ADDED .cvs/.old_cvsroot/checkoutlist Index: .cvs/.old_cvsroot/checkoutlist ================================================================== --- .cvs/.old_cvsroot/checkoutlist +++ .cvs/.old_cvsroot/checkoutlist @@ -0,0 +1,14 @@ +# The "checkoutlist" file is used to support additional version controlled +# administrative files in $CVSROOT/CVSROOT, such as template files. +# +# The first entry on a line is a filename which will be checked out from +# the corresponding RCS file in the $CVSROOT/CVSROOT directory. +# The remainder of the line is an error message to use if the file cannot +# be checked out. +# +# File format: +# +# [] +# +# comment lines begin with '#' +syncmail ADDED .cvs/.old_cvsroot/commitinfo Index: .cvs/.old_cvsroot/commitinfo ================================================================== --- .cvs/.old_cvsroot/commitinfo +++ .cvs/.old_cvsroot/commitinfo @@ -0,0 +1,15 @@ +# The "commitinfo" file is used to control pre-commit checks. +# The filter on the right is invoked with the repository and a list +# of files to check. A non-zero exit of the filter program will +# cause the commit to be aborted. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". ADDED .cvs/.old_cvsroot/config Index: .cvs/.old_cvsroot/config ================================================================== --- .cvs/.old_cvsroot/config +++ .cvs/.old_cvsroot/config @@ -0,0 +1,11 @@ +# Set this to "no" if pserver shouldn't check system users/passwords +#SystemAuth=no + +# Set `PreservePermissions' to `yes' to save file status information +# in the repository. +#PreservePermissions=no + +# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top +# level of the new working directory when using the `cvs checkout' +# command. +#TopLevelAdmin=no ADDED .cvs/.old_cvsroot/cvswrappers Index: .cvs/.old_cvsroot/cvswrappers ================================================================== --- .cvs/.old_cvsroot/cvswrappers +++ .cvs/.old_cvsroot/cvswrappers @@ -0,0 +1,23 @@ +# This file affects handling of files based on their names. +# +# The -t/-f options allow one to treat directories of files +# as a single file, or to transform a file in other ways on +# its way in and out of CVS. +# +# The -m option specifies whether CVS attempts to merge files. +# +# The -k option specifies keyword expansion (e.g. -kb for binary). +# +# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) +# +# wildcard [option value][option value]... +# +# where option is one of +# -f from cvs filter value: path to filter +# -t to cvs filter value: path to filter +# -m update methodology value: MERGE or COPY +# -k expansion mode value: b, o, kkv, &c +# +# and value is a single-quote delimited value. +# For example: +#*.gif -k 'b' ADDED .cvs/.old_cvsroot/editinfo Index: .cvs/.old_cvsroot/editinfo ================================================================== --- .cvs/.old_cvsroot/editinfo +++ .cvs/.old_cvsroot/editinfo @@ -0,0 +1,21 @@ +# The "editinfo" file is used to allow verification of logging +# information. It works best when a template (as specified in the +# rcsinfo file) is provided for the logging procedure. Given a +# template with locations for, a bug-id number, a list of people who +# reviewed the code before it can be checked in, and an external +# process to catalog the differences that were code reviewed, the +# following test can be applied to the code: +# +# Making sure that the entered bug-id number is correct. +# Validating that the code that was reviewed is indeed the code being +# checked in (using the bug-id number or a seperate review +# number to identify this particular code set.). +# +# If any of the above test failed, then the commit would be aborted. +# +# Actions such as mailing a copy of the report to each reviewer are +# better handled by an entry in the loginfo file. +# +# One thing that should be noted is the the ALL keyword is not +# supported. There can be only one entry that matches a given +# repository. ADDED .cvs/.old_cvsroot/loginfo Index: .cvs/.old_cvsroot/loginfo ================================================================== --- .cvs/.old_cvsroot/loginfo +++ .cvs/.old_cvsroot/loginfo @@ -0,0 +1,30 @@ +# The "loginfo" file controls where "cvs commit" log information +# is sent. The first entry on a line is a regular expression which must match +# the directory that the change is being made to, relative to the +# $CVSROOT. If a match is found, then the remainder of the line is a filter +# program that should expect log information on its standard input. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name ALL appears as a regular expression it is always used +# in addition to the first matching regex or DEFAULT. +# +# You may specify a format string as part of the +# filter. The string is composed of a `%' followed +# by a single format character, or followed by a set of format +# characters surrounded by `{' and `}' as separators. The format +# characters are: +# +# s = file name +# V = old version number (pre-checkin) +# v = new version number (post-checkin) +# +# For example: +#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog +# or +#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog + +# Lines to mail changes +CVSROOT $CVSROOT/CVSROOT/syncmail %{sVv} gawthrop@users.sourceforge.net +DEFAULT $CVSROOT/CVSROOT/syncmail %{sVv} mtt-checkins@lists.sourceforge.net ADDED .cvs/.old_cvsroot/modules Index: .cvs/.old_cvsroot/modules ================================================================== --- .cvs/.old_cvsroot/modules +++ .cvs/.old_cvsroot/modules @@ -0,0 +1,26 @@ +# Three different line formats are valid: +# key -a aliases... +# key [options] directory +# key [options] directory files... +# +# Where "options" are composed of: +# -i prog Run "prog" on "cvs commit" from top-level of module. +# -o prog Run "prog" on "cvs checkout" of module. +# -e prog Run "prog" on "cvs export" of module. +# -t prog Run "prog" on "cvs rtag" of module. +# -u prog Run "prog" on "cvs update" of module. +# -d dir Place module in directory "dir" instead of module name. +# -l Top-level directory only -- do not recurse. +# +# NOTE: If you change any of the "Run" options above, you'll have to +# release and re-checkout any working directories of these modules. +# +# And "directory" is a path to a directory relative to $CVSROOT. +# +# The "-a" option specifies an alias. An alias is interpreted as if +# everything on the right of the "-a" had been typed on the command line. +# +# You can encode a module within a module by using the special '&' +# character to interpose another module into the current module. This +# can be useful for creating a module that consists of many directories +# spread out over the entire source repository. ADDED .cvs/.old_cvsroot/notify Index: .cvs/.old_cvsroot/notify ================================================================== --- .cvs/.old_cvsroot/notify +++ .cvs/.old_cvsroot/notify @@ -0,0 +1,12 @@ +# The "notify" file controls where notifications from watches set by +# "cvs watch add" or "cvs edit" are sent. The first entry on a line is +# a regular expression which is tested against the directory that the +# change is being made to, relative to the $CVSROOT. If it matches, +# then the remainder of the line is a filter program that should contain +# one occurrence of %s for the user to notify, and information on its +# standard input. +# +# "ALL" or "DEFAULT" can be used in place of the regular expression. +# +# For example: +#ALL mail %s -s "CVS notification" ADDED .cvs/.old_cvsroot/rcsinfo Index: .cvs/.old_cvsroot/rcsinfo ================================================================== --- .cvs/.old_cvsroot/rcsinfo +++ .cvs/.old_cvsroot/rcsinfo @@ -0,0 +1,13 @@ +# The "rcsinfo" file is used to control templates with which the editor +# is invoked on commit and import. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being made to, relative to the +# $CVSROOT. For the first match that is found, then the remainder of the +# line is the name of the file that contains the template. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". ADDED .cvs/.old_cvsroot/syncmail Index: .cvs/.old_cvsroot/syncmail ================================================================== --- .cvs/.old_cvsroot/syncmail +++ .cvs/.old_cvsroot/syncmail @@ -0,0 +1,459 @@ +#! /usr/bin/python + +# Copyright (c) 2002, 2003, Barry Warsaw, Fred Drake, and contributors +# All rights reserved. +# See the accompanying LICENSE file for details. + +# Compatibility: Python 2.2.3, tied to the version of Python on SourceForge's +# authenticated CVS server. + +"""Complicated notification for CVS checkins. + +This script is used to provide email notifications of changes to the CVS +repository. These email changes will include context diffs of the changes. +Really big diffs will be trimmed. + +This script is run from a CVS loginfo file (see $CVSROOT/CVSROOT/loginfo). To +set this up, create a loginfo entry that looks something like this: + + mymodule /path/to/this/script %%s some-email-addr@your.domain + +In this example, whenever a checkin that matches `mymodule' is made, this +script is invoked, which will generate the diff containing email, and send it +to some-email-addr@your.domain. + + Note: This module used to also do repository synchronizations via + rsync-over-ssh, but since the repository has been moved to SourceForge, + this is no longer necessary. The syncing functionality has been ripped + out in the 3.0, which simplifies it considerably. Access the 2.x versions + to refer to this functionality. Because of this, the script is misnamed. + +It no longer makes sense to run this script from the command line. Doing so +will only print out this usage information. + +Usage: + + %(PROGRAM)s [options] <%%S> email-addr [email-addr ...] + +Where options are: + + --cvsroot= + Use as the environment variable CVSROOT. Otherwise this + variable must exist in the environment. + + --context=# + -C # + Include # lines of context around lines that differ (default: 2). + + -c + Produce a context diff (default). + + -m hostname + --mailhost hostname + The hostname of an available SMTP server. The default is + 'localhost'. + + -u + Produce a unified diff (smaller). + + -S TEXT + --subject-prefix=TEXT + Prepend TEXT to the email subject line. + + -R ADDR + --reply-to=ADDR + Add a "Reply-To: ADDR" header to the email message. + + --quiet / -q + Don't print as much status to stdout. + + --fromhost=hostname + -f hostname + The hostname that email messages appear to be coming from. The From: + header of the outgoing message will look like user@hostname. By + default, hostname is the machine's fully qualified domain name. + + --help / -h + Print this text. + +The rest of the command line arguments are: + + <%%S> + CVS %%s loginfo expansion. When invoked by CVS, this will be a single + string containing the directory the checkin is being made in, relative + to $CVSROOT, followed by the list of files that are changing. If the + %%s in the loginfo file is %%{sVv}, context diffs for each of the + modified files are included in any email messages that are generated. + + email-addrs + At least one email address. +""" +__version__ = '1.2' + +import os +import sys +import re +import time +import string +import getopt +import smtplib +import pwd +import socket + +try: + from socket import getfqdn +except ImportError: + def getfqdn(): + # Python 1.5.2 :( + hostname = socket.gethostname() + byaddr = socket.gethostbyaddr(socket.gethostbyname(hostname)) + aliases = byaddr[1] + aliases.insert(0, byaddr[0]) + aliases.insert(0, hostname) + for fqdn in aliases: + if '.' in fqdn: + break + else: + fqdn = 'localhost.localdomain' + return fqdn + + +from cStringIO import StringIO + +# Which SMTP server to do we connect to? +MAILHOST = 'localhost' +MAILPORT = 25 + +# Diff trimming stuff +DIFF_HEAD_LINES = 20 +DIFF_TAIL_LINES = 20 +DIFF_TRUNCATE_IF_LARGER = 1000 + +COMMASPACE = ', ' + +PROGRAM = sys.argv[0] + +BINARY_EXPLANATION_LINES = [ + "(This appears to be a binary file; contents omitted.)\n" + ] + +NOVERSION = "Couldn't generate diff; no version number found for file: %s" +BACKSLASH = "Couldn't generate diff: backslash in filespec's filename: %s" + + + +def usage(code, msg=''): + print __doc__ % globals() + if msg: + print msg + sys.exit(code) + + + +def calculate_diff(entry, contextlines): + file = entry.name + oldrev = entry.revision + newrev = entry.new_revision + + # Make sure we can find a CVS version number + if oldrev is None and newrev is None: + return NOVERSION % file + + if string.find(file, "'") <> -1: + # Those crazy users put single-quotes in their file names! Now we + # have to escape everything that is meaningful inside double-quotes. + filestr = string.replace(file, '\\', '\\\\') + filestr = string.replace(filestr, '`', '\`') + filestr = string.replace(filestr, '"', '\"') + filestr = string.replace(filestr, '$', '\$') + # and quote it with double-quotes. + filestr = '"' + filestr + '"' + else: + # quote it with single-quotes. + filestr = "'" + file + "'" + if oldrev is None: + # File is being added. + try: + if os.path.exists(file): + fp = open(file) + else: + update_cmd = "cvs -fn update -r %s -p %s" % (newrev, filestr) + fp = os.popen(update_cmd) + lines = fp.readlines() + fp.close() + # Is this a binary file? Let's look at the first few + # lines to figure it out: + for line in lines[:5]: + for c in string.rstrip(line): + if c in string.whitespace: + continue + if c < ' ' or c > chr(127): + lines = BINARY_EXPLANATION_LINES[:] + break + lines.insert(0, '--- NEW FILE: %s ---\n' % file) + except IOError, e: + lines = ['***** Error reading new file: ', + str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] + elif newrev is None: + lines = ['--- %s DELETED ---\n' % file] + else: + # File has been changed. + # This /has/ to happen in the background, otherwise we'll run into CVS + # lock contention. What a crock. + if contextlines > 0: + difftype = "-C " + str(contextlines) + else: + difftype = "-u" + diffcmd = "/usr/bin/cvs -f diff -kk %s --minimal -r %s -r %s %s" \ + % (difftype, oldrev, newrev, filestr) + fp = os.popen(diffcmd) + lines = fp.readlines() + # ignore the error code, it always seems to be 1 :( + fp.close() + if len(lines) > DIFF_TRUNCATE_IF_LARGER: + removedlines = len(lines) - DIFF_HEAD_LINES - DIFF_TAIL_LINES + del lines[DIFF_HEAD_LINES:-DIFF_TAIL_LINES] + lines.insert(DIFF_HEAD_LINES, + '[...%d lines suppressed...]\n' % removedlines) + return string.join(lines, '') + + + +rfc822_specials_re = re.compile(r'[\(\)\<\>\@\,\;\:\\\"\.\[\]]') + +def quotename(name): + if name and rfc822_specials_re.search(name): + return '"%s"' % string.replace(name, '"', '\\"') + else: + return name + + + +def blast_mail(subject, people, entries, contextlines, fromhost, replyto): + # cannot wait for child process or that will cause parent to retain cvs + # lock for too long. Urg! + if not os.fork(): + # in the child + # give up the lock you cvs thang! + time.sleep(2) + # Create the smtp connection to the localhost + conn = smtplib.SMTP() + conn.connect(MAILHOST, MAILPORT) + user = pwd.getpwuid(os.getuid())[0] + name = string.split(pwd.getpwuid(os.getuid())[4], ',')[0] + domain = fromhost or getfqdn() + address = '%s@%s' % (user, domain) + s = StringIO() + sys.stdout = s + datestamp = time.strftime('%a, %d %b %Y %H:%M:%S +0000', + time.gmtime(time.time())) + try: + vars = {'address' : address, + 'name' : quotename(name), + 'people' : string.join(people, COMMASPACE), + 'subject' : subject, + 'version' : __version__, + 'date' : datestamp, + } + print '''\ +From: %(name)s <%(address)s> +To: %(people)s''' % vars + if replyto: + print 'Reply-To: %s' % replyto + print '''\ +Subject: %(subject)s +Date: %(date)s +X-Mailer: Python syncmail %(version)s +''' % vars + s.write(sys.stdin.read()) + # append the diffs if available + print + for entry in entries: + print calculate_diff(entry, contextlines) + finally: + sys.stdout = sys.__stdout__ + resp = conn.sendmail(address, people, s.getvalue()) + conn.close() + os._exit(0) + + + +class CVSEntry: + def __init__(self, name, revision, timestamp, conflict, options, tagdate): + self.name = name + self.revision = revision + self.timestamp = timestamp + self.conflict = conflict + self.options = options + self.tagdate = tagdate + +def get_entry(prefix, mapping, line, filename): + line = string.strip(line) + parts = string.split(line, "/") + _, name, revision, timestamp, options, tagdate = parts + key = namekey(prefix, name) + try: + entry = mapping[key] + except KeyError: + if revision == "0": + revision = None + if string.find(timestamp, "+") != -1: + timestamp, conflict = tuple(string.split(timestamp, "+")) + else: + conflict = None + entry = CVSEntry(key, revision, timestamp, conflict, + options, tagdate) + mapping[key] = entry + return entry + +def namekey(prefix, name): + if prefix: + return os.path.join(prefix, name) + else: + return name + +def load_change_info(prefix=None): + if prefix is not None: + entries_fn = os.path.join(prefix, "CVS", "Entries") + else: + entries_fn = os.path.join("CVS", "Entries") + entries_log_fn = entries_fn + ".Log" + mapping = {} + f = open(entries_fn) + while 1: + line = f.readline() + if not line: + break +## if string.strip(line) == "D": +## continue + # we could recurse down subdirs, except the Entries.Log files + # we need haven't been written to the subdirs yet, so it + # doesn't do us any good +## if line[0] == "D": +## name = string.split(line, "/")[1] +## dirname = namekey(prefix, name) +## if os.path.isdir(dirname): +## m = load_change_info(dirname) +## mapping.update(m) + if line[0] == "/": + # normal file + get_entry(prefix, mapping, line, entries_fn) + # else: bogus Entries line + f.close() + if os.path.isfile(entries_log_fn): + f = open(entries_log_fn) + while 1: + line = f.readline() + if not line: + break + if line[1:2] != ' ': + # really old version of CVS + break + entry = get_entry(prefix, mapping, line[2:], entries_log_fn) + parts = string.split(line, "/")[1:] + if line[0] == "A": + # adding a file + entry.new_revision = parts[1] + elif line[0] == "R": + # removing a file + entry.new_revision = None + f.close() + for entry in mapping.values(): + if not hasattr(entry, "new_revision"): + print 'confused about file', entry.name, '-- ignoring' + del mapping[entry.name] + return mapping + +def load_branch_name(): + tag_fn = os.path.join("CVS", "Tag") + if os.path.isfile(tag_fn): + f = open(tag_fn) + line = string.strip(f.readline()) + f.close() + if line[:1] == "T": + return line[1:] + return None + +# scan args for options +def main(): + # XXX Should really move all the options to an object, just to + # avoid threading so many positional args through everything. + try: + opts, args = getopt.getopt( + sys.argv[1:], 'hC:cuS:R:qf:m:', + ['fromhost=', 'context=', 'cvsroot=', 'mailhost=', + 'subject-prefix=', 'reply-to=', + 'help', 'quiet']) + except getopt.error, msg: + usage(1, msg) + + # parse the options + contextlines = 2 + verbose = 1 + subject_prefix = "" + replyto = None + fromhost = None + for opt, arg in opts: + if opt in ('-h', '--help'): + usage(0) + elif opt == '--cvsroot': + os.environ['CVSROOT'] = arg + elif opt in ('-C', '--context'): + contextlines = int(arg) + elif opt == '-c': + if contextlines <= 0: + contextlines = 2 + elif opt == '-u': + contextlines = 0 + elif opt in ('-S', '--subject-prefix'): + subject_prefix = arg + elif opt in ('-R', '--reply-to'): + replyto = arg + elif opt in ('-q', '--quiet'): + verbose = 0 + elif opt in ('-f', '--fromhost'): + fromhost = arg + elif opt in ('-m', '--mailhost'): + global MAILHOST + MAILHOST = arg + + # What follows is the specification containing the files that were + # modified. The argument actually must be split, with the first component + # containing the directory the checkin is being made in, relative to + # $CVSROOT, followed by the list of files that are changing. + if not args: + usage(1, 'No CVS module specified') + changes = load_change_info() + branch = load_branch_name() + subject = subject_prefix + args[0] + specs = string.split(args[0]) + del args[0] + + # The remaining args should be the email addresses + if not args: + usage(1, 'No recipients specified') + + # Now do the mail command + people = args + + if specs[-3:] == ['-', 'Imported', 'sources']: + print 'Not sending email for imported sources.' + return + + if verbose: +## print 'Python version', sys.version +## os.system("type python1.6; type python2;" +## " type python2.0; type python2.1; type python2.2;" +## " type rcsdiff; type rlog") + print 'Mailing %s...' % string.join(people, COMMASPACE) + print 'Generating notification message...' + blast_mail(subject, people, changes.values(), + contextlines, fromhost, replyto) + if verbose: + print 'Generating notification message... done.' + + + +if __name__ == '__main__': + main() + sys.exit(0) ADDED .cvs/.old_cvsroot/taginfo Index: .cvs/.old_cvsroot/taginfo ================================================================== --- .cvs/.old_cvsroot/taginfo +++ .cvs/.old_cvsroot/taginfo @@ -0,0 +1,20 @@ +# The "taginfo" file is used to control pre-tag checks. +# The filter on the right is invoked with the following arguments: +# +# $1 -- tagname +# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d +# $3 -- repository +# $4-> file revision [file revision ...] +# +# A non-zero exit of the filter program will cause the tag to be aborted. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". ADDED .cvs/.old_cvsroot/verifymsg Index: .cvs/.old_cvsroot/verifymsg ================================================================== --- .cvs/.old_cvsroot/verifymsg +++ .cvs/.old_cvsroot/verifymsg @@ -0,0 +1,21 @@ +# The "verifymsg" file is used to allow verification of logging +# information. It works best when a template (as specified in the +# rcsinfo file) is provided for the logging procedure. Given a +# template with locations for, a bug-id number, a list of people who +# reviewed the code before it can be checked in, and an external +# process to catalog the differences that were code reviewed, the +# following test can be applied to the code: +# +# Making sure that the entered bug-id number is correct. +# Validating that the code that was reviewed is indeed the code being +# checked in (using the bug-id number or a seperate review +# number to identify this particular code set.). +# +# If any of the above test failed, then the commit would be aborted. +# +# Actions such as mailing a copy of the report to each reviewer are +# better handled by an entry in the loginfo file. +# +# One thing that should be noted is the the ALL keyword is not +# supported. There can be only one entry that matches a given +# repository. ADDED .cvs/.old_mttroot_cvsroot/checkoutlist Index: .cvs/.old_mttroot_cvsroot/checkoutlist ================================================================== --- .cvs/.old_mttroot_cvsroot/checkoutlist +++ .cvs/.old_mttroot_cvsroot/checkoutlist @@ -0,0 +1,14 @@ +# The "checkoutlist" file is used to support additional version controlled +# administrative files in $CVSROOT/CVSROOT, such as template files. +# +# The first entry on a line is a filename which will be checked out from +# the corresponding RCS file in the $CVSROOT/CVSROOT directory. +# The remainder of the line is an error message to use if the file cannot +# be checked out. +# +# File format: +# +# [] +# +# comment lines begin with '#' +syncmail ADDED .cvs/.old_mttroot_cvsroot/commitinfo Index: .cvs/.old_mttroot_cvsroot/commitinfo ================================================================== --- .cvs/.old_mttroot_cvsroot/commitinfo +++ .cvs/.old_mttroot_cvsroot/commitinfo @@ -0,0 +1,15 @@ +# The "commitinfo" file is used to control pre-commit checks. +# The filter on the right is invoked with the repository and a list +# of files to check. A non-zero exit of the filter program will +# cause the commit to be aborted. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". ADDED .cvs/.old_mttroot_cvsroot/config Index: .cvs/.old_mttroot_cvsroot/config ================================================================== --- .cvs/.old_mttroot_cvsroot/config +++ .cvs/.old_mttroot_cvsroot/config @@ -0,0 +1,11 @@ +# Set this to "no" if pserver shouldn't check system users/passwords +#SystemAuth=no + +# Set `PreservePermissions' to `yes' to save file status information +# in the repository. +#PreservePermissions=no + +# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top +# level of the new working directory when using the `cvs checkout' +# command. +#TopLevelAdmin=no ADDED .cvs/.old_mttroot_cvsroot/cvswrappers Index: .cvs/.old_mttroot_cvsroot/cvswrappers ================================================================== --- .cvs/.old_mttroot_cvsroot/cvswrappers +++ .cvs/.old_mttroot_cvsroot/cvswrappers @@ -0,0 +1,23 @@ +# This file affects handling of files based on their names. +# +# The -t/-f options allow one to treat directories of files +# as a single file, or to transform a file in other ways on +# its way in and out of CVS. +# +# The -m option specifies whether CVS attempts to merge files. +# +# The -k option specifies keyword expansion (e.g. -kb for binary). +# +# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) +# +# wildcard [option value][option value]... +# +# where option is one of +# -f from cvs filter value: path to filter +# -t to cvs filter value: path to filter +# -m update methodology value: MERGE or COPY +# -k expansion mode value: b, o, kkv, &c +# +# and value is a single-quote delimited value. +# For example: +#*.gif -k 'b' ADDED .cvs/.old_mttroot_cvsroot/editinfo Index: .cvs/.old_mttroot_cvsroot/editinfo ================================================================== --- .cvs/.old_mttroot_cvsroot/editinfo +++ .cvs/.old_mttroot_cvsroot/editinfo @@ -0,0 +1,21 @@ +# The "editinfo" file is used to allow verification of logging +# information. It works best when a template (as specified in the +# rcsinfo file) is provided for the logging procedure. Given a +# template with locations for, a bug-id number, a list of people who +# reviewed the code before it can be checked in, and an external +# process to catalog the differences that were code reviewed, the +# following test can be applied to the code: +# +# Making sure that the entered bug-id number is correct. +# Validating that the code that was reviewed is indeed the code being +# checked in (using the bug-id number or a seperate review +# number to identify this particular code set.). +# +# If any of the above test failed, then the commit would be aborted. +# +# Actions such as mailing a copy of the report to each reviewer are +# better handled by an entry in the loginfo file. +# +# One thing that should be noted is the the ALL keyword is not +# supported. There can be only one entry that matches a given +# repository. ADDED .cvs/.old_mttroot_cvsroot/loginfo Index: .cvs/.old_mttroot_cvsroot/loginfo ================================================================== --- .cvs/.old_mttroot_cvsroot/loginfo +++ .cvs/.old_mttroot_cvsroot/loginfo @@ -0,0 +1,31 @@ +# The "loginfo" file controls where "cvs commit" log information +# is sent. The first entry on a line is a regular expression which must match +# the directory that the change is being made to, relative to the +# $CVSROOT. If a match is found, then the remainder of the line is a filter +# program that should expect log information on its standard input. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name ALL appears as a regular expression it is always used +# in addition to the first matching regex or DEFAULT. +# +# You may specify a format string as part of the +# filter. The string is composed of a `%' followed +# by a single format character, or followed by a set of format +# characters surrounded by `{' and `}' as separators. The format +# characters are: +# +# s = file name +# V = old version number (pre-checkin) +# v = new version number (post-checkin) +# +# For example: +#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog +# or +#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog + +# Lines to mail changes +CVSROOT $CVSROOT/CVSROOT/syncmail %{sVv} mtt@gawthrop.net +DEFAULT $CVSROOT/CVSROOT/syncmail %{sVv} mtt-cvs@lists.sourceforge.net + ADDED .cvs/.old_mttroot_cvsroot/modules Index: .cvs/.old_mttroot_cvsroot/modules ================================================================== --- .cvs/.old_mttroot_cvsroot/modules +++ .cvs/.old_mttroot_cvsroot/modules @@ -0,0 +1,26 @@ +# Three different line formats are valid: +# key -a aliases... +# key [options] directory +# key [options] directory files... +# +# Where "options" are composed of: +# -i prog Run "prog" on "cvs commit" from top-level of module. +# -o prog Run "prog" on "cvs checkout" of module. +# -e prog Run "prog" on "cvs export" of module. +# -t prog Run "prog" on "cvs rtag" of module. +# -u prog Run "prog" on "cvs update" of module. +# -d dir Place module in directory "dir" instead of module name. +# -l Top-level directory only -- do not recurse. +# +# NOTE: If you change any of the "Run" options above, you'll have to +# release and re-checkout any working directories of these modules. +# +# And "directory" is a path to a directory relative to $CVSROOT. +# +# The "-a" option specifies an alias. An alias is interpreted as if +# everything on the right of the "-a" had been typed on the command line. +# +# You can encode a module within a module by using the special '&' +# character to interpose another module into the current module. This +# can be useful for creating a module that consists of many directories +# spread out over the entire source repository. ADDED .cvs/.old_mttroot_cvsroot/notify Index: .cvs/.old_mttroot_cvsroot/notify ================================================================== --- .cvs/.old_mttroot_cvsroot/notify +++ .cvs/.old_mttroot_cvsroot/notify @@ -0,0 +1,12 @@ +# The "notify" file controls where notifications from watches set by +# "cvs watch add" or "cvs edit" are sent. The first entry on a line is +# a regular expression which is tested against the directory that the +# change is being made to, relative to the $CVSROOT. If it matches, +# then the remainder of the line is a filter program that should contain +# one occurrence of %s for the user to notify, and information on its +# standard input. +# +# "ALL" or "DEFAULT" can be used in place of the regular expression. +# +# For example: +#ALL mail %s -s "CVS notification" ADDED .cvs/.old_mttroot_cvsroot/rcsinfo Index: .cvs/.old_mttroot_cvsroot/rcsinfo ================================================================== --- .cvs/.old_mttroot_cvsroot/rcsinfo +++ .cvs/.old_mttroot_cvsroot/rcsinfo @@ -0,0 +1,13 @@ +# The "rcsinfo" file is used to control templates with which the editor +# is invoked on commit and import. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being made to, relative to the +# $CVSROOT. For the first match that is found, then the remainder of the +# line is the name of the file that contains the template. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". ADDED .cvs/.old_mttroot_cvsroot/syncmail Index: .cvs/.old_mttroot_cvsroot/syncmail ================================================================== --- .cvs/.old_mttroot_cvsroot/syncmail +++ .cvs/.old_mttroot_cvsroot/syncmail @@ -0,0 +1,459 @@ +#! /usr/bin/python + +# Copyright (c) 2002, 2003, Barry Warsaw, Fred Drake, and contributors +# All rights reserved. +# See the accompanying LICENSE file for details. + +# Compatibility: Python 2.2.3, tied to the version of Python on SourceForge's +# authenticated CVS server. + +"""Complicated notification for CVS checkins. + +This script is used to provide email notifications of changes to the CVS +repository. These email changes will include context diffs of the changes. +Really big diffs will be trimmed. + +This script is run from a CVS loginfo file (see $CVSROOT/CVSROOT/loginfo). To +set this up, create a loginfo entry that looks something like this: + + mymodule /path/to/this/script %%s some-email-addr@your.domain + +In this example, whenever a checkin that matches `mymodule' is made, this +script is invoked, which will generate the diff containing email, and send it +to some-email-addr@your.domain. + + Note: This module used to also do repository synchronizations via + rsync-over-ssh, but since the repository has been moved to SourceForge, + this is no longer necessary. The syncing functionality has been ripped + out in the 3.0, which simplifies it considerably. Access the 2.x versions + to refer to this functionality. Because of this, the script is misnamed. + +It no longer makes sense to run this script from the command line. Doing so +will only print out this usage information. + +Usage: + + %(PROGRAM)s [options] <%%S> email-addr [email-addr ...] + +Where options are: + + --cvsroot= + Use as the environment variable CVSROOT. Otherwise this + variable must exist in the environment. + + --context=# + -C # + Include # lines of context around lines that differ (default: 2). + + -c + Produce a context diff (default). + + -m hostname + --mailhost hostname + The hostname of an available SMTP server. The default is + 'localhost'. + + -u + Produce a unified diff (smaller). + + -S TEXT + --subject-prefix=TEXT + Prepend TEXT to the email subject line. + + -R ADDR + --reply-to=ADDR + Add a "Reply-To: ADDR" header to the email message. + + --quiet / -q + Don't print as much status to stdout. + + --fromhost=hostname + -f hostname + The hostname that email messages appear to be coming from. The From: + header of the outgoing message will look like user@hostname. By + default, hostname is the machine's fully qualified domain name. + + --help / -h + Print this text. + +The rest of the command line arguments are: + + <%%S> + CVS %%s loginfo expansion. When invoked by CVS, this will be a single + string containing the directory the checkin is being made in, relative + to $CVSROOT, followed by the list of files that are changing. If the + %%s in the loginfo file is %%{sVv}, context diffs for each of the + modified files are included in any email messages that are generated. + + email-addrs + At least one email address. +""" +__version__ = '1.2' + +import os +import sys +import re +import time +import string +import getopt +import smtplib +import pwd +import socket + +try: + from socket import getfqdn +except ImportError: + def getfqdn(): + # Python 1.5.2 :( + hostname = socket.gethostname() + byaddr = socket.gethostbyaddr(socket.gethostbyname(hostname)) + aliases = byaddr[1] + aliases.insert(0, byaddr[0]) + aliases.insert(0, hostname) + for fqdn in aliases: + if '.' in fqdn: + break + else: + fqdn = 'localhost.localdomain' + return fqdn + + +from cStringIO import StringIO + +# Which SMTP server to do we connect to? +MAILHOST = 'localhost' +MAILPORT = 25 + +# Diff trimming stuff +DIFF_HEAD_LINES = 20 +DIFF_TAIL_LINES = 20 +DIFF_TRUNCATE_IF_LARGER = 1000 + +COMMASPACE = ', ' + +PROGRAM = sys.argv[0] + +BINARY_EXPLANATION_LINES = [ + "(This appears to be a binary file; contents omitted.)\n" + ] + +NOVERSION = "Couldn't generate diff; no version number found for file: %s" +BACKSLASH = "Couldn't generate diff: backslash in filespec's filename: %s" + + + +def usage(code, msg=''): + print __doc__ % globals() + if msg: + print msg + sys.exit(code) + + + +def calculate_diff(entry, contextlines): + file = entry.name + oldrev = entry.revision + newrev = entry.new_revision + + # Make sure we can find a CVS version number + if oldrev is None and newrev is None: + return NOVERSION % file + + if string.find(file, "'") <> -1: + # Those crazy users put single-quotes in their file names! Now we + # have to escape everything that is meaningful inside double-quotes. + filestr = string.replace(file, '\\', '\\\\') + filestr = string.replace(filestr, '`', '\`') + filestr = string.replace(filestr, '"', '\"') + filestr = string.replace(filestr, '$', '\$') + # and quote it with double-quotes. + filestr = '"' + filestr + '"' + else: + # quote it with single-quotes. + filestr = "'" + file + "'" + if oldrev is None: + # File is being added. + try: + if os.path.exists(file): + fp = open(file) + else: + update_cmd = "cvs -fn update -r %s -p %s" % (newrev, filestr) + fp = os.popen(update_cmd) + lines = fp.readlines() + fp.close() + # Is this a binary file? Let's look at the first few + # lines to figure it out: + for line in lines[:5]: + for c in string.rstrip(line): + if c in string.whitespace: + continue + if c < ' ' or c > chr(127): + lines = BINARY_EXPLANATION_LINES[:] + break + lines.insert(0, '--- NEW FILE: %s ---\n' % file) + except IOError, e: + lines = ['***** Error reading new file: ', + str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] + elif newrev is None: + lines = ['--- %s DELETED ---\n' % file] + else: + # File has been changed. + # This /has/ to happen in the background, otherwise we'll run into CVS + # lock contention. What a crock. + if contextlines > 0: + difftype = "-C " + str(contextlines) + else: + difftype = "-u" + diffcmd = "/usr/bin/cvs -f diff -kk %s --minimal -r %s -r %s %s" \ + % (difftype, oldrev, newrev, filestr) + fp = os.popen(diffcmd) + lines = fp.readlines() + # ignore the error code, it always seems to be 1 :( + fp.close() + if len(lines) > DIFF_TRUNCATE_IF_LARGER: + removedlines = len(lines) - DIFF_HEAD_LINES - DIFF_TAIL_LINES + del lines[DIFF_HEAD_LINES:-DIFF_TAIL_LINES] + lines.insert(DIFF_HEAD_LINES, + '[...%d lines suppressed...]\n' % removedlines) + return string.join(lines, '') + + + +rfc822_specials_re = re.compile(r'[\(\)\<\>\@\,\;\:\\\"\.\[\]]') + +def quotename(name): + if name and rfc822_specials_re.search(name): + return '"%s"' % string.replace(name, '"', '\\"') + else: + return name + + + +def blast_mail(subject, people, entries, contextlines, fromhost, replyto): + # cannot wait for child process or that will cause parent to retain cvs + # lock for too long. Urg! + if not os.fork(): + # in the child + # give up the lock you cvs thang! + time.sleep(2) + # Create the smtp connection to the localhost + conn = smtplib.SMTP() + conn.connect(MAILHOST, MAILPORT) + user = pwd.getpwuid(os.getuid())[0] + name = string.split(pwd.getpwuid(os.getuid())[4], ',')[0] + domain = fromhost or getfqdn() + address = '%s@%s' % (user, domain) + s = StringIO() + sys.stdout = s + datestamp = time.strftime('%a, %d %b %Y %H:%M:%S +0000', + time.gmtime(time.time())) + try: + vars = {'address' : address, + 'name' : quotename(name), + 'people' : string.join(people, COMMASPACE), + 'subject' : subject, + 'version' : __version__, + 'date' : datestamp, + } + print '''\ +From: %(name)s <%(address)s> +To: %(people)s''' % vars + if replyto: + print 'Reply-To: %s' % replyto + print '''\ +Subject: %(subject)s +Date: %(date)s +X-Mailer: Python syncmail %(version)s +''' % vars + s.write(sys.stdin.read()) + # append the diffs if available + print + for entry in entries: + print calculate_diff(entry, contextlines) + finally: + sys.stdout = sys.__stdout__ + resp = conn.sendmail(address, people, s.getvalue()) + conn.close() + os._exit(0) + + + +class CVSEntry: + def __init__(self, name, revision, timestamp, conflict, options, tagdate): + self.name = name + self.revision = revision + self.timestamp = timestamp + self.conflict = conflict + self.options = options + self.tagdate = tagdate + +def get_entry(prefix, mapping, line, filename): + line = string.strip(line) + parts = string.split(line, "/") + _, name, revision, timestamp, options, tagdate = parts + key = namekey(prefix, name) + try: + entry = mapping[key] + except KeyError: + if revision == "0": + revision = None + if string.find(timestamp, "+") != -1: + timestamp, conflict = tuple(string.split(timestamp, "+")) + else: + conflict = None + entry = CVSEntry(key, revision, timestamp, conflict, + options, tagdate) + mapping[key] = entry + return entry + +def namekey(prefix, name): + if prefix: + return os.path.join(prefix, name) + else: + return name + +def load_change_info(prefix=None): + if prefix is not None: + entries_fn = os.path.join(prefix, "CVS", "Entries") + else: + entries_fn = os.path.join("CVS", "Entries") + entries_log_fn = entries_fn + ".Log" + mapping = {} + f = open(entries_fn) + while 1: + line = f.readline() + if not line: + break +## if string.strip(line) == "D": +## continue + # we could recurse down subdirs, except the Entries.Log files + # we need haven't been written to the subdirs yet, so it + # doesn't do us any good +## if line[0] == "D": +## name = string.split(line, "/")[1] +## dirname = namekey(prefix, name) +## if os.path.isdir(dirname): +## m = load_change_info(dirname) +## mapping.update(m) + if line[0] == "/": + # normal file + get_entry(prefix, mapping, line, entries_fn) + # else: bogus Entries line + f.close() + if os.path.isfile(entries_log_fn): + f = open(entries_log_fn) + while 1: + line = f.readline() + if not line: + break + if line[1:2] != ' ': + # really old version of CVS + break + entry = get_entry(prefix, mapping, line[2:], entries_log_fn) + parts = string.split(line, "/")[1:] + if line[0] == "A": + # adding a file + entry.new_revision = parts[1] + elif line[0] == "R": + # removing a file + entry.new_revision = None + f.close() + for entry in mapping.values(): + if not hasattr(entry, "new_revision"): + print 'confused about file', entry.name, '-- ignoring' + del mapping[entry.name] + return mapping + +def load_branch_name(): + tag_fn = os.path.join("CVS", "Tag") + if os.path.isfile(tag_fn): + f = open(tag_fn) + line = string.strip(f.readline()) + f.close() + if line[:1] == "T": + return line[1:] + return None + +# scan args for options +def main(): + # XXX Should really move all the options to an object, just to + # avoid threading so many positional args through everything. + try: + opts, args = getopt.getopt( + sys.argv[1:], 'hC:cuS:R:qf:m:', + ['fromhost=', 'context=', 'cvsroot=', 'mailhost=', + 'subject-prefix=', 'reply-to=', + 'help', 'quiet']) + except getopt.error, msg: + usage(1, msg) + + # parse the options + contextlines = 2 + verbose = 1 + subject_prefix = "" + replyto = None + fromhost = None + for opt, arg in opts: + if opt in ('-h', '--help'): + usage(0) + elif opt == '--cvsroot': + os.environ['CVSROOT'] = arg + elif opt in ('-C', '--context'): + contextlines = int(arg) + elif opt == '-c': + if contextlines <= 0: + contextlines = 2 + elif opt == '-u': + contextlines = 0 + elif opt in ('-S', '--subject-prefix'): + subject_prefix = arg + elif opt in ('-R', '--reply-to'): + replyto = arg + elif opt in ('-q', '--quiet'): + verbose = 0 + elif opt in ('-f', '--fromhost'): + fromhost = arg + elif opt in ('-m', '--mailhost'): + global MAILHOST + MAILHOST = arg + + # What follows is the specification containing the files that were + # modified. The argument actually must be split, with the first component + # containing the directory the checkin is being made in, relative to + # $CVSROOT, followed by the list of files that are changing. + if not args: + usage(1, 'No CVS module specified') + changes = load_change_info() + branch = load_branch_name() + subject = subject_prefix + args[0] + specs = string.split(args[0]) + del args[0] + + # The remaining args should be the email addresses + if not args: + usage(1, 'No recipients specified') + + # Now do the mail command + people = args + + if specs[-3:] == ['-', 'Imported', 'sources']: + print 'Not sending email for imported sources.' + return + + if verbose: +## print 'Python version', sys.version +## os.system("type python1.6; type python2;" +## " type python2.0; type python2.1; type python2.2;" +## " type rcsdiff; type rlog") + print 'Mailing %s...' % string.join(people, COMMASPACE) + print 'Generating notification message...' + blast_mail(subject, people, changes.values(), + contextlines, fromhost, replyto) + if verbose: + print 'Generating notification message... done.' + + + +if __name__ == '__main__': + main() + sys.exit(0) ADDED .cvs/.old_mttroot_cvsroot/taginfo Index: .cvs/.old_mttroot_cvsroot/taginfo ================================================================== --- .cvs/.old_mttroot_cvsroot/taginfo +++ .cvs/.old_mttroot_cvsroot/taginfo @@ -0,0 +1,20 @@ +# The "taginfo" file is used to control pre-tag checks. +# The filter on the right is invoked with the following arguments: +# +# $1 -- tagname +# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d +# $3 -- repository +# $4-> file revision [file revision ...] +# +# A non-zero exit of the filter program will cause the tag to be aborted. +# +# The first entry on a line is a regular expression which is tested +# against the directory that the change is being committed to, relative +# to the $CVSROOT. For the first match that is found, then the remainder +# of the line is the name of the filter to run. +# +# If the repository name does not match any of the regular expressions in this +# file, the "DEFAULT" line is used, if it is specified. +# +# If the name "ALL" appears as a regular expression it is always used +# in addition to the first matching regex or "DEFAULT". ADDED .cvs/.old_mttroot_cvsroot/verifymsg Index: .cvs/.old_mttroot_cvsroot/verifymsg ================================================================== --- .cvs/.old_mttroot_cvsroot/verifymsg +++ .cvs/.old_mttroot_cvsroot/verifymsg @@ -0,0 +1,21 @@ +# The "verifymsg" file is used to allow verification of logging +# information. It works best when a template (as specified in the +# rcsinfo file) is provided for the logging procedure. Given a +# template with locations for, a bug-id number, a list of people who +# reviewed the code before it can be checked in, and an external +# process to catalog the differences that were code reviewed, the +# following test can be applied to the code: +# +# Making sure that the entered bug-id number is correct. +# Validating that the code that was reviewed is indeed the code being +# checked in (using the bug-id number or a seperate review +# number to identify this particular code set.). +# +# If any of the above test failed, then the commit would be aborted. +# +# Actions such as mailing a copy of the report to each reviewer are +# better handled by an entry in the loginfo file. +# +# One thing that should be noted is the the ALL keyword is not +# supported. There can be only one entry that matches a given +# repository. ADDED .deepsource.toml Index: .deepsource.toml ================================================================== --- .deepsource.toml +++ .deepsource.toml @@ -0,0 +1,49 @@ +version = 1 + +[[analyzers]] +name = "test-coverage" +enabled = true + +[[analyzers]] +name = "shell" +enabled = true + +[[analyzers]] +name = "secrets" +enabled = true + +[[transformers]] +name = "autopep8" +enabled = true + +[[transformers]] +name = "isort" +enabled = true + +[[transformers]] +name = "standardrb" +enabled = true + +[[transformers]] +name = "prettier" +enabled = true + +[[transformers]] +name = "black" +enabled = true + +[[transformers]] +name = "gofmt" +enabled = true + +[[transformers]] +name = "yapf" +enabled = true + +[[transformers]] +name = "standardjs" +enabled = true + +[[transformers]] +name = "rubocop" +enabled = true ADDED .gitattributes Index: .gitattributes ================================================================== --- .gitattributes +++ .gitattributes @@ -0,0 +1,30 @@ +# Disable GitHub Linguist +*.m linguist-vendored +*.sh linguist-vendored +*.r linguist-vendored +*.pl linguist-vendored +*.c linguist-vendored +*.cpp linguist-vendored +*.ltx linguist-vendored +*.tex linguist-vendored +*.htm linguist-vendored +*.html linguist-vendored +*.css linguist-vendored +*.csh linguist-vendored +.old_cvsroot/* linguist-vendored +.old_mttroot_cvsroot/* linguist-vendored +gino/* linguist-vendored +mtt/* linguist-vendored +ntt/* linguist-vendored +patches/* linguist-vendored +*.p2crc linguist-vendored +*.diff linguist-vendored +*.hpp linguist-vendored +*.h linguist-vendored +*.make linguist-vendored +Makefile linguist-vendored +*.yml linguist-vendored +*.toml linguist-vendored +.github/* linguist-vendored +./* linguist-vendored +* linguist-vendored ADDED .gitignore Index: .gitignore ================================================================== --- .gitignore +++ .gitignore DELETED CVSROOT/checkoutlist Index: CVSROOT/checkoutlist ================================================================== --- CVSROOT/checkoutlist +++ CVSROOT/checkoutlist @@ -1,14 +0,0 @@ -# The "checkoutlist" file is used to support additional version controlled -# administrative files in $CVSROOT/CVSROOT, such as template files. -# -# The first entry on a line is a filename which will be checked out from -# the corresponding RCS file in the $CVSROOT/CVSROOT directory. -# The remainder of the line is an error message to use if the file cannot -# be checked out. -# -# File format: -# -# [] -# -# comment lines begin with '#' -syncmail DELETED CVSROOT/commitinfo Index: CVSROOT/commitinfo ================================================================== --- CVSROOT/commitinfo +++ CVSROOT/commitinfo @@ -1,15 +0,0 @@ -# The "commitinfo" file is used to control pre-commit checks. -# The filter on the right is invoked with the repository and a list -# of files to check. A non-zero exit of the filter program will -# cause the commit to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". DELETED CVSROOT/config Index: CVSROOT/config ================================================================== --- CVSROOT/config +++ CVSROOT/config @@ -1,11 +0,0 @@ -# Set this to "no" if pserver shouldn't check system users/passwords -#SystemAuth=no - -# Set `PreservePermissions' to `yes' to save file status information -# in the repository. -#PreservePermissions=no - -# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top -# level of the new working directory when using the `cvs checkout' -# command. -#TopLevelAdmin=no DELETED CVSROOT/cvswrappers Index: CVSROOT/cvswrappers ================================================================== --- CVSROOT/cvswrappers +++ CVSROOT/cvswrappers @@ -1,23 +0,0 @@ -# This file affects handling of files based on their names. -# -# The -t/-f options allow one to treat directories of files -# as a single file, or to transform a file in other ways on -# its way in and out of CVS. -# -# The -m option specifies whether CVS attempts to merge files. -# -# The -k option specifies keyword expansion (e.g. -kb for binary). -# -# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) -# -# wildcard [option value][option value]... -# -# where option is one of -# -f from cvs filter value: path to filter -# -t to cvs filter value: path to filter -# -m update methodology value: MERGE or COPY -# -k expansion mode value: b, o, kkv, &c -# -# and value is a single-quote delimited value. -# For example: -#*.gif -k 'b' DELETED CVSROOT/editinfo Index: CVSROOT/editinfo ================================================================== --- CVSROOT/editinfo +++ CVSROOT/editinfo @@ -1,21 +0,0 @@ -# The "editinfo" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. DELETED CVSROOT/loginfo Index: CVSROOT/loginfo ================================================================== --- CVSROOT/loginfo +++ CVSROOT/loginfo @@ -1,30 +0,0 @@ -# The "loginfo" file controls where "cvs commit" log information -# is sent. The first entry on a line is a regular expression which must match -# the directory that the change is being made to, relative to the -# $CVSROOT. If a match is found, then the remainder of the line is a filter -# program that should expect log information on its standard input. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name ALL appears as a regular expression it is always used -# in addition to the first matching regex or DEFAULT. -# -# You may specify a format string as part of the -# filter. The string is composed of a `%' followed -# by a single format character, or followed by a set of format -# characters surrounded by `{' and `}' as separators. The format -# characters are: -# -# s = file name -# V = old version number (pre-checkin) -# v = new version number (post-checkin) -# -# For example: -#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog -# or -#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog - -# Lines to mail changes -CVSROOT $CVSROOT/CVSROOT/syncmail %{sVv} gawthrop@users.sourceforge.net -DEFAULT $CVSROOT/CVSROOT/syncmail %{sVv} mtt-checkins@lists.sourceforge.net DELETED CVSROOT/modules Index: CVSROOT/modules ================================================================== --- CVSROOT/modules +++ CVSROOT/modules @@ -1,26 +0,0 @@ -# Three different line formats are valid: -# key -a aliases... -# key [options] directory -# key [options] directory files... -# -# Where "options" are composed of: -# -i prog Run "prog" on "cvs commit" from top-level of module. -# -o prog Run "prog" on "cvs checkout" of module. -# -e prog Run "prog" on "cvs export" of module. -# -t prog Run "prog" on "cvs rtag" of module. -# -u prog Run "prog" on "cvs update" of module. -# -d dir Place module in directory "dir" instead of module name. -# -l Top-level directory only -- do not recurse. -# -# NOTE: If you change any of the "Run" options above, you'll have to -# release and re-checkout any working directories of these modules. -# -# And "directory" is a path to a directory relative to $CVSROOT. -# -# The "-a" option specifies an alias. An alias is interpreted as if -# everything on the right of the "-a" had been typed on the command line. -# -# You can encode a module within a module by using the special '&' -# character to interpose another module into the current module. This -# can be useful for creating a module that consists of many directories -# spread out over the entire source repository. DELETED CVSROOT/notify Index: CVSROOT/notify ================================================================== --- CVSROOT/notify +++ CVSROOT/notify @@ -1,12 +0,0 @@ -# The "notify" file controls where notifications from watches set by -# "cvs watch add" or "cvs edit" are sent. The first entry on a line is -# a regular expression which is tested against the directory that the -# change is being made to, relative to the $CVSROOT. If it matches, -# then the remainder of the line is a filter program that should contain -# one occurrence of %s for the user to notify, and information on its -# standard input. -# -# "ALL" or "DEFAULT" can be used in place of the regular expression. -# -# For example: -#ALL mail %s -s "CVS notification" DELETED CVSROOT/rcsinfo Index: CVSROOT/rcsinfo ================================================================== --- CVSROOT/rcsinfo +++ CVSROOT/rcsinfo @@ -1,13 +0,0 @@ -# The "rcsinfo" file is used to control templates with which the editor -# is invoked on commit and import. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being made to, relative to the -# $CVSROOT. For the first match that is found, then the remainder of the -# line is the name of the file that contains the template. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". DELETED CVSROOT/syncmail Index: CVSROOT/syncmail ================================================================== --- CVSROOT/syncmail +++ CVSROOT/syncmail @@ -1,459 +0,0 @@ -#! /usr/bin/python - -# Copyright (c) 2002, 2003, Barry Warsaw, Fred Drake, and contributors -# All rights reserved. -# See the accompanying LICENSE file for details. - -# Compatibility: Python 2.2.3, tied to the version of Python on SourceForge's -# authenticated CVS server. - -"""Complicated notification for CVS checkins. - -This script is used to provide email notifications of changes to the CVS -repository. These email changes will include context diffs of the changes. -Really big diffs will be trimmed. - -This script is run from a CVS loginfo file (see $CVSROOT/CVSROOT/loginfo). To -set this up, create a loginfo entry that looks something like this: - - mymodule /path/to/this/script %%s some-email-addr@your.domain - -In this example, whenever a checkin that matches `mymodule' is made, this -script is invoked, which will generate the diff containing email, and send it -to some-email-addr@your.domain. - - Note: This module used to also do repository synchronizations via - rsync-over-ssh, but since the repository has been moved to SourceForge, - this is no longer necessary. The syncing functionality has been ripped - out in the 3.0, which simplifies it considerably. Access the 2.x versions - to refer to this functionality. Because of this, the script is misnamed. - -It no longer makes sense to run this script from the command line. Doing so -will only print out this usage information. - -Usage: - - %(PROGRAM)s [options] <%%S> email-addr [email-addr ...] - -Where options are: - - --cvsroot= - Use as the environment variable CVSROOT. Otherwise this - variable must exist in the environment. - - --context=# - -C # - Include # lines of context around lines that differ (default: 2). - - -c - Produce a context diff (default). - - -m hostname - --mailhost hostname - The hostname of an available SMTP server. The default is - 'localhost'. - - -u - Produce a unified diff (smaller). - - -S TEXT - --subject-prefix=TEXT - Prepend TEXT to the email subject line. - - -R ADDR - --reply-to=ADDR - Add a "Reply-To: ADDR" header to the email message. - - --quiet / -q - Don't print as much status to stdout. - - --fromhost=hostname - -f hostname - The hostname that email messages appear to be coming from. The From: - header of the outgoing message will look like user@hostname. By - default, hostname is the machine's fully qualified domain name. - - --help / -h - Print this text. - -The rest of the command line arguments are: - - <%%S> - CVS %%s loginfo expansion. When invoked by CVS, this will be a single - string containing the directory the checkin is being made in, relative - to $CVSROOT, followed by the list of files that are changing. If the - %%s in the loginfo file is %%{sVv}, context diffs for each of the - modified files are included in any email messages that are generated. - - email-addrs - At least one email address. -""" -__version__ = '1.2' - -import os -import sys -import re -import time -import string -import getopt -import smtplib -import pwd -import socket - -try: - from socket import getfqdn -except ImportError: - def getfqdn(): - # Python 1.5.2 :( - hostname = socket.gethostname() - byaddr = socket.gethostbyaddr(socket.gethostbyname(hostname)) - aliases = byaddr[1] - aliases.insert(0, byaddr[0]) - aliases.insert(0, hostname) - for fqdn in aliases: - if '.' in fqdn: - break - else: - fqdn = 'localhost.localdomain' - return fqdn - - -from cStringIO import StringIO - -# Which SMTP server to do we connect to? -MAILHOST = 'localhost' -MAILPORT = 25 - -# Diff trimming stuff -DIFF_HEAD_LINES = 20 -DIFF_TAIL_LINES = 20 -DIFF_TRUNCATE_IF_LARGER = 1000 - -COMMASPACE = ', ' - -PROGRAM = sys.argv[0] - -BINARY_EXPLANATION_LINES = [ - "(This appears to be a binary file; contents omitted.)\n" - ] - -NOVERSION = "Couldn't generate diff; no version number found for file: %s" -BACKSLASH = "Couldn't generate diff: backslash in filespec's filename: %s" - - - -def usage(code, msg=''): - print __doc__ % globals() - if msg: - print msg - sys.exit(code) - - - -def calculate_diff(entry, contextlines): - file = entry.name - oldrev = entry.revision - newrev = entry.new_revision - - # Make sure we can find a CVS version number - if oldrev is None and newrev is None: - return NOVERSION % file - - if string.find(file, "'") <> -1: - # Those crazy users put single-quotes in their file names! Now we - # have to escape everything that is meaningful inside double-quotes. - filestr = string.replace(file, '\\', '\\\\') - filestr = string.replace(filestr, '`', '\`') - filestr = string.replace(filestr, '"', '\"') - filestr = string.replace(filestr, '$', '\$') - # and quote it with double-quotes. - filestr = '"' + filestr + '"' - else: - # quote it with single-quotes. - filestr = "'" + file + "'" - if oldrev is None: - # File is being added. - try: - if os.path.exists(file): - fp = open(file) - else: - update_cmd = "cvs -fn update -r %s -p %s" % (newrev, filestr) - fp = os.popen(update_cmd) - lines = fp.readlines() - fp.close() - # Is this a binary file? Let's look at the first few - # lines to figure it out: - for line in lines[:5]: - for c in string.rstrip(line): - if c in string.whitespace: - continue - if c < ' ' or c > chr(127): - lines = BINARY_EXPLANATION_LINES[:] - break - lines.insert(0, '--- NEW FILE: %s ---\n' % file) - except IOError, e: - lines = ['***** Error reading new file: ', - str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] - elif newrev is None: - lines = ['--- %s DELETED ---\n' % file] - else: - # File has been changed. - # This /has/ to happen in the background, otherwise we'll run into CVS - # lock contention. What a crock. - if contextlines > 0: - difftype = "-C " + str(contextlines) - else: - difftype = "-u" - diffcmd = "/usr/bin/cvs -f diff -kk %s --minimal -r %s -r %s %s" \ - % (difftype, oldrev, newrev, filestr) - fp = os.popen(diffcmd) - lines = fp.readlines() - # ignore the error code, it always seems to be 1 :( - fp.close() - if len(lines) > DIFF_TRUNCATE_IF_LARGER: - removedlines = len(lines) - DIFF_HEAD_LINES - DIFF_TAIL_LINES - del lines[DIFF_HEAD_LINES:-DIFF_TAIL_LINES] - lines.insert(DIFF_HEAD_LINES, - '[...%d lines suppressed...]\n' % removedlines) - return string.join(lines, '') - - - -rfc822_specials_re = re.compile(r'[\(\)\<\>\@\,\;\:\\\"\.\[\]]') - -def quotename(name): - if name and rfc822_specials_re.search(name): - return '"%s"' % string.replace(name, '"', '\\"') - else: - return name - - - -def blast_mail(subject, people, entries, contextlines, fromhost, replyto): - # cannot wait for child process or that will cause parent to retain cvs - # lock for too long. Urg! - if not os.fork(): - # in the child - # give up the lock you cvs thang! - time.sleep(2) - # Create the smtp connection to the localhost - conn = smtplib.SMTP() - conn.connect(MAILHOST, MAILPORT) - user = pwd.getpwuid(os.getuid())[0] - name = string.split(pwd.getpwuid(os.getuid())[4], ',')[0] - domain = fromhost or getfqdn() - address = '%s@%s' % (user, domain) - s = StringIO() - sys.stdout = s - datestamp = time.strftime('%a, %d %b %Y %H:%M:%S +0000', - time.gmtime(time.time())) - try: - vars = {'address' : address, - 'name' : quotename(name), - 'people' : string.join(people, COMMASPACE), - 'subject' : subject, - 'version' : __version__, - 'date' : datestamp, - } - print '''\ -From: %(name)s <%(address)s> -To: %(people)s''' % vars - if replyto: - print 'Reply-To: %s' % replyto - print '''\ -Subject: %(subject)s -Date: %(date)s -X-Mailer: Python syncmail %(version)s -''' % vars - s.write(sys.stdin.read()) - # append the diffs if available - print - for entry in entries: - print calculate_diff(entry, contextlines) - finally: - sys.stdout = sys.__stdout__ - resp = conn.sendmail(address, people, s.getvalue()) - conn.close() - os._exit(0) - - - -class CVSEntry: - def __init__(self, name, revision, timestamp, conflict, options, tagdate): - self.name = name - self.revision = revision - self.timestamp = timestamp - self.conflict = conflict - self.options = options - self.tagdate = tagdate - -def get_entry(prefix, mapping, line, filename): - line = string.strip(line) - parts = string.split(line, "/") - _, name, revision, timestamp, options, tagdate = parts - key = namekey(prefix, name) - try: - entry = mapping[key] - except KeyError: - if revision == "0": - revision = None - if string.find(timestamp, "+") != -1: - timestamp, conflict = tuple(string.split(timestamp, "+")) - else: - conflict = None - entry = CVSEntry(key, revision, timestamp, conflict, - options, tagdate) - mapping[key] = entry - return entry - -def namekey(prefix, name): - if prefix: - return os.path.join(prefix, name) - else: - return name - -def load_change_info(prefix=None): - if prefix is not None: - entries_fn = os.path.join(prefix, "CVS", "Entries") - else: - entries_fn = os.path.join("CVS", "Entries") - entries_log_fn = entries_fn + ".Log" - mapping = {} - f = open(entries_fn) - while 1: - line = f.readline() - if not line: - break -## if string.strip(line) == "D": -## continue - # we could recurse down subdirs, except the Entries.Log files - # we need haven't been written to the subdirs yet, so it - # doesn't do us any good -## if line[0] == "D": -## name = string.split(line, "/")[1] -## dirname = namekey(prefix, name) -## if os.path.isdir(dirname): -## m = load_change_info(dirname) -## mapping.update(m) - if line[0] == "/": - # normal file - get_entry(prefix, mapping, line, entries_fn) - # else: bogus Entries line - f.close() - if os.path.isfile(entries_log_fn): - f = open(entries_log_fn) - while 1: - line = f.readline() - if not line: - break - if line[1:2] != ' ': - # really old version of CVS - break - entry = get_entry(prefix, mapping, line[2:], entries_log_fn) - parts = string.split(line, "/")[1:] - if line[0] == "A": - # adding a file - entry.new_revision = parts[1] - elif line[0] == "R": - # removing a file - entry.new_revision = None - f.close() - for entry in mapping.values(): - if not hasattr(entry, "new_revision"): - print 'confused about file', entry.name, '-- ignoring' - del mapping[entry.name] - return mapping - -def load_branch_name(): - tag_fn = os.path.join("CVS", "Tag") - if os.path.isfile(tag_fn): - f = open(tag_fn) - line = string.strip(f.readline()) - f.close() - if line[:1] == "T": - return line[1:] - return None - -# scan args for options -def main(): - # XXX Should really move all the options to an object, just to - # avoid threading so many positional args through everything. - try: - opts, args = getopt.getopt( - sys.argv[1:], 'hC:cuS:R:qf:m:', - ['fromhost=', 'context=', 'cvsroot=', 'mailhost=', - 'subject-prefix=', 'reply-to=', - 'help', 'quiet']) - except getopt.error, msg: - usage(1, msg) - - # parse the options - contextlines = 2 - verbose = 1 - subject_prefix = "" - replyto = None - fromhost = None - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - elif opt == '--cvsroot': - os.environ['CVSROOT'] = arg - elif opt in ('-C', '--context'): - contextlines = int(arg) - elif opt == '-c': - if contextlines <= 0: - contextlines = 2 - elif opt == '-u': - contextlines = 0 - elif opt in ('-S', '--subject-prefix'): - subject_prefix = arg - elif opt in ('-R', '--reply-to'): - replyto = arg - elif opt in ('-q', '--quiet'): - verbose = 0 - elif opt in ('-f', '--fromhost'): - fromhost = arg - elif opt in ('-m', '--mailhost'): - global MAILHOST - MAILHOST = arg - - # What follows is the specification containing the files that were - # modified. The argument actually must be split, with the first component - # containing the directory the checkin is being made in, relative to - # $CVSROOT, followed by the list of files that are changing. - if not args: - usage(1, 'No CVS module specified') - changes = load_change_info() - branch = load_branch_name() - subject = subject_prefix + args[0] - specs = string.split(args[0]) - del args[0] - - # The remaining args should be the email addresses - if not args: - usage(1, 'No recipients specified') - - # Now do the mail command - people = args - - if specs[-3:] == ['-', 'Imported', 'sources']: - print 'Not sending email for imported sources.' - return - - if verbose: -## print 'Python version', sys.version -## os.system("type python1.6; type python2;" -## " type python2.0; type python2.1; type python2.2;" -## " type rcsdiff; type rlog") - print 'Mailing %s...' % string.join(people, COMMASPACE) - print 'Generating notification message...' - blast_mail(subject, people, changes.values(), - contextlines, fromhost, replyto) - if verbose: - print 'Generating notification message... done.' - - - -if __name__ == '__main__': - main() - sys.exit(0) DELETED CVSROOT/taginfo Index: CVSROOT/taginfo ================================================================== --- CVSROOT/taginfo +++ CVSROOT/taginfo @@ -1,20 +0,0 @@ -# The "taginfo" file is used to control pre-tag checks. -# The filter on the right is invoked with the following arguments: -# -# $1 -- tagname -# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d -# $3 -- repository -# $4-> file revision [file revision ...] -# -# A non-zero exit of the filter program will cause the tag to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". DELETED CVSROOT/verifymsg Index: CVSROOT/verifymsg ================================================================== --- CVSROOT/verifymsg +++ CVSROOT/verifymsg @@ -1,21 +0,0 @@ -# The "verifymsg" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. ADDED LICENSE.md Index: LICENSE.md ================================================================== --- LICENSE.md +++ LICENSE.md @@ -0,0 +1,256 @@ +# The GNU General Public License, Version 2, June 1991 (GPLv2) + +> Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, +> Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +## Preamble + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public License is intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. This General Public License applies to most +of the Free Software Foundation's software and to any other program whose +authors commit to using it. (Some other Free Software Foundation software is +covered by the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom to +distribute copies of free software (and charge for this service if you wish), +that you receive source code or can get it if you want it, that you can change +the software or use pieces of it in new free programs; and that you know you can +do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny +you these rights or to ask you to surrender the rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a +fee, you must give the recipients all the rights that you have. You must make +sure that they, too, receive or can get the source code. And you must show them +these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer +you this license which gives you legal permission to copy, distribute and/or +modify the software. + +Also, for each author's protection and ours, we want to make certain that +everyone understands that there is no warranty for this free software. If the +software is modified by someone else and passed on, we want its recipients to +know that what they have is not the original, so that any problems introduced by +others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish +to avoid the danger that redistributors of a free program will individually +obtain patent licenses, in effect making the program proprietary. To prevent +this, we have made it clear that any patent must be licensed for everyone's free +use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification +follow. + +## Terms And Conditions For Copying, Distribution And Modification + +**0.** This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms of +this General Public License. The "Program", below, refers to any such program or +work, and a "work based on the Program" means either the Program or any +derivative work under copyright law: that is to say, a work containing the +Program or a portion of it, either verbatim or with modifications and/or +translated into another language. (Hereinafter, translation is included without +limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by +this License; they are outside its scope. The act of running the Program is not +restricted, and the output from the Program is covered only if its contents +constitute a work based on the Program (independent of having been made by +running the Program). Whether that is true depends on what the Program does. + +**1.** You may copy and distribute verbatim copies of the Program's source code +as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this License +and to the absence of any warranty; and give any other recipients of the Program +a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at +your option offer warranty protection in exchange for a fee. + +**2.** You may modify your copy or copies of the Program or any portion of it, +thus forming a work based on the Program, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that you also +meet all of these conditions: + +- **a)** You must cause the modified files to carry prominent notices stating + that you changed the files and the date of any change. + +- **b)** You must cause any work that you distribute or publish, that in whole + or in part contains or is derived from the Program or any part thereof, to be + licensed as a whole at no charge to all third parties under the terms of this + License. + +- **c)** If the modified program normally reads commands interactively when run, + you must cause it, when started running for such interactive use in the most + ordinary way, to print or display an announcement including an appropriate + copyright notice and a notice that there is no warranty (or else, saying that + you provide a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this License. + (Exception: if the Program itself is interactive but does not normally print + such an announcement, your work based on the Program is not required to print + an announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be reasonably +considered independent and separate works in themselves, then this License, and +its terms, do not apply to those sections when you distribute them as separate +works. But when you distribute the same sections as part of a whole which is a +work based on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the entire whole, +and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise the +right to control the distribution of derivative or collective works based on the +Program. + +In addition, mere aggregation of another work not based on the Program with the +Program (or with a work based on the Program) on a volume of a storage or +distribution medium does not bring the other work under the scope of this +License. + +**3.** You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections 1 and 2 +above provided that you also do one of the following: + +- **a)** Accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + +- **b)** Accompany it with a written offer, valid for at least three years, to + give any third party, for a charge no more than your cost of physically + performing source distribution, a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of Sections 1 and + 2 above on a medium customarily used for software interchange; or, + +- **c)** Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed only for + noncommercial distribution and only if you received the program in object code + or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making +modifications to it. For an executable work, complete source code means all the +source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and installation +of the executable. However, as a special exception, the source code distributed +need not include anything that is normally distributed (in either source or +binary form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component itself +accompanies the executable. + +If distribution of executable or object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the source code +from the same place counts as distribution of the source code, even though third +parties are not compelled to copy the source along with the object code. + +**4.** You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, modify, +sublicense or distribute the Program is void, and will automatically terminate +your rights under this License. However, parties who have received copies, or +rights, from you under this License will not have their licenses terminated so +long as such parties remain in full compliance. + +**5.** You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute the +Program or its derivative works. These actions are prohibited by law if you do +not accept this License. Therefore, by modifying or distributing the Program (or +any work based on the Program), you indicate your acceptance of this License to +do so, and all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +**6.** Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these terms and +conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties to this License. + +**7.** If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), conditions +are imposed on you (whether by court order, agreement or otherwise) that +contradict the conditions of this License, they do not excuse you from the +conditions of this License. If you cannot distribute so as to satisfy +simultaneously your obligations under this License and any other pertinent +obligations, then as a consequence you may not distribute the Program at all. +For example, if a patent license would not permit royalty-free redistribution of +the Program by all those who receive copies directly or indirectly through you, +then the only way you could satisfy both it and this License would be to refrain +entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and the +section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system, which is implemented by public license practices. Many +people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +**8.** If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Program under this License may add an explicit +geographical distribution limitation excluding those countries, so that +distribution is permitted only in or among countries not thus excluded. In such +case, this License incorporates the limitation as if written in the body of this +License. + +**9.** The Free Software Foundation may publish revised and/or new versions of +the General Public License from time to time. Such new versions will be similar +in spirit to the present version, but may differ in detail to address new +problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies +a version number of this License which applies to it and "any later version", +you have the option of following the terms and conditions either of that version +or of any later version published by the Free Software Foundation. If the +Program does not specify a version number of this License, you may choose any +version ever published by the Free Software Foundation. + +**10.** If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software Foundation, +write to the Free Software Foundation; we sometimes make exceptions for this. +Our decision will be guided by the two goals of preserving the free status of +all derivatives of our free software and of promoting the sharing and reuse of +software generally. + +## No Warranty + +**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM +"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR +INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA +BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER +OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ADDED README.md Index: README.md ================================================================== --- README.md +++ README.md @@ -0,0 +1,60 @@ +# MTT + +## Model Transformation Tools + +### Bond-graph based modeling tools + +MTT is a set of tools for modeling dynamic physical systems using the bond-graph +methodology and transforming these models into representations suitable for +analysis, control, and simulation. + +--- + +## Introduction + +- MTT uses and generates `.m` files for [GNU Octave](https://www.octave.org/). +- MTT is mainly built on the [GNU](https://gnu.org/) set of tools. +- MTT uses the algebraic package + [REDUCE](https://reduce-algebra.sourceforge.io/). +- MTT is based on the bond graph language; general bond graph information is + available from + [The Bond Graph Compendium](https://www2.engr.arizona.edu/~cellier/bg.html) + homepage. + +--- + +## Availability + +- [GitHub](https://github.com/reduce-algebra/mtt) _(Primary)_ +- [GitLab Mirror](https://gitlab.com/reduce-algebra/mtt) +- [SourceHut Mirror](https://git.sr.ht/~trn/mtt) +- [NotABug Mirror](https://notabug.org/reduce-algebra/mtt/) +- [Chisel Mirror](https://chiselapp.com/user/reduce-algebra/repository/mtt) +- [Sourceforge](http://mtt.sf.net) _(Archived)_ + - [MTT Developers Mailing List Archive](https://sourceforge.net/p/mtt/mailman/mtt-developers/?limit=250&style=threaded) + - [MTT Help Mailing List Archive](https://sourceforge.net/p/mtt/mailman/mtt-help/?limit=250&style=threaded) + +--- + +## License + +- GNU General Public License, Version 2, June 1991 (GPLv2) + +--- + +## Issue Tracking + +- [GitHub Issues](https://github.com/reduce-algebra/mtt/issues) + +--- + +## Authors + +- [Peter Gawthrop](http://www.gawthrop.net/) + [\](mailto:peter.gawthrop@unimelb.edu.au) +- [Geraint Paul Bevan](https://www.gcu.ac.uk/cebe/staff/geraint%20bevan/) + [\](mailto:Geraint.Bevan@gcu.ac.uk), + [\](mailto:geraint@enchant.me.uk) + [_(https://www.enchant.me.uk)_](https://www.enchant.me.uk/) + +--- ADDED SECURITY.md Index: SECURITY.md ================================================================== --- SECURITY.md +++ SECURITY.md @@ -0,0 +1,14 @@ +# Security Information + +## Reporting a Vulnerability + +Please use email to report any any security vulnerabilities: + +- [Peter Gawthrop](http://www.gawthrop.net/) + [\](mailto:peter.gawthrop@unimelb.edu.au) +- [Geraint Paul Bevan](https://www.gcu.ac.uk/cebe/staff/geraint%20bevan/) + [\](mailto:Geraint.Bevan@gcu.ac.uk), + [\](mailto:geraint@enchant.me.uk) + [_(https://www.enchant.me.uk)_](https://www.enchant.me.uk/) +- [Jeffrey H. Johnson](https://prone.ws/) + [\](mailto:trnsz+reduce-algebra-mtt-security@pobox.com) ADDED gino/AUTHORS Index: gino/AUTHORS ================================================================== --- gino/AUTHORS +++ gino/AUTHORS @@ -0,0 +1,1 @@ +Peter J. Gawthrop (peter@gawthrop.net) ADDED gino/COPYING Index: gino/COPYING ================================================================== --- gino/COPYING +++ gino/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. ADDED gino/INSTALL Index: gino/INSTALL ================================================================== --- gino/INSTALL +++ gino/INSTALL @@ -0,0 +1,16 @@ +======================================================================= +Prerequisites + +Octave and ginsh must be installed before installing gino + + +======================================================================= +Simple system installation + +$ tar xzf gino-.tar.gz +$ cd gino- +$ make clean +$ make + +As superuser +# make install ADDED gino/Makefile Index: gino/Makefile ================================================================== --- gino/Makefile +++ gino/Makefile @@ -0,0 +1,15 @@ +## Makefile for gino library + +all: g_funs + +g_funs: + ./create_gino.sh + +clean: + rm -rf g_funs + +install: g_funs + cp -rf ../gino /usr/share/octave/site/m + + + ADDED gino/README Index: gino/README ================================================================== --- gino/README +++ gino/README @@ -0,0 +1,23 @@ +Gino is a symbolic toolbox for octave (www.octave.org) using ginsh - +the shell interface to ginac (www.ginac.de). + +ginsh.m provides a low-level octave interface to ginsh. All of the +ginsh functions are implemented by octave functions of the form +g_fun(arglist). + +All in and out arguments of the toolbox functions are octave strings +containing valid ginsh expressions. Where appropriate, these can be +turned into matlab scalars, matrices and lists using octave's eval +function. Spurious output is avoided by setting +default_eval_print_flag=0. + +This provides a clear division between symbolic expressions (always +contained in strings) and octave expressions. It also allows the +powerful octave string machinery to be used to manipulate symbolic +expressions. + +gino_examples.m contains some introductory examples. + +P.J.Gawthrop. 19th December 2002. + + ADDED gino/create_gino.sh Index: gino/create_gino.sh ================================================================== --- gino/create_gino.sh +++ gino/create_gino.sh @@ -0,0 +1,73 @@ +#! /bin/sh +## Creates gino functions by querying ginsh +# Copyright (C) 2002 by Peter J. Gawthrop + +prefix="g_" # Prefix function names by this +subdir=${prefix}funs # Where the generated functions live +ginsh="/usr/bin/ginsh" # Location of ginsh + +create_fun() { + funname=${prefix}$1 + filename=${funname}.m + + ## Creates an octave function + echo Creating ${subdir}/${filename} + + ## Find usage string + + usage=`echo "?$1" | ginsh | head -1` + + ## The octave function + cat< ${subdir}/${filename} +function res = ${funname} (arg1,arg2,arg3) + + ## usage: res = ${prefix}${usage} + + ## Generated by create_gino.sh on `date` + ## DO NOT EDIT ME + + if nargin<1 + arg1 = ""; + endif + + if nargin<2 + arg2 = ""; + endif + + if nargin<3 + arg3 = ""; + endif + + res = gino("$1", arg1, arg2, arg3); + +endfunction +EOF +} + +create_readme() { + cat > ${subdir}/README <0) # Strip trailing NL + go_out = substr(go_out,1,length(go_out)-1); + endif +endfunction ADDED gino/go_append.m Index: gino/go_append.m ================================================================== --- gino/go_append.m +++ gino/go_append.m @@ -0,0 +1,18 @@ +function new_list = go_append (list,element) + + ## usage: new_list = go_append (list,element) + ## + ## Appends element to list to give new list + ## This is missing from ginsh + ## Copyright (C) 2002 by Peter J. Gawthrop + + new_list = deblank(list); # Remove trailing blanks + new_list = new_list(1:length(new_list)-1); # Zap final } + if (g_nops(list)=="0") + new_list = sprintf("%s%s}", new_list, element); + else + new_list = sprintf("%s,%s}", new_list, element); + endif + + +endfunction ADDED gino/go_diff.m Index: gino/go_diff.m ================================================================== --- gino/go_diff.m +++ gino/go_diff.m @@ -0,0 +1,26 @@ +function [dfdx_l, dfdx_m] = go_diff (f,x) + + ## usage: [dfdx_l dfdx_m] = go_diff (f,x) + ## + ## dfdx_l is a list with ith element df/dx + ## dfdx_m the corresponing matrix (in ginsh form) + ## f may itself be a list + ## The elements of x must be symbols + + N = eval(g_nops(f)); + M = eval(g_nops(x)); + + dfdx = "{}"; + + ## Find derivatives of f for each x_i and append to list + for j = 1:M + dfdx = go_append(dfdx, g_diff(f,g_op(x,int2str(j-1)))); + endfor + + ## Convert to matrix and transpose + dfdx_m = g_transpose(go_lst_to_matrix(dfdx)); + + ## And back to a list + dfdx_l = go_matrix_to_lst(dfdx_m); + +endfunction ADDED gino/go_gmatrix2mmatrix.m Index: gino/go_gmatrix2mmatrix.m ================================================================== --- gino/go_gmatrix2mmatrix.m +++ gino/go_gmatrix2mmatrix.m @@ -0,0 +1,9 @@ +function M_m = go_gmatrix2mmatrix (M-g) + + ## usage: M_m = go_gmatrix2mmatrix (M-g) + ## + ## Converts a ginsh format matrix to a matlab format matrix + + M_m = strrep(M_g,"],[","];["); + +endfunction ADDED gino/go_lin.m Index: gino/go_lin.m ================================================================== --- gino/go_lin.m +++ gino/go_lin.m @@ -0,0 +1,30 @@ +function [A,B,C,D] = go_lin (f,g) + + ## usage: [A,B,C,D] = go_lin (f,g) + ## + ## + + n_x = eval(g_nops(f)); # Number of states + n_y = eval(g_nops(g)); # Number of outputs + + n_u = n_y; + + ## Create symbolic state list + x = "{}"; + for i=1:n_x + x = go_append(x,sprintf("x_%i", i)); + endfor + + + ## Create symbolic input list + u = "{}"; + for i=1:n_u + u = go_append(u,sprintf("u_%i", i)); + endfor + + [A_l,A] = go_diff(f,x); + [B_l,B] = go_diff(f,u); + [C_l,C] = go_diff(g,x); + [D_l,D] = go_diff(g,u); + +endfunction ADDED gino/go_list.m Index: gino/go_list.m ================================================================== --- gino/go_list.m +++ gino/go_list.m @@ -0,0 +1,23 @@ +function list = go_list (exp0,exp1,exp2,exp3,exp4,exp5,exp6,exp7,exp8,exp9) + + ## usage: list = go_list + ## (exp0[,exp1,exp2,exp3,exp4,exp5,exp6,exp7,exp8,exp9]) + ## Creates a list containing the expressions in the argument list + ## + + ## Copyright (C) 2002 by Peter J. Gawthrop + if nargin>10 + error("Only 10 expressions allowed in argument list"); + endif + + N = nargin; + + list=exp0; + for i=1:N-1 + exp = eval(sprintf("exp%i;",i)); + list=sprintf("%s, %s", list, exp); + endfor + + list = sprintf("{%s}", list); + +endfunction ADDED gino/go_lst_to_matrix.m Index: gino/go_lst_to_matrix.m ================================================================== --- gino/go_lst_to_matrix.m +++ gino/go_lst_to_matrix.m @@ -0,0 +1,41 @@ +function M = go_lst_to_matrix (L) + + ## usage: M = go_lst_to_matrix (L) + ## + ## Converts a list to a matrix + ## Assumes list contains equal-length lists as elements + ## Not in ginsh + ## Copyright (C) 2002 by Peter J. Gawthrop + + n = eval(g_nops(L)); + m = eval(g_nops(g_op(L,"0"))); + + M = ""; + for i = 1:n + M = sprintf("%s[",M); + m_i = g_op(L,int2str(i-1)); + if (eval(g_nops(m_i))!=m) + error("All list elements must be lists of same length"); + endif + + for j = 1:m + m_ij = g_op(m_i,int2str(j-1)); + if j>1 + jsep = ", "; + else + jsep = ""; + endif + M = sprintf("%s%s%s", M, jsep, m_ij); + endfor + if i $(CONFDIR)/mtt.conf + @install mtt.sh $(PROGDIR)/mtt + @install xmtt.sh $(PROGDIR)/xmtt + +install-cc: build-cc clean-cc.sh + @install -d $(INSTDIR)/bin/trans + @install cc/parse_m2cc.exe $(INSTDIR)/bin/trans + +install-doc: build-doc clean-doc.sh + @install -d $(DOCDIR) $(INFODIR) + @cd doc ; DOCPATH=$(DOCDIR) INFOPATH=$(INFODIR) make -s install-doc + @cd doc ; install Makefile mtt.info* mtt.pdf mtt.ps.gz $(DOCDIR) + @install doc/mtt.info* $(INFODIR) + +install-xfig: clean-xfig.sh + @install -d $(XFIGDIR) + @cp -a lib/xfig $(XFIGDIR)/MTT_Bond_Graph + +.PHONY: FORCE + +clean.sh: FORCE + @echo '#! /bin/sh' >>clean.sh + @echo '# This file is auto-generated - do not edit' >>clean.sh + @echo 'rm -f $(PROGDIR)/mtt $(PROGDIR)/xmtt' >>clean.sh + @echo 'rm -fr $(INSTDIR)' >>clean.sh + +clean-cc.sh: FORCE + @echo '#! /bin/sh' >>clean-cc.sh + @echo '# This file is auto-generated - do not edit' >>clean-cc.sh + @echo 'rm -f $(INSTDIR)/bin/trans/parse_m2cc.exe' >>clean-cc.sh + +clean-conf.sh: FORCE + @echo '#! /bin/sh' >>clean-conf.sh + @echo '# This file is auto-generated - do not edit' >>clean-conf.sh + @echo 'rm -f $(CONFDIR)/mtt.conf' >>clean-conf.sh + +clean-doc.sh: FORCE + @echo '#! /bin/sh' >>clean-doc.sh + @echo '# This file is auto-generated - do not edit' >>clean-doc.sh + @echo 'rm -fr $(DOCDIR)' >>clean-doc.sh + @echo 'rm -f $(INFODIR)/mtt.info*' >>clean-doc.sh + +clean-xfig.sh: FORCE + @echo '#! /bin/sh' >>clean-xfig.sh + @echo '# This file is auto-generated - do not edit' >>clean-xfig.sh + @echo 'rm -f $(XFIGDIR)/MTT_Bond_Graph' >>clean-xfig.sh + +mtt.sh.tmp: + @echo '#! /bin/sh' > mtt.sh.tmp + @echo '# This file is auto-generated - do not edit' >>mtt.sh.tmp + @echo '' >>mtt.sh.tmp + @echo 'mtt_config_file=$(CONFDIR)/mtt.conf' >>mtt.sh.tmp + @echo 'mtt_program_dir=$(PROGDIR)' >>mtt.sh.tmp + @echo 'mtt_install_dir=$(INSTDIR)' >>mtt.sh.tmp + @echo '' >>mtt.sh.tmp + @echo '# get site-specific settings' >>mtt.sh.tmp + @echo 'if [ -r $${mtt_config_file} ]; then' >>mtt.sh.tmp + @echo ' . $${mtt_config_file} $${mtt_install_dir} >/dev/null' >>mtt.sh.tmp + @echo '' >>mtt.sh.tmp + @echo 'elif [ -r $${mtt_install_dir}/bin/mttrc ]; then' >>mtt.sh.tmp + @echo ' . $${mtt_install_dir}/bin/mttrc $${mtt_install_dir}' >>mtt.sh.tmp + @echo 'fi' >>mtt.sh.tmp + @echo '' >>mtt.sh.tmp + @echo '# get user-specific settings' >>mtt.sh.tmp + @echo 'if [ -r $${HOME}/.mttrc ]; then' >>mtt.sh.tmp + @echo ' . $${HOME}/.mttrc' >>mtt.sh.tmp + @echo 'fi' >>mtt.sh.tmp + @echo '' >>mtt.sh.tmp + @echo '# get directory-specific settings' >>mtt.sh.tmp + @echo 'if [ -r ./.mttrc ]; then' >>mtt.sh.tmp + @echo ' . ./.mttrc' >>mtt.sh.tmp + @echo 'fi' >>mtt.sh.tmp + @echo '' >>mtt.sh.tmp + +mtt.sh: mtt.sh.tmp + @cat mtt.sh.tmp bin/mtt > mtt.sh + +xmtt.sh: mtt.sh.tmp + @cat mtt.sh.tmp bin/xmtt > xmtt.sh ADDED mtt/bin/capitalise_initial Index: mtt/bin/capitalise_initial ================================================================== --- mtt/bin/capitalise_initial +++ mtt/bin/capitalise_initial @@ -0,0 +1,6 @@ +#! /bin/sh + +phrase="$*" +initial=$(echo $phrase | sed 's/\(.\).*/\1/') +Initial=$(echo $initial | tr [a-z] [A-Z]) +echo $phrase | sed s/$initial/$Initial/ ADDED mtt/bin/check_integration Index: mtt/bin/check_integration ================================================================== --- mtt/bin/check_integration +++ mtt/bin/check_integration @@ -0,0 +1,17 @@ +#!/bin/sh + +## Check if obsolete method of specifiying integration method in use. +if [ -f "$1_simpar.txt" ]; then + method_line=`grep -i METHOD $1_simpar.txt` + if [ -n "`echo $method_line | grep -i euler`" ]; then + echo "$1_simpar.txt contains Euler method - please use mtt -i euler in future" + mtt_switches="$mtt_switches -i euler"; + elif [ -n "`echo $method_line | grep -i implicit`" ]; then + echo "$1_simpar.txt contains Implicit method - please use mtt -i implicit in future" + mtt_switches="$mtt_switches -i implicit"; + fi +fi + +echo Invoking mtt $mtt_switches $1 $2 $3 $4 + +mtt $mtt_switches $1 $2 $3 $4 ADDED mtt/bin/mtt Index: mtt/bin/mtt ================================================================== --- mtt/bin/mtt +++ mtt/bin/mtt @@ -0,0 +1,4095 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt +# This is the main shell script for MTT + +# P.J.Gawthrop Oct 1989, Dec 1989, 1990, 1991, Oct 1993, Dec 1993, Jan 1994, Dec 95, Nov 1996. +# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997,1998,1999 +# Copyright (C) 2000 by Peter J. Gawthrop +# Copyright (C) 2001 by Peter J. Gawthrop + + +############################################################### +## Version control history +############################################################### +## $Header$ +## $Log$ +## Revision 1.419 2014/04/18 02:02:08 gawthrop +## Added sum.tex representation -- this was in a very old MTT and +## summerises the structure. +## +## Revision 1.418 2013/07/19 05:40:26 gawthrop +## Added -nas (No alphabetic sort) switch in help options +## +## Revision 1.417 2008/07/22 17:37:01 geraint +## Fixed case of MTT_EXAMPLES +## +## Revision 1.416 2006/09/27 13:03:20 geraint +## Fixed fr.view and enabled commands to directly build ??fr.m +## +## Revision 1.415 2006/02/09 23:58:24 geraint +## rtxi: builds but does not yet work. +## +## Revision 1.414 2005/11/18 17:23:19 geraint +## rtxi. +## +## Revision 1.413 2005/11/16 00:43:15 geraint +## rtxi +## +## Revision 1.412 2005/09/29 13:46:25 gawthrop +## Converts labg.fig -> ps/eps correctly (using fig2ps) +## +## Revision 1.411 2005/03/15 15:03:28 gawthrop +## Now works for Hierarchical systems +## +## Revision 1.410 2005/03/15 13:35:50 gawthrop +## Pretty abg figure in reports. +## +## Revision 1.409 2005/03/15 12:03:17 gawthrop +## New labg.fig rep - pretty LaTeX figures. +## +## Revision 1.408 2005/02/18 16:59:02 gawthrop +## Don't check files when using -s +## +## Revision 1.407 2005/02/17 18:36:38 geraint +## Removed a bash-ism: replaced [[ conditional ]] with [ conditional ] +## +## Revision 1.406 2005/01/06 15:36:06 geraint +## Tidied output of options. +## +## Revision 1.405 2005/01/06 12:47:53 geraint +## Fixed generation of sese.r with -make-sort option. +## +## Revision 1.404 2004/09/10 21:05:15 geraint +## Ensure that the system exists before proceeding. +## This should stop me from copying my home directory to MTT_work. +## +## Revision 1.403 2004/09/07 20:38:44 geraint +## Applies CRs before creating sese.make to avoid Circular dependencies. +## +## Revision 1.402 2004/09/03 08:35:27 geraint +## Copies Perl CRs to an mtt subdirectory (=> mtt:: workspace). +## +## Revision 1.401 2004/09/02 22:04:06 geraint +## Passes ${use_reduce} to mtt_make_sympar so that it can decide +## if to issue warnings about Reduce reserved words +## +## Revision 1.400 2004/08/31 01:29:48 geraint +## CRs are applied to sorted equation files during production. +## +## Revision 1.399 2004/08/29 16:09:49 geraint +## Added option -no-reduce +## +## Code sorting can now be used with Reduce (via sese.r) so that existing CRs +## work with sorted code (using -make-sort or -sort), or without by using +## -no-reduce; this option implies -make-sort. +## +## Revision 1.398 2004/08/29 14:39:23 geraint +## Added rule to create dae from sorted equations (sese) if sorting is requested. +## +## Revision 1.397 2004/08/29 13:17:30 geraint +## Added rules to use sae (sorted algebraic equations) instead +## of ae if sorted equations are being used. +## +## Converted temporary variable names to lowercase in sorted +## sympar.h to match code output from mtt_r2m. +## +## Revision 1.396 2004/08/29 02:59:30 geraint +## Added -make-sort option and rules to generate simulation using sesx and sesy. +## +## Revision 1.395 2004/08/28 23:48:06 geraint +## Removed dependency of ae.r on cse.r if -ae is not specified as an option. +## This prevents an implicit -A and thus removes a dependency on cse +## (and hence Reduce) for sorted systems. +## +## Revision 1.394 2004/08/28 22:14:12 geraint +## Removed -ibg option: now the default method. +## +## Revision 1.393 2004/08/26 16:20:17 geraint +## Creates postscript files of either dia or fig bond graphs. +## +## Revision 1.392 2004/08/26 12:50:12 geraint +## Replaced some implicit rules with explicit tests and patterns. +## Better than having make search through every possible implicit rule. +## +## Revision 1.391 2004/08/26 00:07:06 geraint +## Added rule to create cbg.dia. +## +## Revision 1.390 2004/08/13 09:49:13 geraint +## Only use one level of MTT_work to prevent MTT from repeatedly copying or creating the same files. +## +## Revision 1.389 2004/08/13 01:32:03 geraint +## Use ibg.m by default for both Xfig and Dia models. +## +## Revision 1.388 2004/08/11 08:18:07 geraint +## Ignores diy make files if the file ${rep}_rep.make.ignore exists, thus allowing user-defined makefiles to use the default MTT rules for languages which they do not override. See odes_rep.make and odeso_rep.make for an example of its use. +## +## Revision 1.387 2004/08/11 07:44:18 geraint +## Included cmp.m as a prerequisite for abg.m +## +## Revision 1.386 2004/08/05 00:02:57 geraint +## Uses lbl2cmp_txt2m.pl to generate _cmp.m. +## +## Revision 1.385 2004/08/02 20:25:47 geraint +## abg.m requires lbl.txt to allow units to be checked. +## +## Revision 1.384 2004/08/01 20:13:30 geraint +## ibg2abg transformation does not require lbl.txt (directly) +## +## Revision 1.383 2004/08/01 19:50:07 geraint +## Moved rules for ibg.m and abg.m so that -ibg can be used with dia models. +## Need to create cmp.m files before this combination will work. +## +## Revision 1.382 2003/09/23 20:53:49 geraint +## Updated version number (5.0). +## +## Revision 1.381 2003/08/10 18:56:55 gawthrop +## Explicitly generate eps files +## +## Revision 1.380 2003/08/06 14:44:51 gawthrop +## Don't include -q or -u in long file names via ${__ARGS} +## +## Revision 1.379 2003/08/06 10:33:42 gawthrop +## User now warned not to use -c which is unsupported. +## +## Revision 1.378 2003/08/04 09:15:09 gawthrop +## -ss switch reinstated +## +## Revision 1.377 2003/06/11 15:48:02 gawthrop +## Copies (aliased) subsystems first. +## Include switches in .ps file names. +## +## Revision 1.376 2003/05/09 09:46:35 gawthrop +## Fixed html output of figures +## +## Revision 1.375 2003/05/08 18:42:52 gawthrop +## Generate pdf from ps (using hyperref package for links etc) +## +## Revision 1.374 2003/04/17 20:57:27 geraint +## Added -sort option to allow direct generation of ode2odes.m using sese.m +## instead of ode/csex. +## +## "mtt -sort rc odeso view" works without Reduce installed!!! +## +## Revision 1.373 2003/04/17 20:07:32 geraint +## Added rule to create _sese.m +## +## Revision 1.372 2003/03/24 12:03:36 gawthrop +## Added -I switch to sese transformation +## +## Revision 1.371 2003/03/13 15:47:35 gawthrop +## Added sese rep. +## +## Revision 1.370 2003/02/11 20:04:08 geraint +## Reverted to line-by-line optimisation as default and added caution to +## description of -optg. +## +## Global optimisation has been observed to create assignments using +## uninitialised temporary variables. +## +## Revision 1.369 2003/02/06 20:28:40 geraint +## Added -ibg switch to aid testing during development of ibg2abg.m +## +## Revision 1.368 2002/12/12 17:18:41 geraint +## Fixed [ 647664 ] Namespace clash: LANG +## Prepended MTT_ to SYS, OPTS and LANG environment variables. +## +## Revision 1.367 2002/12/09 00:14:08 geraint +## Hierarchical dia and mixed dia/fig bond graphs now working. +## +## Revision 1.366 2002/12/06 21:56:21 geraint +## Cosmetic change: removed commented-out lines. +## +## Revision 1.365 2002/12/06 12:45:25 gawthrop +## Simplified rule for sub.sh: both fig and dia go via cmp.txt now. +## +## Revision 1.364 2002/12/03 23:28:44 geraint +## Added dependencies for bond graphs built with dia. +## +## Revision 1.363 2002/11/30 13:39:50 gawthrop +## Split abg2lbl_fig2txt into two parts: +## abg2cmp_fig2txt +## cmp2lbl_txt +## and incorporated into mtt +## +## Revision 1.362 2002/09/19 08:12:53 gawthrop +## Merged version after documentation update +## +## Revision 1.361 2002/09/16 08:08:00 geraint +## Merged changes from global-optimisation branch. +## +## Revision 1.360.2.3 2002/09/16 07:59:26 geraint +## Changed default optimisation to global. +## +## Revision 1.360.2.2 2002/09/04 10:44:59 geraint +## Added option to specify number of tmp variables declared (-ntmpvar ). +## +## Revision 1.360.2.1 2002/09/03 23:44:43 geraint +## adding global optimisation (-optg). +## +## Revision 1.360 2002/08/20 15:51:16 gawthrop +## Update to work with ident DIY rep +## +## Revision 1.359 2002/08/07 14:27:14 geraint +## Changes to make "-i dassl" work again. +## +## Revision 1.358 2002/08/07 11:04:40 geraint +## Now updates timestamp on lbl.txt after processing in make. This eliminates the delay where MTT spends a long period of time uselessly recursing through the model on subsequent passes if the label file is older than the bondgraph. +## +## Revision 1.357 2002/06/28 10:13:40 geraint +## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. +## +## Revision 1.356 2002/06/17 13:14:50 geraint +## Fixed some rules to reduce number of implicit rule searches. +## +## Revision 1.355 2002/06/10 23:18:44 geraint +## Adjusted cr.h comment delimiters to be C compliant. +## +## Revision 1.354 2002/06/10 10:43:19 gawthrop +## ode2odes now prerequisite for sim.m and ssim.m +## +## Revision 1.353 2002/05/28 18:08:38 geraint +## Fixed [ 547294 ] CRs are not sought from MTT_CRS. +## +## Revision 1.352 2002/05/24 11:04:10 geraint +## Removed unnecessary message about *.log file not existing when -D option is used. +## +## Revision 1.351 2002/05/23 17:08:20 geraint +## `mtt sys sfun zip` now produces an input block and an interface block for MTT models. +## Models can be embedded within larger Simulink models by the 2 ports. +## The user must edit 2 code blocks in _sfun_interface.c before compiling with mex. +## +## Revision 1.350 2002/05/21 08:45:36 gawthrop +## DIY reps: no longer skips rep if file exists already. +## Avoids problems in rep.txt when options change +## +## Revision 1.349 2002/05/20 10:29:59 gawthrop +## -oct now forces an m target language to be oct +## (if the rep is an the list: "ae input logic numpar simpar state") +## +## Revision 1.348 2002/05/20 08:50:12 geraint +## Cleans _sfun_ae.mexglx. +## +## Revision 1.347 2002/05/20 07:12:05 gawthrop +## Trying to get oct files generated with -oct +## +## Revision 1.346 2002/05/17 11:15:38 gawthrop +## Messages about copying when using -dr now only appear in verbose (-v) mode. +## +## Revision 1.345 2002/05/15 14:22:25 geraint +## Code for Simulink S-function target written direct to sfun.cc instead of +## calling .mexglx files. This eliminates the sfun dependency on Octave +## ColumnVectors. sys_sfun.cc should build directly on a MS Windows machine +## (can't test this yet). +## +## added sfun.zip target to create source code to export. +## +## Revision 1.344 2002/05/11 01:14:17 geraint +## Fix for [ 553218 ] simpar.oct and simpar.m different. +## Translation added between ColumnVector in base .cc and Octave_map in .oct. +## +## Revision 1.343 2002/05/10 14:07:16 geraint +## Preserve .cc files. +## +## Revision 1.342 2002/05/10 13:24:58 geraint +## Added initial support for building Simulink S-functions. +## Rates do not update properly yet. +## Inertial switches do not work yet. +## Implicit integration not supported yet. +## +## build with: mtt -i euler MotorGenerator sfun mexglx. +## +## Revision 1.341 2002/05/09 15:40:22 gawthrop +## -dr touches copied files to redo timestamp +## +## Revision 1.340 2002/05/08 22:13:47 geraint +## Removed redundant path from mtt_*.cc targets in mexglx build line. +## +## Revision 1.339 2002/05/08 21:32:26 geraint +## Tidied up $1_ode2odes_*.* targets and renamed dummies as *.stamp. +## +## Revision 1.338 2002/05/08 16:03:32 geraint +## Added mex support for ode2odes: mtt sys ode2odes mexglx. +## This mex stuff seems to require octave2.1-headers. +## +## Revision 1.337 2002/05/08 14:51:03 geraint +## Moved matlab/octave data type conversion functions to a separate file. +## +## Revision 1.336 2002/05/07 23:50:34 geraint +## Preliminary support for Matlab dynamically linked shared objects: +## invoke with: mtt -cc sys rep mexglx +## ode2odes support is not yet included. +## +## Revision 1.335 2002/05/01 17:30:55 geraint +## Improved pre-processor directives to better accommodate future alternatives (matlab) +## if necessary. +## +## Revision 1.334 2002/05/01 14:10:22 gawthrop +## Added -dr foo (reads from dir foo) option +## +## Revision 1.333 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.332 2002/04/26 23:19:00 geraint +## Fixed path to info files for "mtt info". +## +## Revision 1.331 2002/04/19 09:24:29 gawthrop +## 2 changes to ode2odes_out generation: only compiles the specified c +## file; outside the computation=c clause +## +## Revision 1.330 2002/04/17 10:03:12 geraint +## Marked .sg as a major representation. +## +## Revision 1.329 2002/04/16 14:58:00 gawthrop +## mtt copy does NOT now copy the CVS directory +## $directory --> ${directory} (just to be tidy) +## +## Revision 1.328 2002/02/19 16:27:05 geraint +## Changes to make MTT work out of the box with Debian. +## +## Revision 1.327 2001/11/15 02:56:17 geraint +## Added DASSL as an option for solution of algebraic equations (-ae dassl). +## Requires octave-2.1.35. +## +## Revision 1.326 2001/10/26 01:01:47 geraint +## fixcc when rdae_is_dae (-cr). +## +## Revision 1.325 2001/10/11 03:15:55 geraint +## Fixed make dependencies for c++ simulation code +## - re-simulation no longer required for different output format. +## +## Revision 1.324 2001/10/05 23:39:43 geraint +## Made odes.dat2 .PRECIOUS to prevent deletion when simulation receives ^C. +## +## Revision 1.323 2001/08/08 02:14:59 geraint +## Rationalisation of solver code, beginning with algebraic solvers. +## +## Revision 1.322 2001/08/01 04:06:07 geraint +## Added -i dassl for -cc and -oct. +## +## Revision 1.321 2001/07/27 23:43:34 geraint +## Added -cc to usage options (required for use with xmtt). +## +## Revision 1.320 2001/07/27 23:38:38 geraint +## Changed comment below (# SUMMARY) - fixes xmtt. +## +## Revision 1.319 2001/07/27 23:29:10 geraint +## *** empty log message *** +## +## Revision 1.318 2001/07/24 04:17:30 gawthrop +## Removed all " from # SUMMARY lines - messes up xmtt +## +## Revision 1.317 2001/07/24 00:55:17 gawthrop +## Resolved clashes -- marked with ## >>> +## +## Revision 1.316 2001/07/22 19:24:03 geraint +## Multiple '-v' increases verbosity. +## +## Revision 1.315 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## +## Revision 1.314 2001/07/13 04:19:03 gawthrop +## Now loads _subs.r with _cr.r file when using -cr option +## +## Revision 1.313 2001/06/13 14:53:59 gawthrop +## MTT now gas the double-colon option in the abg.fig file +## eg R:r:a^2+3*b +## +## Revision 1.312 2001/06/11 19:43:49 gawthrop +## MTT is now much more sophisticated in generating lbl files +## Labels can contain maths +## Repetative components are now broken +## +## Revision 1.311 2001/05/26 18:36:43 gawthrop +## Further modifications. Now works on rcPPP +## -- next jobs: +## add identification to ppp_nlin_sim +## create real-time ppp_nlin_run +## +## Revision 1.310 2001/05/08 08:30:12 gawthrop +## Added line to reverse the x^y --> pow(x,y) in default _simp file to +## prettyfy LaTeX +## +## Revision 1.309.2.3 2001/07/13 04:02:31 geraint +## Implemented numerical algebraic solution for _ode2odes.oct. +## +## Revision 1.309.2.2 2001/06/05 03:20:39 geraint +## added -ae option to select algebraic equation solution method. +## +## Revision 1.309.2.1 2001/05/04 04:07:24 geraint +## Numerical solution of algebraic equations. +## sys_ae.cc written for unsolved inputs. +## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). +## +## Revision 1.309 2001/04/28 03:15:03 geraint +## Fixed comment (interfered with "mtt help representations"). +## +## Revision 1.308 2001/04/25 22:17:45 geraint +## Fixed icd.txt2 dependency. +## +## Revision 1.307 2001/04/15 21:15:41 geraint +## Added interface definition rep: _ICD.(txt|c|cc|m). +## +## Revision 1.305 2001/04/11 09:44:26 gawthrop +## Fixed cc and c problems to do with pow(x,y) and integers +## mtt/lib/reduce/fix_c.r is included in rdae2dae and cse2smx_lang for +## -c, -cc and -oct options +## +## Revision 1.304 2001/04/11 07:35:22 gawthrop +## Now uses system_cr.h in place of system.h in .c rep - +## compatible with older code +## +## Revision 1.303 2001/04/10 12:54:50 gawthrop +## Minor fixes for sensitivity versions +## +## Revision 1.302 2001/04/06 05:24:30 geraint +## -stdin for .cc reps. +## +## Revision 1.301 2001/04/05 03:46:12 geraint +## Added mtt_prepend.sh, -p preserves time attribute of base file +## - eliminates error in dependencies due to update of ese.r by modpar.r. +## +## Revision 1.300 2001/04/04 10:06:49 gawthrop +## New ssim (sensitiveity simulation) rep +## +## Revision 1.299 2001/04/03 14:49:42 gawthrop +## Revised to incorporate new ssim (sensitivity simulation) +## representation (m only just now). +## +## Revision 1.298 2001/04/02 17:36:20 gawthrop +## Resolved $sys name clash when using -s +## +## Revision 1.297 2001/03/29 19:20:45 gawthrop +## Can now use c representations of crs when using -c option +## +## Revision 1.296 2001/03/27 01:07:34 geraint +## Improved determination of Octave version for ode2odes.exe creation. +## Removed FORCE check_update of .txts. +## +## Revision 1.295 2001/03/23 11:21:29 gawthrop +## Show -pdf oprion in help list +## +## Revision 1.294 2001/03/19 02:28:52 geraint +## Branch merge: merging-ode2odes-exe back to MAIN. +## +## Revision 1.293.2.8 2001/03/19 01:35:31 geraint +## Reverted forced update check to main branch form, ready for merge. +## +## Revision 1.293.2.7 2001/03/17 09:51:06 geraint +## Implemented Runge-Kutta IV fixed-step method (-i rk4). +## +## Revision 1.293.2.6 2001/03/03 06:50:38 geraint +## Added summary lines for ode2odes. +## +## Revision 1.293.2.5 2001/03/03 00:27:14 geraint +## Fixed ar options to work with GNU ar. Allow mtt to create dependencies for mtt_%.cc when making mtt_%.oct. +## +## Revision 1.293.2.4 2001/03/02 00:45:21 geraint +## Separated Euler and Implicit methods in .cc code and dependencies. +## +## Revision 1.293.2.3 2001/03/01 05:05:53 geraint +## Minor revisions. +## +## Revision 1.293.2.2 2001/02/23 03:53:53 geraint +## Minor revisions. (ode2odes.exe works on GNU/Linux and ~GNU/Irix) +## +## Revision 1.293.2.1 2001/02/22 06:41:40 geraint +## Initial merge of ode2odes.exe into main mtt. +## standalone_rep.make deleted: rules moved to mtt, variables to mttrc. +## +## Revision 1.293 2001/02/06 04:39:08 geraint +## Added _standalone.exe representation. +## +## Revision 1.292 2001/02/05 17:27:40 gawthrop +## Make sure _def.r exists before creating _state.txt +## +## Revision 1.291 2000/12/27 14:50:40 peterg +## This is the first CVS version (4.9). +## Commented out code now deleted +## +## Revision 1.290 2000/12/05 09:59:37 peterg +## Generates $1_cr.h - allows inclusion of c functions for crs +## +## Revision 1.289 2000/12/05 09:01:52 peterg +## Changed == to = +## +## Revision 1.288 2000/12/01 17:59:01 peterg +## Added .PRECIOUS: %.cc to hang on to cc files - thanks Geraint +## +## Revision 1.287 2000/12/01 16:04:24 peterg +## More partitioning achieved -- now needs the connections to be properly +## sorted in cbg2ese_r +## +## Revision 1.286 2000/12/01 14:18:44 peterg +## -partition now partially works up to cse.m +## but need to think about indexing, struc files etc for subsystems. +## +## Revision 1.285 2000/11/27 11:51:21 peterg +## Fixed a few pdf /fig bugs +## +## Revision 1.284 2000/11/27 10:33:35 peterg +## -pdf option now coerces ps-->pdf +## +## Revision 1.283 2000/11/24 15:11:50 peterg +## -pdf switch for simple displays +## +## Revision 1.282 2000/11/24 14:53:53 peterg +## Added lagrange rep : lde.r and lde.tex +## +## Revision 1.281 2000/11/16 13:51:15 peterg +## Added units stuff +## +## Revision 1.280 2000/11/10 14:45:16 peterg +## Finished up changes to incorporate Geraint's cc stuff +## +## Revision 1.279 2000/11/08 09:51:52 peterg +## Started incorporating Geraints CC/oct conversions +## +## Revision 1.278 2000/11/07 16:39:21 peterg +## *** empty log message *** +## +## Revision 1.277 2000/10/17 09:54:07 peterg +## logic rep sorted out +## +## Revision 1.276 2000/10/15 09:30:31 peterg +## *** empty log message *** +## +## Revision 1.275 2000/10/12 18:38:47 peterg +## New method of sympar generation implemented - uses mtt_make_sympar +## Check/update of numpar.txt is forced. +## +## Revision 1.274 2000/10/12 15:11:54 peterg +## Added the update function for numpar only +## +## Revision 1.273 2000/10/10 21:00:27 peterg +## More changes for new code gneration +## +## Revision 1.272 2000/10/06 16:20:00 peterg +## added ode_write rule +## +## Revision 1.271 2000/10/03 12:14:25 peterg +## Version 4.8 +## +## Revision 1.270 2000/10/03 12:13:51 peterg +## Corrected MTT_LIB paths +## +## Revision 1.269 2000/09/30 14:12:03 peterg +## Fixed bug with no-parameter systems - changed mtt_txt2m and mtt_m2p +## +## Revision 1.268 2000/09/27 16:15:55 peterg +## Now sh (as opposed to bash) compatible - fixed dat22dat again +## +## Revision 1.267 2000/09/21 10:08:30 peterg +## Version 4.7.1 - bug in odes.dat representation fixed in dat22dat +## +## Revision 1.266 2000/09/19 07:47:38 peterg +## fig2dev back to eps - ps produces a4 style output. +## +## Revision 1.265 2000/09/19 07:45:28 peterg +## Version 4.7 +## +## Revision 1.264 2000/09/15 08:37:27 peterg +## Fixed bug using -sub in cbg view +## +## Revision 1.263 2000/09/15 07:33:35 peterg +## Replace fig2dev language eps by ps to avoid version problem. +## +## Revision 1.262 2000/09/14 17:16:33 peterg +## Fixes some outstanding bugs: +## perpendicular strokes in cbg.fig +## proper display of hierachical cbg file (-sub and -viewlevel) +## +## Revision 1.261 2000/09/14 12:43:46 peterg +## view of ps s files now uses -sub and -viewlevel options +## +## Revision 1.260 2000/09/14 09:59:08 peterg +## Added -viewlevel switch +## +## Revision 1.259 2000/09/11 08:21:27 peterg +## Introduced MML - but for _tf rep only. +## +## Revision 1.258 2000/09/11 08:17:28 peterg +## Extended _simp.r to incude default switches +## +## Revision 1.257 2000/09/02 15:53:53 peterg +## Now does partitioning up to dae.view +## +## Revision 1.256 2000/09/02 14:24:06 peterg +## -sub switch introduced - works up to dae.r +## +## Revision 1.255 2000/08/30 11:43:04 peterg +## Put in the -opt switch for code optimisation +## +## Revision 1.254 2000/08/29 09:59:47 peterg +## Version 4.5 -- includes code optimisation using the "Scope" package in reduce +## +## Revision 1.253 2000/08/24 08:53:35 peterg +## New makesubs to create a .subs.r file with output switches to simplify output. +## +## Revision 1.252 2000/08/09 10:31:17 peterg +## Use -d option to find if its a book-style report +## +## Revision 1.251 2000/08/04 10:54:33 peterg +## Rationalised call to gcc using -lp2c to access p2c lib. +## +## Revision 1.250 2000/08/01 19:29:27 peterg +## Explcit zero of input in the simulations +## +## Revision 1.249 2000/08/01 12:28:02 peterg +## VERSION 4.4 +## euler now works +## stepfactor applies to both int. algorithms +## +## Revision 1.248 2000/07/20 07:46:07 peterg +## Version 4.3 +## +## Revision 1.247 2000/07/13 07:21:12 peterg +## Interface to Octave Control Systems Toolbox (OCST) - mtt2sys.m +## +## Revision 1.246 2000/05/21 18:00:11 peterg +## Make manual if not already done. +## Released 4.2 version +## (Train Durham -- Glasgow). +## +## Revision 1.245 2000/05/19 17:50:10 peterg +## Changes to state rep - now has parameter +## +## Revision 1.244 2000/05/19 14:19:46 peterg +## Added library path for representations +## +## Revision 1.243 2000/05/19 11:36:36 peterg +## Added logic rep. +## +## Revision 1.242 2000/05/18 20:12:02 peterg +## Version 4.2 +## +## Revision 1.241 2000/05/16 11:42:14 peterg +## Addded /usr/lib/libp2c.a to gcc +## +## Revision 1.240 2000/05/10 09:38:58 peterg +## Added Make to list of copied files. +## +## Revision 1.239 2000/04/11 18:08:33 peterg +## Fixed cse.tex bug +## +## Revision 1.238 2000/04/10 10:06:41 peterg +## Sorted out implicit rules for p2oct conversion +## +## Revision 1.237 2000/04/07 19:10:24 peterg +## New smxa and smxax reps +## +## Revision 1.236 2000/04/06 10:55:36 peterg +## Removed debug lines +## +## Revision 1.235 2000/04/06 10:52:53 peterg +## Replace $PWD with `pwd` for sh compatibility +## +## Revision 1.234 2000/04/04 16:14:08 peterg +## Sorted mtt help +## +## Revision 1.233 2000/03/16 10:16:11 peterg +## Clean no longer zaps the abg.m files +## +## Revision 1.232 2000/03/16 09:43:35 peterg +## Put in $mtt_switches in mtt comand line when creating _state.txt and +## _input.txt +## +## Revision 1.231 2000/03/15 21:24:23 peterg +## Version 4.1: +## Fixed problems with -abg mode +## Old-style SS lbl no longer supported +## +## Revision 1.230 2000/03/15 20:31:06 peterg +## Replaced lbl2cr by abg2cr_m2txt +## +## Revision 1.229 2000/03/15 19:39:40 peterg +## Replaced sub creation cmp2sub_m2sh by abg2sub_m2sh +## +## Revision 1.228 2000/03/07 10:54:14 peterg +## Added $1_lbl.txt to sympar.txt +## +## Revision 1.227 2000/02/16 15:05:46 peterg +## Replaced spurious 8spaces by tab +## +## Revision 1.226 2000/02/10 18:51:31 peterg +## Included OFF exp; in subs.r default +## +## Revision 1.225 2000/02/10 15:03:10 peterg +## Put subs.r file into the m-code generation -- allows the off exp; +## switch for simpler expresions. +## +## Revision 1.224 2000/02/08 10:27:04 peterg +## Removed obselete .h stuff +## +## Revision 1.223 2000/02/08 09:55:00 peterg +## Added .oct language for ode +## -- octave loadable builtin +## +## Revision 1.222 1999/12/23 10:03:42 peterg +## Added $1_sympars.txt to numpar.m target +## +## Revision 1.221 1999/12/22 05:15:51 peterg +## Set to version 4.0. +## +## Revision 1.220 1999/12/17 03:17:57 peterg +## reps_made is now $1_reps_made - stops clash between two reps per directory +## +## Revision 1.219 1999/12/14 00:36:50 peterg +## Changed $source to $stdin and added to mtt_m2p arg list +## +## Revision 1.218 1999/12/03 00:04:50 peterg +## Version to eric. +## -stdin switch added +## +## Revision 1.217 1999/11/16 22:15:55 peterg +## Changed compcopy to test for abg, not lbl file +## +## Revision 1.216 1999/11/16 05:53:21 peterg +## Added sensitivity (-s) switch +## +## Revision 1.215 1999/11/15 22:45:31 peterg +## Reorganised integration method using -i switch +## Introduced -r (reset) switch +## +## Revision 1.214 1999/11/14 21:27:11 peterg +## *** empty log message *** +## +## Revision 1.213 1999/09/02 23:24:40 peterg +## Now explicitly generates executable _ode2odes.out file +## Which takes command line arguments +## +## Revision 1.212 1999/08/18 06:20:32 peterg +## Put -u back again ..... +## +## Revision 1.211 1999/08/17 04:10:38 peterg +## Removed the -u switch from cp - it doesnt work on non GNU cps +## +## Revision 1.210 1999/08/02 12:52:12 peterg +## Removed redundant .p copying. +## +## Revision 1.209 1999/07/27 03:50:13 peterg +## Fixed odeo.p bug. +## Fixed compound object bug in fig. +## +## Revision 1.208 1999/07/20 23:43:05 peterg +## V 3.8 ( to Eric) +## +## Revision 1.207 1999/04/02 07:17:37 peterg +## Upped version to 3.6 -- the new implicit solver with switches +## +## Revision 1.206 1999/04/02 06:28:54 peterg +## New implicit method - solves numerical prob with ISW +## +## Revision 1.205 1999/03/15 23:27:43 peterg +## Modified generation of odes.dat2 data +## +## Revision 1.204 1999/03/15 05:53:33 peterg +## Put in user-defined representations +## +## Revision 1.203 1999/03/08 03:51:12 peterg +## Version 3.5 for Linux Red Hat 5.2 (Newcastle) +## +## Revision 1.202 1999/02/17 01:59:20 peterg +## Now handles html copy correctely (ie mv directory to ..) +## Fixed path probs with html +## +## Revision 1.201 1999/02/16 03:50:09 peterg +## Removed explicit _smx targets +## +## Revision 1.200 1998/12/03 17:11:03 peterg +## Added -dc (derivative causality) switch. +## +## Revision 1.199 1998/12/03 16:53:50 peterg +## Now completes causality using component, not bond, status. +## +## Revision 1.198 1998/11/20 16:12:30 peterg +## Now copies aliased systems BEFORE generating rgb etc. +## +## Revision 1.197 1998/11/20 09:00:45 peterg +## Number of changes to underlying tools +## +## Revision 1.196 1998/11/10 11:55:40 peterg +## Added $info_switch to abg2cbg invocation +## +## Revision 1.195 1998/10/28 13:58:57 peterg +## Added $1_sympars.txt prerequisite to _tf.m target +## +## Revision 1.194 1998/10/20 09:00:43 peterg +## Added a few summary lines - to help with xmtt +## +## Revision 1.193 1998/10/01 16:11:42 peterg +## Implicit integration now handles switches +## +## Revision 1.192 1998/09/29 20:09:46 peterg +## Fixed nyfr and nifr plotting bug +## +## Revision 1.191 1998/09/02 12:05:39 peterg +## Added INPUT to simpar +## Revision 1.190 1998/09/02 11:48:51 peterg +## VERSION 3.2 (Swansea) +## abg data structure now uses explicti port and subsystem lists so that +## processing is in predetermined order. +## +## Revision 1.189 1998/08/31 10:49:15 peterg +## Minor changes to -abg operation +## +## Revision 1.188 1998/08/27 08:33:21 peterg +## New reduce integration methods - euler/Implicit only +## +## Revision 1.187 1998/08/25 20:06:56 peterg +## New data structure for abg.m and cbg.m +## +## Revision 1.186 1998/08/18 10:49:05 peterg +## VERSION 3.1 release +## +## Revision 1.185 1998/08/18 09:21:14 peterg +## Removed "" from default simpar file. +## +## Revision 1.184 1998/08/18 09:08:26 peterg +## Now grabs components (specified in lbl file as alias) at the rbg stage +## - this makes sure that they are there when needed. +## +## Revision 1.183 1998/08/18 08:48:43 peterg +## Sorted out problem with ifeq ($REPTYPE,data) block - added else. +## +## Revision 1.182 1998/08/17 15:48:39 peterg +## Replaced SVD solver with LUD solver +## +## Revision 1.181 1998/08/15 13:45:28 peterg +## Added new integration methods in Pascal/c version +## Revised the various translations appropriately +## +## Revision 1.180 1998/08/12 14:15:13 peterg +## Implicit integration - c implemetation now included. +## +## Revision 1.179 1998/08/12 12:29:18 peterg +## Put back some of the args stuff -- needed for plots. +## +## Revision 1.178 1998/08/11 13:38:35 peterg +## Zapped the obsolete args stuff +## +## Revision 1.177 1998/07/30 17:32:44 peterg +## VERSION 3.0 +## +## Revision 1.176 1998/07/27 20:25:15 peterg +## Sorted out new mtt_r2m +## +## Revision 1.175 1998/07/27 18:49:09 peterg +## Fixed the frequency stuff +## +## Revision 1.174 1998/07/27 07:10:10 peterg +## Removed dummy global stuff. +## +## Revision 1.173 1998/07/26 14:38:20 peterg +## *** empty log message *** +## +## Revision 1.172 1998/07/26 11:13:38 peterg +## Fixed name classes with globs - ide is that all @strong{MTT} variables +## start with @strong{MTT} +## +## Revision 1.171 1998/07/25 20:37:22 peterg +## Removes -s (switches) option -- they are now assumed to be present +## I still need to shift the old switch +## +## Revision 1.170 1998/07/25 19:16:22 peterg +## Sorted out sympar + switch variables - new sympars rep combines both +## +## Revision 1.169 1998/07/25 16:35:12 peterg +## Incorporated mtt_p2c (uses p2c) +## +## Revision 1.168 1998/07/25 09:44:25 peterg +## Uses Pascal as step on the way to c code -- MUCH nicer! +## State and input now use the simple default - no steady states +## +## Revision 1.167 1998/07/24 17:10:34 peterg +## *** empty log message *** +## +## Revision 1.166 1998/07/22 08:37:30 peterg +## Implicit integration now the default - for octave anyway. +## +## Revision 1.165 1998/07/19 16:00:22 peterg +## Added smx representation +## +## Revision 1.164 1998/07/17 19:45:58 peterg +## Component aliases implemented. +## +## Revision 1.163 1998/07/17 08:27:33 peterg +## Added find target +## +## Revision 1.162 1998/07/16 16:14:27 peterg +## Now stops if a transformation forces error. +## +## Revision 1.161 1998/07/08 11:21:32 peterg +## Added -I switch +## +## Revision 1.160 1998/07/04 11:38:51 peterg +## Version 3.0-- (Seascale) +## +## Revision 1.159 1998/07/04 11:37:43 peterg +## Aliases implemented for parameters + lots of associated goodies +## New-style lbl files - no more SS nonsense. +## +## Revision 1.158 1998/07/03 09:06:39 peterg +## Alias implemented for ports +## +## Revision 1.157 1998/07/01 10:22:11 peterg +## Moved tidy stuff to end of preamble -- needed to make muti-plot copy +## correctely +## Now copies ps file with arguments to WD +## +## Revision 1.156 1998/06/26 14:19:43 peterg +## Copy hidden files (eg .octaverc) in tidy mode +## +## Revision 1.155 1998/06/24 07:43:42 peterg +## Version 2.91 -- includes implicit integration (octave) +## +## Revision 1.154 1998/06/17 14:14:09 peterg +## Removed struc.txt prerequisite for simpar.txt - switch version +## +## Revision 1.153 1998/05/28 09:36:38 peterg +## --version and --versions switch +## +## Revision 1.152 1998/05/24 15:43:10 peterg +## Added symbolic solution of alg. equations (-A) +## +## Revision 1.151 1998/05/23 16:18:37 peterg +## ordinary differential equation.m files generated with the new ode2lang +## method. +## +## Revision 1.150 1998/05/19 19:47:37 peterg +## Updated the odesso representation to use simpar file. +## +## Revision 1.149 1998/05/14 15:16:13 peterg +## Sorted out Differential-Algebraic Equation simulation +## Added LSODE methode to ordinary differential equation simulation +## +## Revision 1.148 1998/05/12 14:42:07 peterg +## Added ese_tidy and new method for organising ese files - +## Each subsystem has an array of variables - effort, flow and state for +## each bond +## +## Revision 1.147 1998/04/15 18:41:47 peterg +## Fixed various probs with multiple systems in one directory +## +## Revision 1.146 1998/04/04 11:00:20 peterg +## Modified various parts to allow coercing directions at ports +## +## Revision 1.145 1998/04/03 11:17:44 peterg +## VERSION 2.9 +## +## Revision 1.144 1998/03/27 13:32:25 peterg +## Removed sympar prerequisites from ss reps. +## +## Revision 1.143 1998/03/22 21:14:03 peterg +## Added obspar.r representation +## Help now case insensitive +## +## Revision 1.142 1998/03/20 15:09:26 peterg +## Changed order of prerequisites for _dae.r to put _rdae.r first. +## +## Revision 1.141 1998/03/11 10:45:19 peterg +## Added rclean - recursive clean +## +## Revision 1.140 1998/03/09 10:23:30 peterg +## PS view now runs as a background process. +## +## Revision 1.139 1998/03/07 16:04:23 peterg +## Added some more txt view reps: input, lbl, numpar, state +## +## Revision 1.138 1998/03/07 15:23:40 peterg +## Uses sort_sympar to uniquely produce the sympar list. +## +## Revision 1.137 1998/03/07 14:04:17 peterg +## dae creation split into 2 parts: +## 1. create a raw (ie without constitutive relationship) dae (rdae) +## 2. add the raw dae to the crs to get the dae. +## reduce has less work to do with this approach +## +## Revision 1.136 1998/03/04 16:34:19 peterg +## New local (_cr.r) and generic (.cr) CR structure. +## CR and lbl now have view mode. +## CRS in abg_tex. +## +## Revision 1.135 1998/02/25 22:09:48 peterg +## Added simpar representation. +## +## Revision 1.134 1998/02/25 15:28:34 peterg +## Added state.m rep. +## +## Revision 1.133 1998/02/24 22:35:33 peterg +## Added -p (preserve) switch to cp in tidy mode. +## +## Revision 1.132 1998/02/24 22:33:23 peterg +## new state reresentation included +## +## Revision 1.131 1998/02/23 16:21:21 peterg +## Just do model name in summary line of lbl file +## +## Revision 1.130 1998/02/19 13:40:24 peterg +## Removed prerequisit from sspar.r target. +## +## Revision 1.129 1998/02/12 08:18:42 peterg +## VERSION 2.8 (St. Annes) +## +## Revision 1.128 1998/02/12 07:48:04 peterg +## Tidy mode copies all files (containing .) to work dir -- this makes +## sure that files such a .c .constitutive relationship go across. +## +## Revision 1.127 1998/02/11 19:36:29 peterg +## Only displays one level of cbg file now. +## +## Revision 1.126 1998/02/11 19:26:03 peterg +## Added verbose (-v) mode. +## +## Revision 1.125 1998/02/11 11:36:28 peterg +## Updated version control mode - make it untidy. +## cp --> cp -u after tidy-mode . +## +## Revision 1.124 1998/02/10 13:03:36 peterg +## Now includes controller transfer function (ctf). +## +## Revision 1.123 1998/02/09 13:51:04 peterg +## Fixed directory string bug. +## +## Revision 1.122 1998/02/06 15:02:26 peterg +## New default sspar -- sets all states to zero. +## +## Revision 1.121 1998/02/06 14:36:51 peterg +## Report on copying back from MTT_work +## +## Revision 1.120 1998/02/05 16:06:53 peterg +## Removed debugging lines. +## Auto parts in books. +## +## Revision 1.119 1998/02/05 15:04:25 peterg +## Fixed problem with book in tidy mode. +## +## Revision 1.118 1998/02/05 12:00:11 peterg +## Tidy mode now default. +## It seems to work ok but not for book type documents. +## +## Revision 1.117 1998/02/04 16:50:50 peterg +## Introduced the tidy (-t and -T) options +## +## Revision 1.116 1998/02/04 11:00:04 peterg +## Added view of subsystems. +## +## Revision 1.115 1998/01/29 19:37:31 peterg +## Fixed spurious call to X server bug +## +## Revision 1.114 1998/01/23 13:38:07 peterg +## VERSION 2.7 +## +## Revision 1.113 1998/01/23 13:27:13 peterg +## Added state-feedback control representations: +## smc,smo,ssk,ssl +## +## Revision 1.112 1998/01/21 09:24:46 peterg +## Removed 'touch $1_rep.txt' -- perhaps best to do this by hand if +## necessary. As it is, it cuased probs wene reediting the _rep.txt file. +## +## Revision 1.111 1998/01/16 14:56:59 peterg +## Argument now correctely recognised as a string beginning with - +## (rather than containing -) +## +# Revision 1.110 1998/01/06 13:59:30 peterg +# Added rename function. +# +# Revision 1.109 1998/01/06 09:20:02 peterg +# Made LATEX2HTML an environment variable. +# +# Revision 1.108 1997/12/19 08:48:55 peterg +# Lille modifications - bicausal algebraic loops supported +# +## Revision 1.107 1997/12/11 10:59:50 peterg +## This is version 2.6 +## +# Revision 1.106 1997/12/11 10:59:07 peterg +# Added debug -D switch + echos directory when -d switch used. +# +# Revision 1.105 1997/12/11 09:04:47 peterg +# Reduced default rep.txt file to just abg.txt -- this is to document +# components which may not be causally complete +# +# Revision 1.104 1997/12/07 21:05:10 peterg +# Removed a debbugging echo +# +## Revision 1.103 1997/12/07 20:10:36 peterg +## Fixed bugs with reprots and distinguish between book, article and +## section reports. +## +## Revision 1.102 1997/12/07 12:14:43 peterg +## Hnadles book, article and section reports seperately +## +## Revision 1.101 1997/12/06 18:54:53 peterg +## Now tidies up after itself. +## Major modifications to do a rep on a directory -- creates a book with +## each example as a chapter. +## +## Revision 1.100 1997/12/06 12:14:39 peterg +## Put a conditional around the PS data rep to check for set arguments. +## +## Revision 1.99 1997/12/04 22:06:53 peterg +## Added view arguments for graph plotting +## +## Revision 1.98 1997/12/04 10:58:15 peterg +## Tidied up switches +## +## Revision 1.97 1997/12/04 10:44:33 peterg +## Changed $cc to $CC +## +## Revision 1.96 1997/12/04 10:40:26 peterg +## Added -p switch - print enviromment variables +## +## Revision 1.95 1997/12/04 10:05:02 peterg +## Compiler now symbolocic $cc +## +# Revision 1.94 1997/11/20 11:23:16 peterg +# Changed gcc to cc +# +## Revision 1.93 1997/09/18 16:57:28 peterg +## _sympar.txt now has a second column - the system type from whence the +## parameter (in the first column) came. +## Done on the train Glasgow-Warrington ! +## +## Revision 1.92 1997/09/11 17:08:46 peterg +## Added spreadsheet version of odeso +## +## Revision 1.91 1997/09/11 08:21:08 peterg +## copy utility split into two: +## copy: copies examples (copies the entire directory) +## compcopy: (just used internally) copies components. +## +## Revision 1.90 1997/08/30 19:35:39 peterg +## Added date to mtt line +## +## Revision 1.89 1997/08/26 15:20:25 peterg +## Added explicit evaluation of report representations +## Version now 2.5++ +## +## Revision 1.88 1997/08/25 07:51:47 peterg +## Version 2.5. +## +## Revision 1.87 1997/07/27 13:11:11 peterg +## Added path checking code -- mtt_check_vars +## +# Revision 1.86 1997/06/29 19:05:51 peterg +# Seascale changes -- mainly to new rep format. +# +## Revision 1.85 1997/06/27 12:14:49 peterg +## Upped version to 2.4++ +## +# Revision 1.84 1997/06/13 14:08:23 peterg +# Changed default rep.txt +# +# Revision 1.83 1997/06/13 09:18:28 peterg +# Removed all params.m +# +# Revision 1.82 1997/06/13 08:59:03 peterg +# Set to version 2.4 +# +## Revision 1.81 1997/05/22 10:11:04 peterg +## Fixed dat2gdat bug (with parameters) +## +## Revision 1.80 1997/05/22 07:38:27 peterg +## Added command line info to .doc files (makedoc) +## +## Revision 1.79 1997/05/19 16:44:12 peterg +## Many changes to get rep.html mode working properly. +## +# Revision 1.78 1997/05/19 13:17:50 peterg +# Explicit inclusion of mtt.sty in .doc files -- latex2html prefers this +# +# Revision 1.77 1997/05/19 11:29:37 peterg +# Added desc.tex and abg.tex descriptions. +# +# Revision 1.76 1997/05/15 09:43:46 peterg +# New version of _input.txt for -s option +# +# Revision 1.75 1997/05/15 09:15:54 peterg +# Included switch.c in dependancy list for _input.c (when -s switch set) +# +# Revision 1.74 1997/05/13 16:58:02 peterg +# Added -s switch to get mtt to search for (Bond Graph) switches +# +## Revision 1.73 1997/05/09 09:18:45 peterg +## Put ./ in front of a.out (again) +## +# Revision 1.72 1997/05/06 13:54:21 peterg +# Changed gcc arguments for the ode simulation -- all files now included +# in the _odes.c file +# +# Revision 1.71 1997/05/03 15:50:18 peterg +# c functions not included in gcc arg list -- they are now included in +# the main prog. +# +# Revision 1.70 1997/05/03 14:17:13 peterg +# Now copies c utilities (eg dsvdcmp.c) from $MTTPATH/trans/c. +# +# Revision 1.69 1997/05/03 13:58:35 peterg +# Implicit integration for sm representation added. +# +# Revision 1.68 1997/05/01 08:39:20 peterg +# params.c and params.m not used any more. +# _numpar.txt is the common base from which _numpar.c and numpar.m is +# generated. +# +# Revision 1.67 1997/04/23 07:26:49 peterg +# Added -o switch -- ode and dae are the same +# Added switches to default menu +# +# Revision 1.66 1997/04/16 09:46:01 peterg +# More informative copy message +# +# Revision 1.65 1997/04/15 15:16:12 peterg +# Added structure (_struc) files. +# Fixed prob with dvi2ps conversion -- removed .doc extension. +# +# Revision 1.64 1997/04/09 09:26:44 peterg +# Added crcopy feature to pull crs from library -- similar to copy +# feature. +# +# Revision 1.63 1997/03/22 17:09:11 peterg +# Fixed bug in recursive cr.txt generation. +# Fixed bug in recursive sympar.txt generation. +# +# Revision 1.62 1997/03/20 17:48:50 peterg +# Better _input.c file default. +# +# Revision 1.61 1997/03/20 16:53:01 peterg +# Generates c files using include statements. +# +# Revision 1.60 1997/03/20 10:25:41 peterg +# Generates a compehensive default params file. +# +# Revision 1.59 1997/03/19 10:14:04 peterg +# Now produces a stripped acausal bond graph. +# +# Revision 1.58 1997/03/18 17:58:12 peterg +# Generates label files containing all variables in fig file. +# Generates sympar file for all levels in system. +# Generates txt version of sympar file. +# +# Revision 1.57 1997/03/10 09:24:58 peterg +# a.out now deleted in the clean operation +# +# Revision 1.56 1997/03/05 08:24:09 peterg +# Delete a.out after it has run. +# +# Revision 1.55 1997/02/24 19:31:10 peterg +# Removed numpar.m requirement from .m files +# +## Revision 1.54 1997/02/09 20:33:13 peterg +## Replaced a.out with ./a.out +## +## Revision 1.53 1997/02/09 20:30:04 peterg +## Copied from tweedledum. +## +# Revision 1.54 1997/02/07 13:33:03 peterg +# Added ; to _input.c file - bug fix. +# +# Revision 1.53 1997/02/07 13:25:04 peterg +# Version 2.3 +# +# Revision 1.52 1997/01/21 22:55:59 peterg +# Minor bug fixes +# +## Revision 1.51 1997/01/21 13:16:40 peterg +## Included transformations to language c for: +## ode +## params +## numpar +## +## Revision 1.50 1996/12/21 19:46:52 peterg +## Set to 2.2++ +## Changed \* --> \\* in rbg_fig2m.awk +## +## Revision 1.49 1996/12/19 19:55:22 peterg +## Version 2.2 -- Linux. +## +## Revision 1.48 1996/12/07 21:33:52 peterg +## Changed _input file to give unit step on ALL inputs +## +## Revision 1.47 1996/12/07 20:50:16 peterg +## *** empty log message *** +## +## Revision 1.46 1996/12/05 10:48:51 peterg +## Put sympar in clean list. +## sympar now sucks in params.r file +## +## Revision 1.45 1996/12/05 10:41:39 peterg +## Saved many changes over past 2 weeks. +## +# Revision 1.44 1996/11/12 16:04:25 peterg +# Really VERSION 2.1 +# +# Revision 1.43 1996/11/12 08:52:57 peterg +# Fixed bug in test arg to if - missing "". +# +# Revision 1.42 1996/11/11 17:23:03 peterg +# Added numpar.m requirement to all .m targets +# +## Revision 1.41 1996/11/11 17:18:32 peterg +## VERSION 2.1 +## +## Revision 1.40 1996/11/09 21:17:38 peterg +## Fixed bug with copying at level 0. +## +## Revision 1.39 1996/11/09 20:22:54 peterg +## VERSION 2.0 +## +## Revision 1.38 1996/11/09 20:17:34 peterg +## Fixed bug with null ARGS argument +## Put in new lib paths. +## +## Revision 1.37 1996/11/09 18:47:46 peterg +## Added new copy command (using find). +## More documaentation stuff. +## +# Revision 1.36 1996/11/03 21:19:02 peterg +# Recursice generation of Constitutive Relationship files. +# +## Revision 1.35 1996/11/02 10:19:19 peterg +## Constitutive Relationship generation from lbl file +## +## Revision 1.34 1996/11/01 13:34:35 peterg +## -q (quiet) switch added +## +## Revision 1.33 1996/11/01 12:34:45 peterg +## Added browser - mtt_help +## +## Revision 1.32 1996/10/31 20:48:41 peterg +## Revised html generation. +## Stopped deletion of rep.txt file. +## +# Revision 1.31 1996/10/20 19:23:54 peterg +# Automatic generation of sub-system abg.m files. +# +## Revision 1.30 1996/10/01 14:08:05 peterg +## Replaced $() by `` +## Replaced make with gmake +## +# Revision 1.29 1996/10/01 11:04:05 peter +# Changed name of html document. +# +## Revision 1.28 1996/09/13 18:44:11 peter +## Added params dependencies. +## +## Revision 1.27 1996/09/12 19:24:56 peter +## New numpar/params setup. +## +## Revision 1.26 1996/09/10 17:04:47 peter +## Added impulse response (ir) representation. +## +## Revision 1.25 1996/08/30 20:03:45 peter +## Removed dependencies from vc +## +## Revision 1.24 1996/08/30 18:37:17 peter +## inor changes. +## +## Revision 1.23 1996/08/30 11:10:37 peter +## More files in clean up. +## +## Revision 1.22 1996/08/30 10:07:51 peter +## Removed impicit creation of abg.fig file. +## +## Revision 1.21 1996/08/22 12:19:51 peter +## Added various document viewers. +## +## Revision 1.20 1996/08/20 08:24:53 peter +## Now with version control. +## +## Revision 1.19 1996/08/19 15:33:22 peter +## Included new state matric (sm) rep. +## Generate step response (sr) from sm. +## +## Revision 1.18 1996/08/19 13:30:54 peter +## New CLEAN target. +## +## Revision 1.17 1996/08/19 06:48:14 peter +## Explicit figure editing. +## +## Revision 1.16 1996/08/18 19:58:36 peter +## Report generation included. +## +## Revision 1.15 1996/08/18 12:01:01 peter +## Unified format of time responses. +## +## Revision 1.14 1996/08/16 14:52:24 peter +## Added two alternative view options - dview and pview. +## +## Revision 1.13 1996/08/16 08:24:31 peter +## Correctly chooses how to make a ps file using $REPTYPE. +## +## Revision 1.12 1996/08/15 16:47:47 peter +## DAE solution (experimental) included. +## +## Revision 1.11 1996/08/15 11:55:30 peter +## Checks for changed argument. +## Handles frequency response. +## +## Revision 1.10 1996/08/15 07:44:24 peter +## Now handles generic transformations using %. +## +## Revision 1.9 1996/08/14 09:16:08 peter +## Step response now goes through m, dat and gdat conversions +## +## Revision 1.8 1996/08/12 20:19:52 peter +## Arguments now passed via $1_args.m file +## +## Revision 1.7 1996/08/11 19:49:27 peter +## Parameter passing (via $4) added. +## +## Revision 1.6 1996/08/11 10:40:56 peter +## Added new numpar stuff. +## Added step response. +## +## Revision 1.5 1996/08/10 14:13:47 peter +## Added impulse and frequency response stuff. +## +## Revision 1.4 1996/08/10 09:19:48 peter +## Put in help, info and warranty stuff. +## +## Revision 1.3 1996/08/09 15:13:13 peter +## Generic viewing of any representation via ps files implemented. +## +## Revision 1.2 1996/08/05 19:50:55 peter +## Put in fig.fig target. +## +## Revision 1.1 1996/08/04 17:29:42 peter +## Initial revision +## +############################################################### + +set_oct() { +## Sets ${m} to oct if such a rep is supported + m=m + supported_reps="ae input logic numpar simpar state" + for supported_rep in ${supported_reps}; do + if [ "${rep}" = "${supported_rep}" ]; then + m=oct + fi + done +} + +#Check $MTTPATH has been set +mtt_check_var "$MTTPATH" "MTTPATH" + +#Version +version='5.0' + +# MTT recursion level is zero unless explicitly set +level=0 + +#Computation mode is octave by default +computation=octave + +#By default, Reduce is used if available +if [ -n "$SYMBOLIC" ]; then + use_reduce='yes' +else + use_reduce='no' +fi + +#By default, the dae and ode representations are different +dae_is_ode=0 + +#By default, the ode and cse reps are different +ode_is_cse=0 + +# By default, don't look for BG switches +switches=0 + +#By default, don't print the environment variables +print=''; + +# By default, make it tidy +tidy=tidy; + +# Default not verbose +verbose=' -s' +verbosity=0 + +# Default integration method +integration_method=implicit; + +# Default algebraic equation solver +algebraic_solver=noAlgebraicSolver; + +# Default no info +info_switch='' + +# Default use m, not oct files +m='m'; + +# Default use ps files +ps=ps +eps=eps +psview=$PSVIEW + +# Default declare 500 temporary variables +num_tmp_var=500 + +# Default no equation sorting +do_sort='' +sort_method='' + +#Initialise list of switches +mtt_switches=''; + +#Initialise read dirs +read_dirs='' + +#Initialise view_level +viewlevel=0 + +#Look for a command line argument +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -q ) + mtt_switches="$mtt_switches $1"; + quiet=quiet;; + -r ) + mtt_switches="$mtt_switches $1"; + reset=reset;; + + -p ) + mtt_switches="$mtt_switches $1"; + print='-p';; + -c ) + echo "-c is obsolete. Please use -cc instead" + fixcc='-fixcc' + mtt_switches="$mtt_switches $1"; + matrix_smxa="-matrix"; + computation=c ;; + -cc ) + fixcc='-fixcc' + mtt_switches="$mtt_switches $1"; + matrix_smxa="-matrix"; + computation=cc ;; + -cr ) + mtt_switches="$mtt_switches $1"; + rdae_is_dae=1 ; + cr_first='-cr';; + -o ) + mtt_switches="$mtt_switches $1"; + dae_is_ode=1 ;; + -nocr ) + mtt_switches="$mtt_switches $1"; + rdae_is_dae=1 ;; + -no-reduce ) + mtt_switches="$mtt_switches $1"; + use_reduce='no'; + do_sort='-sort'; + sort_method='make'; + rdae_is_dae=1 ; + cr_first='-cr'; + Solve=''; + num_tmp_var=0 ; + integration_method="euler" ;; + -i ) + mtt_switches="$mtt_switches $1"; + shift; + case $1 in + dassl) + integration_method=dassl; + mtt_switches="$mtt_switches dassl"; + ;; + euler) + integration_method=euler; + mtt_switches="$mtt_switches euler"; + ;; + implicit) + integration_method=implicit; + mtt_switches="$mtt_switches implicit"; + ;; + rk4) + integration_method=rk4; + mtt_switches="$mtt_switches rk4"; + ;; + *) + echo $1 is an unknown integration method - use dassl, euler, rk4 or implicit; + exit;; + esac;; + -ae ) + mtt_switches="$mtt_switches $1"; + case $2 in + dassl) + mtt_switches="$mtt_switches $2"; + algebraic_solver=Dassl_Solver; + shift; + ;; + fsolve | hybrd) + mtt_switches="$mtt_switches $2"; + algebraic_solver=Hybrd_Solver; + shift; + ;; + hooke) + mtt_switches="$mtt_switches $2"; + algebraic_solver=HJ_Solver; + shift; + ;; + reduce) + mtt_switches="$mtt_switches $2"; + algebraic_solver=Reduce_Solver; + Solve='-A'; + shift; + ;; + *) + echo $1 is an unknown solver - use hybrd, hooke or reduce; + exit;; + esac;; + -s ) + sensitivity_switch='-s'; + mtt_switches="$mtt_switches $1"; + sensitivity=sensitivity ;; + -make-sort ) + mtt_switches="$mtt_switches $1"; + do_sort='-sort'; + sort_method="make"; + num_tmp_var=0 ;; + -sort ) + mtt_switches="$mtt_switches $1"; + do_sort='-sort'; + sort_method="seqn"; + integration_method="sorted_euler";; + -ss ) + mtt_switches="$mtt_switches $1"; + steadystate_computation=yes ;; + -d ) + directory=$2; cd $directory; shift ;; + -dc ) + mtt_switches="$mtt_switches $1"; + causality_switch='-derivative' ;; + -S ) + directory=$2; shift;; + -D ) + mtt_switches="$mtt_switches $1"; + debug=debug ;; + -v ) + mtt_switches="$mtt_switches $1"; + info_switch='-I'; + Verbose='verbose'; + verbosity=`expr $verbosity + 1`; + if [ $verbosity -ge 1 ]; then verbose=' -w '; fi; + if [ $verbosity -ge 2 ]; then set -x; fi; + if [ $verbosity -ge 3 ]; then verbose_make=' -d '; fi; + ;; + -I ) + mtt_switches="$mtt_switches $1"; + info_switch='-I' ;; + -t ) + tidy=tidy ;; + -trace ) + mtt_switches="$mtt_switches $1"; + trace='-n' ;; + -T ) + tidy=tidy; + verytidy=verytidy ;; + -u ) + tidy=untidy ; + mtt_switches="$mtt_switches $1"; + ;; + -l ) + mtt_switches="$mtt_switches $1 $2"; + level=$2; shift ;; + -A ) + mtt_switches="$mtt_switches $1"; + Solve='-A';; + -abg ) + mtt_switches="$mtt_switches $1"; + start_at_abg='yes';; + -stdin ) + mtt_switches="$mtt_switches $1"; + stdin=stdin;; + -sub ) mtt_switches="$mtt_switches $1 $2"; + sub='-sub'; + subsystem="_"$2; + shift;; + -oct ) + fixcc='-fixcc' + mtt_switches="$mtt_switches $1"; + using_oct=yes; + ;; + -opt | -optl ) + mtt_switches="$mtt_switches $1"; + optimise='-optimise_local';; + -optg ) + mtt_switches="$mtt_switches $1"; + optimise='-optimise_global';; + -ntmpvar ) + num_tmp_var=$2; + mtt_switches="$mtt_switches $1 $2"; + shift;; + -partition ) mtt_switches="$mtt_switches $1"; + partition='-partition'; + ;; + -pdf ) mtt_switches="$mtt_switches $1"; + ## ps=pdf; + ## eps=pdf; + ## pdf='-pdf'; + psview=$PDFVIEW; + ;; + -dr ) mtt_switches="$mtt_switches $1"; shift + mtt_switches="$mtt_switches $1"; read_dir=$1 + if [ -d "${read_dir}" ]; then + read_dirs="${read_dirs} ${read_dir}" + else + echo "${read_dir} does not exist - ignoring" + fi + ;; + -nas ) no_alpha_sort="no_alpha_sort"; + mtt_switches="$mtt_switches $1"; + ;; + -viewlevel ) mtt_switches="$mtt_switches $1 $2"; + viewlevel=$2; + shift;; + --version) + echo 'MTT version' $version; exit;; + --versions) + mtt_versions; exit;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +## Create switches string for adding to file names. + MTT_SWITCHES=`echo ${mtt_switches} | sed 's/ //g' | sed 's/^-u-q//'` + +#Print header if not in quiet (-q) mode. +if [ "$quiet" != "quiet" ]; then + echo + echo 'MTT (Model Transformation Tools) version' $version + echo '($Date$)' + echo 'This is free software with ABSOLUTELY NO WARRANTY.' + echo 'Type `mtt warranty'\' 'for details.' + echo + # Print current directory if in -d mode + if [ -n "$directory" ]; then + echo Using directory $directory + echo + fi +fi + +#Print what's going on if in verbose mode +if [ -n "$Verbose" ]; then + echo Starting mtt $mtt_switches $1 $2 $3 $4 at level $level + echo " " current wd `pwd` +fi + +#Check the principle paths +mtt_check_vars $print + +# Exit if just printing paths +if [ "$print" != "" ]; then + exit +fi + +if [ -z "$1" ]; then + if [ -z "$print" ]; then + cat < clean + mtt copy + mtt rename + mtt vc + mtt + mtt + +Options: + -A solve algebraic equations symbolically + -abg start at abg.m representation + -ae algebraic equation solver: reduce|hybrd|dassl|hooke + -cc C++ code generation + -cr use cr before resolving equations + -D debug -- leave log files etc + -d use directory + -dc maximise derivative (not integral) causality + -dr use files contained in + -I prints more information + -i integration method: implicit|euler|rk4|dassl + -nas no alphabetic sort (of components) + -o ode is same as dae + -oct use oct files in place of m files where appropriate + -opt optimise code generation (equivalent to -optl) + -optl locally optimise code generation (line-by-line) + -ntmpvar declare temporary variables (default=$num_tmp_var) + -p print environment variables + -partition partition hierachical system + -pdf generate pdf in place of ps + -q quiet mode -- suppress MTT banner + -r reset time stamp on representation + -s generate sensitivity BG (use mtt -s sSys rep lang) + -ss use steady-state info to initialise simulations + -stdin read input data from standard input for simulations + -sub operate on subsystem + -t tidy mode (default) + -trace just indicate what mtt will do - but do not do it + -u untidy mode (leaves files in current dir) + -v verbose mode (multiple uses increment the verbosity) + --version print version and exit + --versions print version of mtt and components and exit + -viewlevel view levels of hierachy + +Experimental options: + -optg globally optimise code generation (full vector) + -make-sort use sorted equations (sese, generated by make) + -no-reduce try not to use symbolic algebra + -sort use sorted equations (sese, generated by seqn) + +Deprecated options: + -c c-code generation + +EOF + exit + fi +fi + + +if [ "$1" = "info" ] && [ "$3" = "" ]; then + (cd $MTT_DOC ; make --silent mtt.info) + echo "Invoking info in xterm" + xterm -e info -f $MTT_DOC/mtt.info $2 + exit +fi + +if [ "$1" = "help" ]; then + mtt_help $2 $3 + exit +fi + +if [ "$1" = "hinfo" ] && [$2 = ""]; then + mtt_check_var "$HTMLVIEW" HTMLVIEW + (cd $MTT_DOC/; make --silent mtt.html) + echo Invoking $HTMLVIEW + (cd $MTT_DOC; $HTMLVIEW file://$MTT_DOC/mtt.html)& + exit +fi + +if [ "$1" = "manual" ] && [$2 = ""]; then + mtt_check_var "$PDFVIEW" PDFVIEW + (cd $MTT_DOC/; make --silent mtt.pdf) + echo Invoking $PDFVIEW + $PDFVIEW $MTT_DOC/mtt.pdf & + exit +fi + +if [ $1 = "find" ]&& [$3 = ""]; then + mtt_find $MTT_COMPONENTS $2 + find_status=$? + if [ $find_status = "1" ]; then + echo Component $2 not found - is MTT_COMPONENTS set correctly? + fi + exit $find_status +fi + +if [ "$1" = "warranty" ] && [$2 = ""]; then + cat << EOF +Copyright (C) 1989, 1990, 1991, 1992, 1993, + 1994, 1995, 1996, 1997, 1998, 1999 Peter J. Gawthrop +This is free software with ABSOLUTELY NO WARRANTY. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +EOF + exit +fi + +# Start at abg representation +if [ -n "$start_at_abg" ]; then + if [ -f "$1_abg.m" ]; then + if [ "$quiet" != "quiet" ]; then + echo Starting from $1_abg.m + fi + else + echo $1_abg.m does not exist + exit + fi +fi + +# Clean up +if [ "$1" = "clean" ]; then + echo Removing intermediate files in `pwd` + rm -fr MTT_work + exit +fi + +# Recursively clean up +if [ "$1" = "rclean" ]; then + echo 'Removing intermediate files recursively' + dir2paths '.' | gawk '{print "mtt -q -d " $1 " clean " $2}' | sh + exit +fi + +# The big clean up +if [ "$1" = "Clean" ] && [ "$2" = "" ]; then + echo 'Removing all generated files for all systems' + rm -f *.log mtt_info.txt warning.txt + rm -f *_abg.ps *_args.* *_cr.txt *_abg.tex + rm -f *_sabg.fig *_sabg.ps *_head.fig *_bnd.fig + rm -f *_labg.fig *_lcbg.fig + rm -f *_sympar.r *_sympar.c *_sympar.h *_sympar.txt? *_sympar.tex + rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.* *_alias.* + rm -f *_sub.* *_type.sh + rm -f *_dae*.* *_cse.* *_ode.* + rm -f *_obs.* *_rfe.* *_ss.* + rm -f *_dm.* *_csm.* *_tf.* *_sr*.* *_ir*.* *_*fr.* + rm -f *_numpar.c *_input.m *_input.c *_switch.c *_switch.txt + rm -f *_sm.* *_can.* + rm -f *_struc.* *_sympar.txt *_sympar.c *_sympar.h *_sympar.m + rm -f *_odes.c *_odes.dat *_odes.gdat *_odes.m *_odes.ps *_odes.sg + rm -f *_odeso.dat *_odeso.gdat *_odeso.sdat *_odeso.m *_odeso.ps + rm -f *_*.doc *_*.idx *_*.ind *_*.ilg *_*.dvi *_*.aux *_*.lof *_*.toc + rm -f *_rep.tex + rm -f *_unique_raw_list *_raw_list + rm -f mtt_error.txt mtt_info.txt *_ode2odes.out + rm -f *_*_write.r *_simpar.m *_simpar.p + rm -f *_cseo.oct *_input.oct *_simpar.oct *_smxax.oct + rm -f *_csex.oct *_numpar.oct *_smxa.oct *_state.oct + rm -f *_ode.oct *_odeo.oct + rm -f *_cseo.mexglx *_input.mexglx *_simpar.mexglx *_smxax.mexglx + rm -f *_csex.mexglx *_numpar.mexglx *_smxa.mexglx *_state.mexglx + rm -f *_ode.mexglx *_odeo.mexglx + rm -f *_sfun.mexglx *_sfun_*.mexglx + rm -f *_cseo.cc *_input.cc *_simpar.cc *_smxax.cc + rm -f *_csex.cc *_numpar.cc *_smxa.cc *_state.cc + rm -f *_ode.cc *_odeo.cc + rm -f *_logic.m *_logic.cc *_logic.oct + rm -f *_state.m *_state.cc *_state.oct + rm -f *_ode2odes.* *.dat2 MTT.core + rm -f *_modpar.txt *_modpar.r + rm -f *_ICD.txt *_ICD.c *_ICD.cc *_ICD.m + rm -f *_ae.r *_ae.m *_ae.cc *_ae.oct + rm -f *_sese.r *_sese.m + rm -f *_sese.make *_sesx.* *_sesy.* _sae.* + rm -fR *_rep MTT_work + exit +fi + +# Clean up named system +if [ "$2" = "Clean" ] && [ "$3" = "" ]; then + echo 'Removing all generated files for system ' $1 + rm -f *.log mtt_info.txt warning.txt + rm -f $1_abg.ps $1_args.* $1_cr.txt $1_abg.tex + rm -f $1_sabg.fig $1_sabg.ps $1_head.fig $1_bnd.fig + rm -f $1_labg.fig $1_lcbg.fig + rm -f $1_sympar.r $1_sympar.c $1_sympar.h $1_sympar.txt? $1_sympar.tex + rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.* $1_alias.* + rm -f $1_sub.* $1_type.sh + rm -f $1_dae*.* $1_cse.* $1_ode.* $1_obs.* $1_rfe.* $1_ss.* + rm -f $1_dm.* $1_csm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.* + rm -f $1_numpar.m $1_numpar.c $1_input.m $1_input.c $1_switch.c $1_switch.txt + rm -f $1_sm*.* $1_can.* + rm -f $1_struc.* $1_sympar.txt $1_sympar.c $1_sympar.h $1_sympar.m + rm -f $1_odes.c $1_odes.dat $1_odes.gdat $1_odes.sdat $1_odes.m $1_odes.ps $1_odes.sg + rm -f $1_odeso.dat $1_odeso.gdat $1_odeso.m $1_odeso.ps + rm -f $1_*.doc $1_*.idx $1_*.ind $1_*.ilg $1_*.dvi $1_*.aux $1_*.lof $1_*.toc + rm -f $1_rep.tex + rm -f $1_unique_raw_list $1_raw_list + rm -f mtt_error.txt mtt_info.txt $1_ode2odes.out + rm -f $1_*_write.r $1_simpar.m $1_simpar.p + rm -f $1_cseo.oct $1_input.oct $1_simpar.oct $1_smxax.oct + rm -f $1_csex.oct $1_numpar.oct $1_smxa.oct $1_state.oct + rm -f $1_ode.oct $1_odeo.oct + rm -f $1_cseo.mexglx $1_input.mexglx $1_simpar.mexglx $1_smxax.mexglx + rm -f $1_csex.mexglx $1_numpar.mexglx $1_smxa.mexglx $1_state.mexglx + rm -f $1_ode.mexglx $1_odeo.mexglx + rm -f $1_sfun.mexglx $1_sfun_*.mexglx + rm -f $1_cseo.cc $1_input.cc $1_simpar.cc $1_smxax.cc + rm -f $1_csex.cc $1_numpar.cc $1_smxa.cc $1_state.cc + rm -f $1_ode.cc $1_odeo.cc + rm -f $1_logic.m $1_logic.cc $1_logic.oct + rm -f $1_state.m $1_state.cc $1_state.oct + rm -f $1_ode2odes.* $1.dat2 + rm -f $1_modpar.txt $1_modpar.r + rm -f $1_ICD.txt $1_ICD.c $1_ICD.cc $1_ICD.m + rm -f $1_ae.r $1_ae.m $1_ae.cc $1_ae.oct + rm -f $1_sese.r $1_sese.m + rm -f $1_sese.make $1_sesx.* $1_sesy.* $1_sae.* + rm -fR $1_rep MTT_work + exit +fi + +if [ "$2" = "rep" ]; then + documenttype=article + # See if we are making a book -- ie representation rep on a directory + isMTT_work=`pwd | grep 'MTT_work'` + if [ -n "$isMTT_work" ]; then + dotdot='../' + fi + + #isdirectory=`file $dotdot$1 | gawk '{print $2}' | grep directory` + if [ -d "$dotdot$1" ]; then + documenttype=book + fi +else + documenttype=section +fi + +case $2 in + nyfr) + NyquistStyle='True' + ;; + nifr) + NyquistStyle='True' + ;; + *) +esac + +#SUMMARY abg* acausal bond graph (fig) +#SUMMARY abg* acausal bond graph (dia) +#SUMMARY abg* acausal bond graph (ps) +#SUMMARY abg* acausal bond graph (view) +# Invoke explicit requests for modification +if [ "$2" = "abg" ] && [ "$3" = "fig" ]; then + mtt_check_var "$FIG" FIG + echo Editing $1_$2.$3 + ($FIG $1_$2.$3; cp $1_abg.fig $1_$1_abg.fig) & + exit +fi + +# Rename a system +if [ "$1" = "rename" ]; then + mtt_rename_all $2 $3 + exit +fi + +# Copy systems from the example library +if [ "$1" = "copy" ]; then + #set up source and destination dirs + source=$3 + if [ -z "$source" ]; then + source=$MTT_EXAMPLES + fi + destination=$4 + if [ -z "${destination}" ]; then + destination=$2 + fi +# check that its not here already + file_exists=`ls ${destination}/$2_abg.fig 2> /dev/null` + if [ -n "$file_exists" ]; then + if [ "$quiet" != "quiet" ]; then + echo System $2 exists already - no action taken + fi + else + source=$3 + if [ -z "$source" ]; then + source=$MTT_EXAMPLES + fi + destination=$4 + if [ -z "${destination}" ]; then + destination=$2 + fi +echo Copying system $2 from $source into directory ${destination} + find $source -name "$2" -exec cp -fr {} . \; + rm -rf ${destination}/CVS + fi + exit +fi + +# Copy components from the library +if [ "$1" = "compcopy" ]; then + + #Pull out the base name (we may have a library as well) + name=`basename $2` + + #set up source and destination dirs + source=$3 + if [ -z "$source" ]; then + source=$MTT_COMPONENTS + fi + destination=$4 + if [ -z "${destination}" ]; then + destination='.' + fi + + # check that its not here already + file_exists=`ls ${destination}/"$name"_abg.fig 2> /dev/null` + if [ -n "$file_exists" ]; then + if [ "$quiet" != "quiet" ]; then + echo Component $name exists already - no action taken + fi + else + if [ $source = "." ]; then + cp -u *_*.* ${destination} + else + comp_path=`mtt_find $source $2 path_only` + n_found=`echo $comp_path | wc | gawk '{print $2}'` + + if [ "$n_found" = "1" ]; then + echo Copying $2 from $comp_path to ${destination} + cp $comp_path/*_*.* ${destination} + exit 0 + elif [ "$n_found" = "0" ]; then + if [ "$quiet" != "quiet" ]; then + echo Component $2 not found - is MTT_COMPONENTS set correctly? + fi + exit 1 + elif [ "$n_found" > "1" ]; then + echo "Multiple versions of $2 found (see below) - use a more explicit alias" + mtt -q find $2 + exit 2 + fi + fi + fi + exit +fi + +# Copy CRs from the library +if [ "$1" = "crcopy" ]; then + # check that its not here already (or a _cr.r version) + file_exists=`ls $2.cr $2_cr.r 2> /dev/null` + if [ -n "$file_exists" ]; then + if [ "$quiet" != "quiet" ]; then + echo $2.cr or $2_cr.r exists already - no action taken + fi + else + path_name=$3 + if [ -z "$path_name" ]; then + path_name="" + for path in `echo $MTT_CRS | sed 's/:/ /g'`; do + path_name="$path_name $path/r" + done + fi + echo Copying CR $2 to here from $3 + find $path_name -name "$2.cr" -exec cp {} . \; + fi + exit +fi + + +# Version control +VC='' + +if [ "$3" = "vc" ]; then + tidy=untidy; + if [ -n "$4" ]; then + log_message=$4 + else + log_message="No Message" + fi + case $2 in + abg ) + VC='ok' + VCext='fig' ;; + lbl ) + VC='ok' + VCext='txt' ;; + desc ) + VC='ok' + VCext='tex' ;; + simp ) + VC='ok' + VCext='r' ;; + rep ) + VC='ok' + VCext='txt' ;; + numpar ) + VC='ok' + VCext='txt' ;; + input ) + VC='ok' + VCext='txt' ;; + state ) + VC='ok' + VCext='txt' ;; + odes ) + VC='ok' + VCext='h' ;; + sspar ) + VC='ok' + VCext='r' ;; + *) + echo Version control is not appropriate for representation $2 + exit ;; + esac +fi + +# Classify the representation - needed for conversion route to postscript +PLOTTYPE='single'; +case $2 in + abg ) + REPTYPE='bg' ;; + labg ) + REPTYPE='lbg' ;; + sabg ) + REPTYPE='bg' ;; + cbg ) + REPTYPE='bg' ;; + input ) + REPTYPE='txt' ;; + numpar ) + REPTYPE='txt' ;; + state ) + REPTYPE='txt' ;; + simpar ) + REPTYPE='txt' ;; + obspar ) + REPTYPE='txt' ;; + odes) + REPTYPE='data'; PLOTTYPE='multiple' ;; + odeso) + REPTYPE='data'; PLOTTYPE='multiple' ;; + sms) + REPTYPE='data'; PLOTTYPE='multiple' ;; + smso) + REPTYPE='data'; PLOTTYPE='multiple' ;; + odess) + REPTYPE='data' ;; + odesso) + REPTYPE='data' ;; + daes) + REPTYPE='data'; PLOTTYPE='multiple' ;; + daeso) + REPTYPE='data'; PLOTTYPE='multiple' ;; + ir) + REPTYPE='data' ;; + iro) + REPTYPE='data' ;; + sr) + REPTYPE='data' ;; + sro) + REPTYPE='data' ;; + fr) + REPTYPE='data' ;; + lmfr) + REPTYPE='data' ;; + lpfr) + REPTYPE='data' ;; + nyfr) + REPTYPE='data' ;; + nifr) + REPTYPE='data' ;; + *) + REPTYPE='tex' ;; +esac + + +## Set up the main arguments +sys=$1 +rep=$2 +lang=$3 + +## Make ps pdf if -pdf set +if [ "$lang" = "ps" ]; then + lang=$ps +fi + + +# Create some strings +Subsystem=$1$subsystem; + +Subsystem_=$Subsystem"_" +Subsystem_ese=$Subsystem"_ese" +Subsystem_def=$Subsystem"_def" +Subsystem_rdae=$Subsystem"_rdae" +Subsystem_dae=$Subsystem"_dae" +Subsystem_subs=$Subsystem"_subs" +Subsystem_cr=$Subsystem"_cr" +Subsystem_cbg=$Subsystem"_cbg" + + +## Create the make target name +if [ -z "${using_oct}" ]; then + target=${sys}_${rep}.${lang} +else + set_oct; + if [ "${lang}" = "m" ]; then + target=${sys}_${rep}.${m} + else + target=${sys}_${rep}.${lang} + fi +fi + +##echo $target +##target=${sys}_${rep}.${lang} + +## Arguments +ARGS=$4; _ARGS=-$4; __ARGS=`echo $_ARGS | tr ',' '-'` +__ARGS="${MTT_SWITCHES}${__ARGS}" +__ARGS=`echo ${__ARGS} | sed -e 's/-q//g' -e 's/-u//g'` + +# Save up the argument list in a file; but only if argument has changed +#DIFF doesn't like empty files - so put a blank if empty +#if [ -z "$ARGS" ]; then +# ARGS=' '; +# _ARGS=''; +#fi + +#cat > $1_args.new </dev/null` + +#if [ -n "$DIFF" ]; then +# mv $1_args.new $1_args.m +#fi + +## If in MTT_work, then copy from -dr read dirs +this_dir=`basename $PWD` +if [ "${this_dir}" = "MTT_work" ]; then + # Copy from read dirs to MTT_work + for dir in ${read_dirs}; do + if [ -n "$Verbose" ]; then + echo Copying ${dir}/* + cp --force ${dir}/* . + else + cp --force ${dir}/* . 2> /dev/null + fi + read_files=`echo ${dir}/*` + for read_file in ${read_files}; do + read_file_name=`basename ${read_file}` + touch ${read_file_name} + done + done +fi + +# Tidy mode - operate in the directory MTT-work +if [ "$tidy" = "tidy" ] && [ "$level" = "0" ]; then + # make sure that a system exists in this directory + if [ "${sys}_${rep}.${lang}" != "${sys}_abg.dia" ] && [ "${sys}_${rep}.${lang}" != "${sys}_abg.fig" ]; then + nabgs=`ls ${sys}_abg.* 2>/dev/null | wc -l` + if [ $nabgs -eq 0 ]&&[ -z "$sensitivity" ]; then + echo "MTT Error: System $sys does not exist" + exit -1; + fi + fi + mkdir -p MTT_work + valid_files=`ls | grep -v '^MTT'` + ##cp -p -u Makefile Make *.* .* MTT_work 2>/dev/null + cp -p -u -R --force ${valid_files} MTT_work 2>/dev/null + + # Go to MTT_work + cd MTT_work + + if [ -f ".octaverc" ]; then + touch .octaverc + else + echo Copying .octaverc + cp $MTT_LIB/octave/.octaverc . + fi + + if [ -f "useful-functions.hh" ]; then + touch useful-functions.hh + else + echo Copying useful-functions.hh + cp $MTT_CC/include/useful-functions.hh . + fi + + if [ -z "$directory" ]; then + Directory='' + else + Directory=$directory/MTT_work + fi + + mtt -u -q $mtt_switches -S "$Directory" $1 $2 $3 $4 + mtt_status=$? + + # Exit on failure + if [ "$mtt_status" != "0" ]; then + echo Exiting MTT with error $mtt_status + exit 1 + fi + + # Copy back from working directory + if [ "$3" != "view" ] && [ "$3" != "hview" ] && [ -z "$reset" ]; then + if [ "$3" = "html" ]; then + echo Moving $1_$2 + mv $1_$2 .. + else + if [ "$PLOTTYPE" = "multiple" -a -f $1_$2__ARGS.$ps ]; then + echo Copying $1_$2$__ARGS.$ps + cp $1_$2$__ARGS.$ps .. + else + if [ -f $1$subsystem"_"$2.$lang ]; then + echo Copying $1$subsystem"_"$2.$lang + cp -p -u $1$subsystem"_"$2.$lang .. + fi + fi + fi + fi + + # Remove the MTT_work directory if very tidy + if [ "$verytidy" = "verytidy" ]; then + echo Removing all working files + rm -rf ../MTT_work + fi +exit +fi + +# User defined representations +## Copy from library if not already here + +## .make versions +if [ -f "$MTT_REP/$2_rep.make" ]; then + if [ -f "$2_rep.make" ]; then + echo Using $2_rep.make + else + echo Copying $2_rep.make from $MTT_REP + cp $MTT_REP/$2_rep.make . + fi +fi + +if [ -f "$2_rep.make" ]; then + if [ -n "$4" ]; then + filename=$1_$2-$4.$3 + else + filename=$1_$2.$3 + fi + + #if [ -f "$filename" ]; then + # echo $filename exists + #else + if [ ! -f "$2_rep.make.ignore" ]; then + if [ -n "$Verbose" ]; then + echo make -s -f $2_rep.make "MTT_SYS=$1" "MTT_LANG=$3" "MTT_ARG=$4" "MTT_OPTS=$mtt_switches" + fi + make -s -f $2_rep.make "MTT_SYS=$1" "MTT_LANG=$3" "MTT_ARG=$4" "MTT_OPTS=$mtt_switches" + if [ -n "$4" ]; then + echo Copying $1_$2$__ARGS.$ps + cp $1_$2$__ARGS.$ps .. + fi + #fi + exit + fi +fi + +## Check for pre version 4.0 integration method specification. +if [ $level = "0" ]; then + if [ -f "$1_simpar.txt" ]; then + method_line=`grep -i METHOD $1_simpar.txt` + if [ -n "`echo $method_line | grep -i euler`" ]; then + echo Obsolete $1_simpar.txt contains: $method_line + echo " please use mtt -i euler in future" + mtt_switches="$mtt_switches -i euler"; + elif [ -n "`echo $method_line | grep -i implicit`" ]; then + echo Obsolete $1_simpar.txt contains: $method_line + echo " please use mtt -i implicit in future" + mtt_switches="$mtt_switches -i implicit"; + fi + fi +fi + +if [ -n "$reset" ]; then + if [ -f "$1_$2.$3" ]; then + echo Resetting time stamp on $1_$2.$3 + touch $1_$2.$3 + else + echo $1_$2.$3 does not exist - no action taken + fi + exit; +fi + + +if [ -n "$sensitivity" ]; then + sys_s=`echo $1 | cut -c 2-` + sys_abg=${sys_s}_abg +fi + +## Check octave version +case `$MATRIX --version | gawk -F\. '{print $2}'` in + 0) define_octave_dev="";; # stable + 1) define_octave_dev="-DOCTAVE_DEV";; # development + *) define_octave_dev="-DOCTAVE_DEV";; +esac + +################################ +# This is the main mtt programme +################################ + +#echo Target is $target, Subsystem is $Subsystem, options are $mtt_switches +##<<<<<<< mtt +##$MAKE -S ${trace} ${verbose} -f - ${target} << EOF +##======= +##$MAKE -S $verbose $verbose_make -f - $target << EOF +##>>>>>>> 1.316 +$MAKE -S ${trace} $verbose $verbose_make -f - $target << EOF + +# Cancel implicit rules I don't want +%.dvi: %.tex + +# MTT implicit rules +## .oct files +$1_%.oct: $1_%.cc $1_def.h $1_sympar.h $1_cr.h + echo Creating $1_\$*.oct; $MKOCTFILE ${MTT_CXXINCS} -DCODEGENTARGET=OCTAVEDLD $1_\$*.cc + +## pdf files from ps (new version) +$1_%.pdf: $1_%.ps + echo Creating $1_\$*.pdf; ps2pdf $1_\$*.ps $1_\$*.pdf + +## eps from ps (NB ps files are actually eps anyway) +$1_%.eps: $1_%.ps + echo Creating $1_\$*.eps; cp $1_\$*.ps $1_\$*.eps + +.PRECIOUS: mtt_%.oct +.PRECIOUS: $1_%.oct +mtt_%.oct: mtt_%.cc + echo Compiling \$< + ${MKOCTFILE} ${MTT_CXXINCS} -DCODEGENTARGET=OCTAVEDLD $define_octave_dev \$< + +## .mex files +$1_%.mexglx: $1_%.cc $1_def.h $1_sympar.h $1_cr.h mtt_kpathsea.cc mtt_matlab_octave.cc mtt_matlab_octave.hh + echo Creating $1_\$*.mexglx + ${MTT_CXX} -shared -o $1_\$*.mexglx $1_\$*.cc \ + ${MTT_MATLAB_FLAGS} -DCODEGENTARGET=MATLABMEX \ + ${MTT_CXXINCS} ${MTT_CXXLIBS} ${MTT_CXXFLAGS} mtt_kpathsea.cc mtt_matlab_octave.cc + +## .cc files +.PRECIOUS: %.cc # Don't let mtt delete them +.PRECIOUS: $1_%.cc # Don't let mtt delete them +$1_%.cc: $1_%.m + mtt_m2cc.sh $1 \$* cc cat + +mtt_%.cc:: ${MTT_LIB}/cc/mtt_%.cc + cp ${MTT_LIB}/cc/mtt_\$*.cc mtt_\$*.cc + +mtt_%.hh:: ${MTT_LIB}/cc/mtt_%.hh + cp ${MTT_LIB}/cc/mtt_\$*.hh mtt_\$*.hh + +## .o files +.PRECIOUS: $1_%.o +$1_%.o: $1_%.cc $1_def.h $1_sympar.h $1_cr.h + echo Compiling $1_\$*.cc + ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $< -DCODEGENTARGET=STANDALONE + +.PRECIOUS: mtt_%.o +mtt_%.o: mtt_%.cc + echo Compiling mtt_\$*.cc + ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $< -DCODEGENTARGET=STANDALONE $define_octave_dev + +# Copy aliased subsystems +$1_aliased_subsystems_copied: + lbl2component $1 | sh || exit 1 # Grab specified components now + touch $1_aliased_subsystems_copied + +# Generates code to write reduce code +$1_ode_write.r: $1_def.m + def2write_r $1 $2 $computation + +ifeq ("$sensitivity","sensitivity") +ifeq ("$level","0") +$1_abg.fig: $sys_abg.fig + abg2sensitivity_fig $sys_s +else # Either find the sensitivity model or fetch the model and create sensitivity model +$1_abg.fig: + mtt -q -u $mtt_switches compcopy $1 || abg2sensitivity_fig $sys_s +endif +endif + +ifneq ("$sensitivity","sensitivity") +ifneq ("$level","0") +# If level>0, try and get subsystem files; creating if necessary +ifneq ("\$(wildcard $1_abg.dia)","$1_abg.dia") +$1_abg.fig: + mtt -q -u $mtt_switches compcopy $1 +else +$1_abg.fig: +endif +endif +endif + +# Create an arg file if it doesn't exist +$1_args.m: + touch $1_args.m + +#Create list of components +ifeq ("\$(wildcard $1_abg.dia)","$1_abg.dia") +$1_cmp.txt: $1_abg.dia + abg2cmp_dia2txt $1 +else +$1_cmp.txt: $1_abg.fig + abg2cmp_fig2txt $1 +endif + +#Create skeleton files (with titles) if not already there +#SUMMARY lbl* label file (txt) +#SUMMARY lbl label file (txt) +#SUMMARY lbl* label file (view) +#SUMMARY lbl label file (view) +#SUMMARY lbl* label file (tex) +#SUMMARY lbl label file (tex) +$1_lbl.txt: $1_cmp.txt + cmp2lbl_txt $1 $sensitivity + touch $1_lbl.txt + +$1_lbl.tex: $1_lbl.txt + lbl_txt2tex $1 + +#SUMMARY alias name aliases for each subsystem (txt) +$1_alias.txt: $1_lbl.txt + lbl2alias_txt2txt $1 + +#SUMMARY modpar name modulated parameters for each subsystem (txt) +$1_modpar.txt: $1_lbl.txt + lbl2modpar_txt $1 + +#SUMMARY modpar name modulated parameters for each subsystem (r) +$1_modpar.r: $1_modpar.txt $1_struc.txt + modpar_txt2r $1 + +#SUMMARY alias name aliases for each subsystem (m) +$1_alias.m: $1_alias.txt + alias_txt2m $1 + +##SUMMARY icd interface definition for system (c) +##SUMMARY icd interface definition for system (cc) +##SUMMARY icd interface definition for system (m) +##SUMMARY icd interface definition for system (txt) + +$1_ICD.c: $1_ICD.txt + ICD_txt2lang.sh $1 c + +$1_ICD.cc: $1_ICD.txt + ICD_txt2lang.sh $1 cc + +$1_ICD.m: $1_ICD.txt + ICD_txt2lang.sh $1 m + +$1_ICD.txt: $1_icd.txt2 + icd2ICD_txt22txt.sh $1 + +$1_icd.txt2: $1_ese.r + touch $1_icd.txt2 + +#SUMMARY icd interface definitions for each subsystem (m) +$1_icd.m: $1_icd.txt + icd_txt2m.sh $1 + +#SUMMARY icd interface definitions for each subsystem (txt) +$1_icd.txt: $1_lbl.txt + lbl2icd_txt2txt.sh $1 + +#SUMMARY cr constitutive relationship for each subsystem (txt) +$1_cr.txt: $1_abg.m $1_sub.sh + abg2cr_m2txt $1 + + if [ "$level" = "0" ]; then \ + mv $1_cr.txt MTT_cr.txt; \ + else \ + cat $1_cr.txt >> MTT_cr.txt; \ + fi + + sh $1_sub.sh "rm -f " '_cr.txt' # Remove the txt.cr files + sh $1_sub.sh "mtt $mtt_switches -q -u -l $level+1 " ' cr txt' #Create new ones + + if [ "$level" = "0" ]; then \ + sort -u MTT_cr.txt> $1_cr.txt; \ + fi + +#SUMMARY cr constitutive relationship for each subsystem (r) +$1_cr.r: $1_cr.txt + cr_txt2r $1 + +#SUMMARY cr constitutive relationship header (c) +$1_cr.h: + echo Creating $1_cr.h + echo "/* CR headers for system $1 */" > $1_cr.h + +# Cheat a bit and use the top level cr file for the subsystem as well +ifneq ($sub,) +$Subsystem_cr.r: $1_cr.r + echo Creating $Subsystem_cr.r "(copying $1_cr.r)" + cp $1_cr.r $Subsystem_cr.r +endif +#SUMMARY cr constitutive relationship for each subsystem (tex) +#SUMMARY cr constitutive relationship for each subsystem (view) +$1_cr.tex: $1_cr.r + txt2tex $1 cr r + +#SUMMARY sympar symbolic parameters (txt) +#SUMMARY sympar* symbolic parameters (view) +$1_sympar.txt: $1_type.sh $1_abg.m $1_aliased.txt + mtt_make_sympar $1 ${use_reduce} + +#SUMMARY sympar symbolic parameters (r) +$1_sympar.r: $1_sympar.txt + sympar_txt2r $1 +$1_sympar.m: $1_sympar.txt + sympar_txt2m $1 +ifneq ($sort_method,make) +$1_sympar.h: $1_sympar.txt + sympar_txt2h.sh $1 $num_tmp_var +else +$1_sympar.h: $1_sympar.txt $1_sese.make + sympar_txt2h.sh $1 $num_tmp_var + declaration="static double" \ + make -f $1_sese.make declare_tmpvars |\ + tr [A-Z] [a-z] >> \$@ +endif + +#SUMMARY sympar symbolic parameters (c) +# txt to c sympar conversion +$1_sympar.c: $1_sympar.txt + sympar_txt2c $1 + +#SUMMARY sympar symbolic parameters (tex) +# txt to tex (LaTeX) sympar conversion +$1_sympar.tex: $1_sympar.txt + sympar_txt2tex $1 + +#SUMMARY logic Dynamic switch logic (tex) +#SUMMARY logic Dynamic switch logic (view) +$1_logic.tex: $1_logic.txt + txt2tex $1 logic txt + + +#SUMMARY switch Dynamic switch information (txt) +$1_switch.txt: $1_struc.txt + struc2switch_txt $1 +#$1_switchopen.m: $1_switch.txt $1_sympars.txt $1_logic.txt +# switch_txt2m $1 + +#SUMMARY sympars sympar + dynamic switch information (txt) +$1_sympars.txt: $1_sympar.txt $1_switch.txt + echo Creating $1_sympars.txt + cat $1_sympar.txt $1_switch.txt > $1_sympars.txt + +#SUMMARY simp simplification information (r) +$1_simp.r: + echo Creating $1_simp.r + ( \ + echo "%% Reduce commands to simplify output for system $1 ($1_simp.r)"; \ + cat $MTTPATH/trans/m/rcs_header.txt; \ + echo 'ON ALLFAC; %Multiplicative factors'; \ + echo 'OFF DIV; %Polynomial division'; \ + echo 'OFF FACTOR; %Factorise polynomials'; \ + echo 'OFF LIST; %Each term on a new line'; \ + echo 'FOR ALL x,y LET pow(x,y) = x^y; %Readable pow function'; \ + echo 'END;'; \ + )> $1_simp.r + +#SUMMARY subs algebraic substitution (r) +$Subsystem_subs.r: + mtt $mtt_switches -q -u $1 sympar txt; + makesubs $Subsystem; + +#SUMMARY obspar GPC observability function parameters (r) +$1_obspar.r: + echo Creating $1_obspar.r + ( \ + echo "%% Reduce GPC observability function parameters for system $1 ($1_obspar.r)"; \ + cat $MTTPATH/trans/m/rcs_header.txt; \ + echo 'MTTGPCNy := 5;'; \ + echo 'MTTGPCNu := 0;'; \ + echo 'Matrix MTTdU(5,1);'; \ + echo 'MTTdU(1,1) := MTTdU1;'; \ + echo 'MTTdU(2,1) := MTTdU2;'; \ + echo 'MTTdU(3,1) := MTTdU3;'; \ + echo 'MTTdU(4,1) := MTTdU4;'; \ + echo 'MTTdU(5,1) := MTTdU5;'; \ + echo 'Matrix MTTUU(1,5);'; \ + echo 'MTTUU(1,1) := MTTu1;'; \ + echo 'MTTUU(1,2) := MTTu11;'; \ + echo 'MTTUU(1,3) := MTTu12;'; \ + echo 'MTTUU(1,4) := MTTu13;'; \ + echo 'MTTUU(1,5) := MTTu14;'; \ + echo 'END;'; \ + )> $1_obspar.r + +#SUMMARY simpar simulation information (txt) +$1_simpar.txt: + echo Creating $1_simpar.txt + ( \ + echo '# -*-octave-*- Put Emacs into octave-mode'; \ + echo "# Simulation parameters for system $1 ($1_simpar.txt)"; \ + echo "# Generated by MTT on" `date`.; \ + cat $MTTPATH/trans/rcs_header.sh; \ + echo ;\ + echo 'FIRST = 0.0; # First time in simulation output'; \ + echo 'DT = 0.1; # Print interval'; \ + echo 'LAST = 10.0; # Last time in simulation'; \ + echo 'STEPFACTOR = 1; # Integration steps per print interval'; \ + echo 'WMIN = -1; # Minimum frequency = 10^WMIN'; \ + echo 'WMAX = 2; # Maximum frequency = 10^WMAX'; \ + echo 'WSTEPS = 100; # Number of frequency steps'; \ + echo 'INPUT = 1; # Index of the input'; \ + )> $1_simpar.txt + +#SUMMARY simpar simulation information (m) +$1_simpar.m: $1_simpar.txt $1_def.r $1_sympar.txt + mtt_txt2m $1 simpar + + +#SUMMARY numpar numerical parameter declaration -- default (txt) +$1_numpar.txt : $1_sympar.txt $1_def.r +ifeq ($target,$1_numpar.txt) + mtt_update $1 numpar update +else + mtt_update $1 numpar +endif + +#SUMMARY state numerical state declaration -- default (txt) +ifeq ($steadystate_computation,yes) +$1_state.txt : $1_struc.txt $1_sympar.txt $1_def.r $1_ss.r +else +$1_state.txt : $1_struc.txt $1_sympar.txt $1_def.r +endif + +ifeq ($target,$1_state.txt) + mtt_update $1 state update +else + mtt_update $1 state +endif + +#SUMMARY input numerical state declaration -- default (txt) +$1_input.txt : $1_struc.txt $1_sympar.txt +ifeq ($target,$1_input.txt) + mtt_update $1 input update +else + mtt_update $1 input +endif + +#SUMMARY logic Dynamic switch logic (txt) +$1_logic.txt : $1_def.r $1_struc.txt $1_sympar.txt +ifeq ($target,$1_logic.txt) + mtt_update $1 logic update +else + mtt_update $1 logic +endif + +# Dummy target +FORCE: + +ifeq ($use_reduce,yes) +$1_ode2odes_common_%.stamp: $1_ae.% $1_input.% $1_logic.% $1_numpar.% $1_simpar.% $1_state.% + touch \$@ +$1_ode2odes_common.o: $1_ae.o $1_input.o $1_logic.o $1_numpar.o $1_simpar.o $1_state.o + @echo "Creating $1_ode2odes_common.o" + ar -cr \$@ \$^ +else +$1_ode2odes_common_%.stamp: $1_sae.% $1_input.% $1_logic.% $1_numpar.% $1_simpar.% $1_state.% + touch \$@ +$1_ode2odes_common.o: $1_sae.o $1_input.o $1_logic.o $1_numpar.o $1_simpar.o $1_state.o + @echo "Creating $1_ode2odes_common.o" + ar -cr \$@ \$^ +endif + +ifeq ($use_reduce,yes) +$1_ode2odes_euler_%.stamp $1_ode2odes_rk4_%.stamp: $1_ode.% $1_odeo.% + touch \$@ +$1_ode2odes_euler.o $1_ode2odes_rk4.o: $1_ode.o $1_odeo.o mtt_euler.o + @echo "Creating \$@" + ar -cr \$@ \$^ +else +$1_ode2odes_euler_%.stamp $1_ode2odes_rk4_%.stamp: $1_sesx.% $1_sesy.% + touch \$@ +$1_ode2odes_euler.o $1_ode2odes_rk4.o: $1_sesx.o $1_sesy.o mtt_euler.o + @echo "Creating \$@" + ar -cr \$@ \$^ +endif + +ifeq ($use_reduce,yes) +$1_ode2odes_implicit_%.stamp: $1_cseo.% $1_csex.% $1_smxa.% $1_smxax.% + touch \$@ +$1_ode2odes_implicit.o: $1_cseo.o $1_csex.o $1_smxa.o $1_smxax.o mtt_implicit.o + @echo "Creating $1_ode2odes_implicit.o" + ar -cr \$@ \$^ +endif # no alternative + +ifeq ($use_reduce,yes) +$1_ode2odes_dassl_oct.stamp: $1_ode.oct $1_odeo.oct mtt_dassl.oct + touch \$@ +$1_ode2odes_dassl_o.stamp: $1_ode.o $1_odeo.o mtt_dassl.o + touch \$@ +$1_ode2odes_dassl_%.stamp: $1_ode.% $1_odeo.% + touch \$@ +$1_ode2odes_dassl.o: $1_ode.o $1_odeo.o mtt_dassl.o + @echo "Creating \$@" + ar -cr \$@ \$^ +else +$1_ode2odes_dassl_oct.stamp: $1_sesx.oct $1_sesy.oct mtt_dassl.oct + touch \$@ +$1_ode2odes_dassl_o.stamp: $1_sesx.o $1_sesy.o mtt_dassl.o + touch \$@ +$1_ode2odes_dassl_%.stamp: $1_sesx.% $1_sesy.% + touch \$@ +$1_ode2odes_dassl.o: $1_sesx.o $1_sesy.o mtt_dassl.o + @echo "Creating \$@" + ar -cr \$@ \$^ +endif + +$1_ode2odes_${algebraic_solver}.cc: mtt_Solver.cc mtt_AlgebraicSolver.cc mtt_${algebraic_solver}.hh mtt_${algebraic_solver}.cc + +$1_ode2odes_${algebraic_solver}.o: mtt_Solver.o mtt_AlgebraicSolver.o mtt_${algebraic_solver}.o + @echo "Creating $1_ode2odes_${algebraic_solver}.o" + ar -cr \$@ \$^ + +#SUMMARY numpar numerical parameter declaration (m) +$1_numpar.m: $1_numpar.txt $1_sympars.txt + mtt_txt2m $1 numpar + +#SUMMARY numpar numerical parameter declaration (c) +#SUMMARY numpar numerical parameter declaration (view) +$1_numpar.c: $1_numpar.txt $1_sympar.c + txt2c $1 numpar + + + +#SUMMARY logic logic input declaration (m) +$1_logic.m: $1_logic.txt $1_switch.txt + mtt_txt2m $1 logic + +#SUMMARY state state declaration -- default (txt) +#$1_state.txt: +# mtt $mtt_switches $1 struc txt; +# mtt $mtt_switches $1 ss r; +# struc2state_txt2txt $1 + +#SUMMARY state state declaration (m) +$1_state.m: $1_state.txt $1_sympars.txt + mtt_txt2m $1 state + +#SUMMARY desc Verbal description of system (tex) +$1_desc.tex: + makedesc $1 + + +#SUMMARY params symbolic parameter setting (r) + $1_params.r: + echo Creating $1_params.r + ( \ + echo "%% Parameter file for system $1 ($1_params.r)"; \ + echo "%% This file provides symbolic parameters for simplification";\ + cat $MTTPATH/trans/m/rcs_header.txt; \ + echo 'END;'; \ + )> $1_params.r + + +#SUMMARY sspar steady-state definition (r) +$1_sspar.r: + struc2sspar_txt2r $1 + +#SUMMARY sspar steady-state parameters (tex) +#SUMMARY sspar steady-state parameters (view) +$1_sspar.tex: $1_sspar.r + txt2tex $1 sspar r + +#SUMMARY rep* report (txt) +#SUMMARY rep report (tex) +#SUMMARY rep* report (view) +#SUMMARY rep* report (html) + + +ifeq ($documenttype,book) +$1_rep.txt: + dir2rep $1 $dotdot; +else +$1_rep.txt: + makerep_txt $1; +endif + +#SUMMARY rbg raw bond graph (m) +#Raw bond graph: fig file to mfile +$1_rbg.m: $1_abg.fig $1_lbl.txt + rbg_fig2m $1 $no_alpha_sort + +$1_cmp.m: $1_lbl.txt $1_cmp.txt + lbl2cmp_txt2m.pl --sys=$1 --$debug + +$1_fig.fig: $1_rbg.m + +#SUMMARY sabg stripped acausal bond graph (fig) +#SUMMARY sabg stripped acausal bond graph (ps) +#SUMMARY sabg stripped acausal bond graph (view) +$1_sabg.fig: $1_rbg.m + +#SUMMARY labg latex-ready acausal bond graph (fig) +$1_labg.fig: $1_rbg.m +$1_labg.tex: $1_labg.fig + fig2dev -L pstex_t -p $1_labg.eps $1_labg.fig $1_labg.tex + fig2dev -L pstex $1_labg.fig $1_labg.eps + cp -v $1_labg.eps .. + +#Subsystem creation commands +#SUMMARY sub Executable subsystem list (sh) +ifeq ($start_at_abg,yes) +$1_sub.sh: $1_abg.m + abg2sub_m2sh $1 +else +$1_sub.sh: $1_cmp.txt $1_aliased_subsystems_copied + cmp2sub_txt2sh $1 +endif + +#SUMMARY sub LaTeX subsystem list (tex) +#SUMMARY sub subsystem list (ps) +#SUMMARY sub subsystem list (view) +$1_sub.tex: $1_sub.sh +ifeq ($documenttype,section) + sub_sh2tex $1 +else + sub_sh2tex -l $1 +endif + +#SUMMARY abg acausal bond graph (m) +#Raw bond graph to acausal bond graph: mfile + +ifneq ($start_at_abg,yes) +$1_abg.m: $1_ibg.m $1_cmp.m $1_lbl.txt $1_alias.m $1_sub.sh $1_icd.m + @echo "Creating \$@" + (sh $1_sub.sh "mtt $mtt_switches -q -u -l $level+1 " ' abg m null || exit 1') || exit 1 + ibg2abg_m $info_switch $1 +endif + +ifeq ("\$(wildcard $1_abg.dia)","$1_abg.dia") +$1_ibg.m: $1_abg.dia $1_alias.m + abg2ibg_dia2m $1 +else +$1_ibg.m: $1_abg.fig $1_rbg.m + @echo "Creating \$@" + rbg2ibg_m $info_switch $1 +endif + +$1_connections.dat: $1_abg.m + abg2connections_m2dat $1 + +#SUMMARY cbg* causal bond graph (m) +#Acausal bond graph to causal bond graph: mfile +$1_cbg.m: $1_abg.m + abg2cbg_m $info_switch $causality_switch $1 + +$1_type.sh: $1_cbg.m + touch $1_type.sh + +#SUMMARY cbg* causal bond graph (fig) +#SUMMARY cbg* causal bond graph (dia) +#SUMMARY cbg* causal bond graph (ps) +#SUMMARY cbg* causal bond graph (view) +#Causal bond graph: mfile to fig conversion +$1_cbg.fig: $1_cbg.m $1_fig.fig $1_type.sh + sh $1_type.sh 'echo cbg_m2fig ' ' ' ' ' | sh + +$1_cbg.dia: $1_cbg.m + @sh $1_type.sh 'cbg_m2dia ' ' ' ' ' + +#SUMMARY ese elementary system equations (r) +#SUMMARY def definitions - system orders etc. (r) +#SUMMARY def definitions - system orders etc. (m) +#SUMMARY def definitions - system orders etc. (h) +#SUMMARY struc* structure - list of inputs, outputs and states (txt) +#SUMMARY struc structure - list of inputs, outputs and states (tex) +#SUMMARY struc* structure - list of inputs, outputs and states (view) +#SUMMARY sum structure summary - matrix of inputs, outputs and states (tex) +#SUMMARY sum* structure summary - matrix of inputs, outputs and states (view) +#Elementary system equations + definitions +${sys}_ese.r: ${sys}_cbg.m + cbg2ese_m2r $partition $info_switch $Subsystem; #ese_tidy $1 + +ifeq ($sort_method,seqn) +${sys}_sese.m: ${sys}_def.r ${sys}_sese.r ${sys}_sympar.txt + echo Creating \$@ + mtt_r2m ${sys} sese m +${sys}_sese.r: ${sys}_cbg.m ${sys}_struc.m + echo Creating \$@ + cbg2sese_m2r $info_switch $Subsystem +endif + +ifeq ($sort_method,make) +${sys}_sesx.m: ${sys}_def.r ${sys}_sesx.r ${sys}_sympar.txt + echo Creating \$@ + mtt_r2m ${sys} sesx m +${sys}_sesy.m: ${sys}_def.r ${sys}_sesy.r ${sys}_sympar.txt + echo Creating \$@ + mtt_r2m ${sys} sesy m +${sys}_sae.m: ${sys}_def.r ${sys}_sae.r ${sys}_sympar.txt + echo Creating \$@ + mtt_r2m ${sys} sae m + +${sys}_sese.r: ${sys}_sese.make + echo Creating \$@ + make -f \$< MTTdX MTTy > \$@ + echo 'END;' >> \$@ +${sys}_sesx.r: ${sys}_sese.make + echo Creating \$@ + make -f \$< MTTdX > \$@ +${sys}_sesy.r: ${sys}_sese.make + echo Creating \$@ + make -f \$< MTTy > \$@ +${sys}_sae.r: ${sys}_sese.make + echo Creating \$@ + make -f \$< MTTyz > \$@ + +${sys}_sese.make: ${sys}_ese.txt + echo Creating \$@ + ese_txt2make.pl --sys=${sys} --infile=${sys}_ese.txt --outfile=\$@ --$debug + +${sys}_ese.txt: ${sys}_ese.r ${sys}_cr.txt perl_crs.stamp + echo Creating \$@ + ese_r2txt.pl < \$< |\ + apply_crs ${sys} > \$@ + +perl_crs.stamp: + echo Copying CRs from ${MTT_LIB}/cr/perl + mkdir -p mtt + cp ${MTT_LIB}/cr/perl/*.pm mtt/ + touch \$@ +endif + +$1_def.r: $1_ese.r + touch $1_def.r +$1_struc.txt: $1_ese.r + touch $1_struc.txt +$1_aliased.txt: $1_ese.r + touch $1_aliased.txt +$1_struc.tex: $1_struc.txt + struc_txt2tex $1 +$1_sum.tex: $1_struc.txt + struc2sum_txt2tex $1 +$1_struc.m: $1_struc.txt + struc_txt2m $1 +$1_def.m: $1_def.r + def_r2m $1; matlab_tidy $1_def.m; +$1_def.h: $1_def.m $1_sympar.txt + def_m2h.sh $1 + +#SUMMARY rdae raw differential-algebraic equations (r) +#SUMMARY dae differential-algebraic equations (r) +#SUMMARY dae* differential-algebraic equations (m) +#SUMMARY dae differential-algebraic equations (tex) +#SUMMARY dae* differential-algebraic equations (view) +#SUMMARY dae differential-algebraic equations (ps) +#Differential-algebraic equations + +ifeq ($do_sort,) +${sys}_rdae.r: ${sys}_ese.r ${sys}_def.r $1_modpar.r ${Subsystem}_cr.r ${Subsystem}_subs.r +else +${sys}_rdae.r: ${sys}_sese.r ${sys}_def.r $1_modpar.r ${Subsystem}_cr.r ${Subsystem}_subs.r +endif +ifneq ($partition,) + echo Doing subsystems + mtt_make_subsystems ${sys} rdae r +endif + mtt_prepend.sh -p $1_modpar.r $1_ese.r # Add modulated parameters to start + ese2rdae_r ${cr_first} ${fixcc} ${do_sort} ${Subsystem} + tidy ${Subsystem}_rdae.r + +${sys}_dae.r: ${Subsystem}_rdae.r ${Subsystem}_def.r ${Subsystem}_subs.r ${Subsystem}_cr.r +ifneq ($partition,) + echo Doing subsystems + mtt_make_subsystems ${sys} dae r +endif +ifeq ($rdae_is_dae,1) + echo Copying $1_rdae.r to $1_dae.r + cp $1_rdae.r $1_dae.r +else + rdae2dae_r ${fixcc} ${Subsystem}; tidy ${Subsystem}_dae.r +endif + +$1_dae.m: $1_def.r $1_dae.r $1_sympars.txt + dae_r2m $1; matlab_tidy $1_dae.m; matlab_tidy $1_daeo.m +$1_dae.c: $1_def.r $1_dae.r $1_sympar.r + dae_r2c $1; c_tidy $1_dae.c +$1_dae.tex: $1_dae.r $1_simp.r + dae_r2tex $partition $1; latex_tidy $1_dae.tex + +#SUMMARY ae algebraic equations - unknown inputs (r) +#SUMMARY ae algebraic equations - unknown inputs (m) +#SUMMARY ae algebraic equations - unknown inputs (cc) + +ifeq ($algebraic_solver,noAlgebraicSolver) +$1_ae.r: +else +$1_ae.r: $1_cse.r +endif + touch \$@ + +$1_ae.m: $1_ae.r + mtt_r2m $1 ae + +#SUMMARY cse constrained-state equations (r) +#SUMMARY cse* constrained-state equations (m) +#SUMMARY cse* constrained-state equations (oct) +#SUMMARY cse constrained-state equations (tex) +#SUMMARY cse* constrained-state equations (view) +#SUMMARY cse constrained-state equations (ps) +#Constrained-state equations +${sys}_cse.r: ${Subsystem}_dae.r ${Subsystem}_dae.r ${Subsystem}_def.r ${Subsystem}_subs.r +ifneq ($partition,) + echo Doing subsystems + mtt_make_subsystems ${sys} cse r +endif + dae2cse_r $fixcc $optimise $Solve ${Subsystem}; tidy ${Subsystem}_cse.r #$1_subs.r +$1_csex.r: $1_cse.r + touch $1_csex.r +$1_cseo.r: $1_cse.r + touch $1_cseo.r + +#$1_cse.m: $1_def.r $1_cse.r $1_sympar.r $1_subs.r +# cse_r2m $1; matlab_tidy $1_cse.m +${sys}_cse.m: ${Subsystem}_def.r ${Subsystem}_cse.r ${sys}_sympars.txt +ifneq ($partition,) + echo Doing subsystems + mtt_cp_subrep ${sys} sympars txt + mtt_make_subsystems ${sys} cse m +endif + mtt_r2m ${Subsystem} cse;# matlab_tidy $1_cse.m; matlab_tidy $1_cseo.m; + +${sys}_cseo.m: ${Subsystem}_def.r ${Subsystem}_cseo.r ${sys}_sympars.txt +ifneq ($partition,) + echo Doing subsystems + mtt_cp_subrep ${sys} sympars txt + mtt_make_subsystems ${sys} cseo m +endif + mtt_r2m ${Subsystem} cseo + +${sys}_csex.m: ${Subsystem}_def.r ${Subsystem}_csex.r ${sys}_sympars.txt +ifneq ($partition,) + echo Doing subsystems + mtt_cp_subrep ${sys} sympars txt + mtt_make_subsystems ${sys} csex m +endif + mtt_r2m ${Subsystem} csex + +$1_cse.tex: $1_cse.r $1_sympar.r $1_simp.r + cse_r2tex $1 $2; latex_tidy $1_cse.tex + + +#SUMMARY scse sensitivity constrained-state equations (r) +#SUMMARY scse sensitivity constrained-state equations (tex) +#SUMMARY scse sensitivity constrained-state equations (ps) + +$1_scse.r: $1_cse.r $1_def.r + cse2scse_r $1 "$4"; tidy $1_scse.r + +#$1_cse.m: $1_def.r $1_cse.r $1_sympar.r $1_subs.r +# cse_r2m $1; matlab_tidy $1_cse.m +$1_scse.m: $1_def.m $1_scse.r $1_sympars.txt + mtt_r2m $optimise -parameters $1 scse; + matlab_tidy $1_scse.m; matlab_tidy $1_scseo.m; + +$1_scse.tex: $1_scse.r $1_sympar.r $1_simp.r + cse_r2tex $1 $2; latex_tidy $1_scse.tex + + +#SUMMARY ode ordinary differential equations (r) +#SUMMARY ode* ordinary differential equations (m) +#SUMMARY ode ordinary differential equations (c) +#SUMMARY ode ordinary differential equations (tex) +#SUMMARY ode* ordinary differential equations (view) +#SUMMARY ode ordinary differential equations (ps) +#SUMMARY ode ordinary differential equations (oct) +#Ordinary differential equations + +ifeq ($dae_is_ode,1) +$1_ode.r: $1_dae.r + echo Copying $1_dae.r to $1_ode.r + cp $1_dae.r $1_ode.r +else +$1_ode.r: $1_cse.r $1_cseo.r $1_def.r $1_sympar.r $1_subs.r + cse2ode_r $optimise $1; tidy $1_ode.r +endif + +$1_odeo.r: $1_ode.r + touch $1_odeo.r + +$1_ode.m: $1_def.r $1_ode.r + mtt_r2m $optimise -parameters $1 ode m; # matlab_tidy $1_ode.m +$1_odeo.m: $1_def.r $1_odeo.r + mtt_r2m $1 odeo m + +$1_odea.m: $1_ode.m + touch $1_odea.m + +$1_ode.tex: $1_ode.r $1_sympar.r $1_simp.r + ode_r2tex $1; latex_tidy $1_ode.tex + + +$1_lde.r: $1_dae.r + dae2lde_r $optimise $1; tidy $1_lde.r + +$1_lde.tex: $1_lde.r $1_sympar.r $1_simp.r + lde_r2tex $1; latex_tidy $1_lde.tex + +# The main simulation programme +ifeq ($integration_method,implicit) +$1_ode2odes.m : $1_def.r $1_sympars.txt \ + $1_smxa.m $1_smxax.m\ + $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ + $1_csex.m $1_cseo.m $1_logic.m +ifeq ($using_oct,yes) + touch $1_ode2odes.m # Create a dummy which wont' be used + mtt $mtt_switches -q -u $1 ode2odes oct +else + make_ode2odes $1 m $integration_method $algebraic_solver $sort_method +endif +endif +ifneq ($integration_method,implicit) +ifeq ($sort_method,seqn) +$1_ode2odes.m : $1_def.r $1_sympars.txt\ + $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ + $1_sese.m $1_logic.m +else +ifeq ($use_reduce,no) +$1_ode2odes.m : $1_def.r $1_sympars.txt\ + $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ + $1_sesx.m $1_sesy.m $1_logic.m +else +$1_ode2odes.m : $1_def.r $1_sympars.txt\ + $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ + $1_ode.m $1_odeo.m $1_logic.m +endif +endif +ifeq ($using_oct,yes) + echo "*** Warning: Shouldn't be here! Creating dummy $1_ode2odes.m" + touch $1_ode2odes.m # Create a dummy which wont' be used + mtt $mtt_switches -q -u $1 ode2odes oct +else + make_ode2odes $1 m $integration_method $algebraic_solver $sort_method +endif +endif + +#SUMMARY ode2odes Simulation function (m) +#SUMMARY ode2odes Simulation function (cc) +#SUMMARY ode2odes Simulation function (oct) +#SUMMARY ode2odes_rtxi Simulation function (o) +#SUMMARY ode2odes Simulation function (exe) +$1_ode2odes.exe: $1_def.h $1_sympar.h\ + $1_ode2odes.o $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o mtt_kpathsea.o + echo Creating $1_ode2odes.exe + ${MTT_CXX} ${MTT_CXXFLAGS} -o $1_ode2odes.exe\ + $1_ode2odes.o $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o mtt_kpathsea.o\ + ${MTT_LDFLAGS} ${MTT_CXXLIBS} + +$1_ode2odes.o: $1_ode2odes.cc $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o + echo Creating $1_ode2odes.o + ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $1_ode2odes.cc -DCODEGENTARGET=STANDALONE + +$1_ode2odes.oct: $1_ode2odes.cc $1_ode2odes_common_oct.stamp $1_ode2odes_${integration_method}_oct.stamp $1_ode2odes_${algebraic_solver}.o + touch $1_ode2odes.m + echo Creating $1_ode2odes.oct + $MKOCTFILE ${MTT_CXXINCS} -DCODEGENTARGET=OCTAVEDLD $1_ode2odes.cc mtt_${algebraic_solver}.cc mtt_Solver.cc mtt_AlgebraicSolver.cc + +$1_ode2odes.mexglx: $1_ode2odes.cc $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o + touch $1_ode2odes.m + echo Creating $1_ode2odes.mexglx + ${MTT_CXX} -DCODEGENTARGET=MATLABMEX -o $1_ode2odes.mexglx $1_ode2odes.cc \ + $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o \ + ${MTT_MATLAB_FLAGS} ${MTT_CXXINCS} ${MTT_CXXLIBS} ${MTT_CXXFLAGS} \ + ${MTT_LIB}/cc/mtt_kpathsea.cc ${MTT_LIB}/cc/mtt_matlab_octave.cc + +$1_ode2odes.cc: $1_def.r $1_sympars.txt\ + $1_ode2odes_common_m.stamp $1_ode2odes_common_cc.stamp\ + $1_ode2odes_${integration_method}_m.stamp $1_ode2odes_${integration_method}_cc.stamp\ + mtt_Solver.cc mtt_AlgebraicSolver.cc mtt_${algebraic_solver}.cc mtt_${algebraic_solver}.hh + touch $1_ode2odes.m + make_ode2odes $1 cc $integration_method $algebraic_solver $sort_method + +#SUMMARY rtxi real time module (cc) +#SUMMARY rtxi real time module (so) +$1_ode2odes_rtxi.lo: $1_ode2odes.cc $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o \ + $1_rtxi.cc $1_rtxi.h + @echo "Creating \$@" + ${MTT_RTXI_CXXCOMPILE} ${MTT_RTXI_CXXFLAGS} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $1_ode2odes.cc -DCODEGENTARGET=RTXI -o \$@ + @echo compilation complete + +$1_rtxi.so: $1_rtxi.cc $1_ode2odes_rtxi.lo $1_rtxi.h + @echo Compiling module + ${MTT_RTXI_CXXCOMPILE} ${MTT_RTXI_CXXFLAGS} -c $1_rtxi.cc -o $1_rtxi.lo + @echo Compilation complete + ${MTT_RTXI_CXXLINK} ${MTT_RTXI_LIBS} ${MTT_RTXI_LDFLAGS} ${MTT_CXXLIBS} -rpath ${MTT_RTXI_RPATH}$1 -o $1_rtxi.la $1_rtxi.lo $1_ode2odes_rtxi.lo + @echo Module created + +$1_rtxi.install: $1_rtxi.so + @echo Installing module in ${MTT_RTXI_RPATH}$1) + ${MTT_RTXI_LIBTOOL} --mode=install cp $1_rtxi.la ${MTT_RTXI_RPATH}$1 + +$1_rtxi.cc: $1_struc.txt $1_sympar.txt + echo Creating \$@ + sympar2rtxi_txt2cc $1 + +$1_rtxi.h: $1_sympar.txt + echo Creating \$@ + sympar2rtxi_txt2h $1 + + + +#Conversion of m to p to c +#SUMMARY ode ordinary differential equations (c) +#SUMMARY ode ordinary differential equations (p) +#SUMMARY state state declaration (c) +#SUMMARY state state declaration (p) +$1_simpar.p : $1_def.r $1_simpar.m + mtt_m2p $1_simpar.m +$1_numpar.p : $1_def.r $1_numpar.m + mtt_m2p $1_numpar.m +$1_state.p : $1_def.r $1_state.m + mtt_m2p $1_state.m + +#SUMMARY input numerical input declaration (m) +ifeq ($stdin,stdin) +$1_input.m : $1_def.r + make_stdin $1 m +$1_input.p : $1_def.r + make_stdin $1 p +$1_input.cc: + make_stdin $1 cc +else +$1_input.m: $1_input.txt $1_sympars.txt + mtt_txt2m $1 input +$1_input.p : $1_def.r $1_input.m + mtt_m2p $1_input.m +endif + +$1_ode.p : $1_def.r $1_ode.m + mtt_m2p $1_ode.m +$1_odeo.p : $1_def.r $1_odeo.m + mtt_m2p $1_odeo.m +$1_csex.p : $1_def.r $1_cse.m + mtt_m2p $1_csex.m +$1_cseo.p : $1_def.r $1_cseo.m + mtt_m2p $1_cseo.m +$1_smx.p : $1_def.r $1_smx.m + mtt_m2p $1_smx.m +$1_smxa.p : $1_def.r $1_smxa.m + mtt_m2p $1_smxa.m +$1_smxax.p : $1_def.r $1_smxax.m + mtt_m2p $1_smxax.m +$1_logic.p : $1_def.r $1_logic.m + mtt_m2p $1_logic.m + +ifeq ($integration_method,implicit) +$1_ode2odes.p : $1_ode2odes.m $1_def.r $1_smxa.p $1_smxax.p\ + $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ + $1_csex.p $1_cseo.p $1_logic.p + mtt_m2p $1_ode2odes.m $integration_method $stdin +endif +ifneq ($integration_method,implicit) +$1_ode2odes.p : $1_ode2odes.m $1_def.r\ + $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ + $1_ode.p $1_odeo.p $1_logic.p + mtt_m2p $1_ode2odes.m $integration_method $stdin +endif + +$1_ode2odes.c: $1_ode2odes.p + mtt_p2c $info_switch $1 ode2odes + +##SUMMARY sim Octave simulation function (m) + +#ifeq ($computation,octave) +#$1_sim.m: $1_def.r $1_sympar.txt $1_cse.m $1_cseo.m $1_smxa.m $1_smxax.m $1_numpar.m $1_state.m + mtt_make_sim $1 $integration_method $computation +#endif + +#ifeq ($computation,c) +#$1_sim.m: $1_def.r $1_sympar.txt $1_ode2odes.out $1_numpar.m $1_state.m +# mtt_make_sim $1 $integration_method $computation +#endif + +#SUMMARY ssim Octave sensitivity simulation function (m) +$1_ssim.m: $1_def.r $1_ode2odes.${m} + make_ssim $1 m + +#SUMMARY sim Octave simulation function (m) +$1_sim.m: $1_def.r $1_ode2odes.${m} + make_sim $1 m + +#SUMMARY obs observer equations for CGPC (r) +#SUMMARY obs* observer equations for CGPC (m) +#SUMMARY obs observer equations for CGPC (tex) +#SUMMARY obs* observer equations for CGPC (view) +#SUMMARY obs observer equations for CGPC (ps) +#Observer functions for GPC +$1_obs.r: $1_ode.r $1_def.r $1_obspar.r $1_subs.r + ode2obs_r $1; tidy $1_obs.r +$1_obs.m: $1_def.r $1_sympars.txt $1_obs.r $1_obspar.r $1_numpar.m + mtt_r2m $optimise -parameters $1 obs +$1_obs.tex: $1_obs.r $1_sympar.r $1_simp.r + obs_r2tex $1; latex_tidy $1_obs.tex + + +#SUMMARY rfe robot-form equations (r) +#SUMMARY rfe robot-form equations (tex) +#SUMMARY rfe* robot-form equations (view) +#SUMMARY rfe robot-form equations (ps) +#Robot-form equations +$1_rfe.r: $1_cse.r $1_csm.r $1_def.r $1_sympar.r + cse2rfe_r $1; tidy $1_rfe.r +$1_rfe.tex: $1_rfe.r $1_sympar.r $1_simp.r + rfe_r2tex $1; latex_tidy $1_rfe.tex + +#SUMMARY ss steady-state equations (r) +#SUMMARY ss* steady-state equations (m) +#SUMMARY ss steady-state equations (tex) +#SUMMARY ss* steady-state equations (view) +#SUMMARY ss steady-state equations (ps) +#Steady-states +$1_ss.r: $1_def.r $1_sspar.r $1_cr.r $1_ode.r + sspar2ss_r $1; tidy $1_ss.r +$1_ss.m: $1_def.r $1_ss.r $1_numpar.m + ss_r2m $1; matlab_tidy $1_ss.m +$1_ss.tex: $1_def.r $1_ss.r $1_simp.r + ss_r2tex $1; latex_tidy $1_ss.tex + + +#SUMMARY dm descriptor matrices (r) +#SUMMARY dm* descriptor matrices (m) +#SUMMARY dm descriptor matrices (tex) +#SUMMARY dm* descriptor matrices (view) +#SUMMARY dm descriptor matrices (ps) +#Linearised system: descriptor matrices +$1_dm.r: $1_dae.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r + dae2dm_r $1; tidy $1_dm.r +$1_dm.m: $1_def.r $1_dm.r $1_sympars.txt + mtt_r2m $optimise -parameters $1 dm +$1_dm.tex: $1_dm.r $1_sympar.r $1_simp.r + dm_r2tex $1; latex_tidy $1_dm.tex + + + +#SUMMARY csm constrained-state matrices (r) +#SUMMARY csm constrained-state matrices (m) +#SUMMARY csm constrained-state matrices (tex) +#SUMMARY csm constrained-state matrices (view) +#SUMMARY csm constrained-state matrices (ps) +#Linearised system: constrained-state matrices +$1_csm.r: $1_cse.r $1_def.r $1_cr.r $1_sspar.r + cse2csm_r $1 csm; tidy $1_csm.r +$1_csm.m: $1_def.r $1_csm.r $1_sympars.txt + mtt_r2m $optimise -parameters $1 csm; matlab_tidy $1_csm.m +$1_csm.tex: $1_csm.r $1_sympar.r $1_simp.r + csm_r2tex $1 csm; latex_tidy $1_csm.tex +#SUMMARY scsm sensitivity constrained-state matrices (r) +#SUMMARY scsm sensitivity constrained-state matrices (m) +#SUMMARY scsm sensitivity constrained-state matrices (tex) +#SUMMARY scsm sensitivity constrained-state matrices (view) +#SUMMARY scsm sensitivity constrained-state matrices (ps) +#Linearised system: sensitivity constrained-state matrices +$1_scsm.r: $1_scse.r $1_def.r $1_cr.r $1_sympar.r $1_sspar.r + cse2csm_r $1 scsm; tidy $1_scsm.r +$1_scsm.m: $1_def.r $1_scsm.r $1_sympars.txt + csm_r2m $1 scsm; matlab_tidy $1_scsm.m +$1_scsm.tex: $1_scsm.r $1_sympar.r $1_simp.r + csm_r2tex $1 scsm; latex_tidy $1_scsm.tex + +#SUMMARY sm state matrices (r) +#SUMMARY sm* state matrices (m) +#SUMMARY sm state matrices (icad) +#SUMMARY sm state matrices (tex) +#SUMMARY sm state matrices (c) +#SUMMARY sm* state matrices (view) +#SUMMARY sm state matrices (ps) +#Linearised system: state matrices +$1_sm.r: $1_csm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r + csm2sm_r $optimise $1 sm; tidy $1_sm.r +$1_sm.m: $1_def.r $1_sm.r $1_sympars.txt + mtt_r2m $optimise -parameters $1 sm +$1_sm.icad: $1_sm.m $1_numpar.m + sm_m2icad $1 +$1_sm.c: $1_def.r $1_sm.r $1_sympar.c + sm_r2c $1 +$1_sm.tex: $1_sm.r $1_sympar.r $1_simp.r + sm_r2tex $1 sm; latex_tidy $1_sm.tex + +#SUMMARY ssm sensitivity state matrices (r) +#SUMMARY ssm sensitivity state matrices (icad) +#SUMMARY ssm sensitivity state matrices (tex) +#SUMMARY ssm sensitivity state matrices (c) +#SUMMARY ssm sensitivity state matrices (ps) +#Linearised system: sensitivity state matrices +$1_ssm.r: $1_scsm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r + csm2sm_r $optimise $1 ssm; tidy $1_ssm.r +$1_ssm.m: $1_def.r $1_ssm.r $1_sympars.txt + mtt_r2m $optimise -parameters $1 ssm +$1_ssm.tex: $1_ssm.r $1_sympar.r $1_simp.r + sm_r2tex $1 ssm; latex_tidy $1_ssm.tex + +#SUMMARY smx state matrices with variable state x (r) +#SUMMARY smx state matrices with variable state x (m) +#SUMMARY smxx Sparse computation of Ax (m) +#SUMMARY smxtx Sparse computation of ATx (m) +$1_smx.r: $1_def.r $1_def.m $1_ode.r $1_subs.r + ode2smx_lang $1 r; tidy $1_smx.r + +$1_smx.m: $1_def.r $1_def.m $1_cse.r $1_sympars.txt $1_subs.r + cse2smx_lang $fixcc $optimise -parameters $1 smx m + +$1_smxa.m: $1_def.r $1_def.m $1_cse.r $1_sympars.txt $1_subs.r + cse2smx_lang $fixcc $optimise -parameters $matrix_smxa $1 smxa m + +$1_smxax.m: $1_def.r $1_def.m $1_cse.r $1_sympars.txt $1_subs.r + cse2smx_lang $fixcc $optimise -parameters $1 smxax m + +#SUMMARY smc controller form state matrices etc. - siso only (r) +#SUMMARY smc controller form state matrices etc. - siso only (tex) +#SUMMARY smc* controller form state matrices etc. - siso only (m) +#SUMMARY smc* controller form state matrices etc. - siso only (view) +#SUMMARY smc controller form state matrices etc. - siso only (ps) +#Linearised system: controller form state matrices etc. +$1_smc.r: $1_sm.r $1_def.r $1_tf.r + sm2smc_r $1; tidy $1_smc.r +$1_smc.tex: $1_smc.r $1_simp.r + smc_r2tex $1; latex_tidy $1_smc.tex +$1_smc.m: $1_def.r $1_smc.r $1_numpar.m + smc_r2m $1; matlab_tidy $1_smc.m + +#SUMMARY smo observer form state matrices etc. - siso only (r) +#SUMMARY smo observer form state matrices etc. - siso only (tex) +#SUMMARY smo* observer form state matrices etc. - siso only (m) +#SUMMARY smo* observer form state matrices etc. - siso only (view) +#SUMMARY smo observer form state matrices etc. - siso only (ps) +#Linearised system: observer form state matrices etc. +$1_smo.r: $1_sm.r $1_def.r $1_tf.r + sm2smo_r $1; tidy $1_smo.r +$1_smo.tex: $1_smo.r $1_simp.r + smo_r2tex $1; latex_tidy $1_smo.tex +$1_smo.m: $1_def.r $1_smo.r $1_numpar.m + smo_r2m $1; matlab_tidy $1_smo.m + +#SUMMARY ssk State-space controller gain - siso only (r) +#SUMMARY ssk State-space controller gain - siso only (tex) +#SUMMARY ssk* State-space controller gain - siso only (m) +#SUMMARY ssk* State-space controller gain - siso only (view) +#SUMMARY ssk State-space controller gain - siso only (ps) +#Linearised system: State-space controller gain +$1_ssk.r: $1_def.r $1_smc.r + smc2ssk_r $1; tidy $1_ssk.r +$1_ssk.tex: $1_ssk.r $1_simp.r + ssk_r2tex $1; latex_tidy $1_ssk.tex +$1_ssk.m: $1_def.r $1_ssk.r $1_numpar.m + ssk_r2m $1; matlab_tidy $1_ssk.m + +#SUMMARY ssl State-space observer gain - siso only (r) +#SUMMARY ssl State-space observer gain - siso only (tex) +#SUMMARY ssl* State-space observer gain - siso only (m) +#SUMMARY ssl* State-space observer gain - siso only (view) +#SUMMARY ssl State-space observer gain - siso only (ps) +#Linearised system: State-space observer gain +$1_ssl.r: $1_def.r $1_smo.r + smo2ssl_r $1; tidy $1_ssl.r +$1_ssl.tex: $1_ssl.r $1_simp.r + ssl_r2tex $1; latex_tidy $1_ssl.tex +$1_ssl.m: $1_def.r $1_ssl.r $1_numpar.m + ssl_r2m $1; matlab_tidy $1_ssl.m + +#SUMMARY tf transfer function (r) +#SUMMARY tf* transfer function (m) +#SUMMARY tf transfer function (tex) +#SUMMARY tf* transfer function (view) +#SUMMARY tf transfer function (ps) +#Linearised system: transfer function +$1_tf.r: $1_dm.r $1_sympar.r + dm2tf_r $1; tidy $1_tf.r +$1_tf.m: $1_def.r $1_sympars.txt $1_tf.r + tf_r2m $1; matlab_tidy $1_tf.m +$1_tf.tex: $1_def.r $1_tf.r $1_sympar.r $1_simp.r + tf_r2tex $1; latex_tidy $1_tf.tex + +#SUMMARY pkim partialyy-known system identification matrix (r) +#SUMMARY pkim partialyy-known system identification matrix (tex) +#SUMMARY pkim partialyy-known system identification matrix (view) +#SUMMARY pkim partialyy-known system identification matrix (ps) +$1_pkim.r: $1_tf.r $1_sympar.r + tf2pkim_r $1; tidy $1_pkim.r +$1_pkim.tex: $1_def.r $1_pkim.r $1_simp.r + pkim_r2tex $1; latex_tidy $1_pkim.tex + +#SUMMARY ctf controller transfer function (r) +#SUMMARY ctf controller transfer function (m) +#SUMMARY ctf controller transfer function (tex) +#SUMMARY ctf controller transfer function (view) +#SUMMARY ctf controller transfer function (ps) +#Linearised system: transfer function +$1_ctf.r: $1_dm.r $1_ssk.r $1_ssl.r $1_sm.r + ssk2ctf_r $1; tidy $1_ctf.r +$1_ctf.m: $1_def.r $1_ctf.r + ctf_r2m $1; matlab_tidy $1_ctf.m +$1_ctf.tex: $1_def.r $1_ctf.r $1_sympar.r $1_simp.r + ctf_r2tex $1; latex_tidy $1_ctf.tex + +#SUMMARY ir impulse response - state (m) +#SUMMARY ir impulse response - state (dat) +#SUMMARY ir impulse response - state (ps) +#SUMMARY ir impulse response - state (view) + +#SUMMARY iro impulse response - output (m) +#SUMMARY iro impulse response - output (dat) +#SUMMARY iro impulse response - output (ps) +#SUMMARY iro impulse response - output (view) + +#SUMMARY sr step response - state (m) +#SUMMARY sr step response - state (dat) +#SUMMARY sr step response - state (ps) +#SUMMARY sr step response - state (view) + +#SUMMARY sro* step response - output (m) +#SUMMARY sro step response - output (dat) +#SUMMARY sro step response - output (ps) +#SUMMARY sro* step response - output (view) + +#SUMMARY odes ode solution - state (m) +#SUMMARY odes* ode solution - state (dat) +#SUMMARY odes* ode solution - state & output for SciGraphica (sg) +#SUMMARY odes* ode solution - state (ps) +#SUMMARY odes* ode solution - state (view) + +#SUMMARY sms ode (in state matrix form) solution - state & output (c) + +#SUMMARY odeso ode solution - output (m) +#SUMMARY odeso* ode solution - output (dat) +#SUMMARY odeso* ode solution - output for spreadsheet (sdat) +#SUMMARY odeso ode solution - output (ps) +#SUMMARY odeso* ode solution - output (view) + +#SUMMARY daes dae solution - state (m) +#SUMMARY daes dae solution - state (dat) +#SUMMARY daes dae solution - state (ps) +#SUMMARY daes dae solution - state (view) + +#SUMMARY daeso dae solution - output (m) +#SUMMARY daeso dae solution - output (dat) +#SUMMARY daeso dae solution - output (ps) +#SUMMARY daeso dae solution - output (view) + +#Time responses +$1_ir.m: $1_sm.m $1_numpar.m $1_def.m $1_simpar.m + sm2ir_m $1 '$ARGS' +$1_iro.m: $1_ir.m + touch $1_iro.m +$1_ir.dat: $1_ir.m + m2dat $1_ir +$1_iro.dat: $1_iro.m + m2dat $1_iro +$1_sr.m: $1_sm.m $1_numpar.m $1_simpar.m $1_def.m + sm2sr_m $1 +$1_sr.dat: $1_sr.m + m2dat $1_sr +$1_sro.m: $1_sr.m + touch $1_sro.m$ +$1_sro.dat: $1_sro.m + m2dat $1_sro +1_odes.c: $1_ode.c $1_def.r $1_sympar.r + ode2odes_r2c $1 +$1_sms.c: $1_sm.c $1_def.r $1_sympar.r + sm2sms_r2c $1 + +.PRECIOUS: $1_odes.dat2 +ifeq ($computation,octave) +ifeq ($using_oct,yes) +$1_odes.dat2: $1_ode2odes.oct + time octave_ode2odes $1 +else +$1_odes.dat2: $1_ode2odes.m + time octave_ode2odes $1 +endif +endif + +$1_ode2odes.out: $1_ode2odes.c $1_cr.h + echo Creating $1_odes.out by compiling $1_ode2odes.c + $CC $1_ode2odes.c -lp2c -lm -o $1_ode2odes.out + +ifeq ($computation,c) +$1_odes.dat2: $1_ode2odes.out + echo Creating $1_odes.dat2 using c version + time ./$1_ode2odes.out>$1_odes.dat2 +endif + +ifeq ($computation,cc) +$1_sim.exe: $1_ese.r + mtt $mtt_switches -q $1 sim exe + +$1_odes.dat2: $1_ode2odes.exe + echo Creating $1_odes.dat2 using cc version $ARGS + time ./$1_ode2odes.exe $ARGS >$1_odes.dat2 +endif + + +#$1_odeso.m: $1_odes.m +# touch $1_odeso.m +#$1_smso.m: $1_sms.m +# touch $1_smso.m +#$1_daes.m: $1_dae.m $1_numpar.m $1_def.m $1_input.m $1_simpar.m +# dae2daes_m $1 '$ARGS' +#$1_daeso.m: $1_daes.m +# touch $1_daeso.m + + +#Conversion of data files from dat to sdat format +$1_odeso.sdat: $1_odeso.dat $1_struc.txt + odeso_dat2sdat $1 + +$1_odes.sdat: $1_odes.dat $1_struc.txt + odes_dat2sdat $1 + +#Conversion of data to SciGraphica +$1_odes.sg: $1_struc.m $1_odes.dat2 + echo Creating $1_odes.sg + dat22sg.sh $1 + +#SUMMARY odess ode numerical steady-states - states (m) +#SUMMARY odess ode numerical steady-states - states (dat) +#SUMMARY odess ode numerical steady-states - states (ps) +#SUMMARY odess ode numerical steady-states - states (view) + +#SUMMARY odesso ode numerical steady-states - outputs (m) +#SUMMARY odesso ode numerical steady-states - outputs (dat) +#SUMMARY odesso ode numerical steady-states - outputs (ps) +#SUMMARY odesso ode numerical steady-states - outputs (view) + +#Numerical steady states +$1_odess.dat2: $1_ode.m $1_odeo.m $1_numpar.m $1_input.m $1_simpar.m + ode2odess_m2dat2 $1 +#$1_odess.m: $1_ode.m $1_odeo.m $1_numpar.m $1_input.m $1_simpar.m +# ode2odess_m $1 +#$1_odesso.m: $1_odess.m +# touch $1_odesso.m + + +#SUMMARY fr frequency response (m) +#SUMMARY fr frequency response (dat) +#SUMMARY fr frequency response (ps) +#SUMMARY fr frequency response (view) + +#SUMMARY lmfr loglog modulus frequency response (m) +#SUMMARY lmfr loglog modulus frequency response (dat) +#SUMMARY lmfr loglog modulus frequency response (ps) +#SUMMARY lmfr* loglog modulus frequency response (view) + +#SUMMARY lpfr semilog phase frequency response (m) +#SUMMARY lpfr semilog phase frequency response (dat) +#SUMMARY lpfr semilog phase frequency response (ps) +#SUMMARY lpfr* semilog phase frequency response (view) + +#SUMMARY nyfr Nyquist style frequency response (m) +#SUMMARY nyfr Nyquist style frequency response (dat) +#SUMMARY nyfr Nyquist style frequency response (ps) +#SUMMARY nyfr Nyquist style frequency response (view) + +#SUMMARY nifr Nichols style frequency response (m) +#SUMMARY nifr Nichols style frequency response (dat) +#SUMMARY nifr Nichols style frequency response (ps) +#SUMMARY nifr Nichols style frequency response (view) + + +#Frequency responses +$1_fr.m: $1_dm.m $1_numpar.m $1_def.m $1_simpar.m + dm2fr_m $1 +$1_lmfr.m $1_lpfr.m $1_nyfr.m $1_nifr.m: $1_fr.m + +$1_fr.dat: $1_fr.m + m2dat $1_fr +$1_lmfr.dat: $1_lmfr.m + m2dat $1_lmfr +$1_lpfr.dat: $1_lpfr.m + m2dat $1_lpfr +$1_nyfr.dat: $1_nyfr.m + m2dat $1_nyfr +$1_nifr.dat: $1_nifr.m + m2dat $1_nifr + + +ifeq ($REPTYPE,txt) +#Generic conversion of txt files to tex files +$1_$2.tex: $1_$2.txt + txt2tex $1 $2 txt + endif + +#Conversion of dat2 files to dat format +$1_odeso.dat: $1_odes.dat2 $1_def.r + echo Creating $1_odeso.dat + dat22dat $1 ode so +$1_odes.dat: $1_odes.dat2 $1_def.r + echo Creating $1_odes.dat + dat22dat $1 ode s +$1_odesso.dat: $1_odess.dat2 $1_def.r + echo Creating $1_odesso.dat + dat22dat $1 odes so +$1_odess.dat: $1_odess.dat2 $1_def.r + echo Creating $1_odess.dat + dat22dat $1 odes s + +#Generic conversion of data files from dat to (gplot) gdat format +$1_$2.gdat: $1_$2.dat $1_struc.txt $1_args.m + dat2gdat $1 $2 "$ARGS" "$NyquistStyle" + +## Conversion of gdat to fig files +ifeq ($REPTYPE,data) +$1_$2.fig: $1_$2.gdat + gdat2fig $1_$2 + +ifneq ($ARGS,) ## Multiple plots + echo Creating $1_$2$__ARGS.fig + mv $1_$2.fig $1_$2$__ARGS.fig + rm -f $1_$2.gdat +endif + +## Conversion of gdat fig files to ps/pdf +ifeq ($ARGS,) # single plot +$1_$2.$ps : $1_$2.fig + echo Creating $1_$2.$ps + fig2dev -L$eps $1_$2.fig > $1_$2.$ps +else ## Multiple plots +$1_$2.$ps : $1_$2.fig + mtt -q -r $1 $2 dat $4 + echo Creating $1_$2$__ARGS.$ps + fig2dev -L$eps $1_$2$__ARGS.fig > $1_$2$__ARGS.$ps +endif + +endif + + +#Generic conversion of Latex to latex document +mtt.sty: + echo Copying mtt.sty to here + cp $MTTPATH/trans/mtt.sty . +$1_$2.doc: $1_$2.tex + makedoc "$mtt_switches" "$1" "$2" "$3" "$4" "$documenttype" "$ps" + + +#Create PostScript version of dia and fig files +ifeq ($REPTYPE,bg) +ifeq ("\$(wildcard $1_abg.dia)","$1_abg.dia") +$1_$2.$ps : $1_$2.dia +else +$1_$2.$ps : $1_$2.fig +endif + echo Creating $1_$2.$ps + bg2eps $1 $2 $ps $eps +endif + +ifeq ($REPTYPE,lbg) +$1_$2.$ps : $1_$2.fig + labg_fig2ps $1_$2 +endif + +ifeq ($REPTYPE,tex) +#Generic conversion of LaTeX doc to dvi or pdf +$1_$2.$ps: $1_$2.doc + doc2$ps $1_$2 "$documenttype" +endif + + +ifeq ($REPTYPE,tex) +#Create html version of dvi file +$1_$2.html: $1_$2.doc + echo Creating $1_$2/$1_$2.html + $LATEX2HTML $1_$2.doc>latex2html.log 2>latex2html.log +endif + +#Default view +ifeq ($REPTYPE,bg) +$1_$2.view : $Subsystem_$2.pview +endif + +ifeq ($REPTYPE,data) +$1_$2.view: $1_$2.$ps +ifeq ($ARGS,) # single plot + echo Creating view of $1_$2 - $ps file + $psview $1_$2.$ps& +else + echo Creating view of $1_$2$__ARGS - $ps file + $psview $1_$2$__ARGS.$ps& +endif +endif + +ifeq ($REPTYPE,tex) +$1_$2.view : $1_$2.pview +endif + +ifeq ($REPTYPE,txt) +$1_$2.view : $1_$2.tview +endif + +# Hypertext view +$1_$2.hview: $1_$2.html + $HTMLVIEW $1_$2/$1_$2.html& + +#View a ps file +$Subsystem_$2.pview: $1_$2.$ps + echo Creating view of $Subsystem_$2 - $ps file + mtt_multi $psview $Subsystem $2 $ps $viewlevel | sh + +#View a gdat file +$1_$2.dview: $1_$2.gdat + echo Creating view of $1_$2 + gdat2view $1_$2 '$ARGS'& + +#View a tex file +$1_$2.tview: $1_$2.dvi + echo Creating view of $1_$2 + $DVIVIEW $1_$2.dvi& + +#Report generation +$1_rep.make: $1_rep.txt + rep_txt2make $1 "$mtt_switches" + +$1_reps_made: + rep_txt2sh $1 "$mtt_switches"; touch $1_reps_made + +$1_rep.tex: $1_rep.txt $1_reps_made + rep_txt2tex $1 "$documenttype" "$directory" "$mtt_switches"; + +#SUMMARY abg Acausal bond graph report (tex) +$1_abg.tex: $1_sub.sh $1_labg.tex + sh $1_sub.sh "mtt -q " " labg tex" + abg2tex $pdf ${sensitivity_switch} $1 + +#SUMMARY tf Transfer function (mml) +$1_$2.mml: $1_$2.r + mtt_r2mml $1 $2 + + +# Version control system - uses RCS +RCS: + echo Creating RCS + mkdir RCS +$1_$2.vc: RCS + echo Version control on $1_$2.$VCext with message: $log_message + ci -m"$log_message" -I $1_$2.$VCext /dev/null +fi + +#Print what's going on if in verbose mode +if [ -n "$Verbose" ]; then + echo Finishing mtt $mtt_switches $1 $2 $3 $4 at level $level +fi + +if [ "$make_status" != "0" ]; then + echo Exiting MTT with error $make_status + exit 1 +fi ADDED mtt/bin/mtt_backup Index: mtt/bin/mtt_backup ================================================================== --- mtt/bin/mtt_backup +++ mtt/bin/mtt_backup @@ -0,0 +1,74 @@ +#!/bin/sh +# Does a backup with date of selected files. + + +while [ -n "`echo $1 | grep '^-'`" ]; do +case $1 in + -d) + format=date; + shift + ;; + -v) + format=version; + shift + ;; + -h) + echo "Usage: mtt_backup [-d|-v] [lib|doc]"; + exit + ;; + *) + format=date; +esac +done + +#Name of archive +if [ -z "$1" ]; then + mtt="mtt" + dirs='mtt mtt-lib mtt-cc mtt-doc' +else + mtt="mtt-$1" + dirs=$mtt +fi + +## Create appropriate filename +case $format in + date) + filename=`date | gawk '{printf("%s_%s%s_%s.tgz\n", mtt, $2,$3,$6)}' mtt=$mtt`; + shift + ;; + version) + filename=`mtt --version | gawk '{printf("%s-%s.tar.gz\n", mtt, $NF)}' mtt=$mtt`; + shift + ;; + + *) + +esac + +echo Backup file $filename + + + +#Check whether archive exists here +if [ -f "$filename" ]; then + echo File $filename already exists - exiting + exit +fi + +# Listing files to ignore +#echo Finding irrelevant files +#find $dirs -name '*.*' -print |\ +# grep 'dvi$\|ps$\|gif$\|log$\|dat$\|MTT_work\|core\|~$' >IGNORE +#wc IGNORE | gawk '{print "Ignoring", $1, "files"}' + +#echo examples >> IGNORE + +#Inform user +echo Backing up $dirs to $filename + +#Tar the files +#tar --exclude-from IGNORE --create --gzip --file $filename $dir +tar --create --gzip --file $filename $dirs +#Size info +ls -l $filename +# ADDED mtt/bin/mtt_backups Index: mtt/bin/mtt_backups ================================================================== --- mtt/bin/mtt_backups +++ mtt/bin/mtt_backups @@ -0,0 +1,16 @@ +#!/bin/sh +# Does a backup with date of all mtt components +# $Log$ +# Revision 1.2 2000/10/03 12:17:58 peterg +# Prints usage line +# + +if [ -z "$1" ]; then + echo "Usage: mtt_backups [-v|-d]" + exit +fi +mtt_backup $1 +mtt_backup $1 cc +mtt_backup $1 lib +mtt_backup $1 doc + ADDED mtt/bin/mtt_check_sese Index: mtt/bin/mtt_check_sese ================================================================== --- mtt/bin/mtt_check_sese +++ mtt/bin/mtt_check_sese @@ -0,0 +1,30 @@ +#! /bin/sh +## This script tests the sese generation by comparing the +## dae files generated by the conventional approach +## Copyright (C) 2003 by Peter J. Gawthrop + +sys=$1 + +## Correct dae file. +rm -vf ${sys}_ese.r MTT_work/${sys}_ese.r +mtt -q ${sys} dae r +mv -v ${sys}_dae.r ${sys}_dae.r_CORRECT + +## sese file +rm -vf ${sys}_sese.r MTT_work/${sys}_sese.r +mtt -q ${sys} sese r + +## Create the dae file from the sese file +cp -v ${sys}_sese.r ${sys}_ese.r +mtt -q ${sys} dae r + +## And test +diff ${sys}_dae.r ${sys}_dae.r_CORRECT > mtt_diffs + +## Result +if [ "$?" = "0" ]; then + echo "****** dae files are the same ******" +else + echo "****** dae files are different ******" + cat mtt_diffs +fi ADDED mtt/bin/mtt_check_var Index: mtt/bin/mtt_check_var ================================================================== --- mtt/bin/mtt_check_var +++ mtt/bin/mtt_check_var @@ -0,0 +1,40 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_check_var + +# P.J.Gawthrop July 1997 +# Copyright (c) P.J.Gawthrop 1997 + + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +# Revision 1.2 1997/12/04 10:41:15 peterg +# Added third argument to print env. variables. +# +## Revision 1.1 1997/07/27 13:11:37 peterg +## Initial revision +## +############################################################### + +var=$1 +name=$2 +print=$3 +software=$4 + +if [ -z "$1" ]; then + echo '*** MTT WARNING Environment variable' $name 'not set. *****' + echo "Please check that software package $software has been correctely installed" + echo + exit +fi + +if [ "$print" = "print" ]; then + echo Environment variable $name set to $var +fi ADDED mtt/bin/mtt_check_vars Index: mtt/bin/mtt_check_vars ================================================================== --- mtt/bin/mtt_check_vars +++ mtt/bin/mtt_check_vars @@ -0,0 +1,92 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_check_vars + +# P.J.Gawthrop July 1997 +# Copyright (c) P.J.Gawthrop 1997 + + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.8.2.1 2001/03/06 03:48:43 geraint +## Print additional environment variable for "mtt -p". +## MTT_LDFLAGS defaults to " " to avoid installation warning. +## +## Revision 1.8 2000/12/27 13:11:42 peterg +## *** empty log message *** +## +## Revision 1.7 2000/08/04 15:48:30 peterg +## Added PDF +## +## Revision 1.6 2000/05/22 12:37:24 peterg +## *** empty log message *** +## +## Revision 1.5 2000/05/22 12:34:07 peterg +## Added MTT_REP +## +## Revision 1.4 1998/07/30 17:30:41 peterg +## Added some more paths +## +## Revision 1.3 1998/01/23 13:33:47 peterg +## Removed OCTAVE_PATH +## Removed RMATRIX +## +# Revision 1.2 1997/12/04 10:41:49 peterg +# Added -p argument to print environment variables +# +## Revision 1.1 1997/07/27 13:12:03 peterg +## Initial revision +## +############################################################### + +#Look for a command line argument +while [ -n "`echo $1 | grep '-'`" ]; do + case $1 in + -p ) + print=print ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +# Octave +#mtt_check_var "$OCTAVE_PATH" "OCTAVE_PATH" "$print" "Octave" + +# LaTeX +#mtt_check_var "$TEXFORMATS" "TEXFORMATS" "$print" "LaTeX" +#mtt_check_var "$TEXINPUTS" "TEXINPUTS" "$print" "LaTeX" +#mtt_check_var "$TEXFONTS" "TEXFONTS" "$print" "LaTeX" + +# MTT variables +mtt_check_var "$MAKE" "MAKE" "$print" "MTT" +mtt_check_var "$MTTPATH" "MTTPATH" "$print" "MTT" +mtt_check_var "$MTT_CRS" "MTT_CRS" "$print" "MTT" +mtt_check_var "$MTT_COMPONENTS" "MTT_COMPONENTS" "$print" "MTT" +mtt_check_var "$MTT_EXAMPLES" "MTT_EXAMPLES" "$print" "MTT" +mtt_check_var "$MTT_LIB" "MTT_LIB" "$print" "MTT" +mtt_check_var "$MTT_REP" "MTT_REP" "$print" "MTT" +mtt_check_var "$MATRIX" "MATRIX" "$print" "MTT" +mtt_check_var "$SYMBOLIC" "SYMBOLIC" "$print" "MTT" +mtt_check_var "$FIG" "FIG" "$print" "MTT" +mtt_check_var "$PSVIEW" "PSVIEW" "$print" "MTT" +mtt_check_var "$PDFVIEW" "PDFVIEW" "$print" "MTT" +mtt_check_var "$HTMLVIEW" "HTMLVIEW" "$print" "MTT" +mtt_check_var "$DVIVIEW" "DVIVIEW" "$print" "MTT" +mtt_check_var "$CC" "CC" "$print" "MTT" +mtt_check_var "$LATEX2HTML" "LATEX2HTML" "$print" "MTT" +mtt_check_var "$MKOCTFILE" "MKOCTFILE" "$print" "MTT" +mtt_check_var "$MTT_CXX" "MTT_CXX" "$print" "MTT" +mtt_check_var "$MTT_CXXFLAGS" "MTT_CXXFLAGS" "$print" "MTT" +mtt_check_var "$MTT_CXXLIBS" "MTT_CXXLIBS" "$print" "MTT" +mtt_check_var "$MTT_CXXINCS" "MTT_CXXINCS" "$print" "MTT" +mtt_check_var "$MTT_LDFLAGS" "MTT_LDFLAGS" "$print" "MTT" + + ADDED mtt/bin/mtt_cvs2deb Index: mtt/bin/mtt_cvs2deb ================================================================== --- mtt/bin/mtt_cvs2deb +++ mtt/bin/mtt_cvs2deb @@ -0,0 +1,190 @@ +#! /bin/sh + +# Script to create a .deb package from the current cvs sources. + +usage () +{ + cat < .disk/info +tmpfile=`mktemp mtt_deb2cd.tmp.XXXXXXXXXX` +echo "Scanning .deb packages" +dpkg-scanpackages . ${tmpfile} | gzip > ./Packages.gz +rm ${tmpfile} +# create Redhat package +echo "Creating .rpm, please wait ..." +alien --to-rpm ${debfile} +chown -R ${my_user:-"root"}.${my_group:-"root"} . +cd .. + +echo "Directory created (${tmpdir}) - copy this to iso9660 image as /" + +exit 0 ADDED mtt/bin/mtt_find Index: mtt/bin/mtt_find ================================================================== --- mtt/bin/mtt_find +++ mtt/bin/mtt_find @@ -0,0 +1,124 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_find +# mtt_find path name operation +# P.J.Gawthrop Nov 1996 +# Copyright (c) P.J.Gawthrop 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 2000/10/03 18:29:57 peterg +## *** empty log message *** +## +## Revision 1.6 1998/07/17 19:47:35 peterg +## Minor changes +## +## Revision 1.5 1998/07/17 07:50:33 peterg +## Now handles library name +## Returns a status +## 0 if exactly one result +## 1 if no results +## 2 if two or more results +## 3 if utterly confused +## +## Revision 1.4 1998/07/16 20:40:24 peterg +## Cleaned up algorithms +## +## Revision 1.3 1998/07/16 09:15:34 peterg +## Now prints: +## dir +## name_lbl.txt +## access time +## +## Revision 1.2 1997/09/04 09:15:19 peterg +## Includes summary line as well as description lines +## +## Revision 1.1 1996/11/10 10:48:45 peterg +## Initial revision +## +############################################################### + +# Set up dummy file +rm -f mtt_junk +touch mtt_junk + +# Interpret the arguments +path="$1" + +if [ -n "$2" ]; then + name=`basename $2` + longname=$2 + Name="-name $name" +else + name='*' +fi + +# If this is non-empty just print the path +path_only=$3 + +# Find all dirs in path with same name as component +# AND the path contains the full (name+library) name +paths=`echo $path | tr ":" " "` +foundpath=`\ +for thepath in $paths; do + find $thepath -type d $Name -print +done |\ +sort -u |\ +grep "$longname"` + +# If empty set foundpath to the simple components path +if [ -z "$foundpath" ]; then + foundpath="$MTT_LIB/comp/simple" +fi + +# If non-null result, check that the name_ext file exists in dir name +# and print dirname and file name and last access time +if [ -n "$foundpath" ]; then + if [ -n "$path_only" ]; then + format='%h\n'; + else + format='%h\t%f\t%Ac\n'; + fi + for thepath in $foundpath ; do + if [ "$thepath" = "$MTT_COMPONENTS/simple" ]; then + ext='cause.m'; # finds _cause.m + simple='simple'; + else + ext='lbl.txt'; # finds _lbl.txt + fi + dirname=`basename $thepath` + if [ -n "$simple" ]; then + fullname="$name"_"$ext" + else + fullname="$dirname"_"$ext" + fi + find $thepath -maxdepth 1 -name $fullname -printf $format; + done |\ + tee mtt_junk +fi + +# Check exit status and return +hits=`wc mtt_junk | gawk '{print $1}'` +rm -f mtt_junk + +if [ $hits = "1" ]; then + exit 0 +elif [ $hits = "0" ]; then + exit 1 +elif [ $hits > "1" ]; then + exit 2 +else + exit 3 +fi + + + + + ADDED mtt/bin/mtt_help Index: mtt/bin/mtt_help ================================================================== --- mtt/bin/mtt_help +++ mtt/bin/mtt_help @@ -0,0 +1,197 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_help + +# P.J.Gawthrop Nov 1996 +# Copyright (c) P.J.Gawthrop 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.14 2000/10/03 18:29:26 peterg +## crs now works after a fashion +## +## Revision 1.13 2000/04/04 15:22:44 peterg +## Major changes: simple components now work +## Single components now work +## +## Revision 1.12 1998/07/21 08:47:59 peterg +## Default null $2 (regexp) to '^' - ie match any line +## +## Revision 1.11 1998/07/16 20:41:05 peterg +## Now uses new mtt_help +## +## Revision 1.10 1998/05/18 08:35:19 peterg +## Surround arguments to tr with "" +## +## Revision 1.9 1998/03/26 08:23:02 peterg +## Use mixed case Topic for *) part of case sttement +## +## Revision 1.8 1998/03/22 21:13:17 peterg +## Fixed bug in above +## +## Revision 1.7 1998/03/22 20:21:11 peterg +## $topic now converted to lower case. +## +## Revision 1.6 1997/09/04 09:35:04 peterg +## Changed $ext to give accurate match -- matches t ot m at end of +## filename +## +# Revision 1.5 1997/09/04 09:21:01 peterg +# Added context-dependent sort. +# +# Revision 1.4 1997/09/04 09:16:29 peterg +# Removed sort -u +# +## Revision 1.3 1996/11/09 21:10:20 peterg +## Tidied up searches by putting everyrhing into lib. +## +# Revision 1.2 1996/11/02 10:22:54 peterg +# Now browses crs. +# +## Revision 1.1 1996/11/01 12:34:54 peterg +## Initial revision +## +############################################################### + +comment='#'; +Topic=$1 +topic=`echo $Topic | tr "[A-Z]" "[a-z]"` + +if [ -n "$2" ]; then + regexp=$2; +else + regexp='^'; +fi + +if [ "$topic" = "" ]; then + echo 'Usage: mtt help representations' + echo ' mtt help simple' + echo ' mtt help components' + echo ' mtt help examples' + echo ' mtt help CRs' + echo ' mtt help representations ' + echo ' mtt help components ' + echo ' mtt help examples ' + echo ' mtt help CRs ' + echo ' mtt help ' + exit +fi + +ext='_[cl]*.*[mt]' +summary='[%#]SUMMARY' +description='[%#]DESCRIPTION' +alias='[%#]ALIAS' +lbl="_lbl.txt" + +case $topic in + components) + key=$summary + find_path="$MTT_COMPONENTS" + name='' + sort='sort -u' + blurb="components";; + + simple) + key=$summary + find_path="$MTT_COMPONENTS/simple" + name='' + sort='sort -u' + blurb="simple components";; + + crs) + key=$summary + find_path=$MTT_CRS/r + name='*.cr' + sort='sort -u' + blurb="constitutive relationships";; + + examples) + key=$summary + find_path=$MTT_EXAMPLES + name='' + all='all' + sort='sort -u' + blurb="Examples";; + + representations) + key=$summary + find_path=$MTTPATH + name='mtt' + all='all' + sort='sort -u' + blurb="Representations";; + + *) + other=OTHER; + key="$summary|$description|$alias" + find_path=$MTT_LIB + name=$Topic + all='all' + sort='cat' + blurb=$Topic;; +esac + +subtopic=$2 +if [ "$subtopic" = "" ]; then + subtopic='.' +fi; + + +case $topic in + representations) + echo $comment $blurb + mtt2reps_txt + + ;; + crs) + echo $comment $blurb + find $find_path -name "$name" -print |\ + gawk '{print "grep", key, $1}' key=$key | sh |\ + sed "s/$key //" | $sort + ;; + *) + + fullnames=`mtt_find $find_path "$name" | gawk '{printf("%s/%s\n",$1,$2)}'` + N=`echo $fullnames | wc -w`; + if [ -z "$fullnames" ]; then + echo $comment No $blurb found. + else + echo $comment $N $blurb found. + for fullname in $fullnames; do + name=`basename $fullname` + if [ -n "$other" ]; then + cat $fullname | egrep $key + else + info=`cat $fullname | egrep $key | gawk '{for (i=2;i<=NF;i++) print $i}'` + category=`echo $fullname | sed "s!$find_path/!!" ` + category=`dirname $category` + echo $category $name $info + fi + done + fi + esac +exit + + + gawk '{print "cat " $1 "/" $2}' | sh |\ + egrep $key | egrep $regexp |\ + sed "s/$summary[ ]*//" |\ + sed "s/$description[ ]*/ /" |\ + sed "s/$alias[ ]*/ Alias: /" |\ + sed "s!$find_path/!!" |\ + $sort + + + + + + + + ADDED mtt/bin/mtt_pause Index: mtt/bin/mtt_pause ================================================================== --- mtt/bin/mtt_pause +++ mtt/bin/mtt_pause @@ -0,0 +1,10 @@ +#! /bin/sh + +## mtt_pause: Just waits for an EOF +## P J Gawthrop April 2000 +## Copyright (C) 2000 by Peter J. Gawthrop + +echo $* + +mtt $* +cat>/dev/null ADDED mtt/bin/mtt_rename Index: mtt/bin/mtt_rename ================================================================== --- mtt/bin/mtt_rename +++ mtt/bin/mtt_rename @@ -0,0 +1,57 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_rename + +# P.J.Gawthrop Jan 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2002/04/22 08:05:26 gawthrop +## New regexp. +## +## Revision 1.5 2000/12/27 13:11:42 peterg +## *** empty log message *** +## +## Revision 1.4 1998/08/15 13:50:22 peterg +## Doesn't zap preexisting files +## +## Revision 1.3 1998/08/14 15:37:38 peterg +## rename now copies - no delete +## +## Revision 1.2 1998/01/06 13:57:39 peterg +## Now removes old version after copying +## +# Revision 1.1 1998/01/06 13:48:23 peterg +# Initial revision +# +############################################################### + +old_name=$1 +new_name=$2 +extension=$3 + +left='[^a-zA-Z]' +right=$left +if [ -f "$new_name$extension" ]; then + echo "$new_name$extension already exists -- no action taken" + exit +fi +if ls $old_name$extension > /dev/null 2>&1 + then + echo Renaming $old_name$extension to $new_name$extension + sed \ + -e "s/\($left\)$old_name\($right\)/\1$new_name\2/g" \ + -e "s/^$old_name\($right\)/$new_name\1/g" \ + <$old_name$extension >$new_name$extension +fi + + + ADDED mtt/bin/mtt_rename_all Index: mtt/bin/mtt_rename_all ================================================================== --- mtt/bin/mtt_rename_all +++ mtt/bin/mtt_rename_all @@ -0,0 +1,58 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_rename_all + +# P.J.Gawthrop Jan 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 2000/03/17 11:50:18 peterg +## Added pic.fig -- schematic +## +## Revision 1.6 1998/07/22 15:20:06 peterg +## Added state.txt +## +## Revision 1.5 1998/04/13 09:15:36 peterg +## Added obspar +## +## Revision 1.4 1998/03/27 07:38:32 peterg +## simpar.r ---> simpar.txt +## +## Revision 1.3 1998/03/26 14:47:43 peterg +## Addes subs and cr +## +## Revision 1.2 1998/03/02 17:14:06 peterg +## Added simpar to list +## +## Revision 1.1 1998/01/06 13:57:59 peterg +## Initial revision +## +############################################################### + +old_name=$1 +new_name=$2 + +mtt_rename $old_name $new_name _abg.fig +mtt_rename $old_name $new_name _cr.r +mtt_rename $old_name $new_name _desc.tex +mtt_rename $old_name $new_name _input.txt +mtt_rename $old_name $new_name _lbl.txt +mtt_rename $old_name $new_name _logic.txt +mtt_rename $old_name $new_name _numpar.txt +mtt_rename $old_name $new_name _obspar.r +mtt_rename $old_name $new_name _odes.h +mtt_rename $old_name $new_name _rep.txt +mtt_rename $old_name $new_name _pic.fig +mtt_rename $old_name $new_name _simp.r +mtt_rename $old_name $new_name _simpar.txt +mtt_rename $old_name $new_name _sspar.r +mtt_rename $old_name $new_name _state.txt +mtt_rename $old_name $new_name _subs.r ADDED mtt/bin/mtt_version Index: mtt/bin/mtt_version ================================================================== --- mtt/bin/mtt_version +++ mtt/bin/mtt_version @@ -0,0 +1,47 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_version +# Prints out version of a GNU-style tool + +# P.J.Gawthrop May 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1999/12/20 02:08:38 peterg +## Added second arg option +## +## Revision 1.2 1998/05/28 09:31:44 peterg +## Cosmetic changes +## +## Revision 1.1 1998/05/28 09:31:13 peterg +## Initial revision +## +############################################################### + +if [ -z "$2" ]; then + echo Trying $1 ... + ver=`$1 --version | head -1` + if [ -n "$ver" ]; then + echo is OK and has version $ver. + else + echo Either $1 does not exist or is not the GNU version. + fi +else + echo $1: $2 +fi + + + + + + + + ADDED mtt/bin/mtt_versions Index: mtt/bin/mtt_versions ================================================================== --- mtt/bin/mtt_versions +++ mtt/bin/mtt_versions @@ -0,0 +1,88 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_versions + +# P.J.Gawthrop May 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2005/02/17 22:15:35 geraint +## Added missing quotes to conditional expression. +## +## Revision 1.5 2005/02/17 18:36:38 geraint +## Removed a bash-ism: replaced [[ conditional ]] with [ conditional ] +## +## Revision 1.4 2003/08/06 22:39:40 geraint +## Fixed reporting of non-existent software, no longer says "is OK and has version .". +## +## Revision 1.3 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.2 2000/11/13 21:40:26 peterg +## Sorted out the non-gnu +## +## Revision 1.1 1998/05/28 09:24:41 peterg +## Initial revision +## +############################################################### + +echo Versions of mtt and its components on `date` + +## gnu standard --version +mtt_version mtt + +echo Doing the GNU components +mtt_version gawk +mtt_version basename +mtt_version cat +mtt_version cp +mtt_version dirname +mtt_version gcc +mtt_version grep +mtt_version head +mtt_version make +mtt_version octave +mtt_version sed +mtt_version tail +mtt_version tr + +## Non standards +echo Doing the non-GNU components + +print_version () +{ + program=${1:-"Error: unknown program"} + shift; + version=$* + if [ "${version:-""}" ]; then + echo is OK and has version $version. + else + echo $program does not exist. + fi +} + +echo Trying xfig ... +xfig -help 2> mtt_junk; version=`grep Xfig mtt_junk` +print_version xfig $version + +echo Trying fig2dev ... +fig2dev -h > mtt_junk; version=`grep -i patchlevel mtt_junk` +print_version fig2dev $version + +echo Trying reduce ... +reduce -w >mtt_junk 2>1 < ghostview +## +## Revision 1.38 2003/07/13 21:53:24 geraint +## Updated to conform to latest Octave (tested with 2.1.49). +## - the pathsearch library was merged into liboctave last year +## - static_cast no longer seems to work between Matrix and ColumnVector +## +## Revision 1.37 2002/09/19 08:08:15 gawthrop +## Updated documentation documentation +## +## Revision 1.36 2002/08/28 15:48:00 geraint +## Updated mttrc to make standalone C++ compilation configuration clearer. +## +## Revision 1.35 2002/08/06 09:56:54 geraint +## Updated to work with changes in unstable version of Octave 2.1.36. +## Tested with 2.0.17 (ok) but will break earlier unstables (2.1.(<=35)). +## +## Revision 1.34 2002/05/08 14:51:03 geraint +## Moved matlab/octave data type conversion functions to a separate file. +## +## Revision 1.33 2002/05/08 11:39:36 gawthrop +## Added MTT_REP to PATH +## +## Revision 1.32 2002/05/07 23:50:34 geraint +## Preliminary support for Matlab dynamically linked shared objects: +## invoke with: mtt -cc sys rep mexglx +## ode2odes support is not yet included. +## +## Revision 1.31 2002/05/02 20:12:45 geraint +## Added -Wl,--rpath to MTT_CXXLIBS. Sets the runtime linker path so that the +## sys-admin does not have to ldconfig the octave directory for -cc to work. +## +## Revision 1.30 2002/05/02 11:10:11 geraint +## s/loctave/loctinterp/ +## +## Revision 1.29 2002/05/02 11:03:46 geraint +## Reinstated -liboctinterp and -lncurses; needed by xleftdiv. +## +## Revision 1.28 2002/05/01 12:21:29 geraint +## No longer uses save_ascii_data_for_plotting function to write data +## - eliminates dependence on liboctinterp (and libncurses) for .cc. +## +## Revision 1.27 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.26 2002/04/26 16:16:33 geraint +## Removed unnecessary variables PLAT and GCCVERS. +## +## Revision 1.25 2002/04/02 09:16:39 geraint +## Tidied up library search paths, now assumes that system libraries are set up correctly. +## For Debian, this means installing the following: blas-dev, fftw-dev, lapack-dev, libncurses5-dev, libkpathsea-dev, libreadline-dev +## It may also be necessary to run /sbin/ldconfig on the relevant directories (especially Octave's). +## +## Revision 1.24 2001/10/15 14:28:35 gawthrop +## Now has . at start of components library path $MTT_COMPONENTS +## +## Revision 1.23 2001/07/24 22:32:49 gawthrop +## Use gv, not ghostview +## +## Revision 1.22 2001/04/12 03:08:00 geraint +## Improved sh->csh conversion, reduces environment namespace pollution. +## Still need to do proper if [ -z $MTT_BASE ] ... else ... fi conversion. +## +## Revision 1.21 2001/04/10 13:56:13 gawthrop +## Uses standard mkoctfile +## +## Revision 1.20 2001/04/10 13:08:19 gawthrop +## Smoother translation to .cs using sh2csh +## +## Revision 1.19 2001/03/30 15:13:49 gawthrop +## Rationalised simulation modes to each return mtt_data +## +## Revision 1.18 2001/03/19 02:28:52 geraint +## Branch merge: merging-ode2odes-exe back to MAIN. +## +## Revision 1.17.2.4 2001/03/06 03:48:43 geraint +## Print additional environment variable for "mtt -p". +## MTT_LDFLAGS defaults to " " to avoid installation warning. +## +## Revision 1.17.2.3 2001/03/01 05:05:53 geraint +## Minor revisions. +## +## Revision 1.17.2.2 2001/02/23 03:53:53 geraint +## Minor revisions. (ode2odes.exe works on GNU/Linux and ~GNU/Irix) +## +## Revision 1.17.2.1 2001/02/22 06:41:40 geraint +## Initial merge of ode2odes.exe into main mtt. +## standalone_rep.make deleted: rules moved to mtt, variables to mttrc. +## +## Revision 1.17 2000/12/27 16:46:13 peterg +## Stripped the mtt- from paths +## +## Revision 1.16 2000/12/27 15:16:44 peterg +## If then else format +## +## Revision 1.15 2000/12/27 14:57:43 peterg +## Now takes the base path as an argument +## +## Revision 1.14 2000/12/27 13:11:43 peterg +## *** empty log message *** +## +## Revision 1.13 2000/10/03 12:12:14 peterg +## New path structure to account for three way split in mtt tree +## +## Revision 1.12 2000/09/18 12:17:07 peterg +## Now includes to control system toolbox in OCTAVE_PATH +## Don't use -path stuff - use :: instead. +## +## Revision 1.11 2000/05/21 17:55:15 peterg +## New rep path +## +## Revision 1.10 2000/05/16 11:41:23 peterg +## *** empty log message *** +## +## Revision 1.9 1999/03/11 04:02:19 peterg +## Revised so that sh2csh does its stuff. +## +## Revision 1.8 1998/07/17 19:48:46 peterg +## *** empty log message *** +## +## Revision 1.7 1998/03/24 09:11:49 peterg +## Compatible with .csh version +## +## Revision 1.6 1998/03/13 11:53:29 peterg +## reduce --> reduce 64 +## +## Revision 1.5 1998/01/16 08:55:01 peterg +## MAKE=make +## +## Revision 1.4 1998/01/06 09:14:51 peterg +## Added latex2html to setup +## +# Revision 1.3 1998/01/06 09:11:26 peterg +# Removed matlab from the setup +# +# Revision 1.2 1997/12/04 10:49:16 peterg +# Put under RCS at last +# Added CC variable +# +############################################################### + +## When using csh, replace $1 by the mtt base path, eg /usr/share/mtt/latest +export MTT_BASE=$1 + +if [ -z "$MTT_BASE" ]; then + echo mttrc requires one argument: eg mttrc /usr/share/mtt/latest +else + echo Setting paths with base $MTT_BASE + # The following line sets up the make to use -- gmake is the standard + # but you may wish to use lsmake for parallelism + export MAKE='make' + + # The following sets up the c compiler + export CC='gcc' + + # Setup the paths + export MTTPATH=$MTT_BASE/bin + export MTT_LIB=$MTT_BASE/lib + export MTT_DOC=$MTT_BASE/doc + export MTT_CC=$MTT_BASE/cc + + export MTT_COMPONENTS=.:$MTT_LIB/comp + export MTT_CRS=$MTT_LIB/cr + export MTT_EXAMPLES=$MTT_LIB/examples + export MTT_REP=$MTT_LIB/rep + + export PATH=$PATH\:$MTTPATH\:$MTTPATH/trans\:$MTT_CC\:$MTT_REP + + #Setup octave +##<<<<<<< mttrc +## export MATRIX_PATH=$MTTPATH/trans/m/ +## export MATRIX_PATH=$MATRIX_PATH\:$MTT_LIB/comp/simple/ +## export MATRIX_PATH=$MATRIX_PATH\:$MTT_LIB/control/ +## export MATRIX_PATH=$MATRIX_PATH\:$MTT_LIB/octave/\:\: + +##======= + MATRIX="octave" + #MATRIX_PATH1=$(echo "genpath('$MTTPATH/trans/m')" |$MATRIX -q | awk '{print $3}') + #MATRIX_PATH2=$(echo "genpath('$MTT_LIB/comp/simple')" |$MATRIX -q | awk '{print $3}') + #MATRIX_PATH3=$(echo "genpath('$MTT_LIB/control')" |$MATRIX -q | awk '{print $3}') + #MATRIX_PATH4=$(echo "genpath('$MTT_LIB/octave')" |$MATRIX -q | awk '{print $3}') + #export MATRIX_PATH=$MATRIX_PATH1:$MATRIX_PATH2:$MATRIX_PATH3:$MATRIX_PATH4 + MATRIX_PATH1=$(find $MTTPATH/trans/m -type d|grep -v CVS|awk '{printf ":%s", $0}') + MATRIX_PATH2=$(find $MTT_LIB/comp/simple -type d|grep -v CVS|awk '{printf ":%s", $0}') + MATRIX_PATH3=$(find $MTT_LIB/control -type d|grep -v CVS|awk '{printf ":%s", $0}') + MATRIX_PATH4=$(find $MTT_LIB/octave -type d|grep -v CVS|awk '{printf ":%s", $0}') + export MATRIX_PATH=$MATRIX_PATH1:$MATRIX_PATH2:$MATRIX_PATH3:$MATRIX_PATH4 +##>>>>>>> 1.45 + export OCTAVE_PATH=.\:$MATRIX_PATH +##<<<<<<< mttrc + export MATRIX="octave --path $OCTAVE_PATH" +##======= +## export MATRIX="$MATRIX --path $OCTAVE_PATH" +##>>>>>>> 1.45 + + # Setup the symbolic stuff + ##export SYMBOLIC='reduce 64' + export SYMBOLIC='reduce -w' + + + # Setup xfig + export FIG="xfig \ + -startfontsize 20 \ + -metric \ + -portrait \ + -startgridmode 2 \ + -pheight 21 \ + -pwidth 30 \ + -library_dir $MTT_LIB/xfig/\ + " + + # Setup ps viewer + export PSVIEW='evince' + + # Setup pdf viewer + export PDFVIEW='acroread' + + # Setup html viewer + export HTMLVIEW='firefox' + + # Setup dvi viewer + export DVIVIEW='xdvi' + + # Setup latex2html + export LATEX2HTML="latex2html -contents_in_navigation -index_in_navigation -address http://mtt.sourceforge.net" + + # Ascend stuff + export ASCENDLIBRARY=$MTTPATH/ascend/lib + + # Oct file generation - use version with no optimisation. + #export MKOCTFILE=$MTT_LIB/octave/mkoctfile # This for no optimisation + export MKOCTFILE=mkoctfile + + ######################################################################################### + ## + ## Configure environment for standalone compilation of files linked with Octave libraries + ## (required for ode2odes.exe only) + + # location of Octave directories on local system (usually /usr, /usr/local or /opt) + + OCTAVEPREFIX="/usr" + + # include paths for Octave + + IOCTAVE="-I${OCTAVEPREFIX}/include/octave/ -I${OCTAVEPREFIX}/include/octave/octave" + + # include and library paths for Octave + + if [ -z `which ${MKOCTFILE}` ]; then + # Octave development stuff not installed + # C++ and .oct representations will not work + OCTAVE_INC_FLAGS=" " + OCTAVE_LIB_FLAGS=" " + else + OCTAVE_INC_FLAGS="`${MKOCTFILE} --print INCFLAGS`" + OCTAVE_LIB_FLAGS="\ + `${MKOCTFILE} --print LFLAGS` \ + `${MKOCTFILE} --print LIBOCTAVE` \ + `${MKOCTFILE} --print LIBCRUFT` \ + `${MKOCTFILE} --print LIBOCTINTERP` \ + `${MKOCTFILE} --print BLAS_LIBS` \ + `${MKOCTFILE} --print FFTW_LIBS` \ + `${MKOCTFILE} --print LIBS` \ + `${MKOCTFILE} --print FLIBS` \ + `${MKOCTFILE} --print RLD_FLAG`" + fi + + # C++ compiler options + + DEBUG="-g" + OPTIM="-O3" + FLAGS="-fno-rtti -fno-exceptions -fno-implicit-templates" + + # exported variables + + export MTT_CXX="g++" + export MTT_CXXFLAGS="${DEBUG} ${OPTIM} ${FLAGS}" + export MTT_CXXLIBS="${OCTAVE_LIB_FLAGS}" + export MTT_CXXINCS="-I. -I${MTT_LIB}/cc ${OCTAVE_INC_FLAGS}" + export MTT_LDFLAGS=" " + + ## End of Octave environment configuration + ## + ######################################################################################### + + ############################################################ + ## + ## Configure environment for compilation of Matlab mex files + + MATLAB_ARCH="glnx86" + MATLAB_ROOT="/usr/local/matlab6p1" + MATLAB_FLAGS="-shared -fPIC -ansi -D_GNU_SOURCE -pthread" + MATLAB_INCS="-I${MATLAB_ROOT}/extern/include" + MATLAB_LIBS="-Wl,--rpath-link,${MATLAB_ROOT}/extern/lib/${MATLAB_ARCH},--rpath-link,${MATLAB_ROOT}/bin/${MATLAB_ARCH} -L${MATLAB_ROOT}/bin/${MATLAB_ARCH} -lmx -lmex -lm" + + # exported variables + + export MTT_MATLAB_FLAGS="${MATLAB_FLAGS} ${MATLAB_INCS} ${MATLAB_LIBS}" + + ## End of Matlab environment configuration + ## + ############################################################# + + ####################################################### + ## + ## Configure environment for compilation of RTXI module + +##<<<<<<< mttrc + ## RTXI_INCS="-I/usr/local/src/mtt/rtxi/rtxi_cvs_30Sep05/include -I/usr/include/qt3 -I/home/peterg/Development/rtxi/include" +# MORE_RTXI_INCS="-I/usr/realtime/include -I/usr/src/linux/include" +##======= + ROOT="/usr/local/rtxi-knoppix" + + RTXI_LIBTOOL="${ROOT}/usr/local/lib/rtxi/libtool" + RTXI_CXX="g++-3.3" + RTXI_CXXLD="g++-3.3" + RTXI_CXXCOMPILE="${RTXI_LIBTOOL} --mode=compile --tag CXX ${RTXI_CXX}" + RTXI_CXXLINK="${RTXI_LIBTOOL} --mode=link --tag CXX ${RTXI_CXXLD}" + + RTXI_INCS="" + RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/share/qt3/include" + RTXI_INCS="${RTXI_INCS} -I." + RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/realtime/include" + RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/share/qt3/include" + RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/src/comedi/include" + RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/src/rtxi/include" + + RTXI_DEFS="-D_REENTRANT -DQT_THREAD_SUPPORT" + RTXI_CXXFLAGS="-g -O2 ${RTXI_INCS} ${RTXI_DEFS}" + RTXI_LIBS="-L${ROOT}/usr/share/qt3/lib -lqt-mt" +##>>>>>>> 1.45 + RTXI_FLAGS="-DHAVE_CONFIG_H -D_REENTRANT -DQT_THREAD_SUPPORT" + RTXI_LDFLAGS="-L${ROOT}/usr/realtime/lib -lpthread -module -avoid-version" + RTXI_RPATH="${ROOT}/usr/local/lib/rtxi/models/" + + export MTT_RTXI_CXXCOMPILE="${RTXI_CXXCOMPILE}" + export MTT_RTXI_CXXLINK="${RTXI_CXXLINK}" + export MTT_RTXI_LIBTOOL="${RTXI_LIBTOOL}" + export MTT_RTXI_CXXFLAGS="${RTXI_CXXFLAGS}" + export MTT_RTXI_LIBS="${RTXI_LIBS}" + export MTT_RTXI_FLAGS="${RTXI_RTXI_FLAGS}" + export MTT_RTXI_LDFLAGS="${RTXI_LDFLAGS}" + export MTT_RTXI_RPATH="${RTXI_RPATH}" + + ## End of RTXI environment configuration + ## + ############################################################# + +fi ADDED mtt/bin/mttrc.csh Index: mtt/bin/mttrc.csh ================================================================== --- mtt/bin/mttrc.csh +++ mtt/bin/mttrc.csh @@ -0,0 +1,275 @@ +#!/bin/csh +## Automatically generated from bashrc on Wed Aug 28 15:17:42 BST 2002 - DO NOT EDIT +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mttrc - sets up paths etc for mtt +# Usage: mttrc + +# Copyright (c) P.J.Gawthrop 1996,1977. + + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.35 2002/08/06 09:56:54 geraint +## Updated to work with changes in unstable version of Octave 2.1.36. +## Tested with 2.0.17 (ok) but will break earlier unstables (2.1.(<=35)). +## +## Revision 1.34 2002/05/08 14:51:03 geraint +## Moved matlab/octave data type conversion functions to a separate file. +## +## Revision 1.33 2002/05/08 11:39:36 gawthrop +## Added MTT_REP to PATH +## +## Revision 1.32 2002/05/07 23:50:34 geraint +## Preliminary support for Matlab dynamically linked shared objects: +## invoke with: mtt -cc sys rep mexglx +## ode2odes support is not yet included. +## +## Revision 1.31 2002/05/02 20:12:45 geraint +## Added -Wl,--rpath to MTT_CXXLIBS. Sets the runtime linker path so that the +## sys-admin does not have to ldconfig the octave directory for -cc to work. +## +## Revision 1.30 2002/05/02 11:10:11 geraint +## s/loctave/loctinterp/ +## +## Revision 1.29 2002/05/02 11:03:46 geraint +## Reinstated -liboctinterp and -lncurses; needed by xleftdiv. +## +## Revision 1.28 2002/05/01 12:21:29 geraint +## No longer uses save_ascii_data_for_plotting function to write data +## - eliminates dependence on liboctinterp (and libncurses) for .cc. +## +## Revision 1.27 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.26 2002/04/26 16:16:33 geraint +## Removed unnecessary variables PLAT and GCCVERS. +## +## Revision 1.25 2002/04/02 09:16:39 geraint +## Tidied up library search paths, now assumes that system libraries are set up correctly. +## For Debian, this means installing the following: blas-dev, fftw-dev, lapack-dev, libncurses5-dev, libkpathsea-dev, libreadline-dev +## It may also be necessary to run /sbin/ldconfig on the relevant directories (especially Octave's). +## +## Revision 1.24 2001/10/15 14:28:35 gawthrop +## Now has . at start of components library path $MTT_COMPONENTS +## +## Revision 1.23 2001/07/24 22:32:49 gawthrop +## Use gv, not ghostview +## +## Revision 1.22 2001/04/12 03:08:00 geraint +## Improved sh->csh conversion, reduces environment namespace pollution. +## +## Revision 1.21 2001/04/10 13:56:13 gawthrop +## Uses standard mkoctfile +## +## Revision 1.20 2001/04/10 13:08:19 gawthrop +## Smoother translation to .cs using sh2csh +## +## Revision 1.19 2001/03/30 15:13:49 gawthrop +## Rationalised simulation modes to each return mtt_data +## +## Revision 1.18 2001/03/19 02:28:52 geraint +## Branch merge: merging-ode2odes-exe back to MAIN. +## +## Revision 1.17.2.4 2001/03/06 03:48:43 geraint +## Print additional environment variable for "mtt -p". +## MTT_LDFLAGS defaults to " " to avoid installation warning. +## +## Revision 1.17.2.3 2001/03/01 05:05:53 geraint +## Minor revisions. +## +## Revision 1.17.2.2 2001/02/23 03:53:53 geraint +## Minor revisions. (ode2odes.exe works on GNU/Linux and ~GNU/Irix) +## +## Revision 1.17.2.1 2001/02/22 06:41:40 geraint +## Initial merge of ode2odes.exe into main mtt. +## standalone_rep.make deleted: rules moved to mtt, variables to mttrc. +## +## Revision 1.17 2000/12/27 16:46:13 peterg +## Stripped the mtt- from paths +## +## Revision 1.16 2000/12/27 15:16:44 peterg +## +## Revision 1.15 2000/12/27 14:57:43 peterg +## Now takes the base path as an argument +## +## Revision 1.14 2000/12/27 13:11:43 peterg +## *** empty log message *** +## +## Revision 1.13 2000/10/03 12:12:14 peterg +## New path structure to account for three way split in mtt tree +## +## Revision 1.12 2000/09/18 12:17:07 peterg +## Now includes to control system toolbox in OCTAVE_PATH +## Don't use -path stuff - use :: instead. +## +## Revision 1.11 2000/05/21 17:55:15 peterg +## New rep path +## +## Revision 1.10 2000/05/16 11:41:23 peterg +## *** empty log message *** +## +## Revision 1.9 1999/03/11 04:02:19 peterg +## Revised so that sh2csh does its stuff. +## +## Revision 1.8 1998/07/17 19:48:46 peterg +## *** empty log message *** +## +## Revision 1.7 1998/03/24 09:11:49 peterg +## Compatible with .csh version +## +## Revision 1.6 1998/03/13 11:53:29 peterg +## reduce --> reduce 64 +## +## Revision 1.5 1998/01/16 08:55:01 peterg +## MAKE=make +## +## Revision 1.4 1998/01/06 09:14:51 peterg +## Added latex2html to setup +## +# Revision 1.3 1998/01/06 09:11:26 peterg +# Removed matlab from the setup +# +# Revision 1.2 1997/12/04 10:49:16 peterg +# Put under RCS at last +# Added CC variable +# +############################################################### + +## When using csh, replace /usr/local/mtt/mttroot/mtt by the mtt base path, eg /usr/share/mtt/latest +setenv MTT_BASE /usr/local/mtt/mttroot/mtt + + echo Setting paths with base $MTT_BASE + # The following line sets up the make to use -- gmake is the standard + # but you may wish to use lsmake for parallelism + setenv MAKE 'make' + + # The following sets up the c compiler + setenv CC 'gcc' + + # Setup the paths + setenv MTTPATH $MTT_BASE/bin + setenv MTT_LIB $MTT_BASE/lib + setenv MTT_DOC $MTT_BASE/doc + setenv MTT_CC $MTT_BASE/cc + + setenv MTT_COMPONENTS .:$MTT_LIB/comp + setenv MTT_CRS $MTT_LIB/cr + setenv MTT_EXAMPLES $MTT_LIB/examples + setenv MTT_REP $MTT_LIB/rep + + setenv PATH $PATH\:$MTTPATH\:$MTTPATH/trans\:$MTT_CC\:$MTT_REP + + #Setup octave + setenv MATRIX_PATH $MTTPATH/trans/m// + setenv MATRIX_PATH $MATRIX_PATH\:$MTT_LIB/comp/simple// + setenv MATRIX_PATH $MATRIX_PATH\:$MTT_LIB/control// + setenv MATRIX_PATH $MATRIX_PATH\:$MTT_LIB/octave//\:\: + + setenv OCTAVE_PATH .\:$MATRIX_PATH + setenv MATRIX "octave" + + # Setup the symbolic stuff + setenv SYMBOLIC 'reduce 64' + + + # Setup xfig + setenv FIG "xfig \ + -startfontsize 20 \ + -metric \ + -portrait \ + -startgridmode 2 \ + -pheight 21 \ + -pwidth 30 \ + -library_dir $MTT_LIB/xfig/\ + " + + # Setup ps viewer + setenv PSVIEW 'gv' + + # Setup pdf viewer + setenv PDFVIEW 'acroread' + + # Setup html viewer + setenv HTMLVIEW 'netscape' + + # Setup dvi viewer + setenv DVIVIEW 'xdvi' + + # Setup latex2html + setenv LATEX2HTML "latex2html -contents_in_navigation -index_in_navigation -address http://mtt.sourceforge.net" + + # Ascend stuff + setenv ASCENDLIBRARY $MTTPATH/ascend/lib + + # Oct file generation - use version with no optimisation. + #setenv MKOCTFILE $MTT_LIB/octave/mkoctfile # This for no optimisation + setenv MKOCTFILE mkoctfile + + ######################################################################################### + ## + ## Configure environment for standalone compilation of files linked with Octave libraries + ## (required for ode2odes.exe only) + + # location of Octave directories on local system (usually /usr, /usr/local or /opt) + +set OCTAVEPREFIX="/usr" + + # include paths for Octave + +set IOCTAVE="-I${OCTAVEPREFIX}/include/octave/ -I${OCTAVEPREFIX}/include/octave/octave" + + # library paths for Octave + +set OCTAVEVERS=`octave --version | head -1 | gawk '{ print $4 }'` +set OCTAVEMINOR=`echo ${OCTAVEVERS} | gawk -F\. '{print $2}'` + if [ "${OCTAVEMINOR}" = "0" ] ; then # stable + LOCTAVE="-L${OCTAVEPREFIX}/lib/octave-${OCTAVEVERS} -loctave -lcruft -loctinterp -Wl,--rpath,${OCTAVEPREFIX}/lib/octave-${OCTAVEVERS}" + LOCTAVE="-L${OCTAVEPREFIX}/lib/octave-${OCTAVEVERS} -loctave -lcruft -loctinterp -Wl,--rpath,${OCTAVEPREFIX}/lib/octave-${OCTAVEVERS} -loct-pathsearch -loct-readline" + fi +set LSYSTEM="-ldl -lm -lncurses -lkpathsea -lreadline -lblas -llapack -lfftw -lg2c" + + # C++ compiler options + +set DEBUG="-g" +set OPTIM="-O3" +set FLAGS="-fno-rtti -fno-exceptions -fno-implicit-templates" + + # exported variables + + setenv MTT_CXX "g++" + setenv MTT_CXXFLAGS "${DEBUG} ${OPTIM} ${FLAGS}" + setenv MTT_CXXLIBS "${LOCTAVE} ${LSYSTEM}" + setenv MTT_CXXINCS "-I. -I${MTT_LIB}/cc ${IOCTAVE}" + setenv MTT_LDFLAGS " " + + ## End of Octave environment configuration + ## + ######################################################################################### + + ############################################################ + ## + ## Configure environment for compilation of Matlab mex files + +set MATLAB_ARCH="glnx86" +set MATLAB_ROOT="/usr/local/matlab6p1" +set MATLAB_FLAGS="-shared -fPIC -ansi -D_GNU_SOURCE -pthread" +set MATLAB_INCS="-I${MATLAB_ROOT}/extern/include" +set MATLAB_LIBS="-Wl,--rpath-link,${MATLAB_ROOT}/extern/lib/${MATLAB_ARCH},--rpath-link,${MATLAB_ROOT}/bin/${MATLAB_ARCH} -L${MATLAB_ROOT}/bin/${MATLAB_ARCH} -lmx -lmex -lm" + + # exported variables + + setenv MTT_MATLAB_FLAGS "${MATLAB_FLAGS} ${MATLAB_INCS} ${MATLAB_LIBS}" + + ## End of Matlab environment configuration + ## + ############################################################# + ADDED mtt/bin/sh2csh Index: mtt/bin/sh2csh ================================================================== --- mtt/bin/sh2csh +++ mtt/bin/sh2csh @@ -0,0 +1,46 @@ +#!/bin/sh +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2001/04/12 03:08:00 geraint +## Improved sh->csh conversion, reduces environment namespace pollution. +## Still need to do proper if [ -z $MTT_BASE ] ... else ... fi conversion. +## +## Revision 1.2 1999/03/11 04:12:26 peterg +## Put in heading. +## +## Revision 1.1 1999/03/11 04:02:45 peterg +## Initial revision +## +############################################################### + +#Converts mttrc to csh form. + +date=`date` +wd=`pwd` +base=`dirname $wd` + +echo Converting $1 to $1.csh using $base as default + +cat<$1.csh +#!/bin/csh +## Automatically generated from bashrc on $date - DO NOT EDIT +EOF + +# grep -v lines need to be replaced with proper if...then conversion +cat $1 |\ + sed 's/export[ \t]*\([A-Za-z0-9_]*\)=/setenv\ \1\ /' |\ + sed 's/^\([\ \t]*\)\([A-Za-z0-9_]*\)=/set\ \2=/' |\ + grep -v "if \[ -z " |\ + grep -v "echo mttrc requires one argument: eg mttrc /usr/share/mtt/latest" |\ + grep -v "else" |\ + grep -v -e "^fi" |\ + sed "s%\$1%$base%" \ +>>$1.csh + + +echo done. + + ADDED mtt/bin/trans/ICD_txt2lang.sh Index: mtt/bin/trans/ICD_txt2lang.sh ================================================================== --- mtt/bin/trans/ICD_txt2lang.sh +++ mtt/bin/trans/ICD_txt2lang.sh @@ -0,0 +1,54 @@ +#! /bin/sh + +sys=$1 +lang=$2 + +ICD=${sys}_ICD.${lang} +txt=${sys}_ICD.txt +struc=${sys}_struc.txt + +case ${lang} in + c) lb='['; rb=']'; offset=0; comment='//';; + cc) lb='('; rb=')'; offset=1; comment='//';; + m) lb='('; rb=')'; offset=0; comment='#';; + *) echo Language ${lang} not yet supported.; exit -1;; +esac + +echo Creating ${ICD} + +cat < ${ICD} +${comment} Interface Control Definition mappings for system ${sys} +${comment} ${ICD}: Generated by MTT `date` + +EOF + +# ICD.txt Format: +# Input|Output ICD_Name PortName Causality: causality Units: units +# $1 $2 $3 $4 $5 $6 $7 + +cat <> ${ICD} + +${comment} Inputs + +EOF +for name in `cat ${txt} | gawk '($1 == "Input:") { print $3 }'` +do + num=`grep ${name} ${struc} | gawk '($1 == "input") { print $2 }'` + grep ^Input ${txt} |\ + gawk '($3 == name) { printf ("\tmttu%c%d%c\t= %s;\n", lb, num-offset, rb, $2) }'\ + lb=${lb} rb=${rb} name=${name} num=${num} offset=${offset} >> ${ICD} +done + +cat <> ${ICD} + +${comment} Outputs + +EOF +for name in `cat ${txt} | gawk '($1 == "Output:") { print $3 }'` +do + num=`grep ${name} ${struc} | gawk '($1 == "output") { print $2 }'` + grep ^Output ${txt} |\ + gawk '($3 == name) { printf ("\t%-30s = mtty%c%d%c;\n", $2, lb, num-offset, rb) }'\ + lb=${lb} rb=${rb} name=${name} num=${num} offset=${offset} >> ${ICD} +done + ADDED mtt/bin/trans/abg2cbg_m Index: mtt/bin/trans/abg2cbg_m ================================================================== --- mtt/bin/trans/abg2cbg_m +++ mtt/bin/trans/abg2cbg_m @@ -0,0 +1,191 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: abg2cbg_m +# +# Acausal bond graph to causal bond graph: mfile format + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.17 2001/07/28 21:09:22 geraint +## Eliminated duplicate lines in type.sh. +## +## Revision 1.16 2001/07/26 04:07:28 gawthrop +## Changed a to w on open (Geraint's suggestion) +## Explictly close files +## +## Revision 1.15 2001/07/23 23:24:02 gawthrop +## Now only writes to type.sh and cbg.m when causality is complete +## +## Revision 1.14 2000/12/28 12:16:13 peterg +## *** empty log message *** +## +## Revision 1.13 1998/07/27 20:30:12 peterg +## *** empty log message *** +## +## Revision 1.12 1998/07/10 08:43:46 peterg +## Added -I switch +## +## Revision 1.11 1998/01/23 13:29:54 peterg +## $RMATRIX --> $MATRIX +## +# Revision 1.10 1996/12/04 21:51:02 peterg +# Now uses filenum instead of line name. +# Uses fopen +# +# Revision 1.9 1996/11/06 15:49:33 peterg +# Cahged $MATRIX to $RMATRIX +# +# Revision 1.8 1996/08/25 09:31:49 peter +# More error handling. +# +## Revision 1.7 1996/08/25 09:22:55 peter +## # Print errors, if any. +## mtt_error error.txt +## +## Revision 1.6 1996/08/24 14:36:01 peter +## Error handling included. +## +## Revision 1.5 1996/08/19 15:38:31 peter +## Removed bug work round. +## +## Revision 1.4 1996/08/16 14:28:45 peter +## Some debugging lines removed. +## +## Revision 1.3 1996/08/08 18:06:55 peter +## Unified naming scheme. +## +## Revision 1.2 1996/08/05 11:25:00 peter +## Removed bonds argument from abg2cbg. +## Removed call to $1_abg. +## +## Revision 1.1 1996/08/04 17:45:11 peter +## Initial revision +## +############################################################### + +# The causal BG is described by four matrices +# (the same structure as the acausal BG except that Causality is 1 ot -1): +# junctions: describes the junctions - +# Column 1 Index of component (see components) +# Column 2.. Indices of bonds on junction (see jbonds) +# rows may be padded with zeros +# +# cjbonds: describes the true bonds - +# Column 1 Index of component (see components) +# Column 2 Direction +# 1 away from junction +# -1 towards junction +# Column 3 Effort causality +# 1 stroke at arrow end +# -1 stroke at other end +# 0 no stroke (ie acausal) +# Column 4 Flow causality +# 1 stroke at arrow end +# -1 stroke at other end +# 0 no stroke (ie acausal) +# Columns 5:6 x,y coordinates of non-arrow end (in Fig) +# Columns 7:8 x,y coordinates of arrow end (in Fig) +# +# mbonds: describes the modulation bonds - +# Column 1 Index of component at non-arrow end +# Column 2 Index of component at arrow end +# Columns 4:5 x,y coordinates of non-arrow end (in Fig) +# Columns 6:7 x,y coordinates of arrow end (in Fig) +# +# components: describes the comonents - +# Column 1 Type of component +# 0 0-junction +# 1 1-junction +# 2 R component +# 3 C component +# 4 I component +# 11 TF component +# 12 GY component +# 13 A component +# Column 2 Flag for explicit junction +# 4 Explicit component (4 means text type) +# 0 Implicit component +# Column 3-14 fig file information (see fig documentation) +# +# Lists of under- and over-causal junctions are displayed. +# +# P.J.Gawthrop May 1996 +# Copyright (c) P.J.Gawthrop, 1996. + + +# P.J.Gawthrop May 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +derivative=0;blurb=integral +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info;; + -derivative ) + derivative=1; blurb=derivative;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +infofile='mtt_info.txt' +errorfile='mtt_error.txt' +typefile="$1_type.sh" + +# Remove the old log file +rm -f abg2cbg_m.log +rm -f $1_cbg.m +rm -f $typefile +rm -f $infofile + + +#Inform user +echo "Creating $1_cbg.m (maximise $blurb causality)" +echo Creating $1_type.sh + +## Start the type.sh file +mtt_header $1 type sh > $typefile + +# Use matrix manipulation to accomplish the transformation +$MATRIX << EOF >abg2cbg_m.log #2>mtt_error.txt + + infofilenum = fopen("$infofile",'wt'); + errorfilenum = fopen("$errorfile",'wt'); + typefilenum = fopen("$typefile",'wt'); + + %Convert from acausal to causal bond graph in m-file form. + system_name='$1'; + + port_bonds = []; + port_direction = []; + port_status = []; + [cbonds,status] = abg2cbg(system_name, '', '', port_bonds, port_direction, port_status, ... + $derivative,typefilenum, infofilenum, errorfilenum); + + ## close the files + fclose(infofilenum); + fclose(errorfilenum); + fclose(typefilenum); + +EOF + +cat $typefile | sort -u > ${typefile}.tmp +mv ${typefile}.tmp $typefile + +if [ "$info" = "info" ]; then + cat $infofile +fi + +# cp $1_$1_cbg.m $1_cbg.m 2>> mtt_error.txt + +# Print errors, if any. +mtt_error mtt_error.txt + ADDED mtt/bin/trans/abg2cmp_dia2txt Index: mtt/bin/trans/abg2cmp_dia2txt ================================================================== --- mtt/bin/trans/abg2cmp_dia2txt +++ mtt/bin/trans/abg2cmp_dia2txt @@ -0,0 +1,14 @@ +#! /bin/sh + +### abg2cmp_dia2txt +## Creates list of components contained in _abg.dia +## Copyright (C) 2002 by Geraint Paul Bevan + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +set -e + +mtt_uncompress.sh $1_abg.dia +dia2abg.pl --create_component_list --diagram_name=$1 ADDED mtt/bin/trans/abg2cmp_fig2txt Index: mtt/bin/trans/abg2cmp_fig2txt ================================================================== --- mtt/bin/trans/abg2cmp_fig2txt +++ mtt/bin/trans/abg2cmp_fig2txt @@ -0,0 +1,79 @@ +#! /bin/sh + +### abg2cmp_fig2txt +## Creates list of components contained in _abg.fig +## Copyright (C) 2002 by Peter J. Gawthrop + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Log$ + ## Revision 1.3 2002/12/06 22:12:28 geraint + ## Removed unique option from sort + ## - prevents multiple anonymous components from existing + ## - duplicate named components are caught by rbg_fig2m.awk anyway + ## + ## Revision 1.2 2002/12/06 11:47:49 gawthrop + ## Checks levels in fig file to extract genuine components + ## Puts comments at top of cmp.txt file + ## + ## Revision 1.1 2002/12/01 14:54:39 gawthrop + ## Replaces defunct abg2lbl_fig2txt + ## + ## + ############################################################### + +system=$1 +infile=${system}_abg.fig +outfile=${system}_cmp.txt +date=`date` + +echo Creating ${outfile} + +header() { + cat < ${outfile} + +## Make list of components +get_valid_components < ${infile} |\ + remove_port_labels |\ + sort >> ${outfile} ADDED mtt/bin/trans/abg2connections_m2dat Index: mtt/bin/trans/abg2connections_m2dat ================================================================== --- mtt/bin/trans/abg2connections_m2dat +++ mtt/bin/trans/abg2connections_m2dat @@ -0,0 +1,32 @@ +#! /bin/sh + +### abg2connections_m2dat +## Creates connections.dat from abg.m +## Copyright (C) 2004 by Geraint Paul Bevan + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +set -e + +sys=$1 + +file=${sys}_connections.dat + +${MATRIX} <abg2connections_m.log + +abg = ${sys}_abg; + +${sys}_connections = abg2connections (abg); + +str = save_header_format_string; +save_header_format_string = ["# Model Transformation Tools\t", ... + " -*-octave-*-\n", ... + "# Created by abg2connections_m\n", ... + str]; + +save -text ${file} ${sys}_connections; + +EOF + ADDED mtt/bin/trans/abg2cr_m2txt Index: mtt/bin/trans/abg2cr_m2txt ================================================================== --- mtt/bin/trans/abg2cr_m2txt +++ mtt/bin/trans/abg2cr_m2txt @@ -0,0 +1,48 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: abg2cr_m2txt + +# Abg file to constitutive relationship conversion +# P.J.Gawthrop march 2000 +# Copyright (C) 2000 by Peter J. Gawthrop + + + +# Inform user +if [ "$1_cr.txt" -nt "$1_abg.m" ]; then + echo "Using $1_cr.txt" + exit +else + echo "Creating $1_cr.txt" +fi + + +rm -f mtt_error + + +# This is the main transformation using awk +# And remove crs with same name as system +grep 'cr = ' $1_abg.m | gawk ' +BEGIN { +# Include lin cr anyway. +print "lin" +} +{ + crs=substr($3,2,length($3)-3); + N=split(crs,cr,";"); + for (i=1;i<=N;i++){ + if (length(cr[i])>0) + print cr[i]; + } +}' 2>mtt_error.txt | sort -u | grep -v none | grep -v '\$[0-9]'> $1_cr.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + + + ADDED mtt/bin/trans/abg2ibg_dia2m Index: mtt/bin/trans/abg2ibg_dia2m ================================================================== --- mtt/bin/trans/abg2ibg_dia2m +++ mtt/bin/trans/abg2ibg_dia2m @@ -0,0 +1,14 @@ +#! /bin/sh + +### abg2ibg_dia2m +## Creates _ibg.m from _abg.dia +## Copyright (C) 2004 by Geraint Paul Bevan + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +set -e + +mtt_uncompress.sh $1_abg.dia +dia2abg.pl --create_ibg --diagram_name=$1 ADDED mtt/bin/trans/abg2lbl_fig2txt Index: mtt/bin/trans/abg2lbl_fig2txt ================================================================== --- mtt/bin/trans/abg2lbl_fig2txt +++ mtt/bin/trans/abg2lbl_fig2txt @@ -0,0 +1,350 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: abg2lbl_fig2txt +# +# Acausal bond graph to causal bond graph: mfile format + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.27 2002/05/10 09:08:55 gawthrop +## Added EMTF and INTF +## Fixed bug in writing out component headings +## +## Revision 1.26 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.25 2001/10/15 14:27:00 gawthrop +## Now handles [1:N] style port labels +## +## Revision 1.24 2001/08/02 03:24:48 geraint +## Replaced mtt_version.sh with mtt_banner.sh - I think this was the intent. +## +## Revision 1.23 2001/07/26 04:08:35 gawthrop +## Removed lines deleting _type.sh and cbg.m +## -- how did they get there ?? +## +## Revision 1.22 2001/07/08 03:28:11 gawthrop +## Fixed a bug: abg2sympar_m2txt neads a _lbl.txt file when using +## "usinglabel" option +## +## Revision 1.21 2001/07/06 00:46:50 gawthrop +## Added -cr option -- forces cr to be loaded before the ese.r file +## This avoids causality problems when using multi-port Rs to represent +## arbitary equations +## +## Revision 1.20 2001/07/04 05:19:57 gawthrop +## Added RT & CT to list +## +## Revision 1.19 2001/07/03 23:51:10 gawthrop +## Now puts outline #Summary and #Description lines at top of lbl file +## +## Revision 1.18 2001/06/13 18:24:10 gawthrop +## Made "lin" default in place of "none" +## Still needs arg and cr alias clashes to be sorted .... +## +## Revision 1.17 2001/06/13 10:41:06 gawthrop +## Further changes towards aouto creation of lbl files. +## Prettified lbl files +## +## Revision 1.16 2001/06/11 19:43:49 gawthrop +## MTT is now much more sophisticated in generating lbl files +## Labels can contain maths +## Repetative components are now broken +## +## Revision 1.15 2001/06/11 16:53:49 gawthrop +## Now uses abg2sympar_m2txt to get the arguments +## +## Revision 1.14 2001/06/11 15:06:58 gawthrop +## Now handles user-defined components +## +## Revision 1.13 2001/06/04 08:13:37 gawthrop +## Various changes to support PPP +## +## Revision 1.12 2001/05/08 15:18:10 gawthrop +## Added trig and hyperbolic functions to argument exclusion list +## +## Revision 1.11 2000/09/19 11:14:30 peterg +## Now writes the first component type header correctely +## +## Revision 1.10 2000/01/26 10:11:10 peterg +## Added I component +## +## Revision 1.9 1999/11/10 00:47:08 peterg +## Replaced ifs by a table of cr/arg information +## +## Revision 1.8 1999/11/09 22:32:41 peterg +## Under RCS ready for using arrays to contaain defaults. +## +## Revision 1.7 1998/07/04 10:37:21 peterg +## Major revision to include: +## aliases +## new Style +## prettyfied +## +## Revision 1.6 1998/03/05 10:09:47 peterg +## Corrected bug in writing "other" components +## +## Revision 1.5 1998/03/02 09:26:18 peterg +## Now does default CR and args for the basic components only +## SS,I,R,C,GY,TF +## C now has a default of effort input. +## +## Revision 1.4 1998/02/23 16:20:33 peterg +## Summary line just contains the model name +## +## Revision 1.3 1997/05/09 14:21:35 peterg +## Default to flow,component_name +## +# Revision 1.2 1997/03/19 12:08:01 peterg +# No longer writes out non-unique names - now done in rbg_fig2m +# +# Revision 1.1 1997/03/18 13:55:01 peterg +# Initial revision +# +############################################################### + + +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997 + +infofile='mtt_info.txt' +typefile="$1_type.sh" +sensitivity=$2; +system=$1 +outfile=$1_lbl.txt + +if [ -n "$sensitivity" ]; then + sys="-s ${system}" +else + sys=${system} +fi + +# Remove unwanted files +rm -f abg2lbl_fig2txt.log +rm -f $infofile +rm -f mtt_junk* + +## Create lbl files beneath this one +mtt -q -u -l 1 ${sys} sub sh # Create the list +sh $1_sub.sh "abg2lbl_fig2txt " " $sensitivity" + +if [ -f "$1_lbl.txt" ]; then + ##echo "$1_lbl.txt exists in `pwd` - no action taken" + exit +##else + ##echo "$1_lbl.txt dosn not exist in `pwd` " +fi + +#Inform user +if [ -n "$sensitivity" ]; then + echo "Creating ${outfile} (sensitivity version)" +else + echo "Creating ${outfile}" +fi + +write_header() + +{ +cat< $1_unique_raw_list + + +#Write out non-unique names +#echo 'Non-unique names (if any):' +#diff $1_unique_raw_list $1_raw_list | grep '>' | sed 's/>/ /' + +#Write out the outline lbl file +grep -v '\[[0-9]*\]' $1_unique_raw_list | \ +gawk --field-separator ':' ' + BEGIN { + OldComponent="None"; + default_cr = "lin"; + } + { + Component = $1; + Name = $2; + Arg = $3; + +##Aliases + if (Component == "SS") { + port_alias[++j] = Name; + } + else { + alias[++i] = Name; + if (length(sensitivity)>0) { + s_arg = sprintf("%ss",Name); + alias[++i] = s_arg; + s_arg = sprintf(";%s",s_arg); + Component_type = Component; + Component = substr(Component,2); + lin = "slin" + } + else { + Component_type = Component; + lin = "lin"; + } + + } + + ## Table of components + cr["SS"] = "SS"; arg["SS"] = "external,external"; + + cr["Se"] = "SS"; arg["Se"] = sprintf("external%s", s_arg); + cr["Sf"] = "SS"; arg["Sf"] = sprintf("external%s", s_arg); + + cr["De"] = "SS"; arg["De"] = "external"; + cr["Df"] = "SS"; arg["Df"] = "external"; + + cr["R"] = lin; arg["R"] = sprintf("flow,%s%s", Name, s_arg); + cr["C"] = lin; arg["C"] = sprintf("effort,%s%s", Name, s_arg); + cr["I"] = lin; arg["I"] = sprintf("flow,%s%s", Name, s_arg); + + cr["INTF"] = lin; arg["INTF"] = ""; + + cr["CS"] = "lin"; arg["CS"] = sprintf("effort,%s;%s_x0%s", Name, Name, s_arg); + cr["IS"] = "lin"; arg["IS"] = sprintf("flow,%s;%s_x0%s", Name, Name, s_arg); + cr["INTFS"] = "lin"; arg["INTFS"] = sprintf("%s_x0%s", Name, s_arg); + + cr["TF"] = "lin"; arg["TF"] = sprintf("flow,%s%s", Name, s_arg); + cr["GY"] = "lin"; arg["GY"] = sprintf("flow,%s%s", Name, s_arg); + + ##cr["EMTF"] = sprintf("%s", Name); arg["EMTF"] = sprintf("l%s", s_arg); + cr["EMTF"] = "lin"; arg["EMTF"] = sprintf("flow,%s%s", Name, s_arg); + + cr["AE"] = "lin"; arg["AE"] = sprintf("%s%s", Name, s_arg); + cr["AF"] = "lin"; arg["AF"] = sprintf("%s%s", Name, s_arg); + cr["AEf"] = "lin"; arg["AEf"] = sprintf("%s%s", Name, s_arg); + cr["AFe"] = "lin"; arg["AFe"] = sprintf("%s%s", Name, s_arg); + + cr["CDx"] = "lin"; arg["CDx"] = sprintf("%s%s", Name, s_arg); + + + cr["FMR"] = lin; arg["FMR"] = sprintf("effort,%s%s", Name, s_arg); + + cr["RS"] = lin; arg["RS"] = sprintf("flow,%s%s", Name, s_arg); + cr["RT"] = lin; arg["RT"] = sprintf("flow,%s%s", Name, s_arg); + cr["CT"] = lin; arg["CT"] = sprintf("effort,%s%s", Name, s_arg); + + ## Put in the explicit arguments + if (length(Arg)>0) { + arg[Component] = Arg; + if (match(Arg,"=")>0) # Its an equation type cr + cr[Component] = "cr" + else # assume a linear cr + cr[Component] = "lin"; + } + + ## Print component header + if (Component != OldComponent) print "\n## Component type", Component_type + + ## Print Component + printf("\t%s\t", Name); + if (Component in cr) + printf("%s\t\t", cr[Component]) + else + printf("%s\t\t", default_cr); + + if (Component in arg) + printf("%s\t\t\n", arg[Component]) + else { + print "lbl2args_txt2out", Component_type | "/bin/sh"; close("/bin/sh") + } + + OldComponent=Component; + delete arg[Component]; # Zap the element + delete cr[Component]; # Zap the element + } + END{ + print "\n## Port aliases" >> "mtt_junk_alias.txt"; + for (k=1;k<=j;k++){ + if (port_alias[k] ~ "\\["){ # Only do ports + port_name = substr(port_alias[k],2,length(port_alias[k])-2); + if (length(sensitivity)==0) + print "#ALIAS\t" port_name "\t" port_name >> "mtt_junk_alias.txt"; + else + print "#ALIAS\t" port_name "\t" port_name "_1," port_name "_2" >> "mtt_junk_alias.txt"; + } + } + +# print "\n% Argument aliases" >> "mtt_junk_alias.txt"; +# for (k=1;k<=i;k++){ +# print "%ALIAS\t\$" k "\t" alias[k] >> "mtt_junk_alias.txt"; +# } + }' sensitivity=$sensitivity +} + +create_arg_aliases() +{ +cat < $1_lbl.txt +create_arg_aliases > mtt_args.txt # using $1_lbl.txt +mv $1_lbl.txt mtt_junk_lbl.txt + +write_header > ${outfile} +cat mtt_junk_alias.txt >> ${outfile} +cat mtt_args.txt >> ${outfile} +write_blurb >> ${outfile} +cat mtt_junk_lbl.txt >> ${outfile} +## Put a blank line at end +cat >> ${outfile} <$sfilename + + + ADDED mtt/bin/trans/abg2sub_fig2sh Index: mtt/bin/trans/abg2sub_fig2sh ================================================================== --- mtt/bin/trans/abg2sub_fig2sh +++ mtt/bin/trans/abg2sub_fig2sh @@ -0,0 +1,110 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: abg2sub_m2sh + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.4 2002/04/22 10:25:47 gawthrop + ## Handles unnamed components & ingnores artwork + ## + ## Revision 1.3 2001/10/15 14:27:34 gawthrop + ## Now handles [1:N] style port labels + ## + ## Revision 1.2 2001/07/23 23:26:23 gawthrop + ## Removed some boring user feedback + ## + ## Revision 1.1 2001/06/11 19:47:49 gawthrop + ## Makes the sub.sh file directly from the abg.fig file + ## Used for making lbl files (abg2lbl_fig2txt) + ## + ## + ############################################################### + +# Copyright (C) 1996--2002 by Peter J. Gawthrop + + + +get_valid_components() + +{ +gawk ' +function modulo10(x) { + return x-int(x/10)*10 + } +BEGIN{ + polyline = 2; + text = 4; + compound_object = 6; + +} +{ +object = $1; +zero_depth = (modulo10($4)==0)&&(object==text); +if (zero_depth) print $0 + +}' < $1_abg.fig + +} +#if [ -f "$1_sub.sh" ]; then +# echo Using "$1_sub.sh" +# exit +#else + #Inform user + echo Creating $1_sub.sh +#fi + +echo '# Commands to generate subsystem representations'> $1_sub.sh +echo "# File $1_sub.sh" >> $1_sub.sh +echo "# Generated by MTT on `date`." >> $1_sub.sh +echo >> $1_sub.sh + +# Get a list of all components from the _abg file +get_valid_components $1 |\ +grep -v '\[[0-9]*:[0-9]*\]' |\ +grep -v '\[.*\]' |\ +gawk '{if ($1==4) split($14,a,":"); print a[1]}' |\ +sed 's/\\001//' |\ +sort -u > mtt_tmp1 + +# Remove all components starting with 0 or 1 +grep -v '^[01]' < mtt_tmp1 > mtt_tmp4 + +# Get a list of all standard simple components +ls $MTT_LIB/comp/simple |\ + gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2 + +# Get a list of all standard compound components +#ls $MTTPATH/comp/compound |\ +# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2 + +# Sorted combined list +cat mtt_tmp2 | \ + sed 's/^zero$/0/' |\ + sed 's/^one$/1/' |\ + sort -u >mtt_tmp3 + +# Print the non-standard components +comm mtt_tmp4 mtt_tmp3 |\ + gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \ + >>$1_sub.sh + +# Clean up mtt_tmp files +#rm -f mtt_tmp? + + + + + + + + ADDED mtt/bin/trans/abg2sub_m2sh Index: mtt/bin/trans/abg2sub_m2sh ================================================================== --- mtt/bin/trans/abg2sub_m2sh +++ mtt/bin/trans/abg2sub_m2sh @@ -0,0 +1,78 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: abg2sub_m2sh + +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2000/10/03 11:34:53 peterg +## Correct $MTT_LIB +## +## Revision 1.2 2000/03/17 09:53:10 peterg +## Removed irritating echo Using "$1_sub.sh" +## +## Revision 1.1 2000/03/15 21:23:20 peterg +## Initial revision +## +############################################################### + + +if [ -f "$1_sub.sh" ]; then + #echo Using "$1_sub.sh" + exit +else + #Inform user + echo Creating $1_sub.sh +fi + + +echo '# Commands to generate subsystem representations'> $1_sub.sh +echo "# File $1_sub.sh" >> $1_sub.sh +echo "# Generated by MTT on `date`." >> $1_sub.sh +echo >> $1_sub.sh + +# Get a list of all components for the _abg file +gawk '/type = / {print substr($3,2,length($3)-3)}' $1_abg.m |\ +sort -u > mtt_tmp1 + +# Remove all components starting with 0 or 1 +grep -v '^[01]' < mtt_tmp1 > mtt_tmp4 + +# Get a list of all standard simple components +echo ls $MTT_LIB/comp/simple +ls $MTT_LIB/comp/simple |\ + gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2 + +# Get a list of all standard compound components +#ls $MTTPATH/comp/compound |\ +# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2 + +# Sorted combined list +cat mtt_tmp2 | \ + sed 's/^zero$/0/' |\ + sed 's/^one$/1/' |\ + sort -u >mtt_tmp3 + +# Print the non-standard components +comm mtt_tmp4 mtt_tmp3 |\ + gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \ + >>$1_sub.sh + +# Clean up mtt_tmp files +#rm -f mtt_tmp? + + + + + + + + ADDED mtt/bin/trans/abg2sympar_m2txt Index: mtt/bin/trans/abg2sympar_m2txt ================================================================== --- mtt/bin/trans/abg2sympar_m2txt +++ mtt/bin/trans/abg2sympar_m2txt @@ -0,0 +1,86 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: abg2sympar_m2txt + +# Label file to symbolic parameters conversion +# Copyright (C) 2000 by Peter J. Gawthrop + +# Inform user +##echo "Creating $1_sympar.txt" with $1 $2 $3 + +# Separation characters +SEPS='^=*;+/()-' +# Replace by , +REPS='[,*]' + +SystemName=$2 +UseLabelFile=$3 + +if [ -n "$UseLabelFile" ]; then ## Take input from lbl.txt + strip_comments < $1_lbl.txt | tr $SEPS $REPS |\ + gawk '{printf("%s %s \"%s\",\n",$1,$2,$3)}' > mtt_stripped_file +else ## Take input from _abg.m + cat $1_abg.m | grep "arg =" | tr $SEPS $REPS > mtt_stripped_file +fi + +rm -f mtt_error +# This is the main transformation using gawk +cat mtt_stripped_file | \ +gawk ' +function exact_match(name1, name2) { + return ((match(name1,name2)>0)&&(length(name1)==length(name2))) +} + +function matches(names, name) { + n_matches = split(names,match_name); + matched = 0; + for (i_matches = 1; i_matches <= n_matches; i_matches++) { + if ( exact_match(name,match_name[i_matches]) ) { + matched = 1; + break; + } + } + return matched; +} + +BEGIN { + var = "[%|#][PAR|VAR]"; + not_an_arg = "effort flow state internal external zero unknown\ + mtt_e mtt_f\ + sqrt exp log sign sin asin cos acos tan atan \ + sin asin cos acos tan atan \ + sinh asinh cosh acosh tanh atanh \ + none abs"; + arg_line = "arg = "; +} +{ + ## Explicit VAR declarations + if (match($1,var)>0) print $2 "\t" system_name; + + ## Implicit declarations from the arg list +## if (match($1,"arg")>0) { + args= substr($3,2,length($3)-3); + if (length(args)>0) + printf("%s\t%s\n", args,system_name) +## } +}' system_name=$SystemName |\ +grep -v '^\$' | mtt_strip_args | sort -u > mtt_stripped_args + + +## Now get the explicit declarations +if [ -n "$UseLabelFile" ]; then ## Take input from lbl.txt + ext=_lbl.txt +else + ext=_abg.m +fi + +strip_pars.sh $1${ext} $1 | sort -u > mtt_explicit_args + +## And write sorted list +cat mtt_explicit_args mtt_stripped_args + + ADDED mtt/bin/trans/abg2tex Index: mtt/bin/trans/abg2tex ================================================================== --- mtt/bin/trans/abg2tex +++ mtt/bin/trans/abg2tex @@ -0,0 +1,178 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: abg2tex +# Creates a tex file describing the system abg +# P.J.Gawthrop May 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 2004/08/26 16:11:48 geraint +## Fixed ignore() and pipe so that subsystems are included in reports again. +## +## Revision 1.6 2004/02/11 10:10:04 gawthrop +## Includes a _pic.fig file (schematic) if such exists +## +## Revision 1.5 2004/02/10 16:12:21 gawthrop +## Don't give details of Se De Sf Df INTF +## +## Revision 1.4 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.3 2001/07/12 04:02:53 gawthrop +## Now fixes multiports for input and output as well as state +## +## Revision 1.2 2000/11/27 17:45:00 peterg +## Removed "System" from heading +## +## Revision 1.1 2000/11/27 15:11:15 peterg +## Initial revision +## +## Revision 1.7 1997/12/06 16:20:37 peterg +## Added another argument - the label +## +## Revision 1.6 1997/12/06 15:49:35 peterg +## Changed order of fig arguments to put filename first. +## +## Revision 1.5 1997/08/15 11:32:05 peterg +## Removed an echo left in by mistake +## +# Revision 1.4 1997/08/15 11:19:25 peterg +# Minto cosmetics. +# +## Revision 1.3 1997/05/21 12:07:22 peterg +## Replaced echo by cat -- much simpler. +## +## Revision 1.2 1997/05/19 16:25:53 peterg +## Explicit include of tex files .. latex2html seems to prefer this! +## +# Revision 1.1 1997/05/19 11:30:00 peterg +# Initial revision +# +############################################################### + +## Subsystems that don't need documentation +ignore(){ + gawk ' +BEGIN{ +ignored = " Se De Sf Df INTF "; +} +{ + subsys = sprintf(" %s ", $1); + if (match(ignored,subsys)==0) + print $1 + }' +} + +#Look for a command line argument +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -pdf ) pdf='-pdf' + ;; + -s ) sensitivity='-s' + ;; + + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + + +if [ -z "$2" ]; then + filename="$1_abg.tex"; + echo > $filename + echo Creating $filename + subsection='section' +else + filename=$2 + subsection='subsection' +fi + + +#Section heading (if not at top level) +if [ -n "$2" ]; then +cat<> $filename + +%% Subsystem $1 + \subsection{\textbf{$1}} + \label{sec:$1} + \index{\textbf{$1} -- abg} + +EOF +else +mtt -q -u ${sensitivity} $1 abg m # Make sure all the subsystems exist -- nasty kludge +cat< $filename + % abg report for system $1 ($filename) + % Generated by MTT at `date` +EOF +fi + +# Figure +##echo mtt -q -u $pdf $1 abg ps +mtt -q -u $pdf $1 abg ps +cat <> $filename + +%% \fig{`pwd`/$1_labg}{$1_abg}{0.9}{System \textbf{$1}: acausal bond graph} + \tfig{`pwd`/$1_labg}{$1_abg}{0.9}{System \textbf{$1}: acausal bond graph} + +EOF + +## Put a schematic if exists (_pic.fig) +if [ -e "$1_pic.fig" ]; then + echo Inserting $1_pic.fig + fig2dev -L eps $1_pic.fig > $1_pic.ps +cat <> $filename + + \fig{`pwd`/$1_pic}{$1_pic.ps}{0.9}{System \textbf{$1}: schematic diagram} + +EOF +fi + +# Description +mtt -q -u $1 desc tex +# Put in absolute pathnames in figures -- and fix bug in old desc files +sed "s;fig{;fig{`pwd`/;g" < $1_desc.tex |\ +sed "s/Ref{$1_abg}/Ref{fig:$1_abg.ps}/" >> $filename + +# Label file +mtt -q -u $1 lbl tex +cat<> $filename + \sub$subsection{Summary information} + \label{sec:$1_lbl} + \index{\textbf{$1} -- lbl} +EOF +cat $1_lbl.tex >> $filename + + +# CRs +#mtt -q -u $1 cr tex +#cat<> $filename +# \sub$subsection{Constitutive relationships} +# \label{sec:$1_cr} +# \index{\textbf{$1} -- cr} +#EOF +#cat $1_cr.tex >> $filename + +# Subsystems +mtt -q -u $1 sub tex +cat<> $filename + \sub$subsection{Subsystems} + \label{sec:$1_sub} + \index{\textbf{$1} -- subsystems} +EOF +cat $1_sub.tex >> $filename + +#Now do the subsystems (if at top level) +if [ -z "$2" ]; then + sub2subs $1 | sort -u | ignore |\ + gawk '{print "abg2tex", pdf, $1, filename}' pdf=$pdf filename=$filename | sh +fi ADDED mtt/bin/trans/abg_m2a4c Index: mtt/bin/trans/abg_m2a4c ================================================================== --- mtt/bin/trans/abg_m2a4c +++ mtt/bin/trans/abg_m2a4c @@ -0,0 +1,33 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: abg_m2a4c +# +# Acausal bond graph to ascend format + +infofile='mtt_info.txt' +errorfile='mtt_error.txt' + + +# Remove the old log file +rm -f abg_m2a4c_m.log +rm -f $1_abg.a4c + + + +#Inform user +echo "Creating $1_abg.a4c" + +# Use matrix manipulation to accomplish the transformation +octave -q << EOF >$1_abg.a4c + ABG = $1_abg; + name = "$1"; + abg_m2a4c(ABG,name); +EOF + +if [ "$info" = "info" ]; then + cat $infofile +fi ADDED mtt/bin/trans/alias_txt2m Index: mtt/bin/trans/alias_txt2m ================================================================== --- mtt/bin/trans/alias_txt2m +++ mtt/bin/trans/alias_txt2m @@ -0,0 +1,50 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: alias_m +# Creates the component aliases in text form + +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/07/02 19:16:03 peterg +## Prettyfied output +## +## Revision 1.1 1998/07/02 09:21:55 peterg +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_alias.m + +#Create the alias file complete with headers. +echo "function alias = $1_alias" > $1_alias.m +echo "%% Alias file ($1_alias.m)" >> $1_alias.m +echo "%% Generated by MTT at `date`" >> $1_alias.m + +#Write out the variables +gawk '{ + if (NF==2) {i++; print "alias."$1 "\t = \""$2"\";"} + + } + END{ + if (i==0) print "alias = 0;" + }' $1_alias.txt >> $1_alias.m + + + + + + + + + ADDED mtt/bin/trans/apply_crs Index: mtt/bin/trans/apply_crs ================================================================== --- mtt/bin/trans/apply_crs +++ mtt/bin/trans/apply_crs @@ -0,0 +1,16 @@ +#! /bin/sh + +sys=$1 + +# check for the existence of CRs that we need +crs='' +for cr in `cat ${sys}_cr.txt`; do + if [ -f ${cr}.pm -o -f mtt/${cr}.pm ]; then + crs="$crs $cr" + fi +done + +# should be reading the output from ese_r2make +# on standard input +${MTT_LIB}/cr/perl/apply_cr.pl ${crs} + ADDED mtt/bin/trans/awk/lbl2cr.awk Index: mtt/bin/trans/awk/lbl2cr.awk ================================================================== --- mtt/bin/trans/awk/lbl2cr.awk +++ mtt/bin/trans/awk/lbl2cr.awk @@ -0,0 +1,86 @@ +###################################### +##### Model Transformation Tools ##### +###################################### + +# gawk script: lbl2cr.awk +# Label file to symbolic parameters conversion +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.9 1998/03/08 21:01:40 peterg +## Now does multiple crs +## +## Revision 1.8 1998/03/06 09:15:28 peterg +## Ignores SS fields (assumes that if first field is a symbol then other +## field is and SS-style field. +## +## Revision 1.7 1997/04/22 12:50:15 peterg +## New much simpler version -- does not check for multiple crs -- these +## are removed later anyway. +## +# Revision 1.6 1997/03/22 15:15:44 peterg +# Ignores symbolic ($i) crs. +# +# Revision 1.5 1997/03/20 12:05:31 peterg +# Now just writes out the cr name. +# +# Revision 1.4 1996/11/09 20:38:45 peterg +# Put in new lib pat +# +## Revision 1.3 1996/11/04 14:51:14 peterg +## Added none to no cr list +## +# Revision 1.2 1996/11/02 10:22:22 peterg +# Now ignores SS lines. +# +############################################################### + + +function exact_match(name1, name2) { + return ((match(name1,name2)>0)&&(length(name1)==length(name2))) + } + +function matches(names, name) { + n_matches = split(names,match_name); + matched = 0; + for (i_matches = 1; i_matches <= n_matches; i_matches++) { + if ( exact_match(name,match_name[i_matches]) ) { + matched = 1; + break; + } + } + return matched; + } + + +BEGIN { +comment = "%|#"; +cr_delimiter = ";"; +not_a_cr = "effort flow state internal external zero none"; +is_a_SS = "internal external zero"; +numeric = "[0-9]"; +symbolic = "\044"; # Ascii $ +symbol_count = 0; +symbols = ""; + +# Include lin cr anyway. +print "lin" +} +{ + if ( (match($1,comment)==0) && (NF>=3) ) { + crs = $2 + n_crs = split(crs,cr,cr_delimiter); + for (i = 1; i <= n_crs; i++) { + first_char = substr(cr[i],1,1); + if ( (matches(not_a_cr,cr[i])==0) && + (match(numeric,first_char)==0) && + (matches(is_a_SS,$3)==0)) + print cr[i]; + } + } +} ADDED mtt/bin/trans/awk/lbl2sympar.awk Index: mtt/bin/trans/awk/lbl2sympar.awk ================================================================== --- mtt/bin/trans/awk/lbl2sympar.awk +++ mtt/bin/trans/awk/lbl2sympar.awk @@ -0,0 +1,107 @@ +###################################### +##### Model Transformation Tools ##### +###################################### + +# gawk script: lbl2sympar.awk +# Label file to symbolic parameters conversion +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.13 1998/07/15 09:26:50 peterg +## Reinstated the second column of the sympar file - the system name +## +## Revision 1.12 1998/07/04 11:09:46 peterg +## Cleaned up - assumes new lbl style for SS +## +## Revision 1.11 1998/05/13 12:39:23 peterg +## Added `unknown' to list od names to avoid +## +## Revision 1.10 1998/03/26 13:03:23 peterg +## Changed SS field fudge. +## +## Revision 1.9 1998/02/16 16:09:57 peterg +## And taken it out again! +## +## Revision 1.8 1998/02/16 12:08:38 peterg +## Put back the matrix declaration +## +# Revision 1.7 1997/03/18 17:25:24 peterg +# Now just generates names - formatting removed. +# +# Revision 1.6 1996/12/07 20:02:43 peterg +# Fixed symbolic parameter bug. +# +## Revision 1.5 1996/12/07 18:06:50 peterg +## Now detects symbolic args ($1 etc) and ignores them. +## +# Revision 1.4 1996/08/30 18:45:32 peter +# Removed header stuff. +# +## Revision 1.3 1996/08/30 10:30:54 peter +## Switched order of args in matches. +## +## Revision 1.2 1996/08/30 09:35:10 peter +## Fixed problem with global variable in function. +## +## Revision 1.1 1996/08/24 13:34:48 peter +## Initial revision +## +############################################################### + + + +function exact_match(name1, name2) { + return ((match(name1,name2)>0)&&(length(name1)==length(name2))) +} + +function matches(names, name) { + n_matches = split(names,match_name); + matched = 0; + for (i_matches = 1; i_matches <= n_matches; i_matches++) { + if ( exact_match(name,match_name[i_matches]) ) { + matched = 1; + break; + } + } + return matched; +} + + +BEGIN { +sys_name = ARGV[1]; +comment = "%|#"; +var = "[%|#]VAR"; +arg_delimiter = ","; +not_an_arg = "effort flow state internal external zero unknown 0 1"; +SS_parameter = "internal external zero 0 1"; +numeric = "[0-9-]"; +symbol_count = 0; +symbols = ""; +} +{ + if (match($1,var)>0) print $2 "\t" name; + + if ( (match($1,comment)==0) && (NF>=3) ) { + n_args = split($3,arg,arg_delimiter); + for (i = 1; i <= n_args; i++) { + first_char = substr(arg[i],1,1); + if ( (matches(not_an_arg,arg[i])==0) \ + && (match(first_char,numeric)==0) \ + && (match(arg[i],"\\$")==0) \ + && (length(arg[i])>0) \ + && (matches(symbols,arg[i]) ==0) ) { + print arg[i] "\t" name; + } + } + } +} + + + + + ADDED mtt/bin/trans/awk/rbg_fig2m.awk Index: mtt/bin/trans/awk/rbg_fig2m.awk ================================================================== --- mtt/bin/trans/awk/rbg_fig2m.awk +++ mtt/bin/trans/awk/rbg_fig2m.awk @@ -0,0 +1,854 @@ +###################################### +##### Model Transformation Tools ##### +###################################### + +# gawk script: rbg_fig2m.awk +# Raw bond-graph conversion from fig to matlab +# P.J.Gawthrop June 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.46 2004/08/04 19:46:42 geraint +## Sorts components alphabetically (type:name) within the categories: +## internal ports, components, 0 junctions and 1 junctions. +## +## Standardising the order in which components are listed allows models +## built with different editors to interact correctly by separating the +## graphical information from the data which is required to build models. +## +## Revision 1.45 2004/04/07 12:17:43 gawthrop +## Handles new Fig header line. +## +## Revision 1.44 2002/05/25 09:23:47 gawthrop +## Self-naming components: name is mttTYPE or mttTYPE_2 ... +## +## Revision 1.43 2002/05/22 10:33:18 gawthrop +## Nameless components are now named according to type - replaces old +## mtt1 etc style. +## +## Revision 1.42 2002/03/26 12:05:27 geraint +## Escaped characters to eliminate awk warnings. +## +## Revision 1.41 2001/06/13 10:41:06 gawthrop +## Further changes towards aouto creation of lbl files. +## Prettified lbl files +## +## Revision 1.40 2001/06/11 19:43:50 gawthrop +## MTT is now much more sophisticated in generating lbl files +## Labels can contain maths +## Repetative components are now broken +## +## Revision 1.39 2001/05/09 08:50:02 gawthrop +## Uses _art.fig to transmit the art work to the cbg.fig rep. +## +## Revision 1.38 2001/03/23 14:57:31 gawthrop +## Now puts space after header fields + writes _port.fig +## +## Revision 1.37 2000/09/14 08:43:32 peterg +## Add additional directional informatiuon to rbonds: +## cols 7-8 Arrow end directional bond +## cols 9-10 Arrow end directional bond +## +## Revision 1.36 1999/11/19 04:00:26 peterg +## Changed a comment to be more accurate. +## +## Revision 1.35 1999/07/25 22:19:45 peterg +## Fixed bug with false objects when compound objects present. +## -- Reset object to 0 after processing text. +## +## Revision 1.34 1999/02/17 06:23:49 peterg +## Bugs arising from Fig 3.2 fixed +## +## -- depth now zero modulo 10 (3.2 defaults to depth 100!!) +## -- horrible bug using = in place of == fixed. +## +## Revision 1.33 1998/08/10 15:51:06 peterg +## Comments may now be prefaced by # as well as % +## +## Revision 1.32 1998/07/27 20:30:03 peterg +## *** empty log message *** +## +## Revision 1.31 1998/04/16 13:18:13 peterg +## Now ignores spurious ports (in lbl but not Figure \ref{) but gives +## warning +## +## Revision 1.30 1998/04/12 15:01:17 peterg +## Converted to uniform port notation - always use [] +## +## Revision 1.29 1998/04/12 12:35:32 peterg +## Named and unnamed SS handled in a uniform manner - in particular, the +## attributes are passed through +## wrote_component function used. +## +## Revision 1.28 1998/04/06 08:41:48 peterg +## Fixed bug due to adding (and then removing) 0 and 1 as port types +## +## Revision 1.27 1998/04/04 10:54:58 peterg +## Remove a debugging print statement +## +## Revision 1.26 1998/04/04 07:29:26 peterg +## SS now only port component +## +## Revision 1.25 1998/04/03 15:07:20 peterg +## Now correctly write 0/1 port names +## +## Revision 1.24 1998/04/03 14:02:50 peterg +## Added 0 and 1 to list of possible ports +## +## Revision 1.23 1998/02/01 18:37:41 peterg +## Don't print irritating warnings about ports listed in lbl files. +## +# Revision 1.22 1997/08/09 14:42:39 peterg +# Added underscore to port regexp +# +## Revision 1.21 1997/08/04 12:49:17 peterg +## Modified to use named (as opposed to numbered) ports. +## Generates a list of component ports in the .rbg file. +## As octave handles string vectors properly, the .cmp file format is not +## really necessary - but I've let it be for the moment. +## +## Revision 1.20 1997/03/19 12:02:01 peterg +## Now writes an error message if a lable is used twice in the fig file. +## +# Revision 1.19 1997/03/19 09:49:39 peterg +# Ports now written in cmp file. +# +# Revision 1.18 1997/03/19 09:42:08 peterg +# Now writes out the following additional fig files: +# _head.fig The fig header +# _bnd.fig The bonds actually used +# _cmp.fig The components actually used. +# +# Revision 1.17 1997/01/02 11:21:17 peterg +# Now assumes all components bonds etc at depth zero in fig file. +# Ie anything at depth>0 is ignored. +# Thanks to Donald for suggesting this. +# +## Revision 1.16 1996/12/30 20:00:29 peterg +## Fixed bent-bond bug. +## NB unfixed problems: +## 1. xfig writes multi line fields if more than about 5 segments. +## 2. rbg2abg takes a multi-segment bond as a straignt line between the +## end points - so computation of stroke and arrow directions may be +## iffy. +## +## Revision 1.15 1996/12/30 19:23:35 peterg +## Allows for bent bonds - ie bonds with more than 2 line segments. +## +## Revision 1.14 1996/12/21 19:47:53 peterg +## Changed \* to \\* +## +## Revision 1.13 1996/12/21 19:47:23 peterg +## Put back under VC +## +# Revision 1.12 1996/08/24 16:30:12 peter +# Fixed error in nonport_regexp. +# +## Revision 1.11 1996/08/19 10:48:57 peter +## Added `-' to the component regexp. +## +## Revision 1.10 1996/08/19 09:03:13 peter +## Parses repetative components: ie suffixed by *n. +## +## Revision 1.9 1996/08/09 08:23:11 peter +## Fixed bug: ports not recognised. +## +## Revision 1.8 1996/08/05 20:12:43 peter +## Now writes a _fig.fig file. +## +## Revision 1.7 1996/08/05 18:44:56 peter +## Now writes out a _cbg file without ----- symbol. +## +## Revision 1.6 1996/08/05 12:17:37 peter +## n_ports now appear in the _abg file instead. +## +## Revision 1.5 1996/08/05 12:01:28 peter +## The _cmp function now returns the number of ports. +## +## Revision 1.4 1996/08/05 10:14:46 peter +## Made ports appear, in order, at top of component lists +## +## Revision 1.3 1996/08/04 20:32:28 peter +## Stopped complaint about missing lbl entry for port components +## +## Revision 1.2 1996/08/04 20:05:25 peter +## Included port components - eg SS:[1] +## +## Revision 1.1 1996/08/04 20:01:58 peter +## Initial revision +## +############################################################### + + +############################################################## +# This (g)awk script reads a fig file in fig 3.1 format. +# It interprets the picture as: bonds, arrows and components +# as follows: +# +# Bonds are firm (not dashed etc) polylines with n line segments - +# fig represents this by a firstline record where +# field 1 = 2 (always 2) +# field 2 = 1 (polyline) +# field 3 = 0 (style is a firm line) +# field 7 = 0 (depth is zero [top level]) +# field 14 = 0 (no forward arrow) +# field 15 = 0 (backward arrow) +# field 16 = Number of point in line (points=segments+1) +# a data field starting with a tab followed by points (x,y) cordinates +# +# +# Strokes are polylines with 1 line segment and and no arrow +# fig represents this by a firstline record where +# field 1 = 2 (always 2) +# field 2 = 1 (polyline) +# field 3 = 0 (style is a firm line) +# field 14 = 0 (no forward arrow) +# field 15 = 0 (backward arrow) +# field 16 = Number of point in line =2 +# a data field starting with a tab followed by 2 (x,y) cordinates +# +# Arrows are polylines with 1 line segment and an arrow +# fig represents this by a firstline record where +# field 1 = 2 (always 2) +# field 2 = 1 (polyline) +# field 3 = 0 (style is a firm line) +# field 14 = 1 for a forward arrow +# field 15 = 1 for a backward arrow +# an additional data files +# a data field starting with a tab followed by 2(x,y) cordinates +# +# Components appear in two files -- the fig file and the lbl file +# these two files are concatenated with the lbl file first +# The lbl file represents components by 3 fields +# field 1 is the name +# field 2 is the CR name +# field 3 is the CR arguments +# The fig file represents components by 14 fields +# field 1 = 4 +# fields 12 and 13 are the coordinates +# field 14 is the type:name string terminated by \001 +# To prevent text being confused with components, components consist +# of alphanumeric characters and : and _ only. +# +# Components are sorted alphabetically ("type:name") +# within the following categories: +# 1) internal ports (SS:[...]) +# 2) basic components, subsystems and external ports +# 3) 0 junctions +# 4) 1 junctions +############################################################## + +function modulo10(x) { + return x-int(x/10)*10 + } + +function exact_match(name1, name2) { + return ((match(name1,name2)>0)&&(length(name1)==length(name2))) + } + +function write_component(i) { + name = label[i,1]; + cr = label[i,2]; + arg = label[i,3]; + if (length(x[name])==0) { + # print error - its in lbl but not fig file + printf(warning_l, name); + } + else { + component_index++; + print x[name], y[name], info[name] >> b_file; + printf("if i==%1.0f\n", component_index) >> c_file; + printf("\tcomp_type = %s%s%s;\n", q, comp_type[name], q) >> c_file; + printf("\tname = %s%s%s;\n", q, name, q) >> c_file; + printf("\tcr = %s%s%s;\n", q, cr, q) >> c_file; + printf("\targ = %s%s%s;\n", q, arg, q) >> c_file; + printf("\trepetitions = %s;\n", reps[name]) >> c_file; + print "end" >> c_file + } + } + +function process_lbl() { +# This puts the components in the lable file at the top of the list +# and saves up the corresponding CR and arguments +# note that there may be more than one component per label + if ((match($1,comment_regexp)==0)&&(NF>0)) + { + i_label++; + name = $1; + CR = $2; + args = $3; + + label[i_label,1] = name; + label[i_label,2] = CR; + label[i_label,3] = args; + } +} + +function sort_cmp() { +# Sorts components alphabetically by type then name + for (i = 1; i <= i_label; i++) { + name = label[i,1]; + type = comp_type[name]; + cmp_list[i] = sprintf ("'%s:%s'", type, name); + } + + if (no_alpha_sort=="no_alpha_sort") + print "Not sorting components alphabetically" + else { + print "Sorting components alphabetically"; + asort (cmp_list) + }; + + for (i = 1; i <= i_label; i++) { + for (j = 1; j <= i_label; j++) { + name = label[j,1]; + type = comp_type[name]; + typename = sprintf ("'%s:%s'", type, name); + if (typename == cmp_list[i]) { + sort_cmp_list[i] = j; + } + } + } +} + +function fig_info() { +# Grabs the fig-file information for a component + return(sprintf("%s %s %s %s %s %s %s %s %s %s %s ", \ + $1, $2, $3, $4, $5, $6, $7, \ + $8, $9, $10, $11)) + } + +function type_name(type) { +# if (type==1) +# return "one" +# else { +# if (type==0) +# return "zero" +# else +# return type +# } + return sprintf("mtt%s", type); +} + +function process_text() { +# The text string is field 14 onwards + str = $14; + for (i=15; i<=NF; i++) { + str = sprintf("%s %s", str, $i) + } + +# The depth is field 4 (for strings) + depth = modulo10($4); + +# It is terminated by \001 - so delete this termination + str = substr(str,1,length(str)-4); + +# Zap maths + ##gsub(/[()-+*/]/,"",str); + +# Lose the cr stuff (if present) + if (depth==0) { + N=split(str,a,delimiter); + if (N==3) + str=sprintf("%s%s%s", a[1],delimiter,a[2]); + } + +# A component string contains only alphanumeric _ and : + isa_plain_component = match(str, component_regexp)==0; +# It must also be specified at depth 0 (modulo 10) + isa_plain_component = isa_plain_component && (depth==0); + +# A port is a string within [] + isa_port = (match(str, port_regexp)>0) + +# It must also be specified at depth 0 + isa_port = isa_port && (depth==0); + +# Vector port definitions + isa_PORT = ((match(str, PORT_regexp)>0) && (depth==0)); + + if (isa_PORT) { + print str + } + +# A port component is an SS followed by a port string + isa_port_component = 0; + if (match(str, delimiter)) { + split(str,a,delimiter); + isa_port_component = (match(a[1], port_component_regexp))&& + (match(a[2], port_regexp)>0) + } + +# It must also be specified at depth 0 + isa_port_component = isa_port_component && (depth==0); + +# A component is a plain or a port component + isa_component = isa_plain_component||isa_port_component; + +# Coordinates in fields 12 & 13 + x_coord = $12; + y_coord = $13; + +# Do the ports + if (isa_port) { + i_port++; + port_name = str; + ports[i_port] = sprintf("%s %s %s", x_coord, y_coord, port_name); + } + +# Do the port components +# if (isa_port_component) { +# i_port_component++; +# type = a[1]; +# # Port name is the bit between the [] +# port_label = substr(a[2],2,length(a[2])-2); +# x_port[i_port_component] = x_coord; +# y_port[i_port_component] = y_coord; +# info_port[i_port_component] = fig_info(); +# port_labels[i_port_component] = port_label; +# } + +# Do the components + if (isa_component) { + i_text++; + +# Get repetitions (if any) + if (match(str,repetition_regexp) > 0) { + split(str,b,repetition_delimiter); + repetitions = b[2]; + str = b[1]; + } + else { + repetitions = "1"; + }; + + named_component = (match(str,delimiter) > 0); + if (named_component) { + split(str,a,delimiter); + type = a[1]; + name = a[2]; +# Check if name is in label file and if used already + found = 0; name_used = 0; + for (i=1; i<=i_label; i++) { + lname = label[i,1]; + if ( lname==name ) { + found = 1; + if (name in used) { + name_used = 1; + CR = label[i,2]; + args = label[i,3]; + } + else { + used[name] = 1 + } + break + } + } + +if (!found) { +printf(warning_f, name); +i_label++; +CR = default_cr; +args = ""; +label[i_label,1] = name; +label[i_label,2] = CR; +label[i_label,3] = args +} + +# Give it a new entry if already used +# -- also tell user as it is an error now(?) + if (name_used) { + printf(warning_u, name); + i_label++; + i_name++; + name = sprintf("%1.0f", i_name); + label[i_label,1] = name; + label[i_label,2] = CR; + label[i_label,3] = args + } + } + +# Unnamed component + if (named_component==0) { + type = str; + + if (type in name_index) + name_index[type]++ + else + name_index[type] = 1; + + if (name_index[type]==1) + name = sprintf("%s", type_name(type)) + else + name = sprintf("%s_%i", type_name(type), name_index[type]); + + i_label++; + label[i_label,1] = name; + label[i_label,2] = default_cr; + label[i_label,3] = default_args + } + +# Save in associative arrays by name + comp_type[name] = type; + x[name] = x_coord; + y[name] = y_coord; + info[name] = fig_info(); + reps[name] = repetitions; + } + +} + +#Euclidean length of a line between (first_x,first_y) and (second_x,second_y) +function line_length(first_x,first_y,second_x,second_y) { + x_length = second_x-first_x; + y_length = second_y-first_y; + return sqrt( x_length*x_length + y_length*y_length ); +} + +# Returns 1 if (bond) arrow at beginning of field or 2 if arrow at end of field +function arrow_end(first_x,first_y,second_x,second_y,penultimate_x,penultimate_y,last_x,last_y) { + if ( line_length(first_x,first_y,second_x,second_y) < line_length(first_x,first_y,second_x,second_y) ) { + return 1 + } + else { + return 2 + } +} + +function process_bond() { + + arg_count++; + if ( (arg_count-arrow)==1 ) + { + +#Save up bond coords - no arrow and more segments than a stroke has. +# Allows for bent bonds - but just write out the relevant coordinates + if ( (!arrow)&& (NF>2*stroke_coords+1) ) { + i_bond++; + a_end = arrow_end($2,$3,$4,$5,$(NF-3),$(NF-2),$(NF-1),$NF); + if (a_end==1) { + arrow_end_vector_x = $6-$4; + arrow_end_vector_y = $7-$5; + other_end_vector_x = $(NF-1)-$(NF-3); + other_end_vector_y = $(NF)-$(NF-2); + bonds[i_bond] = sprintf("%s %s %s %s %s %s %s %s %s %s", \ + $2, $3, $4, $5, $(NF-1), $(NF), + arrow_end_vector_x, + arrow_end_vector_y, + other_end_vector_x, + other_end_vector_y); + } + else { + other_end_vector_x = $4-$2; + other_end_vector_y = $5-$3; + arrow_end_vector_x = $(NF-3)-$(NF-5); + arrow_end_vector_y = $(NF-2)-$(NF-4); + bonds[i_bond] = sprintf("%s %s %s %s %s %s %s %s %s %s", \ + $2, $3, $(NF-3),$(NF-2),$(NF-1),$NF, + arrow_end_vector_x, + arrow_end_vector_y, + other_end_vector_x, + other_end_vector_y); + } + } + +#Save up arrow coords + if ( (arrow)&&(NF==(2*arrow_coords+1)) ) { + i_arrow++; + arrows[i_arrow] = sprintf("%s %s %s %s", $2, $3, $4, $5); + } + +#Save up stroke coords + if ( (!arrow)&&(NF==(2*stroke_coords+1)) ) { + i_stroke++; + strokes[i_stroke] = sprintf("%s %s %s %s", $2, $3, $4, $5); + } + } +} + +function write_fig() { +# Create _fig.fig file from _abg file - not components +# and write out the components in a _cmp.fig file +# and write out the bonds in a _bnd.fig file + +# The artwork -- not header and not zero depth + + if ((NF>2)&&(!zero_depth)) { + art=$0; + sub("----"," ",art) + printf("%s\n", art) >> art_file + } + + +#Everything except components + if ( ((object!=text)||(isa_component==0)) ) { + #Replace the data_symbol + if (exact_match($1,data_symbol)) { + field_1 = out_data_symbol + } + else { + field_1 = $1 + } + + printf("%s",field_1) >> fig_file + for (i=2; i<=NF; i++) + printf(" %s", $i) >> fig_file; + if (NF==1) + printf(" ") >> fig_file; # Put space after header fields + printf("\n") >> fig_file + } + +# Header + if ($1=="#FIG") + printf("%s", $0) >> head_file; + + if ( NF<3 ) { + printf("%s", $1) >> head_file; + for (i=2; i<=NF; i++) + printf(" %s", $i) >> head_file; + if (NF==1) + printf(" ") >> head_file; # Put space after header fields + printf("\n") >> head_file + } +# Bonds + if (isa_bond) { + + #Replace the data_symbol + if (exact_match($1,data_symbol)) { + field_1 = out_data_symbol + } + else { + field_1 = $1 + } + + printf field_1 >> bnd_file + for (i=2; i<=NF; i++) + printf(" %s", $i) >> bnd_file; + printf("\n") >> bnd_file + } + +# Components & ports + if ( isa_component||isa_port ) { + for (i=1; i<=NF; i++) + printf(" %s", $i) >> cmp_file; + printf("\n") >> cmp_file + } + +# Ports + if ( isa_port_component ||isa_port) { + for (i=1; i<=NF; i++) + printf(" %s", $i) >> port_file; + printf("\n") >> port_file +} +} + +function process_fig() { +# Test for the fig format first line and data line + data_line = (match($1,data_symbol)>0); + first_line = (data_line==0)&&(NF>min_line_length); + +#Process firstline + if (first_line) { + object = $1; + sub_type = $2; + style = $3; + zero_depth = ((modulo10($7)==0)&&(object==polyline)) || ((modulo10($4)==0)&&(object==text)) + f_arrow = ($14==1)&&(object=polyline); + b_arrow = ($15==1)&&(object=polyline); + arrow = f_arrow||b_arrow; + arg_count = 0; + } + +#Process text + if (object==text) { + process_text(); + object = 0; # Text on one line so reset object to zero- avoids compound problem + } + +# Process bond +isa_bond = (zero_depth &&\ + (object==polyline)&& \ + (sub_type==sub_polyline)&& \ + (style==firm_style) \ + ); + +if ( isa_bond && data_line) +{ + process_bond() + } + +if (isa_fig_file){ + write_fig() + } + + } + +BEGIN { + sys_name = ARGV[1]; + delete ARGV[1]; + + b_file = sprintf("%s_rbg.m", sys_name); + c_file = sprintf("%s_cmp.m", sys_name); + fig_file = sprintf("%s_fig.fig", sys_name); + cmp_file = sprintf("%s_cmp.fig", sys_name); + port_file = sprintf("%s_port.fig", sys_name); + bnd_file = sprintf("%s_bnd.fig", sys_name); + head_file = sprintf("%s_head.fig", sys_name); + art_file = sprintf("%s_art.fig", sys_name); + + warning_f = "WARNING %s \t in fig file but not lbl file - using\n"; + warning_l = "WARNING %s \t in lbl file but not fig file - ignoring\n"; + warning_p = "ERROR system ports are not consecutively numbered\n"; + warning_u = "ERROR %s has already appeared in the fig file\n"; + + comment_regexp = "%|#" + data_symbol = "----"; + out_data_symbol = "\t"; + default_cr = ""; + default_args = ""; + delimiter = ":"; + repetition_delimiter = "*"; + repetition_regexp = "\\*"; + q = "\047"; + terminator = "\\001"; + component_regexp = "[^0-9a-zA-Z_:*-]"; + port_regexp = "^[[a-zA-Z0-9_,]*]"; + nonport_regexp = "[a-zA-Z]"; + PORT_regexp = "^PORT .*="; + port_component_regexp = "SS"; + isa_fig_file = 0; + min_line_length = 10; + object = 0; + polyline = 2; + sub_polyline=1; + firm_style = 0; + text = 4; + compound_object = 6; + bond_coords = 3; + stroke_coords = 2; + arrow_coords = 2; + + i_bond = 0; + i_port = 0; + i_stroke = 0; + i_arrow = 0; + i_label = 0; + i_text = 0; + i_port_component = 0; + + component_index = 0; +} +{ +# Start of .fig file? + if ($1=="#FIG") { + isa_fig_file=1; + } + if (isa_fig_file==0) { + process_lbl() + } + else { + process_fig() + } +} + +END { +#Print out the Octave functions + printf("function [rbonds, rstrokes,rcomponents,port_coord,port_name,port_list] = %s_rbg\n", sys_name) > b_file; + printf("%% [rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = %s_rbg\n", sys_name) > b_file; + printf("%% Generated by MTT\n\n") > b_file; + + printf("function [comp_type, name, cr, arg, repetitions] = %s_cmp(i)\n",\ + sys_name) > c_file; + printf("%% [comp_type, name, cr, arg, repetitions] = %s_cmp\n", sys_name) > c_file; + printf("%% Generated by MTT\n\n") > c_file; + + printf("rbonds = [\n") >> b_file; + for (i = 1; i <= i_bond; i++) + print bonds[i] >> b_file; + for (i = 1; i <= i_arrow; i++) + print arrows[i], "-1 -1" >> b_file; + printf("];\n") >> b_file; + + printf("rstrokes = [\n") >> b_file; + for (i = 1; i <= i_stroke; i++) + print strokes[i] >> b_file; + printf("];\n") >> b_file; + + printf("rcomponents = [") >> b_file; + j = 0; + + sort_cmp(); # sort components alphabetically + +# Do the port components, in order of appearance, first. + for (i = 1; i <= i_label; i++) { + num = sort_cmp_list[i]; + name = label[num,1]; + if (match(name,port_regexp)) + write_component(num); + } + +# then do the ordinary components, in order of appearance. + for (i = 1; i <= i_label; i++) { + num = sort_cmp_list[i]; + name = label[num,1]; + if (!match(name,port_regexp)) + if ((!match(comp_type[name],"0"))&& + (!match(comp_type[name],"1"))) + write_component(num); + } + +# followed by the 0 junctions + for (i = 1; i <= i_label; i++) { + num = sort_cmp_list[i]; + name = label[num,1]; + if (!match(name,port_regexp)) + if (match(comp_type[name],"0")) + write_component(num); + } +# and finally the 1 junctions + for (i = 1; i <= i_label; i++) { + num = sort_cmp_list[i]; + name = label[num,1]; + if (!match(name,port_regexp)) + if (match(comp_type[name],"1")) + write_component(num); + } + printf("];\n") >> b_file; + +# Print the (internal) ports list + printf("port_coord = [\n") >> b_file; + for (i = 1; i <= i_port; i++) { + split(ports[i],a, " "); + printf("%s %s\n", a[1], a[2]) >> b_file; + } + printf("];\n\n") >> b_file; + + printf("port_name = [\n") >> b_file; + for (i = 1; i <= i_port; i++) { + split(ports[i],a, " "); + # Dont Remove the [] + # name = substr(a[3],2,length(a[3])-2); + name = a[3]; + printf("'%s'\n", name) >> b_file; + } + printf("];\n\n") >> b_file; + +# Print the (external) port list - ignore spurious ports (in lbl, not fig) + printf("port_list = [\n") >> b_file; + for (i = 1; i <= i_label; i++) { + name = label[i,1]; + if (length(x[name])>0) { + if (match(name,port_regexp)) + printf("'%s'\n", name) >> b_file; + } + } + printf("];\n\n") >> b_file; + +} + + + ADDED mtt/bin/trans/awk/rep_txt2make.awk Index: mtt/bin/trans/awk/rep_txt2make.awk ================================================================== --- mtt/bin/trans/awk/rep_txt2make.awk +++ mtt/bin/trans/awk/rep_txt2make.awk @@ -0,0 +1,34 @@ +###################################### +##### Model Transformation Tools ##### +###################################### + +# gawk script: rep_txt2make +# Converts the text file describing a report to makefile dependencies +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +# Revision 1.3 1997/05/19 15:40:04 peterg +# Pass mtt swithches to the new make file +# +# Revision 1.2 1996/11/21 15:57:28 peterg +# Now runs mtt quietly. +# +# Revision 1.1 1996/08/18 19:59:00 peter +# Initial revision +# +############################################################### + + +{ + if (NF==2) + if( match("tex txt r m ps",$2)>0) + print "mtt -q", switches, system_name, $1, $2 +} + + + ADDED mtt/bin/trans/awk/rep_txt2tex.awk Index: mtt/bin/trans/awk/rep_txt2tex.awk ================================================================== --- mtt/bin/trans/awk/rep_txt2tex.awk +++ mtt/bin/trans/awk/rep_txt2tex.awk @@ -0,0 +1,80 @@ +###################################### +##### Model Transformation Tools ##### +###################################### + +# gawk script: rep_txt2tex +# Converts the text file describing a report to a report. +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +# Revision 1.5 1997/05/22 11:12:34 peterg +# Chaged figure label. +# +## Revision 1.4 1997/05/22 07:36:35 peterg +## \ref --> \Ref +## +## Revision 1.3 1997/05/19 16:43:34 peterg +## Explicit include of tex files 'cos latex2html prefers this! +## +# Revision 1.2 1997/05/19 16:11:10 peterg +# Modified section headers. +# +# Revision 1.1 1996/08/18 19:58:49 peter +# Initial revision +# +############################################################### + + +BEGIN { + split(ARGV[1],a,"_"); + system_name = a[1]; + args = ARGV[2]; + comment="\%"; +} +{ + if ((match($1,comment)==0)&&(NF==2)) { + Representation = $1; + Language = $2; + Rep_lang = sprintf("%s_%s", Representation, Language); + section_head = sprintf("System \\textbf{%s}: representation \\textbf{%s}, language \\textbf{%s}", \ + system_name,Representation,Language); +# section headings + print "\\section{" section_head "}"; + print "\\label{" Rep_lang "}"; + print "\\index{\\textbf{" system_name "} -- " Representation "}"; + +# tex files + if( match("tex",Language)>0) { + # printf(" \\input{%s_%s.%s}\n", system_name, Representation, Language); + command = sprintf("cat %s_%s.%s", system_name, Representation, Language); + system(command); } +# text files + if( match("txt r m c h",Language)>0) { + print " \\begin{verbatim}"; + command = sprintf("cat %s_%s.%s", system_name, Representation, Language); + system(command); + print " \\end{verbatim}"; + } +# ps files + if( match("ps",Language)>0) { + printf("This representation is given as Figure \\Ref{fig:%s}.\n", Rep_lang); + print " \\begin{figure}"; + printf(" \\shadowbox{ \\epsfig{file=%s_%s.%s,width=0.9\\linewidth} }\n", \ + system_name, Representation, Language); + printf(" \\caption{System \\textbf{%s}, representation %s}\n", system_name, Representation); + printf(" \\label{fig:%s}\n", Rep_lang); + print " \\end{figure}"; + } + } +} +END { + +} + + + ADDED mtt/bin/trans/awk/tex2doc.awk Index: mtt/bin/trans/awk/tex2doc.awk ================================================================== --- mtt/bin/trans/awk/tex2doc.awk +++ mtt/bin/trans/awk/tex2doc.awk @@ -0,0 +1,41 @@ +###################################### +##### Model Transformation Tools ##### +###################################### + +# gawk script: tex2doc +# Encapsulates a tex file in a document. +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +# Revision 1.2 1997/04/15 11:18:49 peterg +# Uses supertabular package +# +# Revision 1.1 1996/08/18 20:00:10 peter +# Initial revision +# +############################################################### + + +END{ +# split(ARGV[1],a,"_"); +# system_name = a[1]; +# split(a[2],b,"."); +# representation = b[1]; + makefile = sprintf("%s_rep.make", $system_name, $representation); + print "\\documentclass[12pt,a4paper]{article}"; + printf("\\title{System %s, representation %s}\n", \ + system_name, representation) + print "\\author{Generated by MTT}"; + print " \\usepackage{epsfig}"; + print " \\usepackage{supertabular}"; + print "\\begin{document}"; + print " \\maketitle"; + print" \\input{}", system_nam,e $representation; + print $system_name $representation + print "\\end{document}" +} ADDED mtt/bin/trans/bg2eps Index: mtt/bin/trans/bg2eps ================================================================== --- mtt/bin/trans/bg2eps +++ mtt/bin/trans/bg2eps @@ -0,0 +1,24 @@ +#! /bin/sh + +set +e # prevent dia errors from halting MTT + +sys=$1 +rep=$2 +ps=$3 +eps=$4 + +dia_files=`ls ${sys}*_${rep}.dia 2>/dev/null | sed 's/\.dia$//'` +fig_files=`ls ${sys}*_${rep}.fig 2>/dev/null | sed 's/\.fig$//'` + +for file in ${dia_files} + do + dia --export-to-format=eps ${file}.dia + if [ "${ps}" != "eps" ] + then mv ${file}.eps ${file}.${ps} + fi +done + +for file in ${fig_files} + do + fig2dev -L${eps} ${file}.fig > ${file}.${ps} +done ADDED mtt/bin/trans/c-tidy Index: mtt/bin/trans/c-tidy ================================================================== --- mtt/bin/trans/c-tidy +++ mtt/bin/trans/c-tidy @@ -0,0 +1,37 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1997/02/04 18:50:07 peterg +## Initial revision +## +## Revision 1.2 1996/08/20 08:26:06 peter +## Version control header added. +## +############################################################### + +# Bourne shell script: c_tidy +# Tidies up C format files +# P.J.Gawthrop 14 June 1990 13 Nov 1990, 19 Nov 93, April 1994, Dec 1994, +# June 1995 +# Copyright (c) P.J.Gawthrop, 1990, 1994, 1995. + +# Remove blank lines +cat $1 | \ +tr -s '\012' '\012'\ +>junk +mv junk $1 + + + + + + + ADDED mtt/bin/trans/c_tidy Index: mtt/bin/trans/c_tidy ================================================================== --- mtt/bin/trans/c_tidy +++ mtt/bin/trans/c_tidy @@ -0,0 +1,41 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1997/02/04 18:52:34 peterg +## Copied from matlab tidy -- removed everthing except removal of blank +## lines +## +## Revision 1.1 1997/02/04 18:50:07 peterg +## Initial revision +## +## Revision 1.2 1996/08/20 08:26:06 peter +## Version control header added. +## +############################################################### + +# Bourne shell script: c_tidy +# Tidies up C format files +# P.J.Gawthrop 14 June 1990 13 Nov 1990, 19 Nov 93, April 1994, Dec 1994, +# June 1995 +# Copyright (c) P.J.Gawthrop, 1990, 1994, 1995. + +# Remove blank lines +cat $1 | \ +tr -s '\012' '\012'\ +>junk +mv junk $1 + + + + + + + ADDED mtt/bin/trans/can_r2m Index: mtt/bin/trans/can_r2m ================================================================== --- mtt/bin/trans/can_r2m +++ mtt/bin/trans/can_r2m @@ -0,0 +1,122 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: can_r2m +# Reduce canonical forsm to matlab +# P.J.Gawthrop January 8th 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + + +# Inform user +echo Creating $1_can.m + +# Remove the old log file +rm -f can_r2m.log + +# Use reduce to accomplish the transformation +reduce >can_r2m.log << EOF + +%Read in the definitions file +IN "$1_def.r"; + +%Read the reduce state-space A,B,C and D matrices file +IN "$1_can.r"; + +%Set up the number of argument variables to zero in case the user has forgotten +MTTNVar := 0; + +%Read in the parameter file +IN "$1_sympar.r"; + +OUT "$1_can.m"; +%Headings - Matlab style +%(Note. The ;; are deleted by for2mat) + +write "function [A_c,B_c,C_c,D_c,Con,Obs,K,L,A_comp,B_comp,C_comp] = $1_can;;"; +write "%function [A_c,B_c,C_c,D_c,Con,Obs,K,L,A_comp,B_comp,C_comp] = $1_can;;"; + +write "%Canonical forms and controller design for system $1"; +write "%File $1_can.m"; +write "%Generated by MTT"; +write ""; + +IF MTTNvar>0 THEN +BEGIN + write "% Set the parameters"; + write "global ...;;"; + FOR i := 1:MTTNx DO + write "alpha_c",i, " alpha_o",i, "...;;"; + + FOR i := 1:MTTNvar DO + BEGIN + IF numberp(MTTVar(i,1)) + THEN + BEGIN + % Do nowt + END + ELSE + BEGIN + write MTTVar(i,1), " ..."; + END; + END; + write " "; +END; + + +%Fortran switches - one line expressions +OFF echo; +ON fort$ +cardno!* := 1$ +fortwidth!* := 100$ +OFF period$ + +write "MTTA_c = zeros(", MTTNx, ",", MTTNx, ");"; +write "MTTB_c = zeros(", MTTNx, ",", MTTNu, ");"; +write "MTTC_c = zeros(", MTTNy, ",", MTTNx, ");"; +write "MTTD_c = zeros(", MTTNy, ",", MTTNu, ");"; + +write "MTTCon = zeros(", MTTNx, ",", MTTNx, ");"; +write "MTTObs = zeros(", MTTNx, ",", MTTNx, ");"; + +write "MTTK = zeros(", MTTNy, ",", MTTNx, ");"; +write "MTTL = zeros(", MTTNx, ",", MTTNu, ");"; + +write "MTTA_comp = zeros(", MTTNx, ",", MTTNx, ");"; +write "MTTB_comp = zeros(", MTTNx, ",", MTTNy, ");"; +write "MTTC_comp = zeros(", MTTNu, ",", MTTNx, ");"; + + +ON NERO; % Suppress zero elements. +MTTA_c := MTTA_c; +MTTB_c := MTTB_c; +MTTC_c := MTTC_c; +MTTD_c := MTTD_c; + +MTTCon := MTTCon; +MTTObs := MTTObs; + + +MTTK := MTTK; +MTTL := MTTL; + +MTTA_comp := MTTA_comp; +MTTB_comp := MTTB_comp; +MTTC_comp := MTTC_comp; +MTTD_comp := MTTD_comp; + + +OFF FORT; +write ""; + +SHUT "$1_can.m"; ADDED mtt/bin/trans/can_r2tex Index: mtt/bin/trans/can_r2tex ================================================================== --- mtt/bin/trans/can_r2tex +++ mtt/bin/trans/can_r2tex @@ -0,0 +1,193 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: can_r2tex +# Reduce constrained-state matrices to LaTex constrained-state matrices. +# P.J.Gawthrop January 8th 1997 +# Copyright (c) P.J.Gawthrop, 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +# Inform user +echo Creating $1_can.tex + +# Remove the old log file +rm -f can_r2tex.log + +# Use reduce to accomplish the transformation +reduce >can_r2tex.log<< EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the canonical-form matrices file +in "$1_can.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; + +OUT "$1_can.tex"; + +%Write out the canonical matrices +write "%Canonical-form matrices $1"; +write "%File: $1_can.tex"; +write""; + + +% Controllable form +MTT_Matrix := MTTA_c$ +MTT_Matrix_name := "MTTA_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTB_c$ +MTT_Matrix_name := "MTTB_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTC_c$ +MTT_Matrix_name := "MTTC_c"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + + +% Observable form +MTT_Matrix := MTTA_o$ +MTT_Matrix_name := "MTTA_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTB_o$ +MTT_Matrix_name := "MTTB_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTC_o$ +MTT_Matrix_name := "MTTC_o"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% - Controllability matrix"; +MTT_Matrix := MTTCon$ +MTT_Matrix_name := "MTTCon"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% -Observability matrix"; +MTT_Matrix := MTTObs$ +MTT_Matrix_name := "MTTObs"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% -Controllability matrix - controller form"; +MTT_Matrix := MTTCon_c$ +MTT_Matrix_name := "MTTCon_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% - Transformation matrix - controller form"; +MTT_Matrix := MTTT_c$ +MTT_Matrix_name := "MTTT_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% - Gain matrix - controller form"; +MTT_Matrix := MTTK_c$ +MTT_Matrix_name := "MTTK_c"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% - Gain matrix - physical form"; +MTT_Matrix := MTTK$ +MTT_Matrix_name := "MTTK"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + + +write "% -Observability matrix - Observer form"; +MTT_Matrix := MTTObs_o$ +MTT_Matrix_name := "MTTObs_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% - Transformation matrix - Observer form"; +MTT_Matrix := MTTT_o$ +MTT_Matrix_name := "MTTT_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% - Observer Gain matrix - observer form"; +MTT_Matrix := MTTL_o$ +MTT_Matrix_name := "MTTL_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNy$ +LaTeX_Matrix()$ + +write "% - Gain matrix - physical form"; +MTT_Matrix := MTTL$ +MTT_Matrix_name := "MTTL"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNy$ +LaTeX_Matrix()$ + + +% Controllable form +MTT_Matrix := MTTA_comp$ +MTT_Matrix_name := "MTTA_comp"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTB_comp$ +MTT_Matrix_name := "MTTB_comp"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTC_comp$ +MTT_Matrix_name := "MTTC_comp"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + + + +write "\begin{equation}"; + write "MTTur = {", MTTu_r, "}"; +write "\end{equation}"; + +SHUT "$1_can.tex"; +quit; +EOF ADDED mtt/bin/trans/cbg2ese_m2r Index: mtt/bin/trans/cbg2ese_m2r ================================================================== --- mtt/bin/trans/cbg2ese_m2r +++ mtt/bin/trans/cbg2ese_m2r @@ -0,0 +1,385 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cbg2ese_m +# +# +# P.J.Gawthrop June 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## +## $Log$ +## Revision 1.32 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.31 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## +## Revision 1.30 2001/07/12 04:02:53 gawthrop +## Now fixes multiports for input and output as well as state +## +## Revision 1.29.2.1 2001/06/26 22:29:05 geraint +## mtt_xargs.sh eliminates Arg list too long error for large models. +## (UNIX xargs does not work if the environment is too large). +## +## Revision 1.29 2001/03/29 19:24:14 gawthrop +## Can now use c representations of crs when using -c option +## +## Revision 1.28 2001/02/05 17:19:52 gawthrop +## Now gives unique names to the states of multiports. Second name +## onwards labeled with port number +## +## Revision 1.27 2000/12/05 12:09:56 peterg +## Changed function name to name() +## +## Revision 1.26 2000/12/05 09:04:54 peterg +## *** empty log message *** +## +## Revision 1.25 2000/12/01 14:51:26 peterg +## Major changes towards partioning +## +## - generates sub ese, def and struc +## - generates indices for conversion of subsystem in/out/state - but not used yet +## +## Revision 1.24 2000/11/30 15:12:55 peterg +## Zapped the declaration of subsystem connections - now in individual +## .def files +## +## Revision 1.23 2000/11/30 15:07:28 peterg +## Sorted out mtt_getsize +## +## Revision 1.22 2000/11/12 17:18:30 peterg +## Changed ' to " +## +## Revision 1.21 2000/10/16 08:40:35 peterg +## Whoops! Must touch mtt_aliased +## +## Revision 1.20 2000/10/16 08:36:31 peterg +## Creat empty _aliased file if it doesn't exist +## +## Revision 1.19 2000/10/12 19:25:39 peterg +## Now generateds the _aliased.txt file +## +## Revision 1.18 2000/09/15 08:09:42 peterg +## Removed another debugging line +## +## Revision 1.17 2000/09/15 08:06:17 peterg +## Removed debug lines +## +## Revision 1.16 2000/09/02 15:55:51 peterg +## *** empty log message *** +## +## Revision 1.15 1998/07/08 14:43:12 peterg +## Restored inforfile +## +## Revision 1.14 1998/07/08 08:26:26 peterg +## Added -I option -- if set prints out the information messages +## +## Revision 1.13 1998/05/12 14:49:10 peterg +## Don't write END; any more - ese-tidy does this now! +## +## Revision 1.12 1998/01/23 13:30:46 peterg +## $RMATRIX --> $MATRIX +## +## Revision 1.11 1997/12/16 18:05:03 peterg +## Increased size of structure vector by on to include unknown_inputs as +## 6th element +## +## Revision 1.10 1997/04/15 09:18:26 peterg +## Added structure file +## +# Revision 1.9 1996/12/07 18:21:25 peterg +# Now uses fopen + file number +# +## Revision 1.8 1996/12/05 10:05:28 peterg +## Removed the Octave switch: empty_list_elements_ok = 1; +## This is now in .octaverc +## +# Revision 1.7 1996/08/30 11:29:49 peter +# Added constitutive relationship to argument list. +# Put in explicit argument list to cbg2ese. +# +# Revision 1.6 1996/08/26 13:25:07 peterg +# Corrected error handling. +# +# Revision 1.5 1996/08/24 14:38:11 peter +# Error handling included. +# +## Revision 1.4 1996/08/19 09:02:12 peter +## Errors go to user - not log. +## +## Revision 1.3 1996/08/18 20:05:55 peter +## Included zero outputs. +## +## Revision 1.2 1996/08/08 18:08:37 peter +## Sorted out file naming scheme. +## +## Revision 1.1 1996/08/08 15:57:15 peter +## Initial revision +## +############################################################### + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info;; + -partition ) + partition=yes; + blurb='with partitioning'; + ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + + +infofile='mtt_info.txt'; +structurefile="$1_struc.txt"; +eqnfile="$1_ese.r"; +deffile="$1_def.r"; + + +# Remove the old log file +rm -f cbg2ese_m.log + +# Remove the info and error files +rm -f mtt_info.txt +rm -f mtt_error.txt +rm -f mtt_aliased.txt + +# Remove relevent ese files +rm -f $1_ese.r $1_*_ese.r + +#Inform user +echo Creating $eqnfile $blurb +echo Creating $deffile +echo Creating $structurefile + +# Use matrix manipulation to accomplish the transformation +# This creates an ese file for every subsystem. +$MATRIX << EOF > cbg2ese_m2r.log 2>mtt_error.txt + +infofile = "$infofile";; +infofilenum = fopen(infofile,"wt"); +structurefile = "$structurefile";; +structurefilenum = fopen(structurefile,"wt"); +deffile = "$1_def.r"; +deffilenum = fopen(deffile,"wt"); + +system_name = "$1"; +system_type = ""; +system_cr = ""; +system_args = ""; +full_name = ""; +full_name_repetition = ""; + +% Structure matrix [states,nonstates,inputs,outputs,zero_outputs] + +structure = zeros(1,7); # Initialise structure vector + +structure = cbg2ese(system_name, system_type, system_cr, ... + system_args, full_name, full_name_repetition, ... + 1, structure, structurefilenum, infofilenum); +makedef(structure,deffilenum); +EOF + +echo "END;" >> $1_def.r + +if [ "$info" = "info" ]; then + cat $infofile +fi + +if [ -z "$partition" ]; then + ## Don't partition + + # Create the composite ese file + mtt_xargs.sh cat "$1_ese.r $1_*_ese.r $1_modpar.r" > $1_ese.tmp 2>> /dev/null + + mv $1_ese.tmp $1_ese.r + + # Zap the sub ese files + mtt_xargs.sh "rm -f" "$1_*_ese.r" + + echo "END;" >> $1_ese.r + +else # Partition the system + + # Save up the full def file + mv $1_def.r mtt_all_def.r + +## Recreate def file from the ese file directly +makedef () +{ + +echo Creating $1_def.r + +Nx=`mtt_getsize -external $1 dX` +Nz=`mtt_getsize -external $1 z` +Ny=`mtt_getsize -external $1 y` +Nu=`mtt_getsize -external $1 u` +Nui=`mtt_getsize -external $1 ui` +Nuc=`mtt_getsize -internal $1 u` + +# echo Ny $Ny Nu $Nu Nx $Nx Nui $Nui Nuc $Nuc + +## Definitions file +octave -q <> $1_def.r +} + + +get_indices () +{ + sys=$1 + which=$2 + gawk '{if ($1==which) print $2}' which=$which < ${sys}_struc.txt +} + +convert_indices () +{ + sys=$1 + Which="input output state" + for which in $Which; do + + indices=`get_indices ${sys} $which` + + case $which in + input) + name=u + ;; + output) + name=y + ;; + state) + name=x + ;; + *) + + esac + + new=0 + for old in $indices; do + new=`expr $new + 1` + pattern="MTT${name}(${old},1)" + replacement="MTT${name}(${new},1)" + mv ${sys}_ese.r mtt_junk + sed "s/$pattern/$replacement/" ${sys}_ese.r + done + done +} + # Find subsystems + subsystems=`mtt_get_subsystems $1` + + # Top level + makedef $1; + echo "END;" >> $1_ese.r + + ## Subsystems + for subsystem in $subsystems; do + echo Connecting $subsystem +# Ny=`mtt_getsize -internal ${subsystem}_1 y` +# Nu=`mtt_getsize -internal ${subsystem}_1 u` +# Nx=`mtt_getsize -internal ${subsystem}_1 u` +# echo Ny $Ny Nu $Nu Nx $Nx + + +# echo MATRIX "MTT_"$subsystem"_uc("$Nu",1);" >> $1_def.r + + echo >> $1_ese.r + echo %Subsystem input connections for $subsystem >> $1_ese.r + octave -q <> $1_ese.r + for i=1:$Nu + printf("MTT_%s_uc(%i,1) := %s_1_MTTu%i;\n", "$subsystem", i, "$subsystem", i); + endfor; +EOF + ## Subsystems (Only works when no repetitions at this level) + esefile=${subsystem}_ese.r + echo Creating $esefile + mtt_xargs.sh cat "${subsystem}_1_ese.r ${subsystem}_1_*_ese.r" > $esefile 2> /dev/null + echo "END;" >> $esefile + + ## Def file for subsystem + makedef ${subsystem} + + echo Creating ${subsystem}_struc.txt + grep $subsystem < $1_struc.txt > ${subsystem}_struc.txt + + echo Converting subsystem indices + convert_indices ${subsystem} + + done + +fi + + +# Create the _alised file +touch mtt_aliased.txt +echo Creating $1_aliased.txt +mv mtt_aliased.txt $1_aliased.txt + +# Sort the struc file +mv $structurefile junk +sort -k 1,1 -k 2,2n junk >$structurefile + +# Relabel states with multiple ports +relabel_multiple_definitions(){ + mv $structurefile junk + gawk ' + BEGIN{ + var_type_index=1; + oldname=""; + } + { + name=$4; + newname=name; + if ($1==var_type) { + if (name==oldname) + newname = sprintf("%s_%i",name, ++var_type_index); + else + var_type_index=1; + } + $4 = newname + for (i=1;i $structurefile +} + +relabel_multiple_definitions input; +relabel_multiple_definitions output; +relabel_multiple_definitions state; + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + + + + + + ADDED mtt/bin/trans/cbg2pcbg Index: mtt/bin/trans/cbg2pcbg ================================================================== --- mtt/bin/trans/cbg2pcbg +++ mtt/bin/trans/cbg2pcbg @@ -0,0 +1,31 @@ +#! /bin/bash + +## Colour the reactions in the path + +## Colours +blue=1 +green=2 +cyan=3 +red=4 +magenta=5 +yellow=6 +colour=$magenta + +## Fonts +Times_Bold_Italic=3 +Helvetica_Bold_Oblique=19 +Helvetica_Narrow_Bold_Oblique=23 +font=${Helvetica_Bold_Oblique} + +sys=$1 +path="$2" + +cp ${sys}_cbg.fig tmp.fig +for p in $path; do + ##echo doing $p + sed "s/\([0-9] [0-9]\) [0-9]* \([0-9]* [0-9]*\) [0-9]* \(.*:$p.001$\)/\1 $colour \2 $font \3/" \ + < tmp.fig >TMP.fig + mv TMP.fig tmp.fig +done + +mv tmp.fig ${sys}_pcbg.fig ADDED mtt/bin/trans/cbg2sese_m2r Index: mtt/bin/trans/cbg2sese_m2r ================================================================== --- mtt/bin/trans/cbg2sese_m2r +++ mtt/bin/trans/cbg2sese_m2r @@ -0,0 +1,146 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.1 2003/03/13 15:44:53 gawthrop + ## The main transformation for sorted elementary equations + ## + ## 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 + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info;; + + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +infofile='mtt_info.txt'; +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 + +## Print info + +if [ "$info" = "info" ]; then + cat $infofile +fi ADDED mtt/bin/trans/cbg_m2dia Index: mtt/bin/trans/cbg_m2dia ================================================================== --- mtt/bin/trans/cbg_m2dia +++ mtt/bin/trans/cbg_m2dia @@ -0,0 +1,90 @@ +#! /bin/sh + +### cbg_m2dia +## +## Creates cbg.dia from: +## abg.dia, ibg.m, connections.dat, cbg.m +## +## Copyright (C) 2004 by Geraint Paul Bevan + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +set -e + +sys=$1 +name=$2 + +## need to fix MTT to create connections.dat using make +## in the meantime: +mtt -q ${sys} connections dat + +dia=${sys}_abg.dia +if [ ! -f ${dia} ]; then + # probably not a dia model + exit; +fi + +echo Creating ${name}_cbg.dia -- component type ${sys} + +con=${sys}_connections.dat +out=${name}_cbg.dia + +${MATRIX:-octave} -q < cbg_m2dia_spec.txt +ibg = ${sys}_ibg; +cbg = ${name}_cbg; + +## get connections data: ${sys}_connections +## structure with two cell arrays: head and tail +## the index of each array element is the bond index +## the value of each array element is a component name +load -text ${sys}_connections.dat; +con = ${sys}_connections; + +nibgbonds = length (fieldnames (ibg.bonds)); +ncbgbonds = length (con.head); + +## map cbg data to connection data +for [bond, bond_name] = ibg.bonds + + head = bond.head.component; + tail = bond.tail.component; + + i = index (head, ':'); + head = substr (head, i+1, length(head)-i); + + i = index (tail, ':'); + tail = substr (tail, i+1, length(tail)-i); + + ## index of bond in diagram + idia = str2num (strrep (bond_name, "bond", "")); + + ## find index of bond in cbg + e(idia) = f(idia) = 0; + for i = 1 : ncbgbonds + if (strcmp (con.head{i}, deblank (head)) && ... + strcmp (con.tail{i}, deblank (tail))) + e (idia) = cbg.bonds (i, 1); # effort + f (idia) = cbg.bonds (i, 2); # flow + endif + endfor +endfor + +espec = "--change_effort_causality "; +fspec = "--change_flow_causality "; +for i = 1 : nibgbonds + espec = sprintf ("%s%d:%d;", espec, i, e(i)); + fspec = sprintf ("%s%d:%d;", fspec, i, f(i)); +endfor +disp (espec) +disp (fspec) +EOF + +spec=`cat cbg_m2dia_spec.txt` + +/usr/local/src/mtt/mttroot/mtt/bin/trans/dia2abg.pl \ + --diagram_name $sys \ + --dia_input_file $dia \ + --dia_output_file $out \ + $spec ADDED mtt/bin/trans/cbg_m2fig Index: mtt/bin/trans/cbg_m2fig ================================================================== --- mtt/bin/trans/cbg_m2fig +++ mtt/bin/trans/cbg_m2fig @@ -0,0 +1,94 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cbg_m2fig +# +# Causal bond graph: mfile format to fig file format +# The resultant fig file is the original _abg.fig with +# additional causal strokes superimposed. +# +# P.J.Gawthrop May 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.12 2001/03/23 14:55:03 gawthrop +## Fixed cosmetic bugs -- component display +## +## Revision 1.11 2000/12/28 12:19:49 peterg +## *** empty log message *** +## +## Revision 1.10 2000/09/14 12:04:48 peterg +## New 2 parameter version +## +## Revision 1.9 1998/01/23 13:31:23 peterg +## $RMATRIX --> $MATRIX +## +## Revision 1.8 1996/12/07 19:23:07 peterg +## Registered agian. +## +# Revision 1.7 1996/11/09 19:04:34 peterg +# Removed cp $1_$1_cbg.fig $1_cbg.fig. +# +## Revision 1.6 1996/11/06 15:58:46 peterg +## Changed Matrix to RMATRIX +## +# Revision 1.5 1996/11/02 10:16:50 peterg +# Changed stroke length to 150 +# +# Revision 1.4 1996/08/25 09:28:59 peter +# More error handling. +# +## Revision 1.3 1996/08/24 14:40:31 peter +## Error handling included. +## +## Revision 1.2 1996/08/08 18:07:31 peter +## Sorted out naming scheme for files +## +## Revision 1.1 1996/08/05 20:13:56 peter +## Initial revision +## +############################################################### + + +# Remove the old log file +rm -f cbg_m2fig.log +rm -f mtt_info.txt + +# The following sets up the fig header file for the system +# and each sub system. +# (ls $1_*_cbg.m \ +# | sed 's/\(.*_\)\(.*_\)cbg.m/cp \2fig.fig \1\2cbg.fig/' \ +#| sh ) 2>mtt_error.txt + +#sh $1_type.sh 'cp ' '_fig.fig ' '_cbg.fig'> mtt_error.txt + +# Copy the unchaging part of the figure file +cat $1_head.fig $1_port.fig $1_bnd.fig $1_art.fig> $2_cbg.fig + +#Inform user +echo Creating $2_cbg.fig -- component type $1 + +# Use matrix manipulation to accomplish the transformation +$MATRIX <mtt_error.txt > cbg_m2fig.log + + system_type = "$1" + system_name = "$2" + + thick = 3; length = 150; red = 4; blue = 1; green = 12; font = 18; + cbg2fig(system_name, system_type, '', ... + length, thick, blue, ... + font, green, red); +EOF + +#cp $1_$1_cbg.fig $1_cbg.fig 2>> mtt_error.txt + +# Print errors, if any. +mtt_error mtt_error.txt + ADDED mtt/bin/trans/cmp2cmp_m Index: mtt/bin/trans/cmp2cmp_m ================================================================== --- mtt/bin/trans/cmp2cmp_m +++ mtt/bin/trans/cmp2cmp_m @@ -0,0 +1,75 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cmp2cmp_m +# Revises the component file (cmp) to account for aliases. + +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 12:20:04 peterg +## Initial revision +## +############################################################### + +# Inform user +echo Revising $1_cmp.m + +# Copy the alias and cmp files. +cat $1_alias.txt $1_cmp.m > junk + +#Create the cmp file complete with headers. +#echo "# Component file ($1_cmp.m)" #> $1_cmp.m +#echo "# Revised by MTT at `date`" #>> $1_cmp.m + +#Write out the variables +gawk ' +BEGIN{ +alias_file=1 +Parameter_Regexp = "^_Parameter_" +Line_Regexp = "cr|arg" +quote = "\047" +} +{ + if (alias_file) { + if (match($1,Parameter_Regexp)>0){ + alias[$2] = $1; + sub(Parameter_Regexp,"$",alias[$2]); # Replace by $ format + } + } + else { + if (match($1,Line_Regexp)){ + cr_or_args = substr($3,2,length($3)-3); # It it a cr or arg line + N=split(cr_or_args,a,";"); # Split into parts + for (i=1;i<=N;i++){ + if (a[i] in alias) # Replace by alias + a[i] = alias[a[i]]; + } + cr_or_args = a[1]; # Recombine + for (i=2;i<=N;i++) + cr_or_args = sprintf("%s;%s", cr_or_args, a[i]); + print "\t" $1 "\t" $2 "\t" quote cr_or_args quote + } + else + print $0 + } + if ($1=="###_END_OF_ALIAS_###") + alias_file=0; +}' $1_cmp.m + +rm -f junk + + + + + + + + ADDED mtt/bin/trans/cmp2lbl_txt Index: mtt/bin/trans/cmp2lbl_txt ================================================================== --- mtt/bin/trans/cmp2lbl_txt +++ mtt/bin/trans/cmp2lbl_txt @@ -0,0 +1,361 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cmp2lbl_txt +# +# Component list to skeleton lable file +# Hacked from (now redundent) abg2lbl_txt + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2002/12/06 11:45:57 gawthrop +## Strips comments from _cmp.txt before processing +## +## Revision 1.1 2002/12/01 14:54:52 gawthrop +## Replaces defunct abg2lbl_fig2txt +## +## +## Old log from abg2lbl_fig2txt +## Revision 1.28 2002/10/30 00:04:22 gawthrop +## Added AEf and AFe to list +## +## Revision 1.27 2002/05/10 09:08:55 gawthrop +## Added EMTF and INTF +## Fixed bug in writing out component headings +## +## Revision 1.26 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.25 2001/10/15 14:27:00 gawthrop +## Now handles [1:N] style port labels +## +## Revision 1.24 2001/08/02 03:24:48 geraint +## Replaced mtt_version.sh with mtt_banner.sh - I think this was the intent. +## +## Revision 1.23 2001/07/26 04:08:35 gawthrop +## Removed lines deleting _type.sh and cbg.m +## -- how did they get there ?? +## +## Revision 1.22 2001/07/08 03:28:11 gawthrop +## Fixed a bug: abg2sympar_m2txt neads a _lbl.txt file when using +## "usinglabel" option +## +## Revision 1.21 2001/07/06 00:46:50 gawthrop +## Added -cr option -- forces cr to be loaded before the ese.r file +## This avoids causality problems when using multi-port Rs to represent +## arbitary equations +## +## Revision 1.20 2001/07/04 05:19:57 gawthrop +## Added RT & CT to list +## +## Revision 1.19 2001/07/03 23:51:10 gawthrop +## Now puts outline #Summary and #Description lines at top of lbl file +## +## Revision 1.18 2001/06/13 18:24:10 gawthrop +## Made "lin" default in place of "none" +## Still needs arg and cr alias clashes to be sorted .... +## +## Revision 1.17 2001/06/13 10:41:06 gawthrop +## Further changes towards aouto creation of lbl files. +## Prettified lbl files +## +## Revision 1.16 2001/06/11 19:43:49 gawthrop +## MTT is now much more sophisticated in generating lbl files +## Labels can contain maths +## Repetative components are now broken +## +## Revision 1.15 2001/06/11 16:53:49 gawthrop +## Now uses abg2sympar_m2txt to get the arguments +## +## Revision 1.14 2001/06/11 15:06:58 gawthrop +## Now handles user-defined components +## +## Revision 1.13 2001/06/04 08:13:37 gawthrop +## Various changes to support PPP +## +## Revision 1.12 2001/05/08 15:18:10 gawthrop +## Added trig and hyperbolic functions to argument exclusion list +## +## Revision 1.11 2000/09/19 11:14:30 peterg +## Now writes the first component type header correctely +## +## Revision 1.10 2000/01/26 10:11:10 peterg +## Added I component +## +## Revision 1.9 1999/11/10 00:47:08 peterg +## Replaced ifs by a table of cr/arg information +## +## Revision 1.8 1999/11/09 22:32:41 peterg +## Under RCS ready for using arrays to contaain defaults. +## +## Revision 1.7 1998/07/04 10:37:21 peterg +## Major revision to include: +## aliases +## new Style +## prettyfied +## +## Revision 1.6 1998/03/05 10:09:47 peterg +## Corrected bug in writing "other" components +## +## Revision 1.5 1998/03/02 09:26:18 peterg +## Now does default CR and args for the basic components only +## SS,I,R,C,GY,TF +## C now has a default of effort input. +## +## Revision 1.4 1998/02/23 16:20:33 peterg +## Summary line just contains the model name +## +## Revision 1.3 1997/05/09 14:21:35 peterg +## Default to flow,component_name +## +# Revision 1.2 1997/03/19 12:08:01 peterg +# No longer writes out non-unique names - now done in rbg_fig2m +# +# Revision 1.1 1997/03/18 13:55:01 peterg +# Initial revision +# +############################################################### + + +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997 +# Copyright (C) 2002 by Peter J. Gawthrop + +infofile='mtt_info.txt' +typefile="$1_type.sh" +sensitivity=$2; +system=$1 +outfile=$1_lbl.txt + +if [ -n "$sensitivity" ]; then + sys="-s ${system}" + sensitivity_switch=" -s " +else + sys=${system} +fi + +# Remove unwanted files +rm -f abg2lbl_fig2txt.log +rm -f $infofile +rm -f mtt_junk* + +## Create lbl files beneath this one +mtt -q -u -l 1 ${sys} sub sh # Create the list +sh $1_sub.sh "echo mtt -q -l 1 ${sensitivity_switch}" " lbl txt" | sh + +if [ -f "$1_lbl.txt" ]; then + ##echo "$1_lbl.txt exists in `pwd` - no action taken" + exit +##else + ##echo "$1_lbl.txt dosn not exist in `pwd` " +fi + +#Inform user +if [ -n "$sensitivity" ]; then + echo "Creating ${outfile} (sensitivity version)" +else + echo "Creating ${outfile}" +fi + +write_header() + +{ +cat< default parameters)"; + Name = "# " $1; + cr[Component] = "\t"; + arg[Component] = "\t"; +} +(NF > 1) { + Component = $1; + Name = $2; + Arg = $3; +} +{ +##Aliases + if (Component == "SS") { + port_alias[++j] = Name; + Component_type = Component; + } + else { + alias[++i] = Name; + if (length(sensitivity)>0) { + s_arg = sprintf("%ss",Name); + alias[++i] = s_arg; + s_arg = sprintf(";%s",s_arg); + Component_type = Component; + Component = substr(Component,2); + lin = "slin" + } + else { + Component_type = Component; + lin = "lin"; + } + + } + + ## Table of components + cr["SS"] = "SS"; arg["SS"] = "external,external"; + + cr["Se"] = "SS"; arg["Se"] = sprintf("external%s", s_arg); + cr["Sf"] = "SS"; arg["Sf"] = sprintf("external%s", s_arg); + + cr["De"] = "SS"; arg["De"] = "external"; + cr["Df"] = "SS"; arg["Df"] = "external"; + + cr["R"] = lin; arg["R"] = sprintf("flow,%s%s", Name, s_arg); + cr["C"] = lin; arg["C"] = sprintf("effort,%s%s", Name, s_arg); + cr["I"] = lin; arg["I"] = sprintf("flow,%s%s", Name, s_arg); + + cr["INTF"] = lin; arg["INTF"] = ""; + + cr["CS"] = "lin"; arg["CS"] = sprintf("effort,%s;%s_x0%s", Name, Name, s_arg); + cr["IS"] = "lin"; arg["IS"] = sprintf("flow,%s;%s_x0%s", Name, Name, s_arg); + cr["INTFS"] = "lin"; arg["INTFS"] = sprintf("%s_x0%s", Name, s_arg); + + cr["TF"] = "lin"; arg["TF"] = sprintf("flow,%s%s", Name, s_arg); + cr["GY"] = "lin"; arg["GY"] = sprintf("flow,%s%s", Name, s_arg); + + ##cr["EMTF"] = sprintf("%s", Name); arg["EMTF"] = sprintf("l%s", s_arg); + cr["EMTF"] = "lin"; arg["EMTF"] = sprintf("flow,%s%s", Name, s_arg); + + cr["AE"] = "lin"; arg["AE"] = sprintf("%s%s", Name, s_arg); + cr["AF"] = "lin"; arg["AF"] = sprintf("%s%s", Name, s_arg); + cr["AEf"] = "lin"; arg["AEf"] = sprintf("%s%s", Name, s_arg); + cr["AFe"] = "lin"; arg["AFe"] = sprintf("%s%s", Name, s_arg); + + cr["CDx"] = "lin"; arg["CDx"] = sprintf("%s%s", Name, s_arg); + + + cr["FMR"] = lin; arg["FMR"] = sprintf("effort,%s%s", Name, s_arg); + + cr["RS"] = lin; arg["RS"] = sprintf("flow,%s%s", Name, s_arg); + cr["RT"] = lin; arg["RT"] = sprintf("flow,%s%s", Name, s_arg); + cr["CT"] = lin; arg["CT"] = sprintf("effort,%s%s", Name, s_arg); + + ## Put in the explicit arguments + if (length(Arg)>0) { + arg[Component] = Arg; + if (match(Arg,"=")>0) # Its an equation type cr + cr[Component] = "cr" + else # assume a linear cr + cr[Component] = "lin"; + } + + ## Print component header + if (Component != OldComponent) print "\n## Component type", Component_type + + ## Print Component + printf("\t%s\t", Name); + if (Component in cr) + printf("%s\t\t", cr[Component]) + else + printf("%s\t\t", default_cr); + + if (Component in arg) + printf("%s\t\t\n", arg[Component]) + else { + print "lbl2args_txt2out", Component_type | "/bin/sh"; close("/bin/sh") + } + + OldComponent=Component; + delete arg[Component]; # Zap the element + delete cr[Component]; # Zap the element + } + END{ + print "\n## Port aliases" >> "mtt_junk_alias.txt"; + for (k=1;k<=j;k++){ + if (port_alias[k] ~ "\\["){ # Only do ports + port_name = substr(port_alias[k],2,length(port_alias[k])-2); + if (length(sensitivity)==0) + print "#ALIAS\t" port_name "\t" port_name >> "mtt_junk_alias.txt"; + else + print "#ALIAS\t" port_name "\t" port_name "_1," port_name "_2" >> "mtt_junk_alias.txt"; + } + } + +# print "\n% Argument aliases" >> "mtt_junk_alias.txt"; +# for (k=1;k<=i;k++){ +# print "%ALIAS\t\$" k "\t" alias[k] >> "mtt_junk_alias.txt"; +# } + }' sensitivity=$sensitivity +} + +create_arg_aliases() +{ +cat < $1_lbl.txt +create_arg_aliases > mtt_args.txt # using $1_lbl.txt +mv $1_lbl.txt mtt_junk_lbl.txt + +write_header > ${outfile} +cat mtt_junk_alias.txt >> ${outfile} +cat mtt_args.txt >> ${outfile} +write_blurb >> ${outfile} +cat mtt_junk_lbl.txt >> ${outfile} + +## Put a blank line at end +cat >> ${outfile} < $1_sub.sh +echo "# File $1_sub.sh" >> $1_sub.sh +echo "# Generated by MTT on `date`." >> $1_sub.sh +echo >> $1_sub.sh + +# Get a list of all components for the _cmp file +gawk '/comp_type = / {print substr($3,2,length($3)-3)}' $1_cmp.m |\ +sort -u > mtt_tmp1 + +# Remove all components starting with 0 or 1 +grep -v '^[01]' < mtt_tmp1 > mtt_tmp4 + +# Get a list of all standard simple components +ls $MTT_LIB/comp/simple |\ + gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2 + +# Get a list of all standard compound components +#ls $MTTPATH/comp/compound |\ +# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2 + +# Sorted combined list +cat mtt_tmp2 | \ + sed 's/^zero$/0/' |\ + sed 's/^one$/1/' |\ + sort -u >mtt_tmp3 + +# Print the non-standard components +comm mtt_tmp4 mtt_tmp3 |\ + gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \ + >>$1_sub.sh + +# Clean up mtt_tmp files +#rm -f mtt_tmp? + + + + + + + + ADDED mtt/bin/trans/cmp2sub_m2txt Index: mtt/bin/trans/cmp2sub_m2txt ================================================================== --- mtt/bin/trans/cmp2sub_m2txt +++ mtt/bin/trans/cmp2sub_m2txt @@ -0,0 +1,49 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: makecr + +# Copyright (c) P.J.Gawthrop 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 1996/09/12 19:28:55 peter +## Added rcs header. +## +## Revision 1.4 1996/09/12 12:06:38 peter +## Removed reducndant lines. +## +## Revision 1.3 1996/09/12 12:05:01 peter +## Removed default crs. +## +## Revision 1.2 1996/09/10 16:18:37 peter +## Uses default constitutive relationship mtt/cr/r +## +## Revision 1.1 1996/08/24 14:53:06 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_cr.r + +echo % Default CR file > $1_cr.r +echo % File $1_cr.r >> $1_cr.r +echo % Generated by MTT on `date`. >> $1_cr.r +echo >> $1_cr.r +cat $MTTPATH/trans/m/rcs_header.txt >> $1_cr.r +echo 'END;' >> $1_cr.r + + + + + + + + ADDED mtt/bin/trans/cmp2sub_txt2sh Index: mtt/bin/trans/cmp2sub_txt2sh ================================================================== --- mtt/bin/trans/cmp2sub_txt2sh +++ mtt/bin/trans/cmp2sub_txt2sh @@ -0,0 +1,89 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cmp2sub_txt2sh + +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2002/12/06 12:26:34 gawthrop +## Strips comments from cmp.txt file +## +## Revision 1.1 2002/12/03 23:26:08 geraint +## Convert _cmp.txt to _sub.sh. +## Slightly edited copy of (obsolete) abg2sub_m2sh. +## +## Revision 1.4 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.3 2000/10/03 11:34:53 peterg +## Correct $MTT_LIB +## +## Revision 1.2 2000/03/17 09:53:10 peterg +## Removed irritating echo Using "$1_sub.sh" +## +## Revision 1.1 2000/03/15 21:23:20 peterg +## Initial revision +## +############################################################### + + +if [ -f "$1_sub.sh" ]; then + #echo Using "$1_sub.sh" + exit +else + #Inform user + echo Creating $1_sub.sh +fi + + +echo '# Commands to generate subsystem representations'> $1_sub.sh +echo "# File $1_sub.sh" >> $1_sub.sh +echo "# Generated by MTT on `date`." >> $1_sub.sh +echo >> $1_sub.sh + +# Get a list of all components for the _abg file +strip_comments < $1_cmp.txt | gawk -F\: '{print $1}' |\ +sort -u > mtt_tmp1 + +# Remove all components starting with 0 or 1 +grep -v '^[01]' < mtt_tmp1 > mtt_tmp4 + +# Get a list of all standard simple components +# echo ls $MTT_LIB/comp/simple +ls $MTT_LIB/comp/simple |\ + gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2 + +# Get a list of all standard compound components +#ls $MTTPATH/comp/compound |\ +# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2 + +# Sorted combined list +cat mtt_tmp2 | \ + sed 's/^zero$/0/' |\ + sed 's/^one$/1/' |\ + sort -u >mtt_tmp3 + +# Print the non-standard components +comm mtt_tmp4 mtt_tmp3 |\ + gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \ + >>$1_sub.sh + +# Clean up mtt_tmp files +#rm -f mtt_tmp? + + + + + + + + ADDED mtt/bin/trans/contents.tex Index: mtt/bin/trans/contents.tex ================================================================== --- mtt/bin/trans/contents.tex +++ mtt/bin/trans/contents.tex @@ -0,0 +1,17 @@ +% Contents etc for MTT documents + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/12/07 11:52:30 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \tableofcontents + \newpage + \listoffigures + \newpage ADDED mtt/bin/trans/convert_simpar.sh Index: mtt/bin/trans/convert_simpar.sh ================================================================== --- mtt/bin/trans/convert_simpar.sh +++ mtt/bin/trans/convert_simpar.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +## Gets rid of redundant METHOD lines. +echo Converting $1 +## backup +cp $1 $1_old +sed 's/METHOD/## METHOD/'< $1_old > $1 + + + ADDED mtt/bin/trans/cr_txt2r Index: mtt/bin/trans/cr_txt2r ================================================================== --- mtt/bin/trans/cr_txt2r +++ mtt/bin/trans/cr_txt2r @@ -0,0 +1,146 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + +# Bourne shell script: cr_txt2r + +# Label file to constitutive relationship conversion +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.14 2002/05/09 15:52:09 gawthrop +## Now uses current cr file is its newer than abg.m +## +## Revision 1.13 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.12 2002/04/08 17:04:21 geraint +## Removed spurious "\n" from output. +## +## Revision 1.11 2000/08/01 07:34:33 peterg +## Replaced printf by echo +## +## Revision 1.10 2000/02/25 09:10:12 peterg +## Changed -e to -f in if [ -f "$crf" ]; then +## -- cuased probs on SUN +## +## Revision 1.9 2000/02/16 15:58:17 peterg +## Set level='' not $2 +## +## Revision 1.8 1998/11/20 09:48:31 peterg +## Remove the _lower stuff -- see idf this works now. +## +## Revision 1.7 1998/04/14 17:46:28 peterg +## To avoid clashes when creating for more thsan one top level file, adds +## _lower attribute to lower lecel constitutive relationship files. +## .constitutive relationship files only in top level _constitutive +## relationship files. +## +## Revision 1.6 1998/04/14 13:54:15 peterg +## Uses the _sub.sh rep to recursively generate and include sub systems. +## +## Revision 1.5 1998/03/09 13:36:00 peterg +## Cosmetic change +## +## Revision 1.4 1998/03/06 15:54:41 peterg +## Put message bcak in in simpler form +## +## Revision 1.3 1998/03/06 15:51:06 peterg +## Zapped the irritating error message +## +## Revision 1.2 1998/03/04 15:32:53 peterg +## Major revision. +## Now just includes cr files using in""; +## Two sorts of CR: +## generic (.cr) +## tied to a system (_cr.r) +## +## Revision 1.1 1998/03/04 15:31:14 peterg +## Initial revision +## +# Revision 1.3 1997/04/09 12:59:43 peterg +# Looks for .cr file in current directory - copies from library if they +# don't already exist. +# +# Revision 1.2 1997/04/09 09:25:55 peterg +# Now copies .cr files from linrary to here (if they don't exist +# already). +# +# Revision 1.1 1997/04/09 09:08:12 peterg +# Initial revision +# +############################################################### + +# The level of the recursion null at top level; _lower at lower levels. + +level='' ## Used to be $2 - now set to null. + +abgfile=$1_abg.m +crfile=$1_cr.r +CRFILE=$1_cr.r + +if [ -f "$crfile" ]; then + echo "Using $crfile" +else + # Inform user + echo "Creating $crfile" + + echo "% Constitutive relation file for $1 ($crfile)" > $crfile + echo "% Generated by MTT at `date`" >> $crfile + + echo >> $crfile + + # Recursively create subsystem CR files -- at lower level + sh $1_sub.sh 'cr_txt2r ' ' _lower' + + # Include subsystem CR files + sh $1_sub.sh 'echo ' "_cr.r" |\ + gawk '{ + print "in \"" $1 "\";" + }' >> $crfile + +## if [ -z "$level" ]; then + + # Copy .cr files + gawk '{ + if (NF>0) { + print "mtt -q -u crcopy " $1; + } + }' $1_cr.txt | sh + + # Include the .cr files +# gawk '{ +# if (NF>0) { +# print "in \"" $1 ".cr\";" +# } +# }' $1_cr.txt >> $crfile + + ## list of the crs + crs=`cat $1_cr.txt` + for cr in $crs; do + crf=$cr'_cr.r' + if [ -f "$crf" ]; then +## printf "\045 (%s exists)\n" $crf >> $crfile + echo "% ($crf exists)" >> $crfile + else +## printf 'in "%s.cr";\n' $cr >> $crfile + echo 'in "'$cr.cr'";' >> $crfile + fi + done +## fi +echo 'END;' >> $crfile + +fi +# Now invoke the standard error handling. +#mtt_error mtt_error.txt + + ADDED mtt/bin/trans/cse2csm_r Index: mtt/bin/trans/cse2csm_r ================================================================== --- mtt/bin/trans/cse2csm_r +++ mtt/bin/trans/cse2csm_r @@ -0,0 +1,193 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cse2csm_r +# Constrained-state equation to linear constrained-state matrices conversion +# P.J.Gawthrop 6th September 1991, May 1994 +# Copyright (c) P.J.Gawthrop, 1991, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 2000/04/07 19:11:59 peterg +## reduce --> $SYMBOLIC +## +## Revision 1.6 2000/04/06 11:27:56 peterg +## Removed the in _cr.r +## +## Revision 1.5 1999/12/08 02:04:46 peterg +## Removed bug - uj := MTTU(j,1); not commented out +## +## Revision 1.4 1999/11/22 23:49:50 peterg +## Writes out the new MTTNx and MTTNy +## +## Revision 1.3 1999/11/22 23:38:51 peterg +## Now does scse 2 scsm as well. +## Uses mkid. +## +## Revision 1.2 1998/07/13 09:56:31 peterg +## Back under RCS for major revision +## +# Revision 1.1 1996/08/25 10:13:37 peter +# Initial revision +# +############################################################### + +# Inform user +echo Creating $1_$2.r + +case $2 in + csm) + rep=cse; + ;; + scsm) + rep=scse; + ;; + *) + echo Representation must be csm or scsm; + exit +esac +# Remove the old log file +rm -f cse2csm_r.log + +# Use reduce to accomplish the transformation +$SYMBOLIC >cse2csm_r.log << EOF + +in "$1_def.r"; +in "$1_$rep.r"; +%%in "$1_cr.r"; +%%in "$1_sympar.r"; + +OFF Echo; +OFF Nat; + +% Get rid of the old mttx and u - now use mkid instead +clear MTTx, MTTu; + +IF (MTTNx>0) THEN +BEGIN +% Find MTTA : the A matrix +matrix MTTA(MTTNx,MTTNx); + + FOR j := 1:MTTNx DO + BEGIN + %xj := MTTX(j,1); + xj := mkid(MTTx,j); + FOR i := 1:MTTNx DO + MTTA(i,j) := df(MTTEdx(i,1), xj, 1); + END; +END; + +IF (MTTNx>0) AND (MTTNu>0) THEN +BEGIN +% Find MTTB : the B matrix +matrix MTTB(MTTNx,MTTNu); + + FOR j := 1:MTTNu DO + BEGIN + %uj := MTTU(j,1); + uj := mkid(MTTu,j); + FOR i := 1:MTTNx DO + MTTB(i,j) := df(MTTEdx(i,1), uj, 1); + END; +END; + +IF (MTTNx>0) AND (MTTNy>0) THEN +BEGIN +% Find MTTC : the C matrix +matrix MTTC(MTTNy,MTTNx); + + FOR i := 1:MTTNy DO + FOR j := 1:MTTNx DO + BEGIN + %xj := MTTX(j,1); + xj := mkid(MTTx,j); + MTTC(i,j) := df(MTTY(i,1), xj, 1); + END; +END; + +IF (MTTNy>0) AND (MTTNu>0) THEN +BEGIN + +% Find MTTD : the D matrix +matrix MTTD(MTTNy,MTTNu); + + FOR i := 1:MTTNy DO + FOR j := 1:MTTNu DO + BEGIN + %uj := MTTU(j,1); + uj := mkid(MTTu,j); + MTTD(i,j) := df(MTTY(i,1), uj, 1); + END; +END; + +%Substitute the ss values +in "$1_sspar.r"; + +%Create the output file +OUT "$1_$2.r"; + +% Constants + +write "% New constants"; +write "MTTNx := ", MTTNx, ";"; +write "MTTNy := ", MTTNy, ";"; + + +%Write out the matrices. +IF MTTNx>0 THEN +BEGIN + write "matrix MTTE(", MTTNx, ",", MTTNx, ");"; + FOR i := 1:MTTNx DO + FOR j := 1:MTTNx DO IF MTTE(i,j) NEQ 0 THEN + write "MTTE(", i, ",", j, ") := ", MTTE(i,j); + + write "matrix MTTA(", MTTNx, ",", MTTNx, ");"; + FOR i := 1:MTTNx DO + FOR j := 1:MTTNx DO IF MTTA(i,j) NEQ 0 THEN + write "MTTA(", i, ",", j, ") := ", MTTA(i,j); +END; + +IF MTTNx>0 THEN +IF MTTNu>0 THEN +BEGIN + write "matrix MTTB(", MTTNx, ",", MTTNu, ");"; + FOR i := 1:MTTNx DO + FOR j := 1:MTTNu DO IF MTTB(i,j) NEQ 0 THEN + write "MTTB(", i, ",", j, ") := ", MTTB(i,j); +END; + +%Write it out +IF MTTNy>0 THEN +IF MTTNx>0 THEN +BEGIN + write "matrix MTTC(", MTTNy, ",", MTTNx, ");"; + FOR i := 1:MTTNy DO + FOR j := 1:MTTNx DO IF MTTC(i,j) NEQ 0 THEN + write "MTTC(", i, ",", j, ") := ", MTTC(i,j); +END; + +IF MTTNy>0 THEN IF MTTNu>0 THEN +BEGIN + write "matrix MTTD(", MTTNy, ",", MTTNu, ");"; + FOR i := 1:MTTNy DO + FOR j := 1:MTTNu DO IF MTTD(i,j) NEQ 0 THEN + write "MTTD(", i, ",", j, ") := ", MTTD(i,j); +END; + +write "END;"; + +SHUT "$1_$2.r"; + +EOF + +# Now invoke the standard error handling. +mtt_error_r cse2csm_r.log + + + ADDED mtt/bin/trans/cse2ode_r Index: mtt/bin/trans/cse2ode_r ================================================================== --- mtt/bin/trans/cse2ode_r +++ mtt/bin/trans/cse2ode_r @@ -0,0 +1,155 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cse2ode_r +# Reduce constrained-state equations to ode. +# P.J.Gawthrop 10th May 199, 8th August 1991, April 1994, Dec 1994 +# Copyright (c) P.J.Gawthrop, 1991, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3.4.2 2002/09/10 23:24:19 geraint +## Rationalised local and global optimisations. +## Fixes presentation of locally optimised code (ode view). +## Much more elegant :-) +## +## Revision 1.3.4.1 2002/09/03 23:44:43 geraint +## adding global optimisation (-optg). +## +## Revision 1.3 2001/07/27 23:29:10 geraint +## Optimises only when requested (-opt). +## +## Revision 1.2 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## +## Revision 1.1.4.1 2001/05/04 04:07:24 geraint +## Numerical solution of algebraic equations. +## sys_ae.cc written for unsolved inputs. +## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). +## +## Revision 1.1 2000/12/28 12:21:31 peterg +## Put under RCS +## +## Revision 1.2 1997/01/06 21:17:10 peterg +## Removed: OFF Exp; OFF GCD; +## +## Revision 1.1 1996/08/25 10:05:45 peter +## Initial revision +## +############################################################### + +optimise=''; optimise_msg='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -optimise_global ) + optimise='-optimise_global' + optimise_msg=' with global optimisation' ;; + -optimise_local ) + optimise='-optimise_local' + optimise_msg=' with local optimisation' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +# Create the reduce output code +def2write_r $1 ode +def2write_r $1 odeo + +#Inform user +echo Creating $1_ode.r $optimise_msg +echo Creating $1_odeo.r $optimise_msg + +# Remove the old log file +rm -f cse2ode_r.log + +# Use reduce to accomplish the transformation +$SYMBOLIC >cse2ode_r.log << EOF + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + +%Read the definitions file +in "$1_def.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the constrained-state equations file +in "$1_cse.r"; + +%Read the algebraic equations file +in "$1_ae.r"; + +IF MTTNx>0 THEN + IF MTTNz>0 THEN + MTTdXX := MTTE^(-1)*MTTEdX + ELSE + MTTdXX := MTTEdX; + +%Remove all dX terms from y - a rather nasty method, sorry! + MTTdX1 := 0; + MTTdX2 := 0; + MTTdX3 := 0; + MTTdX4 := 0; + MTTdX5 := 0; + MTTdX6 := 0; + MTTdX7 := 0; + MTTdX8 := 0; + MTTdX9 := 0; + MTTdX10 := 0; + MTTdX11 := 0; + MTTdX12 := 0; + MTTdX13 := 0; + MTTdX14 := 0; + MTTdX15 := 0; + MTTdX16 := 0; + MTTdX17 := 0; + MTTdX18 := 0; + MTTdX19 := 0; + MTTdX20 := 0; + +%Substitute dX into y; +IF MTTNz>0 THEN + IF MTTNx>0 THEN + MTTY := MTTY + MTTEyx*MTTdX; + +OFF Echo; +OFF Nat; + +MTTdX := MTTdXX; + +%Write out the ordinary differential equations. +OUT "$1_ode.r"; +write "%File: $1_ode.r"; +in ("$1_ode_write.r"); +write "in ""$1_odeo.r"";"; +write "END;"; +SHUT "$1_ode.r"; + +%Write out the output equations +OUT "$1_odeo.r"; +write "%File: $1_odeo.r"; +in ("$1_odeo_write.r"); +write "END;"; +SHUT "$1_odeo.r"; +quit; +EOF + +if [ ${optimise:-""} = "-optimise_global" ]; then + mtt_optimise global $1 ode + mtt_optimise global $1 odeo +elif [ ${optimise:-""} = "-optimise_local" ]; then + mtt_optimise local $1 ode + mtt_optimise local $1 odeo +fi + +# Now invoke the standard error handling. +mtt_error_r cse2ode_r.log ADDED mtt/bin/trans/cse2rfe_r Index: mtt/bin/trans/cse2rfe_r ================================================================== --- mtt/bin/trans/cse2rfe_r +++ mtt/bin/trans/cse2rfe_r @@ -0,0 +1,181 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cse2rfe_r +# Reduce constrained-state equations to robot matrices +# Experimental version! +# State vector should have momenta in odd rows,angles in even; +# the last row should have the gravity velocity term. +# There should be one output (only) for each joint velocity. +# P.J.Gawthrop, Nov 92, Dec 93, May 1994 +# Copyright (c) P.J.Gawthrop, 1992, May 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1996/12/05 12:10:00 peterg +## Version history added. +## +############################################################### + +# Inform user +echo Creating $1_rfe.r + +# Remove the old log file +rm -f cse2rfe_r.log + +# Use reduce to accomplish the transformation +reduce >cse2rfe_r.log << EOF + +IN "$1_def.r"; +IN "$1_sympar.r"; +IN "$1_csm.r"; +IN "$1_cse.r"; + +MTTN2 := MTTNy; + + +%Find E11 and E12 matrices +MATRIX MTTE11(MTTN2,MTTN2), MTTE12(MTTN2,MTTN2); +FOR i := 1:MTTN2 DO + FOR j := 1:MTTN2 DO + BEGIN + MTTE11(i,j) := MTTE(2*i-1,2*j-1); + MTTE12(i,j) := MTTE(2*i-1,2*j); + END; + +%Find inertia matrix +MATRIX MTTImi(MTTN2,MTTN2); +FOR i := 1:MTTN2 DO + BEGIN + MTTImi(i,i) := MTTC(i,2*i-1); + END; + +MTTIm := MTTImi^-1; + +%Find gravity matrix if there is an extra gravity state +MATRIX MTTG(MTTN2,1); +MTTNy2 := 2*MTTNy; +IF ( (MTTNx-1)/MTTNy2 = 1) THEN +FOR i := 1:MTTN2 DO + BEGIN + MTTG(i,1) := MTTE(2*i-1,MTTNx); + END; + + + +%Find V matrix from RHS of equation +MTTu1 := 0; +MTTu2 := 0; +MTTu3 := 0; +MTTu4 := 0; +MTTu5 := 0; +MTTu6 := 0; + +MTTx2 := theta_1; +MTTx4 := theta_2; +MTTx6 := theta_3; +MTTx8 := theta_4; +MTTx10 := theta_5; +MTTx12 := theta_6; + +MTTx1 := dot_theta_1*MTTIm(1,1); +MTTx3 := dot_theta_2*MTTIm(2,2); +MTTx5 := dot_theta_3*MTTIm(2,3); + +MATRIX MTTdt(6,1); +MTTdt(1,1) := dot_theta_1; +MTTdt(2,1) := dot_theta_2; +MTTdt(3,1) := dot_theta_3; +MTTdt(4,1) := dot_theta_4; +MTTdt(5,1) := dot_theta_5; +MTTdt(6,1) := dot_theta_6; + +MATRIX dtheta(MTTN2,1); +FOR i := 1:MTTN2 DO + BEGIN + dtheta(i,1) := MTTdt(i,1); + END; + +MATRIX MTTVrhs(MTTN2,1); +MATRIX MTTV(MTTN2,1); +FOR i := 1:MTTN2 DO + BEGIN + MTTVrhs(i,1) := MTTEdX(2*i-1,1); + END; + +%Find V matrix +MTTV := MTTE12*dtheta - MTTVrhs; + +%Find C matrix +MATRIX MTTC(MTTN2,MTTN2); +k := 0; +FOR i := 1:MTTN2 DO + FOR j := 1:MTTN2 DO + BEGIN + coeffs := coeff(MTTV(i,1),MTTdt(j,1)); + IF length(coeffs)>2 THEN co := part(coeffs,3) ELSE co := 0; + MTTC(i,j) := co; + END; + +%Find B matrix +MTTN3 := MTTN2*(MTTN2-1)/2; + +IF MTTN3>0 THEN +BEGIN +MATRIX MTTB(MTTN2,MTTN3); +FOR i := 1:MTTN2 DO +BEGIN + counter := 0; + FOR j := 1:MTTN2-1 DO + BEGIN + coeffs := coeff(MTTV(i,1),MTTdt(j,1)); + IF length(coeffs)>1 THEN co := part(coeffs,2) ELSE co := 0; + FOR k := j+1:MTTN2 DO + BEGIN + counter := counter+1; + coeffs2 := coeff(co,MTTdt(k,1)); + IF length(coeffs2)>1 THEN co2 := part(coeffs2,2) ELSE co2 := 0; + MTTB(i,counter) := co2; + END; + END; +END; +END; + +OFF Echo; +OFF Nat; +ON NERO; + +OUT "$1_rfe.r"; + +%% M +write "MATRIX MTTM(", MTTN2, ",", MTTN2, ")"; +MTTM := MTTE11*MTTIm; + +%% V +write "MATRIX MTTRV(", MTTN2, ",1)"; +MTTRV := MTTV; + +%% + +write "MATRIX MTTRC(", MTTN2, ",", MTTN2, ")"; +MTTRC := MTTC; + +IF MTTN3>0 THEN + BEGIN + write "MATRIX MTTRB(", MTTN2, ",", MTTN3, ")"; + MTTRB := MTTRB; +END; + +write "MATRIX MTTRG(", MTTN2, ", 1)"; +MTTRG := MTTG; + +write ";END;"$ +SHUT "$1_rfe.r"; +quit; +EOF ADDED mtt/bin/trans/cse2scse_r Index: mtt/bin/trans/cse2scse_r ================================================================== --- mtt/bin/trans/cse2scse_r +++ mtt/bin/trans/cse2scse_r @@ -0,0 +1,258 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cse2scse_r +# Reduce constrained-state equations to sensitivity version +# P.J.Gawthrop 10th May 199, 8th August 1991, April 1994, Dec 1994 +# Copyright (c) P.J.Gawthrop, 1999 + +# $Id$ + +# Arguments +system=$1; +system_def=$1_def.r +system_cse=$1_cse.r +system_scse=$1_scse.r + +# Parameters +n=`echo $2 | sed 's/,/ /g' |wc -w` ## Number of parameters + +## Parameter information for reduce. +parameters=`echo $2 | sed 's/,/ /g' |\ + gawk '{ + for (i=1; i<=NF; i++) { + printf("mttpar(%i,1) := %s;\n", i, $i); + printf("mttcoef(%i,1) := %ss;\n", i, $i); + } + }'` + +## Update sympar list. +echo Recreating $1_sympar.txt +# Zap any sensitivity coeficients +mv $1_sympar.txt mtt_junk +grep -v MTT_Sensitivity_Coefficients mtt_junk > $1_sympar.txt + +# Create the new sens coeffs at end of list. +echo $2 | sed 's/,/ /g' |\ +gawk '{ + for (i=1; i<=NF; i++) { + printf("%ss\tMTT_Sensitivity_Coefficients\n",$i); + } + }' >> $1_sympar.txt + +touch $1_sympar.txt + +matrix="matrix mttpar("$n",1); matrix mttcoef("$n",1);" + +# Number of states +Nx=`grep "MTTNx " <$system_def | gawk '{print $3}' | sed 's/;//'` + +#Inform user +echo Creating $system_scse "(for parameters $2, $Nx states)" + +# Remove the old log file +rm -f cse2scse_r.log + +# Use reduce to accomplish the transformation +$SYMBOLIC << EOF >cse2scse_r.log + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + +%Read the definitions file +in "$system_def"; + +%Read the constrained-state equations file +in "$system_cse"; + +% Declare the parameter matrix and fill it +$matrix +$parameters +mtt_n_par := $n; + +MTTNx2 := 2*MTTNx; +MTTNy2 := 2*MTTNy; + +% Compute the sensitivity E matrix +matrix MTTssE(MTTNx,MTTNx); +clear MTTx; % Dont use - mkid is better + +FOR ii := 1:MTTNx DO + FOR jj := 1:MTTNx DO + IF MTTE(ii,jj) NEQ 0 THEN IF MTTE(ii,jj) NEQ 1 THEN + BEGIN + % First with respect to theta... + FOR kk := 1:mtt_n_par DO + BEGIN + mttpar_k := mttpar(kk,1); + mttcoef_k := mttcoef(kk,1); + MTTssE(ii,jj) := MTTssE(ii,jj) + df(MTTE(ii,jj), mttpar_k)*mttcoef_k; + END; + % then with respect to x + FOR i := 1:MTTNx DO + BEGIN + xi := mkid(MTTx,i); + sxi := mkid(MTTsx,i); + MTTssE(ii,jj) := MTTssE(ii,jj) + df(MTTE(ii,jj), xi)*sxi; + END; + END; + +% Compute the sensitivity of the RHS of the cse +matrix MTTssEdx(MTTNx,1); +FOR ii := 1:MTTNx DO +BEGIN + % First with respect to theta + FOR kk := 1:mtt_n_par DO + BEGIN + mttpar_k := mttpar(kk,1); + mttcoef_k := mttcoef(kk,1); + MTTssEdx(ii,1) := MTTssEdx(ii,1) + df(MTTEdx(ii,1), mttpar_k)*mttcoef_k; + END; +% Then with respect to x + FOR i := 1:MTTNx DO + BEGIN + xi := mkid(MTTx,i); + sxi := mkid(MTTsx,i); + MTTssEdx(ii,1) := MTTssEdx(ii,1) + df(MTTEdx(ii,1), xi)*sxi; + END; +END; + +% Sensitivity output function +matrix MTTssY(MTTNy,1); +FOR ii := 1:MTTNy DO +BEGIN + % First with respect to theta + FOR kk := 1:mtt_n_par DO + BEGIN + mttpar_k := mttpar(kk,1); + mttcoef_k := mttcoef(kk,1); + MTTssY(ii,1) := MTTssY(ii,1) + df(MTTY(ii,1), mttpar_k)*mttcoef_k; + END; +% Then with respect to x + FOR i := 1:MTTNx DO + BEGIN + xi := mkid(MTTx,i); + sxi := mkid(MTTsx,i); + MTTssY(ii,1) := MTTssY(ii,1) + df(MTTY(ii,1), xi)*sxi; + END; +END; + + +% Now reorganise everything into composite system +% - odd rows are the system +% - even rows are the sensitivity system +% NB at this stage, the states are numbered incorrectly - sorted out below. + +%E matrix +matrix MTTsE(MTTNx2,MTTNx2); +FOR i := 1:MTTNx DO + FOR j := 1:MTTNx DO + BEGIN + MTTsE(2*i-1,2*j-1) := MTTE(i,j); % System + MTTsE(2*i,2*j) := MTTE(i,j); % Sensitivity system + MTTsE(2*i,2*j-1) := MTTssE(i,j); % Sensitivity system + END; + +%dX matrix +matrix MTTsEdX(MTTNx2,1); + +FOR i := 1:MTTNx DO +BEGIN + MTTsEdX(2*i-1,1) := MTTEdx(i,1); + MTTsEdX(2*i,1) := MTTssEdx(i,1); +END; + +%Y matrix +matrix MTTsY(MTTNy2,1);%dX matrix +matrix MTTsEdX(MTTNx2,1); + +FOR i := 1:MTTNx DO +BEGIN + MTTsEdX(2*i-1,1) := MTTEdx(i,1); + MTTsEdX(2*i,1) := MTTssEdx(i,1); +END; + + +FOR i := 1:MTTNy DO +BEGIN + MTTsY(2*i-1,1) := MTTY(i,1); + MTTsY(2*i,1) := MTTssY(i,1); +END; + + + + +OFF nat; + +OUT "$system_scse"; + +write "%File: $system_scse"; + +% Constants + +write "% New constants"; +write "MTTNx := ", MTTNx2, ";"; +write "MTTNy := ", MTTNy2, ";"; + +% E matrix +MTT_Matrix := MTTsE$ +MTT_Matrix_name := "MTTE"$ +MTT_Matrix_n := MTTNx2$ +MTT_Matrix_m := MTTNx2$ +Reduce_Matrix()$ + +% State derivative +MTT_Matrix := MTTsEdX$ +MTT_Matrix_name := "MTTEdX"$ +MTT_Matrix_n := MTTNx2$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Output +MTT_Matrix := MTTsY$ +MTT_Matrix_name := "MTTY"$ +MTT_Matrix_n := MTTNy2$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +write "END;"; + +SHUT "$system_scse"; +quit; +EOF + +# Now invoke the standard error handling. +mtt_error_r cse2scse_r.log + + +## Now reorganise the states +mv -f $system_scse mtt_junk + + +##echo "Nx = $Nx" +gawk '{ + ## Make sure all MTTn variables are followed by a space + gsub(/mttx[0-9]*/, "& "); + + for (i=Nx;i>0;i--) { + + state = sprintf("mttx%i ",i); + newstate = sprintf("mttx%i ",2*i-1); + sstate = sprintf("mttsx%i",i); + newsstate = sprintf("mttx%i",2*i); + + gsub(state,newstate); + gsub(sstate,newsstate); + + } + print $0 +}' Nx=$Nx $system_scse + + + + + + ADDED mtt/bin/trans/cse2smx_lang Index: mtt/bin/trans/cse2smx_lang ================================================================== --- mtt/bin/trans/cse2smx_lang +++ mtt/bin/trans/cse2smx_lang @@ -0,0 +1,232 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cse2smx_lang +# Constrained-state equation to state matrices with x vector +# Used for implicit integration +# Copyright (C) 2000 by Peter J. Gawthrop +## Modified from eailier version + + +# Args +## Now default to matrix form +matrix='yes' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -noglobals) + noglobals='-noglobals'; + ;; + -parameters) + parameters='-parameters'; + ;; + -matrix) + matrix='yes'; + ;; + -optimise_global | -optimise_local ) + optimise='LOAD SCOPE; ON GENTRANOPT;'; + iname='INAME mtt_o;'; + ;; + -fixcc ) + fix_mtt_pow='FOR ALL x,y LET x^y = mtt_pow(x,y);' + operator='OPERATOR mtt_pow;' + blurb2='fixing c and cc code'; + unfix_mtt_pow='FOR ALL x,y CLEAR x^y;' + unfix_pow='FOR ALL x,y LET pow(x,y) = x^y;'; + ;; + *) + echo $1 is an unknown option + exit;; + esac + shift +done + +## Representation +if [ -z $1 ]; then + echo 'usage [options] cse2smx_lang system [smx|smxa|smxax]' + exit +fi + + +# Language +if [ -n "$3" ]; then + lang=$3 +else + lang="m" +fi + +## Representation +if [ -z $2 ]; then + rep=smx; +else + rep=$2 +fi + +case $rep in + smx) + nrep=0; + out='[mtta,mttax]'; + nmatrix=1; + ;; + smxa) + nrep=1; + if [ -n "$matrix" ]; then + blurb="in matrix form"; + nmatrix=1; + else + blurb="in vector form"; + nmatrix=0; + fi + out='mtta'; + ;; + smxax) + nrep=2 + out='mttax'; + nmatrix=0; + ;; + *) echo Representation $2 not recognised; + exit;; +esac + + +# Inform user +if [ -n "$optimise" ]; then + blurbopt=' using code optimisation' +fi + +echo Creating $1_$rep.$lang $blurb $blurbopt $blurb2 +#echo Creating $1_smxx.$lang +#echo Creating $1_smxtx.$lang + +# Remove the old log file +rm -f cse2smx_r.log +rm -f $1_smx.$lang +rm -f $1_smxx.$lang +rm -f $1_smxtx.$lang +rm -f $1_$rep.body + +# Use reduce to accomplish the transformation +$SYMBOLIC << EOF >cse2smx_lang.log + +${operator} %% Define mtt_pow if needed +lang := $lang; + +in "$1_subs.r"; +in "$1_def.r"; +in "$1_cse.r"; +in "$1_cr.r"; + + +clear mttx; % Dont need this now - use mkid instead + +OFF Echo; + +% Load the general translator package +LOAD GENTRAN; +GENTRANLANG!* := 'Pascal; +ON GENTRANSEG; % Segmentation + +OFF GENDECS; % No declarations +MAXEXPPRINTLEN!* := 80; +TEMPVARNUM!* := 1; +TEMPVARNAME!* := 'mtt_tmp; +%% ' +% Optimise +$optimise + + +ON GETDECS; % Create decrarations automatically +DEFTYPE!* := 'REAL; % and default to real + +%%% The following is a bug fix from ZIB to fix +%%% segmentation violation problem +symbolic procedure maxtype type; +% ------------------------------------------------------------------- ; +% A type may be a pair (l u) wher l is the minimum type for a variable; +% and u is the maximum type. This procedure returns the maximum type.; +% ------------------------------------------------------------------- ; + if atom type + then type + else if pairp cdr type then cadr type else car type; + +% This fix handles the case that the type is a list with ONE entry. +% Should never happen ?? W.N. +%%%%%% End of bug fix + +%Set up output according to the language. + OFF NAT; + GENTRANOUT "$1_$rep.body"; + +% Set up output according to the language. + IF (lang = r) THEN + BEGIN + write "matrix mtta(", mttnx, ",", mttnx, ");"; + write "matrix mttb(", mttnx, ",", mttnu, ");"; + write "matrix mttc(", mttny, ",", mttnx, ");"; + write "matrix mttd(", mttny, ",", mttnu, ");"; + END; + + ${unfix_pow} %% set pow(x,y) to x^y + +% find MTTA : the A matrix + FOR i := 1:MTTNx DO + BEGIN + mttAAx_i := 0; + FOR j := 1:MTTNx DO + BEGIN + ${unfix_mtt_pow} %% Revert to x^y form + ij := i + MTTNx*(j-1); + xj := mkid(mttx,j); + a_ij := df(MTTEdx(i,1), xj, 1); + aa_ij := MTTE(i,j) - mttt*a_ij; + ${fix_mtt_pow} %% set x^y to mtt_pow(x,y) + IF (aa_ij NEQ 0) THEN + IF ($nmatrix EQ 1) THEN + BEGIN + %% Write a with full indexing + $iname + GENTRAN mtta(i,j) ::=: aa_ij; + END; + IF (($nmatrix EQ 0) AND ($nrep EQ 1)) THEN + BEGIN + %% Write a with vector indexing + $iname + GENTRAN mtta(ij) ::=: aa_ij; + END; + mttAAx_i := mttAAx_i + aa_ij*xj; + END; + IF (mttAAx_i NEQ 0) THEN + IF (($nrep EQ 0) OR ($nrep EQ 2)) THEN + BEGIN + $iname + GENTRAN mttax(i) ::=: mttAAx_i; + END; + + + END; + + +%Shut the output according to the language. + GENTRANSHUT "$1_$rep.body"; +EOF + +fix_broken_numbers ( ) { + sed -e "/[0-9.]$/ N" -e "s/\([0-9.]\)[\n\t\ ]*\([0-9]\)/\1\2/g" +} + +refix_pow() { + sed 's/mtt_pow/pow/g' +} + +if [ "$lang" = "m" ]; then +# lang_header $noglobals $parameters $1 $rep m 'mttx,mttu,mttt,mttpar' $out > $1_$rep.m + mtt_header $1 $rep m > $1_$rep.m + cat $1_$rep.body | fix_broken_numbers | refix_pow | mtt_p2m >> $1_$rep.m + echo "## END Code" >> $1_$rep.m + echo "endfunction" >> $1_$rep.m +fi + +# Now invoke the standard error handling. +mtt_error_r cse2smx_lang.log ADDED mtt/bin/trans/cse_r2m Index: mtt/bin/trans/cse_r2m ================================================================== --- mtt/bin/trans/cse_r2m +++ mtt/bin/trans/cse_r2m @@ -0,0 +1,109 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cse_r2m +# Reduce constrained-state to simulab constrained-state equations +# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994. +# Copyright (c) P.J.Gawthrop 1991, 1994. + +# Output must be filtered by matlab_tidy. + +#Inform user +echo Creating $1_cse.m + +# Remove the old log file +rm -f cse_r2m.log + +# Use reduce to accomplish the transformation +reduce >cse_r2m.log << EOF + +%Read the reduce definitions file +in "$1_def.r"; + +%Read the reduce constrained-state equations file +in "$1_cse.r"; + +%Read the reduce substitution file +in "$1_subs.r"; + +%Set up the number of argument variables to zero in case the user has forgotten +MTTNVar := 0; + +%Read the parameter file +%%in "$1_sympar.r"; + + +ON BigFloat, NumVal; +PRECISION 16; %Compatible with Matlab +OFF Nat; + +ON NERO; % Suppress zero elements + +OUT "$1_cse.m"; + +%Headings - Simulab style +%(Note. The ;; are deleted by for2mat) + +write "function [sys,x0] = $1_cse(t,x,u,flag,xInitial);"; + +IF MTTNvar>0 THEN +BEGIN + write "% Read in the parameters"; + write "global ...;;"; + FOR i := 1:MTTNvar DO + BEGIN + IF i0 THEN +FOR i := 1:MTTNu DO +BEGIN + write "MTTu", i, " = u(", i, ");"; +END; +write "end;"; + +%Fortran switches - one line expressions +OFF echo; +ON fort$ +cardno!* := 1$ +fortwidth!* := 100$ +OFF period$ + +write "if abs(flag) == 1 %State derivative"; + +write "MTTE = zeros(", MTTNx, ",", MTTNx, ");"; +MTTE := MTTE; +MTTEdx := MTTEdx; +write "sys = MTTE\MTTEdx;"; + +write "elseif abs(flag) == 3 %Outputs"; +MTTy := MTTy; +write "sys = MTTy;"; + +write "elseif abs(flag) == 0 %Structure"; +write " sys = [", MTTNx, ",0,", MTTNy, ",", MTTNu, ",0,0]"; +write " if nargin<5; xInitial = zeros(", MTTNx, ",1); end;"; +write " x0 = xInitial;"; +write "end;"; +SHUT "$1_cse.m"; + ADDED mtt/bin/trans/cse_r2tex Index: mtt/bin/trans/cse_r2tex ================================================================== --- mtt/bin/trans/cse_r2tex +++ mtt/bin/trans/cse_r2tex @@ -0,0 +1,132 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: cse_r2tex +# Reduce constrained-state to LaTex constrained-state equations. +# P.J.Gawthrop 10th May 199, 8th August 1991, April 1994, Jan 1995 +# Copyright (c) P.J.Gawthrop, 1991, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2000/08/24 11:48:55 peterg +## Include _subs file +## +## Revision 1.5 1999/11/22 23:44:47 peterg +## Now does scse as well +## +## Revision 1.4 1999/11/22 23:04:08 peterg +## *** empty log message *** +## +# Revision 1.3 1996/11/12 09:53:59 peterg +# Reads in the params.r file now. +# +# Revision 1.2 1996/11/12 09:11:20 peterg +# Removed all the hoorrible name changes +# +# Revision 1.1 1996/11/05 09:19:28 peterg +# Initial revision +# +############################################################### + +#Inform user +echo Creating $1_$2.tex + +# Remove the old log file +rm -f cse_r2tex.log + +# Use reduce to accomplish the transformation +reduce >cse_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the parameter file +%%in "$1_params.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the constrained-state equations file +in "$1_$2.r"; + +OFF Echo; +OFF Nat; + +OUT "$1_$2.tex"; + +%Write out the constrained-state equations. + +write "%File: $1_$2.tex"; + +write "%constrained-state equations"; + IF MTTNx>0 THEN + FOR Row := 1:MTTNx DO + BEGIN + write"\begin{equation}"; + write "\dot MTTEX", Row, " = "; + write "{"; + write MTTEdX(Row,1); + write "}"; + write"\end{equation}"; + END; + + + + IF MTTNy>0 THEN + FOR Row := 1:MTTNy DO + BEGIN + write"\begin{equation}"; + write "MTTy", Row, " = "; + write "{"; + write MTTy(Row,1); + write "}"; + write"\end{equation}"; + END; + + +IF MTTNx NEQ 0 THEN +BEGIN +write "% - E matrix"; +write "\begin{equation}"; +write "MTTE = \begin{pmatrix}"; + FOR Row := 1:MTTNx DO + BEGIN + FOR Col := 1:MTTNx DO + BEGIN + Write "{", MTTE(Row,Col), "}"; + IF Colcsm2sm_r.log << EOF + +in "$1_def.r"; +in "$1_$rep.r"; +in "$1_cr.r"; +%%in "$1_sympar.r"; + +OFF Echo; +OFF Nat; + +% Find MTTA and MTTB : the A and B matrices + +MTTinvE := MTTE^(-1); +MTTA := MTTinvE*MTTA; +MTTB := MTTinvE*MTTB; + +% Create the matrix declarations +OUT "$1_$2.r1"; +write "MATRIX MTTA(", MTTNx, ",", MTTNx, ")$"; +write "MATRIX MTTB(", MTTNx, ",", MTTNu, ")$"; +write "MATRIX MTTC(", MTTNy, ",", MTTNx, ")$"; +write "MATRIX MTTD(", MTTNy, ",", MTTNu, ")$"; +SHUT "$1_$2.r1"; + +%Create the output file +OUT "$1_$2.r2"; +write "%File: $1_ode.r"; + +write "% New constants"; +write "MTTNx := ", MTTNx, ";"; +write "MTTNy := ", MTTNy, ";"; + +in ("$1_sm_write.r"); + +%Write out the matrices. +% IF MTTNx>0 THEN +% BEGIN +% write "matrix MTTA(", MTTNx, ",", MTTNx, ");"; +% FOR i := 1:MTTNx DO +% FOR j := 1:MTTNx DO IF MTTA(i,j) NEQ 0 THEN +% write "MTTA(", i, ",", j, ") := ", MTTA(i,j); +% END; + +% IF MTTNx>0 THEN +% IF MTTNu>0 THEN +% BEGIN +% write "matrix MTTB(", MTTNx, ",", MTTNu, ");"; +% FOR i := 1:MTTNx DO +% FOR j := 1:MTTNu DO IF MTTB(i,j) NEQ 0 THEN +% write "MTTB(", i, ",", j, ") := ", MTTB(i,j); +% END; + +% %Write it out +% IF MTTNy>0 THEN +% IF MTTNx>0 THEN +% BEGIN +% write "matrix MTTC(", MTTNy, ",", MTTNx, ");"; +% FOR i := 1:MTTNy DO +% FOR j := 1:MTTNx DO IF MTTC(i,j) NEQ 0 THEN +% write "MTTC(", i, ",", j, ") := ", MTTC(i,j); +% END; + +% IF MTTNy>0 THEN IF MTTNu>0 THEN +% BEGIN +% write "matrix MTTD(", MTTNy, ",", MTTNu, ");"; +% FOR i := 1:MTTNy DO +% FOR j := 1:MTTNu DO IF MTTD(i,j) NEQ 0 THEN +% write "MTTD(", i, ",", j, ") := ", MTTD(i,j); +% END; + +write "END;"; + +SHUT "$1_$2.r2"; +quit; + +EOF + +cat $1_$2.r1 $1_$2.r2 > $1_$2.r + +if [ ${optimise:-""} = "-optimise_global" ]; then + mtt_optimise global $1 $2 +elif [ ${optimise:-""} = "-optimise_local" ]; then + mtt_optimise local $1 $2 +fi + +# Now invoke the standard error handling. +mtt_error_r csm2sm_r.log ADDED mtt/bin/trans/csm_r2m Index: mtt/bin/trans/csm_r2m ================================================================== --- mtt/bin/trans/csm_r2m +++ mtt/bin/trans/csm_r2m @@ -0,0 +1,114 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: csm_r2m +# Reduce constained state-space A,B,C,D and E matrices to Matlab +# P.J.Gawthrop July 1990, Feb 1991, May 1991, Sep 91, Dec 93, Jan 94, May 94. +# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1996/08/19 18:40:02 peter +## read in the nuim_par function etc. +## +## Revision 1.1 1996/08/19 16:27:04 peter +## Initial revision +## +############################################################### + +# Inform user +echo Creating $1_$2.m + +# Remove the old log file +rm -f csm_r2m.log + +# Use reduce to accomplish the transformation +reduce >csm_r2m.log << EOF + +%Read in the definitions file +in "$1_def.r"; + +%Read the reduce state-space A,B,C and D matrices file +in "$1_$2.r"; + +%Set up the number of argument variables to zero in case the user has forgotten +MTTNVar := 0; + +%Read in the parameter file +%%in "$1_sympar.r"; + + +OUT "$1_$2.m"; + +%Headings - Matlab style +%(Note. The ;; are deleted by for2mat) + +IF MTTNvar>0 THEN +BEGIN + write "function [MTTA,MTTB,MTTC,MTTD,MTTE] = $1_$2(..."; + FOR i := 1:MTTNvar DO + BEGIN + IF i0 THEN +BEGIN + write "%function [MTTA,MTTB,MTTC,MTTD,MTTE] = $1_$2(..."; + FOR i := 1:MTTNvar DO + BEGIN + IF i0 THEN +BEGIN + write "% Read in the parameters"; + write "[ ...;;"; + FOR i := 1:MTTNvar DO + BEGIN + IF icsm_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the constrained-state matrices file +in "$1_$2.r"; + +%Read the symbolic parameters file +%%in "$1_sympar.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; + +OUT "$1_$2.tex"; + +%Write out the constrained-state matrices. +write "%constrained-state matrices $1"; +write "%File: $1_$2.tex"; +write""; + +write "%constrained-state matrices"; + +MTT_Matrix := MTTA$ +MTT_Matrix_name := "MTTA"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTB$ +MTT_Matrix_name := "MTTB"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTC$ +MTT_Matrix_name := "MTTC"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTD$ +MTT_Matrix_name := "MTTD"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTE$ +MTT_Matrix_name := "MTTE"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +SHUT "$1_$2.tex"; +quit; +EOF ADDED mtt/bin/trans/ctf_r2tex Index: mtt/bin/trans/ctf_r2tex ================================================================== --- mtt/bin/trans/ctf_r2tex +++ mtt/bin/trans/ctf_r2tex @@ -0,0 +1,67 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ctf_r2tex +# Reduce constrained-state matrices to LaTex constrained-state matrices. +# P.J.Gawthrop January 8th 1997 +# Copyright (c) P.J.Gawthrop, 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +# Inform user +echo Creating $1_ctf.tex + +# Remove the old log file +rm -f ctf_r2tex.log + +# Use reduce to accomplish the transformation +reduce >ctf_r2tex.log<< EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the smconical-form matrices file +in "$1_ctf.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; +OFF EXP; +%ON Rounded; +%Precision 5; + + +OUT "$1_ctf.tex"; + +%Write out the canonical matrices +write "%Controler TF $1"; +write "%File: $1_ctf.tex"; +write""; + +MTT_Matrix := MTTcTF$ +MTT_Matrix_name := "MTTcTF"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNy$ +Latex_Matrix()$ + + +SHUT "$1_ctf.tex"; +quit; +EOF ADDED mtt/bin/trans/dae2cse_r Index: mtt/bin/trans/dae2cse_r ================================================================== --- mtt/bin/trans/dae2cse_r +++ mtt/bin/trans/dae2cse_r @@ -0,0 +1,542 @@ +#! /bin/sh + + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dae2cse_r +# Differential-algebraic equations to constrained-state equations +# P.J.Gawthrop 14 June 1991, 8 Aug 1991, 2 April 1992, 14 April 1994, 28 Dec 94 +# Copyright (c) P.J.Gawthrop 1991, 1992, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.28 2005/09/07 17:04:12 geraint +## Fixes chi for cse representation. +## +## Revision 1.27 2005/03/21 11:50:39 gawthrop +## Don't write an empty cseo file +## +## Revision 1.26 2002/10/28 23:31:21 gawthrop +## Added additional term to MTTEdx to account for zdot terms on +## Right-Hand Side state equations +## +## Revision 1.25 2002/09/18 19:46:48 geraint +## Refined test to reduce shell loop overhead for unnecessary E matrix. +## Removed unnecessary attempt to optimise cse. +## Fixes sm representation. +## +## Revision 1.24 2002/09/16 08:08:00 geraint +## Merged changes from global-optimisation branch. +## +## Revision 1.23.2.3 2002/09/12 18:50:50 geraint +## Uncommented cse optimisations - they seem to work ok. +## +## Revision 1.23.2.2 2002/09/10 23:24:19 geraint +## Rationalised local and global optimisations. +## Fixes presentation of locally optimised code (ode view). +## Much more elegant :-) +## +## Revision 1.23.2.1 2002/09/03 23:44:43 geraint +## adding global optimisation (-optg). +## +## Revision 1.23 2002/07/10 17:43:05 geraint +## Added feature [ 562453 ] Optimisation of algebraic equations. +## +## Revision 1.22 2002/06/28 15:35:47 geraint +## Commented out aej.r generation (not used yet). +## +## Revision 1.21 2002/06/28 10:13:40 geraint +## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. +## +## Revision 1.20.2.1 2002/06/05 11:14:50 geraint +## ae.r now generated using def2write_r like cse?.r +## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r. +## +## Revision 1.20 2002/04/28 18:41:26 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.19 2001/10/26 01:01:49 geraint +## fixcc when rdae_is_dae (-cr). +## +## Revision 1.18 2001/10/05 23:37:32 geraint +## Fixed assignment statement in ae.r when RHS=0. +## +## Revision 1.17 2001/07/27 23:29:10 geraint +## Optimises only when requested (-opt). +## +## Revision 1.16 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## +## Revision 1.15.2.4 2001/06/26 00:55:48 geraint +## Writes algebraic equation Jacobian _aej.r (not used yet). +## +## Revision 1.15.2.3 2001/05/09 00:19:22 geraint +## Fixed EOF error when MTTNYZ=0. +## +## Revision 1.15.2.2 2001/05/05 20:50:16 geraint +## Fixed errors when MTTNx=0. +## +## Revision 1.15.2.1 2001/05/04 04:07:24 geraint +## Numerical solution of algebraic equations. +## sys_ae.cc written for unsolved inputs. +## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). +## +## Revision 1.15 2001/03/19 02:28:52 geraint +## Branch merge: merging-ode2odes-exe back to MAIN. +## +## Revision 1.14.2.1 2001/03/19 00:29:08 geraint +## Parse switches (-A) before calling def2write_r. +## Update $1_def.* instead of removing. +## +## Revision 1.14 2000/12/28 12:24:35 peterg +## *** empty log message *** +## +## Revision 1.13 2000/10/11 08:52:46 peterg +## Creates csex (cse with dxe only) rep. +## +## Revision 1.12 2000/10/10 21:00:58 peterg +## New code genration +## +## Revision 1.11 1998/11/26 09:18:55 peterg +## Incluse subs.r +## +## Revision 1.10 1998/11/18 13:50:29 peterg +## Removed writeing of EYz matrix +## +## Revision 1.9 1998/11/18 10:53:38 peterg +## Put in some more "IF MTTNx>0 THEN" to avoid error messages when no +## states. +## +## Revision 1.8 1998/11/10 08:54:34 peterg +## Put in "IF MTTNx>0 THEN" to prevent probs when Nx=0 +## -- still a couple of apparent error messages - but answers now +## correct +## +## Revision 1.7 1998/10/05 10:46:15 peterg +## Commented out redundant MTTY := MTTY + MTTEyx*MTTEdX; +## +## Revision 1.6 1998/07/19 12:44:35 peterg +## Set MTTYz := 0 if the array is empty - avoids irritating error +## message. +## +## Revision 1.5 1998/05/20 15:23:26 peterg +## Put MTTYz := MTTYz outsise the BEGIN/END +## +## Revision 1.4 1998/05/20 15:13:09 peterg +## Writes out algebraic equations (if any). +## +## Revision 1.3 1998/03/03 09:02:46 peterg +## Replaced MTTEyx*MTTEdX + MTTEyu*MTTdu; term +## +## Revision 1.2 1997/08/26 08:22:36 peterg +## Changed +## MTTY := MTTY + MTTEyx*MTTdX + MTTEyu*MTTdu; +## to +## MTTY := MTTY + MTTEyx*MTTEdX + MTTEyu*MTTdu; +## +## This sorts out the problem when dz appears in the output equation. +## +## Revision 1.1 1997/08/26 08:20:18 peterg +## Initial revision +## +## Revision 1.2 1996/08/25 09:57:30 peter +## Sorted out bug when MTTNz=0 +## +## Revision 1.1 1996/08/15 16:47:02 peter +## Initial revision +## +############################################################### + +#Explicit solution option and optimise option +solve=0; solve_msg='' +optimise=''; optimise_msg='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -A ) + solve=1 + solve_msg=' with explicit solution of algebraic equations' ;; + -fixcc ) + fixcc='-fixcc' + include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` + fix_msg='fixing c and cc code'; + ;; + -optimise_global ) + optimise='-optimise_global' + optimise_msg=' with global optimisation' ;; + -optimise_local ) + optimise='-optimise_local' + optimise_msg=' with local optimisation' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +# Create the reduce output code +def2write_r $fixcc $1 ae +def2write_r $fixcc $1 cse +def2write_r $fixcc $1 csex # Version without E matrix +def2write_r $fixcc $1 cseo + +echo "Creating $1_ae.r $optimise_msg" +echo "Creating $1_cse.r $solve_msg $optimise_msg $fix_msg" +echo "Creating $1_csex.r $optimise_msg" +echo "Creating $1_cseo.r $optimise_msg" + +# Remove the old log file +rm -f dae2cse_r.log + +# Remove some files +rm -f $1_ae.r? $1_cse.r? $1_cseo.r? + +# Use reduce to accomplish the transformation +$SYMBOLIC >dae2cse_r.log << EOF + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + +OFF Echo; +OFF Nat; +ON NERO; + +%Fix c code if required +$include + +in "$1_def.r"; +MTTdxs := MTTdX; %Save the symbolic form of dX + +in "$1_subs.r"; +in "$1_dae.r"; + + +%Create F_x, F_y matrices - assumming equations are +% linear in dZ +IF MTTNz>0 THEN +BEGIN + +IF MTTNx>0 THEN +BEGIN + +% Find MTTFx; +write "% Find MTTFx;"; + +matrix MTTFx(MTTNx,MTTNz); +FOR j := 1:MTTNz DO + BEGIN + dzj := MTTdZ(j,1); + FOR i := 1:MTTNx DO + MTTFx(i,j) := df(MTTdX(i,1), dzj, 1); + END; + +END; + +% Find MTTFy; +write "% Find MTTFy;"; + +matrix MTTFy(MTTNy,MTTNz); +FOR j := 1:MTTNz DO + BEGIN + dzj := MTTdZ(j,1); + FOR i := 1:MTTNy DO + MTTFy(i,j) := df(MTTy(i,1), dzj, 1); + END; + +%Create G_x, G_u matrices +write "%Create G_x, G_u matrices "; + + +% Find MTTGx; +IF MTTNx>0 THEN +BEGIN +write "% Find MTTGx;"; + +matrix MTTGx(MTTNz,MTTNx); +FOR j := 1:MTTNx DO + BEGIN + xj := MTTX(j,1); + FOR i := 1:MTTNz DO + MTTGx(i,j) := df(MTTZ(i,1), xj, 1); + END; +END; + +% Find MTTGu; +write "% Find MTTGu;"; + +matrix MTTGu(MTTNz,MTTNu); +FOR j := 1:MTTNu DO + BEGIN + uj := MTTu(j,1); + FOR i := 1:MTTNz DO + MTTGu(i,j) := df(MTTZ(i,1), uj, 1); + END; + +%Create E matrices +write "%Create E matrices"; + +IF MTTNx>0 THEN +BEGIN +matrix MTTExx(MTTNx,MTTNx); MTTExx := MTTFx*MTTGx; +matrix MTTExu(MTTNx,MTTNu); MTTExu := MTTFx*MTTGu; +matrix MTTEyx(MTTNy,MTTNx); MTTEyx := MTTFy*MTTGx; +matrix MTTE(MTTNx,MTTNx); MTTE := MTTI - MTTExx; +END; +matrix MTTEyu(MTTNy,MTTNu); MTTEyu := MTTFy*MTTGu; + + + + + %% The following gets rid of the dZs; there must be a better way. + MTTdZ1 := 0; + MTTdZ2 := 0; + MTTdZ3 := 0; + MTTdZ4 := 0; + MTTdZ5 := 0; + MTTdZ6 := 0; + MTTdZ7 := 0; + MTTdZ8 := 0; + MTTdZ9 := 0; + MTTdZ10 := 0; + MTTdZ11 := 0; + MTTdZ12 := 0; + MTTdZ13 := 0; + MTTdZ14 := 0; + MTTdZ15 := 0; + MTTdZ16 := 0; + MTTdZ17 := 0; + MTTdZ18 := 0; + MTTdZ19 := 0; + +IF MTTNx>0 THEN +BEGIN +MTTEdX := MTTdX; %Ie MTTEdX is MTTdX with the dz terms deleted ie EdX. +MTTdX := MTTdXs; %Restore the symbolic dX + +%% Add on input derivative terms +MTTEdX := MTTEdX + MTTExu*MTTdu; +%% Add on output derivative terms +MTTEdx := MTTEdX + MTTEyx*(MTTE^(-1))*MTTEdX; +END; + + +%%%%%MTTY := MTTY + MTTEyx*MTTEdX; +%%% This causes the matrix mismatch +%%% MTTdXs and MTTdu need setting in _def.r file +MTTY := MTTY + MTTEyu*MTTdu; + +IF MTTNx>0 THEN + MTTY := MTTY + MTTEyx*(MTTE^(-1))*MTTEdX; + + +END; %%of MTTNz>0 + +IF MTTNz=0 THEN +BEGIN + MTTEdX := MTTdX; + MTTE := MTTI; +END; + +IF (MTTNyz>0) AND ($solve>0) THEN +BEGIN + %%%% Try and solve algebraic loops!! + + %Create list of the relevant equations + MTT_eqns := {}; + FOR i := 1:MTTNyz DO + MTT_eqns := append(MTT_eqns,{MTTyz(i,1)}); + + %Create list of the relevant unknowns + MTT_unknowns := {}; + FOR i := 1:MTTNyz DO + MTT_unknowns := append(MTT_unknowns,{MTTUi(i,1)}); + + %Solve the algebraic equations symbolically + MTT_sol := solve(MTT_eqns,MTT_unknowns); + %The result seems to be in an extra list - I dont know why + % So remove the outer list with first. + % But only if more than one list element! + + if MTTNyz>1 THEN + MTT_sol := first(MTT_sol); + + %Substitute back into the equations + FOR i := 1:MTTNyz DO + BEGIN + MTT_sol_i := first(MTT_sol); MTT_sol := rest(MTT_sol); + set(lhs(MTT_sol_i),rhs(MTT_sol_i)); + END; + + % No algebraic variables left! + MTTNYz := 0; +END; % IF MTTNyz>0 and $solve + +%OUT "$1_aej.r"; +%IF (MTTNyz>0) THEN % as above +%BEGIN +% WRITE "MATRIX MTTyzj(",MTTNyz,",",MTTNyz,")"; +% WRITE "%File: $1_aej.r"; +% FOR i := 1:MTTNyz DO +% FOR j := 1:MTTNyz DO +% BEGIN +% didj := df(MTTyz(i,1),mkid('mttui,j)); +% IF (didj NEQ 0) THEN +% WRITE "MTTyzj(",i,",",j,") := ",didj," +0"; +% END; +%END; +%WRITE ";END;"; +%SHUT "$1_aej.r"; + +IF MTTNyz>0 THEN % not $solve or solution failed +BEGIN +OUT "$1_ae.r1"; +write "MATRIX MTTYZ(", MTTNyz, ",", 1, ")$"; +SHUT "$1_ae.r1"; +END; +OUT "$1_ae.r2"; +write "%File: $1_ae.r"; +in ("$1_ae_write.r"); +write "END;"; +SHUT "$1_ae.r2"; + +% Create the matrix declarations +OUT "$1_cse.r1"; +write "%"; +IF (MTTNx > 0) THEN +BEGIN + write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$"; + write "MATRIX MTTE(", MTTNx, ",", MTTNx, ")$"; +END; +SHUT "$1_cse.r1"; + +OUT "$1_csex.r1"; +write "%File:$1_csex.r1"; +IF (MTTNx > 0) THEN + write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$"; +SHUT "$1_csex.r1"; + +IF MTTNy>0 THEN +BEGIN + OUT "$1_cseo.r1"; + write "MATRIX MTTY(", MTTNy, ",", 1, ")$"; + SHUT "$1_cseo.r1"; +END; + +%%Create the _cse.r file +OUT "$1_cse.r2"; +write "%File: $1_cse.r"; +in ("$1_cse_write.r"); +write "in ""$1_cseo.r"";"; +write "END;"; + +% % State derivative +% MTT_Matrix := MTTEdX$ +% MTT_Matrix_name := "MTTEdX"$ +% MTT_Matrix_n := MTTNx$ +% MTT_Matrix_m := 1$ +% Reduce_Matrix()$ + +% % Output +% MTT_Matrix := MTTY$ +% MTT_Matrix_name := "MTTY"$ +% MTT_Matrix_n := MTTNy$ +% MTT_Matrix_m := 1$ +% Reduce_Matrix()$ + +% % Inputs +% MTT_Matrix := MTTU$ +% MTT_Matrix_name := "MTTU"$ +% MTT_Matrix_n := MTTNu$ +% MTT_Matrix_m := 1$ +% Reduce_Matrix()$ +% MTT_Matrix := MTTdU$ +% MTT_Matrix_name := "MTTdU"$ +% MTT_Matrix_n := MTTNu$ +% MTT_Matrix_m := 1$ +% Reduce_Matrix()$ + +% % E matrix +% MTT_Matrix := MTTE$ +% MTT_Matrix_name := "MTTE"$ +% MTT_Matrix_n := MTTNx$ +% MTT_Matrix_m := MTTNx$ +% Reduce_Matrix()$ + +% % Eyx matrix +% MTT_Matrix := MTTEyx$ +% MTT_Matrix_name := "MTTEyx"$ +% MTT_Matrix_n := MTTNy$ +% MTT_Matrix_m := MTTNx$ +% %Reduce_Matrix()$ + +% % Yz +% MTT_Matrix := MTTYz$ +% MTT_Matrix_name := "MTTYz"$ +% MTT_Matrix_n := MTTNyz$ +% MTT_Matrix_m := 1$ +% Reduce_Matrix()$ + +write ";END;"; + +SHUT "$1_cse.r2"; + +OUT "$1_csex.r2"; +write "%File: $1_cse.r"; +in ("$1_csex_write.r"); +write "END;"; +SHUT "$1_csex.r2"; + +%Write out the output equations +OUT "$1_cseo.r2"; +write "%File: $1_cseo.r"; +IF MTTNy>0 THEN + in ("$1_cseo_write.r"); +write "END;"; +SHUT "$1_cseo.r2"; +quit; +EOF + +touch $1_ae.r1 $1_ae.r2 +touch $1_cseo.r1 +touch $1_cseo.r2 +cat $1_ae.r1 $1_ae.r2 > $1_ae.r +cat $1_cse.r1 $1_cse.r2 > $1_cse.r +cat $1_csex.r1 $1_csex.r2 > $1_csex.r +cat $1_cseo.r1 $1_cseo.r2 > $1_cseo.r + +if [ ${optimise:-""} = "-optimise_global" ]; then + mtt_optimise global $1 ae + mtt_optimise global $1 cseo + mtt_optimise global $1 csex +elif [ ${optimise:-""} = "-optimise_local" ]; then + mtt_optimise local $1 ae + mtt_optimise local $1 cseo + mtt_optimise local $1 csex +fi + +if [ "$solve" = "1" ]; then + echo "Setting MTTNyz=0 in $1_def.r and updating other $1_def files" + gawk '{ + if ($1=="MTTNyz") + print "MTTNyz := 0;" + else print $0 + }' $1_def.r > mtt_junk + # Make sure it preserves the time stamp!! + # and remove dependent reps + touch -r $1_def.r mtt_junk + mv mtt_junk $1_def.r + for file in `ls $1_def.*`; do + if [ $file != $1_def.r ]; then + ext=`echo $file|gawk -F\. '{print $2}'` + mtt -q $1 def $ext + fi + done +fi + + +# Now invoke the standard error handling. +mtt_error_r dae2cse_r.log ADDED mtt/bin/trans/dae2daes_m Index: mtt/bin/trans/dae2daes_m ================================================================== --- mtt/bin/trans/dae2daes_m +++ mtt/bin/trans/dae2daes_m @@ -0,0 +1,116 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dae2daesol_m + +# Transforms descriptor matrix rep to step response + +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 1998/05/14 08:14:28 peterg +## Now reads in data from the simpar file. +## +## Revision 1.5 1998/05/13 16:42:03 peterg +## Fixed various bugs etc. +## +# Revision 1.4 1996/08/24 14:27:59 peter +# Global parameters. +# Error handling. +# +## Revision 1.3 1996/08/18 12:00:19 peter +## Unified format of responses. +## +## Revision 1.2 1996/08/16 13:17:57 peter +## Changed default args to include nx+nz +## Fixed bug with vector outputs. +## +## Revision 1.1 1996/08/15 16:24:55 peter +## Initial revision +## +############################################################### + + +echo Creating $1_daes.m +echo Creating $1_daeso.m +rm -f dae2daes_m.log +rm -f $1_daes.m +rm -f $1_daeso.m + + +$MATRIX << EOF > dae2daes_m.log 2>mtt_error.txt + + %System structure + [nx,ny,nu,nz,nyz] = $1_def; + + % Number of descriptor "states" + NX = nx+2*nz+nyz; + + %Read in parameters + $1_numpar; + + %Read in state (needs redoing for descriptor xevtor + %x = $1_state; + + + %Read in simulation parameters + $1_simpar; + T = [0:DT:LAST]; + + t=0; %Just in case its in the parameter list + + %Defaults + if exist('T')==0 + T=[0:0.1:10] + end; + + if exist('x0')==0 + x0 = zeros(NX,1); + end; + + if exist('dx0')==0 + dx0 = zeros(NX,1); + end; + + [n,m]=size(T); + if m>n + T=T'; + end; + +if NX>0 + x = dassl("$1_dae", x0, dx0, T); + write_matrix([T,x], '$1_daes'); +else + x = zeros(size(T)); +end; + +if ny>0 + i=0; + Y = []; + for tt=T' + i=i+1; + y = $1_daeo(x(i,:),tt); + Y = [Y; y']; + end; + write_matrix([T,Y], '$1_daeso'); +end; + +EOF + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + + + + + + + ADDED mtt/bin/trans/dae2daes_m Index: mtt/bin/trans/dae2daes_m ================================================================== --- mtt/bin/trans/dae2daes_m +++ mtt/bin/trans/dae2daes_m @@ -0,0 +1,116 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dae2daesol_m + +# Transforms descriptor matrix rep to step response + +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 1998/05/14 08:14:28 peterg +## Now reads in data from the simpar file. +## +## Revision 1.5 1998/05/13 16:42:03 peterg +## Fixed various bugs etc. +## +# Revision 1.4 1996/08/24 14:27:59 peter +# Global parameters. +# Error handling. +# +## Revision 1.3 1996/08/18 12:00:19 peter +## Unified format of responses. +## +## Revision 1.2 1996/08/16 13:17:57 peter +## Changed default args to include nx+nz +## Fixed bug with vector outputs. +## +## Revision 1.1 1996/08/15 16:24:55 peter +## Initial revision +## +############################################################### + + +echo Creating $1_daes.m +echo Creating $1_daeso.m +rm -f dae2daes_m.log +rm -f $1_daes.m +rm -f $1_daeso.m + + +$MATRIX << EOF > dae2daes_m.log 2>mtt_error.txt + + %System structure + [nx,ny,nu,nz,nyz] = $1_def; + + % Number of descriptor "states" + NX = nx+2*nz+nyz; + + %Read in parameters + $1_numpar; + + %Read in state (needs redoing for descriptor xevtor + %x = $1_state; + + + %Read in simulation parameters + $1_simpar; + T = [0:DT:LAST]; + + t=0; %Just in case its in the parameter list + + %Defaults + if exist('T')==0 + T=[0:0.1:10] + end; + + if exist('x0')==0 + x0 = zeros(NX,1); + end; + + if exist('dx0')==0 + dx0 = zeros(NX,1); + end; + + [n,m]=size(T); + if m>n + T=T'; + end; + +if NX>0 + x = dassl("$1_dae", x0, dx0, T); + write_matrix([T,x], '$1_daes'); +else + x = zeros(size(T)); +end; + +if ny>0 + i=0; + Y = []; + for tt=T' + i=i+1; + y = $1_daeo(x(i,:),tt)'; + Y = [Y; y']; + end; + write_matrix([T,Y], '$1_daeso'); +end; + +EOF + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + + + + + + + ADDED mtt/bin/trans/dae2dm_r Index: mtt/bin/trans/dae2dm_r ================================================================== --- mtt/bin/trans/dae2dm_r +++ mtt/bin/trans/dae2dm_r @@ -0,0 +1,333 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dae2dm_r +# Differential-algebraic equation to linear descriptor matrices conversion +# P.J.Gawthrop 8th May 1991, 7 June 1991, April 1994. +# Copyright (c) P.J.Gawthrop, 1991, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 2005/03/21 11:44:06 gawthrop +## Avoid error messages when no inputs or no outputs or no states +## +## Revision 1.3 1998/07/27 20:25:36 peterg +## *** empty log message *** +## +# Revision 1.2 1996/08/25 09:53:35 peter +# Error handling added. +# +## Revision 1.1 1996/08/18 20:03:51 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_dm.r + +# Remove the old log file +rm -f dae2dm_r.log + +# Use reduce to accomplish the transformation +reduce >dae2dm_r.log << EOF + +in "$1_def.r"; +in "$1_dae.r"; +in "$1_cr.r"; +%%in "$1_sympar.r"; + +OFF Echo; +OFF Nat; + + +%Total number of descriptor variables +MTTN := MTTNx + 2*MTTNz + MTTNyz; + +IF MTTN>0 THEN +BEGIN +% Find MTTE : the E matrix +matrix MTTE(MTTN,MTTN); + +% First row partition +IF MTTNx>0 THEN + FOR j := 1:MTTNx DO + MTTE(j,j) := 1; + +% Second row partition + IF MTTNz>0 THEN + FOR j := 1:MTTNz DO + MTTE(j+MTTNx, j+MTTNx) := 1; + +% Find MTTA : the A matrix + +% First row partition: x +IF MTTN>0 THEN + BEGIN + matrix MTTA(MTTN,MTTN); + FOR j := 1:MTTNx DO + BEGIN + xj := MTTX(j,1); + FOR i := 1:MTTNx DO + MTTA(i,j) := df(MTTdX(i,1), xj, 1); + END; + + IF MTTNz>0 THEN + FOR j := 1:MTTNz DO + BEGIN + dzj := MTTdz(j,1); + FOR i := 1:MTTNx DO + MTTA(i, j + MTTNx + MTTNz) := df(MTTdX(i,1), dzj, 1); + END; + + IF MTTNyz>0 THEN + FOR j := 1:MTTNyz DO + BEGIN + uij := MTTUi(j,1); + FOR i := 1:MTTNx DO + MTTA(i, j + MTTNx + 2*MTTNz) := df(MTTdX(i,1), uij, 1); + END; + END; + +% Second row partition: z +IF MTTNz>0 THEN + FOR j := 1:MTTNz DO + MTTA(j + MTTNx, j + MTTNx + MTTNz) := 1; + +% Third row partition +IF MTTNz>0 THEN + BEGIN + IF MTTNx>0 THEN + FOR j := 1:MTTNx DO + BEGIN + xj := MTTX(j,1); + FOR i := 1:MTTNz DO + MTTA(i + MTTNx + MTTNz,j) := df(MTTZ(i,1), xj, 1); + END; + + FOR j := 1:MTTNz DO + MTTA(j + MTTNx + MTTNz, j + MTTNx) := -1; + + FOR j := 1:MTTNz DO + BEGIN + dzj := MTTdz(j,1); + FOR i := 1:MTTNz DO + MTTA(i + MTTNx + MTTNz, j + MTTNx + MTTNz) := df(MTTZ(i,1), dzj, 1); + END; + + IF MTTNyz>0 THEN + FOR j := 1:MTTNyz DO + BEGIN + uij := MTTUi(j,1); + FOR i := 1:MTTNz DO + MTTA(i+MTTNx+MTTNz, j+MTTNx+2*MTTNz) := df(MTTZ(i,1), uij, 1); + END; + END; + + +% Fourth row partition +IF MTTNyz>0 THEN + BEGIN + IF MTTNx>0 THEN + FOR j := 1:MTTNx DO + BEGIN + xj := MTTX(j,1); + FOR i := 1:MTTNyz DO + MTTA(i + MTTNx + 2*MTTNz,j) := df(MTTYz(i,1), xj, 1); + END; + + IF MTTNz>0 THEN + FOR j := 1:MTTNz DO + BEGIN + dzj := MTTdz(j,1); + FOR i := 1:MTTNyz DO + MTTA(i + MTTNx + 2*MTTNz, j + MTTNx + MTTNz) := df(MTTYz(i,1), dzj, 1); + END; + + IF MTTNyz>0 THEN + FOR j := 1:MTTNyz DO + BEGIN + uij := MTTUi(j,1); + FOR i := 1:MTTNyz DO + MTTA(i+MTTNx+2*MTTNz, j+MTTNx+2*MTTNz) := df(MTTYz(i,1), uij, 1); + END; + END; + +% Find MTTB : the B matrix + +IF MTTNu>0 THEN +BEGIN +matrix MTTB(MTTN,MTTNu); + +% First row partition +IF MTTNx>0 THEN + BEGIN + FOR j := 1:MTTNu DO + BEGIN + uj := MTTU(j,1); + FOR i := 1:MTTNx DO + MTTB(i,j) := df(MTTdX(i,1), uj, 1); + END; + END; + +% Third row partition +IF MTTNz>0 THEN + BEGIN + FOR j := 1:MTTNu DO + BEGIN + uj := MTTU(j,1); + FOR i := 1:MTTNz DO + MTTB(i + MTTNx + MTTNz ,j) := df(MTTZ(i,1), uj, 1); + END; + END; + +% Fourth row partition +IF MTTNyz>0 THEN + BEGIN + FOR j := 1:MTTNu DO + BEGIN + uj := MTTU(j,1); + FOR i := 1:MTTNyz DO + MTTB(i + MTTNx + 2*MTTNz,j) := df(MTTYz(i,1), uj, 1); + END; + END; + +END; + +% Find MTTC : the C matrix +IF MTTNy>0 THEN +BEGIN +matrix MTTC(MTTNy,MTTN); + +% First column partition +IF MTTNx>0 THEN + BEGIN + FOR i := 1:MTTNy DO + FOR j := 1:MTTNx DO + BEGIN + xj := MTTX(j,1); + MTTC(i,j) := df(MTTY(i,1), xj, 1); + END; + END; + +% Third column partition +IF MTTNz>0 THEN + BEGIN + FOR i := 1:MTTNy DO + FOR j := 1:MTTNz DO + BEGIN + dzj := MTTdZ(j,1); + MTTC(i, j + MTTNx + MTTNz) := df(MTTY(i,1), dzj, 1); + END; + END; + +% Fourth column partition +IF MTTNyz>0 THEN + BEGIN + FOR i := 1:MTTNy DO + FOR j := 1:MTTNyz DO + BEGIN + uij := MTTUi(j,1); + MTTC(i, j + MTTNx + 2*MTTNz) := df(MTTY(i,1), uij, 1); + END; + END; + +END; +END; %of MTTN>0 + +% Find MTTD : the D matrix +IF MTTNy>0 THEN +IF MTTNu>0 THEN +BEGIN + matrix MTTD(MTTNy,MTTNu); + FOR i := 1:MTTNy DO + FOR j := 1:MTTNu DO + BEGIN + uj := MTTU(j,1); + MTTD(i,j) := df(MTTY(i,1), uj, 1); + END; +END; + +%Zap the dz terms (not a nice way) +MTTdz1 := 0; +MTTdz2 := 0; +MTTdz3 := 0; +MTTdz4 := 0; +MTTdz5 := 0; +MTTdz6 := 0; +MTTdz7 := 0; +MTTdz8 := 0; +MTTdz9 := 0; +MTTdz10 := 0; +MTTdz11 := 0; +MTTdz12 := 0; +MTTdz13 := 0; +MTTdz14 := 0; +MTTdz15 := 0; +MTTdz16 := 0; +MTTdz17 := 0; +MTTdz18 := 0; +MTTdz19 := 0; + + +%Substitute the ss values +in "$1_sspar.r"; + +%Create the output file +OUT "$1_dm.r"; + +%Write out the matrices. +IF MTTN>0 THEN +BEGIN + write "matrix MTTE(", MTTN, ",", MTTN, ");"; + FOR i := 1:MTTN DO + FOR j := 1:MTTN DO IF MTTE(i,j) NEQ 0 THEN + write "MTTE(", i, ",", j, ") := ", MTTE(i,j); + + write "matrix MTTA(", MTTN, ",", MTTN, ");"; + FOR i := 1:MTTN DO + FOR j := 1:MTTN DO IF MTTA(i,j) NEQ 0 THEN + write "MTTA(", i, ",", j, ") := ", MTTA(i,j); +END; + +IF MTTN>0 THEN +IF MTTNu>0 THEN +BEGIN + write "matrix MTTB(", MTTN, ",", MTTNu, ");"; + FOR i := 1:MTTN DO + FOR j := 1:MTTNu DO IF MTTB(i,j) NEQ 0 THEN + write "MTTB(", i, ",", j, ") := ", MTTB(i,j); +END; + +%Write it out +IF MTTNy>0 THEN +IF MTTN>0 THEN +BEGIN + write "matrix MTTC(", MTTNy, ",", MTTN, ");"; + FOR i := 1:MTTNy DO + FOR j := 1:MTTN DO IF MTTC(i,j) NEQ 0 THEN + write "MTTC(", i, ",", j, ") := ", MTTC(i,j); +END; + +IF MTTNy>0 THEN IF MTTNu>0 THEN +BEGIN + write "matrix MTTD(", MTTNy, ",", MTTNu, ");"; + FOR i := 1:MTTNy DO + FOR j := 1:MTTNu DO IF MTTD(i,j) NEQ 0 THEN + write "MTTD(", i, ",", j, ") := ", MTTD(i,j); +END; + +write "END;"; + +SHUT "$1_dm.r"; +quit; + +EOF + +# Now invoke the standard error handling. +mtt_error_r dae2dm_r.log ADDED mtt/bin/trans/dae2ker_r Index: mtt/bin/trans/dae2ker_r ================================================================== --- mtt/bin/trans/dae2ker_r +++ mtt/bin/trans/dae2ker_r @@ -0,0 +1,89 @@ +#!/bin/sh +## Shell script dae2ker_r +## Converts dae to behavioral kernal rep. + + +echo Creating $1_ker.r + +$SYMBOLIC > dae2ker.log <MTTNu THEN + v_list := append({w_i},v_list) + ELSE + v_list := append({u_i},v_list); +END; + +eq_list; v_list; +sol := solve(eq_list,v_list); +sol := first(sol); + +% Pluck out the manifest variable solutions +behaviour_list:={}; +FOR i:=1:(MTTNy-MTTNu) DO +BEGIN + soli := first(sol); + sol := rest(sol); + behaviour := DEN(RHS(soli))*LHS(soli) - NUM(RHS(soli)) = 0; + behaviour_list := append(behaviour_list, {behaviour}); +END; +behaviour_list := behaviour_list; + +MATRIX MTTR(MTTNy-MTTNu,MTTNy); +FOR i:=1:(MTTNy-MTTNu) DO +BEGIN + FOR j:=1:MTTNy DO + BEGIN + w_j := mkid(mttw,j); + coeffs := coeff(lhs(first(behaviour_list)),w_j); + IF length(coeffs)>1 THEN + MTTR(i,j) := second(coeff(lhs(first(behaviour_list)),w_j)); + END; + behaviour_list := rest(behaviour_list); +END; + +%% Now do coefficient matrices + +OFF NAT; +OUT "$1_ker.r"; +write "MATRIX MTTR(", MTTNy-MTTNu, ",", MTTNy, ");"; +MTTR := MTTR; +SHUT "$1_ker.r"; + + +EOF ADDED mtt/bin/trans/dae2lde_r Index: mtt/bin/trans/dae2lde_r ================================================================== --- mtt/bin/trans/dae2lde_r +++ mtt/bin/trans/dae2lde_r @@ -0,0 +1,153 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lde2ode.r +# Reduce differential-algebraic equations to Lagranges equations +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2.4.3 2002/09/13 10:10:42 geraint +## Commented out optimisation. +## +## Revision 1.2.4.2 2002/09/10 23:24:19 geraint +## Rationalised local and global optimisations. +## Fixes presentation of locally optimised code (ode view). +## Much more elegant :-) +## +## Revision 1.2.4.1 2002/09/03 23:44:43 geraint +## adding global optimisation (-optg). +## +## Revision 1.2 2001/07/27 23:29:10 geraint +## Optimises only when requested (-opt). +## +## Revision 1.1 2000/12/28 12:25:13 peterg +## Initial revision +## +############################################################### + +optimise=''; optimise_msg='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -optimise_global ) +# optimise='-optimise_global' +# optimise_msg=' with global optimisation' ;; + optimise='' + optimise_msg='' ;; + -optimise_local ) +# optimise='-optimise_local' +# optimise_msg=' with local optimisation' ;; + optimise='' + optimise_msg='' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +# Create the reduce output code +def2write_r $1 lde +def2write_r $1 ldeo + +#Inform user +echo Creating $1_lde.r $optimise_msg +echo Creating $1_ldeo.r $optimise_msg + +# Remove the old log file +rm -f cse2lde_r.log + +# Use reduce to accomplish the transformation +$SYMBOLIC << EOF >cse2lde_r.log + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + +%Read the definitions file +in "$1_def.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the dae file +in "$1_dae.r"; + +% Zap bits we dont need +clear mttui, mttu, mttdu, mttx, mttdz; + +%% The lagrangian eqns are those set to zero. +MTTL := mttyz; + +% Create the second derivative of z +MATRIX mttddz(MTTNz,1); +FOR i := 1:MTTNz DO +BEGIN + mttuii := mkid(mttui,i); + mttdduii := mkid(mttddui,i); + mttddz(i,1) := sub(mttuii=mttdduii,mttz(i,1)); +END; +mttddz; + +% Create Lagranges Equations +FOR j := 1:MTTNyz DO +BEGIN + %% Create derivative of the equations by substituting: + %du for u + mttuj := mkid(mttu,j); + mttduj := mkid(mttdu,j); + MTTL := sub(mttuj=mttduj,MTTL); + + % dv for v + mttuij := mkid(mttui,j); + mttduij := mkid(mttdui,j); + MTTL := sub(mttuij=mttduij,MTTL); + + % dx for x + mttxj := mkid(mttx,j); + MTTL := sub(mttxj=mttdx(j,1),MTTL); + + % ddz for dz + mttdzj := mkid(mttdz,j); + MTTL := sub(mttdzj=mttddz(j,1),MTTL); + +END; + +L = MTTL; + +OFF Echo; +OFF Nat; + + +%Write out the ordinary differential equations. +OUT "$1_lde.r"; +write "%File: $1_lde.r"; +in ("$1_lde_write.r"); +write "in ""$1_ldeo.r"";"; +write "END;"; +SHUT "$1_lde.r"; + +%Write out the output equations +OUT "$1_ldeo.r"; +write "%File: $1_ldeo.r"; +in ("$1_ldeo_write.r"); +write "END;"; +SHUT "$1_ldeo.r"; +quit; +EOF + +# TODO: edit mtt_optimise to accept lde and ldeo +# if [ ${optimise:-""} = "-optimise_global" ]; then +# mtt_optimise global $1 lde +# mtt_optimise global $1 ldeo +# elif [ ${optimise:-""} = "-optimise_local" ]; then +# mtt_optimise local $1 lde +# mtt_optimise local $1 ldeo +# fi + +# Now invoke the standard error handling. +mtt_error_r cse2lde_r.log ADDED mtt/bin/trans/dae_r2m Index: mtt/bin/trans/dae_r2m ================================================================== --- mtt/bin/trans/dae_r2m +++ mtt/bin/trans/dae_r2m @@ -0,0 +1,309 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dae_r2m +# Reduce DAE to OCTAVE (DASSL) DAE +# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994, Jan 95, Aug 97. +# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 1998/05/13 16:43:03 peterg +## Now uses matlab_matrix to write the matrices +## Various bug fixes +## New global generation method +## +# Revision 1.6 1997/08/28 14:07:16 peterg +# Changed MTTDx to MTTDeriv +# +# Revision 1.5 1996/08/24 14:27:29 peter +# Global parameters. +# +## Revision 1.4 1996/08/18 20:02:21 peter +## Include zero outputs. +## +## Revision 1.3 1996/08/16 13:10:53 peter +## Fixed bug Ny changed to Nx in redidual loop. +## +## Revision 1.2 1996/08/16 08:57:34 peter +## Reads $1_input. +## +## Revision 1.1 1996/08/15 16:46:06 peter +## Initial revision +## +############################################################### + + +# WARNING this is experimental!! +# It asumes that the output y is NOT dependent on derivatives of +# z or u. + + +#Inform user +echo Creating $1_dae.m +echo Creating $1_daeo.m + + +# Remove the old log file +rm -f dae_r2m.log + +# Remove temp. files +rm -f $1_dae.m? +rm -f $1_daeo.m? + +# Use reduce to accomplish the transformation +$SYMBOLIC >dae_r2m.log << EOF + +%Read the reduce definitions file +in "$1_def.r"; + +%Read the reduce DAE file +in "$1_dae.r"; + +% Matrix output function +in"$MTTPATH/trans/matlab_matrix.r"; + +%Set up the number of argument variables to zero in case the user has forgotten +MTTNVar := 0; + +%Read the parameter file +%%in "$1_sympar.r"; + + +%% ON NERO; % Suppress zero elements + +%Define the common part of the functions. + +PROCEDURE common; +BEGIN + + write "% Read in the input"; + write "u = $1_input(x,t)"; + + % write "% Read in the arguments"; + % write "$1_args"; + + write "% Set up the State variables"; + FOR i := 1:MTTNx DO + BEGIN + write "mttx", i, " = mttx(", i, ");"; + END; + + write "% Set up the non-state variables"; + FOR i := 1:MTTNz DO + BEGIN + write "mttz", i, " = mttx(", MTTNx+ i, ");"; + END; + write "% Set up the non-state derivatives"; + FOR i := 1:MTTNz DO + BEGIN + write "mttdz", i, " = mttx(", MTTNx+MTTNz+ i, ");"; + END; + + write "% Set up the internal inputs"; + FOR i := 1:MTTNyz DO + BEGIN + write "mttui", i, " = mttx(", MTTNx+2*MTTNz+i, ");"; + END; + + write "% Set up the Input variables"; + IF MTTNu>0 THEN + FOR i := 1:MTTNu DO + BEGIN + write "mttu", i, " = u(", i, ");"; + END; +END; + +% Firstly do the residual = f(dx,x,t) function. + +% MTTGx and u are the derivatives of z wrt x and u respectively + +% Find MTTGx; +if MTTNz>0 THEN +BEGIN +matrix MTTGx(MTTNz,MTTNx); +FOR j := 1:MTTNx DO + BEGIN + xj := MTTX(j,1); + FOR i := 1:MTTNz DO + MTTGx(i,j) := df(MTTZ(i,1), xj, 1); + END; + +% Find MTTGu; +matrix MTTGu(MTTNz,MTTNu); +FOR j := 1:MTTNu DO + BEGIN + uj := MTTu(j,1); + FOR i := 1:MTTNz DO + MTTGu(i,j) := df(MTTZ(i,1), uj, 1); + END; +END; + +IF MTTNz=0 THEN +BEGIN + MTTGx := 0; + MTTGu := 0; + MTTz := 0; +END; + +OUT "$1_dae.m1"; +write "function residual = $1_dae(mttx,deriv0,t);"; +write "% residuals = $1_dae(dx,x,t);"; +write "%DAE in DASSL $1;;"; +write "%File $1_dae.m;;"; +write "%Generated by MTT;;"; + + +common(); +SHUT "$1_dae.m1"; + +GENTRANOUT "$1_dae.m3"; +write "% State derivative"; +IF MTTNX>0 THEN +BEGIN + MTT_Matrix := MTTdX$ + MTT_Matrix_name := "deriv"$ + MTT_Matrix_n := MTTNx$ + MTT_Matrix_m := 1$ + matlab_Matrix()$ + GENTRAN deriv := mtt_matrix$ +END; + +IF MTTNYz>0 THEN +BEGIN + MTT_Matrix := MTTYz$ + MTT_Matrix_name := "MTTYz"$ + MTT_Matrix_n := MTTNYz$ + MTT_Matrix_m := 1$ + matlab_Matrix()$ + GENTRAN MTTYz := mtt_matrix$ +END; + +if MTTNz>0 THEN +BEGIN + MTT_Matrix := MTTz$ + MTT_Matrix_name := "MTTz"$ + MTT_Matrix_n := MTTNz$ + MTT_Matrix_m := 1$ + matlab_Matrix()$ + GENTRAN MTTz := mtt_matrix$ + + MTT_Matrix := MTTGu$ + MTT_Matrix_name := "MTTGu"$ + MTT_Matrix_n := MTTNz$ + MTT_Matrix_m := 1$ + matlab_Matrix()$ + GENTRAN MTTGu := mtt_matrix$ + + MTT_Matrix := MTTGu$ + MTT_Matrix_name := "MTTGx"$ + MTT_Matrix_n := MTTNz$ + MTT_Matrix_m := 1$ + matlab_Matrix()$ + GENTRAN MTTGx := mtt_matrix$ + +END; + + +SHUT "$1_dae.m3"; + +OUT "$1_dae.m4"; +% write "% Set up the non-state derivatives"; +% FOR i := 1:MTTNz DO +% write "mttdz", i, " = mttderiv0(", MTTNx+ i, ");"; +% END; + +write "j = 0;"; + +%Residual has 3 parts as follows: +%Part 1: dx/dt - dx_0/dt +if MTTNx>0 THEN +BEGIN + write "for i=1:", MTTNx, ";;"; + write " j = j+1"; + write " residual(j) = deriv(i)-deriv0(j);"; + write "end;"; +END; + +%Part 2: dz/dt - dz_0/dt +IF MTTNz>0 THEN +BEGIN + if MTTNx>0 THEN + write "mttdzx = mttgx*mttdx" + ELSE + write "mttdzx = zeros(", MTTNz, ",1);"; + + + if MTTNu>0 THEN + write "mttdzu = mttgu*mttdu" + ELSE + write "mttdzu = zeros(", MTTNz, ",1);"; + + write "mttdz = mttdzx + mttdzu"; + + write "for i=1:", MTTNz, ";;"; + write " j = j+1"; + write " residual(j) = mttdz(i)-mttderiv0(j);"; + write "end;"; +END; + +%Part 3: v=0 (the algebraic bits) +IF MTTNyz>0 THEN +BEGIN + write "for i=1:", MTTNyz, ";;"; + write " j = j+1"; + write " residual(j) = mttyz(i)"; + write "end;"; +END; + +SHUT "$1_dae.m4"; + + +% Now do the y = g(x,t) function. +OUT "$1_daeo.m1"; + +write "function mtty = $1_daeo(mttx,t);"; +write "% mtty = $1_daeo(mttx,t);"; +write "%DAE in Simulab form for system $1;;"; +write "%File $1_daeo.m;;"; +write "%Generated by MTT;;"; + +SHUT "$1_daeo.m1"; + +OUT "$1_daeo.m3"; +common(); + + +%Fortran switches - one line expressions +OFF echo; +ON fort$ +cardno!* := 1$ +fortwidth!* := 500$ +OFF period$ + +MTTy := MTTy; + +SHUT "$1_daeo.m3"; + +EOF + +# Create the globals +sympar2global_txt2m $1> $1_dae.m2 +sympar2global_txt2m $1> $1_daeo.m2 + +# Put together the pieces +cat $1_dae.m?>$1_dae.m +cat $1_daeo.m?>$1_daeo.m + + + + + + + ADDED mtt/bin/trans/dae_r2tex Index: mtt/bin/trans/dae_r2tex ================================================================== --- mtt/bin/trans/dae_r2tex +++ mtt/bin/trans/dae_r2tex @@ -0,0 +1,193 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dae_r2tex +# Reduce differential-algebraic to LaTex differential-algebraic equations. +# P.J.Gawthrop 10th May 1991, April 1994 +# Copyright (c) P.J.Gawthrop, 1991, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 1998/01/23 16:08:09 peterg +## changed eqnarray to equation + aligned +## +## Revision 1.3 1997/06/13 13:30:43 peterg +## Removed eqn labels. +## +# Revision 1.2 1996/12/19 10:25:15 peterg +# Now writes out mtti instead of mtt_{i} -- lets latex_tidy do the +# conversion. +# +# Revision 1.1 1996/10/21 08:50:15 peterg +# Initial revision +# +############################################################### + + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info;; + -partition ) + partition=yes; + blurb='with partitioning'; + ;; + *) + echo "$1 is an invalid argument - ignoring"; + exit ;; + esac + shift +done + +# Inform user +echo Creating $1_dae.tex $blurb + +logname=dae_r2tex.log + +# Remove the old log file +rm -f dae_r2tex.log + +# Use reduce to accomplish the transformation +$SYMBOLIC >$logname << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the differential-algebraic equations file +in "$1_dae.r"; + +%Read the symbolic parameter file +%%in "$1_sympar.r"; + + +OFF Echo; +OFF Nat; + + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplifying expressions file +IN "$1_simp.r"; + +% Read the formating function +in "$MTTPATH/trans/latex_equations.r"; + +OUT "$1_dae.tex"; + +%Write out the differential-algebraic equations. + +write "%File: $1_dae.tex"; + +write "%differential-algebraic equations"; +%ON Rounded; +%Precision 5; + +latex_equations(); + +SHUT "$1_dae.tex"; +quit; +EOF + +if [ -n "$partition" ]; then + rm -f mtt_junk + # Now for the subsystems + # Find subsystems + subsystems=`mtt_get_subsystems $1` + + for subsystem in $subsystems; do + echo Doing $subsystem + ucname="MTT_"$subsystem"_uc" + subsystem_dae=$subsystem"_dae" + #subname=`echo $subsystem | mtt_remove_underscore` + + Nu=`mtt_getsize -internal $subsystem"_1" u` + echo Nu $Nu + + # Use symbolic algebra to accomplish the transformation + $SYMBOLIC >$logname << EOF + + + %Read the definitions file + in "$1_def.r"; + + + %Read the symbolic parameter file + %%in "$1_sympar.r"; + + + % Read the formating function + in "$MTTPATH/trans/latex_equations.r"; + + OFF Echo; + OFF Nat; + + + %Read the substitution file + in "$1_subs.r"; + + %Read the simplifying expressions file + IN "$1_simp.r"; + + %Read the differential-algebraic equations file + in "$1_dae.r"; + + %Create the output file + OUT "mtt_junk_1"; + + % Connecting inputs + IF $Nu>0 THEN + BEGIN + write "\section{Subsystem $subsystem}"; + + write "\subsection{Connections}"; + write"\begin{itemize}"; + FOR Row := 1:$Nu DO + BEGIN + write "\item Input ", Row, " is connected to "; + write $ucname(Row,1); + END; + write"\end{itemize}"; + END; + SHUT "mtt_junk_1"; + + %Read the differential-algebraic equations file + in "$subsystem_dae.r"; + + %Create the output file + OUT "mtt_junk_2"; + write "\subsection{Dynamics}"; + latex_equations(); + SHUT "mtt_junk_2"; + +EOF + echo >> $1_dae.tex + echo %Connections for subsystem $subsystem >> $1_dae.tex + + # Sort out underscores and remove mtt to avoide post processor + cat mtt_junk_1 | mtt_remove_underscore | sed 's/mtt//g'>> $1_dae.tex + cat mtt_junk_2 >> $1_dae.tex + rm -rf mtt_junk_? + done +fi + + +# Now invoke the standard error handling. +mtt_error_r dae_r2tex.log + + + + + + + + + + + ADDED mtt/bin/trans/dat22dat Index: mtt/bin/trans/dat22dat ================================================================== --- mtt/bin/trans/dat22dat +++ mtt/bin/trans/dat22dat @@ -0,0 +1,72 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dat22dat +# Splits the data file into output and state bits + +# Copyright (c) P.J.Gawthrop 1999 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.10 2000/10/17 12:24:02 peterg +## Three argument generic version +## +## Revision 1.9 2000/09/27 16:12:50 peterg +## Use expr to evaluate arithmetic - compatible with sh (as opposed to +## bash) +## +## Revision 1.8 2000/09/21 10:07:06 peterg +## Now correctely writes out the state into _odes.dat rep. +## +## Revision 1.7 2000/04/06 09:02:46 peterg +## Removed bash let commands as unsupported by sh +## Do arithmetic within awk - yuk +## +## Revision 1.6 2000/04/06 08:36:15 peterg +## *** empty log message *** +## +## Revision 1.5 1999/03/15 22:42:52 peterg +## Strip comments (put in by Octave save function) +## +## Revision 1.4 1999/03/15 21:55:36 peterg +## Does away with the # symbol in the file - uses _de to get Nx Ny +## instead +## +############################################################### +if [ -z "$1" ]; then + echo "Usage: dat22dat system ode|odes so|s" + exit +fi + +# Find Nx and Ny +Nx=`mtt_getsize $1 x` # States +Ny=`mtt_getsize $1 y` # Outputs + +case $3 in + so) + First=1; Last=`expr $First + $Ny` + ;; + s) + First=`expr $Ny + 2`; Last=`expr $First + $Nx` + ;; + *) + First=1; Last=`expr $Ny + 1` + ;; +esac + +echo Creating $1_$2$3.dat + +gawk '{ + ## Extract the data + if (index($1,"#") != 1){ + for (i=First;i<=Last;i++) + printf("%s ", $i); + printf("\n"); + } +}' First=$First Last=$Last <$1_$2s.dat2 > $1_$2$3.dat ADDED mtt/bin/trans/dat22sg.sh Index: mtt/bin/trans/dat22sg.sh ================================================================== --- mtt/bin/trans/dat22sg.sh +++ mtt/bin/trans/dat22sg.sh @@ -0,0 +1,147 @@ +#! /bin/sh + +# Convert simulation data to SciGraphica (v 0.61) Project file ($sys_odes.sg) + +sys=$1 + +write_project_header () +{ + cat < + + + + + application + scigraphica + + + author + MTT:${USER} + + + +EOF +} + +write_project_footer () +{ + echo '' + echo '' +} + +write_worksheet_header () +{ + name=$1 ; ncol=$2 ; nrow=$3 + cat < + + + application + scigraphica + + + author + MTT:${USER} + + + + ${name} + ${ncol} + ${nrow} + -1 + -1 +EOF +} + +write_worksheet_footer () +{ + echo '' + echo '' +} + +write_column_headings () +{ + gawk '{ printf (" \n \n", NR-1,$0) }' +} + +write_output_headings () +{ + sys=$1 + ${MATRIX} -q <\n", row,col); + printf (" %f\n", val); + printf (" %f\n", val); + printf (" \n"); +endfunction + + [u_names,y_names,x_names] = ${sys}_struc; + ncol = size(${vec}_names)(1); + + load ("${sys}_odes.dat2"); + nrow = size(mtt_data)(1); + + # write Time + for r = 1:nrow + write_cell (r-1,0,mtt_data(r,1)); + endfor + + if ("${vec}" == "y") + offset = 1; + elseif ("${vec}" == "x") + offset = size(y_names)(1); + endif + + for r = 1:nrow + for c = 1:ncol + write_cell (r-1,c,mtt_data(r,c+offset)); + endfor + endfor +EOF +} + +file=${sys}_odes.sg + +NX=`mtt_getsize ${sys} x` +NY=`mtt_getsize ${sys} y` +NTMP=`wc -l ${sys}_odes.dat2 | gawk '{print $1}'` +NROW=`expr ${NTMP} - 4` # 4 comment lines in mtt_data + +{ + write_project_header + # states + write_worksheet_header "X_${sys}" ${NX} ${NROW} + write_state_headings ${sys} + write_cell_values ${sys} x + write_worksheet_footer + # outputs + write_worksheet_header "Y_${sys}" ${NY} ${NROW} + write_output_headings ${sys} + write_cell_values ${sys} y + write_worksheet_footer + write_project_footer +} > ${file} + ADDED mtt/bin/trans/dat2gdat Index: mtt/bin/trans/dat2gdat ================================================================== --- mtt/bin/trans/dat2gdat +++ mtt/bin/trans/dat2gdat @@ -0,0 +1,135 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dat2gdat + +# Converts a data file in data format to gplot data format + +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2002/04/16 11:36:03 gawthrop +## These were flagged with M on cvs update +## +## Revision 1.1 2000/12/28 12:26:15 peterg +## Put under RCS +## +## Revision 1.8 1998/09/29 20:01:27 peterg +## 4th argument for nyquist style files - ie differnt x for each y +## +## Revision 1.7 1997/12/04 22:10:32 peterg +## Handles argument list - variable names. +## +## Revision 1.6 1997/05/22 10:34:05 peterg +## Changed argument structure. +## +## Revision 1.5 1997/05/22 10:11:19 peterg +## Fixed parametetr bug +## +# Revision 1.4 1997/05/16 13:03:10 peterg +# Now selects variables to display. +# +# Revision 1.3 1996/08/26 13:02:58 peterg +# Cahged awk to awk. +# +# Revision 1.2 1996/08/15 11:49:11 peter +# Puts a blank line at the end of the file: +# this allows user to cat files for use in gnuplot. +# +## Revision 1.1 1996/08/14 09:13:52 peter +## Initial revision +## +############################################################### + +echo Creating $1_$2.gdat +rm -f $1_$2.gdat + +DifferentX=$4; + +# Convert multi-columns into gnuplot format - +# ie stack two columns vertically separated by blank lines + +#Get the desired data index +which=`name2index $1 "$3"` +echo $1 $3 $which + +if [ -z "$DifferentX" ]; then +gawk ' +BEGIN{ + row=0; col=0; +} +{ + if (row==0) { + N=split(which,Which,","); + } + row++; + j=1; + if (Which[1]==0) { + x[row] = $1; + for (i=1; i $1_$2.gdat + +else +gawk ' +BEGIN{ + row=0; col=0; +} +{ + row++; cols=NF/2 + for (i=1; i<=cols; i++) { + ycol=2*i; + xcol=ycol-1; + x[row,i] = $xcol + y[row,i] = $ycol; + } +} +END { + rows = row; + for (col = 1; col <= cols; col++) { + for (row = 1; row <= rows; row++) { + print x[row,col], y[row,col] + }; + if (col<=cols) { + printf("\n") + } + } +}' <$1_$2.dat > $1_$2.gdat + +fi + + + + + + ADDED mtt/bin/trans/dat2sdat Index: mtt/bin/trans/dat2sdat ================================================================== --- mtt/bin/trans/dat2sdat +++ mtt/bin/trans/dat2sdat @@ -0,0 +1,51 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dat2sdat + +# Structure file - dat to sdat conversion +# P.J.Gawthrop April 1997 +# Copyright (c) P.J.Gawthrop, 1997, 1999 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1.4.1 2001/06/26 00:57:21 geraint +## Prints more useful name. +## +## Revision 1.1 2000/12/28 12:26:34 peterg +## Put under RCS +## +## Revision 1.1 1999/03/28 21:29:40 peterg +## Initial revision +## +############################################################### + +if [ "$2" = "odes" ]; then + which="state" +else + which="output" +fi + +awk ' +BEGIN{ +printf("Time"); +} +{ + if ($1==which) + printf(" %s(%s)", $4, $5); +} +END{ +printf("\n"); +} +' SYSTEM=$1 which=$which < $1_struc.txt + +cat $1_$2.dat + + + ADDED mtt/bin/trans/dat2siag Index: mtt/bin/trans/dat2siag ================================================================== --- mtt/bin/trans/dat2siag +++ mtt/bin/trans/dat2siag @@ -0,0 +1,47 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dat2siag +# Converts data to siag (scheme in a grid) format - ie columns become rows. + +# Data file dat to sdat conversion +# P.J.Gawthrop February 1998 +# Copyright (c) P.J.Gawthrop, 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2001/04/16 22:22:06 geraint +## *** empty log message *** +## +## Revision 1.1 1999/03/29 03:35:13 peterg +## Initial revision +## +############################################################### + + + + +# This is the main transformation using awk +gawk '{ + i++ + for (j=1;j<=NF;j++) + data[i,j]=$j; + Cols=NF; + Rows++; +} +END{ + for (j=1;j<=Cols;j++) { + for (i=1;i<=Rows;i++){ + printf("%s ", data[i,j]); + } + printf("\n"); + } +}' + + ADDED mtt/bin/trans/def2write_r Index: mtt/bin/trans/def2write_r ================================================================== --- mtt/bin/trans/def2write_r +++ mtt/bin/trans/def2write_r @@ -0,0 +1,215 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: def2write.r +# Generates r code to write matrices +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.17 2002/09/16 08:08:00 geraint +## Merged changes from global-optimisation branch. +## +## Revision 1.16.2.3 2002/09/10 23:24:19 geraint +## Rationalised local and global optimisations. +## Fixes presentation of locally optimised code (ode view). +## Much more elegant :-) +## +## Revision 1.16.2.2 2002/09/10 22:09:14 geraint +## Fixed presentation of globally optimised equations (ode view). +## +## Revision 1.16.2.1 2002/09/03 23:44:43 geraint +## adding global optimisation (-optg). +## +## Revision 1.16 2002/09/03 19:34:15 geraint +## Write EdX regardless - csex is needed to create ode when not optimised. +## +## Revision 1.15 2002/08/29 15:45:20 geraint +## Tests for existence of matrix before entering shell loop. +## Tests for existence of expression before attempting to write or optimise. +## +## Revision 1.14 2002/08/09 14:34:45 geraint +## Fix to prevent numbers being formed with a decimal point in the exponent, Reduce cannot handle these. +## +## Revision 1.13 2002/07/10 17:43:05 geraint +## Added feature [ 562453 ] Optimisation of algebraic equations. +## +## Revision 1.12 2002/06/28 10:13:40 geraint +## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. +## +## Revision 1.11.2.1 2002/06/05 11:14:51 geraint +## ae.r now generated using def2write_r like cse?.r +## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r. +## +## Revision 1.11 2002/05/17 09:14:58 geraint +## Optimises each line in a separate session. Allows larger models to be built. +## +## Revision 1.10 2002/04/28 18:41:27 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.9 2001/07/27 23:29:10 geraint +## Optimises only when requested (-opt). +## +## Revision 1.8 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## +## Revision 1.7.2.1 2001/05/04 04:07:24 geraint +## Numerical solution of algebraic equations. +## sys_ae.cc written for unsolved inputs. +## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). +## +## Revision 1.7 2001/04/11 09:44:26 gawthrop +## Fixed cc and c problems to do with pow(x,y) and integers +## mtt/lib/reduce/fix_c.r is included in rdae2dae and cse2smx_lang for +## -c, -cc and -oct options +## +## Revision 1.6 2000/11/29 20:48:53 peterg +## Zapped unnecessary Npar creation +## +## Revision 1.5 2000/11/09 10:12:24 peterg +## Removed debugging line +## +## Revision 1.4 2000/10/14 16:19:54 peterg +## Just optimize one line at a time ... +## +## Revision 1.3 2000/10/11 09:07:17 peterg +## Added csex rep (cse without E) +## +## Revision 1.2 2000/10/10 21:02:17 peterg +## Added cse reps +## +## Revision 1.1 2000/10/10 09:07:32 peterg +## Initial revision +## +############################################################### + +optimise='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -fixcc ) + include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +sys=$1 # System name +rep=$2 # System representation + +# Inform User +echo Creating $1_$2_write.r + +# Find system constants +Nx=`mtt_getsize $sys x` # States +Nxx=`mtt_getsize $sys xx` # States x States +Nu=`mtt_getsize $sys u` # Inputs +Ny=`mtt_getsize $sys y` # Outputs +Nyz=`mtt_getsize $sys yz` # Zero outputs +#Npar=`wc -l $sys\_sympar.txt | gawk '{print $1}'` + +# Set up representation-specific stuff +case $rep in + ae) + matrices='Yz' + ns="$Nyz" + ms="1" + ;; + cse) + matrices='EdX E' + ns="$Nx $Nx" + ms="1 $Nx" + ;; + csex) + matrices='EdX' + ns="$Nx" + ms="1" + ;; + cseo) + matrices='Y' + ns="$Ny" + ms="1" + ;; + lde) + matrices='L' + ns="$Nyz" + ms="1" + ;; + ldeo) + matrices='Y Yz' + ns="$Ny $Nyz" + ms="1 1" + ;; + ode) + matrices='dX' + ns="$Nx" + ms="1" + ;; + odeo) + matrices='Y' + ns="$Ny" + ms="1 1" + ;; + sm) + matrices='A B C D' + ns="$Nx $Nx $Ny $Ny" + ms="$Nx $Nu $Nx $Nu" + ;; + *) + echo def2write_r: representation $rep not recognised + exit +esac + +# Remove log files +rm -f def2write_r1.log def2write_r2.log + +# Write out the code +echo "" > $1_$2_write.r + +echo 'off echo$' >> $1_$2_write.r +echo 'load gentran$' >> $1_$2_write.r + +for matrix in $matrices; do + ignore_matrix="no" + if [ "$matrix" = "E" ]; then + matrix_exists=`grep -i MTTE ${sys}_dae.r | wc -l | gawk '{print $1}'` + if [ ! $matrix_exists -gt 0 ]; then + ignore_matrix="yes" + n=`first "$ns"`; ns=`rest "$ns"` + m=`first "$ms"`; ms=`rest "$ms"` + is=`n2m 1 $n`; + echo "write \"% Begin Matrix MTTE\"$" >> $1_$2_write.r + for i in $is; do + echo 'write' + name=`echo MTTE'('$i','$i')'` + echo ' '$comma$name ':=' $name '$' + done >> $1_$2_write.r + echo "write \"% End Matrix MTTE\"$" >> $1_$2_write.r + fi + fi + if [ ! "$ignore_matrix" = "yes" ]; then + n=`first "$ns"`; ns=`rest "$ns"` + m=`first "$ms"`; ms=`rest "$ms"` + is=`n2m 1 $n`; + js=`n2m 1 $m`; + echo "write \"% Begin Matrix MTT${matrix}\"$" >> $1_$2_write.r + if [ $n -ge 1 ]; then + for i in $is; do + for j in $js; do + echo 'write' + name=`echo MTT$matrix'('$i','$j')'` + echo ' '$comma$name ':=' $name '$' + done + done + fi >> $1_$2_write.r + echo "write \"% End Matrix MTT${matrix}\"$" >> $1_$2_write.r + fi +done +echo ';END;' >>$1_$2_write.r ADDED mtt/bin/trans/def_r2m Index: mtt/bin/trans/def_r2m ================================================================== --- mtt/bin/trans/def_r2m +++ mtt/bin/trans/def_r2m @@ -0,0 +1,55 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: def_r2m +# transforms definitions from reduce to m file. +# Copyright (c) P.J.Gawthrop 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/07/25 10:21:37 peterg +## Entirely rewritten +## +## Revision 1.1 1998/07/25 07:10:41 peterg +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_def.m + +# Remove the old log file +rm -f def_r2m.log + + +# Header +cat < $1_def.m +function [nx,ny,nu,nz,nyz] = $1_def; +% function [nx,ny,nu,nz,nyz] = $1_def; +% System $1, representation def, language m +% File $1_def.m; +% Generated by MTT on `date`; +% +EOF + +# Constants +Nx=`grep "MTTNx " <$1_def.r | gawk '{print $3}' | sed 's/;//'` +Ny=`grep "MTTNy " <$1_def.r | gawk '{print $3}' | sed 's/;//'` +Nu=`grep "MTTNu " <$1_def.r | gawk '{print $3}' | sed 's/;//'` +Nz=`grep "MTTNz " <$1_def.r | gawk '{print $3}' | sed 's/;//'` +Nyz=`grep "MTTNyz " <$1_def.r | gawk '{print $3}' | sed 's/;//'` + + +cat<> $1_def.m + nx = $Nx; + ny = $Ny; + nu = $Nu; + nz = $Nz; + nyz = $Nyz; +EOF ADDED mtt/bin/trans/dia2abg.pl Index: mtt/bin/trans/dia2abg.pl ================================================================== --- mtt/bin/trans/dia2abg.pl +++ mtt/bin/trans/dia2abg.pl @@ -0,0 +1,571 @@ +#!/usr/bin/perl -w + +#---------------------------------------------------------------------------- +# dia2abg.pl +# Copyright (C) 2002; David Hoover. +# Modified 2004 Geraint Bevan. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The GNU General Public License should be found in the file license.txt. +# For more information about free software, visit http://www.fsf.org/ +#---------------------------------------------------------------------------- + +############################################################################# +# Given a DIA diagram, the script has functions that perform the following +# MTT (model transformation tools) functions: +# 1. Write a _cmp.txt file containing component types:names +# 2. Write a _ibg.m file containing an acausal bond graph suitable for +# processing by MTT. +# 3. Modify a diagram by changing causality as desired. +############################################################################# + +#---------------------------------------------------------------------------- +# Dia uses a unique id for each object. +# get_component_data and get_bond_data read the xml file and collect +# important information about component and bond id's, component +# names, and bond connectivity. These data structures are described here: + +# The %component_id_tag hash provides component names and types: +# +# key=component_id +# value=component type:name + +# 'start' ALWAYS refers to dia's interpretation of start. This means, +# when you draw a line or an arrow, 'start' is the point where you +# initally press down the mouse button. 'end' is the point where you +# release the mouse button. 'start' and 'end' have nothing to do with +# a bond's direction. A half arrow could be on a dia 'start' or 'end' +# point. + +# The %bond_id_start_id and %bond_id_end_id hashes provides +# connectivity info for line start points and end points: +# +# key=bond_id +# value=component_id + +# The %bond_id_arrow_on_start hash is a boolean that indicates whether +# the power arrow (half head) is on the dia line start point. +# +# key=bond_id +# value=boolean arrow_on_start + +# The %bond_id_effort_causality hash is a boolean that provides the +# effort arrow-oriented causality. +# +# key=bond_id +# value=arrow-oriented effort causality. + +# The %bond_id_flow_causality hash is a boolean that provides the +# flow arrow-oriented causality. +# +# key=bond_id +# value=arrow-oriented flow causality. + +# %mtt_bond_id_index provides a unique positive integer index for each +# Dia bond ID. The index is written to the ibg.m file for mtt. + +# The %component_id_type, %component_id_name, %component_id_reps hashes +# store the information from _cmp.m for each component +# +# key=component_id +# value=component type, name or number of repetitions + +#---------------------------------------------------------------------------- + +#----------------------------MAIN PROGRAM------------------------------------ +use strict; +use Getopt::Long; +use XML::DOM; + +my (%component_id_tag, %bond_id_start_id, %bond_id_end_id, + $objects, %mtt_bond_id_index, + %bond_id_arrow_on_start, %bond_id_flow_causality, %bond_id_effort_causality, + %bond_id_start_label,%bond_id_end_label); + +my (%component_id_type, %component_id_name, %component_id_reps); + +# Parse user options: +my $diagram_name = ''; +my $dia_input_file = ''; +my $dia_output_file = ''; +my $component_list_file = ''; +my $debug = 0; +my $create_component_list = 0; +my $create_ibg = 0; +my $ibg_file = ''; +my $change_flow_causality = ''; +my $change_effort_causality = ''; +GetOptions ('diagram_name=s' => \$diagram_name, + 'dia_input_file=s' => \$dia_input_file, + 'dia_output_file=s' => \$dia_output_file, + 'component_list_file=s' => \$component_list_file, + 'debug' => \$debug, + 'create_component_list' => \$create_component_list, + 'create_ibg' => \$create_ibg, + 'ibg_file=s' => \$ibg_file, + 'change_flow_causality=s' => \$change_flow_causality, + 'change_effort_causality=s' => \$change_effort_causality, + ); + +die usage() if $diagram_name eq ''; + +# Use defaults if necessary: +$dia_input_file = $diagram_name . "_abg.dia" if ($dia_input_file eq ''); +$dia_output_file = $diagram_name . "_cbg.dia" if ($dia_output_file eq ''); +$ibg_file = $diagram_name . "_ibg.m" if ($ibg_file eq ''); +$component_list_file = $diagram_name . "_cmp.txt" if ($component_list_file eq ''); + +# Start Parsing XML, and creating files: +my $dom = new XML::DOM::Parser; +my ($doc); + +$doc = $dom->parsefile($dia_input_file); +$objects = get_objects_node($doc,"Bond Graph"); + +get_component_data($objects); +parse_component_data(); + +get_bond_data($objects); + +create_component_list() if ($create_component_list); + +if ($create_ibg) { + open (OUT,">$ibg_file") || + die "Cannot open $ibg_file for writing.\n"; + output_ibg(); + +} + +if ($change_flow_causality ne '' || $change_effort_causality ne '') { + open (DIA_OUT,">$dia_output_file") || + die "Cannot open $dia_output_file for writing.\n"; + print DIA_OUT $doc->toString; + close DIA_OUT; +} + +exit 0; + + +#----------------------------SUBROUTINES------------------------------------- +sub create_component_list { + my ($type, $name); + + print_debug("CREATING unique_raw_list...\n"); + open (RAW,">$component_list_file") || + die "Cannot open $component_list_file for writing.\n"; + + my (%reverse_component_id_tag) = reverse (%component_id_tag); + foreach my $val (sort values(%component_id_tag)) { + my ($id, $type); + $id = $reverse_component_id_tag{$val}; + $type = $component_id_type{$id}; + $_ = $val; + id_cleaner(); + $val = $_; + print RAW $val . "\n"; + } + close(RAW); +} + +sub get_objects_node { + my ( $doc_node, $layer_name )= @_; + my ($root,$layer_node,$objects); + + $root = get_first_element_subnode($doc_node); + die "could not find top-level element dia_diagram.\n" + unless $root->getTagName eq 'dia:diagram'; + + $layer_node = get_first_subnode_by_nodename_attribute(0,$root,"dia:layer","name",$layer_name); + die "I found no dia:layer named $layer_name. Are you sure the diagram has one?\n" unless + $layer_node->getTagName eq 'dia:layer' && + $layer_node->getAttributeNode("name")->getValue eq $layer_name; + + $objects = $layer_node->getElementsByTagName('dia:object'); + + return $objects; +} + +sub output_ibg_header { + my ($date); + $date = `date`; chomp($date); + + print OUT <<"EOF"; +## -*-octave-*- put Emacs into Octave mode + +function [${diagram_name}] = ${diagram_name}_ibg + + ## Intermediate bond graph representation of $diagram_name + ## Generated by MTT on $date + + ## head refers to the harpoon end of a bond + ## tail refers to the other end of a bond + ## causality.? is the end at which ? is imposed + + +EOF +} + +sub output_ibg_footer { + print OUT <<"EOF"; +endfunction +EOF +} + +sub output_ibg { + my ($key,$component,$type,$name, + %reverse_mtt_bond_id_index,$mtt_bond_id,$dia_bond_id, + @bonds, + $bond_id,$start,$end,$id, + $head,$head_component,$head_type,$head_name, + $tail,$tail_component,$tail_type,$tail_name, + $start_label,$end_label, + $head_label,$tail_label, + $effort_causality,$flow_causality); + + output_ibg_header(); + + %reverse_mtt_bond_id_index = reverse (%mtt_bond_id_index); + + @bonds = (sort keys (%reverse_mtt_bond_id_index)); + foreach $mtt_bond_id (@bonds) { + + $dia_bond_id = $reverse_mtt_bond_id_index{$mtt_bond_id}; + + $start = $bond_id_start_id{$dia_bond_id}; + $end = $bond_id_end_id {$dia_bond_id}; + + if ($bond_id_arrow_on_start{$dia_bond_id}) { + $head = $end; + $tail = $start; + } else { + $head = $start; + $tail = $end; + } + + $start_label = $bond_id_start_label{$dia_bond_id}; + $end_label = $bond_id_end_label {$dia_bond_id}; + + # treat label as a comment if not enclosed by [ ] + if ($start_label !~ /\[.*\]/) { + $start_label = "[]"; + } + if ($end_label !~ /\[.*\]/) { + $end_label = "[]"; + } + + if ($bond_id_arrow_on_start{$dia_bond_id}) { + $head_label = $end_label; + $tail_label = $start_label; + } else { + $head_label = $start_label; + $tail_label = $end_label; + } + + $head_component = "$component_id_type{$head}:$component_id_name{$head}"; + $tail_component = "$component_id_type{$tail}:$component_id_name{$tail}"; + + $effort_causality = $bond_id_effort_causality{$dia_bond_id}; + $flow_causality = $bond_id_flow_causality {$dia_bond_id}; + + for ($effort_causality) { + if (/-1/) { $effort_causality = "tail";} + if (/0/) { $effort_causality = "none";} + if (/1/) { $effort_causality = "head";} + } + for ($flow_causality) { + if (/-1/) { $flow_causality = "head";} + if (/0/) { $flow_causality = "none";} + if (/1/) { $flow_causality = "tail";} + } + + print OUT + " ## bond $mtt_bond_id \n" . + " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . + "head.component = \"${head_component}\";\n" . + " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . + "tail.component = \"${tail_component}\";\n"; + + print OUT + " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . + "head.ports = \"$head_label\";\n" . + " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . + "tail.ports = \"$tail_label\";\n"; + + print OUT + " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . + "causality.effort = \"$effort_causality\";\n" . + " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . + "causality.flow = \"$flow_causality\";\n\n"; + } + + output_ibg_footer(); +} + +sub get_component_data { + my ( $objects_node )= @_; + my($obj,$id,$attr,$comp,$strattr,$str_elem,$string); + + print_debug("READING COMPONENTS FROM $dia_input_file...\n"); + for my $i (0..$objects_node->getLength-1) { + $obj = $objects_node->item($i); + next if ($obj->getAttributeNode("type")->getValue ne "BondGraph - MTT port"); + + $id = $obj->getAttributeNode("id")->getValue; + print_debug($id . "\n"); + + $attr = get_first_subnode_by_nodename_attribute(0,$obj,"dia:attribute","name","text"); + $comp = get_first_subnode_by_nodename_attribute(0,$attr,"dia:composite","type","text"); + $strattr = get_first_subnode_by_nodename_attribute(0,$comp,"dia:attribute","name","string"); + $str_elem = get_first_element_subnode($strattr); + $string = get_first_text_subnode($str_elem); + $component_id_tag{$id} = $string->getData; + } + die "There are no components!\n" unless keys(%component_id_tag) > 0; +} + +sub parse_component_data { + my (%anon_index, $id, $component); + + while (($id, $component) = each (%component_id_tag)) { + $_ = $component; + id_cleaner(); + $component = $_; + my ($type_name, $repetitions) = split (/\*/, $component); + if (! $repetitions) { + $type_name = $component; + $repetitions = 1; + } + my ($type, $name) = split (/:/, $type_name); + if (! $name) { + $type = $type_name; + if (! defined ($anon_index{$type})) { + $anon_index{$type} = 1; + $name = "mtt${type}"; + } else { + my $num = ++$anon_index{$type}; + $name = "mtt${type}_${num}"; + } + } + $component_id_type{$id} = $type; + $component_id_name{$id} = $name; + $component_id_reps{$id} = $repetitions; + } +} + +# Dia stores its attributes in a strange way, not using typical xml attributes. +sub get_dia_attribute_value { + my ($type, $attribute_node )= @_; + my ($subnode); + $subnode = get_first_subnode_by_nodename_attribute(0,$attribute_node,$type); + + return $subnode->getAttributeNode("val")->getValue; +} + +# Dia stores its attributes in a strange way, not using typical xml attributes. +sub set_dia_attribute_value { + my ($type, $attribute_node, $new_value )= @_; + my ($subnode); + $subnode = get_first_subnode_by_nodename_attribute(0,$attribute_node,$type); + + $subnode->setAttribute(val => $new_value); +# return $subnode->getAttributeNode("val")->getValue; +} + +sub get_dia_attribute_string { + my ($attribute) = @_; + my ($str_elem, $string); + $str_elem = get_first_element_subnode($attribute); + $string = get_first_text_subnode($str_elem)->getData; + $string =~ s/\#//g; + return $string; +} + +sub get_arrow_info { + my ( $object_node, $id, $id_index )= @_; + my($attribute,$attributes); + + $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "arrow_on_start"); + $bond_id_arrow_on_start{$id} = defined($attribute) ? get_dia_attribute_value("dia:boolean",$attribute) : 0; + + $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "effort_causality"); + change_causality($id_index, $attribute, $change_effort_causality); + $bond_id_effort_causality{$id} = defined($attribute) ? get_dia_attribute_value("dia:enum",$attribute)-1 : 1; + + $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "flow_causality"); + change_causality($id_index, $attribute, $change_flow_causality); + $bond_id_flow_causality{$id} = defined($attribute) ? get_dia_attribute_value("dia:enum",$attribute)-1 : 1; + + $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "start_label"); + $bond_id_start_label{$id} = defined($attribute) ? get_dia_attribute_string($attribute) : "[]"; + + $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "end_label"); + $bond_id_end_label{$id} = defined($attribute) ? get_dia_attribute_string($attribute) : "[]"; +} + +sub change_causality() { + my ($id_index, $attribute_node, $causality_change_string)=@_; + my ($mtt_id, $arrow_oriented_causality); + + foreach my $id_causality (split(/;/,$causality_change_string)) { + ($mtt_id, $arrow_oriented_causality) = split(/:/,$id_causality); + if ($mtt_id eq "all" || $id_index == $mtt_id) { + set_dia_attribute_value("dia:enum",$attribute_node,$arrow_oriented_causality + 1); + } + } +} + +sub get_bond_data { + my ( $objects_node )= @_; + my ($id_index, $obj, $id, $connections, $connection, $to, $handle, + $connections_att); + + print_debug("READING BONDS FROM $dia_input_file...\n"); + $id_index = 0; + for my $i (0..$objects_node->getLength-1) { + $obj = $objects_node->item($i); + next if ($obj->getAttributeNode("type")->getValue ne "BondGraph - MTT bond"); + + $id = $obj->getAttributeNode("id")->getValue; + + print_debug("Bond " . $id . ":\n"); + $mtt_bond_id_index{$id} = ++$id_index; + + get_arrow_info($obj,$id,$id_index); + print_debug("Flow causality ($id):" . $bond_id_flow_causality{$id} . "\n"); + print_debug("Effort causality ($id):" . $bond_id_effort_causality{$id} . "\n"); + print_debug("Arrow on start ($id):" . $bond_id_arrow_on_start{$id} . "\n"); + + # get connection info + $connections_att = $obj->getElementsByTagName('dia:connections'); + die "A bond without connections exists!\n" + unless $connections_att->getLength > 0; + + $connections = $connections_att->item(0)->getElementsByTagName('dia:connection'); + die "Bond $id does not have two connections!\n" unless + $connections->getLength == 2; + + for my $j (0..$connections->getLength-1) { + + $connection = $connections->item($j); + $handle = $connection->getAttributeNode("handle")->getValue; + $to = $connection->getAttributeNode("to")->getValue; + + print_debug("handle " . $handle . "\n"); + print_debug("to " . $to . "\n"); + + if ($handle eq "0") { + $bond_id_start_id{$id} = $to; + } else { + $bond_id_end_id{$id} = $to; + } + } + } + die "There are no bonds!\n" unless keys(%mtt_bond_id_index) > 0; +} + +# if($relax), then this routine will return 'undef' instead of dying, if valid node not found. +sub get_first_subnode_by_nodename_attribute { + my ( $relax, $node, $nodename, $key, $value)= @_; + my ($subnodes,$subnode); + + $subnodes = $node->getChildNodes; + + for my $k (0..$subnodes->getLength-1) { + next if ($subnodes->item($k)->getNodeType != ELEMENT_NODE); + next if ($subnodes->item($k)->getNodeName ne $nodename); + $subnode = $subnodes->item($k); + next if defined($value) && defined($key) && + ($subnode->getAttributeNode($key)->getValue ne $value); + + return $subnode; + } + if($relax) { + return undef; + } else { + die "I found no subnode of " . $node->getNodeName . + " named $nodename with key/value pair: ($key,$value).\n" unless + $subnode->getTagName eq $nodename && + $subnode->getAttributeNode($key)->getValue eq $value; + } +} + +sub get_first_element_subnode { + my ( $node )= @_; + my ($subnodes,$subnode); + + $subnodes = $node->getChildNodes; + + for my $k (0..$subnodes->getLength-1) { + next if ($subnodes->item($k)->getNodeType != ELEMENT_NODE); + $subnode = $subnodes->item($k); + + return $subnode; + } + die " I found no element subnode of " . $node->getNodeName . "." unless + $subnode->getNodeType == ELEMENT_NODE; +} + +sub get_first_text_subnode { + my ( $node )= @_; + my ($subnodes,$subnode); + + $subnodes = $node->getChildNodes; + + for my $k (0..$subnodes->getLength-1) { + next if ($subnodes->item($k)->getNodeType != TEXT_NODE); + $subnode = $subnodes->item($k); + + return $subnode; + } + die " I found no text subnode of " . $node->getNodeName . "." unless + $subnode->getNodeType == TEXT_NODE; +} + +sub id_cleaner { + s/#?([^#]*)#?/$1/; +} + +sub print_debug { + print STDERR $_[0] if ($debug); +} + +sub usage { + return + "\n" . + "Usage: dia2abg.pl --diagram_name [options]\n" . + "Options:\n" . + "\t--dia_input_file \n" . + "\t--dia_output_file \n" . + "\t--component_list_file\n" . + "\t--create_component_list\n" . + "\t--create_ibg\n" . + "\t--debug\n" . + "\t--ibg_file \n" . + "\t--change_flow_causality \n" . + "\t--change_effort_causality \n" . + "\n" . + "\t\tBond causality spec:\n" . + "\t\t 'bond:causality;bond:causality;...'\n" . + "\t\tbond:\n" . + "\t\t [mtt_bond_id|all]\n" . + "\t\tcausality:\n" . + "\t\t [-1|0|1]\n" . + "\n" . + "\t\tCausality is arrow-oriented-causality.\n" . + "\t\tAny causality changes are made BEFORE further processing.\n" . + "\n" +} + ADDED mtt/bin/trans/dir2paths Index: mtt/bin/trans/dir2paths ================================================================== --- mtt/bin/trans/dir2paths +++ mtt/bin/trans/dir2paths @@ -0,0 +1,41 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dir2paths +# Finds paths of all valid MTT examples + +# P.J.Gawthrop Mar 98 +# Copyright (c) P.J.Gawthrop, 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/11/10 17:12:15 peterg +## Removed sorting +## +## Revision 1.1 1998/03/11 10:32:35 peterg +## Initial revision +## +############################################################### + + +dotdot=$2 # Set to ../ if we are in MTT_work + + +# Create paths for all valid examples - ie dir name is system name +find $dotdot$1 -name '*_abg.fig' -print |\ + gawk '{ + N=split($1,name,"/"); + printf("%s", name[1]); + for (i=2;i $1_rep.txt +echo "% Generated by MTT on" `date`. >> $1_rep.txt + +# Create paths for all valid examples - ie dir name is system name +dir2paths $1 $2 | sed 's/Introduction/AAAAA/g' | sort | sed 's/AAAAA/Introduction/g' | \ +gawk '{ + print "mtt -t -d " $1,$2 " rep tex"; + }' >> $1_rep.txt ADDED mtt/bin/trans/dm2fr_m Index: mtt/bin/trans/dm2fr_m ================================================================== --- mtt/bin/trans/dm2fr_m +++ mtt/bin/trans/dm2fr_m @@ -0,0 +1,169 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dm2fr_m + +# Transformation: descriptor matrix to frequency response + +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.15 2003/05/08 18:46:45 gawthrop +## Fixed range bug by using isfield in place of exists +## +## Revision 1.14 2000/05/20 15:35:18 peterg +## Parameterised version +## +## Revision 1.13 1998/09/03 09:12:32 peterg +## Removed debugging lines +## +## Revision 1.12 1998/09/02 12:02:14 peterg +## Added mttinput paramater +## +## Revision 1.11 1998/08/11 13:32:42 peterg +## Lowercase mttLAST etc +## +## Revision 1.10 1998/07/27 20:27:25 peterg +## Now get parameters for simpar file. +## +## Revision 1.9 1998/02/26 15:12:26 peterg +## Removed parameter stuff +## +# Revision 1.8 1996/08/30 14:54:36 peter +# Took back lock. +# +## Revision 1.7 1996/08/24 14:23:00 peter +## Global parameter passing. +## Proper error handling. +# +## Revision 1.6 1996/08/16 14:26:07 peter +## Fixed multi-output bug. +## Made sure that u0 is ok. +## +## Revision 1.5 1996/08/15 16:23:02 peter +## Now uses W in place of w for consistancy with time responses. +## +## Revision 1.4 1996/08/15 11:52:42 peter +## Now creats a number of versions: +## fr complex frequency response +## lmfr log magnitude of fr +## lpfr phase of fr +## nyfr real and imag parts - Nyquist style +## nifr Nichols style. +## +## Revision 1.3 1996/08/11 19:08:08 peter +## Parameter passing now enabled. +## +## Revision 1.2 1996/08/11 09:32:12 peter +## Now takes the numpar parameters correctly +## +## Revision 1.1 1996/08/10 14:11:11 peter +## Initial revision +## +############################################################### + +echo Creating $1_fr.m +echo Creating $1_lmfr.m +echo Creating $1_lpfr.m +echo Creating $1_nyfr.m +echo Creating $1_nifr.m + +#if [ "$2" = "" ]; +#then +# PARAMS='W=logspace(-1,2,100); u0=zeros(nu,1); u0(1)=1;' +# echo Using default parameter $PARAMS +#else +# PARAMS=$2; +#fi + +$MATRIX << EOF > dm2fr_m.log 2>mtt_error.txt + +# Data + mttpar=$1_numpar; + +# Simulation parameters + simpar=$1_simpar; + + [nx,ny,nu,nz,nyz] = $1_def; + + %Defaults + + if (isfield(simpar,"wmin")==0) + simpar.wmin = -1; + end; + + if (isfield(simpar,"wmax")==0) + simpar.wmax = 2 + end; + + if (isfield(simpar,"wsteps")==0) + simpar.wsteps = 100; + end; + + W = logspace(simpar.wmin,simpar.wmax,simpar.wsteps)'; + if (isfield(simpar,"mttinput")==0) + mttinput = 1; + end; + mttu0 = zeros(nu,1); + mttu0(mttinput) = 1; + + [n,m]=size(W); + if m>n + W=W'; + end; + + [n,m]=size(mttu0); + if m>n + mttu0=mttu0'; + end; + + [A,B,C,D,E] = $1_dm(mttpar); + fr = dm2fr(A,B,C,D,E,W,mttu0); + lw = log10(W); + lmfr = log10(abs(fr)); + pfr = angle(fr)*180/pi; + +% Complex frequency response + write_matrix([W fr], "$1_fr"); + +% Log magnitude v log frequency + write_matrix([lw lmfr], "$1_lmfr"); + +% Angle v log frequency + write_matrix([lw pfr], "$1_lpfr"); + +% Nyquist style + re = real(fr); + im = imag(fr); + nyq = [re(:,1) im(:,1)]; + for i = 2:ny + nyq = [nyq re(:,i) im(:,i)]; + end; + write_matrix(nyq, "$1_nyfr"); + +% Nichols style + re = lmfr; + im = pfr; + nic = [im(:,1) re(:,1)]; + for i = 2:ny + nic = [nic im(:,i) re(:,i)]; + end; + write_matrix(nic, "$1_nifr"); + +EOF + +# Now invoke the standard error handling," +mtt_error mtt_error.txt + + + + + + ADDED mtt/bin/trans/dm2ir_m2dat Index: mtt/bin/trans/dm2ir_m2dat ================================================================== --- mtt/bin/trans/dm2ir_m2dat +++ mtt/bin/trans/dm2ir_m2dat @@ -0,0 +1,62 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dat2ps + +# Tramsforms descriptor matrix rep to frequency response dat. + + +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1996/08/11 19:48:29 peter +## Parameter passing added. +## +## Revision 1.2 1996/08/11 10:40:00 peter +## Now handles e and NaN numbers. +## +## Revision 1.1 1996/08/10 14:15:03 peter +## Initial revision +## +############################################################### + +echo Creating $1_ir.dat + +if [ "$2" = "" ]; +then + PARAMS='t=[0:0.1:10]' + echo Using default parameter $PARAMS +else + PARAMS=$2; +fi + + +$MATRIX << EOF | gawk '$1 !~ /[A-MO-Zb-cf-z]/ && NF>0 {print} ' >$1_ir.dat + + $PARAMS; + [n,m]=size(t); + if m>n + t=t'; + end; + + [A,B,C,D,E] = $1_dm($1_numpar); + y = dm2ir(A,B,C,D,E,t); + + [Ny,Nu]=size(D); + NN = Ny*Nu; + + xy = [t y(:,1)]; + for i=2:NN + xy = [xy t y(:,i)]; + end; +xy + +EOF + ADDED mtt/bin/trans/dm2tf_r Index: mtt/bin/trans/dm2tf_r ================================================================== --- mtt/bin/trans/dm2tf_r +++ mtt/bin/trans/dm2tf_r @@ -0,0 +1,89 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dm2tf_r +# Reduce descriptor matrices to transfer function +# P.J.Gawthrop 8th May 1991, Dec 1993, April 1994. +# Copyright (c) P.J.Gawthrop, 1991, 1993, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/03/27 15:00:23 peterg +## reduce ---> symbolic +## +## Revision 1.1 1996/08/25 10:09:55 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_tf.r + +# Remove the old log file +rm -f dm2tf_r.log + +# Use reduce to accomplish the transformation +$SYMBOLIC >dm2tf_r.log << EOF + +%ON FLOAT; + +IN "$1_def.r"; +IN "$1_dm.r"; +IN "$1_subs.r"; + +OFF Echo; +OFF Nat; + +%create sE-A +%MTT_SEA := s*MTTE-MTTA; + +%Find the denominator of the TF - det(sE-A); +%comden := det(MTT_SEA); + +%Find the Adjoint transpose. +%matrix AdjT(MTTNx,MTTNx); +%FOR i := 1:MTTNx DO +% BEGIN +% FOR j := 1:MTTNx DO +% AdjT(i,j) := cofactor(MTT_SEA,i,j); +% END; + +%Adj := TP(AdjT); + +%Find the numerator matrix +%Num := MTTC*Adj*MTTB + MTTD*comden; + + +%Create the transfer function matrix +MTTTF := MTTD; +IF MTTNy>0 THEN MTTTF := MTTTF + (MTTC * ((s*MTTE-MTTA)^-1) * MTTB); + +%MTTTF := Num/comden; + + +OUT "$1_tf.r"; + +%Declare the transfer function matrix +write "matrix MTTTF(", MTTNy, ",", MTTNu, ")$"$ + +%And write it. +%MTTTF := MTTTF; +FOR i := 1:MTTNy DO + BEGIN + FOR j := 1:MTTNu DO + IF MTTTF(i,j) NEQ 0 THEN write "MTTTF(", i, ",", j, ") := ", MTTTF(i,j)$ + END; + +write ";END;"$ +SHUT "$1_tf.r"; + +EOF + +# Now invoke the standard error handling. +mtt_error_r dm2tf_r.log ADDED mtt/bin/trans/dm_r2m Index: mtt/bin/trans/dm_r2m ================================================================== --- mtt/bin/trans/dm_r2m +++ mtt/bin/trans/dm_r2m @@ -0,0 +1,131 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dm_r2m +# Reduce descriptor state-space A,B,C,D and E matrices to Matlab +# P.J.Gawthrop 29th July 1990, 6th Feb 1991, 28 May 1991, Dec 1993, Jan 94 +# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993,1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 1998/04/13 11:01:55 peterg +## Now uses generic header : matlab_header +## +# Revision 1.6 1997/04/16 13:43:29 peterg +# Added matrix dimenensions +# +# Revision 1.5 1997/02/24 14:44:28 peterg +# Ignores numerical parameters in global list. +# +## Revision 1.4 1996/08/24 14:16:25 peter +## Global parameter passing. +## +## Revision 1.3 1996/08/18 12:02:46 peter +## Fixed bug when some matrices are empty. +## +## Revision 1.2 1996/08/12 20:22:20 peter +## Paramaters passed via an internal call to _numpar. +## _args script can overide these parameters - sneaky. +## +## Revision 1.1 1996/08/12 19:09:13 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_dm.m + +# Remove the old log file +rm -f dm_r2m.log + +# Use reduce to accomplish the transformation +reduce >dm_r2m.log << EOF + +ON BigFloat, NumVal; +PRECISION 16; %Compatible with Matlab + +%Read in the definitions file +in "$1_def.r"; + +%Set up the number of argument variables to zero in case the user has forgotten +MTTNVar := 0; + +%Read in the parameter file +%%in "$1_sympar.r"; + +%Read the reduce state-space A,B,C and D matrices file +in "$1_dm.r"; + +IF MTTNvar>0 THEN +BEGIN + write "% Set the parameters"; + write "global ...;;"; + FOR i := 1:MTTNvar DO + BEGIN + IF numberp(MTTVar(i,1)) + THEN + BEGIN + % Do nowt + END + ELSE + BEGIN + write MTTVar(i,1), " ..."; + END; + END; + write " "; +END; + + +%Fortran switches - one line expressions +OFF echo; +ON fort$ +cardno!* := 1$ +fortwidth!* := 100$ +OFF period$ + +MTTN := MTTNx + 2*MTTNz + MTTNyz; +write "MTTA = zeros(", MTTN, ",", MTTN, ");"; +write "MTTB = zeros(", MTTN, ",", MTTNu, ");"; +write "MTTC = zeros(", MTTNy, ",", MTTN, ");"; +write "MTTD = zeros(", MTTNy, ",", MTTNu, ");"; +write "MTTE = zeros(", MTTN, ",", MTTN, ");"; + +OUT "$1_dm.1"; + +ON NERO; % Suppress zero elements. +MTTA := MTTA; +MTTB := MTTB; +MTTC := MTTC; +MTTD := MTTD; +MTTE := MTTE; + +SHUT "$1_dm.1"; + + +EOF + +# Header +matlab_header $1 dm 'A,B,C,D,E'> $1_dm.m + +#Define array sizes. +grep -v 'function' $1_def.m | grep -v '%' >> $1_dm.m +echo 'mtta = zeros(nx+nyz+2*nz,nx+nyz+2*nz);' >> $1_dm.m +echo 'mttb = zeros(nx+nyz+2*nz,nu);' >> $1_dm.m +echo 'mttc = zeros(ny,nx+nyz+2*nz);' >> $1_dm.m +echo 'mttd = zeros(ny,nu);' >> $1_dm.m +echo 'mtte = zeros(nx+nyz+2*nz,nx+nyz+2*nz);' >> $1_dm.m + + +#Code +cat $1_dm.1 >> $1_dm.m + + +rm -f $1_dm.1 + + ADDED mtt/bin/trans/dm_r2tex Index: mtt/bin/trans/dm_r2tex ================================================================== --- mtt/bin/trans/dm_r2tex +++ mtt/bin/trans/dm_r2tex @@ -0,0 +1,163 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: dm_r2tex +# Reduce descriptor matrices to LaTex descriptor matrices. +# P.J.Gawthrop 9 June 1990, 8th July 1990, 14 Feb 1991, 10th May 1991, 4th June 1991 +# Copyright (c) P.J.Gawthrop, 1990, 1991. + +#Inform user +echo Creating $1_dm.tex + +# Remove the old log file +rm -f dm_r2tex.log + +# Use reduce to accomplish the transformation +reduce >dm_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the symbolic parameters file +%%in "$1_sympar.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Number of descriptor variables +MTTN := MTTNx + 2*MTTNz + MTTNyz; + +%Read the descriptor matrices file +in "$1_dm.r"; + +OFF Echo; +OFF Nat; + +OUT "$1_dm.tex"; + +%Write out the descriptor matrices. +write "%Descriptor matrices $1"; +write "%File: $1_dm.tex"; +write""; + +write "%Descriptor matrices"; + +%IF (MTTNz+MTTNyz) NEQ 0 THEN +%BEGIN +% write "% - E matrix"; +% write "\begin{equation}"; +% write "MTTE = MTTI_0(", MTTNx+MTTNz, ",", MTTNz+MTTNyz, ")"; +% write "\end{equation}"; +%END; + + +IF MTTN NEQ 0 THEN +IF (MTTNz+MTTNyz) > 0 THEN +BEGIN +write "% - E matrix"; +write "\begin{equation}"; +write "MTTE = \begin{pmatrix}"; + FOR Row := 1:MTTN DO + BEGIN + FOR Col := 1:MTTN DO + BEGIN + Write "{", MTTE(Row,Col), "}"; + IF Col doc2dvi.log +bibtex $system >> doc2dvi.log +latex $system.doc >> doc2dvi.log +latex $system.doc >> doc2dvi.log + +if [ "$documenttype" = "book" ]; then + makeindex $system >> doc2dvi.log +else + touch $system.ind +fi + +latex $system.doc >> doc2dvi.log +latex $system.doc >> doc2dvi.log + +# Make sure transformation succeeeds +exit 0 ADDED mtt/bin/trans/doc2pdf Index: mtt/bin/trans/doc2pdf ================================================================== --- mtt/bin/trans/doc2pdf +++ mtt/bin/trans/doc2pdf @@ -0,0 +1,43 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: doc2pdf +# Converts doc file to pdf file + +# Copyright (c) P.J.Gawthrop 1998 + + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## +############################################################### + +system=$1 +documenttype=$2 + +# Inform user +echo "Creating $system.pdf" + +#Run pdflatex , bibtex and makeindex +pdflatex $system.doc > doc2pdf.log +bibtex $system >> doc2pdf.log +pdflatex $system.doc >> doc2pdf.log +pdflatex $system.doc >> doc2pdf.log + +if [ "$documenttype" = "book" ]; then + makeindex $system >> doc2pdf.log +else + touch $system.ind +fi + +pdflatex $system.doc >> doc2pdf.log +pdflatex $system.doc >> doc2pdf.log + +# Make sure transformation succeeeds +exit 0 ADDED mtt/bin/trans/doc2ps Index: mtt/bin/trans/doc2ps ================================================================== --- mtt/bin/trans/doc2ps +++ mtt/bin/trans/doc2ps @@ -0,0 +1,43 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: doc2dvi +# Converts doc file to dvi file + +# Copyright (c) P.J.Gawthrop 1998 + + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 1999/11/02 07:56:46 peterg +## Removed documenttype in blurb +## +## Revision 1.3 1998/11/24 12:03:27 peterg +## Indexing of book docs. +## +## Revision 1.2 1998/04/15 18:40:43 peterg +## Run LateX three times +## +## Revision 1.1 1998/03/03 08:35:50 peterg +## Initial revision +## +############################################################### + +system=$1 +documenttype=$2 + +# Inform user +echo "Creating $system.ps" + +doc2dvi $system $documenttype + +dvips -o $system.ps $1 + +# Make sure transformation succeeeds +exit 0 ADDED mtt/bin/trans/ese2rdae_r Index: mtt/bin/trans/ese2rdae_r ================================================================== --- mtt/bin/trans/ese2rdae_r +++ mtt/bin/trans/ese2rdae_r @@ -0,0 +1,294 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ese2rdae_r +# Reduce equations to raw differential-algebraic equation conversion +# P.J.Gawthrop 8th May 1991, May 1994, June 1996 +# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.14 2002/08/30 15:39:04 geraint +## Read fix_c.r before ese.r and explicitly overload ** operator with pow(). +## These changes are required for the Codemist version of Reduce. +## +## Revision 1.13 2002/06/28 10:13:40 geraint +## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. +## +## Revision 1.12.2.2 2002/06/05 17:28:00 geraint +## Cosmetic change. +## +## Revision 1.12.2.1 2002/06/05 11:14:51 geraint +## ae.r now generated using def2write_r like cse?.r +## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r. +## +## These changes produce the desired result (optimised algebraic equations) but +## have highlighted a problem; when optimisation fails, Reduce does not write +## a result. For complicated systems, this can lead to missing assignments in +## the resultant code. +## +## Revision 1.12 2001/07/23 23:31:17 gawthrop +## Added -cr option to load CRs first - avoids alg. loops with R +## implementation of mutiports. +## +## Revision 1.11 2001/07/06 00:46:50 gawthrop +## Added -cr option -- forces cr to be loaded before the ese.r file +## This avoids causality problems when using multi-port Rs to represent +## arbitary equations +## +## Revision 1.10 2000/11/30 15:23:16 peterg +## Taken out all subsystem stuff - now done in mtt using +## mtt_make_subsystems +## +## Revision 1.9 2000/09/07 12:18:31 peterg +## Prettified layout of this file +## +## Revision 1.8 2000/09/07 12:07:26 peterg +## *** empty log message *** +## +## Revision 1.7 2000/09/01 13:34:15 peterg +## Exit on option error +## +## Revision 1.6 2000/09/01 13:30:32 peterg +## Added -partition switch +## +## Revision 1.5 2000/09/01 12:14:57 peterg +## Added connecti9ng inputs +## +## Revision 1.4 1998/04/07 15:06:46 peterg +## Correct log file name +## +## Revision 1.3 1998/03/07 12:57:19 peterg +## Fixed logname bug +## +## Revision 1.2 1998/03/07 12:51:20 peterg +## This is the new version of ese2dae - it does not do the CRs at this +## stage to give reduce an easier time. +## +## rese2ese_r does the constitutive relationship bit +## +## Revision 1.1 1998/03/07 12:49:31 peterg +## Initial revision +## +## Revision 1.12 1998/01/31 16:22:59 peterg +## Added IF MTTNx>0 THEN and IF MTTNy>0 THEN before the relevant +## assignements of MTTdX and MTTY to themselves. +## +## Revision 1.11 1997/09/18 09:45:08 peterg +## Canged the comment about linux reduce -- reduce reads this for some +## reason. +## +## Revision 1.10 1997/09/15 14:21:18 peterg +## Reads ese file twice to avoid a bug in Linux reduce !!!??? +## +## Revision 1.9 1997/08/30 09:59:31 peterg +## Changed mehtod of writing out mtty to avoid a strange segmentation violation. +## Now uses MTTY := MTTY; approach. +## +## Revision 1.8 1997/04/23 09:31:20 peterg +## Now reads in the (top level) def file in the generated reduce code. +## +# Revision 1.7 1997/04/23 09:23:15 peterg +# Two argument version in preparation for heirarchical version +# +# Revision 1.6 1996/11/21 15:47:48 peterg +# Now inputs _params.r not _sympar.r +# +## Revision 1.5 1996/11/02 10:17:35 peterg +## Removed default constitutive relationship input. +## +# Revision 1.4 1996/09/12 12:10:05 peter +# Now reads the default constitutive relationship file. +# +## Revision 1.3 1996/08/25 09:43:26 peter +## General error handling. +## +## Revision 1.2 1996/08/25 08:31:28 peter +## Error handling added. +## +############################################################### + + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info;; + -cr ) + load_cr=yes; + blurb2=' using cr and subs first'; + ;; + -fixcc ) + include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` + blurb3='fixing c and cc code'; + ;; + -partition ) + partition=yes; + blurb='with partitioning'; + ;; + -sort ) + sort=sort; + blurb1='using sorted equations'; + ;; + *) + echo "$1 is an invalid argument - ignoring"; + exit ;; + esac + shift +done + +#Create the top-level system name +topname=$1 + +#Create the system names +if [ -z "$2" ]; + then + sysname=$topname; + else + sysname=$1_$2; +fi + +defname=$topname"_def.r" +crname=$topname"_cr.r" +subsname=$topname"_subs.r" +paramname=$topname"_params.r" +daename=$sysname"_rdae.r" + +if [ -n "$sort" ]; then + esename=$sysname"_sese.r" +else + esename=$sysname"_ese.r" +fi + +logname=ese2rdae.log + +if [ -n "${load_cr}" ]; then + load_cr_comm="in \"${crname}\";" + load_subs_comm="in \"${subsname}\";" +fi + +# Inform user +echo Creating $daename $blurb $blurb1 $blurb2 $blurb3 + +# Remove the old log file +rm -f $logname + +# Use symbolic algebra to accomplish the transformation +$SYMBOLIC >$logname << EOF + +%Read in the cr and sub when -cr is set +$load_cr_comm +$load_subs_comm + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + +% Definitions +in "$defname"; + +% Fix c code if required +$include + +% Elementary system equations +in "$esename"; + +OFF Echo; +OFF Nat; + +%Create the output file +OUT "$daename"; + +write "in ""$defname"""; + +% State +MTT_Matrix := MTTdX$ +MTT_Matrix_name := "MTTdX"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Nonstate +MTT_Matrix := MTTZ$ +MTT_Matrix_name := "MTTZ"$ +MTT_Matrix_n := MTTNz$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Output +MTT_Matrix := MTTy$ +MTT_Matrix_name := "MTTy"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Zero outputs +MTT_Matrix := MTTYz$ +MTT_Matrix_name := "MTTYz"$ +MTT_Matrix_n := MTTNyz$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + + +SHUT "$daename"; +quit; + +EOF + +#if [ -n "$partition" ]; then +# rm -f mtt_junk +# # Now for the subsystems +# # Find subsystems +# subsystems=`mtt_get_subsystems $1` +# +# for subsystem in $subsystems; do +# echo Doing $subsystem +# ucname="MTT_"$subsystem"_uc" +# +# Nu=`mtt_getsize -internal $subsystem u` +# echo Nu $Nu +# +# # Use symbolic algebra to accomplish the transformation +# $SYMBOLIC >$logname << EOF +# +# %Read the formatting function +# in "$MTTPATH/trans/reduce_matrix.r"; +# +# % Definitions +# in "$defname"; +# +# % Elementary system equations +# in "$esename"; +# +# OFF Echo; +# OFF Nat; +# +# %Create the output file +# OUT "mtt_junk"; +# % Connecting inputs +# MTT_Matrix := $ucname $ +# MTT_Matrix_name := "$ucname" $ +# MTT_Matrix_n := $Nu $ +# MTT_Matrix_m := 1$ +# Reduce_Matrix()$ +# +# shut "mtt_junk"; +#EOF +# echo >> $1_rdae.r +# echo %Connections for subsystem $subsystem >> $1_rdae.r +# echo >> $1_rdae.r +# +# cat mtt_junk >> $1_rdae.r +# rm -rf mtt_junk +# done +#fi + +echo "END;" >> $1_rdae.r + +# Now invoke the standard error handling. +mtt_error_r $logname + ADDED mtt/bin/trans/ese_r2txt.pl Index: mtt/bin/trans/ese_r2txt.pl ================================================================== --- mtt/bin/trans/ese_r2txt.pl +++ mtt/bin/trans/ese_r2txt.pl @@ -0,0 +1,13 @@ +#! /usr/bin/perl -w + +use strict; + +$/ = ';'; # statements are terminated by ; +while () { + chomp; + s/%.*\n//g; # strip comments (% to end of line) + s/(\s)*//g; # strip whitespace + s/^END$//; # strip junk + next if /^(\s)*$/; # skip blank lines + printf ("%s\n", $_); # print what remains +} ADDED mtt/bin/trans/ese_tidy Index: mtt/bin/trans/ese_tidy ================================================================== --- mtt/bin/trans/ese_tidy +++ mtt/bin/trans/ese_tidy @@ -0,0 +1,29 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +# Bourne shell script: ese_tidy +# Tidies up Matlab format files +# P.J.Gawthrop May 1998 +# Copyright (c) P.J.Gawthrop, 1990, 1994, 1995. + +#Puts the state & output equations at the end of the file + +grep -v '^MTT' $1_ese.r>junk1 +grep '^MTT' $1_ese.r>junk2 +echo 'END;' >junk3 +cat junk1 junk2 junk3> $1_ese.r + + + + ADDED mtt/bin/trans/ese_txt2make.pl Index: mtt/bin/trans/ese_txt2make.pl ================================================================== --- mtt/bin/trans/ese_txt2make.pl +++ mtt/bin/trans/ese_txt2make.pl @@ -0,0 +1,205 @@ +#! /usr/bin/perl -w +# +# ese_txt2make.pl - sorts equations using Make +# Copyright (C) 2004 Geraint Paul Bevan +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# -------------------------- +# Model Transformation Tools +# -------------------------- +# +# Creates a makefile from the elementary system equations +# Executing the makefile causes make to sort the equations +# +#------------------------------------------------------------------------------- + +use strict; +use Getopt::Long; + +my %dependencies; # left-values right-dependencies +my %expressions; # left-values right-expression + +my $sys = ''; +my $debug = 0; +my $infile = ''; +my $outfile = ''; + +GetOptions ('sys=s' => \$sys, + 'debug' => \$debug, + 'infile=s' => \$infile, + 'outfile=s' => \$outfile); + +# default file names +$infile = "${sys}_ese.txt" if ($infile eq ''); +$outfile = "${sys}_ese.make" if ($outfile eq ''); + +#------------------------------------------------------------------------------- +# main +#------------------------------------------------------------------------------- + +if ($debug) { + my $logfile = "ese_txt2make_${sys}.log"; + open (LOG, ">$logfile") or die ("MTT: ese_txt2make, cannot open $logfile"); +} + +# First the elementary system equations are read +# and placed in the "expressions" hash. +read_ese_txt (); + +# Then the occurence of any lvalue in the expression +# of any other is sought. +get_dependencies (); + +# Finally the expressions are written to a makefile +# where the targets are the left hand values and the +# pre-requisites are the dependencies +write_make ($sys); + +close (LOG) if ($debug); + +#------------------------------------------------------------------------------- +# subroutines +#------------------------------------------------------------------------------- +sub read_ese_txt { + + open (ESE, $infile) + or die ("MTT Error:\nese_txt2make, cannot open $infile\n"); + + while () { + + chomp; + + # separate the left and right side of equations + # and assign them to the expressions hash + my ($lvar,$expr) = split (/:=/); + $expressions{$lvar} = $expr; + + print LOG "$lvar\t= $expressions{$lvar}\n" if $debug; + } + + close (ESE); +} +#------------------------------------------------------------------------------- +sub get_dependencies { + + # compare the pattern to each expression + foreach my $lvar (keys %expressions) { + $dependencies{$lvar} = ""; + $_ = $expressions{$lvar}; + for my $lvar2 (keys %expressions) { + if ($expressions{$lvar} =~ /$lvar2/) { + # a left value has been found in the expression + # add it to the dependencies for this lvar + $dependencies{$lvar} = "$dependencies{$lvar} $lvar2"; + } + } + print LOG "$lvar:\t$dependencies{$lvar}\n" if $debug; + } +} +#------------------------------------------------------------------------------- +sub write_make { + + # create lists of rates, states and tmpvars so that + # separate rules can be created in the makefile + my @list_of_rates; + my @list_of_outputs; + my @list_of_unknown; + my @list_of_nonstates; + my @list_of_tmpvars; + + for my $lvar (sort (keys %expressions)) { + if ($lvar =~ /^MTTdX\(/) { + @list_of_rates = (@list_of_rates, $lvar) ; + } elsif ($lvar =~ /^MTTy\(/) { + @list_of_outputs = (@list_of_outputs, $lvar); + } elsif ($lvar =~ /^MTTyz/) { + @list_of_unknown = (@list_of_unknown, $lvar); + } elsif ($lvar =~ /^MTTz/) { + @list_of_nonstates = (@list_of_nonstates, $lvar); + } elsif ($lvar =~ /^${sys}_/) { + @list_of_tmpvars = (@list_of_tmpvars, $lvar); + } else { + die "MTT Error:\nese_txt2make, unclassified variable: $lvar\n"; + } + } + my @sorted_rates = sort (@list_of_rates); + my @sorted_outputs = sort (@list_of_outputs); + my @sorted_unknown = sort (@list_of_unknown); + my @sorted_nonstates = sort (@list_of_nonstates); + my @sorted_tmpvars = sort (@list_of_tmpvars); + + + # write the header + open (ESE, ">$outfile") or + die ("MTT Error:\nese_txt2make, cannot open $outfile\n"); + + my $date = localtime; + + print ESE + "# $outfile\t-*-makefile-*-\n" . + "#\n"; + + print ESE + "#\t\t--------------------------\n" . + "#\t\tModel Transformation Tools\n" . + "#\t\t--------------------------\n" . + "#\n" . + "# Created by MTT: $date\n\n"; + + # write the rules that external programs use + print ESE + "all: declare_tmpvars MTTdX MTTy\n\n" . + "MTTdX: @sorted_rates\n\n" . + "MTTy: @sorted_outputs\n\n" . + "MTTyz: @sorted_unknown\n\n" . + "MTTz: @sorted_nonstates\n\n"; + + # set the default output format: + # double tmpvar; + # lvalue := expression; + print ESE + "# default output format\n" . + "ifeq (\"\$(assignment)\",\"\")\n" . + "assignment=:=\n" . + "endif\n\n" . + "ifeq (\"\$(declaration)\",\"\")\n" . + "declaration=double\n" . + "endif\n\n" . + "ifeq (\"\$(terminator)\",\"\")\n" . + "terminator=;\n" . + "endif\n\n"; + + # write a rule to declare the temporary variables + print ESE + "# declare temporary variables\n" . + "declare_tmpvars:\n"; + for my $var (@sorted_tmpvars) { + print ESE "\t\@echo \"\$(declaration) $var \$(terminator)\"\n"; + } + print ESE "\n"; + + # write the equations + print ESE "# the equations\n"; + for my $lvar (sort (keys %expressions)) { + print ESE "$lvar: $dependencies{$lvar}\n"; + print ESE "\t\@echo \"$lvar \$(assignment) " . + "$expressions{$lvar} \$(terminator)\"\n\n"; + } + print ESE "\n"; + + close (ESE); +} +#------------------------------------------------------------------------------- ADDED mtt/bin/trans/examples_txt2tk Index: mtt/bin/trans/examples_txt2tk ================================================================== --- mtt/bin/trans/examples_txt2tk +++ mtt/bin/trans/examples_txt2tk @@ -0,0 +1,45 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: examples_txt2tk +# Creates tk/tcl file for xmtt. +# Copyright (c) P.J.Gawthrop, 1998,1999 + + +# Examples menu +gawk 'BEGIN{ + basemenu=".exam.exam" + oldmenu=basemenu + OLDPATH=""; + } + { + if (NF>1){ + PATH=$1; + N=split(PATH,path,"/"); # Find current example path + oldN=split(OLDPATH,oldpath,"/"); # Find last example path + same=1; menu=basemenu; + while ((path[same]==oldpath[same])&&(same<=N)){ + menu=menu"."tolower(path[same]) + same++ + } + oldmenu=menu + for (i=same;i> $1.fig < ${log} 2> ${err} </dev/null + if [ $? = "0" ]; then + grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\ + gawk '{ + printf("mtt_units.sh %s %s %s %s %s\n", sys, $2, $3, $4, $5) + }' sys=${sys} | sh | grep ERROR + if [ $? = "0" ]; then + echo " " *MTT_ERROR: domains and units are not OK - exiting + exit 1 + else + echo " " domains and units are OK + fi + else + echo " no domains or units declared" + fi +} + +check_ports_exist() +{ + declared_ports=`grep '^[\s]*[#|%]UNITS' < ${lbl_file} | gawk '{print $2}'` + for declared_port in $declared_ports; do + grep "${sys}\.ports\.${declared_port}\.type" ${abg_file} >/dev/null + if [ $? = "1" ]; then + echo "*MTT_ERROR: Units declared for non-existent port ${declared_port}" + exit 1 + fi + done +} + +set_units() +{ + grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\ + gawk '{ + printf(" %s.ports.%s.domain = \"%s\";\n", sys, $2, $3); + printf(" %s.ports.%s.units.effort = \"%s\";\n", sys, $2, $4); + printf(" %s.ports.%s.units.flow = \"%s\";\n", sys, $2, $5); + }' sys=${sys} +} + +if [ -z "$units" ]; then + echo Checking port domains and units + check_ports_exist; + test_units; + echo "## Port domain and units" >> ${abg_file} + set_units >> ${abg_file} +fi + +# Append any VAR declarations +if [ -f "$1_lbl.txt" ]; then + echo "## Explicit variable declarations" >> ${abg_file} + grep '^[\s]*[%|#][V|P]AR' $1_lbl.txt | tr '%' '#' >> ${abg_file} + grep '^[\s]*[%|#]NOT[V|P]AR' $1_lbl.txt | tr '%' '#' >> ${abg_file} +fi + +# Close off the function +echo "endfunction" >> ${abg_file} + +# Errors and info +if [ "$info" = "info" ]; then + cat mtt_info.txt +fi + +if mtt_error mtt_error.txt; then + exit 0 +else + exit 1 +fi ADDED mtt/bin/trans/icd2ICD_txt22txt.sh Index: mtt/bin/trans/icd2ICD_txt22txt.sh ================================================================== --- mtt/bin/trans/icd2ICD_txt22txt.sh +++ mtt/bin/trans/icd2ICD_txt22txt.sh @@ -0,0 +1,31 @@ +#! /bin/sh + +sys=$1 +icd=${sys}_*_icd.txt2 +ICD=${sys}_ICD.txt + +echo Creating ${ICD} + +# lbl.txt ICD Format: +# [#|%]ICD PortName EffortName,EffortUnit;FlowName,FlowUnit +# $1 $2 $3 +# Comma / Semi-colon distinction unenforced + +# icd.txt Format +# PortName EffortName,EffortUnit;FlowName,FlowUnit input|output,input|output +# $1 $2 $3 $4 $5 $6 $7 + +cat < ${ICD} +## Interface Control Definition for System ${sys} +## ${ICD}: Generated by MTT `date` + +EOF + +cat ${icd} |\ + sed 's/[\,\;]/\ /g' |\ + gawk ' + ($2 != "null" && $6 == "input") { printf ("Input: %-30s %-30s Causality: Effort Units: %s\n", $2, $1, $3) } + ($4 != "null" && $7 == "input") { printf ("Input: %-30s %-30s Causality: Flow Units: %s\n", $4, $1, $5) } + ($2 != "null" && $6 == "output") { printf ("Output: %-30s %-30s Causality: Effort Units: %s\n", $2, $1, $3) } + ($4 != "null" && $7 == "output") { printf ("Output: %-30s %-30s Causality: Flow Units: %s\n", $4, $1, $5) } + ' | sort >> ${ICD} ADDED mtt/bin/trans/icd_txt2m.sh Index: mtt/bin/trans/icd_txt2m.sh ================================================================== --- mtt/bin/trans/icd_txt2m.sh +++ mtt/bin/trans/icd_txt2m.sh @@ -0,0 +1,18 @@ +#! /bin/sh + +# Inform user +echo Creating $1_icd.m + +#Create the component ICD file complete with headers. +echo "function icd = $1_icd" > $1_icd.m +echo "%% Component icd file ($1_icd.m)" >> $1_icd.m +echo "%% Generated by MTT at `date`" >> $1_icd.m + +#Write out the variables +gawk '{ + if (NF==2) {i++; print "icd."$1 "\t = \""$2"\";"} + + } + END{ + if (i==0) print "icd = 0;" + }' $1_icd.txt >> $1_icd.m ADDED mtt/bin/trans/ker_r2tex Index: mtt/bin/trans/ker_r2tex ================================================================== --- mtt/bin/trans/ker_r2tex +++ mtt/bin/trans/ker_r2tex @@ -0,0 +1,61 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ker_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. +# Copyright (C) 2001 by Peter J. Gawthrop + + +# Inform user +echo Creating $1_ker.tex + +# Remove the old log file +rm -f ker_r2tex.log + +# Use reduce to accomplish the transformation +reduce >ker_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the constrained-state matrices file +in "$1_ker.r"; + +%Read the symbolic parameters file +%%in "$1_sympar.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; + +MATRIX MTT_Matrix(MTTNy-MTTNu,MTTNy); + +OUT "$1_ker.tex"; + +%Write out the kernel matrix +write "%Kernel matrices $1"; +write "%File: $1_ker.tex"; +write""; + +MTT_Matrix := MTTR$ +MTT_Matrix_name := "MTTR"$ +MTT_Matrix_n := MTTNy-MTTNu$ +MTT_Matrix_m := MTTNy$ +LaTeX_Matrix()$ + +SHUT "$1_ker.tex"; +quit; +EOF ADDED mtt/bin/trans/labg_fig2ps Index: mtt/bin/trans/labg_fig2ps ================================================================== --- mtt/bin/trans/labg_fig2ps +++ mtt/bin/trans/labg_fig2ps @@ -0,0 +1,12 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: labg_fig2ps + +# Eps figures from labg rep. +echo Creating $1.ps +fig2ps --nogv --forcespecial --add=$MTT_LIB/latex/bg $1.fig >/dev/null + ADDED mtt/bin/trans/landscape2portrait.sh Index: mtt/bin/trans/landscape2portrait.sh ================================================================== --- mtt/bin/trans/landscape2portrait.sh +++ mtt/bin/trans/landscape2portrait.sh @@ -0,0 +1,28 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: landscape2portrait.sh +# Converts one or more figure files from landscape mode to portrait mode + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ############################################################### + +# Copyright (C) 2001 by Peter J. Gawthrop + +figfiles=$* + +for figfile in $figfiles; do + count=`grep -c Landscape $figfile` + if [ "$count" = "1" ]; then + echo Converting $figfile + mv $figfile ${figfile}.bak + sed 's/Landscape/Portrait/'< ${figfile}.bak > $figfile + fi +done ADDED mtt/bin/trans/lang_header Index: mtt/bin/trans/lang_header ================================================================== --- mtt/bin/trans/lang_header +++ mtt/bin/trans/lang_header @@ -0,0 +1,243 @@ +#!/bin/sh + +# Generates function header for a computer language +# PJ Gawthrop May 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.11 2000/05/11 08:03:02 peterg +## Remove the mtt no global stuff +## +## Revision 1.10 2000/04/18 11:14:32 peterg +## - parameters option +## +## Revision 1.9 2000/04/08 10:23:38 peterg +## Added -noglobal option +## +## Revision 1.8 1999/02/16 04:14:53 peterg +## Small change to modeline generation +## +## Revision 1.7 1999/01/20 22:19:21 peterg +## Puts emacs mode line at top of .m files +## +## Revision 1.6 1998/07/27 20:30:39 peterg +## Mods for dm rep - no globals ... +## +## Revision 1.5 1998/07/25 20:42:30 peterg +## No assignements for switch either +## +## Revision 1.4 1998/07/25 10:43:10 peterg +## No assignments of x or u if sm rep. +## +## Revision 1.3 1998/07/19 15:52:15 peterg +## Don't call the _input function - make it external from now on ... +## +## Revision 1.2 1998/05/24 12:47:39 peterg +## This still needs worjk doing for c generation!! +## +## Revision 1.1 1998/05/23 16:17:40 peterg +## Initial revision +## +############################################################### + +# Args +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -noglobals) + noglobals=noglobals; + ;; + -parameters) + parameters=parameters; + ;; + *) + echo $1 is an unknown option + exit;; + esac + shift +done + +# Set up the language specific stuff +system=$1 +rep=$2 +language=$3 +args=$4 +output=$5 +extras=$6 + +case $language in + m) + modeline='% -*-octave-*- Put Emacs into octave-mode%'; + ext='m'; + Lc='#'; + Rc='#'; + Lb='('; + Rb=')'; + ;; + p) + modeline='% -*-octave-*- Put Emacs into octave-mode%'; + ext='m'; + Lc='#'; + Rc='#'; + Lb='['; + Rb=']'; + ;; + c) + ext='c'; + Lc='/*'; + Rc='*/'; + Lb='['; + Rb=']'; + ;; + java) + ext='java'; + Lc='/*'; + Rc='*/'; + Lb='['; + Rb=']'; + ;; + *) + echo Language $language not supported - sorry; exit 1 +esac + + +######### Octave (matlab) code +if [ "$language" = m ]; then +cat <1 THEN +% BEGIN +% FOR col := 1:MTT_Matrix_m DO +% BEGIN +% IF (row EQ 1) AND (col EQ 1) THEN DELAYOPTS; +% INAME(mtt_o); % Set temp name +% %SETLENGTH(2); % Adjust optimisation +% gentran declare mtt_matrix_element:REAL; +% gentran declare mtt_matrix:REAL; +% mtt_matrix_element := mtt_matrix(row,col); +% GENTRAN mtt_matrix(row,col) ::=: mtt_matrix_element; +% IF (row EQ MTT_matrix_n) AND (col EQ MTT_Matrix_m) THEN MAKEOPTS; +% END; +% END +% ELSE +% BEGIN +% IF (row EQ 1) THEN DELAYOPTS; +% INAME(mtt_o); % Set temp name +% GENTRAN mtt_matrix(row) ::=: mtt_matrix(row,1); +% IF (row EQ MTT_matrix_n) THEN MAKEOPTS; +% END; +% END +END; + +END;; + + ADDED mtt/bin/trans/latex_equations.r Index: mtt/bin/trans/latex_equations.r ================================================================== --- mtt/bin/trans/latex_equations.r +++ mtt/bin/trans/latex_equations.r @@ -0,0 +1,75 @@ +% Reduce file to generate equations +% Copyright (C) 2000 by Peter J. Gawthrop + +PROCEDURE latex_equations; +BEGIN +IF MTTNx>0 THEN +BEGIN + write"\begin{equation}"$ + write"\begin{aligned}"$ + FOR Row := 1:MTTNx DO + BEGIN + write "\dot MTTX", Row, " &= "$ + write "{"$ + write MTTdx(Row,1)$ + write "}"$ + IF Row0 THEN +BEGIN + write"\begin{equation}"$ + write"\begin{aligned}"$ +FOR Row := 1:MTTNz DO + BEGIN + write "MTTz", Row, " &= "$ + write "{"$ + write MTTz(Row,1)$ + write "}"$ + IF Row0 THEN +BEGIN + write"\begin{equation}"$ + write"\begin{aligned}"$ +FOR Row := 1:MTTNyz DO + BEGIN + write "0 &= "$ + write "{"$ + write MTTyz(Row,1)$ + write "}"$ + IF Row0 THEN +BEGIN + write"\begin{equation}"$ + write"\begin{aligned}"$ +FOR Row := 1:MTTNy DO + BEGIN + write "MTTy", Row, " &= "$ + write "{"$ + write MTTy(Row,1)$ + write "}"$ + IF Row0 THEN + IF MTT_Matrix_m>0 THEN + BEGIN + write "\begin{equation}"; + write MTT_Matrix_name, " = \begin{pmatrix}"; + FOR Row := 1:MTT_Matrix_n DO + BEGIN + FOR Col := 1:MTT_Matrix_m DO + BEGIN + write "{", MTT_Matrix(Row,Col), "}"; + IF Col0 THEN + IF MTT_Matrix_m>0 THEN + BEGIN + FOR Row := 1:MTT_Matrix_n DO + BEGIN + FOR Col := 1:MTT_Matrix_m DO + BEGIN + MTT_element := MTT_Matrix(Row,Col); + IF MTT_element NEQ 0 THEN + BEGIN + write "\begin{equation}"; + write MTT_Matrix_name, "_", Row, Col, " = {", MTT_element, "}\cr"; + write "\end{equation}"; + END; + END; + END; + END; +END; +END; + +END;; ADDED mtt/bin/trans/latex_matrix_no.r Index: mtt/bin/trans/latex_matrix_no.r ================================================================== --- mtt/bin/trans/latex_matrix_no.r +++ mtt/bin/trans/latex_matrix_no.r @@ -0,0 +1,83 @@ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%% Model Transformation Tools %%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Reduce function to write matrices in latex form +% P.J.Gawthrop January 22 1998 +% Copyright (c) P.J.Gawthrop, 1998 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Version control history +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% $Id$ +%% $Log$ +%% Revision 1.7 2000/11/02 14:28:08 peterg +%% and up to 10 ... +%% +%% Revision 1.6 2000/10/10 21:02:42 peterg +%% *** empty log message *** +%% +%% Revision 1.5 2000/08/09 10:41:39 peterg +%% Changed criterion form 3 to 5 +%% +%% Revision 1.4 1998/11/10 14:15:36 peterg +%% Now does matrix style for m<3 +%% +%% Revision 1.3 1998/03/14 11:07:09 peterg +%% Removed comma from array subscript +%% +%% Revision 1.2 1998/02/25 22:11:28 peterg +%% Added big matrix version +%% +%% Revision 1.1 1998/01/22 09:59:36 peterg +%% Initial revision +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +PROCEDURE Latex_Matrix; +BEGIN +IF MTT_Matrix_m<10 THEN %% Do matrix style version +BEGIN + IF MTT_Matrix_n>0 THEN + IF MTT_Matrix_m>0 THEN + BEGIN + write "\begin{equation}"; + write MTT_Matrix_name, " = \begin{matrix}"; + FOR Row := 1:MTT_Matrix_n DO + BEGIN + FOR Col := 1:MTT_Matrix_m DO + BEGIN + write "{", MTT_Matrix(Row,Col), "}"; + IF Col0 THEN + IF MTT_Matrix_m>0 THEN + BEGIN + FOR Row := 1:MTT_Matrix_n DO + BEGIN + FOR Col := 1:MTT_Matrix_m DO + BEGIN + MTT_element := MTT_Matrix(Row,Col); + IF MTT_element NEQ 0 THEN + BEGIN + write "\begin{equation}"; + write MTT_Matrix_name, "_", Row, Col, " = {", MTT_element, "}\cr"; + write "\end{equation}"; + END; + END; + END; + END; +END; +END; + +END;; ADDED mtt/bin/trans/latex_tidy Index: mtt/bin/trans/latex_tidy ================================================================== --- mtt/bin/trans/latex_tidy +++ mtt/bin/trans/latex_tidy @@ -0,0 +1,186 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: latex_tidy +# Tidies up LaTex format files +# P.J.Gawthrop 12 June 1990, Dec 1994 +# Copyright (c) P.J.Gawthrop, 1990, 1994 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.24 2003/08/17 11:35:45 gawthrop +## Zapped ^ to uparrow conversion. +## +## Revision 1.23 2003/08/17 11:35:07 gawthrop +## Fixed problem with parentheses +## +## Revision 1.22 2002/09/26 08:33:54 geraint +## Removed comma from pattern so that braces are places around each argument +## of a function call. Added greek letter nu as a special variable. +## +## Revision 1.21 2002/08/21 18:11:15 geraint +## Replaced |x| with |{x}|. LaTeX now renders abs(fractions) correctly. +## +## Revision 1.20 2002/08/20 19:33:21 geraint +## Minor bug fixes and enhancements (I hope): +## +## Delimited expressions within function calls to prevent denominators from continuing beyond commas. +## Allow latex to adjust size of parentheses according to expression within. +## Replaced ^ with \uparrow (less misleading - latex maths doesn't understand operator precedence or words). +## Replaced abs(x) with |x| when x does not contain brackets. +## +## Revision 1.19 2002/08/19 14:37:05 geraint +## Fixed eta, beta, theta, Theta and zeta. +## +## Revision 1.18 2001/06/11 19:43:50 gawthrop +## MTT is now much more sophisticated in generating lbl files +## Labels can contain maths +## Repetative components are now broken +## +## Revision 1.17 2000/12/28 12:31:15 peterg +## *** empty log message *** +## +## Revision 1.16 2000/10/10 21:03:20 peterg +## *** empty log message *** +## +## Revision 1.15 1998/04/07 08:44:11 peterg +## zapped eta - it messes up theta +## +## Revision 1.14 1998/02/25 22:12:07 peterg +## Added , to regexp for subscripts +## +## Revision 1.13 1998/02/18 09:06:07 peterg +## Added dX0 +## +## Revision 1.12 1998/02/09 14:11:08 peterg +## Added ctf --> D(s) +## +## Revision 1.11 1998/01/30 15:15:14 peterg +## Sorted out superscript problem +## +# Revision 1.10 1997/08/19 10:38:26 peterg +# Added pi to the list +# +## Revision 1.9 1997/02/24 13:02:17 peterg +## Added gamma and delta transformations +## +## Revision 1.8 1996/12/31 16:14:53 peterg +## Now handles multi-character subscripts. +## +## Revision 1.7 1996/12/19 10:24:29 peterg +## Uniform conversion of mttxi --> x_{i} for x,u,y and z +## Convert ???mttx to mtt x for x,u,y and z +## +## Revision 1.6 1996/12/12 16:03:19 peterg +## Removed global argument stuff for y - its already done in the +## translation. +## +## Revision 1.5 1996/12/12 15:59:06 peterg +## Generic handling of subscript for y,u,ui +## +## Revision 1.4 1996/12/12 15:54:20 peterg +## Saved it. +## +## Revision 1.3 1996/08/30 14:36:46 peter +## Added some more subscripts. +## -- its high time this was rewritten in awk or perl!!! +## +## Revision 1.2 1996/08/19 14:35:51 peter +## Prettyfied z dot. +## +## Revision 1.1 1996/08/18 20:03:12 peter +## Initial revision +## +############################################################### + +cat $1 | \ +tr "[A-Z]" "[a-z]" | \ +sed \ + -e "s/_\([a-z0-9]*\)/_{\1}/g" \ + -e "s/\// \\\over /g" \ + -e "s/[0-9a-z_]*mtty/mtty/g" \ + -e "s/[0-9a-z_]*mttu/mttu/g" \ + -e "s/mttx\([0-9]*\)/x_{\1}/g" \ + -e "s/mttex\([0-9]*\)/\\\chi_{\1}/g" \ + -e "s/mttddui\([0-9]*\)/\\\ddot{v}_{\1}/g" \ + -e "s/mttdui\([0-9]*\)/\\\dot{v}_{\1}/g" \ + -e "s/mttui\([0-9]*\)/v_{\1}/g" \ + -e "s/mttu\([0-9]*\)/u_{\1}/g" \ + -e "s/mtty\([0-9]*\)/y_{\1}/g" \ + -e "s/mttz\([0-9]*\)/z_{\1}/g" \ + -e "s/mttdx0/\\\dot x_0/g" \ + -e "s/mttdx/\\\dot x/g" \ + -e "s/mttdz/\\\dot z_/g" \ + -e "s/mttdu/\\\dot u_/g" \ + -e "s/dot_/ \\\dot /g" \ + -e "s/mtttf/G(s)/g" \ + -e "s/mttctf/D(s)/g" \ + -e "s/mtta/A/g" \ + -e "s/mttb/B/g" \ + -e "s/mttc/C/g" \ + -e "s/mttd/D/g" \ + -e "s/mtte/E/g" \ + -e "s/mttg/G/g" \ + -e "s/mtti/I/g" \ + -e "s/mttk/K/g" \ + -e "s/mttl/L/g" \ + -e "s/mttm/M/g" \ + -e "s/mtttheta/\\\Theta/g" \ + -e "s/mtto/O/g" \ + -e "s/mttv/V/g" \ + -e "s/mtty0/y_0/g" \ + -e "s/mttu0/u_0/g" \ + -e "s/mttx/x/g" \ + -e "s/mttz/z/g" \ + -e "s/mttyy/Y/g" \ + -e "s/mttw/w/g" \ + -e "s/mttt/T/g" \ + -e "s/mttpar//g" \ + -e "s/!/\\\/g" \ + -e "s/\\$//g" \ + -e "s/f\{0,1\}abs(\([^()]*\))/|{ \1 }|/g" \ + -e "s/(\([^(),]*\),/( { \1 } ,/g" \ + -e "s/,\([^(),]*\),/, { \1 } ,/g" \ + -e "s/,\([^(),]*\))/, { \1 } )/g" \ + -e "s/(/{\\\\left (/g" \ + -e "s/\*\*/^/g" \ + -e "s/\*/ /g" \ + -e "s/)/\\\right )}/g" \ + -e "s/sqrt/\\\sqrt/g" \ + -e "s/theta/\\\theta/g" \ + -e "s/tau/\\\tau/g" \ + -e "s/alpha/\\\alpha/g" \ + -e "s/beta/\\\beta/g" \ + -e "s/gamma/\\\gamma/g" \ + -e "s/delta/\\\delta/g" \ + -e "s/epsilon/\\\epsilon/g" \ + -e "s/\([^b(Th)(th)z]\)eta/\1\\\eta/g" \ + -e "s/^eta/\\\eta/g" \ + -e "s/kappa/\\\kappa/g" \ + -e "s/lambd/\\lambda/g" \ + -e "s/lambda/\\\lambda/g" \ + -e "s/mu/\\\mu/g" \ + -e "s/nu/\\\nu/g" \ + -e "s/phi/\\\phi/g" \ + -e "s/pi/\\\pi/g" \ + -e "s/rho/\\\rho/g" \ + -e "s/sigma/\\\sigma/g" \ + -e "s/omega/\\\omega/g" \ + -e "s/zeta/\\\zeta/g" \ + -e "s/infty/\\\infty/g" \ + -e "s/sin/\\\sin/g" \ + -e "s/cos/\\\cos/g" \ + -e "s/23/{23}/g" \ + -e "s/+-/ -/g" \ + | cat -s | \ +sed -e "s/ $//g" | \ +tr -s '\012' '\012' \ +>junk + +mv junk $1 ADDED mtt/bin/trans/lbl2alias_txt Index: mtt/bin/trans/lbl2alias_txt ================================================================== --- mtt/bin/trans/lbl2alias_txt +++ mtt/bin/trans/lbl2alias_txt @@ -0,0 +1,43 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2alias_txt2txt +# Creates the component aliases in text form + +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/07/02 08:34:00 peterg +## Renamed to lbl2alias_txt2txt +## +## Revision 1.1 1998/07/02 08:14:07 peterg +## Initial revision +## +############################################################### + +# Inform user +echo Creating $1_alias.txt + +#Create the alias file complete with headers. +echo "# Alias file ($1_alias.txt)" > $1_alias.txt +echo "# Generated by MTT at `date`" >> $1_alias.txt + +#Write out the variables +grep '[%|#]ALIAS' $1_lbl.txt |\ +gawk '{print $2,$3}' >> $1_alias.txt + + + + + + + + + ADDED mtt/bin/trans/lbl2alias_txt2txt Index: mtt/bin/trans/lbl2alias_txt2txt ================================================================== --- mtt/bin/trans/lbl2alias_txt2txt +++ mtt/bin/trans/lbl2alias_txt2txt @@ -0,0 +1,77 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2alias_txt2txt +# Creates the component aliases in text form + +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 1998/07/17 19:46:56 peterg +## No change +## +## Revision 1.5 1998/07/17 16:31:37 peterg +## Ignore component aliases (with /) +## +## Revision 1.4 1998/07/03 15:21:26 peterg +## Replace sub by gsub -- need to replace ALL , +## +## Revision 1.3 1998/07/03 13:49:03 peterg +## Flips the order of alias and name when $ is involved. +## +## Revision 1.2 1998/07/03 07:54:39 peterg +## Tidied +## +## Revision 1.1 1998/07/02 09:22:10 peterg +## Initial revision +## +## Revision 1.2 1998/07/02 08:34:00 peterg +## Renamed to lbl2alias_txt2txt +## +## Revision 1.1 1998/07/02 08:14:07 peterg +## Initial revision +## +############################################################### + +# Inform user +echo Creating $1_alias.txt + +#Create the alias file complete with headers. +echo "# Alias file ($1_alias.txt)" > $1_alias.txt +echo "# Generated by MTT at `date`" >> $1_alias.txt + +#Write out the variables + grep '[%|#]ALIAS' $1_lbl.txt |\ + gawk '{ + if (match($3,"/")==0){ + if (match($2,"\\$")==0){ + alias=$2; name =$3 + } + else{ + alias=$3; name =$2 + } + gsub(",","__",alias); #Replace , + n=split(alias,a,"|"); + for (i=1; i<=n; i++) + print a[i] "\t" name; + } + } + END{ + print "###_END_OF_ALIAS_###" + }' >> $1_alias.txt + + + + + + + + + ADDED mtt/bin/trans/lbl2args_txt2out Index: mtt/bin/trans/lbl2args_txt2out ================================================================== --- mtt/bin/trans/lbl2args_txt2out +++ mtt/bin/trans/lbl2args_txt2out @@ -0,0 +1,46 @@ +#!/bin/sh +# Writes argument list to standard output ready for use in calling lbl file + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:08 gawthrop + ## Fixed problems with argument passing for CRs + ## + ## Revision 1.1 2001/06/11 15:06:58 gawthrop + ## Now handles user-defined components + ## + ############################################################### + +# Copyright (C) 2001 by Peter J. Gawthrop + +if [ -f "$1_lbl.txt" ]; then +grep '[#%]ALIAS' $1_lbl.txt |\ + +gawk '{ + if (match($2,"\\$[0-9]")==1) ## Test if its a argument alias + { + i = substr($2,2); + arg[i] = $3 + N++ + } +} +END{ + for (j=1;j<=N;j++){ + if (length(arg[j])==0) + arg[j] = "??"; + } + for (j=1;j \$sys, + 'debug' => \$debug); + +die usage() if ($sys eq ''); + +if ($debug) { + my $logfile = "lbl2cmp_txt2m_${sys}.log"; + open (LOG, ">$logfile") or die ("MTT: lbl2cmp_txt2m, cannot open $logfile"); +} + +$cmp = "${sys}_cmp.txt"; +$lbl = "${sys}_lbl.txt"; +$out = "${sys}_cmp.m"; + +read_cmp_file(); +read_lbl_file(); +sort_components(); +write_header(); +write_body(); + +close (LOG) if ($debug); + +sub usage() { + return "Usage: lbl2cmp_txt2m --sys=\n"; +} + +sub read_cmp_file() { + my ($line, $name, $type, $class, $rep, $i); + + open (CMP, $cmp) or die ("MTT: lbl2cmp_txt2m, cannot open $cmp"); + + $i = 0; + while () { + + chomp; + # skip blank lines + next if (/^(\s)*$/); + # skip comments + next if (/^(\s)*[%\#]/); + # remove leading and trailing whitespace + s/^\s*(\S.*\S)\s*$/$1/; + + $line = $_; + print LOG "read_cmp_file: line='${line}'\n" if ($debug); + + # cmp provides type, name and repetition information + # class is inferred from type and name + # (cr and args are placeholders) + + ($type, $name, $rep) = read_cmp_line($line); + $name = name_anonymous_component($type) if ($name eq ''); + $class = port_or_component_or_junction ($type, $name); + + $component_name [$i++] = $name; + $component_type {$name} = $type; + $component_rep {$name} = $rep; + $component_cr {$name} = ''; + $component_arg {$name} = ''; + $component_class {$name} = $class; + } + close (CMP); +} + +sub read_cmp_line() { + my $line = $_; + my ($type, $name, $rep, $misc); + + ($type, $misc) = split (/:/, $line); + $type = $line unless defined ($type); + + if (defined ($misc)) { + ($name, $rep) = split (/\*/, $misc); + $name = $misc unless defined ($name); + } + + $name = '' unless defined $name; + $rep = 1 unless defined $rep; + + print LOG "read_cmp_line: type='$type', name='$name', rep='$rep'\n" if ($debug); + return ($type, $name, $rep); +} + +sub name_anonymous_component() { + my $type = $_; + my ($name, $num); + if (defined ($anonymous_component_type_index{$type})) { + $num = ++$anonymous_component_type_index{$type}; + $name = "mtt${type}_${num}"; + } else { + $anonymous_component_type_index{$type} = 1; + $name = "mtt${type}"; + } + print LOG "name_anonymous_component: type='${type}', name='${name}'\n" if ($debug); + return ($name); +} + +sub port_or_component_or_junction() { + + # ports are internal SS components (SS:[...]) + # junctions are '0' and '1' types + # everything else is a component, including external SS types. + + my ($type, $name) = @_; + my $retval; + if ($type eq "SS") { + $_ = $name; + if (/\[.+\]/) { + $retval = "port"; + } else { + $retval = "component"; + } + } elsif ($type eq "0") { + $retval = "0junction"; + } elsif ($type eq "1") { + $retval = "1junction"; + } else { + $retval = "component"; + } + print LOG "port_or_component_or_junction: type='$type', name='$name' class='$retval'\n" if ($debug); + return ($retval); +} + +sub read_lbl_file() { + my (@line, $name, $type, $cr, $arg, $i); + + open (LBL, $lbl) or die ("MTT: lbl2cmp_txt2m, cannot open $lbl"); + + $i = 0; + while () { + + chomp; + # skip blank lines + next if (/^(\s)*$/); + # skip comments + next if (/^(\s)*[%\#]/); + # remove leading and trailing whitespace + s/^\s*(\S.*\S)\s*$/$1/; + + # lbl provides name, cr and arg information + + ($name, $cr, $arg) = read_lbl_line (@line); + + $component_cr{$name} = $cr; + $component_arg{$name} = $arg; + } + + close (LBL); +} + +sub read_lbl_line() { + my @line = @_; + my ($name, $cr, $arg); + + @line = split (/\s+/); + $name = shift (@line); + + # strip repetitions (if any) + $name =~ s/([^\*]*)\*.*/$1/; + + $cr = shift (@line); + $arg = shift (@line); + + $cr = '' unless defined ($cr); + $arg = '' unless defined ($arg); + + print LOG "read_lbl_line: name='$name' cr='$cr' arg='$arg'\n" if ($debug); + return ($name, $cr, $arg); +} + +sub write_header() { + my $date = `date`; + chomp ($date); + + open (OUT, ">$out") or + die "MTT: cannot open $out for writing.\n"; + + print OUT << "EOF"; +## $out -*-octave-*- +## Generated by MTT on $date + +function [comp_type, name, cr, arg, repetitions] = ${sys}_cmp(i) + +EOF + + close (OUT); +} + +sub sort_components () +{ + # sorts components into alphabetical order (type:name) + # within the classes: ports, components then junctions. + + my ($name, $class, $i, $j, $target); + + $i = 0; + foreach $target ("port", "component", "0junction", "1junction") { + my @sorted_list = sort (sort_rule @component_name); + for $name (@sorted_list) { + $class = $component_class{$name}; + if ($class eq $target) { + if (! defined ($sorted_component_list{$name})) { + $sorted_component_list{$name} = $i++; + print LOG "sorted: '$name' '$i'\n" if ($debug); + } + } + } + } +} + +sub sort_rule () +{ + my ($type1, $name1, $string1, + $type2, $name2, $string2); + + $name1 = $a; + $name2 = $b; + + $type1 = $component_type{$name1}; + $type2 = $component_type{$name2}; + + $string1 = sprintf ("%s:%s", $type1, $name1); + $string2 = sprintf ("%s:%s", $type2, $name2); + + return ($string1 cmp $string2); +} + + +sub write_body() { + my (%reverse_sorted_component_list, $name); + + %reverse_sorted_component_list = reverse (%sorted_component_list); + for (my $key = 0; $key < scalar @component_name; $key++) { + $name = $reverse_sorted_component_list{$key}; + write_component ($name); + } +} + +sub write_component() { + my ($name) = @_; + + my $i = $sorted_component_list{$name}+1; + + open (OUT, ">>$out") or + die "MTT: cannot open $out for writing.\n"; + + print OUT + "if (i == $i)\n" . + "\tcomp_type = '$component_type{$name}';\n" . + "\tname = '$name';\n" . + "\tcr = '$component_cr{$name}';\n" . + "\targ = '$component_arg{$name}';\n" . + "\trepetitions = $component_rep{$name} ;\n" . + "end\n"; + + close (OUT); +} ADDED mtt/bin/trans/lbl2component Index: mtt/bin/trans/lbl2component ================================================================== --- mtt/bin/trans/lbl2component +++ mtt/bin/trans/lbl2component @@ -0,0 +1,48 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2component +# Creates the commands to pull down components from libraries + +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 2003/08/09 00:29:52 geraint +## Fixed grep error when lbl file doesn't exist. +## +## Revision 1.4 2002/04/28 18:41:27 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.3 1998/07/28 11:23:31 peterg +## Put / explicitly in awk. +## +## Revision 1.2 1998/07/27 08:38:11 peterg +## Just look for / in the relevant field. +## +## Revision 1.1 1998/07/17 17:04:50 peterg +## Initial revision +## +############################################################### + +if [ -f "$1_lbl.txt" ]; then + ## Regexp for an alias + alias='^[#%]ALIAS' + grep $alias $1_lbl.txt | gawk '{if (match($3,"/")>0) print "mtt -q compcopy " $3}' +fi + + + + + + + + + ADDED mtt/bin/trans/lbl2cr_txt2r Index: mtt/bin/trans/lbl2cr_txt2r ================================================================== --- mtt/bin/trans/lbl2cr_txt2r +++ mtt/bin/trans/lbl2cr_txt2r @@ -0,0 +1,46 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2cr_txt2r + +# Label file to constitutive relationship conversion +# P.J.GawthropNovemebr 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 2000/12/28 12:32:06 peterg +## Put under RCS +## +# Revision 1.3 1996/11/03 21:11:44 peterg +# Removed END; statement +# +## Revision 1.2 1996/11/02 10:20:53 peterg +## Created from lbl2sympar +## +############################################################### + + +# Inform user +echo "Creating $1_cr.r" + +rm -f mtt_error + +#Write some file headers +echo "%% constitutive relationship file ($1_cr.r)" > $1_cr.r +echo "%% Generated by MTT at `date`" >> $1_cr.r + +# This is the main transformation using awk +gawk -f $MTTPATH/trans/awk/lbl2cr.awk <$1_lbl.txt 2>mtt_error.txt | \ + sh >> $1_cr.r + +# Now invoke the standard error handling. +#mtt_error mtt_error.txt + + ADDED mtt/bin/trans/lbl2icd_txt2txt.sh Index: mtt/bin/trans/lbl2icd_txt2txt.sh ================================================================== --- mtt/bin/trans/lbl2icd_txt2txt.sh +++ mtt/bin/trans/lbl2icd_txt2txt.sh @@ -0,0 +1,40 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2icd_txt2txt +# Creates the component ICDs in text form + +# Adapted from lbl2alias_txt2txt + +sys=$1 +icd=${sys}_icd.txt +lbl=${sys}_lbl.txt + +# Inform user +echo Creating ${icd} + +#Create the ICD file complete with headers. +echo "# Component ICD file ($1_icd.txt)" > ${icd} +echo "# Generated by MTT at `date`" >> ${icd} + +#Write out the variables + grep '[%|#]ICD' ${lbl} |\ + gawk '{ + if (match($3,"/")==0){ + if (match($2,"\\$")==0){ + icd=$2; name =$3 + } + else{ + icd=$3; name =$2 + } + n=split(icd,a,"|"); + for (i=1; i<=n; i++) + print a[i] "\t" name; + } + } + END{ + print "###_END_OF_ICD_###" + }' >> ${icd} ADDED mtt/bin/trans/lbl2modpar_txt Index: mtt/bin/trans/lbl2modpar_txt ================================================================== --- mtt/bin/trans/lbl2modpar_txt +++ mtt/bin/trans/lbl2modpar_txt @@ -0,0 +1,41 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2modpar_txt2txt +# Creates the component modpares in text form + +# Copyright (C) 2001 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $$Id$ +## $Log$ +## Revision 1.1 2001/03/29 19:24:14 gawthrop +## Can now use c representations of crs when using -c option +## +############################################################### + +# Inform user +echo Creating $1_modpar.txt + +#Create the modpar file complete with headers. +echo "# Modpar file ($1_modpar.txt)" > $1_modpar.txt +echo "# Generated by MTT at `date`" >> $1_modpar.txt + +#Write out the variables +grep '[%|#]MODPAR' $1_lbl.txt |\ +gawk '{printf("%s\t%s\n", $2,$3)}' >> $1_modpar.txt + +echo "# End of $1_modpar.txt" >> $1_modpar.txt + + + + + + + + ADDED mtt/bin/trans/lbl2sympar_txt2r Index: mtt/bin/trans/lbl2sympar_txt2r ================================================================== --- mtt/bin/trans/lbl2sympar_txt2r +++ mtt/bin/trans/lbl2sympar_txt2r @@ -0,0 +1,58 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2sympar_txt2r + +# Label file to symbolic parameters conversion +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 2000/12/28 12:32:06 peterg +## Put under RCS +## +# Revision 1.6 1996/12/07 19:39:51 peterg +# Minor debugging. +# +## Revision 1.5 1996/09/12 17:18:44 peter +## Don't add an RCS header .. +## +## Revision 1.4 1996/08/30 19:01:21 peter +## Added headers to sympar file. +## +## Revision 1.3 1996/08/30 10:18:33 peter +## New path for awk script. +## +## Revision 1.2 1996/08/30 10:04:20 peter +## Included `;' in demimiter list. +## +# Revision 1.1 1996/08/24 13:34:09 peter +# Initial revision +# +############################################################### + + +# Inform user +echo "Creating $1_sympar.r" + +rm -f mtt_error + +#Write some file headers +echo "%% Symbolic parameter file ($1_sympar.r)" > $1_sympar.r +echo "%% Generated by MTT at `date`" >> $1_sympar.r + +# This is the main transformation using awk +tr ';' ',' < $1_lbl.txt | \ +gawk -f $MTTPATH/trans/awk/lbl2sympar.awk | sort >> $1_sympar.r 2>mtt_error.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + ADDED mtt/bin/trans/lbl_txt2tex Index: mtt/bin/trans/lbl_txt2tex ================================================================== --- mtt/bin/trans/lbl_txt2tex +++ mtt/bin/trans/lbl_txt2tex @@ -0,0 +1,156 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl_txt2tex +# Latex summary of the lbl file + +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.12 2002/04/28 18:41:27 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.11 2002/04/19 08:39:45 gawthrop +## Changed \# to # and \% to # to avoid warning in latest gawk version +## +## Revision 1.10 2000/12/28 12:32:06 peterg +## Put under RCS +## +## Revision 1.9 2000/11/16 13:11:06 peterg +## Included PAR and UNITS declarations +## +## Revision 1.8 1999/02/17 21:42:19 peterg +## Replaced print by printf to avoid extra nl in paragraph command. +## +## Revision 1.7 1998/07/27 12:56:26 peterg +## Splits up | separated expressions. +## +## Revision 1.6 1998/07/27 10:56:31 peterg +## Cosmetics. +## +## Revision 1.5 1998/07/27 08:29:44 peterg +## Include a comment field in the aliases +## +## Revision 1.4 1998/07/17 19:46:44 peterg +## Included component alias. +## +## Revision 1.3 1998/07/16 20:39:52 peterg +## More cosmetic changes +## +## Revision 1.2 1998/07/16 16:34:09 peterg +## Cosmetic changes +## +## Revision 1.1 1998/07/16 16:31:47 peterg +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_lbl.tex + +#Create the alias file complete with headers. +echo "% Label summary file ($1_lbl.tex)" > $1_lbl.tex +echo "% Generated by MTT at `date`" >> $1_lbl.tex + +#Write out the Description + grep '[%|#]SUMMARY' $1_lbl.txt | sed 's/_/\\_/g' |\ + gawk '{ + printf("\\paragraph{System %s:",$2); + for (i=3;i<=NF;i++) printf("%s ",$i); print "" + print "}" + }' >> $1_lbl.tex +# grep '[%|#]DESCRIPTION' $1_lbl.txt | sed 's/_/\\_/g' |\ +# gawk '{ +# for (i=2;i<=NF;i++) printf("%s ",$i); print "" +# }' >> $1_lbl.tex + +#Write out the aliases +cat <> $1_lbl.tex +\paragraph{Interface information:} +\begin{description} +EOF + grep '[%|#]ALIAS' $1_lbl.txt | sed 's/_/\\_/g' |\ + gawk '{ + N=split($2,a,"|"); + for (i=1;i<=N;i++){ + if (match(a[i],"\\$")>0){ + printf("\\item [Parameter \\%s] represents actual parameter ",a[i]) + } + else if (match($3,"/")>0){ + printf("\\item [Component %s] is in library ",a[i]) + } + else{ + printf("\\item [Port %s] represents actual port ",a[i]) + } + printf("\\textbf{%s}",$3) + if (match($4,"[#%]")==1) printf(" -- "); + for (j=5;j<=NF;j++) printf(" %s", $j) + printf("\n"); + } + } + END{if (NR==0) print "\\item This component has no ALIAS declarations" +}' | sort >> $1_lbl.tex +cat <> $1_lbl.tex +\end{description} +EOF + +#Write out the VARS +cat <> $1_lbl.tex +\paragraph{Variable declarations:} +\begin{description} +EOF + grep '[%|#][V|P]AR' $1_lbl.txt | sed 's/_/\\_/g' |\ + gawk '{ + printf("\\item %s\n",$2) + } + END{if (NR==0) print "\\item This component has no PAR declarations" +}' | sort >> $1_lbl.tex +cat <> $1_lbl.tex +\end{description} +EOF + + +#Write out the UNITS +cat <> $1_lbl.tex +\paragraph{Units declarations:} +\begin{description} +EOF + grep '[%|#]UNITS' $1_lbl.txt | sed 's/_/\\_/g' |\ + gawk '{ + printf("\\item [Port %s] has domain %s\n",$2, $3) + printf("\\begin{description}\n") + printf("\\item [Effort units] %s\n",$4) + printf("\\item [Flow units] %s\n",$5) + printf("\\end{description}\n") + } + END{if (NR==0) print "\\item This component has no UNITs declarations" +}' >> $1_lbl.tex +cat <> $1_lbl.tex +\end{description} +EOF + +# Write the actual lbl file +cat >> $1_lbl.tex <> $1_lbl.tex +cat >> $1_lbl.tex <lde_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the differential-algebraic equations file +in "$1_lde.r"; + +%Read the symbolic parameter file +%%in "$1_sympar.r"; + + + +OFF Echo; +OFF Nat; + +%Read the substitution file +IN "$1_subs.r"; + +%Read the simplifying expressions file +IN "$1_simp.r"; + +OUT "$1_lde.tex"; + +%Write out the differential-algebraic equations. + +write "%File: $1_lde.tex"; + +write "%ordinary differential equations"; +write "% Generated by MTT"; + +IF MTTNyz>0 THEN +BEGIN + write"\begin{equation} \label{eq_$1_lde_x}"; + write"\begin{aligned}"; + FOR Row := 1:MTTNx DO + BEGIN + write "{"; + write MTTl(Row,1); + write "}"; + write " &= 0"; + IF Row0 THEN +BEGIN + write"\begin{equation} \label{eq_$1_lde_y}"; + write"\begin{aligned}"; + FOR Row := 1:MTTNy DO + BEGIN + write "MTTy", Row, " &= "; + write "{"; + write MTTy(Row,1); + write "}"; + IF Row isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char + ## ## + ## ## Revision 1.52 2004/09/07 18:22:53 geraint + ## ## Issues a more helpful error message than the cryptic Octave stuff + ## ## if there are unconnected ports. + ## ## + ## ## Revision 1.51 2004/02/20 20:42:40 geraint + ## ## Initialize Flipped.cons with [] instead of "". + ## ## + ## ## Revision 1.50 2003/03/13 15:18:39 gawthrop + ## ## Now uses __ to delimit subsystems in names. + ## ## + ## ## Revision 1.49 2001/07/26 05:02:53 geraint + ## ## Now writes cbg.fig when under-causal (again). + ## ## + ## ## Revision 1.48 2001/07/23 23:20:27 gawthrop + ## ## Now only writes to type.sh and cbg.m when causality is completed. + ## ## + ## ## Revision 1.47 2000/03/20 16:45:26 peterg + ## ## *** empty log message *** + ## ## + ## ## Revision 1.46 2000/02/17 16:14:49 peterg + ## ## *** empty log message *** + ## ## + ## ## Revision 1.45 1999/11/01 03:17:45 peterg + ## ## Added extra info - current subsystem + ## ## + ## ## Revision 1.44 1999/03/11 23:54:11 peterg + ## ## Include possibility of vector SS when finding port_bond_index + ## ## + ## ## Revision 1.43 1998/12/14 15:19:36 peterg + ## ## Added missing "derivative_causality," argument to recursive call of + ## ## this function + ## ## + ## ## Revision 1.42 1998/12/03 14:55:40 peterg + ## ## Now uses number of components with complete causality to measure + ## ## progress of algorithm -- Done. + ## ## This replaces bond count -- done. + ## ## + ## ## Revision 1.41 1998/11/20 10:52:28 peterg + ## ## Copies port bonds if the port bonds ARE set + ## ## -- replaces Copies port bonds if the component bonds are NOT set + ## ## + ## ## Revision 1.40 1998/09/02 11:47:09 peterg + ## ## Now uses explicit ordered list of ports instead of port.index. + ## ## Note that subsystems are still treated in arbitrary order. + ## ## + ## ## Revision 1.39 1998/08/25 20:06:16 peterg + ## ## Writes flipped port info + ## ## + ## ## Revision 1.38 1998/08/25 09:15:28 peterg + ## ## Fixed couple of problems with using two copies of the one data + ## ## stucture: + ## ## + ## ## ABG_field and ABG.field + ## ## + ## ## Maybe this is conceptually wrong? + ## ## + ## ## Revision 1.37 1998/08/25 08:33:29 peterg + ## ## Now does ports as well - fixed string prob by using deblank + ## ## + ## ## Revision 1.36 1998/08/25 06:44:40 peterg + ## ## Furhter revisions + ## ## + ## ## Revision 1.35 1998/08/24 10:16:32 peterg + ## ## Coverted to new structure - still needs status sorting. + ## ## + ## ## Revision 1.34 1998/08/24 07:35:03 peterg + ## ## About to go to new abg format. + ## ## + ## ## Revision 1.33 1998/07/29 13:36:37 peterg + ## ## Don't set port status if there aren't any ports. + ## ## + ## ## Revision 1.32 1998/07/28 19:06:11 peterg + ## ## *** empty log message *** + ## ## + ## ## Revision 1.31 1998/07/28 13:15:10 peterg + ## ## Vector SS ports included. + ## ## + ## ## Revision 1.30 1998/07/27 20:29:49 peterg + ## ## Had another go at causality .... + ## ## 1. Impose external causality onto all port bonds + ## ## 2. Set C_cause.m so that it DOESN'T set causality + ## ## -- I_cause is already ok ! + ## ## + ## ## Revision 1.29 1998/07/10 09:01:42 peterg + ## ## Added error + info file in new form + ## ## + ## ## Revision 1.28 1998/07/08 09:23:42 peterg + ## ## Undid the previous change -- needs more thought. + ## ## + ## ## Revision 1.27 1998/07/03 19:03:31 peterg + ## ## Always override the causality of port bonds! + ## ## + ## ## Revision 1.26 1998/06/27 13:24:04 peterg + ## ## Causality now set correctly for: + ## ## multi-port C and I + ## ## C and I with arrows pointing in + ## ## + ## ## Revision 1.25 1998/06/25 18:53:30 peterg + ## ## Actually, the previous comment was optimistic. + ## ## The port causalities on a compound are now forced to be the same as + ## ## that specified by a a _cuase.m file (if it exists) + ## ## + ## ## Revision 1.24 1998/06/25 17:45:03 peterg + ## ## No change -- but checked that explicit causality works! + ## ## + ## ## Revision 1.23 1998/04/04 10:46:37 peterg + ## ## Coerces port bonds to have smae direction as the imposing bonds + ## ## _cbg now generates the (coerced) components as welll as the (coerced) + ## ## causality. + ## ## + ## ## Revision 1.22 1997/08/19 10:21:09 peterg + ## ## Only copy port cuaslity info if not already set within the + ## ## subsystem. I thought I'd done this already .... + ## ## + ## ## Revision 1.21 1997/08/18 16:25:25 peterg + ## ## Minor bug fixes + ## ## + ## ## Revision 1.20 1997/08/18 12:45:24 peterg + ## ## Replaced: comp_bonds = bonds(bond_list,:) + ## ## by: for kk = 1:n_comp + ## ## comp_bonds(kk,:) = bonds(comp(kk),:); + ## ## end; + ## ## + ## ## to avoid an octave bug in 1.92. + ## ## + ## ## Revision 1.19 1997/08/18 11:23:59 peterg + ## ## Main component loop now misses out the ports (SS:[]) -- the causality + ## ## is merely passed through these components. + ## ## + ## ## Revision 1.18 1997/08/08 08:11:04 peterg + ## ## Suppress compoment trace. + ## ## + ## ## Revision 1.17 1997/08/07 16:10:13 peterg + ## ## Move the if status .. to the beginning of the main loop. + ## ## + ## ## Revision 1.16 1997/08/04 13:11:19 peterg + ## ## Only change to component-orientated causality for simple components + ## ## NOT for compound components. + ## ## + ## ## Revision 1.15 1997/01/05 12:25:59 peterg + ## ## More informative message about port bonds incompatible with ports + ## ## + ## ## Revision 1.14 1996/12/31 16:20:42 peterg + ## ## Just write causality information at top level -- it gets a bit + ## ## voluminous if written at deeper levels. + ## ## + ## ## Revision 1.13 1996/12/31 11:49:09 peterg + ## ## Don't copy port bond causality if already set -- allows subsystem + ## ## causality to be preset directely on named SS. + ## ## + ## ## Revision 1.12 1996/12/31 11:42:36 peterg + ## ## *** empty log message *** + ## ## + ## ## Revision 1.11 1996/12/07 17:10:48 peterg + ## ## Allows port SS at top level - ie takes it to be an ardianry SS at top + ## ## level. + ## ## + ## ## Revision 1.10 1996/12/04 21:48:55 peterg + ## ## Compares full-name with empty string (instead of testing for zero + ## ## length. + ## ## + ## ## Revision 1.9 1996/08/30 12:55:40 peter + ## ## More heirachical stuff added. + ## ## + ## ## Revision 1.8 1996/08/26 10:04:25 peterg + ## ## Fixed error due to a line wrap. + ## ## + ## ##Revision 1.7 1996/08/16 12:58:58 peter + ## ## Now does preferred causality of I and C. + ## ## Revision 1.6 1996/08/09 08:27:29 peter + ## ## Added a few deguging lines + ## ## + ## ## Revision 1.5 1996/08/08 18:06:18 peter + ## ## Unified file naming scheme + ## ## + ## ## Revision 1.4 1996/08/08 08:30:06 peter + ## ## The cbg filename contains the system name - this makes things easier + ## ## when setting up the m to fig translation and m to ese translation + ## ## + ## ## Revision 1.3 1996/08/05 18:53:21 peter + ## ## Fixed bug passing causality from subsystems. + ## ## + ## ## Revision 1.2 1996/08/05 15:41:41 peter + ## ## Now recursively does causality on subsystems. + ## ## + ## ## Revision 1.1 1996/08/04 17:55:55 peter + ## ## Initial revision + ## ## + ## ############################################################### + + + mtt_info(sprintf("Completing causality for subsystem %s", system_name), infofile); + + pc = '%'; + sub_delim = "__"; # Subsystem delimiter + + if nargin<1 + system_name = 'no_name'; + end; + + if nargin<4 + port_bonds = []; + end; + + if nargin<5 + infofile = 'stdout'; + end; + + ## Are we at the top level of the heirarchy? + at_top_level = strcmp(full_name, ''); + + ## Create a file to contain shell commands which map subsystem types + ## onto components +# if at_top_level # Then at top level +# fprintf(typefile, "# Commands to map types onto subsystems\n"); +# fprintf(typefile, "# File %s_type.sh\n", system_name); +# fprintf(typefile, "# Generated by MTT at %s\n\n", ctime(time)); +# end; + + ## Create the (full) system name + if at_top_level + full_name = system_name; + system_type = system_name; + else + full_name = [full_name, sub_delim, system_name]; + end; + + fun_name = [system_type, "_abg"]; + + disp("===================================="); + disp(["BEGIN: ", full_name, " (", fun_name, ")"]); + disp("===================================="); + + ## If no such function - then there is nothing to be done. + if exist(fun_name)~=2 + mtt_error(["m-file ", fun_name, " does not exist"], errorfile); + bonds = []; + status = []; + return + end; + + ## Evaluate the system function to get the bonds and number of ports + ##eval(["[bonds,components,n_ports,N_ports]=", fun_name, ";"]); + eval(["[ABG]=", fun_name, ";"]); + !isfield(ABG,"subsystems") + if !isfield(ABG,"subsystems")# Are there any subsystems? + return; # Nothing to do + else + [n_subsystems,junk] = size(fieldnames(ABG.subsystems)) + endif + + if isfield(ABG,"portlist")# Are there any ports? + [n_ports,junk] = size(ABG.portlist); + ## port_bond_index=zeros(n_ports,1); + i_port = 0; + for i=1:n_ports # Find indices of the internal ports + name = deblank(ABG.portlist(i,:)); # Name of this port + eval(["port = ABG.ports.",name,";"]); # Extract port info + for j=1:length(port.connections) # Maybe vector SS + port_bond_index(++i_port) = abs(port.connections(j)); + endfor; + endfor + else + n_ports = 0; + endif + + + [n_bonds,columns] = size(ABG.bonds);# Find number of bonds + if (columns ~= 2)&(n_bonds>0) + error("Incorrect bonds matrix: must have 2 columns"); + end; + + + ## Find number of components + ## [n_components,m_components] = size(components); + ## if n_components==0 # there is nothing to be done + ## return + ## end; + + + + ## Coerce the port (SS:[]) component bonds to have the same direction as + ## of the bonds in the encapsulating system -- but not at top level + Flipped.ports="";Flipped.subs="";Flipped.cons=[]; + + if (n_ports>0)&&(!at_top_level) # Coerce directions + for i=1:n_ports + name = deblank(ABG.portlist(i,:)); # Name of this port + eval(["port = ABG.ports.",name,";"]); # Extract port info + disp ("----"); + i + name + port + port_bond_direction + port.connections + + if (i > max (size (port_bond_direction))) + the_system = sprintf ("\"%s:%s\"", system_type, system_name); + mtt_error (sprintf ("Please check that %s has no disconnected ports.", the_system)); + mtt_error (sprintf ("abg2cbg: port_bond_direction(%d) does not exist.", i)); + exit(1); + end + if (sign(port.connections)!=port_bond_direction(i)) # Direction different? + eval(["ABG.ports.",name,".connections = - port.connections;"]); # Flip direction at port + Flipped.ports=[Flipped.ports;name]; # Remember which port has been flipped + bond_index=abs(port.connections); # Index of bond on port + mtt_info(sprintf("Flip port %s on %s" ... + ,name,full_name),infofile); # And report + for [subsystem,name] = ABG.subsystems # and at the other end + for k=1:length(subsystem.connections) + if (abs(subsystem.connections(k))==bond_index) # Then flip the connection + eval(["ABG.subsystems.",name,".connections(k) = -subsystem.connections(k);"]); + Flipped.subs=[Flipped.subs;name]; # Remember which subsystem has been flipped + Flipped.cons=[Flipped.cons;k]; # Remember which connection has been flipped + mtt_info(sprintf("Flip subsystem %s on %s" ... + ,name,full_name),infofile); # And report + endif + endfor + endfor # subsystem = ABG.subsystems + + ABG.bonds(bond_index,:) = -ABG.bonds(bond_index,:); # Flip the bond causalities + ##(these are arrow-orientated) + endif # Is the direction different? + endfor # port = ABG.ports + endif # (n_ports>0)&&(!at_top_level) + + ## If not at top level, then copy the port bonds. + if !at_top_level # Find number of port bonds + + for j=1:n_ports + jj = port_bond_index(j); # The index of the bond + for k = 1:2 + ## if ABG.bonds(jj,k)==0 # only copy if not already set + ## ABG.bonds(jj,k) = port_bonds(j,k); + ## endif + if port_bonds(j,k)!=0 # only copy if port bonds are set + ABG.bonds(jj,k) = port_bonds(j,k); + endif + endfor + endfor + else + n_port_bonds=0; + endif + + ## Causality indicator + total = 2*n_bonds; + done = sum(sum(abs(ABG.bonds)))/total*100; + + fields=["ports";"subsystems"]; # Do for both ports and subsystems - + ## ports first + for i=1:2 + field=deblank(fields(i,:)); + if isfield(ABG,field); + eval(["ABG_field = ABG.",field, ";"]); + field,ABG_field + + sum_ok = 0; n_comp = 0; + for [subsystem,name] = ABG_field# Find % status = 0 (causally complete) + eval(["ok = (ABG_field.",name,".status==0);"]); + sum_ok = sum_ok + ok; n_comp ++; + endfor; + Done = sum_ok/n_comp*100 + + ## Outer while loop sets preferred causality + ci_index=1; + + ## for [subsystem,name] = ABG_field# Set new status field to -1 + ## eval(["ABG_field.",name,".status=-1;"]); + ## endfor; + + while( ci_index>0) + old_done = inf; + old_Done = inf; + + while Done!=old_Done # Inner loop propagates causality + old_Done = Done; + for [subsystem,name] = ABG_field + name,subsystem + if subsystem.status != 0 # only do this if causality not yet complete + comp = subsystem.connections; # Get the bonds on this component + bond_list = abs(comp); + direction = sign(comp)'*[1 1]; + n_bonds = length(bond_list); + + if strcmp(subsystem.type,"0") # Change names + subsystem.type = "zero"; + end; + if strcmp(subsystem.type,"1") + subsystem.type = "one"; + end; + + cause_name = [subsystem.type, "_cause"];# Component causality procedure name + eqn_name = [subsystem.type, "_eqn"]; #Component equation procedure name + + comp_bonds=[]; # Bonds on this component (arrow-orientated) -- these become the + for kk = 1:n_bonds # port bonds on the ith component of this subsystem. + comp_bonds(kk,:) = ABG.bonds(bond_list(kk),:); + end; + + if exist(eqn_name)!=2 # Try a compound component + ## Port status depends on whether the corresponding bonds are + ## fully causal at this stage. + one = ones(n_bonds,1); + port_status = (sum(abs(comp_bonds'))'==2*one) - one; + + port_bond_direction = -sign(subsystem.connections)'; # Direction of bonds + + if exist(cause_name)==2 # If there is a predefined causality function; use it + comp_bonds = comp_bonds.*(port_bond_direction*[1 1]); # Convert from arrow orientated to component orientated causality + eval([ "[comp_bonds] = ", cause_name, "(comp_bonds);" ]); # Evaluate the built-in causality procedure + + comp_bonds = comp_bonds.*(port_bond_direction*[1 1]); # and convert from component orientated to arrow orientated causality + end; + + port_bond_direction,comp_bonds + [comp_bonds,subsystem.status] = abg2cbg(name, subsystem.type, full_name, + comp_bonds, port_bond_direction, port_status, ... + derivative_causality, ... + typefile, infofile, errorfile); + + + else # its a simple component -- or explicit causality defined + mtt_info(sprintf("Completing causality for component %s (%s)", + name, subsystem.type), infofile); + disp(["---", name, " (", cause_name, ") ---"]); + comp_bonds_in = comp_bonds + + ## Convert from arrow orientated to component orientated causality + comp_bonds = comp_bonds.*direction; + + ## Evaluate the built-in causality procedure + ##eval([ "[comp_bonds,status(i)] = ", cause_name, "(comp_bonds);" ]); + eval([ "[comp_bonds,subsystem.status] = ", cause_name, "(comp_bonds)" ]); + ## and convert from component orientated to arrow orientated causality + comp_bonds = comp_bonds.*direction; + + comp_bonds_out = comp_bonds + end; + + ABG.bonds(bond_list,:) = comp_bonds;# Update the full bonds list + eval(["ABG_field.",name,".status = subsystem.status;"]); + end; + end; + + sum_ok = 0; n_comp = 0; + for [subsystem,name] = ABG_field# Find % status = 0 (causally complete) + eval(["ok = (ABG_field.",name,".status==0);"]); + sum_ok = sum_ok + ok; n_comp ++; + endfor; + + Done = sum_ok/n_comp*100 + done = sum(sum(abs(ABG.bonds)))/total*100 + ##disp(sprintf("Causality is #3.0f#s complete.", done, pc), infofile)); + + endwhile # done!=old_done + + [name,prefered] = getdynamic(ABG_field) # Set causality of a C or I which is not already set + if prefered==0 + ci_index=0; + else + disp("Set causality of a C or I which is not already set") + eval(["ci_bond_index = ABG.",field,".",name,".connections;"]); # Get bonds + ci_direction = sign(ci_bond_index); + ci_bond_index = abs(ci_bond_index); + if derivative_causality + prefered = -prefered; + end; + ABG.bonds(ci_bond_index,1:2) = prefered*ci_direction'*[1 1] + eval(["ABG.subsystems.",name,".status=0"]); #set status of the C or I + endif + endwhile # ( ci_index>0) + eval(["ABG.",field," = ABG_field;"]); # Copy back to actual structure + endif # isfield(CBG,field(i,:)); + endfor + ## if n_ports>0 + ## status(1:n_ports) = zeros(n_ports,1); # Port status not relevant + ## endif; + + ## Print final causality + ## final_done = (sum(status==zeros(n_components,1))/n_components)*100; + + if at_top_level + mtt_info(sprintf("Final causality of %s is %3.0f%s complete.", ... + full_name, Done, pc), infofile); + + if Done<100 + mtt_error(sprintf("Unable to complete causality"),errorfile); + end; + endif # at_top_level + + + + + ## Return the port bonds - arrow orientated causality - and the direction + status=0; + if !at_top_level # Not at top level + port_bonds = ABG.bonds(port_bond_index,:); # Return port bonds + endif; # at top level + + for [subsystem,name] = ABG.subsystems + if subsystem.status==-1 # Under causal + status=-1; + mtt_info(sprintf("Component %s (%s) is undercausal", name, subsystem.type), ... + infofile); + elseif subsystem.status==1; # Over causal + status=-1; + mtt_info(sprintf("Component %s (%s) is overcausal", name, subsystem.type), ... + infofile); + endif; + endfor; # [subsystem,name] = ABG.subsystems + + ## write out the component .cbg file + disp(["Writing ", full_name]); + write_cbg(full_name,system_type,ABG,Flipped); + fprintf(typefile, "$1%s$2%s$3\n", system_type, full_name); + + + + status, port_bonds + disp("===================================="); + disp(["END: ", full_name, " (", fun_name, ")"]); + disp("===================================="); + + +endfunction; ADDED mtt/bin/trans/m/abg2connections.m Index: mtt/bin/trans/m/abg2connections.m ================================================================== --- mtt/bin/trans/m/abg2connections.m +++ mtt/bin/trans/m/abg2connections.m @@ -0,0 +1,38 @@ +## -*-octave-*- put Emacs into Octave mode +## +## ###################################### +## ##### Model Transformation Tools ##### +## ###################################### +## +## abg2connections_m +## +## Creates a cell array recording the name of the +## component at each end of every bond. +## +## This data may differ from ibg.m because of the +## expansion of vector bonds that takes place +## during the generation of abg.m + +function connections = abg2connections (abg) + + substructures = {"ports", "subsystems"}; + + for i = [1,2] + substruct = substructures{i}; + + if (isfield (abg, substruct)) + for [val, key] = eval (sprintf ("abg.%s", substruct)) + for bond_id = val.connections + if (bond_id > 0) + connections.head {+bond_id} = key + else + connections.tail {-bond_id} = key + endif + endfor + endfor + endif + + endfor + +endfunction + ADDED mtt/bin/trans/m/add_bond.m Index: mtt/bin/trans/m/add_bond.m ================================================================== --- mtt/bin/trans/m/add_bond.m +++ mtt/bin/trans/m/add_bond.m @@ -0,0 +1,36 @@ +function comp_list = add_bond(comp_list,bond_number,comp_number); + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Adds a new bond entry to a list of components -- pads the list appropriately. + +[N,M] = size(comp_list); +if M==0 + M=1; +end; + +if comp_number>N % Pad with zeros + comp_list = [comp_list;zeros(comp_number-N,M)]; +end; + +this_comp = [nozeros(comp_list(comp_number,:)), bond_number]; + +L = length(this_comp); + +[N,M] = size(comp_list); + +if LM %pad matrix with zeros and insert new row + comp_list = [comp_list zeros(N,L-M)]; + comp_list(comp_number,:) = this_comp; +else %Sizes match so just insert + comp_list(comp_number,:) = this_comp; +end; ADDED mtt/bin/trans/m/add_row.m Index: mtt/bin/trans/m/add_row.m ================================================================== --- mtt/bin/trans/m/add_row.m +++ mtt/bin/trans/m/add_row.m @@ -0,0 +1,16 @@ +function New=add_row(Old,Row); # Adds a row to end of matrix + + [N,M]=size(Old); + [n,m] = size(Row); + + if m>M + Old = [Old, zeros(N,m-M)]; # Pad with zeros + elseif M>m + Row = [Row, zeros(n,M-m)]; + endif + + New = [Old;Row]; + +endfunction + + ADDED mtt/bin/trans/m/adjbond.m Index: mtt/bin/trans/m/adjbond.m ================================================================== --- mtt/bin/trans/m/adjbond.m +++ mtt/bin/trans/m/adjbond.m @@ -0,0 +1,27 @@ +function [index,distance] = adjbond(point,arrow_end,other_end); +% adjbond: Determines the bond closest to the point +% [index,distance] = adjbond(point,arrow_end,other_end); + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +[n,m] = size(other_end); +one = ones(n,1); +arrow_distance = length2d(one*point - arrow_end); +min_arrow_distance = min(arrow_distance); + +other_distance = length2d(one*point - other_end); +min_other_distance = min(other_distance); + +min_distance = min([arrow_distance; other_distance]); + +adjacent = [arrow_distance, other_distance] == min_distance*[one one]; +[index,n] = getindex(adjacent,1); +distance = min_distance; + ADDED mtt/bin/trans/m/adjcomp.m Index: mtt/bin/trans/m/adjcomp.m ================================================================== --- mtt/bin/trans/m/adjcomp.m +++ mtt/bin/trans/m/adjcomp.m @@ -0,0 +1,33 @@ +function indices = adjcomp(arrow_end,other_end,components); +% adjcomp: Determines the two components at each end of the bond + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +[n,m] = size(components); +one = ones(n,1); + +arrow_distance = length2d(one*arrow_end - components(:,1:2)); +min_arrow_distance = min(arrow_distance); + +other_distance = length2d(one*other_end - components(:,1:2)); +min_other_distance = min(other_distance); + +arrow_adjacent = arrow_distance==min_arrow_distance*one; +other_adjacent = other_distance==min_other_distance*one; +[index,n] = getindex([arrow_adjacent,other_adjacent],1); + +if index(1,2)==1 + indices = index(1:2,1)'; +else + indices = index(2:-1:1,1)'; +end; + + ADDED mtt/bin/trans/m/alias_args.m Index: mtt/bin/trans/m/alias_args.m ================================================================== --- mtt/bin/trans/m/alias_args.m +++ mtt/bin/trans/m/alias_args.m @@ -0,0 +1,82 @@ +function args = alias_args(args,alias,delim,message,FileID,sys_name) + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.10 2012/10/15 19:16:03 geraint +## split is obsolete in Octave, replaced with strsplit +## +## Revision 1.9 2009/11/02 16:54:03 geraint +## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char +## +## Revision 1.8 2001/06/13 16:07:15 gawthrop +## Fixed bug with three separators in a row eg )/( +## +## Revision 1.7 2001/06/13 14:50:15 gawthrop +## Operator ^ now ok in args in abg and/or lbl +## +## Revision 1.6 2001/04/23 16:23:30 gawthrop +## Now stips ; from bottlom level argument list - allows aliasing of +## parts of a,b,c (eg a,b by using a,b;c +## +## Revision 1.5 2000/10/12 19:27:20 peterg +## Now writes out the aliased args ... +## +## Revision 1.4 2000/09/14 13:35:43 peterg +## appended '(' and ')' to SEPS +## -- otherwise first argument after '(' doesn't get substituted +## (Fixed by Geraint) +## +## Revision 1.3 1998/08/11 14:09:05 peterg +## Replaced incorrect length(args>0) with !isempty(args) +## +## Revision 1.2 1998/07/27 10:24:20 peterg +## Included , in the the list of seperators (SEPS) +## This makes it substitute for bits of args separated by commas. +## +## Revision 1.1 1998/07/03 18:29:40 peterg +## Initial revision +## +############################################################### + + if isstruct(alias) + if !isempty(args) + Args = char(strsplit(args,delim)); args=""; + [N,M]= size(Args); + for i=1:N + arg = deblank(Args(i,:)); + arg_ = strrep(arg,",","__"); + if isfield(alias,arg_) + eval(["new_arg = alias.", arg_,";"]); + mtt_info(["Replacing ", arg, "\t by ", ... + new_arg, message],FileID); + mtt_save_alias(arg,sys_name); +## printf("%s --> %s\n",arg,new_arg); + arg = new_arg; +## else +## mtt_info(["NOT replacing ", arg, message],FileID); + end + SEPS = ",+-*/()^"; + for j = 1:length(SEPS) + if (length(arg)>1)&&(length(findstr(arg,SEPS(j)))>0) + arg = alias_args(arg,alias,SEPS(j),message,FileID,sys_name); + end + end; + args = sprintf("%s%s%s", args, delim, arg); + end + if (length(args)>1) + if (substr(args,1,1)==delim) + args = substr(args,2); # loose leading delimiter + endif + endif + + end + end; +endfunction; + + + + + ADDED mtt/bin/trans/m/args2arg.m Index: mtt/bin/trans/m/args2arg.m ================================================================== --- mtt/bin/trans/m/args2arg.m +++ mtt/bin/trans/m/args2arg.m @@ -0,0 +1,31 @@ +function arg = args2arg(args,n,FS) +% args2arg - pulls the nth argument from a FS-separated list. +% FS defaults to `;'. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function args2arg.m +% arg = args2arg(args,n,FS) +% Copyright (c) P.J. Gawthrop, 1996. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/08/30 09:58:55 peter +% %% Uses str2ch to exteact a char from a string. +% %% +% %% Revision 1.1 1996/08/27 12:50:43 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Field separator +if nargin<3 + FS = ';'; +end; + ADDED mtt/bin/trans/m/cause2index.m Index: mtt/bin/trans/m/cause2index.m ================================================================== --- mtt/bin/trans/m/cause2index.m +++ mtt/bin/trans/m/cause2index.m @@ -0,0 +1,28 @@ +function index = cause2index (causality) + + ## usage: index = cause2index (causality) + ## + ## + + if isstr(causality) + if strcmp(causality,"effort") + index = 1; + elseif strcmp(causality,"flow") + index = 2; + elseif strcmp(causality,"state") + index = 3 + else + error(sprintf("Causality ""%s"" not recognised",causality)); + endif + + else + if causality==1 + index = 1; + elseif causality==-1 + index = 2; + else + error(sprintf("Causality ""%i"" not recognised",causality)); + endif + endif + +endfunction ADDED mtt/bin/trans/m/cause2name.m Index: mtt/bin/trans/m/cause2name.m ================================================================== --- mtt/bin/trans/m/cause2name.m +++ mtt/bin/trans/m/cause2name.m @@ -0,0 +1,27 @@ +function name = cause2name(causality) +% cause2name - converts causality to a string +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function cause2name +% name = cause2name(causality) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +if causality==1 + name = 'effort'; +elseif causality ==-1 + name = 'flow'; +else + name = 'state'; +end; ADDED mtt/bin/trans/m/cause2num.m Index: mtt/bin/trans/m/cause2num.m ================================================================== --- mtt/bin/trans/m/cause2num.m +++ mtt/bin/trans/m/cause2num.m @@ -0,0 +1,27 @@ +function num = cause2num(causality) +% cause2num - converts causality to a string +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function cause2num +% num = cause2num(causality) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +if causality==1 + num = 1; +elseif causality ==-1 + num = 2; +else + num = 3; +end; ADDED mtt/bin/trans/m/cbg2ese.m Index: mtt/bin/trans/m/cbg2ese.m ================================================================== --- mtt/bin/trans/m/cbg2ese.m +++ mtt/bin/trans/m/cbg2ese.m @@ -0,0 +1,614 @@ +function structure = cbg2ese(system_name, system_type, system_cr, ... + system_args, full_name, full_name_repetition, ... + repetition,... + structure, structure_file,infofilenum) + ## Set up globals to count the component inputs and outputs. This relies on + ## the named SS (the ports) being in the correct order. Using globals here + ## avoids changing the common argument list for all _eqn files for something + ## which is only used for named SS components. + global local_u_index + global local_y_index + global at_top_level + ## + ## ###################################### + ## ##### Model Transformation Tools ##### + ## ###################################### + ## + ## Matlab function cbg2ese.m + ## Acausal bond graph to causal bond graph: mfile format + ## Structure matrix [states,nonstates,inputs,outputs,zero_outputs] + + ## ############################################################### + ## ## Version control history + ## ############################################################### + ## ## $Id$ + ## ## $Log$ + ## ## Revision 1.54 2009/11/02 16:54:03 geraint + ## ## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char + ## ## + ## ## Revision 1.53 2005/03/21 11:09:47 gawthrop + ## ## Now handles bicausal SS component - + ## ## ie source-source or sensor-sensor + ## ## + ## ## Revision 1.52 2004/09/12 22:27:27 geraint + ## ## Appended 't' to fopen mode string to open in text mode. + ## ## + ## ## Revision 1.51 2003/05/16 11:16:28 gawthrop + ## ## Fixed bug with multiports + ## ## + ## ## Revision 1.50 2003/05/08 18:47:50 gawthrop + ## ## Fixed __ bug when using * representations + ## ## + ## ## Revision 1.49 2003/03/13 15:19:04 gawthrop + ## ## Now uses __ to delimit subsystems in names. + ## ## + ## ## Revision 1.48 2003/03/13 15:10:26 gawthrop + ## ## Removed redundant final column + ## ## + ## ## Revision 1.47 2003/02/28 09:12:17 gawthrop + ## ## Two more columns in _stuc.txt: causality and subsystem name + ## ## + ## ## Revision 1.46 2002/08/20 15:51:17 gawthrop + ## ## Update to work with ident DIY rep + ## ## + ## ## Revision 1.45 2002/05/22 09:15:03 gawthrop + ## ## Non-repetitive components no longer use _1 in names + ## ## + ## ## Revision 1.44 2001/11/11 18:12:30 geraint + ## ## Moved fflush(structure_file) out of loop. + ## ## + ## ## Revision 1.43 2001/11/11 08:32:00 geraint + ## ## fflush (structure_file). + ## ## + ## ## Revision 1.42 2001/04/23 16:23:30 gawthrop + ## ## Now stips ; from bottlom level argument list - allows aliasing of + ## ## parts of a,b,c (eg a,b by using a,b;c + ## ## + ## ## Revision 1.41 2001/04/15 21:15:41 geraint + ## ## Added interface definition rep: _ICD.(txt|c|cc|m). + ## ## + ## ## Revision 1.40 2001/02/05 01:50:29 geraint + ## ## No unit type comparison at ports if either is "none". + ## ## + ## ## Revision 1.40 2000/12/16 08:10:55 geraint + ## ## No unit type comparison at ports if either is "none". + ## ## + ## ## Revision 1.39 2000/11/16 12:54:14 peterg + ## ## Added checking of unit consistency at ports + ## ## + ## ## Revision 1.38 2000/11/16 10:00:57 peterg + ## ## *** empty log message *** + ## ## + ## ## Revision 1.37 2000/11/12 16:45:57 peterg + ## ## Close ese file before recursive call of cbg2ese -- reopen when + ## ## finished. + ## ## THis prevents a new file being opened for each subsystem which fails + ## ## when > 1K files opened + ## ## + ## ## Revision 1.36 2000/10/13 10:54:47 peterg + ## ## Now writes out a unique name for each state etc + ## ## + ## ## Revision 1.35 2000/10/12 19:27:47 peterg + ## ## Now writes the aliased args + ## ## + ## ## Revision 1.34 2000/09/01 08:42:44 peterg + ## ## Cahged somes ends to end for etc for clarity + ## ## + ## ## Revision 1.33 2000/09/01 08:05:32 peterg + ## ## Reformatted with out changing function + ## ## + ## ## Revision 1.32 1998/11/16 13:01:19 peterg + ## ## Fixed problem with repetitions>1 due to new data structures -- now + ## ## computes initial next_bond correctly + ## ## + ## ## Revision 1.31 1998/09/24 12:57:44 peterg + ## ## Now ignores aliasing if no arguments given. + ## ## + ## ## Revision 1.30 1998/09/02 11:14:23 peterg + ## ## Revised to use ordered lists of subsystems and ports + ## ## + ## ## Revision 1.29 1998/08/25 09:22:34 peterg + ## ## Correctely recognises port SSs its now easy -- they are in there own + ## ## field + ## ## + ## ## Revision 1.28 1998/08/25 08:31:42 peterg + ## ## Fixed bug - didn't find the ports - use deblank + ## ## + ## ## Revision 1.27 1998/08/25 07:16:49 peterg + ## ## Modified to data struture representation + ## ## + ## ## Revision 1.26 1998/08/24 14:53:55 peterg + ## ## Uses new _cbg structure. + ## ## + ## ## Revision 1.25 1998/07/28 19:05:12 peterg + ## ## Sttill has vector SS port bug? + ## ## + ## ## Revision 1.24 1998/07/27 10:26:02 peterg + ## ## No change - but fixed bug in alias_args + ## ## + ## ## Revision 1.23 1998/07/08 12:33:51 peterg + ## ## Reinstated the infofilenum parameter. + ## ## + ## ## Revision 1.22 1998/07/04 07:10:27 peterg + ## ## Don't evaluate alias if no constitutive relationship or args and write + ## ## message. + ## ## + ## ## Revision 1.21 1998/07/03 18:58:58 peterg + ## ## Put arg alias stuff within function alias_args + ## ## Called recursively to handle arithmetic expressions + ## ## + ## ## Revision 1.20 1998/07/03 14:39:09 peterg + ## ## Added info messages a bit busy now! + ## ## + ## ## Revision 1.19 1998/04/12 11:58:19 peterg + ## ## Rename port components by changing name_r to [name_r + ## ## + ## ## Revision 1.18 1998/04/11 18:59:16 peterg + ## ## at_top_level now global - passed to SS components + ## ## + ## ## Revision 1.17 1998/04/04 10:47:31 peterg + ## ## Uses (coerced) components from _cbg file - _abg not now used here. + ## ## + ## ## Revision 1.16 1998/03/06 09:38:58 peterg + ## ## Now writes correct structure file for multiport C & I + ## ## + ## ## Revision 1.15 1997/12/16 18:24:33 peterg + ## ## Added unknown_input to structure list + ## ## + ## ## Revision 1.14 1997/08/26 07:51:10 peterg + ## ## Now counts the local input and outputs by order of appearence rather + ## ## than by port number - it therfore handles ports with bicausality correctely. + ## ## + ## ## Revision 1.13 1997/05/19 16:45:56 peterg + ## ## Fixed ISW bug -- deleted spurious ISW_eqn.m file + ## ## + ## ## Revision 1.12 1997/04/15 09:17:26 peterg + ## ## Added the structure file - contains details of states etc. + ## ## + ## ## Revision 1.11 1996/12/07 18:20:11 peterg + ## ## Replaces null argument by a default and tells user. + ## ## + ## ## Revision 1.10 1996/12/07 17:37:07 peterg + ## ## Now handles numbered SS ports appearing at top level. + ## ## + ## ## Revision 1.9 1996/12/04 21:49:47 peterg + ## ## Compares full-name with empty string (instead of testing for zero + ## ## length) + ## ## + ## ## Revision 1.8 1996/08/30 16:36:08 peter + ## ## More info written to ese files. + ## ## + ## ## Revision 1.7 1996/08/30 11:23:13 peter + ## ## Argument substitution implemented. + ## ## + ## ## Revision 1.6 1996/08/27 08:04:52 peterg + ## ## Handles complex components and repetative components. + ## ## + ## ## Revision 1.5 1996/08/24 15:02:23 peter + ## ## Writes `END;' to keep reduce happy. + ## ## + ## ## Revision 1.4 1996/08/19 09:03:41 peter + ## ## Handles repeating components. + ## ## + ## ## Revision 1.3 1996/08/18 20:08:02 peter + ## ## Included additional structure: structure(5) = zero_outputs. + ## ## + ## ## Revision 1.2 1996/08/08 18:08:11 peter + ## ## Sorted out file naming sceme + ## ## + ## ## Revision 1.1 1996/08/08 15:53:23 peter + ## ## Initial revision + ## ## + ## ############################################################# + + ## disp("cbg2ese"); + ## system_name, system_type, full_name, repetition + + pc = "%"; + sub_delim = "__"; # Subsystem delimiter + + + unit_error = "Component %s connects inconsistent ports with units %s and %s"; + unit_info = "Component %s connects ports with units %s and %s"; + + ## Set up the names corresponding to the structure matrix. + structure_name = [ + "state ", + "nonstate ", + "input ", + "output ", + "zero_output ", + "unknown_input"]; + + + ## Are we at the top level of the heirarchy? + at_top_level = strcmp(full_name, ""); + + ## Create the (full) system name + if at_top_level + full_name = system_name; + full_name_repetition = system_name; + system_type = system_name; + else + full_name = [full_name, sub_delim, system_name]; + + if (repetition>1) + full_name_repetition = [full_name_repetition, ... + sub_delim, system_name, sub_delim, ... + num2str(repetition)]; + else + full_name_repetition = [full_name_repetition, ... + sub_delim, system_name]; + endif + + end; + + + + cbg_name = [full_name, "_cbg"]; + if exist(cbg_name)~=2 # Return if cbg file doesn't exist + disp([cbg_name, " does not exist"]); + return + end; + + ## Setup files + ese_name = [full_name_repetition, "_ese.r"]; + ese_file = fopen(ese_name, "wt") # open file (first time) + icd_file = fopen([full_name_repetition,"_icd.txt2"],"wt") + + fprintf(ese_file, "\n%s%s Equation file for system %s (file %s)\n", ... + pc, pc, full_name_repetition, ese_name); + fprintf(ese_file, "%s%s Generated by MTT\n\n", pc, pc); + + ## Evaluate the system function to get the bonds + eval(["CBG = ", cbg_name, ";"]); + ##eval(["[bonds,status,system_type,components] = ", cbg_name, ";"]); + ## abg_name = [system_type, "_abg"]; + ## cmp_name = [system_type, "_cmp"]; + ## alias_name = [system_type, "_alias"]; + + ## No longer needed - cbg now has components: + ## eval(["[junk,components]=", abg_name, ";"]); + + ## Find number of bonds + [n_bonds,columns] = size(CBG.bonds); + if (columns ~= 2)&(n_bonds>0) + error("Incorrect bonds matrix: must have 2 columns"); + endif; + + ## Set up initial bond units + for i=1:n_bonds + bond_effort_unit(i,:)="null"; + bond_flow_unit(i,:)="null"; + endfor + + ## ## Find number of components + ## [n_components,columns] = size(components); + ## n_components = n_components + + ## Set up the first dummy bond number - needed for repetative components + ## next_bond = max(max(abs(components)))+1; + next_bond = n_bonds+1; + + ## Set up the counters for the labelled SS. These are, by definition, + ## encountered first and so the counters will not be messed up by subsystems. + local_u_index = 0; + local_y_index = 0; + + if (length(system_args)==0) + mtt_info(sprintf("No arguments given so no argument aliasing done for system %s(%s)", ... + system_name,system_type), infofilenum); + AliasingArguments=0; + else + AliasingArguments=1; + endif; + + if (length(system_cr)==0) + mtt_info(sprintf("No cr given so no cr aliasing done for system %s(%s)", ... + system_name,system_type), infofilenum); + AliasingCRs=0; + else + AliasingCRs=1; endif; + + + fields=["ports";"subsystems"]; # Do for both ports and subsystems - + ## ports first + lists=["portlist";"subsystemlist"]; + for i=1:2 + field=deblank(fields(i,:)); + list=deblank(lists(i,:)); + if isfield(CBG,list); + eval(["namelist=CBG.",list,";"]); # List of ports/subsystems + [N,M]=size(namelist); # Number of ports/subsystems + for j=1:N + comp_name = deblank(namelist(j,:)); # Name of this component + eval(["subsystem=CBG.",field,".",comp_name,";"]); # Pluck out the details + comp = subsystem.connections; # Connections + bond_list = abs(comp); + direction = sign(comp)'*[1 1]; + # Convert from arrow orientated to component orientated causality + comp_bonds = CBG.bonds(bond_list,:).*direction; + + ## disp(["---- ", field, " ---"]); + + if AliasingArguments # Alias the args list if appropriate + message = sprintf("\tfor component %s (%s) within %s", ... + comp_name,subsystem.type,full_name); + if isfield(CBG,"alias") + subsystem.arg = alias_args(subsystem.arg,CBG.alias,";",message,infofilenum,full_name); + endif; + endif; + + if AliasingCRs # Alias the CR list if appropriate + message = sprintf("\tfor component %s (%s) within %s", ... + comp_name,subsystem.type,full_name); + if isfield(CBG,"alias") + subsystem.cr = alias_args(subsystem.cr,CBG.alias,";",message,infofilenum,full_name); + endif; + endif; + + ## Substitute positional ($1 etc) arguments + subsystem.cr = subs_arg(subsystem.cr,system_cr, ... + "lin",full_name,subsystem.type,comp_name,infofilenum); + subsystem.arg = subs_arg(subsystem.arg,system_args, ... + "1",full_name,subsystem.type,comp_name,infofilenum); + + ## change name of 0 and 1 components -- matlab doesn't like numbers here + if strcmp(subsystem.type,"0") + subsystem.type = "zero"; + endif; + if strcmp(subsystem.type,"1") + subsystem.type = "one"; + endif; + + ports = length(bond_list); + + if subsystem.repetitions>1 + port_pairs = ports/2; + if round(port_pairs)~=port_pairs; + mtt_info(["Repeated component ", comp_name, ... + " has an odd number of ports - ignoring repetitions"], infofilenum); + subsystem.repetitions = 1; + endif; + endif; + + if subsystem.repetitions>1 + odd_bonds = bond_list(1:2:ports-1); + even_bonds = bond_list(2:2:ports); + endif; + + for k = 1:subsystem.repetitions + + if subsystem.repetitions>1 + + if k==1 + bond_list(1:2:ports-1) = odd_bonds; + else + bond_list(1:2:ports-1) = bond_list(2:2:ports); + endif; + + if k==subsystem.repetitions + bond_list(2:2:ports) = even_bonds; + else + new_bonds = [next_bond:next_bond+port_pairs-1]; + next_bond = next_bond+port_pairs; + bond_list(2:2:ports) = new_bonds; + endif; + + endif; + + ## Invoke the appropriate equation-generating procedure + name_r = full_name_repetition; + eqn_name = [subsystem.type, "_eqn"]; + + if exist(eqn_name)~=2 ## Try a compound component + fclose(ese_file); # Close but reopen later + + disp("---PUSH---"); bond_list, comp_name, subsystem.type + structure = cbg2ese(comp_name, subsystem.type, subsystem.cr, subsystem.arg, ... + full_name, full_name_repetition, ... + k, structure, structure_file, infofilenum); + + disp("---POP---"); + ese_file = fopen(ese_name, "at") # open file (again) + + eval(["subABG = ",subsystem.type , "_abg;"]); # Get the information + + ## Link up the bonds for this compound component + fprintf(ese_file, ... + "\n\t%s Equations linking up subsystem %s (%s)\n\n", ... + pc, comp_name, subsystem.type); + + if (k>1) + name_comp_name = sprintf("%s%s%s%s%d", ... + full_name_repetition, sub_delim, ... + comp_name, sub_delim, k); + else + name_comp_name = sprintf("%s%s%s", ... + full_name_repetition, sub_delim, ... + comp_name); + endif + + + printf("\n\t%s Equations linking up subsystem %s (%s)\n\n", ... + pc, comp_name, subsystem.type); + + u_index = 0; y_index = 0; ## Count the inputs and outputs + for port_number=1:length(bond_list) + repetition,port_number + port_bond_number = bond_list(port_number) +# this_bond_effort_unit = ... +# deblank(bond_effort_unit(port_bond_number,:)) +# this_bond_flow_unit = ... +# deblank(bond_flow_unit(port_bond_number,:)); + +# ## Extract the unit/domain stuff +# this_port_name = subABG.portlist(port_number,:); + +# eval(sprintf("this_port = subABG.ports.%s;", ... +# this_port_name)); +# if isfield(this_port,"units") +# eval(["effort_unit = ... +# subABG.ports.",this_port_name,".units.effort;"]); +# eval(["flow_unit = ... +# subABG.ports.",this_port_name,".units.flow;"]); +# else +# effort_unit = "none"; +# flow_unit = "none"; +# endif + +# ## and check consistency +# ## Efforts +# if strcmp(this_bond_effort_unit,"null") # set +# bond_effort_unit = ... +# [bond_effort_unit(1:port_bond_number-1,:) +# effort_unit +# bond_effort_unit(port_bond_number+1:n_bonds,:) +# ] +# elseif (!strcmp(this_bond_effort_unit,"none") && !strcmp(effort_unit,"none")) # check +# mtt_info(sprintf(unit_info,full_name, effort_unit, ... +# this_bond_effort_unit), infofilenum); +# if !strcmp(this_bond_effort_unit,effort_unit) +# error_string = sprintf(unit_error, full_name, ... +# effort_unit, ... +# this_bond_effort_unit); +# mtt_error(error_string); +# endif +# endif +# ## Flows +# if strcmp(this_bond_flow_unit,"null") # set +# bond_flow_unit = ... +# [bond_flow_unit(1:port_bond_number-1,:) +# flow_unit +# bond_flow_unit(port_bond_number+1:n_bonds,:) +# ] +# elseif (!strcmp(this_bond_flow_unit,"none") && !strcmp(flow_unit,"none")) # check +# mtt_info(sprintf(unit_info,full_name, flow_unit, ... +# this_bond_flow_unit), infofilenum); +# if !strcmp(this_bond_flow_unit,flow_unit) +# error_string = sprintf(unit_error, full_name, ... +# flow_unit, ... +# this_bond_flow_unit); +# mtt_error(error_string); +# endif +# endif + + + ## Effort + if comp_bonds(port_number,1)==1 # Source + u_index = u_index + 1; + fprintf(ese_file, "%s_MTTu%d := %s;\n", ... + name_comp_name, u_index, varname(name_r, ... + bond_list(port_number),1)); + else # Sensor + y_index = y_index + 1; + fprintf(ese_file, "%s := %s_MTTy%d;\n", ... + varname(name_r, ... + bond_list(port_number),1), name_comp_name, y_index); + end; + ## Flow + if comp_bonds(port_number,2)==-1 # Source + u_index = u_index + 1; + fprintf(ese_file, "%s_MTTu%d := %s;\n", ... + name_comp_name, u_index, varname(name_r, ... + bond_list(port_number),-1)); + else # Sensor + y_index = y_index + 1; + fprintf(ese_file, "%s := %s_MTTy%d;\n", ... + varname(name_r, ... + bond_list(port_number),-1), name_comp_name, y_index); + end; + end; + + else # its a simple component + fprintf(ese_file, "\n\t%s Equations for component %s (%s), repetition %d\n\n", ... + pc, comp_name, subsystem.type,k); + + + ## # Is it a named port? (Name begins with [) + ## Named_Port = (comp_name(1)=="["); + + if strcmp(field,"ports") #Add [ to start of name + name_r = ["[" name_r]; + endif; + + ## Save the current structure + old_structure = structure; + + ## Generate the simple component equations + ## .. firstly replacing ; by , in argument list + subsystem_arg = strrep(subsystem.arg,";",","); + + eval(["structure = ", ... + eqn_name, ... + "(name_r,bond_list,comp_bonds, ... + direction,subsystem.cr,subsystem_arg,structure,ese_file);" ]); + + ## If structure has changed, write info to structure file. + structure_change = structure-old_structure; + + ## The following line is to avoid probs with multiport C or I + ## it needs changing to handle multi ports correctly + structure_changes = sum(structure_change); + + structure_change = structure_change>zeros(size(structure_change)); + if structure_changes>0 + which_indices = getindex(structure_change,1); + which_indices = which_indices(:,2)'; + for which_index=which_indices + value = structure(which_index); + value_change=value-old_structure(which_index); + for k=1:value_change + if strcmp(subsystem.type,"SS") # One port, may be bicausal + cause_name = cause2name(-comp_bonds(1,k)); + else # Maybe multiport - but unicausal + cause_name = cause2name(-comp_bonds(k,1)); + endif + fprintf(structure_file, ... + "%s\t%i\t%s\t%s%s%s\t%i\t%s\n", ... + structure_name(which_index,:), value-k+1, ... + comp_name, full_name_repetition, sub_delim, comp_name, ... + repetition, cause_name); + endfor; + endfor; + endif; + endif + endfor + fflush (structure_file); + + ## component interface definition + if isfield(CBG,"icd") + if isfield(CBG.icd,comp_name) + if AliasingArguments + subsystem.icd = alias_args(eval(["CBG.icd.",comp_name]),CBG.alias,";",message,infofilenum,full_name); + endif + endif + if (isfield(subsystem,"icd")) + subsystem.icd = subs_arg(subsystem.icd,system_args, ... + "null",full_name,subsystem.type,comp_name,infofilenum); + + fprintf(icd_file,"%s_%s\t%s\t",full_name_repetition,comp_name,subsystem.icd); + if (comp_bonds(1) == 1) + fprintf(icd_file,"output,"); + elseif (comp_bonds(1) == -1) + fprintf(icd_file,"input,"); + endif + if (comp_bonds(2) == 1) + fprintf(icd_file,"input\n"); + elseif (comp_bonds(2) == -1) + fprintf(icd_file,"output\n"); + endif + endif + endif # End of component interface definition + + endfor # [subsystem,comp_name] = CBG_field + endif # isfield(CBG,field) + endfor # i=1:2 + + fclose(icd_file); + fclose(ese_file); # Close + +endfunction + + + ADDED mtt/bin/trans/m/cbg2fig.m Index: mtt/bin/trans/m/cbg2fig.m ================================================================== --- mtt/bin/trans/m/cbg2fig.m +++ mtt/bin/trans/m/cbg2fig.m @@ -0,0 +1,318 @@ +function cbg2fig(system_name, system_type, full_name, ... + stroke_length, stroke_thickness, stroke_colour, ... + comp_font, comp_colour_u, comp_colour_o) + + ## cbg2fig - converts causal bg to figure + ## + ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% Model + ## Transformation Tools %%%%% + ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ## + ## Matlab function cbg_m2fig Causal bond graph: mfile format to fig + ## file format The resultant fig file is the original _abg.fig with + ## additional causal strokes superimposed. cbg2fig(system_name, ... + ## system_type, full_name, ... stroke_length, stroke_thickness, + ## stroke_colour, ... comp_font, comp_colour_u, comp_colour_o) + ## Note this uses geometric info from _rbg.fig - so don't use with + ## -abg switch. + + ## P.J.Gawthrop May 1996 + ## Copyright (c) P.J.Gawthrop, 1996. + + ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ## %% Version control history + ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ## %% $Id$ + ## %% $Log$ + ## %% Revision 1.17 2004/09/12 22:27:27 geraint + ## %% Appended 't' to fopen mode string to open in text mode. + ## %% + ## %% Revision 1.16 2001/03/23 14:58:16 gawthrop + ## %% Fixed cosmetic bugs -- component display + ## %% + ## %% Revision 1.15 2001/03/23 11:20:20 gawthrop + ## %% Fixed bug with vector components --NB takes geometric info from _rbg.fig + ## %% + ## %% Revision 1.14 2000/09/14 12:07:15 peterg + ## %% Fixed overwriting of ports. + ## %% + ## %% Revision 1.13 2000/09/14 09:12:19 peterg + ## %% Fixed stroke orientation bug with bent bonds + ## %% Uses new info from the _rbg.m file - 4 new cols in rbonds + ## %% + ## %% Revision 1.12 2000/09/14 08:07:00 peterg + ## %% Reformated as an Octave function + ## %% + ## %% Revision 1.11 2000/01/18 14:52:02 peterg + ## %% Removed recursion --- maybe put back via a flag later + ## %% + ## %% Revision 1.10 1998/12/14 15:27:32 peterg + ## %% Added separate handling of ports ( poss zero) + ## %% + ## %% Revision 1.9 1998/08/25 06:43:02 peterg + ## %% Revised (partially) for data strucures - needs to include graphic info + ## %% in abg file. + ## %% + ## %% Revision 1.8 1998/04/04 10:45:01 peterg + ## %% Don't do strokes on port bonds + ## %% + ## %% Revision 1.7 1997/08/19 09:49:19 peterg + ## %% Modified to take account of the expanded vector bonds. Only displays + ## %% causality corresponding to the bond connecting the first element of + ## %% the vector ports. + ## %% + ## %% Revision 1.6 1997/08/19 09:41:47 peterg + ## %% Some debugging lines added. + ## %% + ## %% Revision 1.5 1997/05/16 07:33:45 peterg + ## %% Now checks to see if sub system is a simple component before + ## %% recursion. + ## %% 0 --> zero + ## %% 1 --> one + ## %% + ## %% Revision 1.4 1996/12/07 21:34:52 peterg + ## %% Tests for null string with strcmp + ## %% + ## %% Revision 1.3 1996/08/08 15:52:28 peter + ## %% Recursive version. + ## %% Fails due to octave bug - reported. + ## %% + ## %% Revision 1.2 1996/08/05 20:15:39 peter + ## %% Prepared for recursive version. + ## %% + ## %% Revision 1.1 1996/08/05 18:12:25 peter + ## %% Initial revision + ## %% + ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + if nargin<4 + stroke_length = 20; + end; + + if nargin<5 + stroke_thickness = 2; + end; + + if nargin<6 + stroke_colour = 1; %Blue + end; + + if nargin<7 + comp_font = 18; %Helvetica bold + end; + + if nargin<8 + comp_colour_u = 12; %Green + end; + + if nargin<9 + comp_colour_o = 4; %Red + end; + + ## Create a back slash '\' character. + bs = char(92); + + ## Create the (full) system name + if strcmp(full_name,'') + full_name = system_name; + else + full_name = [full_name, '_', system_name]; + end; + + full_name_type = [full_name, '_', system_type]; + ## $$$ fig_name = [full_name_type, '_cbg.fig']; + fig_name = [full_name, '_cbg.fig'] + + ## Return if initial fig file doesn't exist + if exist(fig_name)~=2 + return + end; + + ## Setup file - append to the fig file + filenum = fopen(fig_name, 'at'); + + ## Get the raw and the processed bonds + eval(['[rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = ', system_type, '_rbg;']); + eval(["ABG = ", system_type, "_abg;"]); + bonds=ABG.bonds; + + ## Original number of bonds + [n_bonds,junk] = size(rbonds); + + ## Get the causal bonds + #eval(['[cbonds,status]=', full_name, '_cbg;']); + eval(["CBG = ", full_name, "_cbg;"]); + cbonds=CBG.bonds; + + ## Check sizes + [Rows,Columns] = size(rcomponents); + if (Columns ~= 13) + error('Incorrect rcomponents matrix: must have 13 columns'); + end; + M_components = Columns; + N_rcomponents = Rows; # Number of raw components + + [N_rports,junk] = size(port_list); + [N_components, Columns] = size(CBG.subsystemlist); # Number of derived + # components + + if isfield(CBG,'portlist') + [N_ports, Columns] = size(CBG.portlist); + else + N_ports = 0; + end + + + ## Rotation matrix + rot = [0 -1; 1 0]; + + + ## Determine coordinates of the arrow end of the bond and the other end + ## and other geometry + other_end_1 = rbonds(:,1:2); + arrow_end = rbonds(:,3:4); + other_end_2 = rbonds(:,5:6); + + distance_1 = length2d(other_end_1 - arrow_end); + distance_2 = length2d(other_end_2 - arrow_end); + which_end = (distance_1>distance_2)*[1 1]; + one = ones(size(which_end)); + other_end = which_end.*other_end_1 + (one-which_end).*other_end_2; + arrow_barb = which_end.*other_end_2 + (one-which_end).*other_end_1; + arrow_vector = arrow_barb-arrow_end; + unit_arrow_vector = arrow_vector./(length2d(arrow_vector)*[1 1]); + + ## Extract directional information + arrow_end_direction = [rbonds(:,7), rbonds(:,8)]; + other_end_direction = [rbonds(:,9), rbonds(:,10)]; + + + ## Get indices of bonds with changed causality -- but ignore the extra bonds + ## due to vector bond expansion + changed_e = bonds(1:n_bonds,1)~=cbonds(1:n_bonds,1); + changed_f = bonds(1:n_bonds,2)~=cbonds(1:n_bonds,2); + changed = changed_e|changed_f; + + index_e = getindex(changed_e,1)'; + index_f = getindex(changed_f,1)'; + index_ef = getindex(changed,1)'; + + ## Print the new strokes in fig format + if index_ef(1,1)>0 + for i = index_e # Do the effort stroke - opp. side to arrow + if cbonds(i,1)==1 # Stroke at arrow end + bond_vector = arrow_end_direction(i,:); # Directional vector + stroke_end_1 = arrow_end(i,:); + else + bond_vector = other_end_direction(i,:); # Directional vector + stroke_end_1 = other_end(i,:); + end; + + ## Work out the direction for the stroke (right angles to bond) + unit_bond_vector = bond_vector./(length2d(bond_vector)*[1 1]); + unit_stroke_vector = (rot*unit_bond_vector')'; + + sig = sign(unit_arrow_vector(i,:)*unit_stroke_vector'); + stroke_end_2 = stroke_end_1 - stroke_length*sig*unit_stroke_vector; + + + ## print the fig3 format firstline spec. + polyline = 2; + firstline = fig3(polyline,stroke_thickness,stroke_colour); + fprintf(filenum, '%s\n', firstline); + + fprintf(filenum, ' %4.0f %4.0f %4.0f %4.0f \n', ... + stroke_end_1(1), stroke_end_1(2), ... + stroke_end_2(1), stroke_end_2(2) ); + end; + + for i = index_f # Do the flow stroke - same side as arrow + if cbonds(i,2)==1 # Stroke at arrow end + bond_vector = arrow_end_direction(i,:); # Directional vector + stroke_end_1 = arrow_end(i,:); + else + bond_vector = other_end_direction(i,:); # Directional vector + stroke_end_1 = other_end(i,:); + end; + + ## Work out the direction for the stroke (right angles to bond) + unit_bond_vector = bond_vector./(length2d(bond_vector)*[1 1]); + unit_stroke_vector = (rot*unit_bond_vector')'; + + sig = sign(unit_arrow_vector(i,:)*unit_stroke_vector'); + stroke_end_2 = stroke_end_1 + stroke_length*sig*unit_stroke_vector; + + ## print the fig3 format firstline spec. + polyline = 2; + firstline = fig3(polyline,stroke_thickness,stroke_colour); + fprintf(filenum, '%s\n', firstline); + + fprintf(filenum, ' %4.0f %4.0f %4.0f %4.0f \n', ... + stroke_end_1(1), stroke_end_1(2), ... + stroke_end_2(1), stroke_end_2(2) ); + end; + end; + + ## Print all the components - coloured acording to causality. + ## Miss out the ports + + for i = N_rports+1:N_rcomponents + eval(['[comp_type,comp_name] = ', system_type, '_cmp(i);']); + eval(["comp_status = CBG.subsystems.", comp_name, ".status;"]); + +# if i>N_rports # Subsystem +# comp_name = CBG.subsystemlist(i-N_rports,:); +# eval(["comp_status = CBG.subsystems.", comp_name, ".status;"]); +# else +# comp_name = CBG.portlist(i,:); +# eval(["comp_status = CBG.ports.", comp_name, ".status;"]); +# end + + + fig_params = rcomponents(i,3:M_components); + coords = rcomponents(i,1:2); + + if comp_status==-1 # Then under causal + fig_params(3) = comp_colour_u; + fig_params(6) = comp_font; + end; + + if comp_status==1 # Then over causal + fig_params(3) = comp_colour_o; + fig_params(6) = comp_font; + end; + + + ## Now print the component in fig format + + if index(comp_name,"mtt")==1 # Its a dummy name + typename = comp_type; # just show type + else + typename = [comp_type,":",comp_name]; + endif; + + Terminator = [bs, '001']; + real_index = 8; + for j = 1:length(fig_params) + if j==real_index + fprintf(filenum, '%2.4f ', fig_params(j)); + else + fprintf(filenum, '%i ', fig_params(j)); + endif + + + endfor + + + + fprintf(filenum, '%1.0f %1.0f ', coords(1), coords(2)); + fprintf(filenum, '%s%s\n', typename, Terminator); + + endfor + + ## Close the file + fclose(filenum); + return + +endfunction ADDED mtt/bin/trans/m/cr2name.m Index: mtt/bin/trans/m/cr2name.m ================================================================== --- mtt/bin/trans/m/cr2name.m +++ mtt/bin/trans/m/cr2name.m @@ -0,0 +1,67 @@ +function crname = cr2name(name,RHS_number,LHS_cause,RHS_cause,cr,args,port); +% cr2name - Constructs a string for the cr of a component. +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function cr2name +% cr2name(name,RHS_number,LHS_cause,RHS_cause,cr,args); + +% Copyright (c) P.J. Gawthrop, 1996. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/08/22 18:31:06 peter +% %% Fixed comment bug. +% %% +% %% Revision 1.1 1996/08/22 13:14:39 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin<7 + port=0 +end; + + +if length(args)==0 + a_comma = ''; +else + a_comma = ','; +end; + +if length(cr)==0 + cause_name = ''; + lp = ''; + rp = ''; + c_comma = ''; +else + cause_name = cause2name(LHS_cause); + lp = '('; + rp = ')'; + c_comma = ','; +end + +if port == 0 + port_name = ''; + p_comma = ''; +else + port_name = sprintf('%1.0f',port); + p_comma = ','; +end; + +crname = sprintf('%s%s%s%s%s%s%s%s%s\t%s', ... + cr,lp, args, a_comma, port_name, p_comma, cause_name, c_comma, ... + varname(name, RHS_number,RHS_cause),rp); + + + + + + + ADDED mtt/bin/trans/m/csm2sm.m Index: mtt/bin/trans/m/csm2sm.m ================================================================== --- mtt/bin/trans/m/csm2sm.m +++ mtt/bin/trans/m/csm2sm.m @@ -0,0 +1,15 @@ +function [A,B,C,D] = csm2sm(A,B,C,D,E); +% [A,B,C,D] = csm2sm(A,B,C,D,E); +% Converts constrained-state matrices to state matrices. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +A = E\A; +B = E\B; + ADDED mtt/bin/trans/m/dm2fr.m Index: mtt/bin/trans/m/dm2fr.m ================================================================== --- mtt/bin/trans/m/dm2fr.m +++ mtt/bin/trans/m/dm2fr.m @@ -0,0 +1,89 @@ +function fr = dm2fr(A,B,C,D,E,W,u0) +# fr = dm2fr(A,B,C,D,E,W,u0) +# Descriptor matrix to frequency response. +# A,B,C,D,E - descriptor matrices +# W vector of frequency points +# u0 input gain vector: u = u0*unit phasor + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.8 1997/06/13 13:05:38 peterg +# ## Replaced 'C*( (E*j*w - A) \ B*u0 ' by C*( inv(E*j*w - A)*B*u0 ). \ +# ## seems to have a bug for complex nos (??) +# ## +# ## Revision 1.7 1996/11/06 16:40:38 peterg +# ## Explicit definition of j +# ## +# ## Revision 1.6 1996/08/24 14:22:23 peter +# ## Put in a ; to avoid excessive log output. +# ## +# ## Revision 1.5 1996/08/16 14:26:37 peter +# ## Check and fix size of u0. +# ## +# ## Revision 1.4 1996/08/15 12:50:51 peter +# ## Put in a conj to undo effect of transpose. +# ## +# ## Revision 1.3 1996/08/15 11:53:44 peter +# ## Now has u0 input vector +# ## +# ## Revision 1.2 1996/08/15 10:24:28 peter +# ## Includes u0 argument. +# ## +# ## Revision 1.1 1996/08/10 14:11:28 peter +# ## Initial revision +# ## +# ############################################################### + +[Ny,Nu] = size(D); +[Ny,Nx] = size(C); +N = length(W); + +if nargin<7 + U0 = zeros(Nu,1); + U0(1) = 1; +else + for i=1:Nu + U0(i) = u0(i); + end; +end; + +u0 = U0; + +[n,m]=size(W); +if m>n + W=W'; +end; + +[n,m]=size(u0); +if m>n + u0=u0'; +end; + +j = sqrt(-1); +fr = zeros(N,Ny); +i = 0; +for w = W' + i = i+1; + ## EjA = E*j*w - A; + ## iEjA = conj(EjA)*inv(conj(EjA)*EjA); + ## FR = C*iEjA*B*u0 + D*u0; + FR = C*( (E*j*w - A) \ B*u0 ) + D*u0; + ## FR = C*( inv(E*j*w - A)*B*u0 ) + D*u0; + fr(i,:) = conj(FR'); +end; + + + + + + + + + + + + + ADDED mtt/bin/trans/m/dm2ir.m Index: mtt/bin/trans/m/dm2ir.m ================================================================== --- mtt/bin/trans/m/dm2ir.m +++ mtt/bin/trans/m/dm2ir.m @@ -0,0 +1,40 @@ +function ir = dm2ir(A,B,C,D,E,T); +% ir = dm2ir(A,B,C,D,E,T); +% Descriptor matrix to impulse response. +% NB At the moment - this assumes that E is unity ..... +% A,B,C,D,E - descriptor matrices +% T vector of time points + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1996/08/10 14:16:04 peter +% %% Now has T vector input - it was tmax & tstep +% %% +% %% Revision 1.2 1996/08/10 11:49:39 peter +% %% Fixed multi-input/output problem +% %% +% %% Revision 1.1 1996/08/10 10:26:00 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +[N,M] = size(T); +if M>N + T = T'; + N = M; +end; + +[Ny,Nu] = size(D); +NN=Ny*Nu; + +ir = zeros(N,NN); +i = 0; +for t = T' + i=i+1; + ir(i,:) = reshape(C*expm(A*t)*B, 1,NN); +end; + ADDED mtt/bin/trans/m/dm2sr.m Index: mtt/bin/trans/m/dm2sr.m ================================================================== --- mtt/bin/trans/m/dm2sr.m +++ mtt/bin/trans/m/dm2sr.m @@ -0,0 +1,66 @@ +function [Y,X] = dm2sr(A,B,C,D,E,T,u0,x0); +% [Y,X] = dm2sr(A,B,C,D,E,T,u0,x0); +% Descriptor matrix to impulse response. +% NB At the moment - this assumes that E is unity ..... +% A,B,C,D,E - descriptor matrices +% T vector of time points +% u0 input gain vector: u = u0*unit step. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 1996/08/15 08:34:08 peter +% %% Added step gain (u0) and initial condition (x0) +% %% +% %% Revision 1.3 1996/08/11 19:33:24 peter +% %% Replaced exp by expm - whoops! +% %% +% %% Revision 1.2 1996/08/11 10:37:40 peter +% %% Corrected mistake in step-response calculation. +% %% +% %% Revision 1.1 1996/08/11 09:42:40 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +[Ny,Nu] = size(D); +[Ny,Nx] = size(C); + +if nargin<7 + u0 = zeros(Nu,1); + u0(1) = 1; +end; + +if nargin<8 + x0 = zeros(Nx,1); +end; + +[N,M] = size(T); +if M>N + T = T'; + N = M; +end; + +one = eye(Nx); + +Y = zeros(N,Ny); +X = zeros(N,Nx); +i = 0; +for t = T' + i=i+1; + if Nx>0 + expAt = expm(A*t); + x = ( A\(expAt-one) )*B*u0 + expAt*x0; + X(i,:) = x'; + if Ny>0 + y = C*x + D*u0; + Y(i,:) = y'; + end; + elseif Ny>0 + y = D*u0; + Y(i,:) = y'; + end; +end; + ADDED mtt/bin/trans/m/equation.m Index: mtt/bin/trans/m/equation.m ================================================================== --- mtt/bin/trans/m/equation.m +++ mtt/bin/trans/m/equation.m @@ -0,0 +1,103 @@ +function eqn = equation(comp_type, name,cr,args,outbond,outcause,outport, ... + inbonds,incauses,inports) + ## eqn is a string containing the equation + ## + ## + ## ###################################### + ## ##### Model Transformation Tools ##### + ## ###################################### + ## + ## Matlab function equations.m + ## eqn = equation(name,cr,args,outbond,outcause,outport, ... + ## inbonds,incauses,inports) + + + ## ############################################################### ## Version + ## control history + ## ############################################################### ## $Id: + ## equation.m,v 1.6 2000/12/27 16:06:00 peterg Exp $ ## $Log: + ## equation.m,v $ ## Revision 1.6 2000/12/27 16:06:00 peterg ## *** + ## empty log message *** ## ## Revision 1.5 1996/12/05 11:26:51 + ## peterg ## Null strings now detected with strcmp not length. ## ## + ## Revision 1.4 1996/09/12 16:42:01 peter ## Default now out side + ## this function - need to be none for each ## component. ## ## + ## Revision 1.3 1996/09/12 12:03:58 peter ## Added some error + ## checking. ## If no constitutive relationship, only add diagonal + ## elementts to ## default unity output. ## ## Revision 1.2 + ## 1996/09/10 11:29:47 peter ## Removed causality & port info when no + ## constitutive relationship. ## ## Revision 1.1 1996/09/10 11:11:11peter + ## ## Initial revision ## + ## ############################################################### + + + ## Find the number of inports + nports = length(inbonds); + + ## Check some arguments + if length(incauses) ~= nports + error("equation.m: incauses inconsistent with inbonds"); + endif + + + if length(inports) ~= nports + error("equation.m: inports inconsistent with inbonds"); + endif + + + ## Set up LHS + LHS = varname(name, outbond, outcause); + + ## Set up various strings to get correct syntax if some strings are empty + if strcmp(cr,"") + cause_name = ""; + port_name = ""; + lp = ""; + rp = ""; + c_comma = ""; + else + cause_name = cause2name(outcause); + port_name = sprintf("%i", outport'); + lp = sprintf("(%s, ", comp_type); + rp = ")"; + c_comma = ","; + end + + if strcmp(args,"") + a_comma = ""; + else + a_comma = ","; + endif + + + ## Set up first line of RHS + RHS1 = sprintf("%s%s%s%s%s%s%s%s", ... + cr, lp, args, a_comma, cause_name, c_comma, port_name, c_comma); + + + ## Set up rest of RHS - the input variables, causality and ports. + RHS2 = ""; + for i=1:nports + RHS2 = sprintf("%s\t%s", ... + RHS2, varname(name, inbonds(i), incauses(i))); + + if strcmp(cr,"")==0 # add the causality & port info + RHS2 = sprintf("%s,%s,%i", ... + RHS2, cause2name(incauses(i)), inports(i)); + + endif + + if (i1 # Do a file in another langueage + sleep(1); + psfilename = sprintf("%s.%s",filename,language); + convert = sprintf("fig2dev -L%s %s > %s", language, figfilename, psfilename); + system(convert); + endif + + gset key # Put it back +endfunction ADDED mtt/bin/trans/m/getdynamic.m Index: mtt/bin/trans/m/getdynamic.m ================================================================== --- mtt/bin/trans/m/getdynamic.m +++ mtt/bin/trans/m/getdynamic.m @@ -0,0 +1,36 @@ +function [name,prefered] = getdynamic(subsystems); +# Get the index of a dynamic components which is not set. + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.2 1996/08/16 12:51:22 peter +# ## Removed debugging lines. +# ## +# ## Revision 1.1 1996/08/16 12:50:41 peter +# ## Initial revision +# ## +# ############################################################### + + prefered = 0; # No prefered causality to start with + for [subsystem,name] = subsystems + if subsystem.status==-1 # Undercausal + if strcmp(subsystem.type,'C') + prefered=-1; + break; + endif; + if strcmp(subsystem.type,'I') + prefered=1; + break; + endif; + endif; + endfor; + + if prefered==0 + name = ""; + end; + +endfunction + ADDED mtt/bin/trans/m/getindex.m Index: mtt/bin/trans/m/getindex.m ================================================================== --- mtt/bin/trans/m/getindex.m +++ mtt/bin/trans/m/getindex.m @@ -0,0 +1,46 @@ +function [index, n, otherindex, m] = getindex(array,value); +% Finds the n indices of the elements of array equal to value +% otherindex contains indeces of the the m other elements. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +[N,M] = size(array); +n=0; m=0; +for i=1:N + for j = 1:M + if array(i,j)==value + n=n+1; + index(n,:) = [i j]; + else + m=m+1; + otherindex(m,:) = [i j]; + end; + end; +end; + + +if (M==1)&(n>0) + index = index(:,1); +end; + +if (M==1)&(m>0) + otherindex = otherindex(:,1); +end; + +% Octave doesn't like empty matrices +if n==0 + index=0; +end; + +if m==0 + otherindex=0; +end; + + + ADDED mtt/bin/trans/m/ibg2abg.m Index: mtt/bin/trans/m/ibg2abg.m ================================================================== --- mtt/bin/trans/m/ibg2abg.m +++ mtt/bin/trans/m/ibg2abg.m @@ -0,0 +1,635 @@ +## -*-octave-*- + +function [bonds,components,n_vector_bonds] = ... + ibg2abg(name,bonds,infofile,errorfile) + + ## write useful quantity of data to log + struct_levels_to_print(6); + + ################################ + ## create component structure ## + ################################ + + ## loop over each bond in ibg.m file + for [bond, bond_name] = bonds + ## get the bond number + bond_name + i = str2num(strtok(bond_name, "bond")) + + ## populate "head" and "tail" structures + ## then copy the contents to an overall structure + + ## track (signed) vector bond number within each component + head.index = +i + tail.index = -i + + ## extract type of component at each end + head_type = deblank(char(strsplit(bond.head.component, ":"))(1,:)) + tail_type = deblank(char(strsplit(bond.tail.component, ":"))(1,:)) + + ## extract name of component at each end + head_name = deblank(char(strsplit(bond.head.component, ":"))(2,:)) + tail_name = deblank(char(strsplit(bond.tail.component, ":"))(2,:)) + + ## extract port label data + head.label = bond.head.ports + tail.label = bond.tail.ports + + disp("--checking head and tail for components or ports --") + ## determine whether internal port or subsystem + ## and fix names of ports + if (strcmp(head_type, "SS") & (index(head_name, "[") == 1)) + head_comp_or_port = "port" + head_name = mtt_strip_name(head_name); + else + head_comp_or_port = "comp" + endif + if (strcmp(tail_type, "SS") & (index(tail_name, "[") == 1)) + tail_comp_or_port = "port" + tail_name = mtt_strip_name(tail_name); + else + tail_comp_or_port = "comp" + endif + + ## copy data to object structure (objects) + cmd = sprintf("objects.%s.%s.type = '%s';", + head_comp_or_port, head_name, head_type) + eval(cmd) + cmd = sprintf("objects.%s.%s.type = '%s';", + tail_comp_or_port, tail_name, tail_type) + eval(cmd) + + cmd = sprintf("objects.%s.%s.bond%i = head;", + head_comp_or_port, head_name, i) + eval(cmd) + cmd = sprintf("objects.%s.%s.bond%i = tail;", + tail_comp_or_port, tail_name, i) + eval(cmd) + endfor + + disp("--finished extracting data from ibg.m --") + objects + + ## object structure: + ## + ## objects + ## comp + ## %s (name) + ## type + ## bond%i + ## label + ## port + ## %s (name) + ## type + ## bond%i + ## label + ## + ## "comp" contains components, subsystems and external SS + ## "port" contains internal SS:[...] + + #################################################### + ## count number of vector bonds on each component ## + #################################################### + + if (isfield(objects, "comp")) + for [comp, comp_name] = objects.comp + n = size(fieldnames(comp))(1) - 1; + eval(sprintf("objects.comp.%s.n_bonds = %i;", + comp_name, n)); + endfor + endif + + if (isfield(objects, "port")) + for [port, port_name] = objects.port + n = size(fieldnames(port))(1) - 1; + eval(sprintf("objects.port.%s.n_bonds = %i;", + port_name, n)); + endfor + endif + + disp("-- finished counting number of bonds on components --") + objects + + ## objects + ## comp + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + ## port + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + + ######################################################## + ## ensure labels exist on all ports of each component ## + ######################################################## + + if (isfield(objects, "comp")) + for [comp, comp_name] = objects.comp + if (strcmp(comp.type, "0") | strcmp(comp.type, "1")) + + ## convert type + if (strcmp(comp.type, "0")) + comp.type = "zero"; + elseif (strcmp(comp.type, "1")) + comp.type = "one"; + endif + + ## component is a junction + n_named_ports = 0; + + ## get labelled ports + for [bond, bond_name] = comp + if (index(bond_name, "bond") == 1) + if (! isfield (bond, "label")) + bond.label = "[]" + endif + if (! strcmp(bond.label, "[]")) + n_named_ports += 1; + port_label = bond.label; + endif + endif + eval(sprintf("comp.%s = bond;", bond_name)); + endfor + + ## attach labels to unlabelled ports + if (n_named_ports == 0) + mtt_info(sprintf("Defaulting all ports on junction %s to 'in'", ... + comp_name), infofile); + for [bond, bond_name] = comp + if (index(bond_name, "bond") == 1) + bond.label = "in"; + endif + eval(sprintf("comp.%s = bond;", bond_name)); + endfor + elseif (n_named_ports == 1) + mtt_info(sprintf("Defaulting all ports on junction %s to %s", ... + comp_name, port_label), infofile); + for [bond, bond_name] = comp + if (index(bond_name, "bond") == 1) + bond.label = port_label; + endif + eval(sprintf("comp.%s = bond;", bond_name)); + endfor + elseif (n_named_ports != comp.n_bonds) + mtt_error(sprintf("Junction must have 0,1 or %i port labels", ... + comp.n_bonds), errorfile); + endif + + else + ## component is not a junction + for [bond, bond_name] = comp + if (index(bond_name, "bond") == 1) + if (strcmp(bond.label, "[]")) + if (bond.index > 0) + bond.label = "in"; + else + bond.label = "out"; + endif + else + bond.label = mtt_strip_name(bond.label); + endif + endif + eval(sprintf("comp.%s = bond;", bond_name)); + endfor + endif + + eval(sprintf("objects.comp.%s = comp;", comp_name)); + endfor + endif + + #################### + ## expand aliases ## + #################### + + if (isfield(objects, "comp")) + for [comp, comp_name] = objects.comp + if ((! strcmp(comp.type, "zero")) & (! strcmp(comp.type, "one"))) + alias = eval(sprintf("%s_alias", comp.type)); + if (isstruct(alias)) + for [bond, bond_name] = comp; + if (isstruct(bond)) + if (isfield(alias, bond.label)) + old_name = bond.label; + new_name = eval(sprintf("alias.%s", old_name)); + bond.label = new_name; + mtt_info(sprintf("Aliasing [%s] on %s (%s) to [%s]", + old_name, comp_name, comp.type, new_name), + infofile); + endif + endif + eval(sprintf("comp.%s = bond;", bond_name)); + endfor + endif + eval(sprintf("objects.comp.%s = comp;", comp_name)); + endif + endfor + endif + + disp("-- finished expanding aliases --") + objects + + ## objects + ## comp + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + ## port + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + + ########################################## + ## create sub-bonds according to labels ## + ########################################## + + if (isfield(objects, "comp")) + for [comp, comp_name] = objects.comp + for [bond, bond_name] = comp + if (index(bond_name, "bond") == 1) + [sub_bonds, n_sub_bonds] = split_port(bond.label); + for i = 1:n_sub_bonds + eval(sprintf("bond.subbond%i.label = '%s';", + i, deblank(sub_bonds(i,:)))) + endfor + endif + eval(sprintf("comp.%s = bond;", bond_name)); + endfor + eval(sprintf("objects.comp.%s = comp;", comp_name)); + endfor + endif + + if (isfield(objects, "port")) + for [port, port_name] = objects.port + for [bond, bond_name] = port + if (index(bond_name, "bond") == 1) + [sub_bonds, n_sub_bonds] = split_port(bond.label); + for i = 1:n_sub_bonds + eval(sprintf("bond.subbond%i.label = '%s';", + i, deblank(sub_bonds(i,:)))); + endfor + endif + eval(sprintf("port.%s = bond;", bond_name)); + endfor + eval(sprintf("objects.port.%s = port;", port_name)); + endfor + endif + + disp("-- finished creating sub-bonds --") + objects + + ## objects + ## comp + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + ## subbond%i + ## port + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + ## subbond%i + + ######################################### + ## assign a unique number to each bond ## + ######################################### + + unique_bond_number = 0; + + for [bond, bond_name] = bonds + i = str2num(strtok(bond_name, "bond")); + + ## extract type of component at each end + head.type = deblank(char(strsplit(bond.head.component, ":"))(1,:)); + tail.type = deblank(char(strsplit(bond.tail.component, ":"))(1,:)); + + ## extract name of component at each end + head_name = deblank(char(strsplit(bond.head.component, ":"))(2,:)); + tail_name = deblank(char(strsplit(bond.tail.component, ":"))(2,:)); + + ## determine whether internal port or subsystem + ## and fix names of ports + if (strcmp(head.type, "SS") & (index(head_name, "[") == 1)) + head_comp_or_port = "port"; + head_name = mtt_strip_name(head_name); + else + head_comp_or_port = "comp"; + endif + if (strcmp(tail.type, "SS") & (index(tail_name, "[") == 1)) + tail_comp_or_port = "port"; + tail_name = mtt_strip_name(tail_name); + else + tail_comp_or_port = "comp"; + endif + + ## create strings to reference each component + head_str = sprintf("objects.%s.%s.bond%i", + head_comp_or_port, head_name, i) + tail_str = sprintf("objects.%s.%s.bond%i", + tail_comp_or_port, tail_name, i) + + head_bond = eval(head_str); + tail_bond = eval(tail_str); + + ## check compatible sizes + head.n_subs = size(fieldnames(head_bond))(1) - 2; + tail.n_subs = size(fieldnames(tail_bond))(1) - 2; + if (head.n_subs != tail.n_subs) + mtt_error(sprintf("Vector ports '%s' (%s:%s) and '%s' (%s:%s) are not compatible", + head_bond.label, head.type, head_name, + tail_bond.label, tail.type, tail_name), + errorfile); + elseif (head.n_subs > 1) + mtt_info(sprintf("Vector port '%s'(%s:%s) matches '%s' (%s:%s)", + head_bond.label, head.type, head_name, + tail_bond.label, tail.type, tail_type), + infofile); + endif + + ## write type at other end + eval(sprintf("%s.other_end_type = '%s';", + head_str, tail.type)); + eval(sprintf("%s.other_end_type = '%s';", + tail_str, head.type)); + + ## assign bond number + for i = 1:head.n_subs + ++unique_bond_number; + eval(sprintf("%s.subbond%i.index = +%i;", + head_str, i, unique_bond_number)); + eval(sprintf("%s.subbond%i.index = -%i;", + tail_str, i, unique_bond_number)); + + ## write causality for bond + if (strcmp(bond.causality.effort, "head")) + eval(sprintf("causality(%i,1) = +1;", unique_bond_number)); + elseif (strcmp(bond.causality.effort, "tail")) + eval(sprintf("causality(%i,1) = -1;", unique_bond_number)); + else + eval(sprintf("causality(%i,1) = 0;", unique_bond_number)); + endif + + if (strcmp(bond.causality.flow, "head")) + eval(sprintf("causality(%i,2) = -1;", unique_bond_number)); + elseif (strcmp(bond.causality.flow, "tail")) + eval(sprintf("causality(%i,2) = +1;", unique_bond_number)); + else + eval(sprintf("causality(%i,2) = 0;", unique_bond_number)); + endif + + endfor + endfor + + disp("-- finished assigning unique numbers to bonds --") + objects + + ## objects + ## comp + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + ## subbond%i + ## index + ## port + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + ## subbond%i + ## index + + ## causality matrix is called "bonds" + bonds = causality + disp("-- finished writing bonds matrix --") + + ################################# + ## map component data to cmp.m ## + ################################# + + ## count number of components + if (isfield(objects, "comp")) + n_comps = size(fieldnames(objects.comp), 1) + else + n_comps = 0; + endif + + ## count number of internal ports + if (isfield(objects, "port")) + n_ports = size(fieldnames(objects.port), 1) + else + n_ports = 0; + endif + + ## read data from _cmp.m + for cmp = 1:(n_comps + n_ports) + [this_type, this_name] = eval(sprintf("%s_cmp(%i)", name, cmp)); + ## determine if internal port (and fix name) or subsystem + if (strcmp(this_type, "SS") & (index(this_name, "[") == 1)) + comp_or_port = "port"; + this_name = mtt_strip_name(this_name) + else + comp_or_port = "comp"; + endif + eval(sprintf("objects.%s.%s.index = cmp;", comp_or_port, this_name)); + endfor + + disp("-- finished getting component indices from cmp.m --") + objects + + ## objects + ## comp + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + ## subbond%i + ## index + ## index + ## port + ## %s (name) + ## type + ## n_bonds + ## bond%i + ## label + ## subbond%i + ## index + ## index + + ########################## + ## write n_vector_bonds ## + ########################## + + if (isfield(objects, "comp")) + for [comp, comp_name] = objects.comp + n_vector_bonds(comp.index,1) = comp.n_bonds; + endfor + endif + + disp("-- finished writing n_vector_bonds --") + n_vector_bonds + + ########################################### + ## Write connections matrix (components) ## + ########################################### + + if (isfield(objects, "comp")) + n_comps = size(fieldnames(objects.comp))(1); + else + n_comps = 0; + endif + + components = zeros(n_comps+n_ports, max(n_vector_bonds)); + + if (isfield(objects, "comp")) + for [comp, comp_name] = objects.comp + ## get portlist for component + if exist([comp.type, '_cause']) == 0 + eval(sprintf("ABG = %s_abg;", comp.type)); + if isfield(ABG, "portlist") + port_list = ABG.portlist; + else + error(sprintf("Component %s has no ports", comp.type)); + endif + else + ## must be a simple component: + ## lib/comp/simple/comp_ports.m assigns port numbers + port_list = comp_ports(comp.type, comp.n_bonds) + endif + ## but do what with it? + + counter = 0; + + n_ports = size(port_list,1) + if (strcmp(comp.type, "zero")) | (strcmp(comp.type, "one")) + for port = 1 : n_ports + component_type = comp.type + the_port_list = port_list + the_port = port + label = port_list(port,:) + if (index (label, "[") == 1) + label = mtt_strip_name(label) + endif + label = deblank(label) + + for [bond, bond_name] = comp + if (index(bond_name, "bond") == 1) + for [sub_bond, sub_bond_name] = bond + + if (index(sub_bond_name, "subbond") == 1) + sub_bond_label = sub_bond.label + if (index (sub_bond_label, "[") == 1) + sub_bond_label = mtt_strip_name(sub_bond_label) + endif + sub_bond_label = deblank(sub_bond_label) + + if (strcmp(sub_bond_label, label) | strcmp (sub_bond_label,"in")) + components(comp.index, ++counter) = sub_bond.index + endif + + endif + endfor + endif + endfor + endfor + + elseif (n_ports == 1) + ## no ordering necessary + for [bond, bond_name] = comp + if (index(bond_name, "bond") == 1) + for [sub_bond, sub_bond_name] = bond + if (index(sub_bond_name, "subbond") == 1) + components(comp.index, ++counter) = sub_bond.index + endif + endfor + endif + endfor + + else + ## multiple ports, need to order them + for port = 1 : n_ports + component_type = comp.type + the_port_list = port_list + the_port = port + label = port_list(port,:) + if (index (label, "[") == 1) + label = mtt_strip_name(label) + endif + label = deblank(label) + + for [bond, bond_name] = comp + if (index(bond_name, "bond") == 1) + for [sub_bond, sub_bond_name] = bond + + if (index(sub_bond_name, "subbond") == 1) + sub_bond_label = sub_bond.label + if (index (sub_bond_label, "[") == 1) + sub_bond_label = mtt_strip_name(sub_bond_label) + endif + sub_bond_label = deblank(sub_bond_label) + + ## unalias sub_bond label + if exist([comp.type, '_alias']) + eval(sprintf("alias = %s_alias", comp.type)) + if isstruct(alias) + while_counter = 0; + while isfield(alias, sub_bond_label) + old_sub_bond_label = sub_bond_label; + sub_bond_label = eval(sprintf("alias.%s", sub_bond_label)) + if strcmp(old_sub_bond_label, sub_bond_label) + break; + endif + endwhile + endif + endif + + if (strcmp(sub_bond_label, label)) + components(comp.index, ++counter) = sub_bond.index + endif + + endif + endfor + endif + endfor + endfor + + endif + endfor + endif + disp("-- finished getting port_list --") + port_list + + if (isfield(objects, "port")) + for [port, port_name] = objects.port + counter = 0; + for [bond, bond_name] = port + if (index(bond_name, "bond") == 1) + for [sub_bond, sub_bond_name] = bond + if (index(sub_bond_name, "subbond") == 1) + components(port.index, ++counter) = sub_bond.index; + endif + endfor + endif + endfor + endfor + endif + + disp("-- finished writing components matrix --") + components + +endfunction ADDED mtt/bin/trans/m/length2d.m Index: mtt/bin/trans/m/length2d.m ================================================================== --- mtt/bin/trans/m/length2d.m +++ mtt/bin/trans/m/length2d.m @@ -0,0 +1,24 @@ +function len = length2d(vector_array) +% length2d - Finds (geometric) length of row vectors stacked +% into a column vector +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function length2d +% len = length2d(vector_array) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +% + +len = sqrt(sum(vector_array'.^2)'); ADDED mtt/bin/trans/m/makedef.m Index: mtt/bin/trans/m/makedef.m ================================================================== --- mtt/bin/trans/m/makedef.m +++ mtt/bin/trans/m/makedef.m @@ -0,0 +1,131 @@ +function makedef(structure,deffilenum); + + ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ## %% Version control history + ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ## %% $Id$ + ## %% $Log$ + ## %% Revision 1.8 2000/10/20 13:26:41 peterg + ## %% Made sure that mttui not declared twice + ## %% + ## %% Revision 1.7 2000/10/20 13:16:29 peterg + ## %% Reformated + ## %% + ## %% Revision 1.6 1996/12/07 18:21:57 peterg + ## %% Now uses fopen + file number + ## %% + ## %% Revision 1.5 1996/11/09 21:05:44 peterg + ## %% Only generates MTTIm when at least 2 states! + ## %% + ## %% Revision 1.4 1996/08/30 19:42:36 peter + ## %% Added newline at end of file. + ## %% + ## %% Revision 1.3 1996/08/24 15:06:22 peter + ## %% Write `END;' at end to please reduce. + ## %% + ## %% Revision 1.2 1996/08/18 20:05:20 peter + ## %% Put unded version control + ## %% + ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + states = structure(1); + nonstates=structure(2); + inputs=structure(3); + outputs=structure(4); + zero_outputs = structure(5); + internal_inputs = structure(6); + connecting_inputs = structure(7); + + pc = '%'; + ## Declare reduce constants; + fprintf(deffilenum, 'MTTNx := %1.0f;\n', states); + fprintf(deffilenum, 'MTTNz := %1.0f;\n', nonstates); + fprintf(deffilenum, 'MTTNu := %1.0f;\n', inputs); + fprintf(deffilenum, 'MTTNy := %1.0f;\n', outputs); + fprintf(deffilenum, 'MTTNyz := %1.0f;\n', zero_outputs); + fprintf(deffilenum, 'MTTNui := %1.0f;\n', internal_inputs); + fprintf(deffilenum, 'MTTNuc := %1.0f;\n', connecting_inputs); + + ## Declare reduce matrices + fprintf(deffilenum, '%s Declare reduce matrices\n', pc); + if states>0 + fprintf(deffilenum, 'matrix MTTx(%1.0f,1);\n', states); + fprintf(deffilenum, 'matrix MTTdx(%1.0f,1);\n', states); + endif + + if nonstates>0 + fprintf(deffilenum, 'matrix MTTz(%1.0f,1);\n', nonstates); + fprintf(deffilenum, 'matrix MTTdz(%1.0f,1);\n', nonstates); + endif + + if inputs>0 + fprintf(deffilenum, 'matrix MTTu(%1.0f,1);\n', inputs); + fprintf(deffilenum, 'matrix MTTdu(%1.0f,1);\n', inputs); + endif + + if outputs>0 + fprintf(deffilenum, 'matrix MTTy(%1.0f,1);\n', outputs); + endif + + if zero_outputs>0 + fprintf(deffilenum, 'matrix MTTyz(%1.0f,1);\n', zero_outputs); + fprintf(deffilenum, 'matrix MTTui(%1.0f,1);\n', zero_outputs); + elseif internal_inputs>0 + fprintf(deffilenum, 'matrix MTTui(%1.0f,1);\n', inputs); + endif + + if connecting_inputs>0 + fprintf(deffilenum, 'matrix MTTuc(%1.0f,1);\n', connecting_inputs); + endif + + + ## Make an Nx x Nx unit matrix + if states>0 + fprintf(deffilenum, 'matrix MTTI(%1.0f,%1.0f);\n', states,states); + for i = 1:states + fprintf(deffilenum, 'MTTI(%1.0f,%1.0f) := 1;\n', i, i); + end + endif + + + ## Make an Nx/2 x Nx/2 unit matrix + if states>1 + fprintf(deffilenum, 'matrix MTTIm(%1.0f,%1.0f);\n', states/2,states/2); + for i = 1:states/2 + fprintf(deffilenum, 'MTTIM(%1.0f,%1.0f) := 1;\n', i, i); + end + endif + + + ## Set the y, yz, du, u, x and dx matrices + fprintf(deffilenum, '%s Set the y, yz, u and x matrices\n', pc); + for i=1:outputs + fprintf(deffilenum, 'MTTy(%1.0f,1) := MTTy%1.0f;\n', i, i); + endfor + + for i=1:zero_outputs + fprintf(deffilenum, 'MTTyz(%1.0f,1) := MTTyz%1.0f;\n', i, i); + fprintf(deffilenum, 'MTTui(%1.0f,1) := MTTui%1.0f;\n', i, i); + endfor + + for i=1:inputs + fprintf(deffilenum, 'MTTu(%1.0f,1) := MTTu%1.0f;\n', i, i); + endfor + + for i=1:inputs + fprintf(deffilenum, 'MTTdu(%1.0f,1) := MTTdu%1.0f;\n', i, i); + endfor + + for i=1:states + fprintf(deffilenum, 'MTTx(%1.0f,1) := MTTx%1.0f;\n', i, i); + endfor + + for i=1:nonstates + fprintf(deffilenum, 'MTTdz(%1.0f,1) := MTTdz%1.0f;\n', i, i); + endfor + + fflush (deffilenum); + +endfunction ADDED mtt/bin/trans/m/mat2mfile.m Index: mtt/bin/trans/m/mat2mfile.m ================================================================== --- mtt/bin/trans/m/mat2mfile.m +++ mtt/bin/trans/m/mat2mfile.m @@ -0,0 +1,45 @@ +function mat2mfile(matrix, matrix_name, filenum); +% mat2mfile - writes a matrix as part of an m-file +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function mat2mfile +% mat2mfile(matrix, matrix_name, filenum) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/12/04 21:53:00 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +%Writes out a matrix as a matlab m-file + +[N, M] = size(matrix); + +empty = (N==1)&(M==1)&(matrix(1,1)==0); + +%Write out the matrix +fprintf(filenum, '%s = [\n', matrix_name); + +if ~empty + for i = 1:N, + for j = 1:M + fprintf(filenum, '%1.0f ', matrix(i,j)); + end; + fprintf(filenum, '\n'); + end; +else + fprintf(filenum,'0'); +end; +fprintf(filenum, '];\n'); +fprintf(filenum, '\n'); + ADDED mtt/bin/trans/m/mat2tex.m Index: mtt/bin/trans/m/mat2tex.m ================================================================== --- mtt/bin/trans/m/mat2tex.m +++ mtt/bin/trans/m/mat2tex.m @@ -0,0 +1,35 @@ +function tex = mat2tex(mat) + ## mat2tex: converts matrix into LaTeX form. + ## tex = mat2tex(mat) + + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.1 1999/03/25 01:33:51 peterg + ## Initial revision + ## + ############################################################### + + [n,m]=size(mat); + + for i=1:n + for j=1:m + if mat(i,j) == 0 + printf("0 "); + else + printf("%5.2f", mat(i,j)); + endif + if j0 + cbg = mtt_cbg(Name); # Structure for this subsystem + if isfield (cbg, "ports") + ## Combine ports with the other subsystems + for [component_structure, component] = cbg.ports + eval(sprintf("cbg.subsystems.%s=cbg.ports.%s;",component,component)); + endfor + endif + endif + + + if length(name)>0 # Alias + ##Alias arguments + eval(sprintf("ARG=cbg.subsystems.%s.arg;", name)); # Arguments + ARG = mtt_alias (Name,ARG,arg_default); # Alias them + eval(sprintf("cbg.subsystems.%s.arg=ARG;", name)); # and copy + ## Alias CRs + eval(sprintf("CR=cbg.subsystems.%s.cr;", name)); # CRs + CR = mtt_alias (Name,CR,cr_default); # Alias them + eval(sprintf("cbg.subsystems.%s.cr=CR;", name)); # and copy + else # Call to a subsystem (represented by name="") + if !isfield(cbg,"portlist") + N_ports = 0; + else + [N_ports,M_ports] = size(cbg.portlist); + endif + + if port>N_ports + error(sprintf("port (%i) > N_ports (%i)", port, N_ports)); + else # Get name and find equation + name = deblank(cbg.portlist(port,:)); + if DEBUG + disp("----> lower-level system") + endif + known = mtt_component_eqn (mtt_fullname(Name,name), 1, ... + causality, known, cbg); + return + endif + endif + + + ## Other causality representations + if strcmp(causality,"effort") + i_cause = 1; + othercausality = "flow"; + index_cause = 1; + cause = "e"; + elseif strcmp(causality,"flow") + i_cause = -1; + othercausality = "effort"; + index_cause = 2; + cause = "f"; + else + error(sprintf("mtt_component_eqn: causality %s invalid", causality)); + endif + + ## A useful composite name + name_port_cause = sprintf("%s_%i_%s",name, port, cause); + full_name_port_cause = mtt_fullname(Name,name_port_cause); + + ## If value is known, don't do anything. + if findstr(sprintf(" %s ", full_name_port_cause), known)>0 + eqn = sprintf("%s The %s signal on port %i of %s is known already", ... + CD, causality, port, name); + return + else # Add to list + known = sprintf("%s %s", known, full_name_port_cause); + endif + + + + ## Component type + comp_type = eval(sprintf("cbg.subsystems.%s.type;", name)); + if DEBUG + comp_type + endif + + ## Component cr + cr = eval(sprintf("cbg.subsystems.%s.cr;", name)); + + ## Component arg + arg = eval(sprintf("cbg.subsystems.%s.arg;", name)); + + ## To which bond(s) is the component connected? + connections = eval(sprintf("cbg.subsystems.%s.connections;", name)); + bond_list = abs(connections); # Unsigned list + out_bond_number = bond_list(port); # The bond at the output of this component + direction = sign(connections); # Bond directions + directions = direction'*[1 1]; + + ## List of system bonds + bonds = cbg.bonds; + + ## List of component bond causality (component-orientated causality) + comp_bonds = bonds(bond_list,:).*directions; # Component bonds + + ## What components are at the other ends of the in bonds? + ## Effort + [in_e_bonds,in_e_components,in_e_ports,N_e] = mtt_component_inputs ... + (name,comp_type,causality,"effort",comp_bonds,connections,cbg); + ## Flow + [in_f_bonds,in_f_components,in_f_ports,N_f] = mtt_component_inputs ... + (name,comp_type,causality,"flow",comp_bonds,connections,cbg); + + + ##Composite values + N_ef = N_e + N_f; + in_ef_bonds = [in_e_bonds; in_f_bonds]; + in_ef_components = [in_e_components; in_f_components]; + in_ef_ports = [in_e_ports; in_f_ports]; + in_causality = [ones(N_e,1); -ones(N_f,1)]; + + ## Lists of signals relevant to this component + outsig = [out_bond_number i_cause port]; + insigs = [in_ef_bonds in_causality in_ef_ports]; + innames = in_ef_components; + + if DEBUG + outsig + insigs + innames + endif + + ## Is the signal the output of a port? + is_port_output = 0; # Default + if isfield (cbg, "ports") + if isfield (cbg.ports,name) + is_port_output = (outsig(2)!=insigs(1,2)); + endif + endif + + if is_port_output + ## Which port (number) is it? + [N_ports,M_ports] = size(cbg.portlist); + for i=1:N_ports + if strcmp(deblank(cbg.portlist(i,:)), name) + port_index = i; + break; + endif + endfor + + ## File containing data structure + NAME = mtt_subname(Name); + CBG = mtt_cbg(NAME); + + ## And to which component (at higher level) is it connected? + [new_Name,new_name] = mtt_subname(Name); + port_bond = eval(sprintf("CBG.subsystems.%s.connections(%i);", new_name, port_index)); + [in_name, in_port, in_bond] = mtt_other_end (new_name,port_bond,CBG); + + ## Find its equation + if DEBUG + disp("----> higher level system") + endif + + + known = mtt_component_eqn (mtt_fullname(new_Name,in_name), ... + in_port, causality, known, cbg); + + LHS = Source_seqn ("external",Name); + RHS = varname(NAME, abs(in_bond), i_cause); + eqn = sprintf("%s%s%s := %s;", LHS, SD, name, RHS); + + if !DEBUG + comment = sprintf("%s PORT", CD); + disp(sprintf("%s\n%s",comment, eqn)); + endif + + endif + + + ## Handle special components + if strcmp(comp_type,"0")||strcmp(comp_type,"1") # Junctions + [eqn,insigs,innames] = junction_seqn (comp_type,Name, outsig, ... + insigs, innames); + else # Everything else + if exist(sprintf("%s_cause", comp_type)) # Simple component + ## Do the equations + [eqn,insigs,innames] = eval(sprintf("%s_seqn (Name, name, cr, ... + arg, outsig, ... + insigs, ... + innames, is_port_output);", ... + comp_type)); + ## Resolve CR + eqn = mtt_resolve_cr(eqn); + + else # Compound component + new_NAME = Name; + new_Name = mtt_fullname(Name,name); + new_name = ""; + + ## Get relevant data structure + Cbg = mtt_cbg(new_Name); + port_name = Cbg.portlist(port,:); + + LHS = varname(Name, outsig(1,1), outsig(1,2)); + RHS = Sensor_seqn ("external",new_Name); + eqn = sprintf("%s := %s%s%s;", LHS, RHS, SD, port_name); + + if DEBUG + disp("----> same-level subsystem") + endif + + [known] = mtt_component_eqn ... + (mtt_fullname(new_Name,new_name), port, causality, known, cbg); + + endif + endif + + comment = ... + sprintf("%s Equation for %s signal on port %i of %s (%s), subsystem %s.", ... + CD, causality, port, name, comp_type, Name); + + if DEBUG + disp(sprintf("%s\n%s",comment, eqn)); + endif + + is_external = mtt_is_external(comp_type,outsig, insigs, is_port_output); + + if !is_external + ## Find the corresponding input equations + [N_other,M_other] = size(insigs); + for i = 1:N_other + if insigs(i,2)==1 + other_causality = "effort"; + else + other_causality = "flow"; + endif + + other_port = insigs(i,3); + other_name = deblank(innames(i,:)); + if DEBUG + disp("----> same-level component") + endif + + + [known] = mtt_component_eqn ... + (mtt_fullname(Name,other_name), other_port, other_causality, ... + known, cbg); + endfor + endif + + ## Write this signal + ##comment_2 = sprintf("Connected to:%s", in_component_list); + if !DEBUG + disp(sprintf("%s\n%s",comment, eqn)); + endif + +endfunction ADDED mtt/bin/trans/m/mtt_component_inputs.m Index: mtt/bin/trans/m/mtt_component_inputs.m ================================================================== --- mtt/bin/trans/m/mtt_component_inputs.m +++ mtt/bin/trans/m/mtt_component_inputs.m @@ -0,0 +1,30 @@ +function [in_bonds,in_components,in_ports,N] = mtt_component_inputs ... + (name,comp_type, out_causality, causality,comp_bonds,bond_list,cbg) + + ## usage: [in_bonds,in_components,in_ports,N] = mtt_component_inputs + ## (name,comp_type, out_causality, causality,comp_bonds,bond_list,cbg) + ## + ## + + + ## Other causality representations if strcmp(causality,"effort") + if strcmp(causality,"effort") + i_cause = 1; + othercausality = "flow"; + index_cause = 1; + elseif strcmp(causality,"flow") + i_cause = -1; + othercausality = "effort"; + index_cause = 2; + else + error(sprintf("mtt_component_eqn: causality %s invalid", causality)); + endif + + in_index = find(comp_bonds(:,index_cause)==i_cause); + all_in_bonds = bond_list(in_index); + N_all = length(all_in_bonds); + + ## What components are at the other ends of the in bonds? + [in_components,in_ports,in_bonds] = mtt_other_end (name,all_in_bonds,cbg); + N = length(in_bonds); +endfunction ADDED mtt/bin/trans/m/mtt_error.m Index: mtt/bin/trans/m/mtt_error.m ================================================================== --- mtt/bin/trans/m/mtt_error.m +++ mtt/bin/trans/m/mtt_error.m @@ -0,0 +1,34 @@ +function mtt_error(message, errorfile); +% mtt_error(message, errorfile); + +% function [bonds, status] = abg2cbg(bonds,components,system_name,filename) +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/12/03 16:21:27 peterg +% %% Initial revision +% %% +% %% Revision 1.2 1997/02/11 10:06:42 peterg +% %% Removed a debugging line. +% %% +% %% Revision 1.1 1996/08/18 20:06:57 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Set default file if it isn't there already +if nargin<2 + errorfile = fopen('mtt_error.txt','at'); +end; + +fprintf(errorfile, '*MTT ERROR : %s\n', message); + +#error('MTT exiting this transformation on error'); + ADDED mtt/bin/trans/m/mtt_euler.m Index: mtt/bin/trans/m/mtt_euler.m ================================================================== --- mtt/bin/trans/m/mtt_euler.m +++ mtt/bin/trans/m/mtt_euler.m @@ -0,0 +1,7 @@ +function [x] = mtt_euler(x,dx,dt,Nx,open) # Euler update + I_open = nozeros(open.*[1:Nx]'); # Indices of open switches + x(I_open) = 0.0; # Open switches have zero state + I = nozeros(!open.*[1:Nx]'); # Indices of states to update + x(I) = x(I) + dx(I)*dt; # Update states except open switches. +endfunction; + ADDED mtt/bin/trans/m/mtt_fullname.m Index: mtt/bin/trans/m/mtt_fullname.m ================================================================== --- mtt/bin/trans/m/mtt_fullname.m +++ mtt/bin/trans/m/mtt_fullname.m @@ -0,0 +1,10 @@ +function fullname = mtt_fullname (subname,compname) + + ## usage: fullname = mtt_fullname (subname,compname) + ## + ## Finds the standard mtt name of the component + + delim = "__"; + fullname = sprintf("%s%s%s", subname, delim, compname); + +endfunction ADDED mtt/bin/trans/m/mtt_identify.m Index: mtt/bin/trans/m/mtt_identify.m ================================================================== --- mtt/bin/trans/m/mtt_identify.m +++ mtt/bin/trans/m/mtt_identify.m @@ -0,0 +1,38 @@ +function [theta,Theta,Error,Y] = mtt_identify (system_name,y_s,theta_0,criterion,max_iterations) + + ## usage: [theta,Theta,Error] = mtt_identify (system_name,theta_0,criterion,max_iterations) + ## y_s actual system output + ## theta_0 initial parameter estimate + ## criterion convergence criterion + ## max_iterations limit to number of iterations + + if nargin<4 + criterion = 1e-5; + endif + + if nargin <5 + max_iterations = 20; + endif + + alpha = 1.0; + e_last = 1e20; + error=1e10; + theta = theta_0; + Theta = []; + Error = []; + Y = []; + iterations = 0; + while abs(e_last-error)>criterion + theta + iterations = iterations + 1; + e_last = error; + [t,y,y_theta] = mtt_ssimulate(system_name,theta); # Simulate system + Theta = [Theta theta]; # Save parameters + Y = [Y y]; # Save output + E = (y - y_s); # Error(t) + error = (E'*E); # Sum the error + Error = [Error error]; + theta = theta - alpha*((y_theta'*y_theta)\(y_theta'*E)); + endwhile + +endfunction ADDED mtt/bin/trans/m/mtt_implicit.m Index: mtt/bin/trans/m/mtt_implicit.m ================================================================== --- mtt/bin/trans/m/mtt_implicit.m +++ mtt/bin/trans/m/mtt_implicit.m @@ -0,0 +1,28 @@ +function [x] = mtt_implicit(x,dx,AA,AAx,dt,Nx,open); + ## x = mtt_implicit(x,dx,AA,AAx,dt,Nx,open); + ## Implicit integration update + + ## ############################################################### + ## ## Version control history + ## ############################################################### + ## ## $Id$ + ## ## $Log$ + ## ## Revision 1.3 1999/04/20 06:14:53 peterg + ## ## Reorder to make equivalent to .p version + ## ## + ## ## Revision 1.2 1999/04/20 00:58:22 peterg + ## ## Set open-switch states to zero + ## ## + ## ## Revision 1.1 1999/04/02 06:23:20 peterg + ## ## Initial revision + ## ## + ## ############################################################### + + ## Copyright (C) 1999 by P.J. Gawthrop + + I = nozeros(!open.*[1:Nx]'); # Indices of states to update + x(I) = AA(I,I)\(AAx(I) + dx(I)*dt); # Implicit update (except open switches); + I_open = nozeros(open.*[1:Nx]'); # Indices of open switches + x(I_open) = 0.0; # Open switches have zero state + +endfunction ADDED mtt/bin/trans/m/mtt_info.m Index: mtt/bin/trans/m/mtt_info.m ================================================================== --- mtt/bin/trans/m/mtt_info.m +++ mtt/bin/trans/m/mtt_info.m @@ -0,0 +1,55 @@ +function mtt_info(info, infofile); + ## mtt_info(info, infofile); + + ## function [bonds, status] = abg2cbg(bonds,components,system_name,filename) + ## + ## ###################################### + ## ##### Model Transformation Tools ##### + ## ###################################### + + ## ############################################################### + ## ## Version control history + ## ############################################################### + ## ## $Id$ + ## ## $Log$ + ## ## Revision 1.4 2003/03/24 12:18:00 gawthrop + ## ## Default file when no second argument + ## ## + ## ## Revision 1.3 2000/11/12 17:10:51 peterg + ## ## Close file if it is opened + ## ## Reformated octave style + ## ## + ## ## Revision 1.2 1997/02/11 10:06:42 peterg + ## ## Removed a debugging line. + ## ## + ## ## Revision 1.1 1996/08/18 20:06:57 peter + ## ## Initial revision + ## ## + ## ############################################################### + + ## Set default file if it isn't there already + + if nargin<2 + nofile = 1; + elseif infofile<0 + nofile = 1; + else + nofile = 0; + endif + + if nofile + infofile = fopen("mtt_info.txt","at"); + end; + + fprintf(infofile, "INFORMATION: %s\n", info); + + if nofile + fclose(infofile); + end; + +endfunction + + + + + ADDED mtt/bin/trans/m/mtt_is_external.m Index: mtt/bin/trans/m/mtt_is_external.m ================================================================== --- mtt/bin/trans/m/mtt_is_external.m +++ mtt/bin/trans/m/mtt_is_external.m @@ -0,0 +1,25 @@ +function is_external = mtt_is_external (comp_type,outsig, insigs, is_port) + + ## usage: is_external = mtt_is_external (comp_type,outsig, insigs, is_port) + ## + ## This is to determine if mtt_component_equation should look for + ## another equation. If is_external, the varable is available as a + ## system input and therfore requires no further equation. + ## I suspect that it needs more work. + + + if nargin<4 + is_port = 0; + endif + + is_external = 0; # Default + + if is_port + is_external = 0; + elseif strcmp(comp_type,"SS"); + is_external = insigs(1,2)!=outsig(2); + else + is_external = 0; + endif + +endfunction ADDED mtt/bin/trans/m/mtt_isunique.m Index: mtt/bin/trans/m/mtt_isunique.m ================================================================== --- mtt/bin/trans/m/mtt_isunique.m +++ mtt/bin/trans/m/mtt_isunique.m @@ -0,0 +1,35 @@ +function u = mtt_isunique(x); +% if all the elements of x are different, returns 1 else returns 0 + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/09/18 19:38:58 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +n = length(x); +u=1 + +disp("--checking uniqueness --") +x +for i=1:n + for j = 1:i-1 + if iscell(x) + if x{i}==x{j} + u = 0 + break; + end; + else + if x(i)==x(j) + u = 0 + break; + end; + end + end; +end; + ADDED mtt/bin/trans/m/mtt_name2names.m Index: mtt/bin/trans/m/mtt_name2names.m ================================================================== --- mtt/bin/trans/m/mtt_name2names.m +++ mtt/bin/trans/m/mtt_name2names.m @@ -0,0 +1,12 @@ +function names = mtt_name2names (name) + + ## usage: names = mtt_name2names (name) + ## + ## Converts standard mtt name to an array of subsystem names + + ## Copyright (C) 2003 by Peter J. Gawthrop + + delim ="__"; # MTT delimiter + names = char(strsplit(name,delim)); + +endfunction ADDED mtt/bin/trans/m/mtt_names2name.m Index: mtt/bin/trans/m/mtt_names2name.m ================================================================== --- mtt/bin/trans/m/mtt_names2name.m +++ mtt/bin/trans/m/mtt_names2name.m @@ -0,0 +1,16 @@ +function name = mtt_names2name (names) + + ## usage: name = names2name (names) + ## + ## Converts array of subsystem names to a standard mtt name + + delim ="__"; # MTT delimiter + + [n,m] = size(names); + name = deblank(names(1,:)); + + for i = 2:n + name = sprintf("%s%s%s", name, delim, deblank(names(i,:))); + endfor + +endfunction ADDED mtt/bin/trans/m/mtt_optimise.m Index: mtt/bin/trans/m/mtt_optimise.m ================================================================== --- mtt/bin/trans/m/mtt_optimise.m +++ mtt/bin/trans/m/mtt_optimise.m @@ -0,0 +1,112 @@ +function [theta,Theta,Error,Y,iterations] = mtt_optimise (system_name,y_s,theta_0,method,free,weight,criterion,max_iterations,alpha,View) + ## Usage: [theta,Theta,Error,Y,iterations] = mtt_optimise (system_name,y_s,theta_0,method,free,weight,criterion,max_iterations,alpha) + ## system_name String containg system name + ## y_s actual system output + ## theta_0 initial parameter estimate + ## free Indices of the free parameters within theta_0 + ## weight Weighting function - same dimension as y_s + ## method "time" or "freq" + ## criterion convergence criterion + ## max_iterations limit to number of iterations + ## alpha Optimisation gain parameter + + ## Copyright (C) 1999 by Peter J. Gawthrop + + if nargin<4 + method="time"; + endif + + N = length(theta_0); + if nargin<5 + free = [1:N]; + endif + + if nargin<6 + weight = ones(size(y_s)); + endif + + if nargin<7 + criterion = 1e-7; + endif + + if nargin <8 + max_iterations = 25; + endif + + if nargin<9 + alpha = 0.1; + endif + + if nargin<10 + View = 0; + endif + + if (!strcmp(method,"time"))&&(!strcmp(method,"freq")) + error("method must be either time or freq") + endif + + [n_data,n_y] = size(y_s); + + n_th = length(free); + error_old = inf; + error=1e50; + theta = theta_0; + Theta = []; + Error = []; + Y = []; + iterations = 0; + while (abs(error_old-error)>criterion)&&(abs(error)>criterion)&&(iterationscriterion)&&(abs(error)>criterion)&&(iterations(error_old+criterion) # Reduce step size and try again + factor = 10; + disp(sprintf("%2.2f*step",alpha)); + error = error_old; # Go back to previous error value + error_old = inf; # Don't let it think its converged + theta(free) = theta(free) + step; # Reverse step + step = alpha*step; # new stepsize + else # Recompute step size + tol = 1e-5; + step = pinv(JJ,tol)*J; # Step size + #step = pinv(JJ)*J; # Step size (built in tol) + endif + theta(free) = theta(free) - step; # Increment parameters + endif + ## theta + endwhile +endfunction + + ADDED mtt/bin/trans/m/mtt_other_causality.m Index: mtt/bin/trans/m/mtt_other_causality.m ================================================================== --- mtt/bin/trans/m/mtt_other_causality.m +++ mtt/bin/trans/m/mtt_other_causality.m @@ -0,0 +1,21 @@ +function other = mtt_other_causality (causality) + + ## usage: other = mtt_other_causality (causality) + ## + ## + + causality = deblank(causality); + if strcmp(causality,"effort"); + other = "flow"; + elseif strcmp(causality,"flow"); + other = "effort"; + elseif strcmp(causality,"e"); + other = "f"; + elseif strcmp(causality,"f"); + other = "e"; + else + error(sprintf("Causality \"%s\" not recognised",causality)); + endif + + +endfunction ADDED mtt/bin/trans/m/mtt_other_end.m Index: mtt/bin/trans/m/mtt_other_end.m ================================================================== --- mtt/bin/trans/m/mtt_other_end.m +++ mtt/bin/trans/m/mtt_other_end.m @@ -0,0 +1,27 @@ +function [in_components,in_ports,in_bonds] = mtt_other_end (name,all_in_bonds,cbg); + + ## usage: [in_components,in_ports,in_bonds] = mtt_other_end (name,all_in_bonds,cbg); + ## + ## + + ## What components are at the other ends of the in bonds? + in_components = ""; + in_ports = []; + in_bonds = []; + in_direction = []; + for i = 1:length(all_in_bonds); + for [component_structure, component] = cbg.subsystems + if !strcmp(name,component) + other_connections = component_structure.connections; + one = ones(size(other_connections)); + port = find(abs(all_in_bonds(i))*one==abs(other_connections)); + if (length(port)==1) + in_components = [in_components; component]; + in_bonds = [in_bonds; all_in_bonds(i)]; + in_ports = [in_ports; port]; + endif + endif + endfor + endfor + +endfunction ADDED mtt/bin/trans/m/mtt_resolve_cr.m Index: mtt/bin/trans/m/mtt_resolve_cr.m ================================================================== --- mtt/bin/trans/m/mtt_resolve_cr.m +++ mtt/bin/trans/m/mtt_resolve_cr.m @@ -0,0 +1,57 @@ +function eqn = mtt_resolve_cr (eqn) + ## usage: eqn = mtt_resolve_cr (eqn) + + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2003/03/24 12:20:28 gawthrop + ## *** empty log message *** + ## + ## Revision 1.1 2003/03/24 10:19:42 gawthrop + ## Documentation added + ## + ############################################################### + + ## Temporary version to resolve lin only! + + ## How many equations here? + N = length(findstr(eqn,"=")); + EQNS = char(strsplit(eqn,";")); + + eqn = ""; + for i = 1:N + + ## Split equation + EQN = char(strsplit(EQNS(i,:),":=")); + LHS = deblank(EQN(1,:)); + RHS = deblank(EQN(2,:)); + + if index(RHS,"lin(")>0 # lin cr is here + + RHS = sprintf("%s;", RHS); # Put back ; + + ## Make function into a list + RHS = strrep(RHS,"lin(","{lin,"); + RHS = strrep(RHS,");","}"); + + ## Convert "R" to R etc + RHS = strrep(RHS,"\"",""); + + + RHS = g_subs(RHS, "{{lin,$6,$3,$1,$5,1,$2,$3,1}}", "{$2*$1}"); + RHS = g_subs(RHS, "{{lin,$6,$3,$1,$5,1,$2,$4,1}}", "{$2/$1}"); + endif + + eqn_i = sprintf("%s := %s;", LHS, RHS); + eqn = sprintf("%s %s", eqn, eqn_i); + endfor + +endfunction + ADDED mtt/bin/trans/m/mtt_save_alias.m Index: mtt/bin/trans/m/mtt_save_alias.m ================================================================== --- mtt/bin/trans/m/mtt_save_alias.m +++ mtt/bin/trans/m/mtt_save_alias.m @@ -0,0 +1,21 @@ +function mtt_save_alias (arg,system_name) + + ## usage: mtt_save_alias (arg,system_name,FileID) + ## + ## + ## ###################################### + ## #### Model Transformation Tools ##### + ## ###################################### + + ## ############################################################### + ## Version + ## control history + ## ############################################################### ## $Id: + ## mtt_info.m,v 1.2 1997/02/11 10:06:42 peterg Exp peterg $ ## $Log: + ## mtt_info.m,v $ ## Revision 1.2 1997/02/11 10:06:42 peterg ## + ## ############################################################### + + fileid = fopen('mtt_aliased.txt','at'); + fprintf(fileid, "%s\t%s\n", arg,system_name); + fclose(fileid); +endfunction ADDED mtt/bin/trans/m/mtt_sfreq.m Index: mtt/bin/trans/m/mtt_sfreq.m ================================================================== --- mtt/bin/trans/m/mtt_sfreq.m +++ mtt/bin/trans/m/mtt_sfreq.m @@ -0,0 +1,61 @@ +function [w,y,y_theta] = mtt_sfreq(system_name,theta,free); + ## usage: [w,y,y_theta] = mtt_sfreq(system_name,theta,free); + ## + ## Frequency response with name system_name and parameter vector theta + ## The order of components in theta is determined in system_numpar.txt: + ## y_theta contains the corresponding sensitivity functions + ## Assumes system generated by the sBG approach + ## Copyright (C) 1999 by Peter J. Gawthrop + + ## $Id$ + + ## Assumes SISO system + + global mtt_n_parameters mtt_parameters # Global "argc argv" + global mtt_w # Frequencies (if not specified in simpar file + N = length(theta); + + eval(sprintf("[nx,ny,nu,nz,nyz] = %s_def;", system_name)); + if nargin<3 + free = 1; + endif + + y_theta = []; + + if length(free)==0 + free=1; # Make the loop happen once to get y and X + endif + + [n,m] = size(free); + if m==1 + free = free'; + endif + + + eval(sprintf("%s_simpar;", system_name)); # Read the "simulation" + # parameters + if exist("mttwmin") # Compute frequency range + w = logspace(mttwmin,mttwmax,mttwsteps)'; # Frequency range + else # use global mtt_w + w = mtt_w; + endif + + y_theta = []; + mtt_n_parameters = 1+N; + mtt_parameters(2:1+N) = theta; # The actual parameters + for i = free + mtt_parameters(1) = i; # Select wich sens. function + eval(sprintf("%s_numpar;", system_name)); # Read the parameters + eval(sprintf("[A,B,C,D,E] = %s_dm;", system_name)); # Evaluate the + # descriptor matrices + fr = dm2fr(A,B,C,D,E,w); + y_theta = [y_theta fr(:,2)]; # Sensitivity frequency response + endfor + + y = fr(:,1); # Actual frequency response + + +endfunction + + + ADDED mtt/bin/trans/m/mtt_simulate.m Index: mtt/bin/trans/m/mtt_simulate.m ================================================================== --- mtt/bin/trans/m/mtt_simulate.m +++ mtt/bin/trans/m/mtt_simulate.m @@ -0,0 +1,32 @@ +function [t,y,y_theta] = mtt_simulate(system_name,theta); + ## usage: [t,y,y_theta] = mtt_simulate(r); + ## + ## Simulate system with name system and parameter vector theta + ## The order of components in theta is determined in system_numpar.txt: + ## Copyright (C) 1999 by Peter J. Gawthrop + + ## $Id$ + + ## Simulate using mtt-generated function + y_theta = []; + for i=1:length(theta) + args=""; + for j=1:length(theta) + i_sensitivity=(j==i); + args = sprintf("%s%i %g ",args, i_sensitivity, theta(j)); + endfor + + command = sprintf("./%s_ode2odes.out %s > mtt_data.dat\n", system_name, args); + system(command); + + ## Retrieve data + load -force mtt_data.dat + t = mtt_data(:,1); + y = mtt_data(:,2); + y_theta = [y_theta mtt_data(:,3)]; + endfor + +endfunction + + + ADDED mtt/bin/trans/m/mtt_ssimulate.m Index: mtt/bin/trans/m/mtt_ssimulate.m ================================================================== --- mtt/bin/trans/m/mtt_ssimulate.m +++ mtt/bin/trans/m/mtt_ssimulate.m @@ -0,0 +1,34 @@ +function [t,y,y_theta] = mtt_ssimulate(system_name,theta); + ## usage: [t,y,y_theta] = mtt_ssimulate(system_name,theta); + ## + ## Simulate system with name system_name and parameter vector theta + ## The order of components in theta is determined in system_numpar.txt: + ## y_theta contains the corresponding sensitivity functions + ## Assumes system generated by the sBG approach + ## Copyright (C) 1999 by Peter J. Gawthrop + + ## $Id$ + + ## Simulate using mtt-generated function + y_theta = []; + for i=1:length(theta) + args=""; + for j=1:length(theta) + i_sensitivity=(j==i); + args = sprintf("%s%i %g ",args, i_sensitivity, theta(j)); + endfor + + command = sprintf("./%s_ode2odes.out %s > mtt_data.dat\n", system_name, args); + system(command); + + ## Retrieve data + load -force mtt_data.dat + t = mtt_data(:,1); + y = mtt_data(:,2); + y_theta = [y_theta mtt_data(:,3)]; + endfor + +endfunction + + + ADDED mtt/bin/trans/m/mtt_stime.m Index: mtt/bin/trans/m/mtt_stime.m ================================================================== --- mtt/bin/trans/m/mtt_stime.m +++ mtt/bin/trans/m/mtt_stime.m @@ -0,0 +1,64 @@ +function [t,y,y_theta,x,x_last] = mtt_stime(system_name,theta,free); + ## usage: [t,y,y_theta,x,x_last] = mtt_stime(system_name,theta); + ## + ## Simulate system with name system_name and parameter vector theta + ## The order of components in theta is determined in system_numpar.txt: + ## y_theta contains the corresponding sensitivity functions + ## Assumes system generated by the sBG approach + ## Copyright (C) 1999 by Peter J. Gawthrop + + ## $Id$ + + ## Simulate using mtt-generated function + + N = length(theta); + + eval(sprintf("[nx,ny,nu,nz,nyz] = %s_def;", system_name)); + if nargin<3 + free = 1; + endif + + y_theta = []; + + if length(free)==0 + free=1; # Make the loop happen once to get y and X + endif + + [n,m] = size(free); + if m==1 + free = free'; + endif + + for i=free + args=sprintf("%i",i); + for j=1:length(theta) + args = sprintf("%s %g",args, theta(j)); + endfor + + ## Run system and replace NaN by 1e30 -- easier to handle + file_name = sprintf("%s_input.dat", system_name); + if exist(file_name)==2 # Then use data from this file ... + command = sprintf("./%s_ode2odes.out %s < %s | sed \'s/NAN/Inf/g\' >mtt_out_data.dat\n", ... + system_name, args, file_name); + else + command = sprintf("./%s_ode2odes.out %s | sed \'s/NAN/Inf/g\' >mtt_out_data.dat\n", ... + system_name, args); + endif + + system(command); + + ## Retrieve out_data + load -force mtt_out_data.dat + y_theta = [y_theta mtt_out_data(:,3:2:1+ny)]; + endfor + + ## System out_data + [n,m]=size(mtt_out_data); + t = mtt_out_data(:,1); + y = mtt_out_data(:,2:2:ny); + x = mtt_out_data(:,3+ny:m); + x_last = mtt_out_data(n,3+ny:m); +endfunction + + + ADDED mtt/bin/trans/m/mtt_strip_name.m Index: mtt/bin/trans/m/mtt_strip_name.m ================================================================== --- mtt/bin/trans/m/mtt_strip_name.m +++ mtt/bin/trans/m/mtt_strip_name.m @@ -0,0 +1,22 @@ +function stripped_name = mtt_strip_name (name) + + ## usage: stripped_name = mtt_strip_name (name) + ## + ## Removes blanks and [] from a port name + + if (length(name)==0) + error("Zero length port name found"); + endif + + + [N,M] = size(name) + if N>1 + error("Cannot resolve port names: redraw abg.fig"); + endif + + + stripped_name = deblank(name); # remove blanks + stripped_name = stripped_name(2:length(stripped_name)-1); + stripped_name = deblank(stripped_name); # remove blanks + +endfunction ADDED mtt/bin/trans/m/mtt_subname.m Index: mtt/bin/trans/m/mtt_subname.m ================================================================== --- mtt/bin/trans/m/mtt_subname.m +++ mtt/bin/trans/m/mtt_subname.m @@ -0,0 +1,20 @@ +function [subname, compname] = mtt_subname (name) + + ## usage: subname = mtt_subname (name) + ## + ## Finds the subsystem name from the component name + ## Copyright (C) 2003 by Peter J. Gawthrop + + + names = mtt_name2names(name); + [n,m] = size(names); + + if n<2 # Simple name + subname = ""; + compname = name; + else # Compound name + subname = mtt_names2name(names(1:n-1,:)); + compname = deblank(names(n,:)); + endif + +endfunction ADDED mtt/bin/trans/m/mtt_type_name.m Index: mtt/bin/trans/m/mtt_type_name.m ================================================================== --- mtt/bin/trans/m/mtt_type_name.m +++ mtt/bin/trans/m/mtt_type_name.m @@ -0,0 +1,15 @@ +function NewType = mtt_type_name (OldType) + + ## usage: NewType = mtt_type_name (OldType) + ## + ## + + if OldType=="0"; + NewType = "Zero"; + elseif OldType=="1"; + NewType = "One"; + else + NewType = OldType; + endif + +endfunction ADDED mtt/bin/trans/m/mtt_update.m Index: mtt/bin/trans/m/mtt_update.m ================================================================== --- mtt/bin/trans/m/mtt_update.m +++ mtt/bin/trans/m/mtt_update.m @@ -0,0 +1,13 @@ +function [x] = mtt_update(dx,x,dt,STEPFACTOR,METHOD,name); + + if (METHOD==1) #Euler + ddt = dt/STEPFACTOR; + x = x + dx*ddt; + elseif (METHOD==2) #Linear implicit or Implicit + eval("[AA,AAx] = ",name,"_smx;"); + x = AA\(AAx + dx*dt); + else + error("Method %i is not defined", METHOD); + endif; + +endfunction; ADDED mtt/bin/trans/m/mtt_write.m Index: mtt/bin/trans/m/mtt_write.m ================================================================== --- mtt/bin/trans/m/mtt_write.m +++ mtt/bin/trans/m/mtt_write.m @@ -0,0 +1,33 @@ +function mtt_write(t,x,y,nx,ny,first); + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2002/05/13 08:52:23 gawthrop +## FIRST parameter of simpar now specifies first printed point - +## simulation still starts at zero +## +## Revision 1.5 2001/03/30 15:13:58 gawthrop +## Rationalised simulation modes to each return mtt_data +## +## Revision 1.4 1999/03/15 23:05:29 peterg +## A complete rewrite - now puts into a Global matrix MTT_data +## +## Revision 1.3 1999/03/15 21:57:00 peterg +## Removed the # symbol +## +############################################################### + +global MTT_data + if (t==0.0) + MTT_data=[]; + endif + + if (t>= first) + MTT_data = [MTT_data; t,y(:)',t,x(:)']; + endif + +endfunction + ADDED mtt/bin/trans/m/mtt_zeroswitches.m Index: mtt/bin/trans/m/mtt_zeroswitches.m ================================================================== --- mtt/bin/trans/m/mtt_zeroswitches.m +++ mtt/bin/trans/m/mtt_zeroswitches.m @@ -0,0 +1,4 @@ +function [x] = mtt_zeroswitches(x,Nx,open) + I_open = nozeros(open.*[1:Nx]'); # Indices of open switches + x(I_open) = 0.0; # Open switches have zero states +endfunction; ADDED mtt/bin/trans/m/name_in_list.m Index: mtt/bin/trans/m/name_in_list.m ================================================================== --- mtt/bin/trans/m/name_in_list.m +++ mtt/bin/trans/m/name_in_list.m @@ -0,0 +1,42 @@ +function index = name_in_list(name,list) + +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function name_in_list.m +% Finds name in list and returns index -- zero if not found + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/23 09:22:05 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +[N,M] = size(list); +if N<1 + error('list must have at least one element'); +end; + +index = 0; + +for i = 1:N + j = findstr(name,list(i,:)); + if (length(j)==1) + if j(1)==1 + if index==0 + index = i; + else + index = [index i]; + end + end + end; +end; + ADDED mtt/bin/trans/m/nozeros.m Index: mtt/bin/trans/m/nozeros.m ================================================================== --- mtt/bin/trans/m/nozeros.m +++ mtt/bin/trans/m/nozeros.m @@ -0,0 +1,24 @@ +function v = nozeros (v0,tol) + + ## usage: v = nozeros (v0,tol) + ## + ## Zaps the zeros in a vector with tolerance tol (defaults to zero) + + ## Copyright (C) 2000 by Peter J. Gawthrop + + if nargin<2 + tol=eps; + endif + + + v = []; + j=0; + for i = 1:length(v0) + if abs(v0(i))>tol + j=j+1; + v(1,j) = v0(i); + end; + end; + + +endfunction ADDED mtt/bin/trans/m/pol2root2tex.m Index: mtt/bin/trans/m/pol2root2tex.m ================================================================== --- mtt/bin/trans/m/pol2root2tex.m +++ mtt/bin/trans/m/pol2root2tex.m @@ -0,0 +1,73 @@ +function tex = pol2root2tex(pol,name,f) + ## pol2tex: converts polynomial into LaTeX form as (s-z_1)..(s-z_n) + ## tex = pol2root2tex(pol,[name,f]) + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/05/10 19:08:35 gawthrop + ## Cosmetic improvements + ## + ## Revision 1.1 2001/05/10 11:44:40 gawthrop + ## Useful conversion functions + ## + ## Revision 1.1 1999/05/24 22:05:53 peterg + ## Initial revision + ## + ############################################################### + + if nargin<2 + name = "s" + endif + + if nargin<3 + f = "%2.2f"; + endif + + n = length(pol)-1; + + if n>0 + r = sort(roots(pol)); + endif + + gain = pol(1); + + complex=0; + if ((gain==1)&&(n>0)) + tex=""; + else + tex = sprintf("%g", gain); + endif + + for i=1:n + if real(r(i))<0 + r_plusminus = '+'; + else + r_plusminus = '-'; + endif + if imag(r(i))<0 + i_plusminus = '+'; + else + i_plusminus = '-'; + endif + + if complex + complex=0; + else + if abs(imag(r(i)))<1e-5 + ff = sprintf("%%s (%s %%s %s)",name, f); + tex = sprintf(ff, tex, r_plusminus, abs(r(i))); + else + ff = sprintf("%%s (%s %%s %s \\pm j %s)", name, f, f); + tex = sprintf(ff, tex, r_plusminus, abs(real(r(i))), imag(r(i))); + complex=1; + endif + endif + endfor + +endfunction + + + ADDED mtt/bin/trans/m/pol2tex.m Index: mtt/bin/trans/m/pol2tex.m ================================================================== --- mtt/bin/trans/m/pol2tex.m +++ mtt/bin/trans/m/pol2tex.m @@ -0,0 +1,80 @@ +function tex = pol2tex(pol,name,f) + ## pol2tex: converts polynomial into LaTeX form. + ## tex = pol2tex(pol,[name,f]) + + ## pol polynomial (row vector) + ## name name of the variable (eg s or z) + ## f format of the coefficients (eg %2.4f) + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.3 2001/07/11 03:58:41 gawthrop + ## removed {} + ## + ## Revision 1.2 2001/05/10 19:08:35 gawthrop + ## Cosmetic improvements + ## + ## Revision 1.1 2001/05/10 11:44:40 gawthrop + ## Useful conversion functions + ## + ## Revision 1.1 1999/03/25 01:33:51 peterg + ## Initial revision + ## + ############################################################### + + if nargin<2 + name = "s"; + endif + + if nargin<3 + f = "%2.2f"; + endif + + n = length(pol); + if n<1 + tex = "--"; + return + endif + + if pol(1) == 1 + if n>1 + tex = ''; + else + tex = '1'; + endif + else + ff = sprintf(" %s",f); + tex = sprintf(ff, pol(1)); + endif + + if n>2 + tex = sprintf("%s%s^%i", tex, name, n-1); + elseif n==2 + tex = sprintf("%s%s", tex, name); + else + tex = sprintf("%s", tex); + endif + + for i=2:n + if pol(i)<0 + plusminus = '-'; + else + plusminus = '+'; + endif + ff = sprintf("%%s %%s %s",f); + tex = sprintf(ff, tex, plusminus, abs(pol(i))); + if i1 # Multi ports - port no. is first arg of CR + fprintf(eqnfile, "#1.0f,", outport); + endif + fprintf(eqnfile, "%s", args); # Print the arguments + for port = 1:ports # Print the input causalities and values + fprintf(eqnfile, "\n\t\t,%s,%s", cause2name(RHS_cause(port)), ... + varname(name,bond_number(port), RHS_cause(port))); + endif + fprintf(eqnfile, "\n\t\t);\n"); + endif +endfunction + + ADDED mtt/bin/trans/m/psfig.m Index: mtt/bin/trans/m/psfig.m ================================================================== --- mtt/bin/trans/m/psfig.m +++ mtt/bin/trans/m/psfig.m @@ -0,0 +1,43 @@ +function psfig(filename) + ## Usage: psfig(filename) + ## Puts figure into ps file + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.1 1999/11/30 23:26:21 peterg + ## Initial revision + ## + ## Revision 1.3 1999/09/04 02:23:30 peterg + ## Removed mv stuff - now uses gset on actual file + ## + ## Revision 1.2 1999/06/15 02:05:44 peterg + ## Now adds a .ps if not there already + ## + ## Revision 1.1 1999/03/25 01:35:00 peterg + ## Initial revision + ## + ############################################################### + + ## Add .ps if not there already + if !index(filename,".") # Is there a . + filename = sprintf("%s.ps",filename); + endif + + eval(sprintf("gset output \"%s\" ",filename)); + gset linestyle 1 lw 4 # Thicker lines + gset linestyle 2 lw 4 # Thicker lines + gset linestyle 3 lw 4 # Thicker lines + gset linestyle 4 lw 4 # Thicker lines + gset linestyle 5 lw 4 # Thicker lines + + + gset term postscript eps + replot; + gset term x11 + gset output + replot; + +endfunction ADDED mtt/bin/trans/m/rbg2abg.m Index: mtt/bin/trans/m/rbg2abg.m ================================================================== --- mtt/bin/trans/m/rbg2abg.m +++ mtt/bin/trans/m/rbg2abg.m @@ -0,0 +1,692 @@ +function [bonds,components,n_vector_bonds] = rbg2abg(name,rbonds,rstrokes,rcomponents, ... + port_coord,port_name, ... + infofile,errorfile) + + ## ############################################################### + ## ## Version control history + ## ############################################################### + ## ## $Id$ + ## ## $Log$ + ## ## Revision 1.51 2012/10/15 19:22:44 geraint + ## ## mtt_isunique replaces unique which masks a built-in function. + ## ## + ## ## Revision 1.50 2009/11/02 16:54:03 geraint + ## ## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char + ## ## + ## ## Revision 1.49 2004/07/22 13:18:02 geraint + ## ## Minor typo in error message. + ## ## + ## ## Revision 1.48 2004/02/19 18:27:47 geraint + ## ## [ 852694 ] octave 2.1.52 breaks rbg2abg + ## ## + ## ## Octave now prefers row vectors to column vectors. + ## ## + ## ## Revision 1.47 2002/08/27 16:09:01 geraint + ## ## Added port_name to error message when multiple bonds are near a port. + ## ## + ## ## Revision 1.46 2000/09/11 08:22:02 peterg + ## ## Checks for absent port list in subsystem abg file. + ## ## + ## ## Revision 1.45 1999/10/19 02:13:31 peterg + ## ## Now assigns correct bonds to the new junction port names + ## ## + ## ## Revision 1.44 1999/10/19 00:05:44 peterg + ## ## Now defaults junction ports when only one specified (for vector junctions) + ## ## + ## ## Revision 1.43 1999/10/18 04:08:46 peterg + ## ## Now computes n_vector_bonds -- number apparent (maybe vector) bonds per component. + ## ## Neeeded to vectorise junctions. + ## ## + ## ## Revision 1.42 1999/08/25 21:45:03 peterg + ## ## Spurious start to vector 0 and 1 + ## ## + ## ## Revision 1.41 1999/08/19 21:12:33 peterg + ## ## Tidied and started implementaation of vector junctions + ## ## + ## ## Revision 1.40 1999/08/19 05:39:55 peterg + ## ## Put into octave format + ## ## + ## ## Revision 1.39 1999/08/19 05:22:16 peterg + ## ## To RCS prior to inplementing vector junctions + ## ## + ## ## Revision 1.38 1999/03/12 00:58:06 peterg + ## ## Now gets portlist from the _abg.m file NOT the _rbg.m file + ## ## - this allows expansion of vector SS ports. + ## ## + ## ## Revision 1.37 1998/07/28 19:06:43 peterg + ## ## Still some bugs (vector SS ports)?? + ## ## + ## ## Revision 1.36 1998/07/28 10:30:50 peterg + ## ## Implemented vector SS ports. + ## ## + ## ## Revision 1.35 1998/07/08 15:35:15 peterg + ## ## Added errorfile argument + ## ## + ## ## Revision 1.34 1998/07/02 19:41:29 peterg + ## ## Fixed empty port string bug - set to null string. + ## ## + ## ## Revision 1.33 1998/07/02 17:16:06 peterg + ## ## Commented out redundent code -- obsolete due to new default mechanism + ## ## + ## ## Revision 1.32 1998/07/02 15:12:05 peterg + ## ## Added hard error reporting + ## ## Added error when two unlabled bonds point in. + ## ## + ## ## Revision 1.31 1998/07/02 14:30:50 peterg + ## ## Corrected various bugs - including resettting n_ports to correct value + ## ## + ## ## Revision 1.30 1998/07/02 13:40:50 peterg + ## ## Added extra ports names (due to defaults) to relevant lists: + ## ## port_name + ## ## port_bond + ## ## + ## ## Revision 1.29 1998/07/02 13:28:31 peterg + ## ## Added defaults in new form BEFORE alias expansion + ## ## + ## ## Revision 1.28 1998/07/02 12:36:05 peterg + ## ## Removed debugging lines + ## ## + ## ## Revision 1.27 1998/07/02 12:24:02 peterg + ## ## Expand port aliases + ## ## + ## ## Revision 1.26 1998/04/16 14:07:51 peterg + ## ## Sorted out [] problem with vector ports -- new octave function + ## ## split_port + ## ## + ## ## Revision 1.25 1998/04/12 15:01:04 peterg + ## ## Converted to uniform port notation - always use [] + ## ## + ## ## Revision 1.24 1998/02/19 08:57:16 peterg + ## ## Fixed mtt-info bug -- confused filename with number + ## ## + ## ## Revision 1.23 1997/12/04 14:24:22 peterg + ## ## Removed error message about through-pointing arrows + ## ## + ## ## Revision 1.22 1997/09/18 19:49:37 peterg + ## ## Added test for uniquness of bonds on a component -- if non-unique + ## ## implies same component at both ends of a bond. + ## ## + ## ## Revision 1.21 1997/09/16 15:14:14 peterg + ## ## Added warning if a component has no bonds. + ## ## + ## ## Revision 1.20 1997/08/18 19:39:48 peterg + ## ## Now generates (exampaded) port_bond list correctely + ## ## + ## ## Revision 1.19 1997/08/14 11:59:47 peterg + ## ## Vector ports added!! + ## ## + ## ## Revision 1.18 1997/08/14 11:01:42 peterg + ## ## Reordered algorithms as follows: + ## ## bond end coordinates + ## ## associate port labels with bonds (port_bond) + ## ## associate bonds with components + ## ## unsorted list of bonds on each component (components) + ## ## interpret strokes and setup the causality of the bonds (bonds) + ## ## expand vector ports & add new bonds and connections + ## ## sort bonds on each component according to the labels -- two ports + ## ## default included here. + ## ## + ## ## Revision 1.17 1997/08/09 11:31:16 peterg + ## ## Default two port list is [in;out] (or [out;in]) + ## ## Dont do global default if no ports labels. + ## ## + ## ## Revision 1.16 1997/08/07 16:12:36 peterg + ## ## Fixed sorting bug: now puts the jth component from the unsorted list + ## ## into the kth component of the sorted list .. not vice versa! + ## ## + ## ## Revision 1.15 1997/08/06 21:43:19 peterg + ## ## Corrected error in creating component list: the kth component of the + ## ## list is given by the jth component of the original list NOT vice + ## ## versa. + ## ## + ## ## Revision 1.14 1997/08/04 14:18:55 peterg + ## ## If no ports labels at all, just use the default component list. + ## ## + ## ## Revision 1.13 1997/08/04 12:50:39 peterg + ## ## Many bug fixes to the named port version + tied up the logic and + ## ## supporting comments. + ## ## + ## ## Revision 1.12 1997/08/02 19:37:53 peterg + ## ## Now uses named ports. + ## ## + ## ## Revision 1.11 1997/04/29 09:12:37 peterg + ## ## Added error message if port label near to >1 bond. + ## ## + ## ## Revision 1.10 1997/03/17 13:45:42 peterg + ## ## Added more error info. + ## ## + ## ## Revision 1.9 1996/12/31 11:25:57 peterg + ## ## Clearer error messages for incorrect ports. + ## ## + ## ## Revision 1.8 1996/12/04 21:52:39 peterg + ## ## Now uses fopen. + ## ## + ## ## Revision 1.7 1996/11/01 18:01:57 peterg + ## ## Rationalised port ordering. + ## ## Fixed port bug. + ## ## + ## ## Revision 1.6 1996/08/25 08:27:14 peter + ## ## Now checks ports correctely - I hope. + ## ## + ## ## Revision 1.5 1996/08/24 19:21:26 peter + ## ## More specific error messages. + ## ## + ## ## Revision 1.4 1996/08/24 18:00:33 peter + ## ## Fixed bug with finding ports. + ## ## + ## ## Revision 1.3 1996/08/09 08:26:35 peter + ## ## Cosmetic tidy up. + ## ## + ## ## Revision 1.2 1996/08/04 18:37:57 peter + ## ## Fixed no causal strokes bug. + ## ## + ## ## Revision 1.1 1996/08/04 18:30:14 peter + ## ## Initial revision + ## ## + ## ############################################################### + + + ##Default to no components + components = [0]; + + ## Xfig scaling factor + scale = 1200.0/2.54546; + + ## Rotation matrix + rot = [0 -1; 1 0]; + + ## Find number of strokes + [n_strokes,columns] = size(rstrokes); + if (columns ~= 4)&(n_strokes>0) + error('Incorrect rstrokes matrix: must have 4 columns'); + endif + + + ## Find number of bonds + [n_bonds,columns] = size(rbonds); + if (columns ~= 6)&(n_bonds>0) + error('Incorrect rbonds matrix: must have 6 columns'); + endif + + + ## Find number of components + [n_components,columns] = size(rcomponents); + + ## Find the number of ports refered to within the component + [n_ports,columns] = size(port_coord) + + ## If port_name is empty, make it a empty string + if (length(port_name)==0) + port_name=""; + endif + + + ## Determine coordinates of the arrow end of the bond and the other end + other_end_1 = rbonds(:,1:2); + arrow_end = rbonds(:,3:4); + other_end_2 = rbonds(:,5:6); + + distance_1 = length2d(other_end_1 - arrow_end); + distance_2 = length2d(other_end_2 - arrow_end); + which_end = (distance_1>distance_2)*[1 1]; + one = ones(size(which_end)); + other_end = which_end.*other_end_1 + (one-which_end).*other_end_2; + arrow_vector = ( which_end.*other_end_2 + (one-which_end).*other_end_1 ) - ... + arrow_end; + + ## Locate the bond end nearest to each port + ## col 1 of port_near_bond contains a signed bond number (+ for arrow end) + ## col 2 of port_near_bond contains the corresponding port index + port_bond = []; + for i = 1:n_ports + near_bond = adjbond(port_coord(i,1:2),arrow_end,other_end); + [rows,cols]=size(near_bond); + if rows>1 + error(sprintf ... + ("A port is near to more than one bond at coordinates %g,%g %s\n", ... + port_coord(i,1)/scale, port_coord(i,2)/scale, deblank(port_name(i,:)))); + endif + + + ##The (signed) bond corresponding to the ith port label + port_bond(i,1) = near_bond(1)*sign(1.5-near_bond(2)); + endfor + + port_bond + ##We now have the (signed) bond (port_bond(i)) correponding to the + ## ith port label within the component + + ## Locate the components at the ends of each bond + ## col 1 of comp_near_bond contain the component nearest to the arrow end + ## col 2 of comp_near_bond contain the component nearest to the other end + for i = 1:n_bonds + comp_near_bond(i,:) = adjcomp(arrow_end(i,:),other_end(i,:),rcomponents); + endfor + + comp_near_bond + ## We now have a list (comp_near_bond) of the component(s) at each end + ## of each bond + + ## Now do a list of the bonds on each component - unsorted at this stage. + ## Also expand aliases using the alias list for each component + components = []; + i_vector=0; # Counter for vector components + for i = 1:n_components + ##Get component type + eval(['[comp_type, comp_name] = ', name, '_cmp(i)']); + + + ## There are n_comp_bonds bonds on this component with corresponding index + [index,n_comp_bonds] = getindex(comp_near_bond,i); + + if index(1,1)==0 + mtt_error(sprintf("Component %s (%s) has no bonds", comp_name, + comp_type),errorfile); + endif + + + ## Create the signed list of bonds on this component + one = ones(n_comp_bonds,1); + bond_list = index(:,1); % bond at component + + ## Check that all bonds are unique -- error if not + if mtt_isunique(bond_list)==0 + mtt_error(sprintf("Component %s (%s) is at both ends of a bond", comp_name, + comp_type),errorfile); + endif + + + + ## which end of bond at component? + bond_end = index(:,2); + direction = -sign(bond_end-1.5*one); + signed_bond_list = bond_list.*direction; + components = add_bond(components,signed_bond_list',i); + + ## Unalias and/or default all the ports on this componen + unlabelled_ports = 0; + in_bonds = 0; + out_bonds = 0; + if ((comp_type=="0")||(comp_type=="1")) # A junction + disp("---- default junctions ---- "); + junction_names = 0; + for j=1:n_comp_bonds + port_name_index = getindex(port_bond,signed_bond_list(j)); + if port_name_index>0 + junction_port_name = port_name(port_name_index,:); + named_bond_index = j; + junction_names++; + endif + endfor + if junction_names==1 # one named port + mtt_info(sprintf("Defaulting all ports on junction %s to %s", comp_name, junction_port_name)); + ## Make the other n-1 names the same. + junction_port_name = mtt_strip_name(junction_port_name); + for j=1:n_comp_bonds; + if j!=named_bond_index + port_name = [port_name; ["[" junction_port_name "]"]]; # add to list + [port_name_index,junk] = size(port_name); # the corresponding index + port_bond(port_name_index,:) = signed_bond_list(j); # add to port bond + endif + endfor + elseif (junction_names!=0)&&(junction_names!=n_comp_bonds) # not allowed + mtt_error(sprintf("Junction %s must have 0, 1 or %i port labels", comp_name,n_comp_bonds),errorfile); + endif + port_name = port_name + else # Not a junction + for j=1:n_comp_bonds + signed_bond = signed_bond_list(j); + port_name_index = getindex(port_bond,signed_bond); + port_direction = sign(signed_bond); + + if port_name_index==0 # There is no port on this bond - so try + # to default + unlabelled_ports++; + if(unlabelled_ports==1) + if port_direction>0 + in_bonds++; + port_name_i = "in"; + else + out_bonds++; + port_name_i = "out"; + endif + + elseif (unlabelled_ports==2) + if port_direction>0 + if (++in_bonds>1) + mtt_error(["More than one unlabelled INport on component " ... + comp_name " (" comp_type ")"],errorfile); + else + port_name_i = "in"; + end + else + if (++out_bonds>1) + mtt_error(["More than one unlabelled OUTport on component " ... + comp_name " (" comp_type ")"],errorfile); + else + port_name_i = "out"; + end + endif + + else + mtt_error(["More than two unlabelled ports on component " ... + comp_name " (" comp_type ")"],errorfile); + endif + + mtt_info(["Defaulting port name [" port_name_i "]\t on component " ... + comp_name " (" comp_type ")" ],infofile); + port_name = [port_name; ["[" port_name_i "]"]]; # add to list + [port_name_index,junk] = size(port_name); # the corresponding + # index + port_bond(port_name_index,:) = signed_bond; # add to port bond + else + port_name_i = mtt_strip_name(port_name(port_name_index,:)) + ## port_name_i = deblank(port_name(port_name_index,:)); + ## port_name_i = port_name_i(2:length(port_name_i)-1) # strip [] + endif + + + ## Replace by alias -- if any + eval( ["alias = ", comp_type, '_alias';]); # Get aliases + if isstruct(alias) # are there any aliases + if isfield(alias,port_name_i) # Is this an alias? + eval(["new_port_name_i = alias.",port_name_i]); + mtt_info(["Aliasing name [" port_name_i "]\t on component " ... + comp_name " (" comp_type ")\t to [" new_port_name_i "]"],infofile); + port_name = replace_name(port_name, ... + ["[",new_port_name_i,"]"], ... + port_name_index); + endif + + endif + + endfor + + endif + + endfor + + ## At this point, every port should be labeled (port_name) and ... + ## associated with a bond (port_bond). + disp("--- Completed portnames and the corresponding bonds ---") + port_name, port_bond + + + ## Deduce causality from the strokes (if any) and create the list of bonds + causality = zeros(n_bonds,2); + if n_strokes>0 + ## Find out location of centre and ends of stroke. + stroke_end_1 = [rstrokes(:,1) rstrokes(:,2)]; + stroke_end_2 = [rstrokes(:,3) rstrokes(:,4)]; + + stroke_centre = (stroke_end_1 + stroke_end_2)/2; + stroke_vector = (stroke_end_1 - stroke_end_2); + stroke_length = length2d(stroke_vector); + + ## Deduce bond causality from the strokes + for i = 1:n_strokes + stroke = [stroke_centre(i,:) + stroke_end_1(i,:) + stroke_end_2(i,:)]; + + + ## Find the nearest bond end. + [index,distance] = adjbond(stroke(1,:),arrow_end,other_end); + if (distance>2*stroke_length(i)) + info = sprintf('Stroke at (%4.3f,%4.3f) is %4.3f away from the nearest bond\n', ... + stroke(1,1)/scale, stroke(1,2)/scale, distance/scale); + endif + + + ## Bond end coordinates + j = index(1,1); + which_end = index(1,2)==1; + bond_end = arrow_end(j,:)*which_end + other_end(j,:)*(1-which_end); + + ## Now decide which bit of the stroke is nearest + stroke_index = adjbond(bond_end,stroke,zeros(size(stroke))); + + if stroke_index(1)==1 ## uni-causal stroke + causality(j,1:2) = (2*which_end-1)*[1 1]; + else ## bicausal stroke + ## Find out whether stroke is on flow side of bond + stroke_direction = stroke(1,:) - stroke(stroke_index(1),:); + flow_side = stroke_direction*arrow_vector(j,:)'>0; + causality(j,1+flow_side) = 2*which_end-1; + endif + + endfor + + endif + + + bonds = causality; + + + ## Find number of bonds on each component BEFORE vectorisation + for i=1:n_components + n_vector_bonds(i,1) = length(nozeros(components(i,:))) + endfor + + ## Now expand vector ports + disp("Expanding vector ports"); + [n_bonds,junk] = size(bonds); + n_ports = length(port_bond); + n_exp_ports=n_ports; + exp_port_name=""; + exp_port_bond = []; + ##exp_comps = []; + for i=1:n_ports + port_name_i = port_name(i,:) + [subport,n_subports] = split_port(port_name_i, ','); ## Find the components of the vector port + + if n_subports==1 ## an ordinary port + exp_port_name = [exp_port_name; subport(1,:)]; ## Write out the only port + exp_port_bond = [exp_port_bond; port_bond(i)]; ## and the port_bond + else ## its a vector port + ## Check that there is a corresponding vector port at the other end of the + ## bond + signed_bond_index = port_bond(i); + [other_bond_index,n_other] = getindex(port_bond,-signed_bond_index); + if n_other == 1 + other_port_name = port_name(other_bond_index,:); + [other_subport,n_other_subports] = split_port(other_port_name, ','); + if n_other_subports~=n_subports + mtt_error(['Vector ports ', port_name_i, ' and ', other_port_name, 'are not compatible'],errorfile); + end + else # No explicit matching vector port + mtt_error(['Vector port ', port_name_i, ' has no matching port'], errorfile); + endif + + + if other_bond_index>i ##then its not been done yet + mtt_info(["Vector port: ", port_name_i],infofile); + mtt_info(["matching: ", other_port_name],infofile); + ## Remove sign info. + bond_index = abs(signed_bond_index); + sig = sign(signed_bond_index); + + ## Put the first element of each port list in the expanded list + exp_port_name = [exp_port_name; subport(1,:)]; + exp_port_name = [exp_port_name; other_subport(1,:)]; + + ## Add to the expanded port_bond list + exp_port_bond = [exp_port_bond; signed_bond_index; ... + -signed_bond_index]; + + ## Add the other names to the expanded list and augment the bonds, + ## components and port_bond lists. + for j=2:n_subports + ## Add a new name (for each end) to give a non-vector list + exp_port_name = [exp_port_name; subport(j,:)]; + exp_port_name = [exp_port_name; other_subport(j,:)]; + + ## Add one more bond to the list + bonds = [bonds; bonds(bond_index,:)]; + n_bonds = n_bonds + 1; + + ## Add bond to the expanded port_bond list (ports at both ends) + exp_port_bond = [exp_port_bond; sig*n_bonds; -sig*n_bonds]; + + + ## Add the new bond to the component at both ends (taking note + ## of the direction). + arrow_index = comp_near_bond(bond_index,1); + components = add_bond(components, n_bonds, arrow_index); + other_index = comp_near_bond(bond_index,2); + components = add_bond(components, -n_bonds, other_index); + endfor + + endif + + endif + + endfor + + + + ##Replace old list by new + port_name = exp_port_name + port_bond = exp_port_bond + + ## Resize the lists + [n_ports,junk] = size(port_name); + + port_name, components + ## Produce a list of bonds on each component (within this component) + ## - sorted if explicit port numbers + for i = 1:n_components + disp('-----------------'); + ##Get component type + eval(['[comp_type, comp_name] = ', name, '_cmp(i)']); + + + ##Convert junction names + if comp_type(1)=='0' # Zero junction + comp_type = 'zero'; + isa_junction = 1; + elseif comp_type(1)=='1' # One junction + comp_type = 'one'; + isa_junction = 1; + else + isa_junction = 0; + endif + + ## Find the (unsorted) bond list on this component + signed_bond_list = nozeros(components(i,:)); + n_comp_bonds = length(signed_bond_list); + direction = sign(signed_bond_list); + + ##Find the port list for this component + if exist([comp_type, '_cause'])==0 + eval(["ABG = ",comp_type, "_abg;"]); + if isfield (ABG, "portlist") + port_list = ABG.portlist; + else + error(sprintf("Component %s has no ports", comp_type)); + port_list = []; + endif + else + port_list=comp_ports(comp_type,n_comp_bonds) + endif + + + [n_comp_ports,m_comp_ports] = size(port_list); + subport_list=""; + for p=1:n_comp_ports # Expand any vector ports + [subport,n_sub] = split_port(port_list(p,:), ','); # Find the components + # of the vector port + if n_sub>1 + mtt_info(sprintf("Expanding vector port %s of component type %s", ... + port_list(p,:), comp_type, infofile)); + endif + + subport_list = [subport_list; subport]; + endfor + + port_list = subport_list; # Set the expanded port list. + + + ## Check that number of bonds on the component is the same as the number of + ## ports + [n_comp_ports,m_comp_ports] = size(port_list); + if (n_comp_ports~=n_comp_bonds) & ... + ~(strcmp(comp_type,'zero')|strcmp(comp_type,'one')) + message=sprintf('Component %s (%s) has %1.0f impinging bonds but has %1.0f ports', ... + comp_name,comp_type,n_comp_bonds,n_comp_ports); + mtt_error(message, errorfile); + endif + + + unsorted_port_list=""; + if n_ports>0 ## then there are some named ports + ## so find those associated with the bonds on this component. + k=0; + for j = 1:n_comp_bonds + b = signed_bond_list(j); + ## Find the port label on component end of bond (if any) + [port_index,m] = getindex(port_bond,b); + if m==1 + k=k+1; + unsorted_port_list(k,:) = port_name(port_index,:); + endif + + endfor + + else + k=0; + endif + + %Compute the number of labeled ports + [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list); + if m_unsorted_ports==0 + n_unsorted_ports = 0; + endif + + ## Junctions (order of ports unimportant) + if strcmp(comp_type,'zero')|strcmp(comp_type,'one') + for j = 1:n_comp_bonds + components(i,j) = signed_bond_list(j); + endfor + + else ##Order of ports is important + unsorted_port_list, port_list + if n_unsorted_ports==0 + mtt_error(['Component ', comp_name, ' (', comp_type, ') has no labeled ports'], errorfile); + endif + + ##Write out the signed bond list in the correct order + unsorted_port_list + [n_list,m_list] = size(unsorted_port_list); + if n_list!=n_comp_bonds + error(sprintf("Component %s (%s) has %i bonds but %i port labels", ... + comp_name, comp_type, n_comp_bonds, n_list)) + endif + + for j = 1:n_comp_bonds + j + name_k = unsorted_port_list(j,:) + k = name_in_list(name_k, port_list); + ## Check that it only appears once in port list + if length(k)>1 + mtt_error(['Component ', comp_name, ' (', comp_type, ') has ports with the same name: ', name_k], errorfile); + endif + + + ##Check that it only appears one in the label list + kk = name_in_list(name_k,unsorted_port_list); + if length(kk)>1 + mtt_error(['Component ', comp_name, ' (', comp_type, ') has multiple port labels: ', name_k], errorfile); + endif + + + if k==0 + mtt_error(['Component ', comp_name, ' (', comp_type, ') has an unrecognised port: ', name_k], errorfile); + else + components(i,k) = signed_bond_list(j); + endif + endfor + endif + endfor + +endfunction ADDED mtt/bin/trans/m/rbg2ibg.m Index: mtt/bin/trans/m/rbg2ibg.m ================================================================== --- mtt/bin/trans/m/rbg2ibg.m +++ mtt/bin/trans/m/rbg2ibg.m @@ -0,0 +1,183 @@ +## -*-octave-*- + +function [bonds] = ... + rbg2ibg(name,rbonds,rstrokes,rcomponents,port_coord,port_name, ... + infofile, errorfile) + + rbonds + rstrokes + rcomponents + port_coord + port_name + + ## Default to no components + components = [0]; + + ## Xfig scaling factor + scale = 1200.0/2.54546; + + ## Rotation matrix + rot = [0, -1; 1, 0]; + + ## Find number of strokes + [n_strokes,columns] = size(rstrokes); + if ((columns ~= 4) & (n_strokes > 0)) + error('Incorrect rstrokes matrix: must have 4 columns'); + endif + + ## Find number of bonds + [n_bonds,columns] = size(rbonds); + if ((columns ~= 6) & (n_bonds > 0)) + error('Incorrect rbonds matrix: must have 6 columns'); + endif + + ## Find number of components + [n_components,columns] = size(rcomponents); + + ## Find number of ports referred to + [n_ports,columns] = size(port_coord); + + ## If port_name empty, make it empty string + if (length(port_name) == 0) + port_name=""; + endif + + ## Determine coordinates of arrow end of bond and other end + other_end_1 = rbonds(:,1:2); + arrow_end = rbonds(:,3:4); + other_end_2 = rbonds(:,5:6); + + distance_1 = length2d(other_end_1 - arrow_end); + distance_2 = length2d(other_end_2 - arrow_end); + which_end = (distance_1 > distance_2) * [1, 1]; + one = ones(size(which_end)); + other_end = which_end .* other_end_1 + (one - which_end) .* ... + other_end_2; + arrow_vector = (which_end .* other_end_2 + (one - which_end) .* ... + other_end_1) - arrow_end; + + ## Locate bond end nearest each port + ## col 1 of port_near_bond contains a signed bond number (+ for arrow + ## end) + ## col 2 of port_near_bond contains the corresponding port index + port_bond = []; + for i = 1:n_ports + near_bond = adjbond(port_coord(i,1:2), arrow_end, other_end); + [rows,cols] = size(near_bond); + if (rows > 1) + error(sprintf ... + ("A port is near to more than one bond at coordinates ... + %g,%g %s\n", ... + port_coord(i,1)/scale, port_coord(i,2)/scale, ... + deblank(port_name(i,:)))); + endif + + ## The (signed) bond corresponding to the ith port label + port_bond(i,1) = near_bond(1) * sign(1.5 - near_bond(2)); + endfor + port_bond + + ## Now have (signed) bond (port_bond(i)) corresponding to the ith port + ## Create inverse mapping + for i = 1:n_bonds + eval(sprintf('bond_port_head%i = "[]"', i)) + eval(sprintf('bond_port_tail%i = "[]"', i)) + endfor + for i = 1:n_ports + if (port_bond(i) > 0) + eval(sprintf('bond_port_head%i = "%s"', port_bond(i), ... + deblank(port_name(i,:)))) + else + eval(sprintf('bond_port_tail%i = "%s"', -port_bond(i), ... + deblank(port_name(i,:)))) + endif + endfor + + ## Locate the components at the ends of each bond + ## col 1 of comp_near_bond contains component nearest to the arrow end + ## col 2 of comp_near_bond contains component nearest other end + for i = 1:n_bonds + comp_near_bond(i,:) = adjcomp(arrow_end(i,:), other_end(i,:), ... + rcomponents); + endfor + comp_near_bond + + ## Deduce causality from the strokes (if any) + causality = zeros(n_bonds,2); + if (n_strokes > 0) + ## Find location of centre and ends of stroke + stroke_end_1 = [rstrokes(:,1), rstrokes(:,2)]; + stroke_end_2 = [rstrokes(:,3), rstrokes(:,4)]; + + stroke_centre = (stroke_end_1 + stroke_end_2)/2; + stroke_vector = (stroke_end_1 - stroke_end_2); + stroke_length = length2d(stroke_vector); + + for i = 1:n_strokes + stroke = [stroke_centre(i,:) + stroke_end_1(i,:) + stroke_end_2(i,:)]; + + + ## Find the nearest bond end + [index,distance] = adjbond(stroke(1,:),arrow_end,other_end); + if (distance > (2 * stroke_length(i))) + info = sprintf('Stroke at (%4.3f,%4.3f) is %4.3f away from the nearest bond\n', ... + stroke(1,1)/scale, stroke(1,2)/scale, ... + distance/scale); + endif + + ## Bond end coordinates + j = index(1,1); + which_end = (index(1,2) == 1); + bond_end = arrow_end(j,:) * which_end + other_end(j,:) * (1 - ... + which_end); + + ## Now decide which bit of the stroke is nearest + stroke_index = adjbond(bond_end, stroke, zeros(size(stroke))); + + if (stroke_index(1) == 1) # uni-causal stroke + causality(j,1:2) = (2 * which_end - 1) * [1, 1]; + else # bi-causal stroke + stroke_direction = stroke(1,:) - stroke(stroke_index(1),:); + flow_side = stroke_direction * arrow_vector(j,:)' > 0; + causality(j,1+flow_side) = 2 * which_end - 1; + endif + endfor + endif + causality + + ## Write data + for i = 1:n_bonds + [hc_type, hc_name] = eval([name, '_cmp(comp_near_bond(i,1))']); + [tc_type, tc_name] = eval([name, '_cmp(comp_near_bond(i,2))']); + ## components + eval(sprintf("bonds.bond%i.head.component\t= '%s:%s'", i, hc_type, ... + hc_name)); + eval(sprintf("bonds.bond%i.tail.component\t= '%s:%s'", i, tc_type, ... + tc_name)); + ## ports + eval(sprintf("bonds.bond%i.head.ports\t= bond_port_head%i", i, i)); + eval(sprintf("bonds.bond%i.tail.ports\t= bond_port_tail%i", i, i)); + ## causality + if (causality(i,1) == 1) + effort_causality = "head" + elseif (causality(i,1) == -1) + effort_causality = "tail" + else + effort_causality = "none" + endif + + if (causality(i,2) == 1) + flow_causality = "tail" + elseif (causality(i,2) == -1) + flow_causality = "head" + else + flow_causality = "none" + endif + + eval(sprintf("bonds.bond%i.causality.effort\t= '%s'", i, effort_causality)); + eval(sprintf("bonds.bond%i.causality.flow\t= '%s'", i, flow_causality)); + endfor + +endfunction ADDED mtt/bin/trans/m/rc_sim.m Index: mtt/bin/trans/m/rc_sim.m ================================================================== --- mtt/bin/trans/m/rc_sim.m +++ mtt/bin/trans/m/rc_sim.m @@ -0,0 +1,33 @@ +function [y,x] = rc_sim(mttx_0,mttU,mttT,MTTpar); + + ## Initialise + [MTTu] = zero_input(1); # Zero the input + + [MTTx] = mttx_0; # Read in initial state + + N = length(mttT); + Nx = length(mttx_0); + + y = zeros(1,N); + x = zeros(Nx,N); + + mttdt = mttT(2)-mttT(1); + for i = 1:N + MTTt = mttT(i); + MTTu = mttU(i); + [MTTy] = rc_cseo(MTTx,MTTu,MTTt,MTTpar); # Output + y(1,i) = MTTy; + x(:,i) = MTTx; + if 1>0 # Dont if no states + [MTTdx] = rc_cse(MTTx,MTTu,MTTt,MTTpar); # State derivative + [mttAA] = rc_smxa(MTTx,MTTu,mttdt,MTTpar); # (I-Adt) + [mttAA] = reshape(mttAA,Nx,Nx); + [mttAAx] = rc_smxax(MTTx,MTTu,mttdt,MTTpar); # (I-Adt)x + [MTTopen] = rc_switchopen(MTTx); # Open switches + [MTTx] = mtt_implicit(MTTx,MTTdx,mttAA,mttAAx,mttdt,1,MTTopen); # Implicit update + else + endif; # 1>0 + + endfor; # Integration loop + +endfunction ADDED mtt/bin/trans/m/rcs_header.txt Index: mtt/bin/trans/m/rcs_header.txt ================================================================== --- mtt/bin/trans/m/rcs_header.txt +++ mtt/bin/trans/m/rcs_header.txt @@ -0,0 +1,8 @@ + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ADDED mtt/bin/trans/m/replace_name.m Index: mtt/bin/trans/m/replace_name.m ================================================================== --- mtt/bin/trans/m/replace_name.m +++ mtt/bin/trans/m/replace_name.m @@ -0,0 +1,37 @@ +function string_array = replace_name(string_array, new, index); +% Replaces a row of a string vector with a string of arbitary length. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/07/02 12:36:39 peterg +## Initial revision +## +############################################################### + +string_array,new,index + [N,M]=size(string_array); + L = length(new); + + if index>N + error(["String array has less than ", num2str(index), " rows"]); + end; + + if LN + T = T'; + N = M; +end; + + + +one = eye(Nx); + +Y = zeros(N,Ny); +X = zeros(N,Nx); + +dt = T(2)-T(1);% Assumes fixed interval +##expAdt = expm(A*dt); % Compute matrix exponential +##expAt = one; +i = 0; +x = (B*u0+x0); +for t = T' + i=i+1; + if Nx>0 + ##expAt = expm(A*t); + ##x = expAdt*x; + x = expm(A*t)*(B*u0+x0); + X(i,:) = x'; + if Ny>0 + y = C*x; + Y(i,:) = y'; + end; + end; +end; + + + + + + ADDED mtt/bin/trans/m/sm2sr.m Index: mtt/bin/trans/m/sm2sr.m ================================================================== --- mtt/bin/trans/m/sm2sr.m +++ mtt/bin/trans/m/sm2sr.m @@ -0,0 +1,95 @@ +function [Y,X] = sm2sr(A,B,C,D,T,u0,x0); +% sm2sr - Constrained-state matrix to step response. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function sm2sr +% [Y,X] = sm2sr(A,B,C,D,T,u0,x0); +% A,B,C,D,E - (constrained) state matrices +% T vector of time points +% u0 input gain vector: u = u0*unit step. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 1996/12/05 10:18:52 peterg +% %% Saved (quite old) version which integrates IR to give SR +% %% +% %% Revision 1.3 1996/10/27 10:39:04 peterg +% %% Only compute matrix exponential once. +% %% +% %% Revision 1.2 1996/09/10 16:48:21 peter +% %% Changed ar counts in default settings. +% %% +% %% Revision 1.1 1996/08/19 15:34:29 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +[Ny,Nu] = size(D); +[Ny,Nx] = size(C); + +if nargin<6 + u0 = zeros(Nu,1); + u0(1) = 1; +end; + +if nargin<7 + x0 = zeros(Nx,1); +end; + +[N,M] = size(T); +if M>N + T = T'; + N = M; +end; + + + +one = eye(Nx); + +Y = zeros(N,Ny); +X = zeros(N,Nx); + +dt = T(2)-T(1);% Assumes fixed interval +expAdt = expm(A*dt); % Compute matrix exponential +i = 0; +expAt = one; + +for t = T' + i=i+1; + if Nx>0 + x = ( A\(expAt-one) )*B*u0 + expAt*x0; + expAt = expAt*expAdt; + X(i,:) = x'; + if Ny>0 + y = C*x + D*u0; + Y(i,:) = y'; + end; + elseif Ny>0 + y = D*u0; + Y(i,:) = y'; + end; +end; + +% $$$ % Compute the impulse response +% $$$ [Y,X] = sm2ir(A,B,C,D,T,u0,x0); +% $$$ +% $$$ % Assume fixed sample interval +% $$$ dT = T(2)-T(1); +% $$$ +% $$$ % Do an Euler integration on it +% $$$ Y = mtt_euler(Y,dT); +% $$$ +% $$$ if nargout>1 +% $$$ X = mtt_euler(X,dT); +% $$$ end; +% $$$ + + + ADDED mtt/bin/trans/m/split_port.m Index: mtt/bin/trans/m/split_port.m ================================================================== --- mtt/bin/trans/m/split_port.m +++ mtt/bin/trans/m/split_port.m @@ -0,0 +1,45 @@ +function [subport,n]=split_port(port_name); + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 1998/04/16 14:08:00 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + subport = ""; + raw_subport = char(strsplit(port_name, ',')); # Find the components of the vector + # port + [n,m] = size(raw_subport); # Number of ports + + for i = 1:n + s = deblank(raw_subport(i,:)); + l = length(s); + + if s(1)=="[" # Remove leading [ (if any) + l = l-1; + s = substr(s,2,l); + end + + if s(l)=="]" # Remove trailing ] (if any) + l = l-1; + s = substr(s,1,l); + end + + s = ["[",s,"]"]; # Surround by [] + + subport = [subport ;s]; # Return to the array + end; + +endfunction; + + + + + ADDED mtt/bin/trans/m/str2ch.m Index: mtt/bin/trans/m/str2ch.m ================================================================== --- mtt/bin/trans/m/str2ch.m +++ mtt/bin/trans/m/str2ch.m @@ -0,0 +1,47 @@ +function ch = str2ch(str,n) +% str2ch - pulls the nth char from a string +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function str2ch.m +% ch = str2ch(str,n) +% Copyright (c) P.J. Gawthrop, 1996. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1996/12/04 21:39:55 peterg +% %% Changed to handle null string (octave returns lenghth of 1) +% %% +% %% Revision 1.1 1996/08/30 09:54:44 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +implicit_str_to_num_ok = 1; + +astr = abs(str); +if (n>0) & (n<=length(str)) & (strcmp(str,'')==0) + ch = char(astr(n)); +else + ch = ''; +end; + + + + + + + + + + + + + + + ADDED mtt/bin/trans/m/subs_arg.m Index: mtt/bin/trans/m/subs_arg.m ================================================================== --- mtt/bin/trans/m/subs_arg.m +++ mtt/bin/trans/m/subs_arg.m @@ -0,0 +1,93 @@ +function args_out = subs_arg(args,Args, ... + default,full_name,comp_type,comp_name,fileID) +% subs_arg - substitutes arguments into args from Args +% FS defaults to `;'. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function subs_arg.m +% args_out = subs_arg(args,Args,default,comp_type,comp_name,infofile) +% Copyright (c) P.J. Gawthrop, 1996. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.7 2001/07/03 22:59:10 gawthrop +% %% Fixed problems with argument passing for CRs +% %% +% %% Revision 1.6 1998/07/27 09:53:44 peterg +% %% No change +% %% +% %% Revision 1.5 1998/07/21 16:43:26 peterg +% %% Now writes to an explicit fileID - otherwise we may run out of IDs. +% %% +% %% Revision 1.4 1996/12/10 16:04:11 peterg +% %% Changed file handling on mtt_info. +% %% +% %% Revision 1.3 1996/12/07 18:19:39 peterg +% %% Replaces null argument by a default and tells user. +% %% +% %% Revision 1.2 1996/12/04 21:47:41 peterg +% %% Skips main loop when arg is null. +% %% +% %% Revision 1.1 1996/12/04 21:46:52 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Symbolic argument sign +S = '$'; + +args_out = ''; +if strcmp(args,'')==0 + L = length(args); + args_count = 1; + num_count=0; + while args_count <= L + ch = str2ch(args,args_count); + if ch~=S % copy character + args_out = [args_out, ch]; + args_count = args_count+1; + else % find argument number + args_count = args_count+1; + + ch = str2ch(args,args_count); + ## Modification for $p1 $a1 etc + if !((ch>='0') & (ch<='9')) # It's not numerical - so loose it + args_count = args_count+1; + ch = str2ch(args,args_count); + endif + + i=0; + while (ch>='0') & (ch<='9') + i = 10*i + abs(ch)-abs('0'); + if args_count==L + args_count = args_count+1; + break + end; + args_count = args_count+1; + ch = str2ch(args,args_count); + end; + arg_out = args2arg(Args,i); + + + % Test for empty argument -- replace by default and tell user + message = 'Argument %1.0f of component %s(%s) of system %s is undefined - \n replacing by %s'; + if strcmp(arg_out,'') + info = sprintf(message, ... + i, comp_name, comp_type, full_name, default); + arg_out = default; + else + info = sprintf("Replacing $%i \t by %s for component %s (%s) ... + within %s", i, arg_out, comp_name, comp_type, full_name); + end; + mtt_info(info,fileID); + args_out = [args_out, arg_out]; + end; + end; +end; ADDED mtt/bin/trans/m/varname.m Index: mtt/bin/trans/m/varname.m ================================================================== --- mtt/bin/trans/m/varname.m +++ mtt/bin/trans/m/varname.m @@ -0,0 +1,42 @@ +function name = varname(name,index,causality); + ## varname - Creates name of bond graph variable + ## Usage: name = varname(name,index,causality); + +## ###################################### +## ##### Model Transformation Tools ##### +## ###################################### +## +## Matlab function varname.m +## Copyright (C) 1994-2003 by Peter J. Gawthrop + + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.4 2003/03/24 09:09:52 gawthrop +# ## Reformated to octave standard +# ## Now writes variables in non-matrix form +# ## +# ## Revision 1.3 2003/03/13 14:22:34 gawthrop +# ## No negative bond numbers +# ## +# ## Revision 1.2 2000/12/27 16:06:15 peterg +# ## *** empty log message *** +# ## +# ## Revision 1.1 1996/08/27 08:08:44 peterg +# ## Initial revision +# ## +# ############################################################### + + +# # bond_name = [name,'_bond']; +# # name =sprintf('%s%1.0f_%s', bond_name, index, cause2name(causality)); + +# # bond_name = [name,'(']; +# # name =sprintf('%s(%1.0f,%1.0f)', name, abs(index), cause2num(causality)); + + name =sprintf('%s_%i_%s', name, abs(index), cause2name(causality)); + +endfunction ADDED mtt/bin/trans/m/write_abg.m Index: mtt/bin/trans/m/write_abg.m ================================================================== --- mtt/bin/trans/m/write_abg.m +++ mtt/bin/trans/m/write_abg.m @@ -0,0 +1,200 @@ +function write_abg(system_name,bonds,connections,n_vector_bonds); + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.11 2004/09/12 22:27:27 geraint +## Appended 't' to fopen mode string to open in text mode. +## +## Revision 1.10 2004/08/09 14:47:28 gawthrop +## Changed arg to args to avoid strange octave bug +## +## Revision 1.9 2001/04/15 21:15:41 geraint +## Added interface definition rep: _ICD.(txt|c|cc|m). +## +## Revision 1.8 1999/10/18 22:41:41 peterg +## Corrected vector junction expansion +## +## Revision 1.7 1999/10/18 05:16:51 peterg +## Now vectorises 0 and 1 junctions !! +## +## Revision 1.6 1998/09/02 11:35:20 peterg +## Removed port.index field +## +## Revision 1.5 1998/09/02 10:30:30 peterg +## Now writes out list of ports ans list of subsystems. +## These ordereded lists determine the order of processing of ports ans +## subsystems. +## +## Revision 1.4 1998/08/26 12:45:38 peterg +## Just prefix ports (comps can't start with numeral) +## Prefix with mttp +## +## Revision 1.3 1998/08/26 12:31:07 peterg +## numerical names prefixed by mtt +## +## Revision 1.2 1998/08/26 11:59:20 peterg +## Don't use strrep to remove[] +## +## Revision 1.1 1998/08/25 06:22:02 peterg +## Initial revision +## +############################################################### + + + fid=fopen([system_name,"_abg.m"], "wt"); + [N,M]=size(connections); + Sformat = " %s.subsystems.%s.%s = \"%s\";\n"; + PSformat = " %s.ports.%s.%s = \"%s\";\n"; + Iformat = " %s.subsystems.%s.%s = %i;\n"; + PIformat = " %s.ports.%s.%s = %i;\n"; + Cformat = " %s.subsystems.%s.connections = ["; + PCformat = " %s.ports.%s.connections = ["; + Bformat = " %s.bonds = [\n"; + + fprintf(fid,"function [%s] = %s_abg\n", system_name, system_name); + fprintf(fid,"# This function is the acausal bond graph representation of %s\n",system_name); + fprintf(fid,"# Generated by MTT on %s",ctime(time)); + fprintf(fid,"# The file is in Octave format\n"); + + fprintf(fid,"\n# Subsystems and Ports\n"); + i_port=0; SubsystemList = ""; PortList =""; + for i=1:N + eval(["[comp_type, name, cr, args, repetitions] = ", system_name, "_cmp(i);"]); + c = nozeros(connections(i,:));# Connections to this component + m = length(c); # Number of connections + + ## Vectorise junctions? + n_bonds = n_vector_bonds(i); + if strcmp(comp_type,"0")||strcmp(comp_type,"1") + n_vector = m/n_bonds; + m_vector = n_bonds; + else + n_vector = 1; + m_vector = m; + endif + + if index(name,"[")==0 # Not a port + for i_vector = 1:n_vector; + + if i_vector>1 # Extras + new_name = sprintf("%sv%i", name,i_vector); + else + new_name = name; + endif + + SubsystemList = [SubsystemList; new_name]; + fprintf(fid,"\n# Component %s\n", new_name); + fprintf(fid,Sformat,system_name,new_name,"type",comp_type); + fprintf(fid,Sformat,system_name,new_name,"cr",cr); + fprintf(fid,Sformat,system_name,new_name,"arg",args); + fprintf(fid,Iformat,system_name,new_name,"repetitions",repetitions); + fprintf(fid,Iformat,system_name,new_name,"status",-1); + + ##Connections + fprintf(fid,Cformat,system_name,new_name); + ## Each vector junction has n*m bonds + ## n - dimension of vector + ## m - number of bonds + + ## The first m bonds (in c) correspond to the first vector element + if i_vector==1 + for j=1:m_vector + fprintf(fid,"%i ", c(j) ); + endfor + ## The next block of n-1 bonds are the first bonds on vector elements 2,3 ... + ## followed by a block of n-1 bonds being the second bonds on vector elements 2,3 ... + ## etc + else + k = m_vector+i_vector-1; # index of first bond at level i_vector + for j=1:m_vector + fprintf(fid,"%i ", c(k) ); + k = k + n_vector-1; + endfor + endif + + fprintf(fid,"];\n"); + endfor + else # Its a port + name=name(2:length(name)-1); # Strip [] + ch=name(1); # First char of name + if (ch>="0")&&(ch<="9") # Its a numeral + name=["mttp",name]; # prefix by mttp + endif; + + for i_port=1:m + if m>1 # Index the port name + name_i = sprintf("%s_%i",name,i_port); + else + name_i = name; # Leave it alone + endif; + + PortList = [PortList; name_i]; # Update port list + + fprintf(fid,"\n# Port %s\n", name_i); + fprintf(fid,PSformat,system_name,name_i,"type",comp_type); + fprintf(fid,PSformat,system_name,name_i,"cr",cr); + fprintf(fid,PSformat,system_name,name_i,"arg",args); + fprintf(fid,PIformat,system_name,name_i,"repetitions",repetitions); + fprintf(fid,PIformat,system_name,name_i,"status",-1); + + fprintf(fid,PCformat,system_name,name_i); + fprintf(fid,"%i ", c(i_port)); + fprintf(fid,"];\n"); + + endfor; + endif; + endfor; + + [N,M]=size(PortList); + if N>0 # Put name in list + fprintf(fid,"\n# Ordered list of Port names\n"); + for i=1:N + fprintf(fid," %s.portlist(%i,:) = \"%s\";\n", system_name, i, PortList(i,:)); + endfor; + endif; + + [N,M]=size(SubsystemList); + if N>0 # Put name in list + fprintf(fid,"\n# Ordered list of subsystem names\n"); + for i=1:N + fprintf(fid," %s.subsystemlist(%i,:) = \"%s\";\n", system_name, i, SubsystemList(i,:)); + endfor; + endif; + + + fprintf(fid,"\n# Bonds \n"); + [N,M]=size(bonds); # Bonds + fprintf(fid,Bformat,system_name); + for i=1:N + fprintf(fid," "); + for j=1:M + fprintf(fid,"%i ", bonds(i,j)); + endfor; + fprintf(fid,"\n"); + endfor; + fprintf(fid," ];\n"); + + fprintf(fid,"\n# Aliases \n"); + fprintf(fid,"# A double underscore __ represents a comma \n"); + eval(["alias = ", system_name, "_alias;"]); + if isstruct(alias) + for [val,key] = alias + fprintf(fid,"%s.alias.%s = \"%s\";\n", system_name,key,val); + endfor + endif + + fprintf(fid,"\n# Interface Definition\n"); + eval(["icd = ",system_name, "_icd;"]); + if isstruct(icd) + for [val,key] = icd + fprintf(fid,"%s.icd.%s = \"%s\";\n",system_name,key,val); + endfor + endif + + + fclose(fid); + + ADDED mtt/bin/trans/m/write_cbg.m Index: mtt/bin/trans/m/write_cbg.m ================================================================== --- mtt/bin/trans/m/write_cbg.m +++ mtt/bin/trans/m/write_cbg.m @@ -0,0 +1,87 @@ +function write_cbg(system_name,system_type,system,Flipped) + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 2004/09/12 22:27:27 geraint +## Appended 't' to fopen mode string to open in text mode. +## +## Revision 1.4 1998/08/26 12:26:17 peterg +## Replaced if N>0 by if (N>0)&&(M>0) # Flipped ports exist +## +## Revision 1.3 1998/08/25 20:05:33 peterg +## Write flipped port info +## +## Revision 1.2 1998/08/25 06:21:19 peterg +## Just writes additional information; basic info from the abg structure. +## +## Revision 1.1 1998/08/25 05:55:10 peterg +## Initial revision +## +############################################################### + + + fid=fopen([system_name,"_cbg.m"], "wt");# Open file + + StatusFormat = " %s.%s.%s.status = %i;\n"; + Bformat = " %s.bonds = [\n"; + Iformat = " %s.%s.%s.connections(%i) = %i;\n"; + + + fprintf(fid,"function [%s] = %s_cbg\n", system_name, system_name); + fprintf(fid,"# This function is the causal bond graph representation of %s\n",system_name); + fprintf(fid,"# Generated by MTT on %s",ctime(time)); + fprintf(fid,"# The file is in Octave format\n"); + + fprintf(fid,"\n# Acausal bond graph structure\n"); + fprintf(fid," [%s] = %s_abg;\n", system_name, system_type); + + fprintf(fid,"\n# Status information\n"); +# if isfield(system,"ports") +# for [port,name]=system.ports +# fprintf(fid,StatusFormat,system_name,"ports",name,port.status); +# endfor; +# endif + if isfield(system,"subsystems") + for [subsystem,name]=system.subsystems + fprintf(fid,StatusFormat,system_name,"subsystems",name,subsystem.status); + endfor; + endif + + [N,M]=size(system.bonds); # Bonds + fprintf(fid,"\n# Causal bond information\n"); + fprintf(fid,Bformat,system_name); + for i=1:N + fprintf(fid," "); + for j=1:M + fprintf(fid,"%i ", system.bonds(i,j)); + endfor; + fprintf(fid,"\n"); + endfor; + fprintf(fid," ];\n"); + + [N,M]=size(Flipped.ports); + if (N>0)&&(M>0) # Flipped ports exist + fprintf(fid,"\n# Flipped port information\n"); + for i=1:N + name=deblank(Flipped.ports(i,:)); + eval(["con = system.ports.",name,".connections;"]); + fprintf(fid,Iformat,system_name,"ports",name,1,con); + endfor; + endif; + + [N,M]=size(Flipped.subs); + if (N>0)&&(M>0) # Flipped subs exist + for i=1:N + name=deblank(Flipped.subs(i,:)); + k=Flipped.cons(i); + eval(["con = system.subsystems.",name,".connections(",num2str(k),");"]); + fprintf(fid,Iformat,system_name,"subsystems",name,k,con); + endfor; + endif; + + fclose(fid); + + ADDED mtt/bin/trans/m/write_ibg.m Index: mtt/bin/trans/m/write_ibg.m ================================================================== --- mtt/bin/trans/m/write_ibg.m +++ mtt/bin/trans/m/write_ibg.m @@ -0,0 +1,43 @@ +## -*-octave-*- + +function write_ibg(system_name,bonds); + + fid = fopen([system_name,"_ibg.m"], "wt"); + [nbonds, junk] = size(fieldnames(bonds)); + format_hc = " %s.bonds.bond%i.head.component\t= \"%s\";\n"; + format_tc = " %s.bonds.bond%i.tail.component\t= \"%s\";\n"; + format_hp = " %s.bonds.bond%i.head.ports\t= \"%s\";\n"; + format_tp = " %s.bonds.bond%i.tail.ports\t= \"%s\";\n"; + format_ce = " %s.bonds.bond%i.causality.effort\t= \"%s\";\n"; + format_cf = " %s.bonds.bond%i.causality.flow\t= \"%s\";\n"; + + fprintf(fid, "## -*-octave-*-\n\n"); + fprintf(fid, "function [%s] = %s_ibg\n\n", system_name, system_name); + fprintf(fid, " ## Intermediate bond graph representation of %s\n", ... + system_name); + + fprintf(fid, " ## Generated by MTT on %s\n", ctime(time)); + fprintf(fid, " ## head refers to the harpoon end of a bond\n"); + fprintf(fid, " ## tail refers to the other end of a bond\n"); + fprintf(fid, " ## causality.? is the end at which ? is imposed\n\n"); + + for i=1:nbonds + fprintf(fid, "\n ## bond %i\n", i); + fprintf(fid, format_hc, system_name, i, ... + eval(sprintf("bonds.bond%i.head.component", i))); + fprintf(fid, format_tc, system_name, i, ... + eval(sprintf("bonds.bond%i.tail.component", i))); + fprintf(fid, format_hp, system_name, i, ... + eval(sprintf("bonds.bond%i.head.ports", i))); + fprintf(fid, format_tp, system_name, i, ... + eval(sprintf("bonds.bond%i.tail.ports", i))); + fprintf(fid, format_ce, system_name, i, ... + eval(sprintf("bonds.bond%i.causality.effort", i))); + fprintf(fid, format_cf, system_name, i, ... + eval(sprintf("bonds.bond%i.causality.flow", i))); + endfor; + + fprintf(fid, "\nendfunction\n"); + fclose(fid); + +endfunction; ADDED mtt/bin/trans/m/write_matrix.m Index: mtt/bin/trans/m/write_matrix.m ================================================================== --- mtt/bin/trans/m/write_matrix.m +++ mtt/bin/trans/m/write_matrix.m @@ -0,0 +1,75 @@ +function write_matrix(matrix,name,extn); + +% Writes the matrix function file + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.9 2006/09/27 13:55:08 geraint +% %% Write complex numbers in polar form instead of real and imaginary parts. +% %% +% %% Revision 1.8 2004/09/12 22:27:27 geraint +% %% Appended 't' to fopen mode string to open in text mode. +% %% +% %% Revision 1.7 2002/05/15 16:37:30 gawthrop +% %% Added third argument (file extension) +% %% +% %% Revision 1.6 2000/12/27 16:06:17 peterg +% %% *** empty log message *** +% %% +% %% Revision 1.5 1998/02/03 08:40:39 peterg +% %% Fixed a horrible bug -- changed filename -> filenum +% %% +% %% Revision 1.4 1996/08/15 11:56:11 peter +% %% Does complex matrices. +% %% +% %% Revision 1.3 1996/08/14 19:20:41 peter +% %% Fixed output naming bug. +% %% +% %% Revision 1.2 1996/08/14 08:36:52 peter +% %% Puts a tab between columns. +% %% +% %% Revision 1.1 1996/08/14 08:21:27 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +if nargin<3 + extn="m"; +endif + +filename = sprintf("%s.%s", name, extn); +filenum = fopen(filename,'wt'); + +% Write the function m-file for the causal bond graph +pc = '%'; +fprintf(filenum, 'function data = %s\n', name); +fprintf(filenum, '%s data = %s\n\n', pc, name); + +fprintf(filenum, 'data = [\n'); + +[N,M] = size(matrix); +for row = 1:N + for col = 1:M + value = matrix(row,col); + if iscomplex(value) + fprintf(filenum, '%g*e^(%g*i)', abs(value),angle(value)); + else + fprintf(filenum, '%g', value); + end + if col0 {print} ' <$1.m >$1.dat + ADDED mtt/bin/trans/make_ode2odes Index: mtt/bin/trans/make_ode2odes ================================================================== --- mtt/bin/trans/make_ode2odes +++ mtt/bin/trans/make_ode2odes @@ -0,0 +1,1429 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.90 2005/04/26 23:43:34 geraint +## Reset open switches after update to eliminate overshoots. +## +## Revision 1.89 2004/08/29 16:04:44 geraint +## Fixed ae for non-sorted code. +## +## Revision 1.88 2004/08/29 13:15:28 geraint +## Uses sys_sae instead of sys_ae if sorted equations are being used. +## +## Revision 1.87 2004/08/29 01:46:56 geraint +## Added rules to create ode2odes for sorted system: sesx and sesy. +## +## Revision 1.86 2004/08/29 00:19:49 geraint +## Defaults to noAlgebraicSolver. +## +## Revision 1.85 2003/06/25 12:46:06 gawthrop +## Input only changed one per print interval +## No effect if stepfactor=1 +## Fixes bug when _input.m is compiled using -stdin option +## and stepfactor>1 +## +## Revision 1.84 2003/04/17 20:57:29 geraint +## Added -sort option to allow direct generation of ode2odes.m using sese.m +## instead of ode/csex. +## +## "mtt -sort rc odeso view" works without Reduce installed!!! +## +## Revision 1.83 2002/08/07 14:27:14 geraint +## Changes to make "-i dassl" work again. +## +## Revision 1.82 2002/07/24 14:00:12 geraint +## Corrected arguments passed to mtt_write when dumping data (sigint). +## +## Revision 1.81 2002/07/11 13:00:23 geraint +## Declared more function arguments to be "const" - improves compiler optimisation. +## +## Revision 1.80 2002/05/22 09:35:49 geraint +## Added insertor variable to stop sh-mode font-lock from getting hopelessly confused by embedded C++. +## +## Revision 1.79 2002/05/20 13:42:31 gawthrop +## Uses simpar.first for first printed output +## +## Revision 1.78 2002/05/11 01:14:17 geraint +## Fix for [ 553218 ] simpar.oct and simpar.m different. +## Translation added between ColumnVector in base .cc and Octave_map in .oct. +## +## Revision 1.77 2002/05/08 16:03:32 geraint +## Added mex support for ode2odes: mtt sys ode2odes mexglx. +## This mex stuff seems to require octave2.1-headers. +## +## Revision 1.76 2002/05/08 14:14:55 geraint +## Tidied up ode2odes code - reduced interweaving of STANDALONE/OCTAVEDLD sections +## +## Revision 1.75 2002/05/07 13:48:42 geraint +## Improved clarity of code generated for -cc and -oct (except ode2odes). +## Octave DEFUN_DLDs now call (rather than replace) their .cc equivalents. +## +## Revision 1.74 2002/05/01 17:30:56 geraint +## Improved pre-processor directives to better accommodate future alternatives (matlab) +## if necessary. +## +## Revision 1.73 2002/05/01 12:24:41 geraint +## Removed unnecessary inclusion of load-save.h. +## +## Revision 1.72 2002/05/01 12:21:29 geraint +## No longer uses save_ascii_data_for_plotting function to write data +## - eliminates dependence on liboctinterp (and libncurses) for .cc. +## +## Revision 1.71 2002/04/30 23:27:00 geraint +## Replaced octave_map with columnvector in simpar.cc. Not quite as descriptive but +## standardises the interfaces somewhat and reduces the dependency on liboctinterp +## (and thus libreadline, libkpathsea, libncurses, etc). +## +## Revision 1.70 2002/04/28 18:41:27 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.69 2002/04/17 13:46:58 geraint +## #include for -oct as well as -cc. +## +## Revision 1.68 2002/04/15 10:54:31 geraint +## Statically declare outputs and initialise to zero. +## This is necessary to prevent spurious values from being output when no assignments are made (i.e. when "y(i) := 0 for all u" (Reduce:see NERO)). +## +## Revision 1.67 2002/04/09 12:04:21 geraint +## Replaced ios:: with std::ios:: for g++-3.0 compatability. +## +## Revision 1.66 2002/03/26 11:58:58 geraint +## Added cputime monitoring. +## +## Revision 1.65 2001/11/15 06:24:11 geraint +## Updated (-i dassl) residual function to use new DAEFunc (octave-2.1.35). +## YZ residual dependency on Ui still requires some work. +## +## Revision 1.64 2001/08/08 02:15:00 geraint +## Rationalisation of solver code, beginning with algebraic solvers. +## +## Revision 1.63 2001/08/07 04:39:24 geraint +## Consolidated dassl and residual functions. +## +## Revision 1.62 2001/08/01 22:14:32 geraint +## Bug fix for dassl. +## +## Revision 1.61 2001/08/01 04:06:07 geraint +## Added -i dassl for -cc and -oct. +## +## Revision 1.60 2001/07/16 22:23:00 geraint +## Fixed misleading variable name in .cc rep. +## +## Revision 1.59 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## +## Revision 1.58 2001/07/13 00:51:39 geraint +## Fixed generation of odes.sg from .m and .oct simulations. +## .cc, .m and .oct simulations now all write mtt_data (lower case). +## +## Revision 1.57.2.5 2001/07/13 04:02:31 geraint +## Implemented numerical algebraic solution for _ode2odes.oct. +## +## Revision 1.57.2.4 2001/07/02 00:34:56 geraint +## gcc-3.0 compatibility. +## +## Revision 1.57.2.3 2001/06/25 23:28:29 geraint +## Generic mtt_rate and mtt_output - allows method independent calls. +## +## Revision 1.57.2.2 2001/06/05 03:20:40 geraint +## added -ae option to select algebraic equation solution method. +## +## Revision 1.57.2.1 2001/05/04 04:07:24 geraint +## Numerical solution of algebraic equations. +## sys_ae.cc written for unsolved inputs. +## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). +## +## Revision 1.57 2001/04/01 03:38:54 geraint +## Reset row to zero after write to file, ready for subsequent runs. +## Eliminates SIGSEGV in Octave when _ode2odes called multiple times. +## +## Revision 1.56 2001/03/30 15:13:58 gawthrop +## Rationalised simulation modes to each return mtt_data +## +## Revision 1.55 2001/03/27 13:21:59 geraint +## Octave version compatibility for save_ascii_data(_for_plotting). +## +## Revision 1.54 2001/03/27 01:14:27 geraint +## Improved determination of Octave version. +## +## Revision 1.53 2001/03/21 03:24:59 geraint +## Calculate inputs before outputs (.cc). +## +## Revision 1.52 2001/03/19 02:28:52 geraint +## Branch merge: merging-ode2odes-exe back to MAIN. +## +## Revision 1.51.2.7 2001/03/17 09:51:07 geraint +## Implemented Runge-Kutta IV fixed-step method (-i rk4). +## +## Revision 1.51.2.6 2001/03/16 03:56:13 geraint +## Removed psignal/siginfo.h - problematic and unnecessary. +## +## Revision 1.51.2.5 2001/03/12 23:16:37 geraint +## Minor improvements to signal handling (.exe). +## +## Revision 1.51.2.4 2001/03/12 03:59:30 geraint +## SIGINT (C-c C-c) now causes simulation data to be dumped to MTT.core. +## SIGQUIT (C-c C-\) as for SIGINT, then raises default SIGQUIT. +## SIGFPE as for SIGINT, then raises default SIGABRT. +## +## Revision 1.51.2.3 2001/03/07 04:06:55 geraint +## Irix: catch SIGFPE and write data before aborting (.exe). +## GNU/Linux: nada. +## +## Revision 1.51.2.2 2001/03/02 00:45:21 geraint +## Separated Euler and Implicit methods in .cc code and dependencies. +## +## Revision 1.51.2.1 2001/03/01 05:05:53 geraint +## Minor revisions. +## +## Revision 1.51 2001/02/19 06:33:19 geraint +## Removed operation form loop. +## +## Revision 1.50 2001/02/18 09:18:49 geraint +## Removed temporary Matrices from mtt_implicit.cc +## +## Revision 1.49 2001/02/14 06:06:34 geraint +## Removed octave_value_list wrappers from standalone.exe - speed improvements +## +## Revision 1.48 2001/02/11 07:08:59 geraint +## Static declarations of octave_value_lists: small .exe speed improvement +## +## Revision 1.47 2001/02/11 05:25:52 geraint +## Reduced number of matrix operations during .oct simulation data write +## +## Revision 1.46 2001/02/05 08:32:31 geraint +## typo +## +## Revision 1.45 2001/02/05 04:32:35 geraint +## Octave version 2.1.x compatability and #ifdef statements for standalone rep +## +## Revision 1.46 2001/01/08 06:21:59 geraint +## #ifdef STANDALONE stuff +## +## Revision 1.45 2001/01/07 01:25:49 geraint +## Compatibility with Octave 2.1.33 +## +## Revision 1.44 2000/12/05 12:11:45 peterg +## Changed function name to name() +## +## Revision 1.43 2000/12/04 10:59:40 peterg +## *** empty log message *** +## +## Revision 1.42 2000/11/10 14:19:50 peterg +## Corrected the csex and cseo functions +## +## Revision 1.41 2000/11/09 17:06:39 peterg +## Now does euler for cc +## +## Revision 1.40 2000/10/17 09:55:00 peterg +## Replaced switchopen by logic +## +## Revision 1.39 2000/10/14 08:04:40 peterg +## Changed arguments to _inout for consistency +## +## Revision 1.38 2000/10/11 09:08:08 peterg +## cse --> csex +## +## Revision 1.37 2000/08/01 12:25:06 peterg +## Now includes euler +## +## Revision 1.36 2000/05/19 17:48:16 peterg +## Argument to state +## +## Revision 1.35 2000/05/18 18:59:40 peterg +## Removed the First time stuff +## +## Revision 1.34 2000/05/16 18:56:14 peterg +## *** empty log message *** +## +## Revision 1.33 2000/05/11 19:33:18 peterg +## Uniform version for _sim.m +## +## Revision 1.32 2000/05/11 08:30:00 peterg + +## +## Revision 1.31 2000/05/10 18:33:25 peterg +## Use smxa and smxax in place of smx +## +## Revision 1.30 2000/04/18 11:24:19 peterg +## Removed _numpar. +## +## Revision 1.29 2000/04/07 19:10:57 peterg +## *** empty log message *** +## +## Revision 1.28 1999/12/08 05:56:52 peterg +## Reordered the writing of the input and output. +## Note that last value now discarded. +## +## Revision 1.27 1999/11/15 22:47:53 peterg +## Generates method-specific code. +## +## Revision 1.26 1999/10/20 01:31:43 peterg +## *** empty log message *** +## +## Revision 1.25 1999/08/29 06:55:26 peterg +## Removed [MTTu] = zero_input($Nu); # Zero the input +## to avoide the p2c bug ???? +## +## Revision 1.24 1999/08/27 06:02:16 peterg +## removed zero_input to avoid p2c bug +## +## Revision 1.23 1999/08/02 13:39:19 peterg +## Replaced zero_vector by zero_input +## +## Revision 1.22 1999/04/20 06:16:07 peterg +## Removed initialisation of AA and AAx +## Remove _switch calls -- uses _switchopen exclusively +## +## Revision 1.21 1999/04/02 06:29:25 peterg +## New implicit method - solves numerical prob with ISW +## +## Revision 1.20 1999/04/02 02:13:58 peterg +## Back to RCS +## +## Revision 1.19 1999/03/30 21:39:25 peterg +## In implicit approach, set derivatives to zero (when switch is off) +## before update. This seems to stop numerical leakage though non-return +## switches. +## +## Revision 1.18 1999/03/15 01:17:07 peterg +## Removed some spurious debugging code +## +## Revision 1.17 1999/03/15 01:09:15 peterg +## Fixed bugs when Nx=0 (no state) +## +## Revision 1.16 1999/03/06 02:28:38 peterg +## Rearranged evaluation to: state - input - output - write +## +## Revision 1.15 1999/03/06 02:19:43 peterg +## Changed args to _input +## +## Revision 1.14 1998/10/01 16:02:01 peterg +## Integration with switches handled separately fro Euler and Implicit. +## +## Revision 1.13 1998/09/30 17:41:24 peterg +## Implicit method now allows for switches via _switchA +## +## Revision 1.12 1998/08/27 08:55:18 peterg +## Mods to integration methods +## +## Revision 1.11 1998/08/25 12:28:31 peterg +## Move initila switch to after initial input +## +## Revision 1.10 1998/08/25 12:22:45 peterg +## Put _switch after update and also at initilisation +## +## Revision 1.9 1998/08/15 13:46:59 peterg +## New versions of integration routines +## +## Revision 1.8 1998/08/11 13:28:03 peterg +## Lowercase mttLAST etc +## +## Revision 1.7 1998/07/30 11:29:54 peterg +## Added implicit integration stuff +## +## Revision 1.6 1998/07/30 10:44:37 peterg +## INcluded othe integration methods. +## +## Revision 1.5 1998/07/26 11:02:20 peterg +## Put mtt or MTT in front of variable names to avoid clashes with +## globals +## +## Revision 1.4 1998/07/25 20:14:00 peterg +## update code added for flexibility and octave efficiency +## +############################################################### + + +# Bourne shell script: make_ode2odes + +# Copyright (c) P.J.Gawthrop July 1998. + +# Tell user +sys=$1 +lang=$2 +filename=${sys}_ode2odes.${lang} + +if [ -n "$3" ]; then + method=$3 +else + method=implicit +fi + +if [ -n "$4" ]; then + algebraic_solver=$4 +else + algebraic_solver="noAlgebraicSolver" +fi + +if [ -n "$5" ]; then + sorted_equations=$5 +else + sorted_equations="no" +fi + +insertor=\<\< # help emacs sh-mode handle C++ lines + +echo Creating $filename with $method integration method + +# Find system constants +Nx=`mtt_getsize $sys x` # States +Nu=`mtt_getsize $sys u` # Inputs +Ny=`mtt_getsize $sys y` # Outputs + +case "$method" in + "implicit") + ae=ae + ode=csex + odeo=cseo + algorithm="mtt_implicit(x,dx,AA,AAx,ddt,$Nx,open_switches)" + ;; + "dassl") + case "$sorted_equations" in + "make") # used by sese generated by make + ae=sae + ode=sesx + odeo=sesy + ;; + "seqn") # shouldn't be here unless mtt has changed + ae=ae + ode=sese + odeo=sese + ;; + "no" | *) + ae=ae + ode=ode + odeo=odeo + ;; + esac + algorithm="mtt_dassl(x,u,t,par,dx,ddt,MTTNX,MTTNYZ,open_switches)" + ;; + "sorted_euler") # used by sese generated from seqn + algorithm="mtt_euler(x,dx,ddt,$Nx,open_switches)" + ;; + "euler" | "rk4" | *) + case "$sorted_equations" in + "make") # used by sese generated by make + ae=sae + ode=sesx + odeo=sesy + ;; + "seqn") # shouldn't be here unless mtt has changed + ae=ae + ode=sese + odeo=sese + ;; + "no" | *) + ae=ae + ode=ode + odeo=odeo + ;; + esac + algorithm="mtt_euler(x,dx,ddt,$Nx,open_switches)" + ;; +esac + +make_m() +{ +#lang_header $1 ode2odes m 'x,par,simpar' '[Y,X,t]' > $filename +mtt_header ${sys} ode2odes m > $filename +cat <> $filename +global MTT_data + + if nargin<3 + simpar = ${sys}_simpar(); + [simpar.dt] = mtt_simpar_update; + endif + if nargin<2 + par = ${sys}_numpar(); + [par] = mtt_numpar_update(par); + endif + if nargin<1 + [x0] = ${sys}_state(par); + [x0] = mtt_state_update(x); + endif + + ## Initialise + t = 0.0; + ddt = simpar.dt/simpar.stepfactor; + ilast = round(simpar.last/ddt)+1; # Total number of steps + x = x0; + +## Following removed due to p2c bug +## [u] = zero_input($Nu); # Zero the input + for MTTi=1:$Ny + y(MTTi) = 0; + endfor; + + mttj = 0; + for it = 1:ilast #Integration loop +EOF + +cat <> $filename + if mttj==0 + [u] = ${sys}_input(x,y,t,par); # Input +EOF + +if [ "$method" = "sorted_euler" ]; then +cat <> $filename + [dx,y] = ${sys}_sese(x,u,t,par); # Output +EOF +else +cat <> $filename + [y] = ${sys}_$odeo(x,u,t,par); # Output +EOF +fi + +cat <> $filename + mtt_write(t,x,y,$Nx,$Ny,simpar.first); # Write it out + endif +EOF + +if [ "$method" = "rk4" ]; then +cat << EOF >> $filename + [k1] = ddt * ${sys}_${ode}(x,u,t,par); + [k2] = ddt * ${sys}_${ode}(x+k1/2,u,t+ddt/2,par); + [k3] = ddt * ${sys}_${ode}(x+k2/2,u,t+ddt/2,par); + [k4] = ddt * ${sys}_${ode}(x+k3,u,t+ddt,par); + [dx] = [k1 + 2.0 * [k2 + k3] + k4] / (6.0 * ddt); +EOF +elif [ "$method" = "sorted_euler" ]; then +cat <> $filename + [dx,y] = ${sys}_sese(x,u,t,par); # State derivative and Output +EOF +else +cat << EOF >> $filename + [dx] = ${sys}_$ode(x,u,t,par); # State derivative +EOF +fi + +if [ "$method" = "implicit" ]; then +cat<< EOF >> $filename + + [AA] = ${sys}_smxa(x,u,ddt,par); # (I-Adt) and (I-Adt)x + [AAx] = ${sys}_smxax(x,u,ddt,par); # (I-Adt) and (I-Adt)x + +EOF +fi + +cat <> $filename + [open_switches] = ${sys}_logic(x,u,t,par); # Switch logic + [x] = $algorithm; # Integration update + [open_switches] = ${sys}_logic(x,u,t,par); # Switch logic + [x] = mtt_zeroswitches(x,$Nx,open_switches); + t = t + ddt; # Time update + mttj = mttj+1; # Increment counter + if mttj==simpar.stepfactor + mttj = 0; # Reset counter + endif + + endfor; # Integration loop + +## Create the output data + mtt_data = MTT_data; +endfunction + +EOF +} # make_m + +make_cc() +{ +# get octave version +case `$MATRIX --version | gawk -F\. '{print $2}'` in + 0) # stable + vector_value=vector_value + feval_header=toplev.h + ;; + 1) # development + vector_value=column_vector_value + feval_header=parse.h + ;; + *) + vector_value=column_vector_value + feval_header=parse.h + ;; +esac + +cat < $filename + +// Code generation directives +#define STANDALONE 0 +#define OCTAVEDLD 1 +#define MATLABMEX 2 +#define RTXI 3 +#if (! defined (CODEGENTARGET)) +#define CODEGENTARGET STANDALONE +#endif // (! defined (CODEGENTARGET)) + +#include +#include +#include + +#if (CODEGENTARGET == OCTAVEDLD) +#include +#endif // (CODEGENTARGET == OCTAVEDLD) + +#include "${sys}_def.h" +#include "${sys}_sympar.h" + +#include "mtt_${algebraic_solver}.hh" + +#include +#if (CODEGENTARGET != OCTAVEDLD) + +extern ColumnVector ${sys}_${ae} ( + const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + +extern ColumnVector ${sys}_input ( + const ColumnVector &x, + const ColumnVector &y, + const double &t, + const ColumnVector &par); + +extern ColumnVector ${sys}_logic ( + const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + +extern ColumnVector ${sys}_numpar ( + void); + +extern ColumnVector ${sys}_simpar ( + void); + +extern ColumnVector ${sys}_state ( + const ColumnVector &par); + +extern ColumnVector ${sys}_${ode} ( + const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + +extern ColumnVector ${sys}_${odeo} ( + const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + +EOF +case "$method" in + "implicit") + cat <> $filename +extern ColumnVector Fmtt_implicit ( + ColumnVector &x, + ColumnVector &dx, + Matrix &AA, + ColumnVector &AAx, + const double &ddt, + const int &nx, + const ColumnVector &open_switches); + +extern Matrix ${sys}_smxa ( + const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + +extern ColumnVector ${sys}_smxax ( + const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + +EOF + ;; + "dassl") + cat <> $filename +extern ColumnVector Fmtt_dassl ( + ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par, + const ColumnVector &dx, + const double &ddt, + const int nx, + const int nyz, + const ColumnVector &open_switches); + +EOF + ;; + "euler" | "rk4" | *) + cat <> $filename +extern ColumnVector Fmtt_euler ( + ColumnVector &x, + const ColumnVector &dx, + const double &ddt, + const int &nx, + const ColumnVector &open_switches); + +EOF + ;; +esac +cat <> $filename + +#endif // (CODEGENTARGET != OCTAVEDLD) + +ColumnVector +mtt_ae (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_${ae}(x,u,t,par); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (u); + args (2) = octave_value (t); + args (3) = octave_value (par); + f = feval ("${sys}_${ae}", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline ColumnVector +mtt_input (const ColumnVector &x, + const ColumnVector &y, + const double &t, + const ColumnVector &par) +{ + static MTT::${algebraic_solver} ae(MTTNPAR,MTTNU,MTTNX,MTTNY,MTTNYZ); + static ColumnVector u (MTTNU); + +#if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) + u = ${sys}_input (x, y, t, par); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (y); + args (2) = octave_value (t); + args (3) = octave_value (par); + f = feval ("${sys}_input", args, 1); + u = f(0).${vector_value} (); +#endif // ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) + if (MTTNYZ == 0) + { + return u; + } + else + { + return ae.solve(x,u,t,par); + } +} + +inline ColumnVector +mtt_logic (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_logic (x, u, t, par); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (u); + args (2) = octave_value (t); + args (3) = octave_value (par); + f = feval ("${sys}_logic", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline ColumnVector +mtt_numpar (void) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_numpar (); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + f = feval ("${sys}_numpar", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline ColumnVector +mtt_simpar (void) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_simpar (); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + f = feval ("${sys}_simpar", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline ColumnVector +mtt_state (const ColumnVector &par) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_state (par); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (par); + f = feval ("${sys}_state", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline ColumnVector +mtt_rate (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_${ode} (x, u, t, par); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (u); + args (2) = octave_value (t); + args (3) = octave_value (par); + f = feval ("${sys}_${ode}", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline ColumnVector +mtt_output (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_${odeo} (x, u, t, par); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (u); + args (2) = octave_value (t); + args (3) = octave_value (par); + f = feval ("${sys}_${odeo}", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline ColumnVector +mtt_zeroswitches (ColumnVector &x, + const int Nx, + const ColumnVector &openx) +{ + for (register int i = 0; i < Nx; i++) { + if (0 != openx (i)) { + x(i) = 0.0; + } + } + return x; +} + + +EOF +case "$method" in + "implicit") + cat <> $filename +inline ColumnVector +mtt_implicit (ColumnVector &x, + ColumnVector &dx, + Matrix &AA, + ColumnVector &AAx, + const double &ddt, + const int &nx, + const ColumnVector &open_switches) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return Fmtt_implicit (x, dx, AA, AAx, ddt, nx, open_switches); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (dx); + args (2) = octave_value (AA); + args (3) = octave_value (AAx); + args (4) = octave_value (ddt); + args (5) = octave_value ((double)nx); + args (6) = octave_value (open_switches); + f = feval ("mtt_implicit", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline Matrix +mtt_smxa (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_smxa (x, u, t, par); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (u); + args (2) = octave_value (t); + args (3) = octave_value (par); + f = feval ("${sys}_smxa", args, 1); + return f(0).matrix_value (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +inline ColumnVector +mtt_smxax (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return ${sys}_smxax (x, u, t, par); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (u); + args (2) = octave_value (t); + args (3) = octave_value (par); + f = feval ("${sys}_smxax", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +EOF + ;; + "dassl") +cat <> $filename +inline ColumnVector +mtt_dassl (ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par, + const ColumnVector &dx, + const double &ddt, + const int &nx, + const int &nyz, + const ColumnVector &open_switches) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return Fmtt_dassl (x, u, t, par, dx, ddt, nx, nyz, open_switches); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (u); + args (2) = octave_value (t); + args (3) = octave_value (par); + args (4) = octave_value (dx); + args (5) = octave_value (ddt); + args (6) = octave_value (static_cast (nx)); + args (7) = octave_value (static_cast (nyz)); + args (8) = octave_value (open_switches); + f = feval ("mtt_dassl", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +#if (CODEGENTARGET != OCTAVEDLD) +ColumnVector +Fmtt_residual (const ColumnVector &X, + const ColumnVector &DX, + double t, + int &ires) +{ +#elif (CODEGENTARGET == OCTAVEDLD) +DEFUN_DLD (mtt_residual, args, , "mtt_residual") +{ + static ColumnVector X (MTTNX+MTTNYZ); + static ColumnVector DX (MTTNX+MTTNYZ); + static double t; + static int ires; + + X = args(0).${vector_value} (); + DX = args(1).${vector_value} (); + t = args(2).double_value (); + ires = static_cast(args(3).double_value ()); +#endif // (CODEGENTARGET != OCTAVEDLD) + + static ColumnVector residual (MTTNX+MTTNYZ); + static ColumnVector U (MTTNU+MTTNYZ); + static ColumnVector u (MTTNU); + static ColumnVector y (MTTNY,0.0); + static ColumnVector par (MTTNPAR); + static ColumnVector dx(MTTNX); + static ColumnVector yz(MTTNYZ); + + static ColumnVector x (MTTNX); + static ColumnVector ui (MTTNYZ); + + static octave_value_list new_args; + + x = X.extract (0,MTTNX-1); + if (MTTNYZ > 0) + ui = X.extract (MTTNX,MTTNX+MTTNYZ-1); + +#if (CODEGENTARGET != OCTAVEDLD) + par = ${sys}_numpar(); + u = ${sys}_input(x,y,t,par); +#elif (CODEGENTARGET == OCTAVEDLD) + par = feval ("${sys}_numpar", new_args, 1)(0).${vector_value} (); + new_args(0) = octave_value (x); + new_args(1) = octave_value (u); + new_args(2) = octave_value (t); + new_args(3) = octave_value (par); + u = feval ("${sys}_input", new_args, 1)(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) + + U.insert (u,0); + if (MTTNYZ > 0) + U.insert (ui,MTTNU); + +#if (CODEGENTARGET != OCTAVEDLD) + dx = ${sys}_${ode} (x,U,t,par); + yz = ${sys}_${ae} (x,U,t,par); +#elif (CODEGENTARGET == OCTAVEDLD) + new_args(1) = octave_value (U); + dx = feval ("${sys}_${ode}", new_args, 1)(0).${vector_value} (); + yz = feval ("${sys}_${ae}", new_args, 1)(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) + + for (register int i = 0; i < MTTNX; i++) + residual (i) = dx(i) - DX(i); + + if (MTTNYZ > 0) + { + residual.insert (yz,MTTNX); + + // XXX: + // DASSL needs residual to be dependent on Ui and Uidot + // mtt_dassl always sets the initial Ui to zero, so + // Ui - h*Uidot should equal zero BUT, we don't know h + static double t_old; + double step; + if (t != t_old) + { + step = t - t_old; + t = t_old; + } + else + step = t; + for (register int i = MTTNX; i < MTTNX+MTTNYZ; i++) + residual(i) += X(i) - DX(i)*step; + } + +#if (CODEGENTARGET != OCTAVEDLD) + return residual; +#elif (CODEGENTARGET == OCTAVEDLD) + return octave_value (residual); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +EOF + ;; + "euler" | "rk4" | *) +cat <> $filename +inline ColumnVector +mtt_euler (ColumnVector &x, + const ColumnVector &dx, + const double &ddt, + const int &nx, + const ColumnVector &open_switches) +{ +#if (CODEGENTARGET != OCTAVEDLD) + return Fmtt_euler (x, dx, ddt, nx, open_switches); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args (0) = octave_value (x); + args (1) = octave_value (dx); + args (2) = octave_value (ddt); + args (3) = octave_value ((double)nx); + args (4) = octave_value (open_switches); + f = feval ("mtt_euler", args, 1); + return f(0).${vector_value} (); +#endif // (CODEGENTARGET != OCTAVEDLD) +} + +EOF + ;; +esac +cat <> $filename + +inline void +mtt_write (const double &t, + const ColumnVector &x, + const ColumnVector &y, + const double &first, + const int &nrows, + const bool dump_data = false, + std::ostream &file = std::cout) +{ + static Matrix data; + static int row; + + if (dump_data) + { + if (row > 0) + { + Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1); + file $insertor "# name: mtt_dump" $insertor std::endl + $insertor "# type: matrix" $insertor std::endl + $insertor "# rows: " $insertor written_data.rows () $insertor std::endl + $insertor "# columns: " $insertor written_data.columns () $insertor std::endl + $insertor written_data; + file.flush (); + } + return; + } + + const int nx = x.length (), ny = y.length (); + register int col = 0; + + if (0 == row) + data = Matrix (nrows, 1+ny+1+nx, 0.0); + + if (t >= first) { + data.elem (row, col) = t; + for (register int i = 0; i < ny; i++) + data.elem (row, ++col) = y.elem (i); + data.elem (row, ++col) = t; + for (register int i = 0; i < nx; i++) + data.elem (row, ++col) = x.elem (i); + + row++; + }; + + static std::fstream fcputime ("MTT.cputime", std::ios::out | std::ios::trunc | std::ios::app); + static clock_t cputime0 = clock(); + static clock_t cputime1 = cputime0; + clock_t cputime = clock(); + fcputime $insertor t $insertor '\t' + $insertor static_cast (cputime - cputime0) / CLOCKS_PER_SEC $insertor '\t' + $insertor static_cast (cputime - cputime1) / CLOCKS_PER_SEC $insertor std::endl; + cputime1 = cputime; + + if (nrows == row) + { +#if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == RTXI)) + file $insertor "# name: mtt_dump" $insertor std::endl + $insertor "# type: matrix" $insertor std::endl + $insertor "# rows: " $insertor data.rows () $insertor std::endl + $insertor "# columns: " $insertor data.columns () $insertor std::endl + $insertor data; + file.flush (); +#elif ((CODEGENTARGET == OCTAVEDLD) || (CODEGENTARGET == MATLABMEX)) + set_global_value ("MTT_data", data); +#endif // ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == RTXI)) + row = 0; + fcputime.close(); + } +} + +#if (CODEGENTARGET == RTXI) +#include "${sys}_rtxi.h" +void +${sys}::execute(void) +{ + static ColumnVector simpar (8), par (MTTNPAR), state0 (MTTNX); + + simpar = mtt_simpar (); + par = mtt_numpar (); + state0 = mtt_state (par); + +#else + +void +${sys}_ode2odes (const ColumnVector &state0, + const ColumnVector &par, + const ColumnVector &simpar) +{ +#endif // (CODEGENTARGET == RTXI) + static double first, dt, last, stepfactor; + first = simpar (0); + last = simpar (1); + dt = simpar (2); + stepfactor = simpar (3); + + static ColumnVector dx (MTTNX, 0.0); + static ColumnVector x (MTTNX, 0.0); + static ColumnVector u (MTTNU, 0.0); + static ColumnVector y (MTTNY, 0.0); + + static Matrix AA (MTTNX, MTTNX, 0.0); + static ColumnVector AAx (MTTNX, 0.0); + + static ColumnVector open_switches (MTTNX, 0.0); + + register double t = 0.0; + + const double ddt = dt / stepfactor; + const int ilast = static_cast (round ( last / ddt)) + 1; + const int nrows = static_cast (round ((last - first) / dt)) + 1; + + for (register int i = 0; i < MTTNY; i++) + { + y (i) = 0.0; +#if (CODEGENTARGET == RTXI) + output(i) = y(i); +#endif // (CODEGENTARGET == RTXI) + } + + for (register int i = 0; i < MTTNX; i++) + { + x (i) = state0 (i); + } + + for (register int j = 0, i = 1; i <= ilast; i++) + { +#if (CODEGENTARGET != RTXI) + u = mtt_input (x, y, t, par); +#else + for (register int i = 0; i < MTTNU; i++) { + u(i) = input(i); + } +#endif // (CODEGENTARGET != RTXI) + y = mtt_output (x, u, t, par); + if (0 == j) + { +#if (CODEGENTARGET != RTXI) + mtt_write (t, x, y, first, nrows); +#else + for (register int i = 0; i < MTTNU; i++) { + output(i) = y(i); + } +#endif // (CODEGENTARGET != RTXI) + } +EOF +case "$method" in + "rk4") + cat << EOF >> $filename + { + static ColumnVector + k1 (MTTNX,0.0), + k2 (MTTNX,0.0), + k3 (MTTNX,0.0), + k4 (MTTNX,0.0); + + const double + t1 = t + ddt/2.0, + t2 = t + ddt; + + ColumnVector + x1 (x), + x2 (x), + x3 (x); + + k1 = ddt * mtt_rate (x , u, t , par); x1 += k1 * 0.5; + k2 = ddt * mtt_rate (x1, u, t1, par); x2 += k2 * 0.5; + k3 = ddt * mtt_rate (x2, u, t1, par); x3 += k3; + k4 = ddt * mtt_rate (x3, u, t2, par); + dx = (k1 + 2.0 * (k2 + k3) + k4) / (6.0 * ddt); + } +EOF + ;; + "dassl") + ;; + "implicit") + cat << EOF >> $filename + dx = mtt_rate (x, u, t, par); + AA = mtt_smxa (x, u, ddt, par); + AAx = mtt_smxax (x, u, ddt, par); +EOF + ;; + "euler" | *) + cat << EOF >> $filename + dx = mtt_rate (x, u, t, par); +EOF + ;; +esac + +## Common stuff +cat <> $filename + open_switches = mtt_logic (x, u, t, par); + x = $algorithm; + open_switches = mtt_logic (x, u, t, par); + x = mtt_zeroswitches (x, $Nx, open_switches); + t += ddt; + j++; + j = (j == static_cast (stepfactor)) ? 0 : j; + } + +} + +#if (CODEGENTARGET == STANDALONE) +#include + +void set_signal_handlers (void); + +void dump_data (std::ostream &file) +{ + ColumnVector null (0); + mtt_write (0.0, null, null, 0, 0, true, file); +} + +void handle_signal (int signum) +{ + // handle some signals to ensure data is written. + std::cerr $insertor "# Writing data to MTT.core (signal " $insertor signum $insertor ")" $insertor std::endl; + std::ofstream corefile ("MTT.core"); + dump_data (corefile); + switch (signum) + { + case SIGFPE: + // Intel chips do not raise SIGFPE for DIVZERO :-( + // raise (SIGABRT); + break; + case SIGINT: + break; + case SIGQUIT: + signal (SIGQUIT, SIG_DFL); + raise (SIGQUIT); + break; + default: + std::cerr $insertor "# Warning: make_ode2odes needs updating!" $insertor std::endl; + signal (signum, SIG_DFL); + raise (signum); + break; + } + corefile.close (); + set_signal_handlers (); +} + +void set_signal_handlers (void) +{ + signal (SIGFPE, handle_signal); + signal (SIGINT, handle_signal); + signal (SIGQUIT, handle_signal); +} + +int +main (void) +{ + set_signal_handlers (); + + static ColumnVector simpar (8), numpar (MTTNPAR), state0 (MTTNX); + + simpar = mtt_simpar (); + numpar = mtt_numpar (); + state0 = mtt_state (numpar); + + ${sys}_ode2odes (state0, numpar, simpar); + + return 0; +} +#elif (CODEGENTARGET == OCTAVEDLD) +#include + +DEFUN_DLD (${sys}_ode2odes, args, , +"Octave ode2odes representation of system with $method integration method\nUsage: mtt_data = ${sys}_ode2odes (state0, numpar, simpar)\n") +{ + static octave_value_list retval; + + static ColumnVector state0 (MTTNX); + static ColumnVector numpar (MTTNPAR); + static ColumnVector simpar (8); + + int nargin = args.length (); + switch (nargin) + { + case 3: + simpar = mtt_simpar (args(2).map_value ()); + numpar = args(1).${vector_value} (); + state0 = args(0).${vector_value} (); + break; + case 2: + simpar = mtt_simpar (); + numpar = args(1).${vector_value} (); + state0 = args(0).${vector_value} (); + break; + case 1: + simpar = mtt_simpar (); + numpar = mtt_numpar (); + state0 = args(0).${vector_value} (); + break; + case 0: + simpar = mtt_simpar (); + numpar = mtt_numpar (); + state0 = mtt_state (numpar); + break; + default: + usage("${sys}_ode2odes (x par simpar)", nargin); + error("aborting."); + } + + ${sys}_ode2odes (state0, numpar, simpar); + + retval = octave_value (get_global_value ("MTT_data")); + return (retval); +} +#elif (CODEGENTARGET == MATLABMEX) +#include + +extern "C" { + void + mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) + { + static ColumnVector state0 (MTTNX); + static ColumnVector numpar (MTTNPAR); + static ColumnVector simpar (8); + + initialize_symbol_tables (); + + switch (nrhs) + { + case 3: + simpar = mtt_ColumnVector (prhs[2]); + numpar = mtt_ColumnVector (prhs[1]); + state0 = mtt_ColumnVector (prhs[0]); + break; + case 2: + simpar = mtt_simpar (); + numpar = mtt_ColumnVector (prhs[1]); + state0 = mtt_ColumnVector (prhs[0]); + break; + case 1: + simpar = mtt_simpar (); + numpar = mtt_numpar (); + state0 = mtt_ColumnVector (prhs[0]); + break; + case 0: + simpar = mtt_simpar (); + numpar = mtt_numpar (); + state0 = mtt_state (numpar); + break; + default: + std::cerr $insertor "usage: ${sys}_ode2odes (x par simpar)" $insertor std::endl; + return; + } + + ${sys}_ode2odes (state0, numpar, simpar); + + plhs[0] = mtt_mxArray (get_global_value ("MTT_data").matrix_value ()); + } +} + +#endif // (CODEGENTARGET == STANDALONE) + +EOF +} + +case ${lang} in + m) + make_m + ;; + cc) + make_cc + ;; + *) + echo Language ${lang} is not supported +esac ADDED mtt/bin/trans/make_sim Index: mtt/bin/trans/make_sim ================================================================== --- mtt/bin/trans/make_sim +++ mtt/bin/trans/make_sim @@ -0,0 +1,48 @@ +#!/bin/sh + +## Makes the sensitivity simulation +## Copyright (C) 2001 by Peter J. Gawthrop + +sys=$1 +lang=$2 + +outfile=${sys}_sim.${lang} + +echo Creating $outfile + +make_m() { +mtt_header ${sys} sim m > ${outfile} +cat >> ${outfile} <2 + ## Create time vector + [N,M] = size(y); + t = mtt_data(:,1); + endif; + +endfunction +EOF + +} + +case ${lang} in + m) + make_m + ;; + *) + echo Language ${lang} not supported - sorry +esac ADDED mtt/bin/trans/make_ssim Index: mtt/bin/trans/make_ssim ================================================================== --- mtt/bin/trans/make_ssim +++ mtt/bin/trans/make_ssim @@ -0,0 +1,68 @@ +#!/bin/sh + +## Makes the sensitivity simulation +## Copyright (C) 2001 by Peter J. Gawthrop + +sys=$1 +lang=$2 + +outfile=${sys}_ssim.${lang} + +echo Creating $outfile +make_m() { +mtt_header ${sys} ssim m > ${outfile} +cat >> ${outfile} <4 + [n,m] = size(index); + if (n>m) # Make sure its a row vector + index = index'; + endif + endif + + [nx2,ny2] = ${sys}_def; + y_par = []; + MTT_input = u; + [MTT_input_last,m] = size(u); + + if nargin<5 # No index given + MTT_input_index = 0; + [mtt_data] = ${sys}_ode2odes(x0,par,simpar); + y = mtt_data(:,2:2:1+ny2); + x = mtt_data(:,3+ny2:2:2+ny2+nx2); + ypar = []; + else # Compute sensitivities as well + for i=index + MTT_input_index = 0; + p = par; # Reset parameters + p(i) = 1; # Set sensitivity index to 1 + [mtt_data] = ${sys}_ode2odes(x0,p,simpar); + if (i==index(1)) + y = mtt_data(:,2:2:1+ny2); + endif + y_par = [y_par, mtt_data(:,3:2:2+ny2)]; + x = mtt_data(:,3+ny2:2+ny2+nx2); + endfor + endif + + if nargout>3 + ## Create time vector + [N,M] = size(y); + t = mtt_data(:,1); + endif; + +endfunction +EOF + +} + +case ${lang} in + m) + make_m + ;; + *) + echo Language ${lang} not supported - sorry +esac ADDED mtt/bin/trans/make_stdin Index: mtt/bin/trans/make_stdin ================================================================== --- mtt/bin/trans/make_stdin +++ mtt/bin/trans/make_stdin @@ -0,0 +1,174 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## $Id$ + +# Copyright (C) 1999,2000 by Peter J. Gawthrop + +# Tell user +Sys=$1 +lang=$2 +date=`date` +outfile=$1_input.$2 + +Nu=`mtt_getsize ${Sys} u` # Inputs +echo "Creating $outfile for standard input" + +## Pascal code +make_p() +{ +cat < $outfile +PROCEDURE ${Sys}_input(VAR mttu : InputVector; + mttx : StateVector; + mtty : OutputVector; + mttt : REAL; + par : ParameterVector); + +{Created by MTT on $date for standard input to simulation} + +VAR t : REAL; Start:BOOLEAN; + +BEGIN{${Sys}_input} + {Zap comments} + IF (input^ = chr("#")) THEN + BEGIN + readln; + WHILE (input^ = chr("#")) DO readln; + END; + + read(t); { Read, and discard, first column (time) } + FOR mtti:=1 TO $Nu DO {Read the inputs} + read(mttu[mtti]); + readln; {Next line} + + +END{${Sys}_input}; +EOF +} + +make_m() { +mtt_header ${Sys} input m stdin > $outfile +cat >> $outfile < $outfile < +#include "${Sys}_def.h" + +void strip_comments (istream &str) +{ + char c; + c = str.peek (); + while (c == '#') + { + str.unsetf(ios::skipws); + while (c != '\n') + { + str >> c; + } + str.setf(ios::skipws); + c = str.peek (); + } +} + +ColumnVector ${Sys}_input ( + ColumnVector &mttx, + ColumnVector &mtty, + const double &mttt, + ColumnVector &mttpar +) +{ +#elif (CODEGENTARGET == OCTAVEDLD) +#include +#include +#include "${Sys}_def.h" + +DEFUN_DLD (${Sys}_input, args, , +"Usage: [mttu] = ${Sys}_input()\n\ +Octave input (-stdin) representation of system ${Sys}\n\ +Generated by MTT on `date`") +{ + + octave_value_list retval; +#endif // (CODEGENTARGET == STANDALONE) + + ColumnVector mttu (MTTNU); + + // Set up the mttu vector +#if (CODEGENTARGET == OCTAVEDLD) + int MTT_input_index = static_cast(get_global_value ("MTT_input_index").double_value ()); + int MTT_input_last = static_cast(get_global_value ("MTT_input_last").double_value ()); + Matrix MTT_input = get_global_value ("MTT_input").matrix_value(); + + mttu = MTT_input.row (MTT_input_index); + + if (MTT_input_index < (MTT_input_last - 1)) + { + set_global_value ("MTT_input_index", static_cast(++MTT_input_index)); + } + +#elif (CODEGENTARGET == STANDALONE) + double t, u; + strip_comments (cin); + cin >> t; + for (register int i = 0; i < MTTNU; i++) + { + cin >> u; + mttu(i) = u; + } +#endif // (CODEGENTARGET == OCTAVEDLD) + + +#if (CODEGENTARGET == OCTAVEDLD) + retval (0) = octave_value (mttu); + return (retval); +} +#elif (CODEGENTARGET == STANDALONE) + return mttu; +} +#endif // (CODEGENTARGET == OCTAVEDLD) +EOF +} + +case $lang in + p) + make_p + ;; + m) + make_m + ;; + cc) + make_cc + ;; + *) + echo language $lang not supported - sorry +esac ADDED mtt/bin/trans/makecr Index: mtt/bin/trans/makecr ================================================================== --- mtt/bin/trans/makecr +++ mtt/bin/trans/makecr @@ -0,0 +1,46 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: makecr + +# Copyright (c) P.J.Gawthrop 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 1996/09/12 12:06:38 peter +## Removed reducndant lines. +## +## Revision 1.3 1996/09/12 12:05:01 peter +## Removed default crs. +## +## Revision 1.2 1996/09/10 16:18:37 peter +## Uses default constitutive relationship mtt/cr/r +## +## Revision 1.1 1996/08/24 14:53:06 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_cr.r + +echo % Default CR file > $1_cr.r +echo % File $1_cr.r >> $1_cr.r +echo % Generated by MTT on `date`. >> $1_cr.r +echo >> $1_cr.r +cat $MTTPATH/trans/m/rcs_header.txt >> $1_cr.r +echo 'END;' >> $1_cr.r + + + + + + + + ADDED mtt/bin/trans/makedesc Index: mtt/bin/trans/makedesc ================================================================== --- mtt/bin/trans/makedesc +++ mtt/bin/trans/makedesc @@ -0,0 +1,55 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: maketex +# Makes template for (TeX) system description. + +# P.J.Gawthrop August 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 1999/03/03 01:07:27 peterg +## Label the figure correctely, +## +## Revision 1.3 1998/07/22 08:58:51 peterg +## Corrected spelling. +## +## Revision 1.2 1997/05/21 10:00:51 peterg +## Tidied up. +## +## Revision 1.1 1997/05/21 09:19:27 peterg +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_desc.tex + +echo '% -*-latex-*- Put EMACS into LaTeX-mode' > $1_desc.tex +echo "% Verbal description for system $1 ($1_desc.tex)" >> $1_desc.tex +echo "% Generated by MTT on" `date`. >> $1_desc.tex +cat $MTTPATH/trans/m/rcs_header.txt >> $1_desc.tex + +cat<> $1_desc.tex +The acausal bond graph of system \textbf{$1} is +displayed in Figure \Ref{fig:$1_abg.ps} +EOF + +if [ -e "$1_pic.fig" ]; then +cat<> $1_desc.tex +and the schematic diagram in Figure \Ref{fig:$1_pic.ps} +EOF +fi + +cat<> $1_desc.tex +. +The label file is listed in Section \Ref{sec:$1_lbl} and the +subsystems are listed in Section \Ref{sec:$1_sub}. +EOF ADDED mtt/bin/trans/makedoc Index: mtt/bin/trans/makedoc ================================================================== --- mtt/bin/trans/makedoc +++ mtt/bin/trans/makedoc @@ -0,0 +1,127 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: makedoc +# Encapsulates a tex file in a document. + +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/27 15:53:42 peterg +## Initial revision +## +## Revision 1.1 1997/05/17 13:55:42 peterg +## Initial revision +## +# Revision 1.2 1997/04/23 10:06:51 peterg +# Put output in the correct file! +# +# Revision 1.1 1997/04/23 10:03:41 peterg +# Initial revision +# +############################################################### + +date=`date` +switches=$1 +system=$2 +representation=$3 +lang=$4 +args=$5 +documenttype=$6 +ps=$7 + +if [ "$documenttype" = "book" ]; then + document=book +else + document=article +fi + +if [ "$documenttype" = "book" ]||[ "$documenttype" = "article" ]; then + title="\title{Report on $system}" +else + title="\title{System $system, representation $representation}" +fi + +filename=$2_$3.doc +texname=$2_$3.tex +indexname=$2_$3.ind + +# Inform user +echo "Creating $filename" +# Make arguments acceptable to LateX +Args=`echo $args | sed 's/_/\\\_/g'` + +cat< $filename +\nonstopmode +\documentclass[12pt,a4paper]{$document} + $title + \author{Generated by MTT using :\\\\ + (mtt $switches $system $representation $lang $Args)} + \date{$date} +EOF + +if [ "$documenttype" = "book" ]; then + cat <> $filename + \makeindex +EOF +fi + + +##cp -v $MTTPATH/trans/*.sty . +##cat >> $filename <> $filename + +cat <> $filename +\begin{document} + \maketitle +EOF + +if [ "$documenttype" = "book" ]||[ "$documenttype" = "article" ]; then + cat $MTTPATH/trans/contents.tex >> $filename +fi + +cat <> $filename +%Fancy headings + \pagestyle{fancy} + \renewcommand{\sectionmark}[1]{\markboth{#1}{}} + \lhead{Report \textbf{$system}} + \rhead{Representation \textbf{$representation}} + \rfoot{Page \thepage.}\cfoot{} + \lfoot{\emph{$date}} + + \input{$texname} +EOF + +if [ "$documenttype" = "book" ]; then + cat <> $filename + \input{$indexname} +EOF +fi + +cat<> $filename +\end{document} +EOF + + + + + + + + + + + + ADDED mtt/bin/trans/makerep_txt Index: mtt/bin/trans/makerep_txt ================================================================== --- mtt/bin/trans/makerep_txt +++ mtt/bin/trans/makerep_txt @@ -0,0 +1,74 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: makerep_tex +# Makes template for (TeX) system description. + +# P.J.Gawthrop July 1998 +# Copyright (c) P.J.Gawthrop, 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2000/11/15 10:56:45 peterg +## Added state tex +## +## Revision 1.5 2000/11/04 12:32:43 peterg +## Added more reps + more default reps +## +## Revision 1.4 1999/03/02 22:02:16 peterg +## Octave-mode style +## +## Revision 1.3 1998/11/18 10:47:39 peterg +## Added transfer function rep +## +## Revision 1.2 1998/11/10 09:16:41 peterg +## Added structure rep +## +## Revision 1.1 1998/07/22 09:14:42 peterg +## Initial revision +## +############################################################### + + +#Inform user +echo Creating $1_rep.txt + +cat < $1_rep.txt +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system $1 ($1_rep.txt) +## Generated by MTT on" `date`. + +EOF + +cat $MTTPATH/trans/rcs_header.sh >> $1_rep.txt + +cat <> $1_rep.txt +mtt $1 abg tex # The system description +mtt $1 cbg ps # The causal bond graph +mtt $1 struc tex # The system structure +mtt $1 sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt $1 dae tex # The system dae +## mtt $1 ode tex # The system ode +## mtt $1 sspar tex # Steady-state parameters +## mtt $1 ss tex # Steady state +## mtt $1 dm tex # Descriptor matrices (of linearised system) +## mtt $1 sm tex # State matrices (of linearised system) +## mtt $1 tf tex # Transfer function (of linearised system) +## mtt $1 lmfr ps # log modulus of frequency response (of linearised system) +## mtt $1 simpar txt # Simulation parameters +## mtt $1 numpar txt # Numerical simulation parameters +## mtt $1 state txt # Simulation initial state +## mtt $1 input txt # Simulation input +## mtt $1 logic txt # Logic control +## mtt $1 odeso ps # Simulation output + +## mtt $1 rep txt # This file +EOF + ADDED mtt/bin/trans/makesspar Index: mtt/bin/trans/makesspar ================================================================== --- mtt/bin/trans/makesspar +++ mtt/bin/trans/makesspar @@ -0,0 +1,56 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: makesspar +# Makes default sspar file: all states zero. + +# P.J.Gawthrop February 1998 +# Copyright (c) P.J.Gawthrop, 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1998/02/09 14:13:39 peterg +## Put octave stuff to /dev/null +## +## Revision 1.2 1998/02/09 08:39:27 peterg +## Set inputs to zero as well. +## +## Revision 1.1 1998/02/06 15:53:49 peterg +## Initial revision +## +############################################################### + + +#Inform user +echo Creating $1_sspar.r + +echo "% Steady-state parameters for system $1 ($1_sspar.r)"> $1_sspar.r +echo "% Generated by MTT on" `date`. >> $1_sspar.r +cat $MTTPATH/trans/m/rcs_header.txt >> $1_sspar.r +echo "% Set all states and inputs to zero" >> $1_sspar.r + +$MATRIX <> /dev/null + +fnum=fopen("$1_sspar.r","at"); + +[nx,ny,nu,nz,nyz] = $1_def; + +for i = 1:nx + fprintf(fnum,"MTTX%i := 0;\n", i); +end; +fprintf(fnum,"\n"); +for i = 1:nu + fprintf(fnum,"MTTU%i := 0;\n", i); +end; + + +EOF + + +echo "END;;" >> $1_sspar.r ADDED mtt/bin/trans/makesubs Index: mtt/bin/trans/makesubs ================================================================== --- mtt/bin/trans/makesubs +++ mtt/bin/trans/makesubs @@ -0,0 +1,81 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: makesubs +# Makes the default substitution file + +# Copyright (C) 2000 by Peter J. Gawthrop + + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2001/05/08 15:18:10 gawthrop +## Added trig and hyperbolic functions to argument exclusion list +## +## Revision 1.1 2000/12/28 09:09:52 peterg +## Initial revision +## +## +############################################################### + +#Inform user +echo Creating $1_subs.r + +cat > $1_subs.r <> $1_subs.r + +cat >> $1_subs.r <> $1_subs.r <> $1_subs.r + +# Then states +Nx=`mtt_getsize $1 x` # States + +gawk 'END{ + for (k=1;k> $1_subs.r + +cat >> $1_subs.r <junk +mv junk $1 + + + + ADDED mtt/bin/trans/modpar_txt2r Index: mtt/bin/trans/modpar_txt2r ================================================================== --- mtt/bin/trans/modpar_txt2r +++ mtt/bin/trans/modpar_txt2r @@ -0,0 +1,47 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: modpar_txt2r +# Creates the reduce code for modulated parameters + +# Copyright (C) 2001 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $$Id$ +## $Log$ +## Revision 1.2 2002/04/16 11:36:03 gawthrop +## These were flagged with M on cvs update +## +## Revision 1.1 2001/04/02 08:19:18 gawthrop +## Translates modulated parameters into reduce +## +############################################################### + +# Inform user +echo Creating $1_modpar.r + +#Create the modpar file complete with headers. +echo "% Modpar file ($1_modpar.r)" > $1_modpar.r +echo "% Generated by MTT at `date`" >> $1_modpar.r + +parameters=`strip_comments < $1_modpar.txt | cut -f1` +inputs=`strip_comments < $1_modpar.txt | cut -f2` + + +for parameter in $parameters; do + grep $1_${parameter}_ $1_struc.txt |\ + gawk 'BEGIN{ + name["input"] = "u"; + name["output"] = "y"; + name["state"] = "x"; + name["nonstate"] = "z"; + } + { + printf("%s := mtt%s(%i,1);\n", parameter, name[$1], $2) + }' parameter=$parameter >> $1_modpar.r +done ADDED mtt/bin/trans/mtt.sty Index: mtt/bin/trans/mtt.sty ================================================================== --- mtt/bin/trans/mtt.sty +++ mtt/bin/trans/mtt.sty @@ -0,0 +1,91 @@ +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% mtt.sty -- LaTeX style file for MTT +% P.J.Gawthrop May 1997 +% Copyright (c) P.J.Gawthrop, 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.11 2009/06/26 01:09:50 geraint +% %% fancyheadings is deprecated, replaced by fancyhdr +% %% +% %% Revision 1.10 2005/03/15 13:36:17 gawthrop +% %% Pretty abg figure in reports. +% %% +% %% Revision 1.9 2003/05/08 18:43:02 gawthrop +% %% Generate pdf from ps (using hyperref package for links etc) +% %% +% %% Revision 1.8 2000/12/01 14:15:16 peterg +% %% Removed hyperref stuff to mtt_pdf.sty +% %% +% %% Revision 1.7 2000/11/28 18:28:29 peterg +% %% Removed fancy box - messes up TOC +% %% +% %% Revision 1.6 2000/11/28 18:09:06 peterg +% %% Tidied up: +% %% added hyperef +% %% put fig stuff into mtt_ps.sty and mtt_pdf.sty +% %% +% %% Revision 1.5 1998/11/23 10:45:49 peterg +% %% Reinstated supertabular +% %% +% %% Revision 1.4 1998/07/01 17:34:43 peterg +% %% No change +% %% +% %% Revision 1.3 1997/12/06 16:22:10 peterg +% %% Added another argument - the label. +% %% +% %% Revision 1.2 1997/12/06 15:51:06 peterg +% %% Cahged order of fig args to put file first. +% %% +% %% Revision 1.1 1997/05/19 16:48:10 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Font +\usepackage{times} +%%\usepackage{mathptm} + +%Verbatim file input +\usepackage{verbatim} +\usepackage{moreverb} + +%Long tables +\usepackage{supertabular} + +%AMS maths + \usepackage{amsmath} + +%Fancy headings + %%\usepackage{fancyheadings} + \usepackage{fancyhdr} + +%Fancy boxes +%\usepackage{fancybox} + + +% Read in a verbatim file +\newcommand{\txt}[2]{ + \subsubsection*{#1} + \verbatimtabinput{#2} +} + +% Read in a LaTeX file +\newcommand{\Input}[1]{ + \input{#1} +} + + +% Page refs as well. +\newcommand{\Ref}[1]{\ref{#1} (on page \pageref{#1})} + +%% Latex in figures etc +\newcommand{\B}[1]{\text{\sffamily\textbf{#1}}} +\newcommand{\BB}[2]{$\B{#1}$:$\mathbf{#2}$} ADDED mtt/bin/trans/mtt2reps_txt Index: mtt/bin/trans/mtt2reps_txt ================================================================== --- mtt/bin/trans/mtt2reps_txt +++ mtt/bin/trans/mtt2reps_txt @@ -0,0 +1,85 @@ +#! /bin/sh + +# mtt2reps_txt: Gives a tabular listing of representations and languages +# P J Gawthrop July 1998, October 1998 +# Copyright (c) P.J.Gawthrop, 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.12 2001/07/24 04:18:32 gawthrop +## Fixed problem with shell expanding * (used as important rep marker) +## +## Revision 1.11 2001/04/28 03:38:36 geraint +## Refined selection of matching patterns - checks for exact match. +## +## Revision 1.10 2000/09/14 07:54:13 peterg +## Removed -e option in echo +## +## Revision 1.9 2000/04/05 08:34:30 peterg +## removed output tab +## +## Revision 1.8 2000/04/05 08:04:01 peterg +## Minor reorganisation +## +## Revision 1.7 2000/04/04 16:15:14 peterg +## Fixed awk prob - must be the same sep. for each field (?) +## So tr tab to space +## +## Revision 1.6 2000/04/04 13:09:51 peterg +## *** empty log message *** +## +## Revision 1.5 2000/01/19 17:26:12 peterg +## Now includes the representation title. +## +## Revision 1.4 1999/03/09 00:03:06 peterg +## Revisions for xmtt +## +## Revision 1.3 1999/03/08 21:24:43 peterg +## Handles * representations: +## +## rep* is special +## rep shows all possible languages +## +## Revision 1.2 1999/03/08 06:34:07 peterg +## Removed mtt help - replaced by grep #SUMMARY - quicker +## +## Revision 1.1 1998/10/20 08:15:08 peterg +## Initial revision +## +############################################################### + +sep='|'; # Separates the languages from the rest. + +## List of all representations (deleting the *) +representations=`grep '#SUMMARY' $MTTPATH/mtt | gawk '{sub("\*","+"); print $2'} | sort -u ` + + +for rep in $representations ; do + Rep=`echo $rep | tr '+' '*'` + ## Title should be same for all languages -- but extract the first non-empty version + title=`grep '#SUMMARY' $MTTPATH/mtt | tr '\t' ' ' | grep "[ *]$Rep[ *]" | \ + gawk '{if (NF>2) {for (i=3;imtt_error.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt ADDED mtt/bin/trans/mtt_fix_integers Index: mtt/bin/trans/mtt_fix_integers ================================================================== --- mtt/bin/trans/mtt_fix_integers +++ mtt/bin/trans/mtt_fix_integers @@ -0,0 +1,12 @@ +#! /bin/sh + +mttmatrix='\(mtt[A-Za-z][A-Za-z]*\)' +integer='\([0-9][0-9]*\)' + +mtt_join_lines | gawk -v RS=${1:-"$"} -v ORS=${2:-"$\n"} ' { +str = $0; +str1 = gensub ( /([^A-Za-z_0-9\.\+])([0-9]+)([^\.0-9])/ , "\\1\\2.0\\3" , "g", str ); +str2 = gensub ( /([^e]\+)([0-9]+)([^\.0-9])/ , "\\1\\2.0\\3" , "g", str1 ); +str3 = gensub ( /([^A-Za-z_0-9\.\+])([0-9]+)e([0-9]+).0([^\.0-9])/ , "\\1\\2\\3\\4" , "g" , str2) +printf "%s$\n", str3 ; +}' | sed -e "s/$mttmatrix($integer\.0,/\1(\2,/g" ADDED mtt/bin/trans/mtt_get_subsystems Index: mtt/bin/trans/mtt_get_subsystems ================================================================== --- mtt/bin/trans/mtt_get_subsystems +++ mtt/bin/trans/mtt_get_subsystems @@ -0,0 +1,37 @@ +#!/bin/sh +# Gets the subsystems + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -strip ) + strip=yes; + ;; + *) + echo "$1 is an invalid argument - ignoring"; + exit ;; + esac + shift +done + +subsystems=`sh $1_sub.sh "echo grep " " $1_abg.m" |\ + sh | gawk -F '.' '{print $3}'` + +if [ -n "$strip" ]; then + echo $subsystems + else + for subsystem in $subsystems; do + # echo -n $1_$subsystem' ' + echo $1_$subsystem #| gawk '{printf("%s ",$1)}' + done + echo +fi + + + + + + + + + + ADDED mtt/bin/trans/mtt_getsize Index: mtt/bin/trans/mtt_getsize ================================================================== --- mtt/bin/trans/mtt_getsize +++ mtt/bin/trans/mtt_getsize @@ -0,0 +1,50 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_getsize + +# Gets array sizes for the def.r file +# P.J.Gawthrop Feb 2000 +# Copyright (C) 2000 by Peter J. Gawthrop + + #$Id$ + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -internal ) + internal=yes; + ;; + -external ) + external=yes; + ;; + *) + echo "$1 is an invalid argument - ignoring"; + exit ;; + esac + shift +done + +if [ -n "$internal" ]; then + name=MTT$2"[0-9]"; # echo $name + grep -i "$name" $1_ese.r | wc -l + exit +fi + +if [ -n "$external" ]; then + name="^MTT"$2"("; #echo $name + grep -i "$name" $1_ese.r | wc -l + exit +fi + +## The original version for external sizes. +if [ "$2" = "xx" ]; then + n=`mtt_getsize $1 x` + N=`echo "$n * $n" | bc` +else + N=`grep "MTTN$2 " <$1_def.r | gawk '{print $3}' | sed 's/;//'` +fi + +echo $N ADDED mtt/bin/trans/mtt_header Index: mtt/bin/trans/mtt_header ================================================================== --- mtt/bin/trans/mtt_header +++ mtt/bin/trans/mtt_header @@ -0,0 +1,1148 @@ +#!/bin/sh + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_header +# Headings for functions +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.67 2005/11/16 00:43:15 geraint +## rtxi +## +## Revision 1.66 2005/02/17 18:54:23 geraint +## Fixed a bash-sim: replaced let with $(( )) +## +## Revision 1.65 2004/08/29 13:14:29 geraint +## Added rule to make header for sae (sorted algebraic equations). +## +## Revision 1.64 2004/08/29 01:48:46 geraint +## Added rules to create headers for sorted systems: sesx and sesy. +## +## Revision 1.63 2004/08/28 22:08:41 geraint +## Fixed zeromatrices statements: spaces instead of commas +## +## Revision 1.62 2004/07/19 22:22:25 geraint +## Fixed initialisation of ColumnVectors for -oct. +## +## Revision 1.61 2004/06/21 16:30:41 gawthrop +## Don't zero for cc code +## +## Revision 1.60 2004/06/21 16:05:58 gawthrop +## Zapped comment that causes +## +## Revision 1.59 2004/06/20 13:53:06 gawthrop +## Initialise for numpar as well +## +## Revision 1.58 2004/06/20 13:34:11 gawthrop +## Create vectors using zeros(N,1) - avoids new octave +## default to row vector - more reps now included +## +## Revision 1.57 2004/06/20 10:18:00 gawthrop +## Explicitly size vectors - avoid default row vector bug +## +## Revision 1.56 2003/04/17 20:07:33 geraint +## Added rule to create _sese.m +## +## Revision 1.55 2002/10/30 01:15:20 gawthrop +## Now gives correct-size matrices for dm rep. +## +## Revision 1.54 2002/07/11 13:00:23 geraint +## Declared more function arguments to be "const" - improves compiler optimisation. +## +## Revision 1.53 2002/06/10 23:22:16 geraint +## Fixed problem with Matlab fsolve failing because of "user function returned Inf or Nan" (fsolve.m, line 245). +## +## Revision 1.52 2002/05/27 14:52:15 geraint +## Parameters in sfun reps are now declared using sympar.h at the top of the +## sfun*.c file instead of in individual functions. This causes the optimisation +## variables (mtt_tmp*) to be declared correctly without causing conflicts in the +## scope of parameter declarations. +## +## Revision 1.51 2002/05/19 13:01:21 geraint +## Numerical solution of algebraic equations implemented for S-function target. +## +## Equation solving requires the Matlab Optimization Toolbox to be installed. +## +## Code has been changed from C++ to C to allow mex files to be built with LCC, +## the compiler bundled with Matlab. +## +## Parameters are now obtained from numpar.c instead of a dialogue box. +## +## `mtt sfun zip` creates all necessary files for building the model mex files. +## +## Revision 1.50 2002/05/15 14:22:25 geraint +## Code for Simulink S-function target written direct to sfun.cc instead of +## calling .mexglx files. This eliminates the sfun dependency on Octave +## ColumnVectors. sys_sfun.cc should build directly on a MS Windows machine +## (can't test this yet). +## +## added sfun.zip target to create source code to export. +## +## Revision 1.49 2002/05/11 01:14:17 geraint +## Fix for [ 553218 ] simpar.oct and simpar.m different. +## Translation added between ColumnVector in base .cc and Octave_map in .oct. +## +## Revision 1.48 2002/05/08 14:51:03 geraint +## Moved matlab/octave data type conversion functions to a separate file. +## +## Revision 1.47 2002/05/07 23:50:34 geraint +## Preliminary support for Matlab dynamically linked shared objects: +## invoke with: mtt -cc sys rep mexglx +## ode2odes support is not yet included. +## +## Revision 1.46 2002/05/07 13:48:43 geraint +## Improved clarity of code generated for -cc and -oct (except ode2odes). +## Octave DEFUN_DLDs now call (rather than replace) their .cc equivalents. +## +## Revision 1.45 2002/05/02 09:30:22 gawthrop +## _ssim.m now returns t as 4th arg +## +## Revision 1.44 2002/05/01 17:30:56 geraint +## Improved pre-processor directives to better accommodate future alternatives (matlab) +## if necessary. +## +## Revision 1.43 2002/04/30 23:27:00 geraint +## Replaced octave_map with columnvector in simpar.cc. Not quite as descriptive but +## standardises the interfaces somewhat and reduces the dependency on liboctinterp +## (and thus libreadline, libkpathsea, libncurses, etc). +## +## Revision 1.42 2002/04/28 18:41:27 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.41 2002/04/23 17:46:05 gawthrop +## _sim.m now returns time as third argument +## +## Revision 1.40 2002/04/17 16:23:59 geraint +## Partial fix for [ 545113 ] zeros missing in c++. +## Fixes -oct by removing duplicate initialisation (-c is still outstanding). +## +## Revision 1.39 2002/04/15 10:54:31 geraint +## Statically declare outputs and initialise to zero. +## This is necessary to prevent spurious values from being output when no assignments are made (i.e. when "y(i) := 0 for all u" (Reduce:see NERO)). +## +## Revision 1.38 2001/07/23 23:43:15 gawthrop +## header only version does not need to compute sizes from _def.r +## +## Revision 1.37 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## +## Revision 1.36 2001/07/12 04:00:51 gawthrop +## Now zeros y correctly - ie Ny NOT Nx elements +## +## Revision 1.35 2001/06/13 10:39:51 gawthrop +## Zeros output matices in csex and cseo just in case some elements are +## actually zero and not set in code. Works for m and oct. +## +## Revision 1.34 2001/05/26 18:36:43 gawthrop +## Further modifications. Now works on rcPPP +## -- next jobs: +## add identification to ppp_nlin_sim +## create real-time ppp_nlin_run +## +## Revision 1.33 2001/05/26 15:46:38 gawthrop +## Updated to account for new nonlinear ppp +## +## Revision 1.32 2001/05/24 07:42:12 gawthrop +## Included and updated the missing tf_r2m +## +## Revision 1.31.2.2 2001/07/02 00:34:56 geraint +## gcc-3.0 compatibility. +## +## Revision 1.31.2.1 2001/05/04 04:07:24 geraint +## Numerical solution of algebraic equations. +## sys_ae.cc written for unsolved inputs. +## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). +## +## Revision 1.31 2001/04/03 14:49:42 gawthrop +## Revised to incorporate new ssim (sensitivity simulation) +## representation (m only just now). +## +## Revision 1.30 2001/03/30 15:13:58 gawthrop +## Rationalised simulation modes to each return mtt_data +## +## Revision 1.29 2001/03/27 13:10:23 geraint +## Improved determination of Octave version. +## +## Revision 1.28 2001/02/17 03:48:17 geraint +## Use assignment LHS to gather tmp variable names. +## Prevents collection of long expressions, eg: tmp34*(tmp75 +## +## Revision 1.27 2001/02/14 06:06:34 geraint +## Removed octave_value_list wrappers from standalone.exe - speed improvements +## +## Revision 1.26 2001/02/05 08:50:58 geraint +## Octave 2.1.x compatability. +## +## Revision 1.28 2001/01/17 21:16:15 geraint +## uncomment parameter assignments in .m reps +## +## Revision 1.27 2001/01/14 23:51:26 geraint +## declare parameters as variables instead of constants +## +## Revision 1.26 2001/01/07 21:22:47 geraint +## Compatibility with Octave 2.1.x +## vector_value ---> column_vector_value +## +## Revision 1.25 2000/12/05 12:05:26 peterg +## Changed to () form +## +## Revision 1.24 2000/12/05 10:04:52 peterg +## Fixed dummy variable bug +## +## Revision 1.23 2000/12/05 09:47:50 peterg +## Include crs as c files +## +## Revision 1.22 2000/12/04 12:19:12 peterg +## Changed $() to `` and $() to expr for sh compatibility -- geraint +## +## Revision 1.21 2000/12/04 08:52:40 peterg +## Zapped () in functions for sh compatibility +## +## Revision 1.20 2000/12/04 08:19:27 peterg +## Added switch declarations - in logic.cc +## +## Revision 1.19 2000/12/03 16:11:43 peterg +## Corrected bug in logic declatations +## +## Revision 1.18 2000/12/03 16:06:22 peterg +## Fixed bug in generating dummies +## Added logic declarations +## +## Revision 1.17 2000/12/01 20:55:01 peterg +## Added Geraint's fix for zeroing matrices +## +## Revision 1.16 2000/12/01 17:56:30 peterg +## Removed spurious echo '## Set matrices to zero' - thanks Geraint +## +## Revision 1.15 2000/11/29 21:06:16 peterg +## Removed Npar creation - not needed?? +## +## Revision 1.14 2000/11/27 11:51:43 peterg +## Added zero matrices in matlab code +## +## Revision 1.13 2000/11/09 17:19:52 peterg +## Geraint's pow() mods +## +## Revision 1.12 2000/11/09 16:09:46 peterg +## Declare dummy variables (mtt_s1 etc) +## +## Revision 1.11 2000/11/09 15:29:35 peterg +## lower-case declarations +## +## Revision 1.10 2000/11/07 17:20:51 peterg +## useful-functions.hh now included locally +## +## Revision 1.9 2000/11/07 16:56:24 peterg +## Version from Geraint +## +## Revision 1.2 2000/11/03 00:55:42 geraint +## typo: missed out 'd' in mttedx +## todo: need to accommodate mttsimpar +## +## Revision 1.1 2000/11/02 04:28:39 geraint +## Initial revision +## +## Revision 1.8 2000/10/17 16:35:03 peterg +## No parameter,state or input conversion in txt files +## +## Revision 1.7 2000/10/17 09:53:20 peterg +## Fixed logic rep +## +## Revision 1.6 2000/10/17 08:37:23 peterg +## Included logic rep +## +## Revision 1.5 2000/10/14 09:12:14 peterg +## No dies arguments and output itself +## +## Revision 1.4 2000/10/14 06:49:31 peterg +## Make parameter listing representation dependent +## +## Revision 1.3 2000/10/11 08:59:15 peterg +## Added csex rep +## +## Revision 1.2 2000/10/11 08:01:42 peterg +## Added noglobal fudge + ## +## Revision 1.1 2000/10/10 21:02:27 peterg +## Initial revision +## +############################################################### + +# Arguments +system=$1 +rep=$2 +language=$3 +fun_name=${1}_${2} + +other=$4 # Anything else eg stdin + +insertor=\<\< # help emacs sh-mode with C++ lines + + +if [ -z "$system" ]; then + echo 'Usage: mtt_header sys rep lang [stdin]' + exit +fi + + +# get octave version +octave_development=`octave --version | gawk '{print $4}' | gawk -F\. '{print $2}'` +case `$MATRIX --version | gawk -F\. '{print $2}'` in + 0) # stable + vector_value=vector_value + ;; + 1) # development + vector_value=column_vector_value + ;; + *) + vector_value=column_vector_value + ;; +esac + + +# Representation-specific stuff + +eqnargs='mttx,mttu,mttt,mttpar' +inputeqnargs='mttx,mtty,mttt,mttpar' +case $rep in + ae) + states=yes; + inputs=yes; + parameters=yes; + output=mttyz; + args=$eqnargs; + ;; + cse) + states=yes; + inputs=yes; + parameters=yes; + output='mttdx,mtte' + args=$eqnargs + zeromatrices='dx e' + ;; + csex) + states=yes; + inputs=yes; + parameters=yes; + output=mttedx + args=$eqnargs + zeromatrices='edx'; + ;; + cseo) + states=yes; + inputs=yes; + parameters=yes; + output=mtty + args=$eqnargs + zeromatrices='y'; + ;; + dm) + states=no; + inputs=no; + parameters=yes; + output='mtta,mttb,mttc,mttd,mtte' + args=mttpar + zeromatrices='a b c d e'; + ;; + input) + inputs=no; + output=mttu + args=$inputeqnargs + if [ "$other" = "stdin" ]; then + states=no; + parameters=no; + declareinputs=no; + else + states=yes; + parameters=yes; + declareinputs=yes + declarestates=yes + zeromatrices='u' + fi + ;; + logic) + states=no; + inputs=no; + parameters=yes; + output=mttopen + args=$eqnargs + declareinputs=yes + declarestates=yes + declareswitches=yes + zeromatrices='open'; + ;; + numpar) + states=no; + inputs=no; + parameters=no; + output='mttpar' + zeromatrices='par' + ;; + ode) + states=yes; + inputs=yes; + parameters=yes; + output='mttdx,mtty' + args=$eqnargs + zeromatrices='dx y' + ;; + odeo) + states=yes; + inputs=yes; + parameters=yes; + output='mtty' + args=$eqnargs + zeromatrices='y' + ;; + ode2odes) + states=no; + inputs=no; + parameters=no; + output='mtt_data' + args='x0,par,simpar' + ;; + simpar) + states=no; + inputs=no; + parameters=no; + output='mttsimpar' + oct_rep_include="#include " + oct_return_type="mtt_simpar" + ;; + sae) + states=yes; + inputs=yes; + parameters=yes; + output=mttyz; + args=$eqnargs; + ;; + sese) + states=yes; + inputs=yes; + parameters=yes; + output="mttdx,mtty"; + args=$eqnargs; + zeromatrices="dx y"; + ;; + sesx) + states=yes; + inputs=yes; + parameters=yes; + output='mttdx' + args=$eqnargs + zeromatrices='dx' + ;; + sesy) + states=yes; + inputs=yes; + parameters=yes; + output='mtty' + args=$eqnargs + zeromatrices='y' + ;; + sm) + states=no; + inputs=no; + parameters=yes; + output='mtta,mttb,mttc,mttd' + args=mttpar; + zeromatrices='a b c d'; + ;; + smxa) + states=no; + inputs=no; + parameters=yes; + output='mtta' + args=$eqnargs + zeromatrices='a'; + ;; + smxax) + states=no; + inputs=no; + parameters=yes; + output='mttax' + args=$eqnargs + zeromatrices='ax'; + ;; + state) + states=no; + inputs=no; + parameters=yes; + output=mttx + args=mttpar + declarestates=yes + zeromatrices='x' + ;; + sim) + states=no; + inputs=no; + parameters=no; + output='y,x,t' + args='x0,par,simpar,u' + ;; + ssim) + states=no; + inputs=no; + parameters=no; + output='y,y_par,x,t' + args='x0,par,simpar,u,index' + ;; + tf) + states=no; + inputs=no; + parameters=yes; + output='mttnum,mttden' + args=mttpar; + ;; + type) + states=no; + inputs=no; + parameters=no; + header_only=yes; + ;; + + *) + echo Representation $rep not supported - sorry; exit 1 +esac + +## Sort out parentheses +if [ -n "$args" ]; then + Args='('$args')' +fi +if [ -n "$output" ]; then + Output="[$output] = " +fi + + +# Lanuage specific stuff +case $language in + m) + Lc='##'; + Rc=''; + Lb='('; + Rb=')'; + function="function" + declaration="$Output$1_$rep$Args;" + if [ "$other" != "stdin" ]; then + noglobals=true; # Fudge to make mtt_m2p work + fi + start='## BEGIN Code' + finish='## END Code' + var_declaration= + declarestates=no + declareinputs=no + declareswitches=no + ;; + sh) + modeline='## -*-shell-script-*- Put Emacs into shell-script-mode ##'; + Lc='##'; + Rc=''; + Lb='('; + Rb=')'; + function="" + declaration="" + start='' + parameters=no + states=no + inputs=no + declarestates=no + declareinputs=no + declareswitches=no + ;; + txt) + modeline='## -*-octave-*- Put Emacs into octave-mode ##'; + Lc='##'; + Rc=''; + Lb='('; + Rb=')'; + function="" + declaration="" + start='' + parameters=no + states=no + inputs=no + declarestates=no + declareinputs=no + declareswitches=no + ;; + oct) + modeline="// -*-c++-*- Put Emacs into c++-mode"; + Lc='//'; + Lb='('; + Rb=')'; + oct_header=yes; + constant_declaration="const double " + var_declaration="double " + minusone="-1" + map="_map" + declaredummies=yes + ;; + c) + modeline="/* -*-c-*- Put Emacs into c-mode */"; + Lc='/*' + Rc='*/' + Lb='[' + Rb=']' + constant_declaration="const double " + var_declaration="double " + minusone="-1" + ;; + *) + echo Language $language not supported - sorry; exit 1 +esac + +if [ "$rep" = "simpar" ]; then + output=${output}${map} # Output is simpar_map in this case +fi + +get_sizes() + { + Nx=`mtt_getsize $system x` # States + Nz=`mtt_getsize $system z` # Non-states + Nxx=`mtt_getsize $system xx` # States x States + Nu=`mtt_getsize $system u` # Inputs + Ny=`mtt_getsize $system y` # Outputs + Nyz=`mtt_getsize $system yz` # Zero outputs + + case ${rep} in + dm) + Nx=$(( $Nx + 2 * $Nz + $Nyz )) # Matrices not usual size + ;; + *) + + esac + Npar=`wc -l $system\_sympar.txt | gawk '{print $1}'` + } + +zero_matrices() +{ +## Set matrices to zero +echo +for name in $zeromatrices; do + case $name in + a) + N=$Nx; M=$Nx + ;; + b) + N=$Nx; M=$Nu + ;; + c) + N=$Ny; M=$Nx + ;; + d) + N=$Ny; M=$Nu + ;; + e) + N=$Nx; M=$Nx + ;; + x) + N=$Nx; M=0 + ;; + dx) + N=$Nx; M=0 + ;; + edx) + N=$Nx; M=0 + ;; + y) + N=$Ny; M=0 + ;; + u) + N=$Nu; M=0 + ;; + open) + N=$Nx; M=0 + ;; + ax) + N=$Nx; M=0 + ;; + par) + N=$Npar; M=0 + ;; + *) + + esac + + case ${language} in + m) + if [ "$M" = "0" ]; then + M=1; + fi + echo " mtt$name = zeros($N,$M);" + ;; + oct) + if [ "$M" = "0" ]; then + echo " mtt$name = zeros($N);" + else + echo " mtt$name = zeros($N,$M);" + fi + ;; + *) + esac +done +} + +declare_dummies() +{ +# Get the dummies +dummies="mtt_tmp" +rm -f mtt_dummies +for dummy in $dummies; do + grep "${dummy}[0-9]*[ \t\n]*=" < ${fun_name}.m |\ + gawk '{ + if (match($1,dummy)==1) + print $1 + }' dummy=$dummy >> mtt_dummies +done + +dummy_list=`sort -u mtt_dummies` + +# Comments +cat < +#include "useful-functions.hh" +#include "${system}_cr.h" +#include "${system}_def.h" +#include "${system}_sympar.h" + +// Code generation directives +#define STANDALONE 0 +#define OCTAVEDLD 1 +#define MATLABMEX 2 +#define RTXI 3 +#ifndef CODEGENTARGET +#define CODEGENTARGET STANDALONE +#endif // CODEGENTARGET + +${arg_type} ${system}_${rep} ( +EOF + if [ -z ${args:-""} ]; then + printf "\tvoid" + else + c=`get_field ${args:-""} 0` + i=0 + while [ ${i} -lt ${c} ]; do + i=`expr ${i} + 1` + if [ ${i} -lt ${c} ]; then + comma="," + else + comma="" + fi + w=`get_field ${args} ${i}` + get_arg_specific_stuff ${w} + printf "\tconst ${arg_type}\t&${w}${comma}\n" + done + fi + cat <"} + args=${2:-""} + cat <"} + args=${2:-""} + cat < + +extern "C" +{ + void mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) + { +EOF + map_mex_cc_inputs ${args} +cat < mttpar +## mtt_n_parameters ---> mttnpar +## +## Revision 1.41 2000/04/18 10:13:43 peterg +## Getargs now after numpar file +## +## Revision 1.40 2000/04/07 19:09:04 peterg +## New smxa and smxax reps +## +## Revision 1.39 2000/04/07 13:38:13 peterg +## New mtt_getsize to replace bc +## +## Revision 1.38 2000/04/07 13:24:41 peterg +## Modified for smxa and smxax +## +## Revision 1.37 2000/04/07 08:17:37 peterg +## Added mttpar to the arg list of cse and cseo +## +## Revision 1.36 1999/11/29 06:49:26 peterg +## Upped number of mtt_tnn +## +## Revision 1.35 1999/11/15 22:47:17 peterg +## Generates method-specific code for the ode2odeso rep. +## +## Revision 1.34 1999/10/28 05:08:48 peterg +## Added elseif +## +## Revision 1.33 1999/09/17 04:25:01 peterg +## END --> END; in translation +## +## Revision 1.32 1999/08/29 06:54:42 peterg +## Added code (mtt_parameters, get args etc) to allow arguments to the +## a.out file +## +## Revision 1.31 1999/08/02 13:40:03 peterg +## Added zero-state and zero_input to include list +## Removed zero_matrix +## +## Revision 1.30 1999/04/20 06:16:46 peterg +## Removed calls to _switch.m +## +## Revision 1.29 1999/04/02 06:27:55 peterg +## Modified for new implicit method with swoitches +## +## Revision 1.28 1999/02/17 02:59:54 peterg +## Added -q switch to mtt +## +## Revision 1.27 1999/02/16 21:56:52 peterg +## Now gets standard include files directly from source, +## +## Revision 1.26 1999/02/16 21:43:54 peterg +## Revises smx generation. +## +## Revision 1.25 1999/02/16 04:38:09 peterg +## Now forces creation of _smx file if METHOD=IMPLICIT in simpar.txt +## +## Revision 1.24 1998/11/18 16:56:15 peterg +## Now handles comments after IFS +## +## Revision 1.23 1998/11/18 14:38:01 peterg +## Now convert ALL globals to VAR .. the last one isn't repeated now +## +## Revision 1.22 1998/11/17 17:39:45 peterg +## Put _smx include at end of list (?????) +## +## Revision 1.21 1998/11/17 17:26:11 peterg +## Put sign.p first +## +## Revision 1.20 1998/10/01 16:01:09 peterg +## Now does implicit integration with switches +## +## Revision 1.19 1998/09/29 15:37:18 peterg +## Declare mttINPUT +## +## Revision 1.18 1998/08/27 08:55:40 peterg +## Mods to integration methods +## +## Revision 1.17 1998/08/27 07:38:40 peterg +## About to change to new integration (Euler/Implicit only) +## +## Revision 1.16 1998/08/19 08:46:00 peterg +## Now translates ; % to # +## +## Revision 1.15 1998/08/15 13:46:01 peterg +## Included new sparse update routines +## +## Revision 1.14 1998/08/12 15:21:12 peterg +## Added type definition for the SVD procedures +## +## Revision 1.13 1998/08/11 09:32:07 peterg +## Added comments at procedure begin and end. +## +## Revision 1.12 1998/07/30 11:30:42 peterg +## Included zeros function +## +## Revision 1.11 1998/07/29 14:18:34 peterg +## Reorganised rep dependednt output +## +## Revision 1.10 1998/07/27 20:26:15 peterg +## Added new VARs mttWSTEPS, MTTWMIN,mttWMAX +## +## Revision 1.9 1998/07/27 17:20:42 peterg +## Allow , between () +## +## Revision 1.8 1998/07/26 19:38:17 peterg +## Replaced t0..t9 by mtt_temp0.. +## +## Revision 1.7 1998/07/25 20:06:23 peterg +## Does the mtt_update function +## +## Revision 1.6 1998/07/25 16:59:40 peterg +## Give other procedures local i,j vars. +## +## Revision 1.5 1998/07/25 15:06:17 peterg +## Added DDT VAR +## +## Revision 1.4 1998/07/25 15:05:54 peterg +## DD +## +## Revision 1.3 1998/07/25 14:03:30 peterg +## Added () to [] conversion when the variable is i j k or an integer or +## combination +## +## Revision 1.2 1998/07/25 12:39:57 peterg +## begin on same line as for and if +## +## Revision 1.1 1998/07/25 09:42:52 peterg +## Initial revision +## +############################################################### + + + +# Set up variables +args=`echo $1 | sed 's/_/ /' | sed 's/\./ /'` +Sys=`echo $args | gawk '{print $1}'` +sys=`echo $Sys | gawk '{print tolower($1)}'` +rep=`echo $args | gawk '{print $2}'` +Sys_rep="$Sys""_""$rep" +Sys_smx="$Sys""_smx" +Sys_smxp="$Sys""_smx.p" +Filename="$Sys""_""$rep.p" +filename="$sys""_""$rep.p" + +Method=$2; # The integration method +Stdin=$3; # Using standard input + +if [ -n "$Method" ]; then + MethodBlurb=" with $Method integration method" +fi + +if [ -n "$Stdin" ]; then + StdinBlurb=" using standard input" +fi + +# Inform user + echo Creating $Filename $MethodBlurb $StdinBlurb + +# Find system constants +Nx=`mtt_getsize $Sys x` # States +Nxx=`mtt_getsize $Sys xx` # States x States +Nu=`mtt_getsize $Sys u` # Inputs +Ny=`mtt_getsize $Sys y` # Inputs +Npar=`wc -l $Sys\_sympar.txt | gawk '{print $1}'` + + +#if [ "$rep" = "simpar" ]; then +# mtt -q $Sys smx p +#fi + +# Heading +(case $rep in + state) + echo "PROCEDURE $Sys_rep(VAR mttx : StateVector; + mttpar : ParameterVector);" + ;; + numpar) + echo "PROCEDURE $Sys_rep(VAR mttpar : ParameterVector);" + ;; + simpar) + echo "PROCEDURE $Sys_rep(VAR mttsimpar : SimulationParameters);" + ;; + input) + echo "PROCEDURE $Sys_rep(VAR mttu : InputVector;" + echo " mttx : StateVector;" + echo " mtty : OutputVector;" + echo " mttt : REAL;" + echo " mttpar : ParameterVector);" + ;; + logic) + echo "PROCEDURE $Sys_rep(VAR mttopen : StateVector;" + echo " mttx : StateVector;" + echo " mttu : InputVector;" + echo " mttt : REAL;" + echo " mttpar : ParameterVector);" + ;; + ode) + echo "PROCEDURE $Sys_rep(VAR mttdx: StateVector;" + echo " mttx : StateVector;" + echo " mttu : InputVector;" + echo " mttt : REAL;" + echo " mttpar : ParameterVector);" + ;; + odeo) + echo "PROCEDURE $Sys_rep(VAR mtty : OutputVector;" + echo " mttx : StateVector;" + echo " mttu : InputVector;" + echo " mttt : REAL;" + echo " mttpar : ParameterVector);" + ;; + csex) + echo "PROCEDURE $Sys_rep(VAR mttedx: StateVector;" + echo " mttx : StateVector;" + echo " mttu : InputVector;" + echo " mttt : REAL;" + echo " mttpar : ParameterVector);" + ;; + cseo) + echo "PROCEDURE $Sys_rep(VAR mtty : OutputVector;" + echo " mttx : StateVector;" + echo " mttu : InputVector;" + echo " mttt : REAL;" + echo " mttpar : ParameterVector);" + + ;; + smx ) + echo "PROCEDURE $Sys_rep(VAR mtta : StateMatrix;" + echo " VAR mttax : StateVector;" + echo " mttx : StateVector;" + echo " mttu : InputVector;" + echo " mttdt : REAL;" + echo " mttpar : ParameterVector);" + ;; + smxa ) + echo "PROCEDURE $Sys_rep(VAR mtta : StateMatrix;" + echo " mttx : StateVector;" + echo " mttu : InputVector;" + echo " mttt : REAL;" + echo " mttpar : ParameterVector);" + ;; + smxax ) + echo "PROCEDURE $Sys_rep(VAR mttax : StateVector;" + echo " mttx : StateVector;" + echo " mttu : InputVector;" + echo " mttt : REAL;" + echo " mttpar : ParameterVector);" + ;; + ode2odes) + echo "PROGRAM $Sys_rep;" + echo "" + echo "CONST" + echo " MTT_MaxParameters = 100;" + echo " MTT_Npar = $Npar;" + echo " MTT_Nx = $Nx;" + echo "" + echo "TYPE" + echo " StateVector = ARRAY[1..$Nx] OF REAL;" + echo " InputVector = ARRAY[1..$Nu] OF REAL;" + echo " OutputVector = ARRAY[1..$Ny] OF REAL;" + echo " ParameterVector = ARRAY[1..$Npar] OF REAL;" + echo " SimulationParameters = RECORD" + echo " dt, first, input, last, stepfactor, wmax, wmin, wsteps: REAL" + echo " END;" + echo " StateMatrix = ARRAY[1..$Nx,1..$Nx] OF REAL;" + echo " StateMatrixVector = ARRAY[1..$Nxx] OF REAL;" + echo " glnparray = StateVector;" + echo " glmparray = StateVector;" + echo " glnarray = StateVector;" + echo " glnpbynp = StateMatrix;" + echo " glmpbynp = StateMatrix;" + ## echo " IntegrationMethod = 1..4;" + echo "" + echo "VAR" + echo " simpar : SimulationParameters;" + echo " t,ddt : REAL;" + echo " x,x0,dx,AAx : StateVector;" + echo " mttx,mttdx,mttAAx,mttedx : StateVector;" + echo " u,mttu : InputVector;" + echo " y,mtty : OutputVector;" + echo " par : ParameterVector;" + echo " mttpar : ParameterVector;" + echo " mttnpar : INTEGER;" + echo " AA,mtte : StateMatrix;" + echo " MTTi,MTTj,it,iLast: INTEGER;" + ##echo " mttSTEPFACTOR,mttWSTEPS,mttSTEPS,mttINPUT : INTEGER;" + ## echo " mttMETHOD : IntegrationMethod;" + echo " open_switches : StateVector;" + echo " numparfile, statefile, simparfile : TEXT;" + strip_comments <${Sys}_switch.txt |\ + gawk '{printf("%s_logic : REAL;\n", tolower($1))}' + echo "" + mtt_txt2declare $Sys sympar p + mtt_txt2declare $Sys struc p + ;; +# switchopen) +# echo "PROCEDURE $Sys_rep(VAR open : StateVector; mttx : StateVector);" +# echo "VAR" +# echo " MTTi,MTTj : INTEGER;" +# ;; + *) echo "PROCEDURE $Sys_rep;" + echo "VAR" + echo " MTTi,MTTj : INTEGER;" + ;; +esac) > $Filename + +cat<> $Filename + +{*** System $Sys, rep $rep, language Pascal, file $Filename ***} +{*** Translated by MTT from $Sys_rep.m on `date` ***} + +EOF + +# Regexps + name="[a-zA-Z0-9_]*" + fun_name="$Sys\_$name" + mttfun_name=$name + tab=' ' + space="[ $tab]*" + spaces="[ $tab][ $tab]*" + non_space="[^ ]*" + args='[a-zA-Z0-9,._"]*' + +# Body +fix_operators () +{ + m_neq="(\!\=)|(\~\=)" + m_not="\!" + m__eq="\=\=" + + p_neq="\<\>" + p_not="NOT\ " + p__eq="\=" + + sed "s/$m_neq/$p_neq/g" |\ + sed "s/$m_not/$p_not/g" |\ + sed "s/$m__eq/$p__eq/g" +} + +cat $Sys_rep.m |\ +grep -v 'Remove in mtt_m2p' |\ +grep -v '^[ ]*function' |\ +grep -v '^[ ]*endfunction' |\ +grep -v 'MTT_data' |\ +sed "s/^$space%/#/" | sed "s/\([;)]$space\)%/\1#/" |\ +gawk -F# '{printf("%s",$1) + if (NF>1) printf("{* %s *}", $2) + printf("\n") + }' |\ +sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\ +sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)(\($args\))/\2(\1,\3)/" |\ +sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)/\2(\1)/" |\ +sed "s/$space\($non_space\)$spaces=${spaces}zeros(\([0-9]*\),1)/zero_state(\1,\2)/" |\ +sed "s/$space\($non_space\)$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\ +sed "s/,)/)/" |\ +fix_operators |\ +gawk ' +function printvar(Name,N) { + if (N<1) return; + width = 10; + kk = 0; + for (k=1;k<=N;k++) { + printf("mtt%s%i", Name, k); + if (k==N) + printf(" : REAL;\n") + else + printf(", "); + kk++; + if (kk==width){printf("\n"); kk=0} + } +} +BEGIN{ + comment_regexp = "{" + doing_header = 0 + doing_globals = 0 + N_tmp = 100; + inc ="$I" +} +{ + if ($1=="global") + doing_globals = 1 + else{ + if (doing_globals==1){ + global[++i]=$1; + if (match($0,";")==0){ + } + else{ + doing_globals = 0 + doing_header = 1 + } + } + else + { + if (doing_header==1){ + if (rep=="ode2odes"){ + printf("\n{%s $MTTPATH/trans/p/mtt_write.p}\n",inc) + printf("{%s $MTTPATH/trans/p/mtt_par_update.p}\n",inc) + printf("{%s $MTTPATH/trans/p/sign.p}\n",inc) + printf("{%s $MTTPATH/trans/p/mtt_euler.p}\n",inc) + #printf("{%s $MTTPATH/trans/p/mtt_solve.p}\n",inc) + printf("{%s $MTTPATH/trans/p/mtt_implicit.p}\n",inc) + #printf("{%s $MTTPATH/trans/p/zero_matrix.p}\n",inc) + printf("{%s $MTTPATH/trans/p/zero_input.p}\n",inc) + printf("{%s $MTTPATH/trans/p/zero_state.p}\n",inc) + printf("{%s %s_simpar.p}\n",inc,Sys) + printf("{%s %s_numpar.p}\n",inc,Sys) + # printf("{%s $MTTPATH/trans/p/mtt_getargs.p}\n",inc) + printf("{%s %s_state.p}\n",inc,Sys) + printf("{%s %s_input.p}\n",inc,Sys) + + if (Method=="euler") { + printf("{%s %s_ode.p}\n",inc,Sys) + printf("{%s %s_odeo.p}\n",inc,Sys) + } + if (Method=="implicit") { + printf("{%s %s_csex.p}\n",inc,Sys) + printf("{%s %s_cseo.p}\n",inc,Sys) + printf("\n{%s %s_smxa.p}\n",inc,Sys); + printf("\n{%s %s_smxax.p}\n",inc,Sys); + } + printf("{%s %s_logic.p}\n\n",inc,Sys) + + for (k=1;k<=j;k++) printf("%s\n", comment[k]) + printf("\n") + printf("\nBEGIN{%s}\n", Sys_rep) + printf(" open(statefile,\"%s_state.dat\");\n", Sys) + printf(" open(simparfile,\"%s_simpar.dat\");\n", Sys) + printf(" open(numparfile,\"%s_numpar.dat\");\n", Sys) + } + else{ + for (k=1;k<=j;k++) printf("%s\n", comment[k]) + printf("\n") + printf("VAR \n"); + for (k=1;k0){ + if (doing_header==1) + comment[++j] = $0 + else + printf("%s\n", $0) + } + else { + if ($1=="if") { + sub(/==/, "=", $0) + gsub(/&&/," AND ",$0) + gsub(/\|\|/," OR ",$0) + printf("%s THEN BEGIN\n", $0) + } + else { + #if ((match($1,"mtt_write")>0)&&(length(Stdin)>0)) { + # sub(/mtt_write/, "if NOT eof THEN mtt_write"); + #} + if ($1=="for"){ + if (($2=="it")&&(length(Stdin)>0)){ + printf("WHILE NOT eof DO BEGIN {Integration loop}\n") + } + else { + sub(/:/," TO ",$0) + sub(/=/,":=",$0) + printf("%s DO BEGIN\n", $0) + } + } + else{ + sub(/=/,":=",$0) + sub(/endif/,"END;{IF}",$0) + sub(/endfor/,"END;{FOR}",$0) + sub(/elseif/,"END ELSEIF BEGIN",$0) + sub(/else/,"END ELSE BEGIN",$0) + gsub(/\^/,"**",$0) + gsub(/&&/," AND ",$0) + gsub(/\|\|/," OR ",$0) + printf("%s\n",$0) + } + } + } + } + } +} +END{ + if (rep=="def"){ + printf("EULER = 1,\n") + printf("IMPLICITL = 2;\n") + printf("IMPLICIT = 3;\n") + } + else + if (rep=="ode2odes") + printf("END{%s}.\n", Sys_rep) + else + printf("END{%s};\n", Sys_rep) +}' Sys=$Sys sys=$sys Sys_rep=$Sys_rep rep=$rep \ + Nx=$Nx Nu=$Nu Ny=$Ny Method=$Method Stdin=$Stdin |\ +sed 's/\\$//' |\ +sed 's/(\([ijk0-9,]*\))/\[\1\]/g' |\ +sed 's/(\(MTT[ijk0-9],[0-9]*\))/\[\1\]/g' |\ +sed 's/(\([0-9]*,MTT[ijk0-9]\))/\[\1\]/g' |\ +sed 's/(\(MTT[ijk0-9],MTT[ijk0-9]\))/\[\1\]/g' |\ +sed 's/(\(MTT[ijk0-9,]*\))/\[\1\]/g' |\ +sed 's/switcha(mttAA,/switcha(/g' |\ +sed 's/switch(MTTx,/switch(/g' |\ +sed 's/if nargin<[1-9] THEN//' |\ +sed 's/if nargin>[0-9] THEN//' \ +>> $Filename + +# p2c doesn't like mixed case filenames! +#if [ "$Filename" != "$filename" ]; then +# echo Creating $filename +# cp -f $Filename $filename +#fi + +if [ "$rep" = "ode2odes" ]; then + # Explicitly include files + mtt_pinclude $Filename>junk.p + mv junk.p $Filename +fi + + + ADDED mtt/bin/trans/mtt_make_menu Index: mtt/bin/trans/mtt_make_menu ================================================================== --- mtt/bin/trans/mtt_make_menu +++ mtt/bin/trans/mtt_make_menu @@ -0,0 +1,108 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_make_menu +# Creates tk/tcl menus for xmtt. +# Copyright (c) P.J.Gawthrop, 1998,1999 + +## Paths for its files +dotfile="$HOME/.mtt" +xdotfile="${dotfile}/xmtt" + +repfile="${xdotfile}/reps" +exfile="${xdotfile}/examples" + +#MTT blurb +title=`mtt --version` + +#Collect all systems (inc dir name) +pwd=`pwd`; +dirname=`basename $pwd` +systems=`echo *_abg.fig | sed 's/\([a-zA-Z0-9]*\)_abg.fig/\1/g'` +dirname_in_systems=`echo $systems | grep -c $dirname` +if [ "$dirname_in_systems" = "0" ]; then + systems="$systems $dirname" +fi + +# Default system +system=$dirname + +cat<1. Could be made faster by not generating y when +## y_sim >1 +## +## Revision 1.5 2000/05/17 16:01:42 peterg +## Fixed bug for n_y>1 +## +## Revision 1.4 2000/05/16 18:57:15 peterg +## Still debugging +## +## Revision 1.3 2000/05/16 11:59:34 peterg +## Stard new version with data files not argv. +## +## Revision 1.2 2000/05/11 19:32:29 peterg +## Put in c version + sensitivity computation +## +## Revision 1.1 2000/04/08 10:43:26 peterg +## Initial revision +## +############################################################### + +# Tell user +Sys=$1 +method=$2 +computation=$3 + +if [ -z "$method" ]; then + method=implicit +fi + +if [ -n "$computation" ]; then + blurb="for language $computation" +fi + +echo "Creating $1_sim.m with $method integration method $blurb" + +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 +Npar=`wc -l $Sys\_sympar.txt | gawk '{print $1}'` + +# Header +lang_header -noglobals $1 sim m 'x0,u,t,par,sensitivities' '[y,ys]' > $1_sim.m + +cat >> $1_sim.m <0); + if doing_sensitivities + n_y = $Ny/2; + doing_state=0; + ys = []; + else + n_y = $Ny; + doing_state=(nargout>1); + endif; + + + + ## Initialise + ui = zeros(n_u,1); # Initial control + [xi] = x0; # Read in initial state + + ## Timing parameters + first = t(1); + dt = t(2) - t(1); + n_t = length(t); + last = t(n_t); +EOF + +if [ "$computation" = "c" ]; then +cat >> $1_sim.m <1 + if doing_sensitivities + ys = [ys; yy(2:n_y:2*n_y,:)]; + endif; + endif + + endfor; + ##RealTime = [S T] +endfunction + +EOF + +else + +cat >> $1_sim.m < ${sys}_${subsystem}_struc.txt +done ADDED mtt/bin/trans/mtt_make_subsystems Index: mtt/bin/trans/mtt_make_subsystems ================================================================== --- mtt/bin/trans/mtt_make_subsystems +++ mtt/bin/trans/mtt_make_subsystems @@ -0,0 +1,19 @@ +#!/bin/sh + +# Makes subsystems for partitioning +# Copyright (C) 2000 by Peter J. Gawthrop + +sys=$1 +rep=$2 +lang=$3 + +echo Creating subsystem representations for ${sys}_${rep}.${lang} +# Get subsystems + subsystems=`mtt_get_subsystems -strip ${sys}`; + +for subsystem in $subsystems; do + +mtt $options -u -q -sub $subsystem ${sys} ${rep} ${lang} + ## Repeating systems need sorting out !!!! + #cp $1_$subsystem"_"$2.$3 $1_$subsystem"_1_"$2.$3 +done ADDED mtt/bin/trans/mtt_make_sympar Index: mtt/bin/trans/mtt_make_sympar ================================================================== --- mtt/bin/trans/mtt_make_sympar +++ mtt/bin/trans/mtt_make_sympar @@ -0,0 +1,139 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_make_sympar +# Makes the sympar.txt file +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.12 2004/09/02 22:06:09 geraint +## Does not issue warnings about Reduce reserved words if the +## second argument (use_reduce) is "no". +## +## Revision 1.11 2002/04/28 18:41:27 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.10 2001/07/28 21:10:18 geraint +## Generate warning instead of error if reserved word used. +## +## Revision 1.9 2001/07/23 05:16:39 geraint +## Simple filter for Reduce reserved words in sympar. +## +## Revision 1.8 2001/07/04 06:00:12 gawthrop +## Fixed a funny with tr - changed SEPS and REPS - something to do with ^ +## +## Revision 1.7 2001/04/13 07:14:12 geraint +## Implemented lower level lbl.txt recognition of #NOT[V|P]AR +## +## Revision 1.6 2001/04/10 12:54:50 gawthrop +## Minor fixes for sensitivity versions +## +## Revision 1.5 2000/11/03 14:57:06 peterg +## Corrected regexp notvar +## +## Revision 1.4 2000/11/02 18:53:46 peterg +## Added NOPAR words to unwanted list. +## +## Revision 1.3 2000/10/16 09:41:29 peterg +## Fixed bug with printing a blank line. +## +## Revision 1.2 2000/10/16 09:10:08 peterg +## Now strips out "unwanted" bits frome the _aliased.txt file +## +## Revision 1.1 2000/10/12 19:24:28 peterg +## Initial revision +## +## +############################################################### + + +sys=$1 # System name +filename=$1_sympar.txt + +use_reduce=$2 + +# Inform user +echo Creating $filename + +# Create list of all sympars including those that are aliased +sh $1_type.sh 'echo ' ' ' ' ' |\ +gawk '{printf("abg2sympar_m2txt %s %s\n ", $1, $2)}' |\ +sh | sort -u > mtt_all_sympar.txt + +# Sort the aliased list +mtt_strip_args < $1_aliased.txt | sort -u > mtt_aliased_sort.txt + +# Create list of unwanted stuff +cat mtt_aliased_sort.txt> mtt_unwanted.txt + +notvar="[%|#]NOT[V|P]AR"; +sh $1_type.sh 'strip_notvars.sh ' ' ' ' mtt_unwanted.txt' + +sort -u mtt_unwanted.txt > mtt_unwanted_sort.txt + +# Compare it with the aliased list and show the differences +diff mtt_all_sympar.txt mtt_unwanted_sort.txt |\ +gawk '{if ($1=="<") printf("%s\t%s\n", $2,$3)}' > mtt_sympar.txt + +# Assume same name in different system is the same +gawk '{ + if ($1==name){ + sysname[i++]=$2 + } + + if ($1!=name){ + if (length(name)>0){ + printf("%s\t",name) + comma=""; + for (j=1;j<=i;j++){ + printf("%s%s", comma, sysname[j]); + comma=","; + } + printf("\n") + } + i=1; + sysname[1]=$2; + } + name = $1 +} +END{ + printf("%s\t",name) + comma=""; + for (j=1;j<=i;j++){ + printf("%s%s", comma, sysname[j]); + comma=","; + } + printf("\n") + +}' < mtt_sympar.txt >$filename + +if [ ! "${use_reduce}" = "no" ]; then + reserved_words=`\ + cat ${MTT_LIB}/reduce/reserved_words.txt |\ + gawk '{printf "%s ", $0}' |\ + tr [a-z] [A-Z]` + sympar_words=`\ + cat ${filename} |\ + cut -f1 |\ + gawk '{printf "%s ", $0}' |\ + tr [a-z] [A-Z]` + flag=0 + for reserved_word in ${reserved_words}; do + for sympar_word in ${sympar_words}; do + if [ ${sympar_word} = ${reserved_word} ]; then + echo "" + echo "*** MTT Warning:" + echo " ${sympar_word} is reserved (Reduce)" + echo "" + fi + done + done +fi ADDED mtt/bin/trans/mtt_mend_lines Index: mtt/bin/trans/mtt_mend_lines ================================================================== --- mtt/bin/trans/mtt_mend_lines +++ mtt/bin/trans/mtt_mend_lines @@ -0,0 +1,18 @@ +#!/bin/sh + +# Copyright (C) 2000 by Peter J. Gawthrop + +# Fixes broken lines from reduce. + +#sed 's/[^#]\(.*\)[^;]$/\1\\/' + +gawk '{ + if ((match($1,"#")==0)&&(match($1,"global")==0)&&(match($1,"endfunction")==0)) { + if(match($0,";")!=length($0)) + printf("%s \\\n",$0) + else + print $0 + } + else print $0 + +}' ADDED mtt/bin/trans/mtt_multi Index: mtt/bin/trans/mtt_multi ================================================================== --- mtt/bin/trans/mtt_multi +++ mtt/bin/trans/mtt_multi @@ -0,0 +1,22 @@ +#!/bin/sh + +# Does mutiple commands down the hierarchy + +command=$1 +system=$2 +rep=$3 +lang=$4 +relative_level=$5 + +current_level=`echo $system | gawk '{N=split($1,foo,"_"); print N-1}'` + +if [ -z "$relative_level" ]; then + relative_level=0; +fi + +mtt_xargs.sh "ls" "$2*_$3.$4" |\ +gawk '{ + level=split($1,foo,"_")-2; + maxlevel = current_level + relative_level; + if (level<=maxlevel) print command, $0, "&"; +'} command=$command relative_level=$relative_level current_level=$current_level ADDED mtt/bin/trans/mtt_name2array Index: mtt/bin/trans/mtt_name2array ================================================================== --- mtt/bin/trans/mtt_name2array +++ mtt/bin/trans/mtt_name2array @@ -0,0 +1,55 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_name2array + +# Generates array elements from names +# Copyright (C) 2000 by Peter J. Gawthrop + + +case $2 in + numpar) + name=mttpar + cat $1_sympar.txt>mtt_infile + ;; + state) + name=mttx + gawk '{if ($1==rep) printf("%s\n", $4)}' rep=$2 \ + <$1_struc.txt >mtt_infile + ;; + input) + name=mttu + gawk '{if ($1==rep) printf("%s\n", $4)}' rep=$2 \ + <$1_struc.txt >mtt_infile + ;; + *) + echo Repesentation $2 not supported +esac + +case $3 in + zero) + strip_comments $logfile 2>&1 +off nat; +in "${system}_def.r"; +in "$outfile"; +load scope; +out "$tmpfile"; +$command; +shut "$tmpfile"; +$end; +EOF + +cp $outfile $outfile.unoptimised +cp $tmpfile $outfile.tmp + +find_code $outfile head > $tmpfile.head +cat $tmpfile | mtt_fix_integers > $tmpfile.body +find_code $outfile foot > $tmpfile.foot +cat $tmpfile.head $tmpfile.body $tmpfile.foot > $outfile +echo ";end;" >> $outfile + +mtt_error_r $logfile ADDED mtt/bin/trans/mtt_p2C Index: mtt/bin/trans/mtt_p2C ================================================================== --- mtt/bin/trans/mtt_p2C +++ mtt/bin/trans/mtt_p2C @@ -0,0 +1,99 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: p2C + +# Pascal to a c program - intermediate step for mtt_p2oct +# P.J.Gawthrop Feb 2000 +# Copyright (C) 2000 by Peter J. Gawthrop + + #$Id$ + + +sys_rep="$1_$2" +begin="BEGIN{$sys_rep}" + +# Inform user +# echo "Creating $1_$2.pas" + +# Find system constants +Nx=`mtt_getsize $1 x` +Nxx=`mtt_getsize $1 xx` +Nu=`mtt_getsize $1 u` +Ny=`mtt_getsize $1 y` + +Npar=`wc -l $1_sympar.txt | gawk '{print $1}'` + + +echo "PROCEDURE $1_$2;" > $1_$2.pas +echo "TYPE" >>$1_$2.pas +echo " StateVector = ARRAY[1..$Nx] OF REAL;" >>$1_$2.pas +echo " StateMatrix = ARRAY[1..$Nx,1..$Nx] OF REAL;" >>$1_$2.pas +echo " StateMatrixVector = ARRAY[1..$Nxx] OF REAL;" >>$1_$2.pas +echo " InputVector = ARRAY[1..$Nu] OF REAL;" >>$1_$2.pas +echo " OutputVector = ARRAY[1..$Ny] OF REAL;" >>$1_$2.pas +echo " ParameterVector = ARRAY[1..$Npar] OF REAL;" >>$1_$2.pas + + +# Create the predefined vars +echo "VAR" >>$1_$2.pas +gawk '{ + printf("%s,", $1) + } + END{print "JUNK : REAL;"}'< $1_sympar.txt >>$1_$2.pas + +if [ "$2" = "ode2odes" ]; then + first='PROCEDURE' + gawk ' + { + if (writing) print $0; + if (i++==0) writing=1 + if (match($1,"PROCEDURE")==1) writing=0; + }' < $1_$2.p >>$1_$2.pas +else + first='BEGIN' + + # Convert VAR format in the headings + gawk 'BEGIN{writing=1} + { + if (match($1,"BEGIN")==1) writing=0; + if (writing) print $0; + }' < $1_$2.p | \ + sed \ + -e 's/PROCEDURE [a-zA-Z_0-9]*(VAR/VAR/' \ + -e 's/PROCEDURE [a-zA-Z_0-9]*;//' \ + -e 's/REAL);/REAL;/' \ + -e 's/OutputVector);/OutputVector;/' \ + -e 's/ParameterVector);/ParameterVector;/' \ + >>$1_$2.pas +fi + +# Write out the actual code until the begining of the procedure +gawk 'BEGIN{writing=0} +{ + if (match($1,first)==1) writing=1; + if (writing) print $0; + if (match($1,begin)==1) writing=0; + +}' begin=$begin first=$first < $1_$2.p >>$1_$2.pas + +# Write out the parameters +echo {Parameters} >>$1_$2.pas +gawk '{ + printf(" %s \t:= mttpar[%i];\n", $1, ++i); + }'< $1_sympar.txt >>$1_$2.pas + +# Write out the actual code from the end of the procedure +gawk 'BEGIN{writing=0} +{ + if (writing) print $0; + if (match($1,begin)==1) writing=1; +}' begin=$begin < $1_$2.p >>$1_$2.pas + +#echo "Creating $1_$2.C" +p2c -o $1_$2.C $1_$2.pas > mtt_p2C.log 2>> mtt_p2C.log + + ADDED mtt/bin/trans/mtt_p2c Index: mtt/bin/trans/mtt_p2c ================================================================== --- mtt/bin/trans/mtt_p2c +++ mtt/bin/trans/mtt_p2c @@ -0,0 +1,127 @@ +#! /bin/sh + + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_p2c +# Pascal to c converter for MTT +# Uses the wonderful GNU p2c by Dave Gillespie, daveg@csvax.cs.caltech.edu. +# P.J.Gawthrop July 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.12 2001/04/11 07:36:10 gawthrop +## Now uses system_cr.h in place of system.h in .c rep - +## compatible with older code +## +## Revision 1.11 2001/03/29 19:24:14 gawthrop +## Can now use c representations of crs when using -c option +## +## Revision 1.10 2000/09/15 09:01:41 peterg +## Updated internal comments +## +## Revision 1.9 2000/05/16 18:56:58 peterg +## Now realised that libp2c.a avoids many probs - so simplified it. +## +## Revision 1.8 2000/05/11 19:34:50 peterg +## *** empty log message *** +## +## Revision 1.7 1999/08/29 06:14:27 peterg +## No longer remove "PASCAL_MAIN" +## +## Revision 1.6 1999/04/20 06:17:15 peterg +## Fudge to avoid a bizzare bug (?) in p2c which corrupts "zero_matrix" +## +## Revision 1.5 1998/08/12 14:14:18 peterg +## Added pretty heading and explicitly include p2c header. +## +## Revision 1.4 1998/07/29 13:56:34 peterg +## Replces p2c include by local include. +## +## Revision 1.3 1998/07/27 20:32:51 peterg +## Now gives immediate warnings +## +## Revision 1.2 1998/07/25 16:35:43 peterg +## Sorted out log files etc +## +## Revision 1.1 1998/07/25 16:28:38 peterg +## Initial revision +## +############################################################### + + +# Options +info='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info; + ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +## Create p2crc with various configs. +cat > p2crc < mtt_p2c.log 2>> mtt_p2c.log +cat $1_$2.log >> mtt_p2c.log +mv $1_$2.c mtt_junk.c + +# Change p2c.h include. +#mv $1_$2.c mtt_junk1# +#cat mtt_junk1 | grep -v 'p2c/p2c.h'> mtt_junk2 + +# pretty heading +DATE=`date` + +cat <$1_$2.c +/* C program $1_$2.c */ +/* Generated by MTT on $DATE */ + +/* Compile with gcc -lm -lp2c $1_$2.c -o $1_$2.out */ +/* Note that p2c must be correctly installed so that p2c.h and libp2c.a are accessible */ + +/* Header file for user-defined crs (implemented in c) */ +#include "$1_cr.h" +EOF + +#cat<>$1_$2.c +#/* The following is the header file included here for completeness */ +#EOF + +#cat $MTTPATH/trans/c/p2c.h >> $1_$2.c + +#cat <> $1_$2.c +#/* End of the header file. */ +# +# +#EOF + +## The sed item is to avoid a bizzare bug (?) in p2c which corrupts "zero_matrix" +###cat mtt_junk2 | sed 's/zero_matrix/mttmat/g'>> $1_$2.c + +## Sort out the pascal EOF, PASCAL_MAIN etc +cat mtt_junk.c |\ + grep -v PASCAL_MAIN >> $1_$2.c + +if [ -n "$info" ]; then + cat mtt_p2c.log +fi + +# Remove the garbage +rm -f mtt_junk.c ADDED mtt/bin/trans/mtt_p2cc Index: mtt/bin/trans/mtt_p2cc ================================================================== --- mtt/bin/trans/mtt_p2cc +++ mtt/bin/trans/mtt_p2cc @@ -0,0 +1,119 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_p2cc + +# Pascal to .cc (for octave .oct files). +# P.J.Gawthrop Feb 2000 +# Copyright (C) 2000 by Peter J. Gawthrop + + #$Id$ + +## Extract the system and rep names. +sys=`mtt_sysname $1` +rep=`mtt_repname $1` +sys_rep=$sys"_"$rep + +# Find system constants +Nx=`mtt_getsize $sys x` # States +Nu=`mtt_getsize $sys u` # Inputs +Ny=`mtt_getsize $sys y` # Inputs + +# Create the representation code +mtt_p2C $sys $rep + +# Inform user +echo Creating $sys_rep.cc + +# Create the c++ code +# Heading +date=`date` + +cat > $sys_rep.cc < + +DEFUN_DLD ($sys_rep, args, , + "Usage: $sys_rep(x,u,t,par)\n$sys_rep was generated by MTT on $date") +{ + ColumnVector mttx = args(0).vector_value (); + ColumnVector mttu = args(1).vector_value (); + double mttt = args(2).double_value (); + ColumnVector mttpar = args(3).vector_value (); + +EOF + +case "$rep" in + ode) + echo " ColumnVector mttdx ($Nx);" >> $sys_rep.cc + ;; + odeo) + echo " ColumnVector mtty ($Ny);" >> $sys_rep.cc + ;; + cse) + echo " ColumnVector mttdx ($Nx);" >> $sys_rep.cc + ;; + cseo) + echo " ColumnVector mtty ($Ny);" >> $sys_rep.cc + ;; + smx | smxa | smxax) + Nxx=`echo "$Nx*$Nx" | bc` + echo " Matrix mtta ($Nx,$Nx);" >> $sys_rep.cc + echo " ColumnVector mttax ($Nx);" >> $sys_rep.cc + ;; + *) + +esac + +#Extract Type info +echo '/* Types */' >> $sys_rep.cc +grep typedef $sys_rep.C >> $sys_rep.cc + +#Extract the rep code converting [] to () and deleting mtt variables etc +#The awk part detects the begin and end of the relevant code. +echo "/* Representation $rep information */" >> $sys_rep.cc +gawk '{ + if ( (match($1,"}")==1)&&(NF>1)) writing=0; + if ( (writing) && !(match($2,"mtt[a-z]")==1) ) print $0; + if (match($1,"{")==1) writing=1; +}' <$sys_rep.C |\ +sed 's/\[\([a-z0-9_]*\)\]\[\([a-z0-9_]*\)\]/(\1,\2)/g' |\ +sed 's/\[\([a-z_0-9]*\)\]/(\1)/g' >> $sys_rep.cc + +# Tail +cat >> $sys_rep.cc <> $sys_rep.cc; + ;; + odeo) + echo "return octave_value (mtty); " >> $sys_rep.cc; + ;; + cse) + echo "return octave_value (mttdx);" >> $sys_rep.cc; + ;; + cseo) + echo "return octave_value (mtty); " >> $sys_rep.cc; + ;; + smxa) + echo "return octave_value (mtta); " >> $sys_rep.cc; + ;; + smxax) + echo "return octave_value (mttax); " >> $sys_rep.cc; + ;; + *) + +esac + +# Terminating } +echo "}" >> $sys_rep.cc; + +# Convert to octave loadable code +#echo Creating $sys_rep.oct +#mkoctfile $sys_rep.cc + ADDED mtt/bin/trans/mtt_p2m Index: mtt/bin/trans/mtt_p2m ================================================================== --- mtt/bin/trans/mtt_p2m +++ mtt/bin/trans/mtt_p2m @@ -0,0 +1,25 @@ +#! /bin/sh +## Chages the Pascal output from gentran to octave form +# Copyright (C) 2000 by Peter J. Gawthrop + +sed 's/begin$//' |\ +sed 's/end$//' |\ +sed 's/end;$/;/' |\ +sed 's/\[\([0-9,]*\)\]/(\1)/g' |\ +sed 's/:=/ = /' |\ +sed 's/\*\*/\^/g' |\ +sed 's/mtt\([a-z]\)\([a-z]*\)\([0-9]\)\([0-9]*\)/mtt\1\2(\3\4)/g' |\ +gawk '{ + sub(/^[\ ]*/, "", $0) + sub(/\$$/, ";", $0) + + if (match($NF,"[;#.%]$")==0){ + Previous[++i] = $0 + } + else { + for (j=1;j<=i;j++) printf("%s", Previous[j]); + printf("%s\n", $0) + i=0; + } +}' |\ +sed 's/#/%/g' ADDED mtt/bin/trans/mtt_pdf.sty Index: mtt/bin/trans/mtt_pdf.sty ================================================================== --- mtt/bin/trans/mtt_pdf.sty +++ mtt/bin/trans/mtt_pdf.sty @@ -0,0 +1,25 @@ +%% Style file for postscript document + +\usepackage{mtt} % Common stuff + +% Figure definition +\newcommand{\fig}[4]{ + \begin{figure}[htbp] + \begin{center} + \fbox{ + \pdfimage width #3\linewidth {#1.pdf} + %\includegraphics[width=#3\linewidth]{#1.ps} + } + \caption{#4} + \label{fig:#2} + \end{center} + \end{figure} + } + +% Hyper stuff +\usepackage[implicit=true, + bookmarks=true, + pdfauthor={MTT}, + pdftitle={MTT report}, + pdfsubject={MTT}, + pdfkeywords={MTT, bond graphs}]{hyperref} ADDED mtt/bin/trans/mtt_pinclude Index: mtt/bin/trans/mtt_pinclude ================================================================== --- mtt/bin/trans/mtt_pinclude +++ mtt/bin/trans/mtt_pinclude @@ -0,0 +1,27 @@ +#!/bin/sh +# pinclude - explicitly includes Pascal files - p2c has probs. doing this + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:56:46 peterg +## Put under RCS +## +############################################################### + + + +gawk ' { + if ( (match($1,"{\\$I")>0) || (match($1,"\\*\\$I")>0) ) { + sub(/}/,"",$2); + command=sprintf("mtt_pinclude %s",$2); + system(command) + } + else{ + print $0 + } + + +}' <$1 ADDED mtt/bin/trans/mtt_prepend.sh Index: mtt/bin/trans/mtt_prepend.sh ================================================================== --- mtt/bin/trans/mtt_prepend.sh +++ mtt/bin/trans/mtt_prepend.sh @@ -0,0 +1,60 @@ +#! /bin/sh + +usage () +{ +cat < $tmp + +if [ ${preserve:=""} = "-p" ]; then + touch -r $time $tmp + rm $time +fi + +cp $preserve $tmp $file2 +rm $tmp + ADDED mtt/bin/trans/mtt_ps.sty Index: mtt/bin/trans/mtt_ps.sty ================================================================== --- mtt/bin/trans/mtt_ps.sty +++ mtt/bin/trans/mtt_ps.sty @@ -0,0 +1,40 @@ +%% Style file for postscript document + +%%\usepackage{mtt} % Common stuff (Needs to be explicit now) + +%Postscript figures +\usepackage{graphicx,color} + +% Figure definition +\newcommand{\fig}[4]{ + \begin{figure}[htbp] + \begin{center} + \fbox{ + \includegraphics[width=#3\linewidth,height=18cm,keepaspectratio]{#1.ps} + } + \caption{#4} + \label{fig:#2} + \end{center} + \end{figure} + } + + \newcommand{\tfig}[4]{ + \begin{figure}[htbp] + \begin{center} + \fbox{ + \resizebox{#3\linewidth}{!}{\input{#1}} + } + \caption{#4} + \label{fig:#2} + \end{center} + \end{figure} + } + + +% Hyper stuff +\usepackage[implicit=true, + bookmarks=true, + pdfauthor={MTT}, + pdftitle={MTT report}, + pdfsubject={MTT}, + pdfkeywords={MTT, bond graphs}]{hyperref} ADDED mtt/bin/trans/mtt_r2m Index: mtt/bin/trans/mtt_r2m ================================================================== --- mtt/bin/trans/mtt_r2m +++ mtt/bin/trans/mtt_r2m @@ -0,0 +1,208 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_r2m +# Reduce to octave conversion +# Based on obsolete ode_r2m and ode_r2lang +# Based on obsolete mtt_r2m_old +# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994, Jan 95, May 1998 +# July 1998 +# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996, 1998 +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.33 2004/08/29 03:17:02 geraint +## Vectorise sesx and sesy. +## +## Revision 1.32 2003/04/17 20:07:33 geraint +## Added rule to create _sese.m +## +## Revision 1.31 2002/09/16 08:08:00 geraint +## Merged changes from global-optimisation branch. +## +## Revision 1.30.4.1 2002/09/03 23:44:43 geraint +## adding global optimisation (-optg). +## +## Revision 1.30 2002/03/26 11:59:54 geraint +## Added dummy -optimise switch to prevent falling over for -cc generation. +## +## Revision 1.29 2001/09/07 00:25:56 geraint +## Partial fix for insidious bug which eliminates lines of code when parameter +## names of the form (in* or off*) start continuation lines. +## +## Revision 1.28 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## +## Revision 1.27.4.1 2001/05/04 04:07:24 geraint +## Numerical solution of algebraic equations. +## sys_ae.cc written for unsolved inputs. +## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). +## +## Revision 1.27 2001/02/08 00:39:56 geraint +## Removed clear from code generated by: mtt -c -i euler -o +## +## Revision 1.26 2000/11/27 11:52:10 peterg +## Changed some greps to be case insensitive +## +## Revision 1.25 2000/10/14 08:50:07 peterg +## Use new mtt_header +## +## Revision 1.24 2000/10/11 09:07:53 peterg +## Vectorisation +## csex rep. +## +## Revision 1.23 2000/10/10 21:00:43 peterg +## More reps added +## +## Revision 1.22 2000/09/15 08:27:07 peterg +## Removed debugging lines +## +## Revision 1.21 2000/08/30 11:43:40 peterg +## -optimise switch added +## +## Revision 1.20 2000/08/30 10:43:17 peterg +## Simplified version using GENTRAN matrix :=: matrix +## lang_matrix is no longer used at all +## +## Revision 1.19 2000/08/28 20:17:59 peterg +## Put in Winfried Neun's bug fix +## -- prevents segmentation violation using optimised gentran when matrix +## comtains a number +## +## Revision 1.18 2000/08/24 17:11:40 peterg +## Now optimises as well as segmenting - uses the SCOPE package +## +## Revision 1.17 2000/05/20 15:23:56 peterg +## Paramererised version of sm etc etc (using -parameter switch) +## +## Revision 1.16 2000/04/18 11:14:18 peterg +## Put in the -parameters option +## +## Revision 1.15 2000/02/10 14:58:57 peterg +## *** empty log message *** +## +## Revision 1.14 1999/12/08 02:06:00 peterg +## Now incudes csm rep. +## +## Revision 1.13 1999/11/23 00:59:14 peterg +## Now does ssm.m +## +## Revision 1.12 1999/11/15 22:57:20 peterg +## Removed a debugging line +## +## Revision 1.11 1999/11/01 21:20:14 peterg +## Removed the E matrix from the cse file. +## +## Revision 1.10 1999/10/27 07:38:30 peterg +## Now does cse version -- but not needed now exept for Euler integration +## +## Revision 1.9 1999/10/26 23:47:58 peterg +## Now does cse.m file +## +## Revision 1.8 1999/07/26 06:07:19 peterg +## Reinstated removal of the odeo.p file +## +## Revision 1.7 1999/03/16 00:38:06 peterg +## Done some more tidying up +## +## Revision 1.6 1999/03/15 07:29:25 peterg +## Fixed various obscure reduce bugs +## THIS NEEDS A MAJOR REWRITE!!!! +## +## Revision 1.5 1998/08/13 16:25:07 peterg +## Removed some documentation form odeo.m +## +## Revision 1.4 1998/08/13 15:10:47 peterg +## Change temp var name to mtt_t1 etc +## +## Revision 1.3 1998/08/13 12:43:19 peterg +## Cahnged tmp variable to mtt_1 etc +## +## Revision 1.2 1998/07/27 20:26:44 peterg +## Put in correct N and M values for dm rep +## +## Revision 1.1 1998/07/27 16:30:26 peterg +## Initial revision +## +############################################################### + + +# Args +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -noglobals) + noglobals='-noglobals'; + ;; + -parameters) + parameters='-parameters'; + par='mttpar' + ;; + -optimise_local | -optimise_global ) + ;; + *) + echo $1 is an unknown option + exit;; + esac + shift +done + +# Set up some strings +rep=$2 +ext=m +out=$1"_"$rep.$ext + +#Inform user +echo Creating $out + +# Remove the old log file +rm -f mtt_r2m.log + +#Header +case $rep in + ae|csex|cseo|ode|odeo|sae|sese|sesx|sesy) + vectorise=yes + ;; + *) +esac + + mtt_header $1 $rep $ext > mtt_junk + +#Convert from the (optimised) r file +echo >> mtt_junk +echo '## Code' >> mtt_junk +strip_comments<$1_$2.r |\ +tr [A-Z] [a-z] |\ +grep -vi 'MATRIX ' |\ +grep -vi 'END;' |\ +grep -vi 'clear mtt' |\ +grep -v '^off .*\$' |\ +grep -v '^in .*\$' |\ +sed \ + -e "s/^mtt/ mtt/" \ + -e "s/:=/=/" \ + -e "s/\\$/;/" \ + >> mtt_junk +echo '## END Code' >> mtt_junk +echo endfunction >> mtt_junk + +# Mend broken lines +mtt_mend_lines < mtt_junk > mtt_junk_mended +# Vectorise (n,1) arrays when appropriate +if [ -n "$vectorise" ]; then + mtt_vectorise $out +else + mv mtt_junk_mended $out +fi + +# Now invoke the standard error handling. +#mtt_error_r mtt_r2m.log + + + ADDED mtt/bin/trans/mtt_remove_underscore Index: mtt/bin/trans/mtt_remove_underscore ================================================================== --- mtt/bin/trans/mtt_remove_underscore +++ mtt/bin/trans/mtt_remove_underscore @@ -0,0 +1,3 @@ +#!/bin/sh + +sed 's/_/\\_/g' ADDED mtt/bin/trans/mtt_repname Index: mtt/bin/trans/mtt_repname ================================================================== --- mtt/bin/trans/mtt_repname +++ mtt/bin/trans/mtt_repname @@ -0,0 +1,14 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_repname + +# Returns the representation name from System_rep.lang + +# P.J.Gawthrop Feb 2000 +# Copyright (C) 2000 by Peter J. Gawthrop + +echo $1 | tr '.' '_' | gawk -F '_' '{print $2}' ADDED mtt/bin/trans/mtt_strip_args Index: mtt/bin/trans/mtt_strip_args ================================================================== --- mtt/bin/trans/mtt_strip_args +++ mtt/bin/trans/mtt_strip_args @@ -0,0 +1,81 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: strip args +# Strips unwanted bits from a list of arguments +# Label file to symbolic parameters conversion +# Copyright (C) 2000 by Peter J. Gawthrop + +## $Id$ ## +## $Log$ +## Revision 1.6 2001/07/04 06:00:12 gawthrop +## Fixed a funny with tr - changed SEPS and REPS - something to do with ^ +## +## Revision 1.5 2001/06/13 14:50:13 gawthrop +## Operator ^ now ok in args in abg and/or lbl +## +## Revision 1.4 2001/05/08 15:18:10 gawthrop +## Added trig and hyperbolic functions to argument exclusion list +## +## Revision 1.3 2000/10/17 12:33:13 peterg +## Added mtt_mod to the zapped list +## +## Revision 1.2 2000/10/16 09:06:26 peterg +## Write out the system as a second columns as well +## +## Revision 1.1 2000/10/16 09:04:04 peterg +## Initial revision +## ## +# Inform user +#echo "Creating $1_sympar.txt" + +# Separation characters +SEPS='^=*;+/()-' +# Replace by , +REPS='[,*]' + + +# This is the main transformation using gawk +tr $SEPS $REPS | \ +gawk ' +function exact_match(name1, name2) { + return ((match(name1,name2)>0)&&(length(name1)==length(name2))) +} + +function matches(names, name) { + n_matches = split(names,match_name); + matched = 0; + for (i_matches = 1; i_matches <= n_matches; i_matches++) { + if ( exact_match(name,match_name[i_matches]) ) { + matched = 1; + break; + } + } + return matched; +} + +BEGIN { + not_an_arg = "effort flow state internal external zero unknown\ + mtt_e mtt_f\ + sqrt exp log sign sin asin cos acos tan atan \ + sin asin cos acos tan atan \ + sinh asinh cosh acosh tanh atanh \ + none abs"; +} +{ + args=$1 + sys=$2 + N=split(args, arg, ","); + for (i=1;i<=N;i++){ + if ( (length(arg[i])>0)&&(matches(not_an_arg,arg[i])==0)&&(match(arg[i],"^[0-9]+[.]*")==0) ){ + printf("%s\t%s\n", arg[i], sys); + } + } +}' |\ +grep -v '^\$' + + + ADDED mtt/bin/trans/mtt_sysname Index: mtt/bin/trans/mtt_sysname ================================================================== --- mtt/bin/trans/mtt_sysname +++ mtt/bin/trans/mtt_sysname @@ -0,0 +1,14 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_sysname + +# Returns the system name from System_rep.lang + +# P.J.Gawthrop Feb 2000 +# Copyright (C) 2000 by Peter J. Gawthrop + +echo $1 | gawk -F '_' '{print $1}' ADDED mtt/bin/trans/mtt_txt2declare Index: mtt/bin/trans/mtt_txt2declare ================================================================== --- mtt/bin/trans/mtt_txt2declare +++ mtt/bin/trans/mtt_txt2declare @@ -0,0 +1,78 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar_txt2declare + +# Symbolic parameters to variable declaration +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2000/10/14 09:32:50 peterg +## struc version only does state and input +## +## Revision 1.1 2000/10/14 09:26:48 peterg +## Initial revision +## +## Revision 1.1 2000/10/11 09:08:20 peterg +## Initial revision +## + +############################################################### + +sys=$1 +what=$2 +language=$3 + +case $language in + p) + first="VAR"; + delim=", "; + last=': REAL;'; + ;; + *) + echo Language $language not supported - sorry; exit 1 +esac + +case $what in + struc) + strip_comments < $sys"_"$what".txt" | gawk '{if (($1=="state")||($1=="input")) + print $4; + }' >mtt_names + ;; + sympar) + strip_comments < $sys"_"$what".txt" | gawk '{print $1}' >mtt_names + ;; + *) + echo Argument 2 must be struc or sympar +esac + +# Start +cat<4){ + printf("\n"); j=0; + } + } + printf("%s%s\n",var[n], last); + +}' "delim=$delim" "last=$last" mtt_names + + ADDED mtt/bin/trans/mtt_txt2m Index: mtt/bin/trans/mtt_txt2m ================================================================== --- mtt/bin/trans/mtt_txt2m +++ mtt/bin/trans/mtt_txt2m @@ -0,0 +1,292 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_txt2m +# Converts txt file to matlab file (for numpar and state) + +# Copyright (c) P.J.Gawthrop 1998 + + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.17 2002/04/28 18:41:27 geraint +# %% Fixed [ 549658 ] awk should be gawk. +# %% Replaced calls to awk with call to gawk. +# %% +# %% Revision 1.16 2002/04/18 17:51:11 gawthrop +# %% Put default values in _simpar.m in case of missing values in txt file +# %% +# %% Revision 1.15 2002/03/26 12:00:37 geraint +# %% Escaped characters to eliminate awk warnings. +# %% +# %% Revision 1.14 2001/07/13 04:54:04 geraint +# %% Branch merge: numerical-algebraic-solution back to main. +# %% +# %% Revision 1.13.4.2 2001/07/09 00:24:58 geraint +# %% input rep: Removed input name mapping, left state name mapping. +# %% +# %% Revision 1.13.4.1 2001/06/26 01:01:28 geraint +# %% Makes input and state names available for input rep. +# %% +# %% Revision 1.13 2001/02/05 03:33:18 geraint +# %% Convert user-defined txt to lower-case in translation. +# %% Required by logic.m (Octave is case sensitive). +# %% +# %% Revision 1.12 2000/11/08 11:20:49 peterg +# %% removed the empty matrix stuff +# %% +# %% Revision 1.11 2000/10/17 09:55:21 peterg +# %% Added logic rep +# %% +# %% Revision 1.10 2000/10/15 09:51:50 peterg +# %% Set array code in input rep +# %% +# %% Revision 1.9 2000/10/13 11:07:33 peterg +# %% Started conversion to new style state, input ext +# %% +# %% Revision 1.8 2000/09/30 13:53:07 peterg +# %% Default to empty matix in numpar.m -- avoids probs for parameter-free systems +# %% +# %% Revision 1.7 2000/05/19 17:46:17 peterg +# %% Give argument to state +# %% +# %% Revision 1.6 2000/05/19 14:59:03 peterg +# %% MTT --> mtt in fun output +# %% +# %% Revision 1.5 2000/05/19 14:05:10 peterg +# %% Zero parameters in the numpar.m file +# %% +# %% Revision 1.4 2000/05/18 12:05:42 peterg +# %% Replaced sympar by sympars in numpar rep +# %% +# %% Revision 1.3 2000/05/11 16:09:24 peterg +# %% Put in simpar.first parameter +# %% +# %% Revision 1.2 2000/05/11 12:16:46 peterg +# %% New version of simpar - with record +# %% +# %% Revision 1.1 2000/05/11 10:55:57 peterg +# %% Initial revision +# %% +# %% Revision 1.19 2000/02/11 13:35:16 peterg +# %% Added the new MTTpar generation +# %% +# %% Revision 1.18 1999/11/14 22:22:17 peterg +# %% Removed checks for implicit - now done at command-line level. +# %% +# %% Revision 1.17 1999/11/04 04:54:24 peterg +# %% Removed recreation of smx file. +# %% +# %% Revision 1.16 1999/03/06 02:18:10 peterg +# %% Changed argument list. +# %% +# %% Revision 1.15 1999/02/16 21:44:38 peterg +# %% Revised smx generation +# %% +# %% Revision 1.14 1999/02/16 04:38:22 peterg +# %% Now forces creation of _smx file if METHOD=IMPLICIT in simpar.txt +# %% +# %% Revision 1.13 1998/08/31 11:43:37 peterg +# %% Now lower cases globals in numpar files +# %% +# %% Revision 1.12 1998/08/14 10:47:31 peterg +# %% Put ImplicitS sub before Implicit!! +# %% +# %% Revision 1.11 1998/08/14 10:43:44 peterg +# %% Added ImplicitS - sparse integration +# %% +# %% Revision 1.10 1998/08/11 13:27:51 peterg +# %% Lowercase mttLAST etc +# %% +# %% Revision 1.9 1998/07/30 15:07:17 peterg +# %% Added _ to the disallowed chars around t +# %% +# %% Revision 1.8 1998/07/30 12:52:38 peterg +# %% Adds ; to end of statements +# %% Translates ' to " before removal +# %% +# %% Revision 1.7 1998/07/30 09:32:33 peterg +# %% Replaces: +# %% euler by 1 +# %% implicitl by 1 +# %% implicit by 3 +# %% +# %% Revision 1.6 1998/07/27 18:59:11 peterg +# %% Added WMIN etc +# %% +# %% Revision 1.5 1998/07/26 11:54:20 peterg +# %% Added mtt to variables +# %% +# %% Revision 1.4 1998/07/26 09:50:12 peterg +# %% More forgiving of txt sytax. +# %% +# %% -- can use () or () +# %% -- can use mttx() or x() +# %% -- can use mttu() or u() +# %% +# %% Revision 1.3 1998/07/25 20:40:35 peterg +# %% All vars in lower case now +# %% +# %% Revision 1.2 1998/07/25 09:48:31 peterg +# %% Tidied up for Pascal version +# %% +# %% Revision 1.1 1998/02/25 22:10:25 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +system=$1 +representation=$2 +outfile=$1_$2.m + +tolower () { tr [A-Z] [a-z] ;} + +# Inform user +echo Creating $outfile + +#Create the rep file complete with headers. +case $representation in + input) + name=mttu + arraycode=$representation + ;; + logic) + name=mttx + ;; + numpar) + name=mttpar + arraycode=$representation + ;; + simpar) + ;; + state) + name=mttx + arraycode=$representation + ;; + *) + echo Representation $representation not supported + exit + #echo "function $name = $1_$2$arg" > $outfile + #echo "%% $2 file ($1_$2.m)" >> $outfile + #echo "%% Generated by MTT at `date`" >> $outfile + #echo "% Global variable list" >> $outfile + #sympar2global_txt2m $1 >> $outfile + ;; +esac + +# Generate the header +mtt_header $system $representation m > $outfile + +## Special for logic rep +if [ "$representation" = "logic" ]; then + echo >> $outfile + echo "## Inputs" >> $outfile + mtt_name2array $system input >> $outfile # Set up input by name + echo >> $outfile + echo "## States" >>$outfile + mtt_name2array $system state >> $outfile # Set up state by name +fi + +## Special for input rep +if [ "$representation" = "input" ]; then + echo >> $outfile + echo "## States" >>$outfile + mtt_name2array $system state >> $outfile # Set up state by name +fi + +## Special for simpar rep +if [ "$representation" = "simpar" ]; then + cat >> $outfile<> $outfile +echo "## User defined code from $1_$2.txt" >> $outfile +cat $1_$2.txt | strip_comments | grep -v METHOD |\ +gawk -F# 'BEGIN{ +quote = "\047"; +doublequote = "\042"; +} +{ + N=split($1,a,"="); + if (N==2) { + LHS = a[1]; + RHS = a[2]; + gsub(quote, doublequote, RHS); + sub(/^[ ]*FIRST/, "MTTsimpar.FIRST", LHS); + sub(/^[ ]*DT/, "MTTsimpar.DT", LHS); + sub(/^[ ]*LAST/, "MTTsimpar.LAST", LHS); + sub(/^[ ]*STEPFACTOR/, "MTTsimpar.STEPFACTOR", LHS); + sub(/^[ ]*METHOD/, "MTTsimpar.METHOD", LHS); + sub(/^[ ]*WMIN/, "MTTsimpar.WMIN", LHS); + sub(/^[ ]*WMAX/, "MTTsimpar.WMAX", LHS); + sub(/^[ ]*WSTEPS/, "MTTsimpar.WSTEPS", LHS); + sub(/^[ ]*INPUT/, "MTTsimpar.input", LHS); + LHS = tolower(LHS); + RHS = tolower(RHS); + sub(/["]*euler["]*/, 1, RHS); + sub(/["]*implicit["]*/, 2, RHS); + statement = sprintf("%s= %s",LHS,RHS); + if ( (match(statement,";")==0)&&\ + ((match(statement,"if ")==0))&&\ + ((match(statement,"for ")==0)) ) + statement = sprintf("%s;", statement); + } + else if (match($1,"global")==1) { + statement = tolower($1); # Lower case globals as well + } + else + statement = $1; + + if (NF<2) print " " statement + if (NF>1) print statement " # " $2 +}' | sed\ + -e 's/\[\([0-9]*\)\]/(\1)/g' \ + -e 's/\([^a-zA-Z_0-9]\)t\([^a-zA-Z_0-9]\)/\1mttt\2/g' \ + -e 's/\([^a-zA-Z_0-9]\)x(/\1mttx(/g' \ + -e 's/\([^a-zA-Z_0-9]\)u(/\1mttu(/g' \ + -e 's/mttmtt/mtt/g' \ +| tolower >> $outfile + +if [ -n "$arraycode" ]; then + new_style=`strip_comments < $1_$2.txt| grep "$name(">/dev/null; echo $?` + + if [ "$new_style" = "1" ]; then + echo >> $outfile + echo " ## Set up the $name vector" >> $outfile + ## echo " $name = []; # Default to empty matrix (Remove in mtt_m2p)" >> $outfile + mtt_name2array $1 $arraycode set >> $outfile + else + echo "Old-style file detected: not creating array translations" + fi +fi + +## Special for logic rep +if [ "$representation" = "logic" ]; then + echo >> $outfile + echo "## Open switches" >> $outfile + switch_txt2m $system | tolower >> $outfile +fi + +# End of the function +echo '## END Code' >> $outfile +echo 'endfunction' >> $outfile + ADDED mtt/bin/trans/mtt_uncompress.sh Index: mtt/bin/trans/mtt_uncompress.sh ================================================================== --- mtt/bin/trans/mtt_uncompress.sh +++ mtt/bin/trans/mtt_uncompress.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +file=$1 + +gzip --test --quiet $file 2> /dev/null ; file_is_uncompressed=$? + +if [ $file_is_uncompressed -eq 0 ]; then + gz=`mktemp $file.gz.tmpXXXXXX` + mv $file $gz + zcat $gz > $file +fi + ADDED mtt/bin/trans/mtt_units.sh Index: mtt/bin/trans/mtt_units.sh ================================================================== --- mtt/bin/trans/mtt_units.sh +++ mtt/bin/trans/mtt_units.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +## MTT units script - wrapper for the units program. + +# Copyright (C) 2000 by Peter J. Gawthrop + +# Arguments +sys=$1 +port=$2 +domain=$3 +effort=$4 +flow=$5 + +case ${domain} in + electrical) + base_effort=volt + base_flow=amp + ;; + translational) + base_effort='newton' + base_flow='m/s' + ;; + rotational) + base_effort='newton*m' + base_flow='radian/s' + ;; + fluid) + base_effort='Pa' + base_flow='m^3/s' + ;; + thermal) + base_effort='degK' + base_flow='watt/degK' + + ;; + *) + echo ${sys} ${port} DOMAIN_ERROR invalid domain ${domain} + exit 1 +esac + +get_unit() +{ + if [ "$2" == "none" ]; then + echo 1 + else + factor=`units $2 $3 | head -1 | sed 's/\*//'` + if [ `echo $factor | wc -w` = "1" ]; then + echo $factor + else + echo $1_UNIT_ERROR unit $2 not compatible with domain ${domain} + fi + fi +} +## Check effort and flow for comptability + find factor +effort_factor=`get_unit EFFORT $effort $base_effort` +flow_factor=`get_unit FLOW $flow $base_flow` + +echo ${sys} ${port} ${effort_factor} ${flow_factor} ADDED mtt/bin/trans/mtt_update Index: mtt/bin/trans/mtt_update ================================================================== --- mtt/bin/trans/mtt_update +++ mtt/bin/trans/mtt_update @@ -0,0 +1,309 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: mtt_update +# Generates Updates core representations +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.23 2005/02/17 18:54:23 geraint +## Fixed a bash-sim: replaced let with $(( )) +## +## Revision 1.22 2003/08/19 13:08:44 gawthrop +## Ingnore if/endif +## +## Revision 1.21 2003/08/14 10:33:46 gawthrop +## Ignore if and endif +## +## Revision 1.20 2003/08/13 15:49:39 gawthrop +## Don't sort the states when defaulting - leave in implied order +## +## Revision 1.19 2003/08/05 15:29:36 gawthrop +## Now handles ss.r files with implicit zero values +## +## Revision 1.18 2003/08/04 09:10:30 gawthrop +## Now handles steady-state computation for _state.txt. +## +## Revision 1.17 2002/04/28 18:41:27 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.16 2000/10/17 13:45:18 peterg +## split up state and input - different defaults +## +## Revision 1.15 2000/10/17 09:53:05 peterg +## More on logic rep +## +## Revision 1.14 2000/10/17 08:36:56 peterg +## Included logic rep. +## +## Revision 1.13 2000/10/15 09:27:13 peterg +## Better way of generating $infofile +## +## Revision 1.12 2000/10/14 16:11:00 peterg +## Made all variables, states etc lower case +## +## Revision 1.11 2000/10/13 11:07:00 peterg +## Added initialisation for state and input +## +## Revision 1.10 2000/10/13 10:56:07 peterg +## Now uses the full name from the struc file - no need to recreate. +## +## Revision 1.9 2000/10/13 09:55:09 peterg +## Changed state/input name to $4_$3 +## +## Revision 1.8 2000/10/13 09:28:16 peterg +## Changed regexp to /\(.*$old.*=\)/ +## +## Revision 1.7 2000/10/13 08:56:51 peterg +## Output variables as column, not row. +## +## Revision 1.6 2000/10/13 08:07:24 peterg +## Added state and input - it checks against sympar as well so that +## defined variables may be used here. +## +## Revision 1.5 2000/10/12 19:24:55 peterg +## Corrected output message +## +## Revision 1.4 2000/10/12 17:57:34 peterg +## Fixed header typos +## +## Revision 1.3 2000/10/12 15:11:30 peterg +## Added the update switch +## +## Revision 1.2 2000/10/12 13:45:13 peterg +## Put in the no-file version +## +## Revision 1.1 2000/10/12 12:32:23 peterg +## Initial revision +## +## +############################################################### + + +sys=$1 # System name +rep=$2 # System representation +update=$3 # Update or not +date=`date` + +if [ -z "$2" ]; then + echo Usage mtt_update system representation [update] + exit +fi + +## Extract initial value from steady-state information +initial_value() { + i=$1 + default=$2 + ssfile=${sys}_ss.r + if [ "${rep}" = "state" ]; then + if [ -f "${ssfile}" ]; then + count=`grep -c "^MTTx($i" ${ssfile}`; # See if its there + if [ $count = "1" ]; then + value=`grep "^MTTx($i" ${ssfile}| sed 's/ //g' | gawk -F '=' '{print substr($2,1,length($2)-2)}'` + else + value="0.0" + fi + else + value=${default} + fi + else + value=${default} + fi +} + +## Remove if, end and endif from list +remove_if() { + file=$1 + if [ -f ${file} ]; then + tmpfile="$1_tmp" + + mv ${file} ${tmpfile} + grep -v 'if[ (]\|endif;' <${tmpfile} > ${file} + + ## Delete empty file + size=`ls -s ${file} | awk '{print $1}'` + if [ "${size}" = "0" ]; then + rm $file + fi + fi + } + rm -f mtt_empty + touch mtt_empty + + case $rep in + numpar) + lang=txt + textfile=$1_$2.$lang + infofile=$1_sympar.$lang + moreinfofile=$infofile + default='1.0' + ;; + input) + lang=txt + textfile=$1_$2.$lang + infofile=mtt_list.$lang + moreinfofile=mtt_list_numpar.$lang + gawk '{if ($1==rep) printf("%s\n", $4)}' rep=$2 \ + <$1_struc.txt >$infofile + cat $infofile $1_sympar.$lang> $moreinfofile + default='1.0' + ;; + state) + lang=txt + textfile=$1_$2.$lang + infofile=mtt_list.$lang + moreinfofile=mtt_list_numpar.$lang + gawk '{if ($1==rep) printf("%s\n", $4)}' rep=$2 \ + <$1_struc.txt >$infofile + cat $infofile $1_sympar.$lang> $moreinfofile + default='0.0' + ;; + logic) + lang=txt + textfile=$1_$2.$lang + infofile=mtt_list.$lang + moreinfofile=mtt_list_numpar.$lang + gawk '{if ($3=="MTT_SWITCH") printf("%s_logic\n", $4)}' rep=$2 \ + <$1_struc.txt >$infofile + cat $infofile $1_sympar.$lang> $moreinfofile + default='1.0' + ;; + *) + echo Representation $rep not implemented + exit + esac + + # Create a string containing the variables + if [ -f "$textfile" ]; then + # Inform User + echo Checking $textfile + else + echo Creating $textfile + mtt_header $sys $rep $lang > $textfile + if [ "${rep}" = "state" ]; then + info=`cut -f1 $infofile` # No sort + else + info=`cut -f1 $infofile | sort` # Sort + fi + i=0; + for new in $info; do + i=$(( $i + 1 )); + initial_value $i ${default} + echo $new $value |\ + gawk '{printf("%s\t= %s; # Default\n",$1,$2)}' >> $textfile + done + exit + fi + + # Remove tmp files + rm -f mtt_in_text mtt_in_info + + # Strip files + strip_comments <$textfile | tr 'A-Z' 'a-z' >mtt_text + strip_comments <$infofile | tr 'A-Z' 'a-z' >mtt_info + strip_comments <$moreinfofile | tr 'A-Z' 'a-z' >mtt_moreinfo + + # Use awk to check file + gawk '{ + if (FILENAME=="mtt_text") { + gsub("[\t ]" ,""); # Remove whitespace + split($0,a,"="); + text[a[1]] = a[2]; + } + if (FILENAME=="mtt_info"){ + info[$1] = Default; + } + if (FILENAME=="mtt_moreinfo"){ + moreinfo[$1] = Default; + } + } + END{ + # for (iname in info) print iname + for (tname in text) { + if (!(tname in moreinfo)) print tname >> "mtt_in_text" + } + for (iname in info) { + if (!(iname in text)) print iname >> "mtt_in_info" + } + }' Default=$default mtt_text mtt_info mtt_moreinfo + + ## Remove if, end and endif from list + remove_if mtt_in_text + +if [ -z "$update" ]; then + if [ -f "mtt_in_text" ]; then + echo "The following variables are defined in $textfile, but do not exist:" + sort mtt_in_text | gawk '{printf("\t%s\n",$1)}' + echo Use mtt $sys $rep $lang to update + fi + if [ -f "mtt_in_info" ]; then + echo "The following variables exist, but are not defined in $textfile:" + sort mtt_in_info | gawk '{printf("\t%s\n",$1)}' + echo Use mtt $sys $rep $lang to update + fi + exit +fi +answered='' +if [ -f "mtt_in_text" ]; then + in_text=`sort mtt_in_text` + echo "The following variables are defined in $textfile, but do not exist:" + sort mtt_in_text | gawk '{printf("\t%s\n",$1)}' + + + while [ -z "$answered" ]; do + echo "Update $textfile (y/n)?" + read answer < /dev/tty + case $answer in + y) + answered=yes + for old in $in_text; do + echo Commenting out $old + sed "s/\(.*$old.*=\)/## Removed by MTT on $date: \1/I"\ + <$textfile > mtt_tmp + mv mtt_tmp $textfile + changed=yes + done + ;; + n) + answered=yes + ;; + *) + esac + done +fi + +answered='' +if [ -f "mtt_in_info" ]; then + echo "The following variables exist, but are not defined in $textfile:" + sort mtt_in_info | gawk '{printf("\t%s\n",$1)}' + + while [ -z "$answered" ]; do + echo "Update $textfile (y/n)?" + read answer < /dev/tty + case $answer in + y) + answered=yes + in_info=`sort mtt_in_info` + for new in $in_info; do + echo Adding $new + echo $new $default |\ + gawk '{printf("%s\t= %s; # Added by MTT on %s\n",$1,$2,strftime())}'\ + >> $textfile + changed=yes + done + ;; + n) + answered=yes + ;; + *) + esac + done +fi ADDED mtt/bin/trans/mtt_vectorise Index: mtt/bin/trans/mtt_vectorise ================================================================== --- mtt/bin/trans/mtt_vectorise +++ mtt/bin/trans/mtt_vectorise @@ -0,0 +1,7 @@ +#!/bin/sh +# Vectorises the matrix output of reduce ie converts (n,1) to (n) +# Copyright (C) 2000 by Peter J. Gawthrop + +sed 's/mtt\([a-z]*\)(\([0-9]*\),1)/mtt\1(\2)/g' + + ADDED mtt/bin/trans/multi_command Index: mtt/bin/trans/multi_command ================================================================== --- mtt/bin/trans/multi_command +++ mtt/bin/trans/multi_command @@ -0,0 +1,32 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: multi_command + +# Copyright (c) P.J.Gawthrop 1996. + +# creates a list of commands - one for each file matching $2_*_$3 +# Each command is of the form $1 $2_*_$3 & + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2.4.1 2001/06/28 22:58:27 geraint +## Using mtt_xargs.sh to prevent Arg list too long error. +## +## Revision 1.2 1996/11/09 21:16:06 peterg +## *** empty log message *** +## +# Revision 1.1 1996/10/21 12:31:40 peterg +# Initial revision +# +############################################################### + + +(mtt_xargs.sh "ls" "$2*_$3" \ +| sed "s/\(.*_*\)$3/$1 \1$3 \&/") ADDED mtt/bin/trans/n2m Index: mtt/bin/trans/n2m ================================================================== --- mtt/bin/trans/n2m +++ mtt/bin/trans/n2m @@ -0,0 +1,23 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: n2m +# Gives sting of integers from n to m (n<=m) +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +i=`expr $1 - 1` + +while [ "$i" != "$2" ]; do + i=`expr $i + 1` + echo $i +done ADDED mtt/bin/trans/name2index Index: mtt/bin/trans/name2index ================================================================== --- mtt/bin/trans/name2index +++ mtt/bin/trans/name2index @@ -0,0 +1,59 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: name2index + +# Converts names to array index + +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 2000/11/27 18:06:33 peterg +## *** empty log message *** +## +## Revision 1.4 1997/12/04 22:10:18 peterg +## Handles argument list - variable names. +## +## Revision 1.3 1997/05/22 09:42:48 peterg +## Returns 0 if no names. +## +## Revision 1.2 1997/05/22 09:28:22 peterg +## Removed trailing , in output. +## +## Revision 1.1 1997/05/22 08:48:21 peterg +## Initial revision +## +############################################################### + +gawk ' +{ + name_index[$4]=$2; +} +END{ + M=split(names,xynames,":"); + if (M==0) + printf("0\n") + else + { + if (M==1) + printf("1,"); + else { + printf("%i,",name_index[xynames[1]]+1); + names=xynames[2] + } + + N=split(names,Names,","); + for (i=1; i ${outfile}_1 +%% File ${outfile} generated on `date` from ${infile} +%% All parameters replaced by numbers except for: +%% ${pars} + +EOF + +sed 's/#/%/g' < ${infile} | sed 's/=/:=/' >> ${outfile}_1 + +cat >> ${outfile}_1 < ${outfile} + +rm ${outfile}_1 + ADDED mtt/bin/trans/numpar_txt2c Index: mtt/bin/trans/numpar_txt2c ================================================================== --- mtt/bin/trans/numpar_txt2c +++ mtt/bin/trans/numpar_txt2c @@ -0,0 +1,68 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: numpar_txt2c + +# Numerical parameters to c format +# P.J.Gawthrop May 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2000/12/28 12:52:13 peterg +## *** empty log message *** +## +## 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 |\ +gawk -F# '{ + if (NF<2) print $1 + if (NF>1) print $1 "/* " $2 " */" +}' | sed 's/(\([0-9]*\))/[\1]/' >> $1_numpar.c + +echo '}' >> $1_numpar.c + + ADDED mtt/bin/trans/numpar_txt2m Index: mtt/bin/trans/numpar_txt2m ================================================================== --- mtt/bin/trans/numpar_txt2m +++ mtt/bin/trans/numpar_txt2m @@ -0,0 +1,49 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: numpar_txt2m +# Creates the deafault numerical parameters file for the system (txt) + +# Copyright (c) P.J.Gawthrop 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 2000/12/28 12:52:22 peterg +## *** empty log message *** +## +## 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. +gawk -F# '{ + if (NF==1) print $1 + if (NF==2) print $1 "# " $2 +}' $1_numpar.txt |\ +sed 's/double/global/' >> $1_numpar.m + + ADDED mtt/bin/trans/obs_r2m Index: mtt/bin/trans/obs_r2m ================================================================== --- mtt/bin/trans/obs_r2m +++ mtt/bin/trans/obs_r2m @@ -0,0 +1,136 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: obs_r2m +# Reduce GPC obs function to matlab +# P.J.Gawthrop 18 May 1991, 12 Jan 1994, April 1994, Dec 1994, July 1995 +# Copyright (c) P.J.Gawthrop 1991, 1994. + +# Inform user +echo Creating $1_obs.m + +# Remove the old log file +rm -f obs_r2m.log +rm -f $1_obs.m? +rm -f $1_obsa.m + +# Is the system affine (look in the _obs.r file +affine=`grep 'affine :=' $1_obs.r | gawk '{print $3}' | sed 's/;//'` + + +# Use reduce to accomplish the transformation +$SYMBOLIC >obs_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; + +%Set default values - reset by obspar file. +MTTGPCNy := 2; +MTTGPCNu := 0; + +%Read the parameters file +in "$1_obspar.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the reduce state-space equations file +in "$1_obs.r"; + + +ON BigFloat, NumVal; +PRECISION 16; %Compatible with Matlab +OFF Nat; + +ON NERO; % Suppress zero elements + +% Matrix output function +in"$MTTPATH/trans/matlab_matrix.r"; + +OUT "$1_obs.m2"; + +write "% Set up the State variables"; +FOR i := 1:MTTNx DO +BEGIN + write "mttx", i, " = x(", i, ");"; +END; + +IF affine=0 THEN +BEGIN +write "%"; +write "% Set up the inputs and input derivatives"; +FOR i := 1:MTTNu DO + BEGIN + write "mttu", i, " = u(", i, ",1);"; + FOR j := 1:MTTGPCNu DO + BEGIN + write "mttu", i,j, " = u(", i, ",", j+1, ");"; + END; + END; + +%write "%"; +%write "% Set up the Y matrix"; +%write "Y = zeros(", mtt_matrix_n, ",1);"; +END; + + +SHUT "$1_obs.m2"; + +IF affine=1 THEN +BEGIN + GENTRANOUT "$1_obs.m3"; + MTT_Matrix := MTTObs_o$ + MTT_Matrix_name := "MTTO_o"$ + MTT_Matrix_n := (MTTGPCNY+1)*MTTNy$ + MTT_Matrix_m := 1$ + matlab_Matrix()$ + GENTRAN O_o := mtt_matrix; + + MTT_Matrix := MTTObs_h$ + MTT_Matrix_name := "MTTO_h"$ + MTT_Matrix_n := (MTTGPCNy+1)*MTTNy$ + MTT_Matrix_m := (MTTGPCNu+1)*MTTNu$ + matlab_Matrix()$ + GENTRAN O_h := mtt_matrix; + + GENTRANSHUT "$1_obs.m3"; +END +ELSE +BEGIN + GENTRANOUT "$1_obs.m3"; + mtt_matrix := MTTYY$ + mtt_matrix_n := MTTNY*(MTTGPCNy+1)$ + mtt_matrix_m := 1$ + mtt_matrix_name := Y$ + matlab_matrix(); + GENTRAN YY := mtt_matrix; + GENTRANSHUT "$1_obs.m3"; +END; + +EOF + +if [ "$affine" = "1" ]; then + lang_header $1 obs m x [o_o,o_h] > $1_obs.m1 +else + lang_header $1 obs m x,u yy > $1_obs.m1 +fi + +# Put together the pieces +matlab_tidy $1_obs.m2 +matlab_tidy $1_obs.m3 +cat $1_obs.m? >$1_obs.m + +rm -f $1_obs.m? + + + + + + + ADDED mtt/bin/trans/obs_r2tex Index: mtt/bin/trans/obs_r2tex ================================================================== --- mtt/bin/trans/obs_r2tex +++ mtt/bin/trans/obs_r2tex @@ -0,0 +1,92 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: obs_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.1 1998/04/07 08:30:20 peterg +## Initial revision +## +# 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_obs.tex + +# Remove the old log file +rm -f obs_r2tex.log + +# Use reduce to accomplish the transformation +reduce >obs_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the obs file +in "$1_obs.r"; + +%Read the Obs function parameters +in "$1_obspar.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification parameters +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; +OFF EXP; + +OUT "$1_obs.tex"; + +% Write the affine form +IF affine=1 THEN +BEGIN + MTT_Matrix := MTTObs_o$ + MTT_Matrix_name := "MTTO_o"$ + MTT_Matrix_n := (MTTGPCNY+1)*MTTNy$ + MTT_Matrix_m := 1$ + LaTeX_Matrix()$ + + MTT_Matrix := MTTObs_h$ + MTT_Matrix_name := "MTTO_h"$ + MTT_Matrix_n := (MTTGPCNy+1)*MTTNy$ + MTT_Matrix_m := (MTTGPCNu+1)*MTTNu$ + LaTeX_Matrix()$ +END +ELSE +BEGIN +% Write the obs vector (YY) + MTT_Matrix := MTTYY$ + MTT_Matrix_name := "MTTO"$ + MTT_Matrix_n := (MTTGPCNY+1)*MTTNy$ + MTT_Matrix_m := 1$ + LaTeX_Matrix()$ +END; + +SHUT "$1_obs.tex"; +quit; +EOF ADDED mtt/bin/trans/octave_ode2odes Index: mtt/bin/trans/octave_ode2odes ================================================================== --- mtt/bin/trans/octave_ode2odes +++ mtt/bin/trans/octave_ode2odes @@ -0,0 +1,51 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: octave_ode2odes +# Runs the Octave script $1_ode2odeso.m +# Copyright (c) P.J.Gawthrop 1999 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2005/04/26 22:52:26 geraint +## The Octave load/save -ascii option is deprecated in favour of -text +## +## Revision 1.5 2002/05/07 10:13:48 gawthrop +## Files marked by update as out of sync +## +## Revision 1.4 2001/03/30 15:13:58 gawthrop +## Rationalised simulation modes to each return mtt_data +## +## Revision 1.3 2000/05/19 17:47:56 peterg +## Agument to state +## +## Revision 1.2 2000/05/11 13:43:14 peterg +## No change +## +## Revision 1.1 1999/03/15 23:27:16 peterg +## Initial revision +## +############################################################### + + +echo Creating $1_odes.dat2 +$MATRIX <octave_ode2odes.log 2>mtt_error.txt + ## Set up the simulation parameters + par = $1_numpar; + x_0 = $1_state(par); + simpar = $1_simpar + mtt_data = $1_ode2odes(x_0,par,simpar); + if iscomplex(mtt_data) + mtt_error("octave_ode2odes: Simulated data is complex - something is wrong!"); + mtt_data = real(mtt_data); + endif; + save -text $1_odes.dat2 mtt_data +EOF + +mtt_error mtt_error.txt ADDED mtt/bin/trans/ode2obs_r Index: mtt/bin/trans/ode2obs_r ================================================================== --- mtt/bin/trans/ode2obs_r +++ mtt/bin/trans/ode2obs_r @@ -0,0 +1,253 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode2obs_r +# Odrinary differential equations to observer function equations +# P.J.Gawthrop 14 June 1991, 8 Aug 1991, 2 April 1992, 14 April 1994, 28 Dec 94, +# 12th July 1995, April 1996 +# Copyright (c) P.J.Gawthrop 1991, 1992, 1994, 1995, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 1998/04/07 08:12:12 peterg +## Added affine form. +## +## Revision 1.4 1998/04/07 05:45:12 peterg +## Reverted to an older version due to untraceable bug in new version +## +## Revision 1.3 1996/08/25 10:07:05 peter +## Remove a du state ment causaing touble +## - but needs more work. +## +## Revision 1.2 1996/08/25 08:38:14 peter +## Error handling added. +## +## Revision 1.1 1996/08/25 08:37:44 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_obs.r + +# Remove the old log file +rm -f ode2obs_r.log + +# Use reduce to accomplish the transformation +reduce >ode2obs_r.log << EOF + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + + +OFF Echo; +OFF Nat; +ON NERO; + +in "$1_def.r"; +MTTdxs := MTTdX; %Save the symbolic form of dX + +%Set default values - reset by obspar file. +MTTGPCNy := 2; +MTTGPCNu := 0; + +%%in "$1_sympar.r"; +in "$1_ode.r"; +%%in "$1_simp.r"; + +% Read the obs form parameters. +in "$1_obspar.r"; + +%Create the U vector of input derivatives. +MTTNuu := (MTTGPCNu+1)*MTTNu; +MTTNuu1 := MTTGPCNu*MTTNu; + + +%FOR i := 1:MTTNu DO +% MTTUU(i,1) := MTTU(i,1); +%END; +% +%IF MTTGPCNu>0 THEN +%BEGIN +% FOR i := 1:MTTNu DO +% MTTUU(i+MTTNu,1) := MTTdU(i,1); +% END; +%END; + +MTTU := MTTU; +MTTdU := MTTdU; % ---- removed temporarily, needs def file change? + +%Create the Y vector of output derivatives. +MTTNyy := (MTTGPCNy+1)*MTTNy; +Matrix MTTYY(MTTNyy,1); + +FOR i := 1:MTTNy DO + MTTYY(i,1) := MTTY(i,1); +END; + +l := MTTNy; +FOR i := 1:MTTGPCNy DO + FOR j := 1:MTTNy DO + BEGIN + l := l+1; + MTTYY(l,1) := 0; + FOR k := 1:MTTNx DO %Derivatives wrt x + BEGIN + xk := MTTX(k,1); + MTTYY(l,1) := MTTYY(l,1) + df(MTTYY(l-MTTNy,1), xk, 1)*MTTdX(k,1); + END; + IF MTTGPCNu>0 THEN + FOR k := 1:MTTGPCNu DO %Non-zero derivatives of u + BEGIN + FOR kk := 1:MTTNu DO + BEGIN + uk := MTTUU(kk,k); + MTTYY(l,1) := MTTYY(l,1) + df(MTTYY(l,1), uk, 1)*MTTUU(1,k+1); + END; + END; + END; +END; + +%%Create O_x - derivative of YY wrt x +%Matrix MTTO_x(MTTNyy,MTTNx); +%FOR j := 1:MTTNx DO +% BEGIN +% xj := MTTX(j,1); +% FOR i := 1:MTTNyy DO +% BEGIN +% MTTO_x(i,j) := df(MTTYY(i,1), xj); +% END; +% END; + +%%Create O_u - derivative of YY wrt u (Assumes GPC Nu = 0) +%MTTNNu := (MTTGPCNu+1)*MTTNu; +%Matrix MTTO_u(MTTNyy,MTTNNu); +%FOR j := 1:MTTNNu DO +% BEGIN +% uj := MTTu(j,1); +% FOR i := 1:MTTNyy DO +% BEGIN +% MTTO_u(i,j) := df(MTTYY(i,1), uj); +% END; +% END; + + +%%Create O_uu - derivative of O_u wrt u (Assumes GPC Nu = 0) +%%This is a multi-dimensional matrix kth elements stacked sideways. +%Matrix MTTO_uu(MTTNyy,MTTNNu*MTTNNu); +%FOR k := 1:MTTNNu DO +% BEGIN +% uk := MTTu(k,1); +% FOR j := 1:MTTNNu DO +% BEGIN +% FOR i := 1:MTTNyy DO +% BEGIN +% jk := j+(k-1)*MTTNu; +% MTTO_uu(i,jk) := df(MTTO_u(i,j), uk); +% END; +% END; +% END; + +%%Create O_ux - derivative of O_u wrt x +%%This is a multi-dimensional matrix kth elements stacked sideways. +%Matrix MTTO_ux(MTTNyy,MTTNu*MTTNx); +%FOR k := 1:MTTNx DO +% BEGIN +% xk := MTTx(k,1); +% FOR j := 1:MTTNu DO +% BEGIN +% FOR i := 1:MTTNyy DO +% BEGIN +% jk := j+(k-1)*MTTNu; +% MTTO_ux(i,jk) := df(MTTO_u(i,j), xk); +% END; +% END; +% END; + + +% Try and split the obs function into affine form (O(x,u) = o(x) + h(x)u) +affine := 1; +MTTNuu := (MTTGPCNu+1)*MTTNu; +write "1 affine := ", affine, ";"; + +%IF (affine=1) THEN +%BEGIN + MATRIX MTTObs_o(MTTNyy,1); + MATRIX MTTObs_h(MTTNyy,MTTNuu); +write "2 affine := ", affine, ";"; + FOR i := 1:MTTNyy DO + BEGIN +write "3 affine := ", affine, ";"; + MTTObs_o(i,1) := MTTYY(i,1); + k := 0; + FOR j := 1:MTTNu DO + FOR jj := 0:MTTGPCNu DO + BEGIN + k := k+1; + %Expand as polynomial in u_j^[jj] + coeffs := coeff(MTTObs_o(i,1), MTTUU(j,jj+1)); + MTTObs_o(i,1) := first(coeffs); + IF length(coeffs)>1 THEN + MTTObs_h(i,k) := second(coeffs); + IF length(coeffs)>2 THEN + affine := -1; + END; + END; +%END; + + +%%Create the _obs.r file +OUT "$1_obs.r"; + +IF affine=1 THEN + write "affine := 1; % The O function is affine in u" +ELSE + write "affine := 0; % The O function is not affine in u"; + + +write "% The matrix sizes"; +write "MTTNyy := ", MTTNyy, ";"; +write "MTTNuu := ", MTTNuu, ";"; + +mtt_matrix := MTTYY$ +mtt_matrix_n := MTTNyy$ +mtt_matrix_m := 1$ +mtt_matrix_name := "MTTYY"$ +reduce_matrix(); + +IF affine=1 THEN +BEGIN + mtt_matrix := MTTObs_o$ + mtt_matrix_n := MTTNyy$ + mtt_matrix_m := 1$ + mtt_matrix_name := "MTTObs_o"$ + reduce_matrix(); + + mtt_matrix := MTTObs_h$ + mtt_matrix_n := MTTNyy$ + mtt_matrix_m := MTTNuu$ + mtt_matrix_name := "MTTObs_h"$ + reduce_matrix(); +END; + +%MTTO_x := MTTO_x; +%MTTO_u := MTTO_u; +%MTTO_uu := MTTO_uu; +%MTTO_ux := MTTO_ux; + +write ";END;"; + +SHUT "$1_obs.r"; +quit; + +EOF + +# Now invoke the standard error handling. +mtt_error_r ode2obs_r.log + ADDED mtt/bin/trans/ode2odes_m Index: mtt/bin/trans/ode2odes_m ================================================================== --- mtt/bin/trans/ode2odes_m +++ mtt/bin/trans/ode2odes_m @@ -0,0 +1,229 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode2odes_m + +# Transforms descriptor matrix rep to step response + +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.17 1998/06/27 14:49:16 peterg +## No change +## +## Revision 1.16 1998/06/25 08:47:23 peterg +## Put correct arguments for _input -- (x,t) +## +## Revision 1.15 1998/05/21 16:20:27 peterg +## Modified to include explicit algebraic loop solution +## +## Revision 1.14 1998/05/19 19:48:02 peterg +## Read the simpar file now. +## +## Revision 1.13 1998/05/14 08:05:10 peterg +## Put back under RCS +## +## Revision 1.12 1998/02/25 18:02:39 peterg +## Removed the argument passing stuff . +## Replaced by the simpar.m method. +## +## Revision 1.11 1997/08/29 07:56:54 peterg +## Minor updates +## +# Revision 1.10 1997/01/07 09:16:03 peterg +# Added step_factor parameter - gives that number of integration steps +# per sample. +# +## Revision 1.9 1997/01/06 21:36:44 peterg +## Fixed bug mtt_error --> mtt_error.txt +## Replaced lsode by Euler integration. +## +## Revision 1.8 1996/09/13 17:54:08 peter +## Now writes default $PARAMS to $1_args.m - $1_ode may use it. +## +## Revision 1.7 1996/09/12 18:41:48 peter +## Standard error handling added. +## +## Revision 1.6 1996/08/24 14:11:04 peter +## Global parameter passing. +## +## Revision 1.5 1996/08/18 12:01:26 peter +## Unified format of time responses. +## +## Revision 1.4 1996/08/16 13:04:46 peter +## Fixed problem with more than one output (y vector). +## +## Revision 1.3 1996/08/16 06:36:03 peter +## Removed u from default arg list. +## +## Revision 1.2 1996/08/15 16:24:43 peter +## Uses T in place of t to avoid name clash within function. +## +## Revision 1.1 1996/08/15 11:56:38 peter +## Initial revision +## +############################################################### + +echo Creating $1_odes.m +echo Creating $1_odeso.m + +rm -f ode2odes_m.log +rm -f mtt_error.txt + +#if [ "$2" = "" ]; +#then +# PARAMS='T=[0:0.1:10]; x0=zeros(nx,1);' +# echo Using default parameter $PARAMS +# echo $PARAMS>$1_args.m +#else +# PARAMS=$2; +#fi + +# PARAMS="$PARAMS ;" + + +$MATRIX --verbose << EOF > ode2odes_m.log 2>mtt_error.txt + + %System structure + [nx,ny,nu,nz,nyz] = $1_def; + + %Read in parameters + $1_numpar; + + %Read in state + x = $1_state; + + %Set the initial output + %if ny>0 + % y = $1_odeo(x,0); + %end; + + %Read in simulation parameters + $1_simpar; + T = [0:DT:LAST]; + + t=0; %Just in case it appears in the parameter list. + + + %Defaults + if exist('T')==0 + T=[0:1:100] + end; + + if exist('METHOD')==0 + METHOD = 'Euler' + end; + + if exist('x')==0 + x = zeros(nx,1); + end; + + % xx is the composite vector containing x and the internal inputs. + xx = [x; zeros(nyz,1)]; + + [n,m]=size(T); + if m>n + T=T'; + end; + +method = tolower(METHOD) + +if nx>0 + if strcmp(method,'lsode') + X = lsode('$1_ode', x, T); + elseif strcmp(method,'euler') + %Euler integration + disp("Euler") + X=[]; + dt = (T(2)-T(1))/STEPFACTOR; + for t=T' + X = [X; xx']; + ts = t; + for i=1:STEPFACTOR + x = xx(1:nx); + u = $1_input(xx,ts); + xx = $1_ode(xx,u,ts); + ts = ts + dt; + dx = xx(1:nx); + x = x + dx*dt; + xx(1:nx) = x; + end; + end; + elseif strcmp(method,'implicitl') + %Euler integration + X=[]; + dt = (T(2)-T(1))/STEPFACTOR; + u = $1_input(x,u,t); + A = $1_smx(x,u); + inverse = inv(eye(nx) - dt*A); + for t=T' + X = [X; xx']; + ts = t; + u = $1_input(x,t); + for i=1:STEPFACTOR + x = xx(1:nx); + xx = $1_ode(xx,u,ts); + ts = ts + dt; + dx = xx(1:nx); + x = inverse*(x + dt*(dx - A*x)); + xx(1:nx) = x; + end; + end; + elseif strcmp(method,'implicit') + %Euler integration + X=[]; + dt = (T(2)-T(1))/STEPFACTOR; + One = eye(nx); + for t=T' + X = [X; xx']; + ts = t; + for i=1:STEPFACTOR + x = xx(1:nx); + u = $1_input(x,t); + A = $1_smx(x,u); + xx = $1_ode(xx,u,ts); + ts = ts + dt; + dx = xx(1:nx); + x = (One-A*dt)\(x + dt*(dx - A*x)); + xx(1:nx) = x; + end; + end; + else + error('Method %s not available here', METHOD); + return; + end; + write_matrix([T,X], '$1_odes'); +else + X = zeros(size(T)); +end; + +if ny>0 % compute y and print it + i = 0; Y=[]; + for t=T' + i = i+1; X(i,:); + u = $1_input(x,t); + y = $1_odeo(X(i,:)',u,t); + Y = [Y; y']; + end; + write_matrix([T,Y], '$1_odeso'); +end; + + +EOF + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + + + + + + ADDED mtt/bin/trans/ode2odes_r2c Index: mtt/bin/trans/ode2odes_r2c ================================================================== --- mtt/bin/trans/ode2odes_r2c +++ mtt/bin/trans/ode2odes_r2c @@ -0,0 +1,269 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode2odes_r2c +# Reduce ordinary differential equations to differential-algebraic +# equations solution in the form of a c program. + +# Euler integration of the state is included. + +# NB Arrays should are defined to be one larger than expected +# - the 0 element is not used. + +# Copyright (c) P.J.Gawthrop 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.17 1998/05/15 07:47:23 peterg +## Includes sign.c by default +## +## Revision 1.16 1998/05/14 08:25:52 peterg +## Corrected time skew. +## +## Revision 1.15 1998/05/14 08:20:29 peterg +## Start time at DT - the result at time zero is computed outside the +## loop +## +## Revision 1.14 1998/05/13 08:57:27 peterg +## Now uses simpar.h in place of odes.h +## +## Revision 1.13 1998/02/24 13:34:45 peterg +## Back under RCS +## +# Revision 1.12 1997/05/15 08:39:56 peterg +# Don't initialise states - now done in numpar file. +# +# Revision 1.11 1997/05/12 16:00:54 peterg +# Removed itime again., +# +# Revision 1.10 1997/05/10 10:05:15 peterg +# Put _input in inner loop in front of call to _ode +# +## Revision 1.9 1997/05/10 09:54:34 peterg +## Moved _input call to after the inner integration loop. +## +## Revision 1.8 1997/05/10 08:12:23 peterg +## Put second argument into _input. +## +## Revision 1.7 1997/05/10 07:01:15 peterg +## _input called in outer loop only. +## time updated in outer loop only. +## Integer time (itime) introduced and updated in outer loop - maybe +## useful for discrete events. +## Integer time (itime) passed to _input. +## +## Revision 1.6 1997/05/06 13:53:32 peterg +## Now uses the preprocessor to declare sizes -- MTTNX etc +## +# Revision 1.5 1997/05/01 13:50:11 peterg +# Replaced float by double. +# +# Revision 1.4 1997/05/01 13:43:44 peterg +# Changed double to float. +# +# Revision 1.3 1997/05/01 11:15:33 peterg +# Back under RCS +# +# Revision 1.2 1997/03/20 14:36:56 peterg +# Includes the sympar.h file +# +## Revision 1.1 1997/01/21 22:54:54 peterg +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_odes.c + +# Remove the old log file +rm -f ode_r2c.log + +# Use reduce to accomplish the transformation +reduce >ode2odes_r2c.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 symbolic parameters file +%%in "$1_sympar.r"; + +ON BigFloat, NumVal; +PRECISION 16; %Compatible with Matlab +%OFF Nat; + +ON NERO; % Suppress zero elements + +%Generate the Header part +OUT "$1_odes.c"; + +write "/*"$ +write "Program to solve ode for system $1"$ +write "NB Arrays are defined to be one larger than expected"$ +write " - the 0 element is not used."$ + +write "File $1_odes.c"$ +write "Generated by MTT"$ +write "*/"$ +write " "$ + + +%Program heading +write "#define MTTNX ", MTTNx $ +write "#define MTTNY ", MTTNy $ +write "#define MTTNU ", MTTNu $ +write "#define MTTNX1 ", MTTNx+1 $ +write "#define MTTNY1 ", MTTNy+1 $ +write "#define MTTNU1 ", MTTNu+1 $ +write "#define MTTNX2 ", MTTNx+2 $ +write "#define MTTNY2 ", MTTNy+2 $ +write "#define MTTNU2 ", MTTNu+2 $ + +write "#include "$ +write "#include "$ +write "#include ""sign.c"" "$ +write "#include ""$1_simpar.h"" "$ +write "#include ""$1_ode.c"" "$ +write "#include ""$1_input.c"" "$ +write "#include ""$1_numpar.c"" "$ +write "#include ""$1_state.c"" "$ + +%External (global) variable list +write "#include ""$1_sympar.h"" "$ + + +write "/* Declare standard arrays */"$ +write "double y[MTTNY1]; /* $1_ode output */"$ +write "double dx[MTTNX1]; /* $1_ode state derivative */"$ +write "double x[MTTNX1]; /* $1_ode state */"$ +write "double u[MTTNU1]; /* $1_ode input */"$ + + +write "/* Files */ "$ +write " FILE *fopen(), *fps, *fpso;"$ + +write "main()"$ +write " "$ +write "{"$ + + + +write "/* Counters etc*/ "$ +write " double time;"$ +write " double dt;"$ +write " int i;"$ +write " int k;"$ + +write "/*functions */ "$ +write " extern $1_numpar();"$ + +%Open the output files +write "/* %Open the output file */"$ +write "fps = fopen(""$1_odes.m"", ""w""); "$ +write "fpso = fopen(""$1_odeso.m"", ""w""); "$ + +%Set up user-defined constants +write "/* Set up user-defined constants */"$ +write " $1_numpar();"$ + +%Set up initial state +write "/* Set up initial state */"$ +write " $1_state();"$ + +%Initialise main (Euler) integration loop +write "/* Initialise main (Euler) integration loop */"$ +write " time = 0;"$ +write " dt = DT/STEPFACTOR;"$ +%% write " for (i=1; i<=MTTNX; i++)"$ +%% write " x[i] = 0.0;"$ + +%Set up system inputs +write "/* Set up system inputs */"$ +write " for (i=1; i<=", MTTNu, "; i++)"$ +write " u[i] = 1.0;"$ + +write " $1_input(0.0);"$ + +write " fprintf(fps, ""function data = ", "$1_odes \n"");"$ +write " fprintf(fps, ""data = [\n"");"$ +write " fprintf(fpso, ""function data = ", "$1_odeso \n"");"$ +write " fprintf(fpso, ""data = [\n"");"$ + +% Compute the first output +write "/* Compute the first output */"$ +write " $1_ode(y,dx,x,u);"$ + +%Main (Euler) integration loop +write "/* Main (Euler) integration loop */"$ + +write " while (time<(LAST-DT))"$ +write " {"$ + +%Write to output to file +write "/* Write to output file */"$ +write " fprintf(fpso, ""%5.4g "",time);"$ +write " for (i=1; i<=MTTNY; i++)"$ +write " fprintf(fpso, ""%5.4g "", y[i]);"$ +write " fprintf(fpso, ""\n"");"$ + +%Write to state to file +write "/* Write to state file */"$ +write " fprintf(fps, ""%5.4g "",time);"$ +write " for (i=1; i<=MTTNX; i++)"$ +write " fprintf(fps, ""%5.4g "", x[i]);"$ +write " fprintf(fps, ""\n"");"$ + +write " time = time + DT;"$ + +write "/* Inner integration loop */"$ +write " for (k=1; k<=STEPFACTOR; k++)"$ +write " {"$ +write " for (i=1; i<=MTTNX; i++)"$ +write " x[i] = x[i] + dx[i]*dt;"$ + +write " /* Set up system inputs */"$ +write " $1_input(time);"$ +write " $1_ode();"$ +write " }"$ + +write " }"$ + +%Write to files +%Write to output to file +write "/* Write to output file */"$ +write " fprintf(fpso, ""%5.4g "",time);"$ +write " for (i=1; i<=MTTNY; i++)"$ +write " fprintf(fpso, ""%5.4g "", y[i]);"$ +write " fprintf(fpso, ""\n"");"$ + +%Write to state to file +write "/* Write to state file */"$ +write " fprintf(fps, ""%5.4g "",time);"$ +write " for (i=1; i<=MTTNX; i++)"$ +write " fprintf(fps, ""%5.4g "", x[i]);"$ +write " fprintf(fps, ""\n"");"$ + + +write " fprintf(fps, ""];\n"");"$ +write " fprintf(fpso, ""];\n"");"$ + +write " return 0;"$ +write "}"$ + + +SHUT "$1_odes.c"; + + +EOF + + + ADDED mtt/bin/trans/ode2odess_m Index: mtt/bin/trans/ode2odess_m ================================================================== --- mtt/bin/trans/ode2odess_m +++ mtt/bin/trans/ode2odess_m @@ -0,0 +1,111 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode2odess_m + +# Transforms descriptor matrix rep to step response + +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 2000/10/17 11:07:59 peterg +## *** empty log message *** +## +## Revision 1.3 1998/05/19 19:27:04 peterg +## Zapped all the parameter stuff +## +## Revision 1.2 1996/09/13 19:40:51 peter +## Fixed problem with default paramaters. +## +## Revision 1.1 1996/09/12 19:26:57 peter +## Initial revision +## +## Revision 1.4 1996/08/16 13:04:46 peter +## Fixed problem with more than one output (y vector). +## +## Revision 1.3 1996/08/16 06:36:03 peter +## Removed u from default arg list. +## +## Revision 1.2 1996/08/15 16:24:43 peter +## Uses T in place of t to avoid name clash within function. +## +## Revision 1.1 1996/08/15 11:56:38 peter +## Initial revision +## +############################################################### + +echo Creating $1_odess.m +rm -f ode2odess_m.log + +Nx=`mtt_getsize $1 x` # States +Nxx=`mtt_getsize $1 xx` # States x States +Nu=`mtt_getsize $1 u` # Inputs +Ny=`mtt_getsize $1 y` # Inputs + +$MATRIX << EOF > ode2odess_m.log 2>mtt_error.txt + + %Read in parameters + par = $1_numpar; + + %Read in simulation parameters + simpar=$1_simpar; + T = [0:simpar.dt:simpar.last]; + + t=0; %Just in case it appears in the parameter list. + + + %Defaults + if exist('T')==0 + T=[0:0.1:1] + end; + + if exist('x0')==0 + x0 = zeros($Nx,1); + end; + + [n,m]=size(T); + if m>n + T=T'; + end; + +global t; +function dx=f(x) + global t + par = $1_numpar; + u = $1_input(x,zeros($Ny,1),t,par); + dx = $1_ode(x,u,t,par);; +endfunction; + +i=0; +x = x0; +for t=T' + u = $1_input(x,zeros($Ny,1),t,par); + y(i) = $1_odeo(x,u,t,par)'; + mtt_write(t,x,y,$Nx,$Ny); # Write it out + x = fsolve('f',x)'; +end; + +i=0; +for t=T' + i=i+1; +end; + +write_matrix([T,x], '$1_odess'); +write_matrix([T,y], '$1_odesso'); + +EOF + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + + + + ADDED mtt/bin/trans/ode2odess_m2dat2 Index: mtt/bin/trans/ode2odess_m2dat2 ================================================================== --- mtt/bin/trans/ode2odess_m2dat2 +++ mtt/bin/trans/ode2odess_m2dat2 @@ -0,0 +1,108 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode2odess_m + +# Transforms descriptor matrix rep to step response + +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/10/17 12:55:29 peterg +## Initial revision +## +## Revision 1.4 2000/10/17 11:07:59 peterg +## *** empty log message *** +## +## Revision 1.3 1998/05/19 19:27:04 peterg +## Zapped all the parameter stuff +## +## Revision 1.2 1996/09/13 19:40:51 peter +## Fixed problem with default paramaters. +## +## Revision 1.1 1996/09/12 19:26:57 peter +## Initial revision +## +## Revision 1.4 1996/08/16 13:04:46 peter +## Fixed problem with more than one output (y vector). +## +## Revision 1.3 1996/08/16 06:36:03 peter +## Removed u from default arg list. +## +## Revision 1.2 1996/08/15 16:24:43 peter +## Uses T in place of t to avoid name clash within function. +## +## Revision 1.1 1996/08/15 11:56:38 peter +## Initial revision +## +############################################################### + +echo Creating $1_odess.dat2 +rm -f ode2odess_m.log + +Nx=`mtt_getsize $1 x` # States +Nxx=`mtt_getsize $1 xx` # States x States +Nu=`mtt_getsize $1 u` # Inputs +Ny=`mtt_getsize $1 y` # Inputs + +$MATRIX << EOF >ode2odess_m2dat2.log 2>mtt_error.txt + + global MTT_data # Where mtt_write puts its stuff + %Read in parameters + par = $1_numpar; + + %Read in simulation parameters + simpar=$1_simpar; + T = [0:simpar.dt:simpar.last]; + + t=0; %Just in case it appears in the parameter list. + + + %Defaults + if exist('T')==0 + T=[0:0.1:1] + end; + + if exist('x0')==0 + x0 = zeros($Nx,1); + end; + + [n,m]=size(T); + if m>n + T=T'; + end; + +global t; +function dx=f(x) + global t + par = $1_numpar; + u = $1_input(x,zeros($Ny,1),t,par); + dx = $1_ode(x,u,t,par);; +endfunction; + +x = x0; +for t=T' + u = $1_input(x,zeros($Ny,1),t,par); + x = fsolve('f',x); + y = $1_odeo(x,u,t,par); + mtt_write(t,x,y,$Nx,$Ny); # Write it out +end; + +save -text $1_odess.dat2 MTT_data + +EOF + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + + + + ADDED mtt/bin/trans/ode2smx_lang Index: mtt/bin/trans/ode2smx_lang ================================================================== --- mtt/bin/trans/ode2smx_lang +++ mtt/bin/trans/ode2smx_lang @@ -0,0 +1,218 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode2smx_lang +# ODE to state matrix (with explicit state values) conversion +# P.J.Gawthrop 6th September 1991, May 1994, July 1998 +# Copyright (c) P.J.Gawthrop, 1991, 1994, 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.11 1998/11/26 10:32:34 peterg +## Include subs.r +## +## Revision 1.10 1998/11/17 17:10:22 peterg +## Read in the constitutive relationship file as well +## +## Revision 1.9 1998/08/27 07:06:25 peterg +## Just genrate xj once. +## +## Revision 1.8 1998/08/27 07:04:44 peterg +## Cleared out mttx array ans use mkid instead. +## +## Revision 1.7 1998/08/27 06:48:20 peterg +## Changed mttxx to mttx - in implicit integration smx is called once +## with x in the linearisation the same as x in the current state +## +## Revision 1.6 1998/08/26 18:25:45 peterg +## SMX now generates both A and Ax +## +## Revision 1.5 1998/08/15 13:51:56 peterg +## smx is now I-Adt NOT A +## +## Revision 1.4 1998/08/13 09:03:35 peterg +## *** empty log message *** +## +## Revision 1.3 1998/07/30 10:49:55 peterg +## Removed zeroing. +## +## Revision 1.2 1998/07/30 10:49:02 peterg +## Put [] round output of zeros. +## +## Revision 1.1 1998/07/19 16:59:56 peterg +## Initial revision +## +############################################################### + +# Language +if [ -n "$2" ]; then + lang=$2 +else + lang="r" +fi + + +# Inform user +echo Creating $1_smx.$lang +#echo Creating $1_smxx.$lang +#echo Creating $1_smxtx.$lang + +# Remove the old log file +rm -f ode2smx_r.log + +rm -f $1_smx.$lang +rm -f $1_smxx.$lang +rm -f $1_smxtx.$lang + +# Use reduce to accomplish the transformation +reduce << EOF >ode2smx_lang.log + +lang := $lang; + +in "$1_subs.r"; +in "$1_def.r"; +in "$1_ode.r"; +in "$1_cr.r"; + +clear mttx; % Dont need this now - use mkid instead + +OFF Echo; + +% Load the general translator package +LOAD GENTRAN; +GENTRANLANG!* := 'Pascal; +ON GENTRANSEG; +MAXEXPPRINTLEN!* := 80; +TEMPVARNUM!* := 1; +TEMPVARNAME!* := 'mtt_t; + +% Matrix output function +in"$MTTPATH/trans/lang_matrix.r"; + + +%Set up output according to the language. + OFF NAT; + GENTRANOUT "$1_smx.$lang"; + +% Set up output according to the language. + IF (lang = r) THEN + BEGIN + write "matrix mtta(", mttnx, ",", mttnx, ");"; + write "matrix mttb(", mttnx, ",", mttnu, ");"; + write "matrix mttc(", mttny, ",", mttnx, ");"; + write "matrix mttd(", mttny, ",", mttnu, ");"; + END; + +% find MTTA : the A matrix + FOR i := 1:MTTNx DO + BEGIN + mttAAx_i := 0; +%% xi := mkid(mttx,i); + FOR j := 1:MTTNx DO + BEGIN + xj := mkid(mttx,j); + a_ij := df(MTTdx(i,1), xj, 1); +%% a_ji := df(MTTdx(j,1), xi, 1); + IF i=j THEN + BEGIN + aa_ij := 1 - mttdt*a_ij; +%% aa_ji := aa_ij; + END + ELSE + BEGIN + aa_ij := -mttdt*a_ij; +%% aa_ji := -mttdt*a_ji; + END; + IF (aa_ij NEQ 0) THEN + GENTRAN mtta(i,j) ::=: aa_ij; + mttAAx_i := mttAAx_i + aa_ij*xj; + %%%mttAAtx(i,1) := mttAAtx(i,1) + aa_ji*mkid(mttx,j); + END; + IF (mttAAx_i NEQ 0) THEN + GENTRAN mttax(i) ::=: mttAAx_i; + END; + + + +%% Find MTTB : the B matrix +% FOR j := 1:MTTNu DO +% BEGIN +% uj := MTTU(j,1); +% FOR i := 1:MTTNx DO +% WriteElement("mttb",i,j,df(MTTdx(i,1), uj, 1)); +% END; +% +%% Find MTTC : the C matrix +% FOR i := 1:MTTNy DO +% FOR j := 1:MTTNx DO +% BEGIN +% xj := MTTX(j,1); +% WriteElement("mttc",i,j,df(MTTY(i,1), xj, 1)); +% END; +% +%% Find MTTD : the D matrix +% FOR i := 1:MTTNy DO +% FOR j := 1:MTTNu DO +% BEGIN +% xj := MTTU(j,1); +% WriteElement("mttd",i,j,df(MTTY(i,1), xj, 1)); +% END; + +%Shut the output according to the language. + GENTRANSHUT "$1_smx.$lang"; + + +%% The AAx matrix; +%GENTRANOUT "$1_smxx.$lang"; +%FOR i := 1:MTTNx DO +%BEGIN +% ax_i := mttAAx(i,1); +% IF (ax_i NEQ 0) THEN +% GENTRAN mttax(i) ::=: ax_i; +%END +%GENTRANSHUT "$1_smxx.$lang"; +% +%% The AAtx matrix; +%GENTRANOUT "$1_smxtx.$lang"; +%FOR i := 1:MTTNx DO +%BEGIN +% atx_i := mttAAtx(i,1); +% IF (atx_i NEQ 0) THEN +% GENTRAN mttax(i) ::=: atx_i; +%END +%GENTRANSHUT "$1_smxtx.$lang"; + +EOF + +if [ "$lang" = "m" ]; then + mv $1_smx.$lang mtt_junk +# lang_header $1 smx m 'mttx,mttu,mttdt' '[mtta,mttax]' > $1_smx.m + mtt_header $1 $2 m + cat mtt_junk | mtt_p2m >> $1_smx.m + rm -f mtt_junk + +# mv $1_smxx.$lang mtt_junk +# lang_header $1 smxx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxx.m +# cat mtt_junk | mtt_p2m >> $1_smxx.m +# rm -f mtt_junk +# +# mv $1_smxtx.$lang mtt_junk +# lang_header $1 smxtx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxtx.m +# cat mtt_junk | mtt_p2m >> $1_smxtx.m +# rm -f mtt_junk +# +# +fi + +# Now invoke the standard error handling. +mtt_error_r ode2smx_lang.log + + + + ADDED mtt/bin/trans/ode_r2c Index: mtt/bin/trans/ode_r2c ================================================================== --- mtt/bin/trans/ode_r2c +++ mtt/bin/trans/ode_r2c @@ -0,0 +1,189 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode_r2c +# Reduce ordinary differential equations to c differential-algebraic +# equations + +# Euler integration of the state is included. + +# NB Arrays should be defined to be one larger than expected +# - the 0 element is not used. + +# 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 +# Various bug fixes. +# +## Revision 1.1 1997/01/21 10:52:23 peterg +## Initial revision +## +############################################################### + +# Inform user +echo Creating $1_ode.c + +# Remove the old files +rm -f $1_ode.c1 $1_ode.c2 $1_ode.c + +# Remove the old log file +rm -f ode_r2c.log + +# Use reduce to accomplish the transformation +reduce >ode_r2c.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 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 +%OFF Nat; + +ON NERO; % Suppress zero elements + + +%Generate the Header part +OUT "$1_ode.c1"; + +write "/*"$ +write "Differential algebraic eqns in c form for system $1"$ +write "NB Arrays should be defined to be one larger than expected"$ +write " - the 0 element is not used."$ + +write "File $1_ode.c"$ +write "Generated by MTT"$ +write "*/"$ +write " "$ + + +%Function heading - c style + +write "void $1_ode()"$ + +write " "$ +write "{"$ + +write "/* Declare standard arrays */"$ +write " extern double y[", MTTNy+1, "]; /* $1_ode output */"$ +write " extern double dx[", MTTNx+1, "]; /* $1_ode state derivative */"$ +write " extern double x[", MTTNx+1, "]; /* $1_ode state */"$ +write " extern double u[", MTTNu+1, "]; /* $1_ode input */"$ + +%Declare the dummy variables t0--t9 +write "/* Dummy variable list */ "$ +write " double t0;"$ +FOR i := 1:9 DO +BEGIN + write " double t", i, ";"$ +END$ + +%Declarations$ +write "/* State variable list */ "$ +FOR i := 1:MTTNx DO +BEGIN + write " double mttx", i, ";"$ +END$ + +write "/* Input variable list */ "$ +FOR i := 1:MTTNu DO +BEGIN + write " double mttu", i, ";"$ +END$ + +write "/* Counter */ "$ +write " int i;"$ + +write "/* Parameter list */ "$ +write "#include ", """$1_sympar.c"""$ + +write " "$ +write " /*====== Set up the state variables ======*/"$ +FOR i := 1:MTTNx DO +BEGIN + write " mttx", i, " = x[", i, "];"$ +END$ + +write " "$ +write " /*====== Set up the input variables ======*/"$ +IF MTTNu>0 THEN +BEGIN + FOR i := 1:MTTNu DO + BEGIN + write " mttu", i, " = u[", i, "];"$ + END$ +END$ + + +write " "$ +write " /*====== Compute the state derivative and output ======*/"$ + +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 + BEGIN + GENTRAN dx(i) ::=: mttdx(i,1)$ + END +END$ + +%Output +IF MTTNy>0 THEN +BEGIN + FOR i := 1:MTTNy DO + BEGIN + GENTRAN y(i) ::=: mtty(i,1)$ + END +END$ + + +GENTRANSHUT "$1_ode.c2"; + +EOF + +echo '}' > $1_ode.c3 +cat $1_ode.c1 $1_ode.c2 $1_ode.c3> $1_ode.c + + ADDED mtt/bin/trans/ode_r2lang Index: mtt/bin/trans/ode_r2lang ================================================================== --- mtt/bin/trans/ode_r2lang +++ mtt/bin/trans/ode_r2lang @@ -0,0 +1,245 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode_r2lang +# Reduce ODE to general language ODE +# Based on obsolete ode_r2m +# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994, Jan 95, May 1998 +# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996, 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1998/07/19 16:22:29 peterg +## Changed header to inculde mttu +## +## Revision 1.2 1998/06/21 10:40:58 peterg +## Added fsolve error message. +## +## Revision 1.1 1998/05/23 16:17:14 peterg +## Initial revision +## +############################################################### + +# Set up the language specific stuff +language=$2 + +case $language in + m) + ext='m'; + codegenerator='PASCAL' + Lc='#'; + Rc='#'; + Lb='('; + Rb=')'; + ;; + c) + ext='c'; + codegenerator='C' + Lc='/*'; + Rc='*/'; + Lb='['; + Rb=']'; + ;; + java) + ext='java'; + codegenerator='C' + Lc='/*'; + Rc='*/'; + Lb='['; + Rb=']'; + ;; + *) + echo Language $2 not supported - sorry; exit 1 +esac + +#Inform user +echo Creating $1_ode.$ext +echo Creating $1_odea.$ext +echo Creating $1_odeo.$ext + + +# Remove the old log file +rm -f ode_r2lang.log + +#Remove the temporary files +rm -f $1_ode.$ext.1 +rm -f $1_odea.$ext.1 +rm -f $1_odeo.$ext.1 + +# Use reduce to accomplish the transformation +$SYMBOLIC << EOF #>ode_r2lang.log + +%Read the reduce definitions file +in "$1_def.r"; + +%Read the reduce ODE file +in "$1_ode.r"; + + +% Set up the code generator +% Load the general translator package +LOAD GENTRAN; +GENTRANLANG!* := '$codegenerator; +ON GENTRANSEG; +MAXEXPPRINTLEN!* := 80; +TEMPVARNUM!* := 1; +TEMPVARNAME!* := 'mtt_temp; + +% Matrix output function +in"$MTTPATH/trans/lang_matrix.r"; + +%Set up the number of argument variables to zero in case the user has forgotten +MTTNVar := 0; + +%Read the parameter file +in "$1_sympar.r"; + +% The body of the ode function + GENTRANOUT "$1_ode.$ext.1"; + mtt_matrix := MTTdX$ + mtt_matrix_n := MTTNx$ + mtt_matrix_m := 1$ + mtt_matrix_name := 'MTTdX$ + lang_matrix()$ + GENTRANSHUT "$1_ode.$ext.1"; + +% The algebraic equations (if any) + GENTRANOUT "$1_odea.$ext.1"; + mtt_matrix := MTTYz$ + mtt_matrix_n := MTTNYz$ + mtt_matrix_m := 1$ + mtt_matrix_name := MTTYz$ + lang_matrix()$ + GENTRANSHUT "$1_odea.$ext.1"; + + +% Now do the y = g(x,t) function. +% The body of the odeo function + GENTRANOUT "$1_odeo.$ext.1"; + mtt_matrix := MTTy$ + mtt_matrix_n := MTTNy$ + mtt_matrix_m := 1$ + mtt_matrix_name := MTTy$ + lang_matrix()$ + GENTRANSHUT "$1_odeo.$ext.1"; + +EOF + +# Create the ode.$ext function +lang_header $1 ode $ext 'mttx,mttu,t' mttdx > $1_ode.$ext + +# Algebraic bits +$MATRIX -q <> $1_ode.$ext + %System structure + [nx,ny,nu,nz,nyz] = $1_def; +if nyz>0 + printf("global mttxx mttt;\n"); + printf("mttxx = mttx; mttt=t;\n"); + + printf("$Lc====== Extract the internal input variables ======$Rc\n"); + for i = 1:nyz + printf(" mttui$Lb%i$Rb = mttx$Lb%i$Rb;\n",i,i+nx); + end; + printf("\n"); + + printf("[mttui,info] = fsolve('$1_odea',mttui);\n"); + printf("if (info!=1)\n"); + printf(" error('fsolve has not converged')\n"); + printf("end\n"); + printf("\n"); + + printf("$Lc====== Set up the internal input variables ======$Rc\n"); + for i = 1:nyz + printf(" mttui%i = mttui$Lb%i$Rb;\n",i,i); + end; + printf("\n"); + + printf("$Lc====== Put internal input variables at end of state derivative ======$Rc\n"); + for i = 1:nyz + printf(" mttdx$Lb%i$Rb = mttui%i;\n",i+nx,i); + end; + printf("\n"); +end; + +EOF + +cat <> $1_ode.$ext + +$Lc The differential equations $Rc +EOF + +sed 's/mtt_matrix/mttdx/' $1_ode.$ext.1 >> $1_ode.$ext + +# Java terminating } +if [ "$language" = "java" ]; then +cat <> $1_ode.$ext +} +EOF +fi + + +# Create the odea.$ext function +lang_header $1 odea $ext 'mttui' mttyz 'global mttxx mttt; mttx = mttxx; t=mttt;' > $1_odea.$ext + +$MATRIX -q <> $1_odea.$ext + %System structure + [nx,ny,nu,nz,nyz] = $1_def; +if nyz>0 + printf("$Lc====== Set up the internal input variables ======$Rc\n"); + for i = 1:nyz + printf(" mttui%i = mttui$Lb%i$Rb;\n",i,i); + end; + printf("\n"); +end; +EOF + +cat <> $1_odea.$ext + +% The algebraic equations +EOF +sed 's/mtt_matrix/mttyz/' $1_odea.$ext.1 >> $1_odea.$ext + + +# Create the odeo.$ext function +lang_header $1 odeo $ext 'mttx,mttu,t' mtty > $1_odeo.$ext + +$MATRIX -q <> $1_odeo.$ext + %System structure + [nx,ny,nu,nz,nyz] = $1_def; +if nyz>0 + printf("$Lc====== Extract the internal input variables ======$Rc\n"); + for i = 1:nyz + printf(" mttui$Lb%i$Rb = mttx$Lb%i$Rb;\n",i,i+nx); + end; + printf("\n"); + + printf("$Lc====== Set up the internal input variables ======$Rc\n"); + for i = 1:nyz + printf(" mttui%i = mttui$Lb%i$Rb;\n",i,i); + end; + printf("\n"); +end; + +EOF + + +cat <> $1_odeo.$ext + +% The output equations +EOF +sed 's/mtt_matrix/mtty/' $1_odeo.$ext.1 >> $1_odeo.$ext + +# Convert from Pascal syntax to Octave syntax +mv $1_ode.m mtt_junk; mtt_p2m $1_ode.m +mv $1_odeo.m mtt_junk; mtt_p2m $1_odeo.m +mv $1_odea.m mtt_junk; mtt_p2m $1_odea.m + + + + ADDED mtt/bin/trans/ode_r2m Index: mtt/bin/trans/ode_r2m ================================================================== --- mtt/bin/trans/ode_r2m +++ mtt/bin/trans/ode_r2m @@ -0,0 +1,314 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode_r2m +# Reduce ODE to matlab ODE +# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994, Jan 95. +# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.13 1998/05/21 16:19:54 peterg +## Modified to include explicit algebraic loop solution +## +## Revision 1.12 1998/05/21 12:55:48 peterg +## Put in algebraic equation stuff +## +## Revision 1.11 1998/05/21 08:05:23 peterg +## Back under RCS +## +## Revision 1.10 1998/04/14 07:25:02 peterg +## _input now has arguments (x,t) +## +## Revision 1.9 1998/03/30 14:18:07 peterg +## Removed NERO command +## +## Revision 1.8 1998/02/25 18:03:49 peterg +## Removed the argument reading bits. +## +## Revision 1.7 1997/08/29 07:58:17 peterg +## Changed MTT to mtt in the .m files. +## +# Revision 1.6 1997/01/05 19:34:35 peterg +# Don't write globals which are already assigned to a number. +# +## Revision 1.5 1996/09/13 19:41:39 peter +## *** empty log message *** +## +## Revision 1.4 1996/09/12 18:33:32 peter +## Put back under rcs +## +## Revision 1.3 1996/08/30 11:04:28 peter +## Changed line length to 500. +## +## Revision 1.2 1996/08/24 14:09:41 peter +## Global parameter passing. +## +## Revision 1.1 1996/08/18 12:03:49 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_ode.m +echo Creating $1_odea.m +echo Creating $1_odeo.m + + +# Remove the old log file +rm -f ode_r2m.log + +#Remove the temporary files +rm -f $1_ode.mc +rm -f $1_ode.m1 +rm -f $1_ode.m2 +rm -f $1_ode.m3 +rm -f $1_ode.m4 +rm -f $1_odea.m1; +rm -f $1_odeo.m1; + +# Use reduce to accomplish the transformation +reduce >ode_r2m.log << EOF + +%Read the reduce definitions file +in "$1_def.r"; + +%Read the reduce ODE file +in "$1_ode.r"; + +% Matrix output function +in"$MTTPATH/trans/matlab_matrix.r"; + + +%Set up the number of argument variables to zero in case the user has forgotten +MTTNVar := 0; + +%Read the parameter file +in "$1_sympar.r"; + +%ON NERO; % Suppress zero elements + +%Define the common part of the functions. + +PROCEDURE common; +BEGIN + write "% Read in the input"; + write "u = $1_input(x,t)"; + + write "% Read in the definitions"; + write "[nx,ny,nu,nz,nyz] = $1_def"; + +% write "% Read in the arguments"; +% write "$1_args"; + + write "% Set up the State variables"; + FOR i := 1:MTTNx DO + BEGIN + write "mttx", i, " = x(", i, ");"; + END; + + write "% Set up the Input variables"; + IF MTTNu>0 THEN + FOR i := 1:MTTNu DO + BEGIN + write "mttu", i, " = u(", i, ");"; + END; + +END; + +% The common part +OUT "$1_ode.mc"; +common(); +SHUT "$1_ode.mc"; + +% Set up internal inputs (if any) +OUT "$1_ode.m3"; + write "% Set up the Internal Input variables"; + IF MTTNyz>0 THEN + FOR i := 1:MTTNyz DO + BEGIN + write "mttui", i, " = mttui(", i, ");"; + END; +SHUT "$1_ode.m3"; + +OUT "$1_ode.m4"; + write "% Set up the Internal Input variables (saved in the state vector)"; + IF MTTNyz>0 THEN + FOR i := 1:MTTNyz DO + BEGIN + write "mttui(", i, ") = x(", i+MTTNx, ");"; + END; +SHUT "$1_ode.m4"; + +% The body of the ode function + GENTRANOUT "$1_ode.m1"; + mtt_matrix := MTTdX$ + mtt_matrix_n := MTTNx$ + mtt_matrix_m := 1$ + mtt_matrix_name := MTTdX$ + matlab_matrix(); + GENTRAN MTTdx := mtt_matrix; + GENTRANSHUT "$1_ode.m1"; + +% The algebraic equations (if any) + GENTRANOUT "$1_odea.m1"; + mtt_matrix := MTTYz$ + mtt_matrix_n := MTTNYz$ + mtt_matrix_m := 1$ + mtt_matrix_name := MTTYz$ + matlab_matrix(); + GENTRAN MTTYz := mtt_matrix; + GENTRANSHUT "$1_odea.m1"; + + +%Fortran switches - one line expressions +OFF echo; +ON fort$ +cardno!* := 1$ +fortwidth!* := 10000$ +OFF period$ + +MTTdx := MTTdx; + + +SHUT "$1_ode.m"; + +OUT "$1_odea.m"; +write "function zero = $1_odea(x,t);"; +write "% zero = $1_odea(x,t);"; +write "%Algebraic equations in octave form for system $1;;"; +write "%File $1_odea.m;;"; +write "%Generated by MTT;;"; + +%Write algebraic equations if any ... +zero := MTTYz; +SHUT "$1_odea.m"; + +% Now do the y = g(x,t) function. +% The body of the odeo function + GENTRANOUT "$1_odeo.m1"; + mtt_matrix := MTTy$ + mtt_matrix_n := MTTNy$ + mtt_matrix_m := 1$ + mtt_matrix_name := MTTy$ + matlab_matrix(); + GENTRAN MTTy := mtt_matrix; + GENTRANSHUT "$1_odeo.m1"; + + +EOF + +# Create the ode.m function +cat < $1_ode.m +function mttdx = $1_ode(x,t); +% mttdx = $1_ode(x,t); +%ODE in Octave form for system $1; +%File $1_ode.m; +%Generated by MTT on `date`; +EOF + +# Create the globals +sympar2global_txt2m $1 >> $1_ode.m + +#Common bit +cat $1_ode.mc >> $1_ode.m + +#Extract internal input from state vector +cat $1_ode.m4 >> $1_ode.m + +cat <> $1_ode.m +% Solve the algebraic equations (if any) +if nyz>0 + global xx tt; + xx = x; tt=t; + MTTui = fsolve('$1_odea',mttui); +else + mttui = []; +end +EOF + +cat $1_ode.m3 >> $1_ode.m + +cat <> $1_ode.m + +% The differential equations +EOF +cat $1_ode.m1 >> $1_ode.m + +cat <> $1_ode.m + +% Append the internal inputs to the state derivative +mttdx = [mttdx; mttui]; +EOF + + +# Create the odea.m function +cat < $1_odea.m +function mttyz = $1_odea(mttui); +% mttyz = $1_odea(mttui); +%Algebraic equations in Octave form for system $1; +%File $1_odea.m; +%Generated by mtt on `date`; +EOF + +# Create the globals +sympar2global_txt2m $1 >> $1_odea.m + +cat <> $1_odea.m + +global xx tt; +x = xx; t=tt; +EOF + +#Common bit +cat $1_ode.mc >> $1_odea.m + +# Internal inputs +cat $1_ode.m3 >> $1_odea.m + +cat <> $1_odea.m + +% The algebraic equations +EOF +cat $1_odea.m1 >> $1_odea.m + +# Create the odeo.m function +cat < $1_odeo.m +function mtty = $1_odeo(x,t); +% mtty = $1_odeo(x,t); +%Algebraic equations in Octave form for system $1; +%File $1_odeo.m; +%Generated by MTT on `date`; +EOF + +# Create the globals +sympar2global_txt2m $1 >> $1_odeo.m + + +#Common bit +cat $1_ode.mc >> $1_odeo.m + +#Extract internal input from state vector +cat $1_ode.m4 >> $1_odeo.m + +# Internal inputs +cat $1_ode.m3 >> $1_odeo.m + +cat <> $1_odeo.m + +% The output equations +EOF +cat $1_odeo.m1 >> $1_odeo.m + + + + + + + ADDED mtt/bin/trans/ode_r2tex Index: mtt/bin/trans/ode_r2tex ================================================================== --- mtt/bin/trans/ode_r2tex +++ mtt/bin/trans/ode_r2tex @@ -0,0 +1,121 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ode_r2tex +# Reduce differential-algebraic to LaTex differential-algebraic equations. +# P.J.Gawthrop 10th May 1991, April 1994 +# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1998/01/23 15:51:01 peterg +## Repleace eqnarray by equation + aligned -- this works with Latex2html +## +## Revision 1.2 1996/12/20 08:59:10 peterg +## Now writes out mtti instead of mtt_{i} -- lets latex_tidy do the +## conversion. +## +## Revision 1.1 1996/12/20 08:53:57 peterg +## Initial revision +## +############################################################### + +# Inform user +echo Creating $1_ode.tex + +# Remove the old log file +rm -f ode_r2tex.log + +# Use reduce to accomplish the transformation +reduce >ode_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the differential-algebraic equations file +in "$1_ode.r"; + +%Read the symbolic parameter file +%%in "$1_sympar.r"; + + + +OFF Echo; +OFF Nat; + +%Read the substitution file +IN "$1_subs.r"; + +%Read the simplifying expressions file +IN "$1_simp.r"; + +OUT "$1_ode.tex"; + +%Write out the differential-algebraic equations. + +write "%File: $1_ode.tex"; + +write "%ordinary differential equations"; +write "% Generated by MTT"; + +IF MTTNx>0 THEN +BEGIN + write"\begin{equation} \label{eq_$1_ode_x}"; + write"\begin{aligned}"; + FOR Row := 1:MTTNx DO + BEGIN + write "\dot MTTX", Row, " &= "; + write "{"; + write MTTdx(Row,1); + write "}"; + IF Row0 THEN +BEGIN + write"\begin{equation}"; + write"\begin{aligned}"; +FOR Row := 1:MTTNyz DO + BEGIN + write "0 &= "; + write "{"; + write MTTyz(Row,1); + write "}"; + IF Row0 THEN +BEGIN + write"\begin{equation} \label{eq_$1_ode_y}"; + write"\begin{aligned}"; + FOR Row := 1:MTTNy DO + BEGIN + write "MTTy", Row, " &= "; + write "{"; + write MTTy(Row,1); + write "}"; + IF Row $1_odes.sdat + ADDED mtt/bin/trans/odeso_dat2sdat Index: mtt/bin/trans/odeso_dat2sdat ================================================================== --- mtt/bin/trans/odeso_dat2sdat +++ mtt/bin/trans/odeso_dat2sdat @@ -0,0 +1,29 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: odeso_dat2sdat + +# Structure file - dat to sdat conversion +# P.J.Gawthrop April 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1999/03/28 21:29:40 peterg +## Initial revision +## +############################################################### + + + +# Inform user +echo "Creating $1_odeso.sdat" + +dat2sdat $1 odeso | dat2siag > $1_odeso.sdat + ADDED mtt/bin/trans/p/README Index: mtt/bin/trans/p/README ================================================================== --- mtt/bin/trans/p/README +++ mtt/bin/trans/p/README @@ -0,0 +1,113 @@ +Some of the files in this directory are derived from the NUMERICAL +RECIPES PASCAL SHAREWARE DISKETTE. Please note that any use of these +filse may be subject to the following notice: + + + NUMERICAL RECIPES PASCAL SHAREWARE DISKETTE + +The entire contents of this diskette are +Copyright (C) 1986 by Numerical Recipes Software. + +HERE ARE ANSWERS TO YOUR IMMEDIATE QUESTIONS: + +** What is this diskette? ** This NUMERICAL RECIPES PASCAL SHAREWARE +DISKETTE contains Pascal procedures originally published as the Pascal +Appendix to the FORTRAN book NUMERICAL RECIPES: THE ART OF SCIENTIFIC +COMPUTING (Cambridge University Press, 1986), and test driver programs +originally published as the NUMERICAL RECIPES EXAMPLE BOOK (PASCAL) +(Cambridge University Press, 1986). + +** What kinds of procedures are these Numerical Recipes? ** They are +practically a complete library for scientific computation. Numbering +more than 200, their scope includes integration, linear algebra, +differential equations, Fourier methods, data analysis, statistics, +lots of special functions, random numbers, sorting, root finding, +optimization, and much more. + +** Do I really get this whole library for FREE? ** Yes, providing that +you follow these simple rules: (1) You must read and accept the +disclaimer of warranty at the end of this document. (2) You must not +expect any user support from Numerical Recipes Software, Cambridge +University Press, or the authors of the Numerical Recipes books. (3) +You must not copy or redistribute any of the programs or procedures +for commercial purposes. You CAN make copies of the programs for your +friends and colleagues, providing that you include this file +(especially its copyright notice and disclaimer of warranty) with any +copy that you make. + +** What's the catch, then? ** None at all. Many thousands of +satisfied users paid more than $20 to purchase exactly the programs on +this disk, which were sold by Cambridge University Press (C.U.P.) +between 1986 and 1989. C.U.P. now sells a revised version of the +Numerical Recipes program library, whose Pascal style is much +improved, but whose basic algorithmic workings are identical to this +disk. Rather than let the older version go to waste, its authors +decided to make it available to the shareware community of users. + +** How can I figure out what the procedures do? ** One way is to read +the brief descriptions of all the programs in the file NRINFO.DOC. A +better way is to look at the book Numerical Recipes: The Art of +Scientific Computing in any one of its three editions (FORTRAN, +Pascal, or C). If you don't want to buy this book from Cambridge +University Press (see the file NRINFO.DOC), you can find it in +libraries. Or, take a pencil and a small piece of paper into a +bookstore that carries the book and take notes on which programs you +might find interesting. + +** How do I figure out how to use the procedures? ** Again, you have +several options. All the procedures (named *.PAS) come with +demonstration programs (named *.DEM). These demonstration programs +are included on this shareware diskette. (When sold, they are sold as +a separate diskette.) Usually you can figure out how to use a +procedure by figuring out its .DEM program. Another way is to look at +the Numerical Recipes book in a library or bookstore. + +** Aren't you just trying to get me to buy the book? ** Think of it +this way: Most shareware comes with the requirement that if you use it +more than casually, you are required to become a registered user and +pay a fee. We are not requiring any fee at all. We think that you +will be able to use MOST of the procedures on this diskette without +the Numerical Recipes book. If you become a more-than-casual user, or +if you look at the book in a bookstore, we are betting that you will +WANT to buy it, and perhaps then want to purchase the revised and +improved versions of the programs, also. But it is completely up to +you. + +** OK, what if I do want to get the book? ** Call Cambridge University +Press at their toll-free number, 800-872-7423. (In New York call +800-227-0247 or 914-937-9600.) Ask for "Numerical Recipes in Pascal", +ISBN number 0-521-37516-9. We think you'll like it. (Over 100,000 +copies of the book are in print, in FORTRAN, Pascal, and C.) + +** What are the files on this diskette? ** All the procedures, in +Pascal source code, are in the ZIP file NRPAS13.ZIP. You use +PKUNZIP.EXE to decompress them. (For info just execute PKUNZIP with +no command line arguments.) All the demonstration programs are +similarly in NRPEX10.ZIP (PEX means Pascal EXamples). Some data files +used by the procedures and demonstrations programs are in NRPDATA.ZIP. +The files NRPAS13.LST and NRPEX10.LST each list the names of the files +in their corresponding ZIP file. The short file MODFILE.PAS is used +by many of the procedures to customize to your particular variety of +Pascal compiler; feel free to modify it, if you need to. The file +NRINFO.DOC tells about the book Numerical Recipes in Pascal and gives +a brief description of all the procedures. The file you are now +reading is NRREADME.DOC. + +Good luck, and happy number-crunching! + + DISCLAIMER OF WARRANTY + ---------- -- -------- +THE PROGRAMS AND PROCEDURES ON THIS DISKETTE ARE PROVIDED "AS IS" +WITHOUT WARRANTY OF ANY KIND. WE MAKE NO WARRANTIES, EXPRESS OR +IMPLIED, THAT THE PROGRAMS AND PROCEDURES ARE FREE OF ERROR, OR ARE +CONSISTENT WITH ANY PARTICULAR STANDARD OF MERCHANTABILITY, OR THAT +THEY WILL MEET YOUR REQUIREMENTS FOR ANY PARTICULAR APPLICATION. THEY +SHOULD NOT BE RELIED ON FOR SOLVING A PROBLEM WHOSE INCORRECT SOLUTION +COULD RESULT IN INJURY TO A PERSON OR LOSS OF PROPERTY. IF YOU DO USE +THE PROGRAMS OR PROCEDURES IN SUCH A MANNER, IT IS AT YOUR OWN RISK. +THE AUTHORS AND PUBLISHER DISCLAIM ALL LIABILITY FOR DIRECT, +INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM YOUR USE OF THE +PROGRAMS OR PROCEDURES ON THIS DISKETTE. ANY LIABILITY OF THE PERSON +OR PERSONS FROM WHOM YOU DIRECTLY OR INDIRECTLY OBTAINED THIS DISKETTE +WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OF DISKETTES WITH +MANUFACTURING DEFECTS. ADDED mtt/bin/trans/p/mtt_euler.p Index: mtt/bin/trans/p/mtt_euler.p ================================================================== --- mtt/bin/trans/p/mtt_euler.p +++ mtt/bin/trans/p/mtt_euler.p @@ -0,0 +1,16 @@ +PROCEDURE mtt_euler(VAR x_out, x,dx : StateVector; + dt : REAL; + Nx : INTEGER; + Open : StateVector); + +VAR i : INTEGER; + +BEGIN{mtt_euler} + FOR i := 1 TO Nx DO + BEGIN + IF Open[i]>0.5 THEN{Open switch} + x_out[i] := 0.0 + ELSE + x_out[i] := x[i] + dx[i]*dt; + END; +END;{mtt_euler} ADDED mtt/bin/trans/p/mtt_getargs.p Index: mtt/bin/trans/p/mtt_getargs.p ================================================================== --- mtt/bin/trans/p/mtt_getargs.p +++ mtt/bin/trans/p/mtt_getargs.p @@ -0,0 +1,26 @@ +{ Substitute for p2c PASCAL_MAIN + Copies pogramme arguments in to mtt_parameters array + This c code is embedded in a pascal routine in a p2c compatible way +} + +{EMBED +Static Void PASCAL_MAIN(argc, argv) +int argc; +char *argv[]; + +\[ + int i; + mttnpar = argc-1; + if (mttnpar>0) \[ + for (i=0;i 0) THEN BEGIN + FOR j := ii TO i-1 DO BEGIN + sum := sum-a[i,j]*b[j] + END + END ELSE IF (sum <> 0.0) THEN BEGIN + ii := i + END; + b[i] := sum + END; + FOR i := n DOWNTO 1 DO BEGIN + sum := b[i]; + IF (i < n) THEN BEGIN + FOR j := i+1 TO n DO BEGIN + sum := sum-a[i,j]*b[j] + END + END; + b[i] := sum/a[i,i] + END +END; ADDED mtt/bin/trans/p/mtt_ludcmp.p Index: mtt/bin/trans/p/mtt_ludcmp.p ================================================================== --- mtt/bin/trans/p/mtt_ludcmp.p +++ mtt/bin/trans/p/mtt_ludcmp.p @@ -0,0 +1,84 @@ +PROCEDURE mtt_ludcmp(VAR a: StateMatrix; n: integer; + VAR indx: StateVector; VAR d: real); + +{ This file is derived from the NUMERICAL RECIPES PASCAL SHAREWARE DISKETTE. + Please read the README file in $MTTPATH/trans/p + } + +{ +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/08/14 07:58:13 peterg +## Initial revision +## +############################################################### +} + +(* Programs using LUDCMP must define the types +TYPE + glnpbynp = ARRAY [1..np,1..np] OF real; + glnarray = ARRAY [1..n] OF real; + glindx = ARRAY [1..n] OF integer; +in the main routine. *) + +CONST + tiny=1.0e-20; + +VAR + k,j,imax,i: integer; + sum,dum,big: real; + vv: glnarray; + +BEGIN + d := 1.0; + FOR i := 1 TO n DO BEGIN + big := 0.0; + FOR j := 1 TO n DO IF (abs(a[i,j]) > big) THEN big := abs(a[i,j]); + IF (big = 0.0) THEN BEGIN + writeln('pause in LUDCMP - singular matrix'); readln + END; + vv[i] := 1.0/big + END; + FOR j := 1 TO n DO BEGIN + FOR i := 1 TO j-1 DO BEGIN + sum := a[i,j]; + FOR k := 1 TO i-1 DO BEGIN + sum := sum-a[i,k]*a[k,j] + END; + a[i,j] := sum + END; + big := 0.0; + FOR i := j TO n DO BEGIN + sum := a[i,j]; + FOR k := 1 TO j-1 DO BEGIN + sum := sum-a[i,k]*a[k,j] + END; + a[i,j] := sum; + dum := vv[i]*abs(sum); + IF (dum > big) THEN BEGIN + big := dum; + imax := i + END + END; + IF (j <> imax) THEN BEGIN + FOR k := 1 TO n DO BEGIN + dum := a[imax,k]; + a[imax,k] := a[j,k]; + a[j,k] := dum + END; + d := -d; + vv[imax] := vv[j] + END; + indx[j] := imax; + IF (a[j,j] = 0.0) THEN a[j,j] := tiny; + IF (j <> n) THEN BEGIN + dum := 1.0/a[j,j]; + FOR i := j+1 TO n DO BEGIN + a[i,j] := a[i,j]*dum + END + END + END; +END; ADDED mtt/bin/trans/p/mtt_par_update.p Index: mtt/bin/trans/p/mtt_par_update.p ================================================================== --- mtt/bin/trans/p/mtt_par_update.p +++ mtt/bin/trans/p/mtt_par_update.p @@ -0,0 +1,49 @@ +PROCEDURE mtt_numpar_update(VAR new_numpar : ParameterVector; + old_numpar : ParameterVector); +VAR i : INTEGER; + +BEGIN {mtt_numpar_update} + + for i:=1 TO MTT_Npar DO {copy values} + new_numpar[i] := old_numpar[i]; + + WHILE NOT eof(numparfile) DO {read and update values} + IF NOT (numparfile^ = chr("#")) THEN + BEGIN + read(numparfile,i); read(numparfile,new_numpar[i]); + END + ELSE + readln(numparfile); + +END {mtt_numpar_update}; + +PROCEDURE mtt_state_update(VAR new_state : StateVector; + old_state : StateVector); + +VAR i : INTEGER; + +BEGIN {mtt_state_update} + + for i:=1 TO MTT_Nx DO {copy values} + new_state[i] := old_state[i]; + + WHILE NOT eof(statefile) DO {read and update values} + IF NOT (statefile^ = chr("#")) THEN + BEGIN + read(statefile,i); read(statefile,new_state[i]); + END + ELSE + readln(statefile); + +END {mtt_state_update}; + +PROCEDURE mtt_simpar_update(VAR dt : REAL); +BEGIN {mtt_simpar_update} + + WHILE NOT eof(simparfile) DO {read and update values} + BEGIN + IF NOT (simparfile^ = chr("#")) THEN + read(simparfile,dt); + readln(simparfile); + END +END {mtt_simpar_update}; ADDED mtt/bin/trans/p/mtt_solve.p Index: mtt/bin/trans/p/mtt_solve.p ================================================================== --- mtt/bin/trans/p/mtt_solve.p +++ mtt/bin/trans/p/mtt_solve.p @@ -0,0 +1,38 @@ +PROCEDURE mtt_solve(VAR x : StateVector; + A : StateMatrix; + B : StateVector; + n : integer); + +{ + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.3 1999/10/26 23:44:36 peterg +% % Now packages up mtt_solve_lud OR mtt_solve_svd +% % +% % Revision 1.2 1998/08/14 12:09:13 peterg +% % A passed by value - its destroyed by SVDcm +% % +% % Revision 1.1 1998/08/13 08:51:57 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + } + +VAR + i : integer; + wmax,wmin : real; + w : StateVector ; + v : StateMatrix; + + +(*$I $MTTPATH/trans/p/mtt_solve_lud.p *) +(* I $MTTPATH/trans/p/mtt_solve_svd.p *) + +BEGIN{mtt_solve} + mtt_solve_lud(x,A,B,N); + (*** mtt_solve_svd(x,A,B,N); ***) +END{mtt_solve}; ADDED mtt/bin/trans/p/mtt_solve_lu.p Index: mtt/bin/trans/p/mtt_solve_lu.p ================================================================== --- mtt/bin/trans/p/mtt_solve_lu.p +++ mtt/bin/trans/p/mtt_solve_lu.p @@ -0,0 +1,54 @@ +PROCEDURE mtt_solve_lu.p(VAR x : StateVector; + A : StateMatrix; + VAR B : StateVector; + n : integer; + Small : real); + +{ +Linear equation solution via LU factorisation} + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.2 1998/08/14 12:09:13 peterg +% % A passed by value - its destroyed by SVDcm +% % +% % Revision 1.1 1998/08/13 08:51:57 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + } + +VAR + i : integer; + wmax,wmin : real; + w : StateVector ; + v : StateMatrix; + +(*$I svdcmp.p *) +(*$I svbksb.p *) + +BEGIN{mtt_solve} +(* decompose matrix A using SVD *) + svdcmp(A,n,n,w,v); + +(* find maximum singular value *) + wmax := 0.0; + FOR i := 1 to n DO BEGIN + IF (w[i] > wmax) THEN wmax := w[i] + END; + +(* define "small" *) + wmin := wmax*Small; + +(* zero the "small" singular values *) + FOR i := 1 to n DO BEGIN + IF (w[i] < wmin) THEN w[i] := 0.0 + END; + +(* backsubstitute for B *) + svbksb(A,w,v,n,n,B,x); + +END{mtt_solve}; ADDED mtt/bin/trans/p/mtt_solve_lud.p Index: mtt/bin/trans/p/mtt_solve_lud.p ================================================================== --- mtt/bin/trans/p/mtt_solve_lud.p +++ mtt/bin/trans/p/mtt_solve_lud.p @@ -0,0 +1,61 @@ +PROCEDURE mtt_solve_lud(VAR x : StateVector; + A : StateMatrix; + B : StateVector; + n : integer); + +{ +Linear equation solution via LU factorisation + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.3 1999/10/26 23:37:20 peterg +% % Put include files here. +% % +% % Revision 1.2 1998/08/17 15:56:10 peterg +% % Uses LU decomposition - much faster than SVD when N>100 +% % +% % Revision 1.1 1998/08/17 12:52:16 peterg +% % Initial revision +% % +% % Revision 1.1 1998/08/17 12:41:37 peterg +% % Initial revision +% % +% % Revision 1.2 1998/08/14 12:09:13 peterg +% % A passed by value - its destroyed by SVDcm +% % +% % Revision 1.1 1998/08/13 08:51:57 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + } + +VAR + i : integer; + d : real; + Index : StateVector; + + +(*$I $MTTPATH/trans/p/mtt_ludcmp.p *) +(*$I $MTTPATH/trans/p/mtt_lubksb.p *) + +BEGIN{mtt_solve_lud} + (* decompose matrix A using LU decomposition *) + mtt_ludcmp(A,n,Index,d); + + (* backsubstitute for B *) + mtt_lubksb(A,n,Index,B); + + (* x now lives in B *) + FOR i := 1 TO n DO + x[i] := B[i]; + +END{mtt_solve_lud}; + + + + + + ADDED mtt/bin/trans/p/mtt_solve_svd.p Index: mtt/bin/trans/p/mtt_solve_svd.p ================================================================== --- mtt/bin/trans/p/mtt_solve_svd.p +++ mtt/bin/trans/p/mtt_solve_svd.p @@ -0,0 +1,63 @@ +PROCEDURE mtt_solve_svd(VAR x : StateVector; + A : StateMatrix; + VAR B : StateVector; + n : integer); + +{Solve linear equation via svd} + +{ + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.2 1998/08/17 12:40:25 peterg +% % Renamed mtt_solve to mtt_solve_svd +% % -- now also have mtt_solve_lu +% % +% % Revision 1.1 1998/08/17 12:38:52 peterg +% % Initial revision +% % +% % Revision 1.2 1998/08/14 12:09:13 peterg +% % A passed by value - its destroyed by SVDcm +% % +% % Revision 1.1 1998/08/13 08:51:57 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + } + +CONST + Small = 1e-6; (* Criteroion for small svd *) +VAR + i : integer; + wmax,wmin : real; + w : StateVector ; + v : StateMatrix; + +(*$I svdcmp.p *) +(*$I svbksb.p *) + +BEGIN{mtt_solve} +(* decompose matrix A using SVD *) + svdcmp(A,n,n,w,v); + +(* find maximum singular value *) + wmax := 0.0; + FOR i := 1 to n DO BEGIN + IF (w[i] > wmax) THEN wmax := w[i] + END; + +(* define "small" *) + wmin := wmax*Small; + +(* zero the "small" singular values *) + FOR i := 1 to n DO BEGIN + IF (w[i] < wmin) THEN w[i] := 0.0 + END; + +(* backsubstitute for B *) + svbksb(A,w,v,n,n,B,x); + +END{mtt_solve}; ADDED mtt/bin/trans/p/mtt_sparse.p Index: mtt/bin/trans/p/mtt_sparse.p ================================================================== --- mtt/bin/trans/p/mtt_sparse.p +++ mtt/bin/trans/p/mtt_sparse.p @@ -0,0 +1,92 @@ +PROCEDURE mtt_sparse( b : glnarray; + n,iters : INTEGER; + VAR x : glnarray); + +{ This file is derived from the NUMERICAL RECIPES PASCAL SHAREWARE DISKETTE. + Please read the README file in $MTTPATH/trans/p + } +{* +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 1998/08/15 13:49:19 peterg +## iters now passed as an argument. +## +## Revision 1.4 1998/08/15 09:33:25 peterg +## Deleted the commented out stuff +## +## Revision 1.3 1998/08/15 09:30:05 peterg +## Commented out the cariabel iteration stuff +## +## Revision 1.2 1998/08/15 08:26:30 peterg +## This is variable interations version - now going on to fixed +## iterations +## +## Revision 1.1 1998/08/13 14:58:35 peterg +## Initial revision +## +## Revision 1.1 1998/08/13 08:40:40 peterg +## Initial revision +## +############################################################### +*} + +(* Programs using routine SPARSE must define the type +TYPE + glnarray = ARRAY [1..n] OF real; +in the main routine. They must also provide two routines, +PROCEDURE asub(x: glnarray; VAR y: glnarray; n: integer); +and +PROCEDURE atsub(x: glnarray; VAR z: glnarray; n: integer); +which calculate A*x and (A transpose)*x *) + +VAR + j,iter,irst: integer; + rp,gg,gam,eps2,dgg,bsq,anum,aden: real; + g,h,xi,xj: glnarray; + +BEGIN {mtt_sparse} + mtt_asub(x,xi,n); + rp := 0.0; + bsq := 0.0; + FOR j := 1 TO n DO BEGIN + xi[j] := xi[j]-b[j]; + END; + mtt_atsub(xi,g,n); + FOR j := 1 TO n DO BEGIN + g[j] := -g[j]; + h[j] := g[j] + END; + FOR iter := 1 TO iters DO BEGIN + mtt_asub(h,xi,n); + anum := 0.0; + aden := 0.0; + FOR j := 1 TO n DO BEGIN + anum := anum+g[j]*h[j]; + aden := aden+sqr(xi[j]) + END; + anum := anum/aden; + FOR j := 1 TO n DO BEGIN + xi[j] := x[j]; + x[j] := x[j]+anum*h[j] + END; + mtt_asub(x,xj,n); + FOR j := 1 TO n DO BEGIN + xj[j] := xj[j]-b[j]; + END; + mtt_atsub(xj,xi,n); + gg := 0.0; + dgg := 0.0; + FOR j := 1 TO n DO BEGIN + gg := gg+sqr(g[j]); + dgg := dgg+(xi[j]+g[j])*xi[j] + END; + gam := dgg/gg; + FOR j := 1 TO n DO BEGIN + g[j] := -xi[j]; + h[j] := g[j]+gam*h[j] + END + END; +END {mtt_sparse}; ADDED mtt/bin/trans/p/mtt_update.p Index: mtt/bin/trans/p/mtt_update.p ================================================================== --- mtt/bin/trans/p/mtt_update.p +++ mtt/bin/trans/p/mtt_update.p @@ -0,0 +1,62 @@ +PROCEDURE mtt_update(VAR xnew : StateVector; + dx,x,AAx : StateVector; + VAR AA : StateMatrix; + DT : REAL; + STEPFACTOR : INTEGER; + Nx : INTEGER; + METHOD : IntegrationMethod); + +{ + ############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 1998/08/15 13:48:35 peterg +## New update methods +## +## Revision 1.4 1998/08/14 10:54:58 peterg +## Use sparse computation where possible +## +############################################################### +} + +CONST + Small = 0.000001; + +VAR + i,j : INTEGER; + BB : StateVector; + DDT : REAL; + +(*$I mtt_solve_lud.p *) +(*$I mtt_sparse.p *) + +BEGIN{mtt_update} + + IF Method=1 THEN {Euler} + BEGIN{Euler} + DDT := DT/STEPFACTOR; + FOR i := 1 TO Nx DO + xnew[i] := xnew[i] + dx[i]*DDT; + END {Euler} + ELSE IF (Method=2) OR (METHOD=3) OR (METHOD=4) THEN {Implicit} + BEGIN {Implicit methods} + + FOR i := 1 TO Nx DO {BB is (1-A*dt)*x +dx*dt} + BB[i] := AAx[i] + DT*dx[i]; + + {Solve the equation AAx = B} + IF (Method=2) OR (METHOD=3) THEN {Use SVD} + mtt_solve_lud(xnew,AA,BB,Nx) + ELSE {Sparse CG solution} + mtt_sparse(BB,Nx,STEPFACTOR,xnew); + END{Implicit methods} + ELSE + Writeln("Method >4 is not defined"); + +END{mtt_update}; + + + + ADDED mtt/bin/trans/p/mtt_write.p Index: mtt/bin/trans/p/mtt_write.p ================================================================== --- mtt/bin/trans/p/mtt_write.p +++ mtt/bin/trans/p/mtt_write.p @@ -0,0 +1,54 @@ +PROCEDURE mtt_write(t : REAL; + x : StateVector; + y : OutputVector; + nx,ny : INTEGER); + +{* +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + Pascal function mtt_write + P.J. Gawthrop July 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 1999/03/15 21:57:38 peterg +## Removed the # symbol +## +## Revision 1.4 1998/11/26 13:31:30 peterg +## Put missing space after 2nd t +## +## Revision 1.3 1998/07/25 20:41:38 peterg +## Spaces between numbers +## +## Revision 1.2 1998/07/25 14:04:14 peterg +## Changed format +## +## Revision 1.1 1998/07/25 09:47:25 peterg +## Initial revision +## +############################################################### + + +*} + +CONST TAB=9; + +VAR + i : INTEGER; + +BEGIN + write(t,chr(TAB)); + FOR i := 1 TO ny DO + write(y[i],chr(TAB)); + + write(t,chr(TAB)); + FOR i := 1 TO nx DO + write(x[i],chr(TAB)); + writeln; +END; + ADDED mtt/bin/trans/p/sign.p Index: mtt/bin/trans/p/sign.p ================================================================== --- mtt/bin/trans/p/sign.p +++ mtt/bin/trans/p/sign.p @@ -0,0 +1,10 @@ +FUNCTION sign(x : REAL) : REAL; +{ This useful function is missing from Pascal } + +BEGIN + IF X>=0 THEN + sign := 1 + ELSE + sign := -1; +END; { sign } + ADDED mtt/bin/trans/p/sparse.p Index: mtt/bin/trans/p/sparse.p ================================================================== --- mtt/bin/trans/p/sparse.p +++ mtt/bin/trans/p/sparse.p @@ -0,0 +1,91 @@ +PROCEDURE sparse(b: glnarray; n: integer; VAR x: glnarray; VAR rsq: real); +{* +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### +*} + +(* Programs using routine SPARSE must define the type +TYPE + glnarray = ARRAY [1..n] OF real; +in the main routine. They must also provide two routines, +PROCEDURE asub(x: glnarray; VAR y: glnarray; n: integer); +and +PROCEDURE atsub(x: glnarray; VAR z: glnarray; n: integer); +which calculate A*x and (A transpose)*x *) +LABEL 1,99; +CONST + eps=1.0e-6; +VAR + j,iter,irst: integer; + rp,gg,gam,eps2,dgg,bsq,anum,aden: real; + g,h,xi,xj: glnarray; +BEGIN + eps2 := n*sqr(eps); + irst := 0; +1: irst := irst+1; + asub(x,xi,n); + rp := 0.0; + bsq := 0.0; + FOR j := 1 TO n DO BEGIN + bsq := bsq+sqr(b[j]); + xi[j] := xi[j]-b[j]; + rp := rp+sqr(xi[j]) + END; + atsub(xi,g,n); + FOR j := 1 TO n DO BEGIN + g[j] := -g[j]; + h[j] := g[j] + END; + FOR iter := 1 TO 10*n DO BEGIN + asub(h,xi,n); + anum := 0.0; + aden := 0.0; + FOR j := 1 TO n DO BEGIN + anum := anum+g[j]*h[j]; + aden := aden+sqr(xi[j]) + END; + IF (aden = 0.0) THEN BEGIN + writeln('pause in routine SPARSE'); + writeln('very singular matrix'); readln + END; + anum := anum/aden; + FOR j := 1 TO n DO BEGIN + xi[j] := x[j]; + x[j] := x[j]+anum*h[j] + END; + asub(x,xj,n); + rsq := 0.0; + FOR j := 1 TO n DO BEGIN + xj[j] := xj[j]-b[j]; + rsq := rsq+sqr(xj[j]) + END; + IF ((rsq = rp) OR (rsq <= bsq*eps2)) THEN GOTO 99; + IF (rsq > rp) THEN BEGIN + FOR j := 1 TO n DO BEGIN + x[j] := xi[j] + END; + IF (irst >= 3) THEN GOTO 99; + GOTO 1 + END; + rp := rsq; + atsub(xj,xi,n); + gg := 0.0; + dgg := 0.0; + FOR j := 1 TO n DO BEGIN + gg := gg+sqr(g[j]); + dgg := dgg+(xi[j]+g[j])*xi[j] + END; + IF (gg = 0.0) THEN GOTO 99; + gam := dgg/gg; + FOR j := 1 TO n DO BEGIN + g[j] := -xi[j]; + h[j] := g[j]+gam*h[j] + END + END; + writeln('pause in routine SPARSE'); + writeln('too many iterations'); readln; +99: END; ADDED mtt/bin/trans/p/svbksb.p Index: mtt/bin/trans/p/svbksb.p ================================================================== --- mtt/bin/trans/p/svbksb.p +++ mtt/bin/trans/p/svbksb.p @@ -0,0 +1,51 @@ +PROCEDURE svbksb(u: glmpbynp; w: glnparray; v: glnpbynp; + m,n: integer; b: glmparray; VAR x: glnparray); +{ + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.2 1998/08/12 11:09:54 peterg +% % Taken from NR share library nrpas13 as SVBKSB.PAS +% % and renamed svbksb.p +% % +% % Revision 1.1 1998/08/12 11:09:02 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + } + + +(* Programs using SVBKSB must define the types +TYPE + glnparray = ARRAY [1..np] OF real; + glmparray = ARRAY [1..mp] OF real; + glnpbynp = ARRAY [1..np,1..np] OF real; + glmpbynp = ARRAY [1..mp,1..np] OF real; +in the main routine. *) +VAR + jj,j,i: integer; + s: real; + tmp: glnparray; +BEGIN + FOR j := 1 TO n DO BEGIN + s := 0.0; + IF (w[j] <> 0.0) THEN BEGIN + FOR i := 1 TO m DO BEGIN + s := s+u[i,j]*b[i] + END; + s := s/w[j] + END; + tmp[j] := s + END; + FOR j := 1 TO n DO BEGIN + s := 0.0; + FOR jj := 1 TO n DO BEGIN + s := s+v[j,jj]*tmp[jj]; + END; + x[j] := s + END +END; + ADDED mtt/bin/trans/p/svdcmp.p Index: mtt/bin/trans/p/svdcmp.p ================================================================== --- mtt/bin/trans/p/svdcmp.p +++ mtt/bin/trans/p/svdcmp.p @@ -0,0 +1,312 @@ +PROCEDURE svdcmp(VAR a: glmpbynp; m,n: integer; + VAR w: glnparray; VAR v: glnpbynp); + +{ This file is derived from the NUMERICAL RECIPES PASCAL SHAREWARE DISKETTE. + Please read the README file in $MTTPATH/trans/p + } + +{ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.4 1998/08/12 11:26:39 peterg +% % Zapped unnecessary np and mp arguments +% % +% % Revision 1.3 1998/08/12 11:08:03 peterg +% % Put in pythag routine to compute z = sqrt(y^2 + z^2) (as in book) +% % Save loop index l as ll when jumping from loop - using l itself is +% % undefined +% % +% % Revision 1.2 1998/08/12 11:05:33 peterg +% % Taken from NR share library nrpas13 as SVDCMP.PAS +% % and renamed svdcmp.p +% % +% % Revision 1.1 1998/08/12 11:03:57 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +} + + +(* Programs using routine SVDCMP must define the types +TYPE + glnparray = ARRAY [1..np] OF real; + glmpbynp = ARRAY [1..mp,1..np] OF real; + glnpbynp = ARRAY [1..np,1..np] OF real; +in the main routine. *) +LABEL 1,2,3; +CONST + nmax=100; +VAR + nm,l,k,j,jj,its,i,ll : integer; + z,y,x,scale,s,h,g,f,c,anorm : real; + rv1 : ARRAY [1..nmax] OF real; + +FUNCTION pythag(a,b : real): real; +VAR p,at,bt : REAL; +BEGIN + at:=abs(a); + bt:=abs(b); + IF at>bt THEN + p:= at*sqrt(1.0+sqr(bt/at)) + ELSE + IF bt=0.0 THEN + p := 0.0 + ELSE + p := bt*sqrt(1.0+sqr(at/bt)); + pythag := p; +END{pythag}; + + +FUNCTION sign(a,b : real): real; + BEGIN + IF (b >= 0.0) THEN sign := abs(a) ELSE sign := -abs(a) + END; +FUNCTION max(a,b: real): real; + BEGIN + IF (a > b) THEN max := a ELSE max := b + END; +BEGIN + g := 0.0; + scale := 0.0; + anorm := 0.0; + FOR i := 1 TO n DO BEGIN + l := i+1; + rv1[i] := scale*g; + g := 0.0; + s := 0.0; + scale := 0.0; + IF (i <= m) THEN BEGIN + FOR k := i TO m DO BEGIN + scale := scale+abs(a[k,i]) + END; + IF (scale <> 0.0) THEN BEGIN + FOR k := i TO m DO BEGIN + a[k,i] := a[k,i]/scale; + s := s+a[k,i]*a[k,i] + END; + f := a[i,i]; + g := -sign(sqrt(s),f); + h := f*g-s; + a[i,i] := f-g; + IF (i <> n) THEN BEGIN + FOR j := l TO n DO BEGIN + s := 0.0; + FOR k := i TO m DO BEGIN + s := s+a[k,i]*a[k,j] + END; + f := s/h; + FOR k := i TO m DO BEGIN + a[k,j] := a[k,j]+ + f*a[k,i] + END + END + END; + FOR k := i TO m DO BEGIN + a[k,i] := scale*a[k,i] + END + END + END; + w[i] := scale*g; + g := 0.0; + s := 0.0; + scale := 0.0; + IF ((i <= m) AND (i <> n)) THEN BEGIN + FOR k := l TO n DO BEGIN + scale := scale+abs(a[i,k]) + END; + IF (scale <> 0.0) THEN BEGIN + FOR k := l TO n DO BEGIN + a[i,k] := a[i,k]/scale; + s := s+a[i,k]*a[i,k] + END; + f := a[i,l]; + g := -sign(sqrt(s),f); + h := f*g-s; + a[i,l] := f-g; + FOR k := l TO n DO BEGIN + rv1[k] := a[i,k]/h + END; + IF (i <> m) THEN BEGIN + FOR j := l TO m DO BEGIN + s := 0.0; + FOR k := l TO n DO BEGIN + s := s+a[j,k]*a[i,k] + END; + FOR k := l TO n DO BEGIN + a[j,k] := a[j,k] + +s*rv1[k] + END + END + END; + FOR k := l TO n DO BEGIN + a[i,k] := scale*a[i,k] + END + END + END; + anorm := max(anorm,(abs(w[i])+abs(rv1[i]))); + END; + FOR i := n DOWNTO 1 DO BEGIN + IF (i < n) THEN BEGIN + IF (g <> 0.0) THEN BEGIN + FOR j := l TO n DO BEGIN + v[j,i] := (a[i,j]/a[i,l])/g; + END; + FOR j := l TO n DO BEGIN + s := 0.0; + FOR k := l TO n DO BEGIN + s := s+a[i,k]*v[k,j] + END; + FOR k := l TO n DO BEGIN + v[k,j] := v[k,j]+s*v[k,i] + END + END + END; + FOR j := l TO n DO BEGIN + v[i,j] := 0.0; + v[j,i] := 0.0 + END + END; + v[i,i] := 1.0; + g := rv1[i]; + l := i + END; + FOR i := n DOWNTO 1 DO BEGIN + l := i+1; + g := w[i]; + IF (i < n) THEN BEGIN + FOR j := l TO n DO BEGIN + a[i,j] := 0.0 + END + END; + IF (g <> 0.0) THEN BEGIN + g := 1.0/g; + IF (i <> n) THEN BEGIN + FOR j := l TO n DO BEGIN + s := 0.0; + FOR k := l TO m DO BEGIN + s := s+a[k,i]*a[k,j] + END; + f := (s/a[i,i])*g; + FOR k := i TO m DO BEGIN + a[k,j] := a[k,j]+f*a[k,i] + END + END + END; + FOR j := i TO m DO BEGIN + a[j,i] := a[j,i]*g + END + END ELSE BEGIN + FOR j := i TO m DO BEGIN + a[j,i] := 0.0 + END + END; + a[i,i] := a[i,i]+1.0 + END; + FOR k := n DOWNTO 1 DO BEGIN + FOR its := 1 TO 30 DO BEGIN + FOR l := k DOWNTO 1 DO BEGIN + nm := l-1; + IF ((abs(rv1[l])+anorm) = anorm) THEN + BEGIN + ll:=l; + GOTO 2; + END; + IF nm>0 THEN {* Put in by me - see book *} + IF ((abs(w[nm])+anorm) = anorm) THEN + BEGIN + ll:=l; + GOTO 1 + END; + END; +1: c := 0.0; + s := 1.0; + FOR i := ll TO k DO BEGIN + f := s*rv1[i]; + IF ((abs(f)+anorm) <> anorm) THEN BEGIN + g := w[i]; + {**h := sqrt(f*f+g*g);**} + h := pythag(f,g); + w[i] := h; + h := 1.0/h; + c := (g*h); + s := -(f*h); + FOR j := 1 TO m DO BEGIN + y := a[j,nm]; + z := a[j,i]; + a[j,nm] := (y*c)+(z*s); + a[j,i] := -(y*s)+(z*c) + END + END + END; +2: z := w[k]; + IF (ll = k) THEN BEGIN + IF (z < 0.0) THEN BEGIN + w[k] := -z; + FOR j := 1 TO n DO BEGIN + v[j,k] := -v[j,k] + END + END; + GOTO 3 + END; + IF (its = 30) THEN BEGIN + writeln ('no convergence in 30 SVDCMP iterations'); readln + END; + x := w[l]; + nm := k-1; + y := w[nm]; + g := rv1[nm]; + h := rv1[k]; + f := ((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y); + {***g := sqrt(f*f+1.0); writeln(g);***} + g := pythag(f,1.0); + f := ((x-z)*(x+z)+h*((y/(f+sign(g,f)))-h))/x; + c := 1.0; + s := 1.0; + FOR j := ll TO nm DO BEGIN + i := j+1; + g := rv1[i]; + y := w[i]; + h := s*g; + g := c*g; + {**z := sqrt(f*f+h*h);**} + z := pythag(f,h); + rv1[j] := z; + c := f/z; + s := h/z; + f := (x*c)+(g*s); + g := -(x*s)+(g*c); + h := y*s; + y := y*c; + FOR jj := 1 TO n DO BEGIN + x := v[jj,j]; + z := v[jj,i]; + v[jj,j] := (x*c)+(z*s); + v[jj,i] := -(x*s)+(z*c) + END; + {**z := sqrt(f*f+h*h);**} + z := pythag(f,h); + w[j] := z; + IF (z <> 0.0) THEN BEGIN + z := 1.0/z; + c := f*z; + s := h*z + END; + f := (c*g)+(s*y); + x := -(s*g)+(c*y); + FOR jj := 1 TO m DO BEGIN + y := a[jj,j]; + z := a[jj,i]; + a[jj,j] := (y*c)+(z*s); + a[jj,i] := -(y*s)+(z*c) + END + END; + rv1[l] := 0.0; + rv1[k] := f; + w[k] := x + END; +3: END +END; + ADDED mtt/bin/trans/p/zero_input.p Index: mtt/bin/trans/p/zero_input.p ================================================================== --- mtt/bin/trans/p/zero_input.p +++ mtt/bin/trans/p/zero_input.p @@ -0,0 +1,10 @@ +PROCEDURE zero_input(VAR x : InputVector; + N : INTEGER); +VAR i : INTEGER; + +BEGIN + FOR i:=1 TO N DO + x[i] := 0.0; +END; + + ADDED mtt/bin/trans/p/zero_matrix.p Index: mtt/bin/trans/p/zero_matrix.p ================================================================== --- mtt/bin/trans/p/zero_matrix.p +++ mtt/bin/trans/p/zero_matrix.p @@ -0,0 +1,11 @@ +PROCEDURE zero_matrix(VAR A : StateMatrix; + N : INTEGER); +VAR i,j : INTEGER; + +BEGIN + FOR i:=1 TO N DO + FOR j:=1 TO N DO + A[i,j] := 0.0; +END; + + ADDED mtt/bin/trans/p/zero_state.p Index: mtt/bin/trans/p/zero_state.p ================================================================== --- mtt/bin/trans/p/zero_state.p +++ mtt/bin/trans/p/zero_state.p @@ -0,0 +1,10 @@ +PROCEDURE zero_state(VAR x : StateVector; + N : INTEGER); +VAR i : INTEGER; + +BEGIN + FOR i:=1 TO N DO + x[i] := 0.0; +END; + + ADDED mtt/bin/trans/p/zero_vector.p Index: mtt/bin/trans/p/zero_vector.p ================================================================== --- mtt/bin/trans/p/zero_vector.p +++ mtt/bin/trans/p/zero_vector.p @@ -0,0 +1,10 @@ +PROCEDURE zero_vector(VAR x : StateVector; + N : INTEGER); +VAR i : INTEGER; + +BEGIN + FOR i:=1 TO N DO + x[i] := 0.0; +END; + + ADDED mtt/bin/trans/p/zeros.p Index: mtt/bin/trans/p/zeros.p ================================================================== --- mtt/bin/trans/p/zeros.p +++ mtt/bin/trans/p/zeros.p @@ -0,0 +1,11 @@ +PROCEDURE zeros(VAR A : StateMatrix; + N : INTEGER); +VAR i,j : INTEGER; + +BEGIN + FOR i:=1 TO N DO + FOR j:=1 TO N DO + A[i,j] = 0.0; +END; + + ADDED mtt/bin/trans/p2oct Index: mtt/bin/trans/p2oct ================================================================== --- mtt/bin/trans/p2oct +++ mtt/bin/trans/p2oct @@ -0,0 +1,49 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: lbl2cr_txt2txt + +# Label file to constitutive relationship conversion +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/02/07 15:48:33 peterg +## Initial revision +## +## Revision 1.3 1998/07/29 11:09:39 peterg +## Now matches ^$1$ not $1! +## +## Revision 1.2 1998/03/08 21:02:55 peterg +## Now does multiple crs. +## +# Revision 1.1 1997/03/20 12:23:21 peterg +# Initial revision +# +############################################################### + + + +# Inform user +echo "Creating $1_cr.txt" + +rm -f mtt_error + + +# This is the main transformation using gawk +# And remove crs with same name as system +gawk -f $MTTPATH/trans/awk/lbl2cr.awk $1_lbl.txt 2>mtt_error.txt |\ +grep -v "^$1$" \ +> $1_cr.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + ADDED mtt/bin/trans/rbg2abg_m Index: mtt/bin/trans/rbg2abg_m ================================================================== --- mtt/bin/trans/rbg2abg_m +++ mtt/bin/trans/rbg2abg_m @@ -0,0 +1,246 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: rbg2abg_m +# +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.21 2004/09/12 22:27:27 geraint +## Appended 't' to fopen mode string to open in text mode. +## +## Revision 1.20 2004/02/19 12:05:49 gawthrop +## Fix prob. when no bonds +## +## Revision 1.19 2002/04/28 18:55:03 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.18 2001/03/30 15:13:58 gawthrop +## Rationalised simulation modes to each return mtt_data +## +## Revision 1.17 2000/12/05 12:04:03 peterg +## Changed function name to name() +## +## Revision 1.16 2000/12/05 09:04:08 peterg +## Fixed function () compatibility problem. +## +## Revision 1.15 2000/11/03 14:53:33 peterg +## Copy NOTPAR as well +## +## Revision 1.14 2000/09/14 08:41:35 peterg +## Strip off the additional direction info from rbonds +## +## Revision 1.13 2000/03/16 12:53:26 peterg +## Added copy of the %VAR declarations +## Put in the endfunction statement +## +## Revision 1.12 1998/07/28 19:07:48 peterg +## Writes out N_ports as well as n_ports +## +## Revision 1.11 1998/07/25 16:14:44 peterg +## *** empty log message *** +## +## Revision 1.10 1998/07/08 15:34:56 peterg +## Sorted out error exit status +## +## Revision 1.9 1998/07/08 08:24:26 peterg +## Added -I option -- if set prints out the indormation messages +## +## Revision 1.8 1998/02/19 08:57:02 peterg +## Fixed mtt-info bug -- confused filename with number +## +## Revision 1.7 1997/08/05 08:38:23 peterg +## Added n-ports to the argument list in the comment. +## +## Revision 1.6 1996/12/04 21:52:01 peterg +## Uses filenum and fopen instead of filename. +## +## Revision 1.5 1996/08/25 09:20:32 peter +## General error handling. +## +## Revision 1.4 1996/08/24 17:57:41 peter +## Removed `touch mtt_info.txt' +## +## Revision 1.3 1996/08/24 14:58:56 peter +## Fixed missprint - mtt_err --> mtt_error +## +## Revision 1.2 1996/08/24 14:33:07 peter +## Error handling included. +## +## Revision 1.1 1996/08/05 12:22:16 peter +## Initial revision +## +############################################################### + +# Raw bond graph to structured acausal bond graph: mfile format +# The structured BG is described by four matrices: +# junctions: describes the junctions - +# Column 1 Index of component (see components) +# Column 2.. Indices of bonds on junction (see jbonds) +# rows may be padded with zeros +# +# jbonds: describes the true bonds - +# Column 1 Index of component (see components) +# Column 2 Direction +# 1 away from junction +# -1 towards junction +# Column 3 Causality +# 1 stroke at arrow end +# -1 stroke at other end +# 0 no stroke (ie acausal) +# Columns 4:5 x,y coordinates of non-arrow end (in Fig) +# Columns 6:7 x,y coordinates of arrow end (in Fig) +# +# mbonds: describes the modulation bonds - +# Column 1 Index of component at non-arrow end +# Column 2 Index of component at arrow end +# Columns 4:5 x,y coordinates of non-arrow end (in Fig) +# Columns 6:7 x,y coordinates of arrow end (in Fig) +# +# components: describes the comonents - +# Column 1 Type of component +# 0 0-junction +# 1 1-junction +# 2 R component +# 3 C component +# 4 I component +# 11 TF component +# 12 GY component +# 13 A component +# Column 2 Flag for explicit junction +# 4 Explicit component (4 means text type) +# 0 Implicit component +# Column 3-14 fig file information (see fig documentation) +# +# P.J.Gawthrop May 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info;; + -nounits ) + units=no;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +## Set up some vars +sys=$1 +lbl_file=${sys}_lbl.txt +abg_file=${sys}_abg.m + +# Remove the old log file +rm -f rbg2abg_m.log +rm -f ${abg_file} + +#Inform user +echo Creating ${abg_file} + +# Use matrix manipulation to accomplish the transformation +$MATRIX > rbg2abg_m.log 2>mtt_error.txt << EOF + name = '$1' + infofile = fopen('mtt_info.txt', 'wt'); + errorfile = fopen('mtt_error.txt', 'wt'); + + %Convert from the fig version of the bonds to a structured version + [rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = $1_rbg + [n_ports, junk] = size(port_list) + + N_ports = 0; + for i=1:n_ports # Count the true number of ports. + [subport,n_sub] = split_port(port_list(i,:), ','); + N_ports = N_ports+n_sub; + end; + + [n_bonds,m_bonds] = size(rbonds); + if n_bonds>0 + rbonds = rbonds(:,1:6); # Strip the directional information + endif + + [bonds,components,n_vector_bonds] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name, ... + infofile,errorfile); + + %Write the function m-file for the causal bond graph + write_abg(name,bonds,components,n_vector_bonds); +EOF + +## Sets the units for the abg file +test_units() +{ + grep '^[\s]*[#|%]UNITS' < ${lbl_file} >/dev/null + if [ $? = "0" ]; then + grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\ + gawk '{ + printf("mtt_units.sh %s %s %s %s %s\n", sys, $2, $3, $4, $5) + }' sys=${sys} | sh | grep ERROR + if [ $? = "0" ]; then + echo " " *MTT_ERRROR: domains and units are not OK - exiting + exit 1 + else + echo " " domains and units are OK + fi + else + echo " no domains or units declared" + fi +} + +check_ports_exist() +{ + declared_ports=`grep '^[\s]*[#|%]UNITS' < ${lbl_file} | gawk '{print $2}'` + for declared_port in $declared_ports; do + grep "${sys}\.ports\.${declared_port}\.type" ${abg_file} >/dev/null + if [ $? = "1" ]; then + echo "*MTT_ERRROR: Units declared for non-existent port ${declared_port}" + exit 1 + fi + done +} + +set_units() +{ + grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\ + gawk '{ + printf(" %s.ports.%s.domain = \"%s\";\n", sys, $2, $3); + printf(" %s.ports.%s.units.effort = \"%s\";\n", sys, $2, $4); + printf(" %s.ports.%s.units.flow = \"%s\";\n", sys, $2, $5); + }' sys=${sys} +} + +if [ -z "$units" ]; then + echo Checking port domains and units + check_ports_exist; + test_units; + echo "## Port domain and units" >> ${abg_file} + set_units >> ${abg_file} +fi + +# Append any VAR declarations +if [ -f "$1_lbl.txt" ]; then + echo "## Explicit variable declarations" >> ${abg_file} + grep '^[\s]*[%|#][V|P]AR' $1_lbl.txt | tr '%' '#' >> ${abg_file} + grep '^[\s]*[%|#]NOT[V|P]AR' $1_lbl.txt | tr '%' '#' >> ${abg_file} +fi + +## Close off the function +echo "endfunction" >> ${abg_file} + +## Errors and info +if [ "$info" = "info" ]; then + cat mtt_info.txt +fi + +if mtt_error mtt_error.txt +then + exit 0 +else + exit 1 +fi ADDED mtt/bin/trans/rbg2ibg_m Index: mtt/bin/trans/rbg2ibg_m ================================================================== --- mtt/bin/trans/rbg2ibg_m +++ mtt/bin/trans/rbg2ibg_m @@ -0,0 +1,64 @@ +#! /bin/sh + + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: rbg2ibg_m +# Based on rbg2abg_m + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I) + info=info;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +# Set up some vars +sys=$1 +ibg=${sys}_ibg.m +err=mtt_error.txt +log=rbg2ibg_m.log + +# Remove the old log file +rm -f ${ibg} +rm -f ${log} + +# Inform user +echo Creating ${ibg} + +# Use matrix manipulation to accomplish the transformation +${MATRIX} > ${log} 2> ${err} < \_) + if(index(C[M],"[")==1){ + for (i=1;i0)&&(index(C[i],"$")==0) ) + C[i] = sprintf("$%s$", C[i]); + printf(" %s",C[i]); + } + + printf("\\001\n"); + + } + }' +} + + +# Inform user +echo "Creating $1_rbg.m" +echo "Creating $1_cmp.m" +echo "Creating $1_head.fig" +echo "Creating $1_fig.fig" +echo "Creating $1_cmp.fig" +echo "Creating $1_port.fig" +echo "Creating $1_sabg.fig" +echo "Creating $1_art.fig" +echo "Creating $1_labg.fig" + + +# Remove some files that I'm going to append to. +rm -f $1_fig.fig +rm -f $1_head.fig +rm -f $1_cmp.fig +rm -f $1_port.fig +rm -f $1_bnd.fig +rm -f $1_art.fig + +# Create blank files +touch $1_fig.fig +touch $1_head.fig +touch $1_cmp.fig +touch $1_port.fig +touch $1_bnd.fig +touch $1_art.fig + +# Deletes trailing white space in component names +# and break compound objects +sed 's/[ ]*\\001/\\001/' < $1_abg.fig |\ +grep -v "^6 [0-9 ]*" | grep -v "^-6$" >$1_abg.mtt1 + +# Replace [1:5] with [1,2,3,4,5] +gawk '{ + if (match($14, /\[1:[0-9]*\]/)){ + range = substr($14,2,length($14)-6); + split(range,a,":"); + str = "1"; + for (i=2;i<=a[2];i++) str = sprintf("%s,%i", str, i); + sub(/1:[0-9]*/, str, $14); + } + print $0 +}' < $1_abg.mtt1 > $1_abg.mtt2 + + +# The following horrible sed thing is to replace tab by ---- +# this is because I can't get sed to recognise tabs even if FS=" ". +echo "" > $1_abg.mtt3 +sed 's/ /---- /'<$1_abg.mtt2 >> $1_abg.mtt3 + +# This is the main transformation using awk +cat $1_lbl.txt $1_abg.mtt3 | gawk -f $MTTPATH/trans/awk/rbg_fig2m.awk $1 no_alpha_sort=$2 + +rm -f $1_abg.mtt + +#Create the stripped abg file +cat $1_head.fig $1_bnd.fig $1_cmp.fig> $1_sabg.fig + +#Create the latexed abg file +##latex_tidy $1_art.fig +art2latex< $1_art.fig >$1_lart.fig +cmp2latex<$1_cmp.fig >$1_lcmp.fig +cat $1_head.fig $1_bnd.fig $1_lcmp.fig | sed 's/---- / /' > $1_labg.fig +strip_comments < $1_lart.fig | sed 's/---- / /' >> $1_labg.fig + + + + + + ADDED mtt/bin/trans/rcs_header.m Index: mtt/bin/trans/rcs_header.m ================================================================== --- mtt/bin/trans/rcs_header.m +++ mtt/bin/trans/rcs_header.m @@ -0,0 +1,9 @@ + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + ADDED mtt/bin/trans/rcs_header.sh Index: mtt/bin/trans/rcs_header.sh ================================================================== --- mtt/bin/trans/rcs_header.sh +++ mtt/bin/trans/rcs_header.sh @@ -0,0 +1,7 @@ +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + ADDED mtt/bin/trans/rdae2dae_r Index: mtt/bin/trans/rdae2dae_r ================================================================== --- mtt/bin/trans/rdae2dae_r +++ mtt/bin/trans/rdae2dae_r @@ -0,0 +1,251 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: rdae2dae_r +# Reduce equations to raw differential-algebraic equation conversion +# P.J.Gawthrop 8th May 1991, May 1994, June 1996 +# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 2001/04/11 09:44:26 gawthrop +## Fixed cc and c problems to do with pow(x,y) and integers +## mtt/lib/reduce/fix_c.r is included in rdae2dae and cse2smx_lang for +## -c, -cc and -oct options +## +## Revision 1.6 2001/02/03 13:40:45 gawthrop +## Added explicit MTTNu +## +## Revision 1.5 2000/12/28 12:39:02 peterg +## Put under RCS +## +## Revision 1.4 2000/09/04 08:42:53 peterg +## Put in extra echo to space output +## +## Revision 1.3 2000/09/02 15:55:11 peterg +## Now doesn't include def files in da files +## +## Revision 1.2 2000/09/01 13:36:15 peterg +## Added -partition option +## +## Revision 1.1 2000/09/01 12:14:44 peterg +## Initial revision +## +## Revision 1.3 1998/03/07 12:57:19 peterg +## Fixed logname bug +## +## Revision 1.2 1998/03/07 12:51:20 peterg +## This is the new version of ese2dae - it does not do the CRs at this +## stage to give reduce an easier time. +## +## rese2ese_r does the constitutive relationship bit +## +## Revision 1.1 1998/03/07 12:49:31 peterg +## Initial revision +## +## Revision 1.12 1998/01/31 16:22:59 peterg +## Added IF MTTNx>0 THEN and IF MTTNy>0 THEN before the relevant +## assignements of MTTdX and MTTY to themselves. +## +## Revision 1.11 1997/09/18 09:45:08 peterg +## Canged the comment about linux reduce -- reduce reads this for some +## reason. +## +## Revision 1.10 1997/09/15 14:21:18 peterg +## Reads ese file twice to avoid a bug in Linux reduce !!!??? +## +## Revision 1.9 1997/08/30 09:59:31 peterg +## Changed mehtod of writing out mtty to avoid a strange segmentation violation. +## Now uses MTTY := MTTY; approach. +## +## Revision 1.8 1997/04/23 09:31:20 peterg +## Now reads in the (top level) def file in the generated reduce code. +## +# Revision 1.7 1997/04/23 09:23:15 peterg +# Two argument version in preparation for heirarchical version +# +# Revision 1.6 1996/11/21 15:47:48 peterg +# Now inputs _params.r not _sympar.r +# +## Revision 1.5 1996/11/02 10:17:35 peterg +## Removed default constitutive relationship input. +## +# Revision 1.4 1996/09/12 12:10:05 peter +# Now reads the default constitutive relationship file. +# +## Revision 1.3 1996/08/25 09:43:26 peter +## General error handling. +## +## Revision 1.2 1996/08/25 08:31:28 peter +## Error handling added. +## +############################################################### + + +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -I ) + info=info;; + -partition ) + partition=yes; + blurb='with partitioning'; + ;; + -fixcc ) + include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` + blurb2='fixing c and cc code'; + ;; + *) + echo "$1 is an invalid argument - ignoring"; + exit ;; + esac + shift +done + +#Create the top-level system name +topname=$1 + +#Create the system names +if [ -z "$2" ]; + then + sysname=$topname; + else + sysname=$1_$2; +fi + +defname=$topname"_def.r" +crname=$topname"_cr.r" +subsname=$topname"_subs.r" +rdaename=$sysname"_rdae.r" +daename=$sysname"_dae.r" +logname="rdae2dae.log" + +# Inform user +echo Creating $daename $blurb $blurb2 + +# Remove the old log file +rm -f $logname + +# Use symbolic algebra to accomplish the transformation +$SYMBOLIC >$logname << EOF + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + +% CRs +in "$crname"; + +% Raw dae +in "$rdaename"; + +% Substitution +in "$subsname"; + +% Fix c code if required +$include + + +OFF Echo; +OFF Nat; + +%Create the output file +OUT "$daename"; + +%write "in ""$defname"""; + +write "MTTNu := ", MTTNu; +write "MTTNx := ", MTTNx; +write "MTTNz := ", MTTNz; +write "MTTNy := ", MTTNy; +write "MTTNyz := ", MTTNyz; + +% State +MTT_Matrix := MTTdX$ +MTT_Matrix_name := "MTTdX"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Nonstate +MTT_Matrix := MTTZ$ +MTT_Matrix_name := "MTTZ"$ +MTT_Matrix_n := MTTNz$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Output +MTT_Matrix := MTTy$ +MTT_Matrix_name := "MTTy"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Zero outputs +MTT_Matrix := MTTYz$ +MTT_Matrix_name := "MTTYz"$ +MTT_Matrix_n := MTTNyz$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ +SHUT "$daename"; +quit; + +EOF + +#if [ -n "$partition" ]; then +# rm -f mtt_junk +# # Now for the subsystems +# # Find subsystems +# subsystems=`mtt_get_subsystems $1` +# +# for subsystem in $subsystems; do +# echo Doing $subsystem +# ucname="MTT_"$subsystem"_uc" +# +# Nu=`mtt_getsize -internal $subsystem u` +# echo Nu $Nu +# +# # Use symbolic algebra to accomplish the transformation +# $SYMBOLIC >$logname << EOF +# +# %Read the formatting function +# in "$MTTPATH/trans/reduce_matrix.r"; +# +# % Definitions +# in "$defname"; +# +# % Elementary system equations +# in "$rdaename"; +# +# OFF Echo; +# OFF Nat; +# +# %Create the output file +# OUT "mtt_junk"; +# % Connecting inputs +# MTT_Matrix := $ucname $ +# MTT_Matrix_name := "$ucname" $ +# MTT_Matrix_n := $Nu $ +# MTT_Matrix_m := 1$ +# Reduce_Matrix()$ +# +# shut "mtt_junk"; +#EOF +# echo >> $1_dae.r +# echo %Connections for subsystem $subsystem >> $1_dae.r +# echo >> $1_dae.r +# +# cat mtt_junk >> $1_dae.r +# rm -rf mtt_junk +# done +#fi + +echo "END;" >> $1_dae.r + +# Now invoke the standard error handling. +mtt_error_r $logname + ADDED mtt/bin/trans/reduce_matrix.r Index: mtt/bin/trans/reduce_matrix.r ================================================================== --- mtt/bin/trans/reduce_matrix.r +++ mtt/bin/trans/reduce_matrix.r @@ -0,0 +1,39 @@ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%% Model Transformation Tools %%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Reduce function to write matrices in reduce form +% P.J.Gawthrop January 22 1998 +% Copyright (c) P.J.Gawthrop, 1998 + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 1998/01/22 10:39:01 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + +PROCEDURE Reduce_Matrix; +BEGIN + IF MTT_Matrix_n>0 THEN + IF MTT_Matrix_m>0 THEN + BEGIN + write "clear ", MTT_Matrix_name, ";"; + write "MATRIX ", MTT_Matrix_name, "(", MTT_Matrix_n, ",", + MTT_Matrix_m, ");"; + + FOR i := 1:MTT_Matrix_n DO + FOR j := 1:MTT_Matrix_m DO IF MTT_Matrix(i,j) NEQ 0 THEN + write MTT_Matrix_name, "(", i, ",", j, ") := ", + MTT_Matrix(i,j), ";"; + END; +END; + +END;; ADDED mtt/bin/trans/rep_txt2sh Index: mtt/bin/trans/rep_txt2sh ================================================================== --- mtt/bin/trans/rep_txt2sh +++ mtt/bin/trans/rep_txt2sh @@ -0,0 +1,145 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: rep_txt2sh +# Executes shell commands for report. + +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 2002/05/01 14:07:44 gawthrop +## Added -dr foo (reads files from foo) dir. +## +## Revision 1.6 2002/04/28 18:55:03 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.5 2000/11/27 10:13:25 peterg +## Now passes though options as second argument +## +## Revision 1.4 1998/04/14 18:17:15 peterg +## More messages about Makefile +## +## Revision 1.3 1998/04/14 18:01:04 peterg +## Now executes a Makefile (if it exists) +## +# Revision 1.2 1997/12/06 14:27:53 peterg +# No changes. +# +## Revision 1.1 1997/08/26 09:06:11 peterg +## Initial revision +## +############################################################### + +# Execute a make if Makefile exists +if [ -f Makefile ]; then + echo Executing the Makefile + make + echo Done executing the Makefile + echo +fi + +## Get switches (if any) +mtt_switches=$2 + +# Inform user +echo "Creating representations for $1_rep.tex" + +# Check for old (2 arg) version and update if necessary +mtt_count=`strip_comments < $1_rep.txt | grep -c 'mtt '` +if [ "$mtt_count" = "0" ]; then + echo 'Hmm .. seems to be an old format. creating new file' + echo "Old version saved as $1_rep.txt.SAVE" + mv $1_rep.txt $1_rep.txt.SAVE + strip_comments < $1_rep.txt.SAVE |\ + gawk '{print "mtt", sys, $1, $2}' sys="$1" >$1_rep.txt +fi + + +# Execute the commands - quietly and untidily! +# But use switches +# | sed "s/mtt /mtt -q -u $mtt_switches /" #| tee -a JUNK | sh + +strip_comments< $1_rep.txt | gawk ' +{ + ## Add in the external switches + sub("mtt", sprintf("mtt %s", mtt_switches)); + + ## Count the switches (noting that -i -dr -dw and -de have an argument) + ## and make up a string (switches) containing them + Switches=0; switches = ""; + for (i=2;i<=NF;i++) { + if (match($i,"-")==1) { + Switches++; + switches=sprintf("%s%s", switches, $i); + } + if (match($i,"-i")==1) { + Switches++; + j=i+1; + switches=sprintf("%s%s", switches, $j); + } + if (match($i,"-dr")==1){ + Switches++; + j=i+1; + switches=sprintf("%s%s", switches, $j); + } + if (match($i,"-dw")==1){ + Switches++; + j=i+1; + switches=sprintf("%s%s", switches, $j); + } + if (match($i,"-de")==1){ + Switches++; + j=i+1; + switches=sprintf("%s%s", switches, $j); + } + } + System = $(Switches+2) + Representation = $(Switches+3); + Multiple = "odes odeso sms smso daes daeso"; + Language = $(Switches+4); + + args = $(Switches+5); + if ( (length(args)>0)&&(match(Language,"ps")>0)) { + __Args = sprintf("-%s", gensub(/_/, "-", "g", args) ); + } + else + { + __Args = ""; + } + + ## mtt command + printf("%s\n", $0); + + ## Add in the main mtt switches + __Args = sprintf("%s%s", switches, __Args); + + ## Zap -q -u + gsub("-[qu]","", __Args); + + ## Zap blanks + gsub(" ","", __Args); + + ## copy result to long name file + SysRepLang = sprintf("%s_%s.%s", System, Representation, Language); + if (length(__Args)==0) + __Args = "-noargs"; + SysRepArgLang = sprintf("%s_%s%s.%s", System, Representation, __Args, Language); + printf("echo Creating %s\n", SysRepArgLang); + printf("cp %s %s\n", SysRepLang, SysRepArgLang); + +}' mtt_switches="${mtt_switches}" | sh + +echo "Done creating representations for $1_rep.tex" + + + + ADDED mtt/bin/trans/rep_txt2tex Index: mtt/bin/trans/rep_txt2tex ================================================================== --- mtt/bin/trans/rep_txt2tex +++ mtt/bin/trans/rep_txt2tex @@ -0,0 +1,254 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: rep_txt2tex +# Converts the text file dercribing a report to a report. +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2003/08/19 15:40:25 gawthrop +## Fix _ prob in section headers. +## +## Revision 1.5 2003/08/19 13:10:47 gawthrop +## More arg stuff +## +## Revision 1.4 2002/05/09 16:07:54 gawthrop +## Now handles multiple options whis .tex files as well +## +## Revision 1.3 2002/05/01 14:07:05 gawthrop +## Added -dr foo (reads files from foo) dir. +## +## Revision 1.2 2002/04/28 18:55:03 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.1 2000/12/27 15:57:31 peterg +## Initial revision +## +## Revision 1.15 2000/04/06 10:57:12 peterg +## Removed debug line +## +## Revision 1.14 2000/04/06 10:51:14 peterg +## replaces $PWD by `pwd` for sh compatibility +## +## Revision 1.13 1999/10/19 23:47:27 peterg +## Rewrote for the extra representations - but with .ps at the end +## Need to retrofit old desc files using multiple figures +## +## Revision 1.12 1999/10/19 03:33:01 peterg +## Temporaraly removed argument stripping +## +## Revision 1.11 1999/02/17 02:00:29 peterg +## Absolute pathname for files. +## Indirect include via \input +## +## Revision 1.10 1998/08/25 12:45:27 peterg +## Added icad to languages +## +## Revision 1.9 1998/03/09 13:26:22 peterg +## Removed `system' from part and section headers. +## +## Revision 1.8 1998/02/09 08:59:35 peterg +## Minor debugging lines removed. +## +## Revision 1.7 1998/01/29 19:32:33 peterg +## Removed a spurious X from the file -- tried to run the X server !!! +## +## Revision 1.6 1997/12/04 22:08:52 peterg +## Handles multiple odes.ps files +## +## Revision 1.5 1997/12/04 17:05:57 peterg +## Now handles multiple odeso.ps files +## +## Revision 1.4 1997/08/25 09:15:48 peterg +## Don't do sections for unrecognised languages. +## +# Revision 1.3 1997/06/27 13:28:25 peterg +# New version using explicit command line arguments in the text file +# +## Revision 1.2 1997/05/19 16:11:36 peterg +## Modified section headers. +## +# Revision 1.1 1996/08/18 20:00:38 peter +# Initial revision +# +############################################################### + +documenttype=$2; +mtt_switches=$4 + +## Remove -u and -q +mtt_switches=`echo ${mtt_switches} | sed 's/-[qu]//g'` + +if [ "$documenttype" = "book" ]; then # do book version + # Inform user + echo "Creating $1_rep.tex (directory version)" + strip_comments < $1_rep.txt|\ + gawk ' +BEGIN{ +oldpart = "" +} +{ + # Find directory name. + for (i=1;i1) + part = a[N-1]; + if (length(part)>0) + if (part!=oldpart) + printf("\\part{\\textbf{%s}}\n", part); + oldpart=part; + printf("\\chapter{\\textbf{%s}}\n", $(NF-2)); + printf("\\label{chap:%s(%s)}\n", $(NF-2), directory); + printf("\\input{%s/%s_rep}\n\n", directory, $(NF-2)); + }' > $1_rep.tex + + +else # do article and section version + +if [ -z "$3" ]; then + directory=""; +else + directory=$3/; +fi + +# Inform user +echo "Creating $1_rep.tex" + +# Create the LaTeX file +strip_comments <$1_rep.txt |\ +gawk ' +{ + ## Add in the external switches + sub("mtt", sprintf("mtt %s", mtt_switches)); + + ## Count the switches (noting that -i -dr -dw and -de have an argument) + ## and make up a string (switches) containing them + Switches=0; switches = ""; + for (i=2;i<=NF;i++) { + if (match($i,"-")==1) { + Switches++; + switches=sprintf("%s%s", switches, $i); + } + if (match($i,"-i")==1) { + Switches++; + j=i+1; + switches=sprintf("%s%s", switches, $j); + } + if (match($i,"-dr")==1){ + Switches++; + j=i+1; + switches=sprintf("%s%s", switches, $j); + } + if (match($i,"-dw")==1){ + Switches++; + j=i+1; + switches=sprintf("%s%s", switches, $j); + } + if (match($i,"-de")==1){ + Switches++; + j=i+1; + switches=sprintf("%s%s", switches, $j); + } + } + print "%%%" switches + System = $(Switches+2) + Representation = $(Switches+3); + Multiple = "odes odeso sms smso daes daeso"; + Language = $(Switches+4); + Languages = "tex txt r m c h ps icad"; + args = $(Switches+5); + quote = "\047"; + args = gensub(quote, "", "g", args); + args = gensub(/"/, "", "g", args); +# args = substr(Args,2,length(Args)-2); +# if ( (length(Args)>0)&&(match(Multiple,Representation)>0)) { + if ( (length(args)>0)&&(match(Language,"ps")>0)) { + _Args = sprintf("-%s", args); + __Args = sprintf("-%s", gensub(/_/, "_", "g", args) ); + ___Args = sprintf("-%s", gensub(/,/, "-", "g", args) ); + } + else + { + _Args = ""; + __Args = ""; + ___Args = ""; + } + + ## Add in the mtt args + __Args = sprintf("%s%s", switches, __Args); + + ## Treat no arguments as -noargs + if (length(__Args)==0){ + __Args = "-noargs"; + header_args = ""; + } + else { + header_args = __Args; + gsub("-", " -", header_args); + gsub(/_/, "\\_", header_args); + header_args = sprintf("(%s)", header_args); + } + +print "%%" __Args "%%" +# print "DEBUG", Language, args, _Args, __Args + RepLang = sprintf("%s%s.%s", Representation, __Args, Language); + SysRepLang = sprintf("%s_%s", System, RepLang); + SysRepLangArgs = sprintf("%s_%s", System, RepLang, __Args); + SysRep = sprintf("%s_%s%s", System, Representation, __Args); + filename = gensub(/,/, "-", "g", SysRep); + FileName = sprintf("%s/%s", PWD, filename); + section_head = sprintf("\\textbf{%s\\_%s.%s} \\emph{%s}", + System,Representation,Language, header_args); + +# section headings + if (match(Languages,Language)>0) { + print "\n\n\\section{" section_head "}"; + print "\\label{sec:" SysRepLangArgs "}"; + print "\\index{\\textbf{" System "} -- " Representation "}"; + + print "\n\nMTT command:"; + print "\\begin{verbatim}"; + for (i=1;i<=NF;i++) printf("%s ", $i); + print "\n\\end{verbatim}"; + } + +# tex files + if( match("tex",Language)>0) { + printf(" \\input{%s}\n", FileName); +# command = sprintf("sed s!fig{!fig{%s! < %s_%s.%s", Directory, System, Representation, Language); +# system(command); +} + +# text files + if( match("txt r m c h icad",Language)>0) { + print " \\begin{verbatim}"; + command = sprintf("cat %s.txt", filename); + system(command); + print " \\end{verbatim}"; + } +# ps files + if( match("ps",Language)>0) { + printf("This representation is given as Figure \\Ref{fig:%s}.\n", SysRepLangArgs); + Label = sprintf("%s", SysRepLangArgs); + Caption = sprintf("System \\textbf{%s}, representation %s (%s)", System, Representation, __Args); + printf("\\fig{%s}\n {%s}\n {0.9}\n {%s}\n",FileName,Label,Caption); + } +} +END { + +}' mtt_switches="${mtt_switches}" System=$1 Directory=$directory PWD=`pwd` > $1_rep.tex + +fi ADDED mtt/bin/trans/reps_txt2tk Index: mtt/bin/trans/reps_txt2tk ================================================================== --- mtt/bin/trans/reps_txt2tk +++ mtt/bin/trans/reps_txt2tk @@ -0,0 +1,71 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: reps_txt2tk +# Creates tk/tcl file for xmtt. +# Copyright (c) P.J.Gawthrop, 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 2000/12/28 12:39:34 peterg +## Put under RCS +## +## Revision 1.4 2000/04/05 07:37:27 peterg +## *** empty log message *** +## +## Revision 1.3 1999/08/18 06:15:48 peterg +## Stripped down to just representations menu - see mtt_make_menu +## +## Revision 1.2 1999/03/09 00:03:19 peterg +## Revisions for xmtt +## +## Revision 1.1 1998/10/20 08:13:14 peterg +## Initial revision +## +############################################################### + +sep='|'; # Separates the languages from the rest. + +# Create reps menu +gawk --field-separator=$sep '{ + +# Find the rep and the title + split($1,REP," "); + rep=REP[1]; +# find the languages + N=split($2,LANG," "); + +# Important representation? + if (index(rep,"*")) { + # Zap * + rep=substr(rep,1,length(rep)-1); + sub(/\*/,"",$1); + printf("\n# Menus for representation %s\n", rep) + printf(".rep.rep add cascade -label \"%s\" -menu .rep.rep.%s\n", $1, rep); + printf("menu .rep.rep.%s\n", rep); + for (i=1;i<=N;i++) { + lang = LANG[i]; + printf(" set mtt {mtt_pause $args $system %s %s} \n", rep, lang); + title = sprintf("Output_log_for_representation_%s_(language_%s)", rep, lang); + printf(".rep.rep.%s add command -label \"%s\" ", rep, lang); + printf(" -command \"exec xterm -title %s -e $mtt &\" \n", title); + } + } + else { + printf("\n# Menus for representation %s\n", rep) + printf(".repall.repall add cascade -label \"%s\" -menu .repall.repall.%s\n", $1, rep); + printf("menu .repall.repall.%s\n", rep); + for (i=1;i<=N;i++) { + printf(" set mtt {mtt $args $system %s %s; mtt_pause} \n", rep, LANG[i]); + printf(".repall.repall.%s add command -label \"%s\" ", rep, LANG[i]); + printf(" -command \"exec echo $mtt &; exec $mtt &\" \n"); + } + } +}' + ADDED mtt/bin/trans/rest Index: mtt/bin/trans/rest ================================================================== --- mtt/bin/trans/rest +++ mtt/bin/trans/rest @@ -0,0 +1,22 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: rest +# Gives remainder of space seperated string +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/10/10 07:44:20 peterg +## Initial revision +## +############################################################### + +echo $1 | cut -d ' ' -f 2- + ADDED mtt/bin/trans/simpar_txt2h Index: mtt/bin/trans/simpar_txt2h ================================================================== --- mtt/bin/trans/simpar_txt2h +++ mtt/bin/trans/simpar_txt2h @@ -0,0 +1,50 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: simpar_txt2h + +# Numerical parameters to c format +# P.J.Gawthrop May 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/05/13 08:56:28 peterg +## Initial revision +## +############################################################### + + +system=$1 + + +# Inform user +echo "Creating $1_simpar.h" + +rm -f mtt_error + +#Write some file headers +echo '/*' > $1_simpar.h +echo "Simulation parameter file for system $1 ($1_simpar.h)" >> $1_simpar.h +echo "This file provides the system simulation parameters in c form" >> $1_simpar.h +echo "Generated by MTT at `date`" >> $1_simpar.h +echo "from $1_simpar.txt" >> $1_simpar.h +echo '*/' >> $1_simpar.h +echo >> $1_simpar.h + +# Now do the parameters + +sed 's/ //g' $1_simpar.txt |\ + gawk -F '=' '/=/ {print "#define", $1, $2}' >> $1_simpar.h + + + + + + ADDED mtt/bin/trans/sm2can_r Index: mtt/bin/trans/sm2can_r ================================================================== --- mtt/bin/trans/sm2can_r +++ mtt/bin/trans/sm2can_r @@ -0,0 +1,372 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sm2can_r +# state matrices to various canonical forms. +# P.J.Gawthrop 12 Jan 1997 +# Copyright (c) P.J.Gawthrop 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +# Inform user +echo Creating $1_can.r -- NOTE this is for SISO systems only. + +# Remove the old log file +rm -f sm2can_r.log + +# Use reduce to accomplish the transformation +reduce >sm2can_r.log << EOF + +in "$1_def.r"; +in "$1_sm.r"; +in "$1_tf.r"; + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + + +OFF Echo; +OFF Nat; + +% Find the controllability and observibility matrices. +MATRIX MTTCon(MTTNx,MTTNX); +MTTAB := MTTB; +FOR j := 1:MTTNx DO + BEGIN + FOR i := 1:MTTNx DO + MTTCon(i,j) := MTTAB(i,1); + MTTAB := MTTA*MTTAB; + END; + +MATRIX MTTObs(MTTNx,MTTNX); +MTTCA := MTTC; +FOR i := 1:MTTNx DO + BEGIN + FOR j := 1:MTTNx DO + MTTObs(i,j) := MTTCA(1,j); + MTTCA := MTTCA*MTTA; + END; + +%Canonical forms: +% This statement makes Gs a scalar transfer function +Gs := MTTtf(1,1); + +% Numerator and denominator polynomials +bs := num(gs); +as := den(gs); + +% extract coeficients and divide by coeff of s^n +% reverse operator puts list with highest oder coeffs first +ai := reverse(coeff(as,s)); +a0 := first(ai); +MTTn := length(ai) - 1; + + +% Normalised coeficients; +ai := reverse(coeff(as/a0,s)); +bi := reverse(coeff(bs/a0,s)); +MTTm := length(bi)-1; + +% Zap the (unity) first element of ai list; +ai := rest(ai); + +% System in controller form +% MTTA_c matrix +matrix MTTA_c(MTTn,MTTn); + +% First row is ai coefficients +for i := 1:MTTn do + MTTA_c(1,i) := -part(ai,i); + +% (MTTn-1)x(MTTn-1) unit matrix in lower left-land corner (if n>1) +if MTTn>1 then + for i := 1:MTTn-1 do + MTTA_c(i+1,i) := 1; + +% B_c vector; +matrix MTTB_c(MTTn,1); +MTTB_c(1,1) := 1; + +% C_c vector; +matrix MTTC_c(1,MTTn); +for i := 1:MTTm+1 do + MTTC_c(1,i+MTTn-MTTm-1) := part(bi,i); + +% D_c +MTTD_c := MTTD; + +%Observable form. +MTTA_o := tp(MTTA_c); +MTTB_o := tp(MTTC_c); +MTTC_o := tp(MTTB_c); +MTTD_o := MTTD; + +%Controllability matrix of controllable form +MATRIX MTTCon_c(MTTNx,MTTNX); +MTTAB := MTTB_c; +FOR j := 1:MTTNx DO + BEGIN + FOR i := 1:MTTNx DO + MTTCon_c(i,j) := MTTAB(i,1); + MTTAB := MTTA_c*MTTAB; + END; + +% Transformation matrix; +MTTT_c := MTTCon_c*MTTCon^(-1); + +%Observability matrix of observer form +MATRIX MTTObs_o(MTTNx,MTTNX); +MTTCA := MTTC_o; +FOR i := 1:MTTNx DO + BEGIN + FOR j := 1:MTTNx DO + MTTObs_o(i,j) := MTTCA(1,j); + MTTCA := MTTCA*MTTA_o; + END; + +% Transformation matrix; +MTTT_o := MTTObs^(-1)*MTTObs_o; + +%%%% Controller design %%%%% + +% gain in controller form: +matrix MTTk_c(1,mttn); +matrix alpha_c(9,1); +alpha_c(1,1) := alpha_c1; +alpha_c(2,1) := alpha_c2; +alpha_c(3,1) := alpha_c3; +alpha_c(4,1) := alpha_c4; +alpha_c(5,1) := alpha_c5; +alpha_c(6,1) := alpha_c6; +alpha_c(7,1) := alpha_c7; +alpha_c(8,1) := alpha_c8; +alpha_c(9,1) := alpha_c9; + + +for i := 1:MTTNx do + MTTk_c(1,i) := alpha_c(i,1) - part(ai,i); + +% Gain in physical form +MTTk := MTTk_c*MTTT_c; + +%%%% Observer design %%%%% +% gain in Observer form: +matrix MTTl_o(MTTn,1); +matrix alpha_o(9,1); +alpha_o(1,1) := alpha_o1; +alpha_o(2,1) := alpha_o2; +alpha_o(3,1) := alpha_o3; +alpha_o(4,1) := alpha_o4; +alpha_o(5,1) := alpha_o5; +alpha_o(6,1) := alpha_o6; +alpha_o(7,1) := alpha_o7; +alpha_o(8,1) := alpha_o8; +alpha_o(9,1) := alpha_o9; + +for i := 1:MTTNx DO + MTTL_o(i,1) := alpha_o(i,1) - part(ai,i); + +% Gain in physical form +MTTL := MTTT_o*MTTL_o; + +% Steady-state stuff +% Create the matrix [A B; C D]; +matrix ABCD(MTTn+1,MTTn+1); +for i := 1:MTTNx do + for j := 1:MTTNx do + ABCD(i,j) := MTTA(i,j); + +for i :=1:MTTNx do + ABCD(i,MTTNx+1) := MTTB(i,1); + +for j := 1:MTTNx do + ABCD(MTTNx+1,j) := MTTC(1,j); + +ABCD(MTTNx+1,MTTNx+1) := MTTD(1,1); + +matrix zero_one(MTTNx+1,1); +zero_one(MTTNx+1,1) := 1; + +%Find N vector +Nxu := ABCD^(-1)*zero_one; + +%Extract the parts +MATRIX MTTX_r(MTTNx,1); +FOR i := 1:MTTNx DO + MTTX_r(i,1) := Nxu(i,1); + +MTTu_r := Nxu(MTTNx+1,1); + + +% Compensator + +matrix zero(MTTNx,1); +%State matrices +MTTA_comp := MTTA - MTTL*MTTC - MTTB*MTTK; +MTTB_comp := -MTTL; +MTTC_comp := -MTTK; + +%Transfer function +%Ds := C_d*((s*MTTI - A_d)^(-1))*B_d; +%MTTTFC := Ds; + +%Create the output file +OUT "$1_can.r"; + +%Write out the matrices. + +% Controllable form +MTT_Matrix := MTTA_c$ +MTT_Matrix_name := "MTTA_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +MTT_Matrix := MTTB_c$ +MTT_Matrix_name := "MTTB_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +Reduce_Matrix()$ + +MTT_Matrix := MTTC_c$ +MTT_Matrix_name := "MTTC_c"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + + +% Observable form +MTT_Matrix := MTTA_o$ +MTT_Matrix_name := "MTTA_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +MTT_Matrix := MTTB_o$ +MTT_Matrix_name := "MTTB_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +Reduce_Matrix()$ + +MTT_Matrix := MTTC_o$ +MTT_Matrix_name := "MTTC_o"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Controllability matrix"; +MTT_Matrix := MTTCon$ +MTT_Matrix_name := "MTTCon"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% -Observability matrix"; +MTT_Matrix := MTTObs$ +MTT_Matrix_name := "MTTObs"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% -Controllability matrix - controller form"; +MTT_Matrix := MTTCon_c$ +MTT_Matrix_name := "MTTCon_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Transformation matrix - controller form"; +MTT_Matrix := MTTT_c$ +MTT_Matrix_name := "MTTT_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Gain matrix - controller form"; +MTT_Matrix := MTTK_c$ +MTT_Matrix_name := "MTTK_c"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Gain matrix - physical form"; +MTT_Matrix := MTTK$ +MTT_Matrix_name := "MTTK"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + + +write "% -Observability matrix - Observer form"; +MTT_Matrix := MTTObs_o$ +MTT_Matrix_name := "MTTObs_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Transformation matrix - Observer form"; +MTT_Matrix := MTTT_o$ +MTT_Matrix_name := "MTTT_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Observer Gain matrix - observer form"; +MTT_Matrix := MTTL_o$ +MTT_Matrix_name := "MTTL_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNy$ +Reduce_Matrix()$ + +write "% - Gain matrix - physical form"; +MTT_Matrix := MTTL$ +MTT_Matrix_name := "MTTL"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNy$ +Reduce_Matrix()$ + + +% Controllable form +MTT_Matrix := MTTA_comp$ +MTT_Matrix_name := "MTTA_comp"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +MTT_Matrix := MTTB_comp$ +MTT_Matrix_name := "MTTB_comp"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +Reduce_Matrix()$ + +MTT_Matrix := MTTC_comp$ +MTT_Matrix_name := "MTTC_comp"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + + +KX := MTTK*MTTX_r; +MTTu_r := MTTu_r + KX(1,1); + + + +MTTu_r := MTTu_r; +write "END;"; + +SHUT "$1_can.r"; +quit; + +EOF + +# Now invoke the standard error handling. +mtt_error_r sm2can_r.log ADDED mtt/bin/trans/sm2ir_m Index: mtt/bin/trans/sm2ir_m ================================================================== --- mtt/bin/trans/sm2ir_m +++ mtt/bin/trans/sm2ir_m @@ -0,0 +1,80 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sm2ir_m + +# Transforms descriptor matrix rep to step response + + +# Copyright (c) P.J.Gawthrop, 1996. + + +echo Creating $1_ir.m +echo Creating $1_iro.m +rm -f sm2ir_m.log +rm -f $1_ir.m +rm -f $1_iro.m +rm -f mtt_error + +# if [ "$2" = "" ]; +# then +# PARAMS='T=[0:0.1:10];u0=ones(nu,1);x0=zeros(nx,1);' +# echo Using default parameter $PARAMS +# else +# PARAMS=$2; +# fi + +# PARAMS="$PARAMS ;" + +$MATRIX << EOF > sm2ir_m.log 2>mtt_error.txt + + % Read in the numeric system parameters + mttpar = $1_numpar; + + % Read in the simulation parameters + simpar = $1_simpar; + + [nx,ny,nu,nz,nyz] = $1_def; + t=0; %Just in case it appears in the parameter list. + + + %Defaults + T=[0:simpar.dt:simpar.last]'; + + if exist('u0')==0 + u0 = ones(nu,1); + end; + + if exist('x0')==0 + x0 = zeros(nx,1); + end; + + + [n,m]=size(T); + if m>n + T=T'; + end; + + [A,B,C,D] = $1_sm(mttpar); + [y,x] = sm2ir(A,B,C,D,T,u0,x0); + + if nx>0 + write_matrix([T x], '$1_ir'); + end; + if ny>0 + write_matrix([T y], '$1_iro'); + end; + +EOF + +# Write info +touch mtt_info.txt +cat mtt_info.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + ADDED mtt/bin/trans/sm2smc_r Index: mtt/bin/trans/sm2smc_r ================================================================== --- mtt/bin/trans/sm2smc_r +++ mtt/bin/trans/sm2smc_r @@ -0,0 +1,195 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sm2smc_r +# state matrices to controller canonical form + related matrices +# P.J.Gawthrop 12 Jan 1997 +# Copyright (c) P.J.Gawthrop 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/01/22 13:17:37 peterg +## Initial revision +## +############################################################### +Nu=`mtt_getsize $1 u` +Ny=`mtt_getsize $1 y` + +if [ "$Nu" = "1" ]; then + if [ "$Ny" = "1" ]; then + blurb=' for this siso system' + else + blurb=" using first output of $Ny" + fi +else + if [ "$Ny" = "1" ]; then + blurb=" using first input of $Nu" + else + blurb=" using first input of $Nu and using first output of $Ny" + fi +fi + + +# Inform user +echo Creating $1_smc.r $blurb + +# Remove the old log file +rm -f sm2smc_r.log + +# Use reduce to accomplish the transformation +reduce >sm2smc_r.log << EOF + +in "$1_def.r"; +in "$1_sm.r"; +in "$1_tf.r"; + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + + +OFF Echo; +OFF Nat; + +% Find the controllability matrix +MATRIX MTTCon(MTTNx,MTTNX); +MTTAB := MTTB; +FOR j := 1:MTTNx DO + BEGIN + FOR i := 1:MTTNx DO + MTTCon(i,j) := MTTAB(i,1); + MTTAB := MTTA*MTTAB; + END; + + +%Canonical forms: +% This statement makes Gs a scalar transfer function +Gs := MTTtf(1,1); + +% Numerator and denominator polynomials +bs := num(gs); +as := den(gs); + +% extract coeficients and divide by coeff of s^n +% reverse operator puts list with highest oder coeffs first +ai := reverse(coeff(as,s)); +a0 := first(ai); +MTTn := length(ai) - 1; + + +% Normalised coeficients; +ai := reverse(coeff(as/a0,s)); +bi := reverse(coeff(bs/a0,s)); +MTTm := length(bi)-1; + +% Zap the (unity) first element of ai list; +ai := rest(ai); + +% System in controller form +% MTTA_c matrix +matrix MTTA_c(MTTn,MTTn); + +% First row is ai coefficients +for i := 1:MTTn do + MTTA_c(1,i) := -part(ai,i); + +% (MTTn-1)x(MTTn-1) unit matrix in lower left-land corner (if n>1) +if MTTn>1 then + for i := 1:MTTn-1 do + MTTA_c(i+1,i) := 1; + +% B_c vector; +matrix MTTB_c(MTTn,1); +MTTB_c(1,1) := 1; + +% C_c vector; +matrix MTTC_c(1,MTTn); +for i := 1:MTTm+1 do + MTTC_c(1,i+MTTn-MTTm-1) := part(bi,i); + +% D_c +MTTD_c := MTTD; + +%Controllability matrix of controllable form +MATRIX MTTCon_c(MTTNx,MTTNX); +MTTAB := MTTB_c; +FOR j := 1:MTTNx DO + BEGIN + FOR i := 1:MTTNx DO + MTTCon_c(i,j) := MTTAB(i,1); + MTTAB := MTTA_c*MTTAB; + END; + +% Transformation matrix; +MTTT_c := MTTCon_c*MTTCon^(-1); + + + +%Create the output file +OUT "$1_smc.r"; + +%Write out the matrices. + +% Controllable form +write "% - Controller form"; +MTT_Matrix := MTTA_c$ +MTT_Matrix_name := "MTTA_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +MTT_Matrix := MTTB_c$ +MTT_Matrix_name := "MTTB_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +MTT_Matrix := MTTC_c$ +MTT_Matrix_name := "MTTC_c"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +MTT_Matrix := MTTD_c$ +MTT_Matrix_name := "MTTD_c"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + + +write "% - Controllability matrix"; +MTT_Matrix := MTTCon$ +MTT_Matrix_name := "MTTCon"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + + +write "% -Controllability matrix - controller form"; +MTT_Matrix := MTTCon_c$ +MTT_Matrix_name := "MTTCon_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Transformation matrix - controller form"; +MTT_Matrix := MTTT_c$ +MTT_Matrix_name := "MTTT_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "END;"; + +SHUT "$1_smc.r"; +quit; + +EOF + +# Now invoke the standard error handling. +mtt_error_r sm2smc_r.log ADDED mtt/bin/trans/sm2smo_r Index: mtt/bin/trans/sm2smo_r ================================================================== --- mtt/bin/trans/sm2smo_r +++ mtt/bin/trans/sm2smo_r @@ -0,0 +1,196 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sm2smo_r +# state matrices to cobserver form +# P.J.Gawthrop 12 Jan 1997 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2000/09/11 10:53:54 peterg +## Uses 1st io of mimo to create siso +## +## Revision 1.2 1998/01/22 13:25:22 peterg +## Added END;; to output file. +## +## Revision 1.1 1998/01/22 13:16:43 peterg +## Initial revision +## +############################################################### + +Nu=`mtt_getsize $1 u` +Ny=`mtt_getsize $1 y` + +if [ "$Nu" = "1" ]; then + if [ "$Ny" = "1" ]; then + blurb=' for this siso system' + else + blurb=" using first output of $Ny" + fi +else + if [ "$Ny" = "1" ]; then + blurb=" using first input of $Nu" + else + blurb=" using first input of $Nu and using first output of $Ny" + fi +fi +# Inform user +echo Creating $1_smo.r $blurb + +# Remove the old log file +rm -f sm2smo_r.log + +# Use reduce to accomplish the transformation +reduce >sm2smo_r.log << EOF + +in "$1_def.r"; +in "$1_sm.r"; +in "$1_tf.r"; + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + + +OFF Echo; +OFF Nat; + +% Find observibility matrix. +MATRIX MTTObs(MTTNx,MTTNX); +MTTCA := MTTC; +FOR i := 1:MTTNx DO + BEGIN + FOR j := 1:MTTNx DO + MTTObs(i,j) := MTTCA(1,j); + MTTCA := MTTCA*MTTA; + END; + +%Canonical forms: +% This statement makes Gs a scalar transfer function +Gs := MTTtf(1,1); + +% Numerator and denominator polynomials +bs := num(gs); +as := den(gs); + +% extract coeficients and divide by coeff of s^n +% reverse operator puts list with highest oder coeffs first +ai := reverse(coeff(as,s)); +a0 := first(ai); +MTTn := length(ai) - 1; + + +% Normalised coeficients; +ai := reverse(coeff(as/a0,s)); +bi := reverse(coeff(bs/a0,s)); +MTTm := length(bi)-1; + +% Zap the (unity) first element of ai list; +ai := rest(ai); + +% System in observer form +% MTTA_o matrix +matrix MTTA_o(MTTNx,MTTNx); + +% First column is ai coefficients +for i := 1:MTTNx do + MTTA_o(i,1) := -part(ai,i); + +% (MTTNx-1)x(MTTNx-1) unit matrix in upper right-hand corner (if n>1) +if MTTNx>1 then + for i := 1:MTTNx-1 do + MTTA_o(i,i+1) := 1; + +% C_o vector; +matrix MTTC_o(1,MTTNx); + MTTC_o(1,1) := 1; +MTTC_o; +% B_o vector; +matrix MTTB_o(MTTNx,1); +for i := 1:MTTm+1 do + MTTB_o(i+MTTNx-MTTm-1,1) := part(bi,i); + +% D_o +MTTD_o := MTTD; + +%Observability matrix of observer form +MATRIX MTTObs_o(MTTNx,MTTNX); +MTTCA := MTTC_o; +FOR i := 1:MTTNx DO + BEGIN + FOR j := 1:MTTNx DO + MTTObs_o(i,j) := MTTCA(1,j); + MTTCA := MTTCA*MTTA_o; + END; + +% Transformation matrix; +MTTT_o := MTTObs^(-1)*MTTObs_o; + + +%Create the output file +OUT "$1_smo.r"; + +%Write out the matrices. + +% Observable form +MTT_Matrix := MTTA_o$ +MTT_Matrix_name := "MTTA_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +MTT_Matrix := MTTB_o$ +MTT_Matrix_name := "MTTB_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +MTT_Matrix := MTTC_o$ +MTT_Matrix_name := "MTTC_o"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +MTT_Matrix := MTTD_o$ +MTT_Matrix_name := "MTTD_o"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +write "% -Observability matrix"; +MTT_Matrix := MTTObs$ +MTT_Matrix_name := "MTTObs"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + + +write "% -Observability matrix - Observer form"; +MTT_Matrix := MTTObs_o$ +MTT_Matrix_name := "MTTObs_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Transformation matrix - Observer form"; +MTT_Matrix := MTTT_o$ +MTT_Matrix_name := "MTTT_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + + +write "END;;"; +SHUT "$1_smo.r"; +quit; + +EOF + +# Now invoke the standard error handling. +mtt_error_r sm2smo_r.log ADDED mtt/bin/trans/sm2sr_m Index: mtt/bin/trans/sm2sr_m ================================================================== --- mtt/bin/trans/sm2sr_m +++ mtt/bin/trans/sm2sr_m @@ -0,0 +1,122 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sm2sr_m + +# Transforms descriptor matrix rep to step response + + +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.16 1998/08/11 13:31:05 peterg +## Lowercase mttLAST etc +## +## Revision 1.15 1998/07/27 20:31:40 peterg +## New simpar version +## +## Revision 1.14 1998/07/25 10:00:48 peterg +## *** empty log message *** +## +## Revision 1.13 1997/06/13 12:52:18 peterg +## Removed extra ; from $PARAMS +## +# Revision 1.12 1996/09/12 18:45:31 peter +# Back to rcs. +# +# Revision 1.11 1996/08/24 14:02:39 peter +# Included glabal parameter passing. +# Proper error handling. +# +## Revision 1.10 1996/08/19 15:34:14 peter +## Now based on state - not descriptor matrices. +## +## Revision 1.9 1996/08/18 12:01:45 peter +## Unified format of time responses. +## +## Revision 1.8 1996/08/15 16:23:39 peter +## Uses T in place of t to avoid name clash within function. +## +## Revision 1.7 1996/08/15 11:54:32 peter +## Now has optional initial condition. +## +## Revision 1.6 1996/08/14 09:15:02 peter +## Now encapsulates the data into an m file +## Name changed +## +## Revision 1.5 1996/08/12 20:19:06 peter +## Fiddled about with parameter passing - still not right +## +## Revision 1.4 1996/08/11 19:48:04 peter +## Parameter passing added. +## +## Revision 1.3 1996/08/11 10:38:30 peter +## Minor debugging changes. +## +## Revision 1.2 1996/08/11 10:06:50 peter +## Now allows e format and NaN numbers. +## +## Revision 1.1 1996/08/11 09:45:46 peter +## Initial revision +## +############################################################### + +echo Creating $1_sr.m +echo Creating $1_sro.m +rm -f sm2sr_m.log +rm -f $1_sr.m +rm -f $1_sro.m +rm -f mtt_error + + +# PARAMS="$PARAMS ;" + +$MATRIX << EOF > sm2sr_m.log 2>mtt_error.txt + + % Read in the numeric system parameters + mttpar = $1_numpar; + + % Read in the simulation parameters + simpar = $1_simpar; + + [nx,ny,nu,nz,nyz] = $1_def; + t=0; %Just in case it appears in the parameter list. + + T=[0:simpar.dt:simpar.last]' + + if exist('u0')==0 + u0 = ones(nu,1); + end; + + if exist('x0')==0 + x0 = zeros(nx,1); + end; + + + [n,m]=size(T); + if m>n + T=T'; + end; + + [A,B,C,D] = $1_sm(mttpar); + [y,x] = sm2sr(A,B,C,D,T,u0,x0); + + if nx>0 + write_matrix([T x], '$1_sr'); + end; + if ny>0 + write_matrix([T y], '$1_sro'); + end; + +EOF + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + ADDED mtt/bin/trans/sm_r2m Index: mtt/bin/trans/sm_r2m ================================================================== --- mtt/bin/trans/sm_r2m +++ mtt/bin/trans/sm_r2m @@ -0,0 +1,89 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sm_r2m +# Reduce constained state-space A,B,C,D and E matrices to Matlab +# P.J.Gawthrop July 1990, Feb 1991, May 1991, Sep 91, Dec 93, Jan 94, May 94. +# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.7 1998/06/23 19:18:33 peterg +## Added optional state argument. +## +# Revision 1.6 1997/02/24 14:43:21 peterg +# Now ignores parameters that are numerical. +# +## Revision 1.5 1996/09/12 18:34:44 peter +## Back under rcs. +## +# Revision 1.4 1996/08/24 14:12:26 peter +# Global parameter passing. +# +## Revision 1.3 1996/08/19 18:38:43 peter +## Read in the numerical params etc ... +## +## Revision 1.2 1996/08/19 16:25:18 peter +## Fixed bug when Nx=0. +## +## Revision 1.1 1996/08/19 15:14:51 peter +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_sm.m + +# Remove the old log file +rm -f sm_r2m.log + +#Header +lang_header $1 sm m '' '[mtta,mttb,mttc,mttd]' >$1_sm.m + +# Use reduce to accomplish the transformation +$SYMBOLIC >sm_r2m.log << EOF + +%Read in the definitions file +IN "$1_def.r"; + +%Read the reduce state-space A,B,C and D matrices file +IN "$1_sm.r"; + +%Read in the parameter file +IN "$1_sympar.r"; + +OUT "$1_sm.m1"; + +%Fortran switches - one line expressions +OFF echo; +ON fort$ +cardno!* := 1$ +fortwidth!* := 100$ +OFF period$ + +write "mtta = zeros(", MTTNx, ",", MTTNx, ");"; +write "mttb = zeros(", MTTNx, ",", MTTNu, ");"; +write "mttc = zeros(", MTTNy, ",", MTTNx, ");"; +write "mttd = zeros(", MTTNy, ",", MTTNu, ");"; + +ON NERO; % Suppress zero elements. +mtta := mtta; +mttb := mttb; +mttc := mttc; +mttd := mttd; + +OFF FORT; +write ""; + +SHUT "$1_sm.m1"; +EOF + +cat $1_sm.m1 >> $1_sm.m +#rm -f $1_sm.m1 ADDED mtt/bin/trans/sm_r2tex Index: mtt/bin/trans/sm_r2tex ================================================================== --- mtt/bin/trans/sm_r2tex +++ mtt/bin/trans/sm_r2tex @@ -0,0 +1,100 @@ +#! /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.1 2000/12/27 16:01:35 peterg +## Initial revision +## +## Revision 1.4 1998/02/18 08:25:36 peterg +## Now uses latex_matrix for formatting +## +## 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_$2.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_$2.r"; + +%Read the symbolic parameters file +%%in "$1_sympar.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; + +MATRIX MTT_Matrix(MTTNx,MTTNx); + +OUT "$1_$2.tex"; + +%Write out the state matrices. +write "%state matrices $1"; +write "%File: $1_$2.tex"; +write""; + +MTT_Matrix := MTTA$ +MTT_Matrix_name := "MTTA"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTB$ +MTT_Matrix_name := "MTTB"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTC$ +MTT_Matrix_name := "MTTC"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTD $ +MTT_Matrix_name := "MTTD"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +SHUT "$1_$2.tex"; +quit; +EOF ADDED mtt/bin/trans/smc2ssk_r Index: mtt/bin/trans/smc2ssk_r ================================================================== --- mtt/bin/trans/smc2ssk_r +++ mtt/bin/trans/smc2ssk_r @@ -0,0 +1,117 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: smc2ssk_r +# controller-form state matrices to controller gain k +# P.J.Gawthrop Jan 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1998/02/09 14:16:52 peterg +## Writes end statement to the o/p file +## +## Revision 1.2 1998/01/23 09:30:36 peterg +## Fixed a sign error - the coeficients of a(s) appear with - signs in +## the A_c matrix! +## +## Revision 1.1 1998/01/22 13:16:16 peterg +## Initial revision +## +############################################################### + +Nu=`mtt_getsize $1 u` +Ny=`mtt_getsize $1 y` + +if [ "$Nu" = "1" ]; then + if [ "$Ny" = "1" ]; then + blurb=' for this siso system' + else + blurb=" using first output of $Ny" + fi +else + if [ "$Ny" = "1" ]; then + blurb=" using first input of $Nu" + else + blurb=" using first input of $Nu and using first output of $Ny" + fi +fi + +# Inform user +echo Creating $1_ssk.r $blurb + +# Remove the old log file +rm -f smc2ssk_r.log + +# Use reduce to accomplish the transformation +reduce >smc2ssk_r.log << EOF + +in "$1_def.r"; +in "$1_smc.r"; + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + + +OFF Echo; +OFF Nat; + + +%%%% Controller design %%%%% + +% gain in controller form: +matrix MTTk_c(1,MTTNx); + +matrix alpha_c(9,1); +alpha_c(1,1) := alpha_c1; +alpha_c(2,1) := alpha_c2; +alpha_c(3,1) := alpha_c3; +alpha_c(4,1) := alpha_c4; +alpha_c(5,1) := alpha_c5; +alpha_c(6,1) := alpha_c6; +alpha_c(7,1) := alpha_c7; +alpha_c(8,1) := alpha_c8; +alpha_c(9,1) := alpha_c9; + + +for i := 1:MTTNx do + MTTk_c(1,i) := alpha_c(i,1) + MTTA_c(1,i); + +% Gain in physical form +MTTk := MTTk_c*MTTT_c; + + +%Create the output file +OUT "$1_ssk.r"; + +%Write out the matrices. + +write "% - Gain matrix - controller form"; +MTT_Matrix := MTTK_c$ +MTT_Matrix_name := "MTTK_c"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "% - Gain matrix - physical form"; +MTT_Matrix := MTTK$ +MTT_Matrix_name := "MTTK"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := MTTNx$ +Reduce_Matrix()$ + +write "END;"; + +SHUT "$1_ssk.r"; +quit; + +EOF + +# Now invoke the standard error handling. +mtt_error_r smc2ssk_r.log ADDED mtt/bin/trans/smc_r2tex Index: mtt/bin/trans/smc_r2tex ================================================================== --- mtt/bin/trans/smc_r2tex +++ mtt/bin/trans/smc_r2tex @@ -0,0 +1,114 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: smc_r2tex +# Reduce constrained-state matrices to LaTex constrained-state matrices. +# P.J.Gawthrop January 8th 1997 +# Copyright (c) P.J.Gawthrop, 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2000/08/24 11:43:42 peterg +## Include subs file +## +## Revision 1.1 1998/01/22 13:25:55 peterg +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_smc.tex + +# Remove the old log file +rm -f smc_r2tex.log + +# Use reduce to accomplish the transformation +$SYMBOLIC >smc_r2tex.log<< EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the smconical-form matrices file +in "$1_smc.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; +OFF EXP; +%ON Rounded; +%Precision 5; + + +OUT "$1_smc.tex"; + +%Write out the canonical matrices +write "%Canonical-form matrices $1"; +write "%File: $1_smc.tex"; +write""; + + +% Controllable form +MTT_Matrix := MTTA_c$ +MTT_Matrix_name := "MTTA_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTB_c$ +MTT_Matrix_name := "MTTB_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTC_c$ +MTT_Matrix_name := "MTTC_c"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTD_c$ +MTT_Matrix_name := "MTTD_c"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + +write "% - Controllability matrix"; +MTT_Matrix := MTTCon$ +MTT_Matrix_name := "MTTCon"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% -Controllability matrix - controller form"; +MTT_Matrix := MTTCon_c$ +MTT_Matrix_name := "MTTCon_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% - Transformation matrix - controller form"; +MTT_Matrix := MTTT_c$ +MTT_Matrix_name := "MTTT_c"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + + +SHUT "$1_smc.tex"; +quit; +EOF ADDED mtt/bin/trans/smo2ssl_r Index: mtt/bin/trans/smo2ssl_r ================================================================== --- mtt/bin/trans/smo2ssl_r +++ mtt/bin/trans/smo2ssl_r @@ -0,0 +1,107 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: smo2ssl_r +# observer-form state matrices to Kobserver gain +# P.J.Gawthrop Jan 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/01/23 09:31:03 peterg +## Initial revision +## +############################################################### + +Nu=`mtt_getsize $1 u` +Ny=`mtt_getsize $1 y` + +if [ "$Nu" = "1" ]; then + if [ "$Ny" = "1" ]; then + blurb=' for this siso system' + else + blurb=" using first output of $Ny" + fi +else + if [ "$Ny" = "1" ]; then + blurb=" using first input of $Nu" + else + blurb=" using first input of $Nu and using first output of $Ny" + fi +fi + + +# Inform user +echo Creating $1_ssl.r $blurb + +# Remove the old log file +rm -f smo2ssl_r.log + +# Use reduce to accomplish the transformation +reduce >smo2ssl_r.log << EOF + +in "$1_def.r"; +in "$1_smo.r"; + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + +OFF Echo; +OFF Nat; + + +%%%% Observer design %%%%% +% gain in Observer form: +matrix MTTl_o(MTTNx,1); +matrix alpha_o(9,1); +alpha_o(1,1) := alpha_o1; +alpha_o(2,1) := alpha_o2; +alpha_o(3,1) := alpha_o3; +alpha_o(4,1) := alpha_o4; +alpha_o(5,1) := alpha_o5; +alpha_o(6,1) := alpha_o6; +alpha_o(7,1) := alpha_o7; +alpha_o(8,1) := alpha_o8; +alpha_o(9,1) := alpha_o9; + +for i := 1:MTTNx DO + MTTL_o(i,1) := alpha_o(i,1) + MTTA_o(i,1); + +% Gain in physical form +MTTL := MTTT_o*MTTL_o; + +%Create the output file +OUT "$1_ssl.r"; + +%Write out the matrices. + + +write "% - Observer Gain matrix - observer form"; +MTT_Matrix := MTTL_o$ +MTT_Matrix_name := "MTTL_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNy$ +Reduce_Matrix()$ + +write "% - Gain matrix - physical form"; +MTT_Matrix := MTTL$ +MTT_Matrix_name := "MTTL"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNy$ +Reduce_Matrix()$ + +write "END;"; + +SHUT "$1_ssl.r"; +quit; + +EOF + +# Now invoke the standard error handling. +mtt_error_r smo2ssl_r.log ADDED mtt/bin/trans/smo_r2tex Index: mtt/bin/trans/smo_r2tex ================================================================== --- mtt/bin/trans/smo_r2tex +++ mtt/bin/trans/smo_r2tex @@ -0,0 +1,112 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: smo_r2tex +# Reduce constrained-state matrices to LaTex constrained-state matrices. +# P.J.Gawthrop January 8th 1997 +# Copyright (c) P.J.Gawthrop, 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/01/22 13:17:14 peterg +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_smo.tex + +# Remove the old log file +rm -f smo_r2tex.log + +# Use reduce to accomplish the transformation +reduce >smo_r2tex.log<< EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the observer-form matrices file +in "$1_smo.r"; + + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; +OFF EXP; +%ON Rounded; +%Precision 5; + + +OUT "$1_smo.tex"; + +%Write out the canonical matrices +write "%Canonical-form matrices $1"; +write "%File: $1_smo.tex"; +write""; + + +% Observable form +MTT_Matrix := MTTA_o$ +MTT_Matrix_name := "MTTA_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTB_o$ +MTT_Matrix_name := "MTTB_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTC_o$ +MTT_Matrix_name := "MTTC_o"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +MTT_Matrix := MTTD_o$ +MTT_Matrix_name := "MTTD_o"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +write "% - Observability matrix"; +MTT_Matrix := MTTObs$ +MTT_Matrix_name := "MTTObs"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% -Observability matrix - Observer form"; +MTT_Matrix := MTTObs_o$ +MTT_Matrix_name := "MTTObs_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + +write "% - Transformation matrix - Observer form"; +MTT_Matrix := MTTT_o$ +MTT_Matrix_name := "MTTT_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := MTTNx$ +LaTeX_Matrix()$ + + +SHUT "$1_smo.tex"; +quit; +EOF ADDED mtt/bin/trans/sort_sympar Index: mtt/bin/trans/sort_sympar ================================================================== --- mtt/bin/trans/sort_sympar +++ mtt/bin/trans/sort_sympar @@ -0,0 +1,40 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sort_sympar +# Sorts the symbolic parameters in a nice way. +# P.J.Gawthrop March 1998 +# Copyright (c) P.J.Gawthrop, 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/03/07 15:15:53 peterg +## Initial revision +## +############################################################### + + +# Step 1: sort by variable name +# Step 2: put all varables with same name on same line + + +sort -k 1,1 | \ +gawk '{ + var = $1; sys = $2; + if (var==oldvar) { + oldsys=sprintf("%s,%s",oldsys,sys) + } + else{ + if (length(oldvar)>0) print oldvar "\t" oldsys; + oldvar=var; oldsys=sys + } +} +END{ + print oldvar "\t" oldsys; +}' ADDED mtt/bin/trans/ss_r2m Index: mtt/bin/trans/ss_r2m ================================================================== --- mtt/bin/trans/ss_r2m +++ 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 iss_r2tex.log << EOF + + +%Read the definitions file +in "$1_def.r"; + +%Read the parameter file +%%in "$1_sympar.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplifiy file +in "$1_simp.r"; + +%Read the CR file +in "$1_cr.r"; + +%Read the steady-state file +in "$1_ss.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; +%ON Rounded; +%Precision 5; + +OUT "$1_ss.tex"; +write "% - X0"; +MTT_Matrix := MTTX$ +MTT_Matrix_name := "MTTX"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + +write "% - U"; +MTT_Matrix := MTTU$ +MTT_Matrix_name := "MTTU"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + + +write "% - Y"; +MTT_Matrix := MTTY$ +MTT_Matrix_name := "MTTY"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + +write "% - dX"; +MTT_Matrix := MTTdX$ +MTT_Matrix_name := "MTTdX"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +LaTeX_Matrix()$ + +SHUT "$1_ss.tex"; +quit; +EOF ADDED mtt/bin/trans/ssk2ctf_r Index: mtt/bin/trans/ssk2ctf_r ================================================================== --- mtt/bin/trans/ssk2ctf_r +++ mtt/bin/trans/ssk2ctf_r @@ -0,0 +1,75 @@ +#! /bin/sh + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ssk2ctf_r +# Controller gain k and observer gain l to controller TF +# P.J.Gawthrop Feb 1998 +# Copyright (c) P.J.Gawthrop 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/02/09 14:04:00 peterg +## Renamed matrix to cTF; +## +## Revision 1.1 1998/02/09 13:54:34 peterg +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_ctf.r + +# Remove the old log file +rm -f ssk2ctf_r.log + +# Use reduce to accomplish the transformation +reduce >ssk2ctf_r.log << EOF + +in "$1_def.r"; +in "$1_ssk.r"; +in "$1_ssl.r"; +in "$1_sm.r"; + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + + +OFF Echo; +OFF Nat; + + + +%State matrices of the compensator +A_d := MTTA - MTTL*MTTC - MTTB*MTTK; +B_d := -MTTL; +C_d := -MTTK; +D_d := 0; + +%Transfer function +MTTcTF := C_d*((s*MTTI - A_d)^(-1))*B_d; + +%Create the output file +OUT "$1_ctf.r"; +%Write out the matrices. + +write "% - Compensator TF"; +MTT_Matrix := MTTcTF$ +MTT_Matrix_name := "MTTcTF"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := MTTNy$ +Reduce_Matrix()$ + + +SHUT "$1_ctf.r"; +quit; + +EOF + +# Now invoke the standard error handling. +mtt_error_r ssk2ctf_r.log ADDED mtt/bin/trans/ssk_r2tex Index: mtt/bin/trans/ssk_r2tex ================================================================== --- mtt/bin/trans/ssk_r2tex +++ mtt/bin/trans/ssk_r2tex @@ -0,0 +1,82 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ssk_r2tex +# Reduce constrained-state matrices to LaTex constrained-state matrices. +# P.J.Gawthrop January 8th 1997 +# Copyright (c) P.J.Gawthrop, 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2000/08/24 11:42:46 peterg +## Read subs file +## +## Revision 1.1 1998/01/22 13:16:30 peterg +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_ssk.tex + +# Remove the old log file +rm -f ssk_r2tex.log + +# Use reduce to accomplish the transformation +reduce >ssk_r2tex.log<< EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the smconical-form matrices file +in "$1_ssk.r"; + + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; +OFF EXP; +%ON Rounded; +%Precision 5; + + +OUT "$1_ssk.tex"; + +%Write out the canonical matrices +write "%Canonical-form matrices $1"; +write "%File: $1_ssk.tex"; +write""; + + +write "% - Gain matrix - controller form"; +MTT_Matrix := MTTK_c$ +MTT_Matrix_name := "MTTK_c"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := MTTNx$ +Latex_Matrix()$ + +write "% - Gain matrix - physical form"; +MTT_Matrix := MTTK$ +MTT_Matrix_name := "MTTK"$ +MTT_Matrix_n := 1$ +MTT_Matrix_m := MTTNx$ +Latex_Matrix()$ + +SHUT "$1_ssk.tex"; +quit; +EOF ADDED mtt/bin/trans/ssl_r2tex Index: mtt/bin/trans/ssl_r2tex ================================================================== --- mtt/bin/trans/ssl_r2tex +++ mtt/bin/trans/ssl_r2tex @@ -0,0 +1,78 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ssl_r2tex +# Reduce constrained-state matrices to LaTex constrained-state matrices. +# P.J.Gawthrop January 8th 1997 +# Copyright (c) P.J.Gawthrop, 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/01/22 13:16:30 peterg +## Initial revision +## +############################################################### + + +# Inform user +echo Creating $1_ssl.tex + +# Remove the old log file +rm -f ssl_r2tex.log + +# Use reduce to accomplish the transformation +reduce >ssl_r2tex.log<< EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the obsever gains file +in "$1_ssl.r"; + +%Read the substitution file +in "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +%Read the formatting function +in "$MTTPATH/trans/latex_matrix.r"; + +OFF Echo; +OFF Nat; +OFF EXP; +%ON Rounded; +%Precision 5; + + +OUT "$1_ssl.tex"; + +%Write out the canonical matrices +write "%Canonical-form matrices $1"; +write "%File: $1_ssl.tex"; +write""; + + +write "% - Gain matrix - controller form"; +MTT_Matrix := MTTL_o$ +MTT_Matrix_name := "MTTL_o"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +Latex_Matrix()$ + +write "% - Gain matrix - physical form"; +MTT_Matrix := MTTL$ +MTT_Matrix_name := "MTTL"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +Latex_Matrix()$ + +SHUT "$1_ssl.tex"; +quit; +EOF ADDED mtt/bin/trans/sspar2ss_r Index: mtt/bin/trans/sspar2ss_r ================================================================== --- mtt/bin/trans/sspar2ss_r +++ mtt/bin/trans/sspar2ss_r @@ -0,0 +1,144 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sspar2ss_r +# Reduce steady steady-state parameter file to reduce steady-state: +# X0, and Y0 and U0; +# P.J.Gawthrop 10 July 1990, 22 April 1991, Dec 1993, April 1994 +# Copyright (c) P.J.Gawthrop, 1990, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1998/11/18 11:42:55 peterg +## Added "IF MTTNx>0 THEN" to avoid error message when no states +## +## Revision 1.2 1998/07/22 15:47:28 peterg +## Now operates on ordinary differential equation file. +## +## Revision 1.1 1996/08/25 09:52:20 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_ss.r + +# Remove the old log file +rm -f sspar2ss_r.log + +# Use reduce to accomplish the transformation +$SYMBOLIC >sspar2ss_r.log << EOF + +%Read the definition file +in "$1_def.r"; + +%Read the constitutive relationships (May be used in rss file). +%in "$1_cr.r"; + +%Read the steady-state values +in "$1_sspar.r"; + +%Read in the constrained-state equation +%in "$1_cse.r"; + +%Read in the ode +in "$1_ode.r"; + +%Read the formatting function +in "$MTTPATH/trans/reduce_matrix.r"; + +OFF Echo; +OFF Nat; +OUT "$1_ss.r"; + +IF MTTNx>0 THEN + MTTdx:= MTTdx; + +%Write out the steady-state values (if any) +write "%Steady-state values"; + + +% State +MTT_Matrix := MTTX$ +MTT_Matrix_name := "MTTx"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% State derivative +MTT_Matrix := MTTdX$ +MTT_Matrix_name := "MTTdX"$ +MTT_Matrix_n := MTTNx$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Nonstate +MTT_Matrix := MTTZ$ +MTT_Matrix_name := "MTTZ"$ +MTT_Matrix_n := MTTNz$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Output +MTT_Matrix := MTTy$ +MTT_Matrix_name := "MTTy"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Zero outputs +MTT_Matrix := MTTYz$ +MTT_Matrix_name := "MTTYz"$ +MTT_Matrix_n := MTTNyz$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + +% Input +MTT_Matrix := MTTu$ +MTT_Matrix_name := "MTTu"$ +MTT_Matrix_n := MTTNu$ +MTT_Matrix_m := 1$ +Reduce_Matrix()$ + + +%Write them out by component - but only if values have been set +%(This assumes that if element 1 not set then the rest aren't either) +%ON Rounded; %Make numbers have dec. points-- nice for c +% +%clear MTTx1; +%IF MTTNx>0 THEN +%IF MTTX0(1,1) NEQ MTTX1 THEN +%FOR i := 1:MTTNx DO +%BEGIN +% write "MTTx", i, " := ", MTTX0(i,1); +%END; +% +%clear MTTu1; +%IF MTTNu>0 THEN +%IF MTTu0(1,1) NEQ MTTu1 THEN +%FOR i := 1:MTTNu DO +%BEGIN +% write "MTTu", i, " := ", MTTu0(i,1); +%END; +% +%%Derivatives are zero in the steady-state +%IF MTTNz>0 THEN +%FOR i := 1:MTTNz DO +%BEGIN +% write "MTTdz", i, " := 0"; +%END; + +write "END;"; + +SHUT "$1_ss.r"; +quit; +EOF + +# Now invoke the standard error handling. +mtt_error_r sspar2ss_r.log ADDED mtt/bin/trans/strip_comments Index: mtt/bin/trans/strip_comments ================================================================== --- mtt/bin/trans/strip_comments +++ mtt/bin/trans/strip_comments @@ -0,0 +1,27 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + +# Bourne shell script: strip_comments +# Strips comments from mtt text files +# P.J.Gawthrop July 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/11/18 11:30:19 peterg +## Now strips blank lines as well +## +############################################################### + + +sed 's/%/#/' |\ +gawk --field-separator '#' '{if (length($1)>0) print $1}' |\ +gawk '{if (NF>0) print $0}' + ADDED mtt/bin/trans/strip_notvars.sh Index: mtt/bin/trans/strip_notvars.sh ================================================================== --- mtt/bin/trans/strip_notvars.sh +++ mtt/bin/trans/strip_notvars.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +type=$1 +name=$2 +file=$3 + +notvar="[%|#]NOT[V|P]AR" +grep ${notvar} ${type}_lbl.txt |\ + gawk '{ printf ("%s\t%s\n", $2, name) }' name=${name} \ + >> ${file} + +grep -i pi ${type}_lbl.txt |\ + gawk '{ printf ("pi\t%s\n", name) }' name=${name} \ + >> ${file} ADDED mtt/bin/trans/strip_pars.sh Index: mtt/bin/trans/strip_pars.sh ================================================================== --- mtt/bin/trans/strip_pars.sh +++ mtt/bin/trans/strip_pars.sh @@ -0,0 +1,10 @@ +#! /bin/sh +infile=$1 +name=$2 + + + +var="[%|#][V|P]AR" +grep ${var} ${infile} |\ + gawk '{ printf ("%s\t%s\n", $2, name) }' name=${name} \ + ADDED mtt/bin/trans/struc2gnuplot_txt2wish Index: mtt/bin/trans/struc2gnuplot_txt2wish ================================================================== --- mtt/bin/trans/struc2gnuplot_txt2wish +++ mtt/bin/trans/struc2gnuplot_txt2wish @@ -0,0 +1,585 @@ +#! /bin/sh +# -*-tcl-*- + +sys=$1 + +out=${sys}_gnuplot.wish + +struc=${sys}_struc.txt +dat2=${sys}_odes.dat2 + +Nx=`mtt_getsize ${sys} x` +Ny=`mtt_getsize ${sys} y` + +## write header +cat < ${out} +#!/bin/sh +# -*-tcl-*- Next line replaces shell with wish\\ +exec wish "\$0" "\$@" + +## main window +wm title . "MTT: ${sys}" + +# menu bar +canvas .menubar + +menubutton .menubar.file -text "File" -underline 0 -menu .menubar.file.menu +menu .menubar.file.menu +.menubar.file.menu add command -label "Open (Gnuplot template)" -underline 0 -command open_plotfile +.menubar.file.menu add command -label "Save (Gnuplot template)" -underline 0 -command save_plotfile +.menubar.file.menu add separator +.menubar.file.menu add command -label "Print (PostScript)" -underline 0 -command print_postscript +.menubar.file.menu add separator +.menubar.file.menu add command -label "Quit" -underline 0 -command exit + +menubutton .menubar.edit -text "Edit" -underline 0 -menu .menubar.edit.menu +menu .menubar.edit.menu +.menubar.edit.menu add cascade -label "Axes" -underline 0 -menu .menubar.edit.menu.axes +.menubar.edit.menu add cascade -label "Contour (3D)" -underline 0 -menu .menubar.edit.menu.contour +.menubar.edit.menu add cascade -label "Data style" -underline 0 -menu .menubar.edit.menu.datastyle +.menubar.edit.menu add cascade -label "Grid" -underline 0 -menu .menubar.edit.menu.grid +.menubar.edit.menu add cascade -label "Key" -underline 0 -menu .menubar.edit.menu.key +.menubar.edit.menu add cascade -label "Timestamp" -underline 0 -menu .menubar.edit.menu.time + +menu .menubar.edit.menu.axes +.menubar.edit.menu.axes add command -label "Cartesian" -underline 0 -command { do_cmd "set nopolar ; replot" } +.menubar.edit.menu.axes add command -label "Polar" -underline 0 -command { do_cmd "set polar ; replot" } +.menubar.edit.menu.axes add cascade -label "Ranges" -underline 0 -menu .menubar.edit.menu.axes.range + +menu .menubar.edit.menu.axes.range +.menubar.edit.menu.axes.range add command -label "Set X" -underline 4 -command { do_cmd "set xrange \[[get_value "X axis range? min:max" "*:*"]\] ; replot" } +.menubar.edit.menu.axes.range add command -label "Set Y" -underline 4 -command { do_cmd "set yrange \[[get_value "Y axis range? min:max" "*:*"]\] ; replot" } +.menubar.edit.menu.axes.range add command -label "Set Z" -underline 4 -command { do_cmd "set zrange \[[get_value "Z axis range? min:max" "*:*"]\] ; replot" } + +menu .menubar.edit.menu.contour +.menubar.edit.menu.contour add command -label "Show Contour" -underline 0 -command { do_cmd "set dgrid3d ; set contour ; replot" } +.menubar.edit.menu.contour add command -label "Hide Contour" -underline 0 -command { do_cmd "set nodgrid3d ; set nocontour ; replot" } +.menubar.edit.menu.contour add cascade -label "Surface" -underline 0 -menu .menubar.edit.menu.contour.surface + +menu .menubar.edit.menu.contour.surface +.menubar.edit.menu.contour.surface add command -label "Show Surface" -underline 0 -command { do_cmd "set surface ; replot" } +.menubar.edit.menu.contour.surface add command -label "Hide Surface" -underline 0 -command { do_cmd "set nosurface ; replot" } + +menu .menubar.edit.menu.datastyle +.menubar.edit.menu.datastyle add command -label "Dots" -underline 0 -command { do_cmd "set data style dots ; replot" } +.menubar.edit.menu.datastyle add command -label "Lines" -underline 0 -command { do_cmd "set data style lines ; replot" } +.menubar.edit.menu.datastyle add command -label "Points" -underline 0 -command { do_cmd "set data style points ; replot" } + +menu .menubar.edit.menu.grid +.menubar.edit.menu.grid add cascade -label "Show Grid" -underline 0 -menu .menubar.edit.menu.grid.show +.menubar.edit.menu.grid add cascade -label "Hide Grid" -underline 0 -menu .menubar.edit.menu.grid.hide + +menu .menubar.edit.menu.grid.show +.menubar.edit.menu.grid.show add command -label "Show all ticks" -underline 5 -command { do_cmd "set grid xtics ytics ztics ; replot" } +.menubar.edit.menu.grid.show add command -label "Show X ticks" -underline 5 -command { do_cmd "set grid xtics ; replot" } +.menubar.edit.menu.grid.show add command -label "Show Y ticks" -underline 5 -command { do_cmd "set grid ytics ; replot" } +.menubar.edit.menu.grid.show add command -label "Show Z ticks" -underline 5 -command { do_cmd "set grid ztics ; replot" } + +menu .menubar.edit.menu.grid.hide +.menubar.edit.menu.grid.hide add command -label "Hide all ticks" -underline 5 -command { do_cmd "set grid noxtics noytics noztics ; replot" } +.menubar.edit.menu.grid.hide add command -label "Hide X ticks" -underline 5 -command { do_cmd "set grid noxtics ; replot" } +.menubar.edit.menu.grid.hide add command -label "Hode Y ticks" -underline 5 -command { do_cmd "set grid noytics ; replot" } +.menubar.edit.menu.grid.hide add command -label "Hide Z ticks" -underline 5 -command { do_cmd "set grid noztics ; replot" } + +menu .menubar.edit.menu.key +.menubar.edit.menu.key add command -label "Show Key" -underline 0 -command { do_cmd "set key ; replot" } +.menubar.edit.menu.key add command -label "Hide Key" -underline 0 -command { do_cmd "set nokey ; replot" } +.menubar.edit.menu.key add cascade -label "Position" -underline 0 -menu .menubar.edit.menu.key.posn + +menu .menubar.edit.menu.key.posn +.menubar.edit.menu.key.posn add command -label "Left" -underline 0 -command { do_cmd "set key left ; replot" } +.menubar.edit.menu.key.posn add command -label "Right" -underline 0 -command { do_cmd "set key right ; replot" } +.menubar.edit.menu.key.posn add command -label "Top" -underline 0 -command { do_cmd "set key top ; replot" } +.menubar.edit.menu.key.posn add command -label "Bottom" -underline 0 -command { do_cmd "set key bottom ; replot" } +.menubar.edit.menu.key.posn add command -label "Outside" -underline 0 -command { do_cmd "set key outside ; replot" } +.menubar.edit.menu.key.posn add command -label "Below" -underline 3 -command { do_cmd "set key below ; replot" } + +menu .menubar.edit.menu.time +.menubar.edit.menu.time add command -label "Show Timestamp" -underline 0 -command { do_cmd "set timestamp ; replot" } +.menubar.edit.menu.time add command -label "Hide Timestamp" -underline 0 -command { do_cmd "set notimestamp ; replot" } + +menubutton .menubar.tool -text "Tools" -underline 0 -menu .menubar.tool.menu +menu .menubar.tool.menu +.menubar.tool.menu add cascade -label "gnuplot command" -underline 0 -menu .menubar.tool.menu.gcmd +.menubar.tool.menu add cascade -label "Sort List" -underline 0 -menu .menubar.tool.menu.sort +.menubar.tool.menu add command -label "X-MTT" -underline 0 -command { exec xmtt & } + +menu .menubar.tool.menu.gcmd +.menubar.tool.menu.gcmd add command -label "Show Command" -underline 0 -command show_gnuplot_prompt +.menubar.tool.menu.gcmd add command -label "Hide Command" -underline 0 -command hide_gnuplot_prompt + +menu .menubar.tool.menu.sort +.menubar.tool.menu.sort add command -label "Left to Right" -underline 0 -command { + set sortorder "normal" + set xl [sort_list \$xl \$sortorder ] + set yl [sort_list \$yl \$sortorder ] +} +.menubar.tool.menu.sort add command -label "Right to Left" -underline 0 -command { + set sortorder "reverse" + set xl [sort_list \$xl \$sortorder] + set yl [sort_list \$yl \$sortorder] +} + +button .menubar.quit -text "Quit" -relief flat -command exit + +pack .menubar.file -expand false -fill x -side left +pack .menubar.edit -expand false -fill x -side left +pack .menubar.tool -expand false -fill x -side left +pack .menubar.quit -expand false -fill x -side right + +# list bar +canvas .listbar + +radiobutton .listbar.states -text "States" -value states -variable view -command { .parameters.list configure -listvar xl } +radiobutton .listbar.outputs -text "Outputs" -value outputs -variable view -command { .parameters.list configure -listvar yl } + +checkbutton .listbar.sort -text "Toggle Sort" -relief flat -indicatoron false -onvalue "reverse" -offvalue "normal" -variable sortorder -command { + set xl [sort_list \$xl \$sortorder ] + set yl [sort_list \$yl \$sortorder ] +} + +pack .listbar.states -expand false -fill x -side left +pack .listbar.outputs -expand false -fill x -side left +pack .listbar.sort -expand false -fill x -side right + +# side bar +canvas .plotbar + +tk_optionMenu .plotbar.select select "Select X" "Select Y" "Select Z" + +tk_optionMenu .plotbar.dim dimension "2D" "3D" + +tk_optionMenu .plotbar.plot plottype "Single" "Multi" + +pack .plotbar.dim -expand true -fill x -side right +pack .plotbar.plot -expand true -fill x -side right +pack .plotbar.select -expand true -fill x -side right + +# button bar +canvas .buttonbar + +button .buttonbar.replot -text "Refresh" -relief raised -command { do_cmd "replot" } + +button .buttonbar.newwin -text "New Plot" -relief raised -command { + set windownum [expr 1 + \$windownum] + do_cmd "set term x11 \$windownum" +} + +pack .buttonbar.newwin -expand true -side right -fill x +pack .buttonbar.replot -expand true -side right -fill x + +# rotation bar +canvas .rotationbar +scale .rotationbar.xrot -label "Rotate X" -orient h -from "0" -to "180" -command { do_rotate_3d "xrot" } +scale .rotationbar.zrot -label "Rotate Z" -orient h -from "0" -to "360" -command { do_rotate_3d "zrot" } +pack .rotationbar.xrot -side left -fill x -expand true +pack .rotationbar.zrot -side left -fill x -expand true +.rotationbar.xrot set 30 +.rotationbar.zrot set 60 + + +proc "enable_rotationbar" "" { +} +proc "disable_rotationbar" "" { +} + +## parameter list canvas +canvas .parameters +listbox .parameters.list -background oldlace -foreground black +scrollbar .parameters.yscrollbar -orient v + +## configure scrollbars +.parameters.yscrollbar configure -command ".parameters.list yview" +.parameters.list configure -yscrollcommand ".parameters.yscrollbar set" + +## bind lists +bind .parameters.list <> { + set parameter [ .parameters.list get anchor ] + plot \$parameter + set select "Select Y" +} + +proc "reverse_name" "name" { + set delim "_" + set split_name [split \$name \$delim] + set reversed_name [lindex \$split_name 0] + for {set i 1} {\$i<[llength \$split_name]} {incr i} { + set reversed_name [lindex \$split_name \$i]\$delim\$reversed_name + } + return \$reversed_name +} + +proc "reverse_sort" "list" { + set temp_list {} + set delim " " + foreach name [split \$list \$delim] { + set temp_list \$temp_list\$delim[reverse_name \$name] + } + set temp_list [lsort -ascii \$temp_list] + set list {} + foreach name [split \$temp_list \$delim] { + set list \$list\$delim[reverse_name \$name] + } + return \$list +} + +proc "sort_list" "list sortorder" { + switch -- \$sortorder { + normal { return [lsort -ascii \$list] } + reverse { return [reverse_sort \$list] } + } +} + +EOF + +## create states and outputs lists +gawk ' +($1 == "state") { + name=sys"__"; + label=$4; + sub (name, "", label); + printf "lappend xl %s\n", label +} +($1 == "output") { + name=sys"__"; + label=$4; + sub (name, "", label); + printf "lappend yl %s\n", label +}' sys=${sys} ${struc} >> ${out} + +cat <> ${out} +lappend xl Time +lappend yl Time +.parameters.list configure -listvar yl + +pack .menubar -expand false -fill x -side top +pack .listbar -expand false -fill x -side top +pack .rotationbar -expand false -fill x -side bottom +pack .plotbar -expand false -fill x -side bottom +pack .buttonbar -expand false -fill x -side bottom +pack .parameters.yscrollbar -expand false -fill y -side right +pack .parameters.list -expand true -fill both -side left +pack .parameters -expand true -fill both + +## map names to column numbers +proc "get_state_column" "title" { + switch -- \$title { +EOF + + gawk '($1 == "state") { + name=sys"__"; + label=$4; + sub (name, "", label); + printf "\t\t%s\t{ return %d }\n", label, $2+2+Ny; + } + ' Ny=${Ny} sys=${sys} ${struc} >> ${out} + +cat <> ${out} + } +} + +proc "get_output_column" "title" { + switch -- \$title { +EOF + + gawk '($1 == "output") { + name=sys"__"; + label=$4; + sub (name, "", label); + printf "\t\t%s\t{ return %d }\n", label, $2+1; + } + ' Ny=${Ny} sys=${sys} ${struc} >> ${out} + +cat <> ${out} + } +} + +proc "plot" "title" { + global dimension + global select + global view + global xcolumn + global ycolumn + global zcolumn + global xtitle + global ytitle + global ztitle + if {"\$title" == "Time"} { + set column 1 + } else { + switch -- \$view { + states { set column [get_state_column \$title] } + outputs { set column [get_output_column \$title] } + } + } + switch -- \$select { + "Select X" { + set xcolumn \$column + set xtitle \$title + } + "Select Y" { + set ycolumn \$column + set ytitle \$title + } + "Select Z" { + set zcolumn \$column + set ztitle \$title + set dimension "3D" + } + } + plot_var +} + +## call gnuplot +proc "plot_var" "" { + global xcolumn + global ycolumn + global zcolumn + global xtitle + global ytitle + global ztitle + global dimension + global plottype + global lastplot + switch -- \$dimension { + 2D { + disable_rotationbar + switch -- \$plottype { + Single { + do_cmd "set xlabel '\$xtitle'" + do_cmd "set ylabel '\$ytitle'" + do_cmd "set nokey" + do_cmd "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle x:\$xtitle' " + } + Multi { + do_cmd "set xlabel ''" + do_cmd "set ylabel ''" + do_cmd "set key" + if {"\$lastplot" != "2D"} { + do_cmd "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle x:\$xtitle' " + } else { + do_cmd "replot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle x:\$xtitle' " + } + } + } + } + 3D { + enable_rotationbar + switch -- \$plottype { + Single { + do_cmd "set xlabel '\$xtitle'" + do_cmd "set ylabel '\$ytitle'" + do_cmd "set zlabel '\$ztitle'" + do_cmd "set nokey" + do_cmd "splot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle y:\$ytitle x:\$xtitle' " + } + Multi { + do_cmd "set xlabel ''" + do_cmd "set ylabel ''" + do_cmd "set zlabel ''" + do_cmd "set key" + if {"\$lastplot" != "3D"} { + do_cmd "splot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle y:\$ytitle x:\$xtitle' " + } else { + do_cmd "replot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle y:\$ytitle x:\$xtitle' " + } + } + } + } + } + set lastplot \$dimension +} +## open gnuplot plot file +proc "open_plotfile" "" { + global parameter + if {"\$parameter"==""} { + set name "${sys}.plt" + } else { + set name "\$parameter.plt" + } + set filename [tk_getOpenFile\ + -initialdir ".."\ + -initialfile "\$name"\ + -defaultextension ".plt"\ + -filetypes { + {{Gnuplot} {.plt}} + {{All files} {*}} + } + ] + do_cmd "load '\$filename'" +} + +## save gnuplot plot file +proc "save_plotfile" "" { + global parameter + if {"\$parameter"==""} { + set name "${sys}.plt" + } else { + set name "\$parameter.plt" + } + set filename [tk_getSaveFile\ + -initialdir ".."\ + -initialfile "\$name"\ + -defaultextension ".plt"\ + -filetypes { + {{Gnuplot} {.plt}} + {{All files} {*}} + } + ] + do_cmd "save '\$filename'" +} + +## print output to postscript +proc "print_postscript" "" { + global parameter + global windownum + set filename [tk_getSaveFile\ + -initialdir ".."\ + -initialfile "\$parameter.ps"\ + -defaultextension ".ps"\ + -filetypes { + {{Postscript} {.ps}} + {{All files} {*}} + } + ] + if {\$filename != ""} { + do_cmd "set term postscript" + do_cmd "set output '\$filename'" + do_cmd "replot" + do_cmd "set term x11 \$windownum" + tk_dialog ".printed" "Graph Printed!" "PostScript saved as \$filename" "" "0" "Close" + } +} + +proc "get_value" "string initial" { + frame .f + frame .f.buttons + global get_value_retval + global get_value_status + set get_value_retval "" + set get_value_status "" + + button .f.buttons.ok -text "ok" -command { + set get_value_status "ok" + set get_value_retval [.f.entry get ] + destroy .f + } + button .f.buttons.cancel -text "Cancel" -command { + set get_value_status "cancel" + destroy .f + } + entry .f.entry + label .f.label -text "\$string" + + .f.entry insert 0 "\$initial" + bind .f.entry <> { + set get_value_status "ok" + set get_value_retval [.f.entry get ] + destroy .f + } + + pack .f.buttons.ok -side left -expand false + pack .f.buttons.cancel -side left -expand false + pack .f.label -side top -expand false + pack .f.entry -side top -expand false + pack .f.buttons -side top -expand false + place .f -in .parameters -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside + tkwait variable get_value_retval + if {"\$get_value_status" == "ok"} { + return "\$get_value_retval" + } else { + return "" + } +} + +proc "get_scale" "string min max" { + frame .f + frame .f.buttons + global get_scale_retval + global get_scale_status + set get_scale_retval "" + set get_scale_status "" + + button .f.buttons.ok -text "ok" -command { + set get_scale_status "ok" + set get_scale_retval [.f.scale get ] + destroy .f + } + button .f.buttons.cancel -text "Cancel" -command { + set get_scale_status "cancel" + destroy .f + } + scale .f.scale -orient h -label "\$string" -from "\$min" -to "\$max" + + pack .f.buttons.ok -side left -expand false + pack .f.buttons.cancel -side left -expand false + pack .f.scale -side top -expand false + pack .f.buttons -side top -expand false + place .f -in .parameters -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside + tkwait variable get_value_retval + if {"\$get_scale_status" == "ok"} { + return "\$get_scale_retval" + } else { + return "" + } +} + +proc "do_rotate_3d" "var val" { + switch -- \$var { + xrot { + do_cmd "set view \$val,,, ; replot" + } + zrot { + do_cmd "set view ,\$val,, ; replot" + } + } +} + +proc "show_gnuplot_prompt" "" { + global gnuplot_command + destroy .gcmd + canvas .gcmd + label .gcmd.l -text ">" + entry .gcmd.e -textvariable gnuplot_command + button .gcmd.b -text "<-" -relief flat -command { set gnuplot_command "" } + pack .gcmd.b -side right + pack .gcmd.l -side left + pack .gcmd.e -side top -fill x -expand true + pack .gcmd -expand false -fill x -side bottom -before .rotationbar + focus .gcmd.e + bind .gcmd.e <> { + do_cmd "[.gcmd.e get]" + } +} +proc "hide_gnuplot_prompt" "" { + destroy .gcmd +} + +proc "do_cmd" "string" { + global gnuplot_command + set gnuplot_command "\$string" + puts "\$string" +} + +event add <> + +# Defaults +set parameter "" +set windownum 0 +set view outputs +set lastplot "" +set select "Select Y" +set xcolumn 1 ; set xtitle "Time" +set ycolumn 1 ; set ytitle "Time" +set zcolumn 1 ; set ztitle "Time" + +do_cmd "set mouse" +do_cmd "set timestamp" +do_cmd "set grid" +do_cmd "set nopolar" +do_cmd "set term X11 0" +do_cmd "set key" +do_cmd "set data style lines" + +EOF +chmod +x ${out} ADDED mtt/bin/trans/struc2input_txt2txt Index: mtt/bin/trans/struc2input_txt2txt ================================================================== --- mtt/bin/trans/struc2input_txt2txt +++ mtt/bin/trans/struc2input_txt2txt @@ -0,0 +1,130 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: struc2input_txt2txt +# Creates the deafault numerical parameters file for the system (txt) + +# Copyright (c) P.J.Gawthrop 1997 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.15 2000/12/28 12:44:31 peterg +## *** empty log message *** +## +## 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 +## Added -ss option +## +## Revision 1.10 1998/07/27 11:10:38 peterg +## Put in octave-mode line for Emacs +## +## Revision 1.9 1998/07/25 20:10:37 peterg +## lower case mttu +## +## Revision 1.8 1998/07/25 09:42:09 peterg +## Just sets finrst input to 1 - rest to zero +## +## Revision 1.7 1998/07/25 08:05:41 peterg +## Reverted to original default - not using SS mechanism +## +## Revision 1.6 1998/02/24 10:14:56 peterg +## Now defaults to the steady-state values +## +## Revision 1.5 1998/02/04 12:26:47 peterg +## Simplified output format +## +## Revision 1.4 1998/02/04 11:45:05 peterg +## Less verbose comments. +## +## Revision 1.3 1998/01/29 17:06:21 peterg +## Better annotation of each input +## +## Revision 1.2 1997/05/15 09:44:12 peterg +## Put switches into the input file. +## +# Revision 1.1 1997/05/03 14:55:17 peterg +# Initial revision +# +############################################################### + +#Look for a command line argument +# By default, don't look for BG switches + +while [ -n "`echo $1 | grep '-'`" ]; do + case $1 in + -ss ) + steadystate_computation=yes ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +# Default input +default='1.0' + +#Create the input file complete with headers. +echo '# -*-octave-*- Put Emacs into octave-mode' > $1_input.txt +echo "# Input specification ($1_input.txt)" >> $1_input.txt +echo "# Generated by MTT at `date`" >> $1_input.txt +cat $MTTPATH/trans/rcs_header.sh >> $1_input.txt +echo "# Set the inputs" >> $1_input.txt + +if [ -n "$steadystate_computation" ]; then +# Compute inputs from ss.r file +# Inform user +echo Creating $1_input.txt - compute from steady-state information + +cat $1_ss.r $1_struc.txt | sed 's/\$//' |\ +gawk '{ + if(match($1,"MTTu")>0) { + j++ + split($0,a,"="); + u[j]=a[2]; + } + + if($1=="input") { + i++; + 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 + +gawk '{ + 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 |\ +# gawk '{if (length($1)>0) print tolower($1) "= (t>=0);"}' >> $1_input.txt + + + ADDED mtt/bin/trans/struc2sspar_txt2r Index: mtt/bin/trans/struc2sspar_txt2r ================================================================== --- mtt/bin/trans/struc2sspar_txt2r +++ mtt/bin/trans/struc2sspar_txt2r @@ -0,0 +1,43 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: struc2sspar_txt2txt +# Creates the deafault numerical parameters file for the system (txt) + +# Copyright (c) P.J.Gawthrop 1998 + + +# Inform user +echo Creating $1_sspar.r + + +#Write out the default ss values (0) +#Create the sspar file complete with headers. +echo "% Steady-state parameter file ($1_sspar.r)" > $1_sspar.r +echo "% Generated by MTT at `date`" >> $1_sspar.r +cat $MTTPATH/trans/rcs_header.m >> $1_sspar.r + +echo >> $1_sspar.r + +echo "% Steady-state states" >> $1_sspar.r +gawk '{ + if ($1=="state") + print "MTTX" $2 " := \t0; % " $4 " (" $3 ")" +}' \ + $1_struc.txt >> $1_sspar.r + + +echo "% Steady-state inputs" >> $1_sspar.r +gawk '{ + if ($1=="input") + print "MTTU" $2 " := \t0; % " $4 " (" $3 ")" +}' \ + $1_struc.txt >> $1_sspar.r + + +echo ";;END;" >> $1_sspar.r + + ADDED mtt/bin/trans/struc2state_txt2txt Index: mtt/bin/trans/struc2state_txt2txt ================================================================== --- mtt/bin/trans/struc2state_txt2txt +++ mtt/bin/trans/struc2state_txt2txt @@ -0,0 +1,104 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: struc2state_txt2txt +# Creates the default state file for the system (txt) + +# Copyright (c) P.J.Gawthrop 1998 + + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.10 2000/10/16 08:20:23 peterg +# %% New version with direct naming. +# %% Note ss version is broken - ss.r file in wrong format +# %% +# %% Revision 1.9 2000/10/10 21:03:06 peterg +# %% *** empty log message *** +# %% +# %% Revision 1.8 1998/08/10 13:57:33 peterg +# %% Removed debugging lines +# %% +# %% Revision 1.7 1998/08/10 13:55:11 peterg +# %% Added option of computing from ss values +# %% +# %% Revision 1.6 1998/07/27 20:32:11 peterg +# %% Octave mode forced +# %% +# %% Revision 1.5 1998/07/25 20:10:01 peterg +# %% Lower case mttx +# %% +# %% Revision 1.4 1998/07/25 09:42:37 peterg +# %% Now writes out an array +# %% +# %% Revision 1.3 1998/07/25 08:11:35 peterg +# %% No longer used the SS method - just sets zero states +# %% +# %% Revision 1.2 1998/07/21 16:54:15 peterg +# %% Changed erroneous header +# %% +# %% Revision 1.1 1998/06/27 15:06:40 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +while [ -n "`echo $1 | grep '-'`" ]; do + case $1 in + -ss ) + steadystate_computation=yes ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +# Default state +default='0.0' + +#Create the state file complete with headers. +echo '# -*-octave-*- Put Emacs into octave-mode' > $1_state.txt +echo "# Initial state file ($1_state.txt)" >> $1_state.txt +echo "# Generated by MTT at `date`" >> $1_state.txt +cat $MTTPATH/trans/rcs_header.sh >> $1_state.txt + +#Write out the defaults -- states to steady-state values +echo "# Set the states" >> $1_state.txt + +if [ -n "$steadystate_computation" ]; then +# Compute state from ss.r file +# Inform user +echo Creating $1_state.txt - compute from steady-state information + +cat $1_ss.r $1_struc.txt | sed 's/\$//' |\ +gawk '{ + if(match($1,"MTTx")>0) { + j++ + split($0,a,"="); + x[j]=a[2]; + } + + if($1=="state") { + i++; + # print "x(" i ") =\t", x[i], " \# " $4 " (" $3 ")" + printf("%s =\t%s; # MTT initial value\n", $4, x[i]); + } +}' >> $1_state.txt +else +# Set states to zero +# Inform user +echo Creating $1_state.txt - default states to $default + +gawk '{ + if ($1=="state") printf("%s \t= %s; # MTT initial value\n", $4, default) +}' default=$default <$1_struc.txt >> $1_state.txt + +fi + + ADDED mtt/bin/trans/struc2switch_txt Index: mtt/bin/trans/struc2switch_txt ================================================================== --- mtt/bin/trans/struc2switch_txt +++ mtt/bin/trans/struc2switch_txt @@ -0,0 +1,66 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: struc2switch_txt + +# Structure file - generate a file for switching on states +# P.J.Gawthrop May 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2001/08/02 03:01:08 geraint +## Stopped initialisation of mttopen from over-writing logic.txt contents. +## - comment removed from "sort" input (which put it last) because +## initialisation is inserted in place of the comment by switch_txt2m. +## +## Revision 1.5 2000/10/17 09:20:00 peterg +## *** empty log message *** +## +## Revision 1.4 1998/07/26 10:28:30 peterg +## Added a header line to avoid empty file and to trigger +## switch_txt2m to write initial stuff. +## +## Revision 1.3 1998/07/25 18:50:53 peterg +## Lower case names +## +## Revision 1.2 1997/06/03 15:17:09 peterg +## Changed label to MTT_SWITCH +## +# Revision 1.1 1997/05/13 16:58:59 peterg +# Initial revision +# +############################################################### + + + + +echo Creating $1_switch.txt + +rm -f $1_switch.txt +echo "# These are the switches deduced from ISW and CSW components"\ + > $1_switch.txt + +# This is the main transformation using awk +gawk '{ + if ($1=="state") {i++; if ($3=="MTT_SWITCH") print tolower($4) "\t" i}; +} +END{ +} +' < $1_struc.txt| sort >> $1_switch.txt + +strip_comments < $1_switch.txt | wc -l | gawk '{print $1 " switches found"}' + + + + + + + + ADDED mtt/bin/trans/struc_txt2m Index: mtt/bin/trans/struc_txt2m ================================================================== --- mtt/bin/trans/struc_txt2m +++ mtt/bin/trans/struc_txt2m @@ -0,0 +1,86 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: struc_txt2m + +# Structure file - txt to m conversion +# P.J.Gawthrop April 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 2002/04/28 18:55:03 geraint +## Fixed [ 549658 ] awk should be gawk. +## Replaced calls to awk with call to gawk. +## +## Revision 1.3 2001/10/15 14:20:27 gawthrop +## Now handles the cases where ny or nx or nu are zero +## +## Revision 1.2 2001/03/19 02:28:52 geraint +## Branch merge: merging-ode2odes-exe back to MAIN. +## +## Revision 1.1.2.1 2001/03/06 03:52:15 geraint +## Put back struc_txt2m - required by mtt2sys. +## +############################################################### + + + +# Inform user +echo "Creating $1_struc.m" + +rm -f mtt_error + +#Write some file headers +echo "function [input_name,output_name,state_name] = $1_struc" > $1_struc.m +echo "%% Usage: [input_name,output_name,state_name] = $1_struc" >> $1_struc.m +echo "%% Structure file ($1_struc.m)" >> $1_struc.m +echo "%% Generated by MTT at `date`" >> $1_struc.m + +cat >> $1_struc.m <> $1_struc.m 2>mtt_error.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + ADDED mtt/bin/trans/struc_txt2mstruc Index: mtt/bin/trans/struc_txt2mstruc ================================================================== --- mtt/bin/trans/struc_txt2mstruc +++ mtt/bin/trans/struc_txt2mstruc @@ -0,0 +1,67 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: struc_txt2m + +# Structure file - txt to m-structure conversion +# Copyright (C) 2003 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +sys=$1 +infile=${sys}_struc.txt +fun=${sys}_mstruc +outfile=${fun}.m + +#Inform user +echo Creating ${outfile} + +create_header() { + cat <${outfile} +create_structure >>${outfile} +create_footer >>${outfile} + ADDED mtt/bin/trans/struc_txt2tex Index: mtt/bin/trans/struc_txt2tex ================================================================== --- mtt/bin/trans/struc_txt2tex +++ mtt/bin/trans/struc_txt2tex @@ -0,0 +1,97 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: struc_txt2tex + +# Structure file - text to TeX table conversion +# P.J.Gawthrop April 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 2000/12/28 12:46:59 peterg +## Put under RCS +## +# Revision 1.3 1997/12/06 19:10:41 peterg +# Reverted to tabular --- from supertabular +# +# Revision 1.2 1997/04/15 11:17:58 peterg +# Uses supertabular for long tables. +# +# Revision 1.1 1997/04/15 09:49:04 peterg +# Initial revision +# +############################################################### + + +# Inform user +echo "Creating $1_struc.tex" + +rm -f mtt_error + +#Write some file headers +echo "%% Structure file ($1_struc.txt)" > $1_struc.tex +echo "%% Generated by MTT at `date`" >> $1_struc.tex + +# This is the main transformation using awk +sed 's/_/\\_/g' < $1_struc.txt | gawk ' +function header(what){ + print " \\centering"; + print " \\tablefirsthead{\\hline %"; + print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM "} \\\\"; + print " \\hline"; + print " & Component & System & Repetition \\\\"; + print " \\hline}"; + + print " \\tablehead{\\hline %"; + print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM " (continued)} \\\\"; + print " \\hline"; + print " & Component & System & Repetition \\\\"; + print " \\hline}"; + + print " \\tabletail{\\hline}"; + print " \\begin{supertabular}{|l|l|l|l|}"; +} +#function header(what){ +# print "\\begin{table}[htbp]"; +# print " \\centering"; +# print " \\begin{tabular}{|l|l|l|l|}"; print " \\hline"; +# print " & Component & System & Repetition \\\\"; +# print " \\hline"; +#} +function footer(what){ + print " \\hline"; + print " \\end{supertabular}"; +# print " \\end{tabular}"; +# print " \\caption{" what "}"; +# print "\\end{table}"; + print " \\bigskip"; + print " \\bigskip"; +} + +BEGIN{ +Which="" +} +{ + if ($1!=Which) { + if (Which!="") footer(Which); + header($1); + } + print $2, "&", $3,"&", $4, "&", $5, "\\\\"; + Which = $1; +} +END{ + footer(Which) +} +' SYSTEM=$1 >> $1_struc.tex 2>mtt_error.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + ADDED mtt/bin/trans/sub2subs Index: mtt/bin/trans/sub2subs ================================================================== --- mtt/bin/trans/sub2subs +++ mtt/bin/trans/sub2subs @@ -0,0 +1,29 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sub2subs +# Generates a list of all subsystems associated with system $1 + +# P.J.Gawthrop May 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +# echo the name of the subsystems one level down +sh $1\_sub.sh "echo " + +# Create the corresponding subsystems -- quietly! +#(sh $1\_sub.sh "mtt -q " " sub sh") #>/dev/null +(sh $1\_sub.sh " cmp2sub_m2sh " " ") >/dev/null + + +# Recursively execute the subsystem files +sh $1\_sub.sh "sub2subs " + + + + + + + ADDED mtt/bin/trans/sub_sh2tex Index: mtt/bin/trans/sub_sh2tex ================================================================== --- mtt/bin/trans/sub_sh2tex +++ mtt/bin/trans/sub_sh2tex @@ -0,0 +1,161 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sub_sh2tex +# Converts _sub_sh files to a latex itemized list. +# P.J.Gawthrop May 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 2004/08/26 16:15:40 geraint +## Counts abg.m instead of fig files so that dia models are also included. +## +## Revision 1.5 2004/02/10 16:11:01 gawthrop +## Removed debug +## +## Revision 1.4 2004/02/10 10:22:10 gawthrop +## Do proper arithmetic via let +## Three levels of output +## enumerate, not itemize +## +## Revision 1.3 2004/02/10 10:13:05 gawthrop +## Handles #SUMMARY correctely +## Refined count of subsystems within fig file (avoilds ports with same +## name as system +## +## Revision 1.2 2004/02/10 09:51:07 gawthrop +## Updated obsolete path name. +## +## Revision 1.1 2000/12/27 16:04:08 peterg +## Initial revision +## +## Revision 1.7 1998/02/04 10:59:37 peterg +## Tidied up. +## +# Revision 1.6 1997/09/08 19:42:37 peterg +# Replaced copy by compcopy +# +## Revision 1.5 1997/08/15 11:20:13 peterg +## Explicitly copies compound components (if not already there) +## +# Revision 1.4 1997/06/24 08:28:26 peterg +# Now takes %SUMMARY description from the label file +# Appends count of number of subsystems at that level +# +## Revision 1.3 1997/05/21 10:07:36 peterg +## Fixed \ probs for GNU sh/echo +## +## Revision 1.2 1997/05/19 16:46:17 peterg +## *** empty log message *** +## +# Revision 1.1 1997/05/19 11:29:44 peterg +# Initial revision +# +############################################################### + + +#Useful strings +quote="'"; +listtype="enumerate" + +# Maximum list depth +# Just go to 3 levels +maxlevel=3; + +#Look for a command line argument +labels=''; arg=''; +while [ -n "`echo $1 | grep '-'`" ]; do + case $1 in + -l ) + labels='yes'; arg='-l' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + + +system=$1 +filename=$2 + + +if [ -z "$3" ]; then + level=0; +else + level=$4; +fi +echo "level: $level" +#Top-level commands +if [ -z "$2" ]; then + filename="$1_sub.tex" + + # Inform user + echo "Creating $filename" + + #Write some file headers + echo "% Subsystem file for system $system ($filename)" > $filename + echo "% Generated by MTT at `date`" >> $filename + echo >> $filename +fi + +# Write list item if not at the top level. +if [ -n "$2" ]; then + #Set up some names + filename=$2 + abgfile=$3_abg.m + lblfile=$1_lbl.txt + summary='[%|#]SUMMARY' + + #Get the system description, copying where necesary + mtt -q -u compcopy $system $MTT_LIB/comp/compound + # mtt -q -u $system lbl txt + desc=`grep $summary $lblfile | sed "s/$summary//"` + + #Count the number of subsystems + subs=`grep -c " $system" $abgfile` + + if [ "$labels" = "yes" ]; then + echo ' \item '$desc ' ('$subs') Section \Ref{sec:'$system'}' >> $filename + else + echo ' \item' $desc ' ('$subs')' >> $filename + fi +fi + +# Create the subsystem sh files (if not too deep) +if [ "$level" != "$maxlevel" ]; then + mtt -q -u -l 1 $system sub sh + + # Write the list of subsystems (if they exist). + n_subsystems=`grep -c '$1' $1_sub.sh` + + if [ "$n_subsystems" != "0" ]; then + cat <> $filename + \begin{$listtype} +EOF + # Recursively generate the subsystems + level1=$(( $level + 1 )) + sh $system\_sub.sh "sub_sh2tex $arg " " $filename $system $level1" + cat <> $filename + \end{$listtype} +EOF +#else +# cat <> $filename +# No subsystems. +#EOF +fi +fi + + + + + + + + ADDED mtt/bin/trans/switch_txt2m Index: mtt/bin/trans/switch_txt2m ================================================================== --- mtt/bin/trans/switch_txt2m +++ mtt/bin/trans/switch_txt2m @@ -0,0 +1,155 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: switch_txt2m + +# Convert switch file from txt to m +# P.J.Gawthrop May 1997 +# Copyright (c) P.J.Gawthrop, 1997. + + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.15 2000/12/04 08:23:25 peterg +## Put logic in-line - avoids the if statements +## +## Revision 1.14 2000/11/09 10:29:21 peterg +## open --> mtt_open +## +## Revision 1.13 2000/11/09 10:19:12 peterg +## Explicitly write out the open switches .... +## +## Revision 1.12 2000/11/09 09:52:07 peterg +## Removed [] from zero_state output +## +## Revision 1.11 2000/10/17 09:55:55 peterg +## Now writes to standard output +## Write the name, not the array +## +## Revision 1.10 2000/10/17 09:04:12 peterg +## *** empty log message *** +## +## Revision 1.9 1999/08/02 12:44:21 peterg +## zero_vector --> zero_state. +## +## Revision 1.8 1999/04/20 00:55:40 peterg +## Changed <= to < in switchopen.m +## Removed switch.m generation - redundant +## +## Revision 1.7 1999/04/02 06:30:37 peterg +## New _switchopen +## Removed switcha +## +## Revision 1.6 1998/10/01 18:20:50 peterg +## Split up the three if conditions on the switch and state value into +## three separate ifs. This is because p2c seems to generate incorrect +## code id just the one if is used (???). +## +## Revision 1.5 1998/10/01 16:05:34 peterg +## Separate switch.m file for euler and implicit integration +## +############################################################### + + +# Find system constants +Nx=`mtt_getsize $1 x` # States + +#Write some file headers +#lang_header $1 switch m 'mttx' '[mttx]' > $1_switch.m + +#echo Creating $1_switch.m +# Set states to zero +# gawk '{ +# if ($1=="#"){ +# printf("#== Switches set element of state vector to zero ==#\n") +# } +# else{ +# printf("\n#== Switch: %s ==#\n",$1) +# printf("if (%s==0.0) \n", $1); +# printf(" mttx(%s)=0.0;\n", $2); +# printf("end;\n"); +# printf("if (%s<0.0)\n",$1); +# printf(" if (mttx(%s)<=0.0)\n",$2); +# printf(" mttx(%s)=0.0;\n", $2); +# printf(" end;\n"); +# printf("end;\n"); + +# } +# }' Nx=$Nx < $1_switch.txt >> $1_switch.m + +## Set index version +#echo Creating $1_switchopen.m + +#Write some file headers +#lang_header $1 switchopen m 'mttx' '[open]' > $1_switchopen.m + +## Add the switching logic +#cat >> $1_switchopen.m <> $1_switchopen.m + +# Set states to zero +gawk '{ + if ($1=="#"){ + printf("#== mttopen - boolean vector of open switches ==#\n") + for (i=1;i<=Nx;i++) + printf("mttopen(%i) = 0; # Default to not open\n", i); + } + else{ + printf("\n#== Switch: %s ==#\n",$1) + printf("mttopen(%s) = (abs(%s_logic)<0.5)||((%s_logic<0.0)&&(%s<0.0));\n", $2, $1, $1, $1); +# printf("if (%s_logic==0.0) \n", $1); +# printf(" mttopen(%s) = 1;\n", $2); +# printf("end;\n"); +# printf("if (%s_logic<0.0)\n",$1); +# printf(" if (%s<0.0)\n",$1); +# printf(" mttopen(%s) = 1;\n", $2); +# printf(" end;\n"); +# printf("end;\n"); + + } +}' Nx=$Nx < $1_switch.txt #>> $1_switchopen.m + +#echo Creating $1_switcha.m + +# Implicit integration version +#Write some file headers +# lang_header $1 switcha m 'mttAA,mttx' '[mttAA]' > $1_switcha.m +# gawk '{ +# if ($1=="#"){ +# printf("#== Switches set row and column of A matrix to zero ==#\n") +# } +# else{ +# printf("#== Switch: %s ==#\n",$1) +# printf("if (%s==0.0) \n", $1); +# printf(" for MTTi=1:%s\n",Nx) +# printf(" mttAA(MTTi,%s)=0.0;\n", $2) +# printf(" mttAA(%s,MTTi)=0.0;\n", $2) +# printf(" end;\n"); +# printf(" mttAA(%s,%s) = 1.0;\n", $2,$2); +# printf("end;\n\n") +# +# printf("if (%s<0.0)\n",$1); +# printf(" if (mttx(%s)<=0.0)\n",$2); +# printf(" for MTTi=1:%s\n",Nx) +# printf(" mttAA(MTTi,%s)=0.0;\n", $2) +# printf(" mttAA(%s,MTTi)=0.0;\n", $2) +# printf(" end;\n"); +# printf(" mttAA(%s,%s) = 1.0;\n", $2,$2); +# printf(" end;\n"); +# printf("end;\n"); +# +# } +# }' Nx=$Nx < $1_switch.txt >> $1_switcha.m + + + ADDED mtt/bin/trans/sympar2global_txt2lang Index: mtt/bin/trans/sympar2global_txt2lang ================================================================== --- mtt/bin/trans/sympar2global_txt2lang +++ mtt/bin/trans/sympar2global_txt2lang @@ -0,0 +1,94 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar2global_txt2lang + +# Symbolic parameters to default paramers in computer language +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997. + + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 1998/11/18 11:55:51 peterg +## Now uses sympar2global_txt2m for the m bit +## +## Revision 1.5 1998/07/26 11:00:18 peterg +## Put in exits-- this all needs a good clean +## +## Revision 1.4 1998/07/26 10:50:30 peterg +## Corrected bug. +## +## Revision 1.3 1998/07/26 10:48:18 peterg +## Now strips comments +## +## Revision 1.2 1998/07/25 18:49:00 peterg +## Now uses extended sympars -- sympar + switches +## +## Revision 1.1 1998/06/15 15:24:33 peterg +## Initial revision +## +############################################################### + +# Set up language stuff. +language=$2 + +case $language in + m) + Lc='#'; + Rc='#'; + ;; + c) + Lc='/*'; + Rc='*/'; + ;; + java) + Lc='/*'; + Rc='*/'; + ;; + *) + echo Language $2 not supported - sorry; exit 1 +esac + +cat <0)) { + printf ("global"); + globals_exist=1 + } + if (NF>0) + printf (" ...\n %s", tolower($1)); +} +END{ + if (globals_exist) + print " ;" +}' + +# Now invoke the standard error handling. +# mtt_error mtt_error.txt + + ADDED mtt/bin/trans/sympar2numpar_r2c Index: mtt/bin/trans/sympar2numpar_r2c ================================================================== --- mtt/bin/trans/sympar2numpar_r2c +++ mtt/bin/trans/sympar2numpar_r2c @@ -0,0 +1,97 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar2numpar_r2m +# Creates the deafault numerical parameters file for the system + +# Copyright (c) P.J.Gawthrop 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1997/01/21 11:36:26 peterg +## Initial revision +## +############################################################### + +# Inform user +echo Creating $1_numpar.c + +# Remove the old log file +rm -f sympar2numpar_r2c.log + +# Use reduce to accomplish the transformation +reduce >sympar2numpar_r2c.log 2>mtt_error.txt << EOF + +%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"; + +OUT "$1_numpar1.c"; + +IF MTTNvar>0 THEN +BEGIN + FOR i := 1:MTTNvar DO + IF numberp(MTTVar(i,1)) + THEN + BEGIN + % Do nowt + END + ELSE + BEGIN + write "extern float ", MTTVar(i,1)$ + END; +END; + + +IF MTTNvar>0 THEN +BEGIN + FOR i := 1:MTTNvar DO + IF numberp(MTTVar(i,1)) + THEN + BEGIN + write "/* Variable ", i, " has already been set to ", MTTVar(i,1), "*/"; + END + ELSE + BEGIN + write MTTVar(i,1), " = 1; /* Default value */"; + END; +END; + + +SHUT "$1_numpar1.c"; + +EOF + +matlab_tidy $1_numpar1.c + +#Create the numpar file complete with headers. +echo "/*" > $1_numpar.c +echo "%% Numerical parameter file ($1_numpar.c)" >> $1_numpar.c +echo "%% Generated by MTT at `date`" >> $1_numpar.c +echo "*/" >> $1_numpar.c + +echo "$1_numpar()" >> $1_numpar.c +echo "{" >> $1_numpar.c +echo " extern $1_params();" >> $1_numpar.c + +cat $1_numpar1.c >> $1_numpar.c + +echo "/*" >> $1_numpar.c +echo '%% Input the user-defined parameters' >> $1_numpar.c +echo "*/" >> $1_numpar.c + +echo "$1_params;" >> $1_numpar.c +echo "};" >> $1_numpar.c + +rm $1_numpar1.c + +# Now invoke the standard error handling. +mtt_error_r sympar2numpar_r2c.log ADDED mtt/bin/trans/sympar2numpar_r2m Index: mtt/bin/trans/sympar2numpar_r2m ================================================================== --- mtt/bin/trans/sympar2numpar_r2m +++ mtt/bin/trans/sympar2numpar_r2m @@ -0,0 +1,137 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar2numpar_r2m +# Creates the deafault numerical parameters file for the system + +# Copyright (c) P.J.Gawthrop 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.9 1996/09/12 19:26:05 peter +## Input _params file. +## +## Revision 1.8 1996/08/30 19:37:43 peter +## Moved headers in shell script. +## +## Revision 1.7 1996/08/24 14:11:56 peter +## Global parameter passing. +## +## Revision 1.6 1996/08/20 08:21:24 peter +## *** empty log message *** +## +## Revision 1.5 1996/08/16 14:27:25 peter +## Make a dummy function when no parameters (MTTNVar=0). +## +## Revision 1.4 1996/08/15 12:46:59 peter +## Removed a spuriuos echo. +## +## Revision 1.3 1996/08/12 20:20:59 peter +## Explicit parameters via out put list. +## Parameter conversion stuff deleted. +## +## Revision 1.2 1996/08/11 10:41:52 peter +## Fixed various bugs. +## +## Revision 1.1 1996/08/11 08:48:07 peter +## Initial revision +## +############################################################### + +# Inform user +echo Creating $1_numpar.m + +# Remove the old log file +rm -f sympar2numpar_r2m.log + +# Use reduce to accomplish the transformation +reduce >sympar2numpar_r2m.log << EOF + +%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"; + +OUT "$1_numpar1.m"; + +IF MTTNvar>0 THEN +BEGIN + write "global ...;;"; + FOR i := 1:MTTNvar DO + IF numberp(MTTVar(i,1)) + THEN + BEGIN + % Do nowt + END + ELSE + BEGIN + IF i0 THEN +BEGIN + FOR i := 1:MTTNvar DO + IF numberp(MTTVar(i,1)) + THEN + BEGIN + write "% Variable ", i, " has already been set to ", MTTVar(i,1); + END + ELSE + BEGIN + write MTTVar(i,1), " = 1; % Default value"; + END; +END; + +if MTTNVar=0 THEN + write "foo=0"; + +SHUT "$1_numpar1.m"; + +EOF + +matlab_tidy $1_numpar1.m + +#Create the numpar file complete with headers. +echo "%% Numerical parameter file ($1_numpar.m)" > $1_numpar.m +echo "%% Generated by MTT at `date`" >> $1_numpar.m +cat $MTTPATH/trans/m/rcs_header.txt >> $1_numpar.m +cat $1_numpar1.m >> $1_numpar.m + +echo '%% Input the user-defined parameters' >> $1_numpar.m +echo "$1_params;" >> $1_numpar.m + + +rm $1_numpar1.m + + +# Now invoke the standard error handling. +mtt_error_r sympar2numpar_r2m.log + + + + + + + + + + + + + + + + + + + ADDED mtt/bin/trans/sympar2numpar_txt2txt Index: mtt/bin/trans/sympar2numpar_txt2txt ================================================================== --- mtt/bin/trans/sympar2numpar_txt2txt +++ mtt/bin/trans/sympar2numpar_txt2txt @@ -0,0 +1,88 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar2numpar_txt2txt +# Creates the deafault numerical parameters file for the system (txt) + +# Copyright (c) P.J.Gawthrop 1996 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.13 2000/10/16 08:09:25 peterg +## Tidied up. +## +## Revision 1.12 1999/03/02 22:01:21 peterg +## *** empty log message *** +## +## Revision 1.11 1998/06/15 15:14:46 peterg +## Don't print if blank line +## +## Revision 1.10 1998/03/07 15:27:20 peterg +## Don't do initial states. +## +## Revision 1.9 1998/02/04 12:24:35 peterg +## Simplified output format +## +## Revision 1.8 1998/01/29 17:06:36 peterg +## Better annotation +## +## Revision 1.7 1997/09/18 17:10:18 peterg +## Changed comments pertaining to the parameters to use the new column 2 +## of the sympar file (the system type). +## Added blank line to separate parmeters from states. +## (Done in the Chester Court Hotel). +## +## Revision 1.6 1997/06/13 09:34:39 peterg +## changed [] to () +## +# Revision 1.5 1997/05/15 08:30:14 peterg +# Now write default states (using _struc file). +# +# Revision 1.4 1997/05/15 07:19:19 peterg +# Put back "tolower" +# +# Revision 1.3 1997/05/15 07:13:31 peterg +# Removed "tolower" function. +# +# Revision 1.2 1997/05/01 08:19:04 peterg +# # is now used as the comment symbol +# +# Revision 1.1 1997/05/01 07:35:48 peterg +# Initial revision +# +############################################################### + +# Inform user +echo Creating $1_numpar.txt + +#Create the numpar file complete with headers. +echo '# -*-octave-*- Put Emacs into octave-mode' > $1_numpar.txt +echo "# Numerical parameter file ($1_numpar.txt)" >> $1_numpar.txt +echo "# Generated by MTT at `date`" >> $1_numpar.txt +cat $MTTPATH/trans/rcs_header.txt >> $1_numpar.txt + +#Write out the variables +echo "# Parameters" >> $1_numpar.txt +strip_comments <$1_sympar.txt |\ +gawk '{i++; if (NF>0) print tolower($1) " = \t1.0; \# " $2}'\ + >> $1_numpar.txt + +#Write out the initial states +#echo >> $1_numpar.txt +#echo "# Initial states" >> $1_numpar.txt +#gawk '{ +# if ($1=="state") +# print "x(" $2 ") = \t0.0; \# " $4 " (" $3 ")" +#}' \ +# $1_struc.txt >> $1_numpar.txt + + + + + ADDED mtt/bin/trans/sympar2par_txt2m Index: mtt/bin/trans/sympar2par_txt2m ================================================================== --- mtt/bin/trans/sympar2par_txt2m +++ mtt/bin/trans/sympar2par_txt2m @@ -0,0 +1,39 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar2par_txt2m + +# Symbolic parameters parameter conversion +# Used in lang_header +# Copyright (C) 2000 by Peter J. Gawthrop + +Lb=${5:-'('} +Rb=${6:-')'} + +case $2 in + zero) + strip_comments <$1_sympar.txt |\ + gawk '{ + i++; printf(" %s %s = 0.0;\n", tolower($1)); + }' + ;; + set) + strip_comments <$1_sympar.txt |\ + gawk '{ + i++; printf(" %s mttpar(%i) \t= %s;\n", i, tolower($1)); + }' + ;; + *) + strip_comments <$1_sympar.txt |\ + gawk '{ + i++; printf(" %s %s \t= mttpar%c%i%s%c;\n", decl, tolower($1), Lb, i, minusone, Rb); + }' decl="$3" minusone="$4" Lb=$Lb Rb=$Rb + ;; +esac + + + + ADDED mtt/bin/trans/sympar2params_txt2c Index: mtt/bin/trans/sympar2params_txt2c ================================================================== --- mtt/bin/trans/sympar2params_txt2c +++ mtt/bin/trans/sympar2params_txt2c @@ -0,0 +1,58 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar2params_txt2c + +# Symbolic parameters to default paramers (c) +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1997/03/20 15:17:45 peterg +## All variables are in lower case. +## +# Revision 1.1 1997/03/20 10:25:55 peterg +# Initial revision +# +############################################################### + + + +# Inform user +echo "Creating $1_params.c" + +rm -f mtt_error + +#Write some file headers +echo '/*' > $1_params.c +echo "Parameter file for system $1 ($1_params.c)" >> $1_params.c +echo "This file provides the system params for simulation:" >> $1_params.c +echo "Generated by MTT at `date`" >> $1_params.c +echo "These default parameters should be changed by the user" >> $1_params.c +echo '*/' >> $1_params.c +echo >> $1_params.c + + +cat $MTTPATH/trans/rcs_header.c >> $1_params.c +echo >> $1_params.c + + +echo "#include \"$1_sympar.c\"" >> $1_params.c +echo "$1_params()" >> $1_params.c +echo '{' >> $1_params.c + +#Write out the variables in c format. +gawk '{i++; print tolower($1) " = \t1.0;"}' $1_sympar.txt >> $1_params.c +echo '}' >> $1_params.c + +# Now invoke the standard error handling. +# mtt_error mtt_error.txt + + ADDED mtt/bin/trans/sympar2params_txt2m Index: mtt/bin/trans/sympar2params_txt2m ================================================================== --- mtt/bin/trans/sympar2params_txt2m +++ mtt/bin/trans/sympar2params_txt2m @@ -0,0 +1,57 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar2params_txt2m + +# Symbolic parameters to default paramers (m) +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1997/04/17 11:18:34 peterg +## Write out the RCS header first! +## +# Revision 1.2 1997/04/16 11:40:31 peterg +# Added global variables. +# +# Revision 1.1 1997/04/16 11:31:41 peterg +# Initial revision +# +############################################################### + + + +# Inform user +echo "Creating $1_params.m" + +rm -f mtt_error + +#Write some file headers +echo "% Parameter file for system $1 ($1_params.m)" > $1_params.m +echo "% This file provides the system params for simulation:" >> $1_params.m +echo "% Generated by MTT at `date`" >> $1_params.m +echo "% These default parameters should be changed by the user" >> $1_params.m +echo >> $1_params.m + +cat $MTTPATH/trans/rcs_header.m >> $1_params.m +echo >> $1_params.m + + +#Write out the global variables +sympar2global_txt2m $1 >> $1_params.m + + +#Write out the variables in c format. +gawk '{i++; print tolower($1) " = \t1.0;"}' $1_sympar.txt >> $1_params.m + +# Now invoke the standard error handling. +# mtt_error mtt_error.txt + + ADDED mtt/bin/trans/sympar2rtxi_txt2cc Index: mtt/bin/trans/sympar2rtxi_txt2cc ================================================================== --- mtt/bin/trans/sympar2rtxi_txt2cc +++ mtt/bin/trans/sympar2rtxi_txt2cc @@ -0,0 +1,125 @@ +#! /bin/sh + +sys=$1 +struc=${sys}_struc.txt +sympar=${sys}_sympar.txt +RTXI_H="${sys}_rtxi.h" +RTXI_CC="${sys}_rtxi.cc" +program=$(basename $0) +date=$(date) + +cat < ${RTXI_CC} +// -*-c++-*- Put Emacs into c++-mode + +// Generated from $sympar and $struc by MTT +// using $program +// at $date + +#include <${RTXI_H}> + +extern "C" Plugin::Object *createRTXIPlugin(void) { + return new ${sys}(); +} + +static DefaultGUIModel::variable_t vars[] = { +EOF + +gawk ' + ($1=="input") { + printf(" {\n"); + printf(" \"%s\",\n", $3); + printf(" \"%s\",\n", $6); + printf(" DefaultGUIModel::INPUT,\n"); + printf(" },\n"); + } + ($1=="output") { + printf(" {\n"); + printf(" \"%s\",\n", $3); + printf(" \"%s\",\n", $6); + printf(" DefaultGUIModel::OUTPUT,\n"); + printf(" },\n"); + } +' ${struc} >> ${RTXI_CC} + +gawk ' + { + printf(" {\n"); + printf(" \"%s\",\n", $1); + printf(" \"\",\n"); + printf(" DefaultGUIModel::PARAMETER |"); + printf(" DefaultGUIModel::DOUBLE,\n"); + printf(" },\n"); + } +' $sympar >> ${RTXI_CC} + +cat <> ${RTXI_CC} +}; + +static size_t num_vars = sizeof(vars)/sizeof(DefaultGUIModel::variable_t); +// TODO: initialise from numpar +static double +EOF + +gawk ' + { printf(" %s=0.0,", $1); } + END { printf ";" } +' $sympar |\ + sed -e 's/,;/;\n/' |\ + sed -e 's/,/,\n/' >> ${RTXI_CC} + +cat <> ${RTXI_CC} +static long i_count = 0; + +${sys}::${sys}(void) + : DefaultGUIModel("${sys}",::vars,::num_vars), +EOF + +gawk ' + { printf(" %s(0.0),", $1); } + END { printf ";" } +' $sympar |\ + sed -e 's/,;/\n/' |\ + sed -e 's/,/,\n/' >> ${RTXI_CC} + + +cat <> ${RTXI_CC} +{ + doUpdate(INIT); + refresh(); +} + +${sys}::~${sys}(void) {} + +// ${sys}::execute(void) is defined in ${sys}_ode2odes.cc + +void ${sys}::update(DefaultGUIModel::update_flags_t flag) { + setCaption("${sys}"); + switch(flag) { + case INIT: +EOF + +gawk ' + { + printf(" setParameter(\"%s\",QString::number(%s));\n", + $1, $1); + } +' $sympar >> ${RTXI_CC} + +cat <> ${RTXI_CC} + break; + case MODIFY: +EOF + +gawk ' + { + printf(" getParameter(\"%s\").toDouble();\n", $1); + } +' $sympar >> ${RTXI_CC} + +cat <> ${RTXI_CC} + break; + default: + break; + } +} +EOF ADDED mtt/bin/trans/sympar2rtxi_txt2h Index: mtt/bin/trans/sympar2rtxi_txt2h ================================================================== --- mtt/bin/trans/sympar2rtxi_txt2h +++ mtt/bin/trans/sympar2rtxi_txt2h @@ -0,0 +1,43 @@ +#! /bin/sh + +sys=$1 +sympar=${sys}_sympar.txt +RTXI_H="${sys}_rtxi.h" +program=$(basename $0) +date=$(date) + +cat < ${RTXI_H} +// -*-c++-*- Put Emacs into c++-mode + +// Generated from $sympar by MTT +// using $program +// at $date + +#include +#include + +class $sys : public DefaultGUIModel +{ + +public: + + $sys(void); + virtual ~$sys(void); + + virtual void execute(void); + +protected: + + virtual void update(DefaultGUIModel::update_flags_t); + +private: + +EOF + +gawk ' + { printf(" double %s;\n", $1); } +' $sympar >> ${RTXI_H} + +cat <> ${RTXI_H} +}; +EOF ADDED mtt/bin/trans/sympar_r2c Index: mtt/bin/trans/sympar_r2c ================================================================== --- mtt/bin/trans/sympar_r2c +++ mtt/bin/trans/sympar_r2c @@ -0,0 +1,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 + ADDED mtt/bin/trans/sympar_txt2c Index: mtt/bin/trans/sympar_txt2c ================================================================== --- mtt/bin/trans/sympar_txt2c +++ mtt/bin/trans/sympar_txt2c @@ -0,0 +1,57 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar_txt2c + +# Label file to symbolic parameters conversion +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1997/05/15 07:19:56 peterg +## Put back "tolower" +## +# Revision 1.2 1997/05/15 07:10:56 peterg +# removed "tolower" function +# +# Revision 1.1 1997/05/15 07:10:09 peterg +# Initial revision +# +# Revision 1.3 1997/03/19 16:39:12 peterg +# Put in the correct date. +# +# Revision 1.2 1997/03/18 17:56:35 peterg +# Cosmetic changes. +# +############################################################### + + +# Inform user +echo "Creating $1_sympar.c" + +rm -f mtt_error + +#Write some file headers +echo '/*' > $1_sympar.c +echo "Symbolic parameter file ($1_sympar.c)" >> $1_sympar.c +echo "Generated by MTT at `date`" >> $1_sympar.c +echo '*/' >> $1_sympar.c +echo >> $1_sympar.c + + +#Write out the variables in c format. +gawk '{i++; print "extern double", tolower($1) ";"}' $1_sympar.txt \ + >> $1_sympar.c + + +# Now invoke the standard error handling. +# mtt_error mtt_error.txt + + ADDED mtt/bin/trans/sympar_txt2declare Index: mtt/bin/trans/sympar_txt2declare ================================================================== --- mtt/bin/trans/sympar_txt2declare +++ mtt/bin/trans/sympar_txt2declare @@ -0,0 +1,59 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar_txt2declare + +# Symbolic parameters to variable declaration +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/10/11 09:08:20 peterg +## Initial revision +## + +############################################################### + +sys=$1 +language=$2 + +case $language in + p) + first="VAR"; + delim=", "; + last=': REAL;'; + ;; + *) + echo Language $language not supported - sorry; exit 1 +esac + +# Start +cat<10){ + printf("\n"); j=0; + } + } + printf("%s%s\n",var[n], last); + +}' "delim=$delim" "last=$last" + + ADDED mtt/bin/trans/sympar_txt2m Index: mtt/bin/trans/sympar_txt2m ================================================================== --- mtt/bin/trans/sympar_txt2m +++ mtt/bin/trans/sympar_txt2m @@ -0,0 +1,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 + +gawk '{ + printf(" sympar.%s \t= %i; # %s\n", $1, ++i, $2); +}' < $1_sympar.txt >> $1_sympar.m ADDED mtt/bin/trans/sympar_txt2r Index: mtt/bin/trans/sympar_txt2r ================================================================== --- mtt/bin/trans/sympar_txt2r +++ mtt/bin/trans/sympar_txt2r @@ -0,0 +1,64 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar_txt2r + +# Label file to symbolic parameters conversion +# P.J.Gawthrop March 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.6 1998/02/17 17:03:54 peterg +## Fixed bug in writing out matrix declaration +## +## Revision 1.5 1998/02/16 12:14:21 peterg +## Corrected writing out of MTTVAR matrix - now does this id non-zero +## number of variables - not vv! +## +## Revision 1.4 1997/05/09 14:20:49 peterg +## Dont declare MTTVAR array when there are no variables. +## +# Revision 1.3 1997/03/19 16:39:12 peterg +# Put in the correct date. +# +# Revision 1.2 1997/03/18 17:56:35 peterg +# Cosmetic changes. +# +############################################################### + + +# Inform user +echo "Creating $1_sympar.r" + +rm -f mtt_error + +#Write some file headers +echo "%% Symbolic parameter file ($1_sympar.r)" > $1_sympar.r +echo "%% Generated by MTT at `date`" >> $1_sympar.r +echo >> $1_sympar.r + +#Count the lines in the file +lines=`grep -c '.' $1_sympar.txt` + +if [ "$lines" != "0" ]; then + echo "MATRIX MTTVAR($lines,1);" >> $1_sympar.r +fi +echo "MTTNVAR := $lines;" >> $1_sympar.r +echo >> $1_sympar.r + +#Write out the variables in reduce format. +gawk '{i++; print "MTTVAR(" i ",1) := " $1 ";"}' $1_sympar.txt >> $1_sympar.r + +echo 'END;' >> $1_sympar.r + +# Now invoke the standard error handling. +# mtt_error mtt_error.txt + + ADDED mtt/bin/trans/sympar_txt2tex Index: mtt/bin/trans/sympar_txt2tex ================================================================== --- mtt/bin/trans/sympar_txt2tex +++ mtt/bin/trans/sympar_txt2tex @@ -0,0 +1,96 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sympar_txt2tex + +# Sympar file - text to TeX table conversion +# P.J.Gawthrop April 1997 +# Copyright (c) P.J.Gawthrop, 1997. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/27 16:04:46 peterg +## Initial revision +## +## Revision 1.2 1998/01/19 14:17:26 peterg +## Modified struc_txt2tex to make this. +## +## Revision 1.1 1998/01/19 14:16:39 peterg +## Initial revision +## +# Revision 1.3 1997/12/06 19:10:41 peterg +# Reverted to tabular --- from supertabular +# +# Revision 1.2 1997/04/15 11:17:58 peterg +# Uses supertabular for long tables. +# +# Revision 1.1 1997/04/15 09:49:04 peterg +# Initial revision +# +############################################################### + + +# Inform user +echo "Creating $1_sympar.tex" + +rm -f mtt_error + +#Write some file headers +echo "%% Parameter file ($1_sympar.txt)" > $1_sympar.tex +echo "%% Generated by MTT at `date`" >> $1_sympar.tex + +# This is the main transformation using awk +sed 's/_/\\_/g' < $1_sympar.txt | gawk ' +#function header(what){ +# print " \\centering"; +# print " \\tablefirsthead{\\hline %"; +# print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM "} \\\\"; +# print " \\hline"; +# print " & Component & System & Repetition \\\\"; +# print " \\hline}"; +# +# print " \\tablehead{\\hline %"; +# print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM " (continued)} \\\\"; +# print " \\hline"; +# print " & Component & System & Repetition \\\\"; +# print " \\hline}"; +# +# print " \\tabletail{\\hline}"; +# print " \\begin{supertabular}{|l|l|l|l|}"; +#} +function header(what){ + print "\\begin{table}[htbp]"; + print " \\centering"; + print " \\begin{tabular}{|l|l|}"; print " \\hline"; + print " Parameter & System\\\\"; + print " \\hline"; +} +function footer(what){ + print " \\hline"; + print " \\end{tabular}"; + print " \\caption{" what "}"; + print "\\end{table}"; + print " \\bigskip"; + print " \\bigskip"; +} +BEGIN{ + header($1); +} +{ + print $1, "&", $2, "\\\\"; +} +END{ + footer("Parameters") +} +' SYSTEM=$1 >> $1_sympar.tex 2>mtt_error.txt + +# Now invoke the standard error handling. +mtt_error mtt_error.txt + + ADDED mtt/bin/trans/tex2doc Index: mtt/bin/trans/tex2doc ================================================================== --- mtt/bin/trans/tex2doc +++ mtt/bin/trans/tex2doc @@ -0,0 +1,35 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: tex2doc +# Encapsulates a tex file in a document. + +# P.J.Gawthrop August 1996 +# Copyright (c) P.J.Gawthrop, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2000/12/28 12:48:53 peterg +## Put under RCS +## +# Revision 1.2 1996/08/30 10:19:11 peter +# New path for awk script. +# +## Revision 1.1 1996/08/18 20:00:20 peter +## Initial revision +## +############################################################### + +# Inform user +echo "Creating $1_$2.doc" + +# This is the main transformation using awk +gawk -f $MTTPATH/trans/awk/tex2doc.awk \ +system_name=$1 representation=$2 > $1_$2.doc + ADDED mtt/bin/trans/tf_r2m Index: mtt/bin/trans/tf_r2m ================================================================== --- mtt/bin/trans/tf_r2m +++ mtt/bin/trans/tf_r2m @@ -0,0 +1,152 @@ +#!/bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: tf_r2m +# Reduce transfer-function matrices to Matlab MV toolbox matrices. +# P.J.Gawthrop 9 June 1990, 8 July 1990, Dec 993 +# Copyright (c) P.J.Gawthrop, 1990, 1993. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2001/05/24 07:42:12 gawthrop +## Included and updated the missing tf_r2m +## +## Revision 1.1 1996/09/18 14:05:31 peter +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_tf.m + +# Remove the old log file +rm -f tf_r2m.log + +# Use reduce to accomplish the transformation +reduce >tf_r2m.log << EOF + +%Read the 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 parameter file +%%in "$1_sympar.r"; + +%Read the transfer-function matrices file +OFF Exp; ON GCD; +in "$1_tf.r"; + +OFF Echo; +%OFF Nat; +OFF factor; + +%Find the largest degree numerator polynomial +NnMax := 0; + FOR Row := 1:MTTNy DO + BEGIN + FOR Col := 1:MTTNu DO + BEGIN + Nn := length(coeff(num(MTTtf(Row,Col)),s)); + IF Nn>NnMax THEN NnMax := Nn; + END; + END; + +NnMax; + +%Find the largest degree denominator polynomial, and corresp indices +NdMax := 0; + FOR Row := 1:MTTNy DO + BEGIN + FOR Col := 1:MTTNu DO + BEGIN + Nd := length(coeff(den(MTTtf(Row,Col)),s)); + IF Nd>NdMax THEN + BEGIN + NdMax := Nd; MaxRow := Row; MaxCol := Col; + END + END; + END; + +NdMax; MaxRow; MaxCol; + +IF NnMax>NdMax THEN NMax := NnMax ELSE NMax := NdMax; +Nmax; + +%Use any denominator with maximum degree as the common denominator +MTTden := den(MTTtf(MaxRow,MaxCol)); + +%Find the corresponding numerator +matrix MTTnum(MTTNy,MTTNu); + FOR Row := 1:MTTNy DO + BEGIN + FOR Col := 1:MTTNu DO + MTTnum(Row,Col) := num(MTTtf(Row,Col))*(MTTden/den(MTTtf(Row,Col))); + END; +MTTnum := MTTnum; + +%Put coefficients into matrices +matrix MTTdenco(1,Nmax); +MTTCoeff := Coeff(MTTden,s); +FOR i := 1:Nmax DO +BEGIN + j := Nmax-i+1; + IF j>length(MTTCoeff) THEN MTTdenco(1,i) := 0 + ELSE MTTdenco(1,i) := part(MTTCoeff,j); +END; +MTTdenco := MTTdenco; + +matrix MTTnumco(MTTNy,MTTNu*Nmax); +FOR MTTRow := 1:MTTNy DO +BEGIN + FOR MTTCol := 1:MTTNu DO + BEGIN + MTTCoeff := Coeff(MTTnum(MTTRow,MTTCol),s); + FOR MTTi := 1:Nmax DO + BEGIN + MTTj := Nmax-MTTi+1; + MTTk := MTTi + (MTTCol-1)*Nmax; + IF MTTj>length(MTTCoeff) THEN MTTnumco(MTTRow, MTTk) := 0 + ELSE MTTnumco(MTTRow, MTTk) := part(MTTCoeff,MTTj); + END; + END; +END; + + + +OUT "$1_tf.m1"; + +write "mttden = zeros(1,", Nmax, ");"; +write "mttnum = zeros(", MTTNy, ",", Nmax*MTTNu, ");"; + +%Suppress zeros +ON NERO; + +%Fortran switches - one line expressions +ON fort; +cardno!* := 1\$ +fortwidth!* := 100\$ +OFF period; + +%Write out the matlab code +mttden := MTTdenco; +mttnum := MTTnumco; +SHUT "$1_tf.m1"; +quit; +EOF + +#Headers +mtt_header $1 tf m > $1_tf.m + +#Body +cat $1_tf.m1 >> $1_tf.m +echo '## END Code' >> $1_tf.m +rm -f $1_tf.m1 + ADDED mtt/bin/trans/tf_r2tex Index: mtt/bin/trans/tf_r2tex ================================================================== --- mtt/bin/trans/tf_r2tex +++ mtt/bin/trans/tf_r2tex @@ -0,0 +1,139 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: tf_r2tex +# Reduce transfer-function matrices to LaTex transfer-function matrices. +# P.J.Gawthrop 9 June 1990, 8 July 1990, April 1994. +# Copyright (c) P.J.Gawthrop, 1990, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2014/04/18 00:36:40 gawthrop +## No parentheses. +## +## Revision 1.1 2000/12/27 16:05:29 peterg +## Initial revision +## +## Revision 1.2 1996/12/20 08:59:40 peterg +## Now writes out mtti instead of mtt_{i} -- lets latex_tidy do the +## conversion. +## +## Revision 1.1 1996/11/05 11:01:51 peterg +## Initial revision +## +############################################################### + +#Inform user +echo Creating $1_tf.tex + +# Remove the old log file +rm -f tf_r2tex.log + +# Use reduce to accomplish the transformation +reduce >tf_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the parameter file +%%in "$1_sympar.r"; + +%Read the formatting function +IF MTTNy=1 AND MTTNu=1 + THEN + in "$MTTPATH/trans/latex_matrix_no.r" + ELSE + in "$MTTPATH/trans/latex_matrix.r"; + +%Read the transfer-function matrices file +in "$1_tf.r"; + +%Read the substitution file +IN "$1_subs.r"; + +%Read the simplification file +in "$1_simp.r"; + +OFF Echo; +OFF Nat; + +OUT "$1_tf.tex"; +MTT_Matrix := MTTTF$ +MTT_Matrix_name := "MTTG"$ +MTT_Matrix_n := MTTNy$ +MTT_Matrix_m := MTTNu$ +LaTeX_Matrix()$ + +%% FOR Row := 1:MTTNy DO +%% BEGIN +%% FOR Col := 1:MTTNu DO +%% BEGIN +%% numerator := num(MTTtf(Row,Col)); +%% denominator := den(MTTtf(Row,Col)); +%% cnumerator := coeff(numerator, s); +%% cdenominator := coeff(denominator, s); +%% write "!begin{equation} !label{eq_$1_tf", Row, Col, "}"; +%% IF MTTNy=1 AND MTTNu=1 +%% THEN +%% write "MTTTF(s) = {" +%% ELSE +%% write "MTTTF", Row, Col, "(s) = {"; +%% IF numerator = 0 +%% THEN write "0" +%% ELSE +%% BEGIN +%% FOR i := 1:Length(cnumerator) DO +%% BEGIN +%% cof := part(cnumerator,i); +%% IF cof NEQ 0 THEN +%% BEGIN +%% IF i>1 THEN write " + "; +%% IF cof NEQ 1 THEN +%% BEGIN +%% IF Terms(cof)>1 THEN write "(", cof, ")" +%% ELSE write cof; +%% END +%% ELSE IF i=1 THEN Write "1"; +%% +%% IF i=2 THEN write "s"; +%% IF i>2 THEN write "s^", i-1; +%% END; +%% END; +%% END; +%% +%% IF denominator NEQ 1 THEN +%% BEGIN +%% Write "!over"; +%% FOR i := 1:Length(cdenominator) DO +%% BEGIN +%% cof := part(cdenominator,i); +%% IF cof NEQ 0 THEN +%% BEGIN +%% IF i>1 THEN write " + "; +%% IF cof NEQ 1 THEN +%% BEGIN +%% IF Terms(cof)>1 THEN write "(", cof, ")" +%% ELSE write cof; +%% END +%% ELSE IF i=1 THEN Write "1"; +%% +%% IF i=2 THEN write "s"; +%% IF i>2 THEN write "s^", i-1; +%% END; +%% END; +%% END; +%% write "}"; +%% write "!end{equation}"; +%% END; +%% END; +%% +SHUT "$1_tf.tex"; +quit; +EOF + ADDED mtt/bin/trans/tidy Index: mtt/bin/trans/tidy ================================================================== --- mtt/bin/trans/tidy +++ mtt/bin/trans/tidy @@ -0,0 +1,18 @@ +mv $1 $1.old + +cat $1.old | +#Clear out all (and extraneous) new lines +tr -d '\012' |\ + +#Squash blanks +tr -s '\040' '\040' |\ + +#Put in new lines to replace $ +tr '\044' '\012' |\ + +#Remove blanks after E +sed "s/E /E/g" |\ + +#Put in $ at end of each line +sed "s/$/\$/" >$1 + ADDED mtt/bin/trans/txt2m Index: mtt/bin/trans/txt2m ================================================================== --- mtt/bin/trans/txt2m +++ mtt/bin/trans/txt2m @@ -0,0 +1,186 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: txt2m +# Converts txt file to matlab file (for numpar and state) + +# Copyright (c) P.J.Gawthrop 1998 + + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.19 2000/02/11 13:35:16 peterg +# %% Added the new MTTpar generation +# %% +# %% Revision 1.18 1999/11/14 22:22:17 peterg +# %% Removed checks for implicit - now done at command-line level. +# %% +# %% Revision 1.17 1999/11/04 04:54:24 peterg +# %% Removed recreation of smx file. +# %% +# %% Revision 1.16 1999/03/06 02:18:10 peterg +# %% Changed argument list. +# %% +# %% Revision 1.15 1999/02/16 21:44:38 peterg +# %% Revised smx generation +# %% +# %% Revision 1.14 1999/02/16 04:38:22 peterg +# %% Now forces creation of _smx file if METHOD=IMPLICIT in simpar.txt +# %% +# %% Revision 1.13 1998/08/31 11:43:37 peterg +# %% Now lower cases globals in numpar files +# %% +# %% Revision 1.12 1998/08/14 10:47:31 peterg +# %% Put ImplicitS sub before Implicit!! +# %% +# %% Revision 1.11 1998/08/14 10:43:44 peterg +# %% Added ImplicitS - sparse integration +# %% +# %% Revision 1.10 1998/08/11 13:27:51 peterg +# %% Lowercase mttLAST etc +# %% +# %% Revision 1.9 1998/07/30 15:07:17 peterg +# %% Added _ to the disallowed chars around t +# %% +# %% Revision 1.8 1998/07/30 12:52:38 peterg +# %% Adds ; to end of statements +# %% Translates ' to " before removal +# %% +# %% Revision 1.7 1998/07/30 09:32:33 peterg +# %% Replaces: +# %% euler by 1 +# %% implicitl by 1 +# %% implicit by 3 +# %% +# %% Revision 1.6 1998/07/27 18:59:11 peterg +# %% Added WMIN etc +# %% +# %% Revision 1.5 1998/07/26 11:54:20 peterg +# %% Added mtt to variables +# %% +# %% Revision 1.4 1998/07/26 09:50:12 peterg +# %% More forgiving of txt sytax. +# %% +# %% -- can use () or () +# %% -- can use mttx() or x() +# %% -- can use mttu() or u() +# %% +# %% Revision 1.3 1998/07/25 20:40:35 peterg +# %% All vars in lower case now +# %% +# %% Revision 1.2 1998/07/25 09:48:31 peterg +# %% Tidied up for Pascal version +# %% +# %% Revision 1.1 1998/02/25 22:10:25 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +system=$1 +representation=$2 + +if [ "$representation" = "state" ]; then + name='mttx'; + arg=''; +fi +if [ "$representation" = "input" ]; then + name='mttu'; + arg='(mttt,mttx,mtty)' +fi + +# Inform user +echo Creating $1_$2.m + +#Create the $2 file complete with headers. +case $representation in + simpar) + echo "% Script file $1_$2.m" > $1_$2.m + echo "%% $2 file ($1_$2.m)" >> $1_$2.m + echo "%% Generated by MTT at `date`" >> $1_$2.m + echo '% Dummy globals' >> $1_$2.m + echo 'global ...' >> $1_$2.m + echo 'mtt_dummy_global;' >> $1_$2.m + ;; + numpar) + echo "% Script file $1_$2.m" > $1_$2.m + echo "%% $2 file ($1_$2.m)" >> $1_$2.m + echo "%% Generated by MTT at `date`" >> $1_$2.m + echo "% Global variable list" >> $1_$2.m + sympar2global_txt2m $1 >> $1_$2.m + ;; + *) + echo "function $name = $1_$2$arg" > $1_$2.m + echo "%% $2 file ($1_$2.m)" >> $1_$2.m + echo "%% Generated by MTT at `date`" >> $1_$2.m + echo "% Global variable list" >> $1_$2.m + sympar2global_txt2m $1 >> $1_$2.m + ;; +esac + +#Write out the variables in m format. +cat $1_$2.txt | grep -v METHOD |\ +gawk -F# 'BEGIN{ +quote = "\047"; +doublequote = "\042"; +} +{ + N=split($1,a,"="); + if (N==2) { + LHS = a[1]; + RHS = a[2]; + gsub(quote, doublequote, RHS); + sub(/^[ ]*LAST/, "mttLAST", LHS); + sub(/^[ ]*DT/, "mttDT", LHS); + sub(/^[ ]*STEPFACTOR/, "mttSTEPFACTOR", LHS); + sub(/^[ ]*METHOD/, "mttMETHOD", LHS); + sub(/^[ ]*WMIN/, "mttWMIN", LHS); + sub(/^[ ]*WMAX/, "mttWMAX", LHS); + sub(/^[ ]*WSTEPS/, "mttWSTEPS", LHS); + sub(/^[ ]*INPUT/, "mttinput", LHS); + LHS = tolower(LHS); + RHS = tolower(RHS); + sub(/["]*euler["]*/, 1, RHS); + sub(/["]*implicit["]*/, 2, RHS); + statement = sprintf("%s= %s",LHS,RHS); + if ( (match(statement,";")==0)&&\ + ((match(statement,"if ")==0))&&\ + ((match(statement,"for ")==0)) ) + statement = sprintf("%s;", statement); + } + else if (match($1,"global")==1) { + statement = tolower($1); # Lower case globals as well + } + else + statement = $1; + + if (NF<2) print statement + if (NF>1) print statement " # " $2 +}' | sed\ + -e 's/\[\([0-9]*\)\]/(\1)/g' \ + -e 's/\([^a-zA-Z_]\)t\([^a-zA-Z_]\)/\1mttt\2/g' \ + -e 's/x(/mttx(/g' \ + -e 's/u(/mttu(/g' \ + -e 's/mttmtt/mtt/g' \ + -e 's/#/%/g' \ +>> $1_$2.m + + +if [ "$2" = "numpar" ]; then + gawk '{ + printf(" MTTpar(%i) \t= %s;\n",++i, tolower($1)); + }'< $1_sympar.txt >>$1_numpar.m +fi + + + + + + + + ADDED mtt/bin/trans/txt2tex Index: mtt/bin/trans/txt2tex ================================================================== --- mtt/bin/trans/txt2tex +++ mtt/bin/trans/txt2tex @@ -0,0 +1,44 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: txt2tex + +# Generic textual inclusion as verbatim tex. + +# P.J.Gawthrop March 1998 +# Copyright (c) P.J.Gawthrop, 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +if [ -z "$3" ]; then + echo Usage: txt2tex system representation language + exit 1 +fi +# Inform user +echo "Creating $1_$2.tex" + +rm -f mtt_error + +#Write some file headers +echo "%% Tex file ($1_$2.txt)" > $1_$2.tex +echo "%% Generated by MTT at `date`" >> $1_$2.tex + +cat <> $1_$2.tex +\begin{verbatim} +EOF +cat $1_$2.$3 >> $1_$2.tex +cat<> $1_$2.tex +\end{verbatim} +EOF + + + + ADDED mtt/bin/trans/txt_matrix.r Index: mtt/bin/trans/txt_matrix.r ================================================================== --- mtt/bin/trans/txt_matrix.r +++ mtt/bin/trans/txt_matrix.r @@ -0,0 +1,36 @@ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%% Model Transformation Tools %%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Reduce function to write matrices in text form +% P.J.Gawthrop Febrauary 1998 +% Copyright (c) P.J.Gawthrop, 1998 + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +PROCEDURE txt_Matrix; +BEGIN + IF MTT_Matrix_n>0 THEN + IF MTT_Matrix_m>0 THEN + BEGIN + FOR i := 1:MTT_Matrix_n DO + IF MTT_Matrix_m>1 THEN + BEGIN + FOR j := 1:MTT_Matrix_m DO + write MTT_Matrix_name, "(", i, ",", j, ") = ", + MTT_Matrix(i,j), ";"; + END + ELSE + write MTT_Matrix_name, "(", i, ") = ", + MTT_Matrix(i,1), ";"; + END; +END; + +END;; ADDED mtt/bin/xmtt Index: mtt/bin/xmtt ================================================================== --- mtt/bin/xmtt +++ mtt/bin/xmtt @@ -0,0 +1,94 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: xmtt +# +# x-window version of MTT + +# Copyright (c) P.J.Gawthrop, 1998 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 2000/09/14 07:50:08 peterg +## *** empty log message *** +## +## Revision 1.4 1999/10/19 00:34:10 peterg +## *** empty log message *** +## +## Revision 1.3 1999/08/18 06:17:55 peterg +## Modular form +## +## Revision 1.2 1999/03/09 00:03:55 peterg +## Major revisions for release 3.5 +## +## Revision 1.1 1998/10/20 08:15:17 peterg +## Initial revision +## +############################################################### + +#Basic paths +dotfile="$HOME/.mtt" +xdotfile="${dotfile}/xmtt" + +repfile="${xdotfile}/reps" +exfile="${xdotfile}/examples" +menufile=".xmtt_menu" + +#Look for a command line argument +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + --help|-h ) echo "usage:" + echo " xmtt" + echo " xmtt --update" + echo " xmtt --example example_name" + echo " xmtt --help" + exit;; + + --update|-u ) echo Creating representation list for mtt; + mtt2reps_txt> ${repfile}; + echo Creating examples list for mtt; + mtt -q help examples> ${exfile}; + exit;; + + --example|-e ) shift; example=$1;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done + +if [ -n "${example}" ]; then + mtt -q copy ${example}; + cd ${example}; + xmtt + exit +fi + +## Make sure files exist +if [ -e "${xdotfile}" ]; then + echo ${xdotfile} exists >/dev/null +else + echo Creating ${xdotfile} + mkdir --parents ${xdotfile} +fi + +if [ -e "${repfile}" ]; then + echo ${repfile} exists >/dev/null +else + echo Creating ${repfile} and ${exfile} + xmtt --update + echo done. +fi + +## Create the menu +mtt_make_menu > ${menufile} + +## Use tk shell (wish) +name=`basename $PWD` +wish ${menufile} -name $name ADDED mtt/cc/Makefile Index: mtt/cc/Makefile ================================================================== --- mtt/cc/Makefile +++ mtt/cc/Makefile @@ -0,0 +1,12 @@ + +CXX ?= g++ + +build: parse_m2cc.exe + +.PHONY: FORCE +clean: FORCE + @-rm -f parse_m2cc.exe + +parse_m2cc.exe: parse_m2cc.cc + @$(CXX) $< $(CFLAGS) -o $@ -I./include + @strip $@ ADDED mtt/cc/def_m2h.sh Index: mtt/cc/def_m2h.sh ================================================================== --- mtt/cc/def_m2h.sh +++ mtt/cc/def_m2h.sh @@ -0,0 +1,60 @@ +#! /bin/sh +# $Id$ +# $Log$ +# Revision 1.3 2002/05/15 14:22:25 geraint +# Code for Simulink S-function target written direct to sfun.cc instead of +# calling .mexglx files. This eliminates the sfun dependency on Octave +# ColumnVectors. sys_sfun.cc should build directly on a MS Windows machine +# (can't test this yet). +# +# added sfun.zip target to create source code to export. +# +# Revision 1.2 2002/04/28 18:58:06 geraint +# Fixed [ 549658 ] awk should be gawk. +# Replaced calls to awk with call to gawk. +# +# Revision 1.1 2000/12/28 09:46:05 peterg +# put under RCS +# +# Revision 1.3 2000/12/05 12:13:52 peterg +# Changed function name to name() +# +# Revision 1.2 2000/12/04 12:04:46 peterg +# Changed $() to `` for sh compatibility -- geraint +# +# Revision 1.1 2000/12/04 12:02:23 peterg +# Initial revision +# +# Revision 1.1 2000/10/31 04:32:28 geraint +# Initial revision +# + +SYS=$1 +IN=${SYS}_def.m +SYM=${SYS}_sympar.txt +OUT=${SYS}_def.h + +get_array_size () +{ +vec=$1 +gawk -v vec=${vec} '($1 == vec && $2 == "=") { print $3 }' | sed s/\;// +} + + echo "/* ${SYS}_def.h, generated by MTT on `date` */" > ${OUT} + echo "" >> ${OUT} + echo "#ifndef HAVE_${SYS}_DEF_H" >> ${OUT} + echo "#define HAVE_${SYS}_DEF_H" >> ${OUT} + echo "" >> ${OUT} + echo "const int MTTNU = `cat ${IN} | get_array_size nu`;" >> ${OUT} + echo "const int MTTNX = `cat ${IN} | get_array_size nx`;" >> ${OUT} + echo "const int MTTNY = `cat ${IN} | get_array_size ny`;" >> ${OUT} + echo "const int MTTNZ = `cat ${IN} | get_array_size nz`;" >> ${OUT} + echo "const int MTTNYZ = `cat ${IN} | get_array_size nyz`;" >> ${OUT} + echo "const int MTTNPAR = `wc -l ${SYM} | gawk '{ print $1 }'`;" >> ${OUT} + echo "" >> ${OUT} + echo "static int mttnu, mttnx, mttny, mttnyz, mttnz;" >> ${OUT} + echo "" >> ${OUT} + echo "#endif" >> ${OUT} + + + ADDED mtt/cc/include/Bracket.hh Index: mtt/cc/include/Bracket.hh ================================================================== --- mtt/cc/include/Bracket.hh +++ mtt/cc/include/Bracket.hh @@ -0,0 +1,222 @@ +/* $Id$ + * $Log$ + * Revision 1.1.4.1 2001/06/30 03:26:20 geraint + * gcc-3.0 compatibility. + * + * Revision 1.1 2000/12/28 09:47:29 peterg + * put under RCS + * + * Revision 1.1 2000/10/31 04:29:11 geraint + * Initial revision + * + */ + + + +#include +#include + + +using namespace std; + +class Bracket +{ +public: + friend ostream &operator<< (ostream &str, Bracket *b); + friend string &operator<< (string &str, Bracket *b); + friend string &operator+= (string &str, Bracket *b); + friend string operator+ (string &str, Bracket *b); + virtual int get_nesting_depth (void) = 0; + +protected: + Bracket (char left, char right) { _l = left; _r = right; } + ostream &open (ostream &str) { this->increment_nesting (); return str << this->_l; } + string &open (string &str) { this->increment_nesting (); return str += this->_l; } + ostream &close (ostream &str) { this->decrement_nesting (); return str << this->_r; } + string &close (string &str) { this->decrement_nesting (); return str += this->_r; } + +protected: + virtual int increment_nesting (void) = 0; + virtual int decrement_nesting (void) = 0; + virtual ostream &display (ostream &str) = 0; + virtual string &display (string &str) = 0; + +private: + char _l, _r; +}; + + + +class Brace : public Bracket +{ +public: + int get_nesting_depth (void) { return (this->nesting_depth);} + string indentation (int n = nesting_depth) + { + string s = ""; + int i; + for (i = 0; i < n; i++) + s += " "; + return s; + } + +protected: + Brace () : Bracket ('{', '}') { ; } + int increment_nesting (void) { return ++(this->nesting_depth); } + int decrement_nesting (void) { return --(this->nesting_depth); } + ostream &open (ostream &str) + { + str << endl << this->indentation (); + this->Bracket::open (str); + str << endl << this->indentation (); + return str; + } + string &open (string &str) + { + str += '\n' + this->indentation (); + this->Bracket::open (str); + str += '\n' + this->indentation (); + return str; + } + ostream &close (ostream &str) + { + str << endl << this->indentation (nesting_depth - 1); + this->Bracket::close (str); + str << endl << this->indentation (); + return str; + } + string &close (string &str) + { + str += '\n' + this->indentation (nesting_depth - 1); + this->Bracket::close (str); + str += '\n' + this->indentation (); + return str; + } + +private: + static int nesting_depth; +}; +int Brace::nesting_depth; + + + +class Paren : public Bracket +{ +public: + int get_nesting_depth (void) { return (this->nesting_depth);} + +protected: + Paren () : Bracket ('(', ')') { ; } + int increment_nesting (void) { return ++(this->nesting_depth); } + int decrement_nesting (void) { return --(this->nesting_depth); } + +private: + static int nesting_depth; +}; +int Paren::nesting_depth; + + + +class SquareBracket : public Bracket +{ +public: + int get_nesting_depth (void) { return (this->nesting_depth);} + +protected: + SquareBracket () : Bracket ('[', ']') { ; } + int increment_nesting (void) { return ++(this->nesting_depth); } + int decrement_nesting (void) { return --(this->nesting_depth); } + +private: + static int nesting_depth; +}; +int SquareBracket::nesting_depth; + + + +class LeftBrace : public Brace +{ +public: + ostream &display (ostream &str) { return this->open (str); } + string &display (string &str) { return this->open (str); } +}; + + + +class RightBrace : public Brace +{ +public: + ostream &display (ostream &str) { return this->close (str); } + string &display (string &str) { return this->close (str); } +}; + + + +class LeftParen : public Paren +{ +public: + ostream &display (ostream &str) { return this->open (str); } + string &display (string &str) { return this->open (str); } +}; + + + +class RightParen : public Paren +{ +public: + ostream &display (ostream &str) { return this->close (str); } + string &display (string &str) { return this->close (str); } +}; + + + +class LeftSquareBracket : public SquareBracket +{ +public: + ostream &display (ostream &str) { return this->open (str); } + string &display (string &str) { return this->open (str); } +}; + + + +class Rightbrace : public SquareBracket +{ +public: + ostream &display (ostream &str) { return this->close (str); } + string &display (string &str) { return this->close (str); } +}; + + + +ostream &operator<< (ostream &str, Bracket *b) +{ + b->display (str); + return str; +} + + + +string &operator<< (string &str, Bracket *b) +{ + string s; + b->display (s); + str += s; + return str; +} + + + +string &operator+= (string &str, Bracket *b) +{ + b->display (str); + return str; +} + + + +string operator+ (string &str, Bracket *b) +{ + string s; + b->display (s); + return (str + s); +} ADDED mtt/cc/include/useful-functions.hh Index: mtt/cc/include/useful-functions.hh ================================================================== --- mtt/cc/include/useful-functions.hh +++ mtt/cc/include/useful-functions.hh @@ -0,0 +1,112 @@ + +#ifndef HAVE_USEFUL_FUNCTIONS_HH +#define HAVE_USEFUL_FUNCTIONS_HH + +/* Code generation directives */ +#define STANDALONE 0 +#define OCTAVEDLD 1 +#define MATLABMEX 2 +#if (! defined (CODEGENTARGET)) +#define CODEGENTARGET -1 +#endif /* (! defined (CODEGENTARGET)) */ + +#ifndef __cplusplus +#define inline /* strip */ +#define cast_to_double (double) +/* +typedef unsigned int bool; +const bool true = 1; +const bool false = 0; +*/ +#else +#include +#define cast_to_double static_cast +using std::pow; +#endif /* ! __cplusplus */ + +#ifdef M_PI +static double pi = M_PI; +static double Pi = M_PI; +static double PI = M_PI; +#else +static double pi = 3.1416; +static double Pi = pi; +static double PI = pi; +#endif + +static inline double +max (const double x1, const double x2) +{ + return cast_to_double ((x1 >= x2) ? x1 : (x1 < x2) ? x2 : 0); +} + +static inline double +min (const double x1, const double x2) +{ + return cast_to_double ((x1 <= x2) ? x1 : (x1 > x2) ? x2 : 0); +} + +static inline double +nonsingular (const double x) +{ + return cast_to_double ((x == 0) ? 1.0e-30 : x); +} + +static inline double +sign (const double x) +{ + return cast_to_double ((x > 0) ? +1 : (x < 0) ? -1 : 0); +} + + +/* Octave functions */ +#if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == OCTAVEDLD)) +#ifdef __cplusplus +static Matrix +ones (const int r = 1, const int c = 1) +{ + Matrix m (r, c, 1.0); + return m; +} + +static ColumnVector +nozeros (const ColumnVector v0, const double tol = 0.0) +{ + ColumnVector v (v0.length ()); + register int i, j; + for (i = j = 0; i < v.length (); i++) + if (tol < std::abs (v0 (i))) + { + v (j) = v0 (i); + j++; + } + if (0 == j) + { + return *new ColumnVector (); + } + else + { + return (v.extract (0, --j)); + } +} + +static ColumnVector +zeros (const int r) +{ + ColumnVector v (r, 0.0); + return v; +} + +static Matrix +zeros (const int r, const int c) +{ + Matrix m (r, c, 0.0); + return m; +} +#endif /* __cplusplus */ +#endif /* ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == OCTAVEDLD)) */ + + + +#endif /* HAVE_USEFUL_FUNCTIONS_HH */ + ADDED mtt/cc/mtt_m2cc.sh Index: mtt/cc/mtt_m2cc.sh ================================================================== --- mtt/cc/mtt_m2cc.sh +++ mtt/cc/mtt_m2cc.sh @@ -0,0 +1,213 @@ +#! /bin/sh + +SYS=$1 +REP=$2 +TARGET=${3:-cc} +PARSER=${4:-indent} + +IN=${SYS}_${REP}.m +OUT=${SYS}_${REP}.${TARGET} +TMP=${SYS}_${REP}_m2cc.tmp + +rep_declarations () +{ +(case ${REP} in + simpar) + cat < ${TMP} + find_code ${TMP} head > ${OUT} + find_code ${IN} body |\ + decrement_indices |\ + fix_comment_delimiter c |\ + fix_pow |\ + strip_junk |\ + ${PARSER} >> ${OUT} + find_code ${TMP} foot >> ${OUT} + rm ${TMP} + ;; + cc | *) + mtt_header ${SYS} ${REP} "oct" > ${TMP} + find_code ${TMP} head > ${OUT} + rep_declarations >> ${OUT} + find_code ${IN} body |\ + decrement_indices |\ + c_to_fortran_paren |\ + fix_comment_delimiter cc |\ + fix_pow |\ + strip_junk |\ + ${PARSER} >> ${OUT} + rep_footer >> ${OUT} + find_code ${TMP} foot >> ${OUT} + rm ${TMP} + ;; +esac + + ADDED mtt/cc/parse_m2cc.cc Index: mtt/cc/parse_m2cc.cc ================================================================== --- mtt/cc/parse_m2cc.cc +++ mtt/cc/parse_m2cc.cc @@ -0,0 +1,392 @@ +/* $Id$ + * $Log$ + * Revision 1.4 2002/05/01 12:54:55 geraint + * Now recognises keywords terminated with ; as well as ws. + * Now recognises # as a comment when not terminated by ws. + * i.e. CarnotCycle_input.txt now gets translated correctly! + * + * Revision 1.3 2001/07/13 04:54:04 geraint + * Branch merge: numerical-algebraic-solution back to main. + * + * Revision 1.2.2.1 2001/06/30 03:26:17 geraint + * gcc-3.0 compatibility. + * + * Revision 1.2 2001/03/19 02:28:53 geraint + * Branch merge: merging-ode2odes-exe back to MAIN. + * + * Revision 1.1.2.2 2001/03/09 04:01:20 geraint + * \ escapes newline. + * + * Revision 1.1.2.1 2001/03/09 02:59:26 geraint + * got_comment: (char)c no longer compared to (int)EOF. + * + * Revision 1.1 2000/12/28 09:46:05 peterg + * put under RCS + * + * Revision 1.1 2000/10/31 04:29:50 geraint + * Initial revision + * + */ + + +#include +#include +#include +#include +#include +#include + + + +/* + * Bracket.hh deals with nesting levels of parenthesis + * just add Bracket pointer to string / stream + */ +#include "Bracket.hh" + + + +using namespace std; + +/* + * use lbrace, etc. in expressions to automate nesting calculations + */ +LeftBrace *lbrace = new LeftBrace; +RightBrace *rbrace = new RightBrace; + +LeftParen *lparen = new LeftParen; +RightParen *rparen = new RightParen; + + + +/* + * use brace nesting depth to determine indentation + */ +string indent (void) { return lbrace->indentation (); } + + + +/* + * map contains keyword to look for and function to call when found + */ +map keyword; + + + + +/* + * stack records current nest type + * so that "end" can be handled correctly + */ +enum nest_type +{ + null, + if_statement, + switch_statement, + while_statement +}; + +stack current_nest; + + + +/* + * assuming cin has '(' as next character + * find the matching ')' and return the string contained within + */ +string get_test (void) +{ + const int entry_nesting = lparen->get_nesting_depth (); + char c; + string buf = ""; + cin.setf (ios::skipws); + cin >> c; + if ('(' != c) + { + cerr << "Sorry, test must be enclosed in ( )" << endl; + cerr << "current character is " << c << endl; + /* + * replace this with a call to get_expression maybe? + */ + exit (-1); + } + else + { + buf += lparen; + } + cin.unsetf (ios::skipws); + while (entry_nesting != lparen->get_nesting_depth ()) { + cin >> c; + switch (c) + { + case '(': + buf += lparen; + break; + case ')': + buf += rparen; + break; + case EOF: + cerr << "Oops! EOF reached" << endl; + exit (-1); + default: + buf += c; + break; + } + } + return buf; +} + + + +/* + * functions to be called upon detection of keyword + */ +void got_if (void) +{ + current_nest.push (if_statement); + cout << "if "; + cout << get_test (); + cout << lbrace; +} + +void got_else (void) +{ + cout << rbrace; + cout << "else"; + cout << lbrace; +} + +void got_elseif (void) +{ + cout << rbrace; + got_if (); +} + +void got_switch (void) +{ + current_nest.push (switch_statement); + cout << "switch "; + cout << get_test (); + cout << lbrace; + /* + * open a second brace so that each "case" can be enclosed + */ + cout << lbrace; +} + +void got_case (void) +{ + cout << rbrace; + cout << "case "; + cout << get_test (); + cout << ':'; + cout << lbrace; +} + +void got_otherwise (void) +{ + cout << rbrace; + cout << "default:"; + cout << lbrace; +} + +void got_while (void) +{ + current_nest.push (while_statement); + cout << "while "; + cout << get_test (); + cout << lbrace; +} + +void got_end (void) +{ + enum nest_type n = current_nest.top (); + switch (n) + { + case if_statement: + case while_statement: + cout << rbrace; + break; + case switch_statement: + cout << rbrace + << rbrace; + break; + default: + cerr << "Oops! Unmatched end ... aborting" << endl; + exit (-1); + break; + } + current_nest.pop (); +} + +void got_comment (void) +{ + /* + * get remainder of line in case there are any commented keywords + */ + char c; + cout << " // "; + cin >> c; + do { + cout << c; + } while (c != '\n' && cin >> c); + cout << endl + << indent () << ';' << endl + << indent (); +} + + + +/* + * map contains keyword to look for and functions to call when found + * functions must be of the form "void f (void) {...;}" + * new structures should also be added to enum nest_type + */ +void set_keyword (void) +{ + // if + keyword ["if"] = got_if; + keyword ["else"] = got_else; + keyword ["elseif"] = got_elseif; + keyword ["endif"] = got_end; + + // switch + keyword ["switch"] = got_switch; + keyword ["case"] = got_case; + keyword ["otherwise"] = got_otherwise; + keyword ["endswitch"] = got_end; + + // while + keyword ["while"] = got_while; + keyword ["endwhile"] = got_end; + + // general + keyword ["end"] = got_end; + + /* + * this won't work inside a string + * or if there is no space around the delimiter + */ + keyword ["#"] = got_comment; + keyword ["//"] = got_comment; + +/* + * unimplemented keywords + * + keyword ["for"] = got_for; + keyword ["endfor"] = got_end; + keyword ["break"] = got_break; + keyword ["continue"] = got_continue; +*/ +} + + + +/* read in one character at a time looking for tokens (delimited by whitespace) + * if the token is a keyword, call the appropriate function + */ +int main (void) +{ + set_keyword (); + string buf = ""; + char c; + cin.unsetf (ios::skipws); + while (cin >> c) + { + switch (c) + { + case EOF: + return 0; + case ' ': + case '\t': + if (keyword [buf]) + { + keyword [buf](); + } + else + { + if (! lbrace->get_nesting_depth ()) + { + buf += c; + } + cout << buf; + } + buf = ""; + break; + case ';': + case '\n': + if (keyword [buf]) + { + /* + * keyword found, call function + */ + keyword [buf] (); + } + else + { + cout << buf + /* + * keep newline in case this line has an EOL-comment + */ + << endl + /* + * EOL is end-of-statement in Octave, add ; + */ + << indent () << ';' << endl + << indent (); + } + buf = ""; + break; + case '#': + if (keyword [buf]) + { + /* + * keyword found, call function + */ + keyword [buf] (); + } + else + { + cout << buf + /* + * keep newline in case this line has an EOL-comment + */ + << endl + /* + * EOL is end-of-statement in Octave, add ; + */ + << indent () << ';' << endl + << indent (); + } + keyword ["#"] (); + buf = ""; + break; + + case '\\': + cin >> c; + if ('\n' == c) + { + buf += '\n'; + } + else + { + buf += '\\'; + buf += c; + } + break; + default: + buf += c; + } + if (lbrace->get_nesting_depth ()) + { + cout.setf (ios::skipws); + } + else + { + cout.unsetf (ios::skipws); + } + } + return 0; +} + + ADDED mtt/cc/sympar_txt2h.sh Index: mtt/cc/sympar_txt2h.sh ================================================================== --- mtt/cc/sympar_txt2h.sh +++ mtt/cc/sympar_txt2h.sh @@ -0,0 +1,1128 @@ +#! /bin/sh +# $Id$ +# $Log$ +# Revision 1.9 2004/08/29 03:18:11 geraint +# Do not write temporary variables if NUM_OF_TMP_VAR = 0. +# +# Revision 1.8 2002/09/16 08:08:01 geraint +# Merged changes from global-optimisation branch. +# +# Revision 1.7.2.1 2002/09/04 10:44:59 geraint +# Added option to specify number of tmp variables declared (-ntmpvar ). +# +# Revision 1.7 2002/07/10 11:53:32 geraint +# Replaced shell loop with template expansion - perceptibly quicker generation of sympar.h. +# +# Revision 1.6 2002/05/19 13:01:22 geraint +# Numerical solution of algebraic equations implemented for S-function target. +# +# Equation solving requires the Matlab Optimization Toolbox to be installed. +# +# Code has been changed from C++ to C to allow mex files to be built with LCC, +# the compiler bundled with Matlab. +# +# Parameters are now obtained from numpar.c instead of a dialogue box. +# +# `mtt sfun zip` creates all necessary files for building the model mex files. +# +# Revision 1.5 2002/04/28 18:58:06 geraint +# Fixed [ 549658 ] awk should be gawk. +# Replaced calls to awk with call to gawk. +# +# Revision 1.4 2001/08/24 21:41:04 geraint +# Fixed problem with declaration when there are no numerical parameters. +# +# Revision 1.3 2001/03/19 02:28:53 geraint +# Branch merge: merging-ode2odes-exe back to MAIN. +# +# Revision 1.2.2.1 2001/03/16 03:56:54 geraint +# Convert variable names to lower case. +# +# Revision 1.2 2001/02/05 13:03:19 geraint +# Restrict scope of variables to file (static). +# Warn GCC that variables may be unused. +# +# Revision 1.7 2001/01/09 15:43:50 geraint +# Warn gcc that variables may be unused. +# +# Revision 1.6 2001/01/08 05:47:56 geraint +# Restrict scope of variables to file (static) +# +# Revision 1.5 2000/12/05 12:44:55 peterg +# Changed $() to `` +# +# Revision 1.4 2000/12/05 12:16:02 peterg +# Changed function name to name() +# +# Revision 1.3 2000/12/04 11:05:01 peterg +# Removed () -- geraint +# +# Revision 1.2 2000/11/07 17:29:27 peterg +# Changed echo +# +# Revision 1.1 2000/11/07 17:28:53 peterg +# Initial revision +# +# Revision 1.1 2000/10/31 04:32:02 geraint +# Initial revision +# + +SYS=$1 + +if [ $# -gt 1 ] +then + NUM_OF_TMP_VAR=$2; + shift; shift; +else + NUM_OF_TMP_VAR=500 + shift; +fi +TMP_VAR_NAMES="mtt_tmp mtt_o $*" + +IN=${SYS}_sympar.txt +OUT=${SYS}_sympar.h + +declare_sys_param () +{ +cat ${IN} | gawk '(NF>0){printf ("static double %s MTT_UNUSED;\t/* %s\t*/\n", tolower($1), $2)}' +} + +declare_temp_vars () +{ +for name in ${TMP_VAR_NAMES} +do + echo "" + + cat < ${OUT} +#ifndef MTT_UNUSED +#ifdef __GNUC__ +#define MTT_UNUSED __attribute__ ((__unused__)) +#else +#define MTT_UNUSED +#endif +#endif + +EOF + +declare_sys_param >> ${OUT} +if [ ${NUM_OF_TMP_VAR} -gt 0 ]; then + declare_temp_vars >> ${OUT} +fi + + ADDED mtt/debian/README.Debian Index: mtt/debian/README.Debian ================================================================== --- mtt/debian/README.Debian +++ mtt/debian/README.Debian @@ -0,0 +1,7 @@ +mtt for Debian +-------------- + +Model Transformation Tools is hosted on Sourceforge +http://sourceforge.net/projects/mtt + + -- Geraint , Sun, 28 Apr 2002 00:11:29 +0000 ADDED mtt/debian/changelog Index: mtt/debian/changelog ================================================================== --- mtt/debian/changelog +++ mtt/debian/changelog @@ -0,0 +1,6 @@ +mtt (4.9+2002.04.27-1) unstable; urgency=low + + * Initial Release. + + -- Geraint Sun, 28 Apr 2002 00:11:29 +0000 + ADDED mtt/debian/compat Index: mtt/debian/compat ================================================================== --- mtt/debian/compat +++ mtt/debian/compat @@ -0,0 +1,1 @@ +7 ADDED mtt/debian/conffiles Index: mtt/debian/conffiles ================================================================== --- mtt/debian/conffiles +++ mtt/debian/conffiles @@ -0,0 +1,1 @@ +/etc/mtt.conf ADDED mtt/debian/conffiles.ex Index: mtt/debian/conffiles.ex ================================================================== --- mtt/debian/conffiles.ex +++ mtt/debian/conffiles.ex @@ -0,0 +1,7 @@ +# +# If you want to use this conffile, remove all comments and put files that +# you want dpkg to process here using their absolute pathnames. +# See the policy manual +# +# for example: +# /etc/mtt/mtt.conf ADDED mtt/debian/control Index: mtt/debian/control ================================================================== --- mtt/debian/control +++ mtt/debian/control @@ -0,0 +1,19 @@ +Source: mtt +Section: contrib/math +Priority: optional +Maintainer: Geraint +Build-Depends: debhelper (>> 3.0.0) +Standards-Version: 3.5.2 + +Package: mtt +Architecture: all +Depends: gawk, octave, units, xfig, perl +Recommends: mtt-examples, blas-dev, fftw-dev, c-compiler, dia, g++, gnuplot, info-browser, lapack-dev, latex2html, libkpathsea-dev, libncurses5-dev, libreadline4-dev, libxml-dom-perl, pdf-viewer, postscript-viewer, octave-pkg-dev, octave-info, texlive, texlive-latex-extra, transfig, xterm, www-browser, wish +Suggests: scigraphica, zip +Description: Model Transformation Tools. + A set of tools for modelling dynamic physical systems using the bond-graph methodology and transforming these models into representations suitable for analysis, control and simulation. These tools use, and generate m files for, GNU Octave. + . + The MTT homepage is located at http://mtt.sourceforge.net. An on-line manual is available at http://mtt.sourceforge.net/doc. + . + MTT uses the non-free symbolic algebra tool Reduce to perform some transformations and it is highly recommended that this software is installed. Details of Reduce can be found at http://www.reduce-algebra.com + . ADDED mtt/debian/copyright Index: mtt/debian/copyright ================================================================== --- mtt/debian/copyright +++ mtt/debian/copyright @@ -0,0 +1,16 @@ +This package was debianized by Geraint on +Sun, 28 Apr 2002 00:11:29 +0000. + +It was downloaded from http://sourceforge.net/projects/mtt + +Upstream Author(s): Peter Gawthrop + +Copyright: + +mtt is copyright (c) 1989-2004 by Peter J. Gawthrop. + +You are free to distribute this software under the terms of the +GNU General Public License (GPL). + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL. ADDED mtt/debian/cron.d.ex Index: mtt/debian/cron.d.ex ================================================================== --- mtt/debian/cron.d.ex +++ mtt/debian/cron.d.ex @@ -0,0 +1,4 @@ +# +# Regular cron jobs for the mtt package +# +0 4 * * * root mtt_maintenance ADDED mtt/debian/dirs Index: mtt/debian/dirs ================================================================== --- mtt/debian/dirs +++ mtt/debian/dirs @@ -0,0 +1,2 @@ +usr/bin + ADDED mtt/debian/docs Index: mtt/debian/docs ================================================================== --- mtt/debian/docs +++ mtt/debian/docs ADDED mtt/debian/emacsen-install.ex Index: mtt/debian/emacsen-install.ex ================================================================== --- mtt/debian/emacsen-install.ex +++ mtt/debian/emacsen-install.ex @@ -0,0 +1,45 @@ +#! /bin/sh -e +# /usr/lib/emacsen-common/packages/install/mtt + +# Written by Jim Van Zandt , borrowing heavily +# from the install scripts for gettext by Santiago Vila +# and octave by Dirk Eddelbuettel . + +FLAVOR=$1 +PACKAGE=mtt + +if [ ${FLAVOR} = emacs ]; then exit 0; fi + +echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} + +#FLAVORTEST=`echo $FLAVOR | cut -c-6` +#if [ ${FLAVORTEST} = xemacs ] ; then +# SITEFLAG="-no-site-file" +#else +# SITEFLAG="--no-site-file" +#fi +FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" + +ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} + +# Install-info-altdir does not actually exist. +# Maybe somebody will write it. +if test -x /usr/sbin/install-info-altdir; then + echo install/${PACKAGE}: install Info links for ${FLAVOR} + install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz +fi + +install -m 755 -d ${ELCDIR} +cd ${ELDIR} +FILES=`echo *.el` +cp ${FILES} ${ELCDIR} +cd ${ELCDIR} + +cat << EOF > path.el +(setq load-path (cons "." load-path) byte-compile-warnings nil) +EOF +${FLAVOR} ${FLAGS} ${FILES} +rm -f *.el path.el + +exit 0 ADDED mtt/debian/emacsen-remove.ex Index: mtt/debian/emacsen-remove.ex ================================================================== --- mtt/debian/emacsen-remove.ex +++ mtt/debian/emacsen-remove.ex @@ -0,0 +1,15 @@ +#!/bin/sh -e +# /usr/lib/emacsen-common/packages/remove/mtt + +FLAVOR=$1 +PACKAGE=mtt + +if [ ${FLAVOR} != emacs ]; then + if test -x /usr/sbin/install-info-altdir; then + echo remove/${PACKAGE}: removing Info links for ${FLAVOR} + install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/mtt.info.gz + fi + + echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} + rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} +fi ADDED mtt/debian/emacsen-startup.ex Index: mtt/debian/emacsen-startup.ex ================================================================== --- mtt/debian/emacsen-startup.ex +++ mtt/debian/emacsen-startup.ex @@ -0,0 +1,18 @@ +;; -*-emacs-lisp-*- +;; +;; Emacs startup file for the Debian GNU/Linux mtt package +;; +;; Originally contributed by Nils Naumann +;; Modified by Dirk Eddelbuettel +;; Adapted for dh-make by Jim Van Zandt + +;; The mtt package follows the Debian/GNU Linux 'emacsen' policy and +;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, +;; xemacs19, emacs20, xemacs20...). The compiled code is then +;; installed in a subdirectory of the respective site-lisp directory. +;; We have to add this to the load-path: +(setq load-path (cons (concat "/usr/share/" + (symbol-name flavor) + "/site-lisp/mtt") load-path)) + + ADDED mtt/debian/ex.package.doc-base Index: mtt/debian/ex.package.doc-base ================================================================== --- mtt/debian/ex.package.doc-base +++ mtt/debian/ex.package.doc-base @@ -0,0 +1,22 @@ +Document: mtt +Title: Debian mtt Manual +Author: +Abstract: This manual describes what mtt is + and how it can be used to + manage online manuals on Debian systems. +Section: unknown + +Format: debiandoc-sgml +Files: /usr/share/doc/mtt/mtt.sgml.gz + +Format: postscript +Files: /usr/share/doc/mtt/mtt.ps.gz + +Format: text +Files: /usr/share/doc/mtt/mtt.text.gz + +Format: HTML +Index: /usr/share/doc/mtt/html/index.html +Files: /usr/share/doc/mtt/html/*.html + + ADDED mtt/debian/init.d.ex Index: mtt/debian/init.d.ex ================================================================== --- mtt/debian/init.d.ex +++ mtt/debian/init.d.ex @@ -0,0 +1,70 @@ +#! /bin/sh +# +# skeleton example file to build /etc/init.d/ scripts. +# This file should be used to construct scripts for /etc/init.d. +# +# Written by Miquel van Smoorenburg . +# Modified for Debian GNU/Linux +# by Ian Murdock . +# +# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl +# +# This file was automatically customized by dh-make on Sun, 28 Apr 2002 00:11:29 +0000 + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/mtt +NAME=mtt +DESC=mtt + +test -f $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON + echo "$NAME." + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # /var/run/$NAME.pid --exec $DAEMON + #;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 ADDED mtt/debian/manpage.1.ex Index: mtt/debian/manpage.1.ex ================================================================== --- mtt/debian/manpage.1.ex +++ mtt/debian/manpage.1.ex @@ -0,0 +1,60 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH MTT SECTION "April 28, 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +mtt \- program to do something +.SH SYNOPSIS +.B mtt +.RI [ options ] " files" ... +.br +.B bar +.RI [ options ] " files" ... +.SH DESCRIPTION +This manual page documents briefly the +.B mtt +and +.B bar +commands. +This manual page was written for the Debian distribution +because the original program does not have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBmtt\fP is a program that... +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +For a complete description, see the Info files. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-v, \-\-version +Show version of program. +.SH SEE ALSO +.BR bar (1), +.BR baz (1). +.br +The programs are documented fully by +.IR "The Rise and Fall of a Fooish Bar" , +available via the Info system. +.SH AUTHOR +This manual page was written by Geraint , +for the Debian GNU/Linux system (but may be used by others). ADDED mtt/debian/manpage.sgml.ex Index: mtt/debian/manpage.sgml.ex ================================================================== --- mtt/debian/manpage.sgml.ex +++ mtt/debian/manpage.sgml.ex @@ -0,0 +1,152 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + + + The docbook-to-man binary is found in the docbook-to-man package. + Please remember that if you create the nroff version in one of the + debian/rules file targets (such as build), you will need to include + docbook-to-man in your Build-Depends control field. + + --> + + + FIRSTNAME"> + SURNAME"> + + April 28, 2002"> + + SECTION"> + geraint@users.sf.net"> + + MTT"> + + + Debian"> + GNU"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2001 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + program to do something + + + + &dhpackage; + + + + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; and bar + commands. + + This manual page was written for the &debian; distribution + because the original program does not have a manual page. + Instead, it has documentation in the &gnu; + Info format; see below. + + &dhpackage; is a program that... + + + + OPTIONS + + These programs follow the usual GNU command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + Info files. + + + + + + + + Show summary of options. + + + + + + + + Show version of program. + + + + + + SEE ALSO + + bar (1), baz (1). + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + Info system. + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the GNU Free Documentation + License, Version 1.1 or any later version published by the Free + Software Foundation; with no Invariant Sections, no Front-Cover + Texts and no Back-Cover Texts. + + +
+ + + + ADDED mtt/debian/menu Index: mtt/debian/menu ================================================================== --- mtt/debian/menu +++ mtt/debian/menu @@ -0,0 +1,6 @@ +?package(mtt):needs="X11"\ + section="Apps/Math"\ + title="Xmtt"\ + longtitle="Model Transformation Tools for X"\ + hint="Model Transformation Tools for X"\ + command="x-terminal-emulator -e /usr/bin/xmtt" ADDED mtt/debian/menu.ex Index: mtt/debian/menu.ex ================================================================== --- mtt/debian/menu.ex +++ mtt/debian/menu.ex @@ -0,0 +1,4 @@ +?package(mtt):needs=X11|text|vc|wm section=Apps/see-menu-manual\ + title="mtt" command="/usr/bin/mtt" +?package(mtt):needs=X11|text|vc|wm section=Apps/see-menu-manual\ + title="xmtt" command="/usr/bin/xmtt" ADDED mtt/debian/mtt.1 Index: mtt/debian/mtt.1 ================================================================== --- mtt/debian/mtt.1 +++ mtt/debian/mtt.1 @@ -0,0 +1,147 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH MTT 1 "April 27, 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +mtt \- Model Transformation Tools +.SH SYNOPSIS +.B mtt +.RI [ options ] " system representation language" +.br +.B xmtt +.RI [ --update ] +.SH DESCRIPTION +This manual page documents briefly the +.B mtt +and +.B xmtt +commands. +Detailed documentation is available in info or html format by issuing +the command +.B mtt info +for info format or +.B mtt hinfo +for html. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBmtt\fP is a set of tools for modelling dynamic physical systems using the bond-graph methodology and transforming these models into representations suitable for analysis, control and simulation. These tools use, and generate m files for, GNU Octave. +.SH OPTIONS +A summary of options is included below. +For a complete description, see the Info files. +.TP +.B \-q +quiet mode -- suppress MTT banner +.TP +.B \-A +solve algebraic equations symbolically +.TP +.B \-D +debug -- leave log files etc +.TP +.B \-I +prints more information +.TP +.B \-abg +start at abg.m representation +.TP +.B \-c +c-code generation +.TP +.B \-cc +C++ code generation +.TP +.B \-cr +Use cr before resolving equations +.TP +.B \-d +use directory +.TP +.B \-dc +Maximise derivative (not integral) causality +.TP +.B \-dc +Maximise derivative (not integral) causality +.TP +.B \-i +Use implicit, euler, rk4 or dassl integration +.TP +.B \-ae +Solve algebraic equations with specified solver +.TP +.B \-o +ode is same as dae +.TP +.B \-oct +use oct files in place of m files where appropriate +.TP +.B \-opt +optimise code generation +.TP +.B \-p +print environment variables +.TP +.B \-partition + partition hierachical system +.TP +.B \-pdf +generate pdf in place of ps +.TP +.B \-r +reset time stamp on representation +.TP +.B \-s +generate sensitivity BG (use mtt -s sSys rep lang) +.TP +.B \-ss +use steady-state info to initialise simulations +.TP +.B \-stdin +read input data from standard input for simulations +.TP +.B \-sub +operate on this subsystem +.TP +.B \-t +tidy mode (default) +.TP +.B \-trace +Just indicate what mtt will do - but do not do it +.TP +.B \-u +untidy mode (leaves files in current dir) +.TP +.B \-v +verbose mode (multiple uses of -v increase the verbosity level) +.TP +.B \-viewlevel +View N levels of hierachy +.TP +.B \-\-version +print version and exit +.TP +.B \-\-versions +print version of mtt and components and exit + +The programs are documented fully by +.IR "mtt: Model Transformation Tools" , +available via the Info system. +.SH FILES +/etc/mtt.conf +.SH AUTHOR +This manual page was written by Geraint , +for the Debian GNU/Linux system (but may be used by others). ADDED mtt/debian/mtt.doc-base Index: mtt/debian/mtt.doc-base ================================================================== --- mtt/debian/mtt.doc-base +++ mtt/debian/mtt.doc-base @@ -0,0 +1,21 @@ +Document: mtt +Title: Model Transformation Tools (MTT) Manual +Author: Peter Gawthrop, Geraint Bevan +Abstract: This manual describes Model Transformation Tools (MTT), + a set of tools for modelling dynamic physical systems using the bond-graph + methodology and transforming these models into representations suitable for + analysis, control and simulation. + These tools use, and generate m files for, GNU Octave. +Section: Apps/Math + +Format: postscript +Files: /usr/share/doc/mtt/mtt.ps.gz + +Format: PDF +Files: /usr/share/doc/mtt/mtt.pdf.gz + +Format: HTML +Index: /usr/share/doc/mtt/mtt.html +Files: /usr/share/doc/mtt/*.html + + ADDED mtt/debian/package.doc-base Index: mtt/debian/package.doc-base ================================================================== --- mtt/debian/package.doc-base +++ mtt/debian/package.doc-base @@ -0,0 +1,19 @@ +Document: mtt +Title: Debian mtt Manual +Author: Peter Gawthrop +Abstract: This manual describes mtt, + a set of tools for modelling dynamic physical systems + using the bond-graph methodology and transforming these + models into representations suitable for analysis, control + and simulation. These tools use, and generate m files for, + GNU Octave. +Section: math + +Format: postscript +Files: /usr/share/doc/mtt/mtt.ps.gz + +Format: HTML +Index: /usr/share/doc/mtt/html/mtt.html +Files: /usr/share/doc/mtt/html/*.html + + ADDED mtt/debian/postinst Index: mtt/debian/postinst ================================================================== --- mtt/debian/postinst +++ mtt/debian/postinst @@ -0,0 +1,51 @@ +#! /bin/sh +# postinst script for mtt +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + install-info --menuentry=MTT \ + --description="Model Transformation Tools" \ + --section "[Mm]ath" Mathematics \ + /usr/share/info/mtt.info.gz + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ADDED mtt/debian/postinst.ex Index: mtt/debian/postinst.ex ================================================================== --- mtt/debian/postinst.ex +++ mtt/debian/postinst.ex @@ -0,0 +1,48 @@ +#! /bin/sh +# postinst script for mtt +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ADDED mtt/debian/postrm.ex Index: mtt/debian/postrm.ex ================================================================== --- mtt/debian/postrm.ex +++ mtt/debian/postrm.ex @@ -0,0 +1,38 @@ +#! /bin/sh +# postrm script for mtt +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 ADDED mtt/debian/preinst.ex Index: mtt/debian/preinst.ex ================================================================== --- mtt/debian/preinst.ex +++ mtt/debian/preinst.ex @@ -0,0 +1,44 @@ +#! /bin/sh +# preinst script for mtt +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) +# if [ "$1" = "upgrade" ] +# then +# start-stop-daemon --stop --quiet --oknodo \ +# --pidfile /var/run/mtt.pid \ +# --exec /usr/sbin/mtt 2>/dev/null || true +# fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ADDED mtt/debian/prerm Index: mtt/debian/prerm ================================================================== --- mtt/debian/prerm +++ mtt/debian/prerm @@ -0,0 +1,39 @@ +#! /bin/sh +# prerm script for mtt +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + install-info --quiet --remove /usr/share/info/mtt.info.gz + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ADDED mtt/debian/prerm.ex Index: mtt/debian/prerm.ex ================================================================== --- mtt/debian/prerm.ex +++ mtt/debian/prerm.ex @@ -0,0 +1,39 @@ +#! /bin/sh +# prerm script for mtt +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) +# install-info --quiet --remove /usr/info/mtt.info.gz + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ADDED mtt/debian/rules Index: mtt/debian/rules ================================================================== --- mtt/debian/rules +++ mtt/debian/rules @@ -0,0 +1,94 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatibility version to use. +export DH_COMPAT=3 + + + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) build build-doc + #/usr/bin/docbook-to-man debian/mtt.sgml > mtt.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/mtt. + $(MAKE) install install-doc install-xfig DESTDIR=$(CURDIR)/debian/mtt + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit + dh_installcron + dh_installman debian/mtt.1 + dh_installinfo +# dh_undocumented + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure ADDED mtt/debian/watch.ex Index: mtt/debian/watch.ex ================================================================== --- mtt/debian/watch.ex +++ mtt/debian/watch.ex @@ -0,0 +1,5 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# Site Directory Pattern Version Script +sunsite.unc.edu /pub/Linux/Incoming mtt-(.*)\.tar\.gz debian uupdate ADDED mtt/doc/13873950500069078.pdf Index: mtt/doc/13873950500069078.pdf ================================================================== --- mtt/doc/13873950500069078.pdf +++ mtt/doc/13873950500069078.pdf cannot compute difference between binary files ADDED mtt/doc/293854591.pdf Index: mtt/doc/293854591.pdf ================================================================== --- mtt/doc/293854591.pdf +++ mtt/doc/293854591.pdf cannot compute difference between binary files ADDED mtt/doc/BreedveldChapter.pdf Index: mtt/doc/BreedveldChapter.pdf ================================================================== --- mtt/doc/BreedveldChapter.pdf +++ mtt/doc/BreedveldChapter.pdf cannot compute difference between binary files ADDED mtt/doc/GawSmi96.pdf Index: mtt/doc/GawSmi96.pdf ================================================================== --- mtt/doc/GawSmi96.pdf +++ mtt/doc/GawSmi96.pdf cannot compute difference between binary files ADDED mtt/doc/Makefile Index: mtt/doc/Makefile ================================================================== --- mtt/doc/Makefile +++ mtt/doc/Makefile @@ -0,0 +1,97 @@ +#Makefile for MTT documentation + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2002/04/26 17:17:20 geraint +## Allow variables to be set outside Makefile. +## +## Revision 1.1 2001/06/04 08:18:52 gawthrop +## Putting documentation under CVS +## +## Revision 1.2 1998/07/02 18:40:07 peterg +## More on install option +## +## Revision 1.1 1998/05/14 09:19:52 peterg +## Initial revision +## +############################################################### + + +#MTTPATH = /home/peterg/mtt_new/mtt +#DOCPATH = /home/peterg/web-docs/software/MTT/doc +#INFOPATH = /usr/info + +MTTPATH ?= /home/peterg/mtt_new/mtt +MTT_COMPONENTS ?= /home/eng4/peterg/mtt_new/mtt/lib/comp +MTT_EXAMPLES ?= /home/eng4/peterg/mtt_new/mtt/lib/examples +DOCPATH ?= /home/peterg/web-docs/software/MTT/doc +#INFOPATH = $(DOCPATH) +INFOPATH ?= /usr/info + +all: mtt.info mtt.html mtt.pdf mtt.ps.gz + +mtt.info: mtt.texi + echo "Making info manual. Please wait ..."; makeinfo mtt.texi + +mtt.dvi: mtt.texi + echo "Making dvi manual. Please wait ..."; tex mtt.texi; tex mtt.texi + +mtt.html: mtt.texi + echo "Making html manual. Please wait ..."; texi2html -glossary mtt.texi + +mtt.ps.gz: mtt.dvi + echo "Making ps manual. Please wait ..."; dvips -o mtt.ps mtt; gzip -f mtt.ps + +mtt.pdf: mtt.texi + echo "Making pdf manual. Please wait ..."; texi2pdf mtt.texi + +Compound-Components_rep.ps: + (cd $(MTT_COMPONENTS); mtt Compound-Components rep ps) + mv $(MTT_COMPONENTS)/Compound-Components_rep.ps . + +Compound-Components_rep: + (cd $(MTT_COMPONENTS); mtt Compound-Components rep html) + mv $(MTT_COMPONENTS)/Compound-Components_rep . + +Examples_rep.ps: + (cd $(MTT_EXAMPLES); mtt Examples rep ps) + mv $(MTT_EXAMPLES)/Examples_rep.ps . + +Examples_rep: + (cd $(MTT_EXAMPLES); mtt Examples rep html) + mv $(MTT_EXAMPLES)/Examples_rep . + +clean: + rm -f mtt.aux mtt.fns mtt.pg mtt.tp + rm -f mtt.cp mtt.pgs mtt.vr mtt.ps + rm -f mtt.cps mtt.vrs mtt.dvi mtt.ps.gz + rm -f mtt.ky mtt.fn mtt.log mtt.toc + rm -f mtt.ps mtt.info-* mtt.pdf + rm -f mtt.html mtt_toc.html mtt.info + rm -f mtt.log mtt.ky mtt.toc + +tidy: + rm -f mtt.aux mtt.fns mtt.pg mtt.tp + rm -f mtt.cp mtt.pgs mtt.vr + rm -f mtt.cps mtt.vrs mtt.dvi + rm -f mtt.log mtt.ky mtt.toc + + +install-doc: mtt.html mtt.ps.gz mtt.info + cp mtt.info* $(INFOPATH) + cp mtt*.html mtt.ps.gz $(DOCPATH) + chmod -R a+r $(DOCPATH) + chmod a+x $(DOCPATH) + +install-components: Compound-Components_rep.ps Compound-Components_rep + mv Compound-Components_rep.ps $(DOCPATH)/../components + mv Compound-Components_rep $(DOCPATH)/../components + chmod -R a+r $(DOCPATH)/../components + chmod -R a+x $(DOCPATH)/../components/Compound-Components_re + + + + ADDED mtt/doc/PN10J72L665H44JN.pdf Index: mtt/doc/PN10J72L665H44JN.pdf ================================================================== --- mtt/doc/PN10J72L665H44JN.pdf +++ mtt/doc/PN10J72L665H44JN.pdf cannot compute difference between binary files ADDED mtt/doc/bbm_978-3-662-04181-9-1.pdf Index: mtt/doc/bbm_978-3-662-04181-9-1.pdf ================================================================== --- mtt/doc/bbm_978-3-662-04181-9-1.pdf +++ mtt/doc/bbm_978-3-662-04181-9-1.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/AlgebraicLoops_rep.pdf Index: mtt/doc/example_out/AlgebraicLoops_rep.pdf ================================================================== --- mtt/doc/example_out/AlgebraicLoops_rep.pdf +++ mtt/doc/example_out/AlgebraicLoops_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Anaesthesia_rep.pdf Index: mtt/doc/example_out/Anaesthesia_rep.pdf ================================================================== --- mtt/doc/example_out/Anaesthesia_rep.pdf +++ mtt/doc/example_out/Anaesthesia_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Chemical_rep.pdf Index: mtt/doc/example_out/Chemical_rep.pdf ================================================================== --- mtt/doc/example_out/Chemical_rep.pdf +++ mtt/doc/example_out/Chemical_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Components_rep.pdf Index: mtt/doc/example_out/Components_rep.pdf ================================================================== --- mtt/doc/example_out/Components_rep.pdf +++ mtt/doc/example_out/Components_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Electrical_rep.pdf Index: mtt/doc/example_out/Electrical_rep.pdf ================================================================== --- mtt/doc/example_out/Electrical_rep.pdf +++ mtt/doc/example_out/Electrical_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Electromechanical_rep.pdf Index: mtt/doc/example_out/Electromechanical_rep.pdf ================================================================== --- mtt/doc/example_out/Electromechanical_rep.pdf +++ mtt/doc/example_out/Electromechanical_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/GasDynamics_rep.pdf Index: mtt/doc/example_out/GasDynamics_rep.pdf ================================================================== --- mtt/doc/example_out/GasDynamics_rep.pdf +++ mtt/doc/example_out/GasDynamics_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Hybrid_rep.pdf Index: mtt/doc/example_out/Hybrid_rep.pdf ================================================================== --- mtt/doc/example_out/Hybrid_rep.pdf +++ mtt/doc/example_out/Hybrid_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Identification_rep.pdf Index: mtt/doc/example_out/Identification_rep.pdf ================================================================== --- mtt/doc/example_out/Identification_rep.pdf +++ mtt/doc/example_out/Identification_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Inverse_rep.pdf Index: mtt/doc/example_out/Inverse_rep.pdf ================================================================== --- mtt/doc/example_out/Inverse_rep.pdf +++ mtt/doc/example_out/Inverse_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Mechanical_rep.pdf Index: mtt/doc/example_out/Mechanical_rep.pdf ================================================================== --- mtt/doc/example_out/Mechanical_rep.pdf +++ mtt/doc/example_out/Mechanical_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Sensitivity_rep.pdf Index: mtt/doc/example_out/Sensitivity_rep.pdf ================================================================== --- mtt/doc/example_out/Sensitivity_rep.pdf +++ mtt/doc/example_out/Sensitivity_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Simulation_rep.pdf Index: mtt/doc/example_out/Simulation_rep.pdf ================================================================== --- mtt/doc/example_out/Simulation_rep.pdf +++ mtt/doc/example_out/Simulation_rep.pdf cannot compute difference between binary files ADDED mtt/doc/example_out/Thermal_rep.pdf Index: mtt/doc/example_out/Thermal_rep.pdf ================================================================== --- mtt/doc/example_out/Thermal_rep.pdf +++ mtt/doc/example_out/Thermal_rep.pdf cannot compute difference between binary files ADDED mtt/doc/mtt.html Index: mtt/doc/mtt.html ================================================================== --- mtt/doc/mtt.html +++ mtt/doc/mtt.html @@ -0,0 +1,24060 @@ + + + + + + MTT: Model Transformation Tools + + + + + + + + + + + + + + + + +
+ [Top] + + [Contents] + + [Index] + + [ ? ] +
+

MTT: Model Transformation Tools

+ MTT is a set of Model Transformation Tools based on bond + graphs. MTT + implements the theory to be found in the book "Metamodelling: Bond Graphs + and Dynamic Systems" by Peter Gawthrop and Lorcan Smith published by + Prentice Hall in 1996 (ISBN 0-13-489824-9). +

It implements two features not discussed in that book:

+
    +
  • bicausal bond graphs and
  • +
  • hierarchical bond graphs.
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 1. Introduction +
+ 2. User interface +
+ 3. Creating Models +
+ 4. Simulation +
+ 5. Sensitivity models +
+ 6. Representations +
+ 7. Extending MTT +
+ 8. Documentation +
+ 9. Languages +
+ 10. Language tools +
+ 11. Administration +
+ Glossary +
Index
+ -- The Detailed Node Listing --- +
Introduction
+ 1.1 What is a representation? +
+ 1.2 What is a transformation? +
+ 1.3 What is a bond graph? +
+ 1.4 Variables +
1.5 Bonds
+ 1.6 Components +
+ 1.7 Algebraic loops +
+ 1.8 Switched systems +
Components
+ 1.6.1 Ports +
+ 1.6.2 Constitutive relationship +
+ 1.6.3 Symbolic parameters +
+ 1.6.4 Numeric parameters +
User interface
+ 2.1 Menu-driven interface +
+ 2.2 Command line interface +
+ 2.3 Options +
+ 2.4 Utilities +
Utilities
+ 2.4.1 Help +
+ 2.4.2 Copy +
+ 2.4.3 Clean +
+ 2.4.4 Version control +
Help
+ 2.4.1.1 help representations +
+ 2.4.1.2 help components +
+ 2.4.1.3 help examples +
+ 2.4.1.4 help crs +
+ 2.4.1.5 help <name> +
Creating Models
+ 3.1 Quick start +
+ 3.2 Creating simple models +
+ 3.3 Creating complex models +
Creating complex models
+ 3.3.1 Top level +
Simulation
+ 4.1 Steady-state solutions +
+ 4.2 Simulation parameters +
+ 4.3 Simulation input +
+ 4.4 Simulation logic +
+ 4.5 Simulation initial state +
+ 4.6 Simulation code +
+ 4.7 Simulation output +
Steady-state solutions
+ 4.1.1 Steady-state solutions (odess) +
+ 4.1.2 Steady-state solutions (ss) +
Simulation parameters
+ 4.2.1 Euler integration +
+ 4.2.2 Implicit integration +
+ 4.2.3 Runge Kutta IV integration +
+ 4.2.4 Hybrd algebraic solver +
Simulation code
+ 4.6.1 Dynamically linked functions +
Simulation output
+ 4.7.1 Viewing results with gnuplot +
+ 4.7.2 Exporting results to SciGraphica +
Representations
+ 6.1 Representation summary +
+ 6.2 Defining representations +
+ 6.3 Verbal description (desc) +
+ 6.4 Acausal bond graph (abg) +
+ 6.5 Stripped acausal bond graph (sabg) +
+ 6.6 Labels (lbl) +
+ 6.7 Structure (struc) +
+ 6.8 Constitutive relationship (cr) +
+ 6.9 Parameters +
+ 6.10 Causal bond graph (cbg) +
+ 6.11 Elementary system equations (ese) +
+ 6.12 Differential-Algebraic Equations (dae) +
+ 6.13 Constrained-state Equations (cse) +
+ 6.14 Ordinary Differential Equations +
+ 6.15 Descriptor matrices (dm) +
+ 6.16 Report (rep) +
Acausal bond graph (abg)
+ 6.4.1 Language fig (abg.fig) +
+ 6.4.2 Language m (rbg.m) +
+ 6.4.3 Language m (abg.m) +
+ 6.4.4 Language tex (abg.tex) +
Language fig (abg.fig)
+ 6.4.1.1 Icon library +
+ 6.4.1.2 Bonds +
+ 6.4.1.3 Strokes +
+ 6.4.1.4 Components +
+ 6.4.1.5 Simple components +
+ 6.4.1.6 SS components +
+ 6.4.1.7 Simple components - implementation +
+ 6.4.1.8 Compound components +
+ 6.4.1.9 Named SS components +
+ 6.4.1.10 Coerced bond direction +
+ 6.4.1.11 Port labels +
+ 6.4.1.12 Vector port labels +
+ 6.4.1.13 Port label defaults +
+ 6.4.1.14 Vector Components +
+ 6.4.1.15 Artwork +
+ 6.4.1.16 Valid Names +
Simple components
+ 6.4.1.6 SS components +
+ 6.4.1.7 Simple components - implementation +
Compound components
+ 6.4.1.9 Named SS components +
Language m (rbg.m)
+ 6.4.2.1 Transformation abg2rbg_fig2m +
Language m (abg.m)
+ 6.4.3.1 Arrow-orientated causality +
+ 6.4.3.2 Component-orientated causality +
+ 6.4.3.3 Transformation rbg2abg_m +
+ Stripped acausal bond graph (sabg) +
+ 6.5.1 Language fig (sabg.fig) +
+ 6.5.2 Stripped acausal bond graph (view) +
Labels (lbl)
+ 6.6.1 SS component labels +
+ 6.6.2 Other component labels +
+ 6.6.3 Component names +
+ 6.6.4 Component constitutive relationship +
+ 6.6.5 Component arguments +
+ 6.6.6 Parameter declarations +
+ 6.6.7 Units declarations +
+ 6.6.8 Interface Control Definition +
+ 6.6.9 Aliases +
+ 6.6.10 Parameter passing +
+ 6.6.11 Old-style labels (lbl) +
+ 6.6.12 Language tex (desc.tex) +
Other component labels
+ 6.6.3 Component names +
+ 6.6.4 Component constitutive relationship +
+ 6.6.5 Component arguments +
+ 6.6.9 Aliases +
+ 6.6.10 Parameter passing +
+ 6.6.11 Old-style labels (lbl) +
Aliases
+ 6.6.9.1 Port aliases +
+ 6.6.9.2 Parameter aliases +
+ 6.6.9.3 CR aliases +
+ 6.6.9.4 Component aliases +
Old-style labels (lbl)
+ 6.6.11.1 SS component labels (old-style) +
+ 6.6.11.2 Other component labels (old-style) +
+ 6.6.11.3 Parameter passing (old-style) +
+ Parameter passing (old-style) +
+ 6.6.12 Language tex (desc.tex) +
Structure (struc)
+ 6.7.1 Language txt (struc.txt) +
+ 6.7.2 Language tex (struc.tex) +
+ 6.7.3 Language tex (view) +
+ Constitutive relationship (cr) +
+ 6.8.1 Predefined constitutive relationships +
+ 6.8.2 DIY constitutive relationships +
+ 6.8.3 Unresolved constitutive relationships +
+ 6.8.4 Unresolved constitutive relationships - Octave +
+ 6.8.5 Unresolved constitutive relationships - c++ +
+ Predefined constitutive relationships +
+ 6.8.1.1 lin +
+ 6.8.1.2 exotherm +
Parameters
+ 6.9.1 Symbolic parameters (subs.r) +
+ 6.9.2 Symbolic parameters for simplification (simp.r) +
+ 6.9.3 Numeric parameters (numpar) +
+ Numeric parameters (numpar) +
+ 6.9.3.1 Text form (numpar.txt) +
Causal bond graph (cbg)
+ 6.10.1 Language fig (cbg.fig) +
+ 6.10.2 Language m (cbg.m) +
Language m (cbg.m)
+ 6.10.2.1 Transformation abg2cbg_m +
+ Elementary system equations (ese) +
+ 6.11.0.1 Transformation cbg2ese_m2r +
+ Differential-Algebraic Equations (dae) +
+ 6.12.1 Language reduce (dae.r) +
+ 6.12.2 Language m (dae.m) +
Language reduce (dae.r)
+ 6.12.1.1 Transformation ese2dae_r +
Language m (dae.m)
+ 6.12.2.1 Transformation dae_r2m +
+ Constrained-state Equations (cse) +
+ 6.13.1 Language reduce (cse.r) +
+ 6.13.2 Language m (view) +
Language reduce (cse.r)
+ 6.13.1.1 Transformation dae2cse_r +
+ Ordinary Differential Equations +
+ 6.14.1 Language reduce (ode.r) +
+ 6.14.2 Language m (ode.m) +
+ 6.14.3 Language m (view) +
Language reduce (ode.r)
+ 6.14.1.1 Transformation cse2ode_r +
Language m (ode.m)
+ 6.14.2.1 Transformation ode_r2m +
Descriptor matrices (dm)
+ 6.15.1 Language reduce (dm.r) +
+ 6.15.2 Language m (dm.m) +
Report (rep)
+ 6.16.1 Language text (rep.txt) +
+ 6.16.2 Language view +
Extending MTT
+ 7.1 Makefiles +
+ 7.2 New (DIY) representations +
+ 7.3 Component library +
New (DIY) representations
+ 7.2.1 Makefile +
+ 7.2.2 Shell-script +
+ 7.2.3 Documentation +
Documentation
+ 8.1 Manual +
+ 8.2 On-line documentation +
On-line documentation
+ 8.2.1 Brief on-line documentation +
+ 8.2.2 Detailed on-line documentation +
Languages
9.1 Figr
9.2 m
+ 9.3 Reduce +
9.4 c
Language tools
+ 10.1 Views +
+ 10.2 Xfig +
+ 10.3 Text editors +
+ 10.4 Octave +
+ 10.5 LaTeX +
Octave
+ 10.4.1 Octave control system toolbox (OCST) +
+ 10.4.2 Creating GNU Octave .oct files +
+ 10.4.3 Creating Matlab .mex files +
+ 10.4.4 Embedding MTT models in Simulink +
Administration
+ 11.1 Software components +
+ 11.2 REDUCE setup +
+ 11.3 Octave setup +
+ 11.4 Paths +
+ 11.5 File structure +
+ A.1 GNU Free Documentation License +
+ A.2 GNU GENERAL PUBLIC LICENSE +
Octave setup
+ 11.3.1 .octaverc +
+ 11.3.2 .oct file dependencies +
Paths
+ 11.4.1 $MTTPATH +
+ 11.4.2 $MTT_COMPONENTS +
+ 11.4.3 $MTT_CRS +
+ 11.4.4 $MTT_EXAMPLES +
+ 11.4.5 $OCTAVE_PATH +
+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1. Introduction

+ +

+

+

+ MTT is a set of Model Transformation Tools based on bond + graphs. MTT implements the theory to be found in the book + "Metamodelling: Bond Graphs and Dynamic Systems" by Peter Gawthrop and + Lorcan Smith published by Prentice Hall in 1996 (ISBN 0-13-489824-9). +

+

It implements two features not discussed in that book:

+
    +
  • bicausal bond graphs and
  • +
  • hierarchical bond graphs.
  • +
+

+ In the context of software, it has been said that one good tool is worth + many packages. UNIX is a good example of this philosophy: the user can put + together applications from a range of ready made tools. This manual + describes the application of this philosophy to dynamic system modeling + embodied in MTT - a set of Model Transformation Tools + each of which implements a single transformation between system + representations. +

+

System representations have two attributes.

+
    +
  • + A Form: e.g. acausal bond graph, differential algebraic, linear + state-space etc. +
  • +
  • A Language: e.g. Fig, Matlab, LaTeX, Reduce, postscript etc.
  • +
+

+ Transformations in MTT are accomplished using appropriate + software (e.g. Octave/Matlab, Reduce) encapsulated in UNIX Bourne shell + scripts. The relationships between the tools are encoded in a Make File; + thus the user can specify a final representation and all the necessary + intermediate transformations are automatically generated. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 1.1 What is a representation? +
+ 1.2 What is a transformation? +
+ 1.3 What is a bond graph? +
+ 1.4 Variables +
1.5 Bonds
+ 1.6 Components +
+ 1.7 Algebraic loops +
+ 1.8 Switched systems +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.1 What is a representation?

+ +

+

+

Physical systems have many representations. These include

+
    +
  • a schematic diagram,
  • +
  • a block diagram,
  • +
  • a bunch of equations,
  • +
  • a single differential(-algebraic) equation,
  • +
  • simulation code,
  • +
  • linearised state-space (or descriptor) equations,
  • +
  • transfer function (of the linearised system),
  • +
  • frequency response (of the linearised system),
  • +
  • etc...
  • +
+

+ Each of these representations is related to other representations by an + appropriate transformation (see section + 1.2 What is a transformation?. In many cases, + a modeler is presented with a physical system and needs to make a model. + In particular, a model, in this context, is a representation of the system + appropriate to a particular use, for example: +

+
    +
  • simulation,
  • +
  • control system design,
  • +
  • optimisation
  • +
  • etc.
  • +
+

+ Indeed, for a given physical system, the modeler would need to derive a + number of models. This process can be viewed as a series of steps; each + involving a transformation between representations (see section + 1.2 What is a transformation?. +

+

In this context, the following considerations are relevant.

+
    +
  • + There is a unique `core' representation of any system. There are many + routes from this core representation, each leading to an appropriate + model. There are many possible routes to this core representation from + the physical system: the route chosen is a matter of convenience. +
  • +
  • + Because the core representation is unique, it is easy to expand the + tool-box to include additional transformations from the physical system + to the core representation and additional transformations from the core + representation to the mode. +
  • +
  • + Transformation_1 probably cannot, and certainly should not, be + completely automated. Engineering insight, knowledge and experience is + essential to capture the essence (with respect to the particular use) of + the physical system whilst discarding irrelevant form. +
  • +
  • + Representation_1 should be `close' in some sense to the Physical system. +
  • +
  • + The core representation, and hence the representations leading to it, + must contain enough information to generate all of the required models. +
  • +
  • + Representations must be easily extensible: it must be possible to add + extra components or attributes without restructuring the representation. +
  • +
+

+ I happen to believe that Bond graphs (see section + 1.3 What is a bond graph?) provide the most + convenient and powerful basis for the core representation. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.2 What is a transformation?

+ +

+ Each system representation (see section + 1.1 What is a representation? is related to + other representations by an appropriate transformation as follows: +

+
    +
  • Physical system
  • +
  • Transformation_1 ---> Representation_1
  • +
  • Transformation_2 ---> Representation_2
  • +
  • ...
  • +
  • Transformation_N ---> Core representation
  • +
  • Transformation_N+1 ---> Representation_N+1
  • +
  • Transformation_N+2 ---> Representation_N+2
  • +
  • ...
  • +
  • Transformation_N+M ---> Model
  • +
+ Thus modeling is seen as a sequence of transformations between + representations. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.3 What is a bond graph?

+ +

+

+

+ Bond graphs provide a graphical high-level language for describing dynamic + systems in a precise and unambiguous fashion. They make a clear + distinction between structure (how components are connected together), and + behavior (the particular constitutive relationships, or physical laws, + describing each component. +

+

They can describe a range of physical systems including:

+
    +
  • Electrical systems
  • +
  • Mechanical systems
  • +
  • Hydraulic systems
  • +
  • Chemical process systems
  • +
+

+ More importantly, they can describe systems which contain subsystems drawn + from all of these domains in a uniform manner. +

+

+ Bond graphs are made up of components (see section + 1.6 Components) connected by bonds (see + section 1.5 Bonds) which define the + relationship between variables (see section + 1.4 Variables). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.4 Variables

+ + In bond graph terminology there are four sorts of variables: +
    +
  • effort variables
  • +
  • flow variables
  • +
  • integrated effort variables
  • +
  • integrated flow variables
  • +
+

Examples of effort variables are

+
    +
  • voltage
  • +
  • pressure
  • +
  • force
  • +
  • torque
  • +
  • temperature
  • +
+

Examples of flow variables are

+
    +
  • current
  • +
  • volumetric flow rate
  • +
  • velocity
  • +
  • angular velocity
  • +
  • heat flow
  • +
+

Examples of integrated flow variables are

+
    +
  • charge
  • +
  • volume
  • +
  • momentum
  • +
  • angular momentum
  • +
  • heat
  • +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.5 Bonds

+ + Bonds connect components (see section + 1.6 Components) together. Each bond carries two + variables: + + Each bond has three notations associated with it: +
    +
  • a half-arrow,
  • +
  • a causal stroke and
  • +
  • a causal half-stroke.
  • +
+

The half-arrow indicates two things:

+
    +
  • the direction of power (or pseudo power) flow and
  • +
  • the side of the bond associated with the flow variable.
  • +
+

The causal stroke indicates two things:

+
    +
  • the effort variable is imposed at the same end as the stroke and
  • +
  • the flow variable is imposed at the opposite end to the stroke.
  • +
+

The causal half-stoke indicates one thing:

+
    +
  • + if it is on the effort side of the bond, the effort variable is imposed + at the same end as the stroke or +
  • +
  • + if it is on the flow side of the bond, the flow variable is imposed at + the opposite end to the stroke. +
  • +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.6 Components

+ +

+ Components provide the building blocks of a dynamic system when connected + by bonds (see section 6.4.1.2 Bonds). + Components have the following attributes: +

+
+
ports
+
+ provide the connections to other + components (see section 1.6.1 Ports) +
+
+ constitutive relationships +
+
+ define how the port-variables are + related (see section + 1.6.2 Constitutive relationship) +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ 1.6.1 Ports +
+ 1.6.2 Constitutive relationship +
+ 1.6.3 Symbolic parameters +
+ 1.6.4 Numeric parameters +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.6.1 Ports

+ + Components have one or more ports. Each port carries two variables, and + effort and a flow variable (see section + 1.4 Variables). Any pair of ports can be + connected by a bond (see section 1.5 Bonds); + this connection is equivalent to saying that the effort variables at each + port are identical and that the flow variables at each port are identical. +

+ Ports are implemented in MTT using named SS components. + (see section 6.4.1.9 Named SS components). +

+

+ The direction of the named SS components. (see section + 6.4.1.9 Named SS components) is coerced (see + section 6.4.1.10 Coerced bond direction) to + have the same direction as the bons connected to the corresponding port. + Thus the direction of the direction of the named SS components has no + significance unless the component is at the top level. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.6.2 Constitutive relationship

+ +

+ The constitutive relationship of a component defines how the port + variables are related. This relationship may be linear or non-linear. This + typically contains symbolic parameters (see section + 1.6.3 Symbolic parameters) which may be + replaced, for the purposes of numerical analysis by numeric parameters + (see section 1.6.4 Numeric parameters). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.6.3 Symbolic parameters

+ + The constitutive relationship of a system component (see section + 1.6 Components) typically contains symbolic + parameters. For example a resistor may have a symbolic resistance r. It is + convenient to leave such parameters as symbols when viewing equations or + when performing symbolic analysis such as differentiation. +

+ However, MTT allows replacement of symbolic parameters by + numeric parameters (see section + 1.6.4 Numeric parameters) when appropriate. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.6.4 Numeric parameters

+ + Numerical parameters are needed to give specific values to symbolic + parameters (see section + 1.6.3 Symbolic parameters) for the purposes of + numeric analysis; for example: simulation, graph plotting or use within a + numerical package such as Octave (see section + 10.4 Octave). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.7 Algebraic loops

+ + Following Chapter 3 of the book, algebraic loops appear as under-causal + components in the bond graph. It is up to the modeler to indicate how these + loops are to be resolved by adding appropriate SS elements. +

+ In particular if zero junction is undercausal an SS:loop component (with + effort output indicated by a causal stroke) with the following label file + entry: +

+ + + + + +
+
+  loop SS unknown,zero
+
+
+

+ For more information, refer to: "Metamodelling: Bond Graphs and Dynamic + Systems" by Peter Gawthrop and Lorcan Smith published by Prentice Hall in + 1996 (ISBN 0-13-489824-9). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + [ Up ] + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.8 Switched systems

+ +

+ Some systems contain switch-like components. For example an electrical + system may contain on-off switches and diodes and a hydraulic system may + shut-off valves and non-return valves. +

+

+ Such systems are sometimes called hybrid systems. The modelling an + simulation of such systems is the subject of current research. + MTT implements a simple pragmatic approach to the + modelling and simulation of such systems via two new Bond Graph + components: +

+
+
ISW
+
+ a switched I component +
+
CSW
+
+ a switched C component +
+
+

+ These switches are user controlled through the logic representation (see + section 4.4 Simulation logic). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2. User interface

+ + There are two user interfaces to MTT: a command line + interface (see section + 2.2 Command line interface) and a menu-driven + interface (see section + 2.1 Menu-driven interface). + + + + + + + + + + + + + + + + + + + + + +
+ 2.1 Menu-driven interface +
+ 2.2 Command line interface +
+ 2.3 Options +
+ 2.4 Utilities +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.1 Menu-driven interface

+ + The Menu-driven interface for MTT is invoked as: + + + + + +
+
+xmtt
+
+
+ This will bring up a menu which should be self explanatory :-). Various + messages will be echoed in the window from whence xMTT was + invoked. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.2 Command line interface

+ + The command line interface for MTT is of the form: + + + + + +
+
+mtt [options] <system_name> <representation> <language>
+
+
+
+
[options]
+
+ the (optional) option switches (see + section 2.3 Options) +
+
<system_name>
+
+ the name of the system being transformed +
+
+ <representation> +
+
+ the mnemonic for the system + representation (see section + 6.1 Representation summary) +
+
<language>
+
+ the mnemonic for language for the + representation (see section 9. Languages) +
+
+ for example + + + + + +
+
+mtt rc rep view
+
+
+ creates a view of the report describing system rc and + + + + + +
+
+mtt rc sm m
+
+
+ creates an m file (suitlable for Octave or Matlab) containing state matrices + describing the system rc. +
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.3 Options

+ +

+ MTT has a number of optional switches to control its + operation. These are invoked immediately after `mtt' on the command line; + for example: +

+ + + + + +
+
+mtt -o -ss -cc syst cbg view
+
+
+ invokes the -o, -ss, and -cc + options. +

+ If you wish to use an option all the time, use the alias function + appropriate to the shell you are using. For example, using bash: +

+ + + + + +
+
+alias mtt='mtt -o -ss -cc'
+
+
+ Means that the previous example can be executed using + + + + + +
+
+mtt syst cbg view
+
+
+

The available options are:

+
+
-q
+
quiet mode -- suppress MTT banner
+
-A
+
+ solve algebraic equations symbolically +
+
-ae
+
+ <hybrd> solve algebraic equations + numerically (this option requires -cc or -oct) +
+
-D
+
debug -- leave log files etc
+
-I
+
prints more information
+
-abg
+
start at abg.m representation
+
-c
+
c-code generation
+
-cc
+
C++ code generation
+
-d
+
+ <dir> use directory <dir> +
+
-dc
+
+ Maximise derivative (not integral) + causality +
+
-dc
+
+ Maximise derivative (not integral) + causality +
+
-i
+
+ <implicit|euler|rk4> Use implicit, + euler or Runge Kutta IVintegration +
+
-o
+
ode is same as dae
+
-oct
+
+ use oct files in place of m files where + appropriate +
+
-opt
+
optimise code generation
+
-p
+
print environment variables
+
-partition
+
partition hierachical system
+
-r
+
+ reset time stamp on representation +
+
-s
+
+ try to generate sensitivity BG + (experimental) +
+
-ss
+
+ use steady-state info to initialise + simulations +
+
-stdin
+
+ read input data from standard input for + simulations +
+
-sub
+
+ <subsystem> operate on this + subsystem +
+
-t
+
tidy mode (default)
+
-u
+
+ untidy mode (leaves files in current + dir) +
+
-v
+
+ verbose mode (multiple uses increase the + verbosity) +
+
-viewlevel
+
+ <N> View N levels of hierachy +
+
--version
+
print version and exit
+
--versions
+
+ print version of mtt and components and + exit +
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4 Utilities

+ + MTT provides some utilities to help you keep track of model + building and to keep things clean and tidy. The commands, and there purpose + are: +
+
mtt help
+
Lists the help/browser commands
+
+ mtt copy <system> +
+
+ Copies the system (ie directory and + enclosed files) to the current working directory. +
+
+ + mtt rename <old_name> <new_name> +
+
+ Renames all of the defining + representations (see section + 6.2 Defining representations) and textually + changes each file appropriately. +
+
+ mtt <system> clean +
+
+ Remove all files generated by + MTT associated with system `system'. +
+
mtt clean
+
+ Remove all files generated by + MTT associated with all systems within the current + directory. +
+
+ + mtt system representation vc +
+
+ Apply version control to representation + `representation' of system `system'. +
+
mtt system vc
+
+ Apply version control to all + representations (under version control) system `system'. +
+
+ These are described in more detail in the following sections. + + + + + + + + + + + + + + + + + + + + + +
+ 2.4.1 Help +
+ 2.4.2 Copy +
+ 2.4.3 Clean +
+ 2.4.4 Version control +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.1 Help

+ + MTT implements a browser to keep track of all the systems, + subsystems and constitutive relationships that you, and others may write. It + is invoked in the following ways: + + + + + +
+
+       mtt help representations
+       mtt help components
+       mtt help examples
+       mtt help crs
+       mtt help representations <match_string>
+       mtt help components <match_string>
+       mtt help examples  <match_string>
+       mtt help crs <match_string>
+       mtt help <component_or_example_or_CR_name>
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 2.4.1.1 help representations +
+ 2.4.1.2 help components +
+ 2.4.1.3 help examples +
+ 2.4.1.4 help crs +
+ 2.4.1.5 help <name> +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.1.1 help representations

+ +

The command

+ + + + + +
+
+mtt help representations
+
+
+ lists all of the representations (see section + 6. Representations) available in + MTT. These may change as the version number of + MTT increases. +

The command

+ + + + + +
+
+mtt help representations <match_string>
+
+
+ lists those representation which contain the string + match_string. This string can be any regular expression (see + standard Linux documentation under awk). For example + + + + + +
+
+mtt help representations descriptor
+
+
+ gives all representations containing the word descriptor. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.1.2 help components

+ +

The command

+ + + + + +
+
+mtt help components
+
+
+ lists all of the components (see section + 1.6 Components) available in + MTT. These may change as the version number of + MTT increases. +

The command

+ + + + + +
+
+mtt help components <match_string>
+
+
+ lists those component which contain the string match_string. + This string can be any regular expression (see standard Linux documentation + under awk). For example + + + + + +
+
+mtt help components source
+
+
+ gives all components containing the word component. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.1.3 help examples

+ +

+ This command provides a good way to get started in MTT. + having found an interesting example, copy it to your working directory + using +

+ + + + + +
+
+mtt copy <example_name>
+
+
+ (see section 2.4.2 Copy) + + + + + +
+
+mtt help examples
+
+
+ lists all of the examples available in MTT. This list will + change as more examples are added. +

The command

+ + + + + +
+
+mtt help examples <match_string>
+
+
+ lists those component which contain the string match_string. + This string can be any regular expression (see standard Linux documentation + under awk). For example + + + + + +
+
+mtt help examples pharmokinetic
+
+
+ gives all examples containing the word pharmokinetic. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.1.4 help crs

+ +

The command

+ + + + + +
+
+mtt help crs
+
+
+ lists all of the constitutive relationships (see section + 1.6.2 Constitutive relationship) available in + MTT. These may change as the version number of + MTT increases. +

The command

+ + + + + +
+
+mtt help crs <match_string>
+
+
+ lists those constitutive relationships which contain the string + match_string. This string can be any regular expression (see + standard Linux documentation under awk). For example + + + + + +
+
+mtt help crs sin
+
+
+ gives all crs containing the word sin. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.1.5 help <name>

+ +

The command

+ + + + + +
+
+mtt help <name>
+
+
+ gives a detailed description of the entity called name. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.2 Copy

+ +

+ MTT provides a way of copying examples to your working + directory: +

+ + + + + +
+
+mtt copy <example_name>
+
+
+

Use the command

+ + + + + +
+
+mtt help examples
+
+
+ (see section 2.4.1.3 help examples) to find + something of interest. +

+ Note that components and constitutive relationships are automatically + copied when required. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.3 Clean

+ + MTT generates a lot of representations in a number of + languages. Some of these you will edit yourself; others can always be + recreated by MTT. It makes sense, therefore to have a + utility that removes all of these other files when you have finished + actively working with a particular system. These are two versions: +
    +
  1. mtt system clean
  2. +
  3. mtt clean
  4. +
+ The first removes all files that can be regenerated with + MTT associated with system `system'; the second removes all + such files associated with all systems in the current working directory. +

+ The files which remain after such a clean are the Defining representations + (see section 6.2 Defining representations). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

2.4.4 Version control

+ +

+ When you are working on a modeling project, it is easy to forget what + changes you made to a system and why you made them. Sometimes, you may + regret some changes and wish to revert to an earlier version: even if you + use .old files this may be difficult to achieve safely. +

+

+ These are very similar problems to those faced by software developers and + can be solved in the same way: using version control.MTT + provides version control using the standard GNU Revision Control System + (RCS). This is hidden from the user, but is fully complementary to direct + use of RCS (e.g. via emacs vc commands) to the more experienced user who + wishes to do so. +

+

+ The only files that you should ever change (i.e. the ones never + overwritten by MTT) are the Defining representations (see + section 6.2 Defining representations). +

+

+ All of the files, with the exception of system_abg.fig, are + initially created by MTT and contain the RCS header for + version control. +

+

+ The MTT version control will automatically expand this + part of the text to include all change comments that you give it -- so + will direct use of RCS (e.g. via emacs vc commands) +

+

The MTT version commands are as follows:

+
+
+ + mtt system representation vc +
+
+ Apply version control to representation + `representation' of system `system'. +
+
mtt system vc
+
+ Apply version control to all + representations (under version control) system `system'. +
+
+

+ The first is appropriate after you have made a revision to a single file. + It will prompt you for a change comment; this will be automatically + included in the file header. In addition, enough information will be saved + to enable any version to be retrieved via RCS. +

+

+ The second is appropriate to record the state of the entire model. This + assumes that all relevant files have been recorded by the first version of + the command. Once again, old versions of the entire model can be retrieved + using the relevant RCS commands. +

+

+ A subdirectory `RCS' is created to hold this information. You need not + bother about the contents, except that you must not delete any files + within `RCS'. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

3. Creating Models

+ +

+ MTT helps you to analyse and transform system models -- + ultimately the process of capturing the real world in a model is up to + you. This chapter discusses the MTT aspects of creating a + model. For convenience, this is divided into creating simple models and + creating complex models. +

+ + + + + + + + + + + + + + + + +
+ 3.1 Quick start +
+ 3.2 Creating simple models +
+ 3.3 Creating complex models +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

3.1 Quick start

+ +

+ It is probably worth a quick skim though MTT to get a + flavour of what it can do before plunging into the detail of the rest of + this document. Here is a series of commands to do this. +

+

Copy an initial set of files describing the bond graph.

+ + + + + +
+
+mtt copy rc
+
+
+ Move to it. + + + + + +
+
+cd rc
+
+
+ View the acausal bond graph (the system is called "rc"). + + + + + +
+
+mtt rc abg view
+
+
+ View the causal bond graph of the system. + + + + + +
+
+mtt rc cbg view
+
+
+ View the corresponding ordinary differential equations (ode). + + + + + +
+
+mtt rc ode view
+
+
+ View the system (output) step response + + + + + +
+
+mtt rc sro view
+
+
+

An alternative (but more general) way of achieving the same result is

+ + + + + +
+
+mtt -c rc odeso view
+
+
+

View the system transfer function

+ + + + + +
+
+mtt rc tf view
+
+
+ View the log modulus frequency response of the system. + + + + + +
+
+mtt rc lmfr view
+
+
+

+ View the log modulus frequency response of the system for 100 + logarithmically spaced frequencies in the range 0.1 to 10 radians per + second. +

+ + + + + +
+
+mtt rc lmfr view 'W=logspace(-1,1,100);'
+
+
+

+ MTT has a report generation ((see section + 6.16 Report (rep)) facility which can + generate a hypertext description of the system. +

+ + + + + +
+
+mtt rc rep hview
+
+
+

+ The report contents are specified by the rep representation (see section + 6.16 Report (rep)), in this case the + corresponding file is: +

+ + + + + +
+
+% %% Outline report file for system rc (rc_rep.txt)
+
+mtt rc abg tex
+mtt rc struc tex
+mtt rc cbg ps
+mtt rc ode tex
+mtt rc ode dvi
+mtt rc sm tex
+mtt rc tf tex
+mtt rc tf dvi
+mtt rc sro ps
+mtt rc lmfr ps
+mtt rc odes h
+mtt rc numpar txt
+mtt rc input txt
+mtt -c rc odeso ps
+mtt rc rep txt
+
+
+ A non-hypertext version can be viewed using: + + + + + +
+
+mtt rc rep view
+
+
+

Now have a go at modifying the bond graph.

+ + + + + +
+
+mtt rc abg fig
+
+
+ This brings up the bond graph in Xfig (see section + 10.2 Xfig). Try creating a system with two rs + and 2 cs. +

More examples can be found using

+ + + + + +
+
+mtt help examples
+
+
+ Details of an example can be found using + + + + + +
+
+mtt help <example_name>
+
+
+ and copied using + + + + + +
+
+mtt copy <example_name>
+
+
+

Lots of examples are available.

+ + + + + +
+
+mtt help examples
+
+
+ lists them and + + + + + +
+
+mtt copy <name>
+
+
+ gets you an example. +

+ A number of examples are to be found <A + HREF="http://www.mech.gla.ac.uk/~peterg/software/MTT/examples/Examples/Examples.html"> + here</A>. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

3.2 Creating simple models

+ +

+ For then purposes of this section, simple models are those which are built + up from bond graphs involving predefined components. In contrast, more + complex systems (see section + 3.3 Creating complex models) need to be built + up hierarchically. +

+

The recommended sequence of steps to create a simple model is:

+
    +
  1. + Decide on a name for the system; let us call it `syst' for the purposes + of this discussion. +
  2. +
  3. + Invoke the Bond Graph editor to draw the acausal Bond Graph. + + + + + +
    +
    +  mtt syst abg fig
    +
    +
    +
  4. +
  5. + Draw the Bond Graph (see section + 6.4.1 Language fig (abg.fig)), including + the bonds (see section 1.5 Bonds), the + components (see section 1.6 Components) and + any artwork (see section 6.4.1.15 Artwork) + to make the Bond Graph more readable. The graphical editor xfig is (see + section 10.2 Xfig) is self-explanatory. + The icon library is helpful here (see see section + 6.4.1.1 Icon library). +
  6. +
  7. + Add causal strokes (see section + 6.4.1.3 Strokes) where needed to define + causality. As a general rule, use the minimum number of strokes needed + to define the problem; this will often be only on the + SS components. (see section + 6.4.1.6 SS components). Save the bond + graph. +
  8. +
  9. + View the corresponding causal bond graph. + + + + + +
    +
    +  mtt syst cbg view
    +
    +
    +
      +
    1. + At this stage, MTT will warn you that the labeled + components do not appear in the label file - this can safely be + ignored. +
    2. +
    3. + MTT will indicate the percentage of components + which are causally complete -- ideally this will be 100\%. + Components which are not causally complete will be listed. +
    4. +
    5. + A view of the causal bond graph will be created. The added causal + strokes are indicated in blue, undercausal components in green and + overcausal components in red. +
    6. +
    7. + If the bond graph is causally complete, proceed to the next step, + otherwise think hard and return to the first step. +
    8. +
    +
  10. +
  11. + At this stage, no constitutive relationships have been defined. + Nevertheless, MTT will proceed in a semi-qualitative + fashion by assuming that all constitutive relationships are unity (and + therefore linear). It may be useful at this stage to view various + derived representations to check the overall model properties before + proceeding further. For example: +
      +
    1. + View the system Differential-algebraic equations + + + + + +
      +
      +mtt syst dae view
      +
      +
      +
    2. +
    3. + View the system state matrices + + + + + +
      +
      +mtt syst sm view
      +
      +
      +
    4. +
    5. + View the system transfer function + + + + + +
      +
      +mtt syst tf view
      +
      +
      +
    6. +
    7. + View the system step response + + + + + +
      +
      +mtt syst sro view
      +
      +
      +
    8. +
    +
  12. +
  13. + As well as creating the causal bond graph, MTT has also + generated templates for other text files (see section + 6.2 Defining representations) used to + further specify the system. These can now be edited using your favorite + text editor (see section + 10.3 Text editors). +
  14. +
  15. + MTT will now generate the representations (see section + 6.1 Representation summary)that you desire. + For example the system can be simulated by + + + + + +
    +
    +mtt syst odeso view
    +
    +
    + MTT will complain if a component is named in the bond + graph but not in the label file and vice versa. This mainly to catch + typing errors. +
  16. +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

3.3 Creating complex models

+ +

+ Complex models -- in distinction to simple models (see section + 3.2 Creating simple models) -- have a + hierarchical structure. In particular, bond graph components can be + created by specifying their bond graph. Typically, such components will + have more than one port (see section + 1.6.1 Ports); within each component, ports are + represented by named SS components (see section + 6.4.1.9 Named SS components); outwith each + component, ports are unambiguously identified by labels (see section + 6.4.1.11 Port labels) and vector labels (see + section 6.4.1.12 Vector port labels). +

+

+ Complex models are thus created by conceptually decomposing the system + into simple subsystems, and then creating the corresponding bond graphs. + The procedure for simple systems (see section + 3.2 Creating simple models) is then followed + using the top level system (see section + 3.3.1 Top level); MTT then + recursively operates on the lower level systems. +

+

+ The report representation (see section + 6.16 Report (rep)) provides a convenient way + of viewing a complex system. +

+

An example of such a system can be created as follows:

+ + + + + +
+
+mtt copy twolink
+mtt twolink rep hview
+
+
+

+ The result is <A + HREF="./examples/twolink/twolink_rep/twolink_rep.html"> here</A>. +

+ + + + + + +
+ 3.3.1 Top level +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

3.3.1 Top level

+ + The top level of a complex model contains subsystems but is not, itself, + contained by other systems. It has the following special features: + +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4. Simulation

+ + One purpose of modelling is to simulate the modeled dynamic system. Although + this is just another transformation (see section + 1.2 What is a transformation?) and therefore is + covered in the appropriate chapter (see section + 6. Representations), it is important enough to + be given its own chapter. +

+ Simulation is typically performed using an appropriate simulation language + (which is often inappropriately conflated with modelling tools). + MTT provides a number of alternative routes to simulation + based on the following representations (see section + 6. Representations): +

+
+
cse
+
+ constrained-state differential equation + form +
+
ode
+
+ ordinary differential (or state-space) + equations +
+
+ in each case these equations may be linear or nonlinear. +

+ Special cases of numerical simulation, appropriate to + linear systems, are: +

+
+
ir
+
impulse response - state
+
iro
+
impulse response - output
+
sr
+
impulse response - state
+
sro
+
impulse response - output
+
+

+ There are a number of languages (see section + 9. Languages) which can be used to describe + these representations for the purposes of numerical simulation: +

+
+
m
+
+ octave a high-level + interactive language for numerical computation. +
+
c
+
gcc a c compiler.
+
cc
+
+ g++ a C++ front-end to + gcc. +
+
+

There are a number solution algorithms available:

+
    +
  • explicit solution via the matrix exponential
  • +
  • backward Euler integration (explicit)
  • +
  • forward Euler integration (implicit)
  • +
  • Runge Kutta IV integration (explicit, fixed step)
  • +
  • Hybrd algebraic solver (MINPACK, Octave fsolve)
  • +
+

+ However, all combinations of representation, language and solution method + are not supported by MTT at the moment. Given a system + `system', some recommended commands are: +

+
+
+ mtt system iro view +
+
+ creates the impulse response of a + linear system via the system_sm.m representation using explicit + solution via the matrix exponential. +
+
+ mtt system sro view +
+
+ creates the step response of a + linear system via the system_sm.m representation using explicit + solution via the matrix exponential. +
+
+ mtt -c system odeso view +
+
+ creates the response of a + nonlinear system via the system_ode.c representation using + implicit integration. +
+
+ + mtt -c -i euler system odeso view +
+
+ creates the response of a + nonlinear system via the system_ode.c representation using + euler integration. +
+
+

+ Simulation parameters are described in the system_simpar.txt file (see + section 4.2 Simulation parameters). +

+

+ The steady-state solution of a system can also be "simulated"(see section + 4.1 Steady-state solutions). +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 4.1 Steady-state solutions +
+ 4.2 Simulation parameters +
+ 4.3 Simulation input +
+ 4.4 Simulation logic +
+ 4.5 Simulation initial state +
+ 4.6 Simulation code +
+ 4.7 Simulation output +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.1 Steady-state solutions

+ + + + + + + + + + + + +
+ 4.1.1 Steady-state solutions (odess) +
+ 4.1.2 Steady-state solutions (ss) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.1.1 Steady-state solutions (odess)

+ +

+ MTT can compute the steady-state solutions of an ordinary + differential equation; this used the octave function `fsolve'. The + solution is computed as a function of time using the input specified in + the input file. The simulation parameter file (see section + 4.2 Simulation parameters) is used to provide + the time scales. +

+

For example

+ + + + + +
+
+mtt copy rc
+cd rc
+mtt rc odess view
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.1.2 Steady-state solutions (ss)

+ + A rudimentary form of steady-state solution exists in mtt. The steady states + and inouts are supplied by the user in the file system_simpar.r and the + corresponding output and sate derivative computed by + MTT using + + + + + +
+
+mtt system ss view
+
+
+

For example

+ + + + + +
+
+mtt copy rc
+cd rc
+mtt rc sspar view
+mtt rc ss view
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.2 Simulation parameters

+ +

+ Simulation parameters are set in the system_simpar.txt file. At the moment + this sets the following variables: +

+
    +
  • LAST the last simulation time
  • +
  • DT the incremental time (for plotting)
  • +
  • + STEPFACTOR the number of integration steps per DT -- thus the + integration interval is DT/STEPFACTOR +
  • +
  • WMIN Minimum frequency = 10^WMIN
  • +
  • WMAX Maximum frequency = 10^WMAX
  • +
  • WSTEPS Number of Frequency steps.
  • +
  • INPUT The input index for frequency response
  • +
+

There are a number of solution algorithms

+
    +
  • + Euler basic Euler integration (see section + 4.2.1 Euler integration). This method is + simple, but not recommended for stiff systems. +
  • +
  • + Implicit semi-implicit integration (see section + 4.2.2 Implicit integration) - uses the smx + representation to give stability. +
  • +
  • + Runge Kutta IV fixed step Runge Kutta fourth order integration (see + section 4.2.3 Runge Kutta IV integration). +
  • +
  • Hybrd numerical algebraic equation solver
  • +
+ + + + + + + + + + + + + + + + + + + + + +
+ 4.2.1 Euler integration +
+ 4.2.2 Implicit integration +
+ 4.2.3 Runge Kutta IV integration +
+ 4.2.4 Hybrd algebraic solver +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.2.1 Euler integration

+ + Euler integration approximates the solution of the Ordinary Differential + Equation + + + + + +
+
+dx/dt = f(x,u)
+
+
+ by + + + + + +
+
+x := x + f(x,u)*DDT
+
+
+ where + + + + + +
+
+DDT = DT/STEPFACTOR
+
+
+ If the system is linear, stability is ensured if the integer STEPFACTOR is + chosen to be greater than the real number + + + + + +
+
+(maximum eigenvalue of -A)*DT/2
+
+
+ where A is the nxn matrix appearing in + + + + + +
+
+f(x,u) = Ax + Bu
+
+
+ If the system is non linear, the linearised system matrix A should act as a + guide to the choice of STEPFACTOR. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.2.2 Implicit integration

+ + Implicit integration approximates the solution of the Ordinary Differential + Equation + + + + + +
+
+dx/dt = f(x,u)
+
+
+ by + + + + + +
+
+(I-A*DT)x := (I-A*DT)x + f(x,u)DT
+
+
+ where A is the linearised system matrix. This implies the solution of N + (=number of states) linear equations at each sample interval. The OCTAVE + version used the `\' operator to solve the set of linear equations, the C + version uses LU decomposition. +

+ If the system is linear, stability is ensured unconditionaly. If the + system is non-linear, then the method still works well. +

+

+ This method is nice in that choice of DT trades of accuracy against + computation time without compromising stability. In addition, the correct + stready-state values are achieved. +

+

+ This approach can also be used for constrained state equations of the + form: +

+ + + + + +
+
+E(x) dx/dt = f(x,u)
+
+
+ where E(x) is a state-dependent matrix. The approximate solution is then + given by: + + + + + +
+
+(E(x)-A*DT)x := (E(x)-A*DT)x + f(x,u)DT
+
+
+ which reduces to the ordinary differential equation case when E(x)=I. +

The _smx representation includes the E matrix.

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.2.3 Runge Kutta IV integration

+ + Runge Kutta IV approximates the solution of the Ordinary Differential + Equation + + + + + +
+
+dx/dt = f(x,t)
+
+
+

by

+ + + + + +
+
+x := x + (DT/6)*(k1 + 2*k2 + 2*k3 + k4)
+
+
+

where

+ + + + + +
+
+k1 := f(x,t)
+k2 := f(x+(1/2)*k1,t+(1/2)*DT)
+k3 := f(x+(1/2)*k2,t+(1/2)*DT)
+k4 := f(x+k3,t+DT)
+
+
+

+ The MTT implementation of Runge-Kutta integration is a + fourth order, fixed-step, explicit integration method. +

+

+ For some systems of equations, the increased accuracy of using a fourth + order method can allow larger step-lengths to be used than would allowed + by the lower order Euler integration method. +

+

+ It should be noted that during the interemediate calculations (k1...k4), + the input vector u is not advanced w.r.t. time; the system + inputs are assumed to be constant over the period of the integration + step-length. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.2.4 Hybrd algebraic solver

+ +

+ The hybrd algebraic solver of + MINPACK, which is used + by Octave in the fsolve routine, may be used in conjunction + with one of the other integration methods to solve semi-explicit, index 1, + differential algebraic equations; these may be generated in + MTT models by use of unknown SS Components + see section 6.6.1 SS component labels. +

+

+ This method requires that compiled simulation code is used; either -cc or + -oct. To perform a simulation based on a model sys, +

+ + + + + +
+
+mtt -cc -ae hybrd -i euler sys odeso view
+
+
+

+ MTT will attempt to minimise the residual error at each + integration time-step using the hybrd routine. +

+

+ This method of simulation is particularly well suited to stiff systems + where very fast dynamics are of little interest. Care must be taken to + ensure that an acceptable level of convergence is achieved by the solver + for the system under investigation. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.3 Simulation input

+ + This is defined in the system_input.txt file. A default file is created + automatically by MTT. This is done explicitly by + + + + + +
+
+mtt system input txt
+
+
+ If the file already exists, the same command checks that all inputs are + defined and that all defined inputs exist in the system and promts the user + to correct discrepancies. +

+ Inputs are defined by the full system name appearing in the structure file + (see section 6.7 Structure (struc)). They + can depend on states (again defined by name), time (defined by t) and + parameters +

+

For example:

+ + + + + +
+
+system_pump_l_1_u      = 4e5*atm;
+system_pump_r_1_u       = 4e5*(t<10)*atm;
+system_ss_i             = 0*kg;
+system_ss_o             = 3e-3*kg;
+system_v_1_u            = (t>10);
+system_v_ll_1_u         = 1;
+system_v_lr_1_u         = (t<10);
+system_v_ul_1_u         = 0;
+system_v_ur_1_u         = (t>10);
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.4 Simulation logic

+ + This is defined in the system_logic.txt file. A default file is created + automatically by MTT. This is done explicitly by + + + + + +
+
+mtt system logic txt
+
+
+ If the file already exists, the same command checks that the logic + corresponding to all switch states (see section + 1.8 Switched systems) are defined and that all + defined logic exists in the system and promts the user to correct + discrepancies. +

+ Logical inputs are defined by the full system name corresponding to + MTT_switch components appearing in the structure file (see section + 6.7 Structure (struc)) + with `_logic' appended. They can depend on states (again defined + by name), time (defined by t) and parameters +

+

For example:

+ + + + + +
+
+bounce_ground_1_mtt_switch_logic       = bounce_intf_1_mtt3<0;
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.5 Simulation initial state

+ + This is defined in the system_state.txt file. A default file is created + automatically by MTT. This is done explicitly by + + + + + +
+
+mtt system state txt
+
+
+ If the file already exists, the same command checks that all states are + defined and that all defined states exist in the system and prompts the user + to correct discrepancies. +

+ States are defined by the full system name appearing in the structure file + (see section 6.7 Structure (struc)). They + can depend on parameters. For example +

+ + + + + +
+
+system_c_l     = (1e4/k_l)/kg;
+system_c_ll     = (1e4/k_s)/kg;
+system_c_lr     = (1e4/k_s)/kg;
+system_c_u      = (1e4/k_l)/kg;
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.6 Simulation code

+ + simulation code can be generated by MTT in the form of the + ode2odes transformation. This can be produced in a number of + languages, including .m, .oct, C and C++ see section + 9. Languages. +

To generate simulation code in C:

+ + + + + +
+
+mtt -c [options] sys ode2odes c
+
+
+

Similarly, to generate C++ code:

+ + + + + +
+
+mtt -cc [options] sys ode2odes cc
+
+
+

To generate an executable based on the C++ representation:

+ + + + + +
+
+mtt -cc [options] sys ode2odes exe
+
+
+ + + + + + +
+ 4.6.1 Dynamically linked functions +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.6.1 Dynamically linked functions

+ +

+ Some model representations can be compiled into dynamically loaded code + (shared objects) which are compiled prior to use in other modelling and + simulation environments; in particular, .oct files can be generated for + use in GNU Octave (see section + 10.4.2 Creating GNU Octave .oct files) and + .mex files can be generated for use in Matlab (see section + 10.4.3 Creating Matlab .mex files) or + Simulink (see section + 10.4.4 Embedding MTT models in Simulink). + The use of compiled (and possibly compiler-optimised) code can offer + significant processing speed advantages over equivalent interpreted + functions (e.g. .m files) for computationally intensive procedures. +

+

+ The C++ code generated by MTT allows the same code to be + generated as standalone code, Octave .oct files or Matlab .mexglx files. + Although MTT usually takes care of the compilation + options, if it is necessary to compile the code on a machine on which + MTT is not installed, the appropriate flag should be + passed to the compiler pre-processor: +

+
    +
  • -DCODEGENTARGET=STANDALONE
  • +
  • -DCODEGENTARGET=OCTAVEDLD
  • +
  • -DCODEGENTARGET=MATLABMEX
  • +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.7 Simulation output

+ + The view (see section 10.1 Views) + representation provides a graphical representation of the results of a + simulation; the postscript language provides the same thing in a form that + can be included in a document. +

These are two simulation output representations

+
+
odes
+
+ ordinary differential equation + solution (states) +
+
odeso
+
+ ordinary differential equation + solution (output) +
+
+

+ Particular output variables can be selected by adding a fourth argument in + one of 2 forms +

+
+
+ 'name1;name2;..;namen' +
+
+ plot the variables with names na1 .. + namen against time +
+
'name1:name2'
+
+ plot the variable with name2 against + that with name 1 +
+
+

An example of plotting a single variable against time is:

+ + + + + +
+
+mtt -o -c -ss OttoCycle odeso ps 'OttoCycle_cycle_V'
+
+
+ An example of plotting one variable against another is: + + + + + +
+
+mtt -o -c -ss OttoCycle odeso ps 'OttoCycle_cycle_V:OttoCycle_cycle_P'
+
+
+ + + + + + + + + + + +
+ 4.7.1 Viewing results with gnuplot +
+ 4.7.2 Exporting results to SciGraphica +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.7.1 Viewing results with gnuplot

+ +

+ Simulation plots may be conveniently selected, viewed with + gnuplot and saved to file (in + PostScript format) using the command +

+ + + + + +
+
+mtt [options] rc gnuplot view
+
+
+

+ This will cause a menu to be displayed, from which states and outputs may + be selected for viewing. Clicking on a parameter name will, by + default, cause the time history of the selected parameter to be displayed. +

+

+ As with xMTT (see section + 2.1 Menu-driven interface), the Wish Tcl/Tk + interpreter must be installed to make use of this feature. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

4.7.2 Exporting results to SciGraphica

+ +

+ Simulation results can be converted into an XML-format + SciGraphica (version + 0.61) .sg file with the command +

+ + + + + +
+
+mtt [options] sys odes sg
+
+
+

+ The SciGraphica file will contain two worksheets, X_sys and Y_sys, + containing the state and output time-histories from the simulation. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

5. Sensitivity models

+ +

+ The sensitivity model of a system is a set of equations giving the + sensitivity of the system outputs with respect to system parameters. + MTT has built in methods for assisting with the + development of such models. +

+

+ This feature is experimental at the moment, but the following example + gives an idea of what can be achieved. +

+ + + + + +
+
+mtt copy rc
+cd rc
+mtt -s src ode view
+mtt -s src odeso view
+
+
+ The sensitivity system src is automatically created from the system rc using + the predefined sR and sC components together with vector junctions (see + section 6.4.1.14 Vector Components). The four + outputs are the two system outputs plus the two sensitivity functions. +

+ An alternative route is to create the sensitivity functions by symbolic + differentiation. The following sensitivity representations are available: +

+
+
scse
+
+ sensitivity constrained-state + equations +
+
sm
+
sensitivity state matrices
+
scsm
+
+ sensitivity constrained-state matrices +
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6. Representations

+ +

+ As discussed in 1.1 What is a representation?, + a system has many representations. The purpose of MTT is + to provide an easy way to generate such representation by applying the + appropriate sequence of transformations. The representations supported by + MTT are summarised in + 6.1 Representation summary. +

+

+ There is a two-fold division of representations into those with which the + user defines the system and its various attributes, and those which are + derived from these. The defining representations are listed in + 6.2 Defining representations. +

+

+ Each representation is implemented in one or more languages depending on + its use. These languages are discussed in + 9. Languages and are associated with + appropriate tools for modifying or viewing the representations. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 6.1 Representation summary +
+ 6.2 Defining representations +
+ 6.3 Verbal description (desc) +
+ 6.4 Acausal bond graph (abg) +
+ 6.5 Stripped acausal bond graph (sabg) +
+ 6.6 Labels (lbl) +
+ 6.7 Structure (struc) +
+ 6.8 Constitutive relationship (cr) +
+ 6.9 Parameters +
+ 6.10 Causal bond graph (cbg) +
+ 6.11 Elementary system equations (ese) +
+ 6.12 Differential-Algebraic Equations (dae) +
+ 6.13 Constrained-state Equations (cse) +
+ 6.14 Ordinary Differential Equations +
+ 6.15 Descriptor matrices (dm) +
+ 6.16 Report (rep) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.1 Representation summary

+ +

+ Some of the the representations available in MTT are (in + alphabetical order): +

+
+
abg
+
acausal bond graph
+
cbg
+
causal bond graph
+
cr
+
+ constitutive relationship for each + subsystem +
+
cse
+
constrained-state equations
+
csm
+
constrained-state matrices
+
dae
+
+ differential-algebraic equations +
+
daes
+
dae solution - state
+
daeso
+
dae solution - output
+
def
+
+ definitions - system orders etc. +
+
desc
+
Verbal description of system
+
dm
+
descriptor matrices
+
ese
+
elementary system equations
+
fr
+
frequency response
+
input
+
numerical input declaration
+
ir
+
impulse response - state
+
iro
+
impulse response - output
+
lbl
+
label file
+
lmfr
+
+ loglog modulus frequency response +
+
lpfr
+
+ semilog phase frequency response +
+
nifr
+
+ Nichols style frequency response +
+
numpar
+
numerical parameter declaration
+
nyfr
+
+ Nyquist style frequency response +
+
obs
+
observer equations for CGPC
+
ode
+
ordinary differential equations
+
odes
+
ode solution - state
+
odes
+
ODE simulation header file
+
odeso
+
ode solution - output
+
odess
+
+ ode numerical steady-states - states +
+
odesso
+
+ ode numerical steady-states - outputs +
+
rbg
+
raw bond graph
+
rep
+
report
+
rfe
+
robot-form equations
+
sabg
+
stripped acausal bond graph
+
simp
+
simplification information
+
sm
+
state matrices
+
smx
+
+ state matrices containing explicit + states and inputs +
+
sms
+
ode
+
smss
+
SM simulation header file
+
sr
+
step response - state
+
sro
+
step response - output
+
ss
+
steady-state equations
+
sspar
+
steady-state definition
+
struc
+
+ structure - list of inputs, outputs + and states +
+
sub
+
Executable subsystem list
+
sub
+
LaTeX subsystem list
+
sympar
+
symbolic parameters
+
tf
+
transfer function
+
+ A complete list can be found via the + help representations command (see section + 2.4.1.1 help representations). +

+ Many of these representations have more than one language (see section + 6. Representations) associated with them. +

+

+ Some of these representations define the system (see section + 6.2 Defining representations). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.2 Defining representations

+ +

+ The following representations define the system and therefore must, + ultimately, be defined by the user. However, all of these are assigned + default values by MTT and may then be subsequently edited + (see section 10.3 Text editors) viewed or + operated on by the appropriate tools (see section + 10. Language tools). +

+
+
system_abg.fig
+
+ the acausal bond graph (see section + 6.4 Acausal bond graph (abg)) +
+
system_lbl.txt
+
+ the label file (see section + 6.6 Labels (lbl)) +
+
system_desc.tex
+
+ the description file (see section + 8.2.2 Detailed on-line documentation) +
+
system_simp.r
+
+ algebraic simplifications to make + output more readable (see section + 6.9.2 Symbolic parameters for simplification (simp.r)) +
+
system_subs.r
+
+ algebraic substitutions to resolve, eq + trig. identities (see section + 6.9.1 Symbolic parameters (subs.r)) +
+
system_simpar.txt
+
+ simulation parameters (see section + 4.2 Simulation parameters) +
+
system_numpar.txt
+
+ numerical parameters (see section + 6.9.3 Numeric parameters (numpar)) +
+
system_input.txt
+
+ the system input for simulations (see + section 4.3 Simulation input) +
+
system_logic.txt
+
+ the switching logic for simulations + (see section 4.4 Simulation logic) +
+
system_sspar.r
+
+ defines the system steady-state (see + section 4.1.2 Steady-state solutions (ss)) +
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.3 Verbal description (desc)

+ +

+ Systems can be documented in LaTeX using the _desc.tex file. This file is + included in the report (see section + 6.16 Report (rep)) if the abg tex option is + included in the rep.txt file. As usual, MTT provides a + default text file to be edited by the user (see section + 10.3 Text editors). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4 Acausal bond graph (abg)

+ +

+ The acausal bond graph is the main input to MTT. It is up + to you, as a system modeler, to distill the essential aspects of the + system that you wish to model and capture this information in the form of + a bond graph. +

+

+ The inexperienced modeler may wish to look in one of the standard + textbooks and copy some bond graphs of systems to get going. +

+

+ To create the acausal bond graph of system `sys' in language fig type: +

+ + + + + +
+
+mtt sys abg fig
+
+
+ To create the acausal bond graph of system `sys' in language m type: + + + + + +
+
+mtt sys abg m
+
+
+ To view the acausal bond graph of system `sys' type: + + + + + +
+
+mtt sys abg view
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+ 6.4.1 Language fig (abg.fig) +
+ 6.4.2 Language m (rbg.m) +
+ 6.4.3 Language m (abg.m) +
+ 6.4.4 Language tex (abg.tex) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1 Language fig (abg.fig)

+ +

A bond graph is made up of:

+
+
bonds
+
To connect components together.
+
strokes
+
To indicate causality.
+
components
+
Either simple or compound.
+
artwork
+
+ Irrelevant to the system but useful to + the user. +
+
+

+ An icon library of bonds, components and other symbols is available within + xfig (see section 6.4.1.1 Icon library). +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 6.4.1.1 Icon library +
+ 6.4.1.2 Bonds +
+ 6.4.1.3 Strokes +
+ 6.4.1.4 Components +
+ 6.4.1.5 Simple components +
+ 6.4.1.6 SS components +
+ 6.4.1.7 Simple components - implementation +
+ 6.4.1.8 Compound components +
+ 6.4.1.9 Named SS components +
+ 6.4.1.10 Coerced bond direction +
+ 6.4.1.11 Port labels +
+ 6.4.1.12 Vector port labels +
+ 6.4.1.13 Port label defaults +
+ 6.4.1.14 Vector Components +
+ 6.4.1.15 Artwork +
+ 6.4.1.16 Valid Names +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.1 Icon library

+ + A number of predefined iconic symbols are available within xfig. + + + + + +
+
+Click onto the library icon
+Click onto the library pull-down menu and select BondGraph
+Select iconic symbols from the presented list
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.2 Bonds

+ +

+ Bonds are represented by polylines with two segments. They must be the + default style (i.e. plain not dashed or dotted). The shortest segment is + taken to be the half-arrow. its positioning is significant because: +

+
    +
  • + It points in the direction of power flow; thus a bond normally points + towards C, I and R components. +
  • +
  • + the corresponding side of the bond indicates flow causality; the other + side represents effort causality. This is significant when using casual + half-strokes (see section 6.4.1.3 Strokes). + Please adopt the convention of having the half-arrows below horizontal + bonds and to the right of vertical bonds. +
  • +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.3 Strokes

+ +

+ Causal strokes are represented by single-segment polylines. There are two + sorts of strokes: +

+
    +
  • + Full strokes: these are the usual bond-graph strokes and + determine both the effort and flow causality in the usual way. The + centre of the stroke should be at about one end of the bond and + be at right angles to it. +
  • +
  • + Half strokes: these are an innovation in + MTT and allow you to specify the effort and flow + causality independently. The end of the stroke should be at + about one end of the bond and be at right angles to it. If the causal + half-stroke is on the same side as the half-arrow (see section + 6.4.1.2 Bonds) then it determines + flow causality; if, on the other hand, it is on the + opposite side to the half-arrow (see section + 6.4.1.2 Bonds) then it determines + effort causality. Two half strokes on the same, but on + opposite sides of the bond are equivalent to a a full stroke at + the same end of the bond. +
  • +
+

+ MTT is reasonably forgiving; but a neat diagram will be + less ambiguous to you as well as to MTT. +

+

Causality is indicated as follows:

+
    +
  • + Effort is imposed at the same end as the stroke. +
  • +
  • + Flow is imposed at the opposite end as the stroke. +
  • +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.4 Components

+ +

+ Components are represented by a text string in fig. The recommended style + is: 20pt, Times-Roman and centre justified. +

+

The component text string can be of the following forms:

+
+
type
+
+ Just the type of the component is + indicated. Components may be either Simple components (see section + 6.4.1.5 Simple components) or Compound + components (see section + 6.4.1.8 Compound components). For example: + + + + + +
+
+R
+
+
+
+
type:label
+
+ Both the type and the label of the + component are given. The type must be a valid name (see section + 6.4.1.16 Valid Names.The name provides a + link to more information to be found in See section + 6.6 Labels (lbl). For example: + + + + + +
+
+R:r
+
+
+
+
type:label:cr
+
+ Not only are the type and the label of + the component given, but also the component cr argument. The type must + be a valid name (see section + 6.4.1.16 Valid Names.The name provides a + link to more information to be found in See section + 6.6 Labels (lbl). For example: + + + + + +
+
+R:r:flow,r
+
+
+
+
+ type:label:expression +
+
+ Expression is a mathematical + expression relating the effort (called mtt_e) to the flow (called + mtt_f). For example the following three forms are equivalent + + + + + +
+
+R:r:mtt_e=r*mtt_f
+R:r:mtt_e-r*mtt_f=0
+R:r:mtt_f=mtt_e/r
+
+
+ A non-linear example is: + + + + + +
+
+R:r:mtt_e = sin(mtt_f)
+
+
+
+
type*n
+
+ The name, together with the number + `n' of repetitions of the component, are given. This + repetition only makes sense if the component has an even number of ports + (see section 6.4.1.11 Port labels); n + copies of the component are concatenated with odd Named ports (see + section 6.4.1.11 Port labels) of the + component being connected to the even Named ports of the previous + component in the chain in numerical order. This feature is particularly + useful if the component is compound and can be used for, example to give + a lumped approximation of a distributed system. For example: + + + + + +
+
+MySystem*25
+
+
+
+
type:label*n
+
+ This complete form and is a + combination of the simpler forms. For example: + + + + + +
+
+MySystem:MyLabel*25
+
+
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.5 Simple components

+ +

The following simple components are defined in MTT.

+
+
R
+
Standard one-port R
+
C
+
Standard one-port I
+
I
+
Standard one-port I
+
SS
+
Source-sensor
+
TF
+
Transformer
+
GY
+
Gyrator
+
AE
+
Effort amplifier
+
AF
+
Flow amplifier
+
CSW
+
Switched one-port I
+
ISW
+
Switched one-port I
+
+ + + + + + + + + + + +
+ 6.4.1.6 SS components +
+ 6.4.1.7 Simple components - implementation +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.6 SS components

+ +

+ SS components provide input and output variables for a + system; Named SS components (see section + 6.4.1.9 Named SS components) provide this for + subsystems. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.7 Simple components - implementation

+ +

Each simple component, with name NAME, is defined by two m files:

+
+
NAME_cause.m
+
+ defines the possible causal patterns + for the component +
+
NAME_eqn.m
+
defines the equations generated
+
+ Only the experienced user would normally define simple components - Compound + components (see section + 6.4.1.8 Compound components) are recommended + for DIY components. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.8 Compound components

+ + Compound components are systems described by bond graphs and implemented by + MTT. They have special SS components, Named SS components (see section + 6.4.1.9 Named SS components), to indicate + connections to the encapsulating system. +

+ Like any other system, they are described by a graphical Bond Graph + description (see section + 6.4.1 Language fig (abg.fig)), and a label + file (see section 6.6 Labels (lbl)). +

+

+ By convention, all of the files describing a component live in a directory + with the same name as the component. +

+ + + + + + +
+ 6.4.1.9 Named SS components +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.9 Named SS components

+ +

+ Named SS components provide the link from the system which + defines compound component to the system which uses a + compound component see section + 6.4.1.8 Compound components. A named SS + components is of the form SS:[name]; +

+

+ Where `name' is a name consisting of alphanumeric characters and + underscore; for example: +

+ + + + + +
+
+SS:[Mechanical_1]
+
+
+ Each such named SS provides one of the ports (see section + 1.6.1 Ports). The direction of the named SS + components. (see section + 6.4.1.9 Named SS components) is coerced (see + section 6.4.1.10 Coerced bond direction) to + have the same direction as the bond connected to the corresponding port. + Thus the direction of the direction of the named SS components has no + significance unless the component is at the top level of a system. +

+ If a named SS component exists at the top level (see section + 3.3.1 Top level) and is treated as an + ordinary SS component with the given direction and with the attributes + specified in the label file (see section + 6.6 Labels (lbl)). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.10 Coerced bond direction

+ + Named SS components (see section + 6.4.1.9 Named SS components) provide the + mechanism for declaring the ports (see section + 1.6.1 Ports) of a component. The corresponding + bond has a direction. However, under some circumstances, it may be useful to + reverse this direction. MTT provides a coercion mechanism + for this: the the direction of the bond attached to the named SS component + (see section 6.4.1.9 Named SS components) is + replaced by the direction of the bond attached to the component port. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.11 Port labels

+ + Most multi-port components have ports see section + 1.6.1 Ports)which display different behaviors; + the exception to this is the junction (0 and 1) + components. For this reason, MTT provides a method for + unambiguously identifying the ports of a multi-port component by port + labels. +

+ A port label is indicated by a name within parentheses of the form + [name], where `name' is a name consisting of alphanumeric + characters and underscore; for example: +

+ + + + + +
+
+[Mechanical_1]
+
+
+ This provides a label for corresponding to the component to which the + nearest bond-end is attached. +

The following rules must be be obeyed:

+
    +
  • + If a component has any port labels at all, there must be one for each + port of the component. +
  • +
+

+ Port labels may be grouped into vector port labels (see section + 6.4.1.12 Vector port labels). Components with + compatible (ie containing the same number of ports) vector ports may be + connected by a single bond (see section + 1.5 Bonds); such a bond implies the + corresponding number of bonds (one for each element of the vector port + label). All such bonds inherit the same direction and any + explicit causal strokes (see section + 6.4.1.3 Strokes) +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.12 Vector port labels

+ + Port labels (see section 6.4.1.11 Port labels) + may be grouped into vector port labels of the form + [name1,name2,name3]. + + + + + +
+
+[Mechanical_1,Electrical,Hydraulic_5]
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.13 Port label defaults

+ + Whether impicitly or explicity, all ports of components (with the exception + of 0 and 1 junctions) must have lables (see section + 6.4.1.11 Port labels). However, these can be + omitted from the bond graph in the following circumstances and default + labels are supplied by MTT. +
    +
  1. A single unlabled inport defaults to [in]
  2. +
  3. A single unlabled outport defaults to [out]
  4. +
+

+ These defaults may, in turn be aliases (see section + 6.6.9 Aliases) for port labels (see section + 6.4.1.11 Port labels) or vector port labels + (see section 6.4.1.12 Vector port labels). + Combining the default and alias mechanism is a powerful tool for creating + uncluttered, yet complex, bond graph models. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.14 Vector Components

+ + Vectors of components can be created in four cases: + 0 junctions, 1 junctions, + SS components and SS port components. +

+ In each case, the presence of a vector component is indicated by a single + port label (see section 6.4.1.11 Port labels) + of one of two forms: +

+
    +
  1. + containing numerals from 1 to the order of the vector. Thus a vector of + 3 components is indicated by a port label of the form [1,2,3]. +
  2. +
  3. + 1: followed by the order of the vector. Thus a vector of 3 components is + indicated by a port label of the form [1:3]. +
  4. +
+

+ Within the corresponding label file (see section + 6.6 Labels (lbl)), the components of a vector + port can be accessed using _i where i is the corresponding index. Thus a + port SS:[Electrical] appearing near the port label [1,2,3] could contain + the port alias (see section + 6.6.9.1 Port aliases) +

+ + + + + +
+
+%ALIAS  in Electrical_1,Electrical_2,Electrical_3
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.15 Artwork

+ + You are encouraged to annotate your bond graphs extensively - this makes + them an immediately readable document whilst retaining the precise and + unambiguous expressive power of the bond graph. +

+ You may add any Fig (see section 9.1 Fig) + object to the bond graph as long as it will not be interpreted as part of + the bond graph. The reccommended way to acheive this is to put the Bond + Graph at depth 0,10,20 etc (ie depth modulo 10 is zero) and artwork at any + other depth. +

+

+ For compatibility with earlier versions of MTT, the + following objects are ignored even at level 0. However, their use is + strongly discouraged. +

+
    +
  • + Adding text is OK as long as it cannot be confused with components (see + section 6.4.1.4 Components). In particular, + you can include invalid component characters such as white space, + ", ', ! etc. +
  • +
  • Adding boxes, arcs etc is always OK.
  • +
  • Adding dotted or dashes lines is always OK.
  • +
+

+ The stripped abg file (sabg) (see section + 6.5 Stripped acausal bond graph (sabg)) shows + only those parts of the diagram recognised by MTT and is + therefore useful for distinguishing artwork. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.1.16 Valid Names

+ + A valid name is a text string containing alphanumeric characters. It must + NOT contain underscore `_', hyphen + `-', `:' or `*'. +

The following names should be avoided

+ + + + + +
+
+if endif
+
+
+

+ The following reserved words in reduce should also be avoided (with any + case) +

+ + + + + +
+
+Commands ALGEBRAIC ANTISYMMETRIC ARRAY BYE CLEAR CLEARRULES COMMENT
+CONT DECOMPOSE DEFINE DEPEND DISPLAY ED EDITDEF END EVEN FACTOR FOR
+FORALL FOREACH GO GOTO IF IN INDEX INFIX INPUT INTEGER KORDER LET
+LINEAR LISP LISTARGP LOAD LOAD PACKAGE MASS MATCH MATRIX MSHELL
+NODEPEND NONCOM NONZERO NOSPUR ODD OFF ON OPERATOR ORDER OUT PAUSE
+PRECEDENCE PRINT PRECISION PROCEDURE QUIT REAL REMFAC REMIND RETRY
+RETURN SAVEAS SCALAR SETMOD SHARE SHOWTIME SHUT SPUR SYMBOLIC
+SYMMETRIC VECDIM VECTOR WEIGHT WRITE WTLEVEL
+
+Boolean Operators EVENP FIXP FREEOF NUMBERP ORDP PRIMEP
+
+Infix Operators := = >= > <= < => + * / ^ ** . WHERE SETQ OR AND
+MEMBER MEMQ EQUAL NEQ EQ GEQ GREATERP LEQ LESSP PLUS DIFFERENCE MINUS
+TIMES QUOTIENT EXPT CONS Numerical Operators ABS ACOS ACOSH ACOT ACOTH
+ACSC ACSCH ASEC ASECH ASIN ASINH ATAN ATANH ATAN2 COS COSH COT COTH
+CSC CSCH EXP FACTORIAL FIX FLOOR HYPOT LN LOG LOGB LOG10 NEXTPRIME
+ROUND SEC SECH SIN SINH SQRT TAN TANH
+
+Prefix Operators APPEND ARGLENGTH CEILING COEFF COEFFN COFACTOR CONJ
+DEG DEN DET DF DILOG EI EPS ERF FACTORIZE FIRST GCD G IMPART INT
+INTERPOL LCM LCOF LENGTH LHS LINELENGTH LTERM MAINVAR MAT MATEIGEN MAX
+MIN MKID NULLSPACE NUM PART PF PRECISION RANDOM RANDOM NEW SEED RANK
+REDERR REDUCT REMAINDER REPART REST RESULTANT REVERSE RHS SECOND SET
+SHOWRULES SIGN SOLVE STRUCTR SUB SUM THIRD TP TRACE VARNAME
+
+Reserved Variables CARD NO E EVAL MODE FORT WIDTH HIGH POW I INFINITY
+K!* LOW POW NIL PI ROOT MULTIPLICITY T
+
+Switches ADJPREC ALGINT ALLBRANCH ALLFAC BFSPACE COMBINEEXPT
+COMBINELOGS COMP COMPLEX CRAMER CREF DEFN DEMO DIV ECHO ERRCONT
+EVALLHSEQP EXP EXPANDLOGS EZGCD FACTOR FORT FULLROOTS GCD IFACTOR INT
+INTSTR LCM LIST LISTARGS MCD MODULAR MSG MULTIPLICITIES NAT NERO
+NOSPLIT OUTPUT PERIOD PRECISE PRET PRI RAT RATARG RATIONAL RATIONALIZE
+RATPRI REVPRI RLISP88 ROUNDALL ROUNDBF ROUNDED SAVESTRUCTR
+SOLVESINGULAR TIME TRA TRFAC TRIGFORM TRINT
+
+Other Reserved Ids BEGIN DO EXPR FEXPR INPUT LAMBDA LISP MACRO PRODUCT
+REPEAT SMACRO SUM UNTIL WHEN WHILE WS
+
+
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.2 Language m (rbg.m)

+ + The raw bond graph of system `sys' is represented as an m file with heading: + + + + + +
+
+function [rbonds, rstrokes,rcomponents,rports,n_ports] = sys_rbg
+
+
+ This representation is a half-way house between the fig (see section + 6.4.1 Language fig (abg.fig)) and m (see + section 6.4.3 Language m (abg.m)) + representations. It contains the geometric information from the fig file in + a form digestible by Octave (see section + 10.4 Octave). +

The five outputs of this function are:

+
    +
  • rbonds
  • +
  • rstrokes
  • +
  • rcomponents
  • +
  • rports
  • +
  • n_ports
  • +
+

rbonds is a matrix with

+
    +
  • + one row for each bond (see section + 6.4.1.2 Bonds) +
  • +
  • + columns 1 and 2 containing the x,y coordinates for one end of the bond +
  • +
  • + columns 3 and 4 containing the x,y coordinates for the corner of the + bond +
  • +
  • + columns 5 and 6 containing the x,y coordinates for the other end of the + bond +
  • +
+

+ rstrokes is a matrix with (see section + 6.4.1.3 Strokes) +

+
    +
  • one row for each stroke or half-stroke
  • +
  • + columns 1 and 2 containing the x,y coordinates for one end of the stroke +
  • +
  • + columns 3 and 4 containing the x,y coordinates for the other end of the + stroke +
  • +
+

+ rcomponents is a matrix with (see section + 6.4.1.4 Components) +

+
    +
  • one row for each component
  • +
  • columns 1 and 2 containing the x,y coordinates of the component
  • +
  • the remaining columns containing fig file information
  • +
+

+ rports is a matrix with (see section + 6.4.1.11 Port labels) +

+
    +
  • one row for each component port that is explicitly labeled
  • +
  • columns 1 and 2 containing the x,y coordinates of the port label
  • +
  • column 3 contains the port number.
  • +
+

+ n_ports is the number of ports associated with the system -- i.e. + the number of Named SS components (see section + 6.4.1.9 Named SS components). +

+ + + + + + +
+ 6.4.2.1 Transformation abg2rbg_fig2m +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.2.1 Transformation abg2rbg_fig2m

+ +

+ This transformation takes the acausal bond graph as a fig file (see + section 6.4.1 Language fig (abg.fig)) and + transforms it into a raw bond graph in m-file format (see section + 6.4.2 Language m (rbg.m)). +

+

+ This transformation is implemented in GNU awk (gawk). It scans both the + fig file (see section + 6.4.1 Language fig (abg.fig)) and the label + file (see section 6.6 Labels (lbl)) and + generates the rbg (see section + 6.4.2 Language m (rbg.m)) with components + sorted according to the label file. It also generates a file sys_fig.fig + containing details of the bond graph with the components removed. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.3 Language m (abg.m)

+ +

+ The acausal bond graph of system `sys' is represented as an m file with + heading: +

+ + + + + +
+
+function [bonds,components,n_ports] = sys_abg
+
+
+ The three outputs of this function are: +
    +
  • bonds
  • +
  • components
  • +
  • n_ports
  • +
+

bonds is a matrix with

+ +

components is a matrix with

+
    +
  • one row for each component
  • +
  • + one column for each bond impinging on the component. The + magnitude of each entry corresponds to the bond number (the + appropriate row index of` bonds'); the sign is positive if the bond + arrow points into the component and negative otherwise. +
  • +
+

+ n_ports is the number of ports associated with the system -- i.e. + the number of Named SS components (see section + 6.4.1.9 Named SS components). +

+ + + + + + + + + + + + + + + + +
+ 6.4.3.1 Arrow-orientated causality +
+ 6.4.3.2 Component-orientated causality +
+ 6.4.3.3 Transformation rbg2abg_m +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.3.1 Arrow-orientated causality

+ +

+ The arrow-orientated causality convention assigns -1, 0 or 1 to both the + effort and flow (see section 1.4 Variables) + sides of a bond to represent the causal stroke (see section + 6.4.1.3 Strokes) as follows: +

+
+
0
+
if there is no causality set.
+
1
+
+ if the causal stroke is at the arrow + end of the bond. +
+
-1
+
+ if the causal stroke is at the other + end of the bond. +
+
+ see section + 6.4.3.2 Component-orientated causality. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.3.2 Component-orientated causality

+ +

+ The component-orientated causality convention assigns -1, 0 or 1 to both + the effort and flow (see section + 1.4 Variables) sides of a bond to represent + the causal stroke (see section + 6.4.1.3 Strokes) as follows: +

+
+
0
+
if there is no causality set.
+
1
+
+ if the causal stroke is at the + component end of the bond. +
+
-1
+
+ if the causal stroke is at the other + end of the bond. +
+
+ see section 6.4.3.1 Arrow-orientated causality. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.3.3 Transformation rbg2abg_m

+ + This transformation takes the raw bond graph and, by doing some geometrical + computation, determines the topology of the bond graph -- ie what is close + to what. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.4.4 Language tex (abg.tex)

+ +

+ For the purpose of producing a report (see section + 6.16 Report (rep)), + MTT generates a LaTeX (see section + 10.5 LaTeX) file describing the bond graph + and its subsystems. Additional information may be supplied using the + description representation (see section + 8.2.2 Detailed on-line documentation). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.5 Stripped acausal bond graph (sabg)

+ + The stripped acausal bond graph is the acausal bond graph representation + (see section 6.4 Acausal bond graph (abg)) + without the artwork (see section + 6.4.1.15 Artwork). It is useful to check for + mistakes by showing precisely what is recognised by MTT. + + + + + + + + + + + +
+ 6.5.1 Language fig (sabg.fig) +
+ 6.5.2 Stripped acausal bond graph (view) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.5.1 Language fig (sabg.fig)

+ + The stripped acausal bond graph can be generated as a fig (see section + 9.1 Fig) file using + + + + + +
+
+mtt syst sabg fig
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.5.2 Stripped acausal bond graph (view)

+ + This representation has the standard text view (see section + 10.1 Views). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6 Labels (lbl)

+ + Bond graph components have optional labels. These provide pointers to + further information relating to the component; this avoids clutter on the + bond graph. +

+ The label file contains the following non-blank lines (blank lines are + ignored) +

+
    +
  • Summary - lines beginning with #SUMMARY
  • +
  • Description - lines beginning with #DESCRIPTION
  • +
  • Alias - lines beginning with #ALIAS
  • +
  • Comments - lines beginning with #
  • +
  • Labels - other non-blank lines
  • +
+

+ Note, for compatability with old versions, % may be used in place of #; + but the use of % is deprecated. Each lable contains three fields (in the + following order) separated by white space and on one line: +

+
    +
  1. + The component name see section + 6.6.3 Component names. This must be a valid + name (see section 6.4.1.16 Valid Names. +
  2. +
  3. + The component constitutive relationship see section + 6.6.4 Component constitutive relationship +
  4. +
  5. + The component arguments see section + 6.6.5 Component arguments +
  6. +
+

+ Not each component see section + 6.4.1.4 Components needs a label, only those + which are explicitly labeled on the Bond Graph see section + 6.4 Acausal bond graph (abg). + MTT checks whether all components labelled on the bond + graph have labels and vice versa. +

+

+ If no lbl file exists, MTT will create a valid one for + you; including a default set of arguments and crs for both simplae and + compound components. +

+

If wish to create one to edit yourself, type

+ + + + + +
+
+mtt system_name lbl txt
+
+
+ An example lbl file (for the RC system is): + + + + + +
+
+%% Label file for system RC (RC_lbl.txt)
+%SUMMARY RC
+%DESCRIPTION <Detailed description here>
+% Port aliases
+%ALIAS  in      in
+%ALIAS  out     out
+
+% Argument aliases
+%ALIAS  $1      c
+%ALIAS  $2      r
+
+%% Each line should be of one of the following forms:
+%            a comment (ie starting with %)
+%            component-name     cr_name arg1,arg2,..argn
+%            blank
+
+% ---- Component labels ----
+
+% Component type C
+        c               lin     effort,c
+
+% Component type R
+        r               lin     flow,r
+
+% Component type SS
+        [in]    SS              external,external
+        [out]   SS              external,external
+
+
+
+

+ The old-style lbl files (see section + 6.6.11 Old-style labels (lbl)) are NO LONGER + supported -- you are encouraged to convert them ASAP. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 6.6.1 SS component labels +
+ 6.6.2 Other component labels +
+ 6.6.3 Component names +
+ 6.6.4 Component constitutive relationship +
+ 6.6.5 Component arguments +
+ 6.6.6 Parameter declarations +
+ 6.6.7 Units declarations +
+ 6.6.8 Interface Control Definition +
+ 6.6.9 Aliases +
+ 6.6.10 Parameter passing +
+ 6.6.11 Old-style labels (lbl) +
+ 6.6.12 Language tex (desc.tex) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.1 SS component labels

+ + In addition to the label there are two information fields, see section + 6.6 Labels (lbl). The first must be `SS', the + second contains two information fields of the form + info_field_1,info_field_2. +

+ These two information fields correspond to the effort and flow variables + of the of the SS components as follows +

+
+
info_field_1
+
effort
+
info_field_2
+
flow
+
+ Each of these two fields contains one of the following attributes: +
+
external
+
+ indicates that the corresponding + variable is a system input or output +
+
internal
+
+ indicates that the variable does not + appear as a system output; it is an error to label an input in this way. +
+
a number
+
+ the value of the input; or the value + of the (imposed) output +
+
a symbol
+
+ the symbolic value of the input; or + the value of the (imposed) output +
+
unknown
+
+ used for the SS method of solving + algebraic loops. This indicates that the corresponding system input (SS + output) is to be chosen to set the corresponding system output (SS + input) to zero. +
+
zero
+
+ used for the SS method of solving + algebraic loops. This indicates that the corresponding system output (SS + input) is to be set to zero using the variable indicted by the + corresponding `unknown' label. +
+
+

Some examples are:

+ + + + + +
+
+%% ss1 is both a source and sensor
+ss1     SS              external,external
+%% ss1 acts as a flow sensor - it imposes zero effort.
+ss2     SS              0,external
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.2 Other component labels

+ +

+ In addition to the label there are two information fields, see section + 6.6 Labels (lbl). They correspond to the + constitutive relationship (see see section + 1.6.2 Constitutive relationship and arguments + of the component as follows +

+
+
info_field_1
+
constitutive relationship
+
info_field_2
+
parameters
+
+

Some examples are:

+ + + + + +
+
+%Armature resistance
+r_a     lin     effort,r_a
+
+%Gearbox ratio
+n       lin     effort,n
+
+
+

+ MTT supports parameter-passing to (see section + 6.6.10 Parameter passing) subsystems. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 6.6.3 Component names +
+ 6.6.4 Component constitutive relationship +
+ 6.6.5 Component arguments +
+ 6.6.9 Aliases +
+ 6.6.10 Parameter passing +
+ 6.6.11 Old-style labels (lbl) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.3 Component names

+ + The component name field must contain a valid name (see section + 6.4.1.16 Valid Names corresponding to the name + (the bit after the :) of each named component (see section + 6.4.1.4 Components) on the bond graph (see + section 6.4 Acausal bond graph (abg)). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.4 Component constitutive relationship

+ + The constitutive relationship field contains the name of a constitutive + relationship for the component. There are three sorts of constitutive + relationship recognised by MTT: +
    +
  1. + A generic constitutive relationship such as lin (the generic + linear constitutive relationship. +
  2. +
  3. + A local constitutive relationship with the same name as the component + type +
  4. +
  5. + The SS constitutive relationship reserved for + SS components. All labels for SS components must + contain SS in this field. +
  6. +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.5 Component arguments

+ +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.6 Parameter declarations

+ +

+ It is sometimes useful to use parameters (in addition to those implied by + the Component arguments see section + 6.6.5 Component arguments) to compute values + in, for example the numpar file. These can be declared in the label file; + for examples , the two parameters par1 and par 2 can be declared as: +

+ + + + + +
+
+#PAR par1
+#PAR par2
+
+
+

+ On the other hand, some CR arguments (eg foo and bar) may not correspond + to parameters. These can be excluded from the sympar list using the NOTPAR + declaration +

+ + + + + +
+
+#NOTPAR foo
+#NOTPAR bar
+
+
+

+ For comapability with old code, VAR may be used in place of PAR, but this + usage is deprecated. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.7 Units declarations

+ + The units and domains of ports (see section + 1.6.1 Ports) are declared as: + + + + + +
+
+#UNITS Port_name domain effort_units flow_units
+
+
+ where "Port_name" is the name of the port, domain is one of: +
+
electrical
+
the electrical domain
+
translational
+
+ the translational mechanical domain +
+
rotational
+
+ the rotational mechanical domain +
+
fluid
+
the fluid domain
+
thermal
+
the thermal domain
+
+ and effort_units and flow_units are corresponding units for the effort and + the flow. +

+ Allowed units are those defined in the units package. +

+

MTT checks that units are

+
    +
  • defined consistently with the domain
  • +
  • the same for connected ports when both ports have defined units.
  • +
+ No checks are done if one or both ends of a bond are not connected to a port + with defined units. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.8 Interface Control Definition

+ + It is sometimes useful to be able to automatically generate a set of + assignments mapping MTT inputs and outputs to an external + interface definition. This can be achieved with use of the #ICD + directive. + + + + + +
+
+#ICD    PressureSensor         PUMP1_PRESSURE_SENSOR,Pa;null,none
+#ICD    Electrical              PUMP1_VOLTAGE,volt;PUMP1_CURRENT,amp
+
+% Component type De
+        PressureSensor  SS      external
+
+% Component type SS
+        Electrical      SS      external,external
+
+
+

The ICD directive consists of 3 whitespace delimited fields:

+
    +
  1. [%|#]ICD
  2. +
  3. component name
  4. +
  5. + Four comma (,) or semi-colon (;) delimited fields: +
      +
    1. name of effort parameter
    2. +
    3. unit of effort parameter
    4. +
    5. name of flow parameter
    6. +
    7. unit of flow parameter
    8. +
    +
  6. +
+

+ If no parameter name is required, a value of "null" should be used. If the + parameter does not have any units, a value of "none" should be used. +

+

+ ICD parameters may be aliased see section + 6.6.9 Aliases in the same way as normal + parameters, thus it is possible to define some or all of the ICD in higher + level components. +

+

The command

+ + + + + +
+
+mtt sys ICD txt
+
+
+

will generate a text file containing a list of mappings:

+ + + + + +
+
+## Interface Control Definition for System sys
+## sys_ICD.txt: Generated by MTT Thu Jul 12 21:21:21 CDT 2001
+
+Input:  PUMP1_VOLTAGE           sys_P1_1_Electrical      Causality: Effort   Units: volt
+Output: PUMP1_CURRENT           sys_P1_1_Electrical      Causality: Flow     Units: amp
+Output: PUMP1_PRESSURE_SENSOR   sys_P1_1_PressureSensor  Causality: Effort   Units: Pa
+
+
+

A set of assignments can be generated with the command

+ + + + + +
+
+mtt sys ICD m
+
+
+

resulting in:

+ + + + + +
+
+# Interface Control Definition mappings for system sys
+# sys_ICD.m: Generated by MTT Thu Jul 12 21:26:56 CDT 2001
+
+# Inputs
+
+        mttu(1) = PUMP1_VOLTAGE;
+
+# Outputs
+
+        PUMP1_CURRENT                  = mtty(1);
+        PUMP1_PRESSURE_SENSOR          = mtty(2);
+
+
+

A similar file will be generated by the command

+ + + + + +
+
+mtt sys ICD cc
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.9 Aliases

+ +

+ Aliases provide a convenient mechanism for relabelling words appearing in + the label file (see section + 6.6 Labels (lbl)). There are three contexts + in which the alias mechanism is used: +

+
    +
  1. + renaming ports (see section + 6.6.9.1 Port aliases), +
  2. +
  3. + renaming parameters (see section + 6.6.9.2 Parameter aliases) and +
  4. +
  5. + renaming components (see section + 6.6.9.4 Component aliases). +
  6. +
+

+ All three mechanisms use the same form of statement within the label file +

+ + + + + +
+
+%ALIAS short_label       real_label
+
+
+

+ MTT distinguishes between the three forms as follows: +

+
    +
  • Parameter aliases: `short_label' starts with a `$'
  • +
  • + Component aliases: `real_label' contains the directory separator `/' +
  • +
  • Port aliases: neither of the above
  • +
+ + + + + + + + + + + + + + + + + + + + + +
+ 6.6.9.1 Port aliases +
+ 6.6.9.2 Parameter aliases +
+ 6.6.9.3 CR aliases +
+ 6.6.9.4 Component aliases +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.9.1 Port aliases

+ + Aliases provide a way of refering to (see section + 6.4.1.11 Port labels) or vector port labels + (see section 6.4.1.12 Vector port labels) on + the bond graph using a short-hand notation. With in a component label file + (see section 6.6 Labels (lbl)) statements of + the following forms can occur + + + + + +
+
+%ALIAS short_label       real_label
+
+
+

+ When the component is used within another component, the short_lable may + be used in place of the real_label. More than one alias per label can be + used, for example +

+ + + + + +
+
+%ALIAS short_label_1       real_label
+%ALIAS short_label_2       real_label
+%ALIAS short_label_3       real_label
+
+
+

+ The port can then be refered to in four ways: as real_label, + short_label_1, short_label_2 or short_label_3. An alternative notation for + the ALIAS statement in this case is +

+ + + + + +
+
+%ALIAS short_label_1|short_label_2|short_label_3       real_label
+
+
+

+ The alias feature is particularly powerful in conjunction with vector port + labels (see section + 6.4.1.12 Vector port labels) and the port + label default (see section + 6.4.1.13 Port label defaults) mechanisms. For + example, a component with 5 ports appearing in the lbl file as: +

+ + + + + +
+
+        [Hydraulic_in]  external        external
+        [Hydraulic_out] external        external
+        [Power_Shaft]           external        external
+        [Thermal_in]    external        external
+        [Thermal_out]   external        external
+
+
+

together with the following statements in the label file:

+ + + + + +
+
+%ALIAS  in              Thermal_in,Hyydraulic_in
+%ALIAS  out             Thermal_out,Hydraulic_out
+%ALIAS  shaft|power     Power_Shaft
+
+
+

+ can appear in the bond graph containing that component with one bond + labeled either [shaft] or [power] or [Power_Shaft], one unlabeled vector + bond pointing in and one unlabeled vector bond pointing out. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.9.2 Parameter aliases

+ +

Parameter aliases are of the form

+ + + + + +
+
+%ALIAS $n       actual parameter
+
+
+ where n is an integer (unique within the label file). For example + + + + + +
+
+%ALIAS  $1              c_v
+%ALIAS  $2              density,ideal_gas,r
+%ALIAS  $3              alpha
+%ALIAS  $4              flow,k_p
+
+
+

+ Assigns four symbolic parameters to the corresponding strings These four + parameters ($1--$4) can then be used for + parameter passing(see section + 6.6.10 Parameter passing). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.9.3 CR aliases

+ +

CR aliases are of the form

+ + + + + +
+
+%ALIAS $an       actual parameter
+
+
+ where n is an integer (unique within the label file). For example + + + + + +
+
+%ALIAS  $a1  lin
+
+
+ assigns the symbolic parameter to be lin. This parameter $1 can + then be used for passing a diofferent cr to the component (see section + 6.6.10 Parameter passing). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.9.4 Component aliases

+ +

Component aliases are of the form

+ + + + + +
+
+%ALIAS Component_name   Component_location
+
+
+

An example appears in the following label file fragment

+ + + + + +
+
+...
+%ALIAS  wPipe   CompressibleFlow/wPipe
+%ALIAS  Poly    CompressibleFlow/Poly
+....
+
+
+
+ The two components `wPipe' and `Poly' are both to be found within the + library `Compressible flow' and the respective subdirectories. This follows + the MTT convention that compound components (see section + 6.4.1.8 Compound components) live within a + directory of the same name. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.10 Parameter passing

+ + MTT supports parameter-passing to subsystems within label + files (see section 6.6 Labels (lbl)). Within a + subsystem, explicit constitutive relationships and parameters (or groups + thereof) can be replaced by postitional parameters such as $1, + $2 etc. Although this can be done directly, it is recommended + that this is done via the alias mechanism (see section + 6.6.9.2 Parameter aliases). +

+ In a subsystem $i, is replaced by the ith field of a colon + ; separated field in the calling label file. This field may + include commas , and the four arithmetic operators + +, -, * and /. +

+

+ For example, consider the following example label file fragment + (associated with a component called Pump: +

+ + + + + +
+
+...
+
+%ALIAS  $1              c_v
+%ALIAS  $2              density,ideal_gas,r
+%ALIAS  $3              alpha
+%ALIAS  $4              flow,k_p
+
+%ALIAS  wPipe   CompressibleFlow/wPipe
+%ALIAS  Poly    CompressibleFlow/Poly
+
+% Component type wPipe
+        pipe    none                    c_v;density,ideal_gas,r
+
+% Component type Poly
+        poly            Poly            alpha
+
+
+
+

+ The 4 parameters $1, $2, $3, and + $4 can be passed from a higher level component as in the + following label file fragment: +

+ + + + + +
+
+% Component type Pump
+        comp            none            c_v;rho,ideal_gas,r;alpha;effort,k_c
+        turb            none            c_v;rho,ideal_gas,r;alpha;effort,k_t
+
+
+

Thus in component `comp':

+
    +
  • $1 is replaced by c_v
  • +
  • $2 is replaced by rho,ideal_gas
  • +
  • $3 is replaced by alpha
  • +
  • $4 is replaced by effort,k_c
  • +
+ whereas in component `turb' the first three parameters are the same but +
    +
  • $4 is replaced by effort,k_t
  • +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.11 Old-style labels (lbl)

+ +

+ Old syle labels (mtt version 2.x) are supported by mtt version 3.x. + However, you are advised to use the new form (see section + 6.6 Labels (lbl)). +

+

+ Each line of the _label.txt file is of one of three forms: +

+
    +
  1. + Contains three fields (separated by white space) of the form + + + + + +
    +
    +label   field_1   field_2
    +
    +
    +
  2. +
  3. Blank
  4. +
  5. Preceded by %
  6. +
+ Only the first is noticed by MTT; the second and third are + for providing helpful commenting. +

+ The role of the two information fields depends on the component with the + corresponding label. In particular the classes of components are: +

+ + Named SS component, see section + 6.4.1.9 Named SS components never have labels. + + + + + + + + + + + + + + + + +
+ 6.6.11.1 SS component labels (old-style) +
+ 6.6.11.2 Other component labels (old-style) +
+ 6.6.11.3 Parameter passing (old-style) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.11.1 SS component labels (old-style)

+ + In addition to the label there are two information fields, see section + 6.6 Labels (lbl). They correspond to the effort + and flow of the components as follows +
+
info_field_1
+
effort
+
info_field_2
+
flow
+
+ Each of these two fields contains one of the following attributes: +
+
+
+ external indicates that the + corresponding variable is a system input or output +
+
internal
+
+ indicates that the variable does not + appear as a system output; it is an error to label an input in this way. +
+
a number
+
+ the value of the input; or the value + of the (imposed) output +
+
a symbol
+
+ the symbolic value of the input; or + the value of the (imposed) output +
+
unknown
+
+ used for the SS method of solving + algebraic loops. This indicates that the corresponding system input (SS + output) is to be chosen to set the corresponding system output (SS + input) to zero. +
+
zero
+
+ used for the SS method of solving + algebraic loops. This indicates that the corresponding system output (SS + input) is to be set to zero using the variable indicted by the + corresponding `unknown' label. +
+
+

Some examples are:

+ + + + + +
+
+%Label  field1          field2
+ss1     external        external
+ss2     0               external
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.11.2 Other component labels (old-style)

+ +

+ In addition to the label there are two information fields, see section + 6.6 Labels (lbl). They correspond to the + constitutive relationship (see see section + 1.6.2 Constitutive relationship and arguments + of the component as follows +

+
+
info_field_1
+
constitutive relationship
+
info_field_2
+
parameters
+
+

Some examples are:

+ + + + + +
+
+%Armature resistance
+r_a     lin     effort,r_a
+
+%Gearbox ratio
+n       lin     effort,n
+
+
+

+ MTT supports parameter-passing to (see section + 6.6.11.3 Parameter passing (old-style)) + subsystems. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.11.3 Parameter passing (old-style)

+ + MTT supports parameter-passing to (see section + 6.6.11.3 Parameter passing (old-style)) + subsystems within label files (see section + 6.6 Labels (lbl)). Within a subsystem, explicit + constitutive relationships and parameters (or groups thereof) can be + replaced by $1, $2, etc. +

+ In a subsystem $i, is replaced by the ith field of a colon + ; separated field in the calling label file. This field may + include commas ,. +

+

+ For example subsystem ROD contains the following lines in the label file: +

+ + + + + +
+
+%DESCRIPTION    Parameter 1:    length from end 1 to mass centre
+%DESCRIPTION    Parameter 2:    length from end 2 to mass centre
+%DESCRIPTION    Parameter 3:    inertia about mass centre
+%DESCRIPTION    Parameter 4:    mass
+%DESCRIPTION    See Section 10.2 of "Metamodelling"
+
+
+%Inertias
+J       lin     flow,$3
+m_x     lin     flow,$4
+m_y     lin     flow,$4
+
+%Integrate angular velocity to get angle
+th
+
+%Modulated transformers
+s1      lsin    flow,$1
+s2      lsin    flow,$2
+c1      lcos    flow,$1
+c2      lcos    flow,$2
+
+
+
+

+ This can be used in a higher-level lbl (see section + 6.6 Labels (lbl)) file as: +

+ + + + + +
+
+%SUMMARY Pendulum example from Section 10.3 of "Metamodelling"
+
+%Rod parameters
+rod     none    l;l;j;m
+
+
+
+ + + + + + +
+ 6.6.12 Language tex (desc.tex) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.6.12 Language tex (desc.tex)

+ + This file may contain any LaTeX compatible commands. Any mathematics should + conform to the AMSmath package. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.7 Structure (struc)

+ +

+ The causal bond graph implies a set of equations describing the system. + The Structure (struc) representation describes the structure of these + equations in terms of the input, outputs, states and non-states of the + system. +

+ + + + + + + + + + + + + + + + +
+ 6.7.1 Language txt (struc.txt) +
+ 6.7.2 Language tex (struc.tex) +
+ 6.7.3 Language tex (view) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.7.1 Language txt (struc.txt)

+ + This text tile contains a description of the system structure (see section + 6.7 Structure (struc) with 5 tab-separated + columns containing the following information: +
+
type
+
input, output state or nonstate
+
+
+ index an integer corresponding to the + array index +
+
+
+ component name the name of the + component corresponding to the variable +
+
system name
+
+ the name of the system containing the + component +
+
repetition
+
+ an integer corresponding to the + repetition of a repeated subsystem. +
+
+

+ An example of such a file (corresponding to rc) (see section + 3.1 Quick start) is: +

+ + + + + +
+
+input           1       e1      rc      1
+output          1       e2      rc      1
+state           1       c       rc      1
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.7.2 Language tex (struc.tex)

+ + This LaTeX (see section 10.5 LaTeX) file + contains a description of the system structure (see section + 6.7 Structure (struc) in + longtable format. It is a useful item to include in a + report(see section 6.16 Report (rep)). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.7.3 Language tex (view)

+ + This representation has the standard text view (see section + 10.1 Views). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.8 Constitutive relationship (cr)

+ +

+ The constitutive relationship (see section + 1.6.2 Constitutive relationship) of a simple + component (see section + 6.4.1.5 Simple components is defined in the + symbolic algebra language Reduce (see section + 9.3 Reduce). The constitutive relationship + of a compound components (see section + 6.4.1.8 Compound components) is implied by + the constitutive relationships of its constituent components. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 6.8.1 Predefined constitutive relationships +
+ 6.8.2 DIY constitutive relationships +
+ 6.8.3 Unresolved constitutive relationships +
+ 6.8.4 Unresolved constitutive relationships - Octave +
+ 6.8.5 Unresolved constitutive relationships - c++ +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.8.1 Predefined constitutive relationships

+ +

Some common cr's are predefined by MTT; these are:

+
+
lin
+
+ a linear constitutive relationship +
+
exotherm
+
an exothermic reaction
+
+ + + + + + + + + + + +
+ 6.8.1.1 lin +
+ 6.8.1.2 exotherm +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.8.1.1 lin

+ + The constitutive relationship lin is predefined for the + following components. +
+
R
+
(one-port) R component
+
TF
+
transformer
+
GY
+
gyrator
+
MTF
+
modulated transformer
+
MGY
+
modulated gyrator
+
FMR
+
flow-modulated resistor
+
+ Lin takes two arguments in the form causality,gain +
+
causality
+
+ the causality (effort or flow) of the + input to the constitutive relationship +
+
gain
+
+ the gain of the component when the + input causality is as specified in the first argument. +
+
+ For example the arguments + + + + + +
+
+flow,r
+
+
+ given to an R component corresponds to + + + + + +
+
+e = rf
+
+
+ if if the input causality is flow or + + + + + +
+
+f = e/r
+
+
+ if if the input causality is effort. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.8.1.2 exotherm

+ +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.8.2 DIY constitutive relationships

+ + You can write your own constitutive relationships using Reduce (see section + 9.3 Reduce). This requires some understanding + as to how MTT represent the elementary system equations + (see section + 6.11 Elementary system equations (ese)). + Looking at the predefined constitutive relationships is a good way to get + started (see section 11.5 File structure). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.8.3 Unresolved constitutive relationships

+ +

Consider the following CR file.

+ + + + + +
+
+FOR ALL rho,g,vol,h,topt,bott,flowin,press
+LET tktf2(rho,g,vol,h,topt,bott,effort,2,press,effort,1)
+        = tank(rho,g,vol,h,topt,bott,press);
+
+
+ Assuming that `tank' is not defined in a reduce file, MTT will leave it + unresolved when generating m or c code. +

+ The resulting function can then be expressed as octave (see section + 6.8.4 Unresolved constitutive relationships - Octave) or c++ code as (see section + 6.8.5 Unresolved constitutive relationships - c++) appropriate. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.8.4 Unresolved constitutive relationships - Octave

+ + Following the example of the previous section, the unresolved CR `tank' can + be expressed as an Octave m-file. For example: + + + + + +
+
+function p = tank (rho,g,vol,h,topt,bott,press)
+
+  ## usage:  p = tank (vol,h,topt,bott,press)
+  ##
+  ##
+
+   val = press; zt = topt; zb = bott;
+   zval = 0.5*(abs(zb+(zt-zb)*val-h)+(zb+(zt-zb)*val-h));
+
+   p = rho*g*zval + 0.5*(1+tanh((press-0.98)*500))*100000;
+
+endfunction
+
+
+ This will be automatically loaded into octave. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.8.5 Unresolved constitutive relationships - c++

+ + Following the example of the previous section, the unresolved CR `tank' can + be expressed in c++ code. For example: + + + + + +
+
+inline double tank(const double rho,
+                   const double g,
+                   const double vol,
+                   const double h,
+                   const double topt,
+                   const double bott,
+                   const double press)
+
+
+  /*  ## usage:  p = tank (vol,h,topt,bott,press)
+    ##
+    ##
+  */
+  double p, val, zval, zt, zb;
+
+  val = press;
+  zt = topt;
+  zb = bott;
+  zval = 0.5 * (abs(zb + (zt - zb) * val - h) + zb + (zt - zb) * val - h);
+
+  p = rho * g * zval + 0.5 * (1 + tanh((press - 0.98) * 500)) * 100000L;
+
+  return p;
+
+
+
+

+ To make sure that this is used in system `model', the model_cr.h file must + be as follows: +

+ + + + + +
+
+// CR headers for system model
+#include "tank.c"
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.9 Parameters

+ +

+ In general, lbl (see section + 6.6 Labels (lbl)) files contain symbolic + parameters. MTT provides three ways of substituting for + these parameters: +

+
    +
  • symbolic substitution
  • +
  • symbolic substitution for simplification of displayed equations
  • +
  • numeric
  • +
+ + + + + + + + + + + + + + + + +
+ 6.9.1 Symbolic parameters (subs.r) +
+ 6.9.2 Symbolic parameters for simplification (simp.r) +
+ 6.9.3 Numeric parameters (numpar) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.9.1 Symbolic parameters (subs.r)

+ + This file contains reduce statements to symbolically change the expressions + describing the system. For example, a useful set of trig substitutions is: + + + + + +
+
+LET cos(~x)*cos(~y) = (cos(x+y)+cos(x-y))/2;
+LET cos(~x)*sin(~y) = (sin(x+y)-sin(x-y))/2;
+LET sin(~x)*sin(~y) = (cos(x-y)-cos(x+y))/2;
+LET cos(~x)^2       = (1+cos(2*x))/2;
+LET sin(~x)^2       = (1-cos(2*x));
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.9.2 Symbolic parameters for simplification (simp.r)

+ + This file contains reduce statements to symbolically change the expressions + describing the system. Unlike the subs.r file (see section + 6.9.1 Symbolic parameters (subs.r)) it does + not affect all system transformations; only those converting to LaTeX form. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.9.3 Numeric parameters (numpar)

+ +

+ When computing time and frequency responses; or when evaluating functions + in Octave (see section 10.4 Octave); + symbolic parameters need numerical instantiations. +

+

+ The numpar representation provides the relevant + numerical information. It comes in a number of languages: +

+
+
txt
+
+ a textual description of the parameter + values -- this is the defining representation (see section + 6.2 Defining representations). +
+
m
+
+ readable by octave a + high-level interactive language for numerical computation -- translated + by mtt from the txt version. +
+
c
+
+ readable by gcc a c + compiler -- translated by mtt from the txt version. +
+
+ + + + + + +
+ 6.9.3.1 Text form (numpar.txt) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.9.3.1 Text form (numpar.txt)

+ + This is the textual form of the numerical parameters representation (see + section 6.9.3 Numeric parameters (numpar)). + Lines are either +
+
+ assignment statements +
+
variable = value
+
comments
+
lines beginning with #
+
+ + commented assignment statements +
+
variable = value # comments
+
+ An example file is: + + + + + +
+
+# Numerical parameter file (rc_numpar.txt)
+# Generated by MTT at Mon Jun 16 15:10:17 BST 1997
+
+# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+# %% Version control history
+# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+# %% $Id: mtt.texi,v 1.18 2003/09/07 20:41:19 geraint Exp $
+# %% $Log: mtt.texi,v $
+# %% Revision 1.18  2003/09/07 20:41:19  geraint
+# %% *** empty log message ***
+# %%
+# %% Revision 1.17  2003/08/19 14:20:38  gawthrop
+# %% Version 5.0 of MTT
+# %% Remove xref errors (spurious spaces)
+# %%
+# %% Revision 1.16  2003/08/19 14:11:23  gawthrop
+# %% Links to legal stuff
+# %%
+# %% Revision 1.15  2003/08/19 14:01:45  gawthrop
+# %% Added legal appendices
+# %%
+# %% Revision 1.14  2003/08/06 14:50:56  gawthrop
+# %% Describe the alias mechanism for invoking mtt options
+# %%
+# %% Revision 1.13  2002/12/13 10:07:07  gawthrop
+# %% Added example in sh section of DIY reps
+# %%
+# %% Revision 1.12  2002/09/19 08:09:31  gawthrop
+# %% Updated documentation documentation
+# %%
+# %% Revision 1.11  2002/08/20 15:51:17  gawthrop
+# %% Update to work with ident DIY rep
+# %%
+# %% Revision 1.10  2002/07/22 10:45:22  geraint
+# %% Fixed gnuplot rep so that it correctly re-runs the simulation if input files have changed.
+# %%
+# %% Revision 1.9  2002/07/05 13:29:34  geraint
+# %% Added notes about generating dynamically linked functions for Octave and Matlab.
+# %%
+# %% Revision 1.8  2002/07/04 21:34:12  geraint
+# %% Updated gnuplot view description to describe Tcl/Tk interface instead of obsolete txt method.
+# %%
+# %% Revision 1.7  2002/04/23 09:51:54  gawthrop
+# %% Changed incorrect statement about searching for components.
+# %%
+# %% Revision 1.6  2001/10/15 14:29:50  gawthrop
+# %% Added documentaton on  [1:N] style port labels
+# %%
+# %% Revision 1.5  2001/07/23 03:35:29  geraint
+# %% Updated file structure (mtt/bin).
+# %%
+# %% Revision 1.4  2001/07/23 03:25:02  geraint
+# %% Added notes on -ae hybrd, rk4, ode2odes.cc, .oct dependencies.
+# %%
+# %% Revision 1.3  2001/07/13 03:02:38  geraint
+# %% Added notes on #ICD, gnuplot.txt and odes.sg rep.
+# %%
+# %% Revision 1.2  2001/07/03 22:59:10  gawthrop
+# %% Fixed problems with argument passing for CRs
+# %%
+# %% Revision 1.1  2001/06/04 08:18:52  gawthrop
+# %% Putting documentation under CVS
+# %%
+# %% Revision 1.66  2000/12/05 14:20:55  peterg
+# %% Added the c++  anf m CR info.
+# %%
+# %% Revision 1.65  2000/11/27 15:36:15  peterg
+# %% NOPAR --> NOTPAR
+# %%
+# %% Revision 1.64  2000/11/16 14:22:48  peterg
+# %% added UNITS declaration
+# %%
+# %% Revision 1.63  2000/11/03 14:41:08  peterg
+# %% Added PAR and NOTPAR stuff
+# %%
+# %% Revision 1.62  2000/10/17 17:53:34  peterg
+# %% Added some simulation details
+# %%
+# %% Revision 1.61  2000/09/14 17:13:06  peterg
+# %% New options table
+# %%
+# %% Revision 1.60  2000/09/14 17:09:20  peterg
+# %% Tidied up valid name sections
+# %% Tidied up defining represnetations table
+# %% Verion 4.6
+# %%
+# %% Revision 1.59  2000/08/30 13:09:00  peterg
+# %% Updated option table
+# %%
+# %% Revision 1.58  2000/08/01 13:30:19  peterg
+# %% Version 4.4
+# %% updated STEPFACTOR info
+# %% describes octave and OCST interfaces
+# %%
+# %% Revision 1.57  2000/07/20 07:55:44  peterg
+# %% Version 4.3
+# %%
+# %% Revision 1.56  2000/05/19 17:49:17  peterg
+# %% Extended the user defined representation section -- new nppp rep.
+# %%
+# %% Revision 1.55  2000/03/16 13:53:31  peterg
+# %% Correct date
+# %%
+# %% Revision 1.54  2000/03/15 21:22:57  peterg
+# %% Updated to 4.1 -- old style SS no longer supported
+# %%
+# %% Revision 1.53  1999/12/22 05:33:10  peterg
+# %% Updated for 4.0
+# %%
+# %% Revision 1.52  1999/11/23 00:25:11  peterg
+# %% Added the sensitivity reps
+# %%
+# %% Revision 1.51  1999/11/16 04:43:47  peterg
+# %% Added start of sensitivity section
+# %%
+# %% Revision 1.50  1999/11/16 00:30:35  peterg
+# %% Updated simulation section
+# %% Added vector components
+# %%
+# %% Revision 1.49  1999/07/20 23:44:58  peterg
+# %% V 3.8
+# %%
+# %% Revision 1.48  1999/07/19 03:08:33  peterg
+# %% Added documentation for (new) SS lbl fields
+# %%
+# %% Revision 1.47  1999/03/09 01:42:22  peterg
+# %% Rearranged the User interface section
+# %%
+# %% Revision 1.46  1999/03/09 01:18:01  peterg
+# %% Updated for 3.5 including xmtt
+# %%
+# %% Revision 1.45  1999/03/03 02:39:26  peterg
+# %% Minor updates
+# %%
+# %% Revision 1.44  1999/02/17 06:52:14  peterg
+# %% New level formula dor artwork
+# %%
+# %% Revision 1.43  1998/11/25 16:49:24  peterg
+# %% Put in subs.r documentation (was called params.r)
+# %%
+# %% Revision 1.42  1998/11/24 12:24:59  peterg
+# %% Added section on simulation output
+# %% Version 3.4
+# %%
+# %% Revision 1.41  1998/09/02 12:04:15  peterg
+# %% Version 3.2
+# %%
+# %% Revision 1.40  1998/08/27 08:36:39  peterg
+# %% Removed in. methods except Euler anf implicit
+# %%
+# %% Revision 1.39  1998/08/18 10:44:28  peterg
+# %% Typo
+# %%
+# %% Revision 1.38  1998/08/18 09:16:38  peterg
+# %% Version 3.1
+# %%
+# %% Revision 1.37  1998/08/17 16:14:30  peterg
+# %% Version 3.1 - includes documentation on METHOD=IMPLICIT
+# %%
+# %% Revision 1.36  1998/07/30 17:33:15  peterg
+# %% VERSION 3.0
+# %%
+# %% Revision 1.35  1998/07/22 11:00:53  peterg
+# %% Correct date!
+# %%
+# %% Revision 1.34  1998/07/22 11:00:13  peterg
+# %% Version to BAe
+# %%
+# %% Revision 1.33  1998/07/17 19:32:19  peterg
+# %% Added more about aliases
+# %%
+# %% Revision 1.32  1998/07/05 14:21:56  peterg
+# %% Further additions (Carlisle-Glasgow)
+# %%
+# %% Revision 1.31  1998/07/04 11:35:57  peterg
+# %% Strarted new lbl description
+# %%
+# %% Revision 1.30  1998/07/02 18:39:20  peterg
+# %% Started 3.0
+# %% Added alias and default sections.
+# %%
+# %% Revision 1.29  1998/05/19 19:46:58  peterg
+# %% Added the odess description
+# %%
+# %% Revision 1.28  1998/05/14 09:17:22  peterg
+# %% Added METHOD variable to the simpar file
+# %%
+# %% Revision 1.27  1998/05/13 10:03:09  peterg
+# %% Added unknown/zero SS label documentation.
+# %%
+# %% Revision 1.26  1998/04/29 15:12:46  peterg
+# %% Version 2.9.
+# %%
+# %% Revision 1.25  1998/04/12 17:00:26  peterg
+# %% Added new port features: coerced direction and top-level behaviour.
+# %%
+# %% Revision 1.24  1998/04/05 18:27:20  peterg
+# %% This was the 2.6 version
+# %%
+# Revision 1.23  1997/08/24  11:17:51  peterg
+# This is the released  version 2.5
+#
+# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+# Parameters
+c =     1.0; # Default value
+r =     1.0; # Default value
+# Initial states
+x(1) =  0.0; # Initial state for rc (c)
+
+
+ As usual, MTT provides a default text file to be edited by + the user (see section 10.3 Text editors). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.10 Causal bond graph (cbg)

+ + The causal bond graph is the causally complete version of the Acausal bond + graph (see section + 6.4 Acausal bond graph (abg)). +

To create the causal bond graph of system `sys' in language fig type:

+ + + + + +
+
+mtt sys cbg fig
+
+
+ To create the causal bond graph of system `sys' in language m type: + + + + + +
+
+mtt sys cbg m
+
+
+ To view the causal bond graph of system `sys' type: + + + + + +
+
+mtt sys cbg view
+
+
+ + + + + + + + + + + +
+ 6.10.1 Language fig (cbg.fig) +
+ 6.10.2 Language m (cbg.m) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.10.1 Language fig (cbg.fig)

+ + The fig file is created by MTT. It is identical to the + corresponding acausal representation (see section + 6.4.1 Language fig (abg.fig)) except that +
    +
  • + the new causal strokes are added (using a double thickness line in blue) +
  • +
  • components that are undercausal are bold and green
  • +
  • components that are overcausal are bold and red
  • +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.10.2 Language m (cbg.m)

+ +

+ The causal bond graph of system `sys' is represented as an m file with + heading: +

+ + + + + +
+
+function [cbonds,status] = sys_cbg
+
+
+ The two outputs of this function are: +
    +
  • cbonds
  • +
  • status
  • +
+

cbonds is a matrix with

+ +

status is a matrix with

+
    +
  • one row for each component
  • +
  • + the first column contains 1 if the component is overcausal; 0 if the + component is causally complete and -1 if the component is undercausal. +
  • +
+ A successful model would therefore have all zeros in the status matrix. + + + + + + +
+ 6.10.2.1 Transformation abg2cbg_m +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.10.2.1 Transformation abg2cbg_m

+ +

+ This transformation takes the acausal bond graph as an m file (see section + 6.4.3 Language m (abg.m)) and transforms it + into a causal bond graph in m-file format (see section + 6.10.2 Language m (cbg.m)). +

+

+ It is based on the m-function abg2cbg.m which iteratively tries to + complete causality whilst recursively searching the bond graph structure. + If causality is incomplete, it picks the first acausal dynamic (C or I) + component, asserts integral causality, and tries again. +

+

+ This is essentially the sequential causality assignment procedure of + Karnopp and Rosenberg. +

+

+ The transformation informs the user of the final status in terms of the + percentage of causally complete components; a successful model will yield + 100% here. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.11 Elementary system equations (ese)

+ +

+ The elementary system equations are a complete set of assignment + statements describing the dynamic system corresponding to the bond graph. + They are in the Reduce (see section + 9.3 Reduce) language. +

+

+ Because these are based on a causally complete system, these assignment + statements are directly soluble by substitution. +

+

+ Unlike early versions of MTT, MTT does + not sort the equations in order of solution, but rather leaves + them sorted by component and subsystem. +

+

+ These are not supposed to be read by the user, so there is no view + facility as such. However, you may read these with your favourite text + editor and, to this end, helpful comment lines have been added. +

+

+ Wherever components have an explicit constitutive relationship, the + corresponding RHS of the equation has a standard form. +

+ + + + + +
+
+cr(arguments,out_causality,outport,
+        input_1, causality_1, port_1,
+        ....
+        input_i, causality_i, port_i,
+        ....
+        input_n, causality_n, port_n
+        );
+
+
+ where the symbols have the following meaning +
+
arguments
+
+ the constitutive relationship + arguments +
+
out_causality
+
+ the causality (effort or flow) of the + output variable (see section 1.4 Variables) +
+
outport
+
+ the number (integer) of the output + port of the system +
+
input_i
+
the ith input to the component
+
causality_i
+
+ the causality (effort or flow) of the + ith input variable (see section + 1.4 Variables) +
+
port_i
+
+ the number (integer) of the ith input + port of the system +
+
+

An example for a resistor with linear constitutive relationship is:

+ + + + + +
+
+rc_1_bond4_flow := lin(flow,r,flow,1,
+        rc_1_bond4_effort,effort,1
+        );
+
+
+ + + + + + +
+ 6.11.0.1 Transformation cbg2ese_m2r +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.11.0.1 Transformation cbg2ese_m2r

+ + This transformation takes the causal bond graph as an m file (see section + 6.10.2 Language m (cbg.m)) and transforms it + into elementary system equations in Reduce (see section + 9.3 Reduce) form. +

+ It is based on the m-function cbg2ese.m which iteratively traverses the + causal bond graph writing equations as it goes. +

+

+ It also writes out the system structure as the file `sys_def.r'. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.12 Differential-Algebraic Equations (dae)

+ +

+ The system differential algebraic equations describe the system dynamics + together together with any algebraic constraints. +

+

+ They are generated in language lang for system + sys by: +

+ + + + + +
+
+mtt sys dae lang
+
+
+ Valid languages are: +
+
r
+
+ reduce (see section + 9.3 Reduce). +
+
m
+
+ m (see section + 9.2 m). +
+
view
+
+ reduce (see section + 10.1 Views). +
+
+

There are five sets of variables describing the system:

+
+
x
+
+ the system states (corresponding to C + and I components with integral causality. +
+
z
+
+ the system nonstates (corresponding to + C and I components with derivative causality. +
+
u
+
+ the system inputs (corresponding to SS + components with external attribute). +
+
ui
+
+ the internal system inputs + (corresponding to SS components with internal attribute) used to solve + algebraic loops (see section + 1.7 Algebraic loops). +
+
y
+
+ the system outputs (corresponding to + SS components with external attribute). +
+
+

+ In general there are four sets of equations. The right-hand side of each + is a function of x, dz/dt, u and ui and the left hand sides are: +

+
    +
  1. the derivative of x (dx/dt)
  2. +
  3. z
  4. +
  5. w=0 (the algebraic equations)
  6. +
  7. y
  8. +
+ + + + + + + + + + + +
+ 6.12.1 Language reduce (dae.r) +
+ 6.12.2 Language m (dae.m) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.12.1 Language reduce (dae.r)

+ +

+ The system DAEs (see section + 6.12 Differential-Algebraic Equations (dae)) + are represented in the reduce (see section + 9.3 Reduce) language as arrays containing + the algebraic expressions for the right hand sides of each set of + equations. The arrays are: +

+
+
MTTx
+
+ x -- the system states (corresponding + to C and I components with integral causality. +
+
MTTz
+
+ z -- the system nonstates + (corresponding to C and I components with derivative causality. +
+
MTTu
+
+ u -- the system inputs (corresponding + to SS components with external attribute). +
+
mttv
+
+ ui -- the internal system + inputs (corresponding to SS components with internal attribute) used to + solve algebraic loops (see section + 1.7 Algebraic loops). +
+
MTTy
+
+ y -- the system outputs (corresponding + to SS components with external attribute). +
+
+ + + + + + +
+ 6.12.1.1 Transformation ese2dae_r +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.12.1.1 Transformation ese2dae_r

+ +

+ This transformation (see section + 1.2 What is a transformation?) uses Reduce + (see section 9.3 Reduce) to combine the + elementary system equations (see section + 6.11 Elementary system equations (ese)) with + the constitutive relationships (see section + 1.6.2 Constitutive relationship) and simplify + the result. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.12.2 Language m (dae.m)

+ + The system DAEs (see section + 6.12 Differential-Algebraic Equations (dae)) + are represented in the m (see section 9.2 m) + language as two m-functions of the form: + + + + + +
+
+function resid = sys_dae(dx,x,t)
+function y  = sys_dae(dx,x,t)
+
+
+ Where x is the dae descriptor vector and dx its time derivative; t + is the time. The first function is of a form suitable for solution by DASSL; + the second function can then be used to find the coresponding system output. + + + + + + +
+ 6.12.2.1 Transformation dae_r2m +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.12.2.1 Transformation dae_r2m

+ +

+ This transformation (see section + 1.2 What is a transformation?) uses Reduce + (see section 9.3 Reduce) to rewrite the + elementary system equations (see section + 6.11 Elementary system equations (ese)) in + m-file format (see section 9.2 m) . + Numerical parameters are declared as global. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.13 Constrained-state Equations (cse)

+ +

+ The system constrained-state equations describe the system dynamics for a + special class of systems (see the book for details). The resuting + equations are of the form: +

+ + + + + +
+
+E(x) dx/dt = f(x,u)
+y = g(x,u)
+
+
+ They typically occure where two or more states are constrained to be equal, + or proportional, to each other. For example, two capacitors in parallel or + two inertias connected by a stiff shaft. +

+ They are generated in language lang for system + sys by: +

+ + + + + +
+
+mtt sys cse lang
+
+
+ Valid languages are: +
+
r
+
+ reduce (see section + 9.3 Reduce). +
+
m
+
+ m (see section + 9.2 m). +
+
view
+
+ reduce (see section + 10.1 Views). +
+
+

There are three sets of variables describing the system:

+
+
x
+
+ the system states (corresponding to C + and I components with integral causality. +
+
u
+
+ the system inputs (corresponding to SS + components with external attribute). +
+
y
+
+ the system outputs (corresponding to + SS components with external attribute). +
+
+

+ In general there are two sets of equations. The right-hand side of each is + a function of x and u and the left hand sides are: +

+
    +
  1. the derivative of x (dx/dt) y
  2. +
+ + + + + + + + + + + +
+ 6.13.1 Language reduce (cse.r) +
+ 6.13.2 Language m (view) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.13.1 Language reduce (cse.r)

+ +

+ The system CSEs (see section + 6.13 Constrained-state Equations (cse)) are + represented in the reduce (see section + 9.3 Reduce) language as arrays containing + the algebraic expressions for the right hand sides of each set of + equations. The arrays are: +

+
+
MTTx
+
+ x -- the system states (corresponding + to C and I components with integral causality. +
+
MTTu
+
+ u -- the system inputs (corresponding + to SS components with external attribute). +
+
MTTy
+
+ y -- the system outputs (corresponding + to SS components with external attribute). +
+
+ together with the array containing the elements of the E matrix. + + + + + + +
+ 6.13.1.1 Transformation dae2cse_r +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.13.1.1 Transformation dae2cse_r

+ +

+ This transformation (see section + 1.2 What is a transformation?) Reduce (see + section 9.3 Reduce) to find various + Jacobians which are combined to find the E matrix and the + constrained-state equations (see section + 6.13 Constrained-state Equations (cse)). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.13.2 Language m (view)

+ + This representation has the standard text view (see section + 10.1 Views). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.14 Ordinary Differential Equations

+ +

+ The system ordinary differential equations describe the system dynamics. +

+

+ They are generated in language lang for system + sys by: +

+ + + + + +
+
+mtt sys ode lang
+
+
+ Valid languages are: +
+
r
+
+ reduce (see section + 9.3 Reduce). +
+
m
+
+ m (see section + 9.2 m). +
+
view
+
+ reduce (see section + 10.1 Views). +
+
+

There are three sets of variables describing the system:

+
+
x
+
+ the system states (corresponding to C + and I components with integral causality. +
+
u
+
+ the system inputs (corresponding to SS + components with external attribute). +
+
y
+
+ the system outputs (corresponding to + SS components with external attribute). +
+
+

+ In general there are two sets of equations. The right-hand side of each is + a function of x and u and the left hand sides are: +

+
    +
  1. the derivative of x (dx/dt) y
  2. +
+ + + + + + + + + + + + + + + + +
+ 6.14.1 Language reduce (ode.r) +
+ 6.14.2 Language m (ode.m) +
+ 6.14.3 Language m (view) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.14.1 Language reduce (ode.r)

+ +

+ The system ODEs (see section + 6.14 Ordinary Differential Equations) are + represented in the reduce (see section + 9.3 Reduce) language as arrays containing + the algebraic expressions for the right hand sides of each set of + equations. The arrays are: +

+
+
MTTx
+
+ x -- the system states (corresponding + to C and I components with integral causality. +
+
MTTu
+
+ u -- the system inputs (corresponding + to SS components with external attribute). +
+
MTTy
+
+ y -- the system outputs (corresponding + to SS components with external attribute). +
+
+ + + + + + +
+ 6.14.1.1 Transformation cse2ode_r +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.14.1.1 Transformation cse2ode_r

+ +

+ This transformation (see section + 1.2 What is a transformation?) uses Reduce + (see section 9.3 Reduce) to invert the E + matrix of the constrained-state equations (see section + 6.13 Constrained-state Equations (cse)) and + simplify the result. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.14.2 Language m (ode.m)

+ + The system ODEs (see section + 6.14 Ordinary Differential Equations) are + represented in the m (see section 9.2 m) + language as two m-functions of the form: + + + + + +
+
+function dx = sys_ODE(x,t)
+function y  = sys_ODE(dx,x,t)
+
+
+ Where x is the ODE state vector and dx its time derivative; t is + the time. The first function is of a form suitable for solution by odesol; + the second function can then be used to find the corresponding system + output. + + + + + + +
+ 6.14.2.1 Transformation ode_r2m +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.14.2.1 Transformation ode_r2m

+ +

+ This transformation (see section + 1.2 What is a transformation?) uses Reduce + (see section 9.3 Reduce) to rewrite the + ordinary differential equations (see section + 6.14 Ordinary Differential Equations) in + m-file format (see section 9.2 m) . + Numerical parameters are declared as global. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.14.3 Language m (view)

+ + This representation has the standard text view (see section + 10.1 Views). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.15 Descriptor matrices (dm)

+ +

+ The system descriptor matrices A, B, C, D and E describe the + linearised system dynamics in the form +

+ + + + + +
+
+E dx/dt = Ax + Bu
+y = Cx + Du
+
+
+

+ They are generated in language lang for system + sys by: +

+ + + + + +
+
+mtt sys dm lang
+
+
+ Valid languages are: +
+
r
+
+ reduce (see section + 9.3 Reduce). +
+
m
+
+ m (see section + 9.2 m). +
+
view
+
+ reduce (see section + 10.1 Views). +
+
+ + + + + + + + + + + +
+ 6.15.1 Language reduce (dm.r) +
+ 6.15.2 Language m (dm.m) +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.15.1 Language reduce (dm.r)

+ +

+ The system descriptor matrices (see section + 6.15 Descriptor matrices (dm)) are + represented in the reduce (see section + 9.3 Reduce) language as arrays containing + the four matrices. The arrays are: +

+
+
MTTA
+
A
+
MTTB
+
B
+
MTTA
+
C
+
MTTD
+
D
+
MTTE
+
E
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.15.2 Language m (dm.m)

+ + The system descriptor matrices (see section + 6.15 Descriptor matrices (dm)) are represented + in the m (see section 9.2 m) language as an + m-function of the form: + + + + + +
+
+function [A,B,C,D,E] = sys_dm
+
+
+

+ System numeric parameters (see section + 1.6.4 Numeric parameters) are passed via + global variables defined in the _numpar.m file. Thus the system descriptor + matrices are typically generated in Octave (see section + 10.4 Octave) as follows: +

+ + + + + +
+
+sys_numpar
+[A,B,C,D,E] = sys_dm
+
+
+

+ Parameters can be changed from their default values by entering their + values directly into Octave (see section + 10.4 Octave) and then invoking + sys_dm; for example +

+ + + + + +
+
+sys_numpar
+par_1 = 25
+par_2 = par_1 + 3
+[A,B,C,D,E] = sys_dm
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.16 Report (rep)

+ +

+ MTT has a report-generator feature. The user specifies + the report contents in a text file (see section + 6.16.1 Language text (rep.txt)) using an + appropriate text editor (see section + 10.3 Text editors). +

+

For example, the report can be viewed by typing

+ + + + + +
+
+mtt system rep view
+
+
+ + + + + + + + + + + +
+ 6.16.1 Language text (rep.txt) +
+ 6.16.2 Language view +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.16.1 Language text (rep.txt)

+ +

+ The user specifies the report contents in a text file (see section + 6.16.1 Language text (rep.txt)) using an + appropriate text editor (see section + 10.3 Text editors). The text file contains + lines which are either comments (indicated by %) or valid + MTT commands. The report will then contain appropriate + sections. The following languages are supported by the report generator: +

+
+
m
+
+ octave a high-level + interactive language for numerical computation. +
+
r
+
+ reduce a high-level + interactive language for symbolic computation. +
+
tex
+
+ latex a text processor. +
+
ps
+
+ ghostview another + document viewer. +
+
c
+
gcc a c compiler.
+
+ For example: + + + + + +
+
+mtt rc abg tex
+mtt rc cbg ps
+mtt rc struc tex
+mtt rc ode tex
+mtt rc sro ps
+mtt rc tf tex
+mtt rc lmfr ps
+
+
+

+ The acausal bond graph (abg) (see section + 6.4 Acausal bond graph (abg)) with the tex + language is handled in a special way: the acausal Bond Graph in fig format + (see section 6.4.1 Language fig (abg.fig)), + the label file (see section 6.6 Labels (lbl)) + the description file (see section + 8.2.2 Detailed on-line documentation), + together with corresponding subsystems are included in the report. It is + recommended that the first (non-comment line) in the file should be: +

+ + + + + +
+
+mtt <system> abg tex
+
+
+ where <system> is the name of the (top-level) system. +

+ As usual, MTT provides a default text file to be edited + by the user (see section 10.3 Text editors). +

+

+ In the special case that the first argument to mtt (normally the system) + is a directory, a default text file is provided which generates a report + for all systems to be found in that directory tree. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

6.16.2 Language view

+ + This representation has the standard text view (see section + 10.1 Views). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

7. Extending MTT

+ +

+ MTT has a number of built-in mechanisms for the user to + extend its capabilities. As MTT is based on `Make' it is + unsurprising that some of these involve the creation of `make files'. +

+ + + + + + + + + + + + + + + + +
+ 7.1 Makefiles +
+ 7.2 New (DIY) representations +
+ 7.3 Component library +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

7.1 Makefiles

+ +

+ If a file called `Makefile' exists in the current directory, + MTT executes it using make before doing anything else. + This is useful if one of the .txt files contains a reference to, for + example, an octave function of which MTT unaware. Such a + function can be created using the makefile. An example `Makefile' is +

+ + + + + +
+
+# Makefile for the Two link GMV example
+
+all: msdP_tf.m TwoLinkP_obs.m TwoLinkP_sm.m twolinkp_sm.m TwoLinkGMV_numpar.m
+
+msdP_tf.m: msdP_abg.fig
+        mtt -q msdP tf m
+
+TwoLinkP_obs.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt
+        mtt -q TwoLinkP obs m
+
+TwoLinkP_sm.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt
+        mtt -q TwoLinkP sm m
+
+twolinkp_sm.m: TwoLinkP_sm.m
+        cp -v TwoLinkP_sm.m twolinkp_sm.m
+
+TwoLinkGMV_numpar.m: TwoLinkGMV_numpar.txt
+        mtt -q TwoLinkGMV numpar m
+
+
+ All of the files in the line stating `all:' are created when + MTT is executed (if they don't already exist). +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

7.2 New (DIY) representations

+ +

+ It may be convenient to create new representations for + MTT; in particular, it is nice to be able to include the + result of some numerical or symbolic computations within an + MTT report (see section + 6.16 Report (rep)). Therefore + MTT provides a mechanism for doing this. +

+

+ Future extensions of MTT will use such representations + stored in $MTT_REP. +

+

There are three parts to creating a DIY representation called myrep

+
    +
  1. Creating a make file in Make format called myrep_rep.make
  2. +
  3. Optionally creating a shell script called myrep_rep.sh
  4. +
  5. + Optionally creating a documentation file in LaTeX format called + myrep_rep.tex +
  6. +
+ + + + + + + + + + + + + + + + +
+ 7.2.1 Makefile +
+ 7.2.2 Shell-script +
+ 7.2.3 Documentation +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

7.2.1 Makefile

+ +

+ To create a new representation `myrep' in a language `mylang', create a + file with the name +

+ + + + + +
+
+myrep_rep.make
+
+
+ This file must contain text in `make' syntax. It is executed by + MTT and the two arguments `SYS' (the system name) and + `LANG' (the language) are passed to it by MTT. Note that + MTT cannot know of any prerequisites, but these can be + explicitly included in the makefile (which may include execution of + MTT itself. +

+ The following example declares the new representation `ident' which is + created in conjunction with the shell-script ident_rep.sh (see section + 7.2.2 Shell-script). +

+

@verbatim # -*-makefile-*-

+

+ #SUMMARY Identification #DESCRIPTION Partially know system identification + using #DESCRIPTION using bond graphs +

+

# Makefile for representation ident # File ident_rep.make

+

#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop

+

+ ## Model targets model_reps = ${SYS}_sympar.m ${SYS}_simpar.m + ${SYS}_state.m model_reps += ${SYS}_numpar.m ${SYS}_input.m + ${SYS}_ode2odes.m model_reps += ${SYS}_def.m +

+

+ ## Prepend s to get the sensitivity targets sensitivity_reps = + ${model_reps:%=s%} +

+

+ ## Model prerequisites model_pre = ${SYS}_abg.fig ${SYS}_lbl.txt model_pre + += ${SYS}_rdae.r ${SYS}_numpar.txt +

+

+ ## Prepend s to get the sensitivity targets sensitivity_pre = + ${model_pre:%=s%} +

+

## Simulation targets sims = ${SYS}_sim.m s${SYS}_ssim.m

+

+ ## m-files needed for ident ident_m = ${SYS}_ident.m ${SYS}_ident_numpar.m +

+

+ ## Targets for the ident simulation ident_reps = ${ident_m} ${sims} + ${model_reps} ${sensitivity_reps} +

+

+ ## ps output files etc psfiles = ${SYS}_ident.ps + ${SYS}_ident.comparison.ps figfiles = ${psfiles:%.ps=%.fig} gdatfiles = + ${psfiles:%.ps=%.gdat} datfiles = ${psfiles:%.ps=%.dat2} +

+

## LaTeX files etc latexfiles = ${SYS}_ident_par.tex

+

all: ${SYS}_ident.${LANG}

+

+ echo: echo "sims: ${sims}" echo "model_reps: ${model_reps}" echo + "sensitivity_reps: ${sensitivity_reps}" echo "ident_reps: ${ident_reps}" +

+

${SYS}_ident.view: ${psfiles} ident_rep.sh ${SYS} view

+

${psfiles}: ${figfiles} ident_rep.sh ${SYS} ps

+

${figfiles}: ${gdatfiles} ident_rep.sh ${SYS} fig

+

${gdatfiles}: ${datfiles} ident_rep.sh ${SYS} gdat

+

${datfiles} ${latexfiles}: ${ident_reps} ident_rep.sh ${SYS} dat2

+

${SYS}_ident.m: ident_rep.sh ${SYS} m

+

${SYS}_ident_numpar.m: ident_rep.sh ${SYS} numpar.m

+

+ ## System model reps ## Generic txt files ${SYS}_%.txt: mtt ${OPTS} -q + -stdin ${SYS} $* txt +

+

+ ## Specific m files ${SYS}_ode2odes.m: ${model_pre} mtt -q -stdin ${OPTS} + ${SYS} ode2odes m +

+

${SYS}_sim.m: ${SYS}_ode2odes.m mtt ${OPTS} -q -stdin ${SYS} sim m

+

## Numpar files ${SYS}_numpar.m: mtt ${SYS} numpar m

+

## Sympar files ${SYS}_sympar.m: mtt ${SYS} sympar m

+

+ ## Generic txt to m ${SYS}_%.m: ${SYS}_%.txt mtt ${OPTS} -q -stdin ${SYS} + $* m +

+

+ ## r files ${SYS}_def.r: ${SYS}_abg.fig mtt ${OPTS} -q -stdin ${SYS} def r +

+

${SYS}_rdae.r: mtt ${OPTS} -q -stdin ${SYS} rdae r

+

+ ## Sensitivity model reps ## Generic txt files s${SYS}_%.txt: mtt ${OPTS} + -q -stdin -s s${SYS} $* txt +

+

+ ## Specific m files ## Numpar files s${SYS}_numpar.m: mtt -s s${SYS} + numpar m +

+

## Sympar files s${SYS}_sympar.m: mtt -s s${SYS} sympar m

+

+ s${SYS}_ode2odes.m: ${sensitivity_pre} mtt -q -stdin ${OPTS} -s s${SYS} + ode2odes m +

+

s${SYS}_ssim.m: mtt -q -stdin ${OPTS} -s s${SYS} ssim m

+

s${SYS}_def.m: mtt -q -stdin ${OPTS} -s s${SYS} def m

+

+ ## Generic txt to m s${SYS}_%.m: s${SYS}_%.txt mtt ${OPTS} -q -stdin + s${SYS} $* m +

+

## r files s${SYS}_rdae.r: mtt ${OPTS} -q -stdin -s s${SYS} rdae r

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

7.2.2 Shell-script

+ +

+ For more complex DIY representations, it is convenient to define new + commands to be used by the Makefile (see section + 7.2.1 Makefile). +

+

+ The following example shows this in the context of the DIY representation + `ident' used as an example in the previous section (see section + 7.2.1 Makefile). +

+

@verbatim #! /bin/sh

+

+ ## ident_rep.sh ## DIY representation "ident" for mtt # Copyright (C) 2002 + by Peter J. Gawthrop +

+

ps=ps

+

sys=$1 rep=ident lang=$2 mtt_parameters=$3 rep_parameters=$4

+

+ ## Some names target=${sys}_${rep}.${lang} def_file=${sys}_def.r + dat2_file=${sys}_ident.dat2 dat2s_file=${sys}_idents.dat2 + ident_numpar_file=${sys}_ident_numpar.m + option_file=${sys}_ident_mtt_options.txt +

+

+ ## Get system information if [ -f "${def_file}" ]; then echo Using + ${def_file} else mtt -q ${sys} def r fi +

+

ny=`mtt_getsize $1 y` nu=`mtt_getsize $1 u`

+

+ check_new_options() { if [ -f "${option_file}" ]; then old_options=`cat + ${option_file}` if [ "${mtt_options}" != "${old_options}" ]; then echo + ${mtt_options} > ${option_file} fi else echo ${mtt_options} > + ${option_file} fi } +

+

+ ## Make the _ident.m file make_ident() { filename=${sys}_${rep}.m + date=`date` echo Creating ${filename} +

+

+ cat > ${filename} <<EOF function [epar,Y] = ${sys}_ident + (y,u,t,par_names,Q,extras) +

+

+ ## usage: [epar,Y] = ${sys}_ident (y,u,t,par_names,Q,extras) ## ## last + last time in run ## ppp_names Column vector of names of ppp params ## + par_names Column vector of names of estimated params ## extras Structure + containing additional info ## ## Created by MTT on ${date} ## Sensitivity + system name system_name = "s${sys}" +

+

+ ##Sanity check if nargin<3 printf("Usage: [y,u,t] = + ${sys}_ident(y,u,t,par_names,Q,extras);"); return endif +

+

+ if nargin<6 ## Set up optional parameters extras.criterion = 1e-3; + extras.emulate_timing = 0; extras.max_iterations = 10; extras.simulate = + 2; extras.v = 1e-2; extras.verbose = 1; extras.visual = 1; endif ## System + info [n_x,n_y,n_u,n_z,n_yz] = ${sys}_def; sympar = ${sys}_sympar; simpar = + ${sys}_simpar; sympars = s${sys}_sympar; simpars = s${sys}_simpar; +

+

## Parameter indices i_par = ppp_indices (par_names,sympar,sympars);

+

## Initial model state x_0 = zeros(2*n_x,1);

+

## Initial model parameters par_0 = s${sys}_numpar;

+

+ ## Reset simulation parameters [n_data,m_data] = size(y); dt = t(2)-t(1); + simpars.last = (n_data-1)*dt; simpars.dt = dt; +

+

+ ## Identification [epar,Par,Error,Y,iterations,x] = + ppp_optimise(system_name,x_0,par_0,simpars,u,y,i_par,Q,extras); ## Do some + plots figure(1); title("Comparison of data"); xlabel("t"); ylabel("y"); + [N,M] = size(Y); plot(t,Y(:,M-n_y+1:M),"1;Estimated;", t,y,"3;Actual;"); + figfig("${sys}_ident_comparison"); +

+

+ ## Create a table of the parameters [n_par,m_par] = size(i_par); fid = + fopen("${sys}_ident_par.tex", "w"); + fprintf(fid,"\\\\begin{table}[htbp]\\n"); fprintf(fid," + \\\\centering\\n"); fprintf(fid," \\\\begin{tabular}{|l|l|}\\n"); + fprintf(fid," \\\\hline\\n"); fprintf(fid," Name & Value \\\\\\\\ + \\n"); fprintf(fid," \\\\hline\\n"); for i = 1:n_par fprintf(fid,"$%s$ + & %4.2f \\\\\\\\ \\n", par_names(i,:), epar(i_par(i,1))); endfor + fprintf(fid," \\\\hline\\n"); fprintf(fid,"\\\\end{tabular}\\n"); + fprintf(fid,"\\\\caption{Estimated Parameters}\\n"); + fprintf(fid,"\\\\end{table}\\n"); fclose(fid); +

+

endfunction EOF }

+

+ make_ident_numpar() { echo Creating ${ident_numpar_file} cat > + ${sys}_ident_numpar.m <<EOF function [y,u,t,par_names,Q,extras] = + ${sys}_ident_numpar; +

+

+ ## usage: [y,u,t,par_names,Q,extras] = ${sys}_ident_numpar; ## Edit for + your own requirements ## Created by MTT on ${date} +

+

+ ## This section sets up the data source ## simulate = 0 Real data (you + supply ${sys}_ident_data.dat) ## simulate = 1 Real data input, simulated + output ## simulate = 2 Unit step input, simulated output simulate = 2; +

+

+ ## System info [n_x,n_y,n_u,n_z,n_yz] = ${sys}_def; simpars = + s${sys}_simpar; +

+

+ ## Access or create data if (simulate<2) # Get the real data if + (exist("${sys}_ident_data.dat")==2) printf("Loading + ${sys}_ident_data.dat\n"); load ${sys}_ident_data.dat else printf("Please + create a loadable file ${sys}_ident_data.dat containing y,u and t\n"); + return endif else switch simulate case 2 # Step simulation t = + [0:simpars.dt:simpars.last]'; u = ones(size(t)); otherwise + error(sprintf("simulate = %i not implemented", simulate)); endswitch endif + if (simulate>0) par = ${sys}_numpar(); x_0 = ${sys}_state(par); dt = + t(2)-t(1); simpars.dt = dt; simpars.last = t(length(t)); y = + ${sys}_sim(zeros(n_x,1), par, simpars, u); endif +

+

+ ## Default parameter names - Put in your own here sympar = ${sys}_sympar; + # Symbolic params as structure par_names = struct_elements (sympar); # + Symbolic params as strings [n,m] = size(par_names); # Size the string list +

+

+ ## Sort by index for [i,name] = sympar par_names(i,:) = + sprintf("%s%s",name, blanks(m-length(name))); endfor ## Output weighting + vector Q = ones(n_y,1); ## Extra parameters extras.criterion = 1e-5; + extras.emulate_timing = 0; extras.max_iterations = 10; extras.simulate = + simulate; extras.v = 1e-2; extras.verbose = 1; extras.visual = 1; +

+

endfunction EOF }

+

make_dat2() {

+

## Inform user echo Creating ${dat2_file}

+

+ ## Use octave to generate the data octave -q <<EOF + [y,u,t,par_names,Q,extras] = ${sys}_ident_numpar; [epar,Y] = ${sys}_ident + (y,u,t,par_names,Q,extras); [N,M] = size(Y); y_est = Y(:,M); data = + [t,y_est,u]; save -ascii ${dat2_file} data EOF +

+

+ ## Tidy up the latex stuff - convert foo_123 to foo_{123} cat + ${sys}_ident_par.tex > mtt_junk sed -e "s/_\([a-z0-9,]*\)/_{\1}/g" < + mtt_junk >${sys}_ident_par.tex rm mtt_junk } +

+

+ case ${lang} in numpar.m) ## Make the numpar stuff make_ident_numpar; ;; + m) ## Make the code make_ident; ;; dat2) ## The dat2 language (output + data) & fig file make_dat2; ;; gdat) cp ${dat2_file} ${dat2s_file} + dat22dat ${sys} ${rep} dat2gdat ${sys} ${rep} ;; fig) gdat2fig + ${sys}_${rep} ;; ps) figs=`ls ${sys}_ident*.fig | sed -e 's/\.fig//'` for + fig in ${figs}; do fig2dev -Leps ${fig}.fig > ${fig}.ps done texs=`ls + ${sys}_ident*.tex | sed -e 's/\.tex//'` for tex in ${texs}; do makedoc "" + "${sys}" "ident_par" "tex" "" "" "$ps" doc2$ps ${sys}_ident_par + "$documenttype" done ;; view) pss=`ls ${sys}_ident*.ps` echo Viewing + ${pss} for ps in ${pss}; do gv ${ps}& done ;; *) echo Language ${lang} + not supported by ${rep} representation exit 3 esac +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

7.2.3 Documentation

+ +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

7.3 Component library

+ +

+ If MTT does not recognise a component (eg named + MyComponent) as a simple component (see section + 6.4.1.5 Simple components) or as already + existing, it searches the library search path $MTT_COMPONENTS (see section + 11.4.2 $MTT_COMPONENTS) for a directory + called MyComponent containing MyComponent_lbl.txt. It then copies the + entire directory into the current working directory. Thus, for + example, the directory could contain MyComponent_desc.tex + MyComponent_abg.fig MyComponent_lbl.txt and MyComponent_cr.r in addition + to MyComponent_lbl.txt. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

8. Documentation

+ + + + + + + + + + + + +
+ 8.1 Manual +
+ 8.2 On-line documentation +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

8.1 Manual

+ +

+ MTT is documented in this manual. The manual can be invoked in various + ways: +

+
+
mtt manual
+
+ Brings up a pdf version of the manual +
+
mtt info
+
+ Brings up an xterm containing an info + version of the manual +
+
mtt hinfo
+
+ Brings up an html browser containing + the manual +
+
emacs
+
+ type ^h^i followed by mmtt in the + command window +
+
browser
+
point browser to mtt.sf.netb
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

8.2 On-line documentation

+ +

+ MTT components, constitutive relations, examples and + representations in libraries (see section + 7.3 Component library) are documented in two + ways: +

+
    +
  1. brief
  2. +
  3. verbose
  4. +
+ + + + + + + + + + + +
+ 8.2.1 Brief on-line documentation +
+ 8.2.2 Detailed on-line documentation +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

8.2.1 Brief on-line documentation

+ +

+ Documentation of DIY components, examples, constitutive relationships and + representations is provides by the programmer by inserting code of the + form +

+ + + + + +
+
+#SUMMARY     One line summary
+#DESCRIPTION Multi-line
+#DESCRIPTION More detailed description
+
+
+

within the appropriate file (usually at or near the top):

+
+
components
+
+ _lbl.txt (see section + 6.6 Labels (lbl)) +
+
examples
+
+ _lbl.txt (see section + 6.6 Labels (lbl)) +
+
+ constitutive relations +
+
+ _cr.r (see section + 6.8.2 DIY constitutive relationships) +
+
representations
+
+ _rep.make (see section + 7.2.1 Makefile) +
+
+

This documentation is accessed by the user in various ways

+
+
mtt help name
+
+ prints basic information on the screen +
+
+ mtt system lbl view +
+
+ gives formatted information about the + component or example +
+
+ + Including mtt system abg tex in the _rep.txt file +
+
+ gives formatted information about the + component or example within the report +
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

8.2.2 Detailed on-line documentation

+ +

+ DIY components, examples, constitutive relationships can be described + textually in LaTeX (.tex) description file; this is the only language for + this representation. This representation is used by the LaTeX language + version (see section + 6.4.4 Language tex (abg.tex)) of the acausal + bond graph representation (see section + 6.4 Acausal bond graph (abg)). +

+

+ The file may contain any LaTeX commands valis for the "article" document + type but must not contain: +

+
    +
  • documentclass commands
  • +
  • document environments
  • +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

9. Languages

+ + + + + + + + + + + + + + + + + + + + + + +
9.1 Figr
9.2 m
+ 9.3 Reduce +
9.4 c
+

+ These are a number of languages used by MTT to implement + the various representations. Each has associated Language tools (see + section 10. Language tools) to manipulate + and/or view the representation. +

+
+
fig
+
+ Fig a graphical + description language. +
+
m
+
+ octave a high-level + interactive language for numerical computation. +
+
r
+
+ reduce a high-level + interactive language for symbolic computation. +
+
tex
+
+ latex a text processor. +
+
dvi
+
+ xdvi a document viewer. +
+
ps
+
+ ghostview another + document viewer. +
+
gdat
+
+ gnuplot a data viewer. +
+
c
+
gcc a c compiler.
+
sg
+
+ scigraphica a plotting + package. +
+
+

+ These tools are automatically invoked as appropriate by + MTT; but for more advanced use, these tools can be used + directly on files (with the appropriate suffix) generated by + MTT. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

9.1 Fig

+ + Please see xfig documentation. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

9.2 m

+ + Please see Octave documentation <A + HREF="http://www.che.wisc.edu/octave/">Octave</A> documentation. + <A HREF="http://www.mathworks.com/homepage.html">Matlab</A> + documentation. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

9.3 Reduce

+ + Please see the reduce documentation. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

9.4 c

+ + Please see the gcc documentation. +
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10. Language tools

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 10.1 Views +
+ 10.2 Xfig +
+ 10.3 Text editors +
+ 10.4 Octave +
+ 10.5 LaTeX +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.1 Views

+ +

+ A number of representations (see section + 6. Representations) have a language + representation which is particularly useful for viewing by the user. These + views are invoked, where appropriate by the command: +

+ + + + + +
+
+mtt sys rep view
+
+
+ where sys is the system name and rep a + corresponding representation. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.2 Xfig

+ +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.3 Text editors

+ + All representations live in text files and thus may be edited using your + favourite text editor; however, the Fig (see section + 9.1 Fig) representation is pretty meaningless + in this form and so you should use Xfig (see section + 10.2 Xfig) for representation in this + language. +

+ Its up to you which text editor to use. I recommend emacs, but simpler + (and less powerful) editors such as xedit, textedit and vi are also ok. +

+

+ I usually run MTT out of an emacs shell window and keep + the rest of the files in emacs buffers. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.4 Octave

+ +

+ Octave is a numerical matrix-based language See section `Octave' in + Octave. It is similar to Matlab in many ways. In most cases, + m-files generated by MTT can be understood by both Matlab + and Octave (and no doubt other Matlab lookalikes). +

+

+ MTT provides the octave function mtt. The + octave command +

+ + + + + +
+
+help mtt
+
+
+ gives the following information: + + + + + +
+
+ usage:  mtt (system[,representation,language])
+
+ Invokes mtt from octave to generate system_representation.language
+ Ie equivalent to "mtt system representation language" at the shell
+ Representation and language defualt to "sm" and "m" respectively
+
+
+
+

+ Thus for example, if octave is in the directory containing the system rc + the following session generates the state matrices of the system "rc" with + the defaut capacitance but resitance r=0.1. +

+ + + + + +
+
+octave> mtt("rc");
+Creating rc_rbg.m
+Creating rc_cmp.m
+Creating rc_fig.fig
+Creating rc_sabg.fig
+Creating rc_alias.txt
+Creating rc_alias.m
+Creating rc_sub.sh
+Creating rc_abg.m
+Creating rc_cbg.m (maximise integral causality)
+Creating rc_type.sh
+Creating rc_ese.r
+Creating rc_def.r
+Creating rc_struc.txt
+Creating rc_rdae.r
+Creating rc_subs.r
+Creating rc_cr.txt
+Creating rc_cr.r
+Copying CR SS to here from
+Copying CR lin to here from
+Creating rc_dae.r
+Creating rc_sympar.txt
+Creating rc_sympar.r
+Creating rc_cse.r
+Creating rc_sspar.r
+Creating rc_csm.r
+Creating rc_ode.r
+Creating rc_ss.r
+Creating rc_sm.r
+Creating rc_switch.txt
+0 switches found
+Creating rc_sympars.txt
+Creating rc_sm.m
+Copying rc_sm.m
+octave> mtt("rc","numpar");
+Creating rc_numpar.txt
+Creating rc_numpar.m
+Copying rc_numpar.m
+octave> mtt("rc","sympar");
+Creating rc_sympar.m
+Copying rc_sympar.m
+octave> par = rc_numpar
+par =
+
+  1
+  1
+
+octave> sym = rc_sympar;
+
+octave> par(sym.r) = 0.1;
+octave> [A,B,C,D] = rc_sm(par)
+A = -10
+
+B = 10
+
+C = 1
+
+D = 0
+
+octave>
+
+
+ generates the data structure rc corresponding the the bond graph of the + system called `rc'. The following octave commands then generate the step + reponse and bode diagram respectively: + + + + + +
+
+step(rc);
+bode(rc);
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+ 10.4.1 Octave control system toolbox (OCST) +
+ 10.4.2 Creating GNU Octave .oct files +
+ 10.4.3 Creating Matlab .mex files +
+ 10.4.4 Embedding MTT models in Simulink +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.4.1 Octave control system toolbox (OCST)

+ +

+ MTT provides an interface to the Octave control system + toolbox (OCST) using the mfile mtt2sys. the octave command +

+ + + + + +
+
+help mtt2sys
+
+
+ gives the following information. + + + + + +
+
+ usage:  sys = mtt2sys (Name[,par])
+
+ Creates a sys structure for the Octave Control Systems Toolbox
+ from an MTT system with name "Name"
+ Optional second argument is system parameter list
+ Assumes that Name_sm.m, Name_struc.m and Name_numpar.m exist
+
+
+

+ Thus for example, if octave is in the directory containing the system rc: +

+ + + + + +
+
+rc = mtt2sys("rc");
+
+
+ generates the data structure rc corresponding the the bond graph of the + system called `rc'. The following octave commands then generate the step + reponse and bode diagram respectively: + + + + + +
+
+step(rc);
+bode(rc);
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.4.2 Creating GNU Octave .oct files

+ +

+ GNU Octave dynamically loaded functions (.oct files) can be created by + instructing MTT to create the "oct" representation: +

+ + + + + +
+
+  mtt [options] sys ode oct
+
+
+

+ This will cause MTT to create the C++ representation of + the system (sys_ode.cc) and to then compile it as a shared object suitable + for use within Octave. The resultant file may be used in an identical + manner to the equivalent, but generally slower, interpreted .m file. +

+

+ Usage information for the function may be obtained within Octave in the + usual manner: +

+ + + + + +
+
+  octave:1> help rc_ode
+
+  rc_ode is the dynamically-linked function from the file
+  /home/mttuser/rc/rc_ode.oct
+
+  Usage: [mttdx] = rc_ode(mttx,mttu,mttt,mttpar)
+  Octave ode representation of system rc
+  Generated by MTT on Fri Jul  5 11:23:08 BST 2002
+
+
+

+ Note that the first line of output from Octave identifies whether the + compiled or interpreted function is being used. +

+

+ Alternatively, standard representations may be generated using the Octave + DLDs by use of the "-oct" switch: +

+ + + + + +
+
+  mtt -oct rc odeso view
+
+
+

+ In order to successfully generate .oct files, Octave must be correctly + configured prior to compilation and certain headers and libraries must be + correctly installed on the system (see section + 11.3.2 .oct file dependencies). +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.4.3 Creating Matlab .mex files

+ +

+ On GNU/Linux systems, Matlab dynamically linked executables (.mexglx + files) can created by instructing MTT to create the + "mexglx" representation: +

+ + + + + +
+
+  mtt [options] sys ode mexglx
+
+
+

+ This will cause MTT to create the C++ representation of + the system (sys_ode.cc) and to then compile it as a shared object suitable + for use within Matlab. +

+

+ If it is necessary to compile mex files for another platform, then the + usual C++ representation (generated with the -cc flag) can be created and + the resultant file compiled with the -DCODEGENTARGET=MATLABMEX flag on the + target platform. +

+ + + + + +
+
+  mtt_machine:
+  mtt -cc rc ode cc
+
+  matlab_machine:
+  matlab> mex -DCODEGENTARGET=MATLABMEX rc_ode.cc
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.4.4 Embedding MTT models in Simulink

+ +

+ It is possible to embed MTT functions or entire + MTT models within Simulink simulations as Sfun blocks. If + the zip package is installed on the system, the command +

+ + + + + +
+
+  mtt sys sfun zip
+
+
+

+ will create a compressed archive containing sys.mdl, which may be embedded + into a larger Simulink model. Also contained within the archive will be + four sys_sfun*.c files, +

+
    +
  • sys_sfun.c model state and output equations
  • +
  • sys_sfun_ae.c model algebraic equations
  • +
  • sys_sfun_input.c model inputs
  • +
  • sys_sfun_interface.c interface between MTT model and Simulink
  • +
+

+ The last of these files must be edited to correctly map the inputs and + outputs between the MTT and Simulink models. The two + sections to edit are clearly marked with +

+ + + + + +
+
  /* Start EDIT */
+  ....
+  /* End EDIT */
+
+
+

+ These four files should then be compiled with the Matlab "mex" compiler as + described in the README file in the archive. +

+

+ If it is desired to compile the .mex files directly from within + MTT on a machine which has the Matlab header files + installed, this may be done with the command +

+ + + + + +
+
+  mtt sys sfun mexglx
+
+
+

+ which will generated the four .mex files and the .mdl file. In this case, + the user must ensure that sys_sfun_interface.c has been correctly + edited prior to compilation. +

+

+ Note that solution of algebraic equations within Simulink is not possible + unless the Matlab Optimisation Toolbox is installed. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

10.5 LaTeX

+ +

+ LaTeX is a powerful text processor which MTT uses to + provide visual output. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11. Administration

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 11.1 Software components +
+ 11.2 REDUCE setup +
+ 11.3 Octave setup +
+ 11.4 Paths +
+ 11.5 File structure +
+ A.1 GNU Free Documentation License +
+ A.2 GNU GENERAL PUBLIC LICENSE +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.1 Software components

+ +

+ MTT is built from a set of readily-available software + tools. These are: +

+ +

+ The General purpose tools are (these will all be available with a standard + Linux distribution): +

+
+
sh
+
Bourne shell
+
gmake
+
Gnu make
+
gawk
+
Gnu awk
+
sed
+
Gnu sed
+
grep
+
Gnu grep
+
comm
+
+ Gnu Compare sorted files by line +
+
xfig
+
+ Figure editor, version 3 or greater. +
+
fig2dev
+
+ Fig file conversion, version 3 or + greater. +
+
ghostview
+
postscript viewer
+
xdvi
+
dvi viewer
+
dvips
+
dvi to postscript conversion
+
latex
+
+ the text processor (LaTeX2e needed) +
+
latex2html
+
converts latex to html
+
perl
+
needed for latex2html
+
gnuplot
+
a graph plotting program
+
gnuscape
+
+ or other web/html browser such as + netscape, Red Baron etc. +
+
gcc
+
GNU c compiler
+
+

+ <A HREF="http://home.pages.de/~GNU/">GNU</A> documentation. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.2 REDUCE setup

+ +

+ Symbolic algebra is performed by REDUCE, which although not free software + is the the result of international collaboration. The version I use is + obtained from: +

+
ZIB ( http://www.zib.de )
+ <A HREF="http://www.rrz.uni-koeln.de/REDUCE/">REDUCE</A> + documentation. <A HREF="http://www.zib.de">ZIB</A> + documentation. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.3 Octave setup

+ +

+ Octave is available at various web sites including: + http://www.octave.org +

+ + + + + + + + + + + +
+ 11.3.1 .octaverc +
+ 11.3.2 .oct file dependencies +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.3.1 .octaverc

+ +

The `.octaverc' file should contain the following lines:

+ + + + + +
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Startup file for Octave for use with MTT
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+implicit_str_to_num_ok = 1;
+empty_list_elements_ok = 1;
+
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.3.2 .oct file dependencies

+ + Successful compilation of .oct code requires that Octave has been configured + to use dynamically linked libraries and that the Octave libraries + liboctave, libcruft and + liboctinterp are available on the system. +

+ This can be acheived by compiling Octave from the source code, configured + with the options --enable-shared and + --enable-dl. +

+

+ A number of additional libraries and headers are also required to be + installed on a system. These include, +

+
    +
  • ncurses and readline terminal control routines
  • +
  • + blas or altas basic linear algebra subprograms, + usually optimised for the specific processor +
  • +
  • fftw fast Fourier transform routines
  • +
  • g2c GNU Fortran to C conversion routines
  • +
  • kpathsea TeX path search routines
  • +
+

+ Note that on many GNU/Linux distributions, the necessary headers are + contained in development packages which must be installed in addition to + the standard library package. +

+

+ Further information on configuring and installing Octave to handle dynamic + libraries (DLDs) can be found in the + Octave documentation. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.4 Paths

+ +

+ There are a number of paths that must be set correctely for + MTT to work. These are normally set up by sourcing the + file mttrc that lives in the MTT home + directory. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 11.4.1 $MTTPATH +
+ 11.4.2 $MTT_COMPONENTS +
+ 11.4.3 $MTT_CRS +
+ 11.4.4 $MTT_EXAMPLES +
+ 11.4.5 $OCTAVE_PATH +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.4.1 $MTTPATH

+ + The environment variable $MTTPATH points to the mtt home directory. This is + usually /usr/local/lib/mtt. +

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.4.2 $MTT_COMPONENTS

+ + The environment variable $MTT_COMPONENTS is a colon-separated path pointing + to directories containing components and subsystems. By default + + + + + +
+
+MTT_COMPONENTS=.:$MTT_LIB/lib/comp/
+
+
+ but you may wish to add your own component libraries: + + + + + +
+
+MTT_COMPONENTS=my_library_path:$MTT_COMPONENTS
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.4.3 $MTT_CRS

+ + The environment variable $MTT_CRS is a colon-separated path pointing to + directories containing constitutive relationships. By default + + + + + +
+
+MTT_CRS=$MTTPATH/lib/cr
+
+
+ but you may wish to add your own component libraries: + + + + + +
+
+MTT_CRS=my_cr_path:$MTT_CRS
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.4.4 $MTT_EXAMPLES

+ + The environment variable $MTT_EXAMPLES is a colon-separated path pointing to + directories containing EXAMPLES and subsystems. By default + + + + + +
+
+MTT_EXAMPLES=$MTTPATH/lib/examples
+
+
+ but you may wish to add your own component libraries: + + + + + +
+
+MTT_EXAMPLES=my_examples_path:$MTT_EXAMPLES
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.4.5 $OCTAVE_PATH

+ +

+ The $OCTAVE_PATH path must include the relevant paths for mtt + to work properly. In particular, it must include: +

+ + + + + +
+
+$MTTPATH/trans/m
+$MTTPATH/lib/comp/simple
+$MTTPATH/lib/comp/compound
+
+
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

11.5 File structure

+ + The recommended installation of MTT uses the following + directory structure with corresponding contents. Normally, each of the + listed directories is a subdirectory of `/usr/local'. The directory + mtt is pointed to by $MTTPATH (see section + 11.4.1 $MTTPATH). +
+
`mtt/bin'
+
+ This is the home directory for + MTT. MTT itself lives here along with + `mttrc'. +
+
`mtt/bin/trans'
+
+ The transformations executed by + MTT. +
+
`mtt/bin/trans/m'
+
+ The m-files associated + with the transformations. +
+
`mtt/bin/trans/awk'
+
+ The awk scripts + associated with the transformations. +
+
`mtt/lib'
+
+ The place for components, examples and + CRs which will be updated. +
+
`mtt/lib/comp/simple'
+
+ The + m-files defining the simple components. + +
+
+ `mtt/lib/comp/compound' +
+
+ The m-files defining the + compound components. +
+
`mtt/lib/cr/r'
+
+ constitutive relationship definitions +
+
`mtt/lib/examples'
+
Some examples.
+
+ `mtt/examples/metamodelling' +
+
Examples from the book.
+
`mtt/doc'
+
+ The documentation files for + MTT. +
+
`mtt/doc/Examples'
+
+ Examples used in the documentation. +
+
+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

A. Legal stuff

+ + +
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

A.1 GNU Free Documentation License

+ +

+
Version 1.2, November 2002
+ + + + + +
+
+Copyright © 2000,2001,2002 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+
+
    +
  1. + PREAMBLE +

    + The purpose of this License is to make a manual, textbook, or other + functional and useful document free in the sense of freedom: + to assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or noncommercially. + Secondarily, this License preserves for the author and publisher a way + to get credit for their work, while not being considered responsible + for modifications made by others. +

    +

    + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. It + complements the GNU General Public License, which is a copyleft + license designed for free software. +

    +

    + We have designed this License in order to use it for manuals for free + software, because free software needs free documentation: a free + program should come with manuals providing the same freedoms that the + software does. But this License is not limited to software manuals; it + can be used for any textual work, regardless of subject matter or + whether it is published as a printed book. We recommend this License + principally for works whose purpose is instruction or reference. +

    +
  2. +
  3. + APPLICABILITY AND DEFINITIONS +

    + This License applies to any manual or other work, in any medium, that + contains a notice placed by the copyright holder saying it can be + distributed under the terms of this License. Such a notice grants a + world-wide, royalty-free license, unlimited in duration, to use that + work under the conditions stated herein. The "Document", below, refers + to any such manual or work. Any member of the public is a licensee, + and is addressed as "you". You accept the license if you copy, modify + or distribute the work in a way requiring permission under copyright + law. +

    +

    + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. +

    +

    + A "Secondary Section" is a named appendix or a front-matter section of + the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could fall + directly within that overall subject. (Thus, if the Document is in + part a textbook of mathematics, a Secondary Section may not explain + any mathematics.) The relationship could be a matter of historical + connection with the subject or with related matters, or of legal, + commercial, philosophical, ethical or political position regarding + them. +

    +

    + The "Invariant Sections" are certain Secondary Sections whose titles + are designated, as being those of Invariant Sections, in the notice + that says that the Document is released under this License. If a + section does not fit the above definition of Secondary then it is not + allowed to be designated as Invariant. The Document may contain zero + Invariant Sections. If the Document does not identify any Invariant + Sections then there are none. +

    +

    + The "Cover Texts" are certain short passages of text that are listed, + as Front-Cover Texts or Back-Cover Texts, in the notice that says that + the Document is released under this License. A Front-Cover Text may be + at most 5 words, and a Back-Cover Text may be at most 25 words. +

    +

    + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed of + pixels) generic paint programs or (for drawings) some widely available + drawing editor, and that is suitable for input to text formatters or + for automatic translation to a variety of formats suitable for input + to text formatters. A copy made in an otherwise Transparent file + format whose markup, or absence of markup, has been arranged to thwart + or discourage subsequent modification by readers is not Transparent. + An image format is not Transparent if used for any substantial amount + of text. A copy that is not "Transparent" is called "Opaque". +

    +

    + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a + publicly available DTD, and + standard-conforming simple HTML, PostScript or + PDF designed for human modification. Examples + of transparent image formats include PNG, + XCF and JPG. Opaque + formats include proprietary formats that can be read and edited only + by proprietary word processors, SGML or + XML for which the + DTD and/or processing tools are not generally + available, and the machine-generated HTML, + PostScript or PDF produced by some word + processors for output purposes only. +

    +

    + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the material + this License requires to appear in the title page. For works in + formats which do not have any title page as such, "Title Page" means + the text near the most prominent appearance of the work's title, + preceding the beginning of the body of the text. +

    +

    + A section "Entitled XYZ" means a named subunit of the Document whose + title either is precisely XYZ or contains XYZ in parentheses following + text that translates XYZ in another language. (Here XYZ stands for a + specific section name mentioned below, such as "Acknowledgements", + "Dedications", "Endorsements", or "History".) To "Preserve the Title" + of such a section when you modify the Document means that it remains a + section "Entitled XYZ" according to this definition. +

    +

    + The Document may include Warranty Disclaimers next to the notice which + states that this License applies to the Document. These Warranty + Disclaimers are considered to be included by reference in this + License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and has + no effect on the meaning of this License. +

    +
  4. +
  5. + VERBATIM COPYING +

    + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License applies + to the Document are reproduced in all copies, and that you add no + other conditions whatsoever to those of this License. You may not use + technical measures to obstruct or control the reading or further + copying of the copies you make or distribute. However, you may accept + compensation in exchange for copies. If you distribute a large enough + number of copies you must also follow the conditions in section 3. +

    +

    + You may also lend copies, under the same conditions stated above, and + you may publicly display copies. +

    +
  6. +
  7. + COPYING IN QUANTITY +

    + If you publish printed copies (or copies in media that commonly have + printed covers) of the Document, numbering more than 100, and the + Document's license notice requires Cover Texts, you must enclose the + copies in covers that carry, clearly and legibly, all these Cover + Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on + the back cover. Both covers must also clearly and legibly identify you + as the publisher of these copies. The front cover must present the + full title with all words of the title equally prominent and visible. + You may add other material on the covers in addition. Copying with + changes limited to the covers, as long as they preserve the title of + the Document and satisfy these conditions, can be treated as verbatim + copying in other respects. +

    +

    + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto adjacent + pages. +

    +

    + If you publish or distribute Opaque copies of the Document numbering + more than 100, you must either include a machine-readable Transparent + copy along with each Opaque copy, or state in or with each Opaque copy + a computer-network location from which the general network-using + public has access to download using public-standard network protocols + a complete Transparent copy of the Document, free of added material. + If you use the latter option, you must take reasonably prudent steps, + when you begin distribution of Opaque copies in quantity, to ensure + that this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you distribute an + Opaque copy (directly or through your agents or retailers) of that + edition to the public. +

    +

    + It is requested, but not required, that you contact the authors of the + Document well before redistributing any large number of copies, to + give them a chance to provide you with an updated version of the + Document. +

    +
  8. +
  9. + MODIFICATIONS +

    + You may copy and distribute a Modified Version of the Document under + the conditions of sections 2 and 3 above, provided that you release + the Modified Version under precisely this License, with the Modified + Version filling the role of the Document, thus licensing distribution + and modification of the Modified Version to whoever possesses a copy + of it. In addition, you must do these things in the Modified Version: +

    +
      +
    1. + Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +
    2. +
    3. + List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +
    4. +
    5. + State on the Title page the name of the publisher of the Modified + Version, as the publisher. +
    6. +
    7. Preserve all the copyright notices of the Document.
    8. +
    9. + Add an appropriate copyright notice for your modifications adjacent + to the other copyright notices. +
    10. +
    11. + Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +
    12. +
    13. + Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +
    14. +
    15. Include an unaltered copy of this License.
    16. +
    17. + Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +
    18. +
    19. + Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions it + was based on. These may be placed in the "History" section. You may + omit a network location for a work that was published at least four + years before the Document itself, or if the original publisher of + the version it refers to gives permission. +
    20. +
    21. + For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +
    22. +
    23. + Preserve all the Invariant Sections of the Document, unaltered in + their text and in their titles. Section numbers or the equivalent + are not considered part of the section titles. +
    24. +
    25. + Delete any section Entitled "Endorsements". Such a section may not + be included in the Modified Version. +
    26. +
    27. + Do not retitle any existing section to be Entitled "Endorsements" or + to conflict in title with any Invariant Section. +
    28. +
    29. Preserve any Warranty Disclaimers.
    30. +
    +

    + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no material + copied from the Document, you may at your option designate some or all + of these sections as invariant. To do this, add their titles to the + list of Invariant Sections in the Modified Version's license notice. + These titles must be distinct from any other section titles. +

    +

    + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text has + been approved by an organization as the authoritative definition of a + standard. +

    +

    + You may add a passage of up to five words as a Front-Cover Text, and a + passage of up to 25 words as a Back-Cover Text, to the end of the list + of Cover Texts in the Modified Version. Only one passage of + Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document already + includes a cover text for the same cover, previously added by you or + by arrangement made by the same entity you are acting on behalf of, + you may not add another; but you may replace the old one, on explicit + permission from the previous publisher that added the old one. +

    +

    + The author(s) and publisher(s) of the Document do not by this License + give permission to use their names for publicity for or to assert or + imply endorsement of any Modified Version. +

    +
  10. +
  11. + COMBINING DOCUMENTS +

    + You may combine the Document with other documents released under this + License, under the terms defined in section 4 above for modified + versions, provided that you include in the combination all of the + Invariant Sections of all of the original documents, unmodified, and + list them all as Invariant Sections of your combined work in its + license notice, and that you preserve all their Warranty Disclaimers. +

    +

    + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name but + different contents, make the title of each such section unique by + adding at the end of it, in parentheses, the name of the original + author or publisher of that section if known, or else a unique number. + Make the same adjustment to the section titles in the list of + Invariant Sections in the license notice of the combined work. +

    +

    + In the combination, you must combine any sections Entitled "History" + in the various original documents, forming one section Entitled + "History"; likewise combine any sections Entitled "Acknowledgements", + and any sections Entitled "Dedications". You must delete all sections + Entitled "Endorsements." +

    +
  12. +
  13. + COLLECTIONS OF DOCUMENTS +

    + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the rules + of this License for verbatim copying of each of the documents in all + other respects. +

    +

    + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert a + copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. +

    +
  14. +
  15. + AGGREGATION WITH INDEPENDENT WORKS +

    + A compilation of the Document or its derivatives with other separate + and independent documents or works, in or on a volume of a storage or + distribution medium, is called an "aggregate" if the copyright + resulting from the compilation is not used to limit the legal rights + of the compilation's users beyond what the individual works permit. + When the Document is included in an aggregate, this License does not + apply to the other works in the aggregate which are not themselves + derivative works of the Document. +

    +

    + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half of + the entire aggregate, the Document's Cover Texts may be placed on + covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic form. + Otherwise they must appear on printed covers that bracket the whole + aggregate. +

    +
  16. +
  17. + TRANSLATION +

    + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section 4. + Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also include + the original English version of this License and the original versions + of those notices and disclaimers. In case of a disagreement between + the translation and the original version of this License or a notice + or disclaimer, the original version will prevail. +

    +

    + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to Preserve + its Title (section 1) will typically require changing the actual + title. +

    +
  18. +
  19. + TERMINATION +

    + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other attempt + to copy, modify, sublicense or distribute the Document is void, and + will automatically terminate your rights under this License. However, + parties who have received copies, or rights, from you under this + License will not have their licenses terminated so long as such + parties remain in full compliance. +

    +
  20. +
  21. + FUTURE REVISIONS OF THIS LICENSE +

    + The Free Software Foundation may publish new, revised versions of the + GNU Free Documentation License from time to time. Such new versions + will be similar in spirit to the present version, but may differ in + detail to address new problems or concerns. See + http://www.gnu.org/copyleft/. +

    +

    + Each version of the License is given a distinguishing version number. + If the Document specifies that a particular numbered version of this + License "or any later version" applies to it, you have the option of + following the terms and conditions either of that specified version or + of any later version that has been published (not as a draft) by the + Free Software Foundation. If the Document does not specify a version + number of this License, you may choose any version ever published (not + as a draft) by the Free Software Foundation. +

    +
  22. +
+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

A.1.1 ADDENDUM: How to use this License for your documents

+ +

+ To use this License in a document you have written, include a copy of the + License in the document and put the following copyright and license + notices just after the title page: +

+ + + + + +
+
  Copyright (C)  year  your name.
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the GNU Free Documentation License, Version 1.2
+  or any later version published by the Free Software Foundation;
+  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+  Texts.  A copy of the license is included in the section entitled ``GNU
+  Free Documentation License''.
+
+
+

+ If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, + replace the "with...Texts." line with this: +

+ + + + + +
+
    with the Invariant Sections being list their titles, with
+    the Front-Cover Texts being list, and with the Back-Cover Texts
+    being list.
+
+
+

+ If you have Invariant Sections without Cover Texts, or some other + combination of the three, merge those two alternatives to suit the + situation. +

+

+ If your document contains nontrivial examples of program code, we + recommend releasing these examples in parallel under your choice of free + software license, such as the GNU General Public License, to permit their + use in free software. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

A.2 GNU GENERAL PUBLIC LICENSE

+ +
Version 2, June 1991
+ + + + + +
+
+Copyright © 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+
+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

A.2.1 Preamble

+ +

+ The licenses for most software are designed to take away your freedom to + share and change it. By contrast, the GNU General Public License is + intended to guarantee your freedom to share and change free software--to + make sure the software is free for all its users. This General Public + License applies to most of the Free Software Foundation's software and to + any other program whose authors commit to using it. (Some other Free + Software Foundation software is covered by the GNU Library General Public + License instead.) You can apply it to your programs, too. +

+

+ When we speak of free software, we are referring to freedom, not price. + Our General Public Licenses are designed to make sure that you have the + freedom to distribute copies of free software (and charge for this service + if you wish), that you receive source code or can get it if you want it, + that you can change the software or use pieces of it in new free programs; + and that you know you can do these things. +

+

+ To protect your rights, we need to make restrictions that forbid anyone to + deny you these rights or to ask you to surrender the rights. These + restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. +

+

+ For example, if you distribute copies of such a program, whether gratis or + for a fee, you must give the recipients all the rights that you have. You + must make sure that they, too, receive or can get the source code. And you + must show them these terms so they know their rights. +

+

+ We protect your rights with two steps: (1) copyright the software, and (2) + offer you this license which gives you legal permission to copy, + distribute and/or modify the software. +

+

+ Also, for each author's protection and ours, we want to make certain that + everyone understands that there is no warranty for this free software. If + the software is modified by someone else and passed on, we want its + recipients to know that what they have is not the original, so that any + problems introduced by others will not reflect on the original authors' + reputations. +

+

+ Finally, any free program is threatened constantly by software patents. We + wish to avoid the danger that redistributors of a free program will + individually obtain patent licenses, in effect making the program + proprietary. To prevent this, we have made it clear that any patent must + be licensed for everyone's free use or not licensed at all. +

+

+ The precise terms and conditions for copying, distribution and + modification follow. +

+
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +
+
    +
  1. + This License applies to any program or other work which contains a + notice placed by the copyright holder saying it may be distributed under + the terms of this General Public License. The "Program", below, refers + to any such program or work, and a "work based on the Program" means + either the Program or any derivative work under copyright law: that is + to say, a work containing the Program or a portion of it, either + verbatim or with modifications and/or translated into another language. + (Hereinafter, translation is included without limitation in the term + "modification".) Each licensee is addressed as "you". +

    + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the Program + (independent of having been made by running the Program). Whether that + is true depends on what the Program does. +

    +
  2. +
  3. + You may copy and distribute verbatim copies of the Program's source code + as you receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice and + disclaimer of warranty; keep intact all the notices that refer to this + License and to the absence of any warranty; and give any other + recipients of the Program a copy of this License along with the Program. +

    + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a + fee. +

    +
  4. +
  5. + You may modify your copy or copies of the Program or any portion of it, + thus forming a work based on the Program, and copy and distribute such + modifications or work under the terms of Section 1 above, provided that + you also meet all of these conditions: +
      +
    1. + You must cause the modified files to carry prominent notices stating + that you changed the files and the date of any change. +
    2. +
    3. + You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any part + thereof, to be licensed as a whole at no charge to all third parties + under the terms of this License. +
    4. +
    5. + If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive + use in the most ordinary way, to print or display an announcement + including an appropriate copyright notice and a notice that there is + no warranty (or else, saying that you provide a warranty) and that + users may redistribute the program under these conditions, and + telling the user how to view a copy of this License. (Exception: if + the Program itself is interactive but does not normally print such + an announcement, your work based on the Program is not required to + print an announcement.) +
    6. +
    +

    + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote + it. +

    +

    + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. +

    +

    + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. +

    +
  6. +
  7. + You may copy and distribute the Program (or a work based on it, under + Section 2) in object code or executable form under the terms of Sections + 1 and 2 above provided that you also do one of the following: +
      +
    1. + Accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 + above on a medium customarily used for software interchange; or, +
    2. +
    3. + Accompany it with a written offer, valid for at least three years, + to give any third party, for a charge no more than your cost of + physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +
    4. +
    5. + Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed + only for noncommercial distribution and only if you received the + program in object code or executable form with such an offer, in + accord with Subsection b above.) +
    6. +
    +

    + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. +

    +

    + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. +

    +
  8. +
  9. + You may not copy, modify, sublicense, or distribute the Program except + as expressly provided under this License. Any attempt otherwise to copy, + modify, sublicense or distribute the Program is void, and will + automatically terminate your rights under this License. However, parties + who have received copies, or rights, from you under this License will + not have their licenses terminated so long as such parties remain in + full compliance. +
  10. +
  11. + You are not required to accept this License, since you have not signed + it. However, nothing else grants you permission to modify or distribute + the Program or its derivative works. These actions are prohibited by law + if you do not accept this License. Therefore, by modifying or + distributing the Program (or any work based on the Program), you + indicate your acceptance of this License to do so, and all its terms and + conditions for copying, distributing or modifying the Program or works + based on it. +
  12. +
  13. + Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further restrictions + on the recipients' exercise of the rights granted herein. You are not + responsible for enforcing compliance by third parties to this License. +
  14. +
  15. + If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot distribute + so as to satisfy simultaneously your obligations under this License and + any other pertinent obligations, then as a consequence you may not + distribute the Program at all. For example, if a patent license would + not permit royalty-free redistribution of the Program by all those who + receive copies directly or indirectly through you, then the only way you + could satisfy both it and this License would be to refrain entirely from + distribution of the Program. +

    + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. +

    +

    + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. +

    +

    + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. +

    +
  16. +
  17. + If the distribution and/or use of the Program is restricted in certain + countries either by patents or by copyrighted interfaces, the original + copyright holder who places the Program under this License may add an + explicit geographical distribution limitation excluding those countries, + so that distribution is permitted only in or among countries not thus + excluded. In such case, this License incorporates the limitation as if + written in the body of this License. +
  18. +
  19. + The Free Software Foundation may publish revised and/or new versions of + the General Public License from time to time. Such new versions will be + similar in spirit to the present version, but may differ in detail to + address new problems or concerns. +

    + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and + "any later version", you have the option of following the terms and + conditions either of that version or of any later version published by + the Free Software Foundation. If the Program does not specify a + version number of this License, you may choose any version ever + published by the Free Software Foundation. +

    +
  20. +
  21. + If you wish to incorporate parts of the Program into other free programs + whose distribution conditions are different, write to the author to ask + for permission. For software which is copyrighted by the Free Software + Foundation, write to the Free Software Foundation; we sometimes make + exceptions for this. Our decision will be guided by the two goals of + preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. +
    NO WARRANTY
    +
  22. +
  23. + BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR + THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER + EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE + ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH + YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. +
  24. +
  25. + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR + DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL + DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM + (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED + INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF + THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR + OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +
  26. +
+
END OF TERMS AND CONDITIONS
+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

A.2.2 Appendix: How to Apply These Terms to Your New Programs

+ +

+ If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these + terms. +

+

+ To do so, attach the following notices to the program. It is safest to + attach them to the start of each source file to most effectively convey + the exclusion of warranty; and each file should have at least the + "copyright" line and a pointer to where the full notice is found. +

+ + + + + +
+
one line to give the program's name and a brief idea of what it does.
+Copyright (C) yyyy  name of author
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+
+

+ Also add information on how to contact you by electronic and paper mail. +

+

+ If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: +

+ + + + + +
+
Gnomovision version 69, Copyright (C) 19yy name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+
+
+

+ The hypothetical commands `show w' and `show c' + should show the appropriate parts of the General Public License. Of + course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu + items--whatever suits your program. +

+

+ You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: +

+ + + + + +
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+`Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+
+
+

+ This General Public License does not permit incorporating your program + into proprietary programs. If your program is a subroutine library, you + may consider it more useful to permit linking proprietary applications + with the library. If this is what you want to do, use the GNU Library + General Public License instead of this License. +

+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + + [ > ] + + [ << ] + + [ Up ] + + [ >> ] + + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

Glossary

+ + + + + + +
Jump to: + '
+ A + B + C + D + E + F + G + I + L + M + N + O + P + R + S + T +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index EntrySection
+
+
'
+ 'name1:name2' + 4.7 Simulation output
+ 'name1:name2' + 4.7 Simulation output
+ 'name1;name2;..;namen' + 4.7 Simulation output
+ 'name1;name2;..;namen' + 4.7 Simulation output
+
+
A
+ abg + + 6.1 Representation summary +
+ abg + + 6.1 Representation summary +
+ AE + + 6.4.1.5 Simple components +
+ AE + + 6.4.1.5 Simple components +
+ AF + + 6.4.1.5 Simple components +
+ AF + + 6.4.1.5 Simple components +
+ artwork + + 6.4.1 Language fig (abg.fig) +
+ artwork + + 6.4.1 Language fig (abg.fig) +
+ assignment statements + + 6.9.3.1 Text form (numpar.txt) +
+ assignment statements + + 6.9.3.1 Text form (numpar.txt) +
+
+
B
+ bonds + + 6.4.1 Language fig (abg.fig) +
+ bonds + + 6.4.1 Language fig (abg.fig) +
+
+
C
+ C + + 6.4.1.5 Simple components +
+ c + 4. Simulation
+ C + + 6.4.1.5 Simple components +
+ c + 4. Simulation
+ c + + 6.9.3 Numeric parameters (numpar) +
+ c + + 6.9.3 Numeric parameters (numpar) +
+ c + + 6.16.1 Language text (rep.txt) +
+ c + + 6.16.1 Language text (rep.txt) +
+ c + 9. Languages
+ c + 9. Languages
+ cbg + + 6.1 Representation summary +
+ cbg + + 6.1 Representation summary +
+ cc + 4. Simulation
+ cc + 4. Simulation
+ commented assignment statements + + 6.9.3.1 Text form (numpar.txt) +
+ commented assignment statements + + 6.9.3.1 Text form (numpar.txt) +
+ comments + + 6.9.3.1 Text form (numpar.txt) +
+ comments + + 6.9.3.1 Text form (numpar.txt) +
+ components + + 6.4.1 Language fig (abg.fig) +
+ components + + 6.4.1 Language fig (abg.fig) +
+ cr + + 6.1 Representation summary +
+ cr + + 6.1 Representation summary +
+ cse + 4. Simulation
+ cse + 4. Simulation
+ cse + + 6.1 Representation summary +
+ cse + + 6.1 Representation summary +
+ csm + + 6.1 Representation summary +
+ csm + + 6.1 Representation summary +
+ CSW + + 6.4.1.5 Simple components +
+ CSW + + 6.4.1.5 Simple components +
+
+
D
+ dae + + 6.1 Representation summary +
+ dae + + 6.1 Representation summary +
+ daes + + 6.1 Representation summary +
+ daes + + 6.1 Representation summary +
+ daeso + + 6.1 Representation summary +
+ daeso + + 6.1 Representation summary +
+ def + + 6.1 Representation summary +
+ def + + 6.1 Representation summary +
+ desc + + 6.1 Representation summary +
+ desc + + 6.1 Representation summary +
+ dm + + 6.1 Representation summary +
+ dm + + 6.1 Representation summary +
+ dvi + 9. Languages
+ dvi + 9. Languages
+
+
E
+ ese + + 6.1 Representation summary +
+ ese + + 6.1 Representation summary +
+ exotherm + 6.8.1.2 exotherm
+
+
F
+ fig + 9. Languages
+ fig + 9. Languages
+ fr + + 6.1 Representation summary +
+ fr + + 6.1 Representation summary +
+
+
G
+ gdat + 9. Languages
+ gdat + 9. Languages
+ GY + + 6.4.1.5 Simple components +
+ GY + + 6.4.1.5 Simple components +
+
+
I
+ I + + 6.4.1.5 Simple components +
+ I + + 6.4.1.5 Simple components +
+ input + + 6.1 Representation summary +
+ input + + 6.1 Representation summary +
+ ir + 4. Simulation
+ ir + 4. Simulation
+ ir + + 6.1 Representation summary +
+ ir + + 6.1 Representation summary +
+ iro + 4. Simulation
+ iro + 4. Simulation
+ iro + + 6.1 Representation summary +
+ iro + + 6.1 Representation summary +
+ ISW + + 6.4.1.5 Simple components +
+ ISW + + 6.4.1.5 Simple components +
+
+
L
+ lbl + + 6.1 Representation summary +
+ lbl + + 6.1 Representation summary +
+ lin + 6.8.1.1 lin
+ lmfr + + 6.1 Representation summary +
+ lmfr + + 6.1 Representation summary +
+ lpfr + + 6.1 Representation summary +
+ lpfr + + 6.1 Representation summary +
+
+
M
+ m + 4. Simulation
+ m + 4. Simulation
+ m + + 6.9.3 Numeric parameters (numpar) +
+ m + + 6.9.3 Numeric parameters (numpar) +
+ m + + 6.16.1 Language text (rep.txt) +
+ m + + 6.16.1 Language text (rep.txt) +
+ m + 9. Languages
+ m + 9. Languages
+ mtt &lt;system&gt; clean + 2.4 Utilities
+ mtt &lt;system&gt; clean + 2.4 Utilities
+ mtt -c -i euler system odeso view + 4. Simulation
+ mtt -c -i euler system odeso view + 4. Simulation
+ mtt -c system odeso view + 4. Simulation
+ mtt -c system odeso view + 4. Simulation
+ mtt clean + 2.4 Utilities
+ mtt clean + 2.4 Utilities
+ mtt copy &lt;system&gt; + 2.4 Utilities
+ mtt copy &lt;system&gt; + 2.4 Utilities
+ mtt help + 2.4 Utilities
+ mtt help + 2.4 Utilities
+ mtt rename &lt;old_name&gt; + &lt;new_name&gt; + 2.4 Utilities
+ mtt rename &lt;old_name&gt; + &lt;new_name&gt; + 2.4 Utilities
+ mtt system iro view + 4. Simulation
+ mtt system iro view + 4. Simulation
+ mtt system representation vc + 2.4 Utilities
+ mtt system representation vc + 2.4 Utilities
+ mtt system representation vc + 2.4.4 Version control
+ mtt system representation vc + 2.4.4 Version control
+ mtt system sro view + 4. Simulation
+ mtt system sro view + 4. Simulation
+ mtt system vc + 2.4 Utilities
+ mtt system vc + 2.4 Utilities
+ mtt system vc + 2.4.4 Version control
+ mtt system vc + 2.4.4 Version control
+
+
N
+ NAME_cause.m + + 6.4.1.7 Simple components - implementation +
+ NAME_cause.m + + 6.4.1.7 Simple components - implementation +
+ NAME_eqn.m + + 6.4.1.7 Simple components - implementation +
+ NAME_eqn.m + + 6.4.1.7 Simple components - implementation +
+ nifr + + 6.1 Representation summary +
+ nifr + + 6.1 Representation summary +
+ numpar + + 6.1 Representation summary +
+ numpar + + 6.1 Representation summary +
+ nyfr + + 6.1 Representation summary +
+ nyfr + + 6.1 Representation summary +
+
+
O
+ obs + + 6.1 Representation summary +
+ obs + + 6.1 Representation summary +
+ ode + 4. Simulation
+ ode + 4. Simulation
+ ode + + 6.1 Representation summary +
+ ode + + 6.1 Representation summary +
+ odes + 4.7 Simulation output
+ odes + 4.7 Simulation output
+ odes + + 6.1 Representation summary +
+ odes + + 6.1 Representation summary +
+ odes + + 6.1 Representation summary +
+ odes + + 6.1 Representation summary +
+ odeso + 4.7 Simulation output
+ odeso + 4.7 Simulation output
+ odeso + + 6.1 Representation summary +
+ odeso + + 6.1 Representation summary +
+ odess + + 6.1 Representation summary +
+ odess + + 6.1 Representation summary +
+ odesso + + 6.1 Representation summary +
+ odesso + + 6.1 Representation summary +
+
+
P
+ ps + + 6.16.1 Language text (rep.txt) +
+ ps + + 6.16.1 Language text (rep.txt) +
+ ps + 9. Languages
+ ps + 9. Languages
+
+
R
+ R + + 6.4.1.5 Simple components +
+ r + + 6.16.1 Language text (rep.txt) +
+ R + + 6.4.1.5 Simple components +
+ r + + 6.16.1 Language text (rep.txt) +
+ r + 9. Languages
+ r + 9. Languages
+ rbg + + 6.1 Representation summary +
+ rbg + + 6.1 Representation summary +
+ rep + + 6.1 Representation summary +
+ rep + + 6.1 Representation summary +
+ rfe + + 6.1 Representation summary +
+ rfe + + 6.1 Representation summary +
+
+
S
+ sabg + + 6.1 Representation summary +
+ sabg + + 6.1 Representation summary +
+ scse + 5. Sensitivity models
+ scse + 5. Sensitivity models
+ scsm + 5. Sensitivity models
+ scsm + 5. Sensitivity models
+ sg + 9. Languages
+ sg + 9. Languages
+ simp + + 6.1 Representation summary +
+ simp + + 6.1 Representation summary +
+ sm + 5. Sensitivity models
+ sm + 5. Sensitivity models
+ sm + + 6.1 Representation summary +
+ sm + + 6.1 Representation summary +
+ sms + + 6.1 Representation summary +
+ sms + + 6.1 Representation summary +
+ smss + + 6.1 Representation summary +
+ smss + + 6.1 Representation summary +
+ smx + + 6.1 Representation summary +
+ smx + + 6.1 Representation summary +
+ sr + 4. Simulation
+ sr + 4. Simulation
+ sr + + 6.1 Representation summary +
+ sr + + 6.1 Representation summary +
+ sro + 4. Simulation
+ sro + 4. Simulation
+ sro + + 6.1 Representation summary +
+ sro + + 6.1 Representation summary +
+ SS + + 6.4.1.5 Simple components +
+ ss + + 6.1 Representation summary +
+ ss + + 6.1 Representation summary +
+ SS + + 6.4.1.5 Simple components +
+ sspar + + 6.1 Representation summary +
+ sspar + + 6.1 Representation summary +
+ strokes + + 6.4.1 Language fig (abg.fig) +
+ strokes + + 6.4.1 Language fig (abg.fig) +
+ struc + + 6.1 Representation summary +
+ struc + + 6.1 Representation summary +
+ sub + + 6.1 Representation summary +
+ sub + + 6.1 Representation summary +
+ sub + + 6.1 Representation summary +
+ sub + + 6.1 Representation summary +
+ sympar + + 6.1 Representation summary +
+ sympar + + 6.1 Representation summary +
+
+
T
+ tex + + 6.16.1 Language text (rep.txt) +
+ tex + + 6.16.1 Language text (rep.txt) +
+ tex + 9. Languages
+ tex + 9. Languages
+ TF + + 6.4.1.5 Simple components +
+ tf + + 6.1 Representation summary +
+ TF + + 6.4.1.5 Simple components +
+ tf + + 6.1 Representation summary +
+ txt + + 6.9.3 Numeric parameters (numpar) +
+ txt + + 6.9.3 Numeric parameters (numpar) +
+ type + 6.4.1.4 Components
+ type + 6.4.1.4 Components
+ type*n + 6.4.1.4 Components
+ type*n + 6.4.1.4 Components
+ type:label + 6.4.1.4 Components
+ type:label + 6.4.1.4 Components
+ type:label*n + 6.4.1.4 Components
+ type:label*n + 6.4.1.4 Components
+ type:label:cr + 6.4.1.4 Components
+ type:label:cr + 6.4.1.4 Components
+ type:label:expression + 6.4.1.4 Components
+ type:label:expression + 6.4.1.4 Components
+
+
+ + + + + +
Jump to: + '
+ A + B + C + D + E + F + G + I + L + M + N + O + P + R + S + T +
+

+
+ + + + + + + + + + + + + + + + + + +
+ [ < ] + [ > ] + [ << ] + + [ Up ] + [ >> ] + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

Index

+ + + + + + +
Jump to: + <
+ A + B + C + D + E + F + G + H + I + L + M + N + O + P + Q + R + S + T + U + V + X +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index EntrySection
+
+
<
<name> + 2.4.1.5 help <name> +
+
+
A
+ Acausal bond graph (abg) + + 6.4 Acausal bond graph (abg) +
Administration11. Administration
Algebraic loops1.7 Algebraic loops
alias options2.3 Options
aliases6.6.9 Aliases
+ Arrow-orientated causality + + 6.4.3.1 Arrow-orientated causality +
artwork6.4.1.15 Artwork
+
+
B
+ Bond graphs, what are they? + + 1.3 What is a bond graph? +
Bonds1.5 Bonds
bonds6.4.1.2 Bonds
bonds + 6.4.3 Language m (abg.m) +
Brief documentation + 8.2.1 Brief on-line documentation +
browser2.4.1 Help
+
+
C
c9.4 c
+ Causal bond graph (cbg) + + 6.10 Causal bond graph (cbg) +
cbonds + 6.10.2 Language m (cbg.m) +
Clean2.4.3 Clean
+ Coerced bond direction + + 6.4.1.10 Coerced bond direction +
+ Command line interface + + 2.2 Command line interface +
component + 7.3 Component library +
component aliases + 6.6.9.4 Component aliases +
Component arguments + 6.6.5 Component arguments +
+ Component constitutive relationship + + 6.6.4 Component constitutive relationship +
Component library + 7.3 Component library +
Component library + 7.3 Component library +
Component names6.6.3 Component names
+ Component-orientated causality + + 6.4.3.2 Component-orientated causality +
Components1.6 Components
components + 2.4.1.2 help components +
Components + 8.2 On-line documentation +
components6.4.1.4 Components
components + 6.4.3 Language m (abg.m) +
compound components11.5 File structure
Compound components + 6.4.1.8 Compound components +
+ Constitutive Relationship + + 1.6.2 Constitutive relationship +
+ Constitutive relationship + + 6.8 Constitutive relationship (cr) +
+ Constrained-state Equations + + 6.13 Constrained-state Equations (cse) +
+ Constrained-state Equations (reduce) + + 6.13.1 Language reduce (cse.r) +
+ Constrained-state Equations (view) + + 6.13.2 Language m (view) +
control systems + 10.4.1 Octave control system toolbox (OCST) +
Copy2.4.2 Copy
CR aliases6.6.9.3 CR aliases
+ Creating complex models + + 3.3 Creating complex models +
+ Creating GNU Octave .oct files + + 10.4.2 Creating GNU Octave .oct files +
+ Creating Matlab .mex files + + 10.4.3 Creating Matlab .mex files +
Creating Models3. Creating Models
+ Creating simple models + + 3.2 Creating simple models +
crs2.4.1.4 help crs
cse.r + 6.13.1 Language reduce (cse.r) +
+
+
D
DAE + 6.12 Differential-Algebraic Equations (dae) +
dae.m + 6.12.2 Language m (dae.m) +
dae.r + 6.12.1 Language reduce (dae.r) +
def.r + 6.11.0.1 Transformation cbg2ese_m2r +
+ Defining representations + 6. Representations
+ Defining representations + + 6.2 Defining representations +
desc + 8.2.2 Detailed on-line documentation +
Description + 8.2.2 Detailed on-line documentation +
Descriptor matrices + 6.15 Descriptor matrices (dm) +
+ Descriptor matrices (m) + + 6.15.2 Language m (dm.m) +
+ Descriptor matrices (reduce) + + 6.15.1 Language reduce (dm.r) +
+ Detailed documentation + + 8.2.2 Detailed on-line documentation +
+ Differential-Algebraic Equations + + 6.12 Differential-Algebraic Equations (dae) +
+ Differential-Algebraic Equations (m) + + 6.12.2 Language m (dae.m) +
+ Differential-Algebraic Equations (reduce) + + 6.12.1 Language reduce (dae.r) +
+ DIY constitutive relationships + + 6.8.2 DIY constitutive relationships +
DIY representations + 7.2 New (DIY) representations +
DIY representations7.2.1 Makefile
DIY representations7.2.2 Shell-script
DIY representations7.2.3 Documentation
dm + 6.15 Descriptor matrices (dm) +
dm.m + 6.15.2 Language m (dm.m) +
dm.r + 6.15.1 Language reduce (dm.r) +
Documentation7.2.3 Documentation
Documentation8. Documentation
Documentation + 8.2 On-line documentation +
+
+
E
+ Elementary system equations + + 6.11 Elementary system equations (ese) +
+ Embedding MTT models in Simulink + + 10.4.4 Embedding MTT models in Simulink +
Euler integration + 4.2.1 Euler integration +
Examples + 8.2 On-line documentation +
examples2.4.1.3 help examples
Extending MTT7. Extending MTT
+
+
F
+ FDL, GNU Free Documentation License + + A.1 GNU Free Documentation License +
Fig9.1 Fig
File structure11.5 File structure
+
+
G
gnuplot + 4.7.1 Viewing results with gnuplot +
+
+
H
help + 2.4.1.1 help representations +
Help2.4.1 Help
help + 2.4.1.2 help components +
help2.4.1.3 help examples
help2.4.1.4 help crs
help + 2.4.1.5 help <name> +
Hybrid systems1.8 Switched systems
+
+
I
+ ICD (label file directive) + + 6.6.8 Interface Control Definition +
Icon6.4.1.1 Icon library
Implicit integration + 4.2.2 Implicit integration +
+
+
L
Labels6.6 Labels (lbl)
+ Language fig (abg.fig) + + 6.4.1 Language fig (abg.fig) +
+ Language fig (cbg.fig) + + 6.10.1 Language fig (cbg.fig) +
+ Language fig (sabg.fig) + + 6.5.1 Language fig (sabg.fig) +
Language m (abg.m) + 6.4.3 Language m (abg.m) +
Language m (cbg.m) + 6.10.2 Language m (cbg.m) +
Language m (view) + 6.5.2 Stripped acausal bond graph (view) +
+ Language tex (abg.tex) + + 6.4.4 Language tex (abg.tex) +
+ Language tex (desc.tex) + + 6.6.12 Language tex (desc.tex) +
+ Language tex (struc.tex) + + 6.7.2 Language tex (struc.tex) +
Language tools10. Language tools
+ Language txt (struc.txt) + + 6.7.1 Language txt (struc.txt) +
Languages9. Languages
LaTeX10.5 LaTeX
lbl6.6 Labels (lbl)
lbl + 6.6.11 Old-style labels (lbl) +
library6.4.1.1 Icon library
logic1.8 Switched systems
+
+
M
m9.2 m
m-files10.4 Octave
Make7. Extending MTT
Makefile7.2.1 Makefile
Makefiles7.1 Makefiles
Manual8.1 Manual
Matlab10.4 Octave
Menu-driven interface + 2.1 Menu-driven interface +
MTT, purpose of1. Introduction
mtt.m10.4 Octave
mtt2sys + 10.4.1 Octave control system toolbox (OCST) +
mttrc11.4 Paths
+
+
N
n_ports + 6.4.3 Language m (abg.m) +
Named SS + 6.4.1.8 Compound components +
Named SS components + 6.4.1.9 Named SS components +
New representations + 7.2 New (DIY) representations +
New representations7.2.1 Makefile
New representations7.2.2 Shell-script
New representations7.2.3 Documentation
Numeric parameters + 1.6.4 Numeric parameters +
Numeric parameters + 6.9.3 Numeric parameters (numpar) +
Numeric parameters + 6.9.3.1 Text form (numpar.txt) +
+
+
O
OCST + 10.4.1 Octave control system toolbox (OCST) +
Octave10.4 Octave
Octave + 10.4.1 Octave control system toolbox (OCST) +
Octave interface10.4 Octave
Octave setup11.3 Octave setup
ODE + 6.13 Constrained-state Equations (cse) +
ODE + 6.14 Ordinary Differential Equations +
ode.m + 6.14.2 Language m (ode.m) +
ode.r + 6.14.1 Language reduce (ode.r) +
Old-style labels + 6.6.11 Old-style labels (lbl) +
+ On-line documentation + + 8.2 On-line documentation +
options2.3 Options
+ Ordinary Differential Equations + + 6.14 Ordinary Differential Equations +
+ Ordinary Differential Equations (m) + + 6.14.2 Language m (ode.m) +
+ Ordinary Differential Equations (reduce) + + 6.14.1 Language reduce (ode.r) +
+ Ordinary Differential Equations (view) + + 6.14.3 Language m (view) +
+ Other component labels + + 6.6.2 Other component labels +
+ Other component labels (old-style) + + 6.6.11.2 Other component labels (old-style) +
+
+
P
parameter aliases + 6.6.9.2 Parameter aliases +
+ parameter declarations + + 6.6.6 Parameter declarations +
Parameter passing + 6.6.10 Parameter passing +
+ Parameter passing (old-style) + + 6.6.11.3 Parameter passing (old-style) +
Parameters6.9 Parameters
paths11.4 Paths
port aliases6.6.9.1 Port aliases
Port label defaults + 6.4.1.13 Port label defaults +
port labels + 6.4.1.12 Vector port labels +
ports1.6.1 Ports
ports6.4.1.11 Port labels
+ Predefined constitutive relationships + + 6.8.1 Predefined constitutive relationships +
+
+
Q
Quick start3.1 Quick start
+
+
R
Reduce9.3 Reduce
REDUCE setup11.2 REDUCE setup
rep6.16 Report (rep)
rep.txt + 6.16.1 Language text (rep.txt) +
Report6.16 Report (rep)
Report (text) + 6.16.1 Language text (rep.txt) +
Report (view)6.16.2 Language view
+ Representation summary + + 6.1 Representation summary +
Representations6. Representations
representations + 2.4.1.1 help representations +
+ Representations, defining + 6. Representations
+ Representations, what are they? + + 1.1 What is a representation? +
+
+
S
SciGraphica + 4.7.2 Exporting results to SciGraphica +
Sensitivity models5. Sensitivity models
Shell-script7.2.2 Shell-script
Simple components + 6.4.1.5 Simple components +
simple components11.5 File structure
+ Simple components - implementation + + 6.4.1.7 Simple components - implementation +
Simulation4. Simulation
+ Simulation initial state + + 4.5 Simulation initial state +
Simulation input4.3 Simulation input
Simulation logic4.4 Simulation logic
Simulation output4.7 Simulation output
Simulation parameters + 4.2 Simulation parameters +
Software components + 11.1 Software components +
SS component labels + 6.6.1 SS component labels +
+ SS component labels (old-style) + + 6.6.11.1 SS component labels (old-style) +
SS components6.4.1.6 SS components
status + 6.10.2 Language m (cbg.m) +
+ Steady-state solutions + + 4.1 Steady-state solutions +
+ Steady-state solutions - numerical + + 4.1.1 Steady-state solutions (odess) +
+ Steady-state solutions - symbolic + + 4.1.2 Steady-state solutions (ss) +
+ Stripped acausal bond graph (sabg) + + 6.5 Stripped acausal bond graph (sabg) +
strokes6.4.1.3 Strokes
struc + 6.7 Structure (struc) +
Structure + 6.7 Structure (struc) +
Structure + 6.11.0.1 Transformation cbg2ese_m2r +
Structure (view) + 6.7.3 Language tex (view) +
Switched systems1.8 Switched systems
Symbolic parameters + 1.6.3 Symbolic parameters +
Symbolic parameters + 6.9.1 Symbolic parameters (subs.r) +
+ Symbolic parameters for simplification + + 6.9.2 Symbolic parameters for simplification (simp.r) +
+
+
T
Text editors10.3 Text editors
toolbox + 10.4.1 Octave control system toolbox (OCST) +
Top level3.3.1 Top level
+ Transformation abg2cbg_m + + 6.10.2.1 Transformation abg2cbg_m +
+ Transformation abg2rbg_fig2m + + 6.4.2.1 Transformation abg2rbg_fig2m +
+ Transformation cbg2ese_m2r + + 6.11.0.1 Transformation cbg2ese_m2r +
+ Transformation cse2ode_r + + 6.14.1.1 Transformation cse2ode_r +
+ Transformation dae2cse_r + + 6.13.1.1 Transformation dae2cse_r +
+ Transformation dae_r2m + + 6.12.2.1 Transformation dae_r2m +
+ Transformation ese2dae_r + + 6.12.1.1 Transformation ese2dae_r +
+ Transformation ode_r2m + + 6.14.2.1 Transformation ode_r2m +
+ Transformation rbg2abg_m + + 6.4.3.3 Transformation rbg2abg_m +
Transformations + 1.2 What is a transformation? +
+
+
U
units declarations + 6.6.7 Units declarations +
+ Unresolved constitutive relationships + + 6.8.3 Unresolved constitutive relationships +
+ Unresolved constitutive relationships - Octave + + 6.8.4 Unresolved constitutive relationships - Octave +
+ Unresolved constitutive relationships - Octave + + 6.8.5 Unresolved constitutive relationships - c++ +
User interface2. User interface
Utilities2.4 Utilities
+
+
V
valid name6.4.1.16 Valid Names
Variables1.4 Variables
Vector components + 6.4.1.14 Vector Components +
vector port labels + 6.4.1.12 Vector port labels +
+ Verbal description (desc) + + 6.3 Verbal description (desc) +
Version control2.4.4 Version control
+ view Constrained-state Equations + + 6.5.2 Stripped acausal bond graph (view) +
+ view Constrained-state Equations + + 6.13.2 Language m (view) +
+ view Ordinary Differential Equations + + 6.14.3 Language m (view) +
view Report6.16.2 Language view
view Structure + 6.7.3 Language tex (view) +
views10.1 Views
+
+
X
Xfig10.2 Xfig
+
+
+ + + + + +
Jump to: + <
+ A + B + C + D + E + F + G + H + I + L + M + N + O + P + Q + R + S + T + U + V + X +
+
+ + + + + + + + +
+ [Top] + + [Contents] + + [Index] + + [ ? ] +
+

Table of Contents

+
+ 1. Introduction
+
+ 1.1 What is a representation?
+ 1.2 What is a transformation?
+ 1.3 What is a bond graph?
+ 1.4 Variables
+ 1.5 Bonds
+ 1.6 Components
+
+ 1.6.1 Ports
+ 1.6.2 Constitutive relationship
+ 1.6.3 Symbolic parameters
+ 1.6.4 Numeric parameters
+
+ 1.7 Algebraic loops
+ 1.8 Switched systems
+
+ 2. User interface
+
+ 2.1 Menu-driven interface
+ 2.2 Command line interface
+ 2.3 Options
+ 2.4 Utilities
+
+ 2.4.1 Help
+
+ 2.4.1.1 help representations
+ 2.4.1.2 help components
+ 2.4.1.3 help examples
+ 2.4.1.4 help crs
+ 2.4.1.5 help <name>
+
+ 2.4.2 Copy
+ 2.4.3 Clean
+ 2.4.4 Version control
+
+
+ 3. Creating Models
+
+ 3.1 Quick start
+ 3.2 Creating simple models
+ 3.3 Creating complex models
+
+ 3.3.1 Top level
+
+
+ 4. Simulation
+
+ 4.1 Steady-state solutions
+
+ 4.1.1 Steady-state solutions (odess)
+ 4.1.2 Steady-state solutions (ss)
+
+ 4.2 Simulation parameters
+
+ 4.2.1 Euler integration
+ 4.2.2 Implicit integration
+ 4.2.3 Runge Kutta IV integration
+ 4.2.4 Hybrd algebraic solver
+
+ 4.3 Simulation input
+ 4.4 Simulation logic
+ 4.5 Simulation initial state
+ 4.6 Simulation code
+
+ 4.6.1 Dynamically linked functions
+
+ 4.7 Simulation output
+
+ 4.7.1 Viewing results with gnuplot
+ 4.7.2 Exporting results to SciGraphica
+
+
+ 5. Sensitivity models
+ 6. Representations
+
+ 6.1 Representation summary
+ 6.2 Defining representations
+ 6.3 Verbal description (desc)
+ 6.4 Acausal bond graph (abg)
+
+ 6.4.1 Language fig (abg.fig)
+
+ 6.4.1.1 Icon library
+ 6.4.1.2 Bonds
+ 6.4.1.3 Strokes
+ 6.4.1.4 Components
+ 6.4.1.5 Simple components
+ 6.4.1.6 SS components
+ 6.4.1.7 Simple components - implementation
+ 6.4.1.8 Compound components
+ 6.4.1.9 Named SS components
+ 6.4.1.10 Coerced bond direction
+ 6.4.1.11 Port labels
+ 6.4.1.12 Vector port labels
+ 6.4.1.13 Port label defaults
+ 6.4.1.14 Vector Components
+ 6.4.1.15 Artwork
+ 6.4.1.16 Valid Names
+
+ 6.4.2 Language m (rbg.m)
+
+ 6.4.2.1 Transformation abg2rbg_fig2m
+
+ 6.4.3 Language m (abg.m)
+
+ 6.4.3.1 Arrow-orientated causality
+ 6.4.3.2 Component-orientated causality
+ 6.4.3.3 Transformation rbg2abg_m
+
+ 6.4.4 Language tex (abg.tex)
+
+ 6.5 Stripped acausal bond graph (sabg)
+
+ 6.5.1 Language fig (sabg.fig)
+ 6.5.2 Stripped acausal bond graph (view)
+
+ 6.6 Labels (lbl)
+
+ 6.6.1 SS component labels
+ 6.6.2 Other component labels
+ 6.6.3 Component names
+ 6.6.4 Component constitutive relationship
+ 6.6.5 Component arguments
+ 6.6.6 Parameter declarations
+ 6.6.7 Units declarations
+ 6.6.8 Interface Control Definition
+ 6.6.9 Aliases
+
+ 6.6.9.1 Port aliases
+ 6.6.9.2 Parameter aliases
+ 6.6.9.3 CR aliases
+ 6.6.9.4 Component aliases
+
+ 6.6.10 Parameter passing
+ 6.6.11 Old-style labels (lbl)
+
+ 6.6.11.1 SS component labels (old-style)
+ 6.6.11.2 Other component labels (old-style)
+ 6.6.11.3 Parameter passing (old-style)
+
+ 6.6.12 Language tex (desc.tex)
+
+ 6.7 Structure (struc)
+
+ 6.7.1 Language txt (struc.txt)
+ 6.7.2 Language tex (struc.tex)
+ 6.7.3 Language tex (view)
+
+ 6.8 Constitutive relationship (cr)
+
+ 6.8.1 Predefined constitutive relationships
+
+ 6.8.1.1 lin
+ 6.8.1.2 exotherm
+
+ 6.8.2 DIY constitutive relationships
+ 6.8.3 Unresolved constitutive relationships
+ 6.8.4 Unresolved constitutive relationships - Octave
+ 6.8.5 Unresolved constitutive relationships - c++
+
+ 6.9 Parameters
+
+ 6.9.1 Symbolic parameters (subs.r)
+ 6.9.2 Symbolic parameters for simplification (simp.r)
+ 6.9.3 Numeric parameters (numpar)
+
+ 6.9.3.1 Text form (numpar.txt)
+
+
+ 6.10 Causal bond graph (cbg)
+
+ 6.10.1 Language fig (cbg.fig)
+ 6.10.2 Language m (cbg.m)
+
+ 6.10.2.1 Transformation abg2cbg_m
+
+
+ 6.11 Elementary system equations (ese)
+
+
+ 6.11.0.1 Transformation cbg2ese_m2r
+
+
+ 6.12 Differential-Algebraic Equations (dae)
+
+ 6.12.1 Language reduce (dae.r)
+
+ 6.12.1.1 Transformation ese2dae_r
+
+ 6.12.2 Language m (dae.m)
+
+ 6.12.2.1 Transformation dae_r2m
+
+
+ 6.13 Constrained-state Equations (cse)
+
+ 6.13.1 Language reduce (cse.r)
+
+ 6.13.1.1 Transformation dae2cse_r
+
+ 6.13.2 Language m (view)
+
+ 6.14 Ordinary Differential Equations
+
+ 6.14.1 Language reduce (ode.r)
+
+ 6.14.1.1 Transformation cse2ode_r
+
+ 6.14.2 Language m (ode.m)
+
+ 6.14.2.1 Transformation ode_r2m
+
+ 6.14.3 Language m (view)
+
+ 6.15 Descriptor matrices (dm)
+
+ 6.15.1 Language reduce (dm.r)
+ 6.15.2 Language m (dm.m)
+
+ 6.16 Report (rep)
+
+ 6.16.1 Language text (rep.txt)
+ 6.16.2 Language view
+
+
+ 7. Extending MTT
+
+ 7.1 Makefiles
+ 7.2 New (DIY) representations
+
+ 7.2.1 Makefile
+ 7.2.2 Shell-script
+ 7.2.3 Documentation
+
+ 7.3 Component library
+
+ 8. Documentation
+
+ 8.1 Manual
+ 8.2 On-line documentation
+
+ 8.2.1 Brief on-line documentation
+ 8.2.2 Detailed on-line documentation
+
+
+ 9. Languages
+
+ 9.1 Fig
+ 9.2 m
+ 9.3 Reduce
+ 9.4 c
+
+ 10. Language tools
+
+ 10.1 Views
+ 10.2 Xfig
+ 10.3 Text editors
+ 10.4 Octave
+
+ 10.4.1 Octave control system toolbox (OCST)
+ 10.4.2 Creating GNU Octave .oct files
+ 10.4.3 Creating Matlab .mex files
+ 10.4.4 Embedding MTT models in Simulink
+
+ 10.5 LaTeX
+
+ 11. Administration
+
+ 11.1 Software components
+ 11.2 REDUCE setup
+ 11.3 Octave setup
+
+ 11.3.1 .octaverc
+ 11.3.2 .oct file dependencies
+
+ 11.4 Paths
+
+ 11.4.1 $MTTPATH
+ 11.4.2 $MTT_COMPONENTS
+ 11.4.3 $MTT_CRS
+ 11.4.4 $MTT_EXAMPLES
+ 11.4.5 $OCTAVE_PATH
+
+ 11.5 File structure
+
+ A. Legal stuff
+
+ A.1 GNU Free Documentation License
+
+ A.1.1 ADDENDUM: How to use this License for your documents
+
+ A.2 GNU GENERAL PUBLIC LICENSE
+
+ A.2.1 Preamble
+ A.2.2 Appendix: How to Apply These Terms to Your New Programs
+
+
+ Glossary
+ Index
+
+
+ + + + + + + + +
+ [Top] + + [Contents] + + [Index] + + [ ? ] +
+

Short Table of Contents

+
+ 1. Introduction
+ 2. User interface
+ 3. Creating Models
+ 4. Simulation
+ 5. Sensitivity models
+ 6. Representations
+ 7. Extending MTT
+ 8. Documentation
+ 9. Languages
+ 10. Language tools
+ 11. Administration
+ A. Legal stuff
+ Glossary
+ Index
+
+
+ + + + + + + + +
+ [Top] + + [Contents] + + [Index] + + [ ? ] +
+

About this document

+ This document was generated by using + texi2html The buttons + in the navigation panels have the following meaning: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ButtonNameGo toFrom 1.2.3 go to
[ < ]Backprevious section in reading order1.2.2
[ > ]Forwardnext section in reading order1.2.4
[ << ]FastBackbeginning of this chapter or previous chapter1
[ Up ]Upup section1.2
[ >> ]FastForwardnext chapter2
[Top]Topcover (top) of document
[Contents]Contentstable of contents
[Index]Indexconcept index
[ ? ]Aboutthis page
+

+ where the Example assumes that the current position is at + Subsubsection One-Two-Three of a document of the + following structure: +

+
    +
  • + 1. Section One +
      +
    • + 1.1 Subsection One-One +
        +
      • ...
      • +
      +
    • +
    • + 1.2 Subsection One-Two +
        +
      • 1.2.1 Subsubsection One-Two-One
      • +
      • 1.2.2 Subsubsection One-Two-Two
      • +
      • + 1.2.3 Subsubsection One-Two-Three + <== Current Position +
      • +
      • 1.2.4 Subsubsection One-Two-Four
      • +
      +
    • +
    • + 1.3 Subsection One-Three +
        +
      • ...
      • +
      +
    • +
    • 1.4 Subsection One-Four
    • +
    +
  • +
+
+
+ This document was generated by Peter Gawthrop on + September, 23 2003 using + texi2html + + ADDED mtt/doc/mtt.pdf Index: mtt/doc/mtt.pdf ================================================================== --- mtt/doc/mtt.pdf +++ mtt/doc/mtt.pdf cannot compute difference between binary files ADDED mtt/doc/mtt.texi Index: mtt/doc/mtt.texi ================================================================== --- mtt/doc/mtt.texi +++ mtt/doc/mtt.texi @@ -0,0 +1,7991 @@ +\input texinfo +@c %**start of header +@setfilename mtt.info +@settitle MTT: Model Transformation Tools +@c %**end of header + +@finalout + +@c Here is what I use in the Info `dir' file: +@c * Mtt: (mtt). Model transformation tools. + + + +@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@comment Version control history +@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@comment $Id$ +@comment $Log$ +@comment Revision 1.32 2014/07/12 19:56:27 geraint +@comment Fixed style of NO WARRANTY from @heading to @strong because texi2html complained about having a heading in an enumerate environment +@comment +@comment Revision 1.31 2014/07/10 23:13:27 geraint +@comment Fixed mtt.texi missing arguments and subsection level +@comment +@comment Revision 1.30 2005/03/15 12:04:15 gawthrop +@comment New labg.fig rep - pretty LaTeX figures. +@comment +@comment Revision 1.29 2005/01/19 09:45:15 geraint +@comment Fixed whitespace. +@comment +@comment Revision 1.28 2005/01/06 16:03:55 geraint +@comment Updated options list. +@comment +@comment Revision 1.27 2005/01/06 14:42:33 geraint +@comment Fixed explicit/implicit descriptions of forward/backward Euler. +@comment Replaced -c examples with -cc. +@comment +@comment Revision 1.26 2005/01/06 12:28:36 geraint +@comment Minor typos. +@comment +@comment Revision 1.25 2004/08/27 20:12:34 geraint +@comment Added note about "none" as an option for units. +@comment +@comment Revision 1.24 2004/08/13 01:39:24 geraint +@comment Fixed variable names in diy makefile example (again) +@comment +@comment Revision 1.23 2004/08/11 08:24:28 geraint +@comment Replaced "gnuplot view" with "odeso gnuplot" in examples. +@comment +@comment Revision 1.21 2004/07/23 11:05:26 geraint +@comment Updated Reduce URL: http://www.reduce-algebra.com +@comment +@comment Revision 1.20 2003/10/23 18:14:43 geraint +@comment Added subsection with script for model-specific options. +@comment Fixed typo in url to mtt.sf.net. +@comment +@comment Revision 1.19 2003/10/10 22:22:18 geraint +@comment typo. +@comment +@comment Revision 1.18 2003/09/07 20:41:19 geraint +@comment *** empty log message *** +@comment +@comment Revision 1.17 2003/08/19 14:20:38 gawthrop +@comment Version 5.0 of MTT +@comment Remove xref errors (spurious spaces) +@comment +@comment Revision 1.16 2003/08/19 14:11:23 gawthrop +@comment Links to legal stuff +@comment +@comment Revision 1.15 2003/08/19 14:01:45 gawthrop +@comment Added legal appendices +@comment +@comment Revision 1.14 2003/08/06 14:50:56 gawthrop +@comment Describe the alias mechanism for invoking mtt options +@comment +@comment Revision 1.13 2002/12/13 10:07:07 gawthrop +@comment Added example in sh section of DIY reps +@comment +@comment Revision 1.12 2002/09/19 08:09:31 gawthrop +@comment Updated documentation documentation +@comment +@comment Revision 1.11 2002/08/20 15:51:17 gawthrop +@comment Update to work with ident DIY rep +@comment +@comment Revision 1.10 2002/07/22 10:45:22 geraint +@comment Fixed gnuplot rep so that it correctly re-runs the simulation if input files have changed. +@comment +@comment Revision 1.9 2002/07/05 13:29:34 geraint +@comment Added notes about generating dynamically linked functions for Octave and Matlab. +@comment +@comment Revision 1.8 2002/07/04 21:34:12 geraint +@comment Updated gnuplot view description to describe Tcl/Tk interface instead of obsolete txt method. +@comment +@comment Revision 1.7 2002/04/23 09:51:54 gawthrop +@comment Changed incorrect statement about searching for components. +@comment +@comment Revision 1.6 2001/10/15 14:29:50 gawthrop +@comment Added documentaton on [1:N] style port labels +@comment +@comment Revision 1.5 2001/07/23 03:35:29 geraint +@comment Updated file structure (mtt/bin). +@comment +@comment Revision 1.4 2001/07/23 03:25:02 geraint +@comment Added notes on -ae hybrd, rk4, ode2odes.cc, .oct dependencies. +@comment +@comment Revision 1.3 2001/07/13 03:02:38 geraint +@comment Added notes on #ICD, gnuplot.txt and odes.sg rep. +@comment +@comment Revision 1.2 2001/07/03 22:59:10 gawthrop +@comment Fixed problems with argument passing for CRs +@comment +@comment Revision 1.1 2001/06/04 08:18:52 gawthrop +@comment Putting documentation under CVS +@comment +@comment Revision 1.66 2000/12/05 14:20:55 peterg +@comment Added the c++ anf m CR info. +@comment +@comment Revision 1.65 2000/11/27 15:36:15 peterg +@comment NOPAR --> NOTPAR +@comment +@comment Revision 1.64 2000/11/16 14:22:48 peterg +@comment added UNITS declaration +@comment +@comment Revision 1.63 2000/11/03 14:41:08 peterg +@comment Added PAR and NOPAR stuff +@comment +@comment Revision 1.62 2000/10/17 17:53:34 peterg +@comment Added some simulation details +@comment +@comment Revision 1.61 2000/09/14 17:13:06 peterg +@comment New options table +@comment +@comment Revision 1.60 2000/09/14 17:09:20 peterg +@comment Tidied up valid name sections +@comment Tidied up defining represnetations table +@comment Verion 4.6 +@comment +@comment Revision 1.59 2000/08/30 13:09:00 peterg +@comment Updated option table +@comment +@comment Revision 1.58 2000/08/01 13:30:19 peterg +@comment Version 4.4 +@comment updated STEPFACTOR info +@comment describes octave and OCST interfaces +@comment +@comment Revision 1.57 2000/07/20 07:55:44 peterg +@comment Version 4.3 +@comment +@comment Revision 1.56 2000/05/19 17:49:17 peterg +@comment Extended the user defined representation section -- new nppp rep. +@comment +@comment Revision 1.55 2000/03/16 13:53:31 peterg +@comment Correct date +@comment +@comment Revision 1.54 2000/03/15 21:22:57 peterg +@comment Updated to 4.1 -- old style SS no longer supported +@comment +@comment Revision 1.53 1999/12/22 05:33:10 peterg +@comment Updated for 4.0 +@comment +@comment Revision 1.52 1999/11/23 00:25:11 peterg +@comment Added the sensitivity reps +@comment +@comment Revision 1.51 1999/11/16 04:43:47 peterg +@comment Added start of sensitivity section +@comment +@comment Revision 1.50 1999/11/16 00:30:35 peterg +@comment Updated simulation section +@comment Added vector components +@comment +@comment Revision 1.49 1999/07/20 23:44:58 peterg +@comment V 3.8 +@comment +@comment Revision 1.48 1999/07/19 03:08:33 peterg +@comment Added documentation for (new) SS lbl fields +@comment +@comment Revision 1.47 1999/03/09 01:42:22 peterg +@comment Rearranged the User interface section +@comment +@comment Revision 1.46 1999/03/09 01:18:01 peterg +@comment Updated for 3.5 including xmtt +@comment +@comment Revision 1.45 1999/03/03 02:39:26 peterg +@comment Minor updates +@comment +@comment Revision 1.44 1999/02/17 06:52:14 peterg +@comment New level formula dor artwork +@comment +@comment Revision 1.43 1998/11/25 16:49:24 peterg +@comment Put in subs.r documentation (was called params.r) +@comment +@comment Revision 1.42 1998/11/24 12:24:59 peterg +@comment Added section on simulation output +@comment Version 3.4 +@comment +@comment Revision 1.41 1998/09/02 12:04:15 peterg +@comment Version 3.2 +@comment +@comment Revision 1.40 1998/08/27 08:36:39 peterg +@comment Removed in. methods except Euler anf implicit +@comment +@comment Revision 1.39 1998/08/18 10:44:28 peterg +@comment Typo +@comment +@comment Revision 1.38 1998/08/18 09:16:38 peterg +@comment Version 3.1 +@comment +@comment Revision 1.37 1998/08/17 16:14:30 peterg +@comment Version 3.1 - includes documentation on METHOD=IMPLICIT +@comment +@comment Revision 1.36 1998/07/30 17:33:15 peterg +@comment VERSION 3.0 +@comment +@comment Revision 1.35 1998/07/22 11:00:53 peterg +@comment Correct date! +@comment +@comment Revision 1.34 1998/07/22 11:00:13 peterg +@comment Version to BAe +@comment +@comment Revision 1.33 1998/07/17 19:32:19 peterg +@comment Added more about aliases +@comment +@comment Revision 1.32 1998/07/05 14:21:56 peterg +@comment Further additions (Carlisle-Glasgow) +@comment +@comment Revision 1.31 1998/07/04 11:35:57 peterg +@comment Strarted new lbl description +@comment +@comment Revision 1.30 1998/07/02 18:39:20 peterg +@comment Started 3.0 +@comment Added alias and default sections. +@comment +@comment Revision 1.29 1998/05/19 19:46:58 peterg +@comment Added the odess description +@comment +@comment Revision 1.28 1998/05/14 09:17:22 peterg +@comment Added METHOD variable to the simpar file +@comment +@comment Revision 1.27 1998/05/13 10:03:09 peterg +@comment Added unknown/zero SS label documentation. +@comment +@comment Revision 1.26 1998/04/29 15:12:46 peterg +@comment Version 2.9. +@comment +@comment Revision 1.25 1998/04/12 17:00:26 peterg +@comment Added new port features: coerced direction and top-level behaviour. +@comment +@comment Revision 1.24 1998/04/05 18:27:20 peterg +@comment This was the 2.6 version +@comment +@comment Revision 1.23 1997/08/24 11:17:51 peterg +@comment This is the released version 2.5 +@comment +@comment Revision 1.22 1997/08/23 19:38:53 peterg +@comment Added simulation chapter. +@comment +@comment Revision 1.21 1997/08/23 16:50:10 peterg +@comment Added desc section. +@comment Included named and vector ports +@comment Completed list of representations. +@comment +@comment Revision 1.20 1997/06/16 15:39:24 peterg +@comment THis is the released 2.4 document. +@comment +@comment Revision 1.19 1997/06/16 09:48:23 peterg +@comment Back under revision control (elm) +@comment +@comment Revision 1.18 1997/06/14 20:27:41 peterg +@comment Added complex example section. +@comment +@comment Revision 1.18 1997/06/13 14:51:07 peterg +@comment Added report section +@comment +@comment Revision 1.17 1997/05/09 15:06:02 peterg +@comment Changed to version 2.4. +@comment +@comment Revision 1.16 1996/12/05 10:06:25 peterg +@comment Modified .octaverc : 'true' --> 1 +@comment +@comment Revision 1.15 1996/11/20 19:02:28 peterg +@comment Added some system admin stuff. +@comment Added section on simple models. +@comment +@comment Revision 1.14 1996/11/12 13:19:04 peterg +@comment Put paths as section, not subsection. +@comment +@comment Revision 1.13 1996/11/11 16:53:14 peterg +@comment Added params documentation +@comment Sorted out table bug. +@comment +@comment Revision 1.12 1996/11/10 20:29:31 peterg +@comment Added section on help -- needs more +@comment +@comment Revision 1.11 1996/11/09 21:15:28 peterg +@comment Rewrite of quick start. +@comment Update of file structure. +@comment +@comment Revision 1.10 1996/11/09 20:25:54 peterg +@comment Final v2.0. +@comment +@comment Revision 1.9 1996/10/01 10:33:02 peter +@comment Cleaned up cross references. +@comment +@comment Revision 1.8 1996/10/01 09:31:00 peter +@comment Added sections written in Hong Kong. +@comment +@comment Revision 1.7 1996/09/16 09:49:47 peter +@comment Added ese section +@comment +@comment Revision 1.6 1996/09/16 08:33:53 peter +@comment Added constitutive relationship section etc. +@comment +@comment Revision 1.5 1996/09/15 20:20:56 peter +@comment Added abg and rbg stuff +@comment +@comment Revision 1.4 1996/08/30 19:07:40 peter +@comment Added some admin stuff. +@comment +@comment Revision 1.3 1996/08/30 07:50:16 peter +@comment Added file structure section. +@comment +@comment Revision 1.2 1996/08/22 14:28:50 peter +@comment Added stuff about labels. +@comment +@comment Revision 1.1 1996/08/22 11:52:59 peter +@comment Initial revision +@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +@ifinfo +This file documents MTT, a set of Model Transformation Tools. + + +Copyright (C) Peter J. Gawthrop 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003 + +Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). +@end ignore + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided also that the +section entitled ``GNU General Public License'' is included exactly as +in the original, and provided that the entire resulting derived work is +distributed under the terms of a permission notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that the section entitled ``GNU General Public License'' may be +included in a translation approved by the author instead of in the +original English. +@end ifinfo + + +@titlepage +@title MTT: Model Transformation Tools +@subtitle August 2003 +@subtitle For version 5.0. +@author Peter Gawthrop, Geraint Bevan +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1996,1997,1998,1999,2000,2001,2002,2003 Peter J. Gawthrop + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled "GNU + Free Documentation License". + +General information about MTT is available at URL www.sf.net. MTT is distributed +under the GNU GENERAL PUBLIC LICENSE (@pxref{Copying}). This manual is +distributed under the GNU Free Documentation License (@pxref{GNU Free +Documentation License}). + +@example +http://mtt.sourceforge.net +@end example +@ifhtml + here. +@end ifhtml + +@end titlepage + + +@ifinfo +@node Top, Introduction, (dir), (dir) +@top MTT +@strong{MTT} is a set of Model Transformation Tools based on bond graphs. +@strong{MTT} implements the theory to be found in the book ``Metamodelling: Bond +Graphs and Dynamic Systems'' by Peter Gawthrop and Lorcan Smith +published by Prentice Hall in 1996 (ISBN 0-13-489824-9). + +It implements two features not discussed in that book: +@itemize @bullet +@item +bicausal bond graphs and +@item +hierarchical bond graphs. +@end itemize + + + +@contents + +@end ifinfo + + +@c @include intro.texi +@c Copyright (C) 1996 Peter J. Gawthrop +@c This is part of the MTT manual. +@c For copying conditions, see the file MTT.texi. + +@menu +* Introduction:: +* User interface:: +* Creating Models:: +* Simulation:: +* Sensitivity models:: +* Representations:: +* Extending MTT:: +* Documentation:: +* Languages:: +* Language tools:: +* Administration:: +* Glossary:: +* Index:: + +@detailmenu + --- The Detailed Node Listing --- + +Introduction + +* What is a Representation?:: +* What is a Transformation?:: +* Bond graphs:: What is a bond graph? +* Variables:: +* Bonds:: +* Components:: +* Algebraic loops:: +* Switched systems:: + +Components + +* Ports:: +* Constitutive relationship:: +* Symbolic parameters:: +* Numeric parameters:: + +User interface + +* Menu-driven interface:: +* Command line interface:: +* Options:: +* Utilities:: + +Options + +* Available options:: +* Model-specific options:: + +Available options + +* Experimental options:: +* Deprecated options:: + +Utilities + +* Help:: +* Copy:: +* Clean:: +* Version control:: + +Help + +* help representations:: +* help components:: +* help examples:: +* help crs:: +* help :: + +Creating Models + +* Quick start:: +* Creating simple models:: +* Creating complex models:: + +Creating complex models + +* Top level:: + +Simulation + +* Steady-state solutions:: +* Simulation parameters:: +* Simulation input:: +* Simulation logic:: +* Simulation initial state:: +* Simulation code:: +* Simulation output:: + +Steady-state solutions + +* Steady-state solutions - numerical(odess):: +* Steady-state solutions - symbolic (ss):: + +Simulation parameters + +* Euler integration:: +* Implicit integration:: +* Runge Kutta IV integration:: +* Hybrd algebraic solver:: + +Simulation code + +* Dynamically linked functions:: + +Simulation output + +* Viewing results with gnuplot:: +* Exporting results to SciGraphica:: + +Representations + +* Representation summary:: +* Defining representations:: +* Verbal description (desc):: +* Acausal bond graph (abg):: +* Acausal bond graph - LaTeX ready (labg):: +* Stripped acausal bond graph (sabg):: +* Labels (lbl):: +* Structure (struc):: +* Constitutive Relationship (cr):: +* Parameters:: +* Causal bond graph (cbg):: +* Elementary system equations:: +* Differential-Algebraic Equations:: +* Constrained-state Equations:: +* Ordinary Differential Equations:: +* Descriptor matrices:: +* Report:: + +Acausal bond graph (abg) + +* Language fig (abg.fig):: +* Language m (rbg.m):: +* Language m (abg.m):: +* Language tex (abg.tex):: + +Acausal bond graph - LaTeX ready (labg) + +* Language fig (abg.fig):: +* Language m (rbg.m):: +* Language m (abg.m):: +* Language tex (abg.tex):: + +Language fig (abg.fig) + +* icon library:: +* bonds:: +* strokes:: +* components:: +* Simple components:: +* SS components:: +* Simple components - implementation:: +* Compound components:: +* Named SS components:: +* Coerced bond direction:: +* Port labels:: +* Vector port labels:: +* Port label defaults:: +* Vector components:: +* artwork:: +* Valid names:: + +Simple components + +* SS components:: +* Simple components - implementation:: + +Compound components + +* Named SS components:: + +Language m (rbg.m) + +* Transformation abg2rbg_fig2m:: + +Language m (abg.m) + +* Arrow-orientated causality:: +* Component-orientated causality:: +* Transformation rbg2abg_m:: + +Stripped acausal bond graph (sabg) + +* Language fig (sabg.fig):: +* Stripped acausal bond graph (view):: + +Labels (lbl) + +* SS component labels:: +* Other component labels:: +* Component names:: +* Component constitutive relationship:: +* Component arguments:: +* Parameter declarations:: +* Units declarations:: +* Interface Control Definition:: +* Aliases:: +* Parameter passing:: +* Old-style labels (lbl):: +* Language tex (desc.tex):: + +Other component labels + +* Component names:: +* Component constitutive relationship:: +* Component arguments:: +* Aliases:: +* Parameter passing:: +* Old-style labels (lbl):: + +Aliases + +* Port aliases:: +* Parameter aliases:: +* CR aliases:: +* Component aliases:: + +Old-style labels (lbl) + +* SS component labels (old-style):: +* Other component labels (old-style):: +* Parameter passing (old-style):: + +Parameter passing (old-style) + +* Language tex (desc.tex):: + +Structure (struc) + +* Language txt (struc.txt):: +* Language tex (struc.tex):: +* Structure (view):: + +Constitutive relationship (cr) + +* Predefined constitutive relationships:: +* DIY constitutive relationships:: +* Unresolved constitutive relationships:: +* Unresolved constitutive relationships - Octave:: +* Unresolved constitutive relationships - c++:: + +Predefined constitutive relationships + +* lin:: +* exotherm:: + +Parameters + +* Symbolic parameters (subs.r):: +* Symbolic parameters for simplification (simp.r):: +* Numeric parameters (numpar):: + +Numeric parameters (numpar) + +* Text form (numpar.txt):: + +Causal bond graph (cbg) + +* Language fig (cbg.fig):: +* Language m (cbg.m):: + +Language m (cbg.m) + +* Transformation abg2cbg_m:: + +Elementary system equations (ese) + +* Transformation cbg2ese_m2r:: + +Differential-Algebraic Equations (dae) + +* Differential-Algebraic Equations (reduce):: +* Differential-Algebraic Equations (m):: + +Language reduce (dae.r) + +* Transformation ese2dae_r:: + +Language m (dae.m) + +* Transformation dae_r2m:: + +Constrained-state Equations (cse) + +* Constrained-state Equations (reduce):: +* Constrained-state Equations (view):: + +Language reduce (cse.r) + +* Transformation dae2cse_r:: + +Ordinary Differential Equations + +* Ordinary Differential Equations (reduce):: +* Ordinary Differential Equations (m):: +* Ordinary Differential Equations (view):: + +Language reduce (ode.r) + +* Transformation cse2ode_r:: + +Language m (ode.m) + +* Transformation ode_r2m:: + +Descriptor matrices (dm) + +* Descriptor matrices (reduce):: +* Descriptor matrices (m):: + +Report (rep) + +* Report (text):: +* Report (view):: + +Extending MTT + +* Makefiles:: +* New (DIY) representations:: +* Component library:: + +New (DIY) representations + +* Makefile (DIY representations):: +* Shell-script (DIY representations):: +* Documentation (DIY representations):: + +Documentation + +* Manual (Documentation):: +* On-line documentation:: + +On-line documentation + +* Brief:: +* Detailed:: + +Languages + +* Fig:: r +* m:: +* Reduce:: +* c:: + +Language tools + +* Views:: +* Xfig:: +* Text editors:: +* Octave:: +* LaTeX:: + +Octave + +* Octave control system toolbox (OCST):: +* Creating GNU Octave .oct files:: +* Creating Matlab .mex files:: +* Embedding MTT models in Simulink:: + +Administration + +* Software components:: +* REDUCE setup:: +* Octave setup:: +* Paths:: +* File structure:: +* GNU Free Documentation License:: +* Copying:: + +Octave setup + +* .octaverc:: +* .oct file dependencies:: + +Paths + +* $MTTPATH:: +* $MTT_COMPONENTS:: +* $MTT_CRS:: +* $MTT_EXAMPLES:: +* $OCTAVE_PATH:: + +@end detailmenu +@end menu + +@node Introduction, User interface, Top, Top +@chapter Introduction + +@cindex MTT, purpose of + +@pindex MTT + +@strong{MTT} is a set of Model Transformation Tools based on bond +graphs. @strong{MTT} implements the theory to be found in the book +``Metamodelling: Bond Graphs and Dynamic Systems'' by Peter Gawthrop and +Lorcan Smith published by Prentice Hall in 1996 (ISBN 0-13-489824-9). + +It implements two features not discussed in that book: +@itemize @bullet +@item +bicausal bond graphs and +@item +hierarchical bond graphs. +@end itemize + +In the context of software, it has been said that one good tool is worth many +packages. UNIX is a good example of this philosophy: the user can put together +applications from a range of ready made tools. +This manual describes the application of this philosophy to dynamic +system modeling embodied in @strong{MTT} - a set of Model Transformation Tools +each of which implements a single transformation between system +representations. + + +System representations have two attributes. +@itemize @bullet +@item + A Form: e.g. acausal bond graph, differential algebraic, linear + state-space etc. +@item +A Language: e.g. Fig, Matlab, LaTeX, Reduce, postscript etc. +@end itemize + +Transformations in @strong{MTT} are accomplished using appropriate software (e.g. +Octave/Matlab, Reduce) encapsulated in UNIX Bourne shell scripts. The +relationships between the tools are encoded in a Make File; thus the +user can specify a final representation and all the necessary +intermediate transformations are automatically generated. + +@menu +* What is a Representation?:: +* What is a Transformation?:: +* Bond graphs:: What is a bond graph? +* Variables:: +* Bonds:: +* Components:: +* Algebraic loops:: +* Switched systems:: +@end menu + + +@node What is a Representation?, What is a Transformation?, Introduction, Introduction +@section What is a representation? + +@cindex Representations, what are they? + +@pindex Representations + +Physical systems have many representations. These include +@itemize @bullet +@item +a schematic diagram, +@item +a block diagram, +@item +a bunch of equations, +@item +a single differential(-algebraic) equation, +@item +simulation code, +@item +linearised state-space (or descriptor) equations, +@item +transfer function (of the linearised system), +@item +frequency response (of the linearised system), +@item +etc... +@end itemize + +Each of these representations is related to other representations by an +appropriate transformation (@pxref{What is a Transformation?}. In many cases, a +modeler is presented with a physical system and needs to make a +model. In particular, a model, in this context, is a representation of +the system appropriate to a particular use, for example: +@itemize @bullet +@item +simulation, +@item +control system design, +@item +optimisation +@item +etc. +@end itemize + +Indeed, for a given physical system, the modeler would need to derive +a number of models. This process can be viewed as a series of steps; +each involving a transformation between representations (@pxref{What is a Transformation?}. + + +In this context, the following considerations are relevant. +@itemize @bullet +@item +There is a unique `core' representation of any system. +There are many routes from this core representation, each leading to +an appropriate model. +There are many possible routes to this core representation +from the physical system: the route chosen is a matter of convenience. +@item +Because the core representation is unique, it is easy to expand the +tool-box to include additional transformations from the physical system +to the core representation and additional transformations from the core +representation to the mode. +@item +Transformation_1 probably cannot, and certainly should not, be +completely automated. Engineering insight, knowledge and experience is +essential to capture the essence (with respect to the particular use) of +the physical system whilst discarding irrelevant form. +@item +Representation_1 should be `close' in some sense to the Physical system. +@item +The core representation, and hence the representations leading to it, +must contain enough information to generate all of the required models. +@item +Representations must be easily extensible: it must be possible to add +extra components or attributes without restructuring the representation. +@end itemize + +I happen to believe that Bond graphs (@pxref{Bond graphs}) provide the +most convenient and powerful basis for the core representation. + +@node What is a Transformation?, Bond graphs, What is a Representation?, Introduction +@comment node-name, next, previous, up +@section What is a transformation? +@cindex Transformations + + +Each system representation (@pxref{What is a Representation?} is related to other representations by an +appropriate transformation as follows: +@itemize @bullet +@item + Physical system +@item + Transformation_1 ---> Representation_1 +@item + Transformation_2 ---> Representation_2 +@item + ... +@item + Transformation_N ---> Core representation +@item + Transformation_N+1 ---> Representation_N+1 +@item + Transformation_N+2 ---> Representation_N+2 +@item + ... +@item + Transformation_N+M ---> Model +@end itemize +Thus modeling is seen as a sequence of transformations between +representations. + + + +@node Bond graphs, Variables, What is a Transformation?, Introduction +@section What is a bond graph? + +@cindex Bond graphs, what are they? + +@pindex Bond graphs + +Bond graphs provide a graphical high-level language for describing +dynamic systems in a precise and unambiguous fashion. +They make a clear distinction between structure (how components are +connected together), and behavior (the particular constitutive +relationships, or physical laws, describing each component. + +They can describe a range of physical systems including: +@itemize @bullet +@item +Electrical systems +@item +Mechanical systems +@item +Hydraulic systems +@item +Chemical process systems +@end itemize + +More importantly, they can describe systems which contain subsystems +drawn from all of these domains in a uniform manner. + +Bond graphs are made up of components (@pxref{Components}) connected by +bonds (@pxref{Bonds}) which define the relationship between +variables (@pxref{Variables}). + +@node Variables, Bonds, Bond graphs, Introduction +@comment node-name, next, previous, up +@section Variables +@cindex Variables +In bond graph terminology there are four sorts of variables: +@itemize @bullet +@item @emph{effort} variables +@item @emph{flow} variables +@item @emph{integrated effort} variables +@item @emph{integrated flow} variables +@end itemize + +Examples of @emph{effort} variables are +@itemize @bullet +@item +voltage +@item +pressure +@item +force +@item +torque +@item +temperature +@end itemize + +Examples of @emph{flow} variables are +@itemize @bullet +@item +current +@item +volumetric flow rate +@item +velocity +@item +angular velocity +@item +heat flow +@end itemize + + + +Examples of integrated @emph{flow} variables are +@itemize @bullet +@item +charge +@item +volume +@item +momentum +@item +angular momentum +@item +heat +@end itemize + + + +@node Bonds, Components, Variables, Introduction +@comment node-name, next, previous, up +@section Bonds +@cindex Bonds +Bonds connect components (@pxref{Components}) together. Each bond +carries two variables: +@itemize @bullet +@item an effort (@pxref{Variables}) variable and +@item a flow (@pxref{Variables}) variable. +@end itemize +Each bond has three notations associated with it: +@itemize @bullet +@item a half-arrow, +@item a causal stroke and +@item a causal half-stroke. +@end itemize + +The half-arrow indicates two things: +@itemize @bullet +@item the direction of power (or pseudo power) flow and +@item the side of the bond associated with the flow variable. +@end itemize + +The causal stroke indicates two things: +@itemize @bullet +@item the effort variable is imposed at the same end as the stroke and +@item the flow variable is imposed at the opposite end to the stroke. +@end itemize + +The causal half-stoke indicates one thing: +@itemize @bullet +@item if it is on the effort side of the bond, the effort variable is +imposed at the same end as the stroke or +@item if it is on the flow side of the bond, the flow variable is +imposed at the opposite end to the stroke. +@end itemize + + + +@node Components, Algebraic loops, Bonds, Introduction +@comment node-name, next, previous, up +@section Components +@cindex Components + +Components provide the building blocks of a dynamic system when +connected by bonds (@pxref{bonds}). +Components have the following attributes: +@vtable @code +@item ports + provide the connections to other components (@pxref{Ports}) +@item constitutive relationships + define how the port-variables are related (@pxref{Constitutive +relationship}) +@end vtable + + +@menu +* Ports:: +* Constitutive relationship:: +* Symbolic parameters:: +* Numeric parameters:: +@end menu + +@node Ports, Constitutive relationship, Components, Components +@comment node-name, next, previous, up +@subsection Ports +@cindex ports +Components have one or more ports. Each port carries two variables, +and effort and a flow variable (@pxref{Variables}). Any pair of ports +can be connected by a bond (@pxref{Bonds}); this connection is +equivalent to saying that the effort variables at each port are +identical and that the flow variables at each port are +identical. + +Ports are implemented in @strong{MTT} using named SS components. +(@pxref{Named SS components}). + +The direction of the named SS components. +(@pxref{Named SS components}) +is coerced (@pxref{Coerced bond direction}) to have the same direction +as the bons connected to the corresponding port. Thus the direction of +the direction of the named SS components has no significance unless the +component is at the top level. + +@node Constitutive relationship, Symbolic parameters, Ports, Components +@comment node-name, next, previous, up +@subsection Constitutive relationship +@cindex Constitutive Relationship + +The constitutive relationship of a component defines how the port +variables are related. This relationship may be linear +or non-linear. This typically contains symbolic parameters +(@pxref{Symbolic parameters}) which may be replaced, for the purposes +of numerical analysis by numeric parameters +(@pxref{Numeric parameters}). + +@node Symbolic parameters, Numeric parameters, Constitutive relationship, Components +@comment node-name, next, previous, up +@subsection Symbolic parameters +@cindex Symbolic parameters +The constitutive relationship of a system component (@pxref{Components}) +typically contains symbolic parameters. For example a resistor may have +a symbolic resistance r. It is convenient to leave such parameters as +symbols when viewing equations or when performing symbolic analysis such +as differentiation. + +However, @strong{MTT} allows replacement of symbolic parameters by +numeric parameters (@pxref{Numeric parameters}) when appropriate. + +@node Numeric parameters, , Symbolic parameters, Components +@comment node-name, next, previous, up +@subsection Numeric parameters +@cindex Numeric parameters +Numerical parameters are needed to give specific values to symbolic +parameters (@pxref{Symbolic parameters}) for the purposes of numeric +analysis; +for example: simulation, graph plotting or use within a numerical +package such as Octave (@pxref{Octave}). + + +@node Algebraic loops, Switched systems, Components, Introduction +@section Algebraic loops +@cindex Algebraic loops +Following Chapter 3 of the book, algebraic loops appear as under-causal +components in the bond graph. It is up to the modeler to indicate how these loops +are to be resolved by adding appropriate SS elements. + +In particular if zero junction is undercausal an SS:loop component (with +effort output indicated by a causal stroke) with the following label +file entry: +@example + loop SS unknown,zero +@end example + +For more information, refer to: +``Metamodelling: Bond Graphs and Dynamic Systems'' by Peter Gawthrop and +Lorcan Smith published by Prentice Hall in 1996 (ISBN 0-13-489824-9). + +@node Switched systems, , Algebraic loops, Introduction +@comment node-name, next, previous, up +@section Switched systems +@cindex Switched systems +@cindex Hybrid systems +@cindex logic + +Some systems contain switch-like components. For example an electrical +system may contain on-off switches and diodes and a hydraulic system may +shut-off valves and non-return valves. + +Such systems are sometimes called hybrid systems. The modelling an +simulation of such systems is the subject of current research. +@strong{MTT} implements a simple pragmatic approach to the modelling and +simulation of such systems via two new Bond Graph components: +@vtable @code +@item ISW + a switched @code{I} component +@item CSW + a switched @code{C} component +@end vtable + +These switches are user controlled through the logic representation +(@pxref{Simulation logic}). + +@node User interface, Creating Models, Introduction, Top +@comment node-name, next, previous, up +@chapter User interface +@cindex User interface +@pindex User interface +There are two user interfaces to @strong{MTT}: a command line interface +(@pxref{Command line interface}) and a menu-driven interface +(@pxref{Menu-driven interface}). + +@menu +* Menu-driven interface:: +* Command line interface:: +* Options:: +* Utilities:: +@end menu + +@node Menu-driven interface, Command line interface, User interface, User interface +@comment node-name, next, previous, up +@section Menu-driven interface +@cindex Menu-driven interface +@pindex Menu-driven interface +The Menu-driven interface for @strong{MTT} is invoked as: +@example +xmtt +@end example +This will bring up a menu which should be self explanatory :-). +Various messages will be echoed in the window from whence @strong{xMTT} +was invoked. + +@node Command line interface, Options, Menu-driven interface, User interface +@comment node-name, next, previous, up +@section Command line interface +@cindex Command line interface +@pindex Command line interface +The command line interface for @strong{MTT} is of the form: +@example +mtt [options] +@end example +@vtable @code +@item [options] + the (optional) option switches (@pxref{Options}) +@item + the name of the system being transformed +@item + the mnemonic for the system representation (@pxref{Representation summary}) +@item + the mnemonic for language for the representation (@pxref{Languages}) +@end vtable +for example +@example +mtt rc rep view +@end example +creates a view of the report describing system rc and +@example +mtt rc sm m +@end example +creates an m file (suitlable for Octave or Matlab) containing state +matrices describing the system rc. +@node Options, Utilities, Command line interface, User interface +@comment node-name, next, previous, up +@section Options +@cindex options +@cindex alias options + +@strong{MTT} has a number of optional switches to control its +operation. These are invoked immediately after `mtt' on the command +line; for example: +@example +mtt -o -ss -cc syst cbg view +@end example +invokes the @code{-o}, @code{-ss}, and @code{-cc} options. + +If you wish to use an option all the time, use the +alias function appropriate to the shell you are using. For example, +using bash: +@example +alias mtt='mtt -o -ss -cc' +@end example +Means that the previous example can be executed using +@example +mtt syst cbg view +@end example + +@menu +* Available options:: +* Model-specific options:: +@end menu + +@node Available options, Model-specific options, Options, Options +@comment node-name, next, previous, upThe available options are: +@subsection Available options +@vtable @code +@item -A + solve algebraic equations symbolically +@item -abg + start at abg.m representation +@item -ae + algebraic equation solver: reduce|hybrd|dassl|hooke +@item -cc + C++ code generation +@item -cr + use cr before resolving equations +@item -D + debug -- leave log files etc +@item -d + use directory +@item -dc + maximise derivative (not integral) causality +@item -dr + use files contained in +@item -I + prints more information +@item -i + integration method: implicit|euler|rk4|dassl +@item -o + ode is same as dae +@item -oct + use oct files in place of m files where appropriate +@item -opt + optimise code generation (equivalent to -optl) +@item -optl + locally optimise code generation (line-by-line) +@item -ntmpvar + declare temporary variables (default=$num_tmp_var) +@item -p + print environment variables +@item -partition + partition hierachical system +@item -pdf + generate pdf in place of ps +@item -q + quiet mode -- suppress MTT banner +@item -r + reset time stamp on representation +@item -s + generate sensitivity BG (use mtt -s sSys rep lang) +@item -ss + use steady-state info to initialise simulations +@item -stdin + read input data from standard input for simulations +@item -sub + operate on subsystem +@item -t + tidy mode (default) +@item -trace + just indicate what mtt will do - but do not do it +@item -u + untidy mode (leaves files in current dir) +@item -v + verbose mode (multiple uses increment the verbosity) +@item --version + print version and exit +@item --versions + print version of mtt and components and exit +@item -viewlevel + view levels of hierachy +@end vtable + +@menu +* Experimental options:: +* Deprecated options:: +@end menu + +@node Experimental options, Deprecated options, Available options, Available options +@comment node-name, next, previous, up +@subsubsection Experimental options +There are some experimental options. These have not yet been heavily tested and should be used with caution. +@vtable @code +@item -optg + globally optimise code generation (full vector) +@item -make-sort + use sorted equations (sese, generated by make) +@item -no-reduce + try not to use symbolic algebra +@item -sort + use sorted equations (sese, generated by seqn) +@end vtable + +@node Deprecated options, , Experimental options, Available options +@comment node-name, next, previous, up +@subsubsection Deprecated options +C code generation is now deprecated in favour of C++ generation +@vtable @code +@item -c + c-code generation +@end vtable + +@node Model-specific options, , Available options, Options +@subsection Model specific options +@cindex Model-specific options +It is often desirable to keep the options used to build a model associated with the directory in which the model is contained, along with information about compiler options or paths to component libraries. In these cases, it is convenient to create an executable shell script, say @code{call_mtt} which sets environment variables and options before calling mtt proper, for example: +@example +@verbatim +#! /bin/sh +# call_mtt: sets model specific environment and options + +## Processor flags + +# use 32 bit Reduce +export SYMBOLIC="reduce" + +# set compiler debug and optimization options +export MTT_CXXFLAGS="${MTT_CXXFLAGS}\ + -Wall-Wno-unused -Wuninitialized\ + -O1 -march=pentiumpro -save-temps" + +## Model flags + +# use directory ../.. as base directory +export DIR=${DIR:-${PWD}/../..} + +# additional components are in directory ../comp +export MTT_COMPONENTS="${MTT_COMPONENTS}:${DIR}/comp" + +# additional constitutive relationships are in ../cr +export MTT_CRS="${MTT_CRS}:${DIR}/cr" + +# C header files in ../cr/h +export MTT_CXXINCS="${MTT_CXXINCS} -I${DIR}/cr/h" + +# call mtt with model specific options +exec ${MTTPATH}/mtt -cc -cr -i euler -D -optl -ntmpvar 1200 $* +@end verbatim +@end example + +which may then be used in place of mtt on the command line, + +@example +./call_mtt sys odeso gnuplot +@end example + +@node Utilities, , Options, User interface +@comment node-name, next, previous, up +@section Utilities +@cindex Utilities +@pindex Utilities +@strong{MTT} provides some utilities to help you keep track of model +building and to keep things clean and tidy. The commands, and there +purpose are: +@ftable @code +@item mtt help + Lists the help/browser commands +@item mtt copy + Copies the system (ie directory and enclosed files) to the +current working directory. +@item mtt rename + Renames all of the defining representations (@pxref{Defining +representations}) and textually changes each file appropriately. +@item mtt clean + Remove all files generated by @strong{MTT} associated with +system `system'. +@item mtt clean + Remove all files generated by @strong{MTT} associated with +all systems within the current directory. +@item mtt system representation vc + Apply version control to representation `representation' of +system `system'. +@item mtt system vc + Apply version control to all representations (under version control) +system `system'. +@end ftable +These are described in more detail in the following sections. + +@menu +* Help:: +* Copy:: +* Clean:: +* Version control:: +@end menu + +@node Help, Copy, Utilities, Utilities +@comment node-name, next, previous, up +@subsection Help +@cindex Help +@cindex browser +@strong{MTT} implements a browser to keep track of all the systems, +subsystems and constitutive relationships that you, and others may +write. It is invoked in the following ways: +@example + mtt help representations + mtt help components + mtt help examples + mtt help crs + mtt help representations + mtt help components + mtt help examples + mtt help crs + mtt help +@end example + +@menu +* help representations:: +* help components:: +* help examples:: +* help crs:: +* help :: +@end menu + +@node help representations, help components, Help, Help +@comment node-name, next, previous, up +@subsubsection help representations +@cindex help +@cindex representations + +The command +@example +mtt help representations +@end example +lists all of the representations (@pxref{Representations}) available in +@strong{MTT}. These may change as the version number of @strong{MTT} +increases. + +The command +@example +mtt help representations +@end example +lists those representation which contain the string @code{match_string}. +This string can be any regular expression (see standard Linux +documentation under @code{awk}). +For example +@example +mtt help representations descriptor +@end example +gives all representations containing the word @code{descriptor}. + +@node help components, help examples, help representations, Help +@comment node-name, next, previous, up +@subsubsection help components +@cindex help +@cindex components + +The command +@example +mtt help components +@end example +lists all of the components (@pxref{Components}) available in +@strong{MTT}. These may change as the version number of @strong{MTT} +increases. + +The command +@example +mtt help components +@end example +lists those component which contain the string @code{match_string}. +This string can be any regular expression (see standard Linux +documentation under @code{awk}). +For example +@example +mtt help components source +@end example +gives all components containing the word @code{component}. + +@node help examples, help crs, help components, Help +@comment node-name, next, previous, up +@subsubsection help examples +@cindex help +@cindex examples + +This command provides a good way to get started in @strong{MTT}. having +found an interesting example, copy it to your working directory using +@example +mtt copy +@end example +(@pxref{Copy}) + +@example +mtt help examples +@end example +lists all of the examples available in +@strong{MTT}. +This list will change as more examples are added. + +The command +@example +mtt help examples +@end example +lists those component which contain the string @code{match_string}. +This string can be any regular expression (see standard Linux +documentation under @code{awk}). +For example +@example +mtt help examples pharmokinetic +@end example +gives all examples containing the word @code{pharmokinetic}. + +@node help crs, help , help examples, Help +@comment node-name, next, previous, up +@subsubsection help crs +@cindex help +@cindex crs + +The command +@example +mtt help crs +@end example +lists all of the constitutive relationships (@pxref{Constitutive +relationship}) available in +@strong{MTT}. These may change as the version number of @strong{MTT} +increases. + +The command +@example +mtt help crs +@end example +lists those constitutive relationships which contain the string @code{match_string}. +This string can be any regular expression (see standard Linux +documentation under @code{awk}). +For example +@example +mtt help crs sin +@end example +gives all crs containing the word @code{sin}. + +@node help , , help crs, Help +@comment node-name, next, previous, up +@subsubsection help +@cindex help +@cindex + +The command +@example +mtt help +@end example +gives a detailed description of the entity called @code{name}. + +@node Copy, Clean, Help, Utilities +@comment node-name, next, previous, up +@subsection Copy +@cindex Copy + +@strong{MTT} provides a way of copying examples to your working directory: +@example +mtt copy +@end example + +Use the command +@example +mtt help examples +@end example +(@pxref{help examples}) to find something of interest. + +Note that components and constitutive relationships are automatically +copied when required. + +@node Clean, Version control, Copy, Utilities +@comment node-name, next, previous, up +@subsection Clean +@cindex Clean +@strong{MTT} generates a lot of representations in a number of +languages. +Some of these you will edit yourself; others can always be recreated by +@strong{MTT}. It makes sense, therefore to have a utility that removes +all of these other files when you have finished actively working with a +particular system. These are two versions: +@enumerate +@item +@code{mtt system clean} +@item +@code{mtt clean} +@end enumerate +The first removes all files that can be regenerated with @strong{MTT} +associated with system `system'; the second removes all such files +associated with all systems in the current working directory. + +The files which remain after such a clean are the Defining +representations (@pxref{Defining representations}). + +@node Version control, , Clean, Utilities +@comment node-name, next, previous, up +@subsection Version control +@cindex Version control + +When you are working on a modeling project, it is easy to forget what +changes you made to a system and why you made them. Sometimes, you may +regret some changes and wish to revert to an earlier version: even if +you use .old files this may be difficult to achieve safely. + +These are very similar problems to those faced by software developers +and can be solved in the same way: using version control.@strong{MTT} +provides version control using the standard GNU Revision Control System +(RCS). This is hidden from the user, but is fully complementary to +direct use of RCS (e.g. via emacs vc commands) to the more experienced +user who wishes to do so. + +The only files that you should ever change (i.e. the ones never +overwritten by @strong{MTT}) are the Defining representations +(@pxref{Defining representations}). + +All of the files, with the exception of @code{system_abg.fig}, +are initially created by @strong{MTT} and contain the RCS header for +version control. + + +The @strong{MTT} version control will automatically expand this part of +the text to include all change comments that you give it -- so will +direct use of RCS (e.g. via emacs vc commands) + +The @strong{MTT} version commands are as follows: +@ftable @code +@item mtt system representation vc + Apply version control to representation `representation' of +system `system'. +@item mtt system vc + Apply version control to all representations (under version control) +system `system'. +@end ftable + +The first is appropriate after you have made a revision to a single +file. It will prompt you for a change comment; this will be +automatically included in the file header. In addition, enough +information will be saved to enable any version to be retrieved via +RCS. + +The second is appropriate to record the state of the entire model. This +assumes that all relevant files have been recorded by the first version +of the command. Once again, old versions of the entire model can be +retrieved using the relevant RCS commands. + +A subdirectory `RCS' is created to hold this information. You need not +bother about the contents, except that you must not delete any files +within `RCS'. + +@node Creating Models, Simulation, User interface, Top +@comment node-name, next, previous, up +@chapter Creating Models +@cindex Creating Models + +@strong{MTT} helps you to analyse and transform system models -- +ultimately the process of capturing the real world in a model is up to +you. This chapter discusses the @strong{MTT} aspects of creating a +model. For convenience, this is divided into creating simple models and +creating complex models. + +@menu +* Quick start:: +* Creating simple models:: +* Creating complex models:: +@end menu + +@node Quick start, Creating simple models, Creating Models, Creating Models +@section Quick start +@cindex Quick start +@pindex Quick start + +It is probably worth a quick skim though @strong{MTT} to get a flavour of +what it can do before plunging into the detail of the rest of this +document. Here is a series of commands to do this. + +Copy an initial set of files describing the bond graph. +@example +mtt copy rc +@end example +@noindent +Move to it. +@example +cd rc +@end example +@noindent +@noindent +View the acausal bond graph (the system is called ``rc''). +@example +mtt rc abg view +@end example +@noindent +View the causal bond graph of the system. +@example +mtt rc cbg view +@end example +@noindent +View the corresponding ordinary differential equations (ode). +@example +mtt rc ode view +@end example +@noindent +View the system (output) step response +@example +mtt rc sro view +@end example + +@noindent +An alternative (but more general) way of achieving the same result is +@example +mtt -cc rc odeso view +@end example + +@noindent +View the system transfer function +@example +mtt rc tf view +@end example +@noindent +View the log modulus frequency response of the system. +@example +mtt rc lmfr view +@end example + +@noindent +View the log modulus frequency response of the system for 100 +logarithmically spaced frequencies in the range 0.1 to 10 +radians per second. +@example +mtt rc lmfr view 'W=logspace(-1,1,100);' +@end example + +@strong{MTT} has a report generation ((@pxref{Report}) facility which +can generate a hypertext description of the system. +@example +mtt rc rep hview +@end example + +The report contents are specified by the rep representation +(@pxref{Report}), in this case the corresponding file is: +@example +% %% Outline report file for system rc (rc_rep.txt) + +mtt rc abg tex +mtt rc struc tex +mtt rc cbg ps +mtt rc ode tex +mtt rc ode dvi +mtt rc sm tex +mtt rc tf tex +mtt rc tf dvi +mtt rc sro ps +mtt rc lmfr ps +mtt rc odes h +mtt rc numpar txt +mtt rc input txt +mtt -cc rc odeso ps +mtt rc rep txt +@end example +A non-hypertext version can be viewed using: +@example +mtt rc rep view +@end example + +Now have a go at modifying the bond graph. +@example +mtt rc abg fig +@end example +This brings up the bond graph in Xfig (@pxref{Xfig}). Try creating a +system with two rs and 2 cs. + +More examples can be found using +@example +mtt help examples +@end example +Details of an example can be found using +@example +mtt help +@end example +and copied using +@example +mtt copy +@end example + +Lots of examples are available. +@example +mtt help examples +@end example +lists them and +@example +mtt copy +@end example +gets you an example. + +@ifhtml +A number of examples are to be found + here. +@end ifhtml + +@node Creating simple models, Creating complex models, Quick start, Creating Models +@comment node-name, next, previous, up +@section Creating simple models +@cindex Creating simple models + +For then purposes of this section, simple models are those which are +built up from bond graphs involving predefined components. In contrast, +more complex systems (@pxref{Creating complex models}) need to be built +up hierarchically. + +The recommended sequence of steps to create a simple model is: +@enumerate +@item Decide on a name for the system; let us call it `syst' for the + purposes of this discussion. +@item Invoke the Bond Graph editor to draw the acausal Bond Graph. +@example + mtt syst abg fig +@end example +@item Draw the Bond Graph (@pxref{Language fig (abg.fig)}), including + the bonds (@pxref{Bonds}), the components (@pxref{Components}) and any + artwork (@pxref{artwork}) to make the Bond Graph more readable. The + graphical editor xfig is (@pxref{Xfig}) is self-explanatory. + The icon library is helpful here (see @pxref{icon library}). +@item Add causal strokes (@pxref{strokes}) where needed to define + causality. As a general rule, use the minimum number of strokes needed + to define the problem; this will often be only on the @code{SS} components. + (@pxref{SS components}). + + Save the bond graph. + +@item View the corresponding causal bond graph. +@example + mtt syst cbg view +@end example +@enumerate +@item + At this stage, @strong{MTT} will warn you that the labeled components do + not appear in the label file - this can safely be ignored. +@item + @strong{MTT} will indicate the percentage of components which are + causally complete -- ideally this will be 100%. Components which are + not causally complete will be listed. +@item + A view of the causal bond graph will be created. The added causal + strokes are indicated in blue, undercausal components in green and + overcausal components in red. +@item + If the bond graph is causally complete, proceed to the next step, + otherwise think hard and return to the first step. +@end enumerate + +@item +At this stage, no constitutive relationships have been +defined. Nevertheless, @strong{MTT} will proceed in a semi-qualitative +fashion by assuming that all constitutive relationships are unity (and +therefore linear). It may be useful at this stage to view various +derived representations to check the overall model properties before +proceeding further. For example: +@enumerate +@item +View the system Differential-algebraic equations +@example +mtt syst dae view +@end example +@item +View the system state matrices +@example +mtt syst sm view +@end example +@item +View the system transfer function +@example +mtt syst tf view +@end example +@item +View the system step response +@example +mtt syst sro view +@end example +@end enumerate + +@item +As well as creating the causal bond graph, @strong{MTT} has also +generated templates for other text files +(@pxref{Defining representations}) +used to further specify the +system. +These can now be edited using your favorite text editor (@pxref{Text +editors}). + +@item @strong{MTT} will now generate the representations +(@pxref{Representation summary})that you desire. +For example the system can be simulated by +@example +mtt syst odeso view +@end example +@strong{MTT} will complain if a component is named in the bond graph but +not in the label file and vice versa. This mainly to catch typing errors. + +@end enumerate + +@node Creating complex models, , Creating simple models, Creating Models +@comment node-name, next, previous, up +@section Creating complex models +@cindex Creating complex models + +Complex models -- in distinction to simple models (@pxref{Creating +simple models}) -- have a hierarchical structure. In particular, bond +graph components can be created by specifying their bond +graph. Typically, such components will have more than one port +(@pxref{Ports}); within each component, ports are represented by +named SS components (@pxref{Named SS components}); outwith +each component, ports are unambiguously identified by +labels (@pxref{Port labels}) and vector labels (@pxref{Vector port labels}). + +Complex models are thus created by conceptually decomposing the system +into simple subsystems, and then creating the corresponding bond graphs. +The procedure for simple systems (@pxref{Creating simple models}) is +then followed using the top level system (@pxref{Top level}); @strong{MTT} then recursively +operates on the lower level systems. + +The report representation (@pxref{Report}) provides a convenient way of +viewing a complex system. + +An example of such a system can be created as follows: +@example +mtt copy twolink +mtt twolink rep hview +@end example + +@ifhtml +The result is here. +@end ifhtml + +@menu +* Top level:: +@end menu + +@node Top level, , Creating complex models, Creating complex models +@comment node-name, next, previous, up +@subsection Top level +@cindex Top level +The top level of a complex model contains subsystems but is not, itself, +contained by other systems. +It has the following special features: +@itemize @bullet +@item +its name is used in the mtt command as the system name. +@item +all named SS componenents (@pxref{Named SS components}) are treated as +ordinary SS components (@pxref{SS components}). +@end itemize + + + +@c node next prev up +@node Simulation, Sensitivity models, Creating Models, Top +@chapter Simulation +@cindex Simulation +@pindex Simulation +One purpose of modelling is to simulate the modeled dynamic +system. Although this is just another transformation (@pxref{What is a +Transformation?}) and therefore is covered in the appropriate chapter +(@pxref{Representations}), it is important enough to be given its own +chapter. + +Simulation is typically performed using an appropriate simulation +language (which is often inappropriately conflated with modelling +tools). @strong{MTT} provides a number of alternative routes to +simulation based on the following representations (@pxref{Representations}): +@ftable @code +@item cse + constrained-state differential equation form +@item ode + ordinary differential (or state-space) equations +@c @item dae +@c differential-algebraic (or generalised state-space) equations -- +@c these may be linear or nonlinear. +@end ftable +in each case these equations may be +linear or nonlinear. + +Special cases of numerical simulation, appropriate to @emph{linear} +systems, are: +@ftable @code +@item ir + impulse response - state +@item iro + impulse response - output +@item sr + impulse response - state +@item sro + impulse response - output +@end ftable + +There are a number of languages (@pxref{Languages}) which can be used to describe these +representations for the purposes of numerical simulation: +@ftable @code +@item m + @code{octave} a high-level interactive language for numerical + computation. +@item c + @code{gcc} a c compiler. +@item cc + @code{g++} a C++ front-end to gcc. +@end ftable + +There are a number solution algorithms available: +@itemize @bullet +@item +explicit solution via the matrix exponential +@item +backward Euler integration (implicit) +@item +forward Euler integration (explicit) +@item +Runge Kutta IV integration (explicit, fixed step) +@item +Hybrd algebraic solver (MINPACK, Octave fsolve) +@c @item +@c LSODE (Hindmarsh's ODE solver as implemented in Octave) +@c @item +@c DASSL (Petzold's DAE solver as implemented in Octave) (Unavailable just now) +@end itemize + + However, all combinations of representation, language and solution +method are not supported by @strong{MTT} at the moment. Given a system +`system', some recommended commands are: +@ftable @code +@item mtt system iro view + creates the impulse response of a @emph{linear} system via the +system_sm.m representation using explicit solution via the matrix exponential. +@item mtt system sro view + creates the step response of a @emph{linear} system via the system_sm.m +representation using explicit solution via the matrix exponential. +@c @item mtt system odeso view +@c creates the step response of a @emph{nonlinear} system via the +@c system_ode.m representation using either METHOD=Euler or +@c METHOD=LSODE in the parameter file (@pxref{Simulation parameters}). +@item mtt -cc system odeso view + creates the response of a @emph{nonlinear} system via the +system_ode.cc representation using implicit integration. +@item mtt -cc -i euler system odeso view + creates the response of a @emph{nonlinear} system via the +system_ode.cc representation using euler integration. +@end ftable + +Simulation parameters are described in the system_simpar.txt file +(@pxref{Simulation parameters}). + +The steady-state solution of a system can also be +``simulated''(@pxref{Steady-state solutions}). +@menu +* Steady-state solutions:: +* Simulation parameters:: +* Simulation input:: +* Simulation logic:: +* Simulation initial state:: +* Simulation code:: +* Simulation output:: +@end menu + +@node Steady-state solutions, Simulation parameters, Simulation, Simulation +@comment node-name, next, previous, up +@section Steady-state solutions +@cindex Steady-state solutions + +@menu +* Steady-state solutions - numerical(odess):: +* Steady-state solutions - symbolic (ss):: +@end menu + +@node Steady-state solutions - numerical(odess), Steady-state solutions - symbolic (ss), Steady-state solutions, Steady-state solutions +@comment node-name, next, previous, up +@subsection Steady-state solutions (odess) +@cindex Steady-state solutions - numerical + +@strong{MTT} can compute the steady-state solutions of an ordinary +differential equation; this used the octave function `fsolve'. The +solution is computed as a function of time using the input specified in +the input file. The simulation parameter file (@pxref{Simulation +parameters}) is used to provide the time scales. + +For example +@example +mtt copy rc +cd rc +mtt rc odess view +@end example + +@node Steady-state solutions - symbolic (ss), , Steady-state solutions - numerical(odess), Steady-state solutions +@comment node-name, next, previous, up +@subsection Steady-state solutions (ss) +@cindex Steady-state solutions - symbolic +A rudimentary form of steady-state solution exists in mtt. +The steady states and inouts are supplied by the user in the file +system_simpar.r and the corresponding output and sate derivative +computed by @strong{MTT} using +@example +mtt system ss view +@end example + +For example +@example +mtt copy rc +cd rc +mtt rc sspar view +mtt rc ss view +@end example + + +@node Simulation parameters, Simulation input, Steady-state solutions, Simulation +@comment node-name, next, previous, up +@section Simulation parameters +@cindex Simulation parameters + +Simulation parameters are set in the system_simpar.txt file. At the +moment this sets the following variables: +@itemize @bullet +@item LAST + the last simulation time +@item DT + the incremental time (for plotting) +@item STEPFACTOR + the number of integration steps per DT -- thus the integration + interval is DT/STEPFACTOR +@c ; for sparse implicit integration (@pxref{Sparse +@c implicit integration}) the number of conjugate-gradient minimisation +@c steps. +@c @item METHOD +@c The integration methods available appear in the following table +@item WMIN + Minimum frequency = 10^WMIN +@item WMAX + Maximum frequency = 10^WMAX +@item WSTEPS + Number of Frequency steps. +@item INPUT + The input index for frequency response +@end itemize + +There are a number of solution algorithms +@itemize @bullet +@item Euler + basic Euler integration (@pxref{Euler integration}). This method +is simple, but not recommended for stiff systems. +@item Implicit + semi-implicit integration (@pxref{Implicit integration}) - uses the smx representation to give + stability. +@item Runge Kutta IV + fixed step Runge Kutta fourth order integration (@pxref{Runge Kutta IV integration}). +@item Hybrd + numerical algebraic equation solver + + +@c @item ImplicitS +@c Sparse semi-implicit integration (@pxref{Sparse implicit integration}) +@c -- takes advantage of the sparsity of the A matrix. +@c @item LSODE +@c the variable step-size method that comes with Octave (@pxref{Octave}). +@end itemize + +@menu +* Euler integration:: +* Implicit integration:: +* Runge Kutta IV integration:: +* Hybrd algebraic solver:: +@end menu + +@node Euler integration, Implicit integration, Simulation parameters, Simulation parameters +@comment node-name, next, previous, up +@subsection Euler integration +@cindex Euler integration +Euler integration approximates the solution of the Ordinary Differential Equation +@example +dx/dt = f(x,u) +@end example +by +@example +x := x + f(x,u)*DDT +@end example +where +@example +DDT = DT/STEPFACTOR +@end example +If the system is linear, stability is ensured if the integer STEPFACTOR +is chosen to be greater than the real number +@example +(maximum eigenvalue of -A)*DT/2 +@end example +where A is the nxn matrix appearing in +@example +f(x,u) = Ax + Bu +@end example +If the system is non linear, the linearised system matrix A should act +as a guide to the choice of STEPFACTOR. + +@node Implicit integration, Runge Kutta IV integration, Euler integration, Simulation parameters +@comment node-name, next, previous, up +@subsection Implicit integration +@cindex Implicit integration +Implicit integration approximates the solution of the Ordinary Differential Equation +@example +dx/dt = f(x,u) +@end example +by +@example +(I-A*DT)x := (I-A*DT)x + f(x,u)DT +@end example +where A is the linearised system matrix. This implies the solution of N +(=number of states) linear equations at each sample interval. The OCTAVE +version used the `\' operator to solve the set of linear equations, the +C version uses LU decomposition. + +If the system is linear, stability is ensured unconditionaly. If the +system is non-linear, then the method still works well. + +This method is nice in that choice of DT trades of accuracy against +computation time without compromising stability. In addition, the +correct stready-state values are achieved. + +This approach can also be used for constrained state equations of the +form: +@example +E(x) dx/dt = f(x,u) +@end example +where E(x) is a state-dependent matrix. The approximate solution is then +given by: +@example +(E(x)-A*DT)x := (E(x)-A*DT)x + f(x,u)DT +@end example +which reduces to the ordinary differential equation case when E(x)=I. + +The _smx representation includes the E matrix. + +@node Runge Kutta IV integration, Hybrd algebraic solver, Implicit integration, Simulation parameters +@comment node-name, next, previous, up +@subsection Runge Kutta IV integration +Runge Kutta IV approximates the solution of the Ordinary Differential Equation + +@example +dx/dt = f(x,t) +@end example + +by + +@example +x := x + (DT/6)*(k1 + 2*k2 + 2*k3 + k4) +@end example + +where + +@example +k1 := f(x,t) +k2 := f(x+(1/2)*k1,t+(1/2)*DT) +k3 := f(x+(1/2)*k2,t+(1/2)*DT) +k4 := f(x+k3,t+DT) +@end example + +The @strong{MTT} implementation of Runge-Kutta integration +is a fourth order, fixed-step, explicit integration method. + +For some systems of equations, the increased accuracy of using a fourth order +method can allow larger step-lengths to be used than would allowed by the + lower order Euler integration method. + +It should be noted that during the interemediate calculations (k1...k4), + the input vector @code{u} is not advanced w.r.t. time; the system inputs are +assumed to be constant over the period of the integration step-length. + +@node Hybrd algebraic solver, , Runge Kutta IV integration, Simulation parameters +@comment node-name, next, previous, up +@subsection Hybrd algebraic solver + +The hybrd algebraic solver of @uref{http://www.netlib.org/minpack/hybrd.f,MINPACK}, +which is used by Octave in the @code{fsolve} routine, may be used in conjunction +with one of the other integration methods to solve semi-explicit, index 1, differential +algebraic equations; these may be generated in @strong{MTT} models by use of +@code{unknown} SS Components @pxref{SS component labels}. + +This method requires that compiled simulation code is used; either -cc or -oct. +To perform a simulation based on a model @code{sys}, + +@example +mtt -cc -ae hybrd -i euler sys odeso view +@c XXX: should be daeso view? +@end example + +@strong{MTT} will attempt to minimise the residual error at each integration time-step +using the hybrd routine. + +This method of simulation is particularly well suited to stiff systems where very fast +dynamics are of little interest. Care must be taken to ensure that an acceptable level +of convergence is achieved by the solver for the system under investigation. +@c XXX: tolerance option + +@c @node Sparse implicit integration, , Implicit integration, Simulation parameters +@c @comment node-name, next, previous, up +@c @subsection Sparse implicit integration +@c @cindex Sparse implicit integration +@c This is an experimental approach for large (N>50) systems. + +@c Implicit integration (@pxref{Implicit integration}) requires the +@c solution of N linear equations at each step. This is an O(N^3) operation +@c which can be time consuming for large (N>50) systems. However, the A +@c matrix (and hence the (I-A*DT) matrix) is often sparse - most elements +@c are zero. + +@c This method uses a conjugate-gradient optimisation method to solve the +@c linear equations +@c @example +@c (I-A*DT)x := (I-A*DT)x + f(x,u)DT +@c @end example +@c by recasting them as the minimisation of the quadratic function +@c @example +@c [(I-A*DT)x_new - (I-A*DT)x_old + f(x,u)DT]^2 +@c @end example +@c with respect to x_new. This is solved by the conjugate gradient method. +@c MTT generates two representations _smxx.m and _smxtx to compute +@c (I-A*DT)x and (I-A*DT)'x respectively making full use of the sparsity of +@c the (I-A*DT) matrices to speed up the minimisation procedure. + +@c A fixed number of iterations (STEPFACTOR) are used in each optimisation +@c to give a fixed simulation time. This must be chosen by the user, but +@c between 5N and 10N seems ok. Note that the initial value of the +@c optimisation is x_old. + +@node Simulation input, Simulation logic, Simulation parameters, Simulation +@comment node-name, next, previous, up +@section Simulation input +@cindex Simulation input +This is defined in the system_input.txt file. A default file is created +automatically by @strong{MTT}. This is done explicitly by +@example +mtt system input txt +@end example +If the file already exists, the same command checks that all inputs are +defined and that all defined inputs exist in the system and promts the +user to correct discrepancies. + +Inputs are defined by the full system name appearing in the structure +file (@pxref{Structure (struc)}). They can depend on states (again defined by +name), time (defined by t) and parameters + +For example: +@example +system_pump_l_1_u = 4e5*atm; +system_pump_r_1_u = 4e5*(t<10)*atm; +system_ss_i = 0*kg; +system_ss_o = 3e-3*kg; +system_v_1_u = (t>10); +system_v_ll_1_u = 1; +system_v_lr_1_u = (t<10); +system_v_ul_1_u = 0; +system_v_ur_1_u = (t>10); +@end example + +@node Simulation logic, Simulation initial state, Simulation input, Simulation +@comment node-name, next, previous, up +@section Simulation logic +@cindex Simulation logic +This is defined in the system_logic.txt file. A default file is created +automatically by @strong{MTT}. This is done explicitly by +@example +mtt system logic txt +@end example +If the file already exists, the same command checks that the logic +corresponding to all switch states (@pxref{Switched systems}) are +defined and that all defined logic exists in the system and promts the +user to correct discrepancies. + +Logical inputs are defined by the full system name corresponding to +MTT_switch components appearing in the structure file (@pxref{Structure +(struc)}) @emph{with `_logic' appended}. They can depend on states (again defined by name), time +(defined by t) and parameters + +For example: +@example +bounce_ground_1_mtt_switch_logic = bounce_intf_1_mtt3<0; +@end example + +@node Simulation initial state, Simulation code, Simulation logic, Simulation +@comment node-name, next, previous, up +@section Simulation initial state +@cindex Simulation initial state +This is defined in the system_state.txt file. A default file is created +automatically by @strong{MTT}. This is done explicitly by +@example +mtt system state txt +@end example +If the file already exists, the same command checks that all states are +defined and that all defined states exist in the system and prompts the +user to correct discrepancies. + +States are defined by the full system name appearing in the structure +file (@pxref{Structure (struc)}). They can depend on parameters. +For example +@example +system_c_l = (1e4/k_l)/kg; +system_c_ll = (1e4/k_s)/kg; +system_c_lr = (1e4/k_s)/kg; +system_c_u = (1e4/k_l)/kg; +@end example + + +@c The initial state of a simulation of is set in the @code{state} +@c representation with the language @code{txt}. + +@c As usual, @strong{MTT} defaults this for you. There are two +@c possibilities +@c @itemize @bullet +@c @item +@c The -ss switch is not present: the states default to zero +@c @item +@c The -ss switch is present: the states default to those set in the +@c sspar.r file. +@c @end itemize + +@node Simulation code, Simulation output, Simulation initial state, Simulation +@comment node-name, next, previous, up +@section Simulation code +simulation code can be generated by @strong{MTT} in the form +of the @code{ode2odes} transformation. This can be produced in a number +of languages, including .m, .oct, C and C++ @pxref{Languages}. + +To generate simulation code in C (deprecated): +@example +mtt -c [options] sys ode2odes c +@end example + +Similarly, to generate C++ code: +@example +mtt -cc [options] sys ode2odes cc +@end example + +To generate an executable based on the C++ representation: +@example +mtt -cc [options] sys ode2odes exe +@end example + +@menu +* Dynamically linked functions:: +@end menu + +@node Dynamically linked functions, , Simulation code, Simulation code +@comment node-name, next, previous, up +@subsection Dynamically linked functions +@cindex Compiling C++ files +@cindex mex files +@cindex oct files +Some model representations can be compiled into dynamically loaded +code (shared objects) which are compiled prior to use in other +modelling and simulation environments; in particular, .oct files can +be generated for use in GNU Octave (@pxref{Creating GNU Octave .oct +files}) and .mex files can be generated for use in Matlab +(@pxref{Creating Matlab .mex files}) or Simulink (@pxref{Embedding MTT +models in Simulink}). The use of compiled (and possibly +compiler-optimised) code can offer significant processing speed +advantages over equivalent interpreted functions (e.g. .m files) for +computationally intensive procedures. + +The C++ code generated by @strong{MTT} allows the same code to be +generated as standalone code, Octave .oct files or Matlab .mexglx +files. Although @strong{MTT} usually takes care of the compilation +options, if it is necessary to compile the code on a machine on which +@strong{MTT} is not installed, the appropriate flag should be passed +to the compiler pre-processor: +@itemize @bullet +@item +@code{-DCODEGENTARGET=STANDALONE} +@item +@code{-DCODEGENTARGET=OCTAVEDLD} +@item +@code{-DCODEGENTARGET=MATLABMEX} +@end itemize + +@node Simulation output, , Simulation code, Simulation +@comment node-name, next, previous, up +@section Simulation output +@cindex Simulation output +The view (@pxref{Views}) representation provides a graphical +representation of the results of a simulation; the postscript language +provides the same thing in a form that can be included in a document. + +These are two simulation output representations +@ftable @code +@item odes + ordinary differential equation solution (states) +@item odeso + ordinary differential equation solution (output) +@end ftable + +Particular output variables can be selected by adding a fourth argument +in one of 2 forms +@ftable @code +@item 'name1;name2;..;namen' + plot the variables with names na1 .. namen against time +@item 'name1:name2' + plot the variable with name2 against that with name 1 +@end ftable + +An example of plotting a single variable against time is: +@example +mtt -o -cc -ss OttoCycle odeso ps 'OttoCycle_cycle_V' +@end example +An example of plotting one variable against another is: +@example +mtt -o -cc -ss OttoCycle odeso ps 'OttoCycle_cycle_V:OttoCycle_cycle_P' +@end example + +@menu +* Viewing results with gnuplot:: +* Exporting results to SciGraphica:: +@end menu + +@node Viewing results with gnuplot, Exporting results to SciGraphica, Simulation output, Simulation output +@comment node-name, next, previous, up@subsection +@subsection Viewing results with gnuplot +@cindex gnuplot + +Simulation plots may be conveniently selected, viewed with +@uref{http://www.gnuplot.org,gnuplot} +and saved to file (in PostScript format) using the command + +@example +mtt [options] rc odeso gnuplot +@end example + +This will cause a menu to be displayed, from which states and outputs may be selected for viewing. Clicking on a @emph{parameter name} will, by default, cause the time history of the selected parameter to be displayed. + +As with @strong{xMTT} (@pxref{Menu-driven interface}), the Wish Tcl/Tk interpreter must be installed to make use of this feature. + +@node Exporting results to SciGraphica, , Viewing results with gnuplot, Simulation output +@comment node-name, next, previous, up +@subsection Exporting results to SciGraphica +@cindex SciGraphica + +Simulation results can be converted into an XML-format +@uref{http://scigraphica.sourceforge.net,SciGraphica} (version 0.61) +@emph{.sg} file with the command + +@example +mtt [options] sys odes sg +@end example + +The SciGraphica file will contain two worksheets, X_sys and Y_sys, containing +the state and output time-histories from the simulation. + +@c node next prev up +@node Sensitivity models, Representations, Simulation, Top +@chapter Sensitivity models +@cindex Sensitivity models +@pindex Sensitivity models + +The sensitivity model of a system is a set of equations giving the +sensitivity of the system outputs with respect to system parameters. +@strong{MTT} has built in methods for assisting with the development of +such models. + +This feature is experimental at the moment, but the following example +gives an idea of what can be achieved. +@example +mtt copy rc +cd rc +mtt -s src ode view +mtt -s src odeso view +@end example +The sensitivity system src is automatically created from the system rc +using the predefined sR and sC components together with vector junctions +(@pxref{Vector components}). The four outputs are the two system +outputs plus the two sensitivity functions. + +An alternative route is to create the sensitivity functions by symbolic +differentiation. +The following sensitivity representations are available: +@ftable @code +@item scse + sensitivity constrained-state equations +@item sm + sensitivity state matrices +@item scsm + sensitivity constrained-state matrices +@end ftable + + + +@c node next prev up +@node Representations, Extending MTT, Sensitivity models, Top +@chapter Representations +@cindex Representations +@pindex Representations +@cindex Defining representations +@cindex Representations, defining + +As discussed in @ref{What is a Representation?}, a system has many +representations. The purpose of @strong{MTT} is to provide an easy way to +generate such representation by applying the appropriate sequence of +transformations. The representations supported by @strong{MTT} are +summarised in @ref{Representation summary}. + +There is a two-fold division of representations into those with which the user +defines the system and its various attributes, and those which are +derived from these. The @emph{defining representations} are listed in +@ref{Defining representations}. + +Each representation is implemented in one or more languages depending on +its use. These languages are discussed in @ref{Languages} and are +associated with appropriate tools for modifying or viewing the +representations. + +@menu +* Representation summary:: +* Defining representations:: +* Verbal description (desc):: +* Acausal bond graph (abg):: +* Acausal bond graph - LaTeX ready (labg):: +* Stripped acausal bond graph (sabg):: +* Labels (lbl):: +* Structure (struc):: +* Constitutive Relationship (cr):: +* Parameters:: +* Causal bond graph (cbg):: +* Elementary system equations:: +* Differential-Algebraic Equations:: +* Constrained-state Equations:: +* Ordinary Differential Equations:: +* Descriptor matrices:: +* Report:: +@end menu + +@node Representation summary, Defining representations, Representations, Representations +@comment node-name, next, previous, up +@section Representation summary +@cindex Representation summary + +Some of the the representations +available in @strong{MTT} are (in alphabetical order): +@ftable @code +@item abg + acausal bond graph +@item cbg + causal bond graph +@item cr + constitutive relationship for each subsystem +@item cse + constrained-state equations +@item csm + constrained-state matrices +@item dae + differential-algebraic equations +@item daes + dae solution - state +@item daeso + dae solution - output +@item def + definitions - system orders etc. +@item desc + Verbal description of system +@item dm + descriptor matrices +@item ese + elementary system equations +@item fr + frequency response +@item input + numerical input declaration +@item ir + impulse response - state +@item iro + impulse response - output +@item lbl + label file +@item lmfr + loglog modulus frequency response +@item lpfr + semilog phase frequency response +@item nifr + Nichols style frequency response +@item numpar + numerical parameter declaration +@item nyfr + Nyquist style frequency response +@item obs + observer equations for CGPC +@item ode + ordinary differential equations +@item odes + ode solution - state +@item odes + ODE simulation header file +@item odeso + ode solution - output +@item odess + ode numerical steady-states - states +@item odesso + ode numerical steady-states - outputs +@item rbg + raw bond graph +@item rep + report +@item rfe + robot-form equations +@item sabg + stripped acausal bond graph +@item simp + simplification information +@item sm + state matrices +@item smx + state matrices containing explicit states and inputs +@item sms + ode +@item smss + SM simulation header file +@item sr + step response - state +@item sro + step response - output +@item ss + steady-state equations +@item sspar + steady-state definition +@item struc + structure - list of inputs, outputs and states +@item sub + Executable subsystem list +@item sub + LaTeX subsystem list +@item sympar + symbolic parameters +@item tf + transfer function +@end ftable +A complete list can be found via the @code{help representations} command +(@pxref{help representations}). + +Many of these representations have more than one language (@pxref{Representations}) associated +with them. + +Some of these representations define the system (@pxref{Defining +representations}). + +@node Defining representations, Verbal description (desc), Representation summary, Representations +@comment node-name, next, previous, up +@section Defining representations +@cindex Defining representations + +The following representations define the system and therefore must, +ultimately, be defined by the user. However, all of these are assigned +default values by @strong{MTT} and may then be subsequently edited +(@pxref{Text editors}) viewed or operated on by the appropriate tools +(@pxref{Language tools}). +@vtable @code +@item system_abg.fig + the acausal bond graph (@pxref{Acausal bond graph (abg)}) +@item system_lbl.txt + the label file (@pxref{Labels (lbl)}) +@item system_desc.tex + the description file (@pxref{Detailed}) +@item system_simp.r + algebraic simplifications to make output more readable + (@pxref{Symbolic parameters for simplification (simp.r)}) +@item system_subs.r + algebraic substitutions to resolve, eq trig. identities + (@pxref{Symbolic parameters (subs.r)}) +@item system_simpar.txt + simulation parameters (@pxref{Simulation parameters}) +@item system_numpar.txt + numerical parameters (@pxref{Numeric parameters (numpar)}) +@item system_input.txt + the system input for simulations (@pxref{Simulation input}) +@item system_logic.txt + the switching logic for simulations (@pxref{Simulation logic}) +@item system_sspar.r + defines the system steady-state (@pxref{Steady-state solutions - symbolic (ss)}) +@end vtable + +@node Verbal description (desc), Acausal bond graph (abg), Defining representations, Representations +@comment node-name, next, previous, up +@section Verbal description (desc) +@cindex Verbal description (desc) + +Systems can be documented in LaTeX using the _desc.tex file. This file +is included in the report (@pxref{Report}) if the abg tex option +is included in the rep.txt file. As usual, @strong{MTT} provides a +default text file to be edited by the user (@pxref{Text editors}). + + +@c node next prev up +@node Acausal bond graph (abg), Acausal bond graph - LaTeX ready (labg), Verbal description (desc), Representations +@section Acausal bond graph (abg) +@cindex Acausal bond graph (abg) +@pindex Acausal bond graph (abg) + +The acausal bond graph is the main input to @strong{MTT}. It is up to you, as a +system modeler, to distill the essential aspects of the system that you +wish to model and capture this information in the form of a bond graph. + +The inexperienced modeler may wish to look in one of the standard +textbooks and copy some bond graphs of systems to get going. + + +To create the acausal bond graph of system `sys' in language fig type: +@example +mtt sys abg fig +@end example +To create the acausal bond graph of system `sys' in language m type: +@example +mtt sys abg m +@end example +To view the acausal bond graph of system `sys' type: +@example +mtt sys abg view +@end example + +@menu +* Language fig (abg.fig):: +* Language m (rbg.m):: +* Language m (abg.m):: +* Language tex (abg.tex):: +@end menu + +@node Acausal bond graph - LaTeX ready (labg), Stripped acausal bond graph (sabg), Acausal bond graph (abg), Representations +@section Acausal bond graph - LaTeX ready (labg) +@cindex Acausal bond graph - LaTeX ready (labg) +@pindex Acausal bond graph - LaTeX ready (labg) +This representation exists in the fig (@pxref{Language fig (abg.fig)}) +only. It is used for high-quality figures generated using fig2dev with +the -Lpstex option. + +@menu +* Language fig (abg.fig):: +* Language m (rbg.m):: +* Language m (abg.m):: +* Language tex (abg.tex):: +@end menu + +@node Language fig (abg.fig), Language m (rbg.m), Acausal bond graph - LaTeX ready (labg), Acausal bond graph - LaTeX ready (labg) +@subsection Language fig (abg.fig) +@cindex Language fig (abg.fig) +@pindex Language fig (abg.fig) + +A bond graph is made up of: +@ftable @code +@item bonds + To connect components together. +@item strokes + To indicate causality. +@item components + Either simple or compound. +@item artwork + Irrelevant to the system but useful to the user. +@end ftable + +An icon library of bonds, components and other symbols is available +within xfig (@pxref{icon library}). + + + + +@menu +* icon library:: +* bonds:: +* strokes:: +* components:: +* Simple components:: +* SS components:: +* Simple components - implementation:: +* Compound components:: +* Named SS components:: +* Coerced bond direction:: +* Port labels:: +* Vector port labels:: +* Port label defaults:: +* Vector components:: +* artwork:: +* Valid names:: +@end menu + +@node icon library, bonds, Language fig (abg.fig), Language fig (abg.fig) +@subsubsection Icon library +@cindex Icon +@cindex library +A number of predefined iconic symbols are available within xfig. +@example +Click onto the library icon +Click onto the library pull-down menu and select BondGraph +Select iconic symbols from the presented list +@end example + +@node bonds, strokes, icon library, Language fig (abg.fig) +@subsubsection Bonds +@cindex bonds +@pindex bonds + +Bonds are represented by polylines with two segments. They must be the +default style (i.e. plain not dashed or dotted). The shortest segment is +taken to be the half-arrow. its positioning is significant because: +@itemize @bullet +@item +It points in the direction of power flow; thus a bond normally points +towards C, I and R components. +@item +the corresponding side of the bond indicates flow causality; the other +side represents effort causality. This is significant when using causal +half-strokes (@pxref{strokes}). Please adopt the convention of having +the half-arrows below horizontal bonds and to the right of vertical bonds. +@end itemize + + + +@c node next prev up +@node strokes, components, bonds, Language fig (abg.fig) +@subsubsection Strokes +@cindex strokes +@pindex strokes + +Causal strokes are represented by single-segment polylines. +There are two sorts of strokes: +@itemize @bullet +@item +@emph{Full} strokes: these are the usual bond-graph strokes and determine +both the effort and flow causality in the usual way. The @emph{centre} of the +stroke should be at about one end of the bond and be at right angles to +it. +@item +@emph{Half} strokes: these are an innovation in @strong{MTT} and allow you to +specify the effort and flow causality independently. The @emph{end} of the +stroke should be at about one end of the bond and be at right angles to +it. If the causal half-stroke is on the @emph{same} side as the half-arrow +(@pxref{bonds}) then it determines @emph{flow} causality; if, on the other +hand, it is on the @emph{opposite} side to the half-arrow +(@pxref{bonds}) then it determines @emph{effort} causality. +Two half strokes on the @emph{same}, but on @emph{opposite} sides of the +bond are equivalent to a a full stroke at the same end of the bond. +@end itemize + +@strong{MTT} is reasonably forgiving; but a neat diagram will be less ambiguous to +you as well as to @strong{MTT}. + +Causality is indicated as follows: +@itemize @bullet +@item +@emph{Effort} is imposed at the @emph{same} end as the stroke. +@item +@emph{Flow} is imposed at the @emph{opposite} end as the stroke. +@end itemize + + + +@c node next prev up +@node components, Simple components, strokes, Language fig (abg.fig) +@subsubsection Components +@cindex components +@pindex components + +Components are represented by a text string in fig. The recommended +style is: 20pt, Times-Roman and centre justified. + +The component text string can be of the following forms: +@ftable @code +@item type +Just the type of the component is indicated. Components may be either +Simple components (@pxref{Simple components}) or Compound components +(@pxref{Compound components}). For example: +@example +R +@end example +@item type:label +Both the type and the label of the component are given. The type must be +a valid name (@pxref{Valid names}.The name provides a link to more +information to be found in @xref{Labels (lbl)}. For example: +@example +R:r +@end example +@item type:label:cr +Not only are the type and the label of the component given, but also the +component cr argument. The type must be +a valid name (@pxref{Valid names}.The name provides a link to more +information to be found in @xref{Labels (lbl)}. For example: +@example +R:r:flow,r +@end example +@item type:label:expression +Expression is a mathematical expression relating the effort (called +mtt_e) to the flow (called mtt_f). +For example the following three forms are equivalent +@example +R:r:mtt_e=r*mtt_f +R:r:mtt_e-r*mtt_f=0 +R:r:mtt_f=mtt_e/r +@end example +A non-linear example is: +@example +R:r:mtt_e = sin(mtt_f) +@end example + +@item type*n +The name, together with the number @samp{n} of repetitions of the +component, are given. This repetition only makes sense if the component +has an even number of ports (@pxref{Port labels}); n copies of the component +are concatenated with odd Named ports (@pxref{Port labels}) of the +component being connected to the even Named ports of the previous +component in the chain in numerical order. This feature is particularly +useful if the component is compound and can be used for, example to give +a lumped approximation of a distributed system. For example: +@example +MySystem*25 +@end example +@item type:label*n +This complete form and is a combination of the simpler forms. For +example: +@example +MySystem:MyLabel*25 +@end example + +@end ftable + +@node Simple components, SS components, components, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection Simple components +@cindex Simple components + +The following simple components are defined in MTT. + +@ftable @code +@item R + Standard one-port R +@item C + Standard one-port C +@item I + Standard one-port I +@item SS + Source-sensor +@item TF + Transformer +@item GY + Gyrator +@item AE + Effort amplifier +@item AF + Flow amplifier +@item CSW + Switched one-port C +@item ISW + Switched one-port I +@end ftable + +@menu +* SS components:: +* Simple components - implementation:: +@end menu + +@node SS components, Simple components - implementation, Simple components, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection SS components +@cindex SS components + +@iftex +$$ + +@end iftex + + +@code{SS} components provide input and output variables for a system; +Named SS components (@pxref{Named SS components}) provide this for +subsystems. + +@node Simple components - implementation, Compound components, SS components, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection Simple components - implementation +@cindex Simple components - implementation + +Each simple component, with name NAME, is defined by two m files: +@ftable @code +@item NAME_cause.m + defines the possible causal patterns for the component +@item NAME_eqn.m + defines the equations generated +@end ftable +Only the experienced user would normally define simple components - +Compound components (@pxref{Compound components}) are recommended for +DIY components. + +@node Compound components, Named SS components, Simple components - implementation, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection Compound components +@cindex Compound components +@cindex Named SS +Compound components are systems described by bond graphs and implemented +by MTT. They have special SS components, Named SS components +(@pxref{Named SS components}), to indicate connections to the +encapsulating system. + +Like any other system, they are described by a graphical Bond Graph description +(@pxref{Language fig (abg.fig)}), and a label file (@pxref{Labels (lbl)}). + +By convention, all of the files describing a component live in a +directory with the same name as the component. + +@menu +* Named SS components:: +@end menu + +@node Named SS components, Coerced bond direction, Compound components, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection Named SS components +@cindex Named SS components + +Named SS components provide the link from the system which @emph{defines} +compound component to the system which @emph{uses} a compound +component @pxref{Compound components}. +A named SS components is of the form +@code{SS:[name]}; + +Where `name' is a name consisting of alphanumeric characters and +underscore; for example: +@example +SS:[Mechanical_1] +@end example +Each such named SS provides one of the ports +(@pxref{Ports}). +The direction of the named SS components. +(@pxref{Named SS components}) +is coerced (@pxref{Coerced bond direction}) to have the same direction +as the bond connected to the corresponding port. Thus the direction of +the direction of the named SS components has no significance unless the +component is at the top level of a system. + +If a named SS component exists at the top level (@pxref{Top level}) +and is treated as an +ordinary SS component with the given direction and with the attributes +specified in the label file (@pxref{Labels (lbl)}). + +@node Coerced bond direction, Port labels, Named SS components, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection Coerced bond direction +@cindex Coerced bond direction +@pindex Coerced bond direction +Named SS components (@pxref{Named SS components}) provide the mechanism +for declaring the ports (@pxref{Ports}) of a component. The +corresponding bond has a direction. However, under some circumstances, +it may be useful to reverse this direction. @strong{MTT} provides a +coercion mechanism for this: the the direction of the bond attached to +the named SS component (@pxref{Named SS components}) is replaced by the +direction of the bond attached to the component port. + +@node Port labels, Vector port labels, Coerced bond direction, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection Port labels +@cindex ports +@pindex ports +Most multi-port components have ports +@pxref{Ports})which display different +behaviors; the exception to this is the junction (@code{0} and @code{1}) +components. For this reason, @strong{MTT} provides a method for unambiguously +identifying the ports of a multi-port component by port labels. + +A port label is indicated by a name within parentheses of the form +@code{[name]}, where `name' is a name consisting of alphanumeric +characters and underscore; for example: +@example +[Mechanical_1] +@end example +This provides a label for corresponding to the component to which the +nearest bond-end is attached. + +The following rules must be be obeyed: +@itemize @bullet +@item +If a component has any port labels at all, there must be one for each +port of the component. +@c @item +@c If a component is to be used repetitively (see @ref{components}), it +@c must have an even number of ports and the odd ports are connected to the +@c even points within the chain of components. +@end itemize + +Port labels may be grouped into vector port labels (@pxref{Vector port +labels}). Components with compatible (ie containing the same number of ports) +vector ports may be connected by a @emph{single} bond +(@pxref{Bonds}); such a bond implies the corresponding number of bonds +(one for each element of the vector port label). All such bonds inherit +the same direction and any @emph{explicit} causal strokes (@pxref{strokes}) + +@node Vector port labels, Port label defaults, Port labels, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection Vector port labels +@cindex vector port labels +@cindex port labels +Port labels (@pxref{Port labels}) may be grouped into vector port +labels of the form @code{[name1,name2,name3]}. +@example +[Mechanical_1,Electrical,Hydraulic_5] +@end example + +@node Port label defaults, Vector components, Vector port labels, Language fig (abg.fig) +@comment node-name, next, previous, up +@subsubsection Port label defaults +@cindex Port label defaults +@pindex Port label defaults +Whether impicitly or explicity, all ports of components (with the +exception of 0 and 1 junctions) must have labels (@pxref{Port +labels}). However, these can be omitted from the bond graph in the +following circumstances and default labels are supplied by @strong{MTT}. +@enumerate +@item A single unlabled inport defaults to [in] +@item A single unlabled outport defaults to [out] +@end enumerate + +These defaults may, in turn be aliases (@pxref{Aliases}) for port labels +(@pxref{Port labels}) or vector port labels (@pxref{Vector port +labels}). Combining the default and alias mechanism is a powerful tool +for creating uncluttered, yet complex, bond graph models. + +@node Vector components, artwork, Port label defaults, Language fig (abg.fig) +@subsubsection Vector Components +@cindex Vector components +@pindex Vector components +Vectors of components can be created in four cases: +@code{0} junctions, +@code{1} junctions, +@code{SS} components and +@code{SS} port components. + + +In each case, the presence of a vector component is indicated by a +single port label (@pxref{Port labels}) of one of two forms: +@enumerate +@item containing numerals from 1 to +the order of the vector. Thus a vector of 3 components is indicated by a +port label of the form [1,2,3]. +@item 1: followed by +the order of the vector. Thus a vector of 3 components is indicated by a +port label of the form [1:3]. +@end enumerate + + +Within the corresponding label file (@pxref{Labels (lbl)}), the +components of a vector port can be accessed using _i where i is the +corresponding index. Thus a port SS:[Electrical] appearing near the port +label [1,2,3] could contain the port alias (@pxref{Port aliases}) +@example +%ALIAS in Electrical_1,Electrical_2,Electrical_3 +@end example + +@node artwork, Valid names, Vector components, Language fig (abg.fig) +@subsubsection Artwork +@cindex artwork +@pindex artwork +You are encouraged to annotate your bond graphs extensively - this makes +them an immediately readable document whilst retaining the precise and +unambiguous expressive power of the bond graph. + +You may add any Fig (@pxref{Fig}) object to the bond graph as long as it +will not be interpreted as part of the bond graph. +The reccommended way to acheive this is to put the Bond Graph at depth +0,10,20 etc (ie depth modulo 10 is zero) and artwork at any other depth. +@c The recommended way to do this is to @emph{put all artwork at or below +@c Depth 1} in the figure. @strong{MTT} ignores all objects not at depth 0. + + +For compatibility with earlier versions of @strong{MTT}, the following +objects are ignored even at level 0. However, their use is strongly +discouraged. +@itemize @bullet +@item +Adding text is OK as long as it cannot be confused with components +(@pxref{components}). In particular, you can include invalid component +characters such as white space, @code{"}, @code{'}, @code{!} etc. +@item +Adding boxes, arcs etc is always OK. +@item +Adding dotted or dashes lines is always OK. +@end itemize + +The stripped abg file (sabg) (@pxref{Stripped acausal bond graph +(sabg)}) +shows only those parts of the diagram recognised by @strong{MTT} and is +therefore useful for distinguishing artwork. + +@node Valid names, , artwork, Language fig (abg.fig) +@subsubsection Valid Names +@cindex valid name +@pindex valid name +A valid name is a text string containing alphanumeric characters. It +must @strong{NOT} contain underscore @samp{_}, hyphen @samp{-}, @samp{:} +or @samp{*}. + +The following names should be avoided +@example +if endif +@end example + + +The following reserved words in reduce should also be avoided (with any case) +@example +Commands ALGEBRAIC ANTISYMMETRIC ARRAY BYE CLEAR CLEARRULES COMMENT +CONT DECOMPOSE DEFINE DEPEND DISPLAY ED EDITDEF END EVEN FACTOR FOR +FORALL FOREACH GO GOTO IF IN INDEX INFIX INPUT INTEGER KORDER LET +LINEAR LISP LISTARGP LOAD LOAD PACKAGE MASS MATCH MATRIX MSHELL +NODEPEND NONCOM NONZERO NOSPUR ODD OFF ON OPERATOR ORDER OUT PAUSE +PRECEDENCE PRINT PRECISION PROCEDURE QUIT REAL REMFAC REMIND RETRY +RETURN SAVEAS SCALAR SETMOD SHARE SHOWTIME SHUT SPUR SYMBOLIC +SYMMETRIC VECDIM VECTOR WEIGHT WRITE WTLEVEL + +Boolean Operators EVENP FIXP FREEOF NUMBERP ORDP PRIMEP + +Infix Operators := = >= > <= < => + * / ^ ** . WHERE SETQ OR AND +MEMBER MEMQ EQUAL NEQ EQ GEQ GREATERP LEQ LESSP PLUS DIFFERENCE MINUS +TIMES QUOTIENT EXPT CONS Numerical Operators ABS ACOS ACOSH ACOT ACOTH +ACSC ACSCH ASEC ASECH ASIN ASINH ATAN ATANH ATAN2 COS COSH COT COTH +CSC CSCH EXP FACTORIAL FIX FLOOR HYPOT LN LOG LOGB LOG10 NEXTPRIME +ROUND SEC SECH SIN SINH SQRT TAN TANH + +Prefix Operators APPEND ARGLENGTH CEILING COEFF COEFFN COFACTOR CONJ +DEG DEN DET DF DILOG EI EPS ERF FACTORIZE FIRST GCD G IMPART INT +INTERPOL LCM LCOF LENGTH LHS LINELENGTH LTERM MAINVAR MAT MATEIGEN MAX +MIN MKID NULLSPACE NUM PART PF PRECISION RANDOM RANDOM NEW SEED RANK +REDERR REDUCT REMAINDER REPART REST RESULTANT REVERSE RHS SECOND SET +SHOWRULES SIGN SOLVE STRUCTR SUB SUM THIRD TP TRACE VARNAME + +Reserved Variables CARD NO E EVAL MODE FORT WIDTH HIGH POW I INFINITY +K!* LOW POW NIL PI ROOT MULTIPLICITY T + +Switches ADJPREC ALGINT ALLBRANCH ALLFAC BFSPACE COMBINEEXPT +COMBINELOGS COMP COMPLEX CRAMER CREF DEFN DEMO DIV ECHO ERRCONT +EVALLHSEQP EXP EXPANDLOGS EZGCD FACTOR FORT FULLROOTS GCD IFACTOR INT +INTSTR LCM LIST LISTARGS MCD MODULAR MSG MULTIPLICITIES NAT NERO +NOSPLIT OUTPUT PERIOD PRECISE PRET PRI RAT RATARG RATIONAL RATIONALIZE +RATPRI REVPRI RLISP88 ROUNDALL ROUNDBF ROUNDED SAVESTRUCTR +SOLVESINGULAR TIME TRA TRFAC TRIGFORM TRINT + +Other Reserved Ids BEGIN DO EXPR FEXPR INPUT LAMBDA LISP MACRO PRODUCT +REPEAT SMACRO SUM UNTIL WHEN WHILE WS + + +@end example + + + +@node Language m (rbg.m), Language m (abg.m), Language fig (abg.fig), Acausal bond graph - LaTeX ready (labg) +@comment node-name, next, previous, up +@subsection Language m (rbg.m) +The raw bond graph of system `sys' is represented as + an m file with heading: +@example +function [rbonds, rstrokes,rcomponents,rports,n_ports] = sys_rbg +@end example +This representation is a half-way house between the fig +(@pxref{Language fig (abg.fig)}) and m +(@pxref{Language m (abg.m)}) representations. It contains the +geometric information from the fig file in a form digestible by Octave +(@pxref{Octave}). + +The five outputs of this function are: +@itemize @bullet +@item +rbonds +@item +rstrokes +@item +rcomponents +@item +rports +@item +n_ports +@end itemize + +@emph{rbonds} is a matrix with +@itemize @bullet +@item +one row for each bond (@pxref{bonds}) +@item +columns 1 and 2 containing the x,y coordinates for one end of the bond +@item +columns 3 and 4 containing the x,y coordinates for the corner of the bond +@item +columns 5 and 6 containing the x,y coordinates for the other end of the bond +@end itemize + +@emph{rstrokes} is a matrix with (@pxref{strokes}) +@itemize @bullet +@item +one row for each stroke or half-stroke +@item +columns 1 and 2 containing the x,y coordinates for one end of the stroke +@item +columns 3 and 4 containing the x,y coordinates for the other end of the stroke +@end itemize + +@emph{rcomponents} is a matrix with (@pxref{components}) +@itemize @bullet +@item +one row for each component +@item +columns 1 and 2 containing the x,y coordinates of the component +@item +the remaining columns containing fig file information +@end itemize + +@emph{rports} is a matrix with (@pxref{Port labels}) +@itemize @bullet +@item +one row for each component port that is explicitly labeled +@item +columns 1 and 2 containing the x,y coordinates of the port label +@item +column 3 contains the port number. +@end itemize + +@emph{n_ports} is the number of ports associated with the system -- i.e. the +number of Named SS components (@pxref{Named SS components}). + +@menu +* Transformation abg2rbg_fig2m:: +@end menu + +@node Transformation abg2rbg_fig2m, , Language m (rbg.m), Language m (rbg.m) +@comment node-name, next, previous, up +@subsubsection Transformation abg2rbg_fig2m +@cindex Transformation abg2rbg_fig2m + +This transformation takes the acausal bond graph as a fig file +(@pxref{Language fig (abg.fig)}) and transforms it into a raw bond graph in +m-file format (@pxref{Language m (rbg.m)}). + +This transformation is implemented in GNU awk (gawk). +It scans both the fig file (@pxref{Language fig (abg.fig)}) +and the label file (@pxref{Labels (lbl)}) and generates the rbg + (@pxref{Language m (rbg.m)}) with components sorted according to the +label file. +It also generates a file sys_fig.fig containing details of the bond +graph with the components removed. + + +@node Language m (abg.m), Language tex (abg.tex), Language m (rbg.m), Acausal bond graph - LaTeX ready (labg) +@comment node-name, next, previous, up +@subsection Language m (abg.m) +@cindex Language m (abg.m) +@cindex bonds +@cindex components +@cindex n_ports + +The acausal bond graph of system `sys' is represented as + an m file with heading: +@example +function [bonds,components,n_ports] = sys_abg +@end example +The three outputs of this function are: +@itemize @bullet +@item +bonds +@item +components +@item +n_ports +@end itemize + +@emph{bonds} is a matrix with +@itemize @bullet +@item +one row for each bond +@item +the first column contains the arrow-orientated +(@pxref{Arrow-orientated causality}) +causality of the @emph{effort} variable. +@item +the second column contains the arrow-orientated +(@pxref{Arrow-orientated causality}) +causality of the @emph{flow} variable. +@end itemize + +@emph{components} is a matrix with +@itemize @bullet +@item +one row for each component +@item +one column for each bond impinging on the component. The +@emph{magnitude} of each entry corresponds to the bond number (the +appropriate row index of` bonds'); the sign is positive if the bond +arrow points into the component and negative otherwise. +@end itemize + +@emph{n_ports} is the number of ports associated with the system -- i.e. the +number of Named SS components (@pxref{Named SS components}). + +@menu +* Arrow-orientated causality:: +* Component-orientated causality:: +* Transformation rbg2abg_m:: +@end menu + +@node Arrow-orientated causality, Component-orientated causality, Language m (abg.m), Language m (abg.m) +@comment node-name, next, previous, up +@subsubsection Arrow-orientated causality +@cindex Arrow-orientated causality + +The arrow-orientated causality convention assigns -1, 0 or 1 +to both the effort and flow (@pxref{Variables}) sides of a bond +to represent the causal stroke (@pxref{strokes}) +as follows: +@vtable @code +@item 0 + if there is no causality set. +@item 1 + if the causal stroke is at the arrow end of the bond. +@item -1 + if the causal stroke is at the other end of the bond. +@end vtable +@pxref{Component-orientated causality}. + +@node Component-orientated causality, Transformation rbg2abg_m, Arrow-orientated causality, Language m (abg.m) +@comment node-name, next, previous, up +@subsubsection Component-orientated causality +@cindex Component-orientated causality + +The component-orientated causality convention assigns -1, 0 or 1 +to both the effort and flow (@pxref{Variables}) sides of a bond +to represent the causal stroke (@pxref{strokes}) +as follows: +@vtable @code +@item 0 + if there is no causality set. +@item 1 + if the causal stroke is at the component end of the bond. +@item -1 + if the causal stroke is at the other end of the bond. + +@end vtable +@pxref{Arrow-orientated causality}. + +@node Transformation rbg2abg_m, , Component-orientated causality, Language m (abg.m) +@comment node-name, next, previous, up +@subsubsection Transformation rbg2abg_m +@cindex Transformation rbg2abg_m +This transformation takes the raw bond graph and, by doing some +geometrical computation, determines the topology of the bond graph -- ie +what is close to what. + +@node Language tex (abg.tex), , Language m (abg.m), Acausal bond graph - LaTeX ready (labg) +@comment node-name, next, previous, up +@subsection Language tex (abg.tex) +@cindex Language tex (abg.tex) + +For the purpose of producing a report (@pxref{Report}), @strong{MTT} +generates a LaTeX (@pxref{LaTeX}) file describing the bond graph and its +subsystems. Additional information may be supplied using the description +representation (@pxref{Detailed}). + +@c node next prev up +@node Stripped acausal bond graph (sabg), Labels (lbl), Acausal bond graph - LaTeX ready (labg), Representations +@section Stripped acausal bond graph (sabg) +@cindex Stripped acausal bond graph (sabg) +@pindex Stripped acausal bond graph (sabg) +The stripped acausal bond graph is the acausal bond graph representation +(@pxref{Acausal bond graph (abg)}) without the artwork +(@pxref{artwork}). It is useful to check for mistakes by showing +precisely what is recognised by @strong{MTT}. + +@menu +* Language fig (sabg.fig):: +* Stripped acausal bond graph (view):: +@end menu + +@node Language fig (sabg.fig), Stripped acausal bond graph (view), Stripped acausal bond graph (sabg), Stripped acausal bond graph (sabg) +@subsection Language fig (sabg.fig) +@cindex Language fig (sabg.fig) +@pindex Language fig (sabg.fig) +The stripped acausal bond graph can be generated as a fig (@pxref{Fig}) +file using +@example +mtt syst sabg fig +@end example + +@node Stripped acausal bond graph (view), , Language fig (sabg.fig), Stripped acausal bond graph (sabg) +@subsection Stripped acausal bond graph (view) +@cindex Language m (view) +@cindex view Constrained-state Equations +This representation has the standard text view +(@pxref{Views}). + + +@node Labels (lbl), Structure (struc), Stripped acausal bond graph (sabg), Representations +@comment node-name, next, previous, up +@section Labels (lbl) +@cindex Labels +@cindex lbl +Bond graph components have optional labels. These provide pointers to +further information relating to the component; this avoids clutter on +the bond graph. + +The label file contains the following non-blank lines (blank lines are ignored) +@itemize @bullet +@item Summary - lines beginning with #SUMMARY +@item Description - lines beginning with #DESCRIPTION +@item Alias - lines beginning with #ALIAS +@item Comments - lines beginning with # +@item Labels - other non-blank lines +@end itemize + +Note, for compatability with old versions, % may be used in place of +#; but the use of % is deprecated. +Each label contains three fields (in the following order) separated by +white space and on one line: +@enumerate +@item The component name @pxref{Component names}. This must be a valid +name (@pxref{Valid names}. +@item The component constitutive relationship @pxref{Component constitutive relationship} +@item The component arguments @pxref{Component arguments} +@end enumerate + +Not each component @pxref{components} needs a label, only those which are explicitly +labeled on the Bond Graph @pxref{Acausal bond graph (abg)}. +@strong{MTT} checks whether all components labelled on the bond graph +have labels and vice versa. + +If no lbl file exists, @strong{MTT} will create a valid one for you; +including a default set of arguments and crs for both simplae and +compound components. + +If wish to create one to edit yourself, type +@example +mtt system_name lbl txt +@end example +An example lbl file (for the RC system is): +@example +%% Label file for system RC (RC_lbl.txt) +%SUMMARY RC +%DESCRIPTION +% Port aliases +%ALIAS in in +%ALIAS out out + +% Argument aliases +%ALIAS $1 c +%ALIAS $2 r + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + c lin effort,c + +% Component type R + r lin flow,r + +% Component type SS + [in] SS external,external + [out] SS external,external + +@end example + + +The old-style lbl files (@pxref{Old-style labels (lbl)}) are NO LONGER +supported -- you are encouraged to convert them ASAP. + +@menu +* SS component labels:: +* Other component labels:: +* Component names:: +* Component constitutive relationship:: +* Component arguments:: +* Parameter declarations:: +* Units declarations:: +* Interface Control Definition:: +* Aliases:: +* Parameter passing:: +* Old-style labels (lbl):: +* Language tex (desc.tex):: +@end menu + +@node SS component labels, Other component labels, Labels (lbl), Labels (lbl) +@comment node-name, next, previous, up +@subsection SS component labels +@cindex SS component labels +In addition to the label there are two information fields, @pxref{Labels +(lbl)}. The first must be `SS', the second contains two information +fields of the form info_field_1,info_field_2. + +These two information +fields correspond to the effort and flow variables of the of the SS components as follows +@vtable @code +@item info_field_1 + effort +@item info_field_2 + flow +@end vtable +Each of these two fields contains one of the following @emph{attributes}: +@vtable @code +@item external + indicates that the corresponding variable is a system input or +output +@item internal + indicates that the variable does not appear as a system output; + it is an error to label an input in this way. +@item a number + the value of the input; or the value of the (imposed) output +@item a symbol + the symbolic value of the input; or the value of the (imposed) output +@item unknown + used for the SS method of solving algebraic loops. This + indicates that the corresponding system input (SS output) is to + be chosen to set the corresponding system output (SS input) to zero. +@item zero + used for the SS method of solving algebraic loops. This + indicates that the corresponding system output (SS input) is to + be set to zero using the variable indicted by the corresponding + `unknown' label. +@end vtable + +Some examples are: +@example +%% ss1 is both a source and sensor +ss1 SS external,external +%% ss1 acts as a flow sensor - it imposes zero effort. +ss2 SS 0,external +@end example + + +@node Other component labels, Component names, SS component labels, Labels (lbl) +@comment node-name, next, previous, up +@subsection Other component labels +@cindex Other component labels + +In addition to the label there are two information fields, +@pxref{Labels (lbl)}. +They correspond to the constitutive relationship +(see @pxref{Constitutive relationship} and arguments of the +component as follows +@vtable @code +@item info_field_1 + constitutive relationship +@item info_field_2 + parameters +@end vtable + +Some examples are: +@example +%Armature resistance +r_a lin effort,r_a + +%Gearbox ratio +n lin effort,n +@end example + +@strong{MTT} supports parameter-passing to (@pxref{Parameter passing}) +subsystems. + +@menu +* Component names:: +* Component constitutive relationship:: +* Component arguments:: +* Aliases:: +* Parameter passing:: +* Old-style labels (lbl):: +@end menu + +@node Component names, Component constitutive relationship, Other component labels, Labels (lbl) +@comment node-name, next, previous, up +@subsection Component names +@cindex Component names +The component name field must contain a valid name (@pxref{Valid names} corresponding to the +name (the bit after the :) of each named component (@pxref{components}) +on the bond graph (@pxref{Acausal bond graph (abg)}). + +@node Component constitutive relationship, Component arguments, Component names, Labels (lbl) +@comment node-name, next, previous, up +@subsection Component constitutive relationship +@cindex Component constitutive relationship +The constitutive relationship field contains the name of a constitutive +relationship for the component. There are three sorts of constitutive +relationship recognised by @strong{MTT}: +@enumerate +@item A generic constitutive relationship such as @var{lin} (the generic +linear constitutive relationship. +@item A local constitutive relationship with the same name as the +component type +@item The @var{SS} constitutive relationship reserved for @var{SS} +components. +All labels for @var{SS} components must contain SS in this field. +@end enumerate + + +@node Component arguments, Parameter declarations, Component constitutive relationship, Labels (lbl) +@comment node-name, next, previous, up +@subsection Component arguments +@cindex Component arguments + +@node Parameter declarations, Units declarations, Component arguments, Labels (lbl) +@comment node-name, next, previous, up +@subsection Parameter declarations +@cindex parameter declarations +@pindex parameter declarations +@pindex PAR +@pindex NOTPAR +@pindex VAR +@pindex NOTVAR + +It is sometimes useful to use parameters (in addition to those implied by +the Component arguments @pxref{Component arguments}) to compute values +in, for example the numpar file. These can be declared in the label +file; +for examples , the two parameters par1 and par 2 can be declared as: +@example +#PAR par1 +#PAR par2 +@end example + +On the other hand, some CR arguments (eg foo and bar) may not correspond to +parameters. These can be excluded from the sympar list using +the NOTPAR declaration +@example +#NOTPAR foo +#NOTPAR bar +@end example + +For comapability with old code, VAR may be used in place of PAR, but +this usage is deprecated. + +@node Units declarations, Interface Control Definition, Parameter declarations, Labels (lbl) +@comment node-name, next, previous, up +@subsection Units declarations +@cindex units declarations +@pindex units declarations +@pindex UNITS +The units and domains of ports (@pxref{Ports}) are declared as: +@example +#UNITS Port_name domain effort_units flow_units +@end example +where "Port_name" is the name of the port, domain is one of: +@vtable @code +@item electrical + the electrical domain +@item translational + the translational mechanical domain +@item rotational + the rotational mechanical domain +@item fluid + the fluid domain +@item thermal + the thermal domain +@end vtable +and effort_units and flow_units are corresponding units for the effort +and the flow. + +Allowed units are those defined in the @strong{units} package. + + + +@strong{MTT} checks that units are +@itemize @bullet +@item defined consistently with the domain +@item the same for connected ports when both ports have defined units. +@end itemize +No checks are done if one or both ends of a bond are not connected to a +port with defined units. + +The word ``none'' can be specified in place of a unit to prevent +@strong{MTT} from checking the corresponding effort or flow while +still checking the units of the other variable, if it is specified. +This can be used to force checking of either the effort or flow on +signal bonds or in pseudo-bond graphs where the domain of the two +variables may not be identical. + + +@node Interface Control Definition, Aliases, Units declarations, Labels (lbl) +@comment node-name, next, previous, up +@subsection Interface Control Definition +@cindex ICD (label file directive) +It is sometimes useful to be able to automatically generate a set of +assignments mapping @strong{MTT} inputs and outputs to an external interface +definition. This can be achieved with use of the @emph{#ICD} directive. + +@example +#ICD PressureSensor PUMP1_PRESSURE_SENSOR,Pa;null,none +#ICD Electrical PUMP1_VOLTAGE,volt;PUMP1_CURRENT,amp + +% Component type De + PressureSensor SS external + +% Component type SS + Electrical SS external,external +@end example + + +The ICD directive consists of 3 whitespace delimited fields: + +@enumerate +@item [%|#]ICD +@item component name +@item Four comma (,) or semi-colon (;) delimited fields: + +@enumerate +@item name of effort parameter +@item unit of effort parameter +@item name of flow parameter +@item unit of flow parameter +@end enumerate +@end enumerate + +If no parameter name is required, a value of "null" should be used. +If the parameter does not have any units, a value of "none" should be used. + +ICD parameters may be aliased @pxref{Aliases} in the same way as normal +parameters, thus it is possible to define some or all of the ICD in higher +level components. + +The command + +@example +mtt sys ICD txt +@end example + +will generate a text file containing a list of mappings: + +@example +## Interface Control Definition for System sys +## sys_ICD.txt: Generated by MTT Thu Jul 12 21:21:21 CDT 2001 + +Input: PUMP1_VOLTAGE sys_P1_1_Electrical Causality: Effort Units: volt +Output: PUMP1_CURRENT sys_P1_1_Electrical Causality: Flow Units: amp +Output: PUMP1_PRESSURE_SENSOR sys_P1_1_PressureSensor Causality: Effort Units: Pa +@end example + +A set of assignments can be generated with the command +@example +mtt sys ICD m +@end example + +resulting in: + +@example +# Interface Control Definition mappings for system sys +# sys_ICD.m: Generated by MTT Thu Jul 12 21:26:56 CDT 2001 + +# Inputs + + mttu(1) = PUMP1_VOLTAGE; + +# Outputs + + PUMP1_CURRENT = mtty(1); + PUMP1_PRESSURE_SENSOR = mtty(2); +@end example + +A similar file will be generated by the command +@example +mtt sys ICD cc +@end example + + + +@node Aliases, Parameter passing, Interface Control Definition, Labels (lbl) +@comment node-name, next, previous, up +@subsection Aliases +@cindex aliases +@pindex aliases + +Aliases provide a convenient mechanism for relabelling words appearing +in the label file (@pxref{Labels (lbl)}). There are three contexts in +which the alias mechanism is used: + +@enumerate +@item renaming ports (@pxref{Port aliases}), +@item renaming parameters (@pxref{Parameter aliases}) and +@item renaming components (@pxref{Component aliases}). +@end enumerate + +All three mechanisms use the same form of statement within the label +file +@example +%ALIAS short_label real_label +@end example + +@strong{MTT} distinguishes between the three forms as follows: + +@itemize @bullet +@item Parameter aliases: `short_label' starts with a `$' +@item Component aliases: `real_label' contains the directory separator +`/' +@item Port aliases: neither of the above +@end itemize + +@menu +* Port aliases:: +* Parameter aliases:: +* CR aliases:: +* Component aliases:: +@end menu + + +@node Port aliases, Parameter aliases, Aliases, Aliases +@comment node-name, next, previous, up +@subsubsection Port aliases +@cindex port aliases +@pindex port aliases +Aliases provide a way of refering to (@pxref{Port labels}) or vector port labels (@pxref{Vector +port labels}) on the bond graph using a short-hand notation. With in a +component label file (@pxref{Labels (lbl)}) statements of the following +forms can occur + +@example +%ALIAS short_label real_label +@end example + +When the component is used within another component, the short_lable may +be used in place of the real_label. +More than one alias per label can be used, for example + +@example +%ALIAS short_label_1 real_label +%ALIAS short_label_2 real_label +%ALIAS short_label_3 real_label +@end example + +The port can then be refered to in four ways: as real_label, +short_label_1, short_label_2 or short_label_3. +An alternative notation for the ALIAS statement in this case is + +@example +%ALIAS short_label_1|short_label_2|short_label_3 real_label +@end example + +The alias feature is particularly powerful in conjunction with vector +port labels (@pxref{Vector port labels}) and the port label default +(@pxref{Port label defaults}) mechanisms. For example, a component with +5 ports appearing in the lbl file as: + +@example + [Hydraulic_in] external external + [Hydraulic_out] external external + [Power_Shaft] external external + [Thermal_in] external external + [Thermal_out] external external +@end example + +together with the following statements in the label file: + +@example +%ALIAS in Thermal_in,Hyydraulic_in +%ALIAS out Thermal_out,Hydraulic_out +%ALIAS shaft|power Power_Shaft +@end example + +can appear in the bond graph containing that component with one bond +labeled either [shaft] or [power] or [Power_Shaft], one unlabeled vector +bond pointing in and one unlabeled vector bond pointing out. + +@node Parameter aliases, CR aliases, Port aliases, Aliases +@comment node-name, next, previous, up +@subsubsection Parameter aliases +@cindex parameter aliases +@pindex parameter aliases + +Parameter aliases are of the form +@example +%ALIAS $n actual parameter +@end example +where n is an integer (unique within the label file). +For example + +@example +%ALIAS $1 c_v +%ALIAS $2 density,ideal_gas,r +%ALIAS $3 alpha +%ALIAS $4 flow,k_p +@end example + +Assigns four symbolic parameters to the corresponding strings These four +parameters (@code{$1}--@code{$4}) can then be used for parameter +passing(@pxref{Parameter passing}). + +@node CR aliases, Component aliases, Parameter aliases, Aliases +@comment node-name, next, previous, up +@subsubsection CR aliases +@cindex CR aliases +@pindex CR aliases + +CR aliases are of the form +@example +%ALIAS $an actual parameter +@end example +where n is an integer (unique within the label file). +For example +@example +%ALIAS $a1 lin +@end example +assigns the symbolic parameter to be lin. This parameter @code{$1} can +then be used for passing a diofferent cr to the +component (@pxref{Parameter passing}). + +@node Component aliases, , CR aliases, Aliases +@comment node-name, next, previous, up +@subsubsection Component aliases +@cindex component aliases +@pindex component aliases + +Component aliases are of the form +@example +%ALIAS Component_name Component_location +@end example + +An example appears in the following label file fragment +@example +... +%ALIAS wPipe CompressibleFlow/wPipe +%ALIAS Poly CompressibleFlow/Poly +.... + +@end example +The two components `wPipe' and `Poly' are both to be found within the +library `Compressible flow' and the respective subdirectories. This +follows the @strong{MTT} convention that compound components +(@pxref{Compound components}) live within a directory of the same name. + + +@node Parameter passing, Old-style labels (lbl), Aliases, Labels (lbl) +@comment node-name, next, previous, up +@subsection Parameter passing +@cindex Parameter passing +@strong{MTT} supports parameter-passing to subsystems within label files +(@pxref{Labels (lbl)}). Within a subsystem, explicit constitutive +relationships and parameters (or groups thereof) can be replaced by +postitional parameters such as @code{$1}, @code{$2} etc. Although this +can be done directly, it is recommended that this is done via the alias +mechanism (@pxref{Parameter aliases}). + +In a subsystem +@code{$i}, is replaced by the ith field of a colon @code{;} separated +field in the calling label file. This field may include commas @code{,} +and the four arithmetic operators @code{+}, @code{-}, @code{*} and +@code{/}. + +For example, consider the following example label file fragment (associated with a +component called Pump: +@example +... + +%ALIAS $1 c_v +%ALIAS $2 density,ideal_gas,r +%ALIAS $3 alpha +%ALIAS $4 flow,k_p + +%ALIAS wPipe CompressibleFlow/wPipe +%ALIAS Poly CompressibleFlow/Poly + +% Component type wPipe + pipe none c_v;density,ideal_gas,r + +% Component type Poly + poly Poly alpha + +@end example + +The 4 parameters @code{$1}, @code{$2}, @code{$3}, and @code{$4} can be +passed from a higher level component as in the following label file +fragment: + +@example +% Component type Pump + comp none c_v;rho,ideal_gas,r;alpha;effort,k_c + turb none c_v;rho,ideal_gas,r;alpha;effort,k_t +@end example + +Thus in component `comp': +@itemize @bullet +@item @code{$1} is replaced by c_v +@item @code{$2} is replaced by rho,ideal_gas +@item @code{$3} is replaced by alpha +@item @code{$4} is replaced by effort,k_c +@end itemize +whereas in component `turb' the first three parameters are the same but +@itemize @bullet +@item @code{$4} is replaced by effort,k_t +@end itemize + + + +@node Old-style labels (lbl), Language tex (desc.tex), Parameter passing, Labels (lbl) +@comment node-name, next, previous, up +@subsection Old-style labels (lbl) +@cindex Old-style labels +@cindex lbl + +Old syle labels (mtt version 2.x) are supported by mtt version +3.x. However, you are advised to use the new form (@pxref{Labels +(lbl)}). + +Each line of the @code{_label.txt} file is of one of three forms: +@enumerate +@item +Contains three fields (separated by white space) of the form +@example +label field_1 field_2 +@end example +@item +Blank +@item +Preceded by % +@end enumerate +Only the first is noticed by @strong{MTT}; the second and third are for +providing helpful commenting. + +The role of the two information fields depends on the component with the +corresponding label. In particular the classes of components are: +@itemize @bullet +@item +SS components, @pxref{SS components}. +@item +Other components, @pxref{components}. +@end itemize +Named SS component, @pxref{Named SS components} never have labels. +@menu +* SS component labels (old-style):: +* Other component labels (old-style):: +* Parameter passing (old-style):: +@end menu + + +@node SS component labels (old-style), Other component labels (old-style), Old-style labels (lbl), Old-style labels (lbl) +@comment node-name, next, previous, up +@subsubsection SS component labels (old-style) +@cindex SS component labels (old-style) +In addition to the label there are two information fields, +@pxref{Labels (lbl)}. +They correspond to the effort and flow of the components as follows +@vtable @code +@item info_field_1 + effort +@item info_field_2 + flow +@end vtable +Each of these two fields contains one of the following @emph{attributes}: +@vtable @code +@item external + indicates that the corresponding variable is a system input or +output +@item internal + indicates that the variable does not appear as a system output; + it is an error to label an input in this way. +@item a number + the value of the input; or the value of the (imposed) output +@item a symbol + the symbolic value of the input; or the value of the (imposed) output +@item unknown + used for the SS method of solving algebraic loops. This + indicates that the corresponding system input (SS output) is to + be chosen to set the corresponding system output (SS input) to zero. +@item zero + used for the SS method of solving algebraic loops. This + indicates that the corresponding system output (SS input) is to + be set to zero using the variable indicted by the corresponding + `unknown' label. +@end vtable + +Some examples are: +@example +%Label field1 field2 +ss1 external external +ss2 0 external +@end example + + +@node Other component labels (old-style), Parameter passing (old-style), SS component labels (old-style), Old-style labels (lbl) +@comment node-name, next, previous, up +@subsubsection Other component labels (old-style) +@cindex Other component labels (old-style) + +In addition to the label there are two information fields, +@pxref{Labels (lbl)}. +They correspond to the constitutive relationship +(see @pxref{Constitutive relationship} and arguments of the +component as follows +@vtable @code +@item info_field_1 + constitutive relationship +@item info_field_2 + parameters +@end vtable + +Some examples are: +@example +%Armature resistance +r_a lin effort,r_a + +%Gearbox ratio +n lin effort,n +@end example + +@strong{MTT} supports parameter-passing to (@pxref{Parameter passing (old-style)}) +subsystems. + + +@node Parameter passing (old-style), , Other component labels (old-style), Old-style labels (lbl) +@comment node-name, next, previous, up +@subsubsection Parameter passing (old-style) +@cindex Parameter passing (old-style) +@strong{MTT} supports parameter-passing to (@pxref{Parameter passing (old-style)}) +subsystems within label files (@pxref{Labels (lbl)}). Within a subsystem, +explicit constitutive relationships and parameters (or groups thereof) +can be replaced by +@code{$1}, @code{$2}, etc. + +In a subsystem +@code{$i}, is replaced by the ith field of a colon @code{;} separated +field in the calling label file. This field may include commas @code{,}. + +For example subsystem ROD contains the following lines in the label +file: +@example + +%DESCRIPTION Parameter 1: length from end 1 to mass centre +%DESCRIPTION Parameter 2: length from end 2 to mass centre +%DESCRIPTION Parameter 3: inertia about mass centre +%DESCRIPTION Parameter 4: mass +%DESCRIPTION See Section 10.2 of "Metamodelling" + + +%Inertias +J lin flow,$3 +m_x lin flow,$4 +m_y lin flow,$4 + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,$1 +s2 lsin flow,$2 +c1 lcos flow,$1 +c2 lcos flow,$2 + +@end example + +This can be used in a higher-level lbl (@pxref{Labels (lbl)}) file as: +@example +%SUMMARY Pendulum example from Section 10.3 of "Metamodelling" + +%Rod parameters +rod none l;l;j;m + +@end example + + +@menu +* Language tex (desc.tex):: +@end menu + +@node Language tex (desc.tex), , Old-style labels (lbl), Labels (lbl) +@comment node-name, next, previous, up +@subsection Language tex (desc.tex) +@cindex Language tex (desc.tex) +This file may contain any LaTeX compatible commands. Any mathematics +should conform to the AMSmath package. + +@node Structure (struc), Constitutive Relationship (cr), Labels (lbl), Representations +@comment node-name, next, previous, up +@section Structure (struc) +@cindex Structure +@cindex struc + +The causal bond graph implies a set of equations describing the +system. The Structure (struc) representation describes the structure of +these equations in terms of the input, outputs, states and non-states of +the system. + +@menu +* Language txt (struc.txt):: +* Language tex (struc.tex):: +* Structure (view):: +@end menu + +@node Language txt (struc.txt), Language tex (struc.tex), Structure (struc), Structure (struc) +@comment node-name, next, previous, up +@subsection Language txt (struc.txt) +@cindex Language txt (struc.txt) +This text tile contains a description of the system structure +(@pxref{Structure (struc)} with 5 tab-separated columns containing the +following information: +@vtable @code +@item type + input, output state or nonstate +@item index + an integer corresponding to the array index +@item component name + the name of the component corresponding to the variable +@item system name + the name of the system containing the component +@item repetition + an integer corresponding to the repetition of a repeated subsystem. +@end vtable + +An example of such a file (corresponding to rc) (@pxref{Quick start}) is: +@example +input 1 e1 rc 1 +output 1 e2 rc 1 +state 1 c rc 1 +@end example + + +@node Language tex (struc.tex), Structure (view), Language txt (struc.txt), Structure (struc) +@comment node-name, next, previous, up +@subsection Language tex (struc.tex) +@cindex Language tex (struc.tex) +This LaTeX (@pxref{LaTeX}) file contains a description of the system structure +(@pxref{Structure (struc)} in @code{longtable} format. It is a useful +item to include in a report(@pxref{Report}). + +@node Structure (view), , Language tex (struc.tex), Structure (struc) +@subsection Language tex (view) +@cindex Structure (view) +@cindex view Structure +This representation has the standard text view +(@pxref{Views}). + +@node Constitutive Relationship (cr), Parameters, Structure (struc), Representations +@comment node-name, next, previous, up +@section Constitutive relationship (cr) +@cindex Constitutive relationship + +The constitutive relationship (@pxref{Constitutive relationship}) +of a simple component (@pxref{Simple components} is +defined in the symbolic algebra language Reduce (@pxref{Reduce}). +The constitutive relationship of a compound components +(@pxref{Compound components}) +is implied by the constitutive relationships of its constituent components. + +@menu +* Predefined constitutive relationships:: +* DIY constitutive relationships:: +* Unresolved constitutive relationships:: +* Unresolved constitutive relationships - Octave:: +* Unresolved constitutive relationships - c++:: +@end menu + +@node Predefined constitutive relationships, DIY constitutive relationships, Constitutive Relationship (cr), Constitutive Relationship (cr) +@comment node-name, next, previous, up +@subsection Predefined constitutive relationships +@cindex Predefined constitutive relationships + +Some common cr's are predefined by MTT; these are: +@vtable @code +@item lin + a linear constitutive relationship +@item exotherm + an exothermic reaction +@end vtable + +@menu +* lin:: +* exotherm:: +@end menu + +@node lin, exotherm, Predefined constitutive relationships, Predefined constitutive relationships +@comment node-name, next, previous, up +@subsubsection lin +@findex lin +The constitutive relationship @code{lin} is predefined for the following +components. +@vtable @code +@item R + (one-port) R component +@item TF + transformer +@item GY + gyrator +@item MTF + modulated transformer +@item MGY + modulated gyrator +@item FMR + flow-modulated resistor +@end vtable +Lin takes two arguments in the form causality,gain +@vtable @code +@item causality + the causality (effort or flow) of the @emph{input} to the +constitutive relationship +@item gain + the gain of the component when the input causality is as +specified in the first argument. +@end vtable +For example the arguments +@example +flow,r +@end example +given to an R component corresponds to +@example +e = rf +@end example +if if the input causality is flow +or +@example +f = e/r +@end example +if if the input causality is effort. + +@node exotherm, , lin, Predefined constitutive relationships +@comment node-name, next, previous, up +@subsubsection exotherm +@findex exotherm + +@node DIY constitutive relationships, Unresolved constitutive relationships, Predefined constitutive relationships, Constitutive Relationship (cr) +@comment node-name, next, previous, up +@subsection DIY constitutive relationships +@cindex DIY constitutive relationships +You can write your own constitutive relationships using Reduce +(@pxref{Reduce}). This requires some understanding as to how +@strong{MTT} represent the elementary system equations +(@pxref{Elementary system equations}). Looking at the predefined +constitutive relationships is a good way to get started +(@pxref{File structure}). + +@node Unresolved constitutive relationships, Unresolved constitutive relationships - Octave, DIY constitutive relationships, Constitutive Relationship (cr) +@subsection Unresolved constitutive relationships +@cindex Unresolved constitutive relationships + +Consider the following CR file. +@example +FOR ALL rho,g,vol,h,topt,bott,flowin,press +LET tktf2(rho,g,vol,h,topt,bott,effort,2,press,effort,1) + = tank(rho,g,vol,h,topt,bott,press); +@end example +Assuming that `tank' is not defined in a +reduce file, MTT will leave it unresolved when generating m or c code. + +The resulting function can then be expressed as octave +(@pxref{Unresolved constitutive relationships - Octave}) or c++ code as +(@pxref{Unresolved constitutive relationships - c++}) appropriate. + +@node Unresolved constitutive relationships - Octave, Unresolved constitutive relationships - c++, Unresolved constitutive relationships, Constitutive Relationship (cr) +@subsection Unresolved constitutive relationships - Octave +@cindex Unresolved constitutive relationships - Octave +Following the example of the previous section, the unresolved CR `tank' +can be expressed as an Octave m-file. For example: +@example +function p = tank (rho,g,vol,h,topt,bott,press) + + ## usage: p = tank (vol,h,topt,bott,press) + ## + ## + + val = press; zt = topt; zb = bott; + zval = 0.5*(abs(zb+(zt-zb)*val-h)+(zb+(zt-zb)*val-h)); + + p = rho*g*zval + 0.5*(1+tanh((press-0.98)*500))*100000; + +endfunction +@end example +This will be automatically loaded into octave. + +@node Unresolved constitutive relationships - c++, , Unresolved constitutive relationships - Octave, Constitutive Relationship (cr) +@subsection Unresolved constitutive relationships - c++ +@cindex Unresolved constitutive relationships - Octave +Following the example of the previous section, the unresolved CR `tank' +can be expressed in c++ code. For example: +@example +inline double tank(const double rho, + const double g, + const double vol, + const double h, + const double topt, + const double bott, + const double press) + + + /* ## usage: p = tank (vol,h,topt,bott,press) + ## + ## + */ + double p, val, zval, zt, zb; + + val = press; + zt = topt; + zb = bott; + zval = 0.5 * (abs(zb + (zt - zb) * val - h) + zb + (zt - zb) * val - h); + + p = rho * g * zval + 0.5 * (1 + tanh((press - 0.98) * 500)) * 100000L; + + return p; + +@end example + +To make sure that this is used in system `model', the model_cr.h file +must be as follows: +@example +// CR headers for system model +#include "tank.c" +@end example + +@node Parameters, Causal bond graph (cbg), Constitutive Relationship (cr), Representations +@comment node-name, next, previous, up +@section Parameters +@cindex Parameters + +In general, lbl (@pxref{Labels (lbl)}) files contain symbolic +parameters. @strong{MTT} provides three ways of substituting for these +parameters: +@itemize @bullet +@item +symbolic substitution +@item +symbolic substitution for simplification of displayed equations +@item +numeric +@end itemize + +@menu +* Symbolic parameters (subs.r):: +* Symbolic parameters for simplification (simp.r):: +* Numeric parameters (numpar):: +@end menu + +@node Symbolic parameters (subs.r), Symbolic parameters for simplification (simp.r), Parameters, Parameters +@comment node-name, next, previous, up +@subsection Symbolic parameters (subs.r) +@cindex Symbolic parameters +@vindex subs.r +This file contains reduce statements to symbolically change the +expressions describing the system. +For example, a useful set of trig substitutions is: +@example +LET cos(~x)*cos(~y) = (cos(x+y)+cos(x-y))/2; +LET cos(~x)*sin(~y) = (sin(x+y)-sin(x-y))/2; +LET sin(~x)*sin(~y) = (cos(x-y)-cos(x+y))/2; +LET cos(~x)^2 = (1+cos(2*x))/2; +LET sin(~x)^2 = (1-cos(2*x)); +@end example + +@node Symbolic parameters for simplification (simp.r), Numeric parameters (numpar), Symbolic parameters (subs.r), Parameters +@comment node-name, next, previous, up +@subsection Symbolic parameters for simplification (simp.r) +@cindex Symbolic parameters for simplification +@vindex simp.r +This file contains reduce statements to symbolically change the +expressions describing the system. Unlike the subs.r file +(@pxref{Symbolic parameters (subs.r)}) it does not affect all system +transformations; only those converting to LaTeX form. + +@node Numeric parameters (numpar), , Symbolic parameters for simplification (simp.r), Parameters +@comment node-name, next, previous, up +@subsection Numeric parameters (numpar) +@cindex Numeric parameters + +When computing time and frequency responses; or when evaluating +functions in Octave (@pxref{Octave}); symbolic parameters need numerical +instantiations. + +The numpar representation provides the relevant @emph{numerical} +information. It comes in a number of languages: +@ftable @code +@item txt + a textual description of the parameter values -- this is the +defining representation (@pxref{Defining representations}). +@item m + readable by @code{octave} a high-level interactive language for numerical + computation -- translated by @strong{mtt} from the txt version. +@item c + readable by @code{gcc} a c compiler -- translated by @strong{mtt} from the txt version. + +@end ftable + +@menu +* Text form (numpar.txt):: +@end menu + +@node Text form (numpar.txt), , Numeric parameters (numpar), Numeric parameters (numpar) +@comment node-name, next, previous, up +@subsubsection Text form (numpar.txt) +@cindex Numeric parameters +This is the textual form of the numerical parameters representation +(@pxref{Numeric parameters (numpar)}). Lines are either +@ftable @code +@item assignment statements + variable = value +@item comments + lines beginning with # +@item commented assignment statements + variable = value # comments +@end ftable +An example file is: +@example +# Numerical parameter file (rc_numpar.txt) +# Generated by MTT at Mon Jun 16 15:10:17 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.32 2014/07/12 19:56:27 geraint +# %% Fixed style of NO WARRANTY from heading to strong because texi2html complained about having a heading in an enumerate environment +# %% +# %% Revision 1.31 2014/07/10 23:13:27 geraint +# %% Fixed mtt.texi missing arguments and subsection level +# %% +# %% Revision 1.30 2005/03/15 12:04:15 gawthrop +# %% New labg.fig rep - pretty LaTeX figures. +# %% +# %% Revision 1.29 2005/01/19 09:45:15 geraint +# %% Fixed whitespace. +# %% +# %% Revision 1.28 2005/01/06 16:03:55 geraint +# %% Updated options list. +# %% +# %% Revision 1.27 2005/01/06 14:42:33 geraint +# %% Fixed explicit/implicit descriptions of forward/backward Euler. +# %% Replaced -c examples with -cc. +# %% +# %% Revision 1.26 2005/01/06 12:28:36 geraint +# %% Minor typos. +# %% +# %% Revision 1.25 2004/08/27 20:12:34 geraint +# %% Added note about "none" as an option for units. +# %% +# %% Revision 1.24 2004/08/13 01:39:24 geraint +# %% Fixed variable names in diy makefile example (again) +# %% +# %% Revision 1.23 2004/08/11 08:24:28 geraint +# %% Replaced "gnuplot view" with "odeso gnuplot" in examples. +# %% +# %% Revision 1.21 2004/07/23 11:05:26 geraint +# %% Updated Reduce URL: http://www.reduce-algebra.com +# %% +# %% Revision 1.20 2003/10/23 18:14:43 geraint +# %% Added subsection with script for model-specific options. +# %% Fixed typo in url to mtt.sf.net. +# %% +# %% Revision 1.19 2003/10/10 22:22:18 geraint +# %% typo. +# %% +# %% Revision 1.18 2003/09/07 20:41:19 geraint +# %% *** empty log message *** +# %% +# %% Revision 1.17 2003/08/19 14:20:38 gawthrop +# %% Version 5.0 of MTT +# %% Remove xref errors (spurious spaces) +# %% +# %% Revision 1.16 2003/08/19 14:11:23 gawthrop +# %% Links to legal stuff +# %% +# %% Revision 1.15 2003/08/19 14:01:45 gawthrop +# %% Added legal appendices +# %% +# %% Revision 1.14 2003/08/06 14:50:56 gawthrop +# %% Describe the alias mechanism for invoking mtt options +# %% +# %% Revision 1.13 2002/12/13 10:07:07 gawthrop +# %% Added example in sh section of DIY reps +# %% +# %% Revision 1.12 2002/09/19 08:09:31 gawthrop +# %% Updated documentation documentation +# %% +# %% Revision 1.11 2002/08/20 15:51:17 gawthrop +# %% Update to work with ident DIY rep +# %% +# %% Revision 1.10 2002/07/22 10:45:22 geraint +# %% Fixed gnuplot rep so that it correctly re-runs the simulation if input files have changed. +# %% +# %% Revision 1.9 2002/07/05 13:29:34 geraint +# %% Added notes about generating dynamically linked functions for Octave and Matlab. +# %% +# %% Revision 1.8 2002/07/04 21:34:12 geraint +# %% Updated gnuplot view description to describe Tcl/Tk interface instead of obsolete txt method. +# %% +# %% Revision 1.7 2002/04/23 09:51:54 gawthrop +# %% Changed incorrect statement about searching for components. +# %% +# %% Revision 1.6 2001/10/15 14:29:50 gawthrop +# %% Added documentaton on [1:N] style port labels +# %% +# %% Revision 1.5 2001/07/23 03:35:29 geraint +# %% Updated file structure (mtt/bin). +# %% +# %% Revision 1.4 2001/07/23 03:25:02 geraint +# %% Added notes on -ae hybrd, rk4, ode2odes.cc, .oct dependencies. +# %% +# %% Revision 1.3 2001/07/13 03:02:38 geraint +# %% Added notes on #ICD, gnuplot.txt and odes.sg rep. +# %% +# %% Revision 1.2 2001/07/03 22:59:10 gawthrop +# %% Fixed problems with argument passing for CRs +# %% +# %% Revision 1.1 2001/06/04 08:18:52 gawthrop +# %% Putting documentation under CVS +# %% +# %% Revision 1.66 2000/12/05 14:20:55 peterg +# %% Added the c++ anf m CR info. +# %% +# %% Revision 1.65 2000/11/27 15:36:15 peterg +# %% NOPAR --> NOTPAR +# %% +# %% Revision 1.64 2000/11/16 14:22:48 peterg +# %% added UNITS declaration +# %% +# %% Revision 1.63 2000/11/03 14:41:08 peterg +# %% Added PAR and NOTPAR stuff +# %% +# %% Revision 1.62 2000/10/17 17:53:34 peterg +# %% Added some simulation details +# %% +# %% Revision 1.61 2000/09/14 17:13:06 peterg +# %% New options table +# %% +# %% Revision 1.60 2000/09/14 17:09:20 peterg +# %% Tidied up valid name sections +# %% Tidied up defining represnetations table +# %% Verion 4.6 +# %% +# %% Revision 1.59 2000/08/30 13:09:00 peterg +# %% Updated option table +# %% +# %% Revision 1.58 2000/08/01 13:30:19 peterg +# %% Version 4.4 +# %% updated STEPFACTOR info +# %% describes octave and OCST interfaces +# %% +# %% Revision 1.57 2000/07/20 07:55:44 peterg +# %% Version 4.3 +# %% +# %% Revision 1.56 2000/05/19 17:49:17 peterg +# %% Extended the user defined representation section -- new nppp rep. +# %% +# %% Revision 1.55 2000/03/16 13:53:31 peterg +# %% Correct date +# %% +# %% Revision 1.54 2000/03/15 21:22:57 peterg +# %% Updated to 4.1 -- old style SS no longer supported +# %% +# %% Revision 1.53 1999/12/22 05:33:10 peterg +# %% Updated for 4.0 +# %% +# %% Revision 1.52 1999/11/23 00:25:11 peterg +# %% Added the sensitivity reps +# %% +# %% Revision 1.51 1999/11/16 04:43:47 peterg +# %% Added start of sensitivity section +# %% +# %% Revision 1.50 1999/11/16 00:30:35 peterg +# %% Updated simulation section +# %% Added vector components +# %% +# %% Revision 1.49 1999/07/20 23:44:58 peterg +# %% V 3.8 +# %% +# %% Revision 1.48 1999/07/19 03:08:33 peterg +# %% Added documentation for (new) SS lbl fields +# %% +# %% Revision 1.47 1999/03/09 01:42:22 peterg +# %% Rearranged the User interface section +# %% +# %% Revision 1.46 1999/03/09 01:18:01 peterg +# %% Updated for 3.5 including xmtt +# %% +# %% Revision 1.45 1999/03/03 02:39:26 peterg +# %% Minor updates +# %% +# %% Revision 1.44 1999/02/17 06:52:14 peterg +# %% New level formula dor artwork +# %% +# %% Revision 1.43 1998/11/25 16:49:24 peterg +# %% Put in subs.r documentation (was called params.r) +# %% +# %% Revision 1.42 1998/11/24 12:24:59 peterg +# %% Added section on simulation output +# %% Version 3.4 +# %% +# %% Revision 1.41 1998/09/02 12:04:15 peterg +# %% Version 3.2 +# %% +# %% Revision 1.40 1998/08/27 08:36:39 peterg +# %% Removed in. methods except Euler anf implicit +# %% +# %% Revision 1.39 1998/08/18 10:44:28 peterg +# %% Typo +# %% +# %% Revision 1.38 1998/08/18 09:16:38 peterg +# %% Version 3.1 +# %% +# %% Revision 1.37 1998/08/17 16:14:30 peterg +# %% Version 3.1 - includes documentation on METHOD=IMPLICIT +# %% +# %% Revision 1.36 1998/07/30 17:33:15 peterg +# %% VERSION 3.0 +# %% +# %% Revision 1.35 1998/07/22 11:00:53 peterg +# %% Correct date! +# %% +# %% Revision 1.34 1998/07/22 11:00:13 peterg +# %% Version to BAe +# %% +# %% Revision 1.33 1998/07/17 19:32:19 peterg +# %% Added more about aliases +# %% +# %% Revision 1.32 1998/07/05 14:21:56 peterg +# %% Further additions (Carlisle-Glasgow) +# %% +# %% Revision 1.31 1998/07/04 11:35:57 peterg +# %% Strarted new lbl description +# %% +# %% Revision 1.30 1998/07/02 18:39:20 peterg +# %% Started 3.0 +# %% Added alias and default sections. +# %% +# %% Revision 1.29 1998/05/19 19:46:58 peterg +# %% Added the odess description +# %% +# %% Revision 1.28 1998/05/14 09:17:22 peterg +# %% Added METHOD variable to the simpar file +# %% +# %% Revision 1.27 1998/05/13 10:03:09 peterg +# %% Added unknown/zero SS label documentation. +# %% +# %% Revision 1.26 1998/04/29 15:12:46 peterg +# %% Version 2.9. +# %% +# %% Revision 1.25 1998/04/12 17:00:26 peterg +# %% Added new port features: coerced direction and top-level behaviour. +# %% +# %% Revision 1.24 1998/04/05 18:27:20 peterg +# %% This was the 2.6 version +# %% +# Revision 1.23 1997/08/24 11:17:51 peterg +# This is the released version 2.5 +# +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c = 1.0; # Default value +r = 1.0; # Default value +# Initial states +x(1) = 0.0; # Initial state for rc (c) +@end example +As usual, @strong{MTT} provides a default text file to be edited by the +user (@pxref{Text editors}). + +@node Causal bond graph (cbg), Elementary system equations, Parameters, Representations +@comment node-name, next, previous, up +@section Causal bond graph (cbg) +@cindex Causal bond graph (cbg) +The causal bond graph is the causally complete version of the +Acausal bond graph (@pxref{Acausal bond graph (abg)}). + +To create the causal bond graph of system `sys' in language fig type: +@example +mtt sys cbg fig +@end example +To create the causal bond graph of system `sys' in language m type: +@example +mtt sys cbg m +@end example +To view the causal bond graph of system `sys' type: +@example +mtt sys cbg view +@end example + +@menu +* Language fig (cbg.fig):: +* Language m (cbg.m):: +@end menu + +@node Language fig (cbg.fig), Language m (cbg.m), Causal bond graph (cbg), Causal bond graph (cbg) +@subsection Language fig (cbg.fig) +@cindex Language fig (cbg.fig) +@pindex Language fig (cbg.fig) +The fig file is created by @strong{MTT}. It is identical to the +corresponding acausal representation (@pxref{Language fig (abg.fig)}) +except that +@itemize @bullet +@item +the new causal strokes are added (using a double thickness line in blue) +@item +components that are undercausal are bold and green +@item +components that are overcausal are bold and red +@end itemize + +@node Language m (cbg.m), , Language fig (cbg.fig), Causal bond graph (cbg) +@comment node-name, next, previous, up +@subsection Language m (cbg.m) +@cindex Language m (cbg.m) +@cindex cbonds +@cindex status + + +The causal bond graph of system `sys' is represented as + an m file with heading: +@example +function [cbonds,status] = sys_cbg +@end example +The two outputs of this function are: +@itemize @bullet +@item +cbonds +@item +status +@end itemize + +@emph{cbonds} is a matrix with +@itemize @bullet +@item +one row for each bond +@item +the first column contains the arrow-orientated +(@pxref{Arrow-orientated causality}) +causality of the @emph{effort} variable. +@item +the second column contains the arrow-orientated +(@pxref{Arrow-orientated causality}) +causality of the @emph{flow} variable. +@end itemize + +@emph{status} is a matrix with +@itemize @bullet +@item +one row for each component +@item +the first column contains 1 if the component is overcausal; 0 if the +component is causally complete and -1 if the component is undercausal. +@end itemize +A successful model would therefore have all zeros in the status matrix. + +@menu +* Transformation abg2cbg_m:: +@end menu + +@node Transformation abg2cbg_m, , Language m (cbg.m), Language m (cbg.m) +@comment node-name, next, previous, up +@subsubsection Transformation abg2cbg_m +@cindex Transformation abg2cbg_m + +This transformation takes the acausal bond graph as an m file +(@pxref{Language m (abg.m)}) and transforms it into a causal bond graph in +m-file format (@pxref{Language m (cbg.m)}). + +It is based on the m-function abg2cbg.m which iteratively tries to +complete causality whilst recursively searching the bond graph +structure. +If causality is incomplete, it picks the first acausal dynamic (C or I) +component, asserts integral causality, and tries again. + +This is essentially the sequential causality assignment procedure of +Karnopp and Rosenberg. + +The transformation informs the user of the final status in terms of the +percentage of causally complete components; a successful model will +yield 100% here. + +@node Elementary system equations, Differential-Algebraic Equations, Causal bond graph (cbg), Representations +@comment node-name, next, previous, up +@section Elementary system equations (ese) +@cindex Elementary system equations + +The elementary system equations are a complete set of assignment statements +describing the dynamic system corresponding to the bond graph. +They are in the Reduce (@pxref{Reduce}) language. + +Because these are based on a causally complete system, these assignment +statements are directly soluble by substitution. + +Unlike early versions of @strong{MTT}, @strong{MTT} does @emph{not} sort +the equations in order of solution, but rather leaves them sorted by +component and subsystem. + +These are not supposed to be read by the user, so there is no view +facility as such. However, you may read these with your favourite text +editor and, to this end, helpful comment lines have been added. + +Wherever components have an explicit constitutive relationship, the +corresponding RHS of the equation has a standard form. + +@example +cr(arguments,out_causality,outport, + input_1, causality_1, port_1, + .... + input_i, causality_i, port_i, + .... + input_n, causality_n, port_n + ); +@end example +where the symbols have the following meaning +@vtable @code +@item arguments + the constitutive relationship arguments +@item out_causality + the causality (effort or flow) of the output variable + (@pxref{Variables}) +@item outport + the number (integer) of the output port of the system +@item input_i + the ith input to the component +@item causality_i + the causality (effort or flow) of the ith input variable + (@pxref{Variables}) +@item port_i + the number (integer) of the ith input port of the system +@end vtable + +An example for a resistor with linear constitutive relationship is: +@example +rc_1_bond4_flow := lin(flow,r,flow,1, + rc_1_bond4_effort,effort,1 + ); +@end example + +@menu +* Transformation cbg2ese_m2r:: +@end menu + +@node Transformation cbg2ese_m2r, , Elementary system equations, Elementary system equations +@comment node-name, next, previous, up +@subsection Transformation cbg2ese_m2r +@cindex Transformation cbg2ese_m2r +@cindex Structure +@cindex def.r +This transformation takes the causal bond graph as an m file +(@pxref{Language m (cbg.m)}) and transforms it into elementary system +equations +in Reduce (@pxref{Reduce}) +form. + +It is based on the m-function cbg2ese.m which iteratively traverses the +causal bond graph writing equations as it goes. + +It also writes out the system structure as the file @file{sys_def.r}. + + +@node Differential-Algebraic Equations, Constrained-state Equations, Elementary system equations, Representations +@section Differential-Algebraic Equations (dae) +@cindex Differential-Algebraic Equations +@cindex DAE + +The system differential algebraic equations describe the system dynamics together +together with any algebraic constraints. + +They are generated in language @code{lang} for system +@code{sys} by: +@example +mtt sys dae lang +@end example +Valid languages are: +@vtable @code +@item r + reduce (@pxref{Reduce}). +@item m + m (@pxref{m}). +@item view + reduce (@pxref{Views}). +@end vtable + + +There are five sets of variables describing the system: +@vtable @code +@item x + the system states (corresponding to C and I components with integral + causality. +@item z + the system nonstates (corresponding to C and I components with derivative + causality. +@item u + the system inputs (corresponding to SS components + with external attribute). +@item ui + the @emph{internal} system inputs (corresponding to SS components + with internal attribute) used to solve algebraic loops + (@pxref{Algebraic loops}). +@item y + the system outputs (corresponding to SS components + with external attribute). + @end vtable + +In general there are four sets of equations. The right-hand side of + each is a function of x, dz/dt, u and ui and the left hand sides are: +@enumerate +@item +the derivative of x (dx/dt) +@item +z +@item +w=0 (the algebraic equations) +@item +y +@end enumerate + +@menu +* Differential-Algebraic Equations (reduce):: +* Differential-Algebraic Equations (m):: +@end menu + +@node Differential-Algebraic Equations (reduce), Differential-Algebraic Equations (m), Differential-Algebraic Equations, Differential-Algebraic Equations +@subsection Language reduce (dae.r) +@cindex Differential-Algebraic Equations (reduce) +@cindex dae.r + +The system DAEs (@pxref{Differential-Algebraic Equations}) +are represented in the reduce (@pxref{Reduce}) language as +arrays containing the algebraic expressions for the +right hand sides of each set of equations. The arrays are: +@vtable @code +@item MTTx + x -- the system states (corresponding to C and I components with integral + causality. + +@item MTTz + z -- the system nonstates (corresponding to C and I components with derivative + causality. +@item MTTu + u -- the system inputs (corresponding to SS components + with external attribute). +@item mttv + ui -- the @emph{internal} system inputs (corresponding to SS components + with internal attribute) used to solve algebraic loops + (@pxref{Algebraic loops}). +@item MTTy + y -- the system outputs (corresponding to SS components + with external attribute). + @end vtable + +@menu +* Transformation ese2dae_r:: +@end menu + +@node Transformation ese2dae_r, , Differential-Algebraic Equations (reduce), Differential-Algebraic Equations (reduce) +@subsubsection Transformation ese2dae_r +@cindex Transformation ese2dae_r +@pindex ese2dae_r + +This transformation (@pxref{What is a Transformation?}) +uses Reduce (@pxref{Reduce}) to combine the elementary system +equations (@pxref{Elementary system equations}) with the +constitutive relationships (@pxref{Constitutive relationship}) +and simplify the result. + +@node Differential-Algebraic Equations (m), , Differential-Algebraic Equations (reduce), Differential-Algebraic Equations +@subsection Language m (dae.m) +@cindex Differential-Algebraic Equations (m) +@cindex dae.m +The system DAEs (@pxref{Differential-Algebraic Equations}) +are represented in the m (@pxref{m}) language as +two m-functions of the form: + +@example +function resid = sys_dae(dx,x,t) +function y = sys_dae(dx,x,t) +@end example +Where x is the dae @emph{descriptor} vector and dx its +time derivative; t is the time. +The first function is of a form suitable for solution by DASSL; +the second function can then be used to find the coresponding system +output. + +@menu +* Transformation dae_r2m:: +@end menu + +@node Transformation dae_r2m, , Differential-Algebraic Equations (m), Differential-Algebraic Equations (m) +@subsubsection Transformation dae_r2m +@cindex Transformation dae_r2m +@pindex dae_r2m + +This transformation (@pxref{What is a Transformation?}) +uses Reduce (@pxref{Reduce}) to rewrite the elementary system +equations (@pxref{Elementary system equations}) in m-file +format (@pxref{m}) . Numerical parameters are declared as global. + + +@node Constrained-state Equations, Ordinary Differential Equations, Differential-Algebraic Equations, Representations +@section Constrained-state Equations (cse) +@cindex Constrained-state Equations +@cindex ODE + +The system constrained-state equations describe the system dynamics for +a special class of systems (see the book for details). The resuting +equations are of the form: +@example +E(x) dx/dt = f(x,u) +y = g(x,u) +@end example +They typically occure where two or more states are constrained to be equal, or +proportional, to each other. For example, two capacitors in parallel or +two inertias connected by a stiff shaft. + + +They are generated in language @code{lang} for system +@code{sys} by: +@example +mtt sys cse lang +@end example +Valid languages are: +@vtable @code +@item r + reduce (@pxref{Reduce}). +@item m + m (@pxref{m}). +@item view + reduce (@pxref{Views}). +@end vtable + +There are three sets of variables describing the system: +@vtable @code +@item x + the system states (corresponding to C and I components with integral + causality. +@item u + the system inputs (corresponding to SS components + with external attribute). +@item y + the system outputs (corresponding to SS components + with external attribute). + @end vtable + +In general there are two sets of equations. The right-hand side of + each is a function of x and u and the left hand sides are: +@enumerate +@item +the derivative of x (dx/dt) +y +@end enumerate + +@menu +* Constrained-state Equations (reduce):: +* Constrained-state Equations (view):: +@end menu + +@node Constrained-state Equations (reduce), Constrained-state Equations (view), Constrained-state Equations, Constrained-state Equations +@subsection Language reduce (cse.r) +@cindex Constrained-state Equations (reduce) +@cindex cse.r + +The system CSEs (@pxref{Constrained-state Equations}) +are represented in the reduce (@pxref{Reduce}) language as +arrays containing the algebraic expressions for the +right hand sides of each set of equations. The arrays are: +@vtable @code +@item MTTx + x -- the system states (corresponding to C and I components with integral + causality. +@item MTTu + u -- the system inputs (corresponding to SS components + with external attribute). +@item MTTy + y -- the system outputs (corresponding to SS components + with external attribute). +@end vtable +together with the array containing the elements of the E matrix. +@menu +* Transformation dae2cse_r:: +@end menu + +@node Transformation dae2cse_r, , Constrained-state Equations (reduce), Constrained-state Equations (reduce) +@subsubsection Transformation dae2cse_r +@cindex Transformation dae2cse_r +@pindex dae2cse_r + +This transformation (@pxref{What is a Transformation?}) +Reduce (@pxref{Reduce}) to find various Jacobians which are combined to +find the E matrix and the +constrained-state equations (@pxref{Constrained-state Equations}). + +@node Constrained-state Equations (view), , Constrained-state Equations (reduce), Constrained-state Equations +@subsection Language m (view) +@cindex Constrained-state Equations (view) +@cindex view Constrained-state Equations +This representation has the standard text view +(@pxref{Views}). + +@node Ordinary Differential Equations, Descriptor matrices, Constrained-state Equations, Representations +@section Ordinary Differential Equations +@cindex Ordinary Differential Equations +@cindex ODE + +The system ordinary differential equations describe the system dynamics. + +They are generated in language @code{lang} for system +@code{sys} by: +@example +mtt sys ode lang +@end example +Valid languages are: +@vtable @code +@item r + reduce (@pxref{Reduce}). +@item m + m (@pxref{m}). +@item view + reduce (@pxref{Views}). +@end vtable + +There are three sets of variables describing the system: +@vtable @code +@item x + the system states (corresponding to C and I components with integral + causality. +@item u + the system inputs (corresponding to SS components + with external attribute). +@item y + the system outputs (corresponding to SS components + with external attribute). + @end vtable + +In general there are two sets of equations. The right-hand side of + each is a function of x and u and the left hand sides are: +@enumerate +@item +the derivative of x (dx/dt) +y +@end enumerate + +@menu +* Ordinary Differential Equations (reduce):: +* Ordinary Differential Equations (m):: +* Ordinary Differential Equations (view):: +@end menu + +@node Ordinary Differential Equations (reduce), Ordinary Differential Equations (m), Ordinary Differential Equations, Ordinary Differential Equations +@subsection Language reduce (ode.r) +@cindex Ordinary Differential Equations (reduce) +@cindex ode.r + +The system ODEs (@pxref{Ordinary Differential Equations}) +are represented in the reduce (@pxref{Reduce}) language as +arrays containing the algebraic expressions for the +right hand sides of each set of equations. The arrays are: +@vtable @code +@item MTTx + x -- the system states (corresponding to C and I components with integral + causality. +@item MTTu + u -- the system inputs (corresponding to SS components + with external attribute). +@item MTTy + y -- the system outputs (corresponding to SS components + with external attribute). + @end vtable + +@menu +* Transformation cse2ode_r:: +@end menu + +@node Transformation cse2ode_r, , Ordinary Differential Equations (reduce), Ordinary Differential Equations (reduce) +@subsubsection Transformation cse2ode_r +@cindex Transformation cse2ode_r +@pindex cse2ode_r + +This transformation (@pxref{What is a Transformation?}) +uses Reduce (@pxref{Reduce}) to invert the E matrix of the +constrained-state equations (@pxref{Constrained-state Equations}) +and simplify the result. + +@node Ordinary Differential Equations (m), Ordinary Differential Equations (view), Ordinary Differential Equations (reduce), Ordinary Differential Equations +@subsection Language m (ode.m) +@cindex Ordinary Differential Equations (m) +@cindex ode.m +The system ODEs (@pxref{Ordinary Differential Equations}) +are represented in the m (@pxref{m}) language as +two m-functions of the form: + +@example +function dx = sys_ODE(x,t) +function y = sys_ODE(dx,x,t) +@end example +Where x is the ODE @emph{state} vector and dx its +time derivative; t is the time. +The first function is of a form suitable for solution by odesol; +the second function can then be used to find the corresponding system +output. + +@menu +* Transformation ode_r2m:: +@end menu + +@node Transformation ode_r2m, , Ordinary Differential Equations (m), Ordinary Differential Equations (m) +@subsubsection Transformation ode_r2m +@cindex Transformation ode_r2m +@pindex ode_r2m + +This transformation (@pxref{What is a Transformation?}) +uses Reduce (@pxref{Reduce}) to rewrite the +ordinary differential equations +(@pxref{Ordinary Differential Equations}) in m-file +format (@pxref{m}) . Numerical parameters are declared as global. + +@node Ordinary Differential Equations (view), , Ordinary Differential Equations (m), Ordinary Differential Equations +@subsection Language m (view) +@cindex Ordinary Differential Equations (view) +@cindex view Ordinary Differential Equations +This representation has the standard text view +(@pxref{Views}). + +@node Descriptor matrices, Report, Ordinary Differential Equations, Representations +@section Descriptor matrices (dm) +@cindex Descriptor matrices +@cindex dm + +The system descriptor matrices A, B, C, D and E describe the +@emph{linearised} system dynamics in the form +@example +E dx/dt = Ax + Bu +y = Cx + Du +@end example + +They are generated in language @code{lang} for system +@code{sys} by: +@example +mtt sys dm lang +@end example +Valid languages are: +@vtable @code +@item r + reduce (@pxref{Reduce}). +@item m + m (@pxref{m}). +@item view + reduce (@pxref{Views}). +@end vtable + + +@menu +* Descriptor matrices (reduce):: +* Descriptor matrices (m):: +@end menu + +@node Descriptor matrices (reduce), Descriptor matrices (m), Descriptor matrices, Descriptor matrices +@subsection Language reduce (dm.r) +@cindex Descriptor matrices (reduce) +@cindex dm.r + +The system descriptor matrices (@pxref{Descriptor matrices}) +are represented in the reduce (@pxref{Reduce}) language as +arrays containing the four matrices. The arrays are: +@vtable @code +@item MTTA + A +@item MTTB + B +@item MTTA + C +@item MTTD + D +@item MTTE + E +@end vtable + +@node Descriptor matrices (m), , Descriptor matrices (reduce), Descriptor matrices +@subsection Language m (dm.m) +@cindex Descriptor matrices (m) +@cindex dm.m +The system descriptor matrices (@pxref{Descriptor matrices}) +are represented in the m (@pxref{m}) language as +an m-function of the form: + +@example +function [A,B,C,D,E] = sys_dm +@end example + +System numeric parameters (@pxref{Numeric parameters}) +are passed via global variables defined in the _numpar.m file. +@c (@pxref{numpar.m}). +Thus the system descriptor matrices are +typically generated in Octave (@pxref{Octave}) as follows: + +@example +sys_numpar +[A,B,C,D,E] = sys_dm +@end example + +Parameters can be changed from their default values by entering +their values directly into Octave (@pxref{Octave}) and then invoking +@code{sys_dm}; for example +@example +sys_numpar +par_1 = 25 +par_2 = par_1 + 3 +[A,B,C,D,E] = sys_dm +@end example + + +@node Report, , Descriptor matrices, Representations +@section Report (rep) +@cindex Report +@cindex rep + +@strong{MTT} has a report-generator feature. The user specifies the +report contents in a text file (@pxref{Report (text)}) using an +appropriate text editor (@pxref{Text editors}). + +For example, the report can be viewed by typing +@example +mtt system rep view +@end example + + +@menu +* Report (text):: +* Report (view):: +@end menu + +@node Report (text), Report (view), Report, Report +@subsection Language text (rep.txt) +@cindex Report (text) +@cindex rep.txt + +The user specifies the report contents in a text file (@pxref{Report +(text)}) using an appropriate text editor (@pxref{Text editors}). +The text file contains lines which are either comments (indicated by %) +or valid @strong{MTT} commands. The report will then contain appropriate +sections. The following languages are supported by the report generator: +@ftable @code +@item m + @code{octave} a high-level interactive language for numerical + computation. +@item r + @code{reduce} a high-level interactive language for symbolic + computation. +@item tex + @code{latex} a text processor. +@item ps + @code{ghostview} another document viewer. +@item c + @code{gcc} a c compiler. +@end ftable +For example: +@example +mtt rc abg tex +mtt rc cbg ps +mtt rc struc tex +mtt rc ode tex +mtt rc sro ps +mtt rc tf tex +mtt rc lmfr ps +@end example + +The acausal bond graph (abg) (@pxref{Acausal bond graph (abg)}) with the +tex language is handled in a special way: the acausal Bond Graph in +fig format (@pxref{Language fig (abg.fig)}), the label file (@pxref{Labels (lbl)}) +the description file (@pxref{Detailed}), together with +corresponding subsystems are included in the report. It is recommended +that the first (non-comment line) in the file should be: +@example +mtt abg tex +@end example +where @code{} is the name of the (top-level) system. + +As usual, @strong{MTT} provides a default text file to be edited by the +user (@pxref{Text editors}). + +In the special case that the first argument to mtt (normally the system) +is a directory, a default text file is provided which generates a report +for all systems to be found in that directory tree. + +@node Report (view), , Report (text), Report +@subsection Language view +@cindex Report (view) +@cindex view Report +This representation has the standard text view +(@pxref{Views}). + +@node Extending MTT, Documentation, Representations, Top +@comment node-name, next, previous, up +@chapter Extending MTT +@cindex Extending MTT +@cindex Make + +@strong{MTT} has a number of built-in mechanisms for the user to extend +its capabilities. As @strong{MTT} is based on `Make' it is unsurprising +that some of these involve the creation of `make files'. + +@menu +* Makefiles:: +* New (DIY) representations:: +* Component library:: +@end menu + +@node Makefiles, New (DIY) representations, Extending MTT, Extending MTT +@comment node-name, next, previous, up +@section Makefiles +@cindex Makefiles + +If a file called `Makefile' exists in the current directory, +@strong{MTT} executes it using make before doing anything else. This is +useful if one of the .txt files contains a reference to, for example, an +octave function of which @strong{MTT} unaware. Such a function can be +created using the makefile. An example `Makefile' is +@example +# Makefile for the Two link GMV example + +all: msdP_tf.m TwoLinkP_obs.m TwoLinkP_sm.m twolinkp_sm.m TwoLinkGMV_numpar.m + +msdP_tf.m: msdP_abg.fig + mtt -q msdP tf m + +TwoLinkP_obs.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt + mtt -q TwoLinkP obs m + +TwoLinkP_sm.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt + mtt -q TwoLinkP sm m + +twolinkp_sm.m: TwoLinkP_sm.m + cp -v TwoLinkP_sm.m twolinkp_sm.m + +TwoLinkGMV_numpar.m: TwoLinkGMV_numpar.txt + mtt -q TwoLinkGMV numpar m +@end example +All of the files in the line stating `all:' are created when +@strong{MTT} is executed (if they don't already exist). + +@node New (DIY) representations, Component library, Makefiles, Extending MTT +@comment node-name, next, previous, up +@section New (DIY) representations +@cindex New representations +@cindex DIY representations + +It may be convenient to create new representations for @strong{MTT}; in +particular, it is nice to be able to include the result of some +numerical or symbolic computations within an @strong{MTT} report +(@pxref{Report}). Therefore @strong{MTT} provides a mechanism for doing +this. + +Future extensions of @strong{MTT} will use such representations stored +in $MTT_REP. + +There are three parts to creating a DIY representation called myrep +@enumerate +@item Creating a make file in Make format called myrep_rep.make +@item Optionally creating a shell script called myrep_rep.sh +@item Optionally creating a documentation file in LaTeX format called myrep_rep.tex +@end enumerate + +@menu +* Makefile (DIY representations):: +* Shell-script (DIY representations):: +* Documentation (DIY representations):: +@end menu + +@node Makefile (DIY representations), Shell-script (DIY representations), New (DIY) representations, New (DIY) representations +@comment node-name, next, previous, up +@subsection Makefile +@cindex New representations +@cindex DIY representations +@cindex Makefile + +To create a new representation `myrep' in a language `mylang', create a +file with the name +@example +myrep_rep.make +@end example +This file must contain text in `make' syntax. It is executed by +@strong{MTT} and the two arguments `SYS' (the system name) and `LANG' +(the language) are passed to it by @strong{MTT}. Note that @strong{MTT} +cannot know of any prerequisites, but these can be explicitly included in +the makefile (which may include execution of @strong{MTT} itself. + +The following example declares the new representation `ident' which is +created in conjunction with the shell-script ident_rep.sh (@pxref{Shell-script (DIY +representations)}). + +@verbatim +# -*-makefile-*- + +#SUMMARY Identification +#DESCRIPTION Partially know system identification using +#DESCRIPTION using bond graphs + +# Makefile for representation ident +# File ident_rep.make + +#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop + +## Model targets +model_reps = ${MTT_SYS}_sympar.m ${MTT_SYS}_simpar.m ${MTT_SYS}_state.m +model_reps += ${MTT_SYS}_numpar.m ${MTT_SYS}_input.m ${MTT_SYS}_ode2odes.m +model_reps += ${MTT_SYS}_def.m + +## Prepend s to get the sensitivity targets +sensitivity_reps = ${model_reps:%=s%} + +## Model prerequisites +model_pre = ${MTT_SYS}_abg.fig ${MTT_SYS}_lbl.txt +model_pre += ${MTT_SYS}_rdae.r ${MTT_SYS}_numpar.txt + +## Prepend s to get the sensitivity targets +sensitivity_pre = ${model_pre:%=s%} + + +## Simulation targets +sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m + +## m-files needed for ident +ident_m = ${MTT_SYS}_ident.m ${MTT_SYS}_ident_numpar.m + +## Targets for the ident simulation +ident_reps = ${ident_m} ${sims} ${model_reps} ${sensitivity_reps} + +## ps output files etc +psfiles = ${MTT_SYS}_ident.ps ${MTT_SYS}_ident.comparison.ps +figfiles = ${psfiles:%.ps=%.fig} +gdatfiles = ${psfiles:%.ps=%.gdat} +datfiles = ${psfiles:%.ps=%.dat2} + +## LaTeX files etc +latexfiles = ${MTT_SYS}_ident_par.tex + +all: ${MTT_SYS}_ident.${MTT_LANG} + +echo: + echo "sims: ${sims}" + echo "model_reps: ${model_reps}" + echo "sensitivity_reps: ${sensitivity_reps}" + echo "ident_reps: ${ident_reps}" + +${MTT_SYS}_ident.view: ${psfiles} + ident_rep.sh ${MTT_SYS} view + +${psfiles}: ${figfiles} + ident_rep.sh ${MTT_SYS} ps + +${figfiles}: ${gdatfiles} + ident_rep.sh ${MTT_SYS} fig + +${gdatfiles}: ${datfiles} + ident_rep.sh ${MTT_SYS} gdat + +${datfiles} ${latexfiles}: ${ident_reps} + ident_rep.sh ${MTT_SYS} dat2 + +${MTT_SYS}_ident.m: + ident_rep.sh ${MTT_SYS} m + +${MTT_SYS}_ident_numpar.m: + ident_rep.sh ${MTT_SYS} numpar.m + +## System model reps +## Generic txt files +${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt + +## Specific m files +${MTT_SYS}_ode2odes.m: ${model_pre} + mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m + +${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m + +## Numpar files +${MTT_SYS}_numpar.m: + mtt ${MTT_SYS} numpar m + +## Sympar files +${MTT_SYS}_sympar.m: + mtt ${MTT_SYS} sympar m + +## Generic txt to m +${MTT_SYS}_%.m: ${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m + +## r files +${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r + +${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r + +## Sensitivity model reps +## Generic txt files +s${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} $* txt + +## Specific m files +## Numpar files +s${MTT_SYS}_numpar.m: + mtt -s s${MTT_SYS} numpar m + +## Sympar files +s${MTT_SYS}_sympar.m: + mtt -s s${MTT_SYS} sympar m + +s${MTT_SYS}_ode2odes.m: ${sensitivity_pre} + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ode2odes m + +s${MTT_SYS}_ssim.m: + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ssim m + +s${MTT_SYS}_def.m: + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} def m + + +## Generic txt to m +s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m + +## r files +s${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r + +@end verbatim + +@node Shell-script (DIY representations), Documentation (DIY representations), Makefile (DIY representations), New (DIY) representations +@comment node-name, next, previous, up +@subsection Shell-script +@cindex New representations +@cindex DIY representations +@cindex Shell-script + +For more complex DIY representations, it is convenient to define new +commands to be used by the Makefile (@pxref{Makefile (DIY +representations)}). + +The following example shows this in the context of the DIY +representation `ident' used as an example in the previous section +(@pxref{Makefile (DIY representations)}). + + +@verbatim +#! /bin/sh + +## ident_rep.sh +## DIY representation "ident" for mtt +# Copyright (C) 2002 by Peter J. Gawthrop + +ps=ps + +sys=$1 +rep=ident +lang=$2 +mtt_parameters=$3 +rep_parameters=$4 + +## Some names +target=${sys}_${rep}.${lang} +def_file=${sys}_def.r +dat2_file=${sys}_ident.dat2 +dat2s_file=${sys}_idents.dat2 +ident_numpar_file=${sys}_ident_numpar.m +option_file=${sys}_ident_mtt_options.txt + +## Get system information +if [ -f "${def_file}" ]; then + echo Using ${def_file} +else + mtt -q ${sys} def r +fi + +ny=`mtt_getsize $1 y` +nu=`mtt_getsize $1 u` + +check_new_options() { + if [ -f "${option_file}" ]; then + old_options=`cat ${option_file}` + if [ "${mtt_options}" != "${old_options}" ]; then + echo ${mtt_options} > ${option_file} + fi + else + echo ${mtt_options} > ${option_file} + fi +} + +## Make the _ident.m file +make_ident() { +filename=${sys}_${rep}.m +date=`date` +echo Creating ${filename} + +cat > ${filename} < ${sys}_ident_numpar.m <0) + par = ${sys}_numpar(); + x_0 = ${sys}_state(par); + dt = t(2)-t(1); + simpars.dt = dt; + simpars.last = t(length(t)); + y = ${sys}_sim(zeros(n_x,1), par, simpars, u); + endif + + ## Default parameter names - Put in your own here + sympar = ${sys}_sympar; # Symbolic params as structure + par_names = struct_elements (sympar); # Symbolic params as strings + [n,m] = size(par_names); # Size the string list + + ## Sort by index + for [i,name] = sympar + par_names(i,:) = sprintf("%s%s",name, blanks(m-length(name))); + endfor + + ## Output weighting vector + Q = ones(n_y,1); + + ## Extra parameters + extras.criterion = 1e-5; + extras.emulate_timing = 0; + extras.max_iterations = 10; + extras.simulate = simulate; + extras.v = 1e-2; + extras.verbose = 1; + extras.visual = 1; + +endfunction +EOF +} + +make_dat2() { + +## Inform user +echo Creating ${dat2_file} + +## Use octave to generate the data +octave -q < mtt_junk +sed -e "s/_\([a-z0-9,]*\)/_{\1}/g" < mtt_junk >${sys}_ident_par.tex +rm mtt_junk +} + +case ${lang} in + numpar.m) + ## Make the numpar stuff + make_ident_numpar; + ;; + m) + ## Make the code + make_ident; + ;; + dat2) + ## The dat2 language (output data) & fig file + make_dat2; + ;; + gdat) + cp ${dat2_file} ${dat2s_file} + dat22dat ${sys} ${rep} + dat2gdat ${sys} ${rep} + ;; + fig) + gdat2fig ${sys}_${rep} + ;; + ps) + figs=`ls ${sys}_ident*.fig | sed -e 's/\.fig//'` + for fig in ${figs}; do + fig2dev -Leps ${fig}.fig > ${fig}.ps + done + texs=`ls ${sys}_ident*.tex | sed -e 's/\.tex//'` + for tex in ${texs}; do + makedoc "" "${sys}" "ident_par" "tex" "" "" "$ps" + doc2$ps ${sys}_ident_par "$documenttype" + done + ;; + view) + pss=`ls ${sys}_ident*.ps` + echo Viewing ${pss} + for ps in ${pss}; do + gv ${ps}& + done + ;; + *) + echo Language ${lang} not supported by ${rep} representation + exit 3 +esac + + + +@end verbatim + +@node Documentation (DIY representations), , Shell-script (DIY representations), New (DIY) representations +@comment node-name, next, previous, up +@subsection Documentation +@cindex New representations +@cindex DIY representations +@cindex Documentation + + +@node Component library, , New (DIY) representations, Extending MTT +@comment node-name, next, previous, up +@section Component library +@cindex Component library +@cindex component +@cindex Component library + +If @strong{MTT} does not recognise a component (eg named MyComponent) as +a simple component (@pxref{Simple components}) or as already existing, +it searches the library search path $MTT_COMPONENTS +(@pxref{$MTT_COMPONENTS}) for a directory called MyComponent containing +MyComponent_lbl.txt. It then copies the @emph{entire} directory into the +current working directory. Thus, for example, the directory could +contain MyComponent_desc.tex MyComponent_abg.fig MyComponent_lbl.txt and MyComponent_cr.r in +addition to MyComponent_lbl.txt. + +@c node next prev up +@node Documentation, Languages, Extending MTT, Top +@chapter Documentation +@cindex Documentation + +@menu +* Manual (Documentation):: +* On-line documentation:: +@end menu + +@node Manual (Documentation), On-line documentation, Documentation, Documentation +@section Manual +@cindex Manual + +MTT is documented in this manual. The manual can be invoked in various +ways: + +@vtable @code +@item mtt manual + Brings up a pdf version of the manual +@item mtt info + Brings up an xterm containing an info version of the manual +@item mtt hinfo + Brings up an html browser containing the manual +@item emacs + type ^h^i followed by mmtt in the command window +@item browser + point browser to http://mtt.sf.net +@end vtable + +@node On-line documentation, , Manual (Documentation), Documentation +@section On-line documentation +@cindex Components +@cindex Examples +@cindex Documentation +@cindex On-line documentation + +@strong{MTT} components, constitutive relations, examples and representations in libraries +(@pxref{Component library}) are documented in two ways: + +@enumerate +@item brief +@item verbose +@end enumerate + +@menu +* Brief:: +* Detailed:: +@end menu + +@node Brief, Detailed, On-line documentation, On-line documentation +@subsection Brief on-line documentation +@cindex Brief documentation + +Documentation of DIY components, examples, constitutive relationships +and representations is provides by the programmer by inserting code of +the form + +@example +#SUMMARY One line summary +#DESCRIPTION Multi-line +#DESCRIPTION More detailed description +@end example + +within the appropriate file (usually at or near the top): +@vtable @code +@item components + _lbl.txt (@pxref{Labels (lbl)}) +@item examples + _lbl.txt (@pxref{Labels (lbl)}) +@item constitutive relations + _cr.r (@pxref{DIY constitutive relationships}) +@item representations + _rep.make (@pxref{Makefile (DIY representations)}) +@end vtable + +This documentation is accessed by the user in various ways +@vtable @code +@item mtt help name + prints basic information on the screen +@item mtt system lbl view + gives formatted information about the component or example +@item Including mtt system abg tex in the _rep.txt file + gives formatted information about the component or example + within the report +@end vtable + +@node Detailed, , Brief, On-line documentation +@subsection Detailed on-line documentation +@cindex Detailed documentation +@cindex Description +@cindex desc + +DIY components, examples, constitutive relationships can be described +textually in LaTeX (.tex) description file; this is the only language +for this representation. This representation is used by the LaTeX +language version (@pxref{Language tex (abg.tex)}) of the acausal bond +graph representation (@pxref{Acausal bond graph (abg)}). + +The file may contain any LaTeX commands +valis for the ``article'' document type but must @strong{not} contain: +@itemize @bullet +@item documentclass commands +@item document environments +@end itemize + +@c node next prev up +@node Languages, Language tools, Documentation, Top +@chapter Languages +@cindex Languages +@pindex Languages + + +@c node next prev up +@menu +* Fig:: r +* m:: +* Reduce:: +* c:: +@end menu + +These are a number of languages used by @strong{MTT} to implement the +various representations. +Each has associated Language tools (@pxref{Language tools}) to +manipulate and/or view the representation. + +@ftable @code +@item fig + @code{Fig} a graphical description language. +@item m + @code{octave} a high-level interactive language for numerical + computation. +@item r + @code{reduce} a high-level interactive language for symbolic + computation. +@item tex + @code{latex} a text processor. +@item dvi + @code{xdvi} a document viewer. +@item ps + @code{ghostview} another document viewer. +@item gdat + @code{gnuplot} a data viewer. +@item c + @code{gcc} a c compiler. +@item sg + @code{scigraphica} a plotting package. +@end ftable + +These tools are automatically invoked as appropriate by @strong{MTT}; +but for more advanced use, these tools can be used directly on files +(with the appropriate suffix) generated by @strong{MTT}. + + + +@node Fig, m, Languages, Languages +@section Fig +@cindex Fig +@pindex Fig +Please see xfig documentation. + +@node m, Reduce, Fig, Languages +@section m +@cindex m +@pindex m +Please see Octave documentation +@ifhtml +Octave documentation. +Matlab documentation. +@end ifhtml + + +@node Reduce, c, m, Languages +@section Reduce +@cindex Reduce +@pindex Reduce +Please see the reduce documentation. + +@node c, , Reduce, Languages +@comment node-name, next, previous, up +@section c +@cindex c +@pindex c +Please see the gcc documentation. +@node Language tools, Administration, Languages, Top +@comment node-name, next, previous, up +@chapter Language tools +@cindex Language tools + +@menu +* Views:: +* Xfig:: +* Text editors:: +* Octave:: +* LaTeX:: +@end menu + +@node Views, Xfig, Language tools, Language tools +@comment node-name, next, previous, up +@section Views +@cindex views + +A number of representations (@pxref{Representations}) have a language +representation which is particularly useful for viewing by the +user. These views are +invoked, where appropriate by the command: +@example +mtt sys rep view +@end example +where @code{sys} is the system name and @code{rep} a corresponding representation. + +@node Xfig, Text editors, Views, Language tools +@comment node-name, next, previous, up +@section Xfig +@cindex Xfig + +@node Text editors, Octave, Xfig, Language tools +@comment node-name, next, previous, up +@section Text editors +@cindex Text editors +All representations live in text files and thus may be edited using your +favourite text editor; however, the Fig (@pxref{Fig}) representation is +pretty meaningless in this form and so you should use Xfig +(@pxref{Xfig}) for representation in this language. + +Its up to you which text editor to use. I recommend emacs, but simpler +(and less powerful) editors such as xedit, textedit and vi are also ok. + +I usually run @strong{MTT} out of an emacs shell window and keep the +rest of the files in emacs buffers. + +@node Octave, LaTeX, Text editors, Language tools +@comment node-name, next, previous, up +@section Octave +@cindex Octave +@cindex Matlab +@cindex m-files +@cindex Octave interface +@cindex mtt.m + +Octave is a numerical matrix-based language @xref{Top, +,Octave,Octave,Octave}. It is similar to Matlab in many ways. In most +cases, m-files generated by @strong{MTT} can be understood by both +Matlab and Octave (and no doubt other Matlab lookalikes). + + @strong{MTT} provides the octave function @code{mtt}. The octave + command +@example +help mtt +@end example +gives the following information: +@example + usage: mtt (system[,representation,language]) + + Invokes mtt from octave to generate system_representation.language + Ie equivalent to "mtt system representation language" at the shell + Representation and language defualt to "sm" and "m" respectively + +@end example + +Thus for example, if octave is in the directory containing the system +rc the following session generates the state matrices of the system "rc" +with the defaut capacitance but resitance r=0.1. +@example +octave> mtt("rc"); +Creating rc_rbg.m +Creating rc_cmp.m +Creating rc_fig.fig +Creating rc_sabg.fig +Creating rc_alias.txt +Creating rc_alias.m +Creating rc_sub.sh +Creating rc_abg.m +Creating rc_cbg.m (maximise integral causality) +Creating rc_type.sh +Creating rc_ese.r +Creating rc_def.r +Creating rc_struc.txt +Creating rc_rdae.r +Creating rc_subs.r +Creating rc_cr.txt +Creating rc_cr.r +Copying CR SS to here from +Copying CR lin to here from +Creating rc_dae.r +Creating rc_sympar.txt +Creating rc_sympar.r +Creating rc_cse.r +Creating rc_sspar.r +Creating rc_csm.r +Creating rc_ode.r +Creating rc_ss.r +Creating rc_sm.r +Creating rc_switch.txt +0 switches found +Creating rc_sympars.txt +Creating rc_sm.m +Copying rc_sm.m +octave> mtt("rc","numpar"); +Creating rc_numpar.txt +Creating rc_numpar.m +Copying rc_numpar.m +octave> mtt("rc","sympar"); +Creating rc_sympar.m +Copying rc_sympar.m +octave> par = rc_numpar +par = + + 1 + 1 + +octave> sym = rc_sympar; + +octave> par(sym.r) = 0.1; +octave> [A,B,C,D] = rc_sm(par) +A = -10 + +B = 10 + +C = 1 + +D = 0 + +octave> +@end example +generates the data structure rc corresponding the the bond graph of the +system called `rc'. +The following octave commands then generate the step reponse and bode +diagram respectively: +@example +step(rc); +bode(rc); +@end example + + +@menu +* Octave control system toolbox (OCST):: +* Creating GNU Octave .oct files:: +* Creating Matlab .mex files:: +* Embedding MTT models in Simulink:: +@end menu + +@node Octave control system toolbox (OCST), Creating GNU Octave .oct files, Octave, Octave +@comment node-name, next, previous, up +@subsection Octave control system toolbox (OCST) +@cindex Octave +@cindex toolbox +@cindex OCST +@cindex control systems +@cindex mtt2sys + +@strong{MTT} provides an interface to the Octave control system toolbox +(OCST) using the mfile @code{mtt2sys}. the octave command +@example +help mtt2sys +@end example +gives the following information. +@example + usage: sys = mtt2sys (Name[,par]) + + Creates a sys structure for the Octave Control Systems Toolbox + from an MTT system with name "Name" + Optional second argument is system parameter list + Assumes that Name_sm.m, Name_struc.m and Name_numpar.m exist +@end example + +Thus for example, if octave is in the directory containing the system +rc: +@example +rc = mtt2sys("rc"); +@end example +generates the data structure rc corresponding the the bond graph of the +system called `rc'. +The following octave commands then generate the step reponse and bode +diagram respectively: +@example +step(rc); +bode(rc); +@end example + +@node Creating GNU Octave .oct files, Creating Matlab .mex files, Octave control system toolbox (OCST), Octave +@comment node-name, next, previous, up +@subsection Creating GNU Octave .oct files +@cindex Creating GNU Octave .oct files + +GNU Octave dynamically loaded functions (.oct files) can be created by +instructing @strong{MTT} to create the ``oct'' representation: + +@example + mtt [options] sys ode oct +@end example + +This will cause @strong{MTT} to create the C++ representation of the system +(sys_ode.cc) and to then compile it as a shared object suitable for +use within Octave. The resultant file may be used in an identical +manner to the equivalent, but generally slower, interpreted .m file. + +Usage information for the function may be obtained within Octave in the usual manner: + +@example + octave:1> help rc_ode + + rc_ode is the dynamically-linked function from the file + /home/mttuser/rc/rc_ode.oct + + Usage: [mttdx] = rc_ode(mttx,mttu,mttt,mttpar) + Octave ode representation of system rc + Generated by MTT on Fri Jul 5 11:23:08 BST 2002 +@end example + +Note that the first line of output from Octave identifies whether the +compiled or interpreted function is being used. + +Alternatively, standard representations may be generated using the +Octave DLDs by use of the ``-oct'' switch: + +@example + mtt -oct rc odeso view +@end example + +In order to successfully generate .oct files, Octave must be correctly +configured prior to compilation and certain headers and libraries must +be correctly installed on the system (@pxref{.oct file dependencies}). + +@node Creating Matlab .mex files, Embedding MTT models in Simulink, Creating GNU Octave .oct files, Octave +@comment node-name, next, previous, up +@subsection Creating Matlab .mex files +@cindex Creating Matlab .mex files + +On GNU/Linux systems, Matlab dynamically linked executables (.mexglx +files) can created by instructing @strong{MTT} to create the +``mexglx'' representation: + +@example + mtt [options] sys ode mexglx +@end example + +This will cause @strong{MTT} to create the C++ representation of the +system (sys_ode.cc) and to then compile it as a shared object suitable +for use within Matlab. + +If it is necessary to compile mex files for another platform, then the +usual C++ representation (generated with the -cc flag) can be created +and the resultant file compiled with the -DCODEGENTARGET=MATLABMEX +flag on the target platform. + +@example + mtt_machine: + mtt -cc rc ode cc + + matlab_machine: + matlab> mex -DCODEGENTARGET=MATLABMEX rc_ode.cc +@end example + +@node Embedding MTT models in Simulink, , Creating Matlab .mex files, Octave +@comment node-name, next, previous, up +@subsection Embedding MTT models in Simulink +@cindex Embedding MTT models in Simulink + +It is possible to embed @strong{MTT} functions or entire @strong{MTT} +models within Simulink simulations as Sfun blocks. If the zip package +is installed on the system, the command + +@example + mtt sys sfun zip +@end example + +will create a compressed archive containing sys.mdl, which may be +embedded into a larger Simulink model. Also contained within the +archive will be four sys_sfun*.c files, + +@itemize @bullet +@item +sys_sfun.c +model state and output equations +@item +sys_sfun_ae.c +model algebraic equations +@item +sys_sfun_input.c +model inputs +@item +sys_sfun_interface.c +interface between MTT model and Simulink +@end itemize + +The last of these files must be edited to correctly map the inputs and +outputs between the @strong{MTT} and Simulink models. The two sections +to edit are clearly marked with + +@example + @code{/* Start EDIT */} + @code{....} + @code{/* End EDIT */} +@end example + +These four files should then be compiled with the Matlab ``mex'' +compiler as described in the @emph{README} file in the archive. + +If it is desired to compile the .mex files directly from within +@strong{MTT} on a machine which has the Matlab header files installed, +this may be done with the command + +@example + mtt sys sfun mexglx +@end example + +which will generated the four .mex files and the .mdl file. In this +case, the user must ensure that @emph{sys_sfun_interface.c} has been +correctly edited prior to compilation. + +Note that solution of algebraic equations within Simulink is not +possible unless the @emph{Matlab Optimisation Toolbox} is installed. + +@node LaTeX, , Octave, Language tools +@comment node-name, next, previous, up +@section LaTeX +@cindex LaTeX + +LaTeX is a powerful text processor which @strong{MTT} uses to provide +visual output. + +@node Administration, Glossary, Language tools, Top +@comment node-name, next, previous, up +@chapter Administration +@cindex Administration + +@menu +* Software components:: +* REDUCE setup:: +* Octave setup:: +* Paths:: +* File structure:: +* GNU Free Documentation License:: +* Copying:: +@end menu + +@node Software components, REDUCE setup, Administration, Administration +@comment node-name, next, previous, up +@section Software components +@cindex Software components + +@strong{MTT} is built from a set of readily-available software tools. +These are: +@itemize @bullet +@item General purpose software tools. +@item Octave (@pxref{Octave setup}) +@item REDUCE (@pxref{REDUCE setup}) +@end itemize + +The General purpose tools are (these will all be available with a +standard Linux distribution): +@vtable @code +@item sh + Bourne shell +@item gmake + Gnu make +@item gawk + Gnu awk +@item sed + Gnu sed +@item grep + Gnu grep +@item comm + Gnu Compare sorted files by line +@item xfig + Figure editor, version 3 or greater. +@item fig2dev + Fig file conversion, version 3 or greater. +@item ghostview + postscript viewer +@item xdvi + dvi viewer +@item dvips + dvi to postscript conversion +@item latex + the text processor (LaTeX2e needed) +@item latex2html + converts latex to html +@item perl + needed for latex2html +@item gnuplot + a graph plotting program +@item gnuscape + or other web/html browser such as netscape, Red Baron etc. +@item gcc + GNU c compiler +@end vtable + +@ifhtml +GNU documentation. +@end ifhtml + + + +@node REDUCE setup, Octave setup, Software components, Administration +@comment node-name, next, previous, up +@section REDUCE setup +@cindex REDUCE setup + +Symbolic algebra is performed by REDUCE, which although not free +software is the the result of international collaboration. The version I +use is obtained from: +@quotation +ZIB ( http://www.zib.de ) +@end quotation +@ifhtml +REDUCE documentation. +ZIB documentation. +@end ifhtml + +@node Octave setup, Paths, REDUCE setup, Administration +@comment node-name, next, previous, up +@section Octave setup +@cindex Octave setup + +Octave is available at various web sites including: +@uref{http://www.octave.org} + +@menu +* .octaverc:: +* .oct file dependencies:: +@end menu + +@node .octaverc, .oct file dependencies, Octave setup, Octave setup +@comment node-name, next, previous, up +@subsection .octaverc +@vindex .octaverc + + +The @file{.octaverc} file should contain the following lines: +@example +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Startup file for Octave for use with MTT +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +implicit_str_to_num_ok = 1; +empty_list_elements_ok = 1; + +@end example + +@node .oct file dependencies, , .octaverc, Octave setup +@comment node-name, next, previous, up Additionally, it is necessary to +@subsection .oct file dependencies +Successful compilation of .oct code requires that Octave has been +configured to use dynamically linked libraries and that the Octave +libraries @code{liboctave}, @code{libcruft} and @code{liboctinterp} +are available on the system. + +This can be acheived by compiling Octave from the source code, configured +with the options @code{--enable-shared} and @code{--enable-dl}. + +A number of additional libraries and headers are also required to be +installed on a system. These include, +@itemize @bullet +@item +@emph{ncurses} and @emph{readline} + terminal control routines +@item +@emph{blas} or @emph{altas} + basic linear algebra subprograms, usually optimised for the specific processor +@item +@emph{fftw} + fast Fourier transform routines +@item +@emph{g2c} + GNU Fortran to C conversion routines +@item +@emph{kpathsea} + TeX path search routines +@end itemize + +Note that on many GNU/Linux distributions, the necessary headers are +contained in development packages which must be installed in addition +to the standard library package. + +Further information on configuring and installing Octave to handle dynamic +libraries (DLDs) can be found in the +@uref{http://www.octave.org/docs.html,Octave documentation}. + + +@node Paths, File structure, Octave setup, Administration +@comment node-name, next, previous, up +@section Paths +@cindex paths +@cindex mttrc + +There are a number of paths that must be set correctely for @strong{MTT} +to work. These are normally set up by sourcing the file @code{mttrc} that +lives in the @strong{MTT} home directory. + +@menu +* $MTTPATH:: +* $MTT_COMPONENTS:: +* $MTT_CRS:: +* $MTT_EXAMPLES:: +* $OCTAVE_PATH:: +@end menu + +@node $MTTPATH, $MTT_COMPONENTS, Paths, Paths +@comment node-name, next, previous, up +@subsection $MTTPATH +@vindex $MTTPATH +The environment variable $MTTPATH points to the mtt home directory. +This is usually @code{/usr/local/lib/mtt}. + +@node $MTT_COMPONENTS, $MTT_CRS, $MTTPATH, Paths +@comment node-name, next, previous, up +@subsection $MTT_COMPONENTS +@vindex $MTT_COMPONENTS +The environment variable $MTT_COMPONENTS is a colon-separated path +pointing to directories containing components and subsystems. +By default +@example +MTT_COMPONENTS=.:$MTT_LIB/lib/comp/ +@end example +but you may wish to add your own component libraries: +@example +MTT_COMPONENTS=my_library_path:$MTT_COMPONENTS +@end example + +@node $MTT_CRS, $MTT_EXAMPLES, $MTT_COMPONENTS, Paths +@comment node-name, next, previous, up +@subsection $MTT_CRS +@vindex $MTT_CRS +The environment variable $MTT_CRS is a colon-separated path +pointing to directories containing constitutive relationships. +By default +@example +MTT_CRS=$MTTPATH/lib/cr +@end example +but you may wish to add your own component libraries: +@example +MTT_CRS=my_cr_path:$MTT_CRS +@end example + +@node $MTT_EXAMPLES, $OCTAVE_PATH, $MTT_CRS, Paths +@comment node-name, next, previous, up +@subsection $MTT_EXAMPLES +@vindex $MTT_EXAMPLES +The environment variable $MTT_EXAMPLES is a colon-separated path +pointing to directories containing EXAMPLES and subsystems. +By default +@example +MTT_EXAMPLES=$MTTPATH/lib/examples +@end example +but you may wish to add your own component libraries: +@example +MTT_EXAMPLES=my_examples_path:$MTT_EXAMPLES +@end example + +@node $OCTAVE_PATH, , $MTT_EXAMPLES, Paths +@comment node-name, next, previous, up +@subsection $OCTAVE_PATH +@vindex $OCTAVE_PATH + +The @code{$OCTAVE_PATH} path must include the relevant paths for mtt to +work properly. In particular, it must include: +@example +$MTTPATH/trans/m +$MTTPATH/lib/comp/simple +$MTTPATH/lib/comp/compound +@end example + +@node File structure, GNU Free Documentation License, Paths, Administration +@comment node-name, next, previous, up +@section File structure +@cindex File structure +The recommended installation of @strong{MTT} uses the following +directory structure with corresponding contents. Normally, each of the +listed directories is a subdirectory of @file{/usr/local}. The directory +@code{mtt} is pointed to by $MTTPATH (@pxref{$MTTPATH}). + +@vtable @file +@item mtt/bin + This is the home directory for @strong{MTT}. @strong{MTT} itself lives + here along with @file{mttrc}. +@item mtt/bin/trans + The transformations executed by @strong{MTT}. +@item mtt/bin/trans/m + The @code{m-files} associated with the transformations. +@item mtt/bin/trans/awk + The @code{awk} scripts associated with the transformations. +@item mtt/lib + The place for components, examples and CRs which will be updated. +@item mtt/lib/comp/simple +@cindex simple components + The @code{m-files} defining the simple components. +@cindex compound components +@item mtt/lib/comp/compound + The @code{m-files} defining the compound components. +@item mtt/lib/cr/r + constitutive relationship definitions +@item mtt/lib/examples + Some examples. +@item mtt/examples/metamodelling + Examples from the book. +@item mtt/doc + The documentation files for @strong{MTT}. +@item mtt/doc/Examples + Examples used in the documentation. +@end vtable + +@appendix Legal stuff +@node GNU Free Documentation License, Copying, File structure, Administration +@appendixsec GNU Free Documentation License + +@cindex FDL, GNU Free Documentation License +@center Version 1.2, November 2002 + +@display +Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +@sc{ascii} without markup, Texinfo input format, La@TeX{} input +format, @acronym{SGML} or @acronym{XML} using a publicly available +@acronym{DTD}, and standard-conforming simple @acronym{HTML}, +PostScript or @acronym{PDF} designed for human modification. Examples +of transparent image formats include @acronym{PNG}, @acronym{XCF} and +@acronym{JPG}. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, @acronym{SGML} or +@acronym{XML} for which the @acronym{DTD} and/or processing tools are +not generally available, and the machine-generated @acronym{HTML}, +PostScript or @acronym{PDF} produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. +@end enumerate + +@page +@appendixsubsec ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with...Texts.'' line with this: + +@smallexample +@group + with the Invariant Sections being @var{list their titles}, with + the Front-Cover Texts being @var{list}, and with the Back-Cover Texts + being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@c Local Variables: +@c ispell-local-pdict: "ispell-dict" +@c End: + +@page +@node Copying, , GNU Free Documentation License, Administration +@appendixsec GNU GENERAL PUBLIC LICENSE +@center Version 2, June 1991 + +@c This file is intended to be included in another file. + +@display +Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@page +@appendixsubsec Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software---to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + +@iftex +@appendixsubsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +@end iftex +@ifinfo +@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +@end ifinfo + +@enumerate 0 +@item +This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The ``Program'', below, +refers to any such program or work, and a ``work based on the Program'' +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term ``modification''.) Each licensee is addressed as ``you''. + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +@item +You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +@item +You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +@enumerate a +@item +You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +@item +You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +@item +If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) +@end enumerate + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +@item +You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +@enumerate a +@item +Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +@item +Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +@item +Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) +@end enumerate + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +@item +You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +@item +You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +@item +Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +@item +If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +@item +If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +@item +The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and ``any +later version'', you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +@item +If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +@iftex +@strong{NO WARRANTY} +@end iftex +@ifinfo +@center NO WARRANTY +@end ifinfo + +@item +BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +@item +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +@end enumerate + +@iftex +@heading END OF TERMS AND CONDITIONS +@end iftex +@ifinfo +@center END OF TERMS AND CONDITIONS +@end ifinfo + +@page +@appendixsubsec Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the ``copyright'' line and a pointer to where the full notice is found. + +@smallexample +@var{one line to give the program's name and a brief idea of what it does.} +Copyright (C) @var{yyyy} @var{name of author} + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +@end smallexample + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +@smallexample +Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author} +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. +@end smallexample + +The hypothetical commands @samp{show w} and @samp{show c} should show +the appropriate parts of the General Public License. Of course, the +commands you use may be called something other than @samp{show w} and +@samp{show c}; they could even be mouse-clicks or menu items---whatever +suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a ``copyright disclaimer'' for the program, if +necessary. Here is a sample; alter the names: + +@example +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +@var{signature of Ty Coon}, 1 April 1989 +Ty Coon, President of Vice +@end example + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + +@node Glossary, Index, Administration, Top +@comment node-name, next, previous, up +@unnumbered Glossary +@printindex fn + +@node Index, , Glossary, Top +@comment node-name, next, previous, up +@unnumbered Index +@printindex cp + +@contents + +@bye + + ADDED mtt/doc/mtt_banner.sh Index: mtt/doc/mtt_banner.sh ================================================================== --- mtt/doc/mtt_banner.sh +++ mtt/doc/mtt_banner.sh @@ -0,0 +1,10 @@ + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ############################################################### ADDED mtt/doc/mtt_make_examples Index: mtt/doc/mtt_make_examples ================================================================== --- mtt/doc/mtt_make_examples +++ mtt/doc/mtt_make_examples @@ -0,0 +1,73 @@ +#! /bin/sh +## This makes all of the standard examples +## It takes a few hours. +## Copyright (C) 2003 by Peter J. Gawthrop + +exampledir="$MTT_EXAMPLES" +dirname=`basename ${exampledir}` + +tmpbase="$HOME/JUNK" +tmpdir="${tmpbase}/${dirname}" + +first() { + cat< + + + MTT Examples + + + + +

MTT Examples

+ +
+
    +EOF +} + +entry() { + cat<$1: html, pdf. +EOF +} + +last() { + cat< +
    +Created on `date` by mtt_make_examples +
    + + +EOF +} + +## File start +first > index.html + +if [ -d "${tmpdir}" ]; then + echo "${tmpdir} exists -- using" +else + echo "${tmpdir} does not exist -- copy from ${exampledir}" + ## Create tmp dir + mkdir -pv ${tmpdir} + ## Copy to tmp + cp -r ${exampledir} ${tmpbase} +fi + +## Go to tmp and list DIRS +pushd ${tmpdir} +dirs=`ls | grep -v CVS | grep -v '\.' | grep -v _` + +echo Making examples for ${dirs} in ${tmpdir} +for dir in ${dirs}; do + echo Making examples in $dir + mtt -q $dir rep pdf + mtt -q $dir rep html + entry $dir >> index.html +done + +## File end +last>>index.html +popd ADDED mtt/doc/reduce_reserved.tex Index: mtt/doc/reduce_reserved.tex ================================================================== --- mtt/doc/reduce_reserved.tex +++ mtt/doc/reduce_reserved.tex @@ -0,0 +1,94 @@ +\documentclass[12pt,a4paper]{book} +\newcommand{\REDUCE}{REDUCE} +\begin{document} + + +\appendix +\chapter{Reserved Identifiers} + +We list here all identifiers that are normally reserved in \REDUCE{} +including names of commands, operators and switches initially in the system. +Excluded are words that are reserved in specific implementations of the +system. + +\vspace{13pt} +\begin{list}{}{\renewcommand{\makelabel}[1]{#1\hspace{\fill}}% + \settowidth{\labelwidth}{Numerical Operators}% + \setlength{\labelsep}{1em}% + \settowidth{\leftmargin}{Numerical Operators\hspace*{\labelsep}}% + \sloppy} + +\item[Commands] {\tt ALGEBRAIC} {\tt ANTISYMMETRIC} +{\tt ARRAY} {\tt BYE} {\tt CLEAR} \linebreak +{\tt CLEARRULES} {\tt COMMENT} {\tt +CONT} {\tt DECOMPOSE} {\tt DEFINE} {\tt DEPEND} {\tt DISPLAY} {\tt ED} +{\tt EDITDEF} {\tt END} {\tt EVEN} {\tt FACTOR} {\tt FOR} {\tt FORALL} +{\tt FOREACH} {\tt GO} {\tt GOTO} {\tt IF} {\tt IN} {\tt INDEX} {\tt INFIX} +{\tt INPUT} {\tt INTEGER} {\tt KORDER} {\tt LET} {\tt LINEAR} {\tt LISP} +{\tt LISTARGP} {\tt LOAD} {\tt LOAD\_PACKAGE} {\tt MASS} {\tt MATCH} {\tt +MATRIX} {\tt MSHELL} {\tt NODEPEND} {\tt NONCOM} {\tt NONZERO} {\tt NOSPUR} +{\tt ODD} {\tt OFF} +{\tt ON} {\tt OPERATOR} {\tt ORDER} {\tt OUT} {\tt PAUSE} {\tt PRECEDENCE} +{\tt PRINT\_PRECISION} {\tt PROCEDURE} {\tt QUIT} {\tt REAL} {\tt REMFAC} +{\tt REMIND} {\tt RETRY} {\tt RETURN} {\tt SAVEAS} {\tt SCALAR} {\tt +SETMOD} {\tt SHARE} {\tt SHOWTIME} {\tt SHUT} {\tt SPUR} {\tt SYMBOLIC} +{\tt SYMMETRIC} {\tt VECDIM} {\tt VECTOR} {\tt WEIGHT} {\tt WRITE} {\tt +WTLEVEL} + +\item[Boolean Operators] {\tt EVENP} {\tt FIXP} +{\tt FREEOF} {\tt NUMBERP} {\tt ORDP} {\tt PRIMEP} + +\item[Infix Operators] + \verb|:=| \verb|=| \verb|>=| \verb|>| \verb|<=| \verb|<| \verb|=>| + \verb|+| \verb|*| \verb|/| \verb|^| \verb|**| \verb|.| {\tt WHERE} +{\tt SETQ} {\tt OR} {\tt AND} {\tt MEMBER} {\tt MEMQ} {\tt +EQUAL} {\tt NEQ} {\tt EQ} {\tt GEQ} {\tt GREATERP} {\tt LEQ} {\tt LESSP} +{\tt PLUS} {\tt DIFFERENCE} {\tt MINUS} {\tt TIMES} {\tt QUOTIENT} {\tt +EXPT} {\tt CONS} + +\item[Numerical Operators] {\tt ABS} {\tt ACOS} +{\tt ACOSH} {\tt ACOT} {\tt ACOTH} {\tt ACSC} {\tt ACSCH} {\tt ASEC} {\tt +ASECH} {\tt ASIN} {\tt ASINH} {\tt ATAN} {\tt ATANH} {\tt ATAN2} {\tt COS} +{\tt COSH} {\tt COT} {\tt COTH} {\tt CSC} {\tt CSCH} {\tt EXP} {\tt +FACTORIAL} {\tt FIX} {\tt FLOOR} {\tt HYPOT} {\tt LN} {\tt LOG} {\tt LOGB} +{\tt LOG10} {\tt NEXTPRIME} {\tt ROUND} {\tt SEC} {\tt SECH} {\tt SIN} +{\tt SINH} {\tt SQRT} {\tt TAN} {\tt TANH} + +\item[Prefix Operators] {\tt APPEND} {\tt +ARGLENGTH} {\tt CEILING} {\tt COEFF} {\tt COEFFN} {\tt COFACTOR} {\tt +CONJ} {\tt DEG} {\tt DEN} {\tt DET} {\tt DF} {\tt DILOG} {\tt EI} +{\tt EPS} {\tt ERF} {\tt FACTORIZE} {\tt FIRST} {\tt GCD} {\tt G} {\tt +IMPART} {\tt INT} {\tt INTERPOL} {\tt LCM} {\tt LCOF} {\tt LENGTH} {\tt +LHS} {\tt LINELENGTH} {\tt LTERM} {\tt MAINVAR} {\tt MAT} {\tt MATEIGEN} +{\tt MAX} {\tt MIN} {\tt MKID} {\tt NULLSPACE} {\tt NUM} {\tt PART} {\tt +PF} {\tt PRECISION} {\tt RANDOM} {\tt RANDOM\_NEW\_SEED} {\tt RANK} {\tt +REDERR} {\tt REDUCT} {\tt REMAINDER} {\tt REPART} {\tt REST} {\tt +RESULTANT} {\tt REVERSE} {\tt RHS} {\tt SECOND} {\tt SET} {\tt SHOWRULES} +{\tt SIGN} {\tt SOLVE} {\tt STRUCTR} {\tt SUB} {\tt SUM} {\tt THIRD} {\tt +TP} {\tt TRACE} {\tt VARNAME} + +\item[Reserved Variables] {\tt CARD\_NO} {\tt E} {\tt EVAL\_MODE} +{\tt FORT\_WIDTH} {\tt HIGH\_POW} {\tt I} {\tt INFINITY} {\tt K!*} {\tt +LOW\_POW} {\tt NIL} {\tt PI} {\tt ROOT\_MULTIPLICITY} {\tt T} + +\item[Switches] {\tt ADJPREC} {\tt ALGINT} {\tt ALLBRANCH} {\tt ALLFAC} +{\tt BFSPACE} {\tt COMBINEEXPT} {\tt COMBINELOGS} +{\tt COMP} {\tt COMPLEX} {\tt CRAMER} {\tt CREF} {\tt DEFN} {\tt DEMO} +{\tt DIV} {\tt ECHO} {\tt ERRCONT} {\tt EVALLHSEQP} {\tt EXP} {\tt +EXPANDLOGS} {\tt EZGCD} {\tt FACTOR} {\tt FORT} {\tt FULLROOTS} {\tt GCD} +{\tt IFACTOR} {\tt INT} {\tt INTSTR} {\tt LCM} {\tt LIST} {\tt LISTARGS} +{\tt MCD} {\tt MODULAR} {\tt MSG} {\tt MULTIPLICITIES} {\tt NAT} {\tt +NERO} {\tt NOSPLIT} {\tt OUTPUT} {\tt PERIOD} {\tt PRECISE} {\tt PRET} +{\tt PRI} {\tt RAT} {\tt RATARG} {\tt RATIONAL} {\tt RATIONALIZE} {\tt +RATPRI} {\tt REVPRI} {\tt RLISP88} {\tt ROUNDALL} {\tt ROUNDBF} {\tt +ROUNDED} {\tt SAVESTRUCTR} {\tt SOLVESINGULAR} {\tt TIME} {\tt TRA} {\tt +TRFAC} {\tt TRIGFORM} {\tt TRINT} + +\item[Other Reserved Ids] {\tt BEGIN} {\tt DO} {\tt +EXPR} {\tt FEXPR} {\tt INPUT} {\tt LAMBDA} {\tt +LISP} {\tt MACRO} {\tt PRODUCT} {\tt REPEAT} {\tt SMACRO} {\tt +SUM} {\tt UNTIL} {\tt WHEN} {\tt WHILE} {\tt WS} + +\end{list} + +\end{document} ADDED mtt/lib/cc/mtt_AlgebraicSolver.cc Index: mtt/lib/cc/mtt_AlgebraicSolver.cc ================================================================== --- mtt/lib/cc/mtt_AlgebraicSolver.cc +++ mtt/lib/cc/mtt_AlgebraicSolver.cc @@ -0,0 +1,32 @@ + +#include "mtt_AlgebraicSolver.hh" + +ColumnVector +MTT::AlgebraicSolver::solve (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ + if (_nyz > 0) + { + _x = x; + _uui.insert(u,0); + _t = t; + _par = par; + Solve(); + _uui.insert(_ui,_nu); + } + else + { + _uui = u; + } + return _uui; +} + +ColumnVector +MTT::AlgebraicSolver::eval (const ColumnVector &ui) +{ + if (_nyz > 0) + _uui.insert(ui,_nu); + return mtt_ae(_x,_uui,_t,_par); +} ADDED mtt/lib/cc/mtt_AlgebraicSolver.hh Index: mtt/lib/cc/mtt_AlgebraicSolver.hh ================================================================== --- mtt/lib/cc/mtt_AlgebraicSolver.hh +++ mtt/lib/cc/mtt_AlgebraicSolver.hh @@ -0,0 +1,49 @@ + +#ifndef MTT_ALGEBRAICSOLVER +#define MTT_ALGEBRAICSOLVER + + +#include "mtt_Solver.hh" + + +namespace MTT +{ + class AlgebraicSolver : public MTT::Solver + { + public: + + AlgebraicSolver (const int npar, + const int nu, + const int nx, + const int ny, + const int nyz) + : MTT::Solver (npar,nu,nx,ny,nyz) + {;} + + ColumnVector + solve (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + + ColumnVector + eval (const ColumnVector &ui); + + virtual ~AlgebraicSolver (void) {}; + + protected: + + virtual void + Solve (void) = 0; + }; +} + + +extern ColumnVector +mtt_ae(const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + + +#endif // MTT_ALGEBRAICSOLVER ADDED mtt/lib/cc/mtt_Dassl_Solver.cc Index: mtt/lib/cc/mtt_Dassl_Solver.cc ================================================================== --- mtt/lib/cc/mtt_Dassl_Solver.cc +++ mtt/lib/cc/mtt_Dassl_Solver.cc @@ -0,0 +1,31 @@ + +#include "mtt_Dassl_Solver.hh" + + +// used by "-ae dassl" NOT "-i dassl" + + +MTT::Dassl_Solver *MTT::Dassl_Solver::static_ptr; + +ColumnVector +MTT::Dassl_Solver::f_dassl (const ColumnVector &tryUi, + const ColumnVector &tryUidot, + double t, int &ires) +{ + static MTT::Dassl_Solver *p = MTT::Dassl_Solver::static_ptr; + + ColumnVector residual = p->eval(tryUi); + ColumnVector uidoterr = (tryUi - p->_ui) - tryUidot; + p->_yz = residual + uidoterr; + return p->_yz; +} + +void +MTT::Dassl_Solver::Solve (void) +{ + const double t0 = 0.0; + const double t1 = 1.0; + DAEFunc fcn(&MTT::Dassl_Solver::f_dassl); + DASSL eqn(AlgebraicSolver::_ui,t0,fcn); + AlgebraicSolver::_ui = eqn.do_integrate (t1); +} ADDED mtt/lib/cc/mtt_Dassl_Solver.hh Index: mtt/lib/cc/mtt_Dassl_Solver.hh ================================================================== --- mtt/lib/cc/mtt_Dassl_Solver.hh +++ mtt/lib/cc/mtt_Dassl_Solver.hh @@ -0,0 +1,62 @@ + + +#ifndef MTT_DASSLSOLVER +#define MTT_DASSLSOLVER + + +#include "mtt_AlgebraicSolver.hh" +#include + + +#ifdef OCTAVE_DEV +#include +#define VECTOR_VALUE column_vector_value +#else // !OCTAVE_DEV +#include +#define VECTOR_VALUE vector_value +#endif // OCTAVE_DEV + + +// -ae dassl + + +namespace MTT +{ + class Dassl_Solver : public MTT::AlgebraicSolver { + + // used only when called because of "-ae dassl" + // this is not used when called by "-i dassl" + + public: + + Dassl_Solver (const int npar, + const int nu, + const int nx, + const int ny, + const int nyz) + : MTT::AlgebraicSolver (npar, nu, nx, ny, nyz) + { + static_ptr = this; + } + + static ColumnVector + f_dassl (const ColumnVector &tryUi, + const ColumnVector &tryUidot, + double t, int &ires); + + ~Dassl_Solver (void) {}; + + protected: + + void + Solve (void); + + public: + + static Dassl_Solver *static_ptr; + + }; +} + + +#endif // MTT_DASSLSOLVER ADDED mtt/lib/cc/mtt_HJ_Solver.hh Index: mtt/lib/cc/mtt_HJ_Solver.hh ================================================================== --- mtt/lib/cc/mtt_HJ_Solver.hh +++ mtt/lib/cc/mtt_HJ_Solver.hh @@ -0,0 +1,65 @@ + +#ifndef MTT_HJSOLVER +#define MTT_HJSOLVER + + +#include "mtt_AlgebraicSolver.hh" + + +namespace MTT +{ + class HJ_Solver : public MTT::AlgebraicSolver + { + // http://www.netlib.org/opt/hooke.c + // Hooke and Jeeves solution + + public: + + HJ_Solver (const int npar, + const int nu, + const int nx, + const int ny, + const int nyz) + : MTT::AlgebraicSolver (npar,nu,nx,ny,nyz) + { + static_ptr = this; + VARS = nyz; + } + + static double + f (double tryUi[], int nyz); + + ~HJ_Solver (void) {}; + + protected: + + void + Solve (void); + + double + best_nearby (double delta[], + double point[], + double prevbest, + int nvars); + + int + hooke (int nvars, // MTTNYZ + double startpt[], // user's initial guess + double endpt[], // result + double rho = 0.05, // geometric shrink factor + double epsilon = 1e-3, // end value stepsize + int itermax = 5000); // max # iterations + + private: + + int VARS; + + public: + + static HJ_Solver *static_ptr; + + }; +} + + +#endif // MTT_HJSOLVER ADDED mtt/lib/cc/mtt_Hybrd_Solver.cc Index: mtt/lib/cc/mtt_Hybrd_Solver.cc ================================================================== --- mtt/lib/cc/mtt_Hybrd_Solver.cc +++ mtt/lib/cc/mtt_Hybrd_Solver.cc @@ -0,0 +1,73 @@ + +#include "mtt_Hybrd_Solver.hh" + +// http://www.netlib.org/minpack/hybrd.f +// used by Octave's fsolve + +MTT::Hybrd_Solver *MTT::Hybrd_Solver::static_ptr; + +ColumnVector +MTT::Hybrd_Solver::f_hybrd (const ColumnVector &tryUi) +{ + MTT::Hybrd_Solver::static_ptr->_yz = MTT::Hybrd_Solver::static_ptr->eval(tryUi); + return MTT::Hybrd_Solver::static_ptr->_yz; +} + +void +MTT::Hybrd_Solver::Solve (void) +{ + static std::fstream ferr ("MTT.Hybrd_messages", std::ios::out | std::ios::trunc | std::ios::app); + int info; + static int input_errors; + static int user_errors; + static int convergences; + static int progress_errors; + static int limit_errors; + static int unknown_errors; + + NLFunc fcn(&Hybrd_Solver::f_hybrd); + NLEqn eqn(Solver::_ui,fcn); + // eqn.set_tolerance(1.0e-20); + Solver::_ui = eqn.solve(info); + + switch (info) + { + case 1: + convergences++; + break; + case -2: + input_errors++; + break; + case -1: + user_errors++; + break; + case 3: + progress_errors++; + break; + case 4: + limit_errors++; + break; + default: + unknown_errors++; + break; + } + std::clog.setf (std::ios::scientific); + if (1 != info) + { + std::clog + << "\r" + << " time " << _t << " \t" + << " converge (" << convergences << ") " + << " limit (" << limit_errors << ")" + << " progress (" << progress_errors << ")" + << " other (" << input_errors + user_errors + unknown_errors << ") " + << " (max error = " << std::abs (eval(_ui).max()) << ")" + << std::endl; + } + else + { + std::clog + << "\r time " << _t << "\t max error = " << std::abs (eval(_ui).max()); + } + ferr << info << " "; +} ADDED mtt/lib/cc/mtt_Hybrd_Solver.hh Index: mtt/lib/cc/mtt_Hybrd_Solver.hh ================================================================== --- mtt/lib/cc/mtt_Hybrd_Solver.hh +++ mtt/lib/cc/mtt_Hybrd_Solver.hh @@ -0,0 +1,47 @@ + +#ifndef MTT_HYBRDSOLVER +#define MTT_HYBRDSOLVER + +#include + +#include +#include "mtt_AlgebraicSolver.hh" + + +namespace MTT +{ + class Hybrd_Solver : public MTT::AlgebraicSolver + { + // http://www.netlib.org/minpack/hybrd.f + // used by Octave's fsolve + + public: + + Hybrd_Solver (const int npar, + const int nu, + const int nx, + const int ny, + const int nyz) + : MTT::AlgebraicSolver (npar,nu,nx,ny,nyz) + { + static_ptr = this; + } + + static ColumnVector + f_hybrd (const ColumnVector &tryUi); + + ~Hybrd_Solver (void) {}; + + protected: + + void + Solve (void); + + public: + + static Hybrd_Solver *static_ptr; + }; +} + + +#endif // MTT_HYBRDSOLVER ADDED mtt/lib/cc/mtt_Reduce_Solver.cc Index: mtt/lib/cc/mtt_Reduce_Solver.cc ================================================================== --- mtt/lib/cc/mtt_Reduce_Solver.cc +++ mtt/lib/cc/mtt_Reduce_Solver.cc @@ -0,0 +1,17 @@ + +#include "mtt_Reduce_Solver.hh" + +void +MTT::Reduce_Solver::Solve (void) +{ + ; +} + +ColumnVector +MTT::Reduce_Solver::solve (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ + return u; +} ADDED mtt/lib/cc/mtt_Reduce_Solver.hh Index: mtt/lib/cc/mtt_Reduce_Solver.hh ================================================================== --- mtt/lib/cc/mtt_Reduce_Solver.hh +++ mtt/lib/cc/mtt_Reduce_Solver.hh @@ -0,0 +1,41 @@ + +#ifndef MTT_REDUCESOLVER +#define MTT_REDUCESOLVER + + +#include "mtt_AlgebraicSolver.hh" + + +namespace MTT +{ + class Reduce_Solver : public MTT::AlgebraicSolver + { + // Dummy class + // This will not be used unless the Reduce solver has failed earlier + // in the model build process + + public: + + Reduce_Solver (const int npar, + const int nu, + const int nx, + const int ny, + const int nyz) + : AlgebraicSolver (npar,nu,nx,ny,nyz) + {;} + + void + Solve (void); + + ColumnVector + solve (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + + ~Reduce_Solver (void) {}; + }; +} + + +#endif // MTT_REDUCESOLVER ADDED mtt/lib/cc/mtt_Solver.cc Index: mtt/lib/cc/mtt_Solver.cc ================================================================== --- mtt/lib/cc/mtt_Solver.cc +++ mtt/lib/cc/mtt_Solver.cc @@ -0,0 +1,17 @@ + +#include "mtt_Solver.hh" + +MTT::Solver::Solver (const int npar, + const int nu, + const int nx, + const int ny, + const int nyz) +{ + _np = npar; + _nu = nu; + _nx = nx; + _ny = ny; + _nyz = nyz; + _ui = ColumnVector (_nyz,0.0); + _uui = ColumnVector (_nu+_nyz); +}; ADDED mtt/lib/cc/mtt_Solver.hh Index: mtt/lib/cc/mtt_Solver.hh ================================================================== --- mtt/lib/cc/mtt_Solver.hh +++ mtt/lib/cc/mtt_Solver.hh @@ -0,0 +1,47 @@ + +#ifndef MTT_SOLVER +#define MTT_SOLVER + + +#include +#include +#include + +#include + + +namespace MTT +{ + class Solver + { + public: + + Solver (const int npar, + const int nu, + const int nx, + const int ny, + const int nyz); + + virtual ~Solver (void) {}; + + protected: + + ColumnVector _x; + ColumnVector _uui; + double _t; + ColumnVector _par; + + ColumnVector _ui; + ColumnVector _yz; + + int _nu; + int _np; + int _nx; + int _ny; + int _nyz; + }; +} + + +#endif // MTT_SOLVER + ADDED mtt/lib/cc/mtt_dassl.cc Index: mtt/lib/cc/mtt_dassl.cc ================================================================== --- mtt/lib/cc/mtt_dassl.cc +++ mtt/lib/cc/mtt_dassl.cc @@ -0,0 +1,93 @@ + +#include +#include + + +#ifdef OCTAVE_DEV +#include +#define VECTOR_VALUE column_vector_value +#else // !OCTAVE_DEV +#include +#define VECTOR_VALUE vector_value +#endif // OCTAVE_DEV + +// Code generation directives +#define STANDALONE 0 +#define OCTAVEDLD 1 +#if (! defined (CODEGENTARGET)) +#define CODEGENTARGET STANDALONE +#endif // (! defined (CODEGENTARGET)) + +#if (CODEGENTARGET == STANDALONE) +extern ColumnVector +Fmtt_residual (const ColumnVector &X, const ColumnVector &DX, double t, int &ires); +#endif // (CODEGENTARGET == STANDALONE) + + +ColumnVector +mtt_residual (const ColumnVector &X, const ColumnVector &DX, double t, int &ires) +{ +#if (CODEGENTARGET == STANDALONE) + return Fmtt_residual (X, DX, t, ires); +#elif (CODEGENTARGET == OCTAVEDLD) + static octave_value_list args, f; + args(0) = octave_value (X); + args(1) = octave_value (DX); + args(2) = octave_value (t); + args(3) = octave_value (static_cast(ires)); + f = feval ("mtt_residual", args, 1); + return f(0).VECTOR_VALUE (); +#endif // (CODEGENTARGET == STANDALONE) +} + + +#if (CODEGENTARGET == STANDALONE) +ColumnVector +Fmtt_dassl ( ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par, + const ColumnVector &dx, + const double &ddt, + const int Nx, + const int Nyz, + const ColumnVector &openx) +{ +#elif (CODEGENTARGET == OCTAVEDLD) +DEFUN_DLD (mtt_dassl, args, , + "dassl integration method") +{ + ColumnVector x = args(0).VECTOR_VALUE(); + const ColumnVector u = args(1).VECTOR_VALUE(); + const double t = args(2).double_value(); + const ColumnVector par = args(3).VECTOR_VALUE(); + const ColumnVector dx = args(4).VECTOR_VALUE(); + const double ddt = args(5).double_value(); + const int Nx = static_cast (args(6).double_value()); + const int Nyz = static_cast (args(7).double_value()); + const ColumnVector openx = args(8).VECTOR_VALUE(); +#endif // (CODEGENTARGET == STANDALONE) + + static DAEFunc fdae(mtt_residual); + static ColumnVector XX (Nx+Nyz); + XX.insert (x,0); + + for (register int i = Nx; i < Nx+Nyz; i++) + XX(i) = 0.0; + + double tout = t + ddt; + + DASSL fdassl (XX, t, fdae); + x = fdassl.do_integrate (tout).extract (0,Nx-1); + + for (register int i = 0; i < Nx; i++) + if (openx (i) > 0.5) + x (i) = 0.0; + + +#if (CODEGENTARGET == STANDALONE) + return x; +#elif (CODEGENTARGET == OCTAVEDLD) + return octave_value (x); +#endif // (CODEGENTARGET == STANDALONE) +} ADDED mtt/lib/cc/mtt_euler.cc Index: mtt/lib/cc/mtt_euler.cc ================================================================== --- mtt/lib/cc/mtt_euler.cc +++ mtt/lib/cc/mtt_euler.cc @@ -0,0 +1,53 @@ +#include + +#ifdef OCTAVE_DEV +#define VECTOR_VALUE column_vector_value +#else // !OCTAVE_DEV +#define VECTOR_VALUE vector_value +#endif // OCTAVE_DEV + +// Code generation directives +#define STANDALONE 0 +#define OCTAVEDLD 1 +#if (! defined (CODEGENTARGET)) +#define CODEGENTARGET STANDALONE +#endif // (! defined (CODEGENTARGET)) + +#if (CODEGENTARGET == STANDALONE) +ColumnVector Fmtt_euler ( ColumnVector &x, + const ColumnVector &dx, + const double &ddt, + const int &Nx, + const ColumnVector &openx) +{ +#elif (CODEGENTARGET == OCTAVEDLD) +DEFUN_DLD (mtt_euler, args, , + "euler integration method") +{ + ColumnVector x = args(0).VECTOR_VALUE (); + const ColumnVector dx = args(1).VECTOR_VALUE (); + const double ddt = args(2).double_value (); + const int Nx = static_cast (args(3).double_value ()); + const ColumnVector openx = args(4).VECTOR_VALUE (); +#endif // (CODEGENTARGET == STANDALONE) + + register int i, n; + + n = Nx; + for (i = 0; i < Nx; i++) + { + if (0 != openx (i)) + { + x (i) = 0.0; + } + else + { + x (i) += dx (i) * ddt; + } + } +#if (CODEGENTARGET == STANDALONE) + return x; +#elif (CODEGENTARGET == OCTAVEDLD) + return octave_value (x); +#endif // (CODEGENTARGET == STANDALONE) +} ADDED mtt/lib/cc/mtt_implicit.cc Index: mtt/lib/cc/mtt_implicit.cc ================================================================== --- mtt/lib/cc/mtt_implicit.cc +++ mtt/lib/cc/mtt_implicit.cc @@ -0,0 +1,78 @@ +#include +#include + +#ifdef OCTAVE_DEV +#define VECTOR_VALUE column_vector_value +#else // !OCTAVE_DEV +#define VECTOR_VALUE vector_value +#endif // OCTAVE_DEV + +// Code generation directives +#define STANDALONE 0 +#define OCTAVEDLD 1 +#if (! defined (CODEGENTARGET)) +#define CODEGENTARGET STANDALONE +#endif // (! defined (CODEGENTARGET)) + +#if (CODEGENTARGET == STANDALONE) +ColumnVector Fmtt_implicit ( ColumnVector &x, + ColumnVector &dx, + Matrix &AA, + ColumnVector &AAx, + const double &t, + const int &Nx, + const ColumnVector &openx) +{ +#elif (CODEGENTARGET == OCTAVEDLD) +DEFUN_DLD (mtt_implicit, args, , + "implicit integration method") +{ + ColumnVector x = args(0).VECTOR_VALUE (); + ColumnVector dx = args(1).VECTOR_VALUE (); + Matrix AA = args(2).matrix_value (); + ColumnVector AAx = args(3).VECTOR_VALUE (); + const double t = args(4).double_value (); + const int Nx = (int) (args(5).double_value ()); + const ColumnVector openx = args(6).VECTOR_VALUE (); +#endif // (CODEGENTARGET == STANDALONE) + + register int row, col; + + for (row = 0; row < Nx; row++) + { + if (openx (row) > 0.5) + { + AAx (row) = 0.0; + dx (row) = 0.0; + for (col = 0; col < Nx; col++) + { + AA (row,col) = 0.0; + AA (col,row) = 0.0; + } + } + } + +#ifdef OCTAVE_DEV + x = xleftdiv (AA, Matrix(AAx + dx * t)).column (0); +#else // !OCTAVE_DEV + Matrix tmp = xleftdiv (AA, static_cast(static_cast(AAx + dx * t))); + for (row = 0; row < Nx; row++) + { + x (row) = tmp (row,0); + } +#endif // OCTAVE_DEV + + for (row = 0; row < Nx; row++) + { + if (openx (row) > 0.5) + { + x (row) = 0.0; + } + } + +#if (CODEGENTARGET == STANDALONE) + return x; +#elif (CODEGENTARGET == OCTAVEDLD) + return octave_value (x); +#endif // (CODEGENTARGET == STANDALONE) +} ADDED mtt/lib/cc/mtt_kpathsea.cc Index: mtt/lib/cc/mtt_kpathsea.cc ================================================================== --- mtt/lib/cc/mtt_kpathsea.cc +++ mtt/lib/cc/mtt_kpathsea.cc @@ -0,0 +1,4 @@ + +extern "C" { + int kpse_clear_dir_cache (void) {return 0;} +} ADDED mtt/lib/cc/mtt_matlab_octave.cc Index: mtt/lib/cc/mtt_matlab_octave.cc ================================================================== --- mtt/lib/cc/mtt_matlab_octave.cc +++ mtt/lib/cc/mtt_matlab_octave.cc @@ -0,0 +1,66 @@ + +#include +#include + + +// conversions from Matlab mxArray* to Octave data types + +Matrix +mtt_Matrix (const mxArray *m) +{ + const unsigned long int nrows = mxGetM (m); + const unsigned long int ncols = mxGetN (m); + Matrix o (nrows, ncols); + const double *p = mxGetPr (m); + for (unsigned long int row = 0; row < nrows; row++) + for (unsigned long int col = 0; col < ncols; col++) + o (row, col) = p[row + nrows*col]; + return (o); +} + +ColumnVector +mtt_ColumnVector (const mxArray *m) +{ + const unsigned long int nrows = mxGetM (m); + ColumnVector o (nrows); + const double *p = mxGetPr (m); + for (unsigned long int row = 0; row < nrows; row++) + o (row) = p[row]; + return (o); +} + +const double +mtt_double (const mxArray *m) +{ + const double *p = mxGetPr (m); + return (*p); +} + + +// conversions from Octave data types to Matlab mxArray* + +mxArray * +mtt_mxArray (const Matrix &o) +{ + const unsigned long int nrows = o.rows (); + const unsigned long int ncols = o.columns (); + mxArray *m; + m = mxCreateDoubleMatrix (nrows, ncols, mxREAL); + double *p = mxGetPr (m); + for (unsigned long int row = 0; row < nrows; row++) + for (unsigned long int col = 0; col < ncols; col++) + p [row + nrows*col] = o (row, col); + return (m); +} + +mxArray * +mtt_mxArray (const ColumnVector &o) +{ + const unsigned long int nrows = o.length (); + mxArray *m; + m = mxCreateDoubleMatrix (nrows, 1, mxREAL); + double *p = mxGetPr (m); + for (unsigned long int row = 0; row < nrows; row++) + p [row] = o (row); + return (m); +} ADDED mtt/lib/cc/mtt_matlab_octave.hh Index: mtt/lib/cc/mtt_matlab_octave.hh ================================================================== --- mtt/lib/cc/mtt_matlab_octave.hh +++ mtt/lib/cc/mtt_matlab_octave.hh @@ -0,0 +1,28 @@ + +#ifndef MTT_MATLAB_OCTAVE_HH +#define MTT_MATLAB_OCTAVE_HH + +#include +#include + +// conversions from Matlab mxArray* to Octave data types + +extern Matrix +mtt_Matrix (const mxArray *m); + +extern ColumnVector +mtt_ColumnVector (const mxArray *m); + +extern const double +mtt_double (const mxArray *m); + + +// conversions from Octave data types to Matlab mxArray* + +extern mxArray * +mtt_mxArray (const Matrix &o); + +extern mxArray * +mtt_mxArray (const ColumnVector &o); + +#endif // MTT_MATLAB_OCTAVE_HH ADDED mtt/lib/cc/mtt_noAlgebraicSolver.cc Index: mtt/lib/cc/mtt_noAlgebraicSolver.cc ================================================================== --- mtt/lib/cc/mtt_noAlgebraicSolver.cc +++ mtt/lib/cc/mtt_noAlgebraicSolver.cc @@ -0,0 +1,17 @@ + +#include "mtt_noAlgebraicSolver.hh" + +void +MTT::noAlgebraicSolver::Solve (void) +{ + ; +} + +ColumnVector +MTT::noAlgebraicSolver::solve (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par) +{ + return u; +} ADDED mtt/lib/cc/mtt_noAlgebraicSolver.hh Index: mtt/lib/cc/mtt_noAlgebraicSolver.hh ================================================================== --- mtt/lib/cc/mtt_noAlgebraicSolver.hh +++ mtt/lib/cc/mtt_noAlgebraicSolver.hh @@ -0,0 +1,39 @@ + +#ifndef MTT_REDUCESOLVER +#define MTT_REDUCESOLVER + + +#include "mtt_AlgebraicSolver.hh" + + +namespace MTT +{ + class noAlgebraicSolver : public MTT::AlgebraicSolver + { + // Dummy class + + public: + + noAlgebraicSolver (const int npar, + const int nu, + const int nx, + const int ny, + const int nyz) + : AlgebraicSolver (npar,nu,nx,ny,nyz) + {;} + + void + Solve (void); + + ColumnVector + solve (const ColumnVector &x, + const ColumnVector &u, + const double &t, + const ColumnVector &par); + + ~noAlgebraicSolver (void) {}; + }; +} + + +#endif // MTT_REDUCESOLVER ADDED mtt/lib/cc/mtt_simpar.hh Index: mtt/lib/cc/mtt_simpar.hh ================================================================== --- mtt/lib/cc/mtt_simpar.hh +++ mtt/lib/cc/mtt_simpar.hh @@ -0,0 +1,37 @@ + +#include +#include + +static ColumnVector +mtt_simpar (Octave_map simpar) +{ + static ColumnVector retval (8); + + retval (0) = simpar.contents (simpar.seek ("first" ))(0).double_value (); + retval (1) = simpar.contents (simpar.seek ("last" ))(0).double_value (); + retval (2) = simpar.contents (simpar.seek ("dt" ))(0).double_value (); + retval (3) = simpar.contents (simpar.seek ("stepfactor"))(0).double_value (); + retval (4) = simpar.contents (simpar.seek ("wmin" ))(0).double_value (); + retval (5) = simpar.contents (simpar.seek ("wmax" ))(0).double_value (); + retval (6) = simpar.contents (simpar.seek ("wsteps" ))(0).double_value (); + retval (7) = simpar.contents (simpar.seek ("input" ))(0).double_value (); + + return retval; +} + +static Octave_map +mtt_simpar (ColumnVector simpar) +{ + static Octave_map retval; + + retval.assign ("first" , simpar (0)); + retval.assign ("last" , simpar (1)); + retval.assign ("dt" , simpar (2)); + retval.assign ("stepfactor", simpar (3)); + retval.assign ("wmin" , simpar (4)); + retval.assign ("wmax" , simpar (5)); + retval.assign ("wsteps" , simpar (6)); + retval.assign ("input" , simpar (7)); + + return retval; +} ADDED mtt/lib/comp/compound/Bicausal/B2U/B2U_abg.fig Index: mtt/lib/comp/compound/Bicausal/B2U/B2U_abg.fig ================================================================== --- mtt/lib/comp/compound/Bicausal/B2U/B2U_abg.fig +++ mtt/lib/comp/compound/Bicausal/B2U/B2U_abg.fig @@ -0,0 +1,43 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1350 6525 2700 6525 2475 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2925 6300 2925 4950 3150 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 6525 4500 6525 4275 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 6300 4725 4950 4950 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 6525 6300 6525 6075 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2925 4500 2925 3150 3150 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 4500 4725 3150 4950 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1350 6525 1350 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2700 6300 2700 6525 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3150 6525 3150 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4500 6300 4500 6525 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4950 6525 4950 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6300 6300 6300 6525 +4 2 4 100 0 18 18 0.0000 4 270 930 1260 6615 SS:[ef]\001 +4 1 0 100 0 18 18 0.0000 4 195 150 2925 6615 0\001 +4 1 0 100 0 18 18 0.0000 4 210 405 2925 4815 AE\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4725 6615 1\001 +4 1 0 100 0 18 18 0.0000 4 210 390 4725 4815 AF\001 +4 1 0 100 0 18 18 0.0000 4 210 630 6795 6615 SS:ii\001 +4 1 4 100 0 18 18 0.0000 4 270 825 2925 3015 SS:[e]\001 +4 1 4 100 0 18 18 0.0000 4 270 765 4680 3015 SS:[f]\001 ADDED mtt/lib/comp/compound/Bicausal/B2U/B2U_lbl.txt Index: mtt/lib/comp/compound/Bicausal/B2U/B2U_lbl.txt ================================================================== --- mtt/lib/comp/compound/Bicausal/B2U/B2U_lbl.txt +++ mtt/lib/comp/compound/Bicausal/B2U/B2U_lbl.txt @@ -0,0 +1,48 @@ +#SUMMARY B2U: undoes a bicausal bond +#DESCRIPTION Takes e and f from bicausal bond at port [ef] +#DESCRIPTION and gives corresponding unicausal bonds at ports [e] and [f] + +## System B2U, representation lbl, language txt +## File B2U_lbl.txt +## Generated by MTT on Thu Jul 8 09:59:03 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS e e +#ALIAS ef ef +#ALIAS f f + +## Argument aliases + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type AE (anonymous => default parameters) + # AE + +## Component type AF (anonymous => default parameters) + # AF + +## Component type SS + [e] SS external,0 + [f] SS 0,external + ii SS internal,internal + [ef] SS external,0 + ADDED mtt/lib/comp/compound/Bicausal/U2B/U2B_abg.fig Index: mtt/lib/comp/compound/Bicausal/U2B/U2B_abg.fig ================================================================== --- mtt/lib/comp/compound/Bicausal/U2B/U2B_abg.fig +++ mtt/lib/comp/compound/Bicausal/U2B/U2B_abg.fig @@ -0,0 +1,57 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 1350 6975 1350 6750 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5400 2925 5400 1575 5625 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 3150 3150 3150 2925 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 3150 5175 3150 4950 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 1350 3150 1350 2925 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 1350 5175 1350 4950 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5400 4725 5400 3375 5625 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 4725 5625 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 3375 5400 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 1575 5400 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 2925 5625 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 2925 3825 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 1125 5175 1575 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 8550 5175 675 5175 675 675 8550 675 8550 5175 +4 1 0 100 0 18 18 0.0000 4 210 390 3465 3240 AF\001 +4 1 0 100 0 18 18 0.0000 4 195 150 5400 3240 0\001 +4 2 4 100 0 18 18 0.0000 4 270 765 1710 3240 SS:[f]\001 +4 1 0 100 0 18 18 0.0000 4 210 405 3465 1440 AE\001 +4 1 0 100 0 18 18 0.0000 4 195 150 5400 1440 1\001 +4 2 4 100 0 18 18 0.0000 4 270 825 1710 1440 SS:[e]\001 +4 1 0 100 0 18 18 0.0000 4 210 780 5400 5085 SS:zz\001 +4 0 4 100 0 18 18 0.0000 4 270 1095 7110 1440 SS:[ef]\001 +4 1 1 101 0 3 20 0.0000 4 165 150 4500 1125 e\001 +4 1 1 101 0 3 20 0.0000 4 165 150 6300 1125 e\001 +4 1 1 101 0 3 20 0.0000 4 165 150 2475 1125 e\001 +4 1 1 101 0 3 20 0.0000 4 315 105 2475 3510 f\001 +4 1 1 101 0 3 20 0.0000 4 315 105 4500 3510 f\001 +4 1 1 101 0 3 20 0.0000 4 315 105 6300 1710 f\001 +4 1 1 101 0 3 20 0.0000 4 315 105 5625 2385 f\001 +4 1 1 101 0 3 20 0.0000 4 225 165 2520 1665 0\001 +4 1 1 101 0 3 20 0.0000 4 225 165 2520 3015 0\001 +4 1 1 101 0 3 20 0.0000 4 225 165 5220 4140 0\001 +4 1 1 101 0 3 20 0.0000 4 225 165 5625 4140 0\001 +4 1 1 101 0 3 20 0.0000 4 225 165 5220 2385 0\001 ADDED mtt/lib/comp/compound/Bicausal/U2B/U2B_lbl.txt Index: mtt/lib/comp/compound/Bicausal/U2B/U2B_lbl.txt ================================================================== --- mtt/lib/comp/compound/Bicausal/U2B/U2B_lbl.txt +++ mtt/lib/comp/compound/Bicausal/U2B/U2B_lbl.txt @@ -0,0 +1,42 @@ +#SUMMARY U2B: makes a bicausal bond +#DESCRIPTION Takes e and f from ports [e] and [f] and gives corresponding +#DESCRIPTION bicausal bond at port [ef]. + +## System U2B, representation lbl, language txt +## File U2B_lbl.txt +## Generated by MTT on Thu Jul 8 08:38:15 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS e e +#ALIAS f f +#ALIAS out ef + +## Argument aliases + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type SS + [e] SS external,internal + [f] SS internal,external + [ef] SS internal,external + zz SS 0,0 + ADDED mtt/lib/comp/compound/Bicausal/VJe/VJe_abg.fig Index: mtt/lib/comp/compound/Bicausal/VJe/VJe_abg.fig ================================================================== --- mtt/lib/comp/compound/Bicausal/VJe/VJe_abg.fig +++ mtt/lib/comp/compound/Bicausal/VJe/VJe_abg.fig @@ -0,0 +1,112 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3735 675 4455 990 +4 1 1 101 0 3 20 0.0000 4 105 195 4095 855 =\001 +4 1 1 101 0 3 20 0.0000 4 165 150 3847 855 e\001 +4 1 1 101 0 3 20 0.0000 4 150 150 3937 990 c\001 +4 1 1 101 0 3 20 0.0000 4 165 150 4282 855 e\001 +4 1 1 101 0 3 20 0.0000 4 150 135 4372 990 s\001 +-6 +6 3915 1170 4185 1575 +4 1 1 101 0 3 20 0.0000 4 315 105 3982 1440 f\001 +4 1 1 101 0 3 20 0.0000 4 150 150 4072 1575 c\001 +-6 +6 5940 1170 6210 1575 +4 1 1 101 0 3 20 0.0000 4 315 105 6007 1440 f\001 +4 1 1 101 0 3 20 0.0000 4 150 150 6097 1575 c\001 +-6 +6 5715 2520 5985 2835 +4 1 1 101 0 3 20 0.0000 4 165 150 5812 2700 e\001 +4 1 1 101 0 3 20 0.0000 4 150 135 5902 2835 s\001 +-6 +6 4590 1890 4860 2205 +4 1 1 101 0 3 20 0.0000 4 165 150 4687 2070 e\001 +4 1 1 101 0 3 20 0.0000 4 150 135 4777 2205 s\001 +-6 +6 7110 3510 7380 3915 +4 1 1 101 0 3 20 0.0000 4 315 105 7177 3780 f\001 +4 1 1 101 0 3 20 0.0000 4 150 150 7267 3915 c\001 +-6 +6 6075 3555 6795 3870 +4 1 1 101 0 3 20 0.0000 4 105 195 6435 3735 =\001 +4 1 1 101 0 3 20 0.0000 4 165 150 6187 3735 e\001 +4 1 1 101 0 3 20 0.0000 4 150 150 6277 3870 c\001 +4 1 1 101 0 3 20 0.0000 4 165 150 6622 3735 e\001 +4 1 1 101 0 3 20 0.0000 4 150 135 6712 3870 s\001 +-6 +6 5715 4320 5985 4635 +4 1 1 101 0 3 20 0.0000 4 180 180 5812 4500 u\001 +4 1 1 101 0 3 20 0.0000 4 165 150 5902 4635 e\001 +-6 +6 5715 4815 5985 5220 +4 1 1 101 0 3 20 0.0000 4 180 180 5812 4995 u\001 +4 1 1 101 0 3 20 0.0000 4 315 105 5902 5130 f\001 +-6 +6 3240 4095 3510 4410 +4 1 1 101 0 3 20 0.0000 4 180 180 3337 4275 u\001 +4 1 1 101 0 3 20 0.0000 4 165 150 3427 4410 e\001 +-6 +6 3240 4995 3510 5400 +4 1 1 101 0 3 20 0.0000 4 180 180 3337 5175 u\001 +4 1 1 101 0 3 20 0.0000 4 315 105 3427 5310 f\001 +-6 +6 1755 2520 2025 2835 +4 1 1 101 0 3 20 0.0000 4 165 150 1852 2700 e\001 +4 1 1 101 0 3 20 0.0000 4 150 135 1942 2835 s\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 2925 4725 2925 4500 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5220 2925 6570 2925 6345 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 5175 1125 6975 1125 6975 2700 7200 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4500 2925 4500 3150 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4950 2925 4950 3150 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 2700 4725 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 1125 4725 1125 4500 1350 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1305 2925 2655 2925 2430 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6975 3150 6975 4500 7200 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6525 4725 5175 4725 5400 4950 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2025 4950 675 4950 900 5175 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 7425 5625 -675 5625 -675 450 7425 450 7425 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2025 4500 675 4500 900 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 2700 4950 1350 5175 1575 +4 1 0 100 0 18 18 0.0000 4 195 150 4950 3015 0\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4950 1215 1\001 +4 2 4 100 0 18 18 0.0000 4 270 1065 3285 1215 SS:[PC]\001 +4 1 0 100 0 18 18 0.0000 4 210 570 6975 3015 U2B\001 +4 1 0 100 0 18 18 0.0000 4 210 570 4725 4815 B2U\001 +4 1 4 100 0 18 14 0.0000 4 225 285 6345 2790 [e]\001 +4 1 4 100 0 18 14 0.0000 4 240 225 6795 2520 [f]\001 +4 1 4 100 0 18 14 0.0000 4 240 360 6750 3375 [ef]\001 +4 1 4 100 0 18 14 0.0000 4 225 285 4050 4365 [e]\001 +4 1 4 100 0 18 14 0.0000 4 240 225 4050 5265 [f]\001 +4 1 4 100 0 18 14 0.0000 4 240 360 5220 4545 [ef]\001 +4 1 1 101 0 3 20 0.0000 4 225 165 6075 990 0\001 +4 1 0 100 0 18 18 0.0000 4 195 540 6885 4815 tra:t\001 +4 2 4 100 0 18 14 0.0000 4 225 360 6480 4995 [in]\001 +4 2 4 100 0 18 14 0.0000 4 225 525 6840 4410 [out]\001 +4 1 0 100 0 18 18 0.0000 4 210 750 2970 3015 AE:m\001 +4 2 4 100 0 18 18 0.0000 4 270 900 1215 3015 SS:[in]\001 +4 2 4 100 0 18 18 0.0000 4 270 1080 585 5085 SS:[u_f]\001 +4 2 4 100 0 18 18 0.0000 4 270 1140 585 4590 SS:[u_e]\001 +4 1 0 100 0 18 18 0.0000 4 210 660 2430 4590 AE:e\001 +4 1 0 100 0 18 18 0.0000 4 210 585 2430 5040 AF:f\001 ADDED mtt/lib/comp/compound/Bicausal/VJe/VJe_lbl.txt Index: mtt/lib/comp/compound/Bicausal/VJe/VJe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Bicausal/VJe/VJe_lbl.txt +++ mtt/lib/comp/compound/Bicausal/VJe/VJe_lbl.txt @@ -0,0 +1,61 @@ +#SUMMARY VJe Virtual Junction - effort input +#DESCRIPTION Virtual junction with effort input +#DESCRIPTION User must supply the transfer system tra +#DESCRIPTION tra can have up to 9 parameters passed to it +#DESCRIPTION using parameters of VJe + +## System VJe, representation lbl, language txt +## File VJe_lbl.txt +## Generated by MTT on Thu Jul 8 11:41:51 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases + +## Argument aliases +#ALIAS $1 p_1 +#ALIAS $2 p_2 +#ALIAS $3 p_3 +#ALIAS $4 p_4 +#ALIAS $5 p_5 +#ALIAS $6 p_6 +#ALIAS $7 p_7 +#ALIAS $8 p_8 +#ALIAS $9 p_9 + + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type AE/AF + e lin -1 + f lin -1 + m lin -1 + +## Component type tra + t lin p_1;p_2;p_3;p_4;p_5;p_6;p_7;p_8;p_9 + +## Component type SS + [in] SS external,internal + [u_e] SS external,0 + [u_f] SS 0,external + [PC] SS external,external + + + ADDED mtt/lib/comp/compound/Bicausal/VJf/VJf_abg.fig Index: mtt/lib/comp/compound/Bicausal/VJf/VJf_abg.fig ================================================================== --- mtt/lib/comp/compound/Bicausal/VJf/VJf_abg.fig +++ mtt/lib/comp/compound/Bicausal/VJf/VJf_abg.fig @@ -0,0 +1,106 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 7110 3510 7380 3915 +4 1 1 101 0 3 20 0.0000 4 315 105 7177 3780 f\001 +4 1 1 101 0 3 20 0.0000 4 150 150 7267 3915 c\001 +-6 +6 6075 3555 6795 3870 +4 1 1 101 0 3 20 0.0000 4 105 195 6435 3735 =\001 +4 1 1 101 0 3 20 0.0000 4 165 150 6187 3735 e\001 +4 1 1 101 0 3 20 0.0000 4 150 150 6277 3870 c\001 +4 1 1 101 0 3 20 0.0000 4 165 150 6622 3735 e\001 +4 1 1 101 0 3 20 0.0000 4 150 135 6712 3870 s\001 +-6 +6 5715 4320 5985 4635 +4 1 1 101 0 3 20 0.0000 4 180 180 5812 4500 u\001 +4 1 1 101 0 3 20 0.0000 4 165 150 5902 4635 e\001 +-6 +6 5715 4815 5985 5220 +4 1 1 101 0 3 20 0.0000 4 180 180 5812 4995 u\001 +4 1 1 101 0 3 20 0.0000 4 315 105 5902 5130 f\001 +-6 +6 3240 4095 3510 4410 +4 1 1 101 0 3 20 0.0000 4 180 180 3337 4275 u\001 +4 1 1 101 0 3 20 0.0000 4 165 150 3427 4410 e\001 +-6 +6 3240 4995 3510 5400 +4 1 1 101 0 3 20 0.0000 4 180 180 3337 5175 u\001 +4 1 1 101 0 3 20 0.0000 4 315 105 3427 5310 f\001 +-6 +6 2160 3015 2385 3420 +4 1 1 101 0 3 20 0.0000 4 315 105 2212 3285 f\001 +4 1 1 101 0 3 20 0.0000 4 150 135 2302 3420 s\001 +-6 +6 5715 3015 5940 3420 +4 1 1 101 0 3 20 0.0000 4 315 105 5767 3285 f\001 +4 1 1 101 0 3 20 0.0000 4 150 135 5857 3420 s\001 +-6 +6 5085 1845 5310 2250 +4 1 1 101 0 3 20 0.0000 4 315 105 5137 2115 f\001 +4 1 1 101 0 3 20 0.0000 4 150 135 5227 2250 s\001 +-6 +6 5940 675 6255 990 +4 1 1 101 0 3 20 0.0000 4 165 150 6052 855 e\001 +4 1 1 101 0 3 20 0.0000 4 150 150 6142 990 c\001 +-6 +6 3645 1305 4320 1710 +4 1 1 101 0 3 20 0.0000 4 105 195 3960 1575 =\001 +4 1 1 101 0 3 20 0.0000 4 315 105 3712 1575 f\001 +4 1 1 101 0 3 20 0.0000 4 150 150 3802 1710 c\001 +4 1 1 101 0 3 20 0.0000 4 315 105 4147 1575 f\001 +4 1 1 101 0 3 20 0.0000 4 150 135 4237 1710 s\001 +-6 +6 3825 675 4140 990 +4 1 1 101 0 3 20 0.0000 4 165 150 3937 855 e\001 +4 1 1 101 0 3 20 0.0000 4 150 150 4027 990 c\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 2925 4725 2925 4500 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 2700 4950 1350 5175 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1575 2925 2925 2925 2700 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5220 2925 6570 2925 6345 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 5175 1125 6975 1125 6975 2700 7200 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6975 3150 6975 4500 7200 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6525 4725 5175 4725 5400 4950 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4500 2925 4500 3150 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4950 2925 4950 3150 5175 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 7425 5625 450 5625 450 450 7425 450 7425 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 1125 4725 1125 4500 1350 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3375 2700 3375 3150 +4 1 0 100 0 18 18 0.0000 4 195 150 4950 1215 0\001 +4 1 0 100 0 18 18 0.0000 4 210 390 3150 3015 AF\001 +4 2 4 100 0 18 18 0.0000 4 270 900 1530 3015 SS:[in]\001 +4 2 4 100 0 18 18 0.0000 4 270 1065 3285 1215 SS:[PC]\001 +4 1 0 100 0 18 18 0.0000 4 210 570 6975 3015 U2B\001 +4 1 0 100 0 18 18 0.0000 4 210 615 6975 4815 tra:t\001 +4 2 4 100 0 18 18 0.0000 4 270 1140 2790 4545 SS:[u_e]\001 +4 2 4 100 0 18 18 0.0000 4 270 1080 2790 5040 SS:[u_f]\001 +4 1 0 100 0 18 18 0.0000 4 210 570 4725 4815 B2U\001 +4 1 4 100 0 18 14 0.0000 4 240 225 6345 2790 [f]\001 +4 1 4 100 0 18 14 0.0000 4 225 285 6795 2520 [e]\001 +4 1 4 100 0 18 14 0.0000 4 240 360 6750 3375 [ef]\001 +4 1 4 100 0 18 14 0.0000 4 225 360 6300 4995 [in]\001 +4 1 4 100 0 18 14 0.0000 4 225 285 4050 4365 [e]\001 +4 1 4 100 0 18 14 0.0000 4 240 225 4050 5265 [f]\001 +4 1 4 100 0 18 14 0.0000 4 240 360 5220 4545 [ef]\001 +4 1 4 100 0 18 14 0.0000 4 225 525 6660 4365 [out]\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4950 3015 1\001 +4 1 1 101 0 3 20 0.0000 4 225 165 6075 1530 0\001 ADDED mtt/lib/comp/compound/Bicausal/VJf/VJf_lbl.txt Index: mtt/lib/comp/compound/Bicausal/VJf/VJf_lbl.txt ================================================================== --- mtt/lib/comp/compound/Bicausal/VJf/VJf_lbl.txt +++ mtt/lib/comp/compound/Bicausal/VJf/VJf_lbl.txt @@ -0,0 +1,60 @@ +#SUMMARY VJf Virtual Junction - flow input +#DESCRIPTION Virtual junction with flow input +#DESCRIPTION User must supply the transfer system tra +#DESCRIPTION tra can have up to 9 parameters passed to it +#DESCRIPTION using parameters of VJf + + +## System VJf, representation lbl, language txt +## File VJf_lbl.txt +## Generated by MTT on Thu Jul 8 11:41:51 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS PC PC +#ALIAS in in +#ALIAS u_e u_e +#ALIAS u_f u_f + +## Argument aliases +#ALIAS $1 p_1 +#ALIAS $2 p_2 +#ALIAS $3 p_3 +#ALIAS $4 p_4 +#ALIAS $5 p_5 +#ALIAS $6 p_6 +#ALIAS $7 p_7 +#ALIAS $8 p_8 +#ALIAS $9 p_9 + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type tra + t lin p_1;p_2;p_3;p_4;p_5;p_6;p_7;p_8;p_9 + +## Component type SS + [in] SS internal,external + [u_e] SS external,0 + [u_f] SS 0,external + [PC] SS external,external + + + ADDED mtt/lib/comp/compound/Chemical/Cm/Cm_abg.fig Index: mtt/lib/comp/compound/Chemical/Cm/Cm_abg.fig ================================================================== --- mtt/lib/comp/compound/Chemical/Cm/Cm_abg.fig +++ mtt/lib/comp/compound/Chemical/Cm/Cm_abg.fig @@ -0,0 +1,32 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 6300 4500 5625 4725 5850 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 5175 4500 4500 4725 4725 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4275 6300 4725 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 7425 4500 6750 4725 6975 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4275 7425 4725 7425 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 4050 4500 3375 4725 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 4275 5400 4275 5175 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5850 4275 6525 4275 6300 4500 +4 1 0 100 0 18 18 0.0000 4 210 390 4500 5490 AF\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4485 4365 0\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4485 6615 1\001 +4 1 4 100 0 18 18 0.0000 4 270 900 4500 7875 SS:[in]\001 +4 1 0 100 0 18 18 0.0000 4 210 510 4500 3285 C:C\001 +4 1 0 100 0 18 18 0.0000 4 210 405 5625 4365 AE\001 +4 0 4 100 0 18 18 0.0000 4 270 1095 6750 4365 SS:[out]\001 ADDED mtt/lib/comp/compound/Chemical/Cm/Cm_lbl.txt Index: mtt/lib/comp/compound/Chemical/Cm/Cm_lbl.txt ================================================================== --- mtt/lib/comp/compound/Chemical/Cm/Cm_lbl.txt +++ mtt/lib/comp/compound/Chemical/Cm/Cm_lbl.txt @@ -0,0 +1,53 @@ +#SUMMARY Cm Integrates [in] flow to give [out] effort + +#DESCRIPTION Zero effort imposed in [in]. Use with mC + +## System Cm, representation lbl, language txt +## File Cm_lbl.txt +## Generated by MTT on Tue Aug 13 15:52:46 EST 2013 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in +#ALIAS out out + +## Argument aliases + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + # 0 + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type AF (anonymous => default parameters) + # AF + +## Component type C + C lin state,1 + +## Component type SS +[in] SS external,external +[out] SS external,external + ADDED mtt/lib/comp/compound/Chemical/Rate/Rate_abg.fig Index: mtt/lib/comp/compound/Chemical/Rate/Rate_abg.fig ================================================================== --- mtt/lib/comp/compound/Chemical/Rate/Rate_abg.fig +++ mtt/lib/comp/compound/Chemical/Rate/Rate_abg.fig @@ -0,0 +1,30 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3780 2880 5220 3195 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 2925 5175 2925 4950 3150 +-6 +6 1755 2880 3195 3195 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2925 3150 2925 2925 3150 +-6 +6 3105 2655 3195 3195 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3150 2700 3150 3150 +-6 +6 3780 2655 3870 3195 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 2700 3825 3150 +-6 +4 1 0 100 0 18 26 0.0000 4 300 525 3510 3060 R:r\001 +4 1 4 100 0 18 14 0.0000 4 210 270 3015 2655 [1]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 3960 2655 [2]\001 +4 1 4 100 0 18 18 0.0000 4 270 1275 1080 3015 SS:[conc]\001 +4 1 4 100 0 18 18 0.0000 4 270 1605 6120 3015 SS:[thermal]\001 ADDED mtt/lib/comp/compound/Chemical/Rate/Rate_cr.r Index: mtt/lib/comp/compound/Chemical/Rate/Rate_cr.r ================================================================== --- mtt/lib/comp/compound/Chemical/Rate/Rate_cr.r +++ mtt/lib/comp/compound/Chemical/Rate/Rate_cr.r @@ -0,0 +1,21 @@ +%% CR file for rate-of reaction component RATE + +OPERATOR Rate; + +% Reaction rate +FOR ALL comp,k,q,h,n,Conc,Temp LET + Rate(comp,k,q,h,n,flow,1, + Conc,effort,1, + Temp,effort,2 + ) + = k*Conc^n*e^(-q/Temp); + +% Heat +FOR ALL comp,k,q,h,n,Conc,Temp LET + Rate(comp,k,q,h,n,flow,2, + Conc,effort,1, + Temp,effort,2 + ) + = k*Conc^n*h*e^(-q/Temp); + +END; ADDED mtt/lib/comp/compound/Chemical/Rate/Rate_desc.tex Index: mtt/lib/comp/compound/Chemical/Rate/Rate_desc.tex ================================================================== --- mtt/lib/comp/compound/Chemical/Rate/Rate_desc.tex +++ mtt/lib/comp/compound/Chemical/Rate/Rate_desc.tex @@ -0,0 +1,32 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Rate (Rate_desc.tex) +% Generated by MTT on Tue Mar 14 17:54:06 GMT 2000. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Rate} is + displayed in Figure \Ref{fig:Rate_abg.ps} and its label + file is listed in Section \Ref{sec:Rate_lbl}. + The subsystems are listed in Section \Ref{sec:Rate_sub}. + + +This component represents rate of reaction equations corresponding to +the chemical reaction: +\begin{equation} + \text{nA} \rightarrow \text{B} +\end{equation} +The relevant equations are +\begin{equation} + \begin{align} + \frac{dc_a}{dt} &= k_a c_a^n e^{-\frac{q_a}{T}} \tag{Rate of reaction}\\ + Q &= h_a k_a c_a^n e^{-\frac{q_a}{T}} \tag{Heat of reaction} + \end{align} +\end{equation} +where $\frac{dc_a}{dt}$ is the rate of change of concentration of +species A and $Q$ is the corresponding heat generated. + ADDED mtt/lib/comp/compound/Chemical/Rate/Rate_lbl.txt Index: mtt/lib/comp/compound/Chemical/Rate/Rate_lbl.txt ================================================================== --- mtt/lib/comp/compound/Chemical/Rate/Rate_lbl.txt +++ mtt/lib/comp/compound/Chemical/Rate/Rate_lbl.txt @@ -0,0 +1,30 @@ +%% Label file for system Rate (Rate_lbl.txt) +%SUMMARY Rate +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in conc +%ALIAS out thermal + +% Argument aliases +%ALIAS $1 k,q,h,n + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + r Rate k,q,h,n + +% Component type SS + [conc] SS external,external + [thermal] SS external,external ADDED mtt/lib/comp/compound/Chemical/mC/mC_abg.fig Index: mtt/lib/comp/compound/Chemical/mC/mC_abg.fig ================================================================== --- mtt/lib/comp/compound/Chemical/mC/mC_abg.fig +++ mtt/lib/comp/compound/Chemical/mC/mC_abg.fig @@ -0,0 +1,43 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 6300 4500 5625 4725 5850 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 5175 4500 4500 4725 4725 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 5400 3600 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 4275 4050 3600 3375 3600 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 2925 3375 2250 3600 2475 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 3375 3375 3375 5175 3600 4950 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4275 6300 4725 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 7425 4500 6750 4725 6975 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4275 7425 4725 7425 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 4 + 4275 6525 3375 6525 3375 5625 3600 5850 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 2025 5400 2925 5400 2700 5625 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 2925 5175 2925 5625 +4 1 0 100 0 18 18 0.0000 4 210 390 4500 5490 AF\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4485 4365 1\001 +4 1 0 100 0 18 18 0.0000 4 210 510 3375 2025 C:C\001 +4 1 0 100 0 18 18 0.0000 4 210 840 3375 5490 EMAE\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4485 6615 1\001 +4 1 4 100 0 18 18 0.0000 4 270 900 4500 7875 SS:[in]\001 +4 1 0 100 0 18 18 0.0000 4 195 150 3360 3240 0\001 +4 1 4 100 0 18 14 0.0000 4 225 525 3150 5850 [out]\001 +4 1 4 100 0 18 14 0.0000 4 225 660 2925 5175 [mod]\001 +4 2 4 100 0 18 18 0.0000 4 270 1275 1935 5490 SS:[mod]\001 ADDED mtt/lib/comp/compound/Chemical/mC/mC_lbl.txt Index: mtt/lib/comp/compound/Chemical/mC/mC_lbl.txt ================================================================== --- mtt/lib/comp/compound/Chemical/mC/mC_lbl.txt +++ mtt/lib/comp/compound/Chemical/mC/mC_lbl.txt @@ -0,0 +1,58 @@ +#SUMMARY mC Modulated C component +#DESCRIPTION Effort on [mod] multiplies effort on [in]. Use with Cm + +## System mC, representation lbl, language txt +## File mC_lbl.txt +## Generated by MTT on Tue Aug 13 15:52:46 EST 2013 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in +#ALIAS mod mod + +## Argument aliases +#ALIAS $1 k_eq + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + # 0 + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type AF (anonymous => default parameters) + # AF + +## Component type C + C lin state,k_eq + +## Component type EMAE (anonymous => default parameters) + # EMAE + +## Component type SS + + +[in] SS external,external +[mod] SS external,external + ADDED mtt/lib/comp/compound/Control/Collocated/PDe/PDe_abg.fig Index: mtt/lib/comp/compound/Control/Collocated/PDe/PDe_abg.fig ================================================================== --- mtt/lib/comp/compound/Control/Collocated/PDe/PDe_abg.fig +++ mtt/lib/comp/compound/Control/Collocated/PDe/PDe_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1575 3375 2925 3375 2700 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 3375 4725 3375 4500 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 3150 4950 1800 5175 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5175 3375 6525 3375 6300 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 3150 3150 1800 3375 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6525 3150 6525 3600 +2 4 0 2 31 7 51 0 -1 0.000 0 0 7 0 0 5 + 7875 4275 7875 900 450 900 450 4275 7875 4275 +4 1 0 100 0 18 18 0.0000 4 195 150 3150 3465 0\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4950 3465 1\001 +4 2 4 100 0 18 18 0.0000 4 270 870 1530 3465 SS:[in]\001 +4 0 4 100 0 18 18 0.0000 4 270 1065 6660 3465 SS:[out]\001 +4 1 0 100 0 18 18 0.0000 4 270 780 3150 1665 C:k_p\001 +4 1 0 100 0 18 18 0.0000 4 270 765 4950 1665 R:k_d\001 ADDED mtt/lib/comp/compound/Control/Collocated/PDe/PDe_desc.tex Index: mtt/lib/comp/compound/Control/Collocated/PDe/PDe_desc.tex ================================================================== --- mtt/lib/comp/compound/Control/Collocated/PDe/PDe_desc.tex +++ mtt/lib/comp/compound/Control/Collocated/PDe/PDe_desc.tex @@ -0,0 +1,56 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system PDe (PDe_desc.tex) +% Generated by MTT on Tue May 1 09:26:33 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{PDe} is + displayed in Figure \Ref{fig:PDe_abg.ps} and its label + file is listed in Section \Ref{sec:PDe_lbl}. + The subsystems are listed in Section \Ref{sec:PDe_sub}. + + This is a proportional + derivative (PD) controller for a + collocated sutuation where the control signal is an effort and the + measured signal is a (collocated) flow. + + The controller can be thought of as controlling \emph{integated + flow}, and it is with respect to this that the P and D terms are defined. + + The setpoint is a \emph{flow}; and must be generated to give the + desired \emph{integrated} flow. + + Physically, the controller is a \textbf{C} and an \textbf{R} + component - for mechanical systems a mass and a spring. + + Mathematically, in integral causality, the equations are: +%file: pde_{dae}.tex +%differential-algebraic equations + \begin{equation} + \begin{aligned} + \dot x_{1} &= + { + f_d - f + } + \end{aligned} + \end{equation} + \begin{equation} + \begin{aligned} + u &= + { + - k_{d} f + k_{p} x_{1} + } + \end{aligned} + \end{equation} + + The state $x_1$ is the the integrated difference between + \emph{desired} flow $f_d$ and the actual flow $f$. Thus the control + signal $u$ is $k_p$ multiplied by the position error minus $k_d$ time + the flow. ADDED mtt/lib/comp/compound/Control/Collocated/PDe/PDe_lbl.txt Index: mtt/lib/comp/compound/Control/Collocated/PDe/PDe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Control/Collocated/PDe/PDe_lbl.txt +++ mtt/lib/comp/compound/Control/Collocated/PDe/PDe_lbl.txt @@ -0,0 +1,39 @@ +%% Label file for system PDe (PDe_lbl.txt) +%SUMMARY PDe: Proportional + Derivative controller with effort output +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS out out + +% Argument aliases +%ALIAS $1 k_p +%ALIAS $2 k_d + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + k_p lin state,k_p + +% Component type R + k_d lin flow,k_d + +% Component type SS + [in] SS internal,external + [out] SS external,external ADDED mtt/lib/comp/compound/Control/Collocated/PIe/PIe_abg.fig Index: mtt/lib/comp/compound/Control/Collocated/PIe/PIe_abg.fig ================================================================== --- mtt/lib/comp/compound/Control/Collocated/PIe/PIe_abg.fig +++ mtt/lib/comp/compound/Control/Collocated/PIe/PIe_abg.fig @@ -0,0 +1,34 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2025 2700 3375 2700 3150 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3600 2475 3600 1125 3825 1350 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 2700 5175 2700 4950 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 900 5175 900 4950 1125 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 900 2025 900 2250 1125 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 6525 3375 900 3375 900 450 6525 450 6525 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 2475 5175 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2025 2475 2025 2925 +4 1 0 100 0 18 18 0.0000 4 195 150 3600 2790 0\001 +4 2 4 100 0 18 18 0.0000 4 270 825 1935 2790 SS:[in]\001 +4 0 4 100 0 18 18 0.0000 4 270 930 5310 2790 SS:[out]\001 +4 1 1 101 0 3 24 0.0000 4 165 195 4500 2520 u\001 +4 1 1 101 0 3 24 0.0000 4 240 165 4545 3015 y\001 +4 1 1 101 0 3 24 0.0000 4 165 240 2520 3015 w\001 +4 1 0 100 0 18 18 0.0000 4 195 150 3600 990 1\001 +4 1 0 100 0 18 18 0.0000 4 270 675 5670 990 C:k_i\001 +4 1 0 100 0 18 18 0.0000 4 270 765 1575 945 R:k_p\001 ADDED mtt/lib/comp/compound/Control/Collocated/PIe/PIe_desc.tex Index: mtt/lib/comp/compound/Control/Collocated/PIe/PIe_desc.tex ================================================================== --- mtt/lib/comp/compound/Control/Collocated/PIe/PIe_desc.tex +++ mtt/lib/comp/compound/Control/Collocated/PIe/PIe_desc.tex @@ -0,0 +1,30 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system PIe (PIe_desc.tex) +% Generated by MTT on Wed May 15 10:28:28 BST 2002. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{PIe} is + displayed in Figure \Ref{fig:PIe_abg.ps} and its label + file is listed in Section \Ref{sec:PIe_lbl}. + +\textbf{PIe} implements a collocated PI controller where: +\begin{description} +\item[w] is the (flow) setpoint at port [w] +\item[y] is the (flow) system output at port [yu] +\item[u] is the (effort) system input (control signal) at port [yu] +\end{description} + +The controller transfer-function is: +\begin{equation} + u(s) = \left [ k_p + \frac{k_i}{s} \right ] e(s) +\end{equation} +where the \emph{error} $e(s) = w(s) - y(s)$. ADDED mtt/lib/comp/compound/Control/Collocated/PIe/PIe_lbl.txt Index: mtt/lib/comp/compound/Control/Collocated/PIe/PIe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Control/Collocated/PIe/PIe_lbl.txt +++ mtt/lib/comp/compound/Control/Collocated/PIe/PIe_lbl.txt @@ -0,0 +1,50 @@ +#SUMMARY PIe: PI controller with effort output +#DESCRIPTION Implements collocated PI controller with: +#DESCRIPTION w (flow) setpoint at in-port +#DESCRIPTION y (flow) measurement at out-port +#DESCRIPTION u (effort) control at out-port + + +## System PIe, representation lbl, language txt +## File PIe_lbl.txt +## Generated by MTT on Wed May 15 10:17:13 BST 2002 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS w in +#ALIAS yu out + +## Argument aliases +#ALIAS $1 k_i +#ALIAS $2 k_p + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type C + k_i lin state,k_i + +## Component type R + k_p lin flow,k_p + +## Component type R + [in] SS internal,external + [out] SS external,external + ADDED mtt/lib/comp/compound/Control/Collocated/PIe/PIe_rep.txt Index: mtt/lib/comp/compound/Control/Collocated/PIe/PIe_rep.txt ================================================================== --- mtt/lib/comp/compound/Control/Collocated/PIe/PIe_rep.txt +++ mtt/lib/comp/compound/Control/Collocated/PIe/PIe_rep.txt @@ -0,0 +1,35 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system PIe (PIe_rep.txt) +## Generated by MTT on" Wed May 15 10:33:29 BST 2002. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt PIe abg tex # The system description +mtt PIe cbg ps # The causal bond graph +mtt PIe struc tex # The system structure +mtt PIe sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt PIe dae tex # The system dae +mtt PIe ode tex # The system ode +## mtt PIe sspar tex # Steady-state parameters +## mtt PIe ss tex # Steady state +## mtt PIe dm tex # Descriptor matrices (of linearised system) +## mtt PIe sm tex # State matrices (of linearised system) +mtt PIe tf tex # Transfer function (of linearised system) +## mtt PIe lmfr ps # log modulus of frequency response (of linearised system) +## mtt PIe simpar txt # Simulation parameters +## mtt PIe numpar txt # Numerical simulation parameters +## mtt PIe state txt # Simulation initial state +## mtt PIe input txt # Simulation input +## mtt PIe logic txt # Logic control +## mtt PIe odeso ps # Simulation output + +mtt PIe rep txt # This file ADDED mtt/lib/comp/compound/Control/Collocated/Pe/Pe_abg.fig Index: mtt/lib/comp/compound/Control/Collocated/Pe/Pe_abg.fig ================================================================== --- mtt/lib/comp/compound/Control/Collocated/Pe/Pe_abg.fig +++ mtt/lib/comp/compound/Control/Collocated/Pe/Pe_abg.fig @@ -0,0 +1,28 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2025 2700 3375 2700 3150 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3600 2475 3600 1125 3825 1350 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 2700 5175 2700 4950 2925 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 6525 3375 900 3375 900 450 6525 450 6525 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 2475 5175 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2025 2475 2025 2925 +4 1 0 100 0 18 18 0.0000 4 195 150 3600 2790 0\001 +4 2 4 100 0 18 18 0.0000 4 270 870 1935 2790 SS:[in]\001 +4 0 4 100 0 18 18 0.0000 4 270 1065 5310 2790 SS:[out]\001 +4 1 1 101 0 3 24 0.0000 4 165 195 4500 2520 u\001 +4 1 1 101 0 3 24 0.0000 4 240 165 4545 3015 y\001 +4 1 1 101 0 3 24 0.0000 4 165 240 2520 3015 w\001 +4 1 0 100 0 18 18 0.0000 4 270 765 3735 990 R:k_p\001 ADDED mtt/lib/comp/compound/Control/Collocated/Pe/Pe_desc.tex Index: mtt/lib/comp/compound/Control/Collocated/Pe/Pe_desc.tex ================================================================== --- mtt/lib/comp/compound/Control/Collocated/Pe/Pe_desc.tex +++ mtt/lib/comp/compound/Control/Collocated/Pe/Pe_desc.tex @@ -0,0 +1,33 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Pe (Pe_desc.tex) +% Generated by MTT on Wed May 15 10:28:28 BST 2002. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2002/05/15 11:01:24 gawthrop +% %% New PI controller component +% %% +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Pe} is + displayed in Figure \Ref{fig:Pe_abg.ps} and its label + file is listed in Section \Ref{sec:Pe_lbl}. + +\textbf{Pe} implements a collocated P controller where: +\begin{description} +\item[w] is the (flow) setpoint at port [w] +\item[y] is the (flow) system output at port [yu] +\item[u] is the (effort) system input (control signal) at port [yu] +\end{description} + +The controller transfer-function is: +\begin{equation} + u(s) = k_p e(s) +\end{equation} +where the \emph{error} $e(s) = w(s) - y(s)$. ADDED mtt/lib/comp/compound/Control/Collocated/Pe/Pe_lbl.txt Index: mtt/lib/comp/compound/Control/Collocated/Pe/Pe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Control/Collocated/Pe/Pe_lbl.txt +++ mtt/lib/comp/compound/Control/Collocated/Pe/Pe_lbl.txt @@ -0,0 +1,49 @@ +#SUMMARY Pe: Proportional controller with effort output +#DESCRIPTION Implements collocated P controller with: +#DESCRIPTION w (flow) setpoint at in-port +#DESCRIPTION y (flow) measurement at out-port +#DESCRIPTION u (effort) control at out-port + + +## System Pe, representation lbl, language txt +## File Pe_lbl.txt +## Generated by MTT on Wed May 15 10:17:13 BST 2002 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.1 2002/05/15 11:01:24 gawthrop + ## New PI controller component + ## + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS w in +#ALIAS yu out + +## Argument aliases +#ALIAS $1 k_p + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type R + k_p lin flow,k_p + +## Component type R + [in] SS internal,external + [out] SS external,external + ADDED mtt/lib/comp/compound/Control/Collocated/Pe/Pe_rep.txt Index: mtt/lib/comp/compound/Control/Collocated/Pe/Pe_rep.txt ================================================================== --- mtt/lib/comp/compound/Control/Collocated/Pe/Pe_rep.txt +++ mtt/lib/comp/compound/Control/Collocated/Pe/Pe_rep.txt @@ -0,0 +1,38 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system Pe (Pe_rep.txt) +## Generated by MTT on" Wed May 15 10:33:29 BST 2002. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2002/05/15 11:01:24 gawthrop +## New PI controller component +## +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt Pe abg tex # The system description +mtt Pe cbg ps # The causal bond graph +mtt Pe struc tex # The system structure +mtt Pe sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt Pe dae tex # The system dae +mtt Pe ode tex # The system ode +## mtt Pe sspar tex # Steady-state parameters +## mtt Pe ss tex # Steady state +## mtt Pe dm tex # Descriptor matrices (of linearised system) +## mtt Pe sm tex # State matrices (of linearised system) +mtt Pe tf tex # Transfer function (of linearised system) +## mtt Pe lmfr ps # log modulus of frequency response (of linearised system) +## mtt Pe simpar txt # Simulation parameters +## mtt Pe numpar txt # Numerical simulation parameters +## mtt Pe state txt # Simulation initial state +## mtt Pe input txt # Simulation input +## mtt Pe logic txt # Logic control +## mtt Pe odeso ps # Simulation output + +mtt Pe rep txt # This file ADDED mtt/lib/comp/compound/Control/Collocated/Pe/sPe_lbl.txt Index: mtt/lib/comp/compound/Control/Collocated/Pe/sPe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Control/Collocated/Pe/sPe_lbl.txt +++ mtt/lib/comp/compound/Control/Collocated/Pe/sPe_lbl.txt @@ -0,0 +1,41 @@ +#SUMMARY sPe Sensitivity version of Pe +#DESCRIPTION Detailed description here + +## System sPe, representation lbl, language txt +## File sPe_lbl.txt +## Generated by MTT on Wed May 15 11:55:22 BST 2002 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in_1,in_2 +#ALIAS out out_1,out_2 + +## Argument aliases + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type + [in] SS internal,external + [out] SS external,external + +## Component type sR + k_p slin flow,k_p;0 + ADDED mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_abg.fig Index: mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_abg.fig ================================================================== --- mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_abg.fig +++ mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_abg.fig @@ -0,0 +1,33 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 2700 6300 2700 6075 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4950 2475 4950 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6300 2700 6300 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9900 2700 11250 2700 11025 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 11250 2700 11250 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 9900 2475 9900 2700 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 12600 5175 3825 5175 3825 450 12600 450 12600 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 4275 4725 2925 4950 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 2475 4725 1125 4950 1350 +4 1 0 100 0 18 18 0.0000 4 195 150 4725 2790 1\001 +4 1 0 100 0 18 18 0.0000 4 270 1590 9045 2790 SS:amp_out\001 +4 1 0 100 0 18 18 0.0000 4 270 1395 7110 2790 SS:amp_in\001 +4 1 4 100 0 18 18 0.0000 4 270 1140 4905 990 SS:[neg]\001 +4 1 4 100 0 18 18 0.0000 4 270 1140 4725 4590 SS:[pos]\001 +4 0 4 100 0 18 18 0.0000 4 270 1065 11385 2790 SS:[out]\001 ADDED mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_lbl.txt Index: mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_lbl.txt ================================================================== --- mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_lbl.txt +++ mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_lbl.txt @@ -0,0 +1,36 @@ +#SUMMARY OpAmp: an ideal operational amplifier +#DESCRIPTION Uses virtual earth concept + + +## System OpAmp, representation lbl, language txt +## File OpAmp_lbl.txt +## Generated by MTT on Tue Sep 18 09:32:19 BST 2001 + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ############################################################### + +## Port aliases +#ALIAS neg neg +#ALIAS out out +#ALIAS pos pos + +## Argument aliases + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type + [neg] SS external,external + [out] SS external,external + [pos] SS external,external + amp_in SS 0,0 + amp_out SS internal,internal + ADDED mtt/lib/comp/compound/Electrical/RC/RC_abg.fig Index: mtt/lib/comp/compound/Electrical/RC/RC_abg.fig ================================================================== --- mtt/lib/comp/compound/Electrical/RC/RC_abg.fig +++ mtt/lib/comp/compound/Electrical/RC/RC_abg.fig @@ -0,0 +1,65 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 4277 4052 4277 3827 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4502 4277 5402 4277 5177 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 4051 4276 3151 4501 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 4051 5626 3151 5851 3376 +2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 3825 585 4725 585 4725 765 3825 765 3825 585 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5400 1215 5850 1215 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3150 675 3825 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4725 675 6750 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5625 675 5625 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5625 1215 5625 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3150 1575 6750 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 4277 6752 4277 6527 4502 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9225 5625 9225 225 900 225 900 5625 9225 5625 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5400 1080 5850 1080 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 4050 4050 4050 4500 +4 2 4 0 0 0 20 0.0000 4 255 2040 3105 4365 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 4277 4367 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5627 4367 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 375 4276 2926 R:r\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 5626 2926 C:c\001 +4 0 1 1 0 0 20 0.0000 4 135 105 4230 450 r\001 +4 0 1 1 0 0 20 0.0000 4 135 120 6030 1215 c\001 +4 1 1 1 0 0 20 0.0000 4 255 1350 4950 4995 Bond graph\001 +4 1 1 1 0 0 20 0.0000 4 195 1200 4950 2025 Schematic\001 +4 0 4 0 0 0 20 0.0000 4 255 2190 6887 4367 SS:[out]\001 +4 0 1 1 0 0 20 0.0000 4 135 135 3375 4005 v\001 +4 0 1 1 0 0 20 0.0000 4 195 135 3465 4140 1\001 +4 0 1 1 0 0 20 0.0000 4 195 75 3375 4590 i\001 +4 0 1 1 0 0 20 0.0000 4 195 135 3465 4725 1\001 +4 0 1 1 0 0 20 0.0000 4 195 75 6165 4590 i\001 +4 0 1 1 0 0 20 0.0000 4 195 135 6255 4725 2\001 +4 0 1 1 0 0 20 0.0000 4 135 135 6165 4005 v\001 +4 0 1 1 0 0 20 0.0000 4 195 135 6255 4140 2\001 +4 0 1 1 0 0 20 0.0000 4 135 135 6660 1170 v\001 +4 0 1 1 0 0 20 0.0000 4 195 135 6750 1305 2\001 +4 0 1 1 0 0 20 0.0000 4 195 75 6300 450 i\001 +4 0 1 1 0 0 20 0.0000 4 195 135 6390 585 2\001 +4 0 1 1 0 0 20 0.0000 4 195 75 3375 450 i\001 +4 0 1 1 0 0 20 0.0000 4 195 135 3465 585 1\001 +4 0 1 1 0 0 20 0.0000 4 135 135 3060 1170 v\001 +4 0 1 1 0 0 20 0.0000 4 195 135 3150 1305 1\001 ADDED mtt/lib/comp/compound/Electrical/RC/RC_desc.tex Index: mtt/lib/comp/compound/Electrical/RC/RC_desc.tex ================================================================== --- mtt/lib/comp/compound/Electrical/RC/RC_desc.tex +++ mtt/lib/comp/compound/Electrical/RC/RC_desc.tex @@ -0,0 +1,17 @@ +% Verbal description for system RC (RC_desc.tex) +% Generated by MTT on Tue Aug 26 09:43:25 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\textbf{RC} is a Simple two-port RC circuit. The two ports are [in] +and [out] and the two parameters are c and r respectively + + The acausal bond graph of system \textbf{RC} is + displayed in Figure \Ref{RC_abg} and its label + file is listed in Section \Ref{sec:RC_lbl}. + The subsystems are listed in Section \Ref{sec:RC_sub}. ADDED mtt/lib/comp/compound/Electrical/RC/RC_lbl.txt Index: mtt/lib/comp/compound/Electrical/RC/RC_lbl.txt ================================================================== --- mtt/lib/comp/compound/Electrical/RC/RC_lbl.txt +++ mtt/lib/comp/compound/Electrical/RC/RC_lbl.txt @@ -0,0 +1,45 @@ +%% Label file for system RC (RC_lbl.txt) +%SUMMARY RC A Simple two-port RC circuit +%DESCRIPTION This simple example is used in the manual. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 2000/09/14 15:13:02 peterg +% %% Changed port CRs to give SISO system when used in isolation +% %% +% %% Revision 1.2 1998/07/27 11:09:36 peterg +% %% Commented the aliases. +% %% +% %% Revision 1.1 1998/07/16 20:16:30 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in # The left-hand port +%ALIAS out out # The right-hand port + +% Argument aliases +%ALIAS $1 c # Capacitance +%ALIAS $2 r # Resistance + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + c lin effort,c + +% Component type R + r lin flow,r + +% Component type SS + [in] SS external,internal + [out] SS external,0 ADDED mtt/lib/comp/compound/Electrical/Tee/Tee_abg.fig Index: mtt/lib/comp/compound/Electrical/Tee/Tee_abg.fig ================================================================== --- mtt/lib/comp/compound/Electrical/Tee/Tee_abg.fig +++ mtt/lib/comp/compound/Electrical/Tee/Tee_abg.fig @@ -0,0 +1,79 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 2250 765 3375 765 3375 1035 2250 1035 2250 765 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4275 1575 5175 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4275 1800 5175 1800 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 2 1 2.00 120.00 240.00 + 1350 900 2250 900 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 2 1 2.00 120.00 240.00 + 4725 900 4725 1575 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 5850 765 6975 765 6975 1035 5850 1035 5850 765 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 2 1 2.00 120.00 240.00 + 3375 900 4725 900 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 2 1 2.00 120.00 240.00 + 5805 900 4725 900 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 2 1 2.00 120.00 240.00 + 8100 900 6975 900 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 + 4725 1800 4725 2475 1350 2475 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 + 4725 2475 8100 2475 8100 2430 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 6076 4501 6076 4276 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 5851 2926 4501 3151 4726 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8100 6077 6750 6077 6975 6302 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 6077 4950 6077 5175 6302 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 5852 6525 4502 6750 4727 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 4501 4951 4726 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9226 6976 226 6976 226 3826 9226 3826 9226 6976 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9225 3375 225 3375 225 225 9225 225 9225 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 6075 2700 6075 2475 6300 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 5850 2700 6300 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6750 5850 6750 6300 +4 1 1 1 0 3 20 0.0000 4 270 465 1350 1710 u_1\001 +4 1 1 1 0 3 20 0.0000 4 270 465 8145 1710 u_2\001 +4 1 1 1 0 3 20 0.0000 4 285 420 1800 675 y_1\001 +4 1 1 1 0 3 20 0.0000 4 285 420 7830 720 y_2\001 +4 1 1 1 0 3 20 0.0000 4 285 420 7695 6345 y_2\001 +4 1 1 1 0 3 20 0.0000 4 270 465 7650 5940 u_2\001 +4 1 -1 0 0 2 20 0.0000 4 210 150 4726 6166 0\001 +4 1 -1 0 0 2 20 0.0000 4 210 150 2926 6166 1\001 +4 1 -1 0 0 2 20 0.0000 4 285 720 2926 4366 R:r_1\001 +4 1 -1 0 0 2 20 0.0000 4 210 150 6525 6167 1\001 +4 1 -1 0 0 2 20 0.0000 4 285 720 6525 4367 R:r_2\001 +4 1 -1 0 0 2 20 0.0000 4 210 420 4726 4366 C:c\001 +4 1 1 1 0 3 20 0.0000 4 210 1335 4680 3060 Schematic\001 +4 1 1 1 0 3 20 0.0000 4 285 1470 4725 6705 Bond graph\001 +4 1 1 1 0 3 20 0.0000 4 270 390 2835 1350 r_1\001 +4 1 1 1 0 3 20 0.0000 4 270 390 6345 1350 r_2\001 +4 1 1 1 0 3 20 0.0000 4 135 135 3870 1800 c\001 +4 1 1 1 0 3 20 0.0000 4 270 465 1980 5940 u_1\001 +4 1 1 1 0 3 20 0.0000 4 285 420 1980 6390 y_1\001 +4 1 4 0 0 2 20 0.0000 4 285 1050 765 6165 SS:[e_1]\001 +4 1 4 0 0 2 20 0.0000 4 285 1050 8640 6165 SS:[e_2]\001 ADDED mtt/lib/comp/compound/Electrical/Tee/Tee_desc.tex Index: mtt/lib/comp/compound/Electrical/Tee/Tee_desc.tex ================================================================== --- mtt/lib/comp/compound/Electrical/Tee/Tee_desc.tex +++ mtt/lib/comp/compound/Electrical/Tee/Tee_desc.tex @@ -0,0 +1,26 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Tee (Tee_desc.tex) +% Generated by MTT on Fri Mar 13 16:28:54 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Tee} is + displayed in Figure \Ref{Tee_abg} and its label + file is listed in Section \Ref{sec:Tee_lbl}. + +This simple ``tee'' RC circuit has two ports: +\begin{itemize} +\item Port [1] carrying $v_1$ and $i_1$ and +\item Port [2] carrying $v_2$ and $i_2$. +\end{itemize} + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Electrical/Tee/Tee_lbl.txt Index: mtt/lib/comp/compound/Electrical/Tee/Tee_lbl.txt ================================================================== --- mtt/lib/comp/compound/Electrical/Tee/Tee_lbl.txt +++ mtt/lib/comp/compound/Electrical/Tee/Tee_lbl.txt @@ -0,0 +1,43 @@ +%SUMMARY Tee Electrical T circuit +%DESCRIPTION A two port circuit composed of 2 resistors and one +%DESCRIPTION capacitor in a T form, + +%% Label file for system Tee (Tee_lbl.txt) + +%ALIAS $1 r_1 +%ALIAS $2 r_2 +%ALIAS $3 c + +%ALIAS in e_1 +%ALIAS out e_2 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1999/12/16 22:21:09 peterg +% %% Changed port names +% %% +% %% Revision 1.1 1998/07/16 16:30:41 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c lin effort,c + +% Component type R + r_1 lin flow,r_1 + r_2 lin flow,r_2 + +% Component type SS + [e_1] SS external,external + [e_2] SS external,external ADDED mtt/lib/comp/compound/Electromechanical/CM/CM_abg.fig Index: mtt/lib/comp/compound/Electromechanical/CM/CM_abg.fig ================================================================== --- mtt/lib/comp/compound/Electromechanical/CM/CM_abg.fig +++ mtt/lib/comp/compound/Electromechanical/CM/CM_abg.fig @@ -0,0 +1,37 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 4050 5175 2700 5400 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 2250 5175 900 5400 1125 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 2475 6750 2475 6525 2700 +2 2 0 3 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 7650 2025 2700 2025 2700 2925 7650 2925 7650 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 5850 5175 4500 5400 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 7680 5175 6330 5400 6555 +2 2 0 3 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 7650 5625 2700 5625 2700 6525 7650 6525 7650 5625 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6750 2250 6750 2700 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 2700 5400 2700 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 5850 5400 5850 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 8325 8325 450 2025 450 2025 8325 8325 8325 +4 1 4 0 0 0 20 0.0000 4 240 960 5175 810 SS:[out]\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5175 2565 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1485 5175 4365 C:transducer\001 +4 0 -1 0 0 0 20 0.0000 4 195 735 6840 2565 I:mass\001 +4 0 1 1 0 0 20 0.0000 4 255 885 2880 2340 Moving\001 +4 0 1 1 0 0 20 0.0000 4 195 585 2880 2670 Plate\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5175 6165 1\001 +4 1 4 0 0 0 20 0.0000 4 240 810 5175 8055 SS:[in]\001 +4 0 1 1 0 0 20 0.0000 4 195 585 2880 6315 Plate\001 +4 0 1 1 0 0 20 0.0000 4 195 630 2880 5940 Fixed\001 ADDED mtt/lib/comp/compound/Electromechanical/CM/CM_desc.tex Index: mtt/lib/comp/compound/Electromechanical/CM/CM_desc.tex ================================================================== --- mtt/lib/comp/compound/Electromechanical/CM/CM_desc.tex +++ mtt/lib/comp/compound/Electromechanical/CM/CM_desc.tex @@ -0,0 +1,30 @@ +% Verbal description for system CM (CM_desc.tex) +% Generated by MTT on Fri Sep 19 18:07:12 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{CM} is + displayed in Figure \Ref{CM_abg} and its label + file is listed in Section \Ref{sec:CM_lbl}. + The subsystems are listed in Section \Ref{sec:CM_sub}. + +{\bf CM} is an electromechanical moving-plate capacitor with linear +electrical capacitance $c$ of the form +\begin{equation} + c = c_0 \frac{x_0}{x} +\end{equation} +where $x_0$ is the plate separation corresponding to a capacitance of +$c_0$. +The corresponding electrical constitutive relationship (which gives an +energy-conserving two-port \textbf{C}) is +\begin{equation} + F = Q c_0 \frac{x_0}{x^2} +\end{equation} +where $F$ is the force between the plates and $Q$ the charge on the +capacitor. +This is implemented in the \emph{cm.cr} Constitutive Relationship. ADDED mtt/lib/comp/compound/Electromechanical/CM/CM_lbl.txt Index: mtt/lib/comp/compound/Electromechanical/CM/CM_lbl.txt ================================================================== --- mtt/lib/comp/compound/Electromechanical/CM/CM_lbl.txt +++ mtt/lib/comp/compound/Electromechanical/CM/CM_lbl.txt @@ -0,0 +1,30 @@ +%SUMMARY CM: Mechanical (moving-plate) capacitor +%DESCRIPTION Parameter 1: Capacitance at plate separation of x_0 +%DESCRIPTION Parameter 2: x_0 +%DESCRIPTION Parameter 3: mass of moving-plate + +%% Label file for system CM (CM_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + transducer cm $1,$2 + +% Component type I + mass lin flow,$3 + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/comp/compound/Electromechanical/DC/DC_abg.fig Index: mtt/lib/comp/compound/Electromechanical/DC/DC_abg.fig ================================================================== --- mtt/lib/comp/compound/Electromechanical/DC/DC_abg.fig +++ mtt/lib/comp/compound/Electromechanical/DC/DC_abg.fig @@ -0,0 +1,40 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 4860 4730 4860 494 2293 494 2293 4730 4860 4730 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2036 2724 3371 2724 3063 2947 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3576 2501 3576 1342 3833 1609 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3782 2724 5116 2724 4808 2947 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3576 2947 3576 4106 3833 3839 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6656 2724 7991 2724 7683 2947 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8196 2546 8196 1386 8453 1654 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8196 2947 8196 4106 8453 3839 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8453 2724 9788 2724 9480 2947 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9480 4730 9480 494 6913 494 6913 4730 9480 4730 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 12150 5175 45 5175 45 316 12150 316 12150 5175 +4 2 4 0 0 0 20 0.0000000 4 240 1815 1980 2790 SS:[Electrical]\001 +4 1 -1 0 0 0 23 0.0000000 4 240 171 3525 2858 1\001 +4 1 -1 0 0 0 23 0.0000000 4 274 1198 5938 2813 GY:k_m\001 +4 1 -1 0 0 0 23 0.0000000 4 240 171 8196 2813 1\001 +4 1 -1 0 0 0 23 0.0000000 4 274 650 3525 1252 I:l_a\001 +4 1 -1 0 0 0 23 0.0000000 4 308 770 8299 1252 I:j_m\001 +4 1 -1 0 0 0 23 0.0000000 4 274 770 3628 4463 R:r_a\001 +4 1 -1 0 0 0 23 0.0000000 4 274 941 8248 4463 R:b_m\001 +4 1 1 1 0 0 23 0.0000000 4 240 1352 3576 5043 Electrical\001 +4 1 1 1 0 0 23 0.0000000 4 240 1626 8196 5043 Mechanical\001 +4 1 1 1 0 0 23 0.0000000 4 240 736 10404 3170 Shaft\001 +4 1 1 1 0 0 23 0.0000000 4 240 1420 1472 3170 Terminals\001 +4 0 4 0 0 0 20 0.0000000 4 240 2055 9945 2835 SS:[Mechanical]\001 ADDED mtt/lib/comp/compound/Electromechanical/DC/DC_desc.tex Index: mtt/lib/comp/compound/Electromechanical/DC/DC_desc.tex ================================================================== --- mtt/lib/comp/compound/Electromechanical/DC/DC_desc.tex +++ mtt/lib/comp/compound/Electromechanical/DC/DC_desc.tex @@ -0,0 +1,37 @@ +% Verbal description for system DC (DC_desc.tex) +% Generated by MTT on Thu Sep 11 10:09:58 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{DC} is + displayed in Figure \Ref{DC_abg} and its label + file is listed in Section \Ref{sec:DC_lbl}. + The subsystems are listed in Section \Ref{sec:DC_sub}. + + \begin{table}[htbp] + \begin{center} + \leavevmode + \begin{tabular}{|l|l|} + \hline + Index & Parameter\\ + \hline + 1 & Motor gain ($k_m$) \\ + 2 & Armature inductance ($l_a$) \\ + 3 & Armature resistance ($r_a$) \\ + 4 & Inertia ($j_m$) \\ + 5 & Friction coefficient ($b_m$) \\ + \hline + \end{tabular} + \caption{DC motor parameters} + \label{tab:DC_components} + \end{center} + \end{table} +{\bf DC} is a two-port component representing a DC motor. It has the 5 +parameters listed in Table \Ref{tab:DC_components}. + + ADDED mtt/lib/comp/compound/Electromechanical/DC/DC_lbl.txt Index: mtt/lib/comp/compound/Electromechanical/DC/DC_lbl.txt ================================================================== --- mtt/lib/comp/compound/Electromechanical/DC/DC_lbl.txt +++ mtt/lib/comp/compound/Electromechanical/DC/DC_lbl.txt @@ -0,0 +1,69 @@ +%SUMMARY DC: DC motor (or generator) + +%% Port Alias +%ALIAS in Electrical +%ALIAS out Mechanical + +%% Unit definition +%UNITS Electrical electrical volt amp +%UNITS Mechanical rotational N*m radians/s + +%ALIAS $1 k_m +%ALIAS $2 l_a +%ALIAS $3 r_a +%ALIAS $4 j_m +%ALIAS $5 b_m + + +%% Label file for system DC (DC_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.6 2000/11/16 09:45:51 peterg +% %% Added unit definitions +% %% +% %% Revision 1.5 1998/07/26 12:49:24 peterg +% %% Corrected some errors +% %% +% %% Revision 1.4 1998/07/26 12:45:33 peterg +% %% Added ports +% %% +% %% Revision 1.3 1998/07/22 12:01:17 peterg +% %% Aliased ports and parameters. +% %% +% %% Revision 1.2 1996/12/04 16:01:42 peterg +% %% Documantation added. +% %% +% %% Revision 1.1 1996/12/04 16:00:56 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Motor gain +k_m lin flow,k_m + +% Electrical components +%Inductance +l_a lin effort,l_a + +%Resistance +r_a lin flow,r_a + +% Mechanical components +%Inertia +j_m lin flow,j_m + +%Friction +b_m lin flow,b_m + +% Ports + [Electrical] SS external,external + [Mechanical] SS external,external ADDED mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_abg.fig Index: mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_abg.fig ================================================================== --- mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_abg.fig +++ mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_abg.fig @@ -0,0 +1,28 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2925 1575 4275 1575 4050 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 1575 6075 1575 5850 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7200 1575 8550 1575 8325 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9000 1575 10350 1575 10125 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 1800 4500 3150 4725 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 8775 1800 8775 3150 9000 2925 +4 1 0 100 0 18 18 0.0000 4 195 150 4500 1665 1\001 +4 1 0 100 0 18 18 0.0000 4 195 150 8775 1665 0\001 +4 2 4 100 0 18 18 0.0000 4 270 900 2835 1665 SS:[in]\001 +4 0 4 100 0 18 18 0.0000 4 270 1095 10440 1665 SS:[out]\001 +4 1 0 100 0 18 18 0.0000 4 270 780 8775 3600 C:k_p\001 +4 1 0 100 0 18 18 0.0000 4 270 795 4500 3600 C:c_p\001 +4 1 0 100 0 18 18 0.0000 4 270 945 6615 1665 TF:g_p\001 ADDED mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_lbl.txt Index: mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_lbl.txt ================================================================== --- mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_lbl.txt +++ mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_lbl.txt @@ -0,0 +1,54 @@ +#SUMMARY Piezo: Piezo-electric transducer +#DESCRIPTION Simple Mason model in Bond Graph form + +## System Piezo, representation lbl, language txt +## File Piezo_lbl.txt +## Generated by MTT on Wed Mar 15 16:55:26 EST 2006 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in +#ALIAS out out + +## Argument aliases +#ALIAS $1 c_p +#ALIAS $2 g_p +#ALIAS $3 k_p + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type C + c_p lin effort,c_p + k_p lin state,k_p + +## Component type SS + [in] SS external,external + [out] SS external,external + +## Component type TF + g_p lin flow,g_p + ADDED mtt/lib/comp/compound/GasDynamics/CG/CG_abg.fig Index: mtt/lib/comp/compound/GasDynamics/CG/CG_abg.fig ================================================================== --- mtt/lib/comp/compound/GasDynamics/CG/CG_abg.fig +++ mtt/lib/comp/compound/GasDynamics/CG/CG_abg.fig @@ -0,0 +1,53 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 2700 3600 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2025 4950 2025 4725 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2925 4950 2925 4725 3150 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9675 2250 9675 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1800 2025 3150 2025 2925 2250 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 1800 1800 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 7875 2250 7875 900 3375 900 3375 1800 3600 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7425 2475 6075 2475 6300 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9630 2475 8280 2475 8505 2700 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4500 3600 6525 3600 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4725 4500 4725 4500 1350 6525 1350 6525 4725 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 9315 540 8055 900 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8910 4725 8910 1800 6975 1800 6975 4725 8910 4725 +4 2 4 0 0 0 20 0.0000 4 240 1185 3510 3015 SS:[mass]\001 +4 1 4 0 0 0 20 0.0000 4 240 315 4860 1800 [1]\001 +4 1 4 0 0 0 20 0.0000 4 240 315 4860 2745 [2]\001 +4 1 -1 0 0 2 30 0.0000 4 405 885 5445 2610 C:cg\001 +4 1 -1 0 0 0 20 0.0000 4 255 645 7830 2565 PS:ps\001 +4 0 4 0 0 0 20 0.0000 4 240 1920 9855 2565 SS:[mechanical]\001 +4 1 4 0 0 0 20 0.0000 4 240 315 6120 2205 [3]\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 3375 2115 0\001 +4 2 4 0 0 0 20 0.0000 4 240 1575 1755 2115 SS:[thermal]\001 +4 1 4 0 0 0 20 0.0000 4 240 405 7245 2295 [in]\001 +4 0 4 0 0 0 20 0.0000 4 255 885 7965 2160 [power]\001 +4 0 4 0 0 0 20 0.0000 4 240 555 8325 2790 [out]\001 +4 1 1 1 0 0 20 0.0000 4 255 1050 5490 3915 Enthalpy\001 +4 1 1 1 0 0 20 0.0000 4 195 600 5490 4245 Mass\001 +4 1 1 1 0 0 20 0.0000 4 195 915 5490 4575 Volume\001 +4 1 1 1 0 0 20 0.0000 4 195 135 9405 2295 p\001 +4 1 1 1 0 0 20 0.0000 4 255 645 9270 2745 dV/dt\001 +4 1 1 1 0 0 20 0.0000 4 255 915 7380 1440 p*dV/dt\001 +4 1 1 1 0 0 20 0.0000 4 255 3885 9360 450 Joule's work-enthalpy conversion\001 +4 1 1 1 0 0 20 0.0000 4 195 1590 7920 3960 Power Sensor\001 +4 1 1 1 0 0 20 0.0000 4 255 1800 7920 4380 Work-enthalpy\001 ADDED mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r Index: mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r ================================================================== --- mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r +++ mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r @@ -0,0 +1,43 @@ +%SUMMARY CG CR two-port C thermal pseudo Bond Graph for gas dynamics + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 1998/03/04 15:38:16 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +OPERATOR CG; + +% Port 1 : temperature +FOR ALL COMP, c_v,r,Enthalpy,Stored_Mass,Volume +LET CG(COMP, c_v,r, effort, 1, + Enthalpy,state,1, + Stored_Mass,state,2, + Volume,state,3) + = Enthalpy/(c_v*Stored_Mass); + +% Port 2 : Pressure +FOR ALL COMP, c_v,r,Enthalpy,Stored_Mass,Volume +LET CG(COMP, c_v,r, effort, 2, + Enthalpy,state,1, + Stored_Mass,state,2, + Volume,state,3) + = (R/c_v)*(Enthalpy/Volume); + +% Port 3 : (Also) Pressure +FOR ALL COMP, c_v,r,Enthalpy,Stored_Mass,Volume +LET CG(COMP, c_v,r, effort, 3, + Enthalpy,state,1, + Stored_Mass,state,2, + Volume,state,3) + = (R/c_v)*(Enthalpy/Volume); + +END;; + ADDED mtt/lib/comp/compound/GasDynamics/CG/CG_lbl.txt Index: mtt/lib/comp/compound/GasDynamics/CG/CG_lbl.txt ================================================================== --- mtt/lib/comp/compound/GasDynamics/CG/CG_lbl.txt +++ mtt/lib/comp/compound/GasDynamics/CG/CG_lbl.txt @@ -0,0 +1,42 @@ +%SUMMARY CG: C component for compressible gas dynamics +%DESCRIPTION Port [Thermal]: Temperature/Enthalpy pseudo bond +%DESCRIPTION Port [Mass]: Pressure/mass-flow pseudo bond +%DESCRIPTION Port [Mechanical]: Pressure/volume flow energy bond +%DESCRIPTION +%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) +%DESCRIPTION Parameter 2: R (universal gas constant) +%DESCRIPTION Based on Karnopp, Margolis and Rosenberg: Section 12.4. + + +%% Label file for system CG (CG_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/03/04 12:06:06 peterg +% %% Renamed CR from GasAccumulator to CG +% %% +% %% Revision 1.1 1997/11/21 17:06:34 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + cg CG $1,$2 + +% Component type PS + ps lin effort,1 + +% Component type SS + [mass] SS external,external + [mechanical] SS external,external + [thermal] SS external,external ADDED mtt/lib/comp/compound/GasDynamics/RG/RG_abg.fig Index: mtt/lib/comp/compound/GasDynamics/RG/RG_abg.fig ================================================================== --- mtt/lib/comp/compound/GasDynamics/RG/RG_abg.fig +++ mtt/lib/comp/compound/GasDynamics/RG/RG_abg.fig @@ -0,0 +1,36 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2925 4950 2925 4725 3150 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4500 3600 6525 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2025 4950 2025 4725 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 2925 7425 2925 7200 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 2025 7425 2025 7200 2250 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4500 4500 4500 4500 1350 6525 1350 6525 4500 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 1800 4950 2250 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 2700 4950 3150 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6075 1800 6075 2250 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6075 2700 6075 3150 +4 2 4 0 0 0 20 0.0000 4 255 1545 3510 3015 SS:[mass_in]\001 +4 1 1 1 0 0 20 0.0000 4 255 1125 5490 3915 Isentropic\001 +4 1 1 1 0 0 20 0.0000 4 195 780 5490 4245 Nozzle\001 +4 1 -1 0 0 2 30 0.0000 4 405 885 5535 2520 R:rg\001 +4 2 4 0 0 0 20 0.0000 4 255 1935 3510 2115 SS:[thermal_in]\001 +4 0 4 0 0 0 20 0.0000 4 255 2085 7515 2115 SS:[thermal_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 1695 7515 2970 SS:[mass_out]\001 +4 1 4 0 0 0 20 0.0000 4 240 315 4725 1935 [1]\001 +4 1 4 0 0 0 20 0.0000 4 240 315 4725 2835 [2]\001 +4 1 4 0 0 0 20 0.0000 4 240 315 6300 1935 [3]\001 +4 1 4 0 0 0 20 0.0000 4 240 315 6300 2835 [4]\001 ADDED mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r Index: mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r ================================================================== --- mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r +++ mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r @@ -0,0 +1,66 @@ +%SUMMARY RG CR for 2 port gas dymanics R: isentropic nozzle + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 1998/03/04 15:37:48 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +OPERATOR RG; + +% Port 1 : Enthalpy flow +FOR ALL COMP, gamma,R,A,T_u,P_u,T_d,P_d +LET RG(COMP, gamma,R,A, flow, 1, + T_u,effort,1, + P_u,effort,2, + T_d,effort,3, + P_d,effort,4) + = A*( P_u/sqrt(T_u) ) + *sqrt( (2*gamma)/(R*(gamma-1)) ) + *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ) + *(gamma/(gamma-1))*R*T_u; + +% Port 2 : Mass flow +FOR ALL COMP, gamma,R,A,T_u,P_u,T_d,P_d +LET RG(COMP, gamma,R,A, flow, 2, + T_u,effort,1, + P_u,effort,2, + T_d,effort,3, + P_d,effort,4) + = A*( P_u/sqrt(T_u) ) + *sqrt( (2*gamma)/(R*(gamma-1)) ) + *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ); + +% Port 3 : Enthalpy flow +FOR ALL COMP, gamma,R,A,T_u,P_u,T_d,P_d +LET RG(COMP, gamma,R,A, flow, 3, + T_u,effort,1, + P_u,effort,2, + T_d,effort,3, + P_d,effort,4) + = A*( P_u/sqrt(T_u) ) + *sqrt( (2*gamma)/(R*(gamma-1)) ) + *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ) + *(gamma/(gamma-1))*R*T_u; + +% Port 4 : Mass flow +FOR ALL COMP, gamma,R,A,T_u,P_u,T_d,P_d +LET RG(COMP, gamma,R,A, flow, 4, + T_u,effort,1, + P_u,effort,2, + T_d,effort,3, + P_d,effort,4) + = A*( P_u/sqrt(T_u) ) + *sqrt( (2*gamma)/(R*(gamma-1)) ) + *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ); + + +END;; + ADDED mtt/lib/comp/compound/GasDynamics/RG/RG_lbl.txt Index: mtt/lib/comp/compound/GasDynamics/RG/RG_lbl.txt ================================================================== --- mtt/lib/comp/compound/GasDynamics/RG/RG_lbl.txt +++ mtt/lib/comp/compound/GasDynamics/RG/RG_lbl.txt @@ -0,0 +1,43 @@ +%SUMMARY RG: R component for compressible gas dynamics: isentropic nozzle +%DESCRIPTION Port [Thermal_in]: Temperature/Enthalpy pseudo bond +%DESCRIPTION Port [Thermal_out]: Temperature/Enthalpy pseudo bond +%DESCRIPTION Port [Mass_in]: Pressure/mass-flow pseudo bond +%DESCRIPTION Port [Mass_out]: Pressure/mass-flow pseudo bond +%DESCRIPTION +%DESCRIPTION Parameter 1: gamma (c_p/c_v) +%DESCRIPTION Parameter 2: R (universal gas constant) +%DESCRIPTION Parameter 3: A (nozzle cross-section) +%DESCRIPTION Based on Karnopp, Margolis and Rosenberg: Section 12.4. + + + +%% Label file for system RG (RG_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/03/04 12:07:37 peterg +% %% Renamed CR from Isentropic nozzle to RG +% %% +% %% Revision 1.1 1997/11/21 19:18:28 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type RG + rg RG $1,$2,$3 + +% Component type SS + [mass_in] SS external,external + [mass_out] SS external,external + [thermal_in] SS external,external + [thermal_out] SS external,external ADDED mtt/lib/comp/compound/General/AEf/AEf_abg.fig Index: mtt/lib/comp/compound/General/AEf/AEf_abg.fig ================================================================== --- mtt/lib/comp/compound/General/AEf/AEf_abg.fig +++ mtt/lib/comp/compound/General/AEf/AEf_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1350 2475 2475 2475 2250 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3397 2497 4522 2497 4297 2722 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5197 2475 6322 2475 6097 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2475 2250 2475 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4500 2250 4500 2745 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 2250 5175 2700 +4 1 0 100 0 18 20 0.0000 4 225 675 2880 2610 AE:a\001 +4 1 0 100 0 18 20 0.0000 4 225 435 4860 2610 GY\001 +4 1 4 100 0 18 20 0.0000 4 285 975 810 2565 SS:[in]\001 +4 1 4 100 0 18 20 0.0000 4 285 1170 6975 2610 SS:[out]\001 ADDED mtt/lib/comp/compound/General/AEf/AEf_lbl.txt Index: mtt/lib/comp/compound/General/AEf/AEf_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/AEf/AEf_lbl.txt +++ mtt/lib/comp/compound/General/AEf/AEf_lbl.txt @@ -0,0 +1,46 @@ +%% Label file for system AEf (AEf_lbl.txt) +%SUMMARY AEf Effort input amplifier with flow output +%DESCRIPTION Made from AE with GY on output + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/07/29 04:19:43 peterg +% %% Initial revision +% %% +% %% Revision 1.2 1999/03/05 08:25:11 peterg +% %% Changed default to lin. +% %% +% %% Revision 1.1 1999/03/04 06:05:46 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS out out + +% Argument aliases +%ALIAS $1 g + +% CR aliases +%ALIAS $1 lin + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AF + a lin g + +% Component type SS + [in] SS external,external + [out] SS external,external + ADDED mtt/lib/comp/compound/General/AFe/AFe_abg.fig Index: mtt/lib/comp/compound/General/AFe/AFe_abg.fig ================================================================== --- mtt/lib/comp/compound/General/AFe/AFe_abg.fig +++ mtt/lib/comp/compound/General/AFe/AFe_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1350 2475 2475 2475 2250 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3397 2497 4522 2497 4297 2722 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5197 2475 6322 2475 6097 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1350 2250 1350 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3375 2250 3375 2745 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6300 2250 6300 2700 +4 1 0 100 0 18 20 0.0000 4 225 660 2880 2610 AF:a\001 +4 1 0 100 0 18 20 0.0000 4 225 435 4860 2610 GY\001 +4 1 4 100 0 18 20 0.0000 4 285 975 810 2565 SS:[in]\001 +4 1 4 100 0 18 20 0.0000 4 285 1170 6975 2610 SS:[out]\001 ADDED mtt/lib/comp/compound/General/AFe/AFe_lbl.txt Index: mtt/lib/comp/compound/General/AFe/AFe_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/AFe/AFe_lbl.txt +++ mtt/lib/comp/compound/General/AFe/AFe_lbl.txt @@ -0,0 +1,39 @@ +%% Label file for system AFe (AFe_lbl.txt) +%SUMMARY AFe Flow input amplifier with effort output +%DESCRIPTION Made from AF with GY on output + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/03/04 06:05:46 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS out out + +% Argument aliases +%ALIAS $1 g + +% CR aliases +%ALIAS $1 lin + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AF + a lin g + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/comp/compound/General/CD/CD_abg.fig Index: mtt/lib/comp/compound/General/CD/CD_abg.fig ================================================================== --- mtt/lib/comp/compound/General/CD/CD_abg.fig +++ mtt/lib/comp/compound/General/CD/CD_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 2700 3150 2700 2250 2925 2475 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 2925 3375 3825 3375 3600 3600 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 1575 3375 2475 3375 2250 3600 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 1350 3150 1350 2250 1575 2475 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 225 3375 1125 3375 900 3600 +4 1 0 100 0 18 18 0.0000 4 210 510 1350 2115 Df:f\001 +4 1 0 100 0 18 18 0.0000 4 210 630 2700 2115 De:e\001 +4 0 0 100 0 18 18 0.0000 4 210 405 3960 3465 C:c_1\001 +4 2 4 100 0 18 18 0.0000 4 270 900 135 3465 SS:[in]\001 +4 1 0 100 0 18 18 0.0000 4 195 150 1350 3465 1\001 +4 1 0 100 0 18 18 0.0000 4 195 150 2700 3465 0\001 ADDED mtt/lib/comp/compound/General/CD/CD_lbl.txt Index: mtt/lib/comp/compound/General/CD/CD_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/CD/CD_lbl.txt +++ mtt/lib/comp/compound/General/CD/CD_lbl.txt @@ -0,0 +1,56 @@ +#SUMMARY CD +#DESCRIPTION Detailed description here + +## System CD, representation lbl, language txt +## File CD_lbl.txt +## Generated by MTT on Thu Apr 24 10:30:13 EST 2014 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in + +## Argument aliases +#ALIAS $1 effort,c_1 + +## cr aliases +#ALIAS $a1 lin + + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type De + e SS external + +## Component type Df + f SS external + +## Component type I + c_1 lin effort,c_1 + +## Component type SS + [in] SS external,external + ADDED mtt/lib/comp/compound/General/CDx/CDx_abg.fig Index: mtt/lib/comp/compound/General/CDx/CDx_abg.fig ================================================================== --- mtt/lib/comp/compound/General/CDx/CDx_abg.fig +++ mtt/lib/comp/compound/General/CDx/CDx_abg.fig @@ -0,0 +1,24 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 3150 3150 3150 2925 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 2925 3375 1575 3600 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 3375 3375 4725 3150 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 4950 5175 4950 4950 5175 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 6750 5850 675 5850 675 900 6750 900 6750 5850 +4 1 0 100 0 18 18 0.0000 4 210 450 3375 1440 C:c\001 +4 1 0 100 0 18 18 0.0000 4 195 150 3375 3240 0\001 +4 2 4 100 0 18 18 0.0000 4 270 870 1755 3240 SS:[in]\001 +4 1 0 100 0 18 18 0.0000 4 210 615 3330 5085 AE:a\001 +4 0 4 100 0 18 18 0.0000 4 270 1065 5310 5040 SS:[out]\001 ADDED mtt/lib/comp/compound/General/CDx/CDx_desc.tex Index: mtt/lib/comp/compound/General/CDx/CDx_desc.tex ================================================================== --- mtt/lib/comp/compound/General/CDx/CDx_desc.tex +++ mtt/lib/comp/compound/General/CDx/CDx_desc.tex @@ -0,0 +1,25 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system CDx (CDx_desc.tex) +% Generated by MTT on Thu Apr 19 10:28:34 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{CDx} is + displayed in Figure \Ref{fig:CDx_abg.ps} and its label + file is listed in Section \Ref{sec:CDx_lbl}. + + This component is a standard compliance except that: + \begin{itemize} + \item There is an additional output equal to the integrated flow + variable + \item the re is a single parameter $c$ -- the compliance. + \end{itemize} + ADDED mtt/lib/comp/compound/General/CDx/CDx_lbl.txt Index: mtt/lib/comp/compound/General/CDx/CDx_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/CDx/CDx_lbl.txt +++ mtt/lib/comp/compound/General/CDx/CDx_lbl.txt @@ -0,0 +1,38 @@ +%% Label file for system CDx (CDx_lbl.txt) +%SUMMARY CDx: C component with state output +%DESCRIPTION Parameter 1: compliance + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS out out + +% Argument aliases +%ALIAS $1 c + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AE + a lin c + +% Component type C + c lin effort,c + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/comp/compound/General/CS/CS_abg.fig Index: mtt/lib/comp/compound/General/CS/CS_abg.fig ================================================================== --- mtt/lib/comp/compound/General/CS/CS_abg.fig +++ mtt/lib/comp/compound/General/CS/CS_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2340 3915 2610 4185 +4 1 0 100 0 18 20 0.0000 4 270 195 2475 4185 1\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 3825 2475 2475 2700 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 5625 2475 4275 2700 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4050 4050 4050 3825 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2700 3825 2700 4275 +4 1 0 100 0 18 20 0.0000 4 285 570 2475 2295 C:c\001 +4 0 0 100 0 18 20 0.0000 4 360 1185 4185 4185 Se:e_0\001 +4 1 4 100 0 18 20 0.0000 4 360 1185 2475 6030 SS:[in]\001 ADDED mtt/lib/comp/compound/General/CS/CS_lbl.txt Index: mtt/lib/comp/compound/General/CS/CS_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/CS/CS_lbl.txt +++ mtt/lib/comp/compound/General/CS/CS_lbl.txt @@ -0,0 +1,36 @@ +%% Label file for system CS (CS_lbl.txt) +%SUMMARY CS C component with initial state + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in + +% Argument aliases +%ALIAS $1 effort,c +%ALIAS $2 e_0 + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + c lin effort,c + +% Component type SS + [in] SS external,external + +% Component type Se + e_0 SS e_0 + + ADDED mtt/lib/comp/compound/General/CSW/CSW_abg.fig Index: mtt/lib/comp/compound/General/CSW/CSW_abg.fig ================================================================== --- mtt/lib/comp/compound/General/CSW/CSW_abg.fig +++ mtt/lib/comp/compound/General/CSW/CSW_abg.fig @@ -0,0 +1,11 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 2925 2475 1575 2700 1800 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 4770 3600 4770 900 225 900 225 3600 4770 3600 +4 1 4 0 0 0 20 0.0000 4 240 810 2475 3240 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 2130 2520 1440 C:MTT_SWITCH\001 ADDED mtt/lib/comp/compound/General/CSW/CSW_lbl.txt Index: mtt/lib/comp/compound/General/CSW/CSW_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/CSW/CSW_lbl.txt +++ mtt/lib/comp/compound/General/CSW/CSW_lbl.txt @@ -0,0 +1,44 @@ +%SUMMARY CSW: Switched C component +%DESCRIPTION CSW acts as an C component except when the -s -c option is used. +%DESCRIPTION When the -s -c option is used: +%DESCRIPTION The component label is used as a variable name (eg Name) +%DESCRIPTION In the ode simulation: +%DESCRIPTION Name = 1 implies normal C (closed switch) +%DESCRIPTION Name = 0 implies state=0 (open switch) +%DESCRIPTION Name = -1 implies state>0 (Diode) + +%ALIAS out in +%ALIAS $1 lin +%ALIAS $1 effort,c_s + +%% Label file for system CSW (CSW_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1997/09/11 09:00:52 peterg +% %% More documentation. +% %% +% %% Revision 1.1 1997/06/16 10:55:20 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1997/06/03 15:26:09 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + MTT_SWITCH lin effort,c_s + +% Component type SS + [in] SS external,external + ADDED mtt/lib/comp/compound/General/CX/CX_abg.fig Index: mtt/lib/comp/compound/General/CX/CX_abg.fig ================================================================== --- mtt/lib/comp/compound/General/CX/CX_abg.fig +++ mtt/lib/comp/compound/General/CX/CX_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1800 2700 3150 2700 2925 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2700 4950 2700 4725 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 1125 3375 2475 3600 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 3600 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 2475 3600 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 2475 1800 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 1125 3150 1125 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6075 3600 6075 450 225 450 225 3600 6075 3600 +4 1 -1 0 0 22 20 0.0000 4 225 150 3375 2835 0\001 +4 1 -1 0 0 22 20 0.0000 4 240 435 5355 2790 C:c\001 +4 2 4 0 0 22 20 0.0000 4 315 870 1665 2790 SS:[in]\001 +4 1 4 0 0 22 20 0.0000 4 315 810 3375 990 SS:[X]\001 ADDED mtt/lib/comp/compound/General/CX/CX_lbl.txt Index: mtt/lib/comp/compound/General/CX/CX_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/CX/CX_lbl.txt +++ mtt/lib/comp/compound/General/CX/CX_lbl.txt @@ -0,0 +1,34 @@ +#SUMMARY CX C component with state i/o +#DESCRIPTION Port [X]: state i/o +## Label file for system CX (CX_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.3 2000/08/29 15:25:33 peterg +# ## New SS format +# ## +# ## Revision 1.2 1998/04/14 17:06:44 peterg +# ## Input only to SS +# ## +# ## Revision 1.1 1998/04/12 15:21:11 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + +# Component type C + c $1 $1 + +# Component type SS + [in] SS internal,external + [X] SS internal,external + + ADDED mtt/lib/comp/compound/General/De/De_abg.fig Index: mtt/lib/comp/compound/General/De/De_abg.fig ================================================================== --- mtt/lib/comp/compound/General/De/De_abg.fig +++ mtt/lib/comp/compound/General/De/De_abg.fig @@ -0,0 +1,17 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 4 0 2 31 7 99 0 -1 0.000 0 0 7 0 0 5 + 4950 3600 4950 1800 675 1800 675 3600 4950 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3150 2475 3150 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2700 3150 2700 2925 2925 +4 0 0 100 0 18 20 0.0000 4 285 660 3285 2790 SS:y\001 +4 2 4 100 0 18 20 0.0000 4 285 975 1755 2790 SS:[in]\001 ADDED mtt/lib/comp/compound/General/De/De_lbl.txt Index: mtt/lib/comp/compound/General/De/De_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/De/De_lbl.txt +++ mtt/lib/comp/compound/General/De/De_lbl.txt @@ -0,0 +1,37 @@ +%% Label file for system De (De_lbl.txt) +%SUMMARY De Simple effort detector +%DESCRIPTION Simple effort detector constructed from SS with fixed causality + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1999/09/07 03:32:21 peterg +% %% Fixed alias bug +% %% +% %% Revision 1.2 1999/09/07 03:21:02 peterg +% %% Aliased to out as well as in +% %% +% %% Revision 1.1 1999/03/03 22:02:04 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in|out in + +% Argument aliases +%ALIAS $1 external + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [in] SS external,external + y SS external,0 ADDED mtt/lib/comp/compound/General/Df/Df_abg.fig Index: mtt/lib/comp/compound/General/Df/Df_abg.fig ================================================================== --- mtt/lib/comp/compound/General/Df/Df_abg.fig +++ mtt/lib/comp/compound/General/Df/Df_abg.fig @@ -0,0 +1,17 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 4 0 2 31 7 99 0 -1 0.000 0 0 7 0 0 5 + 4950 3600 4950 1800 675 1800 675 3600 4950 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2700 3150 2700 2925 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1800 2475 1800 2925 +4 0 0 100 0 18 20 0.0000 4 285 660 3285 2790 SS:y\001 +4 2 4 100 0 18 20 0.0000 4 285 975 1755 2790 SS:[port]\001 ADDED mtt/lib/comp/compound/General/Df/Df_lbl.txt Index: mtt/lib/comp/compound/General/Df/Df_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/Df/Df_lbl.txt +++ mtt/lib/comp/compound/General/Df/Df_lbl.txt @@ -0,0 +1,37 @@ +%% Label file for system Df (Df_lbl.txt) +%SUMMARY Df Simple flow detector +%DESCRIPTION Simple flow detector constructed from SS with fixed causality + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1999/09/07 03:31:47 peterg +% %% Fixed alias bug +% %% +% %% Revision 1.2 1999/09/07 03:20:34 peterg +% %% Aliased to out as well as in +% %% +% %% Revision 1.1 1999/03/03 22:05:16 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in|out port + +% Argument aliases +%ALIAS $1 external +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [port] SS external,external + y SS 0,external ADDED mtt/lib/comp/compound/General/EMAE/EMAE_abg.fig Index: mtt/lib/comp/compound/General/EMAE/EMAE_abg.fig ================================================================== --- mtt/lib/comp/compound/General/EMAE/EMAE_abg.fig +++ mtt/lib/comp/compound/General/EMAE/EMAE_abg.fig @@ -0,0 +1,33 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3150 4995 3150 4725 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 1080 5850 2475 5580 2205 +2 4 0 2 31 7 0 0 -1 0.000 0 0 7 0 0 5 + 10125 4275 10125 225 225 225 225 4275 10125 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1530 3150 2925 3150 2655 3420 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 6075 2475 5625 2475 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 2925 2925 2925 3375 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 8100 2925 8100 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6705 3150 8100 3150 7830 3420 +4 1 -1 0 0 22 20 0.0000 4 240 375 3330 3240 AE\001 +4 1 -1 0 0 22 20 0.0000 4 315 1380 5895 3240 EMTF:gain\001 +4 2 4 0 0 22 20 0.0000 4 300 870 1485 3240 SS:[in]\001 +4 0 4 0 0 22 20 0.0000 4 300 1050 8370 3240 SS:[out]\001 +4 1 4 0 0 22 20 0.0000 4 300 1200 5805 945 SS:[mod]\001 +4 1 4 0 0 22 20 0.0000 4 300 750 5850 2925 [mod]\001 +4 2 4 0 0 22 20 0.0000 4 300 420 4995 2925 [in]\001 +4 0 4 0 0 22 20 0.0000 4 300 600 6705 2925 [out]\001 ADDED mtt/lib/comp/compound/General/EMAE/EMAE_lbl.txt Index: mtt/lib/comp/compound/General/EMAE/EMAE_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/EMAE/EMAE_lbl.txt +++ mtt/lib/comp/compound/General/EMAE/EMAE_lbl.txt @@ -0,0 +1,32 @@ +%SUMMARY EMAE Effort-modulated AE component +%DESCRIPTION Ports: [in], [out] and [mod] + + +%% Label file for system EMAE (EMAE_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/08/29 15:27:30 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type EMTF + gain lin effort + +% Component type SS + [in] SS external,external + [mod] SS external,external + [out] SS external,external + + ADDED mtt/lib/comp/compound/General/EMAF/EMAF_abg.fig Index: mtt/lib/comp/compound/General/EMAF/EMAF_abg.fig ================================================================== --- mtt/lib/comp/compound/General/EMAF/EMAF_abg.fig +++ mtt/lib/comp/compound/General/EMAF/EMAF_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1575 3150 2970 3150 2700 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3150 4995 3150 4725 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 3150 8145 3150 7875 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 1080 5850 2475 5580 2205 +2 4 0 2 31 7 0 0 -1 0.000 0 0 7 0 0 5 + 10125 4275 10125 225 225 225 225 4275 10125 4275 +4 1 -1 0 0 22 20 0.0000 4 210 390 3330 3240 AF\001 +4 1 -1 0 0 22 20 0.0000 4 270 1455 5895 3240 EMTF:gain\001 +4 2 4 0 0 22 20 0.0000 4 270 900 1485 3240 SS:[in]\001 +4 0 4 0 0 22 20 0.0000 4 270 1095 8370 3240 SS:[out]\001 +4 1 4 0 0 22 20 0.0000 4 270 1275 5805 945 SS:[mod]\001 +4 1 4 0 0 22 20 0.0000 4 270 795 5850 2925 [mod]\001 +4 2 4 0 0 22 20 0.0000 4 270 420 4995 2925 [in]\001 +4 0 4 0 0 22 20 0.0000 4 270 615 6705 2925 [out]\001 ADDED mtt/lib/comp/compound/General/EMAF/EMAF_lbl.txt Index: mtt/lib/comp/compound/General/EMAF/EMAF_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/EMAF/EMAF_lbl.txt +++ mtt/lib/comp/compound/General/EMAF/EMAF_lbl.txt @@ -0,0 +1,29 @@ +%SUMMARY EMAF Effort-modulated AF component +%DESCRIPTION Ports: [in], [out] and [mod] + + +%% Label file for system EMAF (EMAF_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type EMTF + gain lin flow + +% Component type SS + [in] SS external,external + [mod] SS external,external + [out] SS external,external + + ADDED mtt/lib/comp/compound/General/EMR/EMR_abg.fig Index: mtt/lib/comp/compound/General/EMR/EMR_abg.fig ================================================================== --- mtt/lib/comp/compound/General/EMR/EMR_abg.fig +++ mtt/lib/comp/compound/General/EMR/EMR_abg.fig @@ -0,0 +1,24 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2040 3030 2460 3240 +4 1 0 100 0 18 18 0.0000 4 210 420 2250 3240 GY\001 +-6 +6 1800 4725 2700 5175 +4 1 0 100 0 18 18 0.0000 4 210 825 2250 5040 FMR:r\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 1575 2250 2925 2025 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 3375 2250 4725 2025 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 6525 2250 5175 2025 5400 +4 1 4 100 0 18 18 0.0000 4 270 1275 2250 1350 SS:[mod]\001 +4 1 4 100 0 18 18 0.0000 4 270 900 2250 6975 SS:[in]\001 +4 0 4 100 0 18 14 0.0000 4 225 660 2475 4725 [mod]\001 ADDED mtt/lib/comp/compound/General/EMR/EMR_lbl.txt Index: mtt/lib/comp/compound/General/EMR/EMR_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/EMR/EMR_lbl.txt +++ mtt/lib/comp/compound/General/EMR/EMR_lbl.txt @@ -0,0 +1,45 @@ +#SUMMARY EMR Effort-modulated resistor +#DESCRIPTION Resistor CR is modulated by effort on port [mod] + +## System EMR, representation lbl, language txt +## File EMR_lbl.txt +## Generated by MTT on Wed Aug 14 09:04:10 EST 2013 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in +#ALIAS mod mod + +## Argument aliases +#ALIAS $1 effort,k + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type FMR + r lin effort,k + +## Component type GY (anonymous => default parameters) + # GY + +## Component type SS + [in] SS external,external + [mod] SS external,external + ADDED mtt/lib/comp/compound/General/ID/ID_abg.fig Index: mtt/lib/comp/compound/General/ID/ID_abg.fig ================================================================== --- mtt/lib/comp/compound/General/ID/ID_abg.fig +++ mtt/lib/comp/compound/General/ID/ID_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 2700 3150 2700 2250 2925 2475 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 2925 3375 3825 3375 3600 3600 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 1575 3375 2475 3375 2250 3600 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 1350 3150 1350 2250 1575 2475 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 225 3375 1125 3375 900 3600 +4 1 0 100 0 18 18 0.0000 4 210 510 1350 2115 Df:f\001 +4 1 0 100 0 18 18 0.0000 4 210 630 2700 2115 De:e\001 +4 0 0 100 0 18 18 0.0000 4 210 405 3960 3465 I:i_1\001 +4 2 4 100 0 18 18 0.0000 4 270 900 135 3465 SS:[in]\001 +4 1 0 100 0 18 18 0.0000 4 195 150 1350 3465 1\001 +4 1 0 100 0 18 18 0.0000 4 195 150 2700 3465 0\001 ADDED mtt/lib/comp/compound/General/ID/ID_lbl.txt Index: mtt/lib/comp/compound/General/ID/ID_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/ID/ID_lbl.txt +++ mtt/lib/comp/compound/General/ID/ID_lbl.txt @@ -0,0 +1,56 @@ +#SUMMARY ID +#DESCRIPTION Detailed description here + +## System ID, representation lbl, language txt +## File ID_lbl.txt +## Generated by MTT on Thu Apr 24 10:30:13 EST 2014 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in + +## Argument aliases +#ALIAS $1 flow,i_1 + +## cr aliases +#ALIAS $a1 lin + + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type De + e SS external + +## Component type Df + f SS external + +## Component type I + i_1 lin flow,i_1 + +## Component type SS + [in] SS external,external + ADDED mtt/lib/comp/compound/General/INTF/INTF_abg.fig Index: mtt/lib/comp/compound/General/INTF/INTF_abg.fig ================================================================== --- mtt/lib/comp/compound/General/INTF/INTF_abg.fig +++ mtt/lib/comp/compound/General/INTF/INTF_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1801 3151 2701 3151 2476 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3376 3151 4276 3151 4051 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 2926 4501 2026 4726 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3151 5626 3151 5401 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6301 3150 7201 3150 6976 3375 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9900 4050 450 4050 450 1350 9900 1350 9900 4050 +4 2 4 0 0 0 20 0.0000 4 240 1170 1711 3241 SS:[Flow]\001 +4 1 -1 0 0 0 20 0.0000 4 195 375 3016 3241 AF\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 4501 3241 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 195 4501 1891 C\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 5986 3241 AE\001 +4 0 4 0 0 0 20 0.0000 4 255 2400 7336 3241 SS:[Integrated_flow]\001 ADDED mtt/lib/comp/compound/General/INTF/INTF_desc.tex Index: mtt/lib/comp/compound/General/INTF/INTF_desc.tex ================================================================== --- mtt/lib/comp/compound/General/INTF/INTF_desc.tex +++ mtt/lib/comp/compound/General/INTF/INTF_desc.tex @@ -0,0 +1,17 @@ +% Verbal description for system INTF (INTF_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:16 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{INTF} is + displayed in Figure \Ref{INTF_abg} and its label + file is listed in Section \Ref{sec:INTF_lbl}. + The subsystems are listed in Section \Ref{sec:INTF_sub}. + +\textbf{INTF} is a two-port component where the effort on port [out] + is the integral of the flow on port [in]. ADDED mtt/lib/comp/compound/General/INTF/INTF_lbl.txt Index: mtt/lib/comp/compound/General/INTF/INTF_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/INTF/INTF_lbl.txt +++ mtt/lib/comp/compound/General/INTF/INTF_lbl.txt @@ -0,0 +1,30 @@ +%% Label file for system INTF (INTF_lbl.txt) +%SUMMARY INTF: flow integrator +%DESCRIPTION Port [in]: Flow to be integrated +%DESCRIPTION Port [out]: Effort = integral of flow on port [in] + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Flow +%ALIAS out Integrated_flow + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [Flow] SS external,external + [Integrated_flow] SS external,external ADDED mtt/lib/comp/compound/General/INTFS/INTFS_abg.fig Index: mtt/lib/comp/compound/General/INTFS/INTFS_abg.fig ================================================================== --- mtt/lib/comp/compound/General/INTFS/INTFS_abg.fig +++ mtt/lib/comp/compound/General/INTFS/INTFS_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1801 3151 2701 3151 2476 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3376 3151 4276 3151 4051 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 2926 4501 2026 4726 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3151 5626 3151 5401 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6301 3150 7201 3150 6976 3375 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9900 4050 450 4050 450 1350 9900 1350 9900 4050 +4 2 4 0 0 0 20 0.0000 4 240 1170 1711 3241 SS:[Flow]\001 +4 1 -1 0 0 0 20 0.0000 4 195 375 3016 3241 AF\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 4501 3241 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 195 4501 1891 CS:unit\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 5986 3241 AE\001 +4 0 4 0 0 0 20 0.0000 4 255 2400 7336 3241 SS:[Integrated_flow]\001 ADDED mtt/lib/comp/compound/General/INTFS/INTFS_desc.tex Index: mtt/lib/comp/compound/General/INTFS/INTFS_desc.tex ================================================================== --- mtt/lib/comp/compound/General/INTFS/INTFS_desc.tex +++ mtt/lib/comp/compound/General/INTFS/INTFS_desc.tex @@ -0,0 +1,21 @@ +% Verbal description for system INTF (INTF_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:16 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/08/24 11:20:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{INTFS} is + displayed in Figure \Ref{INTFS_abg} and its label + file is listed in Section \Ref{sec:INTFS_lbl}. + The subsystems are listed in Section \Ref{sec:INTFS_sub}. + +\textbf{INTFS} is a two-port component where the effort on port [out] + is the integral of the flow on port [in]. The single parameter e_0 + is the initial value of the integral. ADDED mtt/lib/comp/compound/General/INTFS/INTFS_lbl.txt Index: mtt/lib/comp/compound/General/INTFS/INTFS_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/INTFS/INTFS_lbl.txt +++ mtt/lib/comp/compound/General/INTFS/INTFS_lbl.txt @@ -0,0 +1,38 @@ +%% Label file for system INTF (INTF_lbl.txt) +%SUMMARY INTFS: flow integrator with explicit initial state +%DESCRIPTION Port [in]: Flow to be integrated +%DESCRIPTION Port [out]: Effort = integral of flow on port [in] + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/07/16 07:35:10 peterg +% %% Aliased version +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Flow +%ALIAS out Integrated_flow + +% Argument aliases +%ALIAS $1 e_0 + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type CS + unit lin effort,1;e_0 + +% Component type SS + [Flow] SS external,external + [Integrated_flow] SS external,external + ADDED mtt/lib/comp/compound/General/IS/IS_abg.fig Index: mtt/lib/comp/compound/General/IS/IS_abg.fig ================================================================== --- mtt/lib/comp/compound/General/IS/IS_abg.fig +++ mtt/lib/comp/compound/General/IS/IS_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 3825 2475 2475 2700 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 5625 2475 4275 2700 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4050 4050 4050 3825 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 3825 4050 4275 +2 4 0 2 31 7 52 0 -1 0.000 0 0 7 0 0 5 + 5625 6570 5625 1575 1350 1575 1350 6570 5625 6570 +4 1 0 100 0 18 20 0.0000 4 210 240 2475 2295 I:i\001 +4 0 0 100 0 18 20 0.0000 4 270 795 4185 4185 Sf:f_0\001 +4 1 4 100 0 18 20 0.0000 4 270 900 2475 6030 SS:[in]\001 +4 1 0 100 0 18 20 0.0000 4 195 150 2475 4185 0\001 ADDED mtt/lib/comp/compound/General/IS/IS_abg.fig.bak Index: mtt/lib/comp/compound/General/IS/IS_abg.fig.bak ================================================================== --- mtt/lib/comp/compound/General/IS/IS_abg.fig.bak +++ mtt/lib/comp/compound/General/IS/IS_abg.fig.bak @@ -0,0 +1,23 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2340 3915 2610 4185 +4 1 0 100 0 18 20 0.0000 4 270 195 2475 4185 0\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 3825 2475 2475 2700 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 5625 2475 4275 2700 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4050 4050 4050 3825 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 3825 4050 4275 +4 1 0 100 0 18 20 0.0000 4 285 315 2475 2295 I:i\001 +4 0 0 100 0 18 20 0.0000 4 360 1035 4185 4185 Sf:f_0\001 +4 1 4 100 0 18 20 0.0000 4 360 1185 2475 6030 SS:[in]\001 ADDED mtt/lib/comp/compound/General/IS/IS_lbl.txt Index: mtt/lib/comp/compound/General/IS/IS_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/IS/IS_lbl.txt +++ mtt/lib/comp/compound/General/IS/IS_lbl.txt @@ -0,0 +1,39 @@ +%% Label file for system IS (IS_lbl.txt) +%SUMMARY IS I component with initial state + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:29:11 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in + +% Argument aliases +%ALIAS $1 flow,i +%ALIAS $2 f_0 + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type I + i lin flow,i + +% Component type SS + [in] SS external,external + +% Component type Sf + f_0 SS f_0 + + ADDED mtt/lib/comp/compound/General/ISW/ISW_abg.fig Index: mtt/lib/comp/compound/General/ISW/ISW_abg.fig ================================================================== --- mtt/lib/comp/compound/General/ISW/ISW_abg.fig +++ mtt/lib/comp/compound/General/ISW/ISW_abg.fig @@ -0,0 +1,11 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 2925 2475 1575 2700 1800 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 4770 3600 4770 900 225 900 225 3600 4770 3600 +4 1 4 0 0 0 20 0.0000 4 240 810 2475 3240 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 2025 2520 1440 I:MTT_SWITCH\001 ADDED mtt/lib/comp/compound/General/ISW/ISW_lbl.txt Index: mtt/lib/comp/compound/General/ISW/ISW_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/ISW/ISW_lbl.txt +++ mtt/lib/comp/compound/General/ISW/ISW_lbl.txt @@ -0,0 +1,42 @@ +%SUMMARY ISW: Switched I component +%DESCRIPTION ISW acts as an I component except when the -s -c option is used. +%DESCRIPTION When the -s -c option is used: +%DESCRIPTION The component label is used as a variable name (eg Name) +%DESCRIPTION In the ode simulation: +%DESCRIPTION Name = 1 implies normal I (closed switch) +%DESCRIPTION Name = 0 implies state=0 (open switch) +%DESCRIPTION Name = -1 implies state>0 (Diode) + +%ALIAS out in +%ALIAS $1 lin +%ALIAS $1 flow,i_s + + + +%% Label file for system ISW (ISW_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/07/26 12:57:00 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1997/06/03 15:26:09 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type I + MTT_SWITCH lin flow,i_s + +% Component type SS + [in] SS external,external ADDED mtt/lib/comp/compound/General/IX/IX_abg.fig Index: mtt/lib/comp/compound/General/IX/IX_abg.fig ================================================================== --- mtt/lib/comp/compound/General/IX/IX_abg.fig +++ mtt/lib/comp/compound/General/IX/IX_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1800 2700 3150 2700 2925 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2700 4950 2700 4725 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 1125 3375 2475 3600 2250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 5850 3825 5850 450 225 450 225 3825 5850 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 2475 3150 2475 +4 1 -1 0 0 22 20 0.0000 4 225 150 3375 2835 1\001 +4 1 -1 0 0 22 20 0.0000 4 240 240 5355 2790 I:i\001 +4 2 4 0 0 22 20 0.0000 4 315 870 1665 2790 SS:[in]\001 +4 1 4 0 0 22 20 0.0000 4 315 810 3375 990 SS:[X]\001 ADDED mtt/lib/comp/compound/General/IX/IX_lbl.txt Index: mtt/lib/comp/compound/General/IX/IX_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/IX/IX_lbl.txt +++ mtt/lib/comp/compound/General/IX/IX_lbl.txt @@ -0,0 +1,34 @@ +#SUMMARY IX I component with state i/o +#DESCRIPTION Port [X]: state i/o + +## Label file for system IX (IX_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.3 2000/08/29 15:26:38 peterg +# ## New SS format +# ## +# ## Revision 1.2 1998/04/14 17:08:50 peterg +# ## Input only on SS +# ## +# ## Revision 1.1 1998/04/12 15:20:11 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + +# Component type I + i $1 $1 + +# Component type SS + [in] SS internal,external + [X] SS internal,external ADDED mtt/lib/comp/compound/General/Lf/Lf_abg.fig Index: mtt/lib/comp/compound/General/Lf/Lf_abg.fig ================================================================== --- mtt/lib/comp/compound/General/Lf/Lf_abg.fig +++ mtt/lib/comp/compound/General/Lf/Lf_abg.fig @@ -0,0 +1,34 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 2925 5400 2925 5175 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 2925 7650 2925 7425 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7875 3150 7875 4500 8100 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 4500 3825 3150 4050 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7875 2700 7875 1350 8100 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 1350 3825 2700 4050 2475 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 8550 5175 3150 5175 3150 675 8550 675 8550 5175 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 7650 2700 8100 2700 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3600 1350 4050 1350 +4 1 4 100 0 18 18 0.0000 4 270 825 3825 4950 SS:[n]\001 +4 1 4 100 0 18 18 0.0000 4 270 840 7875 4950 SS:[p]\001 +4 1 0 100 0 18 18 0.0000 4 195 150 3825 3015 0\001 +4 1 0 100 0 18 18 0.0000 4 210 405 5850 3015 AE\001 +4 1 0 100 0 18 18 0.0000 4 195 150 7875 3015 1\001 +4 1 4 100 0 18 18 0.0000 4 270 1095 7875 1125 SS:[out]\001 +4 1 4 100 0 18 18 0.0000 4 270 900 3825 1125 SS:[in]\001 ADDED mtt/lib/comp/compound/General/Lf/Lf_lbl.txt Index: mtt/lib/comp/compound/General/Lf/Lf_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/Lf/Lf_lbl.txt +++ mtt/lib/comp/compound/General/Lf/Lf_lbl.txt @@ -0,0 +1,51 @@ +#SUMMARY Lf: loop gain (flow) +#DESCRIPTION Loop gain transfer function is formed by breaking loop + +## System Lf, representation lbl, language txt +## File Lf_lbl.txt +## Generated by MTT on Mon Dec 5 09:38:43 EST 2005 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in +#ALIAS n n +#ALIAS out out +#ALIAS p p + +## Argument aliases + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type AE (anonymous => default parameters) + # AE + +## Component type SS + [in] SS external,external + [n] SS external,external + [out] SS external,external + [p] SS external,external + ADDED mtt/lib/comp/compound/General/RD/RD_abg.fig Index: mtt/lib/comp/compound/General/RD/RD_abg.fig ================================================================== --- mtt/lib/comp/compound/General/RD/RD_abg.fig +++ mtt/lib/comp/compound/General/RD/RD_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 2700 3150 2700 2250 2925 2475 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 2925 3375 3825 3375 3600 3600 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 1575 3375 2475 3375 2250 3600 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 1350 3150 1350 2250 1575 2475 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 225 3375 1125 3375 900 3600 +4 1 0 100 0 18 18 0.0000 4 210 510 1350 2115 Df:f\001 +4 1 0 100 0 18 18 0.0000 4 210 630 2700 2115 De:e\001 +4 0 0 100 0 18 18 0.0000 4 210 405 3960 3465 R:r\001 +4 2 4 100 0 18 18 0.0000 4 270 900 135 3465 SS:[in]\001 +4 1 0 100 0 18 18 0.0000 4 195 150 1350 3465 1\001 +4 1 0 100 0 18 18 0.0000 4 195 150 2700 3465 0\001 ADDED mtt/lib/comp/compound/General/RD/RD_lbl.txt Index: mtt/lib/comp/compound/General/RD/RD_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/RD/RD_lbl.txt +++ mtt/lib/comp/compound/General/RD/RD_lbl.txt @@ -0,0 +1,56 @@ +#SUMMARY RD +#DESCRIPTION Detailed description here + +## System RD, representation lbl, language txt +## File RD_lbl.txt +## Generated by MTT on Thu Apr 24 10:30:13 EST 2014 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in + +## Argument aliases +#ALIAS $1 flow,r + +## cr aliases +#ALIAS $a1 lin + + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type De + e SS external + +## Component type Df + f SS external + +## Component type R + r lin flow,r + +## Component type SS + [in] SS external,external + ADDED mtt/lib/comp/compound/General/Se/Se_abg.fig Index: mtt/lib/comp/compound/General/Se/Se_abg.fig ================================================================== --- mtt/lib/comp/compound/General/Se/Se_abg.fig +++ mtt/lib/comp/compound/General/Se/Se_abg.fig @@ -0,0 +1,17 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2700 3150 2700 2925 2925 +2 4 0 2 31 7 99 0 -1 0.000 0 0 7 0 0 5 + 4950 3600 4950 1800 675 1800 675 3600 4950 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3150 2475 3150 2925 +4 2 0 100 0 18 20 0.0000 4 225 675 1710 2790 SS:u\001 +4 0 4 100 0 18 20 0.0000 4 285 1170 3330 2790 SS:[out]\001 ADDED mtt/lib/comp/compound/General/Se/Se_lbl.txt Index: mtt/lib/comp/compound/General/Se/Se_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/Se/Se_lbl.txt +++ mtt/lib/comp/compound/General/Se/Se_lbl.txt @@ -0,0 +1,35 @@ +%% Label file for system Se (Se_lbl.txt) +%SUMMARY Se Simple effort source +%DESCRIPTION Simple effort source constructed from SS with fixed causality + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1999/03/12 04:04:27 peterg +% %% Single argument - the effort value e_s +% %% +% %% Revision 1.1 1999/03/03 21:55:46 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS out|in out + +% Argument aliases +%ALIAS $1 e_s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [out] SS external,external + u SS e_s,internal ADDED mtt/lib/comp/compound/General/Sf/Sf_abg.fig Index: mtt/lib/comp/compound/General/Sf/Sf_abg.fig ================================================================== --- mtt/lib/comp/compound/General/Sf/Sf_abg.fig +++ mtt/lib/comp/compound/General/Sf/Sf_abg.fig @@ -0,0 +1,17 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2700 3150 2700 2925 2925 +2 4 0 2 31 7 99 0 -1 0.000 0 0 7 0 0 5 + 4950 3600 4950 1800 675 1800 675 3600 4950 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1800 2475 1800 2925 +4 2 0 100 0 18 20 0.0000 4 225 675 1710 2790 SS:u\001 +4 0 4 100 0 18 20 0.0000 4 285 1170 3330 2790 SS:[out]\001 ADDED mtt/lib/comp/compound/General/Sf/Sf_lbl.txt Index: mtt/lib/comp/compound/General/Sf/Sf_lbl.txt ================================================================== --- mtt/lib/comp/compound/General/Sf/Sf_lbl.txt +++ mtt/lib/comp/compound/General/Sf/Sf_lbl.txt @@ -0,0 +1,33 @@ +%% Label file for system Sf (Sf_lbl.txt) +%SUMMARY Sf Simple flow source +%DESCRIPTION Simple flow source constructed from SS with fixed causality + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1999/03/12 04:03:09 peterg +% %% Single argument - the value of the flow +% %% +% %% Revision 1.1 1999/03/03 21:50:15 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS out|in out + +% Argument aliases +%ALIAS $1 f_s +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [out] SS external,external + u SS internal,f_s ADDED mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_abg.fig Index: mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_abg.fig ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_abg.fig +++ mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_abg.fig @@ -0,0 +1,68 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 2250 3825 2250 3600 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 2250 5400 2250 5175 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5850 2250 6975 2250 6750 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 2025 4050 900 4275 1125 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6975 2025 6975 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 2475 4950 3150 5175 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4500 3825 4500 3600 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5850 4500 6975 4500 6750 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4500 5400 4500 5175 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 3600 4050 4275 4275 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 4275 3825 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6975 4275 6975 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 2025 3825 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 4725 5625 5850 5850 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5850 6075 6975 6075 6750 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5400 6075 4275 6075 4500 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 5850 5400 6300 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 675 225 675 6975 9225 6975 9225 225 675 225 +4 2 4 100 0 18 20 0.0000 4 360 1605 2655 4590 SS:[a_in]\001 +4 1 0 100 0 18 20 0.0000 4 270 195 4050 2340 1\001 +4 1 0 100 0 18 20 0.0000 4 270 195 5625 2340 0\001 +4 1 0 100 0 18 20 0.0000 4 285 750 4050 765 I:dm\001 +4 0 4 100 0 18 20 0.0000 4 360 1860 7110 2340 SS:[y_out]\001 +4 2 4 100 0 18 20 0.0000 4 360 1620 2565 2340 SS:[y_in]\001 +4 0 4 100 0 18 20 0.0000 4 360 1845 7065 4590 SS:[a_out]\001 +4 1 0 100 0 18 20 0.0000 4 270 195 4050 4590 1\001 +4 1 0 100 0 18 20 0.0000 4 270 195 5625 4590 0\001 +4 1 0 100 0 18 20 0.0000 4 285 975 4815 3510 TF:dz\001 +4 1 1 101 0 32 20 0.0000 4 255 270 4635 4095 W\001 +4 1 1 101 0 32 20 0.0000 4 255 945 6345 4950 W+DW\001 +4 1 1 101 0 32 20 0.0000 4 255 270 4680 4950 W\001 +4 1 1 101 0 32 20 0.0000 4 255 270 3150 4950 W\001 +4 1 1 101 0 18 20 0.0000 4 210 210 3150 2610 v\001 +4 1 1 101 0 18 20 0.0000 4 210 210 4725 2610 v\001 +4 1 1 101 0 18 20 0.0000 4 210 825 6255 2610 v+ v\001 +4 1 1 101 0 32 20 0.0000 4 255 225 6390 2610 D\001 +4 1 1 101 0 32 20 0.0000 4 255 225 5400 3015 D\001 +4 1 1 101 0 18 20 0.0000 4 210 210 5625 3015 v\001 +4 1 0 100 0 18 20 0.0000 4 270 195 5625 6210 1\001 +4 1 0 100 0 18 20 0.0000 4 285 810 7425 6165 C:dk\001 +4 1 0 100 0 18 20 0.0000 4 285 735 3915 6165 R:dr\001 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_desc.tex @@ -0,0 +1,48 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system BernoulliEuler (BernoulliEuler_desc.tex) +% Generated by MTT on Mon Apr 19 06:43:36 BST 1999. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{BernoulliEuler} is + displayed in Figure \Ref{fig:BernoulliEuler_abg.ps} and its label + file is listed in Section \Ref{sec:BernoulliEuler_lbl}. + The subsystems are listed in Section \Ref{sec:BernoulliEuler_sub}. + +This component represents one lump of a lumped model of a uniform beam +modelled using the the Bernoulli-Euler assumptions: +\begin{enumerate} +\item The shear forces can be neglected. +\item Rotational inertia can be neglected. +\end{enumerate} + +\begin{itemize} +\item The \textbf{I} component represents the inertial properties of + the lump in the perpendicular direction. In particular the velocity + of the lump $v$ is: + \begin{equation} + \dot v = \frac{\Delta f}{\Delta m} + \end{equation} + where $\Delta m$ is the lump mass and $\Delta f$ is the net vertical + force. +\item The \textbf{C} component represents the angular stiffness of the + lump. In particular the torque acting on the lump is: + \begin{equation} + \dot \tau = \Delta k \Delta \Omega + \end{equation} + where $\Delta k$ is the lump (angular) stiffness and $\Delta \Omega$ + is the net angular velocity. +\item The \textbf{TF} component represents the relation between the + angular domains + \begin{equation} + \begin{align} + \tau &= \Delta x \Delta f \\ + \Delta v &= \Delta x \Omega + \end{align} + \end{equation} +\end{itemize} ADDED mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_lbl.txt @@ -0,0 +1,65 @@ +%% Label file for system BernoulliEuler (BernoulliEuler_lbl.txt) +%SUMMARY BernoulliEuler +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 1999/10/13 07:01:58 peterg +% %% Added aliases: +% %% a_in theta_in +% %% a_out theta_out +% %% +% %% Revision 1.3 1999/09/02 03:07:16 peterg +% %% r_d --> dr +% %% +% %% Revision 1.2 1999/05/17 21:27:05 peterg +% %% Added damping +% %% +% %% Revision 1.1 1999/05/16 07:12:40 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS theta_in a_in +%ALIAS theta_out a_out +%ALIAS in y_in,a_in +%ALIAS out y_out,a_out + +% Argument aliases +%ALIAS $1 dk +%ALIAS $2 dm +%ALIAS $3 dz +%ALIAS $4 dr + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type I + dm lin flow,dm + +% Component type C + dk lin state,dk + +% Component type R + dr lin flow,dr + +% Component type SS + [y_in] SS external,external + [y_out] SS external,external + [a_in] SS external,external + [a_out] SS external,external + +% Component type TF + dz lin effort,dz + + + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_abg.fig Index: mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_abg.fig ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_abg.fig +++ mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_abg.fig @@ -0,0 +1,67 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 2250 3825 2250 3600 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 2250 5400 2250 5175 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5850 2250 6975 2250 6750 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 2025 4050 900 4275 1125 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6975 2025 6975 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 2475 4950 3150 5175 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4500 3825 4500 3600 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5850 4500 6975 4500 6750 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4500 5400 4500 5175 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 4725 5625 5850 5850 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 3600 4050 4275 4275 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 4275 3825 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6975 4275 6975 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 2025 3825 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 6075 5400 6075 5175 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5850 6075 6975 6075 6750 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 6300 5625 7425 5850 7200 +4 2 4 100 0 18 20 0.0000 4 285 1860 2655 4590 SS:[theta_in]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 4050 2340 1\001 +4 1 0 100 0 18 20 0.0000 4 210 165 5625 2340 0\001 +4 1 0 100 0 18 20 0.0000 4 225 645 4050 765 I:dm\001 +4 0 4 100 0 18 20 0.0000 4 285 1500 7110 2340 SS:[y_out]\001 +4 2 4 100 0 18 20 0.0000 4 285 1305 2565 2340 SS:[y_in]\001 +4 0 4 100 0 18 20 0.0000 4 285 2055 7065 4590 SS:[theta_out]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 4050 4590 1\001 +4 1 0 100 0 18 20 0.0000 4 210 165 5625 4590 0\001 +4 1 0 100 0 18 20 0.0000 4 225 795 4815 3510 TF:dz\001 +4 1 1 101 0 32 20 0.0000 4 210 225 4635 4095 W\001 +4 1 1 101 0 32 20 0.0000 4 210 795 6345 4950 W+DW\001 +4 1 1 101 0 32 20 0.0000 4 210 225 4680 4950 W\001 +4 1 1 101 0 32 20 0.0000 4 210 225 3150 4950 W\001 +4 1 1 101 0 18 20 0.0000 4 165 165 3150 2610 v\001 +4 1 1 101 0 18 20 0.0000 4 165 165 4725 2610 v\001 +4 1 1 101 0 18 20 0.0000 4 165 690 6255 2610 v+ v\001 +4 1 1 101 0 32 20 0.0000 4 210 180 6390 2610 D\001 +4 1 1 101 0 32 20 0.0000 4 210 180 5400 3015 D\001 +4 1 1 101 0 18 20 0.0000 4 165 165 5625 3015 v\001 +4 1 0 100 0 18 20 0.0000 4 210 165 5625 6165 1\001 +4 1 0 100 0 18 20 0.0000 4 225 660 7380 6165 C:dk\001 +4 2 4 100 0 18 20 0.0000 4 300 1500 4230 6165 SS:[patch]\001 +4 1 0 100 0 18 20 0.0000 4 285 780 5625 7785 R:dr\001 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_desc.tex @@ -0,0 +1,22 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system pBernoulliEuler (pBernoulliEuler_desc.tex) +% Generated by MTT on Mon Apr 19 06:43:36 BST 1999. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{pBernoulliEuler} is + displayed in Figure \Ref{fig:pBernoulliEuler_abg.ps} and its label + file is listed in Section \Ref{sec:pBernoulliEuler_lbl}. + The subsystems are listed in Section \Ref{sec:pBernoulliEuler_sub}. + +This is identical to component \textbf{pBernoulliEuler} except that a +\emph{piezoelectric patch} is included. This provides: +\begin{enumerate} +\item an moment-generating \emph{actuator} and +\item a curvature \emph{sensor}. +\end{enumerate} ADDED mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_lbl.txt @@ -0,0 +1,60 @@ +%% Label file for system pBernoulliEuler (pBernoulliEuler_lbl.txt) +%SUMMARY pBernoulliEuler +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1999/05/17 21:27:39 peterg +% %% Added damping +% %% +% %% Revision 1.2 1999/05/16 21:31:48 peterg +% %% Renamed SS to patch +% %% +% %% Revision 1.1 1999/05/16 21:08:13 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in y_in,theta_in +%ALIAS out y_out,theta_out +%ALIAS torque patch +%ALIAS curvature patch + + +% Argument aliases +%ALIAS $1 dk +%ALIAS $2 dm +%ALIAS $3 dz +%ALIAS $4 dr + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type I + dm lin flow,dm + +% Component type C + dk lin state,dk + +% Component type R + dr lin flow,dr + +% Component type SS + [y_in] SS external,external + [y_out] SS external,external + [theta_in] SS external,external + [theta_out] SS external,external + [patch] SS external,external + +% Component type TF + dz lin effort,dz + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_abg.fig Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_abg.fig ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_abg.fig +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_abg.fig @@ -0,0 +1,22 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2027 2252 3377 2252 3152 2477 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3827 2252 5177 2252 4952 2477 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 2026 3601 676 3826 901 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 2250 7200 2250 6975 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3375 2025 3375 2475 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 3375 9450 45 225 45 225 3375 9450 3375 +4 1 -1 0 0 0 20 0.0000 4 195 135 3602 2387 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 90 3601 541 I\001 +4 1 -1 0 0 0 20 0.0000 4 195 375 5535 2340 AF\001 +4 1 24 0 0 0 20 0.0000 4 195 1050 1440 2340 SS:Force\001 +4 0 24 0 0 0 20 0.0000 4 240 2040 7290 2340 SS:[Acceleration]\001 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_lbl.txt @@ -0,0 +1,33 @@ +%SUMMARY ACCEL: Provides a acceleration (useful for simulating gravity. +%DESCRIPTION Useful for simulating gravity as explaned in Section 10.9 +%DESCRIPTION of "Metamodelling". + +%ALIAS in|out Acceleration + +%% Label file for system ACCEL (ACCEL_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/07/27 06:50:41 peterg +% %% *** empty log message *** +% %% +% %% Revision 1.2 1998/07/27 06:49:57 peterg +% %% Added blank line at end +% %% +% %% Revision 1.1 1998/07/27 06:47:32 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +% SS components + Force SS external,internal + [Acceleration] SS external,external + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_abg.fig Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_abg.fig ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_abg.fig +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_abg.fig @@ -0,0 +1,121 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4951 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 I:J\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTF:th\001 +4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000 4 255 1950 2971 1216 SS:[xTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 1950 2971 9361 SS:[xTip_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 1950 8372 1217 SS:[yTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 1950 8417 9362 SS:[yTip_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 2700 5671 1216 SS:[angularTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 2700 5671 9361 SS:[angularTip_b]\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_desc.tex @@ -0,0 +1,17 @@ +% Verbal description for system ROD (ROD_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ROD} is + displayed in Figure \Ref{ROD_abg} and its label + file is listed in Section \Ref{sec:ROD_lbl}. + The subsystems are listed in Section \Ref{sec:ROD_sub}. + +{\bf ROD} is essentially as described in Figure 10.2 of +``Metamodelling''. ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_lbl.txt @@ -0,0 +1,71 @@ +%SUMMARY ROD: rigid rod in two dimensions +%DESCRIPTION See Section 10.2 of "Metamodelling" + +%ALIAS $1 l_a # length from end a to mass centre +%ALIAS $2 l_b # length from end b to mass centre +%ALIAS $3 j_m # inertia about mass centre +%ALIAS $4 m # mass + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS x_a xTip_a # Force/velocity at tip a in x direction +%ALIAS y_a yTip_a # Force/velocity at tip a in y direction +%ALIAS alpha_a angularTip_a # Torque/angular velocity at tip a + +%ALIAS x_b xTip_b # Force/velocity at tip b in x direction +%ALIAS y_b yTip_b # Force/velocity at tip b in y direction +%ALIAS alpha_b angularTip_b # Torque/angular velocity at tip b + +%ALIAS INTF General/INTF # The flow integration component. + +%% Label file for system ROD (ROD_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 1998/07/27 10:51:20 peterg +% %% Aliased INTF as well. +% %% +% %% Revision 1.3 1998/07/27 10:49:10 peterg +% %% Major revision to include aliases etc +% %% +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,j_m +m_x lin flow,m +m_y lin flow,m + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,l_a +s2 lsin flow,l_b +c1 lcos flow,l_a +c2 lcos flow,l_b + +% Component type SS + [angularTip_a] SS external,external + [angularTip_b] SS external,external + [xTip_a] SS external,external + [xTip_b] SS external,external + [yTip_a] SS external,external + [yTip_b] SS external,external + + + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_abg.fig Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_abg.fig ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_abg.fig +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_abg.fig @@ -0,0 +1,124 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4951 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 4950 1800 3375 1800 3600 +4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 I:J\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTF:th\001 +4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 2971 1216 SS:[x_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 2971 9361 SS:[x_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 8372 1217 SS:[y_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 8417 9362 SS:[y_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 1485 5671 1216 SS:[alpha_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 1485 5671 9361 SS:[alpha_b]\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 +4 1 4 0 0 0 20 0.0000 4 255 1215 1756 3286 SS:[alpha]\001 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_desc.tex @@ -0,0 +1,22 @@ +% Verbal description for system RODa (RODa_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/08/15 09:41:19 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{RODa} is + displayed in Figure \Ref{RODa_abg} and its label + file is listed in Section \Ref{sec:RODa_lbl}. + The subsystems are listed in Section \Ref{sec:RODa_sub}. + +{\bf RODa} is essentially as described in Figure 10.2 of +``Metamodelling''. It has an additional port ``[angle]'' to provide +access to the rod angle. + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_lbl.txt @@ -0,0 +1,52 @@ +%SUMMARY RODa: rigid rod in two dimensions - angle port. +%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a +%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b +%DESCRIPTION Port [x_a]: x force/velocity - end a +%DESCRIPTION Port [x_b]: x force/velocity - end b +%DESCRIPTION Port [y_a]: y force/velocity - end a +%DESCRIPTION Port [y_b]: y force/velocity - end b +%DESCRIPTION Port [alpha]: rod angle +%DESCRIPTION +%DESCRIPTION Parameter 1: length from end 1 to mass centre +%DESCRIPTION Parameter 2: length from end 2 to mass centre +%DESCRIPTION Parameter 3: inertia about mass centre +%DESCRIPTION Parameter 4: mass +%DESCRIPTION See Section 10.2 of "Metamodelling" + + +%% Label file for system RODa (RODa_lbl.txt) + + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,$3 +m_x lin flow,$4 +m_y lin flow,$4 + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,$1 +s2 lsin flow,$2 +c1 lcos flow,$1 +c2 lcos flow,$2 + + + + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_abg.fig Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_abg.fig ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_abg.fig +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_abg.fig @@ -0,0 +1,86 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 4905 4500 5805 4275 5805 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3376 7379 4501 6479 4276 6479 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1801 7604 2926 7604 2701 7829 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3376 7604 4501 7604 4276 7829 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 6030 4950 4905 4950 5130 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4950 7155 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 6255 4950 7425 4950 7155 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1800 4680 2925 4680 2700 4905 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1800 6165 2925 6165 2700 6390 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 4680 4500 4680 4275 4905 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5895 4680 7020 4680 6795 4905 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 6255 7200 4905 7200 5130 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 5805 7200 7380 7200 7155 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 7605 6975 7605 6750 7830 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7425 4680 8550 4680 8325 4905 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7425 7605 8550 7605 8325 7830 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 6030 4950 6030 4815 5895 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 6255 4950 6255 4815 6390 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 2554 3028 1317 885 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 2554 3028 4698 1791 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 2566 3016 2566 541 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 2566 3016 5041 3016 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9675 8550 9675 225 225 225 225 8550 9675 8550 +4 0 1 1 0 0 20 0.0000 4 135 135 5220 3105 x\001 +4 0 1 1 0 0 20 0.0000 4 195 135 2700 585 y\001 +4 0 1 1 0 0 20 0.0000 4 195 210 1485 855 Y\001 +4 0 1 1 0 0 20 0.0000 4 195 210 4590 1710 X\001 +4 0 1 1 0 32 20 0.0000 4 195 150 3420 2880 q\001 +4 0 -1 0 0 2 20 0.0000 4 195 135 3060 4770 1\001 +4 0 -1 0 0 2 20 0.0000 4 195 135 3060 7695 1\001 +4 0 -1 0 0 2 20 0.0000 4 195 135 3015 6255 0\001 +4 1 4 0 0 2 16 0.0000 4 210 390 4635 4455 [in]\001 +4 1 4 0 0 2 16 0.0000 4 210 390 4635 7965 [in]\001 +4 0 -1 0 0 2 20 0.0000 4 195 135 7155 4770 0\001 +4 0 -1 0 0 2 20 0.0000 4 195 135 7110 7740 0\001 +4 1 -1 0 0 2 20 0.0000 4 195 1260 5175 4770 EMTF:xX\001 +4 1 -1 0 0 2 20 0.0000 4 195 1260 5175 5850 EMTF:xY\001 +4 1 -1 0 0 2 20 0.0000 4 255 1260 5220 6615 EMTF:yX\001 +4 1 -1 0 0 2 20 0.0000 4 255 1260 5175 7695 EMTF:yY\001 +4 1 4 0 0 2 16 0.0000 4 210 525 5760 4455 [out]\001 +4 1 4 0 0 2 16 0.0000 4 210 525 5760 7965 [out]\001 +4 1 4 0 0 2 16 0.0000 4 210 390 4635 6795 [in]\001 +4 1 4 0 0 2 16 0.0000 4 210 390 4545 5625 [in]\001 +4 1 4 0 0 2 16 0.0000 4 210 525 5940 5625 [out]\001 +4 1 4 0 0 2 16 0.0000 4 210 525 5985 6795 [out]\001 +4 0 4 0 0 2 16 0.0000 4 210 630 5040 7335 [mod]\001 +4 0 4 0 0 2 16 0.0000 4 210 630 5085 6075 [mod]\001 +4 0 4 0 0 2 16 0.0000 4 210 630 5085 6300 [mod]\001 +4 0 4 0 0 2 16 0.0000 4 210 630 5040 5040 [mod]\001 +4 2 4 0 0 2 20 0.0000 4 240 1215 1710 6255 SS:[theta]\001 +4 2 4 0 0 2 20 0.0000 4 240 795 1665 4770 SS:[X]\001 +4 2 4 0 0 2 20 0.0000 4 240 795 1710 7695 SS:[Y]\001 +4 0 4 0 0 2 20 0.0000 4 240 720 8640 4770 SS:[x]\001 +4 0 4 0 0 2 20 0.0000 4 255 720 8685 7695 SS:[y]\001 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_desc.tex @@ -0,0 +1,20 @@ +% Verbal description for system ROT2 (ROT2_desc.tex) +% Generated by MTT on Fri Aug 15 21:09:17 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ROT2} is + displayed in Figure \Ref{ROT2_abg} and its label + file is listed in Section \Ref{sec:ROT2_lbl}. + The subsystems are listed in Section \Ref{sec:ROT2_sub}. + +\textbf{ROT2} implements a 2D rotational {\em transformation\/} in +terms of a set of {\em transformers}. A flow expressed in the $XY$ +coordinates of Figure \Ref{ROT2_abg} is transformed by \textbf{ROT2} +into the coordinates of $xy$. The corresponding (energy conserving) +effort transformation is implied by \textbf{ROT2}. ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_lbl.txt @@ -0,0 +1,31 @@ +%SUMMARY ROT2: 2D rotational transformer +%DESCRIPTION {ROT2} implements a 2D rotational transformation in terms +%DESCRIPTION of a set of transformers. A flow expressed in the X-Y +%DESCRIPTION coordinates is transformed by ROT2 into the coordinates +%DESCRIPTION of x-y. The corresponding (energy conserving) effort +%DESCRIPTION transformation is implied. +%DESCRIPTION Ports X and Y correspond to the old coordinate system +%DESCRIPTION Ports x and y correspond to the new coordinate system +%DESCRIPTION Port theta is the angle of XY with respect to xy. + +%% Label file for system ROT2 (ROT2_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type EMTF + xX lcos flow,1 + xY lsin flow,1 + yX lsin flow,-1 + yY lcos flow,1 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_desc.tex @@ -0,0 +1,17 @@ +% Verbal description for system ROD (ROD_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ROD} is + displayed in Figure \Ref{ROD_abg} and its label + file is listed in Section \Ref{sec:ROD_lbl}. + The subsystems are listed in Section \Ref{sec:ROD_sub}. + +{\bf ROD} is essentially as described in Figure 10.2 of +``Metamodelling''. ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_lbl.txt @@ -0,0 +1,71 @@ +%SUMMARY ROD: rigid rod in two dimensions +%DESCRIPTION See Section 10.2 of "Metamodelling" + +%ALIAS $1 l_a # length from end a to mass centre +%ALIAS $2 l_b # length from end b to mass centre +%ALIAS $3 j_m # inertia about mass centre +%ALIAS $4 m # mass + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS x_a xTip_a # Force/velocity at tip a in x direction +%ALIAS y_a yTip_a # Force/velocity at tip a in y direction +%ALIAS alpha_a angularTip_a # Torque/angular velocity at tip a + +%ALIAS x_b xTip_b # Force/velocity at tip b in x direction +%ALIAS y_b yTip_b # Force/velocity at tip b in y direction +%ALIAS alpha_b angularTip_b # Torque/angular velocity at tip b + +%ALIAS INTF General/INTF # The flow integration component. + +%% Label file for system ROD (ROD_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 1998/07/27 10:51:20 peterg +% %% Aliased INTF as well. +% %% +% %% Revision 1.3 1998/07/27 10:49:10 peterg +% %% Major revision to include aliases etc +% %% +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,j_m +m_x lin flow,m +m_y lin flow,m + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,l_a +s2 lsin flow,l_b +c1 lcos flow,l_a +c2 lcos flow,l_b + +% Component type SS + [angularTip_a] SS external,external + [angularTip_b] SS external,external + [xTip_a] SS external,external + [xTip_b] SS external,external + [yTip_a] SS external,external + [yTip_b] SS external,external + + + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_abg.fig Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_abg.fig ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_abg.fig +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_abg.fig @@ -0,0 +1,126 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4951 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8550 5400 9225 6075 8955 6075 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8685 5265 8415 5535 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 315 6933 5268 I:J\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000000 4 270 735 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000000 4 240 735 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1170 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1170 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000000 4 210 150 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 570 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000000 4 210 990 4681 5266 INTF:th\001 +4 1 1 1 0 0 20 0.0000000 4 210 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000000 4 135 195 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000000 4 210 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000000 4 195 330 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1485 2971 1216 SS:[xTip_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1500 2971 9361 SS:[xTip_b]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1485 8372 1217 SS:[yTip_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1500 8417 9362 SS:[yTip_b]\001 +4 1 4 0 0 0 20 0.0000000 4 270 2250 5671 1216 SS:[angularTip_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 2265 5671 9361 SS:[angularTip_b]\001 +4 1 1 1 0 0 20 0.0000000 4 270 630 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000000 4 240 1470 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000000 4 270 645 1350 9855 Tip b\001 +4 1 -1 0 0 0 20 0.0000000 4 270 810 9360 6345 SS:mg\001 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_desc.tex @@ -0,0 +1,20 @@ +% Verbal description for system gROD (gROD_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/08/15 09:41:19 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{gROD} is + displayed in Figure \Ref{gROD_abg} and its label + file is listed in Section \Ref{sec:gROD_lbl}. + The subsystems are listed in Section \Ref{sec:gROD_sub}. + +{\bf gROD} is essentially as described in Figure 10.2 of +``Metamodelling''. ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_lbl.txt @@ -0,0 +1,86 @@ +%SUMMARY gROD: rigid rod in two dimensions - with gravity +%DESCRIPTION See Section 10.2 of "Metamodelling" +%DESCRIPTION Gravity term added at centre + +%ALIAS $1 l_a # length from end a to mass centre +%ALIAS $2 l_b # length from end b to mass centre +%ALIAS $3 j_m # inertia about mass centre +%ALIAS $4 m # mass +%ALIAS $5 g # gravity + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS x_a xTip_a # Force/velocity at tip a in x direction +%ALIAS y_a yTip_a # Force/velocity at tip a in y direction +%ALIAS alpha_a|a_a angularTip_a # Torque/angular velocity at tip a + +%ALIAS x_b xTip_b # Force/velocity at tip b in x direction +%ALIAS y_b yTip_b # Force/velocity at tip b in y direction +%ALIAS alpha_b|a_b angularTip_b # Torque/angular velocity at tip b + +%ALIAS INTF General/INTF # The flow integration component. + +%% Label file for system gROD (gROD_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/11/25 13:55:42 peterg +% %% Added missig attribute field m*g,internal +% %% +% %% Revision 1.1 1998/11/25 10:48:34 peterg +% %% Initial revision +% %% +% %% Revision 1.5 1998/07/27 12:27:27 peterg +% %% Added vector port aliases +% %% +% %% Revision 1.4 1998/07/27 10:51:20 peterg +% %% Aliased INTF as well. +% %% +% %% Revision 1.3 1998/07/27 10:49:10 peterg +% %% Major revision to include aliases etc +% %% +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,j_m +m_x lin flow,m +m_y lin flow,m + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,l_a +s2 lsin flow,l_b +c1 lcos flow,l_a +c2 lcos flow,l_b + +% Component type SS + mg SS m*g,internal + [angularTip_a] SS external,external + [angularTip_b] SS external,external + [xTip_a] SS external,external + [xTip_b] SS external,external + [yTip_a] SS external,external + [yTip_b] SS external,external + + + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_desc.tex @@ -0,0 +1,17 @@ +% Verbal description for system ROD (ROD_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ROD} is + displayed in Figure \Ref{ROD_abg} and its label + file is listed in Section \Ref{sec:ROD_lbl}. + The subsystems are listed in Section \Ref{sec:ROD_sub}. + +{\bf ROD} is essentially as described in Figure 10.2 of +``Metamodelling''. ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_lbl.txt @@ -0,0 +1,71 @@ +%SUMMARY ROD: rigid rod in two dimensions +%DESCRIPTION See Section 10.2 of "Metamodelling" + +%ALIAS $1 l_a # length from end a to mass centre +%ALIAS $2 l_b # length from end b to mass centre +%ALIAS $3 j_m # inertia about mass centre +%ALIAS $4 m # mass + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS x_a xTip_a # Force/velocity at tip a in x direction +%ALIAS y_a yTip_a # Force/velocity at tip a in y direction +%ALIAS alpha_a angularTip_a # Torque/angular velocity at tip a + +%ALIAS x_b xTip_b # Force/velocity at tip b in x direction +%ALIAS y_b yTip_b # Force/velocity at tip b in y direction +%ALIAS alpha_b angularTip_b # Torque/angular velocity at tip b + +%ALIAS INTF General/INTF # The flow integration component. + +%% Label file for system ROD (ROD_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 1998/07/27 10:51:20 peterg +% %% Aliased INTF as well. +% %% +% %% Revision 1.3 1998/07/27 10:49:10 peterg +% %% Major revision to include aliases etc +% %% +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,j_m +m_x lin flow,m +m_y lin flow,m + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,l_a +s2 lsin flow,l_b +c1 lcos flow,l_a +c2 lcos flow,l_b + +% Component type SS + [angularTip_a] SS external,external + [angularTip_b] SS external,external + [xTip_a] SS external,external + [xTip_b] SS external,external + [yTip_a] SS external,external + [yTip_b] SS external,external + + + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gROD_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gROD_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gROD_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gROD_lbl.txt @@ -0,0 +1,86 @@ +%SUMMARY gROD: rigid rod in two dimensions - with gravity +%DESCRIPTION See Section 10.2 of "Metamodelling" +%DESCRIPTION Gravity term added at centre + +%ALIAS $1 l_a # length from end a to mass centre +%ALIAS $2 l_b # length from end b to mass centre +%ALIAS $3 j_m # inertia about mass centre +%ALIAS $4 m # mass +%ALIAS $5 g # gravity + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS x_a xTip_a # Force/velocity at tip a in x direction +%ALIAS y_a yTip_a # Force/velocity at tip a in y direction +%ALIAS alpha_a|a_a angularTip_a # Torque/angular velocity at tip a + +%ALIAS x_b xTip_b # Force/velocity at tip b in x direction +%ALIAS y_b yTip_b # Force/velocity at tip b in y direction +%ALIAS alpha_b|a_b angularTip_b # Torque/angular velocity at tip b + +%ALIAS INTF General/INTF # The flow integration component. + +%% Label file for system gROD (gROD_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/11/25 13:55:42 peterg +% %% Added missig attribute field m*g,internal +% %% +% %% Revision 1.1 1998/11/25 10:48:34 peterg +% %% Initial revision +% %% +% %% Revision 1.5 1998/07/27 12:27:27 peterg +% %% Added vector port aliases +% %% +% %% Revision 1.4 1998/07/27 10:51:20 peterg +% %% Aliased INTF as well. +% %% +% %% Revision 1.3 1998/07/27 10:49:10 peterg +% %% Major revision to include aliases etc +% %% +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,j_m +m_x lin flow,m +m_y lin flow,m + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,l_a +s2 lsin flow,l_b +c1 lcos flow,l_a +c2 lcos flow,l_b + +% Component type SS + mg SS m*g,internal + [angularTip_a] SS external,external + [angularTip_b] SS external,external + [xTip_a] SS external,external + [xTip_b] SS external,external + [yTip_a] SS external,external + [yTip_b] SS external,external + + + ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_abg.fig Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_abg.fig ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_abg.fig +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_abg.fig @@ -0,0 +1,133 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4951 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8550 5400 9225 6075 8955 6075 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8685 5265 8415 5535 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 5175 2025 3825 2250 3825 +4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 I:J\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTF:th\001 +4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000 4 255 1380 2971 1216 SS:[xTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 1380 2971 9361 SS:[xTip_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 1380 8372 1217 SS:[yTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 1380 8417 9362 SS:[yTip_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 2130 5671 1216 SS:[angularTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 2130 5671 9361 SS:[angularTip_b]\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 +4 1 -1 0 0 0 20 0.0000 4 255 720 9360 6345 Se:mg\001 +4 2 4 0 0 0 20 0.0000 4 255 1200 1935 3735 SS:[angle]\001 ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_desc.tex Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_desc.tex ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_desc.tex +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_desc.tex @@ -0,0 +1,20 @@ +% Verbal description for system gRODa (gRODa_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/08/15 09:41:19 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{gRODa} is + displayed in Figure \Ref{gRODa_abg} and its label + file is listed in Section \Ref{sec:gRODa_lbl}. + The subsystems are listed in Section \Ref{sec:gRODa_sub}. + +{\bf gRODa} is essentially as described in Figure 10.2 of +``Metamodelling''. ADDED mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_lbl.txt Index: mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_lbl.txt ================================================================== --- mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_lbl.txt +++ mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_lbl.txt @@ -0,0 +1,98 @@ +%SUMMARY gRODa: rigid rod in two dimensions - with gravity and angle port +%DESCRIPTION See Section 10.2 of "Metamodelling" +%DESCRIPTION Gravity term added at centre + +%ALIAS $1 l_a # length from end a to mass centre +%ALIAS $2 l_b # length from end b to mass centre +%ALIAS $3 j_m # inertia about mass centre +%ALIAS $4 m # mass +%ALIAS $5 g # gravity + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS x_a xTip_a # Force/velocity at tip a in x direction +%ALIAS y_a yTip_a # Force/velocity at tip a in y direction +%ALIAS alpha_a|a_a angularTip_a # Torque/angular velocity at tip a + +%ALIAS x_b xTip_b # Force/velocity at tip b in x direction +%ALIAS y_b yTip_b # Force/velocity at tip b in y direction +%ALIAS alpha_b|a_b angularTip_b # Torque/angular velocity at tip b + +%ALIAS angle|a angle # Angle port + +%ALIAS INTF General/INTF # The flow integration component. + +%% Label file for system gRODa (gRODa_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/08/05 08:04:40 peterg +% %% Initial revision +% %% +% %% Revision 1.3 1998/11/30 10:47:53 peterg +% %% Added extra a_a and a_b aliases +% %% +% %% Revision 1.2 1998/11/25 13:55:42 peterg +% %% Added missig attribute field m*g,internal +% %% +% %% Revision 1.1 1998/11/25 10:48:34 peterg +% %% Initial revision +% %% +% %% Revision 1.5 1998/07/27 12:27:27 peterg +% %% Added vector port aliases +% %% +% %% Revision 1.4 1998/07/27 10:51:20 peterg +% %% Aliased INTF as well. +% %% +% %% Revision 1.3 1998/07/27 10:49:10 peterg +% %% Major revision to include aliases etc +% %% +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,j_m +m_x lin flow,m +m_y lin flow,m + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,l_a +s2 lsin flow,l_b +c1 lcos flow,l_a +c2 lcos flow,l_b + + +% Component type Se + mg SS m*g + + + [angularTip_a] SS external,external + [angularTip_b] SS external,external + [xTip_a] SS external,external + [xTip_b] SS external,external + [yTip_a] SS external,external + [yTip_b] SS external,external + [angle] SS external,external + + + ADDED mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_abg.fig Index: mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_abg.fig ================================================================== --- mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_abg.fig +++ mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_abg.fig @@ -0,0 +1,57 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 1800 3825 1800 3600 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 5400 6300 5400 6075 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 9000 3825 9000 3600 9225 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 1800 6975 1800 6750 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 5625 4725 6975 4950 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 7425 4725 8775 4950 8550 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 9000 6975 9000 6750 9225 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 1575 3825 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6975 1575 6975 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4500 5175 4500 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 8775 3825 9225 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6975 8775 6975 9225 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 8550 9450 1350 9450 1350 1125 8550 1125 8550 9450 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 5175 5905 4220 5905 4539 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 3375 4725 2025 4950 2250 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 5175 4725 3825 4950 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 5400 3150 5400 3375 5625 +4 1 4 100 0 18 18 0.0000 4 270 1110 1935 1890 SS:[F_1]\001 +4 1 0 100 0 18 18 0.0000 4 270 1710 4770 1890 Muscle1:m_1\001 +4 1 0 100 0 18 18 0.0000 4 270 840 4770 3690 TF:r_1\001 +4 1 0 100 0 18 18 0.0000 4 210 390 6615 5490 I:m\001 +4 1 0 100 0 18 18 0.0000 4 270 840 4815 7290 TF:r_2\001 +4 1 0 100 0 18 18 0.0000 4 270 1710 4725 9090 Muscle1:m_2\001 +4 1 0 100 0 18 18 0.0000 4 270 840 2610 5490 Se:mg\001 +4 1 4 100 0 18 14 0.0000 4 210 285 3510 8775 [F]\001 +4 1 4 100 0 18 14 0.0000 4 210 285 3510 1530 [F]\001 +4 1 0 100 0 18 18 0.0000 4 270 900 7515 1890 De:x_1\001 +4 1 0 100 0 18 18 0.0000 4 270 900 7515 9090 De:x_2\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4725 5490 1\001 +4 1 0 100 0 18 18 0.0000 4 270 915 6075 4140 Df:v_m\001 +4 1 4 100 0 18 18 0.0000 4 270 1110 1890 9045 SS:[F_2]\001 ADDED mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_desc.tex Index: mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_desc.tex ================================================================== --- mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_desc.tex +++ mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_desc.tex @@ -0,0 +1,37 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system LowerLeg1 (LowerLeg1_desc.tex) +% Generated by MTT on Thu Apr 19 10:39:20 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\fig{LowerLeg1_pic} + {LowerLeg1_pic} + {0.9} + {Simple lower-leg model} + + A schematic of a simple muscle model with skeleton appears in + Figure \Ref{fig:LowerLeg1_pic} and the acausal bond graph is + displayed in Figure \Ref{fig:LowerLeg1_abg.ps} and its label file + is listed in Section \Ref{sec:LowerLeg1_lbl.txt}. The subsystems + are listed in Section \Ref{sec:LowerLeg1_sub}. The model is a + rough approximation of the lower leg, knee joint and thigh muscles + with the lower leg horizontal. + + The components are: + \begin{description} + \item[F\_1 and F\_2] the force inputs to the upper and lower muscles + \item[m\_1 and m\_2] the upper and lower muscles + \item[r\_1 and r\_2] the transformers reflecting the geometry of the + muscle attachments + \item[m] load mass + \item[mg] force due to gravity. + \end{description} + ADDED mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_input.txt Index: mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_input.txt ================================================================== --- mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_input.txt +++ mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_input.txt @@ -0,0 +1,9 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System LowerLeg1, representation input, language txt; +## File Example2_input.txt; +## Generated by MTT on Mon Apr 30 10:08:54 BST 2001; + +example2_f_1 = 1.0*((t>2.0)&&(t<4.0)); # On for 26.0)&&(t<8.0)); # On for 6 } + imagemask } bind +] def +/PaintProc { + pop + exec fill +} def +currentdict +end +/P8 exch def + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def + /DrawEllipse { + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def + /savematrix mtrx currentmatrix def + x y tr xrad yrad sc 0 0 1 startangle endangle arc + closepath + savematrix setmatrix + } def + +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +%%Page: 1 1 +10 setmiterlimit + 0.06299 0.06299 sc +% Polyline +15.000 slw +n 555 675 m 450 675 450 3720 105 arcto 4 {pop} repeat + 450 3825 6870 3825 105 arcto 4 {pop} repeat + 6975 3825 6975 780 105 arcto 4 {pop} repeat + 6975 675 555 675 105 arcto 4 {pop} repeat + cp gs col31 s gr +% Arc +n 1800.0 -821.0 2576.0 105.2 74.8 arcn +gs col0 s gr + +% Arc +n 1800.0 4151.0 2576.0 -105.2 -74.8 arc +gs col0 s gr + +% Arc +n 1800.0 349.0 2576.0 105.2 74.8 arcn +gs col0 s gr + +% Arc +n 1800.0 5321.0 2576.0 -105.2 -74.8 arc +gs col0 s gr + +% Ellipse +n 2700 2250 127 127 0 360 DrawEllipse gs col0 s gr + +% Polyline +n 2475 2025 m 5625 2025 l 5625 2475 l 2475 2475 l + cp gs col0 s gr +% Polyline +n 2475 1575 m 2700 1575 l 2700 2025 l 2475 2025 l + cp gs col0 s gr +% Polyline +n 2475 2475 m 2700 2475 l 2700 2925 l 2475 2925 l + cp gs col0 s gr +% Polyline +7.500 slw +n 675 1125 m 1125 1125 l 1125 3375 l 675 3375 l + cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def +15.00 15.00 sc P8 [16 0 0 -16 45.00 75.00] PATmp PATsp ef gr PATusp gs col0 s gr +% Polyline +15.000 slw +gs clippath +2731 2196 m 2646 2281 l 2801 2436 l 2717 2267 l 2886 2351 l cp +eoclip +n 2700 2250 m + 3780 3330 l gs col1 s gr gr + +% arrowhead +n 2886 2351 m 2717 2267 l 2801 2436 l 2886 2436 l 2886 2351 l + cp gs col1 1.00 shd ef gr col1 s +% Polyline +gs clippath +1746 1543 m 1831 1628 l 1986 1473 l 1817 1558 l 1901 1388 l cp +eoclip +n 1800 1575 m + 2250 1125 l gs col1 s gr gr + +% arrowhead +n 1901 1388 m 1817 1558 l 1986 1473 l 1986 1388 l 1901 1388 l + cp gs col1 1.00 shd ef gr col1 s +% Polyline +gs clippath +1746 2668 m 1831 2753 l 1986 2598 l 1817 2683 l 1901 2513 l cp +eoclip +n 1800 2700 m + 3375 1125 l gs col1 s gr gr + +% arrowhead +n 1901 2513 m 1817 2683 l 1986 2598 l 1986 2513 l 1901 2513 l + cp gs col1 1.00 shd ef gr col1 s +% Polyline +gs clippath +3996 1948 m 4081 2033 l 4236 1878 l 4067 1963 l 4151 1793 l cp +eoclip +n 4050 1980 m + 4905 1125 l gs col1 s gr gr + +% arrowhead +n 4151 1793 m 4067 1963 l 4236 1878 l 4236 1793 l 4151 1793 l + cp gs col1 1.00 shd ef gr col1 s +% Polyline +gs clippath +5818 1745 m 5903 1830 l 6058 1675 l 5889 1760 l 5973 1590 l cp +eoclip +n 5872 1777 m + 6524 1125 l gs col1 s gr gr + +% arrowhead +n 5973 1590 m 5889 1760 l 6058 1675 l 6058 1590 l 5973 1590 l + cp gs col1 1.00 shd ef gr col1 s +% Polyline +n 5625 1890 m 6345 1890 l 6345 2565 l 5625 2565 l + cp gs col0 s gr +/Times-BoldItalic ff 300.00 scf sf +3825 3645 m +gs 1 -1 sc (Pivot) dup sw pop 2 div neg 0 rm col1 sh gr +/Times-BoldItalic ff 300.00 scf sf +2250 1080 m +gs 1 -1 sc (Muscle 1) dup sw pop 2 div neg 0 rm col1 sh gr +/Times-BoldItalic ff 300.00 scf sf +3555 1080 m +gs 1 -1 sc (Muscle 2) dup sw pop 2 div neg 0 rm col1 sh gr +/Times-BoldItalic ff 300.00 scf sf +4905 1080 m +gs 1 -1 sc (Bone) dup sw pop 2 div neg 0 rm col1 sh gr +/Times-BoldItalic ff 300.00 scf sf +6480 1080 m +gs 1 -1 sc (Load) dup sw pop 2 div neg 0 rm col1 sh gr +/Times-Roman ff 375.00 scf sf +5850 2295 m +gs 1 -1 sc (m) col0 sh gr +$F2psEnd +rs +end ADDED mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_rep.txt Index: mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_rep.txt ================================================================== --- mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_rep.txt +++ mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_rep.txt @@ -0,0 +1,37 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system LowerLeg1 (Example1_rep.txt) +## Generated by MTT on" Thu Apr 19 10:26:57 BST 2001. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt LowerLeg1 abg tex # The system description +mtt LowerLeg1 cbg ps # The causal bond graph +mtt LowerLeg1 lbl txt +mtt Muscle1 lbl txt +mtt LowerLeg1 struc tex # The system structure +mtt LowerLeg1 sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt LowerLeg1 dae tex # The system dae +mtt LowerLeg1 ode tex # The system ode +## mtt LowerLeg1 sspar tex # Steady-state parameters +## mtt LowerLeg1 ss tex # Steady state +## mtt LowerLeg1 dm tex # Descriptor matrices (of linearised system) +mtt LowerLeg1 sm tex # State matrices (of linearised system) +mtt LowerLeg1 tf tex # Transfer function (of linearised system) +## mtt LowerLeg1 lmfr ps # log modulus of frequency response (of linearised system) + mtt LowerLeg1 simpar tex # Simulation parameters + mtt LowerLeg1 numpar tex # Numerical simulation parameters +## mtt LowerLeg1 state tex # Simulation initial state + mtt LowerLeg1 input tex # Simulation input +## mtt LowerLeg1 logic tex # Logic control + mtt LowerLeg1 odeso ps # Simulation output + +mtt LowerLeg1 rep txt # This file ADDED mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_abg.fig Index: mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_abg.fig ================================================================== --- mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_abg.fig +++ mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_abg.fig @@ -0,0 +1,31 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 2700 4050 2700 3825 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 2700 5850 2700 5625 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 2475 4275 1125 4500 1350 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7200 2700 8550 2700 8325 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4275 4275 2925 4500 3150 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 9900 4950 1575 4950 1575 450 9900 450 9900 4950 +4 1 0 100 0 18 18 0.0000 4 195 150 4275 2790 1\001 +4 2 4 100 0 18 18 0.0000 4 270 870 2610 2790 SS:[in]\001 +4 1 0 100 0 18 18 0.0000 4 270 840 4455 945 R:d_m\001 +4 1 0 100 0 18 18 0.0000 4 270 1170 6525 2790 CDx:c_m\001 +4 0 4 100 0 18 18 0.0000 4 270 1065 8640 2790 SS:[out]\001 +4 1 1 101 0 3 20 0.0000 4 210 1170 8055 3285 Extension\001 +4 1 4 100 0 18 18 0.0000 4 270 810 4275 4545 SS:[F]\001 +4 1 1 101 0 3 20 0.0000 4 270 3150 7875 4680 Simple linear muscle model\001 +4 1 1 101 0 3 20 0.0000 4 210 1365 2340 3240 Connection\001 +4 1 1 101 0 3 20 0.0000 4 270 1335 3015 4545 Force input\001 ADDED mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_desc.tex Index: mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_desc.tex ================================================================== --- mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_desc.tex +++ mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_desc.tex @@ -0,0 +1,37 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Muscle1 (Muscle1_desc.tex) +% Generated by MTT on Thu Apr 19 10:39:29 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Muscle1} is + displayed in Figure \Ref{fig:Muscle1_abg.ps} and its label + file is listed in Section \Ref{sec:Muscle1_lbl}. + The subsystems are listed in Section \Ref{sec:Muscle1_sub}. + + +This model is a highly simplified linear model of a muscle. The two +main components are: +\begin{itemize} +\item a \textbf{CDx} component representing the muscle compliance and + also providing a measurement of muscle extension and +\item an \textbf{R} component representing mechanical damping in the muscle +\end{itemize} + +The component has three ports: +\begin{description} +\item [in] representing the connection of the muscle to the outside world. The + corresponding force corresponds to the sum of the muscle force and + the reaction force of connected components. +\item[out] a measurement of the muscle extension. +\item[F] Representing the force component of the muscle model. +\end{description} + ADDED mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_lbl.txt Index: mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_lbl.txt ================================================================== --- mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_lbl.txt +++ mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_lbl.txt @@ -0,0 +1,41 @@ +%% Label file for system Muscle1 (Muscle1_lbl.txt) +%SUMMARY Muscle1 +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS F F +%ALIAS in in +%ALIAS out out + +% Argument aliases +%ALIAS $1 c_m +%ALIAS $2 d_m + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type CDx + c_m lin c_m + +% Component type R + d_m lin flow,d_m + +% Component type SS + [F] SS external,external + [in] SS external,external + [out] SS external,external ADDED mtt/lib/comp/compound/Sensitivity/O/O_abg.fig Index: mtt/lib/comp/compound/Sensitivity/O/O_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/O/O_abg.fig +++ mtt/lib/comp/compound/Sensitivity/O/O_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2295 6075 3645 6075 3420 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 5760 3825 4410 4050 4635 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 6075 5400 6075 5175 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2295 3150 3645 3150 3420 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 2835 3825 1485 4050 1710 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 3150 5400 3150 5175 3375 +4 1 4 100 0 18 20 0.0000 4 285 1080 3870 4185 SS:[B2]\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 6075 6165 SS:[B3]\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 1665 6165 SS:[B1]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 3825 6165 0\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 3870 1260 SS:[A2]\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 6075 3240 SS:[A3]\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 1665 3240 SS:[A1]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 3825 3240 0\001 ADDED mtt/lib/comp/compound/Sensitivity/O/O_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/O/O_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/O/O_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/O/O_lbl.txt @@ -0,0 +1,36 @@ +%% Label file for system O (O_lbl.txt) +%SUMMARY O Three-port zero junction for 2-bond vector bonds :-) +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/07/29 04:47:49 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in A1,B1 +%ALIAS out A2,B2 +%ALIAS in_2|out_2 A3,B3 + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [A1] SS external,external + [A2] SS external,external + [A3] SS external,external + [B1] SS external,external + [B2] SS external,external + [B3] SS external,external ADDED mtt/lib/comp/compound/Sensitivity/l/l_abg.fig Index: mtt/lib/comp/compound/Sensitivity/l/l_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/l/l_abg.fig +++ mtt/lib/comp/compound/Sensitivity/l/l_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2295 6075 3645 6075 3420 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 5760 3825 4410 4050 4635 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 6075 5400 6075 5175 6300 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2295 3150 3645 3150 3420 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 2835 3825 1485 4050 1710 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 3150 5400 3150 5175 3375 +4 1 4 100 0 18 20 0.0000 4 285 1080 3870 4185 SS:[B2]\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 6075 6165 SS:[B3]\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 1665 6165 SS:[B1]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 3825 6165 1\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 3870 1260 SS:[A2]\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 6075 3240 SS:[A3]\001 +4 1 4 100 0 18 20 0.0000 4 285 1080 1665 3240 SS:[A1]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 3825 3240 1\001 ADDED mtt/lib/comp/compound/Sensitivity/l/l_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/l/l_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/l/l_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/l/l_lbl.txt @@ -0,0 +1,36 @@ +%% Label file for system l (l_lbl.txt) +%SUMMARY l Three port 1 junction with 2-bond vector ports :-) +%DESCRIPTIlN + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/07/29 04:49:49 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in A1,B1 +%ALIAS out A2,B2 +%ALIAS in_2|out_2 A3,B3 + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [A1] SS external,external + [A2] SS external,external + [A3] SS external,external + [B1] SS external,external + [B2] SS external,external + [B3] SS external,external ADDED mtt/lib/comp/compound/Sensitivity/sAE/sAE_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sAE/sAE_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sAE/sAE_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sAE/sAE_abg.fig @@ -0,0 +1,38 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4050 5625 4050 5400 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7650 4050 9000 4050 8775 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9450 4050 10800 4050 10575 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 450 3825 450 3600 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 450 5625 450 5400 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7650 450 9000 450 8775 675 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 2520 9225 3825 9225 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 675 4050 2025 4275 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5625 3825 5625 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 225 3825 675 +4 1 0 100 0 18 20 0.0000 4 210 1155 6660 4140 AE:sens\001 +4 1 0 100 0 18 20 0.0000 4 195 150 9225 4140 1\001 +4 1 0 100 0 18 20 0.0000 4 195 150 4050 540 0\001 +4 1 0 100 0 18 20 0.0000 4 270 960 4050 2340 AE:k_s\001 +4 1 0 100 0 18 20 0.0000 4 210 1320 6660 540 AE:actual\001 +4 1 4 100 0 18 20 0.0000 4 270 1740 3060 4140 SS:[Sens_in]\001 +4 1 4 100 0 18 20 0.0000 4 270 1935 12240 4140 SS:[Sens_out]\001 +4 1 4 100 0 18 20 0.0000 4 270 2115 10575 585 SS:[Actual_out]\001 +4 1 4 100 0 18 20 0.0000 4 270 1920 1170 585 SS:[Actual_in]\001 ADDED mtt/lib/comp/compound/Sensitivity/sAE/sAE_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sAE/sAE_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sAE/sAE_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sAE/sAE_lbl.txt @@ -0,0 +1,39 @@ +%% Label file for system sAE (sAE_lbl.txt) +%SUMMARY sAE +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Actual_in,Sens_in +%ALIAS out Actual_out,Sens_out + + +% Argument aliases +%ALIAS $1 k +%ALIAS $2 k_s + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AE + actual lin k + sens lin k + k_s lin k_s + +% Component type SS + [Actual_in] SS external,external + [Actual_out] SS external,external + [Sens_in] SS external,external + [Sens_out] SS external,external ADDED mtt/lib/comp/compound/Sensitivity/sAF/sAF_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sAF/sAF_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sAF/sAF_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sAF/sAF_abg.fig @@ -0,0 +1,42 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2430 180 2520 720 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2475 225 2475 675 +-6 +6 4230 3780 4320 4320 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4275 3825 4275 4275 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4050 5625 4050 5400 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7650 4050 9000 4050 8775 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9450 4050 10800 4050 10575 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 450 3825 450 3600 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 450 5625 450 5400 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7650 450 9000 450 8775 675 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 2520 9225 3825 9225 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 675 4050 2025 4275 1800 +4 1 0 100 0 18 20 0.0000 4 285 1425 6660 4140 AF:sens\001 +4 1 0 100 0 18 20 0.0000 4 270 195 9225 4140 0\001 +4 1 0 100 0 18 20 0.0000 4 270 195 4050 540 1\001 +4 1 0 100 0 18 20 0.0000 4 360 1215 4050 2340 AF:k_s\001 +4 1 0 100 0 18 20 0.0000 4 285 1680 6660 540 AF:actual\001 +4 1 4 100 0 18 20 0.0000 4 360 2280 3060 4140 SS:[Sens_in]\001 +4 1 4 100 0 18 20 0.0000 4 360 2520 12240 4140 SS:[Sens_out]\001 +4 1 4 100 0 18 20 0.0000 4 360 2775 10575 585 SS:[Actual_out]\001 +4 1 4 100 0 18 20 0.0000 4 360 2535 1170 585 SS:[Actual_in]\001 ADDED mtt/lib/comp/compound/Sensitivity/sAF/sAF_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sAF/sAF_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sAF/sAF_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sAF/sAF_lbl.txt @@ -0,0 +1,39 @@ +%% Label file for system sAF (sAF_lbl.txt) +%SUMMARY sAF +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Actual_in,Sens_in +%ALIAS out Actual_out,Sens_out + + +% Argument aliases +%ALIAS $1 k +%ALIAS $2 k_s + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AF + actual lin k + sens lin k + k_s lin k_s + +% Component type SS + [Actual_in] SS external,external + [Actual_out] SS external,external + [Sens_in] SS external,external + [Sens_out] SS external,external ADDED mtt/lib/comp/compound/Sensitivity/sC/sC_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sC/sC_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sC/sC_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sC/sC_abg.fig @@ -0,0 +1,20 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 3375 5400 3375 5625 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 3375 4500 3375 4275 3600 +2 4 0 3 31 7 101 0 -1 0.000 0 0 11 0 0 5 + 9000 4725 1350 4725 1350 2253 9000 2253 9000 4725 +4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 +4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 +4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 +4 1 0 100 0 18 18 0.0000 4 210 450 4950 3465 C:c\001 ADDED mtt/lib/comp/compound/Sensitivity/sC/sC_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sC/sC_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sC/sC_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sC/sC_lbl.txt @@ -0,0 +1,40 @@ +%% Label file for system sC (sC_lbl.txt) +%SUMMARY sC Sensitivity C component +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2001/04/05 12:00:18 gawthrop +% %% Identification example +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in actual,sensitivity + +% Argument aliases +%ALIAS $1 effort,c +%ALIAS $2 cs + +%CR alias +%ALIAS $1 slin + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- +% Component type C + c slin effort,c;cs + +% Component type SS + [actual] SS external,external + [sensitivity] SS external,external + + + ADDED mtt/lib/comp/compound/Sensitivity/sCS/sCS_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sCS/sCS_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sCS/sCS_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sCS/sCS_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2340 3915 2610 4185 +4 1 6 100 0 18 20 0.0000 4 271 196 2476 4186 [1,2]\001 +4 1 0 100 0 18 20 0.0000 4 270 195 2476 4185 1\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 3825 2475 2475 2700 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 5625 2475 4275 2700 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4050 4050 4050 3825 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2700 3825 2700 4275 +4 1 0 100 0 18 20 0.0000 4 285 570 2475 2295 sC:c\001 +4 0 0 100 0 18 20 0.0000 4 360 1185 4185 4185 sSe:e_0\001 +4 1 6 100 0 18 20 0.0000 4 361 1186 2476 6031 [1,2]\001 +4 1 4 100 0 18 20 0.0000 4 360 1185 2476 6030 SS:[in]\001 ADDED mtt/lib/comp/compound/Sensitivity/sCS/sCS_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sCS/sCS_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sCS/sCS_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sCS/sCS_lbl.txt @@ -0,0 +1,41 @@ +%% Label file for system sCS (sCS_lbl.txt) +%SUMMARY sCS C component with initial state + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 10:31:35 peterg +% %% Put under RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in_1,in_2 + +% Argument aliases +%ALIAS $1 effort,c +%ALIAS $2 e_0 +%ALIAS $3 c_s +%ALIAS $4 e_0s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + c slin effort,c;c_s + +% Component type SS + [in] SS external,external + +% Component type Se + e_0 SS e_0;e_0s + + ADDED mtt/lib/comp/compound/Sensitivity/sCT/sCT_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sCT/sCT_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sCT/sCT_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sCT/sCT_abg.fig @@ -0,0 +1,27 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 2700 3375 2700 3150 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 2700 5625 2700 5400 2925 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 3825 6525 1575 900 1575 900 3825 6525 3825 +4 1 4 0 0 0 20 0.0000 4 240 270 3285 2475 [f]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 3105 S\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 2475 T\001 +4 1 1 1 0 3 30 0.0000 4 60 105 2520 2835 .\001 +4 2 6 0 0 0 20 0.0000 4 240 510 1981 2791 [1,2]\001 +4 2 4 0 0 0 20 0.0000 4 240 810 1981 2790 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 735 3825 2790 sFP:fp\001 +4 1 4 0 0 0 20 0.0000 4 255 315 4410 2475 [p]\001 +4 1 1 1 0 3 20 0.0000 4 240 210 4950 3105 Q\001 +4 1 1 1 0 3 20 0.0000 4 195 165 4950 2475 T\001 +4 1 1 1 0 3 30 0.0000 4 60 105 4995 2835 .\001 +4 1 -1 0 0 0 20 0.0000 4 195 495 5940 2790 sC:c\001 ADDED mtt/lib/comp/compound/Sensitivity/sCT/sCT_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sCT/sCT_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sCT/sCT_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sCT/sCT_lbl.txt @@ -0,0 +1,35 @@ +#SUMMARY sCT Sensitivity version of Continuous-Time (thermal C) component + +## System sCT, representation lbl, language txt +## File sCT_lbl.txt +## Generated by MTT on Fri Jul 6 05:16:27 BST 2001 + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ############################################################### + +## Port aliases +#ALIAS in in_1,in_2 + +## Argument aliases +#ALIAS $1 effort,c +#ALIAS $2 cs + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type SS + [in] SS external,external + +## Component type C + c slin effort,c;cs + +## Component type FP + fp lin ADDED mtt/lib/comp/compound/Sensitivity/sCT/sCT_rep.txt Index: mtt/lib/comp/compound/Sensitivity/sCT/sCT_rep.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sCT/sCT_rep.txt +++ mtt/lib/comp/compound/Sensitivity/sCT/sCT_rep.txt @@ -0,0 +1,35 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system sCT (sCT_rep.txt) +## Generated by MTT on" Fri Jul 6 05:27:38 BST 2001. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt sCT abg tex # The system description +##mtt sCT cbg ps # The causal bond graph +mtt sCT struc tex # The system structure +mtt sCT sympar tex # The system parameters +## Uncomment the following lines or add others +mtt sCT dae tex # The system dae +## mtt sCT ode tex # The system ode +## mtt sCT sspar tex # Steady-state parameters +## mtt sCT ss tex # Steady state +## mtt sCT dm tex # Descriptor matrices (of linearised system) +## mtt sCT sm tex # State matrices (of linearised system) +## mtt sCT tf tex # Transfer function (of linearised system) +## mtt sCT lmfr ps # log modulus of frequency response (of linearised system) +## mtt sCT simpar tex # Simulation parameters +## mtt sCT numpar tex # Numerical simulation parameters +## mtt sCT state tex # Simulation initial state +## mtt sCT input tex # Simulation input +## mtt sCT logic tex # Logic control +## mtt sCT odeso ps # Simulation output + +## mtt sCT rep txt # This file ADDED mtt/lib/comp/compound/Sensitivity/sDC/sDC_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sDC/sDC_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sDC/sDC_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sDC/sDC_abg.fig @@ -0,0 +1,56 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2036 2724 3371 2724 3063 2947 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3836 2700 5171 2700 4863 2923 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5421 2501 5421 1342 5678 1609 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8501 2724 9836 2724 9528 2947 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11325 4730 11325 494 8758 494 8758 4730 11325 4730 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5672 2700 7006 2700 6698 2923 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 4725 6300 494 2293 494 2293 4725 6300 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2501 3600 1342 3857 1609 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11886 2546 11886 1386 12143 1654 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12143 2724 13478 2724 13170 2947 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10041 2546 10041 1386 10298 1654 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10298 2724 11633 2724 11325 2947 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 15750 5175 45 5175 45 316 15750 316 15750 5175 +4 2 4 0 0 0 20 0.0000 4 255 1815 1980 2790 SS:[Electrical]\001 +4 1 1 1 0 0 23 0.0000 4 240 1395 1472 3170 Terminals\001 +4 1 -1 0 0 0 23 0.0000 4 240 90 5370 2858 l\001 +4 1 -1 0 0 0 23 0.0000 4 285 1365 7783 2813 sGY:k_m\001 +4 1 -1 0 0 0 23 0.0000 4 285 765 5370 1252 sI:l_a\001 +4 1 1 1 0 0 23 0.0000 4 240 1290 5421 5043 Electrical\001 +4 1 1 1 0 0 23 0.0000 4 240 1605 10041 5043 Mechanical\001 +4 1 -1 0 0 0 23 0.0000 4 240 90 3600 2835 l\001 +4 1 -1 0 0 0 23 0.0000 4 270 900 3645 1260 sR:r_a\001 +4 1 4 100 0 18 4 0.0000 4 75 270 3780 2475 [out_2]\001 +4 1 4 100 0 18 4 0.0000 4 75 270 5580 2475 [out_2]\001 +4 1 -1 0 0 0 23 0.0000 4 240 90 11880 2835 l\001 +4 1 4 100 0 18 4 0.0000 4 75 270 11745 2475 [out_2]\001 +4 1 -1 0 0 0 23 0.0000 4 300 885 10144 1252 sI:j_m\001 +4 1 -1 0 0 0 23 0.0000 4 240 90 10035 2835 l\001 +4 1 4 100 0 18 4 0.0000 4 75 270 9900 2475 [out_2]\001 +4 1 -1 0 0 0 23 0.0000 4 285 1080 11880 1260 sR:b_m\001 +4 0 4 0 0 0 20 0.0000 4 255 2055 13635 2790 SS:[Mechanical]\001 +4 1 1 1 0 0 23 0.0000 4 240 735 12645 3150 Shaft\001 +4 1 4 100 0 18 16 0.0000 4 225 480 2115 2520 [1,2]\001 +4 1 4 100 0 18 16 0.0000 4 225 480 13365 2565 [1,2]\001 ADDED mtt/lib/comp/compound/Sensitivity/sDC/sDC_desc.tex Index: mtt/lib/comp/compound/Sensitivity/sDC/sDC_desc.tex ================================================================== --- mtt/lib/comp/compound/Sensitivity/sDC/sDC_desc.tex +++ mtt/lib/comp/compound/Sensitivity/sDC/sDC_desc.tex @@ -0,0 +1,38 @@ +% Verbal description for system sDC (sDC_desc.tex) +% Generated by MTT on Thu Sep 11 10:09:58 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{sDC} is + displayed in Figure \Ref{sDC_abg} and its label + file is listed in Section \Ref{sec:sDC_lbl}. + The subsystems are listed in Section \Ref{sec:sDC_sub}. + + \begin{table}[htbp] + \begin{center} + \leavevmode + \begin{tabular}{|l|l|} + \hline + Index & Parameter\\ + \hline + 1 & Motor gain ($k_m$) \\ + 2 & Armature inductance ($l_a$) \\ + 3 & Armature resistance ($r_a$) \\ + 4 & Inertia ($j_m$) \\ + 5 & Friction coefficient ($b_m$) \\ + \hline + \end{tabular} + \caption{sDC motor parameters} + \label{tab:sDC_components} + \end{center} + \end{table} +{\bf sDC} is a two(vector)-port component representing a DC motor and its +sensitivity functions. It has the 5 +parameters listed in Table \Ref{tab:sDC_components}. + + ADDED mtt/lib/comp/compound/Sensitivity/sDC/sDC_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sDC/sDC_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sDC/sDC_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sDC/sDC_lbl.txt @@ -0,0 +1,52 @@ +%% Label file for system sDC (sDC_lbl.txt) +%SUMMARY sDC +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Electrical_1,Electrical_2 +%ALIAS out Mechanical_1,Mechanical_2 + +% Argument aliases +%ALIAS $1 k_m +%ALIAS $2 l_a +%ALIAS $3 r_a +%ALIAS $4 j_m +%ALIAS $5 b_m + +%ALIAS $6 k_ms +%ALIAS $7 l_as +%ALIAS $8 r_as +%ALIAS $9 j_ms +%ALIAS $10 b_ms + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [Electrical] SS external,external + [Mechanical] SS external,external + +% Component type sGY + k_m lin flow,k_m;k_ms + +% Component type sI + j_m lin flow,j_m;j_ms + l_a lin flow,l_a;l_as + +% Component type sR + b_m lin flow,b_m;b_ms + r_a lin flow,r_a;r_as + + ADDED mtt/lib/comp/compound/Sensitivity/sDe/sDe_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sDe/sDe_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sDe/sDe_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sDe/sDe_abg.fig @@ -0,0 +1,17 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 2025 3600 2025 3375 2250 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 1350 3600 1350 3375 1575 +4 1 0 100 0 18 20 0.0000 4 270 1110 1485 2115 SS:ss_2\001 +4 1 0 100 0 18 20 0.0000 4 270 1110 1485 1440 SS:ss_1\001 +4 1 4 100 0 18 20 0.0000 4 270 1515 4545 1440 SS:[port_1]\001 +4 1 4 100 0 18 20 0.0000 4 270 1515 4500 2115 SS:[port_2]\001 ADDED mtt/lib/comp/compound/Sensitivity/sDe/sDe_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sDe/sDe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sDe/sDe_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sDe/sDe_lbl.txt @@ -0,0 +1,33 @@ +%% Label file for system sDe (sDe_lbl.txt) +%SUMMARY sDe Sensitivity version of Effort detector (De) +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/07/29 04:53:34 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in|out port_1,port_2 + +% Argument aliases +%ALIAS $1 external + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [port_1] SS external,external + [port_2] SS external,external + ss_1 SS external,0 + ss_2 SS external,0 ADDED mtt/lib/comp/compound/Sensitivity/sDf/sDf_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sDf/sDf_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sDf/sDf_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sDf/sDf_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 900 1215 2070 1530 +4 1 0 100 0 18 20 0.0000 4 285 1155 1485 1440 SS:ss_1\001 +-6 +6 900 1890 2070 2205 +4 1 0 100 0 18 20 0.0000 4 285 1155 1485 2115 SS:ss_2\001 +-6 +6 2205 1305 3645 1620 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 1350 3600 1350 3375 1575 +-6 +6 2205 1980 3645 2295 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 2025 3600 2025 3375 2250 +-6 +6 3735 1215 5355 1530 +4 1 4 100 0 18 20 0.0000 4 300 1620 4545 1440 SS:[port_1]\001 +-6 +6 3690 1890 5310 2205 +4 1 4 100 0 18 20 0.0000 4 300 1620 4500 2115 SS:[port_2]\001 +-6 ADDED mtt/lib/comp/compound/Sensitivity/sDf/sDf_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sDf/sDf_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sDf/sDf_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sDf/sDf_lbl.txt @@ -0,0 +1,36 @@ +%% Label file for system sDf (sDf_lbl.txt) +%SUMMARY sDf Sensitivity version of Effort detector (De) +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/09/07 05:32:17 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1999/07/29 04:53:34 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in|out port_1,port_2 + +% Argument aliases +%ALIAS $1 external + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [port_1] SS external,external + [port_2] SS external,external + ss_1 SS 0,external + ss_2 SS 0,external ADDED mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_abg.fig @@ -0,0 +1,103 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2205 3555 2295 4095 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2250 3600 2250 4050 +-6 +6 2205 3555 2295 4095 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2250 3600 2250 4050 +-6 +6 2205 7155 2295 7695 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2250 7200 2250 7650 +-6 +6 3510 4005 4050 4095 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4005 4050 3555 4050 +-6 +6 3645 5850 4185 5940 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4140 5895 3690 5895 +-6 +6 8730 5355 9270 5445 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 9225 5400 8775 5400 +-6 +6 3600 7155 4140 7245 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4095 7200 3645 7200 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 7425 3600 7425 3375 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 7425 5400 7425 5175 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7425 7425 8775 7425 8550 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9225 7425 10575 7425 10350 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 3825 3600 3825 3375 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 3825 5400 3825 5175 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7425 3825 8775 3825 8550 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9225 3825 10575 3825 10350 4050 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 5895 9000 7200 9000 6975 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9006 5873 3831 7178 3831 6953 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 450 6300 1800 6525 1575 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 2250 6300 3600 6525 3375 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6075 1800 6525 1800 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 + 6075 2025 4275 2025 4275 5400 4500 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 4050 3825 5400 4050 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9000 4050 9000 5400 9225 5175 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6525 2250 6525 7200 6750 6975 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 + 6525 2025 8550 2025 8550 5400 8775 5175 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 + 6525 8550 9225 8550 9225 5850 9450 6075 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 + 6075 8550 3600 8550 3600 5850 3375 6075 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 10125 6300 8775 6525 9000 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6075 8775 6525 8775 +4 1 4 100 0 18 20 0.0000 4 285 2415 6210 360 SS:[Actual_mod]\001 +4 1 5 100 0 18 20 0.0000 4 210 165 6300 2115 0\001 +4 1 4 100 0 18 20 0.0000 4 285 1845 1215 7515 SS:[Sens_in]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 3825 7515 1\001 +4 1 0 100 0 18 20 0.0000 4 225 1590 6435 7515 EMTF:sens\001 +4 1 0 100 0 18 20 0.0000 4 210 165 9000 7515 0\001 +4 1 4 100 0 18 20 0.0000 4 285 2040 11790 7515 SS:[Sens_out]\001 +4 1 4 100 0 18 20 0.0000 4 285 2055 1215 3915 SS:[Actual_in]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 3825 3915 1\001 +4 1 0 100 0 18 20 0.0000 4 225 1785 6435 3915 EMTF:actual\001 +4 1 0 100 0 18 20 0.0000 4 210 165 9000 3915 0\001 +4 1 4 100 0 18 20 0.0000 4 285 2250 11790 3915 SS:[Actual_out]\001 +4 1 0 100 0 18 20 0.0000 4 225 1170 8955 5715 AE3:ae3\001 +4 1 0 100 0 18 20 0.0000 4 225 1095 3825 5715 AF3:af3\001 +4 2 4 100 0 18 14 0.0000 4 210 600 6255 3600 [mod]\001 +4 2 4 100 0 18 14 0.0000 4 210 600 6435 7155 [mod]\001 +4 1 4 100 0 18 20 0.0000 4 285 2205 6300 10395 SS:[Sens_mod]\001 +4 1 5 100 0 18 20 0.0000 4 210 165 6345 8640 0\001 +4 2 4 100 0 18 14 0.0000 4 210 720 3420 5985 [smod]\001 +4 0 4 100 0 18 14 0.0000 4 210 720 9540 5940 [smod]\001 +4 2 4 100 0 18 14 0.0000 4 210 600 8505 5355 [mod]\001 +4 0 4 100 0 18 14 0.0000 4 210 600 4455 5400 [mod]\001 ADDED mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt @@ -0,0 +1,69 @@ +%% Label file for system sEMTF (sEMTF_lbl.txt) +%SUMMARY sEMTF Effort modulated TF - sensitivity version +%DESCRIPTION It is assumed that no sensitivity parameter is associated +%DESCRIPTION with this component. +%DESCRIPTION This is a built out of EMTFs and the 4 port AE3 component +%DESCRIPTION There is one argument alias - the transformer (flow) gain +%DESCRIPTION There are two CR aliases: one for the EMTF and one for +%DESCRIPTION the AE3 +%DESCRIPTION Examples: +%DESCRIPTION lin;slin n +%DESCRIPTION lsin;slsin l +%DESCRIPTION lcos;slcos l + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2002/04/17 18:50:35 gawthrop +% %% Sensitivity EMTF components +% %% +% %% Revision 1.1 2000/12/28 17:29:10 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Actual_in,Sens_in +%ALIAS out Actual_out,Sens_out +%ALIAS mod Actual_mod,Sens_mod + + +% Argument aliases +%ALIAS $1 l + +% CR aliases +%ALIAS $1 lsin +%ALIAS $2 slsin + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type EMTF + actual lsin flow,l + sens lsin flow,l + +% Component type AE3 (????NB NEGATIVE GAIN HERE!!!!) + ae3 slsin l + +% Component type AF3 + af3 slsin l + +% Component type SS + [Actual_in] SS external,external + [Actual_out] SS external,external + [Actual_mod] SS external,internal + [Sens_in] SS external,external + [Sens_out] SS external,external + [Sens_mod] SS external,internal + + + ADDED mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_abg.fig @@ -0,0 +1,42 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 675 4050 675 3825 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 1350 4050 1350 3825 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 1125 4050 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 450 4050 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 675 4725 675 4950 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 1350 4725 1350 4950 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 8100 675 6750 675 6975 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 8100 1350 6750 1350 6975 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 8100 450 8100 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 8100 1125 8100 1575 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 9900 1800 1350 1800 1350 225 9900 225 9900 1800 +4 1 4 100 0 18 18 0.0000 4 270 870 2115 765 SS:[In]\001 +4 1 4 100 0 18 18 0.0000 4 270 1020 2115 1395 SS:[sIn]\001 +4 1 0 100 0 18 24 0.0000 4 285 510 4410 1125 R:r\001 +4 1 4 100 0 18 14 0.0000 4 210 270 4860 540 [3]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 4860 1215 [4]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 3870 1215 [2]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 3870 540 [1]\001 +4 1 0 100 0 18 18 0.0000 4 210 375 6390 765 AF\001 +4 1 0 100 0 18 18 0.0000 4 210 375 6390 1440 AF\001 +4 1 4 100 0 18 18 0.0000 4 270 1230 8820 765 SS:[Mod]\001 +4 1 4 100 0 18 18 0.0000 4 270 1380 8865 1440 SS:[sMod]\001 ADDED mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_cr.r Index: mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_cr.r ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_cr.r +++ mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_cr.r @@ -0,0 +1,68 @@ +%% CR file for sFMR +%% Just for flow input definition of r, ie must use with flow,r;k_s +in "$MTT_CRS/r/slin.cr"; + +OPERATOR sFMR; + +% Ordinary FMR port +FOR ALL gain_cause,r,k_s,out_cause,in,sin,in_cause,modu,smodu +LET sFMR(gain_cause,r,k_s,out_cause,1, + in,in_cause,1, + sin,in_cause,2, + modu,flow,3, + smodu,flow,4 + ) + = slin(gain_cause,r*modu,k_s,out_cause,1, + in,in_cause,1, + sin,in_cause,2); + +% Sensitivity FMR port - effort input +FOR ALL r,k_s,out_cause,inp,sinp,inp_cause,modu,smodu +LET sFMR(flow,r,k_s,out_cause,2, + inp,effort,1, + sinp,effort,2, + modu,flow,3, + smodu,flow,4 + ) + = ( + slin(flow,r,k_s,out_cause,2, + inp/modu,effort,1, + sinp/modu,effort,2) + - smodu*(1/(r*(modu^2))) + ); + +% Sensitivity FMR port - flow input +FOR ALL r,k_s,out_cause,inp,sinp,inp_cause,modu,smodu +LET sFMR(flow,r,k_s,out_cause,2, + inp,flow,1, + sinp,flow,2, + modu,flow,3, + smodu,flow,4 + ) + = ( + slin(flow,r,k_s,out_cause,2, + inp*modu,flow,1, + sinp*modu,flow,2) + + r*inp*smodu + ); + +% Modulation port +FOR ALL gain_cause,r,k_s,out_cause,inp,sinp,inp_cause,modu,smodu +LET sFMR(gain_cause,r,k_s,out_cause,3, + inp,inp_cause,1, + sinp,inp_cause,2, + modu,flow,3, + smodu,flow,4 + ) + = 0; + +% Sensitivity modulation port +FOR ALL gain_cause,r,k_s,out_cause,inp,sinp,inp_cause,modu,smodu +LET sFMR(gain_cause,r,k_s,out_cause,4, + inp,inp_cause,1, + sinp,inp_cause,2, + modu,flow,3, + smodu,flow,4 + ) + = 0; +END; ADDED mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_desc.tex Index: mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_desc.tex ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_desc.tex +++ mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_desc.tex @@ -0,0 +1,34 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system sFMR (sFMR_desc.tex) +% Generated by MTT on Thu Jul 5 23:47:35 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{sFMR} is + displayed in Figure \Ref{fig:sFMR_abg.ps} and its label + file is listed in Section \Ref{sec:sFMR_lbl}. + The subsystems are listed in Section \Ref{sec:sFMR_sub}. + + +This is the sensitivity version of the \textbf{FMR} (flow-modulated +resistor) component. + +In the linear case, the CR of the standard port is: +\begin{equation} + e = mrf +\end{equation} +where $e$ is the effort, $m$ the (flow) modulation, $r$ the +``resistance'' and $f$ the flow. + +The corresponding sensitivity CR is: +\begin{equation} + e^\prime = m^\prime rf + mr^\prime f + mrf^\prime +\end{equation} ADDED mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_lbl.txt @@ -0,0 +1,38 @@ +#SUMMARY sFMR Sensitivity version of FMR (Flow-modulated R) + +## System sFMR, representation lbl, language txt +## File sFMR_lbl.txt +## Generated by MTT on Thu Jul 5 04:45:59 BST 2001 + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ############################################################### + +## Port aliases +#ALIAS in In,sIn +#ALIAS out Mod,sMod + + +## Argument aliases +#ALIAS $1 flow,r +#ALIAS $2 k_s + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type R + r sFMR flow,r,k_s + +## Component type SS + [In] SS external,external + [sIn] SS external,external + [Mod] SS external,external + [sMod] SS external,external + ADDED mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_rep.txt Index: mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_rep.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_rep.txt +++ mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_rep.txt @@ -0,0 +1,36 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system sFMR (sFMR_rep.txt) +## Generated by MTT on" Thu Jul 5 23:56:36 BST 2001. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt sFMR abg tex # The system description +mtt sFMR cr tex # The CR +##mtt sFMR cbg ps # The causal bond graph +mtt sFMR struc tex # The system structure +mtt sFMR sympar tex # The system parameters +## Uncomment the following lines or add others +mtt sFMR dae tex # The system dae +## mtt sFMR ode tex # The system ode +## mtt sFMR sspar tex # Steady-state parameters +## mtt sFMR ss tex # Steady state +## mtt sFMR dm tex # Descriptor matrices (of linearised system) +## mtt sFMR sm tex # State matrices (of linearised system) +## mtt sFMR tf tex # Transfer function (of linearised system) +## mtt sFMR lmfr ps # log modulus of frequency response (of linearised system) +## mtt sFMR simpar tex # Simulation parameters +## mtt sFMR numpar tex # Numerical simulation parameters +## mtt sFMR state tex # Simulation initial state +## mtt sFMR input tex # Simulation input +## mtt sFMR logic tex # Logic control +## mtt sFMR odeso ps # Simulation output + +## mtt sFMR rep txt # This file ADDED mtt/lib/comp/compound/Sensitivity/sFP/sFP_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sFP/sFP_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFP/sFP_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sFP/sFP_abg.fig @@ -0,0 +1,42 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 675 4050 675 3825 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 1350 4050 1350 3825 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 675 6075 675 5850 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 1350 6075 1350 5850 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2700 1125 2700 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2700 450 2700 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 450 4725 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 1125 4725 1575 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 7875 1800 1350 1800 1350 225 7875 225 7875 1800 +4 1 4 100 0 18 18 0.0000 4 270 810 2115 765 SS:[F]\001 +4 1 4 100 0 18 18 0.0000 4 270 960 2115 1395 SS:[sF]\001 +4 1 4 100 0 18 18 0.0000 4 270 960 6885 1440 SS:[sP]\001 +4 1 0 100 0 18 24 0.0000 4 285 510 4410 1125 R:r\001 +4 1 4 100 0 18 18 0.0000 4 270 810 6840 765 SS:[P]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 4860 540 [2]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 4860 1215 [4]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 3870 1215 [3]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 3870 540 [1]\001 +4 1 1 101 0 3 20 0.0000 4 195 165 3195 945 S\001 +4 1 1 101 0 3 20 0.0000 4 240 210 5535 945 Q\001 +4 1 1 101 0 3 20 0.0000 4 195 165 3195 450 T\001 +4 1 1 101 0 3 20 0.0000 4 195 135 3330 585 1\001 +4 1 1 101 0 3 20 0.0000 4 195 165 5445 450 T\001 +4 1 1 101 0 3 20 0.0000 4 195 135 5580 585 2\001 ADDED mtt/lib/comp/compound/Sensitivity/sFP/sFP_cr.r Index: mtt/lib/comp/compound/Sensitivity/sFP/sFP_cr.r ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFP/sFP_cr.r +++ mtt/lib/comp/compound/Sensitivity/sFP/sFP_cr.r @@ -0,0 +1,92 @@ +%% CR file for sFP + +OPERATOR sFP; + +% Entropy flow in + +% Ordinary FP port +% Temperature +FOR ALL Entropy,Temperature,sEntropy,sTemperature +LET sFP(effort,1, + Entropy,flow,1, + Temperature,effort,2, + sEntropy,flow,3, + sTemperature,effort,4 + ) + = Temperature; + +% Heat +FOR ALL Entropy,Temperature,sEntropy,sTemperature +LET sFP(flow,2, + Entropy,flow,1, + Temperature,effort,2, + sEntropy,flow,3, + sTemperature,effort,4 + ) + = Entropy*Temperature; + +% Temperature sensitivity +% Sensitivity FP port +FOR ALL Entropy,Temperature,sEntropy,sTemperature +LET sFP(effort,3, + Entropy,flow,1, + Temperature,effort,2, + sEntropy,flow,3, + sTemperature,effort,4 + ) + = sTemperature; + +% Heat sensitivity +FOR ALL Entropy,Temperature,sEntropy,sTemperature +LET sFP(flow,4, + Entropy,flow,1, + Temperature,effort,2, + sEntropy,flow,3, + sTemperature,effort,4 + ) + = (Entropy*sTemperature + sEntropy*Temperature); + +% Heat flow in + +% Ordinary FP port +% Temperature +FOR ALL Heat,Temperature,sHeat,sTemperature +LET sFP(effort,2, + Temperature,effort,1, + Heat,flow,2, + sTemperature,effort,3, + sHeat,flow,4 + ) + = Temperature; + +% Heat +FOR ALL Heat,Temperature,sHeat,sTemperature +LET sFP(flow,1, + Temperature,effort,1, + Heat,flow,2, + sTemperature,effort,3, + sHeat,flow,4 + ) + = Heat/Temperature; + +% Temperature sensitivity +% Sensitivity FP port +FOR ALL Heat,Temperature,sHeat,sTemperature +LET sFP(effort,4, + Temperature,effort,1, + Heat,flow,2, + sTemperature,effort,3, + sHeat,flow,4 + ) + = sTemperature; + +% Heat sensitivity +FOR ALL Heat,Temperature,sHeat,sTemperature +LET sFP(flow,3, + Temperature,effort,1, + Heat,flow,2, + sTemperature,effort,3, + sHeat,flow,4 + ) + = (sHeat*Temperature - Heat*sTemperature)/Temperature^2; +END; ADDED mtt/lib/comp/compound/Sensitivity/sFP/sFP_desc.tex Index: mtt/lib/comp/compound/Sensitivity/sFP/sFP_desc.tex ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFP/sFP_desc.tex +++ mtt/lib/comp/compound/Sensitivity/sFP/sFP_desc.tex @@ -0,0 +1,34 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system sFP (sFP_desc.tex) +% Generated by MTT on Fri Jul 6 01:55:23 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{sFP} is + displayed in Figure \Ref{fig:sFP_abg.ps} and its label + file is listed in Section \Ref{sec:sFP_lbl}. + The subsystems are listed in Section \Ref{sec:sFP_sub}. + +This is the sensitivity version of the \textbf{FP} (flow/power +real-pseuso component). + +The standard ports implement the CR: +\begin{align} + T_1 &= T_2 \\ + Q &= S*T_2 +\end{align} + +The \emph{sensitivity} ports implement the CR: +\begin{align} + T_1^\prime &= T_2^\prime \\ + Q^\prime &= S^\prime *T_2 + S*T_2^\prime +\end{align} + ADDED mtt/lib/comp/compound/Sensitivity/sFP/sFP_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sFP/sFP_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFP/sFP_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sFP/sFP_lbl.txt @@ -0,0 +1,34 @@ +#SUMMARY sFP Sensitivity version of FP - real-pseudo conversion + +## System sFP, representation lbl, language txt +## File sFP_lbl.txt +## Generated by MTT on Thu Jul 5 08:03:02 BST 2001 + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ############################################################### + +## Port aliases +#ALIAS in|f F,sF +#ALIAS out|p P,sP + + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type R + r sFP + +## Component type SS + [F] SS external,external + [P] SS external,external + [sF] SS external,external + [sP] SS external,external + ADDED mtt/lib/comp/compound/Sensitivity/sFP/sFP_rep.txt Index: mtt/lib/comp/compound/Sensitivity/sFP/sFP_rep.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sFP/sFP_rep.txt +++ mtt/lib/comp/compound/Sensitivity/sFP/sFP_rep.txt @@ -0,0 +1,36 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system sFP (sFP_rep.txt) +## Generated by MTT on" Fri Jul 6 02:04:19 BST 2001. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt sFP abg tex # The system description +mtt sFP cr tex # The system description +##mtt sFP cbg ps # The causal bond graph +mtt sFP struc tex # The system structure +mtt sFP sympar tex # The system parameters +## Uncomment the following lines or add others +mtt sFP dae tex # The system dae +## mtt sFP ode tex # The system ode +## mtt sFP sspar tex # Steady-state parameters +## mtt sFP ss tex # Steady state +## mtt sFP dm tex # Descriptor matrices (of linearised system) +## mtt sFP sm tex # State matrices (of linearised system) +## mtt sFP tf tex # Transfer function (of linearised system) +## mtt sFP lmfr ps # log modulus of frequency response (of linearised system) +## mtt sFP simpar tex # Simulation parameters +## mtt sFP numpar tex # Numerical simulation parameters +## mtt sFP state tex # Simulation initial state +## mtt sFP input tex # Simulation input +## mtt sFP logic tex # Logic control +## mtt sFP odeso ps # Simulation output + +## mtt sFP rep txt # This file ADDED mtt/lib/comp/compound/Sensitivity/sGY/sGY_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sGY/sGY_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sGY/sGY_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sGY/sGY_abg.fig @@ -0,0 +1,32 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 450 3825 450 3600 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 1125 3825 1125 3600 1350 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5175 450 6525 450 6300 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5175 1125 6525 1125 6300 1350 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7200 450 8550 450 8325 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7200 1125 8550 1125 8325 1350 +4 1 4 100 0 18 20 0.0000 4 270 1920 1440 540 SS:[Actual_in]\001 +4 1 0 100 0 18 20 0.0000 4 210 960 4545 855 sTF:stf\001 +4 1 4 100 0 18 20 0.0000 4 270 1740 1440 1215 SS:[Sens_in]\001 +4 1 0 100 0 18 20 0.0000 4 210 420 6840 540 GY\001 +4 1 0 100 0 18 20 0.0000 4 210 420 6840 1215 GY\001 +4 1 4 100 0 18 20 0.0000 4 270 2115 9765 540 SS:[Actual_out]\001 +4 1 4 100 0 18 20 0.0000 4 270 1935 9765 1215 SS:[Sens_out]\001 +4 1 4 100 0 18 14 0.0000 4 210 1125 3825 315 [Actual_in]\001 +4 1 4 100 0 18 14 0.0000 4 210 1275 5175 315 [Actual_out]\001 +4 1 4 100 0 18 14 0.0000 4 210 1140 5175 1575 [Sens_out]\001 +4 1 4 100 0 18 14 0.0000 4 210 990 3870 1575 [Sens_in]\001 ADDED mtt/lib/comp/compound/Sensitivity/sGY/sGY_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sGY/sGY_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sGY/sGY_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sGY/sGY_lbl.txt @@ -0,0 +1,38 @@ +%% Label file for system sGY (sGY_lbl.txt) +%SUMMARY sGY GY component with sensitivity ports +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Actual_in,Sens_in +%ALIAS out Actual_out,Sens_out + + +% Argument aliases +%ALIAS $1 flow,k +%ALIAS $2 k_s + +%ALIAS $1 lin + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- +% Component type sTF + stf lin flow,k;k_s + +% Component type SS + [Actual_in] SS external,external + [Actual_out] SS external,external + [Sens_in] SS external,external + [Sens_out] SS external,external + ADDED mtt/lib/comp/compound/Sensitivity/sI/sI_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sI/sI_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sI/sI_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sI/sI_abg.fig @@ -0,0 +1,20 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 3375 5400 3375 5625 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 3375 4500 3375 4275 3600 +2 4 0 3 31 7 101 0 -1 0.000 0 0 11 0 0 5 + 9000 4725 1350 4725 1350 2253 9000 2253 9000 4725 +4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 +4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 +4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 +4 1 0 100 0 18 18 0.0000 4 210 390 4950 3465 I:m\001 ADDED mtt/lib/comp/compound/Sensitivity/sI/sI_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sI/sI_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sI/sI_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sI/sI_lbl.txt @@ -0,0 +1,40 @@ +%% Label file for system sI (sI_lbl.txt) +%SUMMARY sI Sensitivity I component +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2001/04/05 12:00:18 gawthrop +% %% Identification example +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in actual,sensitivity + +% Argument aliases +%ALIAS $1 flow,m +%ALIAS $2 ms + +%CR alias +%ALIAS $1 slin + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- +% Component type C + m slin flow,m;ms + +% Component type SS + [actual] SS external,external + [sensitivity] SS external,external + + + ADDED mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2925 3150 2925 2925 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2250 3150 2250 2925 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 2925 6300 2925 6075 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 2250 6300 2250 6075 2475 +4 1 4 100 0 18 20 0.0000 4 270 1200 990 3015 SS:[in_2]\001 +4 1 4 100 0 18 20 0.0000 4 270 1200 990 2340 SS:[in_1]\001 +4 1 0 100 0 18 20 0.0000 4 270 1455 4050 3015 INTF:intf_2\001 +4 1 0 100 0 18 20 0.0000 4 270 1455 4050 2340 INTF:intf_1\001 +4 1 4 100 0 18 20 0.0000 4 270 1395 7245 3015 SS:[out_2]\001 +4 1 4 100 0 18 20 0.0000 4 270 1395 7245 2340 SS:[out_1]\001 ADDED mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_lbl.txt @@ -0,0 +1,37 @@ +%% Label file for system sINTF (sINTF_lbl.txt) +%SUMMARY sINTF Sensitivity version of INTF +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 10:32:30 peterg +% %% Put under RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in_1,in_2 +%ALIAS out out_1,out_2 + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type INTF + intf_1 + intf_2 + +% Component type SS + [in_1] SS external,external + [in_2] SS external,external + [out_1] SS external,external + [out_2] SS external,external ADDED mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2925 3150 2925 2925 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1800 2250 3150 2250 2925 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 2925 6300 2925 6075 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 2250 6300 2250 6075 2475 +4 1 4 100 0 18 20 0.0000 4 270 1200 990 3015 SS:[in_2]\001 +4 1 4 100 0 18 20 0.0000 4 270 1200 990 2340 SS:[in_1]\001 +4 1 0 100 0 18 20 0.0000 4 270 1650 4050 3015 INTFS:intf_2\001 +4 1 4 100 0 18 20 0.0000 4 270 1395 7245 3015 SS:[out_2]\001 +4 1 4 100 0 18 20 0.0000 4 270 1395 7245 2340 SS:[out_1]\001 +4 1 0 100 0 18 20 0.0000 4 270 1650 4095 2340 INTFS:intf_1\001 ADDED mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_lbl.txt @@ -0,0 +1,39 @@ +%% Label file for system sINTFS (sINTFS_lbl.txt) +%SUMMARY sINTFS Sensitivity version of INTF with initial state +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 10:32:30 peterg +% %% Put under RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in_1,in_2 +%ALIAS out out_1,out_2 + +% Argument aliases +%ALIAS $1 e_0 +%ALIAS $2 k_s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type INTFS + intf_1 none e_0 + intf_2 none k_s + +% Component type SS + [in_1] SS external,external + [in_2] SS external,external + [out_1] SS external,external + [out_2] SS external,external ADDED mtt/lib/comp/compound/Sensitivity/sIS/sIS_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sIS/sIS_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sIS/sIS_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sIS/sIS_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 3825 2475 2475 2700 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 5625 2475 4275 2700 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4050 4050 4050 3825 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 3825 4050 4275 +2 4 0 2 31 7 52 0 -1 0.000 0 0 7 0 0 5 + 6075 6300 6075 1350 1125 1350 1125 6300 6075 6300 +4 1 0 100 0 18 20 0.0000 4 210 405 2475 2295 sI:i\001 +4 0 0 100 0 18 20 0.0000 4 270 960 4185 4185 sSf:f_0\001 +4 1 6 100 0 18 20 0.0000 4 270 555 2476 6031 [1,2]\001 +4 1 4 100 0 18 20 0.0000 4 270 900 2476 6030 SS:[in]\001 +4 1 6 100 0 18 20 0.0000 4 270 555 2476 4186 [1,2]\001 +4 1 0 100 0 18 20 0.0000 4 195 150 2476 4185 0\001 ADDED mtt/lib/comp/compound/Sensitivity/sIS/sIS_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sIS/sIS_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sIS/sIS_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sIS/sIS_lbl.txt @@ -0,0 +1,40 @@ +%% Label file for system sIS (sIS_lbl.txt) +%SUMMARY sIS +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:29:10 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Port aliases +%ALIAS in in_1,in_2 + +% Argument aliases +%ALIAS $1 flow,i +%ALIAS $2 f_0 +%ALIAS $3 i_s +%ALIAS $4 f_0s + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [in] SS external,external + +% Component type sI + i slin flow,i;i_s + +% Component type sSf + f_0 SS f_0;f_0s ADDED mtt/lib/comp/compound/Sensitivity/sR/sR_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sR/sR_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sR/sR_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sR/sR_abg.fig @@ -0,0 +1,20 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 3375 5400 3375 5625 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 3375 4500 3375 4275 3600 +2 4 0 3 31 7 101 0 -1 0.000 0 0 11 0 0 5 + 9000 4725 1350 4725 1350 2253 9000 2253 9000 4725 +4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 +4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 +4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 +4 1 0 100 0 18 18 0.0000 4 210 390 4950 3465 R:r\001 ADDED mtt/lib/comp/compound/Sensitivity/sR/sR_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sR/sR_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sR/sR_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sR/sR_lbl.txt @@ -0,0 +1,39 @@ +%% Label file for system sR (sR_lbl.txt) +%SUMMARY sR Sensitivity R component +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2001/04/05 12:00:18 gawthrop +% %% Identification example +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in actual,sensitivity + +% Argument aliases +%ALIAS $1 flow,r +%ALIAS $2 rs + +%CR alias +%ALIAS $1 slin + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + r slin flow,r;rs + +% Component type SS + [actual] SS external,external + [sensitivity] SS external,external + + + ADDED mtt/lib/comp/compound/Sensitivity/sRS/sRS_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sRS/sRS_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sRS/sRS_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sRS/sRS_abg.fig @@ -0,0 +1,36 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 675 4050 675 3825 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 1350 4050 1350 3825 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 1125 4050 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 450 4050 900 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 9900 1800 1350 1800 1350 225 9900 225 9900 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 675 6075 675 5850 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 1350 6075 1350 5850 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 1125 4725 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 450 4725 900 +4 1 4 100 0 18 18 0.0000 4 270 870 2115 765 SS:[In]\001 +4 1 4 100 0 18 18 0.0000 4 270 1020 2115 1395 SS:[sIn]\001 +4 1 0 100 0 18 24 0.0000 4 285 510 4410 1125 R:r\001 +4 1 4 100 0 18 14 0.0000 4 210 270 4860 540 [2]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 4860 1215 [4]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 3870 1215 [3]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 3870 540 [1]\001 +4 1 4 100 0 18 18 0.0000 4 270 1230 6795 765 SS:[Out]\001 +4 1 4 100 0 18 18 0.0000 4 270 1380 6885 1440 SS:[sOut]\001 ADDED mtt/lib/comp/compound/Sensitivity/sRS/sRS_cr.r Index: mtt/lib/comp/compound/Sensitivity/sRS/sRS_cr.r ================================================================== --- mtt/lib/comp/compound/Sensitivity/sRS/sRS_cr.r +++ mtt/lib/comp/compound/Sensitivity/sRS/sRS_cr.r @@ -0,0 +1,68 @@ +%% CR file for sFMR +%% Just for flow input definition of r, ie must use with flow,r;k_s + +in "$MTT_CRS/r/slin.cr"; %% make sure CR slin is there + +OPERATOR sRS; + +% Ordinary RS port +% R component +FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp +LET sRS(gain_cause,r,rs,out_cause,1, + inp,in_cause,1, + temp,effort,2, + sinp,in_cause,3, + stemp,effort,4 + ) + = lin(gain_cause,r,temp_cause,1, + inp,in_cause,1); +% Entropy flow +FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp +LET sRS(gain_cause,r,rs,out_cause,2, + inp,in_cause,1, + temp,effort,2, + sinp,in_cause,3, + stemp,effort,4 + ) + = inp*lin(gain_cause,r,temp_cause,1, + inp,in_cause,1)/temp; + +% Sensitivity ports +FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp +LET sRS(gain_cause,r,rs,out_cause,3, + inp,in_cause,1, + temp,effort,2, + sinp,in_cause,3, + stemp,effort,4 + ) + = slin(gain_cause,r,rs,temp_cause,2, + inp,in_cause,1, + sinp,in_cause,2 + ); + +%% Sensitivity entropy flow +%% - flow in +FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp +LET sRS(gain_cause,r,rs,out_cause,4, + inp,flow,1, + temp,effort,2, + sinp,flow,3, + stemp,effort,4 + ) + = 2*inp*sinp*r/temp + + (inp^2)*rs/temp + - (inp^2)*r*stemp/(temp^2); + +%% - effort in +FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp +LET sRS(gain_cause,r,rs,out_cause,4, + inp,effort,1, + temp,effort,2, + sinp,effort,3, + stemp,effort,4 + ) + = 2*inp*sinp/(r*temp) + - (inp^2)*rs/((r^2)*temp) + - (inp^2)*stemp/(r*temp^2); + +END; ADDED mtt/lib/comp/compound/Sensitivity/sRS/sRS_desc.tex Index: mtt/lib/comp/compound/Sensitivity/sRS/sRS_desc.tex ================================================================== --- mtt/lib/comp/compound/Sensitivity/sRS/sRS_desc.tex +++ mtt/lib/comp/compound/Sensitivity/sRS/sRS_desc.tex @@ -0,0 +1,37 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system sRS (sFMR_desc.tex) +% Generated by MTT on Thu Jul 5 23:47:35 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2001/07/06 01:17:14 gawthrop +% %% New sensitivity components (for extruder model) +% %% +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{sRS} is + displayed in Figure \Ref{fig:sFMR_abg.ps} and its label + file is listed in Section \Ref{sec:sFMR_lbl}. + The subsystems are listed in Section \Ref{sec:sFMR_sub}. + + +This is the sensitivity version of the \textbf{FMR} (flow-modulated +resistor) component. + +In the linear case, the CR of the standard port is: +\begin{equation} + e = mrf +\end{equation} +where $e$ is the effort, $m$ the (flow) modulation, $r$ the +``resistance'' and $f$ the flow. + +The corresponding sensitivity CR is: +\begin{equation} + e^\prime = m^\prime rf + mr^\prime f + mrf^\prime +\end{equation} ADDED mtt/lib/comp/compound/Sensitivity/sRS/sRS_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sRS/sRS_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sRS/sRS_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sRS/sRS_lbl.txt @@ -0,0 +1,29 @@ +#SUMMARY sRS Sensitivity version of RS + +## System sRS, representation lbl, language txt + +## Port aliases +#ALIAS in In,sIn +#ALIAS out Out,sOut + + +## Argument aliases +#ALIAS $1 flow,r +#ALIAS $2 rs + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type R + r sRS flow,r;rs + +## Component type SS + [In] SS external,external + [sIn] SS external,external + [Out] SS external,external + [sOut] SS external,external + ADDED mtt/lib/comp/compound/Sensitivity/sRS/sRS_rep.txt Index: mtt/lib/comp/compound/Sensitivity/sRS/sRS_rep.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sRS/sRS_rep.txt +++ mtt/lib/comp/compound/Sensitivity/sRS/sRS_rep.txt @@ -0,0 +1,39 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system sRS (sFMR_rep.txt) +## Generated by MTT on" Thu Jul 5 23:56:36 BST 2001. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2001/07/06 01:18:24 gawthrop +## New sensitivity components - documentation +## +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt sRS abg tex # The system description +mtt sRS cr tex # The CR +##mtt sRS cbg ps # The causal bond graph +mtt sRS struc tex # The system structure +mtt sRS sympar tex # The system parameters +## Uncomment the following lines or add others +mtt sRS dae tex # The system dae +## mtt sRS ode tex # The system ode +## mtt sRS sspar tex # Steady-state parameters +## mtt sRS ss tex # Steady state +## mtt sRS dm tex # Descriptor matrices (of linearised system) +## mtt sRS sm tex # State matrices (of linearised system) +## mtt sRS tf tex # Transfer function (of linearised system) +## mtt sRS lmfr ps # log modulus of frequency response (of linearised system) +## mtt sRS simpar tex # Simulation parameters +## mtt sRS numpar tex # Numerical simulation parameters +## mtt sRS state tex # Simulation initial state +## mtt sRS input tex # Simulation input +## mtt sRS logic tex # Logic control +## mtt sRS odeso ps # Simulation output + +## mtt sRS rep txt # This file ADDED mtt/lib/comp/compound/Sensitivity/sRT/sRT_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sRT/sRT_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sRT/sRT_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sRT/sRT_abg.fig @@ -0,0 +1,60 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 2701 5625 2701 5400 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 2701 7425 2701 7200 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 2476 5850 1126 6075 1351 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11475 3600 450 3600 450 451 11475 451 11475 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 2701 3375 2701 3150 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 2701 9675 2701 9450 2926 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3375 2520 3375 2970 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 8325 2475 8325 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5625 2475 5625 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6075 2475 6075 2925 +4 1 6 0 0 0 20 0.0000 4 240 510 5851 2792 [1,2]\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5851 2791 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 480 5850 991 sR:r\001 +4 1 4 0 0 0 20 0.0000 4 255 315 4410 2476 [p]\001 +4 1 4 0 0 0 20 0.0000 4 255 315 7290 2476 [p]\001 +4 1 1 1 0 3 20 0.0000 4 240 210 5040 3106 Q\001 +4 1 1 1 0 3 30 0.0000 4 60 105 5085 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 5040 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 240 210 6615 3106 Q\001 +4 1 1 1 0 3 30 0.0000 4 60 105 6660 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 6615 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 6795 2611 2\001 +4 1 1 1 0 3 20 0.0000 4 195 135 5220 2611 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 870 3825 2790 sFP:fp1\001 +4 2 6 0 0 0 20 0.0000 4 240 510 1981 2791 [1,2]\001 +4 2 4 0 0 0 20 0.0000 4 240 810 1981 2790 SS:[in]\001 +4 1 4 0 0 0 20 0.0000 4 240 270 3285 2476 [f]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 3106 S\001 +4 1 1 1 0 3 30 0.0000 4 60 105 2520 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2610 2611 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2610 3241 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 870 7920 2790 sFP:fp2\001 +4 1 4 0 0 0 20 0.0000 4 240 270 8505 2476 [f]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9090 3106 S\001 +4 1 1 1 0 3 30 0.0000 4 60 105 9135 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9090 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 9270 3241 2\001 +4 1 1 1 0 3 20 0.0000 4 195 135 9270 2611 2\001 +4 0 6 0 0 0 20 0.0000 4 240 510 9811 2792 [1,2]\001 +4 0 4 0 0 0 20 0.0000 4 240 960 9811 2791 SS:[out]\001 ADDED mtt/lib/comp/compound/Sensitivity/sRT/sRT_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sRT/sRT_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sRT/sRT_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sRT/sRT_lbl.txt @@ -0,0 +1,39 @@ +#SUMMARY sRT Sensitivity version of RT + +## System sRT, representation lbl, language txt +## File sRT_lbl.txt +## Generated by MTT on Fri Jul 6 05:51:50 BST 2001 + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ############################################################### + +## Port aliases +#ALIAS in in_1,in_2 +#ALIAS out out_1,out_2 + +## Argument aliases +#ALIAS $1 flow,r +#ALIAS $2 rs + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type SS + [in] SS external,external + [out] SS external,external + +## Component type FP + fp1 lin + fp2 lin + +## Component type R + r slin flow,r;rs + ADDED mtt/lib/comp/compound/Sensitivity/sSe/sSe_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sSe/sSe_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sSe/sSe_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sSe/sSe_abg.fig @@ -0,0 +1,17 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 2025 3600 2025 3375 2250 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 1350 3600 1350 3375 1575 +4 1 0 100 0 18 20 0.0000 4 270 1080 1485 2115 Se:se_2\001 +4 1 4 100 0 18 20 0.0000 4 270 1515 4500 2115 SS:[port_2]\001 +4 1 4 100 0 18 20 0.0000 4 270 1515 4545 1440 SS:[port_1]\001 +4 1 0 100 0 18 20 0.0000 4 270 1080 1485 1440 Se:se_1\001 ADDED mtt/lib/comp/compound/Sensitivity/sSe/sSe_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sSe/sSe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sSe/sSe_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sSe/sSe_lbl.txt @@ -0,0 +1,38 @@ +%% Label file for system sSe (sSe_lbl.txt) +%SUMMARY sSe Sensitivity version of effort source (Se) +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/07/29 04:54:41 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in|out port_1,port_2 + +% Argument aliases +%ALIAS $1 e_s +%ALIAS $2 k_s + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [port_1] SS external,external + [port_2] SS external,external + +% Component type Se + se_1 SS e_s + se_2 SS k_s + ADDED mtt/lib/comp/compound/Sensitivity/sSe/sSe_sSe_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sSe/sSe_sSe_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sSe/sSe_sSe_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sSe/sSe_sSe_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 900 1215 2070 1530 +4 1 0 100 0 18 20 0.0000 4 285 1155 1485 1440 Sf:sf_1\001 +-6 +6 900 1890 2070 2205 +4 1 0 100 0 18 20 0.0000 4 285 1155 1485 2115 Sf:sf_2\001 +-6 +6 2205 1305 3645 1620 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 1350 3600 1350 3375 1575 +-6 +6 2205 1980 3645 2295 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 2025 3600 2025 3375 2250 +-6 +6 3735 1215 5355 1530 +4 1 4 100 0 18 20 0.0000 4 300 1620 4545 1440 SS:[port_1]\001 +-6 +6 3690 1890 5310 2205 +4 1 4 100 0 18 20 0.0000 4 300 1620 4500 2115 SS:[port_2]\001 +-6 ADDED mtt/lib/comp/compound/Sensitivity/sSf/sSf_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sSf/sSf_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sSf/sSf_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sSf/sSf_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 900 1215 2070 1530 +4 1 0 100 0 18 20 0.0000 4 285 1155 1485 1440 Sf:sf_1\001 +-6 +6 900 1890 2070 2205 +4 1 0 100 0 18 20 0.0000 4 285 1155 1485 2115 Sf:sf_2\001 +-6 +6 2205 1305 3645 1620 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 1350 3600 1350 3375 1575 +-6 +6 2205 1980 3645 2295 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 2025 3600 2025 3375 2250 +-6 +6 3735 1215 5355 1530 +4 1 4 100 0 18 20 0.0000 4 300 1620 4545 1440 SS:[port_1]\001 +-6 +6 3690 1890 5310 2205 +4 1 4 100 0 18 20 0.0000 4 300 1620 4500 2115 SS:[port_2]\001 +-6 ADDED mtt/lib/comp/compound/Sensitivity/sSf/sSf_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sSf/sSf_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sSf/sSf_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sSf/sSf_lbl.txt @@ -0,0 +1,38 @@ +%% Label file for system sSf (sSf_lbl.txt) +%SUMMARY sSf Sensitivity version of flow source (Sf) +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/07/29 04:54:41 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in|out port_1,port_2 + +% Argument aliases +%ALIAS $1 f_s +%ALIAS $2 k_s + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [port_1] SS external,external + [port_2] SS external,external + +% Component type Sf + sf_1 SS f_s + sf_2 SS k_s + ADDED mtt/lib/comp/compound/Sensitivity/sTF/sTF_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sTF/sTF_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sTF/sTF_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sTF/sTF_abg.fig @@ -0,0 +1,49 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 4050 3825 4050 3600 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4050 5625 4050 5400 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7650 4050 9000 4050 8775 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9450 4050 10800 4050 10575 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 450 3825 450 3600 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 450 5625 450 5400 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7650 450 9000 450 8775 675 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9450 450 10800 450 10575 675 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 2520 9225 3825 9225 3600 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9231 2498 4056 3803 4056 3578 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 675 4050 2025 4275 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9225 675 9225 2025 9450 1800 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 3825 675 4275 675 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 9000 2025 9450 2025 +4 1 4 100 0 18 20 0.0000 4 270 1740 1440 4140 SS:[Sens_in]\001 +4 1 0 100 0 18 20 0.0000 4 195 150 4050 4140 1\001 +4 1 0 100 0 18 20 0.0000 4 210 1095 6660 4140 TF:sens\001 +4 1 0 100 0 18 20 0.0000 4 195 150 9225 4140 0\001 +4 1 4 100 0 18 20 0.0000 4 270 1935 12015 4140 SS:[Sens_out]\001 +4 1 4 100 0 18 20 0.0000 4 270 1920 1440 540 SS:[Actual_in]\001 +4 1 0 100 0 18 20 0.0000 4 195 150 4050 540 1\001 +4 1 0 100 0 18 20 0.0000 4 195 150 9225 540 0\001 +4 1 4 100 0 18 20 0.0000 4 270 2115 12015 540 SS:[Actual_out]\001 +4 1 0 100 0 18 20 0.0000 4 210 825 9180 2340 AE:ae\001 +4 1 0 100 0 18 20 0.0000 4 210 750 4050 2340 AF:af\001 +4 1 0 100 0 18 20 0.0000 4 210 1260 6660 540 TF:actual\001 ADDED mtt/lib/comp/compound/Sensitivity/sTF/sTF_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sTF/sTF_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sTF/sTF_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sTF/sTF_lbl.txt @@ -0,0 +1,52 @@ +%% Label file for system sTF (sTF_lbl.txt) +%SUMMARY sTF TF component with sensitivity ports +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1999/08/26 01:34:59 peterg +% %% Summary line added +% %% +% %% Revision 1.2 1999/08/26 01:22:25 peterg +% %% New alias $1 flow,k +% %% +% %% Revision 1.1 1999/08/26 00:15:58 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Actual_in,Sens_in +%ALIAS out Actual_out,Sens_out + + +% Argument aliases +%ALIAS $1 flow,k +%ALIAS $2 k_s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AE + ae lin effort,-k_s + +% Component type AF + af lin flow,k_s + +% Component type SS + [Actual_in] SS external,external + [Actual_out] SS external,external + [Sens_in] SS external,external + [Sens_out] SS external,external + +% Component type TF + actual lin flow,k + sens lin flow,k ADDED mtt/lib/comp/compound/Sensitivity/sTF/testsTF_abg.fig Index: mtt/lib/comp/compound/Sensitivity/sTF/testsTF_abg.fig ================================================================== --- mtt/lib/comp/compound/Sensitivity/sTF/testsTF_abg.fig +++ mtt/lib/comp/compound/Sensitivity/sTF/testsTF_abg.fig @@ -0,0 +1,20 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 2925 6075 2925 5850 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2250 2700 2250 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 2925 3600 2925 3375 3150 +4 1 0 100 0 18 18 0.0000 4 210 930 4185 3060 sTF:stf\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 1620 3015 SS:ss_1\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 6750 3015 SS:ss_2\001 +4 1 4 100 0 18 14 0.0000 4 210 450 2385 2700 [1,2]\001 +4 1 4 100 0 18 14 0.0000 4 210 450 6030 2790 [1,2]\001 ADDED mtt/lib/comp/compound/Sensitivity/sTF/testsTF_lbl.txt Index: mtt/lib/comp/compound/Sensitivity/sTF/testsTF_lbl.txt ================================================================== --- mtt/lib/comp/compound/Sensitivity/sTF/testsTF_lbl.txt +++ mtt/lib/comp/compound/Sensitivity/sTF/testsTF_lbl.txt @@ -0,0 +1,34 @@ +#SUMMARY testsTF +#DESCRIPTION Detailed description here + +## System testsTF, representation lbl, language txt +## File testsTF_lbl.txt +## Generated by MTT on Thu Aug 9 12:38:50 BST 2001 + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ############################################################### + +## Port aliases + +## Argument aliases +#ALIAS $1 k +#ALIAS $2 k_s + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type + ss_1 SS external,external + ss_2 SS external,external + +## Component type sTF + stf slin flow,n;n_s + ADDED mtt/lib/comp/compound/Thermal/CT/CT_abg.fig Index: mtt/lib/comp/compound/Thermal/CT/CT_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CT/CT_abg.fig +++ mtt/lib/comp/compound/Thermal/CT/CT_abg.fig @@ -0,0 +1,26 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 2700 3375 2700 3150 2925 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 5850 3825 5850 1575 225 1575 225 3825 5850 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 2700 5625 2700 5400 2925 +4 1 4 0 0 0 20 0.0000 4 240 270 3285 2475 [f]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 3105 S\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 2475 T\001 +4 1 1 1 0 3 30 0.0000 4 60 105 2520 2835 .\001 +4 2 4 0 0 0 20 0.0000 4 240 810 1980 2790 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 630 3825 2790 FP:fp\001 +4 1 4 0 0 0 20 0.0000 4 255 315 4410 2475 [p]\001 +4 1 1 1 0 3 20 0.0000 4 240 210 4950 3105 Q\001 +4 1 1 1 0 3 20 0.0000 4 195 165 4950 2475 T\001 +4 1 1 1 0 3 30 0.0000 4 60 105 4995 2835 .\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 5940 2790 C:c\001 ADDED mtt/lib/comp/compound/Thermal/CT/CT_desc.tex Index: mtt/lib/comp/compound/Thermal/CT/CT_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CT/CT_desc.tex +++ mtt/lib/comp/compound/Thermal/CT/CT_desc.tex @@ -0,0 +1,7 @@ + +Component \textbf{CT} is a two port thermal resistor with true power +bonds. Internally, it has a pseudo Bond Graph representation, and the +corresponding thermal resistance just acts as an ordinary one-port +\textbf{C} component. + + ADDED mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt Index: mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt +++ mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt @@ -0,0 +1,60 @@ +%SUMMARY CT: One-port thermal C component with T/Sdot bond +%DESCRIPTION CR and parameters as for a one-port C component +%DESCRIPTION Internally pseudo +%DESCRIPTION Example label file entry: +%DESCRIPTION % Component type CT +%DESCRIPTION c lin effort,c + +%Port aliases +%ALIAS Thermal|out in + +%CR aliases +%ALIAS $1 effort,c_t +%ALIAS $a1 lin + +%% Label file for system CT (CT_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.7 2001/07/03 22:59:10 gawthrop +% %% Fixed problems with argument passing for CRs +% %% +% %% Revision 1.6 2001/06/13 17:10:26 gawthrop +% %% Alias for the cr (ie ALIAS $1 lin) +% %% +% %% Revision 1.5 2001/06/11 15:09:18 gawthrop +% %% Removed spurious parameter +% %% +% %% Revision 1.4 1998/07/22 11:28:15 peterg +% %% Out as port alias +% %% +% %% Revision 1.3 1998/07/22 11:27:41 peterg +% %% Changed port name +% %% +% %% Revision 1.2 1998/06/29 10:12:58 peterg +% %% Converted to FP component +% %% Removed FP label +% %% +% %% Revision 1.1 1997/09/04 09:49:19 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c lin effort,c_t + +% Component type FP + fp + +% Component type SS + [in] SS external,external ADDED mtt/lib/comp/compound/Thermal/CT2/CT2.cr Index: mtt/lib/comp/compound/Thermal/CT2/CT2.cr ================================================================== --- mtt/lib/comp/compound/Thermal/CT2/CT2.cr +++ mtt/lib/comp/compound/Thermal/CT2/CT2.cr @@ -0,0 +1,44 @@ +%SUMMARY CT2 Constitutive Relationship for a two port thermo C +%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) +%DESCRIPTION Parameter 2: gamma = c_p/c_v +%DESCRIPTION Parameter 3: mass of (ideal) gas within component. +%DESCRIPTION Parameter 4: t_0 -- the temperature at which internal +%DESCRIPTION energy is zero. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/12/07 20:45:21 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/02 10:21:19 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/09/12 11:18:26 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +OPERATOR CT2; +Port 1 - Thermal +FOR ALL c_v,gamma,m,t_0,InternalEnergy,Volume +LET CT2(c_v,gamma,m,t_0,effort,1, + InternalEnergy, state, 1, + Volume, state, 2) + = InternalEnergy/(m*c_v); + +Port 2 - Mechanical +FOR ALL c_v,gamma,m,t_0,InternalEnergy,Volume +LET CT2(c_v,gamma,m,t_0,effort,2, + InternalEnergy, state, 1, + Volume, state, 2) + = (gamma-1)*(InternalEnergy+c_v*m*t_0)/Volume; + +END; ADDED mtt/lib/comp/compound/Thermal/CT2/CT2_abg.fig Index: mtt/lib/comp/compound/Thermal/CT2/CT2_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CT2/CT2_abg.fig +++ mtt/lib/comp/compound/Thermal/CT2/CT2_abg.fig @@ -0,0 +1,57 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2700 5400 4050 5400 3825 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 5400 4725 5400 4950 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 3825 2475 5175 2700 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 2025 2475 3375 2700 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 3825 6525 5175 6750 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 3375 6525 2025 6750 2250 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 5085 5895 5085 4950 3690 4950 3690 5895 5085 5895 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 2024 6750 3262 5512 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 5175 2700 5625 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6075 5175 6075 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 6525 5625 6525 6750 4500 6750 4725 6975 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 2475 5625 2475 6750 4050 6750 3825 6975 +4 1 4 0 0 0 20 0.0000000 4 240 345 2250 4005 [e]\001 +4 1 4 0 0 0 20 0.0000000 4 240 330 2250 3375 [s]\001 +4 0 -1 0 0 0 20 0.0000000 4 210 150 2430 5490 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 420 4410 5490 C:c\001 +4 1 -1 0 0 0 20 0.0000000 4 270 690 6525 5490 PS:ps\001 +4 0 4 0 0 0 20 0.0000000 4 270 960 6660 5850 [power]\001 +4 1 -1 0 0 0 20 0.0000000 4 210 690 2430 3690 ES:es\001 +4 1 4 0 0 0 20 0.0000000 4 240 870 2475 1845 SS:[in]\001 +4 2 4 0 0 0 20 0.0000000 4 240 600 5985 5265 [out]\001 +4 0 4 0 0 0 20 0.0000000 4 240 450 6750 5175 [in]\001 +4 0 -1 0 0 0 20 0.0000000 4 210 150 6435 3690 0\001 +4 1 4 0 0 0 20 0.0000000 4 240 1020 6480 1890 SS:[out]\001 +4 1 1 1 0 3 20 0.0000000 4 240 2340 6480 1530 Mechanical Power\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 2160 2700 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 6300 2700 P\001 +4 0 1 1 0 3 20 0.0000000 4 210 675 6660 2700 dV/dt\001 +4 1 1 1 0 3 20 0.0000000 4 240 1935 2475 1530 Thermal Power\001 +4 0 1 1 0 3 20 0.0000000 4 210 720 2610 4365 dH/dt\001 +4 1 1 1 0 3 20 0.0000000 4 255 840 1935 4365 T-T_0\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 6300 4365 P\001 +4 0 1 1 0 3 20 0.0000000 4 210 855 6705 4365 -dV/dt\001 +4 2 1 1 0 3 20 0.0000000 4 210 1755 2025 6660 dH/dt-PdV/dt\001 +4 1 1 1 0 3 20 0.0000000 4 270 1485 4365 4770 Two-port C\001 +4 1 4 0 0 0 20 0.0000000 4 240 450 4050 5265 [in]\001 +4 1 4 0 0 0 20 0.0000000 4 240 600 4770 5265 [out]\001 +4 0 1 1 0 3 20 0.0000000 4 210 855 4005 7335 PdV/dt\001 +4 0 -1 0 0 0 20 0.0000000 4 210 150 4230 6840 1\001 ADDED mtt/lib/comp/compound/Thermal/CT2/CT2_desc.tex Index: mtt/lib/comp/compound/Thermal/CT2/CT2_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CT2/CT2_desc.tex +++ mtt/lib/comp/compound/Thermal/CT2/CT2_desc.tex @@ -0,0 +1,41 @@ +% Verbal description for system CT2 (CT2_desc.tex) +% Generated by MTT on Thu Dec 4 16:00:14 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/12/07 20:29:56 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{CT2} is + displayed in Figure \Ref{CT2_abg} and its label + file is listed in Section \Ref{sec:CT2_lbl}. + The subsystems are listed in Section \Ref{sec:CT2_sub}. + +\textbf{CT2} is a two port thermal capacitor representing an ideal +heat engine converting heat to work without energy loss. There are two +ports {\bf [in]} (with covariables Temperature (absolute) and +entropy flow) and {\bf [out]} with covariables Pressure and rate of +change of volume. + +Rather than using the corresponding (nonlinear) Constitutive +Relationship (with entropy and volume as states) directly, the +component is built up from a {\em linear\/} two-port capacitor with +internal energy and volume as states. The {\bf ES} component provides +the conversion from the pseudo Bond Graph with temperature (relative) +and enthalpy flow as covariables to the true Bond Graph with with +covariables Temperature (absolute) and entropy flow. + +The power-sensor {\bf PS} component is used to subtract the work enrgy +from the internal energy. + + + + + + + ADDED mtt/lib/comp/compound/Thermal/CT2/CT2_lbl.txt Index: mtt/lib/comp/compound/Thermal/CT2/CT2_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CT2/CT2_lbl.txt +++ mtt/lib/comp/compound/Thermal/CT2/CT2_lbl.txt @@ -0,0 +1,40 @@ +%SUMMARY CT2: Two-port thermal C component - a heat engine. +%DESCRIPTION Port [in]: a (true) thermal bond +%DESCRIPTION Port [out]: a mechanical (P, dV/dT) bond. +%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) +%DESCRIPTION Parameter 2: gamma = c_p/c_v +%DESCRIPTION Parameter 3: mass of (ideal) gas within component. +%DESCRIPTION Parameter 4: t_0 -- the temperature at which internal +%DESCRIPTION energy is zero. + +%% Label file for system CT2 (CT2_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C c_v,gamma,m,t_0 + c CT2 $1,$2,$3,$4 + +% Component type ES + es + +% Component type PS + ps + +% Component type SS + [in] SS external,external + [out] SS external,external + + + ADDED mtt/lib/comp/compound/Thermal/CU/CU_abg.fig Index: mtt/lib/comp/compound/Thermal/CU/CU_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CU/CU_abg.fig +++ mtt/lib/comp/compound/Thermal/CU/CU_abg.fig @@ -0,0 +1,65 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1125 3375 2250 3375 2025 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2700 3375 3825 3375 3600 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 3375 5400 3375 5175 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 5175 4725 4050 4725 4050 3600 4275 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 3375 7200 3375 6975 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7650 3375 8775 3375 8550 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9225 3375 10350 3375 10125 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10800 3375 11925 3375 11700 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 9000 3600 9000 4725 6075 4725 6300 4950 +4 1 -1 0 0 2 20 0.0000 4 195 360 2475 3465 FP\001 +4 1 -1 0 0 2 20 0.0000 4 195 135 4050 3465 0\001 +4 1 4 0 0 2 16 0.0000 4 210 270 2160 3105 [f]\001 +4 1 4 0 0 2 16 0.0000 4 225 315 2835 3105 [p]\001 +4 1 1 1 0 3 22 0.0000 4 225 195 1440 3150 T\001 +4 1 1 1 0 3 22 0.0000 4 225 195 3240 3150 T\001 +4 1 1 1 0 3 22 0.0000 4 225 195 4815 3150 T\001 +4 1 1 1 0 3 22 0.0000 4 285 720 4815 3825 Q-W\001 +4 1 1 1 0 3 22 0.0000 4 285 240 3240 3825 Q\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3285 3555 .\001 +4 1 1 1 0 3 22 0.0000 4 225 195 1440 3825 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 1485 3555 .\001 +4 1 1 1 0 3 30 0.0000 4 60 120 4590 3555 .\001 +4 1 1 1 0 3 30 0.0000 4 60 120 5040 3555 .\001 +4 1 -1 0 0 2 20 0.0000 4 195 360 7425 3465 FP\001 +4 1 -1 0 0 2 20 0.0000 4 195 360 10575 3465 FP\001 +4 1 -1 0 0 2 20 0.0000 4 195 135 9000 3465 1\001 +4 0 4 0 0 2 20 0.0000 4 240 990 12060 3465 SS:[out]\001 +4 1 4 0 0 2 16 0.0000 4 210 270 10935 3105 [f]\001 +4 1 4 0 0 2 16 0.0000 4 210 270 7110 3105 [f]\001 +4 1 4 0 0 2 16 0.0000 4 225 315 7785 3105 [p]\001 +4 1 4 0 0 2 16 0.0000 4 225 315 10260 3105 [p]\001 +4 1 1 1 0 3 22 0.0000 4 225 195 6615 3150 P\001 +4 1 1 1 0 3 22 0.0000 4 225 195 9765 3150 P\001 +4 1 1 1 0 3 22 0.0000 4 225 195 11385 3150 P\001 +4 1 1 1 0 3 22 0.0000 4 225 225 11385 3825 V\001 +4 1 1 1 0 3 30 0.0000 4 60 120 11430 3555 .\001 +4 1 1 1 0 3 22 0.0000 4 225 285 9765 3825 W\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9810 3555 .\001 +4 1 1 1 0 3 22 0.0000 4 225 225 6615 3825 V\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6660 3555 .\001 +4 1 -1 0 0 2 20 0.0000 4 195 405 5715 3465 C:c\001 +4 1 1 1 0 3 22 0.0000 4 225 195 8190 3150 P\001 +4 1 1 1 0 3 22 0.0000 4 225 285 8190 3825 W\001 +4 1 1 1 0 3 30 0.0000 4 60 120 8235 3555 .\001 +4 1 1 1 0 3 22 0.0000 4 225 195 8190 4500 P\001 +4 1 1 1 0 3 22 0.0000 4 225 285 8190 5175 W\001 +4 1 1 1 0 3 30 0.0000 4 60 120 8235 4905 .\001 +4 2 4 0 0 2 20 0.0000 4 240 825 990 3465 SS:[in]\001 +4 1 -1 0 0 2 20 0.0000 4 195 690 5625 4815 AF:af\001 +4 1 1 1 0 3 22 0.0000 4 300 1275 900 4275 Heat port\001 +4 1 1 1 0 3 22 0.0000 4 315 1305 11295 4275 Work port\001 ADDED mtt/lib/comp/compound/Thermal/CU/CU_cr.r Index: mtt/lib/comp/compound/Thermal/CU/CU_cr.r ================================================================== --- mtt/lib/comp/compound/Thermal/CU/CU_cr.r +++ mtt/lib/comp/compound/Thermal/CU/CU_cr.r @@ -0,0 +1,79 @@ +%SUMMARY CU Constitutive Relationship for a two port thermo C +%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) +%DESCRIPTION Parameter 2: gamma = c_p/c_v +%DESCRIPTION Parameter 3: mass of (ideal) gas within component. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 10:34:56 peterg +% %% Put under RCS +% %% +% %% Revision 1.1 1997/12/07 20:45:21 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/02 10:21:19 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/09/12 11:18:26 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +OPERATOR CU; + +%% Integral/Integral causality +Port 1 - Thermal +FOR ALL COMPONENT, c_v,gamma,m,InternalEnergy,Volume +LET CU(COMPONENT, ideal_gas,c_v,gamma,m,effort,1, + InternalEnergy, state, 1, + Volume, state, 2) + = InternalEnergy/(m*c_v); + +Port 2 - Mechanical +FOR ALL COMPONENT, c_v,gamma,m,InternalEnergy,Volume +LET CU(COMPONENT, ideal_gas,c_v,gamma,m,effort,2, + InternalEnergy, state, 1, + Volume, state, 2) + = (gamma-1)*(InternalEnergy)/Volume; + +%% Derivative/Integral causality +Port 1 - Thermal +FOR ALL COMPONENT, c_v,gamma,m,Temperature,Volume +LET CU(COMPONENT, ideal_gas,c_v,gamma,m,state,1, + Temperature, effort, 1, + Volume, state, 2) + = Temperature*(m*c_v); + +Port 2 - Mechanical +FOR ALL COMPONENT, c_v,gamma,m,Temperature,Volume +LET CU(COMPONENT, ideal_gas,c_v,gamma,m,effort,2, + Temperature, effort, 1, + Volume, state, 2) + = (gamma-1)*(m*c_v)*(Temperature)/Volume; + +%% Integral/Derivative causality +Port 1 - Thermal +FOR ALL COMPONENT, c_v,gamma,m,InternalEnergy,Pressure +LET CU(COMPONENT, ideal_gas,c_v,gamma,m,effort,1, + InternalEnergy, state, 1, + Pressure, effort, 2) + = InternalEnergy/(m*c_v); + +Port 2 - Mechanical +FOR ALL COMPONENT, c_v,gamma,m,InternalEnergy,Pressure +LET CU(COMPONENT, ideal_gas,c_v,gamma,m,state,2, + InternalEnergy, state, 1, + Pressure, effort, 2) + = (gamma-1)*(InternalEnergy)/Pressure; + + +END; ADDED mtt/lib/comp/compound/Thermal/CU/CU_lbl.txt Index: mtt/lib/comp/compound/Thermal/CU/CU_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CU/CU_lbl.txt +++ mtt/lib/comp/compound/Thermal/CU/CU_lbl.txt @@ -0,0 +1,25 @@ +%SUMMARY CU +%DESCRIPTION +%% Label file for system CU (CU_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +% Component type AF (gain of -1) + af lin -1 + +% Component type C + c CU $1 + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_abg.fig @@ -0,0 +1,62 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4953 2928 6528 2928 6303 3153 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2476 2926 4051 2926 3826 3151 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2476 4051 4051 4051 3826 4276 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 4051 6526 4051 6301 4276 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 5618 4501 4493 4726 4718 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6978 2925 8553 2925 8328 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6978 4050 8553 4050 8328 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 2693 6750 1568 6975 1793 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 4268 6750 5393 6975 5168 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6480 1575 6975 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6480 5400 6975 5400 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 6300 11025 675 225 675 225 6300 11025 6300 +4 2 4 0 0 0 20 0.0000 4 255 2085 2436 4101 SS:[Hydraulic_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1935 2438 3023 SS:[Thermal_in]\001 +4 2 4 0 0 0 12 0.0000 4 180 540 4102 3337 [Th_in]\001 +4 2 4 0 0 0 12 0.0000 4 180 570 4147 3922 [Hy_in]\001 +4 0 4 0 0 0 12 0.0000 4 180 675 5002 3922 [Hy_out]\001 +4 0 4 0 0 0 12 0.0000 4 180 645 5002 3337 [Th_out]\001 +4 1 -1 0 0 22 20 0.0000 4 270 1470 4504 3649 hPipe:pipe\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2933 3968 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2798 4238 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2798 3878 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 2798 4508 V\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2842 2752 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2977 2842 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2977 3517 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2842 3382 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2842 3112 .\001 +4 1 4 0 0 0 20 0.0000 4 240 1140 4501 5986 SS:[Heat]\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7933 4244 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7933 3884 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 7933 4514 V\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8068 3974 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7933 2713 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8068 2803 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7933 3343 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7933 3073 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8068 3478 2\001 +4 0 4 0 0 0 20 0.0000 4 255 2235 8696 4197 SS:[Hydraulic_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 2085 8651 3026 SS:[Thermal_out]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6750 3060 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6750 4140 0\001 +4 1 -1 0 0 22 20 0.0000 4 210 675 6705 5715 SS:P\001 +4 1 -1 0 0 22 20 0.0000 4 210 645 6705 1440 SS:T\001 +4 1 4 0 0 0 12 0.0000 4 180 495 4501 4366 [Heat]\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_desc.tex @@ -0,0 +1,27 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Comb (Comb_desc.tex) +% Generated by MTT on Tue Mar 31 15:58:34 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Comb} is + displayed in Figure \Ref{Comb_abg} and its label + file is listed in Section \Ref{sec:Comb_lbl}. + The subsystems are listed in Section \Ref{sec:Comb_sub}. + + This thermal tank model has been developed to represent an ideal + (and non-dynamic) combustion chamber for a gas turbine. The major + simplification is that the mass contained in the tank is assumed + constant -- this is consistent with using an ideal compressor and an + ideal turbine with identical mass flows. Energy conservatioin is + ensured by using true bonds and \textbf{TF} components. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_lbl.txt @@ -0,0 +1,73 @@ +%SUMMARY Comb: Combustion chamber model + +%DESCRIPTION This thermal tank model has been developed to represent an ideal +%DESCRIPTION (and non-dynamic) combustion chamber for a gas turbine. The major +%DESCRIPTION simplification is that the mass contained in the tank is assumed +%DESCRIPTION constant -- this is consistent with using an ideal compressor and an +%DESCRIPTION ideal turbine with identical mass flows. Energy conservation is +%DESCRIPTION ensured by using true bonds and components. + +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +%ALIAS $1 m_c +%ALIAS $2 v_c +%ALIAS $3 r + +%ALIAS hPipe CompressibleFlow/hPipe + +%% Label file for system Comb (Comb_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.6 1998/07/04 08:24:25 peterg +% %% New-style SS +% %% +% %% Revision 1.5 1998/07/03 14:55:33 peterg +% %% Aliased parameters. +% %% Removed _c from parameters, +% %% +% %% Revision 1.4 1998/07/02 19:46:34 peterg +% %% New aliases +% %% +% %% Revision 1.3 1998/07/02 10:54:42 peterg +% %% Lower case in out +% %% +% %% Revision 1.2 1998/07/02 10:49:32 peterg +% %% Added port aliases +% %% +% %% Revision 1.1 1998/05/19 09:11:29 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type SS + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Heat] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external + P SS external,0 + T SS external,0 + +% Component type hPipe + pipe none m_c;v_c;r + + + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_abg.fig @@ -0,0 +1,35 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 2476 5626 2476 5401 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 3376 5626 3376 5401 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5626 2251 5626 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5626 3151 5626 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6752 2927 7877 2927 7652 3152 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7877 2702 7877 3152 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 2475 3826 2475 3601 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 3375 3826 3375 3601 3600 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 4725 10125 1350 90 1350 90 4725 10125 4725 +4 2 4 0 0 22 20 0.0000 4 270 1890 2610 2565 SS:[Pressure]\001 +4 2 4 0 0 22 20 0.0000 4 270 2385 2655 3465 SS:[Temperature]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 5041 2251 P\001 +4 1 1 1 0 3 20 0.0000 4 195 165 4996 3241 T\001 +4 1 4 0 0 22 20 0.0000 4 270 330 5895 2520 [1]\001 +4 1 4 0 0 22 20 0.0000 4 270 330 5895 3465 [2]\001 +4 1 -1 0 0 18 30 0.0000 4 345 600 6030 3060 R:r\001 +4 1 4 0 0 22 20 0.0000 4 270 330 6570 3015 [3]\001 +4 1 1 1 0 32 30 0.0000 4 345 210 7337 2792 r\001 +4 0 4 0 0 22 20 0.0000 4 270 1695 8146 3016 SS:[Density]\001 +4 1 -1 0 0 18 20 0.0000 4 210 405 4140 2610 AE\001 +4 1 -1 0 0 18 20 0.0000 4 210 405 4140 3465 AE\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_cr.r Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_cr.r ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_cr.r +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_cr.r @@ -0,0 +1,36 @@ +% Constitutive relation file for Density (Density_cr.r) +% Generated by MTT at Wed Mar 11 11:01:28 GMT 1998 + +OPERATOR Density; + +% Ideal gas +FOR ALL COMPONENT, R,Temperature,Pressure,Nothing +LET Density(COMPONENT, density,ideal_gas,R,effort,3, + Pressure,effort,1, + Temperature,effort,2, + Nothing,flow,3 + ) = Pressure/(R*Temperature); + +FOR ALL COMPONENT, R,Temperature,Pressure,Nothing +LET Density(COMPONENT, specific_volume,ideal_gas,R,effort,3, + Pressure,effort,1, + Temperature,effort,2, + Nothing,flow,3 + ) = (R*Temperature)/Pressure; + +% Incompressible +FOR ALL COMPONENT, rho,Temperature,Pressure,Nothing +LET Density(COMPONENT, density,incompressible,rho,effort,3, + Pressure,effort,1, + Temperature,effort,2, + Nothing,flow,3 + ) = rho; + +FOR ALL COMPONENT, rho,Temperature,Pressure,Nothing +LET Density(COMPONENT, specific_volume,incompressible,rho,effort,3, + Pressure,effort,1, + Temperature,effort,2, + Nothing,flow,3 + ) = 1/rho; + +END; ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_desc.tex @@ -0,0 +1,39 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Density (Density_desc.tex) +% Generated by MTT on Thu Mar 19 13:24:59 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Density} is + displayed in Figure \Ref{Density_abg} and its label + file is listed in Section \Ref{sec:Density_lbl}. + +This three port component computes the density $\rho$ of substance in +terms of the temperature $T$ and the pressure $P$. At the moment, +there are four forms dependent on the four forms of the component parameter: +\begin{enumerate} +\item \emph{density,incompressible,rho} +\item \emph{specific\_volume,incompressible,rho} +\item \emph{density,ideal\_gas,R} +\item \emph{specific\_volume,ideal\_gas,R} +\end{enumerate} + +\begin{equation} + y = + \begin{cases} + \rho & \text{if the parameter is + \emph{density,incompressible,rho}}\\ + \frac{1}{\rho} & \text{if the parameter is + \emph{specific\_volume,incompressible,rho}}\\ + \frac{P}{RT} & \text{if the parameter is \emph{density,ideal\_gas,R}}\\ + \frac{RT}{P} & \text{if the parameter is + \emph{specific\_volume,ideal\_gas,R}} + \end{cases} +\end{equation} +where $\rho$ is the density of the incompressible fluid and $R$ the +universal gas constant of the ideal gas. ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_lbl.txt @@ -0,0 +1,41 @@ +%SUMMARY Density - Computes P and T. + +%DESCRIPTION Parameter: density,ideal_gas,gas_constant +%DESCRIPTION OR : specific_volume,ideal_gas,gas_constant +%DESCRIPTION OR : density,incompressible,gas_constant +%DESCRIPTION OR : specific_volume,incompressible,gas_constant +%DESCRIPTION Port [P]: Pressure +%DESCRIPTION Port [T]: Temperature +%DESCRIPTION Port [rho]: Density + +%ALIAS P Pressure +%ALIAS T Temperature +%ALIAS rho|out Density + +%ALIAS $1 density,ideal_gas,r + + + +%% Label file for system Density (Density_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type R + r Density density,ideal_gas,r + +% Component type SS + [Pressure] SS external,external + [Temperature] SS external,external + [Density] SS external,external ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_abg.fig @@ -0,0 +1,64 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4503 2928 6078 2928 5853 3153 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 2926 3601 2926 3376 3151 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 4051 3601 4051 3376 4276 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 4051 6076 4051 5851 4276 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6528 2925 8103 2925 7878 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6528 4050 8103 4050 7878 4275 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9900 6300 9900 675 225 675 225 6300 9900 6300 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 2693 6300 1568 6525 1793 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 4268 6300 5393 6525 5168 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6030 1575 6525 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6030 5400 6525 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3825 4500 4320 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 4507 4050 5632 4275 5407 +4 2 4 0 0 0 12 0.0000 4 180 540 3652 3337 [Th_in]\001 +4 2 4 0 0 0 12 0.0000 4 180 570 3697 3922 [Hy_in]\001 +4 0 4 0 0 0 12 0.0000 4 180 675 4552 3922 [Hy_out]\001 +4 0 4 0 0 0 12 0.0000 4 180 645 4552 3337 [Th_out]\001 +4 1 -1 0 0 22 20 0.0000 4 270 1470 4054 3649 hPipe:pipe\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2483 3968 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2348 4238 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2348 3878 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 2348 4508 V\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2392 2752 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2527 2842 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2527 3517 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2392 3382 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2392 3112 .\001 +4 2 4 0 0 0 20 0.0000 4 255 1290 1896 4191 SS:[Hy_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1275 1943 3023 SS:[Th_in]\001 +4 1 4 0 0 22 12 0.0000 4 180 540 4051 4366 [Heat]\001 +4 1 -1 0 0 0 20 0.0000 4 195 570 4051 5986 CT:c\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7483 4244 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7483 3884 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 7483 4514 V\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7618 3974 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7483 2713 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7618 2803 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7483 3343 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7483 3073 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7618 3478 2\001 +4 0 4 0 0 0 20 0.0000 4 255 1440 8246 4197 SS:[Hy_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 1425 8201 3026 SS:[Th_out]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6300 3060 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6300 4140 0\001 +4 1 -1 0 0 22 20 0.0000 4 210 675 6255 5715 SS:P\001 +4 1 -1 0 0 22 20 0.0000 4 210 645 6255 1440 SS:T\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_desc.tex @@ -0,0 +1,27 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system ICV (ICV_desc.tex) +% Generated by MTT on Tue Mar 31 15:58:34 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ICV} is + displayed in Figure \Ref{ICV_abg} and its label + file is listed in Section \Ref{sec:ICV_lbl}. + The subsystems are listed in Section \Ref{sec:ICV_sub}. + + This thermal tank model has been developed to represent an + inter-volume component (ICV) for a gas turbine. The major + simplification is that the mass contained in the ICV is assumed + constant -- this is consistent with using an ideal compressor and an + ideal turbine with identical mass flows. Energy conservation is + ensured by using true bonds and \textbf{TF} components. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_lbl.txt @@ -0,0 +1,34 @@ +%SUMMARY ICV Inter-component volume for a gas turbine. +%DESCRIPTION Parameter 1 Thermal capacity (c) + +%% Label file for system ICV (ICV_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type CT + c lin effort,$1 + +% Component type SS + [Hy_in] external external + [Hy_out] external external + [T] external external + [Th_in] external external + [Th_out] external external + P external 0 + T external 0 + +% Component type hPipe + pipe none m_c;v_c;r + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_abg.fig @@ -0,0 +1,56 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 2927 6977 2927 6752 3152 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 2926 4051 2926 3826 3151 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4051 2701 4051 3151 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1126 2925 2251 2925 2026 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 2026 4051 2026 3826 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4051 1801 4051 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1126 2025 2251 2025 2026 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 3826 4051 3826 3826 4051 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4051 3601 4051 4051 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1126 3825 2251 3825 2026 4050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 4949 4951 3824 5176 4049 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4726 3824 5176 3824 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4950 6749 4950 5624 5175 5849 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5850 2700 5850 3150 +4 1 4 0 0 22 20 0.0000 4 270 330 5670 3015 [5]\001 +4 1 1 1 0 22 20 0.0000 4 150 255 6437 2792 m\001 +4 0 4 0 0 22 20 0.0000 4 270 2055 7246 3016 SS:[MassFlow]\001 +4 1 -1 0 0 18 30 0.0000 4 345 600 5040 3060 R:r\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3466 2701 P\001 +4 1 4 0 0 22 20 0.0000 4 270 330 4320 2970 [2]\001 +4 1 -1 0 0 18 20 0.0000 4 210 405 2565 3060 AE\001 +4 2 4 0 0 22 20 0.0000 4 270 1005 1080 3015 SS:[P2]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3466 1801 P\001 +4 1 4 0 0 22 20 0.0000 4 270 330 4320 2070 [1]\001 +4 1 -1 0 0 18 20 0.0000 4 210 405 2565 2160 AE\001 +4 2 4 0 0 22 20 0.0000 4 270 1005 1080 2115 SS:[P1]\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3601 1981 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3601 2881 2\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6436 2566 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3421 3691 T\001 +4 1 4 0 0 22 20 0.0000 4 270 330 4320 3915 [3]\001 +4 1 -1 0 0 18 20 0.0000 4 210 405 2565 3915 AE\001 +4 2 4 0 0 22 20 0.0000 4 270 975 1080 3915 SS:[T1]\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3601 3781 1\001 +4 1 4 0 0 22 20 1.5708 4 270 330 5040 3555 [4]\001 +4 1 -1 0 0 18 20 1.5708 4 210 405 5040 5310 AE\001 +4 2 4 0 0 22 20 1.5708 4 270 1305 5040 6795 SS:[Area]\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_cr.r Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_cr.r ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_cr.r +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_cr.r @@ -0,0 +1,27 @@ +% Constitutive relation file for NozzleFlow (NozzleFlow_cr.r) +% Generated by PJG at Wed Apr 8 09:30 GMT 1998 + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +OPERATOR NozzleFlow; +% Ideal gas - but polytropic expansion +FOR ALL R, n, p1, p2, T1, A, Nothing +LET NozzleFlow(R,n,flow,5, + p1,effort,1, + p2,effort,2, + T1,effort,3, + A,effort,4, + Nothing,effort,5 + ) = A*p1*( (2*n/(n-1)) * (1/(R*T1)) * + ((p2/p1)^(2/n)) * (1 - (p2/p1)^(n-1/n) ) ^(1/2) + ); + +END; ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_desc.tex @@ -0,0 +1,42 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system NozzleFlow (NozzleFlow_desc.tex) +% Generated by MTT on Thu Mar 19 13:24:59 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{NozzleFlow} is + displayed in Figure \Ref{NozzleFlow_abg} and its label + file is listed in Section \Ref{sec:NozzleFlow_lbl}. + +This 5 port component computes the mass flow in a polytropic +convergent nozzle from the formula: +\begin{equation} + \dot m = A p_1 \sqrt{\frac{2n}{n-1}\frac{1}{RT_1} + \left ( \frac{p_2}{p_1} \right )^\frac{2}{n} + \left [ 1- \left ( \frac{p_2}{p_1} \right )^\frac{n-1}{n} \right ] } +\end{equation} + +where: +\begin{itemize} +\item $n$ is the coefficient of polytropic expansion and +\item $R$ is the universal gas constant. +\end{itemize} + +If the expansion is isentropic +\begin{equation} + n=\gamma=\frac{c_p}{c_v} +\end{equation} +whre $c_p$ and $c_v$ are the spesicfic heats at constant pressure and volume. + +Typical values for air are +\begin{equation} + \begin{align} + R &= 287 \text{Nm}\text{kg}^{-1}{K}^{-1}\\ + \gamma &= 1.4 + \end{align} +\end{equation} ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_lbl.txt @@ -0,0 +1,32 @@ +%SUMMARY NozzleFlow Subsonic ideal gas nozzle flow with polytropic expansion +%DESCRIPTION Polytropic expansion coefficient n=gamma=c_p/c_v for isentropic expansion. + + +%ALIAS $1 R Ideal gas constant +%ALIAS $2 n Index of polytropic expansion + +%% Label file for system NozzleFlow (NozzleFlow_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type R + r NozzleFlow R,n + +% Component type SS + [Area] SS external,external + [MassFlow] SS external,external + [P1] SS external,external + [P2] SS external,external + [T1] SS external,external ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_rep.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_rep.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_rep.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_rep.txt @@ -0,0 +1,22 @@ +# Outline report file for system NozzleFlow (NozzleFlow_rep.txt) +# Generated by MTT on" Thursday September 24 09:49:01 BST 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt NozzleFlow abg tex # The system description + +# Uncomment the following lines or add others +mtt NozzleFlow ode tex # The system ode +# mtt NozzleFlow sspar tex # Steady-state parameters +# mtt NozzleFlow ss tex # Steady state +# mtt NozzleFlow sm tex # State matrices (of linearised system) +# mtt NozzleFlow lmfr ps # log modulus of frequency response (of linearised system) +# mtt NozzleFlow simpar tex # Simulation parameters +# mtt NozzleFlow numpar tex # Numerical simulation parameters +# mtt NozzleFlow input tex # Simulation input +# mtt NozzleFlow odeso ps # Simulation output ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_abg.fig @@ -0,0 +1,49 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4727 2027 5852 2027 5627 2252 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5852 1802 5852 2252 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2026 4052 2026 3827 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4727 2702 5852 2702 5627 2927 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2701 4052 2701 3827 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4727 3377 5852 3377 5627 3602 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5852 3152 5852 3602 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 3376 4052 3376 3827 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7428 2703 8553 2703 8328 2928 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5850 2478 5850 2928 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9003 2700 10128 2700 9903 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8778 4050 8778 2925 9003 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8550 2925 8775 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8775 4050 9000 4050 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 13050 5625 135 5625 135 1125 13050 1125 13050 5625 +4 1 -1 0 0 18 20 0.0000 4 210 405 4366 2161 AE\001 +4 1 -1 0 0 18 20 0.0000 4 210 405 4366 2836 AE\001 +4 1 -1 0 0 18 20 0.0000 4 210 405 4366 3466 AE\001 +4 2 4 0 0 22 20 0.0000 4 270 2190 2881 2116 SS:[Pressure_1]\001 +4 2 4 0 0 22 20 0.0000 4 270 2190 2881 2791 SS:[Pressure_2]\001 +4 2 4 0 0 22 20 0.0000 4 270 2685 2881 3466 SS:[Temperature_1]\001 +4 1 -1 0 0 18 30 0.0000 4 345 600 6706 2836 R:r\001 +4 1 4 0 0 22 20 0.0000 4 270 330 6120 2790 [2]\001 +4 1 4 0 0 22 20 0.0000 4 270 330 6120 3465 [3]\001 +4 1 4 0 0 22 20 0.0000 4 270 330 6120 2115 [1]\001 +4 1 4 0 0 22 20 0.0000 4 270 330 7245 2790 [4]\001 +4 0 4 0 0 22 20 0.0000 4 270 2685 10260 2790 SS:[Temperature_2]\001 +4 1 -1 0 0 18 20 0.0000 4 210 1080 8775 4410 SS:zero\001 +4 1 -1 0 0 18 20 0.0000 4 195 150 8820 2790 1\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_cr.r Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_cr.r ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_cr.r +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_cr.r @@ -0,0 +1,19 @@ +% Constitutive relation file for Poly (Poly_cr.r) +% Generated by MTT at Wed Mar 11 11:01:28 GMT 1998 + +OPERATOR Poly; + +% Ideal gas + +% Temperature output on port [T2] +FOR ALL COMPONENT, alpha,P1,P2,T1,Nothing +LET Poly(COMPONENT, alpha,effort,4, + P1,effort,1, + P2,effort,2, + T1,effort,3, + Nothing,flow,4 + ) = T1*(P2/P1)^alpha; + + + +END; ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_desc.tex @@ -0,0 +1,37 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Poly (Poly_desc.tex) +% Generated by MTT on Thu Mar 19 13:24:59 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/03/31 15:05:33 peterg +% %% Spell checked +% %% +% %% Revision 1.2 1998/03/27 10:56:14 peterg +% %% Added bicausal bit +% %% +% %% Revision 1.1 1998/03/26 15:13:35 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Poly} is + displayed in Figure \Ref{Poly_abg} and its label + file is listed in Section \Ref{sec:Poly_lbl}. + +This four-port component computes the temperature following a +polytropic expansion using: +\begin{equation} + T_2 = T_1 \left ( \frac{P_2}{P_1} \right )^\alpha +\end{equation} +where $\alpha = \frac{n-1}{n}$ and $n$ is the coefficient of +polytropic expansion. This component imposes zero flow at all its +ports and therefore does not affect energy balance. + +The output is \emph{bicausal} as it imposes both $T_2$ and a zero flow. +This is implemented using the bicausal \textbf{SS} component labeled +``zero''. + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_lbl.txt @@ -0,0 +1,47 @@ +%SUMMARY Poly - computes polytropic expansion temperature. +%DESCRIPTION Parameter: alpha = (n-1)/n (n = polytropic index) + +%DESCRIPTION This four-port component computes the temperature following +%DESCRIPTION a polytropic expansion using where alpha = (n-1)/n and n is +%DESCRIPTION the coefficient of polytropic expansion. This component +%DESCRIPTION imposes zero flow at all its ports and therefore does not +%DESCRIPTION affect energy balance. The output is bicausal as it +%DESCRIPTION imposes both T_2 and a zero flow. This is implemented using +%DESCRIPTION the bicausal SS component labeled ``zero''. + +%ALIAS P1 Pressure_1 +%ALIAS P2 Pressure_2 +%ALIAS T1 Temperature_1 +%ALIAS T2|out Temperature_2 + +%ALIAS $1 alpha + +%% Label file for system Poly (Poly_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/27 10:48:50 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type R + r Poly alpha + +% Component type SS + zero SS 0,0 + [Pressure_1] SS external,external + [Temperature_1] SS external,external + [Pressure_2] SS external,external + [Temperature_2] SS external,external + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_abg.fig @@ -0,0 +1,89 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7203 2028 8778 2028 8553 2253 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 2026 6301 2026 6076 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5176 3151 6301 3151 6076 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2703 2028 4278 2028 4053 2253 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2656 3151 4683 3151 4458 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8776 3151 10803 3151 10578 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7201 3151 8326 3151 8101 3376 +2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 + 4501 1801 4501 901 6076 901 5851 1126 +2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 + 4951 2926 4951 1351 6076 1351 5851 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 7426 901 9001 901 9001 1801 9226 1576 +2 1 0 2 5 -1 0 0 -1 0.000 0 0 -1 0 0 4 + 8551 2926 8551 1351 7426 1351 7651 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6755 7969 6755 6844 6980 7069 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6754 6371 6754 5246 6979 5471 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6752 4751 6752 3626 6977 3851 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9228 2025 10803 2025 10578 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11704 2028 13279 2028 13054 2253 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9225 1800 10125 900 10125 1125 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 10013 788 10238 1013 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 15705 8550 15705 225 225 225 225 8550 15705 8550 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 7965 6975 7965 +4 2 4 0 0 0 20 0.0000 4 255 1935 2617 2122 SS:[Thermal_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 2085 2615 3245 SS:[Hydraulic_in]\001 +4 2 4 0 0 0 12 0.0000 4 180 540 6352 2437 [Th_in]\001 +4 2 4 0 0 0 12 0.0000 4 180 570 6397 3022 [Hy_in]\001 +4 0 4 0 0 0 12 0.0000 4 180 675 7252 3022 [Hy_out]\001 +4 0 4 0 0 0 12 0.0000 4 180 645 7252 2437 [Th_out]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 9047 2117 0\001 +4 1 1 1 0 3 30 0.0000 4 60 120 10181 3297 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 10181 2937 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 10181 3567 V\001 +4 1 1 1 0 3 20 0.0000 4 195 135 10316 3027 2\001 +4 0 4 0 0 0 20 0.0000 4 255 2235 10944 3250 SS:[Hydraulic_out]\001 +4 1 -1 0 0 22 20 0.0000 4 270 1305 6796 1261 Poly:poly\001 +4 2 4 0 0 22 12 0.0000 4 180 345 7291 856 [T2]\001 +4 2 4 0 0 22 12 0.0000 4 180 345 7336 1531 [P2]\001 +4 0 4 0 0 22 12 0.0000 4 180 345 6211 856 [T1]\001 +4 0 4 0 0 22 12 0.0000 4 180 345 6211 1531 [P1]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 8596 3286 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 4951 3286 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 4501 2161 0\001 +4 1 4 0 0 0 20 0.0000 4 240 1215 6755 8330 SS:[Shaft]\001 +4 1 1 1 0 32 30 0.0000 4 240 195 6530 7610 t\001 +4 1 1 1 0 32 30 0.0000 4 240 285 6980 7610 w\001 +4 1 4 0 0 0 12 0.0000 4 180 540 6751 3421 [Work]\001 +4 1 -1 0 0 22 20 0.0000 4 210 750 11250 2115 EBTF\001 +4 1 1 1 0 3 20 0.0000 4 195 165 12657 1767 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 12792 1857 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 12657 2397 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 12657 2127 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 12792 2532 2\001 +4 0 4 0 0 0 20 0.0000 4 255 2085 13375 2080 SS:[Thermal_out]\001 +4 1 -1 0 0 22 20 0.0000 4 270 1530 6754 2749 wPipe:pipe\001 +4 1 -1 0 0 22 20 0.0000 4 210 645 10305 765 SS:T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3157 3022 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3022 3292 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3022 2932 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 3022 3562 V\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3066 1806 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3201 1896 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3201 2571 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3066 2436 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3066 2166 .\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6755 6710 1\001 +4 1 -1 0 0 22 20 0.0000 4 270 915 6800 5090 TF:k_p\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_desc.tex @@ -0,0 +1,46 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Pump (Pump_desc.tex) +% Generated by MTT on Fri Mar 20 15:53:12 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/04/01 08:09:06 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Pump} is + displayed in Figure \Ref{Pump_abg} and its label + file is listed in Section \Ref{sec:Pump_lbl}. + The subsystems are listed in Section \Ref{sec:Pump_sub}. + +\textbf{Pump} represents an ideal pumping component for compressible +or incompressible flow though a pipe, it may also be used as a turbine. + +The pump is ideal in the sense that the mass flow rate $\dot m$ +depends only on the shaft speed $\omega$: +\begin{equation} + \dot m = k_p \omega +\end{equation} + +It is implemented using three components: +\begin{itemize} +\item the ideal isentropic \textbf{wPipe} component which gives the + correct energy flows +\item the polytropic expansion \textbf{Poly} component which imposes + the correct temperature at the output of the pump. This component + imposes zero flow at all its ports and therefore does not affect + energy balance. It has a bicausal output imposing both the + temperature measured by the \textbf{SS} component ``T'' and a zero + flow. +\item the \emph{effort-bicausal transformer} \textbf{EBTF} + component. This component is an energy-conserving \textbf{TF} + component with non-standard causality. The modulus is determined by + the two imposed efforts ($T$ and $T_2$), and this modulus determines + the flows in the usual way. In particular, it makes sure that the + internal energy flowing from the pump to the following components + (imposing $T_2$) is correct. +\end{itemize} ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_lbl.txt @@ -0,0 +1,86 @@ +%SUMMARY Pump Ideal pump component for compressible flow + +%DESCRIPTION Pump represents an ideal pumping component for compressible +%DESCRIPTION or incompressible flow though a pipe, it may also be used as a turbine. +%DESCRIPTION The pump is ideal in the sense that the mass flow rate +%DESCRIPTION depends only on the shaft speed. + +%DESCRIPTION Parameter 1: c_v - specific heat of fluid +%DESCRIPTION Parameter 2: Parameter passed to Density component +%DESCRIPTION Parameter 3: alpha = (n-1)/n, n coefficient of polytropic +%DESCRIPTION expansion. +%DESCRIPTION Parameter 4: k_p pump constant: mass flow = k_p*shaft speed + +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +%ALIAS Work Shaft + +%ALIAS $1 c_v +%ALIAS $2 density,ideal_gas,r +%ALIAS $3 alpha +%ALIAS $4 flow,k_p + +%ALIAS wPipe CompressibleFlow/wPipe +%ALIAS Poly CompressibleFlow/Poly + +%% Label file for system Pump (Pump_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.7 1998/07/04 08:39:58 peterg +% %% New-style SS +% %% +% %% Revision 1.6 1998/07/03 15:02:25 peterg +% %% Work alias added +% %% +% %% Revision 1.5 1998/07/03 14:43:24 peterg +% %% Added parameter aliases +% %% +% %% Revision 1.4 1998/07/02 19:46:19 peterg +% %% New aliases +% %% +% %% Revision 1.3 1998/07/02 10:55:54 peterg +% %% Lower case in out +% %% +% %% Revision 1.2 1998/07/02 10:52:33 peterg +% %% Added port aliases +% %% +% %% Revision 1.1 1998/04/07 15:23:30 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type wPipe + pipe none c_v;density,ideal_gas,r + +% Component type Poly + poly Poly alpha + +% Component type SS + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Shaft] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external + T SS external,0 + +% Component type TF + k_p lin flow,k_p + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_abg.fig @@ -0,0 +1,110 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7650 3600 9680 3602 9455 3827 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9900 3825 9900 5850 10125 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1575 6300 4725 6300 4500 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6077 6301 7202 6301 6977 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7650 6299 9230 6302 9005 6527 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10575 6300 13725 6300 13500 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10125 3600 11700 3600 11475 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12150 3600 13725 3600 13500 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7425 3825 7425 4725 7650 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7425 6075 7425 5175 7650 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7425 2228 7425 3353 7650 3128 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 9675 9000 5625 9000 5625 1350 9675 1350 9675 9000 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 15525 9450 15525 675 90 675 90 9450 15525 9450 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 7650 6525 8775 7650 9945 7650 9945 6750 10170 6975 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 7200 6525 6030 7695 5400 7695 5400 6750 5625 6975 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7425 7657 7425 6532 7650 6757 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 3600 6300 3600 6075 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 3600 7200 3600 6975 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 3600 5175 3600 4950 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1575 3600 2925 3600 2700 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 3825 5400 4725 5625 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 5175 5400 5850 5625 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 4950 4275 4950 4500 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4275 4725 4275 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5175 4950 5175 5175 +4 1 1 1 0 3 20 0.0000000 4 210 150 2073 4143 1\001 +4 1 1 1 0 3 20 0.0000000 4 210 165 1938 4008 S\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 1938 3738 .\001 +4 1 -1 0 0 22 20 0.0000000 4 225 135 7426 3691 0\001 +4 1 1 1 0 3 20 0.0000000 4 210 165 13102 4012 S\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 13102 3742 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 13237 4147 2\001 +4 0 4 0 0 0 20 0.0000000 4 240 1500 13820 3695 SS:[Th_out]\001 +4 1 -1 0 0 22 20 0.0000000 4 225 135 9901 3691 0\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 2029 6169 1\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 1894 6439 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 1894 6079 P\001 +4 1 1 1 0 3 20 0.0000000 4 210 195 1894 6709 V\001 +4 2 4 0 0 0 20 0.0000000 4 270 1380 1442 6392 SS:[Hy_in]\001 +4 2 4 0 0 0 12 0.0000000 4 180 570 4680 6165 [Hy_in]\001 +4 1 -1 0 0 22 20 0.0000000 4 225 135 7427 6437 0\001 +4 2 4 0 0 0 12 0.0000000 4 180 570 9225 6165 [Hy_in]\001 +4 0 4 0 0 0 12 0.0000000 4 180 660 6076 6166 [Hy_out]\001 +4 1 -1 0 0 22 20 0.0000000 4 225 945 5401 6391 VM:v2m\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 13102 6488 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 13102 6128 P\001 +4 1 1 1 0 3 20 0.0000000 4 210 195 13102 6758 V\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 13237 6218 2\001 +4 0 4 0 0 0 20 0.0000000 4 270 1530 13865 6441 SS:[Hy_out]\001 +4 0 4 0 0 0 12 0.0000000 4 180 660 10531 6166 [Hy_out]\001 +4 1 -1 0 0 22 20 0.0000000 4 225 945 9901 6391 VM:m2v\001 +4 1 4 0 0 0 12 0.0000000 4 165 225 5402 6077 [T]\001 +4 1 4 0 0 0 12 0.0000000 4 165 225 5402 6617 [P]\001 +4 1 4 0 0 0 12 0.0000000 4 165 225 9902 6077 [T]\001 +4 1 4 0 0 0 12 0.0000000 4 165 225 9902 6617 [P]\001 +4 2 4 0 0 0 20 0.0000000 4 240 1350 1534 3694 SS:[Th_in]\001 +4 1 -1 0 0 22 20 0.0000000 4 225 330 11926 3691 ES\001 +4 1 4 0 0 0 12 0.0000000 4 165 195 11567 3332 [e]\001 +4 1 4 0 0 0 12 0.0000000 4 165 195 12242 3332 [s]\001 +4 1 -1 0 0 22 20 0.0000000 4 285 1290 7471 5041 Tankp:tank\001 +4 2 4 0 0 0 12 0.0000000 4 165 315 7200 4680 [Th]\001 +4 2 4 0 0 0 12 0.0000000 4 180 345 7245 5265 [Hy]\001 +4 1 1 1 0 3 20 0.0000000 4 270 2400 7425 8685 Pseudo bond graph\001 +4 1 4 0 0 0 20 0.0000000 4 270 1110 7426 2116 SS:[pTh]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1140 7426 7966 SS:[pHy]\001 +4 1 -1 0 0 22 20 0.0000000 4 225 330 6570 3690 AF\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 13102 3382 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 13237 3472 2\001 +4 1 4 0 0 0 12 0.0000000 4 165 195 2793 3378 [s]\001 +4 1 4 0 0 0 12 0.0000000 4 165 195 3423 3378 [e]\001 +4 1 -1 0 0 22 20 0.0000000 4 225 330 3150 3735 ES\001 +4 1 -1 0 0 22 20 0.0000000 4 225 135 5401 3691 1\001 +4 1 -1 0 0 22 20 0.0000000 4 225 135 5400 5085 0\001 +4 1 -1 0 0 22 20 0.0000000 4 225 900 3735 5040 SS:zero\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 4999 5674 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 5134 5764 1\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 1938 3378 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 2073 3468 1\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 10358 5454 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 10493 5544 2\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system Tank (Tank_desc.tex) +% Generated by MTT on Tue Jan 13 18:03:04 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Tank} is + displayed in Figure \Ref{Tank_abg} and its label + file is listed in Section \Ref{sec:Tank_lbl}. + The subsystems are listed in Section \Ref{sec:Tank_sub}. ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_lbl.txt @@ -0,0 +1,51 @@ +%SUMMARY Tank - thermal storage component for compressible fluids. +%DESCRIPTION Two port thermal storage component for compressible +%DESCRIPTION fluids +%DESCRIPTION Parameter 1 Passed to Tankp subcomponent +%DESCRIPTION Parameter 2 Parameter two of density component. +%DESCRIPTION Typical label file entry: +%DESCRIPTION % Component type Tank +%DESCRIPTION C1 none ideal_gas,r_g,c_p,v_t;r_g +%DESCRIPTION Port [Th_in]: Thermal flow bond (T/Sdot) +%DESCRIPTION Port [Th_out]: Thermal flow bond (T/Sdot) +%DESCRIPTION Port [Hy_in]: Hydraulic flow bond (P/Vdot) +%DESCRIPTION Port [Hy_out]: Hydraulic flow bond (P/Vdot) +%DESCRIPTION Port [pTh]: Thermal flow pseudo bond direct to tank (T/Edot) +%DESCRIPTION Port [pHy]: Hydraulic flow pseudo bond direct to tank (P/mdot) + +%% Label file for system Tank (Tank_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/26 09:00:26 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type SS + [Hy_in] external external + [Hy_out] external external + [pHy] external external + [pTh] external external + [Th_in] external external + [Th_out] external external + zero internal internal + +% Component type Tankp + tank none $1 + +% Component type VMe + v2m none density,$2 + m2v none specific_volume,$2 + + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_abg.fig @@ -0,0 +1,20 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2926 3646 3376 3646 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2926 946 3376 946 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 947 3151 2072 3376 1847 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 3646 3151 2521 3376 2746 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 5850 4275 5850 225 225 225 225 4275 5850 4275 +4 1 -1 0 0 22 20 0.0000 4 210 870 3151 2431 C:tank\001 +4 1 4 0 0 0 20 0.0000 4 240 915 3150 765 SS:[Th]\001 +4 1 4 0 0 0 20 0.0000 4 255 930 3105 3960 SS:[Hy]\001 +4 1 4 0 0 0 20 0.0000 4 240 405 2836 2026 [in]\001 +4 1 4 0 0 0 20 0.0000 4 240 555 2791 2746 [out]\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_cr.r Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_cr.r ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_cr.r +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_cr.r @@ -0,0 +1,35 @@ +% Constitutive relation file for Tankp (Tankp_cr.r) +% Generated by MTT at Thu Mar 5 10:30:23 GMT 1998 + +OPERATOR Tankp; +%%%% Incompressible %%%% +%Temperature +FOR ALL c_p,c,StoredMass,StoredEnthalpy +LET Tankp(incompressible,c_p,c,effort,1, + StoredEnthalpy,state,1, + StoredMass,state,2 + ) = StoredEnthalpy/(StoredMass*c_p); + +%Pressure +FOR ALL c_p,c,StoredMass,StoredEnthalpy +LET Tankp(incompressible,c_p,c,effort,2, + StoredEnthalpy,state,1, + StoredMass,state,2 + ) = StoredMass/c; + +%%%% Ideal gas %%%% +%Temperature +FOR ALL R,c_p,Volume,StoredMass,StoredEnthalpy +LET Tankp(ideal_gas,R,c_p,Volume,effort,1, + StoredEnthalpy,state,1, + StoredMass,state,2 + ) = (StoredEnthalpy/(c_p*StoredMass)); + +%Pressure +FOR ALL R,c_p,Volume,StoredMass,StoredEnthalpy +LET Tankp(ideal_gas,R,c_p,Volume,effort,2, + StoredEnthalpy,state,1, + StoredMass,state,2 + ) = R*( ( (StoredEnthalpy/(c_p*StoredMass)))/(Volume/StoredMass) ); + +END; ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_desc.tex @@ -0,0 +1,38 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Tankp (Tankp_desc.tex) +% Generated by MTT on Fri Mar 20 12:21:36 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Tankp} is + displayed in Figure \Ref{Tankp_abg} and its label + file is listed in Section \Ref{sec:Tankp_lbl}. + The subsystems are listed in Section \Ref{sec:Tankp_sub}. + +\textbf{Tankp} is a pseudo bond graph based model of a tank storing +(as the two states) +\begin{itemize} +\item enthalpy and +\item mass +\end{itemize} + +There are two versions: +\begin{itemize} +\item the incompressible version where the tank has a pressure-based + capacitance $c_t$ and +\item the ideal-gas version were the tank has a volume $v_t$ and $r$ + and $c_p$ are the universal gas constant and the specific heat respectively. +\end{itemize} + + + + + + + + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_lbl.txt @@ -0,0 +1,27 @@ +%SUMMARY Tankp Pseudo bond graph model of a tank storing mass and enthalpy +%DESCRIPTION Parameter 1: EITHER +%DESCRIPTION incompressible,c OR +%DESCRIPTION ideal_gas,R,c_p,v_t + +%% Label file for system Tankp (Tankp_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + tank Tankp $1 + +% Component type SS + [Hy] external external + [Th] external external ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_abg.fig @@ -0,0 +1,85 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6528 2028 8103 2028 7878 2253 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4051 2026 5626 2026 5401 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 3151 5626 3151 5401 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2028 2028 3603 2028 3378 2253 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1981 3151 4008 3151 3783 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8101 3151 10128 3151 9903 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6526 3151 7651 3151 7426 3376 +2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 + 3826 1801 3826 901 5401 901 5176 1126 +2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 + 4276 2926 4276 1351 5401 1351 5176 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 6751 901 8326 901 8326 1801 8551 1576 +2 1 0 2 5 -1 0 0 -1 0.000 0 0 -1 0 0 4 + 7876 2926 7876 1351 6751 1351 6976 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8553 2025 10128 2025 9903 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11029 2028 12604 2028 12379 2253 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8550 1800 9450 900 9450 1125 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9338 788 9563 1013 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 3619 6075 4744 6300 4519 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 5194 6075 6319 6300 6094 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 6994 6075 8119 6300 7894 +4 2 4 0 0 0 12 0.0000 4 180 540 5677 2437 [Th_in]\001 +4 2 4 0 0 0 12 0.0000 4 180 570 5722 3022 [Hy_in]\001 +4 0 4 0 0 0 12 0.0000 4 180 675 6577 3022 [Hy_out]\001 +4 0 4 0 0 0 12 0.0000 4 180 645 6577 2437 [Th_out]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 8372 2117 0\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9506 3297 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9506 2937 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 9506 3567 V\001 +4 1 1 1 0 3 20 0.0000 4 195 135 9641 3027 2\001 +4 0 4 0 0 0 20 0.0000 4 255 1440 10269 3250 SS:[Hydraulic_out]\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2482 3022 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2347 3292 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2347 2932 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 2347 3562 V\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2391 1806 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2526 1896 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2526 2571 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2391 2436 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2391 2166 .\001 +4 2 4 0 0 0 20 0.0000 4 255 1290 1895 3245 SS:[Hydraulic_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1275 1942 2077 SS:[Thermal_in]\001 +4 1 -1 0 0 22 20 0.0000 4 270 1305 6121 1261 Poly:poly\001 +4 2 4 0 0 22 12 0.0000 4 180 345 6616 856 [T2]\001 +4 2 4 0 0 22 12 0.0000 4 180 345 6661 1531 [P2]\001 +4 0 4 0 0 22 12 0.0000 4 180 345 5536 856 [T1]\001 +4 0 4 0 0 22 12 0.0000 4 180 345 5536 1531 [P1]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 7921 3286 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 4276 3286 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3826 2161 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6080 5090 1\001 +4 1 1 1 0 32 30 0.0000 4 240 195 5855 7610 t\001 +4 1 1 1 0 32 30 0.0000 4 240 285 6305 7610 w\001 +4 1 -1 0 0 22 20 0.0000 4 210 750 10575 2115 EBTF\001 +4 1 1 1 0 3 20 0.0000 4 195 165 11982 1767 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 12117 1857 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 11982 2397 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 11982 2127 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 12117 2532 2\001 +4 0 4 0 0 0 20 0.0000 4 255 1425 12700 2080 SS:[Thermal_out]\001 +4 1 -1 0 0 22 20 0.0000 4 270 1530 6079 2749 wPipe:pipe\001 +4 1 -1 0 0 22 20 0.0000 4 210 645 9630 765 SS:T\001 +4 1 -1 0 0 22 20 0.0000 4 270 825 6080 6755 TF:k_t\001 +4 1 4 0 0 0 20 0.0000 4 240 1215 6120 8460 SS:[Shaft]\001 +4 1 4 0 0 0 12 0.0000 4 180 495 6076 3421 [Work]\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_desc.tex @@ -0,0 +1,21 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Turb (Turb_desc.tex) +% Generated by MTT on Fri Mar 20 15:53:12 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Turb} is + displayed in Figure \Ref{Turb_abg} and its label + file is listed in Section \Ref{sec:Turb_lbl}. + The subsystems are listed in Section \Ref{sec:Turb_sub}. + +\textbf{Turb} represents an ideal turbine component for compressible +or incompressible flow though a pipe. + +It is identical to the \textbf{Pump} component (which has a more +complete description) exept for the direction of work flow. ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_lbl.txt @@ -0,0 +1,72 @@ +%SUMMARY Turb Ideal turbine component for compressible flow +%DESCRIPTION Parameter 1: c_p - specific heat of fluid +%DESCRIPTION Parameter 2: Parameter passed to Density component +%DESCRIPTION Parameter 3: alpha = (n-1)/n, n coefficient of polytropic +%DESCRIPTION expansion. +%DESCRIPTION Parameter 4: k_t pump constant: mass flow = k_t*shaft speed + +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +%ALIAS $1 c_p +%ALIAS $2 ideal_gas,r +%ALIAS $3 alpha +%ALIAS $4 effort,k + +%% Label file for system Turb (Turb_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.5 1998/07/03 10:12:18 peterg +% %% New aliased parameter form +% %% +% %% Revision 1.4 1998/07/02 19:48:45 peterg +% %% Changed aliases +% %% +% %% Revision 1.3 1998/07/02 10:55:24 peterg +% %% Lower case in out +% %% +% %% Revision 1.2 1998/07/02 10:51:10 peterg +% %% Added port aliases +% %% +% %% Revision 1.1 1998/04/07 15:21:02 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type Pipe + pipe none c_p;ideal_gas,r + +% Component type Poly + poly Poly alpha + +% Component type SS + [Hydraulic_in] external external + [Hydraulic_out] external external + [Shaft] external external + [Thermal_in] external external + [Thermal_out] external external + T external 0 + +% Component type TF + k_t lin effort,k + + + + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_abg.fig @@ -0,0 +1,47 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5143 4050 6088 3105 6088 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 2488 1822 5210 1822 6110 2722 5840 2722 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6313 4500 6313 3150 6538 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6538 3150 7438 4050 7213 4050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2445 4052 4020 4052 3795 4277 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8564 4052 10139 4052 9914 4277 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 6538 2700 7438 1800 10138 1800 9913 2025 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 13050 4950 45 4950 45 450 13050 450 13050 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6165 3105 6435 3105 +4 1 -1 0 0 22 20 0.0000 4 195 150 6315 3017 0\001 +4 1 1 1 0 3 20 0.0000 4 195 510 5865 3872 mp v\001 +4 1 1 1 0 3 20 0.0000 4 195 330 6043 4050 1 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 5729 3691 .\001 +4 1 1 1 0 3 20 0.0000 4 195 510 6675 3872 mp v\001 +4 1 1 1 0 3 20 0.0000 4 195 330 6853 4050 2 2\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6539 3691 .\001 +4 2 4 0 0 22 20 0.0000 4 270 2355 2399 4141 SS:[Hydraulic_in]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2805 3782 P\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2941 4683 1\001 +4 1 1 1 0 3 20 0.0000 4 195 195 2806 4548 V\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2805 4277 .\001 +4 2 4 0 0 22 20 0.0000 4 270 2145 2355 1892 SS:[Thermal_in]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2894 1531 T\001 +4 0 4 0 0 22 20 0.0000 4 270 2550 10319 4187 SS:[Hydraulic_out]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9689 3783 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 9600 4458 V\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9599 4187 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 9735 4593 2\001 +4 0 4 0 0 22 20 0.0000 4 270 2340 10365 1892 SS:[Thermal_out]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9734 1532 T\001 +4 1 -1 0 0 22 20 0.0000 4 210 945 4558 4185 TF:P2T\001 +4 1 -1 0 0 22 20 0.0000 4 210 945 8068 4140 TF:T2P\001 +4 1 4 0 0 22 20 0.0000 4 270 1290 6359 4771 SS:[Heat]\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_desc.tex @@ -0,0 +1,31 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system hPipe (hPipe_desc.tex) +% Generated by MTT on Tue Mar 31 09:54:08 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{hPipe} is + displayed in Figure \Ref{hPipe_abg} and its label + file is listed in Section \Ref{sec:hPipe_lbl}. + The subsystems are listed in Section \Ref{sec:hPipe_sub}. + + +\textbf{hPipe} represents an ideal (energy conserving) pipe carrying a +fluid with heat transfer. To ensure energy conservation, power bonds are used and +connected by (energy conserving) \textbf{TF} components. +It is assumed that the working fluid is an ideal gas (gas constant $r$) and that a mass +$m_t$ is stored within pipe with a volume $v_t$. + +The central \textbf{0} junction carries temperature ($T$) and the two +hydraulic ports are connected to this by appropriate transformers. +The modulus of the \textbf{TF} component labeled ``P2T'' is such P and +T are related by the ideal gas law +\begin{equation} + P = \frac{Rm_t}{v_t} T +\end{equation} + ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_lbl.txt @@ -0,0 +1,59 @@ +%SUMMARY hPipe: Pipe for compressible fluid with heat transfer and heat storage. + +%DESCRIPTION hPipe represents an ideal (energy conserving) pipe carrying a +%DESCRIPTION fluid with heat transfer. To ensure energy conservation, power bonds are used and +%DESCRIPTION connected by (energy conserving) TF components. +%DESCRIPTION It is assumed that the working fluid is an ideal gas (gas constant r) and that a mass +%DESCRIPTION m_t is stored within pipe with a volume v_t. + +%DESCRIPTION Parameter 1: m_t (mass in pipe) +%DESCRIPTION Parameter 2: v_t (volume of pipe) +%DESCRIPTION Parameter 3: r (gas constant) +%DESCRIPTION Typical lable entry +%DESCRIPTION % Component type hPipe +%DESCRIPTION pipe none m_p;v_p;r + +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +%ALIAS $1 m +%ALIAS $2 v +%ALIAS $3 r + + + +%% Label file for system hPipe (hPipe_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/07/03 17:38:32 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type SS + [Heat] SS external,external + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external + +% Component type TF + P2T lin flow,r*m/v + T2P lin effort,r*m/v ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_abg.fig Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_abg.fig +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_abg.fig @@ -0,0 +1,108 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1666 3781 3241 3781 3016 4006 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3691 3781 4591 3781 4366 4006 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3466 1756 3466 2431 3691 2206 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3466 3556 3466 2881 3691 3106 +2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 + 4366 2656 5491 2656 5491 3331 5716 3106 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6392 1532 7292 2432 7022 2432 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7742 2882 8642 3782 8372 3782 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7764 2454 8664 1554 8664 1824 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6392 3782 7292 2882 7292 3152 +2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 + 10666 2658 9766 2658 9766 3333 9993 3106 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11566 1758 11566 2433 11791 2208 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11566 3558 11566 2883 11791 3108 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9766 1531 11341 1531 11116 1756 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1666 1531 3241 1531 3016 1756 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3691 1531 5266 1531 5041 1756 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11836 1533 13411 1533 13186 1758 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11791 3781 13366 3781 13141 4006 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10411 3781 11311 3781 11086 4006 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7515 4275 7516 3106 7741 3331 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7515 5895 7516 4726 7741 4951 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 16200 6300 45 6300 45 180 16200 180 16200 6300 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7335 5895 7695 5895 +4 2 4 0 0 22 20 0.0000 4 270 2355 2430 3915 SS:[Hydraulic_in]\001 +4 2 4 0 0 22 20 0.0000 4 270 2145 2476 1666 SS:[Thermal_in]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3466 1621 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3466 3916 0\001 +4 1 4 0 0 22 12 0.0000 4 180 405 4186 2521 [rho]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 7517 2792 1\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 11566 1623 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 11566 3918 0\001 +4 1 4 0 0 22 12 0.0000 4 180 405 10846 2523 [rho]\001 +4 1 4 0 0 22 12 0.0000 4 180 495 9766 3558 [mod]\001 +4 1 -1 0 0 22 20 0.0000 4 210 840 5851 1621 TF:t2u\001 +4 1 -1 0 0 22 20 0.0000 4 270 1515 5536 3916 EMTF:p2pv\001 +4 1 4 0 0 22 12 0.0000 4 180 495 5491 3601 [mod]\001 +4 2 4 0 0 22 12 0.0000 4 180 240 3331 3016 [P]\001 +4 2 4 0 0 22 12 0.0000 4 180 240 3331 2386 [T]\001 +4 2 4 0 0 22 12 0.0000 4 180 240 11431 2386 [T]\001 +4 2 4 0 0 22 12 0.0000 4 180 240 11431 3016 [P]\001 +4 0 4 0 0 22 20 0.0000 4 270 2340 13591 1621 SS:[Thermal_out]\001 +4 0 4 0 0 22 20 0.0000 4 270 2550 13546 3916 SS:[Hydraulic_out]\001 +4 1 4 0 0 22 12 0.0000 4 180 270 4816 3601 [in]\001 +4 1 4 0 0 22 12 0.0000 4 180 405 6301 3601 [out]\001 +4 1 4 0 0 22 12 0.0000 4 180 405 10441 3556 [out]\001 +4 1 4 0 0 22 12 0.0000 4 180 270 8911 3556 [in]\001 +4 1 -1 0 0 22 20 0.0000 4 210 840 9316 1621 TF:u2t\001 +4 1 -1 0 0 22 20 0.0000 4 270 1515 9631 3871 EMTF:pv2p\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2161 3646 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2026 3511 P\001 +4 1 1 1 0 3 20 0.0000 4 195 165 12960 1261 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 13095 1396 2\001 +4 1 1 1 0 3 20 0.0000 4 195 135 13051 3647 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 12916 3512 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 12827 4187 V\001 +4 1 1 1 0 3 30 0.0000 4 60 120 12826 3916 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 12962 4322 2\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2162 4412 1\001 +4 1 1 1 0 3 20 0.0000 4 195 195 2027 4277 V\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2026 4006 .\001 +4 1 1 1 0 3 20 0.0000 4 135 210 6841 3736 m\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6841 3511 .\001 +4 1 1 1 0 3 20 0.0000 4 135 210 8101 3691 m\001 +4 1 1 1 0 3 30 0.0000 4 60 120 8101 3466 .\001 +4 1 1 1 0 3 20 0.0000 4 135 210 6570 2295 m\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6570 2070 .\001 +4 1 1 1 0 3 20 0.0000 4 135 210 8461 2341 m\001 +4 1 1 1 0 3 30 0.0000 4 60 120 8461 2116 .\001 +4 1 1 1 0 3 20 0.0000 4 135 150 7922 1847 u\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8057 1982 2\001 +4 1 1 1 0 3 20 0.0000 4 195 300 6482 3062 p v\001 +4 1 1 1 0 3 20 0.0000 4 195 330 6570 3240 1 1\001 +4 1 1 1 0 3 20 0.0000 4 195 300 8372 3063 p v\001 +4 1 1 1 0 3 20 0.0000 4 195 330 8460 3241 2 2\001 +4 1 -1 0 0 22 20 0.0000 4 270 1725 3511 2791 Density:rho1\001 +4 1 -1 0 0 22 20 0.0000 4 270 1725 11521 2793 Density:rho2\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7246 1981 1\001 +4 1 1 1 0 3 20 0.0000 4 135 150 7111 1846 u\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2115 1260 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2250 1395 1\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 7517 4592 1\001 +4 1 4 0 0 22 20 0.0000 4 270 1380 7516 6211 SS:[Shaft]\001 ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_desc.tex Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_desc.tex +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_desc.tex @@ -0,0 +1,44 @@ +% Verbal description for system wPipe (wPipe_desc.tex) +% Generated by MTT on Mon Mar 9 09:11:22 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{wPipe} is + displayed in Figure \Ref{wPipe_abg} and its label + file is listed in Section \Ref{sec:wPipe_lbl}. + The subsystems are listed in Section \Ref{sec:wPipe_sub}. + +\textbf{wPipe} represents an ideal (energy conserving) pipe carrying a +fluid with work transfer. To ensure energy conservation, power bonds are used and +connected by (energy conserving) \textbf{TF} components. + +The central \textbf{1} junction carries mass flow ($\dot m$) and the +four ports are connected to this by appropriate transformers. In the +case of the hydraulic ports, these transformers are \emph{modulated} +by the corresponding fluid density. +The bonds impinging on this \textbf{1} junction carry the +corresponding effort variables; in particular, the thermal bonds carry +specific internal energy $u$ and the hydraulic bonds carry $Pv$ where +$P$ is the pressure and $v$ the specific volume. + +The ports ``Work\_in'' and ``Work\_out'' are convenient for attaching +(for example) the shadt work of a pump, turbine or compressor. + +The ports are +\begin{itemize} +\item [Hy\_in] Pressure/volume-flow inflow +\item [Hy\_in] Pressure/volume-flow outflow +\item [Th\_in] Temperature/Entropy-flow in flow +\item [Th\_out] Temperature/Entropy-flow out flow +\item [Shaft] Torque/angular velocity input. +\end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_lbl.txt Index: mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_lbl.txt +++ mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_lbl.txt @@ -0,0 +1,76 @@ +%SUMMARY wPipe Isentropic pipe with work transfer. + +%DESCRIPTION wPipe represents an ideal (energy conserving) pipe carrying a +%DESCRIPTION fluid with work transfer. To ensure energy conservation, power bonds are used and +%DESCRIPTION connected by (energy conserving) TF components. + +%DESCRIPTION Parameter 1: c_v - specific heat of fluid +%DESCRIPTION Parameter 2: Parameter passed to Density component +%DESCRIPTION Ports: + +%DESCRIPTION [Hy_in] Pressure/volume-flow inflow +%DESCRIPTION [Hy_in] Pressure/volume-flow outflow +%DESCRIPTION [Th_in] Temperature/Entropy-flow in flow +%DESCRIPTION [Th_out] Temperature/Entropy-flow out flow +%DESCRIPTION [Shaft] Torque/angular velocity input. + +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +%ALIAS Work Shaft + +%ALIAS $1 c_v +%ALIAS $2 density,ideal_gas,r + +%ALIAS Density CompressibleFlow/Density + +%% Label file for system wPipe (wPipe_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/07/04 08:33:30 peterg +% %% New-style SS +% %% +% %% Revision 1.1 1998/07/03 17:38:20 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type Density + rho1 none density,ideal_gas,r + rho2 none density,ideal_gas,r + +% Component type EMTF + p2pv lin flow + pv2p lin effort + +% Component type SS + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Shaft] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external + +% Component type TF + t2u lin effort,c_v + u2t lin flow,c_v + + + + ADDED mtt/lib/comp/compound/Thermal/Conv/Conv_abg.fig Index: mtt/lib/comp/compound/Thermal/Conv/Conv_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/Conv/Conv_abg.fig +++ mtt/lib/comp/compound/Thermal/Conv/Conv_abg.fig @@ -0,0 +1,64 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4051 1351 5176 1351 4951 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5401 1576 5401 2701 5626 2476 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5401 3151 5401 4276 5626 4051 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2251 4501 5176 4501 4951 4726 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 6751 1351 6526 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 1351 8551 1351 8326 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9226 1350 10351 1350 10126 1575 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 8370 2925 4275 2925 4275 630 8370 630 8370 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2206 1351 3331 1351 3106 1576 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11925 6075 11925 225 675 225 675 6075 11925 6075 +4 1 -1 0 0 22 20 0.0000 4 210 390 3736 1441 ES\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 5401 1441 1\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 5401 4636 1\001 +4 1 -1 0 0 22 20 0.0000 4 270 1215 5401 3061 FMR:c_p\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2657 4682 .\001 +4 1 1 1 0 3 20 0.0000 4 135 210 2657 4952 m\001 +4 1 4 0 0 0 20 0.0000 4 240 285 3466 1126 [s]\001 +4 1 4 0 0 0 20 0.0000 4 240 300 4006 1126 [e]\001 +4 1 1 1 0 3 20 0.0000 4 195 135 4592 1262 1\001 +4 1 1 1 0 3 20 0.0000 4 195 615 4770 1080 T - T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 5085 1260 0\001 +4 1 1 1 0 3 20 0.0000 4 195 180 4683 1803 E\001 +4 1 1 1 0 3 30 0.0000 4 60 120 4683 1533 .\001 +4 1 1 1 0 3 20 0.0000 4 195 180 6079 1804 E\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6079 1534 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 6120 1125 0\001 +4 1 -1 0 0 22 20 0.0000 4 210 390 7111 1441 AF\001 +4 1 -1 0 0 22 20 0.0000 4 210 390 8911 1441 ES\001 +4 1 1 1 0 3 20 0.0000 4 195 180 7832 1803 E\001 +4 1 4 0 0 0 20 0.0000 4 240 300 8641 1081 [e]\001 +4 1 4 0 0 0 20 0.0000 4 240 285 9136 1081 [s]\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7832 1533 .\001 +4 1 1 1 0 3 20 0.0000 4 195 615 7922 1082 T - T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8237 1262 0\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7744 1264 2\001 +4 1 1 1 0 3 20 0.0000 4 270 2340 6930 2340 Pseudo Bond Graph\001 +4 2 4 0 0 0 20 0.0000 4 240 1200 2160 4590 SS:[Mdot]\001 +4 2 4 0 0 0 20 0.0000 4 255 1275 2072 1442 SS:[Th_in]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2611 1171 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2746 1261 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2746 1936 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2611 1801 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2611 1531 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9590 1220 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 9725 1310 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9590 1850 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9590 1580 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 9725 1985 2\001 +4 0 4 0 0 0 20 0.0000 4 255 1425 10443 1443 SS:[Th_out]\001 ADDED mtt/lib/comp/compound/Thermal/Conv/Conv_desc.tex Index: mtt/lib/comp/compound/Thermal/Conv/Conv_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/Conv/Conv_desc.tex +++ mtt/lib/comp/compound/Thermal/Conv/Conv_desc.tex @@ -0,0 +1,47 @@ +% Verbal description for system Conv (Conv_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:53 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/03/09 10:19:43 peterg +% %% Added note about energy consevation. +% %% +% %% Revision 1.1 1998/03/09 10:13:27 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Conv} is + displayed in Figure \Ref{Conv_abg} and its label + file is listed in Section \Ref{sec:Conv_lbl}. + The subsystems are listed in Section \Ref{sec:Conv_sub}. + +The \textbf{Conv} component represents one way isenentropic flow of +fluid though a pipe. Externally, it has true energy bonds: $P$/$\dot V$ +(Pressure/volume-flow) representing hydraulic energy and $T$/$\dot +S$(Temperature/Entropy-flow) representing convected thermal energy. + +Internally, however, the thermal part is represented by a pseudo bond +graph which computes the flow of internal energy $\dot E$ from the +upstream temperature $T_1$ and the mass flow rate $\dot m$ as: +\begin{equation} + \dot E = c_p T_1 \dot m +\end{equation} +The $AF$ component makes the $FMR$ component use $T_1$ rather than +$T_1-T_2$. + +The two \textbf{ES} components provide the conversion from true to +psuedo thermal bonds and vice versa. + +%The pipe has an resistance to flow represented by the \textbf{RS} +%component labeled `r' which can be linear or nonlinear. The hydraulic +%energy loss reappears on the thermal bond of this (energy-conserving) +%\textbf{RS} component. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Thermal/Conv/Conv_lbl.txt Index: mtt/lib/comp/compound/Thermal/Conv/Conv_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/Conv/Conv_lbl.txt +++ mtt/lib/comp/compound/Thermal/Conv/Conv_lbl.txt @@ -0,0 +1,27 @@ +%SUMMARY Conv Convection of heat through a pipe +%DESCRIPTION Parameter 1: Specific heat of fluid (c_p) + +%% Label file for system Conv (Conv_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type FMR + c_p lin effort,$1 + +% Component type SS + [Hy_in] SS external,external + [Hy_out] SS external,external + [Th_in] SS external,external + [Th_out] SS external,external ADDED mtt/lib/comp/compound/Thermal/Cycle/Cycle_abg.fig Index: mtt/lib/comp/compound/Thermal/Cycle/Cycle_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/Cycle/Cycle_abg.fig +++ mtt/lib/comp/compound/Thermal/Cycle/Cycle_abg.fig @@ -0,0 +1,77 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 1800 6750 1800 6525 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 2025 5175 3375 5400 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3825 5175 5175 5400 4950 +2 2 0 3 1 7 1 0 -1 0.000 1 0 -1 0 0 5 + 6075 900 9000 900 9000 2700 6075 2700 6075 900 +2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 + 8325 900 8550 900 8550 2700 8325 2700 8325 900 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10125 3825 10125 5175 10350 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 1800 9900 1800 9675 2025 +2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 + 8550 1665 9585 1665 9585 1935 8550 1935 8550 1665 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 4725 1440 5805 1440 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 9675 1440 10755 1440 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 7785 3465 8415 2835 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 1800 4950 1800 4725 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1755 1800 3105 1800 2880 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 2025 3375 5175 3600 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3150 5175 3600 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10350 1800 11700 1800 11475 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12150 1800 13500 1800 13275 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 11700 5175 12150 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11925 2025 11925 5175 12150 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10125 2025 10125 3375 10350 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 2025 5400 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 2025 10350 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 5175 10350 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 5175 5400 5175 +4 1 -1 0 0 0 20 0.0000 4 255 855 7290 1890 CU:gas\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5175 1890 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 1590 5175 3690 INTF:entropy\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 10125 1890 1\001 +4 1 1 1 0 3 20 0.0000 4 270 1035 7200 1440 Ideal gas\001 +4 1 1 1 0 3 20 0.0000 4 210 885 4635 1305 Heat in\001 +4 1 1 1 0 3 20 0.0000 4 210 1080 10170 1305 Work out\001 +4 1 1 1 0 3 20 0.0000 4 270 1800 5130 5895 Entropy change\001 +4 1 1 1 0 3 20 0.0000 4 270 1365 7110 3690 Ideal piston\001 +4 1 -1 0 0 0 20 0.0000 4 195 1560 10125 3690 INTF:volume\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 3375 1890 0\001 +4 2 4 0 0 0 20 0.0000 4 240 1140 1575 1890 SS:[Heat]\001 +4 1 -1 0 0 0 20 0.0000 4 195 585 3375 5490 SS:T\001 +4 1 1 1 0 3 20 0.0000 4 255 1485 3240 5895 Temperature\001 +4 1 -1 0 0 0 20 0.0000 4 195 570 5130 5490 SS:S\001 +4 1 -1 0 0 0 20 0.0000 4 195 615 10125 5490 SS:V\001 +4 1 -1 0 0 0 20 0.0000 4 195 570 11880 5490 SS:P\001 +4 0 4 0 0 0 20 0.0000 4 240 1230 13680 1890 SS:[Work]\001 +4 1 1 1 0 3 20 0.0000 4 270 1815 10080 5850 Volume change\001 +4 1 1 1 0 3 20 0.0000 4 195 975 11925 5850 Pressure\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 11925 1890 0\001 ADDED mtt/lib/comp/compound/Thermal/Cycle/Cycle_desc.tex Index: mtt/lib/comp/compound/Thermal/Cycle/Cycle_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/Cycle/Cycle_desc.tex +++ mtt/lib/comp/compound/Thermal/Cycle/Cycle_desc.tex @@ -0,0 +1,71 @@ +% Verbal description for system Cycle (Cycle_desc.tex) +% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/06/30 12:46:24 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/12/08 09:37:04 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Cycle} is + displayed in Figure \Ref{Cycle_abg} and its label + file is listed in Section \Ref{sec:Cycle_lbl}. + The subsystems are listed in Section \Ref{sec:Cycle_sub}. + +The system has two heat engine ports: +\begin{enumerate} +\item \textbf{[Heat]} and +\item \textbf{[Work]} +\end{enumerate} +By convention, energy flows in to the \textbf{[Heat]} port and out of +the \textbf{[Work]} port. Both ports are true energy ports. + + +The subsystem \textbf{CU} (Section \Ref{sec:CU}) is a two-port +component describing an ideal gas. It has two energy ports which, with +integral causality correspond to +\begin{enumerate} +\item Entropy flow in; temperature out +\item Volume rate of change in; pressure out +\end{enumerate} + +Four \textbf{SS} components are set up as sensors to measure the +important quantities pertaining to the cycle: +\begin{enumerate} +\item \textbf{S} to measure the integrated entropy flow +\item \textbf{T} to measure the (absolute) temperature +\item \textbf{V} to measure the integrated volume change +\item \textbf{P} to measure the pressure +\end{enumerate} + + \begin{table}[htbp] + \begin{center} + \leavevmode + \begin{tabular}{|l|l|l|l|l|} + \hline + Cycle & Compression & Heating & Expansion & Cooling \\ + \hline + Otto & II & II & II & II \\ + Carnot & II & DI & II & DI \\ + Diesel & II & ID & II & II \\ + Joule & II & ID & II & ID \\ + \hline + \end{tabular} + \caption{Cycles and their causality} + \label{tab:cycles} + \end{center} + \end{table} + + A number of cycles can be built depending on the causality of the + two ports \textbf{[Heat]} and \textbf{[Work]} of \textbf{Cycle} + Some possible cycles listed in Tables \Ref{tab:cycles} where each + table entry gives the causality on the heat and work ports + respectively. + ADDED mtt/lib/comp/compound/Thermal/Cycle/Cycle_lbl.txt Index: mtt/lib/comp/compound/Thermal/Cycle/Cycle_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/Cycle/Cycle_lbl.txt +++ mtt/lib/comp/compound/Thermal/Cycle/Cycle_lbl.txt @@ -0,0 +1,54 @@ +#SUMMARY Cycle: Closed cycle with ideal gas +#DESCRIPTION Uses the CU two-port thermal capacitor. + +#ALIAS in Heat +#ALIAS out Work + +#ALIAS $1 ideal_gas +#ALIAS $2 c_v +#ALIAS $3 gamma_g +#ALIAS $4 m_g + +## Label file for system Cycle (Cycle_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.2 1998/07/21 14:21:04 peterg +# ## New style file +# ## +# ## Revision 1.1 1997/12/08 20:24:43 peterg +# ## Initial revision +# ## +# ## Revision 1.1 1997/12/07 20:38:05 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + + +# Component type CU + gas CU ideal_gas,c_v,gamma_g,m_g + +# Component type INTF + entropy + volume + +# Component type SS + S SS external,0 + T SS external,0 + V SS external,0 + P SS external,0 + [Heat] SS external,external + [Work] SS external,external + + + ADDED mtt/lib/comp/compound/Thermal/Cycle/Cycle_simp.r Index: mtt/lib/comp/compound/Thermal/Cycle/Cycle_simp.r ================================================================== --- mtt/lib/comp/compound/Thermal/Cycle/Cycle_simp.r +++ mtt/lib/comp/compound/Thermal/Cycle/Cycle_simp.r @@ -0,0 +1,10 @@ +%% Reduce commands to simplify output for system Cycle (Cycle_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/comp/compound/Thermal/FMRT/FMRT_abg.fig Index: mtt/lib/comp/compound/Thermal/FMRT/FMRT_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/FMRT/FMRT_abg.fig +++ mtt/lib/comp/compound/Thermal/FMRT/FMRT_abg.fig @@ -0,0 +1,53 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 2701 5625 2701 5400 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 2701 7425 2701 7200 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 2476 5850 1126 6075 1351 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11475 3600 450 3600 450 451 11475 451 11475 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 2701 3375 2701 3150 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 2701 9675 2701 9450 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 900 5625 900 5400 1125 +4 1 -1 0 0 0 20 0.0000 4 195 150 5850 2791 1\001 +4 1 4 0 0 0 20 0.0000 4 255 360 4410 2476 [p]\001 +4 1 4 0 0 0 20 0.0000 4 255 360 7290 2476 [p]\001 +4 1 1 1 0 3 20 0.0000 4 255 225 5040 3106 Q\001 +4 1 1 1 0 3 30 0.0000 4 60 120 5085 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 180 5040 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 255 225 6615 3106 Q\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6660 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 180 6615 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 150 6795 2611 2\001 +4 1 1 1 0 3 20 0.0000 4 195 150 5220 2611 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 825 3825 2790 FP:fp1\001 +4 2 4 0 0 0 20 0.0000 4 255 870 1980 2790 SS:[in]\001 +4 1 4 0 0 0 20 0.0000 4 240 315 3285 2476 [f]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 3106 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2520 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 180 2475 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 150 2610 2611 1\001 +4 1 1 1 0 3 20 0.0000 4 195 150 2610 3241 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 825 7920 2790 FP:fp2\001 +4 1 4 0 0 0 20 0.0000 4 240 315 8505 2476 [f]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9090 3106 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9135 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 180 9090 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 150 9270 3241 2\001 +4 1 1 1 0 3 20 0.0000 4 195 150 9270 2611 2\001 +4 0 4 0 0 0 20 0.0000 4 255 1020 9810 2791 SS:[out]\001 +4 0 -1 0 0 0 20 0.0000 4 195 825 5850 990 FMR:r\001 +4 2 4 0 0 0 20 0.0000 4 255 1170 4185 990 SS:[mod]\001 +4 1 4 0 0 0 20 0.0000 4 255 750 5400 765 [mod]\001 ADDED mtt/lib/comp/compound/Thermal/FMRT/FMRT_desc.tex Index: mtt/lib/comp/compound/Thermal/FMRT/FMRT_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/FMRT/FMRT_desc.tex +++ mtt/lib/comp/compound/Thermal/FMRT/FMRT_desc.tex @@ -0,0 +1,11 @@ +Component \textbf{FMRT} is a two port thermal resistor with true power +bonds. Internally, it has a pseudo Bond Graph representation, and the +corresponding thermal resistance just acts as an ordinary one-port +\textbf{R} component. + +The resistance $r$ is modulated by a flow variable $f$ on the [mod] port +so that the {\em conductance\/} $\sigma$ is: +\begin{equation} + \sigma = \frac{f}{r} +\end{equation} + ADDED mtt/lib/comp/compound/Thermal/FMRT/FMRT_lbl.txt Index: mtt/lib/comp/compound/Thermal/FMRT/FMRT_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/FMRT/FMRT_lbl.txt +++ mtt/lib/comp/compound/Thermal/FMRT/FMRT_lbl.txt @@ -0,0 +1,68 @@ +#SUMMARY FMRT: Two port thermal resistance with T/Sdot bonds with flow modulation +#DESCRIPTION Port [in]: T/Sdot power in +#DESCRIPTION Port [out]: T/Sdot power out +#DESCRIPTION CR and parameters as for a one-port R component +#DESCRIPTION Internally pseudo bond graph +#DESCRIPTION Example label file entry: +#DESCRIPTION # Component type RT +#DESCRIPTION r lin flow,r + +#ALIAS ThermalIn in +#ALIAS ThermalOut out +#ALIAS Modulation mod + +#ALIAS $1 flow,r +#ALIAS $1 lin + + +## Label file for system FMRT (FMRT_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.8 2001/07/05 08:42:41 gawthrop +# ## Updated to allow auto-generation of sensitivity version +# ## +# ## Revision 1.7 2001/07/03 22:59:10 gawthrop +# ## Fixed problems with argument passing for CRs +# ## +# ## Revision 1.6 2001/06/13 17:10:26 gawthrop +# ## Alias for the cr (ie ALIAS $1 lin) +# ## +# ## Revision 1.5 2001/06/11 19:51:08 gawthrop +# ## Zapped spurious $1 alias +# ## +# ## Revision 1.4 1998/07/22 11:31:42 peterg +# ## New port names +# ## +# ## Revision 1.3 1998/07/21 16:26:05 peterg +# ## Now has aliased parameters. +# ## +# ## Revision 1.2 1998/06/29 10:08:14 peterg +# ## Converted to FP component +# ## Removed lables from FP +# ## +# ## Revision 1.1 1997/09/04 09:48:47 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + +# Component type FMR + r lin flow,r + +# Component type FP + fp1 + fp2 + +# Component type SS + [in] SS external,external + [out] SS external,external + [mod] SS external,external ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_abg.fig Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_abg.fig +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_abg.fig @@ -0,0 +1,84 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2715 1351 3840 1351 3615 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4515 1351 5640 1351 5415 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5865 1576 5865 2701 6090 2476 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5865 3151 5865 4276 6090 4051 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2715 4501 5640 4501 5415 4726 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6090 1351 7215 1351 6990 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7890 1351 9015 1351 8790 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6090 4501 10815 4501 10590 4726 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9690 1350 10815 1350 10590 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11039 4274 11039 3149 11264 3374 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11039 2699 11039 1574 11264 1799 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11267 1353 12392 1353 12167 1578 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11267 4500 12392 4500 12167 4725 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 8834 2925 4739 2925 4739 630 8834 630 8834 2925 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 15075 6075 15075 450 450 450 450 6075 15075 6075 +4 2 4 0 0 0 20 0.0000 4 255 2085 2624 4590 SS:[Hydraulic_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1935 2581 1442 SS:[Thermal_in]\001 +4 1 -1 0 0 22 20 0.0000 4 210 390 4200 1441 ES\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 5865 1441 1\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 5865 4636 1\001 +4 1 -1 0 0 22 20 0.0000 4 210 390 7575 1441 AF\001 +4 1 -1 0 0 22 20 0.0000 4 270 1665 5865 3061 FMR:rho_cp\001 +4 1 -1 0 0 22 20 0.0000 4 210 390 9375 1441 ES\001 +4 1 1 1 0 3 20 0.0000 4 195 180 8296 1803 E\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3256 4412 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3121 4682 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3121 4322 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 3121 4952 V\001 +4 1 4 0 0 0 20 0.0000 4 240 285 3930 1126 [s]\001 +4 1 4 0 0 0 20 0.0000 4 240 300 4470 1126 [e]\001 +4 1 4 0 0 0 20 0.0000 4 240 300 9105 1081 [e]\001 +4 1 4 0 0 0 20 0.0000 4 240 285 9600 1081 [s]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3120 1171 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3255 1261 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3255 1936 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3120 1801 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3120 1531 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 5056 1262 1\001 +4 1 1 1 0 3 20 0.0000 4 195 615 5234 1080 T - T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 5549 1260 0\001 +4 1 1 1 0 3 30 0.0000 4 60 120 8296 1533 .\001 +4 1 1 1 0 3 20 0.0000 4 195 615 8386 1082 T - T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8701 1262 0\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8208 1264 2\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 11039 1440 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 11039 4590 1\001 +4 1 -1 0 0 22 20 0.0000 4 210 600 11084 3015 RS:r\001 +4 0 4 0 0 0 20 0.0000 4 255 2235 12617 4593 SS:[Hydraulic_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 2085 12572 1443 SS:[Thermal_out]\001 +4 1 1 1 0 3 30 0.0000 4 60 120 11674 4685 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 11674 4325 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 11674 4955 V\001 +4 1 1 1 0 3 20 0.0000 4 195 135 11809 4415 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 11674 1175 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 11809 1265 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 11674 1805 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 11674 1535 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 11809 1940 2\001 +4 1 1 1 0 3 20 0.0000 4 270 2340 7394 2340 Pseudo Bond Graph\001 +4 1 1 1 0 3 20 0.0000 4 195 180 5147 1803 E\001 +4 1 1 1 0 3 30 0.0000 4 60 120 5147 1533 .\001 +4 1 1 1 0 3 20 0.0000 4 195 180 6543 1804 E\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6543 1534 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 6584 1125 0\001 ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_desc.tex Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_desc.tex +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_desc.tex @@ -0,0 +1,44 @@ +% Verbal description for system Pipe (Pipe_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:53 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/09 10:13:27 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Pipe} is + displayed in Figure \Ref{Pipe_abg} and its label + file is listed in Section \Ref{sec:Pipe_lbl}. + The subsystems are listed in Section \Ref{sec:Pipe_sub}. + +The \textbf{Pipe} component represents one way flow of incompressible +fluid though a pipe. Externally, it has true energy bonds: $P$/$\dot V$ +(Pressure/volume-flow) representing hydraulic energy and $T$/$\dot +S$(Temperature/Entropy-flow) representing convected thermal energy. + +Internally, however, the thermal part is represented by a pseudo bond +graph which computes the flow of internal energy $\dot E$ from the +upstream temperature $T_1$ and the volumetric flow rate $\dot V$ as: +\begin{equation} + \dot E = \rho c_p T_1 \dot V +\end{equation} +The $AF$ component makes the $FMR$ component use $T_1$ rather than +$T_1-T_2$. + +The two \textbf{ES} components provide the conversion from true to +psuedo thermal bonds and vice versa. + +The pipe has an resistance to flow represented by the \textbf{RS} +component labeled `r' which can be linear or nonlinear. The hydraulic +energy loss reappears on the thermal bond of this (energy-conserving) +\textbf{RS} component. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_lbl.txt Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_lbl.txt +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_lbl.txt @@ -0,0 +1,52 @@ +%% Label file for system Pipe (Pipe_lbl.txt) +%SUMMARY Pipe: Pipe containing hot incompressible liquid +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/11/20 11:34:17 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + + +%ALIAS $1 rho +%ALIAS $2 c_p +%ALIAS $3 flow,r + + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type FMR + rho_cp lin effort,$1*$2 + +% Component type RS + r $1 $3 + +% Component type SS + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external + ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_abg.fig Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_abg.fig +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_abg.fig @@ -0,0 +1,56 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2714 2476 3839 2476 3614 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4289 2476 5414 2476 5189 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6313 2477 8297 2478 8072 2703 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2713 1351 5418 1353 5193 1578 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6313 1351 8297 1352 8072 1577 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 3825 4050 2700 4275 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 5400 4050 4275 4275 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4063 7020 4063 5895 4288 6120 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 10800 7650 10800 450 405 450 405 7650 10800 7650 +4 2 4 0 0 0 20 0.0000 4 255 2085 2669 2567 SS:[Hydraulic_in]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 4064 2612 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3166 2389 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3031 2659 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3031 2299 P\001 +4 0 4 0 0 0 20 0.0000 4 255 2235 8522 2571 SS:[Hydraulic_out]\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7579 2663 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7579 2303 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 7579 2933 V\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7714 2393 2\001 +4 0 4 0 0 0 20 0.0000 4 255 1035 6313 2341 [Hy_out]\001 +4 1 -1 0 0 22 20 0.0000 4 270 1305 5953 1936 Pipe:pipe\001 +4 2 4 0 0 0 20 0.0000 4 255 870 5459 1172 [Th_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1935 2536 1444 SS:[Thermal_in]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3075 1173 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3210 1263 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3210 1938 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3075 1803 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3075 1533 .\001 +4 0 4 0 0 0 20 0.0000 4 255 1020 6313 1171 [Th_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 2085 8477 1400 SS:[Thermal_out]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7579 1132 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7714 1222 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 7579 1762 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7579 1492 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7714 1897 2\001 +4 2 4 0 0 0 20 0.0000 4 255 885 5457 2340 [Hy_in]\001 +4 1 1 1 0 3 20 0.0000 4 195 195 3031 2929 V\001 +4 1 -1 0 0 22 20 0.0000 4 270 915 4063 4141 TF:k_p\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 4064 5717 1\001 +4 1 4 0 0 0 20 0.0000 4 240 1215 4063 7381 SS:[Shaft]\001 +4 1 1 1 0 32 30 0.0000 4 240 195 3838 6661 t\001 +4 1 1 1 0 32 30 0.0000 4 240 285 4288 6661 w\001 ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_desc.tex Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_desc.tex +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_desc.tex @@ -0,0 +1,35 @@ +% Verbal description for system Pump (Pump_desc.tex) +% Generated by MTT on Mon Mar 9 09:11:22 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Pump} is + displayed in Figure \Ref{Pump_abg} and its label + file is listed in Section \Ref{sec:Pump_lbl}. + The subsystems are listed in Section \Ref{sec:Pump_sub}. + +\textbf{Pump} represents an ideal pump for incompressible fluid +driving fluid though a \textbf{Pipe} component. The pipe component +provides the correct thermal flow; if its resistance is set to zero, +the pump is an ideal component. + +The flow must be one way (in to out) for correct thermal properties. + +The ports are +\begin{itemize} +\item [Hy_in] Pressure/volume-flow inflow +\item [Hy_in] Pressure/volume-flow outflow +\item [Th_in] Temperature/Entropy-flow in flow +\item [Th_out] Temperature/Entropy-flow out flow +\item [Shaft] Torque/angular velocity input. +\end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_lbl.txt Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_lbl.txt +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_lbl.txt @@ -0,0 +1,53 @@ +%SUMMARY Pump: a hydraulic pump - incompressible flow +%DESCRIPTION Typical lable: pump lin rho;c_p;flow,r;k_p + +%% Label file for system Pump (Pump_lbl.txt) + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/11/20 10:07:14 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%ALIAS Pipe IncompressibleFlow/Pipe +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +%ALIAS Work Shaft + +%ALIAS $1 rho +%ALIAS $2 c_p +%ALIAS $3 flow,r +%ALIAS $4 flow,k_p + +%ALIAS $1 lin + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + +% Component type Pipe + pipe lin rho;c_p;flow,r + +% Component type TF + k_p lin flow,k_p + +% Component type SS + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external + [Shaft] SS external,external ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_abg.fig Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_abg.fig +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_abg.fig @@ -0,0 +1,76 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2940 2477 4065 2477 3840 2702 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4740 2477 5865 2477 5640 2702 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2940 5627 5865 5627 5640 5852 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6315 2478 7440 2478 7215 2703 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8116 2479 9241 2479 9016 2704 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6315 5626 9240 5626 9015 5851 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 7484 6571 4739 6571 4739 1801 7484 1801 7484 6571 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5864 5401 6314 5401 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5864 2701 6314 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6089 2702 6089 3827 6314 3602 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6089 5401 6089 4276 6314 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6088 1127 6088 2252 6313 2027 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11700 7200 11700 225 675 225 675 7200 11700 7200 +4 0 4 0 0 0 20 0.0000 4 255 2235 9421 5719 SS:[Hydraulic_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 2085 9376 2569 SS:[Thermal_out]\001 +4 2 4 0 0 0 20 0.0000 4 255 2085 2894 5716 SS:[Hydraulic_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1935 2806 2568 SS:[Thermal_in]\001 +4 1 -1 0 0 22 20 0.0000 4 210 390 4425 2567 ES\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3481 5538 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3346 5808 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3346 5448 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 3346 6078 V\001 +4 1 4 0 0 0 20 0.0000 4 240 285 4155 2252 [s]\001 +4 1 4 0 0 0 20 0.0000 4 240 300 4695 2252 [e]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3345 2297 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3480 2387 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 3480 3062 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 3345 2927 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 3345 2657 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 5281 2388 1\001 +4 1 1 1 0 3 20 0.0000 4 195 615 5459 2206 T - T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 5774 2386 0\001 +4 1 1 1 0 3 30 0.0000 4 60 120 5372 2659 .\001 +4 1 1 1 0 3 20 0.0000 4 195 180 5372 2929 E\001 +4 1 -1 0 0 22 20 0.0000 4 210 870 6089 4186 C:tank\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6090 2567 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6090 5762 0\001 +4 1 -1 0 0 22 20 0.0000 4 210 390 7800 2568 ES\001 +4 1 1 1 0 3 30 0.0000 4 60 120 8523 5811 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 8523 5451 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 8523 6081 V\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8658 5541 2\001 +4 1 1 1 0 3 20 0.0000 4 195 180 6721 2930 E\001 +4 1 4 0 0 0 20 0.0000 4 240 300 7530 2208 [e]\001 +4 1 4 0 0 0 20 0.0000 4 240 285 8025 2208 [s]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 8523 2301 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8658 2391 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 8523 2931 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 8523 2661 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 8658 3066 2\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6721 2660 .\001 +4 1 1 1 0 3 20 0.0000 4 195 615 6811 2209 T - T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 7126 2389 0\001 +4 1 1 1 0 3 20 0.0000 4 195 135 6633 2391 2\001 +4 1 1 1 0 3 20 0.0000 4 270 2340 6134 6346 Pseudo Bond Graph\001 +4 1 4 0 0 0 20 0.0000 4 240 555 5639 3826 [out]\001 +4 1 4 0 0 0 20 0.0000 4 240 405 5684 4501 [in]\001 +4 1 4 0 0 0 20 0.0000 4 255 1500 6088 990 SS:[Heat_in]\001 ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_cr.r Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_cr.r ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_cr.r +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_cr.r @@ -0,0 +1,20 @@ +% Constitutive relation file for Tank (Tank_cr.r) +% Generated by MTT at Thu Mar 5 10:30:23 GMT 1998 + +OPERATOR tank; + +%Pressure +FOR ALL COMPONENT, rho,c_p,c,Volume,Energy +LET tank(COMPONENT, rho,c_p,c,effort,1, + Volume,state,1, + Energy,state,2 + ) = (Volume*rho)/c; + +%Temperature +FOR ALL COMPONENT, rho,c_p,c,Volume,Energy +LET tank(COMPONENT, rho,c_p,c,effort,2, + Volume,state,1, + Energy,state,2 + ) = Energy/(Volume*rho*c_p); + +END; ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_desc.tex Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_desc.tex +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system Tank (Tank_desc.tex) +% Generated by MTT on Tue Jan 13 18:03:04 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Tank} is + displayed in Figure \Ref{Tank_abg} and its label + file is listed in Section \Ref{sec:Tank_lbl}. + The subsystems are listed in Section \Ref{sec:Tank_sub}. ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_lbl.txt Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_lbl.txt +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_lbl.txt @@ -0,0 +1,52 @@ +%% Label file for system Tank (Tank_lbl.txt) +%SUMMARY Tank: Tank of hot incompressible liquid +%DESCRIPTION c is the pressure constant: P=(rho*V)/c +%DESCRIPTION Typical lable: tank Tank rho;c_p;c + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/11/20 09:46:34 peterg +% %% Modernised lbl syntax +% %% +% %% Revision 1.1 1998/11/20 08:57:19 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +%ALIAS Heat Heat_in + +% Argument aliases +%ALIAS $1 rho +%ALIAS $2 c_p +%ALIAS $3 c + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + tank Tank rho,c_p,c + +% Component type SS + [Heat_in] SS external,external + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_abg.fig Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_abg.fig +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_abg.fig @@ -0,0 +1,74 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6526 7426 6526 6301 6751 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 6302 6078 6302 5853 6527 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5177 6078 5177 5853 5402 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6076 2476 3601 4951 3871 4951 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6076 3601 3601 6076 3871 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6976 2701 6976 2476 9451 4951 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 3825 6975 3600 9450 6075 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6976 6301 9228 6301 9003 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6976 5176 9228 5176 9003 5401 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2253 6302 3378 6302 3153 6527 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2253 5177 3378 5177 3153 5402 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9678 5177 10803 5177 10578 5402 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9678 6302 10803 6302 10578 6527 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 9001 6525 7876 6750 8101 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 13275 9675 13275 1350 45 1350 45 9675 13275 9675 +4 2 4 0 0 0 20 0.0000 4 255 2085 2205 6390 SS:[Hydraulic_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1935 2205 5265 SS:[Thermal_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 870 6123 4998 [Th_in]\001 +4 0 4 0 0 0 20 0.0000 4 255 1020 6977 4997 [Th_out]\001 +4 1 4 0 0 0 20 0.0000 4 240 810 6572 6167 [Shaft]\001 +4 2 4 0 0 0 20 0.0000 4 255 885 5986 6166 [Hy_in]\001 +4 0 4 0 0 0 20 0.0000 4 255 1035 7112 6167 [Hy_out]\001 +4 1 -1 0 0 22 20 0.0000 4 270 1665 6527 5762 Pump:pump\001 +4 1 -1 0 0 22 20 0.0000 4 270 1260 6527 3152 Pipe:leak\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2705 6215 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2570 6125 P\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2614 4999 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2749 5089 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2749 5764 1\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2614 5629 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2614 5359 .\001 +4 1 1 1 0 3 20 0.0000 4 195 195 2570 6755 V\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2570 6485 .\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3603 6393 0\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3603 5268 0\001 +4 0 4 0 0 0 20 0.0000 4 255 2085 10941 5271 SS:[Thermal_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 2235 10941 6397 SS:[Hydraulic_out]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 10043 4958 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 10178 5048 2\001 +4 1 1 1 0 3 20 0.0000 4 195 165 10043 5588 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 10043 5318 .\001 +4 1 1 1 0 3 20 0.0000 4 195 135 10178 5723 2\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 9453 5268 0\001 +4 1 1 1 0 3 30 0.0000 4 60 120 10088 6489 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 10088 6129 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 10088 6759 V\001 +4 1 1 1 0 3 20 0.0000 4 195 135 10223 6219 2\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 9498 6438 0\001 +4 0 4 0 0 0 20 0.0000 4 255 870 7023 2343 [Th_in]\001 +4 0 4 0 0 0 20 0.0000 4 255 885 7021 3466 [Hy_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1020 6032 2342 [Th_out]\001 +4 2 4 0 0 0 20 0.0000 4 255 1035 6032 3467 [Hy_out]\001 +4 1 4 0 0 0 20 0.0000 4 240 1215 6482 9317 SS:[Shaft]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6528 7743 1\001 ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_desc.tex Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_desc.tex +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_desc.tex @@ -0,0 +1,25 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system lPump (lPump_desc.tex) +% Generated by MTT on Mon Mar 9 10:35:44 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{lPump} is + displayed in Figure \Ref{lPump_abg} and its label + file is listed in Section \Ref{sec:lPump_lbl}. + The subsystems are listed in Section \Ref{sec:lPump_sub}. + +\textbf{lPump} corrsponds to the \textbf{Pump} component but with a +backflow leakage around the ump driven by the pressure drop across +the pump. This leakage is implemented using the \textbf{Pipe} +component to give the correct thermal behaviour. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_lbl.txt Index: mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_lbl.txt +++ mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_lbl.txt @@ -0,0 +1,52 @@ +%% Label file for system lPump (lPump_lbl.txt) +%SUMMARY lPump: a hydraulic pump with leakage - incompressible flow + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Component aliases +%ALIAS Pipe IncompressibleFlow/Pipe +%ALIAS Pump IncompressibleFlow/Pump + +% Port aliases +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +% Argument aliases +%ALIAS $1 rho +%ALIAS $2 c_p +%ALIAS $3 flow,r +%ALIAS $4 flow,k_p +%ALIAS $5 flow,r_l + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type Pipe + leak lin $1;$2;$5 + +% Component type Pump + pump lin $1;$2;$3;$4 + +% Component type SS + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external + [Shaft] SS external,external + ADDED mtt/lib/comp/compound/Thermal/RT/RT_abg.fig Index: mtt/lib/comp/compound/Thermal/RT/RT_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/RT/RT_abg.fig +++ mtt/lib/comp/compound/Thermal/RT/RT_abg.fig @@ -0,0 +1,49 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 2701 5625 2701 5400 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 2701 7425 2701 7200 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 2476 5850 1126 6075 1351 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11475 3600 450 3600 450 451 11475 451 11475 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 2701 3375 2701 3150 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 2701 9675 2701 9450 2926 +4 1 -1 0 0 0 20 0.0000 4 195 135 5850 2791 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 375 5850 991 R:r\001 +4 1 4 0 0 0 20 0.0000 4 255 315 4410 2476 [p]\001 +4 1 4 0 0 0 20 0.0000 4 255 315 7290 2476 [p]\001 +4 1 1 1 0 3 20 0.0000 4 240 210 5040 3106 Q\001 +4 1 1 1 0 3 30 0.0000 4 60 105 5085 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 5040 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 240 210 6615 3106 Q\001 +4 1 1 1 0 3 30 0.0000 4 60 105 6660 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 6615 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 6795 2611 2\001 +4 1 1 1 0 3 20 0.0000 4 195 135 5220 2611 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 765 3825 2790 FP:fp1\001 +4 2 4 0 0 0 20 0.0000 4 240 810 1980 2790 SS:[in]\001 +4 1 4 0 0 0 20 0.0000 4 240 270 3285 2476 [f]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 3106 S\001 +4 1 1 1 0 3 30 0.0000 4 60 105 2520 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2475 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2610 2611 1\001 +4 1 1 1 0 3 20 0.0000 4 195 135 2610 3241 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 765 7920 2790 FP:fp2\001 +4 1 4 0 0 0 20 0.0000 4 240 270 8505 2476 [f]\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9090 3106 S\001 +4 1 1 1 0 3 30 0.0000 4 60 105 9135 2836 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 9090 2521 T\001 +4 1 1 1 0 3 20 0.0000 4 195 135 9270 3241 2\001 +4 1 1 1 0 3 20 0.0000 4 195 135 9270 2611 2\001 +4 0 4 0 0 0 20 0.0000 4 240 960 9810 2791 SS:[out]\001 ADDED mtt/lib/comp/compound/Thermal/RT/RT_desc.tex Index: mtt/lib/comp/compound/Thermal/RT/RT_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/RT/RT_desc.tex +++ mtt/lib/comp/compound/Thermal/RT/RT_desc.tex @@ -0,0 +1,5 @@ +Component \textbf{RT} is a two port thermal resistor with true power +bonds. Internally, it has a pseudo Bond Graph representation, and the +corresponding thermal resistance just acts as an ordinary one-port +\textbf{R} component. + ADDED mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt Index: mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt +++ mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt @@ -0,0 +1,63 @@ +%SUMMARY RT: Two port thermal resistance with T/Sdot bonds +%DESCRIPTION Port [in]: T/Sdot power in +%DESCRIPTION Port [out]: T/Sdot power out +%DESCRIPTION CR and parameters as for a one-port R component +%DESCRIPTION Internally pseudo bond graph +%DESCRIPTION Example label file entry: +%DESCRIPTION % Component type RT +%DESCRIPTION r lin flow,r + +%ALIAS ThermalIn in +%ALIAS ThermalOut out + +%ALIAS $1 flow,r +%ALIAS $a1 lin + + +%% Label file for system RT (RT_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.7 2001/07/03 22:59:10 gawthrop +% %% Fixed problems with argument passing for CRs +% %% +% %% Revision 1.6 2001/06/13 17:10:26 gawthrop +% %% Alias for the cr (ie ALIAS $1 lin) +% %% +% %% Revision 1.5 2001/06/11 19:51:08 gawthrop +% %% Zapped spurious $1 alias +% %% +% %% Revision 1.4 1998/07/22 11:31:42 peterg +% %% New port names +% %% +% %% Revision 1.3 1998/07/21 16:26:05 peterg +% %% Now has aliased parameters. +% %% +% %% Revision 1.2 1998/06/29 10:08:14 peterg +% %% Converted to FP component +% %% Removed lables from FP +% %% +% %% Revision 1.1 1997/09/04 09:48:47 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + +% Component type R + r lin flow,r + +% Component type FP + fp1 + fp2 + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/comp/compound/Thermal/RT/TestRT_abg.fig Index: mtt/lib/comp/compound/Thermal/RT/TestRT_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/RT/TestRT_abg.fig +++ mtt/lib/comp/compound/Thermal/RT/TestRT_abg.fig @@ -0,0 +1,18 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 3600 3600 3600 3375 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 3600 5850 3600 5625 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 3420 3600 3780 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 3420 4500 3780 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 7020 4725 1125 4725 1125 2295 7020 2295 7020 4725 +4 1 -1 0 0 2 20 0.0000 4 195 705 4050 3690 RT:rt\001 +4 1 -1 0 0 2 20 0.0000 4 255 870 1800 3690 SS:T_1\001 +4 1 -1 0 0 2 20 0.0000 4 255 870 6345 3690 SS:T_2\001 ADDED mtt/lib/comp/compound/Thermal/RT/TestRT_lbl.txt Index: mtt/lib/comp/compound/Thermal/RT/TestRT_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/RT/TestRT_lbl.txt +++ mtt/lib/comp/compound/Thermal/RT/TestRT_lbl.txt @@ -0,0 +1,24 @@ +%SUMMARY TestRT +%DESCRIPTION +%% Label file for system TestRT (TestRT_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type RT + rt lin flow,r;0 + +% Component type SS + T_1 external external + T_2 external external ADDED mtt/lib/comp/compound/Thermal/RT1/RT1_abg.fig Index: mtt/lib/comp/compound/Thermal/RT1/RT1_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/RT1/RT1_abg.fig +++ mtt/lib/comp/compound/Thermal/RT1/RT1_abg.fig @@ -0,0 +1,30 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1575 2700 2925 2700 2700 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 2700 5175 2700 4950 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 2475 5400 1125 5625 1350 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 2700 6975 2700 6750 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7876 2701 9226 2701 9001 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10081 2701 11431 2701 11206 2926 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 12600 4275 12600 450 225 450 225 4275 12600 4275 +4 1 -1 0 0 0 20 0.0000000 4 210 690 3420 2790 ES:es\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5400 2790 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 390 5400 990 R:r\001 +4 2 4 0 0 0 20 0.0000000 4 240 870 1485 2790 SS:[in]\001 +4 1 4 0 0 0 20 0.0000000 4 240 330 2835 2475 [s]\001 +4 1 4 0 0 0 20 0.0000000 4 240 345 3960 2475 [e]\001 +4 1 -1 0 0 0 20 0.0000000 4 210 705 7470 2790 AF:af\001 +4 1 -1 0 0 0 20 0.0000000 4 210 690 9676 2791 ES:se\001 +4 0 4 0 0 0 20 0.0000000 4 240 1020 11611 2791 SS:[out]\001 +4 1 4 0 0 0 20 0.0000000 4 240 345 9091 2476 [e]\001 +4 1 4 0 0 0 20 0.0000000 4 240 330 10306 2476 [s]\001 ADDED mtt/lib/comp/compound/Thermal/RT1/RT1_desc.tex Index: mtt/lib/comp/compound/Thermal/RT1/RT1_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/RT1/RT1_desc.tex +++ mtt/lib/comp/compound/Thermal/RT1/RT1_desc.tex @@ -0,0 +1,18 @@ +Component \textbf{RT1} is a two port thermal resistor with true power +bonds. Internally, it has a pseudo Bond Graph representation, and the +corresponding thermal resistance just acts as an ordinary one-port +\textbf{R} component. +Unlike the {\bf RT} component, it is {\em one-sided\/} in the snese +that the paper flow depends only on the upstream temperature. It is +useful for modelling radiation via the Stefan-Boltzmann law when using +the {\bf StefanBoltzmann} CR. + + +This one-sidedness is achieved using the {\bf AF} component to isolate +the intrnal {\bf R} component from the downstream temperature. + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/comp/compound/Thermal/RT1/RT1_lbl.txt Index: mtt/lib/comp/compound/Thermal/RT1/RT1_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/RT1/RT1_lbl.txt +++ mtt/lib/comp/compound/Thermal/RT1/RT1_lbl.txt @@ -0,0 +1,51 @@ +%% Label file for system RT1 (RT1_lbl.txt) +%SUMMARY RT1: Two port thermal resistance with T/Sdot bonds +%DESCRIPTION Port [in]: T/Sdot power in +%DESCRIPTION Port [out]: T/Sdot power out +%DESCRIPTION CR and parameters as for a one-port R component +%DESCRIPTION One sided: flow depends on upstream temperature only +%DESCRIPTION Useful for radiation modelling +%DESCRIPTION Example label file entry: +%DESCRIPTION % Component type RT1 +%DESCRIPTION r lin flow,r + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 10:40:45 peterg +% %% Put under RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS out out + +% Argument aliases +%ALIAS $1 r +%ALIAS $1 lin + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AF + af + +% Component type ES + es + se + +% Component type R + r lin flow,r + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_abg.fig Index: mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_abg.fig +++ mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4515 2701 5865 2701 5640 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2715 2701 4065 2701 3840 2926 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 3600 225 3600 225 1801 8325 1801 8325 3600 +4 1 4 0 0 0 20 0.0000000 4 270 360 4650 2476 [p]\001 +4 1 -1 0 0 0 20 0.0000000 4 210 330 4290 2791 FP\001 +4 1 4 0 0 0 20 0.0000000 4 240 315 3975 2476 [f]\001 +4 1 1 1 0 3 20 0.0000000 4 210 165 3165 3106 S\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 3210 2836 .\001 +4 1 1 1 0 3 20 0.0000000 4 270 210 5280 3106 Q\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 5325 2836 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 5280 2521 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 3165 2521 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 3300 2611 1\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 3300 3241 1\001 +4 1 1 1 0 3 20 0.0000000 4 210 150 5460 2611 1\001 +4 0 4 0 0 0 20 0.0000000 4 270 2115 6000 2791 SS:[EnergyFlow]\001 +4 2 4 0 0 0 20 0.0000000 4 270 2220 2655 2790 SS:[EntropyFlow]\001 ADDED mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_lbl.txt Index: mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_lbl.txt +++ mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_lbl.txt @@ -0,0 +1,28 @@ +%% Label file for system ES (ES_lbl.txt) +%SUMMARY ES Identical to the FP component except for the port labels +%DESCRIPTION Converts true thermal to pseudo BGs + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS e|p EnergyFlow +%ALIAS s|f EntropyFlow + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [EnergyFlow] SS external,external + [EntropyFlow] SS external,external ADDED mtt/lib/comp/compound/Thermal/VM/VM_abg.fig Index: mtt/lib/comp/compound/Thermal/VM/VM_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/VM/VM_abg.fig +++ mtt/lib/comp/compound/Thermal/VM/VM_abg.fig @@ -0,0 +1,54 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 3825 3600 3825 3375 4050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 3600 4500 2925 4500 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 1980 5400 2655 5625 2430 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 2925 6975 3600 6750 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7246 3826 8371 3826 8146 4051 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5175 10125 450 225 450 225 5175 10125 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 1125 4500 1125 4275 1350 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 900 4500 1395 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 1800 4500 1800 4275 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 1575 4500 2070 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 4050 6300 4725 6525 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 4050 4500 4725 4320 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 4725 4950 4725 5175 4950 +4 2 4 0 0 0 20 0.0000 4 255 1290 2073 3918 SS:[Hy_in]\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2570 4010 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2570 3650 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 2570 4280 V\001 +4 1 4 0 0 0 20 0.0000 4 240 570 5445 1935 [rho]\001 +4 2 4 0 0 0 20 0.0000 4 240 675 5355 2700 [mod]\001 +4 1 -1 0 0 22 20 0.0000 4 210 1365 5400 3015 EMAF:rho\001 +4 1 4 0 0 0 20 0.0000 4 240 405 4860 3285 [in]\001 +4 1 4 0 0 0 20 0.0000 4 240 555 5851 3241 [out]\001 +4 1 1 1 0 3 30 0.0000 4 60 120 8018 3968 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 8018 3608 P\001 +4 1 1 1 0 3 20 0.0000 4 135 210 8018 4238 m\001 +4 0 4 0 0 0 20 0.0000 4 255 1440 8551 3916 SS:[Hy_out]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3825 3915 1\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6975 3915 0\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2613 948 T\001 +4 2 4 0 0 0 20 0.0000 4 240 345 4410 1665 [P]\001 +4 2 4 0 0 0 20 0.0000 4 240 360 4455 945 [T]\001 +4 2 4 0 0 0 20 0.0000 4 240 750 2119 1849 SS:[P]\001 +4 2 4 0 0 0 20 0.0000 4 240 765 2119 1219 SS:[T]\001 +4 1 -1 0 0 22 20 0.0000 4 270 2130 5715 1530 Density:density\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 4725 4815 0\001 +4 1 -1 0 0 22 20 0.0000 4 210 405 5985 4815 AE\001 ADDED mtt/lib/comp/compound/Thermal/VM/VM_desc.tex Index: mtt/lib/comp/compound/Thermal/VM/VM_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/VM/VM_desc.tex +++ mtt/lib/comp/compound/Thermal/VM/VM_desc.tex @@ -0,0 +1,29 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system VM (VM_desc.tex) +% Generated by MTT on Thu Mar 19 14:37:43 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{VM} is + displayed in Figure \Ref{VM_abg} and its label + file is listed in Section \Ref{sec:VM_lbl}. + The subsystems are listed in Section \Ref{sec:VM_sub}. + +The \textbf{VM} component acts as a density-modulated transformer +converting a $P$/$\dot V$ energy bond to a $P$/$\dot m$ pseudo bond. It used +the \textbf{Density} component and therfore inherits the properties of +that component -- in particular it takes the same parameter. The four +ports are: + +\begin{itemize} +\item [Hy_in]: hydraulic in +\item [Hy_out]: hydraulic out +\item [P]: Pressure +\item [T]: Temperature +\end{itemize} + ADDED mtt/lib/comp/compound/Thermal/VM/VM_lbl.txt Index: mtt/lib/comp/compound/Thermal/VM/VM_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/VM/VM_lbl.txt +++ mtt/lib/comp/compound/Thermal/VM/VM_lbl.txt @@ -0,0 +1,33 @@ +%SUMMARY VM: Volumetric to mass flow and vv - pseudo mass-flow bond +%DESCRIPTION Converts between P/Vdot energy bond to a P/mdot pseudo bond +%DESCRIPTION Parameter 1: passed to the Density subcomponent +%% Label file for system VM (VM_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/26 08:37:59 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type Density + density none $1 + +% Component type EMAF + rho + +% Component type SS + [Hy_in] SS external,external + [Hy_out] SS external,external + [P] SS external,external + [T] SS external,external ADDED mtt/lib/comp/compound/Thermal/VMe/VMe_abg.fig Index: mtt/lib/comp/compound/Thermal/VMe/VMe_abg.fig ================================================================== --- mtt/lib/comp/compound/Thermal/VMe/VMe_abg.fig +++ mtt/lib/comp/compound/Thermal/VMe/VMe_abg.fig @@ -0,0 +1,40 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 3825 4950 3825 4725 4050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 1350 4500 1350 4275 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 2250 5400 3600 5625 3375 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9045 4725 9045 450 225 450 225 4725 9045 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6076 3826 7201 3826 6976 4051 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 1125 4500 1620 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 2025 4500 2025 4275 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 1800 4500 2295 +4 1 1 1 0 3 20 0.0000 4 195 165 2613 1173 T\001 +4 2 4 0 0 0 20 0.0000 4 255 1290 2073 3918 SS:[Hy_in]\001 +4 1 4 0 0 0 20 0.0000 4 240 570 5400 2115 [rho]\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2570 4010 .\001 +4 1 1 1 0 3 20 0.0000 4 195 165 2570 3650 P\001 +4 1 1 1 0 3 20 0.0000 4 195 195 2570 4280 V\001 +4 1 4 0 0 0 20 0.0000 4 240 405 4725 3690 [in]\001 +4 2 4 0 0 0 20 0.0000 4 240 675 5310 3330 [mod]\001 +4 1 -1 0 0 22 20 0.0000 4 210 1065 5535 3915 EMTF:tf\001 +4 1 4 0 0 0 20 0.0000 4 240 555 6301 3691 [out]\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6848 3968 .\001 +4 1 1 1 0 3 20 0.0000 4 195 270 6848 3608 Pv\001 +4 1 1 1 0 3 20 0.0000 4 135 210 6848 4238 m\001 +4 1 -1 0 0 22 20 0.0000 4 270 2130 5805 1665 Density:density\001 +4 2 4 0 0 0 20 0.0000 4 240 345 4410 1890 [P]\001 +4 2 4 0 0 0 20 0.0000 4 240 360 4455 1170 [T]\001 +4 2 4 0 0 0 20 0.0000 4 240 750 2119 2074 SS:[P]\001 +4 2 4 0 0 0 20 0.0000 4 240 765 2119 1444 SS:[T]\001 +4 0 4 0 0 0 20 0.0000 4 255 1440 7381 3916 SS:[Hy_out]\001 ADDED mtt/lib/comp/compound/Thermal/VMe/VMe_desc.tex Index: mtt/lib/comp/compound/Thermal/VMe/VMe_desc.tex ================================================================== --- mtt/lib/comp/compound/Thermal/VMe/VMe_desc.tex +++ mtt/lib/comp/compound/Thermal/VMe/VMe_desc.tex @@ -0,0 +1,29 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system VMe (VMe_desc.tex) +% Generated by MTT on Thu Mar 19 14:37:43 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{VMe} is + displayed in Figure \Ref{VMe_abg} and its label + file is listed in Section \Ref{sec:VMe_lbl}. + The subsystems are listed in Section \Ref{sec:VMe_sub}. + +The \textbf{VMe} component acts as a density-modulated transformer +converting a $P$/$\dot V$ energy bond to a $Pv$/$\dot m$ bond. It used +the \textbf{Density} component and therfore inherits the properties of +that component -- in particular it takes the same parameter. The four +ports are: + +\begin{itemize} +\item [Hy_in]: hydraulic in +\item [Hy_out]: hydraulic out +\item [P]: Pressure +\item [T]: Temperature +\end{itemize} + ADDED mtt/lib/comp/compound/Thermal/VMe/VMe_lbl.txt Index: mtt/lib/comp/compound/Thermal/VMe/VMe_lbl.txt ================================================================== --- mtt/lib/comp/compound/Thermal/VMe/VMe_lbl.txt +++ mtt/lib/comp/compound/Thermal/VMe/VMe_lbl.txt @@ -0,0 +1,33 @@ +%SUMMARY VMe: Volumetric to mass flow and vv - energy bonds +%DESCRIPTION Converts between P/Vdot energy bond to a Pv/mdot energy bond +%DESCRIPTION Parameter 1: passed to the Density subcomponent +%% Label file for system VMe (VMe_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/26 08:38:15 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type Density + density none $1 + +% Component type EMTF + tf lin flow + +% Component type SS + [Hy_in] SS external,external + [Hy_out] SS external,external + [P] SS external,external + [T] SS external,external ADDED mtt/lib/comp/simple/AE_alias.m Index: mtt/lib/comp/simple/AE_alias.m ================================================================== --- mtt/lib/comp/simple/AE_alias.m +++ mtt/lib/comp/simple/AE_alias.m @@ -0,0 +1,15 @@ +function alias = AE_alias # Port aliases for AE + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/AE_cause.m Index: mtt/lib/comp/simple/AE_cause.m ================================================================== --- mtt/lib/comp/simple/AE_cause.m +++ mtt/lib/comp/simple/AE_cause.m @@ -0,0 +1,79 @@ +function [bonds,status] = AE_cause(bonds); +% AE_cause - Causality for effort amplifier component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function AE_cause +% [bonds,status] = AE_cause(bonds) + +%SUMMARY AE: effort amplifier +%DESCRIPTION Port[1]: amplifier effort input e_1 (f_1=0) +%DESCRIPTION Port[2]: amplifier effort output e_2 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/11/01 11:40:30 peterg +% %% Documentation. +% %% +% %% Revision 1.1 1996/08/30 19:05:21 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + + +status = -1; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'AE')==0 + return +end + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + +% Port 1 must impose (zero) flow and port 2 have flow imposed +if (f_1==-1)|(f_2==1) % Conflict + status = 1; + else % Do the rest of the causality + + if f_1 == 0 % Set port 1 effort + f_1 = 1; + end; + + if f_2 == 0 % Set port 2 effort + f_2 = -1; + end; + + number_set = sum(sum([e_1 e_2]~=zeros(1,2) )); + if number_set==0 % Under causal + status = -1; + elseif number_set==1 % Set the causality + if e_1 == 0 + e_1 = -e_2; + else + e_2 = -e_1; + end + status = 0; + elseif number_set==2 % Check the causality + if e_1==-e_2 + status = 0; + else + status = 1; + end + end; +end; + + bonds = [e_1 f_1 + e_2 f_2] + ADDED mtt/lib/comp/simple/AE_eqn.m Index: mtt/lib/comp/simple/AE_eqn.m ================================================================== --- mtt/lib/comp/simple/AE_eqn.m +++ mtt/lib/comp/simple/AE_eqn.m @@ -0,0 +1,71 @@ +function structure = AE_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% AE_eqn. Equation generation for effort amplifier. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 1996/09/10 10:10:41 peter +% %% Now uses eqaution.m to format the equation. +% %% +% %% Revision 1.3 1996/08/30 19:03:10 peter +% %% Added argument check. +% %% Added extra name argument. +% %% +% %% Revision 1.2 1996/08/30 13:23:11 peter +% %% Added bond number check +% %% +% %% Revision 1.1 1996/08/22 13:12:34 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin<6 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'AE')==0 + return +end + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + + +% Flow on port 1 is always zero + fprintf(eqnfile, '%s := 0;\n', ... + varname(name,bond_number(1), -1)); + + +outcause = 1; +incause = 1; + +if e_2 == -1 % Unicausal: e_2 := e_1 + outbond = bond_number(2); + inbond = bond_number(1); + outport = 2; + inport = 1; +else % Bicausal: e_1 := e_2 + outbond = bond_number(1); + inbond = bond_number(2); + outport = 1; + inport = 2; +end + + +eqn = equation("AE",name,cr,args,outbond,outcause,outport, ... + inbond,incause,inport); +fprintf(eqnfile, '%s',eqn); + + + + + + + ADDED mtt/lib/comp/simple/AE_seqn.m Index: mtt/lib/comp/simple/AE_seqn.m ================================================================== --- mtt/lib/comp/simple/AE_seqn.m +++ mtt/lib/comp/simple/AE_seqn.m @@ -0,0 +1,8 @@ +function [eqn,insigs,innames] = AE_seqn (Name, name, cr, arg, outsig, insigs, innames) + + ## usage: [eqn,inbonds] = AE_seqn (Name, cr, arg, outbond, inbonds) + ## + ## Implements the AE component + + [eqn,insigs,innames] = Amp_seqn ("AE",Name, name, cr, arg, outsig, insigs, innames); +endfunction ADDED mtt/lib/comp/simple/AF_alias.m Index: mtt/lib/comp/simple/AF_alias.m ================================================================== --- mtt/lib/comp/simple/AF_alias.m +++ mtt/lib/comp/simple/AF_alias.m @@ -0,0 +1,15 @@ +function alias = AF_alias # Port aliases for AF + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/AF_cause.m Index: mtt/lib/comp/simple/AF_cause.m ================================================================== --- mtt/lib/comp/simple/AF_cause.m +++ mtt/lib/comp/simple/AF_cause.m @@ -0,0 +1,74 @@ +function [bonds,status] = AF_cause(bonds); +% AF_cause - Causality for Flow amplifier component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function AF_cause +% [bonds,status] = AF_cause(bonds) + +%SUMMARY AF: flow amplifier +%DESCRIPTION Port[1]: amplifier flow input f_1 (e_1=0) +%DESCRIPTION Port[2]: amplifier flow output f_2 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/08/30 19:05:32 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +status = -1; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'AF')==0 + return +end + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + +% Port 1 must impose (zero) effort and port 2 have effort imposed +if (e_1==1)|(e_2==-1) % Conflict + status = 1; + else % Do the rest of the causality + + if e_1 == 0 % Set port 1 effort + e_1 = -1; + end; + + if e_2 == 0 % Set port 2 effort + e_2 = 1; + end; + + number_set = sum(sum([f_1 f_2]~=zeros(1,2) )); + if number_set==0 % Under causal + status = -1; + elseif number_set==1 % Set the causality + if f_1 == 0 + f_1 = -f_2; + else + f_2 = -f_1; + end + status = 0; + elseif number_set==2 % Check the causality + if f_1==-f_2 + status = 0; + else + status = 1; + end + end; +end; + + bonds = [e_1 f_1 + e_2 f_2]; ADDED mtt/lib/comp/simple/AF_eqn.m Index: mtt/lib/comp/simple/AF_eqn.m ================================================================== --- mtt/lib/comp/simple/AF_eqn.m +++ mtt/lib/comp/simple/AF_eqn.m @@ -0,0 +1,76 @@ +function structure = AF_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% AF_eqn - equations for flow amplifier +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function AF_eqn +% structure = AF_eqn(bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1996/09/12 19:29:35 peter +% %% Use new equation method. +% %% +% %% Revision 1.2 1996/09/11 13:35:14 peter +% %% New equation.m method used. +% %% +% %% Revision 1.1 1996/08/30 18:38:57 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +if nargin<6 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'AF')==0 + return +end + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + +% Effort on port 1 is always zero + fprintf(eqnfile, '%s := 0;\n', ... + varname(name,bond_number(1), 1)); + +outcause = -1; +incause = -1; + +if f_2 == 1 % Unicausal: f_2 := f_1 + outbond = bond_number(2); + inbond = bond_number(1); + outport = 2; + inport = 1; +else % Bicausal: f_1 := f_2 + outbond = bond_number(1); + inbond = bond_number(2); + outport = 1; + inport = 2; +end + + +eqn = equation("AF",name,cr,args,outbond,outcause,outport, ... + inbond,incause,inport); +fprintf(eqnfile, '%s',eqn); + + + + + + + ADDED mtt/lib/comp/simple/AF_seqn.m Index: mtt/lib/comp/simple/AF_seqn.m ================================================================== --- mtt/lib/comp/simple/AF_seqn.m +++ mtt/lib/comp/simple/AF_seqn.m @@ -0,0 +1,8 @@ +function [eqn,insigs,innames] = AF_seqn (Name, name, cr, arg, outsig, insigs, innames) + + ## usage: [eqn,inbonds] = AF_seqn (Name, cr, arg, outbond, inbonds) + ## + ## Implements the AF component + + [eqn,insigs,innames] = Amp_seqn ("AF",Name, name, cr, arg, outsig, insigs, innames); +endfunction ADDED mtt/lib/comp/simple/Amp_seqn.m Index: mtt/lib/comp/simple/Amp_seqn.m ================================================================== --- mtt/lib/comp/simple/Amp_seqn.m +++ mtt/lib/comp/simple/Amp_seqn.m @@ -0,0 +1,43 @@ +function [eqn,insigs,innames] = Amp_seqn (AmpType,Name, name, cr, arg, outsig, insigs, innames) + + ## usage: [eqn,inbonds] = AF_seqn (Name, cr, arg, outbond, inbonds) + ## + ## + + N = mtt_check_sigs (outsig,insigs); + if (N!=2) + mtt_error("Amplifier component must have exactly two ports"); + endif + + + ## On which port is the equation required? + outbond_number = outsig(1); + outport = find(abs(insigs(:,1))!=outbond_number*ones(N,1)); + + ## Some definitions + flow = -1; + effort = 1; + + if strcmp(AmpType,"AE") + causality = effort; + other_causality = flow; + elseif strcmp(AmpType,"AF") + causality = flow; + other_causality = effort; + else + mtt_error(sprintf("Amp_seqn: type %s unknown", AmpType)); + endif + + ## Standard causality + if (outport==2) + qAmpType = sprintf("""%s""", AmpType); + eqn = equation(qAmpType,Name,cr,arg,outsig(1),causality,2, ... + insigs(2,1),causality,1); + elseif (outport==1) + LHS = varname(Name,insigs(2,1),other_causality); + eqn = sprintf("%s := 0;", LHS); + else + mtt_error("AF_seqn: outport must be 1 or 2"); + endif + +endfunction ADDED mtt/lib/comp/simple/C2_cause.m Index: mtt/lib/comp/simple/C2_cause.m ================================================================== --- mtt/lib/comp/simple/C2_cause.m +++ mtt/lib/comp/simple/C2_cause.m @@ -0,0 +1,35 @@ +function [bonds,status] = C2_cause(bonds); +% C2_cause - Unicausal multiport C2 C2omponent +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function C2_cause +% [bonds,status] = C2_cause(bonds) + +%SUMMARY C2: elementary C component with two ports +%DESCRIPTION Two port dynamic component +%DESCRIPTION Preferred integral causality (flow input) +%DESCRIPTION Cannot be bicausal + + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Copyright (c) P.J. Gawthrop, 1996. + +% Unicausal multiport C component +% Same causal pattern as R component + +[bonds,status] = R_cause(bonds); + + ADDED mtt/lib/comp/simple/CI_seqn.m Index: mtt/lib/comp/simple/CI_seqn.m ================================================================== --- mtt/lib/comp/simple/CI_seqn.m +++ mtt/lib/comp/simple/CI_seqn.m @@ -0,0 +1,36 @@ +function [eqn,insigs,innames] = CI_seqn (comp_type,Name, name, cr, arg, outsig, insigs ,innames) + + ## usage: [eqn,inbonds] = CI_seqn (Name, cr, arg, outbond, inbonds) + ## + ## + ## Multi port C's ?? + + delim = "__"; + N = mtt_check_sigs (outsig,insigs); + + state_index=3; + + i_cause = outsig(2); # Extract causality + + state_equation=((i_cause==1)&&strcmp(comp_type,"C")) ... + ||((i_cause==-1)&&strcmp(comp_type,"I")); + + ## Create the equation + if state_equation # output/state + LHS = varname(Name, outsig(1,1), state_index); + RHS = sprintf("MTTx_%s%s%s", Name, delim, name); + eqn_1 = sprintf("%s := %s;", LHS, RHS); + + inports = [1:N]; + comp_type_str=sprintf("""%s""", comp_type); + eqn_2 = equation(comp_type_str,Name,cr,arg,outsig(1),outsig(2),outsig(3), ... + insigs(:,1),state_index,inports); + + eqn = sprintf("%s\n%s", eqn_1, eqn_2); + else # state derivative + RHS = varname(Name, insigs(1,1), insigs(1,2)); + LHS = sprintf("MTTdx_%s%s%s", Name, delim, name); + eqn = sprintf("%s := %s;", LHS, RHS); + endif + +endfunction ADDED mtt/lib/comp/simple/C_alias.m Index: mtt/lib/comp/simple/C_alias.m ================================================================== --- mtt/lib/comp/simple/C_alias.m +++ mtt/lib/comp/simple/C_alias.m @@ -0,0 +1,18 @@ +function alias = C_alias # Port aliases for C + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/07/02 14:49:14 peterg +## Initial revision +## +############################################################### + + alias.in = '1'; + alias.out = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/C_cause.m Index: mtt/lib/comp/simple/C_cause.m ================================================================== --- mtt/lib/comp/simple/C_cause.m +++ mtt/lib/comp/simple/C_cause.m @@ -0,0 +1,69 @@ +function [bonds,status] = C_cause(bonds); +% C_cause - Unicausal multiport C component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function C_cause +% [bonds,status] = C_cause(bonds) + +%SUMMARY C: elementary C component +%DESCRIPTION Single port dynamic component +%DESCRIPTION Preferred integral causality (flow input) +%DESCRIPTION Cannot be bicausal + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/11/01 12:35:36 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +% Unicausal multiport C component +% Same causal pattern as R component + +% [bonds,status] = R_cause(bonds); + +% Set causality to preferred if not already set. +% Find the number of ports +[ports,junk] = size(bonds); + +% default undercausal status +statuses = -ones(ports,1); + +% Force unicausality but DONT set if not already set +preferred = -1; +for i = 1:ports + if (bonds(i,1)~=0)&(bonds(i,2)~=0) % Both bonds set + statuses(i) = bonds(i,1)~=bonds(i,2); + elseif bonds(i,2)~=0 % Bond 1 set + bonds(i,1) = bonds(i,2); + statuses(i) = 0; + elseif bonds(i,1)~=0 % Bond 2 set + bonds(i,2) = bonds(i,1); + statuses(i) = 0; + else # Don't set +# bonds(i,1) = preferred; +# bonds(i,2) = preferred; +# statuses(i) = 0; + end; +end; + +if max(statuses)==1 + status = 1; +elseif min(statuses)==-1 + status = -1; +else + status = 0; +end; + + ADDED mtt/lib/comp/simple/C_eqn.m Index: mtt/lib/comp/simple/C_eqn.m ================================================================== --- mtt/lib/comp/simple/C_eqn.m +++ mtt/lib/comp/simple/C_eqn.m @@ -0,0 +1,44 @@ +function structure = C_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% C_eqn - equation generation for C component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function C_eqn +% structure = C_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 2003/01/07 10:10:14 gawthrop +% %% Uses new version of equation.m - passes component type to cr. +% %% +% %% Revision 1.2 1997/04/09 13:00:28 peterg +% %% *** empty log message *** +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + + +if nargin<8 + eqnfile = 'stdout'; +end; + +% Unicausal version +CorI = 1; +structure = cieqn(name,bond_number,bonds,direction,cr,args, structure, ... + CorI, eqnfile); + + + + + + + ADDED mtt/lib/comp/simple/C_seqn.m Index: mtt/lib/comp/simple/C_seqn.m ================================================================== --- mtt/lib/comp/simple/C_seqn.m +++ mtt/lib/comp/simple/C_seqn.m @@ -0,0 +1,11 @@ +function [eqn,insigs,innames] = C_seqn (Name, name, cr, arg, outsig, insigs ,innames) + + ## usage: [eqn,inbonds] = C_seqn (Name, cr, arg, outbond, inbonds) + ## + ## + ## Multi port C's ?? + + + [eqn,insigs,innames] = CI_seqn ("C", Name, name, cr, arg, outsig, insigs ,innames); + +endfunction ADDED mtt/lib/comp/simple/EBTF_alias.m Index: mtt/lib/comp/simple/EBTF_alias.m ================================================================== --- mtt/lib/comp/simple/EBTF_alias.m +++ mtt/lib/comp/simple/EBTF_alias.m @@ -0,0 +1,15 @@ +function alias = EBTF_alias # Port aliases for EBTF + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/EBTF_cause.m Index: mtt/lib/comp/simple/EBTF_cause.m ================================================================== --- mtt/lib/comp/simple/EBTF_cause.m +++ mtt/lib/comp/simple/EBTF_cause.m @@ -0,0 +1,67 @@ +function [bonds,status] = EBTF_cause(bonds); +% EBTF_cause - causality for a EBTF component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function EBTF_cause +% [bonds,status] = EBTF_cause(bonds) + +%SUMMARY EBTF: transformer component - bicausal on effort +%DESCRIPTION Energy conserving two-port +%DESCRIPTION e_1 f_1 = e_2 f_2 and e_1 and e_2 are both imposed. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + +% Copyright (c) P.J. Gawthrop, 1998. + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'EBTF')==0 + return +end + +% Effort must be imposed by both bonds +if (bonds(1,1)==-1)|(bonds(2,1)==-1) % Overcausal + status = 1; + return +end; + +bonds(1,1) = 1; +bonds(2,1) = 1; + +% Flow bond must have through causality +if (bonds(1,2)==0)&(bonds(2,2)==0) % Undercausal + status = -1; + return +end; + +if (bonds(1,2)==bonds(2,2))&(bonds(1,2)!=0) % Overcausal + status = 1; + return +end; + +%Set flow causality +if (bonds(1,2)!=0) + bonds(2,2) = -bonds(1,2) +else + bonds(1,2) = -bonds(2,2) +end; + +status = 0; + + + + + + + ADDED mtt/lib/comp/simple/EBTF_eqn.m Index: mtt/lib/comp/simple/EBTF_eqn.m ================================================================== --- mtt/lib/comp/simple/EBTF_eqn.m +++ mtt/lib/comp/simple/EBTF_eqn.m @@ -0,0 +1,51 @@ +function structure = EBTF_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); + +if nargin<8 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'EBTF')==0 + return +end + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + + +% Effort -- no equation + +% Flow +effort1_name = varname(name,bond_number(1), 1); +effort2_name = varname(name,bond_number(2), 1); +flow1_name = varname(name,bond_number(1), -1); +flow2_name = varname(name,bond_number(2), -1); + +if f_1==-1 %Write flow on port 2 + fprintf(eqnfile,'%s := (%s/%s)*%s;\n' , ... + flow2_name, ... + effort1_name, ... + effort2_name, ... + flow1_name); +else %Write flow on port 1 + fprintf(eqnfile,'%s := (%s/%s)*%s;\n' , ... + flow1_name, ... + effort2_name, ... + effort1_name, ... + flow2_name); +end; + + + + + + + + + + + ADDED mtt/lib/comp/simple/EMTF_alias.m Index: mtt/lib/comp/simple/EMTF_alias.m ================================================================== --- mtt/lib/comp/simple/EMTF_alias.m +++ mtt/lib/comp/simple/EMTF_alias.m @@ -0,0 +1,16 @@ +function alias = EMTF_alias # Port aliases for EMTF + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + alias.mod = '3'; + +endfunction + + ADDED mtt/lib/comp/simple/EMTF_cause.m Index: mtt/lib/comp/simple/EMTF_cause.m ================================================================== --- mtt/lib/comp/simple/EMTF_cause.m +++ mtt/lib/comp/simple/EMTF_cause.m @@ -0,0 +1,83 @@ +function [bonds,status] = EMTF_cause(bonds); +% EMTF_cause - causality for a modulated TF component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function EMTF_cause +% [bonds,status] = EMTF_cause(bonds) +% Causality for effort-modulated EMTF +% At the moment, modulation can NOT be inverted. + +%SUMMARY EMTF: effort-modulated transformer +%DESCRIPTION Energy conserving three-port +%DESCRIPTION Ports [1] and [2] as for TF +%DESCRIPTION e_1 = f(f_2); f_1 = f(e_2) +%DESCRIPTION Effort on port[3] modulates the CR + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +status = -1; + +% Check that there are exactly three bonds. +if check_bonds(bonds,3,'EMTF')==0 + return +end + +% Extract the bond information +TF_bonds = bonds(1:2,:); +e_3 = bonds(3,1); +f_3 = bonds(3,2); + +%Causality of EMTF is same as that of a TF on ports 1 and 2 +[TF_bonds,TF_status] = TF_cause(TF_bonds); + + +% Effort is the modulation - imposed on component. +if e_3==-1 % Conflict + mod_status_e = 1; +else % Do the rest of the causality + if e_3==0 % Set to the fixed causality + e_3 = 1; + end; + mod_status_e = 0; +end; + +% Zero flow imposed by component. +if f_3==-1 % Conflict + mod_status_f = 1; +else % Do the rest of the causality + if f_3==0 % Set to the fixed causality + f_3 = 1; + end; + mod_status_f = 0; +end; + +bonds = [TF_bonds + e_3 f_3]; + +if (TF_status == 0) & (mod_status_e == 0) & (mod_status_f == 0) + status = 0; +end; + +if (TF_status == 1) | (mod_status_e == 1) | (mod_status_f == 1) + status = 1; +end; + + + + + + + + ADDED mtt/lib/comp/simple/EMTF_eqn.m Index: mtt/lib/comp/simple/EMTF_eqn.m ================================================================== --- mtt/lib/comp/simple/EMTF_eqn.m +++ mtt/lib/comp/simple/EMTF_eqn.m @@ -0,0 +1,81 @@ +function structure = EMTF_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 11:45:48 peterg +% %% *** empty log message *** +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +if nargin<8 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +if check_bonds(bonds,3,'EMTF')==0 + return +end + +% There are 3 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); +e_3 = bonds(3,1); + + +% Effort +outcause = 1; +incause = [1;1]; +if e_1==1 + outbond = bond_number(2); + inbond = bond_number([1 3]); + outport = 2; + inport = [1;3]; +else + outbond = bond_number(1); + inbond = bond_number([2 3]); + outport = 1; + inport = [2;3]; +end; + +eqn = equation("EMTF",name,cr,args,outbond,outcause,outport, ... + inbond,incause,inport); +fprintf(eqnfile, '%s',eqn); + +% Flow +outcause = -1; +incause = [-1;1]; +if f_1==-1 + outbond = bond_number(2); + inbond = bond_number([1 3]); + outport = 2; + inport = [1;3]; +else + outbond = bond_number(1); + inbond = bond_number([2 3]); + outport = 1; + inport = [2;3]; +end; + +eqn = equation("EMTF",name,cr,args,outbond,outcause,outport, ... + inbond,incause,inport); +fprintf(eqnfile, '%s',eqn); + +% Modulation: flow on port 3 is always zero + fprintf(eqnfile, '%s := 0;\n', ... + varname(name,bond_number(3), -1)); + + + + + + + ADDED mtt/lib/comp/simple/ES_alias.m Index: mtt/lib/comp/simple/ES_alias.m ================================================================== --- mtt/lib/comp/simple/ES_alias.m +++ mtt/lib/comp/simple/ES_alias.m @@ -0,0 +1,24 @@ +function alias = ES_alias # Port aliases for ES + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/07/02 14:47:53 peterg +## Initial revision +## +############################################################### + + alias.in = '1'; + alias.out = '2'; + + alias.e = '1'; + alias.s = '2'; + + alias.enthalpy = '1'; + alias.entropy = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/ES_cause.m Index: mtt/lib/comp/simple/ES_cause.m ================================================================== --- mtt/lib/comp/simple/ES_cause.m +++ mtt/lib/comp/simple/ES_cause.m @@ -0,0 +1,30 @@ +function [bonds,status] = ES_cause(bonds); +% Causality for ES component + +%SUMMARY ES: converts thermal pseudobond to true bond and vv +%DESCRIPTION Port [e]: temperature (T) / enthalpy flow (E) bond +%DESCRIPTION Port [s]: temperature (T) / entropy flow (S) bond + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1997. + +status = -1; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'ES')==0 + return +end + +% Same causality as TF +[bonds,status] = TF_cause(bonds); + + ADDED mtt/lib/comp/simple/ES_eqn.m Index: mtt/lib/comp/simple/ES_eqn.m ================================================================== --- mtt/lib/comp/simple/ES_eqn.m +++ mtt/lib/comp/simple/ES_eqn.m @@ -0,0 +1,72 @@ +function structure = ES_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% ES_eqn - equations for ES component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function ES_eqn +% ES_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/02/25 16:59:56 peterg +% %% Corrected enthalpy-entropy conversion -- use temp on the entropy side. +% %% +% %% Revision 1.1 1998/02/25 15:03:51 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1997. + + +if nargin<6 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +ports = 2; +if check_bonds(bonds,ports,'ES')==0 + return +end + + +% There are 2 ports; extract the information +e_bond = bonds(1,:); +s_bond = bonds(2,:); + +% The efforts are the same - but the enthalpy side has relative T +if e_bond(1)==1 %effort imposed on the enthalpy bond +% fprintf(eqnfile,'%s := %s + t_0;\n' , ... + fprintf(eqnfile,'%s := %s;\n' , ... + varname(name,bond_number(2), 1), ... + varname(name,bond_number(1), 1) ); +else %effort imposed on the entropy bond +% fprintf(eqnfile,'%s := %s - t_0;\n' , ... + fprintf(eqnfile,'%s := %s;\n' , ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(2), 1) ); +end; + +% The flows need to be converted - use the absolute temp on the +% entropy side +if e_bond(2)==-1 %flow imposed on the enthalpy bond + fprintf(eqnfile,'%s := %s/%s;\n' , ... + varname(name,bond_number(2), -1), ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(2), 1) ); +else % flow imposed on the entropy bond + fprintf(eqnfile,'%s := %s*%s;\n' , ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(2), -1), ... + varname(name,bond_number(2), 1) ); +end; ADDED mtt/lib/comp/simple/FMR_alias.m Index: mtt/lib/comp/simple/FMR_alias.m ================================================================== --- mtt/lib/comp/simple/FMR_alias.m +++ mtt/lib/comp/simple/FMR_alias.m @@ -0,0 +1,19 @@ +function alias = FMR_alias # Port aliases for FMR + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/07/02 14:47:14 peterg +## Initial revision +## +############################################################### + + alias.in = '1'; + alias.out = '2'; + alias.mod = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/FMR_cause.m Index: mtt/lib/comp/simple/FMR_cause.m ================================================================== --- mtt/lib/comp/simple/FMR_cause.m +++ mtt/lib/comp/simple/FMR_cause.m @@ -0,0 +1,83 @@ +function [bonds,status] = FMR_cause(bonds); + +% Causality for Flow-modulated R component + +%SUMMARY FMR: flow-modulated resistor +%DESCRIPTION Port[in]: a simple one port resistor +%DESCRIPTION Port[out]: flow provides modulation for the resistor +%DESCRIPTION Used with the lin CR, with parameters flow,r this gives +%DESCRIPTION a resistance r*f_m where f_m is the flow on port [out] +%DESCRIPTION Can be bicausal - deduces modulation from e and f on port[in] + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1996/11/01 11:53:48 peterg +% %% Documentation +% %% +% %% Revision 1.2 1996/08/30 13:29:05 peter +% %% Error check on bond numbers. +% %% +% %% Revision 1.1 1996/08/09 08:28:02 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +status = -1; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'FMR')==0 + return +end + + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + +% e_2 must be effort causality (imposes zero effort) + if e_2 == 1 % Conflict + status = 1; + else % Do the rest of the causality + if e_2==0 % Set to the fixed causality + e_2 = -1; + end; + + number_set = sum(sum([e_1 f_1 f_2]~=zeros(1,3) )); + if number_set<2 % Under causal + status = -1; + elseif number_set==2 % Set the causality + if f_2 == -1 % Unicausal + if e_1 == 0 + e_1 = f_1; + else + f_1 = e_1; + end; + elseif f_2 == 1 % Bicausal + e_1 = 1; + f_1 = -1; + elseif f_2 == 0 + if e_1==f_1 + f_2 = -1; % Unicausal + else + f_2 = 1; % Bicausal + end; + end; + status = 0; + elseif number_set==3 % Check the causality + if ( (f_2==-1)&(e_1~=f_1) )|( (f_2==1)&(e_1==f_1) ) + status = 1; + else + status = 0; + end; + end; + end; + + bonds = [e_1 f_1 + e_2 f_2]; + ADDED mtt/lib/comp/simple/FMR_eqn.m Index: mtt/lib/comp/simple/FMR_eqn.m ================================================================== --- mtt/lib/comp/simple/FMR_eqn.m +++ mtt/lib/comp/simple/FMR_eqn.m @@ -0,0 +1,108 @@ +function structure = FMR_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% FMR_eqn - equations for flow-modulated resistor +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function FMR_eqn +% FMR_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1996/09/12 19:30:31 peter +% %% Updated to use new eqaution.m +% %% +% %% Revision 1.2 1996/08/30 18:35:43 peter +% %% New name argument added. +% %% +% %% Revision 1.1 1996/08/30 16:38:25 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + + +if nargin<6 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +ports = 2; +if check_bonds(bonds,ports,'FMR')==0 + return +end + + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + +if length(cr)==0 % Then do default unity CR + if f_2 == -1 % Standard with modulation + if f_1 == 1 % Flow out + op = '*'; + else % Effort out + op = '/'; + end; + + fprintf(eqnfile, '%s := %s%s%s;\n', ... + varname(name,bond_number(1), -e_1), ... + varname(name,bond_number(1), e_1), ... + op, ... + varname(name,bond_number(2), -1)); + else % Deduce modulation + + fprintf(eqnfile, '%s := %s/%s;\n', ... + varname(name,bond_number(2), -1), ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(1), 1)); + end; +else % write the full works + if f_2 == -1 % Standard with modulation + outport = 1; + outnumber = bond_number(1); + if f_1 == 1 % Flow out + outcause = -1; + else % Effort out + outcause = 1; + end; + incause = [-outcause; -1]; % Flow input on port 2 + eqn = equation("FMR",name,cr,args,outnumber,outcause,outport, ... + bond_number,incause,1:ports); + fprintf(eqnfile, '%s',eqn); + + else % Modulation is output + outport = 2; + outcause = -1; + outnumber = bond_number(2); + innumber = bond_number(1)*[1;1]; + incause = [1; -1]; % Effort and flow on port 1 + inports = [1; 1]; + eqn = equation("FMR",name,cr,args,outnumber,outcause,outport, ... + innumber,incause,inports); + fprintf(eqnfile, '%s',eqn); + end; +end; + + % Effort on port 2 is always zero + fprintf(eqnfile, '%s := 0;\n', ... + varname(name,bond_number(2), 1)); + + + + + + + + + ADDED mtt/lib/comp/simple/FP_alias.m Index: mtt/lib/comp/simple/FP_alias.m ================================================================== --- mtt/lib/comp/simple/FP_alias.m +++ mtt/lib/comp/simple/FP_alias.m @@ -0,0 +1,24 @@ +function alias = FP_alias # Port aliases for FP + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/07/07 15:01:09 peterg +## Named ports correctely f --> 1, p --> 2 +## +## Revision 1.1 1998/07/02 14:46:42 peterg +## Initial revision +## +############################################################### + + alias.f = '1'; + alias.p = '2'; + + alias.s = '1'; + alias.e = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/FP_cause.m Index: mtt/lib/comp/simple/FP_cause.m ================================================================== --- mtt/lib/comp/simple/FP_cause.m +++ mtt/lib/comp/simple/FP_cause.m @@ -0,0 +1,40 @@ +function [bonds,status] = FP_cause(bonds); +% Causality for FP component + +%SUMMARY FP: converts true bond to a pseudo bond with power flow as flow +%DESCRIPTION Port [f]: True bond with a flow covariable +%DESCRIPTION Port [p]: Pseudo bond with power (ef) as flow variable + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/06/29 09:56:24 peterg +% %% Changed name to FP from ES +% %% +% %% Revision 1.1 1998/06/29 09:56:02 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1997/09/04 08:34:53 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1997. + +status = -1; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'FP')==0 + return +end + +% Same causality as TF +[bonds,status] = TF_cause(bonds); + + + ADDED mtt/lib/comp/simple/FP_eqn.m Index: mtt/lib/comp/simple/FP_eqn.m ================================================================== --- mtt/lib/comp/simple/FP_eqn.m +++ mtt/lib/comp/simple/FP_eqn.m @@ -0,0 +1,82 @@ +function structure = FP_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% FP_eqn - equations for FP component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function FP_eqn +% FP_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/07/07 15:00:04 peterg +% %% Replaced e_ by f_ +% %% s_ by p_ +% %% +% %% Revision 1.2 1998/06/29 09:54:16 peterg +% %% Changed name from ES to FP +% %% +% %% Revision 1.1 1998/06/29 09:53:22 peterg +% %% Initial revision +% %% +% %% Revision 1.3 1998/03/27 10:59:43 peterg +% %% Zapped t_0 again ... +% %% +% %% Revision 1.2 1998/02/25 16:59:56 peterg +% %% Corrected enthalpy-entropy conversion -- use temp on the entropy side. +% %% +% %% Revision 1.1 1998/02/25 15:03:51 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1997. + + +if nargin<6 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +ports = 2; +if check_bonds(bonds,ports,'FP')==0 + return +end + + +% There are 2 ports; extract the information +f_bond = bonds(1,:); +p_bond = bonds(2,:); + +% The efforts are the same +if p_bond(1)==1 %effort imposed on the pseudo bond + fprintf(eqnfile,'%s := %s;\n' , ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(2), 1) ); +else %effort imposed on the true bond + fprintf(eqnfile,'%s := %s;\n' , ... + varname(name,bond_number(2), 1), ... + varname(name,bond_number(1), 1) ); +end; + +% The flows need to be converted +if p_bond(2)==-1 %flow imposed on the pseudo bond + fprintf(eqnfile,'%s := %s/%s;\n' , ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(2), -1), ... + varname(name,bond_number(1), 1) ); +else % flow imposed on the true bond + fprintf(eqnfile,'%s := %s*%s;\n' , ... + varname(name,bond_number(2), -1), ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(2), 1) ); +end; ADDED mtt/lib/comp/simple/GY_alias.m Index: mtt/lib/comp/simple/GY_alias.m ================================================================== --- mtt/lib/comp/simple/GY_alias.m +++ mtt/lib/comp/simple/GY_alias.m @@ -0,0 +1,15 @@ +function alias = GY_alias # Port aliases for GY + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/GY_cause.m Index: mtt/lib/comp/simple/GY_cause.m ================================================================== --- mtt/lib/comp/simple/GY_cause.m +++ mtt/lib/comp/simple/GY_cause.m @@ -0,0 +1,36 @@ +function [bonds,status] = GY_cause(bonds); +% GY_cause - causality for GY component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function GY_cause +% [bonds,status] = GY_cause(bonds); + +%SUMMARY GY: elementary gyrator component +%DESCRIPTION Energy conserving two-port +%DESCRIPTION e_1 = f(f_2); f_1 = f(e_2) + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1997/09/12 09:42:12 peterg +% %% Fixed causality bug. +% %% +% %% Revision 1.1 1996/11/01 12:04:25 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +%Causality of GY is same as that of a TF but with flipped effort/flow +bonds(2,:) = - bonds(2,2:-1:1); +[bonds,status] = TF_cause(bonds); +bonds(2,:) = - bonds(2,2:-1:1); ADDED mtt/lib/comp/simple/GY_eqn.m Index: mtt/lib/comp/simple/GY_eqn.m ================================================================== --- mtt/lib/comp/simple/GY_eqn.m +++ mtt/lib/comp/simple/GY_eqn.m @@ -0,0 +1,80 @@ +function structure = GY_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% GY_eqn - equations for GY component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function GY_eqn +% structure = GY_eqn(bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 11:51:06 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + + +if nargin<8 + eqnfile = 'stdout'; +end; + + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + + +% Effort - flow +if e_1==1 + outbond = bond_number(2); + inbond = bond_number(1); + outport = 2; + inport = 1; + outcause = -1; + incause = 1; +else + outbond = bond_number(1); + inbond = bond_number(2); + outport = 1; + inport = 2; + outcause = 1; + incause = -1; +end; + +eqn = equation("GY",name,cr,args,outbond,outcause,outport, ... + inbond,incause,inport); +fprintf(eqnfile, '%s',eqn); + +% Flow-effort +if f_1==-1 + outbond = bond_number(2); + inbond = bond_number(1); + outport = 2; + inport = 1; + outcause = 1; + incause = -1; +else + outbond = bond_number(1); + inbond = bond_number(2); + outport = 1; + inport = 2; + outcause = -1; + incause = 1; +end; + +eqn = equation("GY",name,cr,args,outbond,outcause,outport, ... + inbond,incause,inport); +fprintf(eqnfile, '%s',eqn); + ADDED mtt/lib/comp/simple/GY_seqn.m Index: mtt/lib/comp/simple/GY_seqn.m ================================================================== --- mtt/lib/comp/simple/GY_seqn.m +++ mtt/lib/comp/simple/GY_seqn.m @@ -0,0 +1,27 @@ +function [eqn,insigs,innames] = GY_seqn (Name, cr, arg, outsig, insigs, innames) + + ## usage: [eqn,inbonds] = GY_seqn (Name, cr, arg, outbond, inbonds) + ## + ## + ## GYs have two ports; the input and output ports must be different + N = mtt_check_sigs (outsig,insigs); + + if N!=2 + error("A GY must have exactly two ports"); + else + if insigs(1,3)==outsig(3) # First signal is on output port + inport = 2; + else + inport = 1; + endif + endif + + insig = insigs(inport,:); + inname = innames(inport,:); + eqn = equation("""GY""",Name,cr,arg,outsig(1),outsig(2),outsig(3), ... + insig(:,1),insig(:,2),inport); + + insigs = insig; # Set the correct input signals + innames = inname; # Set the correct input names + +endfunction ADDED mtt/lib/comp/simple/I_alias.m Index: mtt/lib/comp/simple/I_alias.m ================================================================== --- mtt/lib/comp/simple/I_alias.m +++ mtt/lib/comp/simple/I_alias.m @@ -0,0 +1,15 @@ +function alias = I_alias # Port aliases for I + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '1'; + +endfunction + + ADDED mtt/lib/comp/simple/I_cause.m Index: mtt/lib/comp/simple/I_cause.m ================================================================== --- mtt/lib/comp/simple/I_cause.m +++ mtt/lib/comp/simple/I_cause.m @@ -0,0 +1,30 @@ +function [bonds,status] = I_cause(bonds); +% I_cause - Unicausal multiport C component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function I_cause +% [bonds,status] = I_cause(bonds) + +%SUMMARY I: elementary I component +%DESCRIPTION Single port dynamic component +%DESCRIPTION Preferred integral causality (effort input) +%DESCRIPTION Cannot be bicausal + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +% Same causal pattern as R component +[bonds,status] = R_cause(bonds); + + ADDED mtt/lib/comp/simple/I_eqn.m Index: mtt/lib/comp/simple/I_eqn.m ================================================================== --- mtt/lib/comp/simple/I_eqn.m +++ mtt/lib/comp/simple/I_eqn.m @@ -0,0 +1,32 @@ +function structure = I_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% I_eqn - equations for I component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function I_eqn +% structure = I_eqn(bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + + +if nargin<8 + eqnfile = 'stdout'; +end; + +% Unicausal version +CorI = -1; +structure = cieqn(name,bond_number,bonds,direction,cr,args, structure, ... + CorI, eqnfile); + ADDED mtt/lib/comp/simple/I_seqn.m Index: mtt/lib/comp/simple/I_seqn.m ================================================================== --- mtt/lib/comp/simple/I_seqn.m +++ mtt/lib/comp/simple/I_seqn.m @@ -0,0 +1,11 @@ +function [eqn,insigs,innames] = I_seqn (Name, name, cr, arg, outsig, insigs ,innames) + + ## usage: [eqn,inbonds] = I_seqn (Name, cr, arg, outbond, inbonds) + ## + ## + ## Multi port I's ?? + + + [eqn,insigs,innames] = CI_seqn ("I", Name, name, cr, arg, outsig, insigs ,innames); + +endfunction ADDED mtt/lib/comp/simple/PS_alias.m Index: mtt/lib/comp/simple/PS_alias.m ================================================================== --- mtt/lib/comp/simple/PS_alias.m +++ mtt/lib/comp/simple/PS_alias.m @@ -0,0 +1,16 @@ +function alias = PS_alias # Port aliases for PS + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + alias.power = '3'; + +endfunction + + ADDED mtt/lib/comp/simple/PS_cause.m Index: mtt/lib/comp/simple/PS_cause.m ================================================================== --- mtt/lib/comp/simple/PS_cause.m +++ mtt/lib/comp/simple/PS_cause.m @@ -0,0 +1,62 @@ +function [bonds,status] = PS_cause(bonds); +% Causality for PS component + +%SUMMARY PS: Power sensor +%DESCRIPTION Port[in]: Inflowing bond +%DESCRIPTION Port[out]: Outflowing bond e_2=e_1; f_2=f_1. +%DESCRIPTION Port[power]: f = power = e_1*f_1 = e_2*f_2 + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1997. + +status = -1; + +% Check that there are exactly three bonds. +if check_bonds(bonds,3,'PS')==0 + return +end + +% Do the [in] and [out] ports -- like a TF +inout_bonds = bonds(1:2,:); +[inout_bonds,inout_status] = TF_cause(inout_bonds); + +% Do the power port -- must have flow out and effort in +power_bonds = bonds(3,:); +for i = 1:2 + if (power_bonds(i)==1) + power_status = 0; + elseif (power_bonds(i)==0) + power_bonds(i)==1; + power_status = 0; + else + power_status = 1; + end; +end; + + + + + + +% Reconstruct the bonds +bonds = [inout_bonds; power_bonds]; + +% Generate an overall status +if (inout_status==1)|(power_status==1) + status = 1; +elseif + (inout_status==-1)|(power_status==-1) + status=-1; +else + status = 0; +end; + + ADDED mtt/lib/comp/simple/PS_eqn.m Index: mtt/lib/comp/simple/PS_eqn.m ================================================================== --- mtt/lib/comp/simple/PS_eqn.m +++ mtt/lib/comp/simple/PS_eqn.m @@ -0,0 +1,56 @@ +function structure = PS_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% PS_eqn - equations for a power sensor +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function PS_eqn +% PS_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Copyright (c) P.J. Gawthrop, 1997. + + +if nargin<6 + eqnfile = 'stdout'; +end; + +% Check that there are exactly three bonds. +ports = 3; +if check_bonds(bonds,ports,'PS')==0 + return +end + + +% There are 3 ports; extract the information +inout_bonds = bonds(1:2,:); +power_bonds = bonds(3,:); + +inout_direction = direction(1:2,:); +power_direction = direction(3,:); + +% Do ports [in] and [out] - unit gain TF. +structure = TF_eqn(name,bond_number(1:2),inout_bonds,inout_direction, ... +'lin','effort,1', structure,eqnfile); + +% Do port [power] - the power bit. +% This computes f_2 = e_1*f_1 +fprintf(eqnfile,'%s := %s*%s;\n' , ... + varname(name,bond_number(3), -power_bonds(1)), ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(1), -1) ); + + + ADDED mtt/lib/comp/simple/RST_alias.m Index: mtt/lib/comp/simple/RST_alias.m ================================================================== --- mtt/lib/comp/simple/RST_alias.m +++ mtt/lib/comp/simple/RST_alias.m @@ -0,0 +1,15 @@ +function alias = RST_alias # Port aliases for RST + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/RST_cause.m Index: mtt/lib/comp/simple/RST_cause.m ================================================================== --- mtt/lib/comp/simple/RST_cause.m +++ mtt/lib/comp/simple/RST_cause.m @@ -0,0 +1,30 @@ +function [bonds,status] = RST_cause(bonds); +% Causality for RST component + +%SUMMARY RST: thermal resistor with entropy generation +%DESCRIPTION Port[in]: a simple one port resistor but: +%DESCRIPTION flow is multiplied by e_out +%DESCRIPTION Port[out]: thermal power - effort is temperature, flow is entropy flow +%DESCRIPTION Not bicausal (yet) + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1997. + +status = -1; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'RST')==0 + return +end + +% Same causality as RS +[bonds,status] = RS_cause(bonds); + ADDED mtt/lib/comp/simple/RST_eqn.m Index: mtt/lib/comp/simple/RST_eqn.m ================================================================== --- mtt/lib/comp/simple/RST_eqn.m +++ mtt/lib/comp/simple/RST_eqn.m @@ -0,0 +1,76 @@ +function structure = RT_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% RT_eqn - equations for flow-modulated resistor +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function RT_eqn +% RT_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% VeRTion control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/09/03 09:30:45 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Copyright (c) P.J. Gawthrop, 1997. + + +if nargin<6 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +ports = 2; +if check_bonds(bonds,ports,'RT')==0 + return +end + + +% There are 2 ports; extract the information +in_bonds = bonds(1,:); +out_bonds = bonds(2,:); +in_direction = direction(1,:); +out_direction = direction(2,:); + +% Do port [in] - a standard resistor -- except for modulation by e_2 +structure = R_eqn(name,bond_number(1),in_bonds,in_direction,cr,args, ... + structure,eqnfile); + +% Resistance is multiplied by effort e_1 + e_2 (ie effort on upsteam side of +% the 1 junction) +if in_bonds(1) == 1 % Flow output - divide by e_1+e_2 + fprintf(eqnfile,'%s := %s/(%s+%s);\n' , ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(2), 1) ); +else + % Effort output - multiply by e_1+e_2 + fprintf(eqnfile,'%s := %s*(%s+%s);\n' , ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(2), 1) ); +end; + + +% Do port [out] - the thermal bit. RT is power conserving. +% This computes f_2 = e_1*f_1/e_2 or e_2 = e_1*f_1/f_2 +fprintf(eqnfile,'%s := %s*%s/%s;\n' , ... + varname(name,bond_number(2), -out_bonds(1)), ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(2), out_bonds(1)) ); + + ADDED mtt/lib/comp/simple/RS_alias.m Index: mtt/lib/comp/simple/RS_alias.m ================================================================== --- mtt/lib/comp/simple/RS_alias.m +++ mtt/lib/comp/simple/RS_alias.m @@ -0,0 +1,15 @@ +function alias = RS_alias # Port aliases for RS + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/RS_cause.m Index: mtt/lib/comp/simple/RS_cause.m ================================================================== --- mtt/lib/comp/simple/RS_cause.m +++ mtt/lib/comp/simple/RS_cause.m @@ -0,0 +1,48 @@ +function [bonds,status] = RS_cause(bonds); +% Causality for RS component + +%SUMMARY RS: resistor with entropy generation +%DESCRIPTION Port[in]: a simple one port resistor +%DESCRIPTION Port[out]: thermal power - effort is temperature, flow is entropy flow +%DESCRIPTION Not bicausal (yet) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Copyright (c) P.J. Gawthrop, 1997. + +status = -1; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'RS')==0 + return +end + +% There are 2 ports; extract the information +in_bonds = bonds(1,:); +out_bonds = bonds(2,:); + +% Port [in] is an ordinary resistor +[in_bonds,in_status] = R_cause(in_bonds); + +% Port [out] has the same causality pattern as an ordinary resistor +[out_bonds,out_status] = R_cause(out_bonds); + +% Reconstruct the bonds +bonds = [in_bonds; out_bonds]; + +% Generate an overall status +if (in_status==1)|(out_status==1) + status = 1; +elseif + (in_status==-1)|(out_status==-1) + status=-1; +else + status = 0; +end; + + ADDED mtt/lib/comp/simple/RS_eqn.m Index: mtt/lib/comp/simple/RS_eqn.m ================================================================== --- mtt/lib/comp/simple/RS_eqn.m +++ mtt/lib/comp/simple/RS_eqn.m @@ -0,0 +1,55 @@ +function structure = RS_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% RS_eqn - equations for flow-modulated resistor +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function RS_eqn +% RS_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Copyright (c) P.J. Gawthrop, 1997. + + +if nargin<6 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +ports = 2; +if check_bonds(bonds,ports,'RS')==0 + return +end + + +% There are 2 ports; extract the information +in_bonds = bonds(1,:); +out_bonds = bonds(2,:); +in_direction = direction(1,:); +out_direction = direction(2,:); + +% Do port [in] - a standard resistor +structure = R_eqn(name,bond_number(1),in_bonds,in_direction,cr,args, ... + structure,eqnfile); + +% Do port [out] - the thermal bit. RS is power conserving. +% This computes f_2 = e_1*f_1/e_2 or e_2 = e_1*f_1/f_2 +fprintf(eqnfile,'%s := %s*%s/%s;\n' , ... + varname(name,bond_number(2), -out_bonds(1)), ... + varname(name,bond_number(1), 1), ... + varname(name,bond_number(1), -1), ... + varname(name,bond_number(2), out_bonds(1)) ); + + ADDED mtt/lib/comp/simple/R_alias.m Index: mtt/lib/comp/simple/R_alias.m ================================================================== --- mtt/lib/comp/simple/R_alias.m +++ mtt/lib/comp/simple/R_alias.m @@ -0,0 +1,15 @@ +function alias = R_alias # Port aliases for R + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '1'; + +endfunction + + ADDED mtt/lib/comp/simple/R_cause.m Index: mtt/lib/comp/simple/R_cause.m ================================================================== --- mtt/lib/comp/simple/R_cause.m +++ mtt/lib/comp/simple/R_cause.m @@ -0,0 +1,56 @@ +function [bonds,status] = R_cause(bonds); +% R_cause - Causality function for a (multi-port) unicausal R component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function R_cause +% [bonds,status] = R_cause(bonds) + +%SUMMARY R: R component +%DESCRIPTION Multiport component with no dynamics +%DESCRIPTION Cannot be bicausal + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/08/30 19:05:08 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + + +% Find the number of ports +[ports,junk] = size(bonds); + +% default undercausal status +statuses = -ones(ports,1); + +% Force unicausality +for i = 1:ports + if (bonds(i,1)~=0)&(bonds(i,2)~=0) % Both bonds set + statuses(i) = bonds(i,1)~=bonds(i,2); + elseif bonds(i,2)~=0 % Bond 1 set + bonds(i,1) = bonds(i,2); + statuses(i) = 0; + elseif bonds(i,1)~=0 % Bond 2 set + bonds(i,2) = bonds(i,1); + statuses(i) = 0; + end; +end; + +if max(statuses)==1 + status = 1; +elseif min(statuses)==-1 + status = -1; +else + status = 0; +end; + + ADDED mtt/lib/comp/simple/R_eqn.m Index: mtt/lib/comp/simple/R_eqn.m ================================================================== --- mtt/lib/comp/simple/R_eqn.m +++ mtt/lib/comp/simple/R_eqn.m @@ -0,0 +1,63 @@ +function structure = R_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% R_eqn - Equation function for a (multi-port) unicausal R component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function R_eqn +% structure = R_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 1996/09/12 19:28:11 peter +% %% Added defaults (with no constitutive relationship) +% %% +% %% Revision 1.3 1996/09/12 16:40:45 peter +% %% Now does a default (when no constitutive relationship) with a unit +% %% constitutive relationship on each port. +% %% +% %% Revision 1.2 1996/09/12 13:12:04 peter +% %% Removed an fprintf that was a mistake. +% %% +% %% Revision 1.1 1996/09/12 11:00:56 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +if nargin<8 + eqnfile = 'stdout'; +end; + + +% Find the number of ports +[ports,junk] = size(bonds); + + +for outport = 1:ports + outcause = -bonds(outport,1); + outnumber = bond_number(outport); + if length(cr)>0 + incause = bonds(:,1); + inport = 1:ports; + inbond = bond_number; + else % default if no cr: unit cr on each port + incause = bonds(outport,1); + inport = outport; + inbond = outnumber; + end; + + eqn = equation("R",name,cr,args,outnumber,outcause,outport, ... + inbond,incause,inport); + fprintf(eqnfile, '%s',eqn); +end; + + ADDED mtt/lib/comp/simple/R_seqn.m Index: mtt/lib/comp/simple/R_seqn.m ================================================================== --- mtt/lib/comp/simple/R_seqn.m +++ mtt/lib/comp/simple/R_seqn.m @@ -0,0 +1,18 @@ +function [eqn,insigs,innames] = R_seqn (Name, name, cr, arg, outsig, insigs, innames) + + ## usage: [eqn,inbonds] = R_seqn (Name, cr, arg, outbond, inbonds) + ## + ## + ## Multi port R's use all potential signals + + N = mtt_check_sigs (outsig,insigs); + + inports = [1:N]; + eqn = equation("""R""",Name,cr,arg,outsig(1),outsig(2),outsig(3), ... + insigs(:,1),insigs(:,2),inports); + + ## No change + ## insigs = insigs; + ## innames = innames; + +endfunction ADDED mtt/lib/comp/simple/SS_alias.m Index: mtt/lib/comp/simple/SS_alias.m ================================================================== --- mtt/lib/comp/simple/SS_alias.m +++ mtt/lib/comp/simple/SS_alias.m @@ -0,0 +1,28 @@ +function alias = SS_alias # Port aliases for SS + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1998/07/28 19:08:22 peterg +## Some vector aliases added. +## +## Revision 1.1 1998/07/02 14:37:42 peterg +## Initial revision +## +############################################################### + + alias.in = "1"; + alias.out = "1"; + + MAX = 10; + value = "1"; + for i=1:MAX + eval(sprintf("alias.in%i = \"%s\";", i, value)); + eval(sprintf("alias.out%i = \"%s\";", i, value)); + value = sprintf("%s,%i",value,i+1); + endfor; +endfunction + + ADDED mtt/lib/comp/simple/SS_cause.m Index: mtt/lib/comp/simple/SS_cause.m ================================================================== --- mtt/lib/comp/simple/SS_cause.m +++ mtt/lib/comp/simple/SS_cause.m @@ -0,0 +1,55 @@ +function [bonds,status] = SS_cause(bonds) +% SS_cause = causality for an SS component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function SS_cause +% [bonds,status] = SS_cause(bonds) + +%SUMMARY SS: source-sensor component +%DESCRIPTION multi-port source sensor component +%DESCRIPTION when the name is [name], acts as port `name' of a system. +%DESCRIPTION may be bicausal + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/11/01 14:41:14 peterg +% %% Check correct bonds +% %% +% %% Revision 1.1 1996/11/01 12:18:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +## Check that there is exactly one bonds. +##if check_bonds(bonds,1,'SS')==0 +## return +##end + +disp("Starting SS_cause"); + +[n_bonds,junk] = size(bonds); +Status=zeros(n_bonds,1); +for i=1:n_bonds + if (bonds(i,1)==0)|(bonds(i,2)==0) % Under causal + Status(i) = -1; + else % causal + Status(i) = 0; + end; +end; +status=min(Status); + + + + + + + ADDED mtt/lib/comp/simple/SS_eqn.m Index: mtt/lib/comp/simple/SS_eqn.m ================================================================== --- mtt/lib/comp/simple/SS_eqn.m +++ mtt/lib/comp/simple/SS_eqn.m @@ -0,0 +1,267 @@ +function structure = SS_eqn(name,Bond_number,Bonds,Direction,cr,args, ... + structure,filenum); + + disp("SS_eqn"); + name,Bond_number,Bonds,Direction + + ## Set up globals to count the component inputs and outputs. This relies on + ## the named SS (the ports) being in the correct order. Using globals here + ## avoids changing the common argument list for all _eqn files for something + ## which is only used for named SS components. + global local_u_index + global local_y_index + global at_top_level + + ## SS_eqn - equations for SS component + ## + ## ####################################### + ## ###### Model Transformation Tools ##### + ## ###################################### + ## + ## Matlab function SS_eqn + ## structure = SS_eqn(name,bond_number,bonds,direction,cr,args, ... + ## structure,filenum); + + + ## Copyright (c) P.J. Gawthrop, 1996. + + + ## ############################################################### + ## ### Version control history + ## ############################################################### + ## ### $Id$ + ## ### $Log$ + ## ### Revision 1.27 2005/03/21 10:34:47 gawthrop + ## ### Tidied. + ## ### + ## ### Revision 1.26 2004/08/29 13:11:21 geraint + ## ### Writes MTTyz vector in the same format as MTTx and MTTy: MTTyz($d,1) + ## ## + ## ### Revision 1.25 2003/01/07 18:09:21 geraint + ## ### More informative error message. + ## ## + ## ### Revision 1.24 1999/10/22 02:20:32 peterg + ## ### Changed error handleing of number of attributes >2 + ## ## + ## ### Revision 1.23 1998/12/03 16:46:16 peterg + ## ### Deblanked attributes so that zero attribute works. + ## ## + ## ### Revision 1.22 1998/07/28 19:05:46 peterg + ## ### Fixed a few bugs. + ## ## + ## ### Revision 1.21 1998/07/28 14:21:31 peterg + ## ### Vector SS ports. + ## ## + ## ### Revision 1.20 1998/07/08 14:42:52 peterg + ## ### Removed the annoying info message - it causes problems with big + ## ### systems + ## ## + ## ### Revision 1.19 1998/07/08 11:33:54 peterg + ## ### Replace mtt_info by mtt_error when appropriate + ## ## + ## ### Revision 1.18 1998/07/08 11:30:45 peterg + ## ### Removed second (fileID) argument from mtt_info + ## ## + ## ### Revision 1.17 1998/07/04 07:15:44 peterg + ## ### Back under RCS + ## ## + ## ### Revision 1.16 1998/04/11 19:07:16 peterg + ## ### Now do named ports as ordinary ports iff at top level. + ## ### --- not yet complete, need to pass necesssary info though to this + ## ### function + ## ## + ## ### Revision 1.15 1997/12/16 19:16:07 peterg + ## ### Added unknown input to the effort part. + ## ## + ## ### Revision 1.14 1997/12/16 18:25:19 peterg + ## ### Added unknown_input attribure to flow -- effort still needs doing + ## ## + ## ### Revision 1.13 1997/09/18 13:15:15 peterg + ## ### Fixed incorrect error message flagging inappropriate flow outputs + ## ### -- used to give the effort rather than the flow in the error message. + ## ## + ## ### Revision 1.12 1997/08/26 07:51:30 peterg + ## ### Now counts the local input and outputs by order of appearence rather + ## ### than by port number - it therfore handles ports with bicausality correctely. + ## ## + ## ### Revision 1.11 1997/05/09 08:21:07 peterg + ## ### Explicit computation of port number -- avoids str2num + ## ## + ## ### Revision 1.10 1997/03/22 17:13:03 peterg + ## ### Fixed bug for port nos. > 1 digit! + ## ## + ## ### Revision 1.9 1997/03/22 15:50:59 peterg + ## ### Changed #1.0f to %d format. + ## ## + ## ### Revision 1.8 1996/12/10 16:52:29 peterg + ## ### Detect null string using strcmp, not length. + ## ### Put filnum argument to mtt_info. + ## ## + ## ### Revision 1.7 1996/12/07 17:17:40 peterg + ## ### Added some ; + ## ## + ## ### Revision 1.6 1996/12/05 09:49:09 peterg + ## ### Explicit computation of port number from string. + ## ## + ## ### Revision 1.5 1996/12/04 21:27:53 peterg + ## ### Replaced str2num by sprintf + ## ## + ## ### Revision 1.4 1996/08/18 20:06:21 peter + ## ### Included zero outputs. + ## ## + ## ### Revision 1.3 1996/08/09 14:08:04 peter + ## ### Empty effort and flow attributes replaced by 'external'. + ## ## + ## ### Revision 1.2 1996/08/08 16:38:19 peter + ## ### Changed to filenumer type of fprintf + ## ## + ## ### Revision 1.1 1996/08/08 16:19:08 peter + ## ### Initial revision + ## ## + ## ############################################################### + + + ## The string 'cr' contains the effort attributes; + ## 'arg' contains the flow attributes. + ## external indicates an external variable + ## internal indicates an internal variable + ## anything else is the name of a constant. + ## Blank is taken to be external + ## If its a numbered port: + ## cr contains 'MTT_port' + ## arg contains port number + + if (strcmp(cr,"SS")) # Then its the standard file + a = char(strsplit(args,",")) + [N,M]=size(a); + if (N~=2) # Must have 2 arguments + mtt_error(sprintf("SS should have 2 args not %i", N)); + endif + effort_attribute = deblank(a(1,:)); + flow_attribute = deblank(a(2,:)); + else # Old style file + effort_attribute = cr; + flow_attribute = args; + endif + + ## Default attributes + if strcmp(effort_attribute,"") + effort_attribute = "external"; + endif + + if strcmp(flow_attribute,"") + flow_attribute = "external"; + endif + + inputs = structure(3); + outputs = structure(4); + zero_outputs = structure(5); + unknown_inputs = structure(6); + + n_bonds = length(Bond_number) # Multi port? + for i=1:n_bonds # Loop over all the bonds + bond_number = Bond_number(i); + bonds = Bonds(i,:); + direction = Direction(i,:); + Named_Port = name(1)=="["; + if Named_Port + sname = name(2:length(name)); #Strip the [] + else + sname = name; + endif + + if Named_Port&&~at_top_level # It's a named port + ## Effort + if bonds(1,1)==-1 # Source + local_u_index = local_u_index + 1 + fprintf(filenum, "%s := %s_MTTu%d;\n", ... + varname(sname, bond_number,1), sname, local_u_index); + else # Sensor + local_y_index = local_y_index + 1 + fprintf(filenum, "%s_MTTy%d := %s;\n", ... + sname, local_y_index, varname(sname, bond_number,1)); + endif + + ## Flow + if bonds(1,2)==1 # Source + local_u_index = local_u_index + 1 + fprintf(filenum, "%s := %s_MTTu%d;\n", ... + varname(sname, bond_number,-1), sname, local_u_index); + else # Sensor + local_y_index = local_y_index + 1 + fprintf(filenum, "%s_MTTy%d := %s;\n", ... + sname, local_y_index, varname(sname, bond_number,-1)); + endif + else # Now do SS which are not ports + ## Effort + if strcmp(effort_attribute, "external") + if bonds(1,1)==-1 # Source + inputs = inputs+1; + fprintf(filenum, "%s := MTTu(%d,1);\n", ... + varname(sname, bond_number,1),inputs); + else # Sensor + outputs = outputs+1; + fprintf(filenum, "MTTy(%d,1) := %s;\n", ... + outputs, varname(sname, bond_number,1)); + endif + elseif strcmp(effort_attribute, "unknown") # Unknown input + unknown_inputs = unknown_inputs + 1; + fprintf(filenum, "%s := MTTUi%d;\n", ... + varname(sname, bond_number,1), unknown_inputs); + elseif strcmp(effort_attribute, "internal") + ## Do nothing + else + if bonds(1,1)==-1 # Named or unknown source + fprintf(filenum, "%s := %s;\n", ... + varname(sname, bond_number,1), effort_attribute); + else # Sensor + if strcmp(effort_attribute, "zero") #Zero output + zero_outputs = zero_outputs + 1; + fprintf(filenum, "MTTyz(%d,1) := %s;\n", ... + zero_outputs, varname(sname, bond_number,1)); + else + mtt_error([effort_attribute, " not appropriate for an output (", name, ")"]); + endif + endif + endif + + ## Flow + if strcmp(flow_attribute, "external") + if bonds(1,2)==1 # Source + inputs = inputs+1 + fprintf(filenum, "%s := MTTu(%d,1);\n", varname(sname, bond_number,-1),inputs); + else # Sensor + outputs = outputs+1 + fprintf(filenum, "MTTy(%d,1) := %s;\n", outputs, ... + varname(sname, bond_number,-1)); + endif + elseif strcmp(flow_attribute, "unknown") # Unknown input + unknown_inputs = unknown_inputs + 1 + fprintf(filenum, "%s := MTTUi%d;\n", ... + varname(sname, bond_number,-1), unknown_inputs); + elseif strcmp(flow_attribute, "internal") + ## Do nothing + else # Named constant + if bonds(1,2)==1 # Source + fprintf(filenum, "%s := %s;\n", ... + varname(sname, bond_number,-1), flow_attribute); + else # Sensor + if strcmp(flow_attribute, "zero") #Zero output + zero_outputs = zero_outputs + 1 + fprintf(filenum, "MTTyz(%d,1) := %s;\n", ... + zero_outputs, varname(sname, bond_number,-1)); + else + mtt_error([flow_attribute, " not appropriate for an output (", name, ")"]); + endif + endif + endif + endif + + structure(3) = inputs; + structure(4) = outputs; + structure(5) = zero_outputs; + structure(6) = unknown_inputs; + + endfor +endfunction + ADDED mtt/lib/comp/simple/SS_seqn.m Index: mtt/lib/comp/simple/SS_seqn.m ================================================================== --- mtt/lib/comp/simple/SS_seqn.m +++ mtt/lib/comp/simple/SS_seqn.m @@ -0,0 +1,58 @@ +function [eqn,insigs,innames] = SS_seqn (Name, name, cr, arg, outsig, ... + insigs,innames,is_port) + + ## usage: [eqn,inbonds] = SS_seqn (Name, cr, arg, outbond, inbonds) + ## + ## + ## Multi port SS's ?? + + delim = "__"; + N = mtt_check_sigs (outsig,insigs); + + full_name = sprintf("%s%s%s", Name,delim,name); + + ## Get the special attibutes for SS + attrib_name = char(strsplit(arg,",")); + [N_a,M_a]=size(attrib_name); + if (N_a~=2) # Must have 2 arguments + mtt_error(sprintf("SS should have 2 args not %i", N_a)); + end; + + effort_attribute = deblank(attrib_name(1,:)); + flow_attribute = deblank(attrib_name(2,:)); + + ## Default attributes + if strcmp(effort_attribute,"")||is_port + effort_attribute = "external"; + end; + + if strcmp(flow_attribute,"")||is_port + flow_attribute = "external"; + end; + + + if mtt_is_external("SS",outsig,insigs) # Source + if outsig(2)==1 # effort output. + attribute = effort_attribute; + else + attribute = flow_attribute; + endif + + ## Create the equation + LHS = varname(Name, outsig(1,1), outsig(1,2)); + RHS = Source_seqn (attribute,full_name); + eqn = sprintf("%s := %s;", LHS, RHS); + else # Sensor + if insigs(1,2)==1 # effort output. + attribute = effort_attribute; + else + attribute = flow_attribute; + endif + + ## Create the equation + LHS = Sensor_seqn (attribute,full_name); + RHS = varname(Name, insigs(1,1), insigs(1,2)); + eqn = sprintf("%s := %s;", LHS, RHS); + endif + +endfunction ADDED mtt/lib/comp/simple/Sensor_seqn.m Index: mtt/lib/comp/simple/Sensor_seqn.m ================================================================== --- mtt/lib/comp/simple/Sensor_seqn.m +++ mtt/lib/comp/simple/Sensor_seqn.m @@ -0,0 +1,16 @@ +function LHS = Sensor_seqn (attribute,name) + + ## usage: LHS = Sensor_seqn (attribute,name) + ## + ## Write the LHS of a sensor equation + + + if strcmp(attribute,"external") + LHS = sprintf("MTTy_%s", name); + elseif strcmp(attribute,"internal") + LHS = sprintf("MTTy_%s", name); + else + error(sprintf("attribute ""%s"" not appropriate for a " ... + "source"), attribute); + endif +endfunction ADDED mtt/lib/comp/simple/Source_seqn.m Index: mtt/lib/comp/simple/Source_seqn.m ================================================================== --- mtt/lib/comp/simple/Source_seqn.m +++ mtt/lib/comp/simple/Source_seqn.m @@ -0,0 +1,16 @@ +function RHS = Source_seqn (attribute,name) + + ## usage: RHS = Source_seqn (attribute,name) + ## + ## Write the RHS of a source equation + + if strcmp(attribute,"external") + RHS = sprintf("MTTu_%s",name); + elseif strcmp(attribute,"internal") + error(sprintf("attribute ""internal"" not appropriate for a " + "source")); + else + RHS = attribute; + endif + +endfunction ADDED mtt/lib/comp/simple/TF_alias.m Index: mtt/lib/comp/simple/TF_alias.m ================================================================== --- mtt/lib/comp/simple/TF_alias.m +++ mtt/lib/comp/simple/TF_alias.m @@ -0,0 +1,15 @@ +function alias = TF_alias # Port aliases for TF + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + alias.in = '1'; + alias.out = '2'; + +endfunction + + ADDED mtt/lib/comp/simple/TF_cause.m Index: mtt/lib/comp/simple/TF_cause.m ================================================================== --- mtt/lib/comp/simple/TF_cause.m +++ mtt/lib/comp/simple/TF_cause.m @@ -0,0 +1,36 @@ +function [bonds,status] = TF_cause(bonds); +% TF_cause - causality for a TF component +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function TF_cause +% [bonds,status] = TF_cause(bonds) + +%SUMMARY TF: elementary transformer component +%DESCRIPTION Energy conserving two-port +%DESCRIPTION e_1 = f(e_2); f_1 = f(f_2) + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/11/01 12:05:54 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'TF')==0 + return +end + + +%Causality of TF is same as that of a junction +[bonds,status] = zero_cause(bonds); ADDED mtt/lib/comp/simple/TF_eqn.m Index: mtt/lib/comp/simple/TF_eqn.m ================================================================== --- mtt/lib/comp/simple/TF_eqn.m +++ mtt/lib/comp/simple/TF_eqn.m @@ -0,0 +1,78 @@ +function structure = TF_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/09/10 10:41:37 peter +% %% Now used equation.m to write the equations. +% %% +% %% Revision 1.1 1996/08/19 09:05:04 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +if nargin<8 + eqnfile = 'stdout'; +end; + +% Check that there are exactly two bonds. +if check_bonds(bonds,2,'TF')==0 + return +end + +% There are 2 ports; extract the information +e_1 = bonds(1,1); +f_1 = bonds(1,2); +e_2 = bonds(2,1); +f_2 = bonds(2,2); + + +% Effort +outcause = 1; +incause = 1; +if e_1==1 + outbond = bond_number(2); + inbond = bond_number(1); + outport = 2; + inport = 1; +else + outbond = bond_number(1); + inbond = bond_number(2); + outport = 1; + inport = 2; +end; + +eqn = equation("TF",name,cr,args,outbond,outcause,outport, ... + inbond,incause,inport); +fprintf(eqnfile, '%s',eqn); + +% Flow +outcause = -1; +incause = -1; +if f_1==-1 + outbond = bond_number(2); + inbond = bond_number(1); + outport = 2; + inport = 1; +else + outbond = bond_number(1); + inbond = bond_number(2); + outport = 1; + inport = 2; +end; + +eqn = equation("TF",name,cr,args,outbond,outcause,outport, ... + inbond,incause,inport); +fprintf(eqnfile, '%s',eqn); + + + + + + + + ADDED mtt/lib/comp/simple/TF_seqn.m Index: mtt/lib/comp/simple/TF_seqn.m ================================================================== --- mtt/lib/comp/simple/TF_seqn.m +++ mtt/lib/comp/simple/TF_seqn.m @@ -0,0 +1,27 @@ +function [eqn,insigs,innames] = TF_seqn (Name, cr, arg, outsig, insigs, innames) + + ## usage: [eqn,inbonds] = TF_seqn (Name, cr, arg, outbond, inbonds) + ## + ## + ## TFs have two ports; the input and output ports must be different + N = mtt_check_sigs (outsig,insigs); + + if N!=2 + error("A TF must have exactly two ports"); + else + if insigs(1,3)==outsig(3) # First signal is on output port + inport = 2; + else + inport = 1; + endif + endif + + insig = insigs(inport,:); + inname = innames(inport,:); + eqn = equation("""TF""",Name,cr,arg,outsig(1),outsig(2),outsig(3), ... + insig(:,1),insig(:,2),inport); + + insigs = insig; # Set the correct input signals + innames = inname; # Set the correct input names + +endfunction ADDED mtt/lib/comp/simple/check_bonds.m Index: mtt/lib/comp/simple/check_bonds.m ================================================================== --- mtt/lib/comp/simple/check_bonds.m +++ mtt/lib/comp/simple/check_bonds.m @@ -0,0 +1,28 @@ +function ok = check_bonds(bonds,n,component); +% check_bonds - check to see correct number (n) of bonds. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function check_bonds +% err = check_bonds(bonds,n); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. +% Check that there are exactly two bonds. +[n_bonds,cols] = size(bonds); +if n_bonds~=n + mtt_info(sprintf('MTT error: %s must have %1.0f (not %1.0f) bonds', ... + component, n, n_bonds)); + ok=0; +else + ok=1; +end ADDED mtt/lib/comp/simple/cicause.m Index: mtt/lib/comp/simple/cicause.m ================================================================== --- mtt/lib/comp/simple/cicause.m +++ mtt/lib/comp/simple/cicause.m @@ -0,0 +1,46 @@ +function [bonds,status] = cicause(bonds,default); +% cicause - Sets causality for C & I components +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function cicause +% [bonds,status] = cicause(bonds,default) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + + + +if (norm(bonds)>1) + if (bonds(1)==-bonds(2)) % Over causal + status = 1; + else % Causal + status = 0; + end; +elseif norm(bonds)==0 % Acausal + % bonds = default*[1 1]; %Set integral causality + % status = 0; + status = -1; +else % Set causality + % Effort + if bonds(1)==0 + status = 0; + bonds(1) = bonds(2); + end; + + % Flow + if bonds(2)==0 + status = 0; + bonds(2) = bonds(1); + end; + +end; ADDED mtt/lib/comp/simple/cieqn.m Index: mtt/lib/comp/simple/cieqn.m ================================================================== --- mtt/lib/comp/simple/cieqn.m +++ mtt/lib/comp/simple/cieqn.m @@ -0,0 +1,110 @@ +function structure = cieqn(name, bond_number,bonds,direction,cr,args, ... + structure,CorI,eqnfile); +% cieqn - Equation function for a (multi-port) unicausal C or I component +% CorI = 1 for C, -1 for I; 0 for ISW + +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function cieqn + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/06/29 13:05:08 peterg +% %% Changed cieqn so that sign ignored. +% %% +% %% Revision 1.2 1997/12/04 13:48:00 peterg +% %% Added sign info to take account of direction of bonds. +% %% +% %% Revision 1.1 1997/04/09 10:18:26 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +if nargin<8 + eqnfile = 'stdout'; +end; + +if (CorI==1) + comp_type = "C"; +else + comp_type = "I"; +endif + +CorIorISW = CorI; +if CorIorISW==0 % ISW + CorI = -1; +end; + + +% Find the number of ports +[ports,junk] = size(bonds); + +% Right-hand side causality +RHS_cause = (bonds(:,1)==CorI*ones(ports,1))*CorI +state_cause = zeros(ports,1); % State causality + +for outport = 1:ports + +# % Sort out direction +# if direction(outport,1) == 1 +# sign = '+'; +# else +# sign = '-'; +# end; + + sign = '+'; + LHS_number = bond_number(outport); + if bonds(outport,1) == -CorI % Integral causality on this port + state = structure(1)+1; + LHS_cause = CorI; + + % Print equation of form x_i = MTTx(i) + fprintf(eqnfile, '%s := MTTx(%1.0f,1);\n', ... + varname(name,LHS_number, state_cause), state); + + % Print equation of form xdot = input - with sign + fprintf(eqnfile, 'MTTdX(%1.0f,1) := %s%s;\n', state, sign, ... + varname(name,LHS_number,-LHS_cause)); + % Print equation of form output = CR (state) + eqn = equation(comp_type,name,cr,args,LHS_number,LHS_cause,outport, ... + bond_number,state_cause,1:ports); + fprintf(eqnfile, '%s',eqn); + structure(1) = state; + else % Derivative causality + nonstate = structure(2)+1; + LHS_cause = -CorI; + + % Print equation of form zdot = MTTdz(i) -- with sign + fprintf(eqnfile, '%s := %sMTTdz(%1.0f,1);\n', ... + varname(name,LHS_number,LHS_cause), sign, ... + nonstate); + % Print equation of form MTTz(i) = z_i + fprintf(eqnfile, 'MTTz(%1.0f,1) := %s;\n', nonstate, ... + varname(name,LHS_number, state_cause)); + + % Print equation of form z_i = CR(input) + eqn = equation(comp_type,name,cr,args,LHS_number,state_cause, outport, ... + bond_number,RHS_cause,1:ports); + fprintf(eqnfile, '%s',eqn); + structure(2) = nonstate; + end; +end; + + + + + + + + + ADDED mtt/lib/comp/simple/comp_ports.m Index: mtt/lib/comp/simple/comp_ports.m ================================================================== --- mtt/lib/comp/simple/comp_ports.m +++ mtt/lib/comp/simple/comp_ports.m @@ -0,0 +1,81 @@ +function ports = comp_ports(comp_type,N) +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function comp_ports +% ports = comp_ports(comp_type) +% Returns the port list for simple components + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.8 1998/06/29 12:16:05 peterg +% %% Whoops - FP bonds are p and f (in that order) +% %% +% %% Revision 1.7 1998/06/29 12:13:36 peterg +% %% Changed FP ports to f and p +% %% +% %% Revision 1.6 1998/06/29 09:55:17 peterg +% %% Changed name to FP from ES +% %% +% %% Revision 1.5 1998/04/12 15:01:53 peterg +% %% Converted to uniform port notation - always use [] +% %% +% %% Revision 1.4 1998/03/31 08:39:31 peterg +% %% Added EBTF +% %% +% %% Revision 1.3 1997/11/21 11:32:57 peterg +% %% N ports numbered 1..N +% %% +% %% Revision 1.2 1997/08/28 08:08:24 peterg +% %% Added RS component to the two-port list +% %% +% %% Revision 1.1 1997/08/02 19:35:47 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +junctions = '-zero-one-'; +one_ports = '-SS-'; +two_ports = '-TF-GY-AE-AF-FMR-RS-EBTF-'; +N_ports = '-R-C-I-'; +comp_type = ['-', comp_type, '-']; + +#if length(findstr(comp_type,junctions))==1 +# ports = ['[undefined]']; +#elseif length(findstr(comp_type,one_ports))==1 +# ports = ['[in]']; +#elseif length(findstr(comp_type,two_ports))==1 +# ports = ['[in]';'[out]']; +#elseif length(findstr(comp_type,'[-EMTF-]'))==1 +# ports = ['[in]';'[out]';'[mod]']; +#elseif length(findstr(comp_type,'[-FP-]'))==1 +# ports = ['[p]';'[f]']; +#elseif length(findstr(comp_type,'[-PS-]'))==1 +# ports = ['[in]';'[out]';'[power]']; +#elseif length(findstr(comp_type,N_ports))==1 +# if N==1 +# ports = ['[in]']; +# elseif N==2 +# ports = ['[in]';'[out]']; +# elseif N>2 +# ports = '[1]'; +# for i=2:N +# ports = [ports; sprintf("[%i]",i)]; +# end; +# end; +#end; + +# All the above is now done in the alias files + ports = '[1]'; + for i=2:N + ports = [ports; sprintf("[%i]",i)]; + end; + +endfunction ADDED mtt/lib/comp/simple/juncause.m Index: mtt/lib/comp/simple/juncause.m ================================================================== --- mtt/lib/comp/simple/juncause.m +++ mtt/lib/comp/simple/juncause.m @@ -0,0 +1,40 @@ +function [bonds,status] = juncause(bonds,jun,cause) +% [bonds,status] = juncause(bonds,jun,cause) + +% Causality for either effort or flow on either zero or one junctions + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/08/09 08:29:04 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +j = (3-cause)/2; % j is 1 for effort, 2 for flow + +[n_bonds,junk] = size(bonds); +[causing_bond, n,other_bonds,m] = getindex(bonds(:,j),jun); +if n>1 % over causal + status = 1; +elseif n==1 %causal + status = 0; + bonds(other_bonds(:,1),j) = -jun*ones(m,1); +elseif n==0 % undercausal - try other way + [causing_bond, n,other_bonds,m] = getindex(bonds(:,j),-jun); + if n==n_bonds % over causal + status = 1; + elseif n==n_bonds-1 %causal + status = 0; + bonds(other_bonds(:,1),j) = jun*ones(m,1); + else % undercausal + status = -1; + end; +end; + + + + ADDED mtt/lib/comp/simple/junction_seqn.m Index: mtt/lib/comp/simple/junction_seqn.m ================================================================== --- mtt/lib/comp/simple/junction_seqn.m +++ mtt/lib/comp/simple/junction_seqn.m @@ -0,0 +1,58 @@ +function [eqn,insigs,innames] = junction_seqn (jun_type,Name, outsig, ... + insigs, innames) + ## usage: [eqn,insigs] = junction_seqn (jun_type,Name, outport, outsig, ... + ## insigs) + ## + ## + ## Junctions + + ## Sanity check + N = mtt_check_sigs (outsig,insigs); + + outport = outsig(3); + + ## Setup up causality corresponding to junction + if jun_type=="0" + i_jun_type = 1; + elseif jun_type=="1" + i_jun_type = -1; + else + error("Junction type %s unknown", jun_type) + endif + + ## Is output same causality as junction? + same_type = outsig(2)==i_jun_type; + + + ## LHS + eqn = sprintf("%s :=", varname(Name, abs(outsig(1)), outsig(2))); + + ## Find the input bond of the same causality as junction + one = ones(N,1); + inport = find(insigs(:,2)==i_jun_type*one); + + ##RHS + if same_type + insig = insigs(inport,:); + inname = innames(inport,:); + eqn = sprintf("%s\n\t%s", eqn, varname(Name, abs(insigs(inport,1)),i_jun_type)); + else + insig=[]; + inname=""; + inports = []; + out_dir = sign(insigs(inport,1)); + for i=1:N + if i!=inport + in_dir = sign(insigs(i,1)); + plusminus = sign2name(-in_dir*out_dir); + eqn = sprintf("%s\n\t%s%s", eqn, plusminus, varname(Name, ... + abs(insigs(i,1)), -i_jun_type)); + insig = [insig; insigs(i,:)]; + inname = [inname; innames(i,:)]; + endif + endfor + endif + eqn = sprintf("%s;", eqn); + insigs = insig; + innames = inname; +endfunction ADDED mtt/lib/comp/simple/juneqn.m Index: mtt/lib/comp/simple/juneqn.m ================================================================== --- mtt/lib/comp/simple/juneqn.m +++ mtt/lib/comp/simple/juneqn.m @@ -0,0 +1,52 @@ +function juneqn(name,bond_number,bonds,direction,cr,args,jun,filenumber) +% juneqn - Equations for both effort and flow on either +% zero or one junctions +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function juneqn +% juneqn(name,bond_number,bonds,direction,cr,args,jun,filenumber) + +% Copyright (c) P.J. Gawthrop, 1996. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1996/12/05 10:02:45 peterg +% %% Explicit generation of strong-causality equations -- oneequation not +% %% used now. +% %% +% %% Revision 1.2 1996/08/08 18:09:10 peter +% %% Changed to finenumber format. +% %% +% %% Revision 1.1 1996/08/08 16:38:50 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Same causality as junction +column = (3-jun)/2; +[causing_bond,n,other_bonds,m] = getindex(bonds(:,column),jun) +for i=other_bonds' + fprintf(filenumber, '%s \t:=\t%s;\n', ... + varname(name, bond_number(i),jun), ... + varname(name, bond_number(causing_bond),jun) ... + ); +end; + + +% Opposite causality to junction +column = (3+jun)/2; +[caused_bond,n,other_bonds,m] = getindex(bonds(:,column),jun) +fprintf(filenumber, '%s\t:= \n', varname(name, bond_number(caused_bond),-jun)); +for i=other_bonds' + term_sign = -direction(caused_bond,column)*direction(i,column) + fprintf(filenumber, '\t\t%s %s\n', sign2name(term_sign), ... + varname(name, bond_number(i),-jun)); +end; +fprintf(filenumber, ';\n'); ADDED mtt/lib/comp/simple/one_cause.m Index: mtt/lib/comp/simple/one_cause.m ================================================================== --- mtt/lib/comp/simple/one_cause.m +++ mtt/lib/comp/simple/one_cause.m @@ -0,0 +1,34 @@ +function [bonds,status] = one_cause(bonds); +% one_cause - causality for a one junction +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function one_cause + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Copyright (c) P.J. Gawthrop, 1996. + +%Effort +[bonds,e_status] = juncause(bonds,-1,1); + +%Flow +[bonds,f_status] = juncause(bonds,-1,-1); + +if (e_status==1)|(f_status==1) % Over causal + status = 1; +elseif (e_status==-1)|(f_status==-1) % Under causal + status = -1; +else % causal + status = 0; +end; + ADDED mtt/lib/comp/simple/one_eqn.m Index: mtt/lib/comp/simple/one_eqn.m ================================================================== --- mtt/lib/comp/simple/one_eqn.m +++ mtt/lib/comp/simple/one_eqn.m @@ -0,0 +1,33 @@ +function structure = one_eqn(name,bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% one_eqn - equations for a one junction +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function one_eqn +% one_eqn(name,bond_number,bonds,direction,cr,args, ... +% structure,eqnfile); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/12/05 10:00:49 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +disp("one-eqn") +name,bond_number,bonds,direction,cr,args +if nargin<7 + eqnfile = 'stdout'; +end; + +juneqn(name,bond_number,bonds,direction,cr,args,-1,eqnfile) + + + + ADDED mtt/lib/comp/simple/oneeqn.m Index: mtt/lib/comp/simple/oneeqn.m ================================================================== --- mtt/lib/comp/simple/oneeqn.m +++ mtt/lib/comp/simple/oneeqn.m @@ -0,0 +1,28 @@ +function oneeqn(name,LHS_number,LHS_cause,RHS_number,RHS_cause,cr,args, ... + eqnfile); +% oneeqn - prints a single equation +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function oneeqn +% oneeqn(name,LHS_number,LHS_cause,RHS_number,RHS_cause,cr,args,eqnfile) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +if nargin<7 + eqnfile = 'stdout'; +end; + + +fprintf(eqnfile, '%s := %s;\n', ... + varname(name, LHS_number,LHS_cause), ... + cr2name(name,RHS_number,LHS_cause,RHS_cause,cr,args)); ADDED mtt/lib/comp/simple/zero_cause.m Index: mtt/lib/comp/simple/zero_cause.m ================================================================== --- mtt/lib/comp/simple/zero_cause.m +++ mtt/lib/comp/simple/zero_cause.m @@ -0,0 +1,32 @@ +function [bonds,status] = zero_cause(bonds); +% zero_cause - causality for zero junctions +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function zero_cause +% [bonds,status] = zero_cause(bonds); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%Effort +[bonds,e_status] = juncause(bonds,1,1); + +%Flow +[bonds,f_status] = juncause(bonds,1,-1); + +status = 0; +if (e_status==1)|(f_status==1) % Over causal + status = 1; +endif; +if (e_status==-1)|(f_status==-1) % Under causal + status = -1; +endif; + + ADDED mtt/lib/comp/simple/zero_eqn.m Index: mtt/lib/comp/simple/zero_eqn.m ================================================================== --- mtt/lib/comp/simple/zero_eqn.m +++ mtt/lib/comp/simple/zero_eqn.m @@ -0,0 +1,29 @@ +function structure = zero_eqn(name, bond_number,bonds,direction,cr,args, ... + structure,eqnfile); +% zero_eqn - equations for zero junctions +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function zero_eqn +% zero_eqn(name, bond_number,bonds,direction,cr,args, structure,eqnfile); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +if nargin<7 + eqnfile = 'stdout'; +end; + + +juneqn(name, bond_number,bonds,direction,cr,args,1,eqnfile) + + + + ADDED mtt/lib/control/PPP/Beam_numpar.m Index: mtt/lib/control/PPP/Beam_numpar.m ================================================================== --- mtt/lib/control/PPP/Beam_numpar.m +++ mtt/lib/control/PPP/Beam_numpar.m @@ -0,0 +1,45 @@ +% Script file Beam_numpar.m +%% numpar file (Beam_numpar.m) +%% Generated by MTT at Thu Apr 22 07:00:08 BST 1999 +% Global variable list +global ... + area ... + areamoment ... + beamlength ... + beamthickness ... + beamwidth ... + density ... + ei ... + n ... + youngs ... + dk ... + dm ... + dz ... + rhoa ; + % -*-octave-*- Put Emacs into octave-mode + % Numerical parameter file (Beam_numpar.txt) + % Generated by MTT at Mon Apr 19 06:24:08 BST 1999 + + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % %% Version control history + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % %% $Id$ + % %% $Log$ + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % Parameters +n = 7; +beamlength = 0.58; +beamwidth = 0.05; +beamthickness = 0.005; +youngs = 1e6; +density = 1e5; +area = beamwidth*beamthickness; +areamoment = (beamthickness*beamwidth^2)/12; + +ei= 58.6957 ; % from Reza +rhoa= 0.7989 ; % from Reza + +dz = beamlength/n; % BernoulliEuler +dm = rhoa*dz; % BernoulliEuler +dk = ei/dz; % BernoulliEuler ADDED mtt/lib/control/PPP/Beam_sm.m Index: mtt/lib/control/PPP/Beam_sm.m ================================================================== --- mtt/lib/control/PPP/Beam_sm.m +++ mtt/lib/control/PPP/Beam_sm.m @@ -0,0 +1,69 @@ +% -*-octave-*- Put Emacs into octave-mode% +function [mtta,mttb,mttc,mttd] = Beam_sm(); +% [mtta,mttb,mttc,mttd] = Beam_sm(); +%System Beam, representation sm, language m; +%File Beam_sm.m; +%Generated by MTT on Thu Apr 22 07:02:48 BST 1999; +% +%====== Set up the global variables ======% +global ... +area ... +areamoment ... +beamlength ... +beamthickness ... +beamwidth ... +density ... +ei ... +n ... +youngs ... +dk ... +dm ... +dz ... +rhoa ; +%a matrix% +mtta = zeros(14,14); +mtta(1,2) = -dk/dz; +mtta(2,1) = 1.0/(dm*dz); +mtta(2,3) = -2.0/(dm*dz); +mtta(2,5) = 1.0/(dm*dz); +mtta(3,2) = (2.0*dk)/dz; +mtta(3,4) = -dk/dz; +mtta(4,3) = 1.0/(dm*dz); +mtta(4,5) = -2.0/(dm*dz); +mtta(4,7) = 1.0/(dm*dz); +mtta(5,2) = -dk/dz; +mtta(5,4) = (2.0*dk)/dz; +mtta(5,6) = -dk/dz; +mtta(6,5) = 1.0/(dm*dz); +mtta(6,7) = -2.0/(dm*dz); +mtta(6,9) = 1.0/(dm*dz); +mtta(7,4) = -dk/dz; +mtta(7,6) = (2.0*dk)/dz; +mtta(7,8) = -dk/dz; +mtta(8,7) = 1.0/(dm*dz); +mtta(8,9) = -2.0/(dm*dz); +mtta(8,11) = 1.0/(dm*dz); +mtta(9,6) = -dk/dz; +mtta(9,8) = (2.0*dk)/dz; +mtta(9,10) = -dk/dz; +mtta(10,9) = 1.0/(dm*dz); +mtta(10,11) = -2.0/(dm*dz); +mtta(10,13) = 1.0/(dm*dz); +mtta(11,8) = -dk/dz; +mtta(11,10) = (2.0*dk)/dz; +mtta(11,12) = -dk/dz; +mtta(12,11) = 1.0/(dm*dz); +mtta(12,13) = -2.0/(dm*dz); +mtta(13,10) = -dk/dz; +mtta(13,12) = (2.0*dk)/dz; +mtta(13,14) = -dk/dz; +mtta(14,13) = 1.0/(dm*dz); +%b matrix% +mttb = zeros(14,1); +mttb(11) = 1.0/dz; +mttb(13) = -2.0/dz; +%c matrix% +mttc = zeros(1,14); +mttc(1,1) = 1.0/dm; +%d matrix% +mttd = zeros(1,1); ADDED mtt/lib/control/PPP/NMPsystem.m Index: mtt/lib/control/PPP/NMPsystem.m ================================================================== --- mtt/lib/control/PPP/NMPsystem.m +++ mtt/lib/control/PPP/NMPsystem.m @@ -0,0 +1,21 @@ +function [A,B,C,D] = NMPsystem () + + ## usage: [A,B,C,D] = NMPsystem () + ## + ## NMP system example (2-s)/(s-1)^3 + + A = [3 -3 1 + 1 0 0 + 0 1 0]; + + B = [1 + 0 + 0]; + + C = [0 -0.5 1]; + + D = 0; + + + +endfunction ADDED mtt/lib/control/PPP/TwoMassSpring.m Index: mtt/lib/control/PPP/TwoMassSpring.m ================================================================== --- mtt/lib/control/PPP/TwoMassSpring.m +++ mtt/lib/control/PPP/TwoMassSpring.m @@ -0,0 +1,34 @@ +function [A,B,C,D] = TwoMassSpring (k,m_1,m_2) + + ## usage: [A,B,C,D] = TwoMassSpring (k,m_1,m_2) + ## + ## Two mass-spring example from Middleton et al. EE9908 + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 1999/05/18 22:31:26 peterg + ## Fixed error in dim of D + ## + ## Revision 1.1 1999/05/18 22:28:56 peterg + ## Initial revision + ## + ############################################################### + + + A = [0 1 0 0 + -k/m_1 0 k/m_1 0 + 0 0 0 1 + k/m_2 0 -k/m_2 0]; + B = [0 + 1/m_1 + 0 + 0]; + C = [1 0 0 0 + 0 0 1 0]; + + D = zeros(2,1); + +endfunction ADDED mtt/lib/control/PPP/airc.m Index: mtt/lib/control/PPP/airc.m ================================================================== --- mtt/lib/control/PPP/airc.m +++ mtt/lib/control/PPP/airc.m @@ -0,0 +1,27 @@ +function [A,B,C,D] = airc +% System AIRC +% This system is the aircraft example from the book: +% J.M Maciejowski: Multivariable Feedback Design Addison-Wesley, 1989 +% It has 5 states, 3 inputs and 3 outputs. + +% P J Gawthrop Jan 1998 + +A = [ 0 0 1.1320 0 -1.0000 + 0 -0.0538 -0.1712 0 0.0705 + 0 0 0 1.0000 0 + 0 0.0485 0 -0.8556 -1.0130 + 0 -0.2909 0 1.0532 -0.6859]; + +B = [ 0 0 0 + -0.1200 1.0000 0 + 0 0 0 + 4.4190 0 -1.6650 + 1.5750 0 -0.0732]; + +C = [1 0 0 0 0 + 0 1 0 0 0 + 0 0 1 0 0]; + +D = zeros(3,3); + + ADDED mtt/lib/control/PPP/autm.m Index: mtt/lib/control/PPP/autm.m ================================================================== --- mtt/lib/control/PPP/autm.m +++ mtt/lib/control/PPP/autm.m @@ -0,0 +1,40 @@ +function [A,B,C,D]=autm +% System AUTM +% This system is the automotive gas turbine example from the book: +% Y.S. Hung and A.G.J. Macfarlane: "Multivariable Feedback. A +% quasi-classical approach." Springer 1982 +% It has 12 states, 2 inputs and 2 outputs. + +% P J Gawthrop Jan 1998 + +%A-matrix +A = zeros(12,12); +A(1,2) = 1; +A(2,1) = -0.202; A(2,2) = -1.150; +A(3,4) = 1; +A(4,5) = 1; +A(5,3) = -2.360; A(5,4) = -13.60; A(5,5) = -12.80; +A(6,7) = 1; +A(7,8) = 1; +A(8,6) = -1.620; A(8,7) = -9.400; A(8,8) = -9.150; +A(9,10) = 1; +A(10,11) = 1; +A(11,12) = 1; +A(12,9) = -188.0; A(12,10) = -111.6; A(12,11) = -116.4; A(12,12) = -20.8; + +%B-matrix +B = zeros(12,2); +B(2,1) = 1.0439; B(2,2) = 4.1486; +B(5,1) = -1.794; B(5,2) = 2.6775; +B(8,1) = 1.0439; B(8,2) = 4.1486; +B(12,1) = -1.794; B(12,2) = 2.6775; + +%C-matrix +C = zeros(2,12); +C(1,1) = 0.2640; C(1,2) = 0.8060; C(1,3) = -1.420; C(2,4) = -15.00; +C(2,6) = 4.9000; C(2,7) = 2.1200; C(2,8) = 1.9500; C(2,9) = 9.3500; +C(2,10) = 25.800; C(2,11) = 7.1400; + +%D-matrix +D = zeros(2,2); + ADDED mtt/lib/control/PPP/butterworth_matrix.m Index: mtt/lib/control/PPP/butterworth_matrix.m ================================================================== --- mtt/lib/control/PPP/butterworth_matrix.m +++ mtt/lib/control/PPP/butterworth_matrix.m @@ -0,0 +1,16 @@ +function A = butterworth_matrix (n,p) + + ## usage: A = butterworth (n,p) + ## + ## A-matrix for generating nth order Butterworth functions with parameter p + + ## Copyright (C) 2000 by Peter J. Gawthrop + + ## Butterworth poly + pol = ppp_butter(n,p); + + ## Create A matrix (controller form) + A = [-pol(2:n+1) + eye(n-1) zeros(n-1,1)]; + +endfunction ADDED mtt/lib/control/PPP/damped_matrix.m Index: mtt/lib/control/PPP/damped_matrix.m ================================================================== --- mtt/lib/control/PPP/damped_matrix.m +++ mtt/lib/control/PPP/damped_matrix.m @@ -0,0 +1,26 @@ +function A = damped_matrix (frequency,damping) + + ## usage: A = damped_matrix (frequency,damping) + ## + ## Gives an A matrix with eigenvalues with specified + ## frequencies and damping ratio + + N = length(frequency); + + if nargin<2 + damping = zeros(size(frequency)); + endif + + if length(damping) != N + error("Frequency and damping vectors have different lengths"); + endif + + A = zeros(2*N,2*N); + for i=1:N + j = 2*(i-1)+1; + A_i = [-2*damping(i)*frequency(i) -frequency(i)^2 + 1 0]; + A(j:j+1,j:j+1) = A_i; + endfor + +endfunction ADDED mtt/lib/control/PPP/laguerre_matrix.m Index: mtt/lib/control/PPP/laguerre_matrix.m ================================================================== --- mtt/lib/control/PPP/laguerre_matrix.m +++ mtt/lib/control/PPP/laguerre_matrix.m @@ -0,0 +1,18 @@ +function A = laguerre_matrix (n,p) + + ## usage: A = laguerre_matrix (n,p) + ## + ## A-matrix for generating nth order Laguerre functions with parameter p + + ## Copyright (C) 1999 by Peter J. Gawthrop + + if n<1 # Creatre empty matrix + A = []; + else # Create A matrix + A = diag(-p*ones(n,1)); + for i=1:n-1 + A = A + diag(-2*p*ones(n-i,1),-i); + endfor + endif + +endfunction ADDED mtt/lib/control/PPP/ppp_RT.m Index: mtt/lib/control/PPP/ppp_RT.m ================================================================== --- mtt/lib/control/PPP/ppp_RT.m +++ mtt/lib/control/PPP/ppp_RT.m @@ -0,0 +1,7 @@ +function [y,u] = ppp_RT (U) + + ## usage: [y,u] = ppp_RT (U) + ## + ## + +endfunction ADDED mtt/lib/control/PPP/ppp_RT_sim.m Index: mtt/lib/control/PPP/ppp_RT_sim.m ================================================================== --- mtt/lib/control/PPP/ppp_RT_sim.m +++ mtt/lib/control/PPP/ppp_RT_sim.m @@ -0,0 +1,19 @@ +function [y,u] = ppp_RT_sim (U) + + ## usage: [y,u] = ppp_RT_sim (U) + ## + ## U PPP weight (column vector) + + global system_name_sim i_ppp_sim x_0_sim y_sim u_sim A_u_sim + + + ## Data from previous time - last point not used + if length(y_sim)>0 # Avoid initial junk + [n_t_old,junk] = size(y_sim); + y = y_sim(1:n_t_old-1,:); u = u_sim(1:n_t_old-1,:); + else + y=[]; u=[]; + endif + +endfunction + ADDED mtt/lib/control/PPP/ppp_RT_sim_compute.m Index: mtt/lib/control/PPP/ppp_RT_sim_compute.m ================================================================== --- mtt/lib/control/PPP/ppp_RT_sim_compute.m +++ mtt/lib/control/PPP/ppp_RT_sim_compute.m @@ -0,0 +1,26 @@ +function ppp_RT_sim_compute (U) + + ## usage: [y,u] = ppp_RT_sim_compute (U) + ## + ## U PPP weight (column vector) + + global system_name_sim i_ppp_sim x_0_sim y_sim u_sim A_u_sim simpar_sim + + ## System details -- defines simulation within ol interval + par = eval(sprintf("%s_numpar;", system_name_sim)); + t = [0:simpar_sim.dt:simpar_sim.last]; + n_t = length(t); + [n_x,n_y,n_u] = eval(sprintf("%s_def", system_name_sim)); + [n_U,junk] = size(A_u_sim); + + ## Set up u_star + u_star = ppp_ustar(A_u_sim,1,t,0,0,n_u-n_U); + + ## Simulate + par(i_ppp_sim(:,3)) = U; # Update the simulation ppp weights + [y_sim,x] = eval(sprintf("%s_sim(x_0_sim, par, simpar_sim, u_star);", \ + system_name_sim)); + x_0_sim = x(n_t,:)'; # Extract state for next time + u_sim = u_star(:,1:n_U)*U; +endfunction + ADDED mtt/lib/control/PPP/ppp_are.m Index: mtt/lib/control/PPP/ppp_are.m ================================================================== --- mtt/lib/control/PPP/ppp_are.m +++ mtt/lib/control/PPP/ppp_are.m @@ -0,0 +1,49 @@ +function [P,A_u,A_w,k] = ppp_are (A,B,C,D,Q,R,A_type) + + ## usage: [P,A_u,A_w] = ppp_are (A,B,C,D,Q,R,A_type) + ## + ## + + if nargin<1 + disp("usage: [P,A_u,A_w] = ppp_are (A,B,C,D,Q,R,A_type)"); + return + endif + + if nargin<7 + A_type = "feedback"; + endif + + [n_x,n_u,n_y] = abcddim(A,B,C,D); # Dimensions + n_q = is_square(Q); # Size of Q + if n_q==0 + error("Q must be square"); + endif + + ## Steady-state Linear Quadratic solution + ## using Algebraic Riccati equation (ARE) + if n_q==n_y # Output weight + Q_x = C'*Q*C; # Weighting on x + elseif n_q==n_x # State weight + Q_x = Q; + else + error(sprintf("Q (%ix%i) must be %ix%i or %ix%i",n_q,n_q,n_y,n_y,n_x,n_x)); + endif + + [k, P, poles] = lqr (A, B, Q_x, R); # Algebraic Riccati solution + + ## Basis functions + if strcmp(A_type,"companion") + A_u = compan(poly(poles)); + elseif strcmp(A_type,"feedback") + A_u = A-B*k; + else + error(sprintf("A_type must be %s, not %s", "companion or feedback", A_type)); + endif + + ## Avoid spurious imag parts due to rounding + A_u = real(A_u); + + ## Setpoint basis functions + A_w = 0; + +endfunction ADDED mtt/lib/control/PPP/ppp_aug.m Index: mtt/lib/control/PPP/ppp_aug.m ================================================================== --- mtt/lib/control/PPP/ppp_aug.m +++ mtt/lib/control/PPP/ppp_aug.m @@ -0,0 +1,26 @@ +function [A,v] = ppp_aug (A_1,A_2) + + ## usage: [A,v] = ppp_aug (A_1,A_2) + ## + ## Augments square matrix A_1 with square matrix A_2 to create A=[A_1 0; A_2 0]; + ## and generates v, a compatible column vector with unit elements + + ## Copyright (C) 1999 by Peter J. Gawthrop + + + [n_1,m_1] = size(A_1); + if n_1 != m_1 + error("A_1 must be square"); + endif + + [n_2,m_2] = size(A_2); + if n_2 != m_2 + error("A_2 must be square"); + endif + + A = [A_1 zeros(n_1,n_2) + zeros(n_2,n_1) A_2]; + + v = ones(n_1+n_2,1); + +endfunction ADDED mtt/lib/control/PPP/ppp_butter.m Index: mtt/lib/control/PPP/ppp_butter.m ================================================================== --- mtt/lib/control/PPP/ppp_butter.m +++ mtt/lib/control/PPP/ppp_butter.m @@ -0,0 +1,23 @@ +function pol = ppp_butter (order,radius) + + ## usage: pol = cgpc_butter (order,radius) + ## + ## Butterworth polynomial of given order and pole radius + ## Copyright (C) 1999 by P.J. Gawthrop + + ## $Id$ + + theta = pi/(2*order); # Angle with real axis + + even = (floor(order/2)==order/2); + if even + pol=1; N=order/2; + else + pol=[1 radius]; N=(order-1)/2; + endif + + for i=1:N + pol=conv(pol, [1 2*radius*cos(i*theta) radius^2]); + endfor + +endfunction ADDED mtt/lib/control/PPP/ppp_closedloop.m Index: mtt/lib/control/PPP/ppp_closedloop.m ================================================================== --- mtt/lib/control/PPP/ppp_closedloop.m +++ mtt/lib/control/PPP/ppp_closedloop.m @@ -0,0 +1,37 @@ +function [Ac,Bc,Cc,Dc] = ppp_closedloop (A,B,C,D,k_x,k_w,l_x,l_y) + + ## usage: [Ac,Bc,Cc,Dc] = ppp_closedloop (A,B,C,K_x,K_w,K_y,L) + ## + ## + + + ## Closed loop input is [w;v]. + ## Closed loop output is [y;u]. + ## w is reference signal + ## v is input disturbance + ## Inputs: + ## A,B,C,D MIMO linear system matrices + ## k_x,k_w,k_y Gain matrices: u = k_w*w - k_x*x + ## L Observer gain matrix + ## Outputs + ## Ac,Bc,Cc,Dc Closed-loop charecteristic polynomial + + ## Copyright (C) 1999 by Peter J. Gawthrop + + ## System dimensions + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + ## Create matrices describing closed-loop system + Ac = [ A, -B*k_x + l_x*C, (A - l_x*C - B*k_x)]; + + Bc = [B*k_w B + B*k_w zeros(n_x,n_u)]; + + Cc = [C zeros(n_y,n_x) + zeros(n_u,n_x) -k_x ]; + + Dc = [zeros(n_y,n_y) zeros(n_y,n_u) + k_w zeros(n_u,n_u)]; + +endfunction ADDED mtt/lib/control/PPP/ppp_cost.m Index: mtt/lib/control/PPP/ppp_cost.m ================================================================== --- mtt/lib/control/PPP/ppp_cost.m +++ mtt/lib/control/PPP/ppp_cost.m @@ -0,0 +1,14 @@ +function [J J_U] = ppp_cost (U,x,W,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww) + + ## usage: [J J_U] = ppp_cost (U,x,W,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww) + ## Computes the PPP cost function given U,x and W + ## + ## J_uu,J_ux,J_uw,J_xx,J_xw,J_ww cost derivatives from ppp_lin + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + J = U'*J_uu*U/2 + U'*(J_ux*x - J_uw*W) - x'*J_xw*W + x'*J_xx*x/2 + W'*J_ww*W'/2; + J_U = J_uu*U + (J_ux*x - J_uw*W) ; + +endfunction ADDED mtt/lib/control/PPP/ppp_error.m Index: mtt/lib/control/PPP/ppp_error.m ================================================================== --- mtt/lib/control/PPP/ppp_error.m +++ mtt/lib/control/PPP/ppp_error.m @@ -0,0 +1,18 @@ +function err = ppp_error(par) + + ## usage: err = error (par) + ## + ## + + global ppp_y_0 ppp_sim_command ppp_par ppp_i_par ppp_x0 ppp_sim ppp_u + + pars = ppp_par; + pars(ppp_i_par) = par; + + y = sidSimpleExtruder_ssim(ppp_x0,pars,ppp_sim,ppp_u); + + [N,n_y] = size(y); + + Err = y - ppp_y_0; + err = sum(diag(Err'*Err))/N +endfunction ADDED mtt/lib/control/PPP/ppp_ex1.m Index: mtt/lib/control/PPP/ppp_ex1.m ================================================================== --- mtt/lib/control/PPP/ppp_ex1.m +++ mtt/lib/control/PPP/ppp_ex1.m @@ -0,0 +1,62 @@ +function name = ppp_ex1 (ReturnName) + + ## usage: ppp_ex1 () + ## + ## PPP example - an unstable, nmp siso system + ## $Id$ + + + ## Example name + name = "Linear unstable non-minimum phase third order system- Laguerre inputs"; + + if nargin>0 + return + endif + + + ## System - unstable & NMP + [A,B,C,D] = NMPsystem; + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + ## Setpoint + A_w = ppp_aug(0,[]); + + ## Controller + + ##Optimisation horizon + t = [4.0:0.05:5]; + + ## A_u + A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); + + ## Design and plot + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t); + + + ## Compute exact version + poles = sort(eig(A_u)); # Desired poles - eigenvalues of A_u + poles = poles(1:n_x); # Loose the last one - due to setpoint + clp = poly(poles); # Closed-loop cp + kk = clp(2:n_x+1)+A(1,:); # Corresponding gain + A_c = A-B*kk; # Closed-loop A + K_X = ppp_open2closed (A_u,[A_c B*k_w; [0 0 0 0]],[kk -k_w]); # Exact + + ## Compute K_x using approx values + A_c_a = A-B*k_x; + K_X_comp = ppp_open2closed (A_u,[A_c_a B*k_w; [0 0 0 0]],[k_x -k_w]); # Computed Kx + + format bank + log_cond_uu = log10(cond_uu) + Exact_closed_loop_poles = poles' + Approximate_closed_loop_poles = cl_poles + Exact_k_x = kk + Approximate_k_x = k_x + Exact_K_X = K_X + Approximate_K_X = [K_x -K_w] + Computed_K_x = K_X_comp + K_xw_error = Approximate_K_X-K_X + format +endfunction + + + ADDED mtt/lib/control/PPP/ppp_ex10.m Index: mtt/lib/control/PPP/ppp_ex10.m ================================================================== --- mtt/lib/control/PPP/ppp_ex10.m +++ mtt/lib/control/PPP/ppp_ex10.m @@ -0,0 +1,34 @@ +function name = ppp_ex10 (ReturnName) + + ## usage: name = ppp_ex10 (ReturnName) + ## + ## PPP example - shows a standard multivariable system + ## + + ## Example name + name = "Remotely-piloted vehicle example: system RPV from J.M Maciejowski: Multivariable Feedback Design"; + + if nargin>0 + return + endif + + ## System + [A,B,C,D] = rpv; + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + ## Controller + t = 1*[0.9:0.01:1]; # Time horizon + A_w = 0; # Setpoint +# TC = 0.1*[1 1]; # Time constants for each input +# A_u = []; +# for tc=TC # Input +# A_u = [A_u;ppp_aug(laguerre_matrix(2,1/tc), 0)]; +# endfor + A_u = ppp_aug(laguerre_matrix(2,5.0), A_w) + Q = [1;1]; # Output weightings + + ## Design and plot + W = [1;2] + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); + +endfunction ADDED mtt/lib/control/PPP/ppp_ex11.m Index: mtt/lib/control/PPP/ppp_ex11.m ================================================================== --- mtt/lib/control/PPP/ppp_ex11.m +++ mtt/lib/control/PPP/ppp_ex11.m @@ -0,0 +1,107 @@ +function [name,T,y,u,ys,us,J] = ppp_ex11 (ReturnName) + + ## usage: [name,T,y,u,ys,us,T1,du,dus] = ppp_ex11 (ReturnName) + ## + ## PPP example + + ## $Id$ + + + ## Example name + name = "Input constraints +-1.5 on u* at tau=0,0.5,1,1.5,2"; + + if nargin>0 + return + endif + + ## System + A = [-3 -3 -1 + 1 0 0 + 0 1 0]; + B = [1 + 0 + 0]; + C = [0 -0.5 1]; + D = 0; + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + ## Controller + t = [6:0.02:7]; # Time horizon + A_w = 0; # Setpoint + A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions + + Q = ones(n_y,1);; + + + ## Constraints + Gamma = []; + gamma = []; + + ## Constraints - u + Tau_u = [0:0.5:2]; + one = ones(size(Tau_u)); + limit = 1.5; + Min_u = -limit*one; + Max_u = limit*one; + Order_u = 0*one; + + ## Constraints - y + Tau_y = []; # No output constraints + one = ones(size(Tau_y)); + limit = 1.5; + Min_y = -limit*one; + Max_y = limit*one; + Order_y = 0*one; + + ## Simulation + W=1; + x_0 = zeros(3,1); + + ## Constrained - open-loop + disp("Designing controller"); + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); # Unconstrained design + [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); + + Gamma = Gamma_u; + gamma = gamma_u; + + ## Constrained OL simulation + disp("Computing constrained ol response"); + [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); + T = [0:t(2)-t(1):t(length(t))]; + [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); + + ## Unconstrained OL simulation + disp("Computing unconstrained ol response"); + [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); + [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); + + title("Constrained and unconstrained y*"); + xlabel("t"); + grid; + figure(1); + plot(T,ys,"-;y*: constrained;", T,ysu, "--;y*: unconstrained;") + + ## Non-linear - closed-loop + disp("Computing constrained closed-loop response"); + [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ + Tau_u,Min_u,Max_u,Order_u, \ + Tau_y,Min_y,Max_y,Order_y,W,x_0); + + title("Constrained closed-loop response"); + xlabel("t"); + grid; + figure(2); + plot(T,y,"-;y;", T,u,"--;u;"); + +# ## Compute derivatives. +# dt = t(2)-t(1); +# du = diff(u)/dt; +# dus = diff(us)/dt; +# T1 = T(1:length(T)-1); + ##plot(T1,du,T1,dus); +endfunction + + + + ADDED mtt/lib/control/PPP/ppp_ex12.m Index: mtt/lib/control/PPP/ppp_ex12.m ================================================================== --- mtt/lib/control/PPP/ppp_ex12.m +++ mtt/lib/control/PPP/ppp_ex12.m @@ -0,0 +1,75 @@ +function [name,T,y,u,ys,us,J,T1,du,dus] = ppp_ex12 (ReturnName) + + ## usage: [name,T,y,u,ys,us,T1,du,dus] = ppp_ex12 (ReturnName) + ## + ## PPP example - shows input derivative constraints + ## $Id$ + + + ## Example name + name = "Input derivative constraints +-1 on u* at tau=0,0.5,1,1.5,2"; + + if nargin>0 + return + endif + + ## System + A = [-3 -3 -1 + 1 0 0 + 0 1 0]; + B = [1 + 0 + 0]; + C = [0 -0.5 1]; + D = 0; + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + ## Controller + t = [4:0.02:5]; # Time horizon + A_w = 0; # Setpoint + A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions + Q = ones(n_y,1);; + + ## Constaints - du*/dtau + Tau = [0:0.5:2]; + one = ones(size(Tau)); + limit = 1; + Min = -limit*one; + Max = limit*one; + Order = one; + [Gamma,gamma] = ppp_input_constraint (A_u,Tau,Min,Max,Order); + + W=1; + x_0 = zeros(3,1); + + ## Constrained - open-loop + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); + [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); + T = [0:t(2)-t(1):t(length(t))]; + [ys,us] = ppp_ystar(A,B,C,D,x_0,A_u,U,T); + + ## Non-linear - closed-loop + [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ + Tau,Min,Max,Order, \ + [],[],[],[], W,x_0); + + title("y,y*,u and u*"); + xlabel("t"); + grid; + plot(T,y,"1;y;", T,u,"2;u;", T,ys,"3;y*;", T,us,"4;u*;"); + + ## Compute derivatives. + dt = t(2)-t(1); + du = diff(u)/dt; + dus = diff(us)/dt; + T1 = T(1:length(T)-1); + ##plot(T1,du,T1,dus); +endfunction + + + + + + + + ADDED mtt/lib/control/PPP/ppp_ex13.m Index: mtt/lib/control/PPP/ppp_ex13.m ================================================================== --- mtt/lib/control/PPP/ppp_ex13.m +++ mtt/lib/control/PPP/ppp_ex13.m @@ -0,0 +1,49 @@ +function name = ppp_ex13 (ReturnName) + + ## usage: ppp_ex13 () + ## + ## PPP example: Sensitivity minimisation (incomplete) + + + ## Example name + name = "Sensitivity minimisation (incomplete)"; + + if nargin>0 + return + endif + + + ## System - unstable + A = [-3 -3 -1 + 1 0 0 + 0 1 0]; + B = [1 + 0 + 0]; + C = [0 -0.5 1 + 0 1.0 0]; + D = [0;0]; + + ## Setpoint + A_w = [0;0] + + ## Controller + t =[0:0.1:5]; # Optimisation horizon + t1 =[0:0.1:1]; + t2 =[1.1:0.1:3.9]; + t3 =[4:0.1:5]; + + + A_u = ppp_aug(laguerre_matrix(3,5.0), 0); + q_s=1e3; + Q = [exp(5*t) + q_s*exp(-t)] + size(Q) + W = [1;0]; + + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W) + +endfunction + + + ADDED mtt/lib/control/PPP/ppp_ex14m.m Index: mtt/lib/control/PPP/ppp_ex14m.m ================================================================== --- mtt/lib/control/PPP/ppp_ex14m.m +++ mtt/lib/control/PPP/ppp_ex14m.m @@ -0,0 +1,102 @@ +function [name,T,y,u,ys,us,ysu,usu,J] = ppp_ex14m (ReturnName) + + ## usage: [name,T,y,u,ys,us,ysu,usu,J] = ppp_ex14 (ReturnName) + ## + ## PPP example - shows output constraints on nonlinear system + ## $Id$ + + + ## Example name + name = "Output constraints -0.1 on y* at tau=0.1,0.5,1,2"; + + if nargin>0 + if ReturnName + return + endif + endif + + ## System + A = [-3 -3 -1 + 1 0 0 + 0 1 0]; + B = [1 + 0 + 0]; + C = [0 -0.5 1]; + D = 0; + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + ## Controller + t = [4:0.02:5]; # Time horizon + A_w = 0; # Setpoint + A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions + Q = ones(n_y,1);; + + ## Constaints - u + Tau_u = []; + one = ones(size(Tau_u)); + limit = 3; + Min_u = -limit*one; + Max_u = limit*one; + Order_u = 0*one; + + ## Constraints - y + Tau_y = [0.1 0.5 1 2] + one = ones(size(Tau_y)); + Min_y = -0.01*one; # Min_y(5) = 0.99; + Max_y = 1e5*one; # Max_y(5) = 1.01; + Order_y = 0*one; + + ## Simulation + W=1; + x_0 = zeros(3,1); + + ## Constrained - open-loop + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); # Unconstrained design + [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); + [Gamma_y,gamma_y] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau_y,Min_y,Max_y,Order_y); + + Gamma = [Gamma_u; Gamma_y]; + gamma = [gamma_u; gamma_y]; + + ## Constrained OL simulation + [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); + T = [0:t(2)-t(1):t(length(t))]; + [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); + + ## Unconstrained OL simulation + [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); + [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); + + title("Constained and unconstrained y*"); + xlabel("t"); + grid; + plot(T,ys,T,ysu) + + ## Non-linear - closed-loop + movie = 1; + if movie + hold on; + endif + + [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ + Tau_u,Min_u,Max_u,Order_u, \ + Tau_y,Min_y,Max_y,Order_y,W,x_0,movie); + + hold off; +# title("y,y*,u and u*"); +# xlabel("t"); +# grid; +# plot(T,y,T,u,T,ysu,T,usu); + + ## Compute derivatives. + dt = t(2)-t(1); + du = diff(u)/dt; + dus = diff(us)/dt; + T1 = T(1:length(T)-1); + ##plot(T1,du,T1,dus); +endfunction + + + + ADDED mtt/lib/control/PPP/ppp_ex15.m Index: mtt/lib/control/PPP/ppp_ex15.m ================================================================== --- mtt/lib/control/PPP/ppp_ex15.m +++ mtt/lib/control/PPP/ppp_ex15.m @@ -0,0 +1,64 @@ +function [name,T,y,u,ye,ue,J] = ppp_ex15 (ReturnName) + + ## usage: ppp_ex15 () + ## + ## PPP example - an unstable, nmp siso system + ## $Id$ + + ## Example name + name = "Linear unstable non-minimum phase third order system - intermittent control"; + + if nargin>0 + return + endif + + + ## System - unstable + A = [3 -3 1 + 1 0 0 + 0 1 0]; + B = [10 + 0 + 0]; + C = [0 -0.5 1]; + D = 0; + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + ## Setpoint + A_w = ppp_aug(0,[]); + + ## Controller + t =[4.0:0.01:5.0]; # Optimisation horizon + dt = t(2)-t(1); + A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); + Q = 1; # Weight + + ##Simulate + W = 1; # Setpoint + x_0 = zeros(n_x,1); # Initial state + + + ## Closed-loop intermittent solution + Delta_ol = 0.5 # Intermittent time + + disp("Intermittent control simulation"); + R=1;P=0; + [T,y,u] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q,R,P, \ + [],[],[],[], \ + [],[],[],[],W,x_0,Delta_ol); +size(T) + ## Exact closed-loop + disp("Exact closed-loop"); + [k_x,k_w] = ppp_lin (A,B,C,D,A_u,A_w,t,Q) + [ye,Xe] = ppp_sm2sr(A-B*k_x, B, C, D, T, k_w*W, x_0); # Compute Closed-loop control + + ue = k_w*ones(size(T))*W - k_x*Xe; + + + title("y and u, exact and intermittent"); + xlabel("t"); + grid; + plot(T,y,"1;y (intermittent);", T,u,"2;u (intermittent);",\ + T,ye,"3;y (exact);", T,ue,"4;u (exact);"); + +endfunction ADDED mtt/lib/control/PPP/ppp_ex16.m Index: mtt/lib/control/PPP/ppp_ex16.m ================================================================== --- mtt/lib/control/PPP/ppp_ex16.m +++ mtt/lib/control/PPP/ppp_ex16.m @@ -0,0 +1,103 @@ +function [name,T,y,u,ys,us,J] = ppp_ex16 (ReturnName) + + ## usage: [name,T,y,u,ys,us,T1,du,dus] = ppp_ex16 (ReturnName) + ## + ## PPP example + + ## $Id$ + + + ## Example name + name = "Input constraints +-1.5 on u* at tau=0,0.1,0.2..,2.0 - intermittent control"; + + if nargin>0 + return + endif + + ## System + A = [-3 -3 -1 + 1 0 0 + 0 1 0]; + B = [1 + 0 + 0]; + C = [0 -0.5 1]; + D = 0; + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + ## Controller + t = [5:0.01:6]; # Time horizon + A_w = 0; # Setpoint + A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions + A_u = ppp_aug(laguerre_matrix(1,0.5), A_u); # Add some extra slow modes + Q = ones(n_y,1);; + + ## Constaints + Gamma = []; + gamma = []; + + ## Constaints - u + Tau_u = [0:0.1:2]; + one = ones(size(Tau_u)); + limit = 1.5; + Min_u = -limit*one; + Max_u = limit*one; + Order_u = 0*one; + + ## Constaints - y + Tau_y = []; + one = ones(size(Tau_y)); + limit = 1.5; + Min_y = -limit*one; + Max_y = limit*one; + Order_y = 0*one; + + ## Simulation + W=1; + x_0 = zeros(3,1); + + ## Constrained - open-loop + disp("Control design"); + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); # Unconstrained design + [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); + + Gamma = Gamma_u; + gamma = gamma_u; + + disp("Open-loop simulations"); + ## Constrained OL simulation + [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); + T = [0:t(2)-t(1):t(length(t))]; + [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); + + ## Unconstrained OL simulation + [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); + [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); + + title("Constrained and unconstrained y* and u*"); + xlabel("t"); + grid; + axis([0 6 -1 2]); + plot(T,ys,T,ysu,T,us,T,usu) + axis; + + ## Non-linear - closed-loop + disp("Closed-loop simulation"); + Delta_ol = 0.1; + [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ + Tau_u,Min_u,Max_u,Order_u, \ + Tau_y,Min_y,Max_y,Order_y,W,x_0,Delta_ol); + + title("y,y*,u and u*"); + xlabel("t"); + grid; + plot(T,y,T,u,T,ys,T,us); +endfunction + + + + + + + + ADDED mtt/lib/control/PPP/ppp_ex17.m Index: mtt/lib/control/PPP/ppp_ex17.m ================================================================== --- mtt/lib/control/PPP/ppp_ex17.m +++ mtt/lib/control/PPP/ppp_ex17.m @@ -0,0 +1,94 @@ +function [name,T,y,u,ys,us,ysu,usu,J] = ppp_ex17 (ReturnName) + + ## usage: [name,T,y,u,ys,us,ysu,usu,J] = ppp_ex17 (ReturnName) + ## + ## PPP example - shows output constraints on nonlinear system + ## $Id$ + + + ## Example name + name = "Output constraints -0.1 on y* at tau=0.1,0.5,1,2 - intermittent control"; + + if nargin>0 + if ReturnName + return + endif + endif + + ## System + A = [-3 -3 -1 + 1 0 0 + 0 1 0]; + B = [1 + 0 + 0]; + C = [0 -0.5 1]; + D = 0; + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + ## Controller + t = [9:0.02:10]; # Time horizon + A_w = 0; # Setpoint + A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions + Q = ones(n_y,1);; + + ## Constraints - u + Tau_u = []; + one = ones(size(Tau_u)); + limit = 3; + Min_u = -limit*one; + Max_u = limit*one; + Order_u = 0*one; + + ## Constraints - y + Tau_y = [0.1 0.5 1 2] + one = ones(size(Tau_y)); + Min_y = -0.01*one; # Min_y(5) = 0.99; + Max_y = 1e5*one; # Max_y(5) = 1.01; + Order_y = 0*one; + + ## Simulation + W=1; + x_0 = zeros(3,1); + + ## Constrained - open-loop + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); # Unconstrained design + [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); + [Gamma_y,gamma_y] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau_y,Min_y,Max_y,Order_y); + + Gamma = [Gamma_u; Gamma_y]; + gamma = [gamma_u; gamma_y]; + + ## Constrained OL simulation + [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); + T = [0:t(2)-t(1):t(length(t))]; + + ## OL solution + [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); + + ## Unconstrained OL simulation + [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); + [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); + + title("Constained and unconstrained y*"); + xlabel("t"); + grid; + figure(1); + plot(T,ys,"-;y* (constrained);", T,ysu,"--;y* (unconstrained);") + + ## Non-linear - closed-loop + delta_ol = 0.1; mu = 1e-4; + [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ + Tau_u,Min_u,Max_u,Order_u, \ + Tau_y,Min_y,Max_y,Order_y,W,x_0,delta_ol,mu); + + title("y and u"); + xlabel("t"); + grid; + plot(T,y,"1;y (constrained);", T,u,"2;u (constrained);"); + +endfunction + + + + ADDED mtt/lib/control/PPP/ppp_ex18.m Index: mtt/lib/control/PPP/ppp_ex18.m ================================================================== --- mtt/lib/control/PPP/ppp_ex18.m +++ mtt/lib/control/PPP/ppp_ex18.m @@ -0,0 +1,40 @@ +function name = ppp_ex18 (ReturnName) + + ## usage: ppp_ex18 () + ## + ## PPP example - an unstable, nmp siso system + ## $Id$ + + + ## Example name + name = "First order with redundant inputs"; + + if nargin>0 + return + endif + + ## System + A = 1 + B = 1 + C = 1 + D = 0; + + ## Setpoint + A_w = ppp_aug(0,[]); + + ## Controller + ##Optimisation horizon + t =[2:0.1:3]; + + ## A_u + A_u = diag([0 -2 -4 -6]) + + [ol_poles,cl_poles] = ppp_lin_plot (A,B,C,D,A_u,A_w,t) + + +endfunction + + + + + ADDED mtt/lib/control/PPP/ppp_ex19.m Index: mtt/lib/control/PPP/ppp_ex19.m ================================================================== --- mtt/lib/control/PPP/ppp_ex19.m +++ mtt/lib/control/PPP/ppp_ex19.m @@ -0,0 +1,105 @@ +function [name,T,y,u,ys,us,J] = ppp_ex19 (ReturnName,n_extra,T_extra) + + ## usage: [name,T,y,u,ys,us,T1,du,dus] = ppp_ex19 (ReturnName) + ## + ## PPP example + + ## $Id$ + + + ## Example name + name = "Input constraints with redundant U*"; + + if (nargin>0)&&(ReturnName==1) + return + endif + + + if nargin<2 + n_extra = 3 + endif + + if nargin<3 + T_extra = 2.0 + endif + + + ## System + A = 1 + B = 1 + C = 1 + D = 0; + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + ## Controller + t = [2:0.01:3]; # Time horizon + A_w = 0; + A_u = diag([0 -6]); + A_u = ppp_aug(A_u,laguerre_matrix(n_extra,1/T_extra)) + Q = 1; + ## Constraints + Gamma = []; + gamma = []; + + ## Constraints - u + Tau_u = [0 0.1 0.5 1 1.5 2]; + Tau_u = 0; + one = ones(size(Tau_u)); + limit = 1.5; + Min_u = -limit*one; + Max_u = limit*one; + Order_u = 0*one; + + ## Constraints - y + Tau_y = []; + one = ones(size(Tau_y)); + limit = 1.5; + Min_y = -limit*one; + Max_y = limit*one; + Order_y = 0*one; + + ## Simulation + W=1; + x_0 = zeros(n_x,1); + + ## Constrained - open-loop + disp("Control design"); + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t); # Unconstrained design + [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); + + Gamma = Gamma_u; + gamma = gamma_u; + + disp("Open-loop simulations"); + ## Constrained OL simulation + [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); + T = [0:t(2)-t(1):t(length(t))]; + [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); + + ## Unconstrained OL simulation + [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); + [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); + + title("Constrained and unconstrained y*"); + xlabel("t"); + grid; + plot(T,ys,"-;y* (constrained);", T,ysu,"--;y* (unconstrained);"); + + ## Non-linear - closed-loop + disp("Closed-loop simulation"); + [T1,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ + Tau_u,Min_u,Max_u,Order_u, \ + Tau_y,Min_y,Max_y,Order_y,W,x_0); + + title("y and u"); + xlabel("t"); + grid; + plot(T,y,"1;y (constrained);", T,u,"2;u (constrained);"); + +endfunction + + + + + + ADDED mtt/lib/control/PPP/ppp_ex2.m Index: mtt/lib/control/PPP/ppp_ex2.m ================================================================== --- mtt/lib/control/PPP/ppp_ex2.m +++ mtt/lib/control/PPP/ppp_ex2.m @@ -0,0 +1,32 @@ +function name = ppp_ex2 (Return_Name) + + ## usage: Name = ppp_ex2 (Return_Name) + ## + ## PPP example: Effect of slow desired closed-loop + ## $Id$ + + + ## Example name + name = "Effect of slow desired closed-loop: closed-loop is same as open loop"; + + if nargin>0 + return + endif + + ## System + A = -1; # Fast - time constant = 1 + B = 0.5; # Gain is 1/2 + C = 1; + D = 0; + + ## Controller + t =[9:0.1:10]; # Optimisation horizon + + A_u = [-0.1 0 # Slow - time constant = 10 + 1 0]; + + A_w = 0; # Constant set point + + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w] = ppp_lin_plot(A,B,C,D,A_u,A_w,t) +endfunction + ADDED mtt/lib/control/PPP/ppp_ex20.m Index: mtt/lib/control/PPP/ppp_ex20.m ================================================================== --- mtt/lib/control/PPP/ppp_ex20.m +++ mtt/lib/control/PPP/ppp_ex20.m @@ -0,0 +1,73 @@ +function [name,T,y,u,ys,us,ysu,usu] = ppp_ex20 (ReturnName) + + ## usage: ppp_ex20 () + ## + ## PPP example - 2nd-order 2i2o system + ## $Id$ + + + ## Example name + name = "2nd-order 2i2o system with 1st-order basis" + + if nargin>0 + return + endif + + ## System + A = [-2 -1 + 1 0]; + B = [[1;0], [1;2]]; + C = [ [0,1]; [2,1]]; + D = zeros(2,2); + +# sys = ss2sys(A,B,C,D); + [n_x,n_u,n_y] = abcddim(A,B,C,D); + +# ## Display it +# for j = 1:n_u +# for i = 1:n_y +# sysout(sysprune(sys,i,j),"tf") +# step(sysprune(sys,i,j),1,5); +# endfor +# endfor + + ## Setpoint + A_w = 0; + + ## Controller + + ##Optimisation horizon + t =[4:0.01:5]; + + ## A_u + pole = [3]; + poles = 1; + A_u = ppp_aug(butterworth_matrix(poles,pole),0); + Q = ones(n_y,1);; + + ## Setpoints + W = [1:n_y]'; + + ## Design and plot + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); + + format bank + cl_poles + + A_c = A-B*k_x; # Closed-loop A + A_cw = [A_c B*k_w*W + zeros(1,n_x+1)] + + log_cond_uu = log10(cond_uu) + # K_xwe = ppp_open2closed(A_u,A_cwe,[k_xe -k_we*W]); # Exact Kx +# K_xwc = ppp_open2closed(A_u,A_cw,[k_x -k_w*W]); # Computed Kx + # Exact_K_xw = K_xwe + PPP_K_xw = [K_x -K_w*W] +# Comp_K_xw = K_xwc + +# Error = Approx_K_xw - Comp_K_xw + +endfunction + + + ADDED mtt/lib/control/PPP/ppp_ex20.new.m Index: mtt/lib/control/PPP/ppp_ex20.new.m ================================================================== --- mtt/lib/control/PPP/ppp_ex20.new.m +++ mtt/lib/control/PPP/ppp_ex20.new.m @@ -0,0 +1,92 @@ +# function name = ppp_ex20 (ReturnName) + +# ## usage: name = ppp_ex20 (ReturnName) +# ## +# ## PPP example -- a standard multivariable example +# ## $Id$ + + + +# ## Example name +# name = "Turbogenerator example: system TGEN from J.M Maciejowski: Multivariable Feedback Design"; + +# if nargin>0 +# return +# endif + + ## System + [A,B,C,D] = airc; + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + ## Controller + t = [9:0.1:10]; # Time horizon + A_w = zeros(n_y,1); # Setpoint + TC = 2*[1 1]; # Time constants for each input + # A_u = []; +# for tc=TC # Input +# A_u = [A_u;ppp_aug(laguerre_matrix(3,1/tc), 0)]; +# endfor + A_u = ppp_aug(laguerre_matrix(5,1.0), 0); + Q = [1;1]; # Output weightings + + ## Constraints + Gamma = []; + gamma = []; + + ## Constraints - u + Tau_u = [0 0.1 0.5 1 1.5 2]; + Tau_u = 0; + one = ones(size(Tau_u)); + limit = 1.5; + Min_u = -limit*one; + Max_u = limit*one; + Order_u = 0*one; + + ## Constraints - y + Tau_y = []; + one = ones(size(Tau_y)); + limit = 1.5; + Min_y = -limit*one; + Max_y = limit*one; + Order_y = 0*one; + + ## Simulation + W=[1;2;3]; + x_0 = zeros(n_x,1); + + ## Constrained - open-loop + disp("Control design"); + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t); # Unconstrained design + [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); + + Gamma = Gamma_u; + gamma = gamma_u; + + disp("Open-loop simulations"); + ## Constrained OL simulation + [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); + T = [0:t(2)-t(1):t(length(t))]; + [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); + + ## Unconstrained OL simulation + [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); + [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); + + title("Constrained and unconstrained y*"); + xlabel("t"); + grid; + plot(T,ys,T,ysu) + + ## Non-linear - closed-loop + disp("Closed-loop simulation"); + [T1,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ + Tau_u,Min_u,Max_u,Order_u, \ + Tau_y,Min_y,Max_y,Order_y,W,x_0); + + title("y,y*,u and u*"); + xlabel("t"); + grid; + plot(T1,y,T,ys,T1,u,T,us); + + +#endfunction ADDED mtt/lib/control/PPP/ppp_ex21.m Index: mtt/lib/control/PPP/ppp_ex21.m ================================================================== --- mtt/lib/control/PPP/ppp_ex21.m +++ mtt/lib/control/PPP/ppp_ex21.m @@ -0,0 +1,76 @@ +function [name,T,y,u,ys,us,ysu,usu] = ppp_ex21 (ReturnName) + + ## usage: ppp_ex21 () + ## + ## PPP example - 2nd-order 2i2o system system with anomalous behaviour" + ## $Id$ + + + ## Example name + name = "2nd-order 2i2o system with anomalous behaviour" + + if nargin>0 + return + endif + + ## System + A = [-2 -1 + 1 0]; + B = [[1;0], [1;2]]; + C = [ [0,1]; [2,1]]; + D = zeros(2,2); + + sys = ss2sys(A,B,C,D); + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + ## Display it + for j = 1:n_u + for i = 1:n_y + sysout(sysprune(sys,i,j),"tf") + step(sysprune(sys,i,j),1,5); + endfor + endfor + + ## Setpoint + A_w = 0; + + ## Controller + + ##Optimisation horizon + t =[4:0.1:5]; + + ## A_u + pole = [4]; + #A_u = ppp_aug(laguerre_matrix(2,pole),0); + #A_u = ppp_aug(diag([-3,-4]),0); + A_u = ppp_aug(butterworth_matrix(2,pole),0); + Q = ones(n_y,1);; + + ## Setpoints + W = [1:n_y]'; + + ## Initial condition + x_0 = [0;0.5]; + + ## Design and plot + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0); + + format short + cl_poles + + A_c = A-B*k_x; # Closed-loop A + A_cw = [A_c B*k_w*W + zeros(1,n_x+1)] + + log_cond_uu = log10(cond_uu) + # K_xwe = ppp_open2closed(A_u,A_cwe,[k_xe -k_we*W]); # Exact Kx + #AA_u = ppp_inflate([A_u;A_u]); + K_xwc = ppp_open2closed(A_u,A_cw,[k_x -k_w*W]) # Computed Kx + # Exact_K_xw = K_xwe + Approx_K_xw = [K_x -K_w*W] + format + +endfunction + + + ADDED mtt/lib/control/PPP/ppp_ex3.m Index: mtt/lib/control/PPP/ppp_ex3.m ================================================================== --- mtt/lib/control/PPP/ppp_ex3.m +++ mtt/lib/control/PPP/ppp_ex3.m @@ -0,0 +1,62 @@ +function name = ppp_ex3 (Return_Name) + + ## usage: Name = ppp_ex3 (Return_Name) + ## + ## PPP example: Uncoupled 5x5 system + ## $Id$ + + + + + ## Example name + name = "Uncoupled NxN system - n first order systems"; + + if nargin>0 + return + endif + + ## System - N uncoupled integrators + N = 3 + A = -0.0*eye(N); + B = eye(N); + C = eye(N); + D = zeros(N,N); + + t =[4:0.1:5]; # Optimisation horizon + ## Create composite matrices + A_u = []; # Initialise + A_w = []; # Initialise + + for i=1:N + ## Setpoint - constant + a_w = ppp_aug(0,[]); + A_w = [A_w;a_w]; + + ## Controller + a_u = ppp_aug(-i,a_w); + A_u = [A_u; a_u]; + endfor + + A_u = [-diag([1:N])] + + Q = ones(N,1); # Equal output weightings + W = ones(N,1); # Setpoints are all unity + + ## Design and simulate + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u] = ppp_lin(A,B,C,D,A_u,A_w,t); + # [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = \ + # ppp_lin_plot(A,B,C,D,A_u,A_w,t,Q,W); + + Approximate_K_x = K_x#(1:2:2*N,:) + A_c = A-B*k_x; + Closed_Loop_Poles = eig(A-B*k_x) + ## Now try out the open/closed loop theory +# A_u = -diag(1:N); # Full A_u matrix +# A_c = -diag(1:N); # Ideal closed-loop +# k_x = diag(1:N); # Ideal feedback + KK = ppp_open2closed (ppp_inflate(A_u),A_c,k_x); + Exact_K_x_tilde = KK + + +endfunction + ADDED mtt/lib/control/PPP/ppp_ex4.m Index: mtt/lib/control/PPP/ppp_ex4.m ================================================================== --- mtt/lib/control/PPP/ppp_ex4.m +++ mtt/lib/control/PPP/ppp_ex4.m @@ -0,0 +1,47 @@ +function name = ppp_ex4 (ReturnName) + + ## usage: ppp_ex4 () + ## + ## PPP example -- a 1i2o system with performance limitations + ## $Id$ + + + + ## Example name + name = "Resonant system (1i2o): illustrates performance limitations with 2 different time-constants"; + + if nargin>0 + return + endif + + + ## Mass- sping damper from Middleton et al EE9908 + + ## Set parameters to unity + m_1 = 1; + m_2 = 1; + k = 1; + + ## System + [A,B,C,D] = TwoMassSpring (k,m_1,m_2); + + for TC = [0.4 1] + disp(sprintf("\nClosed-loop time constant = %1.1f\n",TC)); + ## Controller + A_w = zeros(2,1); # Setpoint: Unit W* for each output + t =[11:0.1:12]; # Optimisation horizon + [A_u] = ppp_aug(laguerre_matrix(4,1/TC), 0); # U* + + Q = [1;0]; + + ## Design and plot + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q) + hold on; + endfor + + hold off; +endfunction + + + + ADDED mtt/lib/control/PPP/ppp_ex5.m Index: mtt/lib/control/PPP/ppp_ex5.m ================================================================== --- mtt/lib/control/PPP/ppp_ex5.m +++ mtt/lib/control/PPP/ppp_ex5.m @@ -0,0 +1,58 @@ +function name = ppp_ex5 (ReturnName) + + ## usage: ppp_ex5 (ReturnName) + ## + ## PPP example -- a 28-state vibrating beam system + ## $Id$ + + + ## Example name + name = "Vibrating beam: 14 state regulation problem with 7 beam velocities as output"; + + if nargin>0 + return + endif + + + ## System - beam + Beam_numpar; + [A,B,C,D]=Beam_sm; + + ## Redo C and D to reveal ALL velocities + c = C(1); + C = zeros(7,14); + for i = 1:7 + C(i,2*i-1) = c; + endfor + D = zeros(7,1); + + e = eig(A); # Eigenvalues + N = length(e); + frequencies = sort(imag(e)); + frequencies = frequencies(N/2+1:N); # Modal frequencies + + ## Controller + ## Controller design parameters + t = [0.4:0.01:0.5]; # Optimisation horizon + + Q = ones(7,1); + + ## Specify input basis functions + ## - damped sinusoids with same frequencies as beam + damping_ratio = 0.2; # Damping ratio of inputs + A_u = damped_matrix(frequencies,0.2*ones(size(frequencies))); + u_0 = ones(14,1); # Initial conditions + + A_w = zeros(7,1); # Setpoint + W = zeros(7,1); # Zero setpoint + + ## Set up an "typical" initial condition + x_0 = zeros(14,1); + x_0(2:2:14) = ones(1,7); # Set initial twist to 1. + + ## Simulation + [ol_poles,cl_poles] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0); + + + +endfunction ADDED mtt/lib/control/PPP/ppp_ex6.m Index: mtt/lib/control/PPP/ppp_ex6.m ================================================================== --- mtt/lib/control/PPP/ppp_ex6.m +++ mtt/lib/control/PPP/ppp_ex6.m @@ -0,0 +1,55 @@ +function [name,T,y,u,J] = ppp_ex6 (ReturnName) + + ## usage: [name,T,y,u,J] = ppp_ex6 (ReturnName) + ## + ## PPP example -- PPP for redundant actuation + ## $Id$ + + + ## Example name + name = "Two input-one output system with input constraints"; + + if nargin>0 + return + endif + + ## System + A = 0; + B = [0.5 1]; + C = 1; + D = [0 0]; + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + ## Controller + t = [4:0.1:5]; # Time horizon + A_w = 0; # Setpoint + A_u = [-2;-0.5]; # Input + Q = 1; # Output weight + + ## Constrain input 1 at time tau=0 + Tau = 0; + Max = [1;inf] + Min = [-inf;-inf]; + Order = 0; + i_u = 1; + + ## Simulation + W=1; + x_0 = 0; + + ## Linear + ppp_lin_plot (A,B,C,D,A_u,A_w,t); + + ## Non-linear + movie = 0; + [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, Tau,Min,Max,Order, \ + [],[],[],[], W,x_0); + title("y,u_1,u_2"); + xlabel("t"); + grid; + plot(T,y,"-;y;", T,u(1,:),"--;u_1;", T,u(2,:),".-;u_2;"); + +endfunction + + + ADDED mtt/lib/control/PPP/ppp_ex7.m Index: mtt/lib/control/PPP/ppp_ex7.m ================================================================== --- mtt/lib/control/PPP/ppp_ex7.m +++ mtt/lib/control/PPP/ppp_ex7.m @@ -0,0 +1,37 @@ +function name = ppp_ex7 (ReturnName) + + ## usage: name = ppp_ex7 (ReturnName) + ## + ## PPP example -- standard multivariable system + ## $Id$ + + + ## Example name + name = "Aircraft example: system AIRC from J.M Maciejowski: Multivariable Feedback Design"; + + if nargin>0 + return + endif + + ## System + [A,B,C,D] = airc; + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + ## Controller + t = [4:0.01:5]; # Time horizon + A_w = 0; # Setpoint (same for each input) + #A_u = ppp_aug(laguerre_matrix(5,1), 0) # Same for each input + A_u = laguerre_matrix(5,1); # Same for each input + Q = ones(3,1); # Output weightings + ## Design and plot + W = [1;2;3] + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); + cl_poles + + ## Try open-closed theory but using computed values: + A_c = A - B*k_x; eig(A_c) + K_x + KK = ppp_open2closed (A_u,A_c,k_x) + + 100*((KK-K_x)./KK) +endfunction ADDED mtt/lib/control/PPP/ppp_ex8.m Index: mtt/lib/control/PPP/ppp_ex8.m ================================================================== --- mtt/lib/control/PPP/ppp_ex8.m +++ mtt/lib/control/PPP/ppp_ex8.m @@ -0,0 +1,29 @@ +function name = ppp_ex8 (ReturnName) + + ## usage: name = ppp_ex8 (ReturnName) + ## + ## PPP example - standard multivariable example + ## $Id$ + + ## Example name + name = "Automotive gas turbine example: system AUTM from J.M Maciejowski: Multivariable Feedback Design"; + + if nargin>0 + return + endif + + ## System + [A,B,C,D] = autm; + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + ## Controller + t = [4:0.1:5]; # Time horizon + A_w = 0; # Setpoint + A_u = ppp_aug(laguerre_matrix(4,2.0), 0) # Input + Q = [1;1e3]; # Output weightings + + ## Design and plot + W = [1;2] + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); + +endfunction ADDED mtt/lib/control/PPP/ppp_ex9.m Index: mtt/lib/control/PPP/ppp_ex9.m ================================================================== --- mtt/lib/control/PPP/ppp_ex9.m +++ mtt/lib/control/PPP/ppp_ex9.m @@ -0,0 +1,42 @@ +function name = ppp_ex9 (ReturnName) + + ## usage: name = ppp_ex9 (ReturnName) + ## + ## PPP example -- a standard multivariable example + ## $Id$ + + + + ## Example name + name = "Turbogenerator example: system TGEN from J.M Maciejowski: Multivariable Feedback Design"; + + if nargin>0 + return + endif + + ## System + [A,B,C,D] = tgen; + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + ## Controller + t = [1.0:0.01:2.0]; # Time horizon +# A_w = zeros(n_y,1); # Setpoint +# TC = 2*[1 1]; # Time constants for each input +# A_u = []; +# for tc=TC # Input +# A_u = [A_u;ppp_aug(laguerre_matrix(3,1/tc), 0)]; +# endfor + A_w = 0; + A_u = ppp_aug(ppp_aug(laguerre_matrix(2,1.0),laguerre_matrix(2,2.0)), A_w) + Q = [1;1]; # Output weightings + + ## Design and plot + W = [1;2] + [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); + +# ol_poles, cl_poles +# k_x,k_w +# K_X = [K_x -K_w] +# A_c = A - B*k_x; +# K_X_comp = ppp_open2closed (A_u,[A_c B*k_w*W; zeros(1,n_x+1)],[k_x -k_w*W]) +endfunction ADDED mtt/lib/control/PPP/ppp_examples.m Index: mtt/lib/control/PPP/ppp_examples.m ================================================================== --- mtt/lib/control/PPP/ppp_examples.m +++ mtt/lib/control/PPP/ppp_examples.m @@ -0,0 +1,54 @@ +function ppp_examples () + + ## usage: ppp_examples () + ## + ## Various menu-driven PPP examples + + + str="menu(""Predictive Pole-Placement (PPP) examples"",""Exit"",""All examples"; # Menu string + + used = 2; + option=used; + + while option>1 + + exists=1; + i_example=1; # Example counter + while exists + name=sprintf("ppp_ex%i",i_example); + exists=(exist(name)==2); + if exists + title = eval(sprintf("%s(1);", name)); + str = sprintf("%s"",""%s",str,title); + i_example++; + endif + endwhile + n_examples = i_example-1; + + str = sprintf("%s"" );\n",str); + + option=eval(str); # Menu - ask user + + if option>1 # Do something - else return + if option==2 # All examples + Examples=1:n_examples; + else # Just the chosen examples + Examples = option-used; + endif + for example=Examples # Do the chosen examples + eval(sprintf("Title = ppp_ex%i(1);",example)); + disp(sprintf("Evaluating example ppp_ex%i:\n\t %s\n", example, Title)); + eval(sprintf("ppp_ex%i;",example)); + endfor + endif + + + endwhile + +endfunction + + + + + + ADDED mtt/lib/control/PPP/ppp_extract.m Index: mtt/lib/control/PPP/ppp_extract.m ================================================================== --- mtt/lib/control/PPP/ppp_extract.m +++ mtt/lib/control/PPP/ppp_extract.m @@ -0,0 +1,31 @@ +function A_i = ppp_extract (A_u,input) + + ## usage: A_i = ppp_extract (A_u) + ## + ## Extracts the ith A_u matrix. + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + [n,m] = size(A_u); # Size of composite A_u matrix + square = (n==m); # Its a square matrix so same U* on each input + if square + A_i = A_u; # All a_u the same + else + N = m; # Number of U* functions per input + n_u = n/m; + if floor(n_u) != n_u # Check that n_u is an integer + error("A_u must be square or be a column of square matrices"); + endif + + if input>n_u + error("Input index too large"); + endif + + ## Extract the ith matrix + start = (input-1)*N; + range=(start+1:start+N); + A_i = A_u(range,:); + endif + +endfunction ADDED mtt/lib/control/PPP/ppp_identify.m Index: mtt/lib/control/PPP/ppp_identify.m ================================================================== --- mtt/lib/control/PPP/ppp_identify.m +++ mtt/lib/control/PPP/ppp_identify.m @@ -0,0 +1,62 @@ +function [par,Par,Error,Y] = ppp_identify (system_name,u,y_0,par_names,par_0,extras) + ## ppp_identify: System identification for PPP + ## usage: [par,Par,Error,Y] = ppp_identify(system_name,u,y_0,par_names,par_0,extras) + ## + ## system_name String containing system name + ## u System input (column vector, each row is u') + ## y_0 Desired model output + ## par_names Column vector of (padded) strings - the adjustable + ## parameter names + ## par_0 Initial parameter vector estimate + ## extras (opt) optimisation parameters + ## .criterion convergence criterion + ## .max_iterations limit to number of iterations + ## .v Initial Levenberg-Marquardt parameter + + + if nargin<6 + extras.criterion = 1e-5; + extras.max_iterations = 10; + extras.v = 1e-5; + extras.verbose = 0; + endif + + s_system_name = sprintf("s%s", system_name); # Name of sensitivity system + + ## Set up parameters + sim = eval([s_system_name, "_simpar;"]); # Simulation parameter + sym = eval([s_system_name, "_sympar;"]); # Parameter names + x0 = eval([s_system_name, "_state(par_0);"]); # Initial state + +# ## Set up the free parameter list +# free = []; +# [n,m] = size(par_names); +# for i = 1:n +# p_name = deblank(par_names(i,:)); +# s_name = sprintf("%ss", p_name); +# if struct_contains(sym, p_name) +# i_p = eval(sprintf("sym.%s;", p_name)); +# if struct_contains(sym, s_name) +# i_s = eval(sprintf("sym.%s;", s_name)); +# free_i = eval(sprintf("[%i,%i];", i_p, i_s)); +# free = [free; free_i]; +# else +# printf("Sensitivity parameter %s does not exist: ignoring \ +# parameter %s\n", s_name, p_name); +# endif +# else +# printf("Parameter %s does not exist: ignoring\n", p_name) +# endif +# endfor +# free + free = ppp_indices(par_names,sym); + [par,Par,Error,Y] = ppp_optimise(s_system_name,x0,par_0,sim,u,y_0,free,extras); + +endfunction + + + + + + + ADDED mtt/lib/control/PPP/ppp_indices.m Index: mtt/lib/control/PPP/ppp_indices.m ================================================================== --- mtt/lib/control/PPP/ppp_indices.m +++ mtt/lib/control/PPP/ppp_indices.m @@ -0,0 +1,48 @@ +function indices = ppp_indices (names,sympar,sympars) + + ## usage: indices = ppp_indices (names,sympar) + ## + ## names: column vector of component names + ## sympar symbolic parameter structure for system + ## sympars symbolic parameter structure for sensitivity system + + + ## Returns a matrix indices with 3 columns, one row per name + ## First col: index of ith parameter of sensitivity system + ## Second col: index of ith sensitivity parameter of sensitivity system + ## Third col : index of ith parameter of system + ## Copyright (C) 2002 by Peter J. Gawthrop + + ## Sanity check + if nargin<3 + printf("Usage: ppp_indices (names,sympar,sympars)\n"); + return + endif + + ## Set up the + indices = []; + [n,m] = size(names); + for i = 1:n + p_name = deblank(names(i,:)); + s_name = sprintf("%ss", p_name); + if struct_contains(sympars, p_name) + i_ps = eval(sprintf("sympars.%s;", p_name)); + if struct_contains(sympars, s_name) + i_s = eval(sprintf("sympars.%s;", s_name)); + if struct_contains(sympar, p_name) + i_p = eval(sprintf("sympar.%s;", p_name)); + indices_i = eval(sprintf("[%i,%i,%i];", i_ps, i_s, i_p)); + indices = [indices; indices_i]; + else + printf("Parameter %s does not exist in sympar: ignoring\n", p_name) + endif + else + printf("Sensitivity parameter %s does not exist in sympars: ignoring \ + parameter %s\n", s_name, p_name); + endif + else + printf("Parameter %s does not exist in sympars: ignoring\n", p_name) + endif + endfor + +endfunction ADDED mtt/lib/control/PPP/ppp_inflate.m Index: mtt/lib/control/PPP/ppp_inflate.m ================================================================== --- mtt/lib/control/PPP/ppp_inflate.m +++ mtt/lib/control/PPP/ppp_inflate.m @@ -0,0 +1,27 @@ +function A_m = ppp_inflate (A_v) + + ## usage: A_m = ppp_inflate (A_v) + ## + ## Creates the square matrix A_m with the matrix elements of the column + ## vector of square matrices A_v. + + ## Copyright (C) 2001 by Peter J. Gawthrop + + [N,M] = size(A_v); + + if N-inf + Gamma = [Gamma; -Gamma_tau]; + gamma = [gamma; -Min(i)]; + endif + + endfor + +endfunction ADDED mtt/lib/control/PPP/ppp_input_constraints.m Index: mtt/lib/control/PPP/ppp_input_constraints.m ================================================================== --- mtt/lib/control/PPP/ppp_input_constraints.m +++ mtt/lib/control/PPP/ppp_input_constraints.m @@ -0,0 +1,42 @@ +function [Gamma,gamma] = ppp_input_constraints (A_u,Tau,Min,Max,Order) + + ## usage: [Gamma,gamma] = ppp_input_constraints (A_u,Tau,Min,Max[,Order]) + ## + ## Derives input copnstraint matrices Gamma and gamma + ## for multi-input systems. + ## A_u Input-generating matrix + ## Tau row vector of times at which constraints occur + ## Max, Maximum and minimum values + ## Limits at inf and -inf are discarded + + ## Sanity check + [n_u,n_tau] = size(Min); + [n,m] = size(Max); + if (n!=n_u)||(m!=n_tau) + error("Max and Min must have the same dimensions"); + endif + + [n,m] = size(Tau); + if (m!=n_tau) + error("Max and Min must have same number of columns as Tau"); + endif + if (n>1) + error("Tau must be a row vector"); + endif + + ##Defaults + if nargin<5 + Order=zeros(1,n_tau); + endif + + ## Stack up constraints for each input + Gamma=[]; + gamma=[]; + for i_u=1:n_u + [Gamma_i,gamma_i] = \ + ppp_input_constraint(A_u,Tau,Min(i_u,:),Max(i_u,:),Order,i_u,n_u); + Gamma = [Gamma; Gamma_i]; + gamma = [gamma; gamma_i]; + endfor + +endfunction ADDED mtt/lib/control/PPP/ppp_int_obs.m Index: mtt/lib/control/PPP/ppp_int_obs.m ================================================================== --- mtt/lib/control/PPP/ppp_int_obs.m +++ mtt/lib/control/PPP/ppp_int_obs.m @@ -0,0 +1,34 @@ +function [x_p,y_p,y_new,error] = ppp_int_obs (x,y,U,A,B,C,D,A_u,delta,L) + + ## usage: x_new = ppp_int_obs (x,y,U,A,B,C,D,A_u,delta,L) + ## + ## Intermittent observer for PPP + ## + ## x,y Current estimated state and measured output + ## U PPP control weights + ## A,B,C,D System matrices + ## A_u PPP basis matrix + ## delta time step + ## L Observer gain + ## x_p, y_p predicted estimated state and output + ## y_new corrected estimated current output + ## error corresponding error + + ## Copyright (C) 2003 by Peter J. Gawthrop + + ## Sanity check + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + if nargin<10 + L = zeros(n_x,n_y); + endif + + ## Corrector (on current value of output) + error = (C*x-y); + x_new = x - L*error; + y_new = C*x_new; + + ## Predictor (predicts Delta_OL ahead) + [y_p,us,x_p] = ppp_ystar (A,B,C,D,x_new,A_u,U,delta); + +endfunction ADDED mtt/lib/control/PPP/ppp_ippp.m Index: mtt/lib/control/PPP/ppp_ippp.m ================================================================== --- mtt/lib/control/PPP/ppp_ippp.m +++ mtt/lib/control/PPP/ppp_ippp.m @@ -0,0 +1,20 @@ +function i_ppp = ppp_ippp (n_ppp,sympar,sympars) + + ## usage: i_ppp = ppp_ippp (n_ppp,sympar,sympars) + ## nppp number of ppp parameters + ## sympars symbolic parameter structure for system + ## sympar symbolic parameter structure for sensitivity system + ## Returns a matrix i_ppp with n_ppp rows and 3 columns + ## First col: index of ith ppp parameter of sensitivity system + ## Second col: index of ith ppp sensitivity parameter of sensitivity system + ## Third col : index of ith ppp parameter of system + ## Copyright (C) 2002 by Peter J. Gawthrop + + i_ppp = []; + for i=1:n_ppp + i_ppp_i = eval(sprintf("[sympars.ppp_%i, sympars.ppp_%is \ + sympar.ppp_%i];",i,i,i)); + i_ppp = [i_ppp ; i_ppp_i]; + endfor + +endfunction ADDED mtt/lib/control/PPP/ppp_lin.m Index: mtt/lib/control/PPP/ppp_lin.m ================================================================== --- mtt/lib/control/PPP/ppp_lin.m +++ mtt/lib/control/PPP/ppp_lin.m @@ -0,0 +1,238 @@ +function [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P,max_cond); + ## usage: + ## [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = + ## ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P,max_cond) + + ## + ## Linear PPP (Predictive pole-placement) computation + ## INPUTS: + ## A,B,C,D: system matrices + ## A_u: composite system matrix for U* generation + ## one square matrix (A_ui) row for each system input + ## each A_ui generates U*' for ith system input. + ## OR + ## A_u: square system matrix for U* generation + ## same square matrix for each system input. + ## A_w: composite system matrix for W* generation + ## one square matrix (A_wi) row for each system output + ## each A_wi generates W*' for ith system output. + ## tau: row vector of times for optimisation (equispaced in time) + ## Q column vector of output weights (defaults to unity) + ## OR + ## Q matrix, each row corresponds to time-varying weight compatible with t + ## max_cond: Maximum condition number of J_uu (def 1/eps) + ## OUTPUTS: + ## k_x: State feedback gain + ## k_w: setpoint gain + ## ie u(t) = k_w w(t) - k_x x(t) + ## K_x, K_w: open loop gains + ## Us0: Value of U* at tau=0 + ## J_uu, J_ux, J_uw, J_xx,J_xw,J_ww: cost derivatives + ## cond_uu : Condition number of J_uu + ## Copyright (C) 1999, 2000 by Peter J. Gawthrop + ## $Id$ + + ## Check some dimensions + [n_x,n_u,n_y] = abcddim(A,B,C,D); + if (n_x==-1) + return + endif + + ## Default Q (output weight) + if nargin<8 + Q = ones(n_y,1); + endif + + ## Default R (input weight) + if nargin<9 + R = zeros(n_u,1); + endif + + ## Default P (terminal weight) + if nargin<10 + P = zeros(n_x,n_x); + P_weighting = 0; + else + P_weighting = 1; + endif + + ## Default condittion number + if nargin<11 + max_cond = 1e20; + endif + + [n_U,m_U] = size(A_u); + if (n_U != n_u*m_U)&&(n_U != m_U) + error("A_u must be square or have N_u rows and N_u/n_u columns"); + endif + + if (n_U == m_U) # U matrix square + n_U = n_U*n_u; # So same U* on each input + endif + + + [n_W,m_W] = size(A_w); + if n_W>0 + if (n_W != n_y*m_W)&&(n_W != m_W) + error("A_w must either be square or have N_w rows and N_w/n_y columns"); + endif + square_W = (n_W== m_W); # Flag indicates W is square + if (n_W == m_W) # W matrix square + n_W = n_W*n_y; # So same W* on each output + endif + endif + + + [n_t,m_t] = size(tau); + if n_t != 1 + error("tau must be a row vector"); + endif + dt = tau(2) - tau(1); # Sample interval + + [n_Q,m_Q] = size(Q); + if ((m_Q != 1)&&(m_Q != m_t)) || (n_Q != n_y) + error("Q must be a column vector with one row per system output"); + endif + + if (m_Q == 1) # Convert to vector Q(i) + Q = Q*ones(1,m_t); # Extend to cover full range of tau + endif + + ##Set up initial states + u_0 = ones(m_U,1); + w_0 = ones(m_W,1); + + ## Find y_U - derivative of y* wrt U. + i_U = 0; + x_0 = zeros(n_x,1); # This is for x=0 + y_u = []; # Initialise + x_u_t = []; # Initialise + Us = []; # Initialise + for i=1:n_U # Do for each input function U*_i + dU = zeros(n_U,1); + dU(++i_U) = 1; # Create dU/dU_i + [ys,us,xs] = ppp_ystar (A,B,C,D,x_0,A_u,dU,tau); # Find ystar and ustar + y_u = [y_u ys']; # Save y_u (y for input u) with one row for each t. + Us = [Us us']; # Save u (input) with one row for each + # t. + x_u_t = [x_u_t xs(:,m_t)]; # x_u at terminal time + endfor + + Ws = []; # Initialise + if n_W>0 + ## Find w* + i_W = 0; + x_0 = zeros(n_x,1); # This is for x=0 + for i=1:n_W # Do for each setpoint function W*i + dW = zeros(n_W,1); + dW(++i_W) = 1; # Create dW/dW_i + [ys,ws] = ppp_ystar ([],[],[],[],[],A_w,dW,tau); # Find ystar and ustar + Ws = [Ws ws']; # Save u (input) with one row for each t. + endfor + endif + + + + ## Find y_x - derivative of y* wrt x. + y_x=[]; + for t_i=tau + y = C*expm(A*t_i); + yy = reshape(y,1,n_y*n_x); # Reshape to a row vector + y_x = [y_x; yy]; + endfor + + ## Compute the integrals to give cost function derivatives + [n_yu m] = size(y_u'); + [n_yx m] = size(y_x'); + [n_yw m] = size(Ws'); + + J_uu = zeros(n_U,n_U); + J_ux = zeros(n_U,n_x); + J_uw = zeros(n_U,n_W); + J_xx = zeros(n_x,n_x); + J_xw = zeros(n_x,n_W); + J_ww = zeros(n_W,n_W); + + ## Add up cost derivatives for each output but weighted by Q. + ## Scaled by time interval + ## y_u,y_x and Ws should really be 3D matrices, but instead are stored + ## with one row for each time and one vector (size n_y) column for + ## each element of U + + ## Scale Q + Q = Q*dt; # Scale to give correct units + ## Non-w bits + for i = 1:n_y # For each output + QQ = ones(n_U,1)*Q(i,:); # Resize Q + J_uu = J_uu + (QQ .* y_u(:,i:n_y:n_yu)') * y_u(:,i:n_y:n_yu); + J_ux = J_ux + (QQ .* y_u(:,i:n_y:n_yu)') * y_x(:,i:n_y:n_yx); + QQ = ones(n_x,1)*Q(i,:); # Resize Q + J_xx = J_xx + (QQ .* y_x(:,i:n_y:n_yx)') * y_x(:,i:n_y:n_yx); + endfor + + ## Input weighting (scalar for the moment) + if (n_u>1) + warning("Sorry, cant do n_u>1 just now: exiting"); + return + endif + + ## Scale R + R = R*dt; # Scale to give correct units + for i = 1:m_t + Ust = Us(i,:); + J_uu = J_uu + Ust'*R*Ust; + endfor + + ## w bits + if n_W>0 + for i = 1:n_y # For each output + QQ = ones(n_U,1)*Q(i,:); # Resize Q + J_uw = J_uw + (QQ .* y_u(:,i:n_y:n_yu)') * Ws (:,i:n_y:n_yw); + QQ = ones(n_x,1)*Q(i,:); # Resize Q + J_xw = J_xw + (QQ .* y_x(:,i:n_y:n_yx)') * Ws (:,i:n_y:n_yw); + QQ = ones(n_W,1)*Q(i,:); # Resize Q + J_ww = J_ww + (QQ .* Ws (:,i:n_y:n_yw)') * Ws (:,i:n_y:n_yw); + endfor + endif + + if P_weighting + ## Terminal constraint + tau_last = tau(m_t); + x_x_t = expm(A*tau_last); # deriv. of x*(tau_2) wrt x(0) + J_ux = J_ux + x_u_t'*P*x_x_t; + J_uu = J_uu + x_u_t'*P*x_u_t; + + ## Terminal constraint - w bits + ## NB SISO ONLY at the moment + C = C(1,:); # REMOVE ME + + ## deriv of x* wrt W + if (cond(A)<1e10) # Finite ss gain + x_W_t = (A\B)*inv(C*(A\B)); + else # Infinite ss gain + Y_0 = zeros(n_x,n_y); Y_0(1,:) = ones(1,n_y); + x_W_t = obsv(A,C)\Y_0; + endif + + J_uw = J_uw + x_u_t'*P*x_W_t; + endif + + ## Exit if badly conditioned + cond_uu = cond(J_uu); + if cond_uu>max_cond + error(sprintf("J_uu is badly conditioned. Condition number = \ + 10^%i",log10(cond_uu))); + endif + + ## Compute the open-loop gains + K_w = J_uu\J_uw; + K_x = J_uu\J_ux; + + ## U*(tau) at tau=0 + Us0 = ppp_ustar(A_u,n_u,0); + + ## Compute the closed-loop gains + k_x = Us0*K_x; + k_w = Us0*K_w; + +endfunction ADDED mtt/lib/control/PPP/ppp_lin_con_sol.m Index: mtt/lib/control/PPP/ppp_lin_con_sol.m ================================================================== --- mtt/lib/control/PPP/ppp_lin_con_sol.m +++ mtt/lib/control/PPP/ppp_lin_con_sol.m @@ -0,0 +1,10 @@ +function U = ppp_lin_con_sol (x,w,J_uu,J_ux,J_uw) + + ## usage: U = ppp_lin_con_sol (x,w,J_uu,J_ux,J_uw) + ## + ## + + ## Pass info to the solnp algorithm + global ppp_J_uu, ppp_J_ux, ppp_J_uw + +endfunction ADDED mtt/lib/control/PPP/ppp_lin_obs.m Index: mtt/lib/control/PPP/ppp_lin_obs.m ================================================================== --- mtt/lib/control/PPP/ppp_lin_obs.m +++ mtt/lib/control/PPP/ppp_lin_obs.m @@ -0,0 +1,54 @@ +function [l_x,l_y,L_x,L_y,J_uu,J_ux,J_uw,Us0] = ppp_lin_obs (A,B,C,D,A_u,A_y,t,Q) + + ## usage: [l_x,l_y,L_x,L_y,J_uu,J_ux,J_uw,Us0] = ppp_lin_obs (A,B,C,D,A_u,A_y,t,Q) + ## + ## Linear PPP (Predictive pole-placement) computation + ## INPUTS: + ## A,B,C,D: system matrices + ## A_u: composite system matrix for U* generation + ## one square matrix (A_ui) row for each system input + ## each A_ui generates U*' for ith system input. + ## A_y: composite system matrix for W* generation + ## one square matrix (A_yi) row for each system output + ## each A_yi generates W*' for ith system output. + ## t: row vector of times for optimisation (equispaced in time) + ## Q column vector of output weights (defaults to unity) + + ## OUTPUTS: + ## l_x: State feedback gain + ## l_y: setpoint gain + ## ie u(t) = l_y w(t) - l_x x(t) + ## L_x, L_y: open loop gains + ## J_uu, J_ux, J_uw: cost derivatives + ## Us0: Value of U* at tau=0 + + ## Check some dimensions + [n_x,n_u,n_y] = abcddim(A,B,C,D); + if (n_x==-1) + return + endif + + ## Default Q + if nargin<8 + Q = ones(n_y,1); + endif + + +# B_x = eye(n_x); # Pseudo B +# D_x = zeros(n_y,n_x); # Pseudo D + [l_x,l_y,L_x,L_y,J_uu,J_ux,J_uw,Us0] = ppp_lin(A',C',B',D',A_u',A_y',t,Q); + + l_x = l_x'; + l_y = l_y'; + L_x = L_x'; + L_y = L_y'; +endfunction + + + + + + + + + ADDED mtt/lib/control/PPP/ppp_lin_plot.m Index: mtt/lib/control/PPP/ppp_lin_plot.m ================================================================== --- mtt/lib/control/PPP/ppp_lin_plot.m +++ mtt/lib/control/PPP/ppp_lin_plot.m @@ -0,0 +1,90 @@ +function [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0) + + ## usage: [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0) + ## + ## Linear PPP (Predictive pole-placement) computation with plotting + ## INPUTS: + ## A,B,C,D: system matrices + ## A_u: composite system matrix for U* generation + ## one square matrix (A_ui) row for each system input + ## each A_ui generates U*' for ith system input. + ## A_w: composite system matrix for W* generation + ## one square matrix (A_wi) row for each system output + ## each A_wi generates W*' for ith system output. + ## t: row vector of times for optimisation (equispaced in time) + ## Q: column vector of output weights (defaults to unity) + ## W: Constant setpoint vector (one element per output) + ## x_0: Initial state + ## OUTPUTS: + ## Various poles 'n zeros + ## k_x: State feedback gain + ## k_w: setpoint gain + ## ie u(t) = k_w w(t) - k_x x(t) + ## K_x, K_w: open loop gains + ## J_uu, J_ux, J_uw: cost derivatives + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + ## Some dimensions + [n_x,n_u,n_y] = abcddim(A,B,C,D); + [n_U,m_U]=size(A_u); + square = (n_U==m_U); # Its a square matrix so same U* on each input + [n_W,m_W]=size(A_w); + if n_W==m_W # A_w square + n_W = n_W*n_y; # Total W functions + endif + + + [n_t,m_t] = size(t); + + ## Default Q + if nargin<8 + Q = ones(n_y,1) + endif + + ## Default W + if nargin<9 + W = ones(n_W,1) + endif + + ## Default x_0 + if nargin<10 + x_0 = zeros(n_x,1); + endif + + ## Check some dimensions + [n_Q,m_Q] = size(Q); + if ((m_Q != 1)&&(m_Q != m_t)) || (n_Q != n_y) + error("Q must be a column vector with one row per system output"); + endif + + [n,m] = size(W); + if ((m != 1) || (n != n_W)) + error("W must be a column vector with one element per system output"); + endif + + [n,m] = size(x_0); + if ((m != 1) || (n != n_x)) + error("x_0 must be a column vector with one element per system state"); + endif + + ## Simulate + [y,ystar,t,k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu]\ + = ppp_lin_sim(A,B,C,D,A_u,A_w,t,Q,W,x_0); + + ## Plot + xlabel("Time"); title("y* and y"); grid; + plot(t,ystar,t,y); + + ## Compute some pole/zero info + cl_poles = eig(A-B*k_x)'; + ol_poles = eig(A)'; + + if nargout>3 + ol_zeros = tzero(A,B,C,D)'; + cl_zeros = tzero(A-B*k_x,B,C,D)'; + endif + +endfunction + ADDED mtt/lib/control/PPP/ppp_lin_quad.m Index: mtt/lib/control/PPP/ppp_lin_quad.m ================================================================== --- mtt/lib/control/PPP/ppp_lin_quad.m +++ mtt/lib/control/PPP/ppp_lin_quad.m @@ -0,0 +1,25 @@ +function [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,A_u] = \ + ppp_lin_quad (A,B,C,D,tau,Q,R,A_e) + + ## usage:[k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,A_u] = + ## ppp_lin_quad (A,B,C,D,tau,Q,R[,A_e]) + ## + ## + + ## Steady-state Linear Quadratic solution + ## using Algebraic Riccati equation (ARE) + + if nargin<8 + A_e = []; + endif + + [P,A_u,A_w] = ppp_are (A,B,C,D,Q,R); + + A_u = ppp_aug(A_u,A_e); + + ## PPP solution + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww] = \ + ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P); + + +endfunction ADDED mtt/lib/control/PPP/ppp_lin_run.m Index: mtt/lib/control/PPP/ppp_lin_run.m ================================================================== --- mtt/lib/control/PPP/ppp_lin_run.m +++ mtt/lib/control/PPP/ppp_lin_run.m @@ -0,0 +1,382 @@ +function [t,y,u,X_est,y_c,t_e,y_e,e_e,p_c,p_o] = ppp_lin_run (Name,Simulate,ControlType,w,x_0,p_c,p_o) + + ## usage: [t,y,u,y_c,t_e,y_e,e_e,p_c,p_o] = ppp_lin_run (Name,Simulate,ControlType,w,x_0,p_c,p_o) + ## + ## + ## Linear closed-loop PPP of lego system (and simulation) + ## + ## Name: Name of system (in mtt terms) + ## Simulate = 0: real thing + ## Simulate = 1: simulate + ## Control = 0: step test + ## Control = 1: PPP open-loop + ## Control = 2: PPP closed-loop + ## w is the (constant) setpoint + ## par_control and par_observer are structures containing parameters + ## for the observer and controller + + ##Defaults + if nargin<1 # Default name to dir name + names = split(pwd,"/"); + [n_name,m_name] = size(names); + Name = deblank(names(n_name,:)); + endif + + if nargin<6 + p_c.N = 50; + endif + + if nargin<7 + p_o.sigma = 1e-1; + endif + + ## System + sys = mtt2sys(Name); # Create system + [A,B,C_0,D_0] = sys2ss(sys); # SS form + [n_x, n_u, n_y] = abcddim(A,B,C_0,D_0); + + ## Extract matrices for controlled and constrained outputs. + if !struct_contains(p_c,"I_0") # Indices for controlled outputs + p_c.I_0 = 1:n_y + endif + if !struct_contains(p_c,"I_1") # Indices for constrained outputs + p_c.I_1 = 1:n_y + endif + + C = C_0(p_c.I_0,:) + C_c = C_0(p_c.I_1,:); + D = D_0(p_c.I_0,:); + D_c = D_0(p_c.I_1,:); + [n_x, n_u, n_y] = abcddim(A,B,C,D); # Dimensions + [n_x, n_u, n_y_c] = abcddim(A,B,C_c,D_c); # Dimensions + + + if nargin<2 + Simulate = 1; + endif + + if nargin<3 + ControlType = 2; + endif + + if nargin<4 + w = ones(n_y,1);; + endif + + if nargin<5 + x_0 = zeros(n_x,1); + endif + + if !struct_contains(p_c,"delta_ol") + p_c.delta_ol = 0.5; # OL sample interval + endif + + if !struct_contains(p_c,"T") + p_c.T = 10; # Last time point. + endif + + if !struct_contains(p_c,"Iterations") + p_c.Iterations = 5; # Number of interations, total =T*Iterations + endif + + if !struct_contains(p_c,"augment") + p_c.augment = 0; # Augment basis funs with constant + endif + + if !struct_contains(p_c,"integrate") + p_c.integrate = 0; + endif + + if !struct_contains(p_c,"Tau_u") + p_c.Tau_u = []; + p_c.Min_u = []; + p_c.Max_u = []; + endif + + if !struct_contains(p_c,"Tau_y") + p_c.Tau_y = []; + p_c.Min_y = []; + p_c.Max_y = []; + endif + + + if !struct_contains(p_c,"Method") + p_c.Method = "lq"; + endif + + if struct_contains(p_c,"Method") + if strcmp(p_c.Method,"lq") + p_c.Q = eye(n_y); + p_c.n_U = n_x; + if !struct_contains(p_c,"R") + p_c.R = (0.1^2)*eye(n_u); + endif + elseif strcmp(p_c.Method,"original"); + if !struct_contains(p_c,"A_w") + p_c.A_w = 0; + endif + if !struct_contains(p_c,"A_u") + p_c.n_U = n_x; + a_u = 2.0; + p_c.A_u = laguerre_matrix(p_c.n_U,a_u); + if p_c.augment # Put in constant term + p_c.A_u = ppp_aug(0,p_c.A_u); + endif + endif + else + error(sprintf("Method %s not recognised", p_c.Method)); + endif + endif + + if !struct_contains(p_c,"tau") # Time horizon + if strcmp(p_c.Method,"lq") + p_c.tau = [0:0.1:1]*2; + elseif strcmp(p_c.Method,"original"); + p_c.tau = [10:0.1:11]; + else + error(sprintf("Method %s not recognised", p_c.Method)); + endif + endif + + if !struct_contains(p_c,"A_e") + p_c.A_e = []; # No extra modes + endif + + if !struct_contains(p_o,"x_0") + p_o.x_0 = zeros(n_x,1); + endif + + if !struct_contains(p_o,"method") + ##p_o.method = "continuous"; + ##p_o.method = "intermittent"; + p_o.method = "remote"; + endif + + ## Check w. + [n_w,m_w] = size(w); + if ( (n_w!=n_y) || (m_w!=1) ) + error(sprintf("ppp_lin_run: w must a column vector with %i elements",n_y)); + endif + + ## Initialise + x_est = p_o.x_0; + + ## Initialise simulation state + x = x_0; + y_i = C*x_0 + + if ControlType==0 # Step input + I = 1; # 1 large sample + p_c.delta_ol = p_c.T; # I + K_w = zeros(p_c.n_U,n_y); + K_w(1,1) = 1; + K_w(2,1) = -1; + K_x = zeros(p_c.n_U,n_x); + else + I = ceil(p_c.T/p_c.delta_ol) # Number of large samples + if strcmp(p_c.Method, "original") + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww] =\ + ppp_lin(A,B,C,D,p_c.A_u,p_c.A_w,p_c.tau); # Design + elseif strcmp(p_c.Method, "lq") # LQ design + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,A_u] \ + = ppp_lin_quad (A,B,C,D,p_c.tau,p_c.Q,p_c.R,p_c.A_e); + p_c.A_u = A_u; + else + error(sprintf("Control method %s not recognised", p_c.Method)); + endif + + ##Sanity check A_u + [p_c.n_U,M_u] = size(p_c.A_u); + if (p_c.n_U!=M_u) + error("A_u must be square"); + endif + + ## Checks + cl_poles = eig(A - B*k_x) + ol_poles = eig(A) + t_max = 1/min(abs(cl_poles)); + t_min = 1/max(abs(cl_poles)); + endif + + ## Initial control U + U = zeros(p_c.n_U,1) ; + + ## Short sample interval + dt = p_c.delta_ol/p_c.N; + + ## Observer design + G = eye(n_x); # State noise gain + sigma_x = eye(n_x); # State noise variance + Sigma = p_o.sigma*eye(n_y) # Measurement noise variance + + if strcmp(p_o.method, "intermittent") + Ad = expm(A*p_c.delta_ol); # Discrete-time transition matrix + if (ControlType==2) # + [L, M, P, obs_poles] = dlqe(Ad,G,C,sigma_x,Sigma); + else + L = zeros(n_x,n_y); + obs_poles = eig(Ad); + endif + elseif strcmp(p_o.method, "continuous") + Ad = expm(A*dt); # Discrete-time transition matrix + A_ud = expm(p_c.A_u*dt); # Discrete-time input transition + if (ControlType==2) # + [L, M, P, obs_poles] = dlqe(Ad,G,C,sigma_x,Sigma); + else + L = zeros(n_x,n_y); + obs_poles = eig(Ad); + endif + elseif strcmp(p_o.method, "remote") + L = zeros(n_x,n_y); + obs_poles = []; + else + error(sprintf("Observer method ""%s"" unknown", p_o.method)); + endif + + ## Display the poles + obs_poles + + ## Write the include file for the real-time function + ## Use double length to allow for overuns + overrun = 2; + Ustar = ppp_ustar (p_c.A_u, n_u, [0:dt:overrun*p_c.delta_ol], 0,0); + if p_c.integrate # Integrate Ustar + disp("Integrating Ustar"); + Ustar = cumsum(Ustar)*dt; + endif + + disp("Writing Ustar.h ..."); + ppp_ustar2h(Ustar); + disp("done."); + + + ## Control loop + y = []; + y_c = []; + u = []; + t = []; + y_e = []; + X_est = []; + t_e = []; + e_e = []; + tick = time; + i=0; + + for j=1:p_c.Iterations + for k=1:I + tim=time; # Timing + i++; + + if Simulate # Exact simulation + X = x; # Current (simulated) state + else # The real thing + if strcmp(p_o.method, "remote") + [t_i,y_i,u_i,X] = ppp_put_get_X(U); # Remote-state interface + else + [t_i,y_i,u_i] = ppp_put_get(U); # Generic interface to real-time + endif + endif + + ## Observer + if strcmp(p_o.method, "intermittent") + [x_est y_est y_new, e_est] = ppp_int_obs \ + (x_est,y_i,U,A,B,C,D,p_c.A_u,p_c.delta_ol,L); + elseif strcmp(p_o.method, "continuous") + Ui = U; # U at sub intervals + for k = 1:p_c.N + [x_est y_est y_new e_est] = ppp_int_obs \ + (x_est,yi(:,k),Ui,A,B,C,D,p_c.A_u,dt,L); + Ui = A_ud'*Ui; + y_e = [y_e; y_new']; + e_e = [e_e; e_est']; + endfor + elseif strcmp(p_o.method, "remote") + ## predict from remote state (with zero L) + if (ControlType==2) # Closed-loop + [x_est y_est y_new e_est] = ppp_int_obs \ + (X,y_i,U,A,B,C,D,p_c.A_u,p_c.delta_ol,zeros(n_x,1)); + ## x_est = X; y_est=y_i; y_new=y_i; e_est=0; + else # Open-loop + [x_est y_est y_new e_est] = ppp_int_obs \ + (x_est,y_i,U,A,B,C,D,p_c.A_u,p_c.delta_ol,zeros(n_x,1)); + endif + endif + + ## Simulation (based on U_i) + if Simulate + t_sim = [1:p_c.N]*dt; # Simulation time points + [yi,ui,xsi] = ppp_ystar(A,B,C,D,x,p_c.A_u,U,t_sim); # Simulate + x = xsi(:,p_c.N); # NEXT state + ti = [(i-1)*p_c.N:i*p_c.N-1]*dt; + y_i = yi(1); # Current output + t_i = ti(1); + endif + + ##Control + if ( length(p_c.Tau_u)==0&&length(p_c.Tau_y)==0 ) + U = K_w*w - K_x*x_est; + else + ## Input constraints + [Gamma_u, gamma_u] = \ + ppp_input_constraints(p_c.A_u,p_c.Tau_u,p_c.Min_u,p_c.Max_u); + + ## Output constraints + [Gamma_y,gamma_y] = \ + ppp_output_constraints(A,B,C_c,D_c,x_est,p_c.A_u,\ + p_c.Tau_y,p_c.Min_y,p_c.Max_y); + + ## Composite constraints - t=0 + Gamma = [Gamma_u; Gamma_y]; + gamma = [gamma_u; gamma_y]; + + [u_qp,U,n_active] = ppp_qp \ + (x_est,w,J_uu,J_ux,J_uw,Us0,Gamma,gamma,1e-6,1); + endif + + ## Allow for the delay + ##U = expm(p_c.delta_ol*p_c.A_u)*U; + + ## Save data + if Simulate + t = [t;ti']; + y = [y;yi']; + X_est = [X_est;x_est']; + y_c = [y_c;(C_c*xsi)']; + u = [u;ui']; + else + t = [t;t_i]; + y = [y;y_i']; + X_est = [X_est;x_est']; + u = [u;u_i']; + endif + + if strcmp(p_o.method, "intermittent")||strcmp(p_o.method, "remote") + y_e = [y_e; y_new']; + e_e = [e_e; e_est']; + t_e = [t_e; t_i]; + endif + if !Simulate + delta_comp = time-tim; + usleep(floor(1e6*(p_c.delta_ol-delta_comp-0.01))); + endif + + endfor # Main loop + w = -w; + endfor # Outer loop + if !Simulate + ppp_put_get(0*U); # Reset to zero + endif + + + if strcmp(p_o.method, "continuous") + t_e = t; + endif + + + average_ol_sample_interval = (time-tick)/i + + ## Put data on file (so can use for identification) + filename = sprintf("%s_ident_data.dat",Name); + eval(sprintf("save -ascii %s t y u",filename)); + +endfunction ADDED mtt/lib/control/PPP/ppp_lin_sim.m Index: mtt/lib/control/PPP/ppp_lin_sim.m ================================================================== --- mtt/lib/control/PPP/ppp_lin_sim.m +++ mtt/lib/control/PPP/ppp_lin_sim.m @@ -0,0 +1,88 @@ +function [y,ystar,t,k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin_sim(A,B,C,D,A_u,A_w,tau,Q,W,x_0) + + ## usage: [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,tau,Q,W,x_0) + ## + ## Linear PPP (Predictive pole-placement) computation with plotting + ## INPUTS: + ## A,B,C,D: system matrices + ## A_u: composite system matrix for U* generation + ## one square matrix (A_ui) row for each system input + ## each A_ui generates U*' for ith system input. + ## A_w: composite system matrix for W* generation + ## one square matrix (A_wi) row for each system output + ## each A_wi generates W*' for ith system output. + ## tau: row vector of times for optimisation (equispaced in time) + ## Q: column vector of output weights (defaults to unity) + ## W: Constant setpoint vector (one element per output) + ## x_0: Initial state + ## OUTPUTS: + ## y : closed-loop output + ## ystar : open-loop moving-horizon output + ## t : time axis + + ## Copyright (C) 2001 by Peter J. Gawthrop + ## $id: ppp_lin_plot.m,v 1.13 2001/01/26 16:03:13 peterg Exp $ + + ## Some dimensions + [n_x,n_u,n_y] = abcddim(A,B,C,D); + [n_U,m_U]=size(A_u); + square = (n_U==m_U); # Its a square matrix so same U* on each input + [n_W,m_W]=size(A_w); + if n_W==m_W # A_w square + n_W = n_W*n_y; # Total W functions + endif + + + [n_tau,m_tau] = size(tau); + + ## Default Q + if nargin<8 + Q = ones(n_y,1); + endif + + ## Default W + if nargin<9 + W = ones(n_W,1) + endif + + ## Default x_0 + if nargin<10 + x_0 = zeros(n_x,1); + endif + + ## Check some dimensions + [n_Q,m_Q] = size(Q); + if ((m_Q != 1)&&(m_Q != m_tau)) || (n_Q != n_y) + error("Q must be a column vector with one row per system output"); + endif + + [n,m] = size(W); + if ((m != 1) || (n != n_W)) + error("W must be a column vector with one element per system output"); + endif + + [n,m] = size(x_0); + if ((m != 1) || (n != n_x)) + error("x_0 must be a column vector with one element per system state"); + endif + + ## Control design + disp("Designing controller"); + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin (A,B,C,D,A_u,A_w,tau,Q); + + ## Set up simulation times + dtau = tau(2) -tau(1); # Time increment + t = 0:dtau:tau(length(tau)); # Time starting at zero + + ## Compute the OL step response + disp("Computing OL response"); + U = K_w*W - K_x*x_0; + ystar = ppp_ystar (A,B,C,D,x_0,A_u,U,t); + + ## Compute the CL step response + disp("Computing CL response"); + y = ppp_sm2sr(A-B*k_x, B, C, D, t, k_w*W, x_0); # Compute Closed-loop control + + +endfunction + ADDED mtt/lib/control/PPP/ppp_nlin.m Index: mtt/lib/control/PPP/ppp_nlin.m ================================================================== --- mtt/lib/control/PPP/ppp_nlin.m +++ mtt/lib/control/PPP/ppp_nlin.m @@ -0,0 +1,37 @@ +function [U, U_all, Error, Y, its] = ppp_nlin(system_name,x_0,par_0,sim,us,w,free, Q, extras) + + ## usage: [U, U_all, Error, Y,its ] = ppp_nlin(system_name,x_0,par_0,sim,us,w,free, Q, extras) + ## + ## + + if nargin<9 + extras.criterion = 1e-8; + extras.max_iterations = 10; + extras.v = 0.1; + extras.verbose = 1; + endif + + s_system_name = sprintf("s%s", system_name); # Name of sensitivity system + + ## Details + [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name)); + [n_tau,n_us] = size(us); + + if nargin<8 + Q = ones(n_y,1); + endif + + ## Checks + if (n_us<>n_u) + error(sprintf("Inputs (%i) differenct to system inputs (%i)", n_us, n_u)); + endif + + ##Optimise + [par,Par,Error,Y,its] = ppp_optimise(s_system_name,x_0,par_0,sim,us,w,free,Q,extras); + + U = par(free(:,1)); + U_all = Par(free(:,1),:); +endfunction + + + ADDED mtt/lib/control/PPP/ppp_nlin_run.m Index: mtt/lib/control/PPP/ppp_nlin_run.m ================================================================== --- mtt/lib/control/PPP/ppp_nlin_run.m +++ mtt/lib/control/PPP/ppp_nlin_run.m @@ -0,0 +1,271 @@ +function [y,u,t,p,UU,t_open,t_ppp,t_est,its_ppp,its_est] = ppp_nlin_run(system_name,i_ppp,i_par,A_u,w_s,N_ol,Q,extras) + + + ## usage: [y,u,t,p,U,t_open,t_ppp,t_est,its_ppp,its_est] = + ## ppp_nlin_run (system_name,i_ppp,i_par,A_u,w_s,N_ol[,extras]) + ## + ## y,u,t System output, input and corresponding time p + ## Estimated parameters U PPP weight vector t_open The + ## open-loop interval t_ppp Time for each ppp optimisation t_est + ## Time for each estimation i_ppp Matrix of ppp gain indices: col. + ## 1 Gain indices in sensitivity system col. 2 Gain sensitivity + ## indices in sensitivity system col. 3 Gain indices in system + ## i_par Matrix of indices of estimated parameters col. 1 Parameter + ## indices in sensitivity system col. 2 Parameter sensitivity + ## indices in sensitivity system col. 3 Parameter indices in system + ## A_u Basis function generating matrix w_s w_star: That part + ## of the moving horizon setpoint within the optimisation horizon. + ## N_ol The number of open-loop intervals to be computed extras + ## Extra parameters in a structure: extras.alpha ?? + ## extras.criterion Optimisation convergence criterion + ## extras.emulate_timing Simulate some real-time features + ## extras.estimate Estimate parameters and states + ## extras.max_iterations Maximum optimisation iterations + ## extras.simulate 1 for simulation (not real-time) extras.vInitial Levenberg-Marquardt parameter + ## extras.verbose 1 for extra info display + ## + ## Real-time implementatipn of nonlinear PPP Copyright (C) 2001,2002 + ## by Peter J. Gawthrop + + ## Globals to pass details to simulation + global system_name_sim i_ppp_sim x_0_sim y_sim u_sim A_u_sim simpar_sim + + ## Defaults + if nargin<8 + extras.alpha = 0.1; + extras.criterion = 1e-5; + extras.emulate_timing = 0; + extras.max_iterations = 10; + extras.simulate = 1; + extras.v = 1e-5; + extras.verbose = 0; + extras.visual = 0; + endif + + ##Estimate if we have some adjustable parameters + estimating_parameters = (length(i_par)>0); + + ## Names + s_system_name = sprintf("s%s", system_name); + + ## System details -- defines simulation within ol interval + par = eval(sprintf("%s_numpar;", system_name)); + simpar = eval(sprintf("%s_simpar;", system_name)); + dt = simpar.dt; # Sample interval + simpar_est = simpar; # Initial estimation simulation params + simpar_model = simpar; # Initial internal model simulation params + simpar_pred = simpar; # Initial prediction simulation params + T_ol_0 = simpar.last; # The initial specified interval + n_t = round(simpar.last/simpar.dt); # Corresponding length + x_0 = eval(sprintf("%s_state(par);", system_name)); + x_0_model = x_0; + [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name)); + [n_par,m_par] = size(i_par); + if nargin<8 + Q = ones(n_y,1); + endif + + ## Sensitivity system details -- defines moving horizon simulation + simpars = eval(sprintf("%s_simpar;", s_system_name)); + pars = eval(sprintf("%s_numpar;", s_system_name)); + x_0s = eval(sprintf("%s_state(pars);", s_system_name)); + x_0_models = x_0s; + + p = []; # Initialise saved parameters + + ## Times + ## -- within opt horizon + n_Tau = round(simpars.last/simpars.dt); + dtau = simpars.dt; + Tau = [0:n_Tau-1]'*dtau; + [n_tau,n_w] = size(w_s); + tau = Tau(n_Tau-n_tau+1:n_Tau); + w = w_s(n_tau,:); # Final value of setpoint + + + ## Main simulation loop + y = []; + x = []; + u = []; + t = []; + + + t_last = 0; + UU_l =[]; + UU_c =[]; + + t_ppp = []; + t_est = []; + its_ppp = []; + its_est = []; + t_open = []; + x_nexts = zeros(2*n_x,1); + + ## Initial U is zero + [n_U,junk] = size(A_u); + U = zeros(n_U,1); + + ## Initialise saved U + UU = []; + + ## Create input basis functions + u_star_tau = ppp_ustar(A_u,1,Tau',0,0,n_u-n_U); + + ## Reverse time to get "previous" U + U_old = U; + + if (extras.simulate==1) + ## Set up globals for simulation + system_name_sim = system_name; + i_ppp_sim = i_ppp; + x_0_sim = x_0; + y_sim = []; # Junk + u_sim = []; # Junk + A_u_sim = A_u; + simpar_sim = simpar; + T_total = simpar.last; + endif + + for i = 0:N_ol # Main loop + printf("%i",i); + UU = [UU; U']; # Save control U + + if n_par>0 + par_est = pars(i_par(:,1)); + p = [p; par_est']; # Save up the estimated parameters + endif + + + if (extras.simulate==1) + [y_ol,u_ol] = ppp_RT_sim(U); # Simulate + else + [y_ol,u_ol] = ppp_RT(U); # Real thing + endif + + t_start = time; # Initialise time + + if (i==0) # Data is rubbish at i=0 - ignore + usleep(T_ol_0*1e6); # Hang about + else + ## Set up time information for the gathered data + n_ol = length(y_ol); # How many data points? + t_ol = [0:n_ol-1]'*dt; + T_ol = n_ol*dt; # Length of ol interval + t_open = [t_open;T_ol]; + + ## Generate input to actual system + u_star_t = ppp_ustar(A_u,1,t_ol',0,0,n_u-n_U); + + ## Tune parameters/states + if (estimating_parameters==1) + + ## Set up according to interval length + if (T_ol>T_ol_0) ## Truncate data + simpar_est.last = T_ol_0; + y_est = y_ol(1:n_t+1,:); + else + simpar_est.last = T_ol; + y_est = y_ol; + endif + + simpar_pred.last = T_ol_0; # Predicted length of next interval + pars(i_ppp(:,1)) = U_old; # Update the simulation ppp weights + + ## Optimise + tick = time; + [pars,Par,Error,Y,its] = \ + ppp_optimise(s_system_name,x_0_models,pars,simpar_est,u_star_t,y_est,i_par,Q,extras); + + if extras.visual + figure(11); + title("Parameter optimisation"); + II = [1:length(y_est)]; plot(II,y_est,"*", II,Y); + endif + + est_time = time-tick; + t_est = [t_est;est_time]; + its_est = [its_est; its-1]; + endif + + ## Update internal model + par(i_ppp(:,3)) = U_old; # Update the internal model ppp weights + + if (estimating_parameters==1) + par(i_par(:,3)) = pars(i_par(:,1)); # Update the internal model params + endif + + simpar_model.last = T_ol; + [y_model,x_model] = eval(sprintf("%s_sim(x_0_model, par, simpar_model, \ + u_star_t);",system_name)); + + x_0 = x_model(n_ol+1,:)'; # Initial state of next interval +## x_0 = x_model(n_ol-1,:)'; # Initial state of next interval + x_0_model = x_0; + x_0_models(1:2:(2*n_x)-1) = x_0_model; + + ## Compute U by optimisation + tick = time; + + ## Predict state at start of next interval + par(i_ppp(:,3)) = U; + [y_next,x_next] = eval(sprintf("%s_sim(x_0, par, simpar, \ + u_star_t);",system_name)); + x_next = x_next(n_t+1,:)'; # Initial state for next time + x_nexts(1:2:(2*n_x)-1) = x_next; # And for internal sensitivity model + + ## Optimize for next interval + U_old = U; # Save previous value + U = expm(A_u*T_ol)*U; # Initialise from continuation trajectory + pars(i_ppp(:,1)) = U; # Put initial value of U into the parameter vector + [U, U_all, Error, Y, its] = ppp_nlin(system_name,x_nexts,pars,simpars,u_star_tau,w_s,i_ppp,Q,extras); + if extras.visual + figure(12); + title("PPP optimisation"); + II = [1:length(w_s)]; plot(II,w_s,"*", II,Y); + figure(1); + endif + + ppp_time = time-tick; + t_ppp = [t_ppp;ppp_time]; + its_ppp = [its_ppp; its-1]; + + ## Total execution time + T_total = time - t_start; + if (extras.simulate==1)&&(extras.emulate_timing!=1) + printf("."); + T_diff = 0; # Always correct interval + else + T_diff = T_total - T_ol_0; # Compute difference + if T_diff<0 + printf("-"); + usleep(-T_diff*1e6); + T_total = time - t_start; + else + printf("+"); + endif + printf("%2.2f",T_total); + endif + T_total = simpar.dt*round(T_total/simpar.dt); # Whole no. of intervals + + pars(i_ppp(:,1)) = U; # Put final value of U into the parameter vector + + ## Save up data + y_ol = y_ol(1:n_ol,:); + y = [y; y_ol]; + u = [u; u_ol]; + t = [t; t_ol+t_last*ones(n_ol,1) ]; + t_last = t_last + T_ol; + + endif + + + if (extras.simulate==1) # Do the actual simulation + if (extras.emulate_timing==1) # Emulate timing + simpar_sim.last = T_total; # simulate for actual execution time + endif + ppp_RT_sim_compute (U_old); + endif + + endfor + printf("\n"); +endfunction ADDED mtt/lib/control/PPP/ppp_nlin_sim.m Index: mtt/lib/control/PPP/ppp_nlin_sim.m ================================================================== --- mtt/lib/control/PPP/ppp_nlin_sim.m +++ mtt/lib/control/PPP/ppp_nlin_sim.m @@ -0,0 +1,198 @@ +function [y,x,u,t,p,UU,UU_c,UU_l,t_ppp,t_est] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N_ol,extras) + + ## usage: [y,x,u,t,p,UU,UU_c,UU_l,t_ppp,t_est] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N_ol,extras) + ## + ## + + ## Simulate nonlinear PPP + ## Copyright (C) 2000 by Peter J. Gawthrop + + ## Defaults + if nargin<7 + extras.U_initial = "zero"; + extras.U_next = "continuation"; + extras.criterion = 1e-5; + extras.max_iterations = 10; + extras.v = 0.1; + extras.verbose = 0; + extras.estimate = 1; + endif + + + + ## Names + s_system_name = sprintf("s%s", system_name); + + ## System details -- defines simulation within ol interval + par = eval(sprintf("%s_numpar;", system_name)); + simpar = eval(sprintf("%s_simpar;", system_name)); + x_0 = eval(sprintf("%s_state(par);", system_name)); + [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name)); + + ## Sensitivity system details -- defines moving horizon simulation + simpars = eval(sprintf("%s_simpar;", s_system_name)); + pars = eval(sprintf("%s_numpar;", s_system_name)); + + ## Times + ## -- within opt horizon + n_Tau = round(simpars.last/simpars.dt); + dtau = simpars.dt; + Tau = [0:n_Tau-1]'*dtau; + [n_tau,n_w] = size(w_s); + tau = Tau(n_Tau-n_tau+1:n_Tau); + w = w_s(length(w_s)); # Final value of setpoint + + ## -- within ol interval + n_t = round(simpar.last/simpar.dt); + dt = simpar.dt; + t_ol = [0:n_t-1]'*dt; + T_ol = n_t*dt; + + ## Create input basis functions + [n_U,junk] = size(A_u); + + ## For moving horizon + eA = expm(A_u*dtau); + u_star_i = ones(n_U,1); + u_star_tau = []; + for i = 1:n_Tau + u_star_tau = [u_star_tau; u_star_i']; + u_star_i = eA*u_star_i; + endfor + + ## and for actual implementation + eA = expm(A_u*dt); + u_star_i = ones(n_U,1); + u_star_t = []; + for i = 1:n_t + u_star_t = [u_star_t; u_star_i']; + u_star_i = eA*u_star_i; + endfor + + if extras.verbose + title("U*(tau)") + xlabel("tau"); + plot(Tau,u_star_tau) + title("U*(t)") + xlabel("t_ol"); + plot(t_ol,u_star_t) + endif + + + ## Check number of inputs adjust if necessary + if n_u>n_U + disp(sprintf("Augmenting inputs with %i zeros", n_u-n_U)); + u_star_tau = [u_star_tau; zeros(n_u-n_U, n_Tau)]; + u_star_t = [u_star_t; zeros(n_u-n_U, n_t)]; + endif + + if n_u0 + [U, U_all, Error, Y] = ppp_nlin(system_name,x_0s,pars,simpars,u_star_tau,w_s,i_ppp,extras); + pars(i_ppp(:,1)) = U; # Put final value of U into the parameter vector + else + Error = []; + endif + ppp_time = time-tick; + t_ppp = [t_ppp;ppp_time]; + + ## Generate control + u_ol = u_star_t*U; # Not used - just for show + + ## Simulate system over one ol interval + par(i_ppp(:,3)) = pars(i_ppp(:,1)); # Update the simulation ppp weights + [y_ol,x_ol] = eval(sprintf("%s_sim(x_0, par, simpar, u_star_t);", system_name)); + + + ## Tune parameters/states + if (extras.estimate==1) + tick = time; + par_est = pars(i_par(:,1)); + p = [p; par_est']; + pars = ppp_optimise(s_system_name,x_0s,pars,simpar,u_star_t,y_ol,i_par,extras); + est_time = time-tick; + t_est = [t_est;est_time]; + endif + + x_0 = x_ol(n_t+1,:)'; # Extract state for next time + y_ol = y_ol(1:n_t,:); # Avoid extra points due to rounding error + x_ol = x_ol(1:n_t,:); # Avoid extra points due to rounding error + + + y = [y; y_ol]; + x = [x; x_ol]; + u = [u; u_ol]; + + UU = [UU; U']; + UU_l = [UU_l; U_l']; + UU_c = [UU_c; U_c']; + + t = [t; t_ol+t_last*ones(n_t,1) ]; + t_last = t_last + T_ol; + + + endfor + +endfunction ADDED mtt/lib/control/PPP/ppp_open2closed.m Index: mtt/lib/control/PPP/ppp_open2closed.m ================================================================== --- mtt/lib/control/PPP/ppp_open2closed.m +++ mtt/lib/control/PPP/ppp_open2closed.m @@ -0,0 +1,86 @@ +function [K_x T] = ppp_open2closed (A_u,A_c,k_x,x_0,Us0); + + ## usage: [K_x T] = ppp_open2closed (A_u,A_c,k_x,x_0[,Us0]); + ## K_x is the open-loop matrix as in U = K_w W - K_x x + ## Note that K_x is a column vector of matrices - one matrix per input. + ## T is the transformation matrix: x = T*Ustar; A_c = T*A_u*T^-1; U = (k_x*T)' + ## A_u: The control basis-function matrix + ## Us0: The initial value of Ustar + ## A_c: closed-loop system matrix + ## k_x: closed-loop feedback gain + ## x_0: initial state + ## Us0: initial basis fun state + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + + ## Check sizes + n_o = is_square(A_u); + n_c = is_square(A_c); + + if (n_o==0)||(n_c==0)||(n_o!=n_c) + error("A_u and A_c must be square and of the same dimension"); + endif + + [n_u,n_x] = size(k_x); + + ## Defaults + if nargin<4 + x_0 = zeros(n_c,1); + endif + + if nargin<5 #Create U*(0) + ##Us0 = ppp_ustar(A_u,n_u); + Us0 = ones(1,n_o); + endif + + + ## Decompose A_u and Us0 into two bits: + if n_o==n_c + A_w = []; + u_0 = Us0(1:n_c)'; # Assume same Us0 on each input + else + A_w = A_u(n_c+1:n_o, n_c+1:n_o) + A_u = A_u(1:n_c, 1:n_c) + U_w = Us0(1,n_c+1:n_o)' + u_0 = Us0(1:n_c)' + endif + + if !is_controllable(A_u,u_0) + error("The pair [A_u, u_0] must be controllable"); + endif + + ## Controllability matrices + C_o = u_0; + C_c = x_0; + for i=1:n_c-1 + C_o = [C_o A_u^i*u_0]; + C_c = [C_c A_c^i*x_0]; + endfor + + ## Transformation matrix: x = T*Ustar; A_c = T*A_u*T^-1; U = (k_x*T)' + iC_o = C_o^-1; + T = C_c*iC_o; + + K_x = []; + for j = 1:n_u + ## K_j matrix + K_j = []; + for i=1:n_c; + ## Create T_i = dT/dx_i + T_i = zeros(n_c,1); + T_i(i) = 1; + for k=1:n_c-1; + A_k = A_c^k; + T_i = [T_i A_k(:,i)]; + endfor + T_i = T_i*iC_o; + kj = k_x(j,:); # jth row of k_x + K_ji = kj*T_i; # ith row of K_j + K_j = [K_j; K_ji]; + endfor + K_x = [K_x; K_j']; + endfor + +endfunction ADDED mtt/lib/control/PPP/ppp_optimise.m Index: mtt/lib/control/PPP/ppp_optimise.m ================================================================== --- mtt/lib/control/PPP/ppp_optimise.m +++ mtt/lib/control/PPP/ppp_optimise.m @@ -0,0 +1,223 @@ +function [par,Par,Error,Y,iterations,x] = \ + ppp_optimise(system_name,x_0,par_0,simpar,u,y_0,free,Q,extras); + ## Levenberg-Marquardt optimisation for PPP/MTT + ## Usage: [par,Par,Error,Y,iterations,x] = ppp_optimise(system_name,x_0,par_0,simpar,u,y_0,free[,Q,extras]); + ## system_name String containing system name + ## x_0 Initial state + ## par_0 Initial parameter vector estimate + ## simpar Simulation parameters: + ## .first first time + ## .dt time increment + ## .stepfactor Euler integration step factor + ## u System input (column vector, each row is u') + ## y_0 Desired model output + ## free one row for each adjustable parameter + ## first column parameter indices + ## second column corresponding sensitivity indices + ## Q vector of positive output weights. + ## extras (opt) optimisation parameters + ## .criterion convergence criterion + ## .max_iterations limit to number of iterations + ## .v Initial Levenberg-Marquardt parameter + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.14 2002/08/20 16:14:35 gawthrop + ## Include Q in documentation + ## + ## Revision 1.13 2002/08/20 15:43:45 gawthrop + ## Works with ident DIY rep + ## + ## Revision 1.12 2002/06/11 11:25:25 gawthrop + ## No longer delay the simulated data. + ## + ## Revision 1.11 2002/05/20 13:32:36 gawthrop + ## Sanity check on y_0 + ## + ## Revision 1.10 2002/05/13 16:01:09 gawthrop + ## Addes Q weighting matrix + ## + ## Revision 1.9 2002/05/08 10:14:21 gawthrop + ## Idetification now OK (Moved data range in ppp_optimise by one sample interval) + ## + ## Revision 1.8 2002/04/23 17:50:39 gawthrop + ## error --> err to avoid name clash with built in function + ## + ## Revision 1.7 2001/08/10 16:19:06 gawthrop + ## Tidied up the optimisation stuff + ## + ## Revision 1.6 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ## Revision 1.5 2001/06/06 07:54:38 gawthrop + ## Further fixes to make nonlinear PPP work ... + ## + ## Revision 1.4 2001/05/26 15:46:38 gawthrop + ## Updated to account for new nonlinear ppp + ## + ## Revision 1.3 2001/04/05 11:50:12 gawthrop + ## Tidied up documentation + verbose mode + ## + ## Revision 1.2 2001/04/04 08:36:25 gawthrop + ## Restuctured to be more logical. + ## Data is now in columns to be compatible with MTT. + ## + ## Revision 1.1 2000/12/28 11:58:07 peterg + ## Put under CVS + ## + ############################################################### + + + ## Copyright (C) 1999,2000,2001,2002 by Peter J. Gawthrop + + ## Simulation command + sim_command = sprintf("%s_ssim(x_0,par,simpar,u,i_s);", system_name); + + ## Extract indices + i_t = free(:,1); # Parameters + i_s = free(:,2)'; # Sensitivities + + if nargin<9 + extras.criterion = 1e-5; + extras.max_iterations = 10; + extras.v = 1e-5; + extras.verbose = 0; + endif + + + [n_data,n_y] = size(y_0); + if n_dataextras.criterion)&&\ + (abs(err)>extras.criterion)&&\ + (iterations1 # Adjust the Levenberg-Marquardt parameter + reduction = err_old-err; + predicted_reduction = 2*J'*step + step'*JJ*step; + r = predicted_reduction/reduction; + if (r<0.25)||(reduction<0) + v = 4*v; + elseif r>0.75 + v = v/2; + endif + + if reduction<0 # Its getting worse + par(i_t) = par(i_t) + step; # rewind parameter + err = err_old; # rewind error + err_old = err_old_old; # rewind old error + if extras.verbose + printf(" Rewinding ....\n"); + endif + endif + endif + + ## Compute step using pseudo inverse + JJL = JJ + v*eye(n_th); # Levenberg-Marquardt term + step = pinv(JJL)*J; # Step size + par(i_t) = par(i_t) - step; # Increment parameters + err_old_old = err_old; # Save old error + err_old = err; # Save error + + ##Some diagnostics + Error = [Error err]; # Save error + Par = [Par par]; # Save parameters + Y = [Y y]; # Save output + + if extras.verbose # Diagnostics + printf("Iteration: %i\n", iterations); + printf(" error: %g\n", err); + printf(" reduction: %g\n", reduction); + printf(" prediction: %g\n", predicted_reduction); + printf(" ratio: %g\n", r); + printf(" L-M param: %g\n", v); + printf(" parameters: "); + for i_th=1:n_th + printf("%g ", par(i_t(i_th))); + endfor + printf("\n"); + endif + + + endwhile + +endfunction ADDED mtt/lib/control/PPP/ppp_output_constraint.m Index: mtt/lib/control/PPP/ppp_output_constraint.m ================================================================== --- mtt/lib/control/PPP/ppp_output_constraint.m +++ mtt/lib/control/PPP/ppp_output_constraint.m @@ -0,0 +1,80 @@ +function [Gamma,gamma] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau,Min,Max,Order,i_y) + + ## usage: [Gamma,gamma] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau,Min,Max,Order) + ## + ## Derives the output constraint matrices Gamma and gamma + ## For Constraints Min and Max at times Tau + ## Initial state x_0 + ## Order=0 - output constraints + ## Order=1 - output derivative constraints + ## etc + ## NOTE You can stack up Gamma and gamma matrices for create multi-output constraints. + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + ## Sizes + [n_x,n_u,n_y] = abcddim(A,B,C,D); # System dimensions + [n_U,m_U] = size(A_u); # Number of basis functions + [n,n_tau] = size(Tau); # Number of constraint times + + if n_tau==0 # Nothing to be done + Gamma = []; + gamma = []; + return + endif + + ## Defaults + if nargin<10 + Order = zeros(1,n_tau); + endif + + if nargin<11 + i_y = 1; # First output + endif + + if n != 1 + error("Tau must be a row vector"); + endif + + n = length(Min); + m = length(Max); + o = length(Order); + + if (n != n_tau)||(m != n_tau)||(o != n_tau) + error("Tau, Min, Max and Order must be the same length"); + endif + + + ## Compute Gamma + Gamma = []; + zero_x = zeros(size(x_0)); + for i=1:n_U + U = zeros(n_U,1); U(i,1) = 1; # Set up U_i + y_i = ppp_ystar (A,B,C,D,zero_x,A_u,U,Tau); # Compute y* for ith input for each tau + y_i = y_i(i_y,:); # Pluck out output i_y + ## Gamma = [Gamma [-y_i';y_i']]; # Put in parts for Min and max + Gamma_i = []; + if (Min>-inf) + Gamma_i = [Gamma_i; -y_i']; # Min part of column + endif + if (Max-inf) + gamma = [gamma; -(Min-y_x)']; + endif + if (Max1) + error("Tau must be a row vector"); + endif + + ##Defaults + if nargin<10 + Order=zeros(n_y,n_tau); + endif + + ## Stack up constraints for each output + Gamma=[]; + gamma=[]; + for i_y=1:n_y + [Gamma_i,gamma_i] = \ + ppp_output_constraint (A,B,C,D,x_0,A_u,Tau,\ + Min(i_y,:),Max(i_y,:),Order(i_y,:),i_y); + Gamma = [Gamma; Gamma_i]; + gamma = [gamma; gamma_i]; + endfor + +endfunction ADDED mtt/lib/control/PPP/ppp_pred.m Index: mtt/lib/control/PPP/ppp_pred.m ================================================================== --- mtt/lib/control/PPP/ppp_pred.m +++ mtt/lib/control/PPP/ppp_pred.m @@ -0,0 +1,31 @@ +function [A_p,B_p] = ppp_pred (A,B,C,D,A_u,Ust0,T) + + ## usage: [A_p,B_p] = ppp_pred (A,B,C,D,A_u,Ust0,T) + ## + ## PPP prediction matrices: x_pred = A_p*x + B_p*U + + ## Sanity + [n_x,n_u,n_y] = abcddim(A,B,C,D); # System dimensions + if (n_x==-1) + error("A B C D not compatible"); + endif + + n_U = issquare(A_u); + if (n_U!=n_x) + error(sprintf("A_u must be %ix%i",n_x,n_x)); + endif + + [nn,mm] = size(Ust0); + if (nn!=1)||(mm!=n_x) + error(sprintf("Ust0 must be 1x%i",n_x)); + endif + + Z = zeros(n_x,n_x); + AA = [A B*Ust0 + Z A_u']; + + eAA = expm(AA*T); + A_p = eAA(1:n_x,1:n_x); + B_p = eAA(1:n_x,n_x+1:2*n_x); + +endfunction ADDED mtt/lib/control/PPP/ppp_qp.m Index: mtt/lib/control/PPP/ppp_qp.m ================================================================== --- mtt/lib/control/PPP/ppp_qp.m +++ mtt/lib/control/PPP/ppp_qp.m @@ -0,0 +1,66 @@ +function [u,U,n_active] = ppp_qp (x,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma,mu,test) + + ## usage: [u,U] = ppp_qp (x,W,J_uu,J_ux,J_uw,Gamma,gamma) + ## INPUTS: + ## x: system state + ## W: Setpoint vector + ## J_uu,J_ux,J_uw: Cost derivatives (see ppp_lin) + ## Us0: value of U* at tau=0 (see ppp_lin) + ## Gamma, gamma: U constrained by Gamma*U <= gamma + ## mu Parameter of qp_mu + ## Outputs: + ## u: control signal + ## U: control weight vector + ## + ## Predictive pole-placement of linear systems using quadratic programming + ## Use ppp_input_constraint and ppp_output_constraint to generate Gamma and gamma + ## Use ppp_lin to generate J_uu,J_ux,J_uw + ## Use ppp_cost to evaluate resultant cost function + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + if nargin<9 + mu = 0 + endif + + if nargin<10 + test=0; + endif + + + ## Check the sizes + n_x = length(x); + + [n_U,m_U] = size(J_uu); + if n_U != m_U + error("J_uu must be square"); + endif + + [n,m] = size(J_ux); + if (n != n_U)||(m != n_x) + error("J_ux should be %ix%i not %ix%i",n_U,n_x,n,m); + endif + + + if length(gamma)>0 # Constraints exist: do the QP algorithm + ## QP solution for weights U +## [U,iterations] = qp_mu(J_uu,(J_ux*x-J_uw*W),Gamma,gamma,mu,[],[],0,test); + [U,n_active] = qp_hild(J_uu,(J_ux*x - J_uw*W),Gamma,gamma); # +## iterations = 0; + + ##U = qp(J_uu,(J_ux*x - J_uw*W),Gamma,gamma); # QP solution for weights U + ##U = pd_lcp04(J_uu,(J_ux*x - J_uw*W),Gamma,gamma); # QP solution for weights U + u = Us0*U; # Control signal + else # Do the unconstrained solution + ## Compute the open-loop gains + n_active = 0; + K_w = J_uu\J_uw; + K_x = J_uu\J_ux; + + ## Closed-loop control + U = K_w*W - K_x*x; # Basis functions weights - U(t) + u = Us0*U; # Control u(t) + endif + +endfunction ADDED mtt/lib/control/PPP/ppp_qp_sim.m Index: mtt/lib/control/PPP/ppp_qp_sim.m ================================================================== --- mtt/lib/control/PPP/ppp_qp_sim.m +++ mtt/lib/control/PPP/ppp_qp_sim.m @@ -0,0 +1,153 @@ +function [T,y,u,X,Iterations] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q,R,P,\ + Tau_u,Min_u,Max_u,Order_u, \ + Tau_y,Min_y,Max_y,Order_y, \ + W,x_0,Delta_ol,mu,test,movie) + + ## usage: [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, Tau_u,Min_u,Max_u,Order_u, Tau_y,Min_y,Max_y,Order_y, W,x_0,movie) + ## Needs documentation - see ppp_ex11 for example of use. + ## OUTPUTS + ## T: Time vector + ## y,u,J output, input and cost + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + if nargin<21 # No intermittent control + Delta_ol = 0; + endif + + if nargin<22 # Mu + mu = 0; + endif + + if nargin<23 + test=0 + endif + + if nargin<24 # No movie + movie = 0; + endif + +test = test + ## Check some sizes + [n_x,n_u,n_y] = abcddim(A,B,C,D); + + [n_x0,m_x0] = size(x_0); + if (n_x0 != n_x)||(m_x0 != 1) + error(sprintf("Initial state x_0 must be %ix1 not %ix%i",n_x,n_x0,m_x0)); + endif + + ## Input constraints + [Gamma_u, gamma_u] = ppp_input_constraints(A_u,Tau_u,Min_u,Max_u); + + ## Output constraints + [Gamma_y,gamma_y] = ppp_output_constraints(A,B,C,D,x_0,A_u,Tau_y,Min_y,Max_y,Order_y); + + ## Composite constraints - t=0 + Gamma = [Gamma_u; Gamma_y]; + gamma = [gamma_u; gamma_y]; + + ## Design the controller + ## disp("Designing controller"); + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww] = ppp_lin (A,B,C,D,A_u,A_w,t,Q,R,P); + + ## Set up various time vectors + dt = t(2)-t(1); # Time increment + + ## Make sure Delta_ol is multiple of dt + Delta_ol = floor(Delta_ol/dt)*dt; + + if Delta_ol>0 # Intermittent control + T_ol = 0:dt:Delta_ol; # Create the open-loop time vector + else + T_ol = [0,dt]; + Delta_ol = dt; + endif + t_last = t(length(t)); + T_cl = 0:Delta_ol:2*t_last-Delta_ol; # Closed-loop time vector + T = 0:dt:2*t_last; # Overall time vector + + ## Lengths thereof + n_Tcl = length(T_cl); + n_ol = length(T_ol); + n_T = length(T); + + ## Expand W with constant last value or truncate + [n_W,m_W] = size(W); + + if m_W>n_T + W = W(:,1:n_T); + else + W = [W W(:,m_W)*ones(1,n_T-m_W+1)]; + endif + + ## Compute U* + Ustar_ol = ppp_ustar(A_u,n_u,T_ol); # U* in the open-loop interval + + [n,m] = size(Ustar_ol); + n_U = m/length(T_ol); # Determine size of each Ustar + +# ## Discrete-time system +# csys = ss2sys(A,B,C,D); +# dsys = c2d(csys,dt); +# [Ad, Bd] = sys2ss(dsys) + + x = x_0; # Initialise state + + ## Initialise the saved variable arrays + X = []; + u = []; + Iterations = []; + du = []; + J = []; + tick= time; + + ## disp("Simulating ..."); + for t=T_cl # Outer loop at Delta_ol + printf("%g\r",t); + ##disp(sprintf("Time %g", t)); + ## Output constraints + [Gamma_y,gamma_y] = ppp_output_constraints (A,B,C,D,x,A_u,Tau_y,Min_y,Max_y,Order_y); + + ## Composite constraints + Gamma = [Gamma_u; Gamma_y]; + gamma = [gamma_u; gamma_y]; + + ## Current Setpoint value + w = W(:,floor(t/dt)+1); + + ## Compute U(t) via QP optimisation + [uu, U, iterations] = ppp_qp (x,w,J_uu,J_ux,J_uw,Us0,Gamma,gamma,mu,test); # Compute U + + ## Compute the cost (not necessary but maybe interesting) +# [J_t] = ppp_cost (U,x,W,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww); # cost +# J = [J J_t]; + + ## OL Simulation (exact) + [ys,us,xs] = ppp_ystar (A,B,C,D,x,A_u,U,T_ol); + + ## Save values (discarding final ones) + X = [X xs(:,1:n_ol-1)]; # save state + u = [u us(:,1:n_ol-1)]; # save input + Iterations = [Iterations iterations*ones(1,n_ol-1)]; + + ## Final values + x = xs(:,n_ol); # Final state + ut = us(:,n_ol); # Final control + + endfor + + ## Save the last values + X = [X x]; # Save state + u = [u ut]; # Save input + Iterations = [Iterations iterations]; # Save iteration count + + tock = time; + Elapsed_Time = tock-tick; + y = C*X + D*u; # System output + + +endfunction + + + ADDED mtt/lib/control/PPP/ppp_sim.m Index: mtt/lib/control/PPP/ppp_sim.m ================================================================== --- mtt/lib/control/PPP/ppp_sim.m +++ mtt/lib/control/PPP/ppp_sim.m @@ -0,0 +1,54 @@ +function [y,y_s] = ppp_sim (system_name,x_0,u,t,par,i_s,external) + + ## mtt_sim: Simulates system sensitivity functions. + ## usage: [y,y_s] = ppp_sim (system_name,x_0,u,t,par,i_s) + ## system_name string containing name of the sensitivity system + ## x_0 initial state + ## u system input (one input per row) + ## t row vector of time + ## par system parameter vector + ## i_s indices of sensitivity parameters + + + if nargin<7 + external = 0; + endif + + ## Some sizes + n_s = length(i_s); + n_t = length(t); + + + for i = 1:n_s + + ## Set sensitivity parameters + par(i_s(i)) = 1.0; + par(complement(i_s(i),i_s)) = 0; + + if external + par_string = ""; + for i_string=1:length(par) + par_string = sprintf("%s %s", par_string, num2str(par(i_string))); + endfor + data_string = system(sprintf("./%s_ode2odes.out %s | cut -f 2-%i", \ + system_name, par_string, 1+n_s)); + Y = str2num(data_string)'; + else + Y = eval(sprintf("%s_sim(x_0,u,t,par);", system_name)); + endif + + [n_Y,m_Y] = size(Y); + n_y = n_Y/2; + if i==1 + y = Y(1:2:n_Y,:); # Save up the output + y_s = zeros(n_s*n_y, n_t); # Initialise for speed + endif + + y_s((i-1)*n_y+1:i*n_y,:) = Y(2:2:n_Y,:); # Other sensitivities + + endfor + +title(""); +plot(t,y); + +endfunction ADDED mtt/lib/control/PPP/ppp_sm2sr.m Index: mtt/lib/control/PPP/ppp_sm2sr.m ================================================================== --- mtt/lib/control/PPP/ppp_sm2sr.m +++ mtt/lib/control/PPP/ppp_sm2sr.m @@ -0,0 +1,69 @@ +function [Y,X] = ppp_sm2sr(A,B,C,D,T,u0,x0); + ## Usage [Y,X] = ppp_sm2sr(A,B,C,D,T,u0,x0); + ## Computes a step response + ## A,B,C,D- state matrices + ## T vector of time points + ## u0 input gain vector: u = u0*unit step. + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + [Ny,Nu] = size(D); + [Ny,Nx] = size(C); + + if nargin<6 + u0 = zeros(Nu,1); + u0(1) = 1; + end; + + if nargin<7 + x0 = zeros(Nx,1); + end; + + [N,M] = size(T); + if M>N + T = T'; + N = M; + end; + + + + one = eye(Nx); + + Y = zeros(Ny,N); + X = zeros(Nx,N); + + dt = T(2)-T(1); # Assumes fixed interval + expAdt = expm(A*dt); # Compute matrix exponential + i = 0; + expAt = one; + + DoingStep = max(abs(u0))>0; # Is there a step component? + DoingInitial = max(abs(x0))>0; # Is there an initial component? + for t = T' + i=i+1; + if Nx>0 + x = zeros(Nx,1); + if DoingStep + x = x + ( A\(expAt-one) )*B*u0; + endif + if DoingInitial + x = x + expAt*x0; + endif + + expAt = expAt*expAdt; + + X(:,i) = x; + if Ny>0 + y = C*x + D*u0; + Y(:,i) = y; + endif + elseif Ny>0 + y = D*u0; + Y(:,i) = y; + endif + endfor + + +endfunction + ADDED mtt/lib/control/PPP/ppp_ustar.m Index: mtt/lib/control/PPP/ppp_ustar.m ================================================================== --- mtt/lib/control/PPP/ppp_ustar.m +++ mtt/lib/control/PPP/ppp_ustar.m @@ -0,0 +1,74 @@ +function Ustar = ppp_ustar (A_u,n_u,tau,order,packed,n_zero) + + ## usage: Us = ppp_ustar(A_u,n_u,tau,order,packed) + ## + ## Computes the U* matrix at time tau in terms of A_u + ## n_u : Number of system inputs + ## If tau is a vector, computes U* at each tau and puts into a row vector: + ## If packed==1 + ## Ustar = [Ustar(tau_1) Ustar(tau_2) ...] + ## else Ustar = [Ustar(tau_1); Ustar(tau_2) ...] + ## n_zero extra zero columns appended + + ## Copyright (C) 1999 by Peter J. Gawthrop + ## $Id$ + + if nargin<2 + n_u = 1; + endif + + if nargin<3 + tau = 0; + endif + + if nargin<4 + order = 0; + endif + + if nargin<5 + packed=1; + endif + + if nargin<6 + n_zero=0; + endif + + + [n,m] = size(A_u); # Size of composite A_u matrix + N = m; # Number of U* functions per input + nm = n/m; + + if (nm != n_u)&&(n!=m) # Check consistency + error("A_u must be square or be a column of square matrices"); + endif + + u_0 = ones(N,1); + + Ustar = []; + for t = tau; + ustar = []; + for i = 1:n_u + A_i = ppp_extract(A_u,i); + Ak = A_i^order; + eA = expm(A_i*t); + if (packed==1) + ustar = [ustar; zeros(1,(i-1)*N), (Ak*eA*u_0)', \ + zeros(1,(n_u-i)*N)]; + else + ustar = [ustar, (Ak*eA*u_0)']; + endif + endfor + + if (packed==1) + Ustar = [Ustar ustar]; + else + Ustar = [Ustar; ustar]; + endif + endfor + + if (n_zero>0) + [N,M] = size(Ustar); + Ustar = [Ustar zeros(N, n_zero)]; + endif + +endfunction ADDED mtt/lib/control/PPP/ppp_ustar2h.m Index: mtt/lib/control/PPP/ppp_ustar2h.m ================================================================== --- mtt/lib/control/PPP/ppp_ustar2h.m +++ mtt/lib/control/PPP/ppp_ustar2h.m @@ -0,0 +1,61 @@ +function ppp_ustar2h (Ustar,DT,name) + + ## usage: ppp_Ustar2h (Ustar[,name]) + ## + ## + + if nargin<2 + DT = 1; + endif + + if nargin<3 + name = "Ustar"; + endif + + [N,N_U] = size(Ustar); + + ## Open the file + filename = sprintf("%s.h", name); + fid = fopen(filename,"w"); + + ## Header + header = sprintf("/*\n File %s generated by ppp_ustar2h on %s */\n", \ + filename, ctime(time)); + + def = sprintf("#define N_U %i\n#define N_T %i\n#define DT %g\n", \ + N_U, N, DT); + def = sprintf("%sdouble U[N_U]={",def); + for j=1:N_U + if j0) + [n_x,n_u,n_y] = abcddim(A,B,C,D); # System dimensions + else + n_x = 0; + n_y = 0; + n_u = 0; + endif + + no_system = n_x==0; + + [n,m] = size(A_u); # Size of composite A_u matrix + square = (n==m); # Is A_u square? + n_U = m; # functions per input + + [n,m] = size(U); + if (m != 1) + error("U must be a column vector"); + endif + + if n_u>0 + if n_u!=length(U)/n_U + error("U must be a column vector with n_u*n_U components"); + endif + else + n_u = length(U)/n_U; # Deduce n_u from U if no system + endif + + [n_x0,m_x0] = size(x_0); + if n_x0!=n_x + error(sprintf("x_0 must be a column with length %i", n_x)); + endif + + + [n,m]=size(tau); + if (n != 1 ) + error("tau must be a row vector of times"); + endif + + if nargin<9 + Us0 = ones(1,n_U); + endif + + [n_Us0,m_Us0] = size(Us0); + if (n_Us0>1)||(n_Us0>m_Us0) + error(sprintf("Us0 must be a row vector, not %ix%i ",n_Us0,m_Us0)); + endif + + + if square # Then same A_u for each input + ## Reorganise vector U into matrix Utilde + Utilde = []; + for i=1:n_u + j = (i-1)*n_U; + range = j+1:j+n_U; + Utilde = [Utilde; U(range,1)']; + endfor + + ## Composite A matrix + if no_system + AA = A_u; + else + Z = zeros(n_U,n_x); + AA = [A B*Utilde + Z A_u]; + endif + + xx_0 = [x_0;Us0']; # Composite initial condition + else # Different A_u on each input + ## Reorganise vector U into matrix Utilde + Utilde = []; + for i=1:n_u + j = (i-1)*n_U; + k = (n_u-i)*n_U; + range = j+1:j+n_U; + Utilde = [Utilde; zeros(1,j), U(range,1)', zeros(1,k)]; + endfor + + ## Create the full A_u matrix (AA_u) with the A_i s on the diagonal +# AA_u = []; +# for i = 1:n_u +# AA_u = ppp_aug(AA_u,ppp_extract(A_u,i)); +# endfor + AA_u = ppp_inflate(A_u); + + ## Composite A matrix + if no_system + AA = AA_u; + else + Z = zeros(n_U*n_u,n_x); + AA = [A B*Utilde + Z AA_u]; + endif + xx_0 = [x_0;ones(n_U*n_u,1)]; # Composite initial condition + endif + + + ## Initialise + xs = []; # x star + xu = []; # x star + ys = []; # y star + us = []; # u star + n_xx = length(xx_0); # Length of composite state + + ## Compute the star variables + for t=tau + xxt = expm(AA*t)*xx_0; # Composite state + xst = xxt(1:n_x); # x star + xut = xxt(n_x+1:n_xx); # x star + if length(C)>0 + yst = C*xst; # y star + else + yst = []; + endif + + ust = Utilde*xut; # u star + + xs = [xs xst]; # x star + xu = [xu xut]; # x star + ys = [ys yst]; # y star + us = [us ust]; # u star + endfor + +endfunction ADDED mtt/lib/control/PPP/rpv.m Index: mtt/lib/control/PPP/rpv.m ================================================================== --- mtt/lib/control/PPP/rpv.m +++ mtt/lib/control/PPP/rpv.m @@ -0,0 +1,28 @@ +function [A,B,C,D] = rpv +% System RPV +% This system is the remotely-piloted vehicle example from the book: +% J.M Maciejowski: Multivariable Feedback Design Addison-Wesley, 1989 +% It has 6 states, 2 inputs and 2 outputs. + +% P J Gawthrop Jan 1998 + +A = [-0.0257 -36.6170 -18.8970 -32.0900 3.2509 -0.7626 + 0.0001 -1.8997 0.9831 -0.0007 -0.1780 -0.0050 + 0.0123 11.7200 -2.6316 0.0009 -31.6040 22.3960 + 0 0 1.0000 0 0 0 + 0 0 0 0 -30.0000 0 + 0 0 0 0 0 -30.0000]; + +B = [0 0 + 0 0 + 0 0 + 0 0 + 30 0 + 0 30]; + +C = [0 1 0 0 0 0 + 0 0 0 1 0 0]; + +D = zeros(2,2); + + ADDED mtt/lib/control/PPP/tgen.m Index: mtt/lib/control/PPP/tgen.m ================================================================== --- mtt/lib/control/PPP/tgen.m +++ mtt/lib/control/PPP/tgen.m @@ -0,0 +1,28 @@ +function [A,B,C,D] = tgen +% System TGEN from +% This system is the turbogenerator example from the book: +% J.M Maciejowski: Multivariable Feedback Design Addison-Wesley, 1989 +% It has 6 states, 2 inputs and 2 outputs. + +% P J Gawthrop Jan 1998 + +A = [-18.4456 4.2263 -2.2830 0.2260 0.4220 -0.0951 + -4.0977 -6.0706 5.6825 -0.6966 -1.2246 0.2873 + 1.4449 1.4336 -2.6477 0.6092 0.8979 -0.2300 + -0.0093 0.2302 -0.5002 -0.1764 -6.3152 0.1350 + -0.0464 -0.3489 0.7238 6.3117 -0.6886 0.3645 + -0.0602 -0.2361 0.2300 0.0915 -0.3214 -0.2087]; + +B = [-0.2748 3.1463 + -0.0501 -9.3737 + -0.1550 7.4296 + 0.0716 -4.9176 + -0.0814 -10.2648 + 0.0244 13.7943]; + +C = [0.5971 -0.7697 4.8850 4.8608 -9.8177 -8.8610 + 3.1013 9.3422 -5.6000 -0.7490 2.9974 10.5719]; + +D = zeros(2,2); + + ADDED mtt/lib/control/PPP/transient.m Index: mtt/lib/control/PPP/transient.m ================================================================== --- mtt/lib/control/PPP/transient.m +++ mtt/lib/control/PPP/transient.m @@ -0,0 +1,27 @@ +function X = transient (t,A,x_0) + + ## usage: L = transient (t,p,order) + ## + ## Computes transient response for time t with initial condition x_0 + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.1 1999/04/27 04:46:05 peterg + ## Initial revision + ## + ## Revision 1.1 1999/04/25 23:19:40 peterg + ## Initial revision + ## + ############################################################### + + +X=[]; + for tt=t # Create the Transient up to highest order + x = expm(A*tt)*x_0; + X = [X x]; + endfor + +endfunction ADDED mtt/lib/cr/hh/ISW.hh Index: mtt/lib/cr/hh/ISW.hh ================================================================== --- mtt/lib/cr/hh/ISW.hh +++ mtt/lib/cr/hh/ISW.hh @@ -0,0 +1,6 @@ +#ifndef ISW_HH +#define ISW_HH + +// dummy file + +#endif // ISW_H ADDED mtt/lib/cr/hh/SS.hh Index: mtt/lib/cr/hh/SS.hh ================================================================== --- mtt/lib/cr/hh/SS.hh +++ mtt/lib/cr/hh/SS.hh @@ -0,0 +1,6 @@ +#ifndef SS_HH +#define SS_HH + +// dummy file + +#endif // SS_H ADDED mtt/lib/cr/hh/causality.hh Index: mtt/lib/cr/hh/causality.hh ================================================================== --- mtt/lib/cr/hh/causality.hh +++ mtt/lib/cr/hh/causality.hh @@ -0,0 +1,8 @@ +#ifndef CAUSALITY_HH +#define CAUSALITY_HH + +enum causality { effort, flow, state }; + +typedef enum causality causality_t; + +#endif ADDED mtt/lib/cr/hh/components.hh Index: mtt/lib/cr/hh/components.hh ================================================================== --- mtt/lib/cr/hh/components.hh +++ mtt/lib/cr/hh/components.hh @@ -0,0 +1,14 @@ +#ifndef COMPONENTS_HH +#define COMPONENTS_HH + +// $ cd $(echo $MTT_COMPONENTS/simple | sed 's/\.://') +// $ ls *_eqn.m | gawk -F_ '{printf ("%s, ", $1)}' +enum component { + AE, AF, C, EBTF, EMTF, ES, FMR, FP, GY, I, PS, RST, RS, R, SS, TF, + ae, af, c, ebtf, emtf, es, fmr, fp, gy, i, ps, rst, rs, r, ss, tf +}; + +typedef enum component component_t; + + +#endif ADDED mtt/lib/cr/hh/constants.hh Index: mtt/lib/cr/hh/constants.hh ================================================================== --- mtt/lib/cr/hh/constants.hh +++ mtt/lib/cr/hh/constants.hh @@ -0,0 +1,12 @@ +#ifndef CONSTANTS_HH +#define CONSTANTS_HH + +const double pi = 3.14159264; +const double pi2 = pi * pi; +const double pi4 = pi2 * pi2; + +// Reynolds number +const double ReL = 2300.0; // transition from laminar flow +const double ReT = 4000.0; // transition to turbulent flow + +#endif // CONSTANTS ADDED mtt/lib/cr/hh/fade.hh Index: mtt/lib/cr/hh/fade.hh ================================================================== --- mtt/lib/cr/hh/fade.hh +++ mtt/lib/cr/hh/fade.hh @@ -0,0 +1,43 @@ +#ifndef FADE_HH +#define FADE_HH + +#include // tanh + +#include "constants.hh" // pi + +inline double +fade(const double x, + const double x1, + const double x2, + const double y1, + const double y2) +{ + /* fades two functions together smoothly over the range x1 to x2 + * function does not check that x2 > x1 + */ + double theta; + theta = (x - x1) / (x2 - x1); // map (linear) {x1 , x2 } => {0 , +1 } + theta = (theta - 0.5) * 2.0 * pi; // map (linear) {0 , +1 } => {-Pi , +Pi} + theta = tanh(theta); // map (non-linear) {-Pi , +Pi} => {-1 , +1 } + theta = (theta + 1.0) / 2.0; // map (linear) {-1 , +1 } => {0 , +1 } + + return (theta * y1 + (1.0 - theta) * y2); +} + +inline double +chkfade(const double x, + const double x1, + const double x2, + const double y1, + const double y2) +{ + double X1 = x1, X2 = x2; + if (x1 > x2) { + std::cerr << "* Warning: chkfade; x2 > x1, swapping" << std::endl; + X1 = x2; + X2 = x1; + } + return ((x <= X1) ? y1 : (x > X2) ? y2 : fade(x, X1, X2, y1, y2)); +} + +#endif // FADE_HH ADDED mtt/lib/cr/hh/frictionfactor.hh Index: mtt/lib/cr/hh/frictionfactor.hh ================================================================== --- mtt/lib/cr/hh/frictionfactor.hh +++ mtt/lib/cr/hh/frictionfactor.hh @@ -0,0 +1,33 @@ +#ifndef FRICTIONFACTOR_HH +#define FRICTIONFACTOR_HH + +#include +#include + +#include "constants.hh" // ReL, ReT +#include "fade.hh" + +inline double +frictionfactor(const double Re, const double r) { + if (0.0 == Re) { + return 0.0; + } + else if (ReL >= Re) { // laminar flow + return 16.0 / Re; // using k = 4.f.(l/d) + } else if (ReT <= Re) { // turbulent flow + /* S.E.Haaland + * Simple and explicit formulas for the friction factor in turbulent pipe flow + * Journal of Fluids Engineering, 105 (1983) + */ + double A = 6.91 / Re; + double B = pow((r / 3.71), 1.11); + double f = pow(-3.6 * log10(A + B), -2); + return f; + } else { // transition region + double ffL = frictionfactor(ReL, r); + double ffT = frictionfactor(ReT, r); + return fade(Re, ReL, ReT, ffL, ffT); + } +} + +#endif // FRICTIONFACTOR_HH ADDED mtt/lib/cr/hh/kinematicviscosity.hh Index: mtt/lib/cr/hh/kinematicviscosity.hh ================================================================== --- mtt/lib/cr/hh/kinematicviscosity.hh +++ mtt/lib/cr/hh/kinematicviscosity.hh @@ -0,0 +1,61 @@ +#ifndef KINEMATICVISCOSITY_HH +#define KINEMATICVISCOSITY_HH + +#include // pow +#include + +inline double +kerosenekinematicviscosity(const double T) + /* + * B.S.Massey + * Mechanics of fluids + * ISBN: 0 412 34280 4 + * log-log plot of kinematic viscosity versus temperature is linear for kerosene + * L(n) = log10(n) + * + * T = 0 deg C : nu = 4.0 mm2/s + * T = 100 deg C : nu = 0.9 mm2/s + * + * deg C => K, mm2/s => m2/s + * + * T1 = 273.15 : nu1 = 4.0e-6 m2/s + * T2 = 373.15 : nu2 = 0.9e-6 m2/s + * + * L(nu) = m L(T) + c + * + * m = (L(nu2) - L(nu1)) / (L(T2) - L(T1)) + * = L(nu2/nu1) / L(T2/T1) + * = L(0.9/4.0) / L(373.15/273.15) + * = -4.781567507 + * + * c = L(nu1) - m * L(T1) + * = L(4.0e-6) - m * L(273.15) + * = 6.251876827 + * + * nu {m2/s} = 10^(m * L(T {Kelvin}) + c) + * + * = 10^(m * L(T) + c) + * = 10^c * (10^L(T))^m + * = 10^c * T^m + * + * 10^c = 1.78598097e6 + * + * nu = 1.78598097e6 * T^(-4.781567507) + */ +{ + return 1.79e6 * pow(T, -4.78); +} + +inline double +kinematicviscosity(const std::string fluid, + const double T) +{ + if ("kerosene" == fluid) { + return kerosenekinematicviscosity(T); + } else { + std::cerr << __FILE__ << ": fluid \"" << fluid << "\" unknown" << std::endl; + exit(-1); + } +} + +#endif // KINEMATICVISCOSITY_HH ADDED mtt/lib/cr/hh/lin.hh Index: mtt/lib/cr/hh/lin.hh ================================================================== --- mtt/lib/cr/hh/lin.hh +++ mtt/lib/cr/hh/lin.hh @@ -0,0 +1,129 @@ +#ifndef LIN_HH +#define LIN_HH + +#include + +#include "causality.hh" +#include "components.hh" +// translated from lin.cr + +// one 2-port, R/C/I; two 2-port, TF/GY +inline double +lin(const component_t type, + // parameters + const causality_t gain_causality, + const double gain, + // output + const causality_t out_causality, + const int out_port, + // input + const double input, + const causality_t in_causality, + const int in_port) +{ + if (out_port == in_port) { // R/C/I + if (gain_causality == in_causality) { + return input * gain; + } else { + return input / gain; + } + } else { // GY/TF + if (out_causality == in_causality) { // gyrator + if ((out_port == 1 && out_causality != gain_causality) + ||(out_port == 2 && out_causality == gain_causality)) { + return input * gain; + } else { + return input / gain; + } + } else { // transformer + if (out_causality == gain_causality) { + return input * gain; + } else { + return input / gain; + } + } + } +} + +// two 2-port, AE/AF +inline double +lin(const component_t type, + // parameters + const double gain, + // output + const causality_t out_causality, + const int out_port, + // input + const double input, + const causality_t in_causality, + const int in_port) +{ + return + (out_port == 1) ? input * gain : + input / gain; +} + + + + +// three 2-port, FMR +inline double +lin(const component_t type, + // parameters + const causality_t gain_causality, + const double gain, + // output + const causality_t out_causality, + const int out_port, + // input + const double input, + const causality_t in_causality, + const int in_port, + const double modulation, + const causality_t mod_causality, + const int mod_port) +{ + if (mod_causality == flow) { // uni-causal + if (out_port == 2) { + return 0; + } else { + double k = 1.0; + if (gain_causality == in_causality) { + k *= gain; + } else { + k /= gain; + } + if (in_causality == effort) { + k *= modulation; + } else { + k /= modulation; + } + return input * k; + } + } else { // bi-causal + if ((in_causality == effort) + &&(mod_causality == flow) + &&(gain_causality == effort) + &&(in_port == 1) + &&(mod_port == 1)) { + return (input / modulation) / gain; + } else { + + // three 2-port, EMTF + + if ((out_causality == gain_causality && out_port == 2) + ||(out_causality != gain_causality && out_port == 1)) { + return input * gain * modulation; + } else if((out_causality != gain_causality && out_port == 2) + ||(out_causality == gain_causality && out_port == 1)) { + return input / (gain * modulation); + } else { + std::cerr << "* Error: __FILE__ does not cover this case" << std::endl; + exit(-1); + } + } // EMTF + } // bi-causal +} + + +#endif // LIN_HH ADDED mtt/lib/cr/hh/pressuredrop.hh Index: mtt/lib/cr/hh/pressuredrop.hh ================================================================== --- mtt/lib/cr/hh/pressuredrop.hh +++ mtt/lib/cr/hh/pressuredrop.hh @@ -0,0 +1,49 @@ +#ifndef PRESSUREDROP_HH +#define PRESSUREDROP_HH + +#include // fabs, pow +#include + +#include "causality.hh" +#include "constants.hh" +#include "frictionfactor.hh" +#include "kinematicviscosity.hh" +#include "sign.hh" + +inline double +pressuredrop(const std::string fluid, + const double d, + const double l, + const double r, + const double rho, + const double T, + const double Q) +{ + double nu = kinematicviscosity(fluid, T); + double Re = 4.0 * fabs(Q) / (pi * d * nu); + double f = frictionfactor(Re, r); + double k = 4.0 * f * l / d; + double dP = k * 8.0 * rho * pow(Q, 2) / (pi2 * pow(d, 4)); + return (dP * sign(Q)); +} + +inline double +pressuredrop(const std::string fluid, + const double d, + const double l, + const double r, + const double rho, + const double T, + const causality_t effort_causality, const int port, + const double Q, const causality_t flow_causality, const int port_in) +{ + + /* assert(effort == causality); + * assert(flow == causality_in); + * assert(1 == port_in); + * assert(1 == port); + */ + return pressuredrop(fluid, d, l, r, rho, T, Q); +} + +#endif // PRESSUREDROP_HH ADDED mtt/lib/cr/hh/sign.hh Index: mtt/lib/cr/hh/sign.hh ================================================================== --- mtt/lib/cr/hh/sign.hh +++ mtt/lib/cr/hh/sign.hh @@ -0,0 +1,13 @@ +#ifndef SIGN_HH +#define SIGN_HH + +template +inline int +sign(T x) +{ + return ((x > 0) ? +1 : + (x < 0) ? -1 : + 0); +} + +#endif // SIGN_HH ADDED mtt/lib/cr/hh/squarelaw.hh Index: mtt/lib/cr/hh/squarelaw.hh ================================================================== --- mtt/lib/cr/hh/squarelaw.hh +++ mtt/lib/cr/hh/squarelaw.hh @@ -0,0 +1,24 @@ +#ifndef SQUARELAW_HH +#define SQUARELAW_HH + +#include // log, pow + +#include "causality.hh" +#include "constants.hh" + +inline double +staticpressure(const double beta, + const double C_d, + const double d, + const double P_ref, + const double rho, + const causality_t causality, const int port, + const double Q1, const causality_t causality1, const int port1, + const double Q2, const causality_t causality2, const int port2) +{ + static double P; + if (0.0 != Q1 && 0.0 != Q2) { + double num = pi2 * pow(d, 4) * log(Q1 / Q2); + double den = 8.0 * beta * rho * Q1 * (Q2 - Q1 + C_d * (Q1 + Q2) / 2.0); + P = P_ref + log(num / den)/beta; + } + return P; +} + +#endif // STATICPRESSUE_HH ADDED mtt/lib/cr/perl/Density.pm Index: mtt/lib/cr/perl/Density.pm ================================================================== --- mtt/lib/cr/perl/Density.pm +++ mtt/lib/cr/perl/Density.pm @@ -0,0 +1,156 @@ +#------------------------------------------------------------------------------- +# Model Transformation Tools +#------------------------------------------------------------------------------- + + +package mtt::Density; + +#------------------------------------------------------------------------------- +# linear constitutive relationship with cosine modulation +#------------------------------------------------------------------------------- + +use strict; +use warnings; + +#------------------------------------------------------------------------------- +# standard module header (see perlmod for explanation) +#------------------------------------------------------------------------------- +BEGIN { + use Exporter (); + our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION = 1.00; + + @ISA = qw(Exporter); + @EXPORT = qw(&Density); # CR name + %EXPORT_TAGS = ( ); +} + +#------------------------------------------------------------------------------- +# declaration of specific component implementations +#------------------------------------------------------------------------------- +sub Density_r(@); # R + +#------------------------------------------------------------------------------- +# main function: selects which subfunction to call +#------------------------------------------------------------------------------- +sub Density (@) { + + my $retval; + + $_ = $_[0]; + + s/\((.*)\)/$1/; # strip brackets + my @args = split (/,/); # split arguments + + $_ = $args[0]; # get component type + + # select rule to use + if (/^R|r$/) { $retval = Density_r (@args); } + + # if a substitution has been made ($retval) + if ($retval) + { + return $retval; # return substituted expression + } + else # return nothing + { + return; + } +} + +#------------------------------------------------------------------------------- +# R +#------------------------------------------------------------------------------- +sub Density_r (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 15-1) + { + if ($args[2] eq 'ideal_gas') + { + my ($component, + $required_output, + $law, + $R, + $out_causality, + $out_port, + $Pressure, + $P_causality, + $P_port, + $Temperature, + $T_causality, + $T_port, + $Nothing, + $N_causality, + $N_port) = @args; + + if (($P_causality eq 'effort') and + ($P_port == 1) and + ($T_causality eq 'effort') and + ($T_port == 2) and + ($N_causality eq 'flow') and + ($N_port == 3)) + { + if ($required_output eq 'density') + { + return "(($Pressure)/(($R)*($Temperature)))"; + } + elsif ($required_output eq 'specific_volume') + { + return "(($R)*($Temperature)/($Pressure))"; + } + } + } + elsif ($args[2] eq 'incompressible') + { + my ($component, + $required_output, + $law, + $rho, + $out_causality, + $out_port, + $Pressure, + $P_causality, + $P_port, + $Temperature, + $T_causality, + $T_port, + $Nothing, + $N_causality, + $N_port) = @args; + + if (($P_causality eq 'effort') and + ($P_port == 1) and + ($T_causality eq 'effort') and + ($T_port == 2) and + ($N_causality eq 'flow') and + ($N_port == 3)) + { + if ($required_output eq 'density') + { + return "($rho)"; + } + elsif ($required_output eq 'specific_volume') + { + return "(1/($rho))"; + } + } + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +1; # return true + ADDED mtt/lib/cr/perl/Poly.pm Index: mtt/lib/cr/perl/Poly.pm ================================================================== --- mtt/lib/cr/perl/Poly.pm +++ mtt/lib/cr/perl/Poly.pm @@ -0,0 +1,122 @@ +#------------------------------------------------------------------------------- +# Model Transformation Tools +#------------------------------------------------------------------------------- + + +package mtt::Poly; + +#------------------------------------------------------------------------------- +# Polytropic constitutive relationship +#------------------------------------------------------------------------------- + +use strict; +use warnings; + +#------------------------------------------------------------------------------- +# standard module header (see perlmod for explanation) +#------------------------------------------------------------------------------- +BEGIN { + use Exporter (); + our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION = 1.00; + + @ISA = qw(Exporter); + @EXPORT = qw(&Poly); # CR name + %EXPORT_TAGS = ( ); +} + +#------------------------------------------------------------------------------- +# declaration of specific component implementations +#------------------------------------------------------------------------------- +sub Poly_any(@); # any component + +#------------------------------------------------------------------------------- +# main function: selects which subfunction to call +#------------------------------------------------------------------------------- +sub Poly (@) { + + my $retval; + + $_ = $_[0]; + + s/\((.*)\)/$1/; # strip brackets + my @args = split (/,/); # split arguments + + $_ = $args[0]; # get component type + + # select rule to use + $retval = Poly_any (@args); + + # if a substitution has been made ($retval) + if ($retval) + { + return $retval; # return substituted expression + } + else # return nothing + { + return; + } +} + +#------------------------------------------------------------------------------- +# any component +#------------------------------------------------------------------------------- +sub Poly_any (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 16-1) + { + my ($component, + $alpha, + $out_causality, + $out_port, + $P1, + $in1_causality, + $in1_port, + $P2, + $in2_causality, + $in2_port, + $T1, + $in3_causality, + $in3_port, + $Nothing, + $in4_causality, + $in4_port) = @args; + + if (($in1_port == 1) and + ($in1_causality eq 'effort') and + ($in2_port == 2) and + ($in2_causality eq 'effort') and + ($in3_port == 3) and + ($in3_causality eq 'effort') and + ($in4_port == 4) and + ($in4_causality eq 'flow')) + { + if ($out_port != 4) + { + return "(0)"; + } + elsif ($out_causality eq 'effort') + { + # return temperature T2 + $retval = "($T1)*pow((($P2)/($P1)),($alpha))"; + } + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +1; # return true + ADDED mtt/lib/cr/perl/apply_cr.pl Index: mtt/lib/cr/perl/apply_cr.pl ================================================================== --- mtt/lib/cr/perl/apply_cr.pl +++ mtt/lib/cr/perl/apply_cr.pl @@ -0,0 +1,192 @@ +#! /usr/bin/perl -w +# +# apply_cr.pl - apply specified CRs to text on standard input +# Copyright (C) 2004 Geraint Paul Bevan +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# -------------------------- +# Model Transformation Tools +# -------------------------- +# +# +#------------------------------------------------------------------------------- + +use strict; +use Getopt::Long; + +my $cr_name=''; +#------------------------------------------------------------------------------- +# arguments and options +#------------------------------------------------------------------------------- +my $crlist = ''; +my $debug = 0; +my $help = 0; + +GetOptions ('debug' => \$debug, + 'help' => \$help); + +#------------------------------------------------------------------------------- +# globals +#------------------------------------------------------------------------------- + +my @expressions; +my @prefixes; + +my $expression; +my $i = 0; + +#------------------------------------------------------------------------------- +# subroutine declarations +#------------------------------------------------------------------------------- +sub substitute_subexpressions(); +sub process_expression(); +sub display_subexpressions(); +sub reassemble_expression(); +sub usage(); + +#------------------------------------------------------------------------------- +# main +#------------------------------------------------------------------------------- + +if ($help) { + usage(); + exit 1; +} + +while () { + $expression = $_; + print STDERR "Start Expression -> $expression\n" if $debug; + + $i = 0; + @expressions = (); + @prefixes = (); + + substitute_subexpressions(); + display_subexpressions () if ($debug); + + for ($i = 0; $i <= $#expressions; $i++) { + process_expression (); + } + + display_subexpressions () if ($debug); + reassemble_expression (); + print STDOUT "$expression"; +} + +#------------------------------------------------------------------------------- +# subroutines +#------------------------------------------------------------------------------- +sub substitute_subexpressions() { + + while ($expression =~ /\(.*\)/) { + $_ = $expression; + # get a matched pair of brackets + s/ (.*) ( \({1} [^\(\)]* \){1} ) (.*) /$1 : $2 : $3/x; + + my $extracted; + my $remainder; + my $skipped; + ($skipped, $extracted, $remainder) = split (/ : /); + + $expressions[$i] = $extracted if $extracted; + + $_ = $skipped; + s/(\s)//g; # strip whitespace + s/ (.*?) (\w*)$ /$2/x; # get function name (if any) + $prefixes[$i] = $_; + $skipped =~ s/(.*)$prefixes[$i]$/$1/; + + $expression = "$skipped\{$i\}$remainder"; + + $i++; + } + $expressions[$i] = $expression; +# $prefixes[$i] = ""; +} +#------------------------------------------------------------------------------- +sub process_expression() { + + my $cr = ''; + foreach my $cr_name (@ARGV) { + if ($prefixes[$i]) { + if ($prefixes[$i] eq $cr_name) { + $cr = $cr_name; + } + } + } + if ($cr eq '') { + return; + } + + # call cr(arg1,arg2,...) User-defined CR in the model directory + if (-e "$cr.pm") { + my $expr = $expressions[$i]; + eval "require $cr"; + $cr->import (@_[1 .. $#_]); + no strict 'refs'; # allow symbolic references + my $substitution = &$cr ($expr); + use strict 'refs'; + if ($substitution) { + $prefixes[$i] = ""; + $expressions[$i] = "$substitution"; + } + } + # call cr(arg1,arg2,...) Standard CR in the mtt namespace + if (-e "mtt/$cr.pm") { + my $expr = $expressions[$i]; + my $mttcr = "mtt::$cr"; + eval "require 'mtt/$cr.pm'"; + $mttcr->import (@_[1 .. $#_]); + no strict 'refs'; # allow symbolic references + my $substitution = &$cr ($expr); + use strict 'refs'; + if ($substitution) { + $prefixes[$i] = ""; + $expressions[$i] = "$substitution"; + } + } +} +#------------------------------------------------------------------------------- +sub display_subexpressions() { + + for ($i = 0; $i <= $#expressions; $i++) { + my $prefix = " "; + $prefix = $prefixes[$i] if ($prefixes[$i]); + print STDERR "$i\t($prefix)\t$expressions[$i]\n\n"; + } +} +#------------------------------------------------------------------------------- +sub reassemble_expression () { + + $expression = $expressions[$#expressions]; + + for ($i = $#expressions; $i >= 0; $i--) { + print STDERR "{$i}: $expressions[$i]\n" if $debug; + $expression =~ s/\{$i\}/$prefixes[$i]$expressions[$i]/g; + } + print STDERR "Final expression -> $expression\n" if $debug; +} +#------------------------------------------------------------------------------- +sub usage() { + + print STDOUT + "\nUsage: $0 [options] crname1 crname2 ..\n" . + "\n" . + "\toptions:\n" . + "\t--debug\n" . + "\t--help\n" . + "\n"; +} ADDED mtt/lib/cr/perl/lcos.pm Index: mtt/lib/cr/perl/lcos.pm ================================================================== --- mtt/lib/cr/perl/lcos.pm +++ mtt/lib/cr/perl/lcos.pm @@ -0,0 +1,120 @@ +#------------------------------------------------------------------------------- +# Model Transformation Tools +#------------------------------------------------------------------------------- + + +package mtt::lcos; + +#------------------------------------------------------------------------------- +# linear constitutive relationship with cosine modulation +#------------------------------------------------------------------------------- + +use strict; +use warnings; + +#------------------------------------------------------------------------------- +# standard module header (see perlmod for explanation) +#------------------------------------------------------------------------------- +BEGIN { + use Exporter (); + our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION = 1.00; + + @ISA = qw(Exporter); + @EXPORT = qw(&lcos); # CR name + %EXPORT_TAGS = ( ); +} + +#------------------------------------------------------------------------------- +# declaration of specific component implementations +#------------------------------------------------------------------------------- +sub lcos_emtf(@); # EMTF + +#------------------------------------------------------------------------------- +# main function: selects which subfunction to call +#------------------------------------------------------------------------------- +sub lcos (@) { + + my $retval; + + $_ = $_[0]; + + s/\((.*)\)/$1/; # strip brackets + my @args = split (/,/); # split arguments + + $_ = $args[0]; # get component type + + # select rule to use + if (/^EMTF|emtf$/) { $retval = lcos_emtf (@args); } + + # if a substitution has been made ($retval) + if ($retval) + { + return $retval; # return substituted expression + } + else # return nothing + { + return; + } +} + +#------------------------------------------------------------------------------- +# EMTF +#------------------------------------------------------------------------------- +sub lcos_emtf (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 11-1) + { + my ($component, + $gain_causality, + $gain, + $out_causality, + $out_port, + $input, + $in_causality, + $in_port, + $mod_input, + $mod_causality, + $mod_port) = @args; + + if ((($mod_port == 3) and + ($out_causality eq $in_causality)) + and + ((($out_causality eq $gain_causality) and + ($out_port == 2)) + or + (($out_causality ne $gain_causality) and + ($out_port == 1)))) + { + $retval = "(($input)*($gain)*(cos($mod_input)))"; + } + elsif ((($mod_port == 3) and + ($out_causality eq $in_causality)) + and + ((($out_causality ne $gain_causality) and + ($out_port == 2)) + or + (($out_causality eq $gain_causality) and + ($out_port == 1)))) + { + $retval = "(($input)/(($gain)*(cos($mod_input))))"; + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +1; # return true + ADDED mtt/lib/cr/perl/lin.pm Index: mtt/lib/cr/perl/lin.pm ================================================================== --- mtt/lib/cr/perl/lin.pm +++ mtt/lib/cr/perl/lin.pm @@ -0,0 +1,440 @@ +#------------------------------------------------------------------------------- +# Model Transformation Tools +#------------------------------------------------------------------------------- + + +package mtt::lin; + +#------------------------------------------------------------------------------- +# Default linear constitutive relationship +#------------------------------------------------------------------------------- + +use strict; +use warnings; + +#------------------------------------------------------------------------------- +# standard module header (see perlmod for explanation) +#------------------------------------------------------------------------------- +BEGIN { + use Exporter (); + our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION = 1.00; + + @ISA = qw(Exporter); + @EXPORT = qw(&lin); # CR name + %EXPORT_TAGS = ( ); +} + +#------------------------------------------------------------------------------- +# declaration of specific component implementations +#------------------------------------------------------------------------------- +sub lin_amp (@); # AE AF +sub lin_cir (@); # C I R +sub lin_emtf(@); # EMTF +sub lin_fmr (@); # FMR +sub lin_gy (@); # GY +sub lin_tf (@); # TF + +#------------------------------------------------------------------------------- +# main function: selects which subfunction to call +#------------------------------------------------------------------------------- +sub lin (@) { + + my $retval; + + $_ = $_[0]; + + s/\((.*)\)/$1/; # strip brackets + my @args = split (/,/); # split arguments + + $_ = $args[0]; # get component type + + # select rule to use + if (/^AE|ae$/) { $retval = lin_amp (@args); } + if (/^AF|af$/) { $retval = lin_amp (@args); } + if (/^C|c$/) { $retval = lin_cir (@args); } + if (/^EMTF|emtf$/) { $retval = lin_emtf (@args); } + if (/^FMR|fmr$/) { $retval = lin_fmr (@args); } + if (/^GY|gy$/) { $retval = lin_gy (@args); } + if (/^I|i$/) { $retval = lin_cir (@args); } + if (/^R|r$/) { $retval = lin_cir (@args); } + if (/^TF|tf$/) { $retval = lin_tf (@args); } + + # if a substitution has been made ($retval) + if ($retval) + { + return $retval; # return substituted expression + } + else # return nothing + { + return; + } +} + +#------------------------------------------------------------------------------- +# AE and AF +#------------------------------------------------------------------------------- +sub lin_amp (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 8-1) { + + my ($component, + $gain_causality, + $gain, + $out_causality, + $out_port, + $input, + $in_causality, + $in_port) = @args; + + if (($out_port == 2) and + ($in_port == 1)) + { # uni-causal + $retval = "(($input)*($gain))"; + } + + elsif (($out_port == 1) and + ($in_port == 2)) + { # bi-causal + $retval = "(($input)/($gain))"; + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +# C, I and R +#------------------------------------------------------------------------------- +sub lin_cir (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 8-1) + { + my ($component, + $gain_causality, + $gain, + $out_causality, + $out_port, + $input, + $in_causality, + $in_port) = @args; + + if ( + ($out_port == 1) + and + ($in_port == 1) + ) + { # single port + if ($in_causality eq $gain_causality) + { + $retval = "(($input)*($gain))"; + } + elsif ($in_causality ne $gain_causality) + { + $retval = "(($input)/($gain))"; + } + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +# EMTF +#------------------------------------------------------------------------------- +sub lin_emtf (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 10-1) + { # modulation only + my ($component, + $gain_causality, + $out_causality, + $out_port, + $input, + $in_causality, + $in_port, + $mod_input, + $mod_causality, + $mod_port) = @args; + + if ((($mod_causality eq 'effort') and + ($mod_port == 3)) + and + ((($out_causality eq $gain_causality) and + ($out_port == 2)) + or + (($out_causality ne $gain_causality) and + ($out_port == 1)))) + { + $retval = "(($input)*($mod_input))"; + } + elsif ((($mod_causality eq 'effort') and + ($mod_port == 3)) + and + ((($out_causality ne $gain_causality) and + ($out_port == 2)) + or + (($out_causality eq $gain_causality) and + ($out_port == 1)))) + { + $retval = "(($input)/($mod_input))"; + } + } + elsif ($#args == 11-1) + { # modulation and gain + my ($component, + $gain_causality, + $gain, + $out_causality, + $out_port, + $input, + $in_causality, + $in_port, + $mod_input, + $mod_causality, + $mod_port) = @args; + + if ((($mod_causality eq 'effort') and + ($mod_port == 3)) + and + ((($out_causality eq $gain_causality) and + ($out_port == 2)) + or + (($out_causality ne $gain_causality) and + ($out_port == 1)))) + { + $retval = "(($input)*(($gain)*($mod_input)))"; + } + elsif ((($mod_causality eq 'effort') and + ($mod_port == 3)) + and + ((($out_causality ne $gain_causality) and + ($out_port == 2)) + or + (($out_causality eq $gain_causality) and + ($out_port == 1)))) + { + $retval = "(($input)/(($gain)*($mod_input)))"; + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} +#------------------------------------------------------------------------------- +# FMR +#------------------------------------------------------------------------------- +sub lin_fmr (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 7-1) + { # uni-causal + # flow modulation multiplies effort on port 1 (or divides flow) + my ($component, + $gain_causality, + $gain, + $out_causality, + $input, + $in_causality, + $mod_input) = @args; + + if (($gain_causality eq $in_causality) and + ($out_causality eq 'flow')) + { + $retval = "(($input)*($gain)*($mod_input))"; + } + elsif (($gain_causality eq $in_causality) and + ($out_causality eq 'effort')) + { + $retval = "(($input)*($gain)/($mod_input))"; + } + elsif (($gain_causality ne $in_causality) and + ($out_causality eq 'flow')) + { + $retval = "(($input)*($mod_input)/($gain))"; + } + elsif (($gain_causality ne $in_causality) and + ($out_causality eq 'effort')) + { + $retval = "(($input)/(($gain)*($mod_input)))"; + } + } + elsif ($#args == 11-1) + { # bi-causal + # deduces the flow on port 2 + my ($component, + $gain_causality, + $gain, + $out_causality, + $out_port, + $e_input, + $e_causality, + $e_port, + $f_input, + $f_causality, + $f_port) = @args; + + if (($gain_causality eq 'effort') and + ($out_causality eq 'flow') and + ($out_port == 2) and + ($e_causality eq 'effort') and + ($e_port == 1) and + ($f_causality eq 'flow') and + ($f_port == 1)) + { + $retval = "((($f_input)/($e_input))/($gain))"; + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +# GY +#------------------------------------------------------------------------------- +sub lin_gy (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 8-1) + { + my ($component, + $gain_causality, + $gain, + $out_causality, + $out_port, + $input, + $in_causality, + $in_port) = @args; + + if (($out_causality ne $in_causality) and + ($out_port != $in_port) + and + (($out_causality ne $gain_causality) and + ($out_port == 2)) + or + (($out_causality ne $gain_causality) and + ($out_port == 1))) + { + $retval = "(($input)/($gain))"; + } + + elsif (($out_causality ne $in_causality) and + ($out_port != $in_port) + and + (($out_causality eq $gain_causality) and + ($out_port == 2)) + or + (($out_causality eq $gain_causality) and + ($out_port == 1))) + { + $retval = "(($input)*($gain))"; + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +# TF +#------------------------------------------------------------------------------- +sub lin_tf (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 8-1) + { + my ($component, + $gain_causality, + $gain, + $out_causality, + $out_port, + $input, + $in_causality, + $in_port) = @args; + + if (($out_causality eq $in_causality) and + ($out_port ne $in_port) + and + (($out_causality eq $gain_causality) and + ($out_port == 2)) + or + (($out_causality ne $gain_causality) and + ($out_port == 1))) + { + $retval = "(($input)*($gain))"; + } + + elsif (($out_causality eq $in_causality) and + ($out_port ne $in_port) + and + (($out_causality ne $gain_causality) and + ($out_port == 2)) + or + (($out_causality eq $gain_causality) and + ($out_port == 1))) + { + $retval = "(($input)/($gain))"; + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} +#------------------------------------------------------------------------------- +1; # return true + ADDED mtt/lib/cr/perl/lsin.pm Index: mtt/lib/cr/perl/lsin.pm ================================================================== --- mtt/lib/cr/perl/lsin.pm +++ mtt/lib/cr/perl/lsin.pm @@ -0,0 +1,120 @@ +#------------------------------------------------------------------------------- +# Model Transformation Tools +#------------------------------------------------------------------------------- + + +package mtt::lsin; + +#------------------------------------------------------------------------------- +# linear constitutive relationship with sine modulation +#------------------------------------------------------------------------------- + +use strict; +use warnings; + +#------------------------------------------------------------------------------- +# standard module header (see perlmod for explanation) +#------------------------------------------------------------------------------- +BEGIN { + use Exporter (); + our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION = 1.00; + + @ISA = qw(Exporter); + @EXPORT = qw(&lsin); # CR name + %EXPORT_TAGS = ( ); +} + +#------------------------------------------------------------------------------- +# declaration of specific component implementations +#------------------------------------------------------------------------------- +sub lsin_emtf(@); # EMTF + +#------------------------------------------------------------------------------- +# main function: selects which subfunction to call +#------------------------------------------------------------------------------- +sub lsin (@) { + + my $retval; + + $_ = $_[0]; + + s/\((.*)\)/$1/; # strip brackets + my @args = split (/,/); # split arguments + + $_ = $args[0]; # get component type + + # select rule to use + if (/^EMTF|emtf$/) { $retval = lsin_emtf (@args); } + + # if a substitution has been made ($retval) + if ($retval) + { + return $retval; # return substituted expression + } + else # return nothing + { + return; + } +} + +#------------------------------------------------------------------------------- +# EMTF +#------------------------------------------------------------------------------- +sub lsin_emtf (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 11-1) + { + my ($component, + $gain_causality, + $gain, + $out_causality, + $out_port, + $input, + $in_causality, + $in_port, + $mod_input, + $mod_causality, + $mod_port) = @args; + + if ((($mod_port == 3) and + ($out_causality eq $in_causality)) + and + ((($out_causality eq $gain_causality) and + ($out_port == 2)) + or + (($out_causality ne $gain_causality) and + ($out_port == 1)))) + { + $retval = "(($input)*($gain)*(sin($mod_input)))"; + } + elsif ((($mod_port == 3) and + ($out_causality eq $in_causality)) + and + ((($out_causality ne $gain_causality) and + ($out_port == 2)) + or + (($out_causality eq $gain_causality) and + ($out_port == 1)))) + { + $retval = "(($input)/(($gain)*(sin($mod_input))))"; + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +1; # return true + ADDED mtt/lib/cr/r/CT2.cr Index: mtt/lib/cr/r/CT2.cr ================================================================== --- mtt/lib/cr/r/CT2.cr +++ mtt/lib/cr/r/CT2.cr @@ -0,0 +1,43 @@ +%SUMMARY CT2 Constitutive Relationship for a two port thermo C +%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) +%DESCRIPTION Parameter 2: gamma = c_p/c_v +%DESCRIPTION Parameter 3: mass of (ideal) gas within component. +%DESCRIPTION Parameter 4: t_0 -- the temperature at which internal +%DESCRIPTION energy is zero. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/12/07 20:45:21 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/02 10:21:19 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/09/12 11:18:26 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +OPERATOR CT2; +Port 1 - Thermal +FOR ALL c_v,gamma,m,t_0,InternalEnergy,Volume +LET CT2(c_v,gamma,m,t_0,effort,1, + InternalEnergy, state, 1, + Volume, state, 2) + = InternalEnergy/(m*c_v); + +Port 2 - Mechanical +FOR ALL c_v,gamma,m,t_0,InternalEnergy,Volume +LET CT2(c_v,gamma,m,t_0,effort,2, + InternalEnergy, state, 1, + Volume, state, 2) + = (gamma-1)*(InternalEnergy+c_v*m*t_0)/Volume; + ADDED mtt/lib/cr/r/MA.cr Index: mtt/lib/cr/r/MA.cr ================================================================== --- mtt/lib/cr/r/MA.cr +++ mtt/lib/cr/r/MA.cr @@ -0,0 +1,120 @@ +%SUMMARY MA: Mass-action kinetics for Re +%DESCRIPTION Parameter 1: kappa + +OPERATOR MA; + +%%% Two port version (standard) +FOR ALL n_out, A_f, A_r, kappa +LET MA(R, flow,kappa,flow,n_out, + A_f,effort,1, + A_r,effort,2) = kappa*(exp(A_f/RT) - exp(A_r/RT)); + + +%%% Four port version (stoichiometric) with integral causality +%% Flows on ports 1 & 2 = flow on port 3. +FOR ALL A_f, A_r, v_1, v_2,kappa +LET MA(R, flow,kappa,flow,1, + A_f,effort,1, + A_r,effort,2, + v_1,flow,3, + v_2,effort,4) = v_1; + +FOR ALL A_f, A_r, v_1, v_2,kappa +LET MA(R, flow,kappa,flow,2, + A_f,effort,1, + A_r,effort,2, + v_1,flow,3, + v_2,effort,4) = v_1; + +%% Flow on port 4 is induced flow +FOR ALL A_f, A_r, v_1, v_2,kappa +LET MA(R, flow,kappa,flow,4, + A_f,effort,1, + A_r,effort,2, + v_1,flow,3, + v_2,effort,4) = kappa*(exp(A_f/RT) - exp(A_r/RT)); + +%%% Four port version (stoichiometric) with flow imposed on port 1 +%% Flow on port 2 = flow on port 1 +FOR ALL A_1,A_2,A_3,A_4, v_1,v_2,v_3,v_4, kappa +LET MA(R, flow,kappa,flow,2, + v_1,flow,1, + A_2,effort,2, + v_3,flow,3, + A_4,effort,4) = v_1; + +%% Flow on port 4 = flow on port 1 +FOR ALL A_1,A_2,A_3,A_4, v_1,v_2,v_3,v_4, kappa +LET MA(R, flow,kappa,flow,4, + v_1,flow,1, + A_2,effort,2, + v_3,flow,3, + A_4,effort,4) = v_1; + +%% Effort on port 1 +FOR ALL A_1,A_2,A_3,A_4,v_1,v_2,v_3,v_4,kappa +LET MA(R,flow,kappa,effort,1, + v_1,flow,1, + A_2,effort,2, + v_3,flow,3, + A_4,effort,4) = RT*log( (v_1/kappa) + exp(A_2/RT) ); + + +%%% Four port version (stoichiometric) with flow imposed on port 2 + +%% Flow on port 1 = flow on port 2 +FOR ALL A_1,A_2,A_3,A_4, v_1,v_2,v_3,v_4, kappa +LET MA(R, flow,kappa,flow,1, + A_1,effort,1, + v_2,flow,2, + v_3,flow,3, + A_4,effort,4) = v_2; + +%% Flow on port 4 = flow on port 2 +FOR ALL A_1,A_2,A_3,A_4, v_1,v_2,v_3,v_4, kappa +LET MA(R, flow,kappa,flow,4, + A_1,effort,1, + v_2,flow,2, + v_3,flow,3, + A_4,effort,4) = v_2; + +%% Effort on port 2 +FOR ALL A_1,A_2,A_3,A_4,v_1,v_2,v_3,v_4,kappa +LET MA(R,flow,kappa,effort,2, + A_1,effort,1, + v_2,flow,2, + v_3,flow,3, + A_4,effort,4) = RT*log( (v_2/kappa) + exp(A_1/RT) ); + +%%% Five port version (stoichiometric) with integral causality +%% Flow on port 1 = flow on port 3. +FOR ALL A_f, A_r, v_f, v_r, v, kappa +LET MA(R, flow,kappa,flow,1, + A_f,effort,1, + A_r,effort,2, + v_f,flow,3, + v_r,flow,4, + v,effort,5) = v_f; + +%% Flow on port 2 = flow on port 4. +FOR ALL A_f, A_r, v_f, v_r, v, kappa +LET MA(R, flow,kappa,flow,2, + A_f,effort,1, + A_r,effort,2, + v_f,flow,3, + v_r,flow,4, + v,effort,5) = v_r; + +%% Flow on port 5 is induced flow +FOR ALL A_f, A_r, v_f, v_r, v, kappa +LET MA(R, flow,kappa,flow,5, + A_f,effort,1, + A_r,effort,2, + v_f,flow,3, + v_r,flow,4, + v,effort,5) = kappa*(exp(A_f/RT) - exp(A_r/RT)); + + +%% AE version +FOR ALL mu +LET MA(AE, effort,2, mu, effort,1) = exp(mu/RT); ADDED mtt/lib/cr/r/SS.cr Index: mtt/lib/cr/r/SS.cr ================================================================== --- mtt/lib/cr/r/SS.cr +++ mtt/lib/cr/r/SS.cr @@ -0,0 +1,3 @@ +%% A dummy constitutive relationship file for SS + +END;; ADDED mtt/lib/cr/r/StefanBoltzmann.cr Index: mtt/lib/cr/r/StefanBoltzmann.cr ================================================================== --- mtt/lib/cr/r/StefanBoltzmann.cr +++ mtt/lib/cr/r/StefanBoltzmann.cr @@ -0,0 +1,15 @@ +%SUMMARY StefanBoltzmann: Stefan-Boltzmann radiation law. +%DESCRIPTION Parameter 1: Stefan-Boltzmann constant +%DESCRIPTION Parameter 2: Area of radiating surface + + + +OPERATOR StefanBoltzmann; + + +FOR ALL sigma,Area,input +LET StefanBoltzmann(sigma,Area,flow, 1, + input, effort, 1) + = sigma*area*input^4; + + ADDED mtt/lib/cr/r/cm.cr Index: mtt/lib/cr/r/cm.cr ================================================================== --- mtt/lib/cr/r/cm.cr +++ mtt/lib/cr/r/cm.cr @@ -0,0 +1,44 @@ +%SUMMARY cm: relation for 2-port CM component +%DESCRIPTION Parameter 1 capacitance at separation x_0 +%DESCRIPTION Parameter 2 x_0 +%DESCRIPTION parameter 3 moving-plate mass + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:18:38 peterg +% %% put under RCS +% %% +% %% Revision 1.1 1996/11/02 10:21:19 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/09/12 11:18:26 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +OPERATOR cm; +%Linear electrical bit +FOR ALL comp,c_0,x_0,elec_state,mech_state LET +cm(comp,c_0,x_0,effort,1, + elec_state,state,1, + mech_state,state,2 + ) + = elec_state/(c_0*x_0/mech_state); + +%Nonlinear mechanical bit +FOR ALL comp,c_0,x_0,elec_state,mech_state LET +cm(comp,c_0,x_0,effort,2, + elec_state,state,1, + mech_state,state,2 + ) + = -(c_0*x_0)*((elec_state/mech_state)^2)/2; + +END;; ADDED mtt/lib/cr/r/cp.cr Index: mtt/lib/cr/r/cp.cr ================================================================== --- mtt/lib/cr/r/cp.cr +++ mtt/lib/cr/r/cp.cr @@ -0,0 +1,27 @@ +%SUMMARY cp Chemical potential constitutive relationship + +% This formula gives the Gibb's free energy for a reaction component +% with given concentration. +% k_e is the corresponding equilibrium constant. + +% C version integral causality +FOR ALL concentration, k_e, RT +LET cp(C,k_e,RT, effort, 1, + concentration, state, 1) + = RT*log(k_e*concentration); + +% C version derivative causality +FOR ALL potential, k_e, RT +LET cp(C,k_e,RT, state, 1, + potential, effort, 1) + = exp(potential/RT)/k_e; + +%AE version +FOR ALL concentration, RT +LET cp(AE,RT,effort,2,concentration,effort,1) + = RT*log(concentration); + +%AE version with k_e +FOR ALL concentration, k_e, RT +LET cp(AE,k_e,RT,effort,2,concentration,effort,1) + = RT*log(k_e*concentration); ADDED mtt/lib/cr/r/cr.cr Index: mtt/lib/cr/r/cr.cr ================================================================== --- mtt/lib/cr/r/cr.cr +++ mtt/lib/cr/r/cr.cr @@ -0,0 +1,121 @@ +%SUMMARY cr generic CR +%DESCRIPTION Argument is an algebraic expression with no embeddedwhite space +%DESCRIPTION Only available for one ports just now +%DESCRIPTION effort (or integrated effort) variable must be called mtt_e +%DESCRIPTION flow (or integrated flow) variable must be called mtt_f +%DESCRIPTION For example: +%DESCRIPTION mtt_e=k*mtt_f +%DESCRIPTION mtt_f=mtt_e/r + +% $Log$ +% Revision 1.5 2003/01/09 09:57:42 gawthrop +% Added dummy first argument (comp_type) to cr +% +% Revision 1.4 2000/12/28 09:18:38 peterg +% put under RCS +% +% Revision 1.3 2000/10/05 10:13:00 peterg +% New eqn2ass function. +% Started extension to multiports +% +% Revision 1.2 2000/10/03 18:35:04 peterg +% Removed comment bug +% +% Revision 1.1 2000/10/03 18:34:00 peterg +% Initial revision +% + +%Copyright (C) 2000 by Peter J. Gawthrop + + +% Function to convert equation to assignment +OPERATOR eqn2ass; +FOR ALL comp_type, eqn,outlist,inputs +LET eqn2ass(eqn,outlist,inputs) = +BEGIN + ass := {}; mtt_ports := 0; + solutions := solve(eqn,outlist); + FOR EACH solution IN solutions DO + BEGIN + mtt_ports := mtt_ports + 1; + rh := RHS(solution); + FOR EACH input IN inputs DO + rh := sub(input,rh); + ass := APPEND(ass,{rh}); + END; + IF mtt_ports EQ 1 THEN + RETURN FIRST(ass) + ELSE + RETURN ass; + + %return sub(input,rhs(first(solve(eqn,outlist)))); + % Needs multiplicity warning +END; + + +OPERATOR cr; + +% Version for one-port components + +% We need four versions so that state does not need to be explicitly +% mentioned. +% At the moment, assume only one solution (in fact the first is +% chosen) + +%%%% This is the Equation version +% Flow input +FOR ALL comp_type, mtt_cr, input, out_cause +LET cr(comp_type,mtt_cr,out_cause, 1, input, flow, 1) + = eqn2ass(mtt_cr,mtt_e,{mtt_f=input}); + +% Effort input +FOR ALL comp_type, mtt_cr, input, out_cause +LET cr(comp_type,mtt_cr,out_cause, 1, input, effort, 1) + = eqn2ass(mtt_cr,mtt_f,{mtt_e=input}); + +% Effort output +FOR ALL comp_type, mtt_cr, input, in_cause +LET cr(comp_type,mtt_cr,effort, 1, input, in_cause, 1) + = eqn2ass(mtt_cr,mtt_e,{mtt_f=input}); + +% Flow output +FOR ALL comp_type, mtt_cr, input, in_cause +LET cr(comp_type,mtt_cr,flow, 1, input, in_cause, 1) + = eqn2ass(mtt_cr,mtt_f,{mtt_e=input}); + +%%%% This is the assignment version +% Flow input +FOR ALL comp_type, mtt_cr_e,mtt_cr_f, input, out_cause +LET cr(comp_type,mtt_cr_e,mtt_cr_f,out_cause, 1, input, flow, 1) + = sub(mtt_f=input,mtt_cr_f); + +% Effort input +FOR ALL comp_type, mtt_cr_e,mtt_cr_f, input, out_cause +LET cr(comp_type,mtt_cr_e,mtt_cr_f,out_cause, 1, input, effort, 1) + = sub(mtt_e=input,mtt_cr_e); + +% Effort output +FOR ALL comp_type, mtt_cr_e,mtt_cr_f, input, in_cause +LET cr(comp_type,mtt_cr_e,mtt_cr_f,effort, 1, input, in_cause, 1) + = sub(mtt_f=input,mtt_cr_f); + +% Flow output +FOR ALL comp_type, mtt_cr_e,mtt_cr_f, input, in_cause +LET cr(comp_type,mtt_cr_e,mtt_cr_f,flow, 1, input, in_cause, 1) + = sub(mtt_e=input,mtt_cr_e); + + +%%% Q&D FMR 2 port. +FOR ALL comp_type, mtt_cr_e,mtt_cr_f,input_1,input_2 +LET cr(comp_type,mtt_cr_e,mtt_cr_f,flow,1, + input_1,effort,1, + input_2,flow,2 + ) = sub(mtt_mod=input_2,sub(mtt_e=input_1,mtt_cr_e)); + +%% AE amplifier +FOR ALL mtt_cr, input, out_cause +LET cr(ae,mtt_cr,effort, 2, + input, effort, 1) + = eqn2ass(mtt_cr,mtt_2,{mtt_1=input}); + +END; ADDED mtt/lib/cr/r/defaultcr.r Index: mtt/lib/cr/r/defaultcr.r ================================================================== --- mtt/lib/cr/r/defaultcr.r +++ mtt/lib/cr/r/defaultcr.r @@ -0,0 +1,63 @@ +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Linear constitutive relationship. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%Linear Constitutive Relationship for single port components: R,C,I. +% e = Gain*f (if gain_causality = flow) +% f = Gain*e (if gain_causality = effort) +OPERATOR lin; +FOR ALL gain_causality, gain, causality, input, other_causality +SUCH THAT causality = gain_causality +LET lin(gain_causality, gain, other_causality, 1, input, causality, 1) + = gain*input; + +%Linear CR: e = (1/Gain)*f (if gain_causality = flow) +% f = (1/Gain)*e (if gain_causality = effort) +FOR ALL gain_causality, gain, causality, input, other_causality +SUCH THAT causality NEQ gain_causality +LET lin(gain_causality, gain, other_causality, 1, input, causality, 1) + = input/gain; + + +% Linear Constitutive Relationship for AE and AF +% Output = gain * input + +% Unicausal form +FOR ALL gain, input, causality +LET lin(gain, causality, 2, input, causality, 1) = gain*input; + +%Bicausal form +FOR ALL gain, output, causality +LET lin(gain, causality, 1, output, causality, 2) = output/gain; + +% Linear Constitutive Relationship for TF +FOR ALL gain, input, causality, gain_causality, outport, inport +SUCH THAT ( + (causality = gain_causality) AND (outport = 2) + OR + (causality NEQ gain_causality) AND (outport = 1) + ) +LET lin(gain_causality, gain, causality, outport, input, causality, inport) + = gain*input; + +FOR ALL gain, input, causality, gain_causality, outport, inport +SUCH THAT ( + (causality NEQ gain_causality) AND (outport = 2) + OR + (causality = gain_causality) AND (outport = 1) + ) +LET lin(gain_causality, gain, causality, outport, input, causality, inport) + = input/gain; + +END; + ADDED mtt/lib/cr/r/delta_h.cr Index: mtt/lib/cr/r/delta_h.cr ================================================================== --- mtt/lib/cr/r/delta_h.cr +++ mtt/lib/cr/r/delta_h.cr @@ -0,0 +1,31 @@ +%SUMMARY delta_h CR for gas turbine compressor + + +OPERATOR delta_h; + +% Port 1 - generates delta h +FOR ALL c_p,Temperature,Massflow,DeltaT +LET delta_h(c_p, flow, 1, + Temperature,effort,1, + Massflow,flow,2, + DeltaT,effort,3) + = Massflow*c_p*DeltaT; + +% Port 2 - generates zero effort +FOR ALL c_p,Temperature,Massflow,DeltaT +LET delta_h(c_p, effort, 2, + Temperature,effort,1, + Massflow,flow,2, + DeltaT,effort,3) + = 0; + +% Port 3 - generates zero effort +FOR ALL c_p,Temperature,Massflow,DeltaT +LET delta_h(c_p, flow,3, + Temperature,effort,1, + Massflow,flow,2, + DeltaT,effort,3) + = 0; + + + ADDED mtt/lib/cr/r/lcos.cr Index: mtt/lib/cr/r/lcos.cr ================================================================== --- mtt/lib/cr/r/lcos.cr +++ mtt/lib/cr/r/lcos.cr @@ -0,0 +1,55 @@ +%SUMMARY lcos linear constitutive relationship with cos modulation +%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 +%DESCRIPTION value is effort, flow or state +%DESCRIPTION Parameter 2 is the gain corresponding to the causality of +%DESCRIPTION parameter 1. +%DESCRIPTION Supported components: + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Linear constitutive relationship with cos modulation + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/03/04 17:51:02 peterg +% %% Added END +% %% +% %% Revision 1.1 1996/11/02 10:18:07 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +OPERATOR lcos; + +%DESCRIPTION three port component: EMTF +FOR ALL comp_type, gain, input, causality, gain_causality, outport, inport, + m_input, m_causality +SUCH THAT ( + (causality = gain_causality) AND (outport = 2) + OR + (causality NEQ gain_causality) AND (outport = 1) + ) +LET lcos(comp_type, gain_causality, gain, causality, outport, + input, causality, inport, + m_input, m_causality, 3) + = cos(m_input)*gain*input; + +FOR ALL comp_type, gain, input, causality, gain_causality, outport, inport, + m_input, m_causality +SUCH THAT ( + (causality NEQ gain_causality) AND (outport = 2) + OR + (causality = gain_causality) AND (outport = 1) + ) +LET lcos(comp_type, gain_causality, gain, causality, outport, + input, causality, inport, + m_input, m_causality, 3) + = input/(cos(m_input)*gain); + +END;; ADDED mtt/lib/cr/r/lin.cr Index: mtt/lib/cr/r/lin.cr ================================================================== --- mtt/lib/cr/r/lin.cr +++ mtt/lib/cr/r/lin.cr @@ -0,0 +1,229 @@ +%SUMMARY lin linear constitutive relationship +%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 +%DESCRIPTION value is effort, flow or state +%DESCRIPTION Parameter 2 is the gain corresponding to the causality of +%DESCRIPTION parameter 1. +%DESCRIPTION Supported components: + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Linear constitutive relationship. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 2000/12/28 09:19:07 peterg +% % put under RCS +% % +% % Revision 1.3 1998/07/04 10:47:04 peterg +% % back under RCS +% % +% % Revision 1.2 1998/03/04 15:38:54 peterg +% % Added END statement +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +%DESCRIPTION single port components: R,C,I +%Linear Constitutive Relationship for single port components: R,C,I. +% e = Gain*f (if gain_causality = flow) +% f = Gain*e (if gain_causality = effort) +OPERATOR lin; +FOR ALL comp_type, gain_causality, gain, causality, input, other_causality +SUCH THAT causality = gain_causality +LET lin(comp_type,gain_causality, gain, other_causality, 1, input, causality, 1) + = gain*input; + +%Linear CR: e = (1/Gain)*f (if gain_causality = flow) +% f = (1/Gain)*e (if gain_causality = effort) +FOR ALL comp_type, gain_causality, gain, causality, input, other_causality +SUCH THAT causality NEQ gain_causality +LET lin(comp_type,gain_causality, gain, other_causality, 1, input, causality, 1) + = input/gain; + +%DESCRIPTION two port components: AE, AF +% Linear Constitutive Relationship for AE and AF +% Output = gain * input + +% Unicausal form +FOR ALL comp_type, gain, input, causality +LET lin(comp_type,gain, causality, 2, input, causality, 1) = gain*input; + +%Bicausal form +FOR ALL comp_type, gain, output, causality +LET lin(comp_type,gain, causality, 1, output, causality, 2) = output/gain; + +%DESCRIPTION two port component: TF +% Linear Constitutive Relationship for TF +FOR ALL comp_type, gain_causality, gain, causality, outport, input, same_causality, inport + +SUCH THAT + ( causality = same_causality ) + AND + ( inport NEQ outport ) + AND + ( + ( (causality = gain_causality) AND (outport = 2) ) + OR + ( (causality NEQ gain_causality) AND (outport = 1) ) + ) +LET lin(comp_type,gain_causality, gain, causality, outport, + input, same_causality, inport) + = gain*input; + +FOR ALL comp_type, gain_causality, gain, causality, outport, + input, same_causality, inport +SUCH THAT + ( causality = same_causality ) + AND + ( inport NEQ outport ) + AND + ( + ( (causality NEQ gain_causality) AND (outport = 2) ) + OR + ( (causality = gain_causality) AND (outport = 1) ) + ) +LET lin(comp_type,gain_causality, gain, causality, outport, + input, same_causality, inport) + = input/gain; + +%% This version in not reliable. I rellly need to pass component names +%% as cr arguments. + +%DESCRIPTION two port component: GY +% Linear Constitutive Relationship for GY + +FOR ALL comp_type, gain, input, causality, gain_causality, other_causality, + outport, inport +SUCH THAT + (causality NEQ other_causality) + AND + ( inport NEQ outport ) + AND + ( + ( (causality NEQ gain_causality) AND (outport = 2) ) + OR + ( (causality NEQ gain_causality) AND (outport = 1) ) + ) +LET lin(comp_type,gain_causality, gain, other_causality, outport, + input, causality, inport) + = input/gain; + +FOR ALL comp_type, gain, input, causality, gain_causality, other_causality, + outport, inport +SUCH THAT + (causality NEQ other_causality) + AND + ( inport NEQ outport ) + AND + ( + ( (causality = gain_causality) AND (outport = 2) ) + OR + ( (causality = gain_causality) AND (outport = 1) ) + ) +LET lin(comp_type,gain_causality, gain, other_causality, outport, + input, causality, inport) + = gain*input; + +%DESCRIPTION three port component: FMR + +% Linear Constitutive Relationship for FMR - unicausal case +% Flow modulation multiplies effort on port 1 (or divides flow) + +% The 4 possibilities follow... +FOR ALL comp_type, gain_causality, gain, out_causality, input, in_causality, + mod_input +SUCH THAT (gain_causality=in_causality) AND (out_causality=flow) +LET lin(comp_type,gain_causality, gain, out_causality, 1, + input, in_causality, 1, + mod_input, flow, 2) + = input*gain*mod_input; + +FOR ALL comp_type, gain_causality, gain, out_causality, input, in_causality, + mod_input +SUCH THAT (gain_causality=in_causality) AND (out_causality=effort) +LET lin(comp_type,gain_causality, gain, out_causality, 1, + input, in_causality, 1, + mod_input, flow, 2) + = input*gain/mod_input; + +FOR ALL comp_type, gain_causality, gain, out_causality, input, in_causality, + mod_input +SUCH THAT (gain_causality NEQ in_causality) AND (out_causality=flow) +LET lin(comp_type,gain_causality, gain, out_causality, 1, + input, in_causality, 1, + mod_input, flow, 2) + = input*mod_input/gain; + +FOR ALL comp_type, gain_causality, gain, out_causality, input, in_causality, + mod_input +SUCH THAT (gain_causality NEQ in_causality) AND (out_causality=effort) +LET lin(comp_type,gain_causality, gain, out_causality, 1, + input, in_causality, 1, + mod_input, flow, 2) + = input/(gain*mod_input); + +% Linear Constitutive Relationship for FMR - bicausal case +% Deduces the flow on port 2. + +% The 2 possibilities follow... +FOR ALL comp_type, gain, e_input, f_input +LET lin(comp_type,effort, gain, flow, 2, + e_input, effort, 1, + f_input, flow, 1) + = (f_input/e_input)/gain; + +%EMTF component - modulation only +% Linear Constitutive Relationship for EMTF +FOR ALL comp_type, gain_causality, gain, causality, outport, input, same_causality, inport +SUCH THAT + ( (causality = gain_causality) AND (outport = 2) ) + OR + ( (causality NEQ gain_causality) AND (outport = 1) ) +LET lin(comp_type,gain_causality, causality, outport, + input, same_causality, inport, + gain, effort, 3) + = gain*input; + +FOR ALL comp_type, gain_causality, gain, causality, outport, + input, same_causality, inport +SUCH THAT + ( (causality NEQ gain_causality) AND (outport = 2) ) + OR + ( (causality = gain_causality) AND (outport = 1) ) +LET lin(comp_type,gain_causality, causality, outport, + input, same_causality, inport, + gain, effort, 3) + = input/gain; + +%EMTF component - modulation and gain +% Linear Constitutive Relationship for EMTF +FOR ALL comp_type, gain_causality, gain, causality, outport, input, +same_causality, inport, modulation +SUCH THAT + ( (causality = gain_causality) AND (outport = 2) ) + OR + ( (causality NEQ gain_causality) AND (outport = 1) ) +LET lin(comp_type,gain_causality, gain, causality, outport, + input, same_causality, inport, + modulation, effort, 3) + = gain*modulation*input; + +FOR ALL comp_type, gain_causality, gain, causality, outport, + input, same_causality, inport, modulation +SUCH THAT + ( (causality NEQ gain_causality) AND (outport = 2) ) + OR + ( (causality = gain_causality) AND (outport = 1) ) +LET lin(comp_type,gain_causality, gain, causality, outport, + input, same_causality, inport, + modulation, effort, 3) + = input/(gain*modulation); + +END;; + ADDED mtt/lib/cr/r/linx.cr Index: mtt/lib/cr/r/linx.cr ================================================================== --- mtt/lib/cr/r/linx.cr +++ mtt/lib/cr/r/linx.cr @@ -0,0 +1,44 @@ +%%% linx - cr for single port I and C with an initial state x_0 + + + +%DESCRIPTION linear cr for single port I and C with an initial state x0 +%DESCRIPTION only adds x0 if in integral causality + + +OPERATOR linx; + +%% Input causality as specified +%Linear Constitutive Relationship for single port components: C,I. +% e = Gain*f (if gain_causality = flow) +% f = Gain*e (if gain_causality = effort) + +FOR ALL gain_causality, gain, causality, input, other_causality +SUCH THAT (causality = gain_causality) AND (causality = state) +LET linx(gain_causality, gain, x0, other_causality, 1, input, causality, 1) + = gain*(input + x0); + + +FOR ALL gain_causality, gain, causality, input, other_causality +SUCH THAT (causality = gain_causality) AND (causality NEQ state) +LET linx(gain_causality, gain, x0, other_causality, 1, input, causality, 1) + = gain*(input); + +%% Input causality not as specified +%Linear CR: e = (1/Gain)*f (if gain_causality = flow) +% f = (1/Gain)*e (if gain_causality = effort) + +FOR ALL gain_causality, gain, x0, causality, input, other_causality +SUCH THAT (causality NEQ gain_causality) AND (causality = state) +LET linx(gain_causality, gain, x0, other_causality, 1, input, causality, 1) + = (input+x0)/gain; + +FOR ALL gain_causality, gain, x0, causality, input, other_causality +SUCH THAT (causality NEQ gain_causality) AND (causality NEQ state) +LET linx(gain_causality, gain, x0, other_causality, 1, input, causality, 1) + = (input)/gain; + + + + +END;; ADDED mtt/lib/cr/r/lsin.cr Index: mtt/lib/cr/r/lsin.cr ================================================================== --- mtt/lib/cr/r/lsin.cr +++ mtt/lib/cr/r/lsin.cr @@ -0,0 +1,55 @@ +%SUMMARY lsin linear constitutive relationship with sin modulation +%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 +%DESCRIPTION value is effort, flow or state +%DESCRIPTION Parameter 2 is the gain corresponding to the causality of +%DESCRIPTION parameter 1. +%DESCRIPTION Supported components: + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Linear constitutive relationship with sin modulation + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/03/04 17:51:37 peterg +% %% Added END +% %% +% %% Revision 1.1 1996/11/02 10:18:25 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +OPERATOR lsin; + +%DESCRIPTION three port component: EMTF +FOR ALL comp_type, gain, input, causality, gain_causality, outport, inport, + m_input, m_causality +SUCH THAT ( + (causality = gain_causality) AND (outport = 2) + OR + (causality NEQ gain_causality) AND (outport = 1) + ) +LET lsin(comp_type, gain_causality, gain, causality, outport, + input, causality, inport, + m_input, m_causality, 3) + = sin(m_input)*gain*input; + +FOR ALL comp_type, gain, input, causality, gain_causality, outport, inport, + m_input, m_causality +SUCH THAT ( + (causality NEQ gain_causality) AND (outport = 2) + OR + (causality = gain_causality) AND (outport = 1) + ) +LET lsin(comp_type, gain_causality, gain, causality, outport, + input, causality, inport, + m_input, m_causality, 3) + = input/(sin(m_input)*gain); + +END;; ADDED mtt/lib/cr/r/oneway.cr Index: mtt/lib/cr/r/oneway.cr ================================================================== --- mtt/lib/cr/r/oneway.cr +++ mtt/lib/cr/r/oneway.cr @@ -0,0 +1,26 @@ +%SUMMARY oneway One way constitutive relationship eg Diode +%DESCRIPTION Parameter 1 is a large number being the forward gain +%DESCRIPTION -- the reciprocal is the backward gain +%DESCRIPTION The input must be an effort +%DESCRIPTION Typical use is an R component with effort input + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +OPERATOR oneway; + +%Input has flow causality +FOR ALL r, input +LET oneway(r, effort, 1, input, flow, 1) + = ((1 - sign(input))/2)*r*input; + +%Input has effort causality +FOR ALL r, input +LET oneway(r, flow, 1, input, effort, 1) + = ((1 - sign(input))/2)*(1/r)*input; + ADDED mtt/lib/cr/r/polytrop.cr Index: mtt/lib/cr/r/polytrop.cr ================================================================== --- mtt/lib/cr/r/polytrop.cr +++ mtt/lib/cr/r/polytrop.cr @@ -0,0 +1,41 @@ +%SUMMARY polytrop CR for gas turbine compressor + + +OPERATOR polytrop; + +% Port 1 generates zero flow +FOR ALL Ipressure,temperature,Fpressure,gamma,enthflow +LET polytrop(gamma, flow, 1, + Fpressure,effort,1, + enthflow,flow,2, + temperature,effort,3, + Ipressure,effort,4) + = 0; + +% Port 2 generates deltaT +FOR ALL Ipressure,temperature,Fpressure,gamma,enthflow +LET polytrop(gamma, effort, 2, + Fpressure,effort,1, + enthflow,flow,2, + temperature,effort,3, + Ipressure,effort,4) + = temperature*((Ipressure/Fpressure)^(gamma)-1); + +% Port 3 generates zero flow +FOR ALL Ipressure,temperature,Fpressure,gamma,enthflow +LET polytrop(gamma, flow, 3, + Fpressure,effort,1, + enthflow,flow,2, + temperature,effort,3, + Ipressure,effort,4) + = 0; + +% Port 4 generates zero flow +FOR ALL Ipressure,temperature,Fpressure,gamma,enthflow +LET polytrop(gamma, flow, 4, + Fpressure,effort,1, + enthflow,flow,2, + temperature,effort,3, + Ipressure,effort,4) + = 0; + ADDED mtt/lib/cr/r/powerlaw.cr Index: mtt/lib/cr/r/powerlaw.cr ================================================================== --- mtt/lib/cr/r/powerlaw.cr +++ mtt/lib/cr/r/powerlaw.cr @@ -0,0 +1,26 @@ +%SUMMARY powerlaw powerlaw constitutive relationship +%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 +%DESCRIPTION value is effort or flow +%DESCRIPTION Parameter 2 is the gain r corresponding to the causality of +%DESCRIPTION parameter 1. +%DESCRIPTION Supported components: + + +%DESCRIPTION single port components: R + +%Powerlaw Constitutive Relationship for single port components: R + + +OPERATOR powerlaw; +FOR ALL gain_causality, gain, power, causality, input, other_causality +SUCH THAT causality = gain_causality +LET powerlaw(gain_causality, gain, power, other_causality, 1, input, causality, 1) + = gain*(abs(input)^power)*sign(input); + + +FOR ALL gain_causality, gain, power, causality, input, other_causality +SUCH THAT causality NEQ gain_causality +LET powerlaw(gain_causality, gain, power, other_causality, 1, input, causality, 1) + = ( (abs(input)/gain)^(1/power) )*sign(input); + +END; ADDED mtt/lib/cr/r/reed.cr Index: mtt/lib/cr/r/reed.cr ================================================================== --- mtt/lib/cr/r/reed.cr +++ mtt/lib/cr/r/reed.cr @@ -0,0 +1,40 @@ +%SUMMARY reed Nonlinear 2-port R for musical reed component + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Linear constitutive relationship. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/11/02 10:21:19 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/09/12 11:18:26 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Linear Constitutive Relationship for reed - unicausal case with +% pressure output. +OPERATOR reed,abs,sign; + +% Port 1 - the modulated R +FOR ALL D,q,H,airflow,displacement +LET reed(D,q,H, effort, 1, + airflow,flow,1, + displacement, effort,2) + = (D*sign(airflow)*(airflow)^q)/((H-displacement)^2); + +% Port 2 - zero flow +FOR ALL D,q,H,airflow,displacement +LET reed(D,q, flow, 2, + airflow,flow,1, + displacement, effort,2) + =0; + ADDED mtt/lib/cr/r/sat_tank.cr Index: mtt/lib/cr/r/sat_tank.cr ================================================================== --- mtt/lib/cr/r/sat_tank.cr +++ mtt/lib/cr/r/sat_tank.cr @@ -0,0 +1,26 @@ +%SUMMARY sat_tank Saturation nonlinearity with variable slopes for tank +%DESCRIPTION Parameter 1 is the slope of the "normal" linear part of the CR +%DESCRIPTION Parameter 2 is the "large" slope +%DESCRIPTION Parameter 3 is the lower bound of the state +%DESCRIPTION Parameter 4 is the upper bound of the state + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +OPERATOR sign0; +FOR ALL x + LET sign0(x) = (sign(x)+1)/2; + +OPERATOR sat_tank; +%Output has effort causality, input is state +FOR ALL k_0, k_1, x_0, x_1, x +LET sat_tank(k_0, k_1, x_0, x_1, effort, 1, + x, state, 1) + = x*k_0 + (x-x_1)*(k_1-k_0)*sign0(x-x_1) + (x-x_0)*(k_1-k_0)*sign0(x_0-x); + + ADDED mtt/lib/cr/r/slcos.cr Index: mtt/lib/cr/r/slcos.cr ================================================================== --- mtt/lib/cr/r/slcos.cr +++ mtt/lib/cr/r/slcos.cr @@ -0,0 +1,29 @@ +%SUMMARY slcos linear constitutive relationship with sin modulation - sensitivity +%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 +%DESCRIPTION value is effort, flow or state +%DESCRIPTION Parameter 2 is the gain corresponding to the causality of +%DESCRIPTION parameter 1. +%DESCRIPTION Supported components: + + +OPERATOR slcos; + +%DESCRIPTION four port component - effort i/o +FOR ALL gain, input, junk, m_input, dm_input +LET slcos(gain, effort, 2, + input, effort, 1, + junk, flow, 2, + m_input, effort, 3, + dm_input,effort, 4) + = -gain*sin(m_input)*dm_input*input; + +%DESCRIPTION four port component - flow i/o +FOR ALL gain, input, junk, m_input, dm_input +LET slcos(gain, flow, 2, + input, flow, 1, + junk, effort, 2, + m_input, effort, 3, + dm_input,effort, 4) + = -gain*sin(m_input)*dm_input*input; + +END;; ADDED mtt/lib/cr/r/slin.cr Index: mtt/lib/cr/r/slin.cr ================================================================== --- mtt/lib/cr/r/slin.cr +++ mtt/lib/cr/r/slin.cr @@ -0,0 +1,71 @@ +%DESCRIPTION Sensitivity version of lin + +in "$MTT_CRS/r/lin.cr"; + +% One port version for historical reasons +OPERATOR slin; +FOR ALL gain_causality, gain, causality, input, other_causality +LET slin(gain_causality, gain, other_causality, 1, input, causality, 1) + = lin(gain_causality, gain, other_causality, 1, input, + causality, 1); + +% Two port version for sC,sI,sR + +% Port 1 - standard +FOR ALL COMPONENT, gain_causality, gain, sgain, causality, input, sinput, other_causality +LET slin(COMPONENT,gain_causality, gain, sgain, other_causality, 1, + input, causality, 1, + sinput, causality, 2) + = lin(COMPONENT,gain_causality, gain, other_causality, 1, + input, causality, 1); + + +% Port 2 - sensitivity +FOR ALL COMPONENT, gain_causality, gain, sgain, causality, input, sinput, other_causality +SUCH THAT sgain NEQ 0 +LET slin(COMPONENT,gain_causality, gain, sgain, other_causality, 2, + input, causality, 1, + sinput, causality, 2) + = lin(COMPONENT,gain_causality, gain, other_causality, 1, + sinput, causality, 1) + + sgain*df(lin(COMPONENT,gain_causality, gain, other_causality, 1, + input, causality, 1), gain); + +%% Don't compute the derivative in this case +FOR ALL COMPONENT, gain_causality, gain, sgain, causality, input, sinput, other_causality +SUCH THAT sgain EQ 0 +LET slin(COMPONENT,gain_causality, gain, sgain, other_causality, 2, + input, causality, 1, + sinput, causality, 2) + = lin(COMPONENT,gain_causality, gain, other_causality, 1, + sinput, causality, 1); + + +%% This is the version to go with sEMTF +%% It is the CR passed to the AE3 components + +%DESCRIPTION four port component - effort i/o +FOR ALL COMPONENT, gain, input, junk, m_input, dm_input +LET slin(COMPONENT,gain, effort, 2, + input, effort, 1, + junk, flow, 2, + m_input, effort, 3, + dm_input,effort, 4) + = gain*dm_input*input; + +%DESCRIPTION four port component - flow i/o +FOR ALL COMPONENT, gain, input, junk, m_input, dm_input +LET slin(COMPONENT,gain, flow, 2, + input, flow, 1, + junk, effort, 2, + m_input, effort, 3, + dm_input,effort, 4) + = gain*dm_input*input; + +END;; + + + + + + ADDED mtt/lib/cr/r/slsin.cr Index: mtt/lib/cr/r/slsin.cr ================================================================== --- mtt/lib/cr/r/slsin.cr +++ mtt/lib/cr/r/slsin.cr @@ -0,0 +1,29 @@ +%SUMMARY slsin linear constitutive relationship with sin modulation - sensitivity +%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 +%DESCRIPTION value is effort, flow or state +%DESCRIPTION Parameter 2 is the gain corresponding to the causality of +%DESCRIPTION parameter 1. +%DESCRIPTION Supported components: + + +OPERATOR slsin; + +%DESCRIPTION four port component - effort i/o +FOR ALL gain, input, junk, m_input, dm_input +LET slsin(gain, effort, 2, + input, effort, 1, + junk, flow, 2, + m_input, effort, 3, + dm_input,effort, 4) + = gain*cos(m_input)*dm_input*input; + +%DESCRIPTION four port component - flow i/o +FOR ALL gain, input, junk, m_input, dm_input +LET slsin(gain, flow, 2, + input, flow, 1, + junk, effort, 2, + m_input, effort, 3, + dm_input,effort, 4) + = gain*cos(m_input)*dm_input*input; + +END;; ADDED mtt/lib/cr/r/square.cr Index: mtt/lib/cr/r/square.cr ================================================================== --- mtt/lib/cr/r/square.cr +++ mtt/lib/cr/r/square.cr @@ -0,0 +1,31 @@ +%SUMMARY square square-law constitutive relationship +%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 +%DESCRIPTION value is effort or flow +%DESCRIPTION Parameter 2 is the gain r corresponding to the causality of +%DESCRIPTION parameter 1. +%DESCRIPTION Supported components: + + +%DESCRIPTION single port components: R + +%Square-Law Constitutive Relationship for single port components: R +% output = Gain*input^2*sign(input) {if gain_causality = causality} +% output = (1/Gain^(1/2))*input^(1/2)*sign(input) +% {if gain_causality not= causality} + + + +OPERATOR square; +FOR ALL gain_causality, gain, causality, input, other_causality +SUCH THAT causality = gain_causality +LET square(gain_causality, gain, other_causality, 1, input, causality, 1) + = gain*input^2*sign(input); + + +FOR ALL gain_causality, gain, causality, input, other_causality +SUCH THAT causality NEQ gain_causality +LET square(gain_causality, gain, other_causality, 1, input, causality, 1) + = input^(1/2)*sign(input)/(gain^(1/2)); + + +END; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Comb_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Comb_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Comb_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Comb_abg.m @@ -0,0 +1,125 @@ +function [Comb] = Comb_abg +# This function is the acausal bond graph representation of Comb +# Generated by MTT on Thu Mar 16 10:33:30 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port Hydraulic_in + Comb.ports.Hydraulic_in.type = "SS"; + Comb.ports.Hydraulic_in.cr = "SS"; + Comb.ports.Hydraulic_in.arg = "external,external"; + Comb.ports.Hydraulic_in.repetitions = 1; + Comb.ports.Hydraulic_in.status = -1; + Comb.ports.Hydraulic_in.connections = [-3 ]; + +# Port Hydraulic_out + Comb.ports.Hydraulic_out.type = "SS"; + Comb.ports.Hydraulic_out.cr = "SS"; + Comb.ports.Hydraulic_out.arg = "external,external"; + Comb.ports.Hydraulic_out.repetitions = 1; + Comb.ports.Hydraulic_out.status = -1; + Comb.ports.Hydraulic_out.connections = [7 ]; + +# Port Heat + Comb.ports.Heat.type = "SS"; + Comb.ports.Heat.cr = "SS"; + Comb.ports.Heat.arg = "external,external"; + Comb.ports.Heat.repetitions = 1; + Comb.ports.Heat.status = -1; + Comb.ports.Heat.connections = [-5 ]; + +# Port Thermal_in + Comb.ports.Thermal_in.type = "SS"; + Comb.ports.Thermal_in.cr = "SS"; + Comb.ports.Thermal_in.arg = "external,external"; + Comb.ports.Thermal_in.repetitions = 1; + Comb.ports.Thermal_in.status = -1; + Comb.ports.Thermal_in.connections = [-2 ]; + +# Port Thermal_out + Comb.ports.Thermal_out.type = "SS"; + Comb.ports.Thermal_out.cr = "SS"; + Comb.ports.Thermal_out.arg = "external,external"; + Comb.ports.Thermal_out.repetitions = 1; + Comb.ports.Thermal_out.status = -1; + Comb.ports.Thermal_out.connections = [6 ]; + +# Component P + Comb.subsystems.P.type = "SS"; + Comb.subsystems.P.cr = "SS"; + Comb.subsystems.P.arg = "external,0"; + Comb.subsystems.P.repetitions = 1; + Comb.subsystems.P.status = -1; + Comb.subsystems.P.connections = [9 ]; + +# Component T + Comb.subsystems.T.type = "SS"; + Comb.subsystems.T.cr = "SS"; + Comb.subsystems.T.arg = "external,0"; + Comb.subsystems.T.repetitions = 1; + Comb.subsystems.T.status = -1; + Comb.subsystems.T.connections = [8 ]; + +# Component pipe + Comb.subsystems.pipe.type = "hPipe"; + Comb.subsystems.pipe.cr = "none"; + Comb.subsystems.pipe.arg = "m_c;v_c;r"; + Comb.subsystems.pipe.repetitions = 1; + Comb.subsystems.pipe.status = -1; + Comb.subsystems.pipe.connections = [5 3 -4 2 -1 ]; + +# Component mtt1 + Comb.subsystems.mtt1.type = "0"; + Comb.subsystems.mtt1.cr = ""; + Comb.subsystems.mtt1.arg = ""; + Comb.subsystems.mtt1.repetitions = 1; + Comb.subsystems.mtt1.status = -1; + Comb.subsystems.mtt1.connections = [1 -6 -8 ]; + +# Component mtt2 + Comb.subsystems.mtt2.type = "0"; + Comb.subsystems.mtt2.cr = ""; + Comb.subsystems.mtt2.arg = ""; + Comb.subsystems.mtt2.repetitions = 1; + Comb.subsystems.mtt2.status = -1; + Comb.subsystems.mtt2.connections = [4 -7 -9 ]; + +# Ordered list of Port names + Comb.portlist(1,:) = "Hydraulic_in "; + Comb.portlist(2,:) = "Hydraulic_out"; + Comb.portlist(3,:) = "Heat "; + Comb.portlist(4,:) = "Thermal_in "; + Comb.portlist(5,:) = "Thermal_out "; + +# Ordered list of subsystem names + Comb.subsystemlist(1,:) = "P "; + Comb.subsystemlist(2,:) = "T "; + Comb.subsystemlist(3,:) = "pipe"; + Comb.subsystemlist(4,:) = "mtt1"; + Comb.subsystemlist(5,:) = "mtt2"; + +# Bonds + Comb.bonds = [ + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 1 1 + 1 1 + ]; + +# Aliases +# A double underscore __ represents a comma +Comb.alias.out = "Thermal_out,Hydraulic_out"; +Comb.alias.Hy_out = "Hydraulic_out"; +Comb.alias.v_c = "$2"; +Comb.alias.Th_in = "Thermal_in"; +Comb.alias.r = "$3"; +Comb.alias.Th_out = "Thermal_out"; +Comb.alias.in = "Thermal_in,Hydraulic_in"; +Comb.alias.Hy_in = "Hydraulic_in"; +Comb.alias.m_c = "$1"; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_abg.m @@ -0,0 +1,81 @@ +function [Density] = Density_abg +# This function is the acausal bond graph representation of Density +# Generated by MTT on Thu Mar 16 10:36:39 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port Pressure + Density.ports.Pressure.type = "SS"; + Density.ports.Pressure.cr = "SS"; + Density.ports.Pressure.arg = "external,external"; + Density.ports.Pressure.repetitions = 1; + Density.ports.Pressure.status = -1; + Density.ports.Pressure.connections = [-4 ]; + +# Port Temperature + Density.ports.Temperature.type = "SS"; + Density.ports.Temperature.cr = "SS"; + Density.ports.Temperature.arg = "external,external"; + Density.ports.Temperature.repetitions = 1; + Density.ports.Temperature.status = -1; + Density.ports.Temperature.connections = [-5 ]; + +# Port Density + Density.ports.Density.type = "SS"; + Density.ports.Density.cr = "SS"; + Density.ports.Density.arg = "external,external"; + Density.ports.Density.repetitions = 1; + Density.ports.Density.status = -1; + Density.ports.Density.connections = [3 ]; + +# Component r + Density.subsystems.r.type = "R"; + Density.subsystems.r.cr = "Density"; + Density.subsystems.r.arg = "density,ideal_gas,r"; + Density.subsystems.r.repetitions = 1; + Density.subsystems.r.status = -1; + Density.subsystems.r.connections = [1 2 -3 ]; + +# Component mtt1 + Density.subsystems.mtt1.type = "AE"; + Density.subsystems.mtt1.cr = ""; + Density.subsystems.mtt1.arg = ""; + Density.subsystems.mtt1.repetitions = 1; + Density.subsystems.mtt1.status = -1; + Density.subsystems.mtt1.connections = [4 -1 ]; + +# Component mtt2 + Density.subsystems.mtt2.type = "AE"; + Density.subsystems.mtt2.cr = ""; + Density.subsystems.mtt2.arg = ""; + Density.subsystems.mtt2.repetitions = 1; + Density.subsystems.mtt2.status = -1; + Density.subsystems.mtt2.connections = [5 -2 ]; + +# Ordered list of Port names + Density.portlist(1,:) = "Pressure "; + Density.portlist(2,:) = "Temperature"; + Density.portlist(3,:) = "Density "; + +# Ordered list of subsystem names + Density.subsystemlist(1,:) = "r "; + Density.subsystemlist(2,:) = "mtt1"; + Density.subsystemlist(3,:) = "mtt2"; + +# Bonds + Density.bonds = [ + 1 1 + 1 1 + 1 1 + 0 0 + 0 0 + ]; + +# Aliases +# A double underscore __ represents a comma +Density.alias.P = "Pressure"; +Density.alias.out = "Density"; +Density.alias.rho = "Density"; +Density.alias.T = "Temperature"; +Density.alias.density__ideal_gas__r = "$1"; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_cr.r Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_cr.r ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_cr.r +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_cr.r @@ -0,0 +1,36 @@ +% Constitutive relation file for Density (Density_cr.r) +% Generated by MTT at Wed Mar 11 11:01:28 GMT 1998 + +OPERATOR Density; + +% Ideal gas +FOR ALL R,Temperature,Pressure,Nothing +LET Density(density,ideal_gas,R,effort,3, + Pressure,effort,1, + Temperature,effort,2, + Nothing,flow,3 + ) = Pressure/(R*Temperature); + +FOR ALL R,Temperature,Pressure,Nothing +LET Density(specific_volume,ideal_gas,R,effort,3, + Pressure,effort,1, + Temperature,effort,2, + Nothing,flow,3 + ) = (R*Temperature)/Pressure; + +% Incompressible +FOR ALL rho,Temperature,Pressure,Nothing +LET Density(density,incompressible,rho,effort,3, + Pressure,effort,1, + Temperature,effort,2, + Nothing,flow,3 + ) = rho; + +FOR ALL rho,Temperature,Pressure,Nothing +LET Density(specific_volume,incompressible,rho,effort,3, + Pressure,effort,1, + Temperature,effort,2, + Nothing,flow,3 + ) = 1/rho; + +END; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/In_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/In_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/In_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/In_abg.m @@ -0,0 +1,57 @@ +function [In] = In_abg +# This function is the acausal bond graph representation of In +# Generated by MTT on Thu Mar 16 10:33:58 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port Hy_out + In.ports.Hy_out.type = "SS"; + In.ports.Hy_out.cr = "SS"; + In.ports.Hy_out.arg = "external,external"; + In.ports.Hy_out.repetitions = 1; + In.ports.Hy_out.status = -1; + In.ports.Hy_out.connections = [2 ]; + +# Port Th_out + In.ports.Th_out.type = "SS"; + In.ports.Th_out.cr = "SS"; + In.ports.Th_out.arg = "external,external"; + In.ports.Th_out.repetitions = 1; + In.ports.Th_out.status = -1; + In.ports.Th_out.connections = [1 ]; + +# Component Hy_in + In.subsystems.Hy_in.type = "SS"; + In.subsystems.Hy_in.cr = "SS"; + In.subsystems.Hy_in.arg = "p_1,internal"; + In.subsystems.Hy_in.repetitions = 1; + In.subsystems.Hy_in.status = -1; + In.subsystems.Hy_in.connections = [-2 ]; + +# Component Th_in + In.subsystems.Th_in.type = "SS"; + In.subsystems.Th_in.cr = "SS"; + In.subsystems.Th_in.arg = "t_1,internal"; + In.subsystems.Th_in.repetitions = 1; + In.subsystems.Th_in.status = -1; + In.subsystems.Th_in.connections = [-1 ]; + +# Ordered list of Port names + In.portlist(1,:) = "Hy_out"; + In.portlist(2,:) = "Th_out"; + +# Ordered list of subsystem names + In.subsystemlist(1,:) = "Hy_in"; + In.subsystemlist(2,:) = "Th_in"; + +# Bonds + In.bonds = [ + 1 1 + 1 1 + ]; + +# Aliases +# A double underscore __ represents a comma +In.alias.out = "Th_out,Hy_out"; +In.alias.in = "Th_out,Hy_out"; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/In_desc.tex Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/In_desc.tex ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/In_desc.tex +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/In_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system In (In_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:36 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{In} is + displayed in Figure \Ref{In_abg} and its label + file is listed in Section \Ref{sec:In_lbl}. + The subsystems are listed in Section \Ref{sec:In_sub}. ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Load_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Load_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Load_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Load_abg.m @@ -0,0 +1,60 @@ +function [Load] = Load_abg +# This function is the acausal bond graph representation of Load +# Generated by MTT on Thu Mar 16 10:34:27 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port in + Load.ports.in.type = "SS"; + Load.ports.in.cr = "SS"; + Load.ports.in.arg = "external,external"; + Load.ports.in.repetitions = 1; + Load.ports.in.status = -1; + Load.ports.in.connections = [-1 ]; + +# Port out + Load.ports.out.type = "SS"; + Load.ports.out.cr = "SS"; + Load.ports.out.arg = "external,external"; + Load.ports.out.repetitions = 1; + Load.ports.out.status = -1; + Load.ports.out.connections = [3 ]; + +# Component PowerSensor + Load.subsystems.PowerSensor.type = "PS"; + Load.subsystems.PowerSensor.cr = ""; + Load.subsystems.PowerSensor.arg = ""; + Load.subsystems.PowerSensor.repetitions = 1; + Load.subsystems.PowerSensor.status = -1; + Load.subsystems.PowerSensor.connections = [1 -2 -3 ]; + +# Component r_l + Load.subsystems.r_l.type = "R"; + Load.subsystems.r_l.cr = "lin"; + Load.subsystems.r_l.arg = "flow,r_l"; + Load.subsystems.r_l.repetitions = 1; + Load.subsystems.r_l.status = -1; + Load.subsystems.r_l.connections = [2 ]; + +# Ordered list of Port names + Load.portlist(1,:) = "in "; + Load.portlist(2,:) = "out"; + +# Ordered list of subsystem names + Load.subsystemlist(1,:) = "PowerSensor"; + Load.subsystemlist(2,:) = "r_l "; + +# Bonds + Load.bonds = [ + 0 0 + 0 0 + 0 0 + ]; + +# Aliases +# A double underscore __ represents a comma +Load.alias.out = "out"; +Load.alias.r_l = "$2"; +Load.alias.in = "in"; +Load.alias.PowerSensor = "$1"; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_abg.m @@ -0,0 +1,56 @@ +function [Out] = Out_abg +# This function is the acausal bond graph representation of Out +# Generated by MTT on Thu Mar 16 10:34:51 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port Hy_in + Out.ports.Hy_in.type = "SS"; + Out.ports.Hy_in.cr = "SS"; + Out.ports.Hy_in.arg = "external,external"; + Out.ports.Hy_in.repetitions = 1; + Out.ports.Hy_in.status = -1; + Out.ports.Hy_in.connections = [-1 ]; + +# Port Th_in + Out.ports.Th_in.type = "SS"; + Out.ports.Th_in.cr = "SS"; + Out.ports.Th_in.arg = "external,external"; + Out.ports.Th_in.repetitions = 1; + Out.ports.Th_in.status = -1; + Out.ports.Th_in.connections = [-2 ]; + +# Component Hy_out + Out.subsystems.Hy_out.type = "SS"; + Out.subsystems.Hy_out.cr = "SS"; + Out.subsystems.Hy_out.arg = "p_1,internal"; + Out.subsystems.Hy_out.repetitions = 1; + Out.subsystems.Hy_out.status = -1; + Out.subsystems.Hy_out.connections = [1 ]; + +# Component Th_out + Out.subsystems.Th_out.type = "SS"; + Out.subsystems.Th_out.cr = "SS"; + Out.subsystems.Th_out.arg = "t_1,internal"; + Out.subsystems.Th_out.repetitions = 1; + Out.subsystems.Th_out.status = -1; + Out.subsystems.Th_out.connections = [2 ]; + +# Ordered list of Port names + Out.portlist(1,:) = "Hy_in"; + Out.portlist(2,:) = "Th_in"; + +# Ordered list of subsystem names + Out.subsystemlist(1,:) = "Hy_out"; + Out.subsystemlist(2,:) = "Th_out"; + +# Bonds + Out.bonds = [ + -1 -1 + -1 -1 + ]; + +# Aliases +# A double underscore __ represents a comma +Out.alias.in = "Th_in,Hy_in"; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_desc.tex Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_desc.tex ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_desc.tex +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system Out (Out_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:44 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Out} is + displayed in Figure \Ref{Out_abg} and its label + file is listed in Section \Ref{sec:Out_lbl}. + The subsystems are listed in Section \Ref{sec:Out_sub}. ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_abg.m @@ -0,0 +1,122 @@ +function [Poly] = Poly_abg +# This function is the acausal bond graph representation of Poly +# Generated by MTT on Thu Mar 16 10:35:48 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port Pressure_1 + Poly.ports.Pressure_1.type = "SS"; + Poly.ports.Pressure_1.cr = "SS"; + Poly.ports.Pressure_1.arg = "external,external"; + Poly.ports.Pressure_1.repetitions = 1; + Poly.ports.Pressure_1.status = -1; + Poly.ports.Pressure_1.connections = [-2 ]; + +# Port Temperature_1 + Poly.ports.Temperature_1.type = "SS"; + Poly.ports.Temperature_1.cr = "SS"; + Poly.ports.Temperature_1.arg = "external,external"; + Poly.ports.Temperature_1.repetitions = 1; + Poly.ports.Temperature_1.status = -1; + Poly.ports.Temperature_1.connections = [-6 ]; + +# Port Pressure_2 + Poly.ports.Pressure_2.type = "SS"; + Poly.ports.Pressure_2.cr = "SS"; + Poly.ports.Pressure_2.arg = "external,external"; + Poly.ports.Pressure_2.repetitions = 1; + Poly.ports.Pressure_2.status = -1; + Poly.ports.Pressure_2.connections = [-4 ]; + +# Port Temperature_2 + Poly.ports.Temperature_2.type = "SS"; + Poly.ports.Temperature_2.cr = "SS"; + Poly.ports.Temperature_2.arg = "external,external"; + Poly.ports.Temperature_2.repetitions = 1; + Poly.ports.Temperature_2.status = -1; + Poly.ports.Temperature_2.connections = [8 ]; + +# Component r + Poly.subsystems.r.type = "R"; + Poly.subsystems.r.cr = "Poly"; + Poly.subsystems.r.arg = "alpha"; + Poly.subsystems.r.repetitions = 1; + Poly.subsystems.r.status = -1; + Poly.subsystems.r.connections = [1 3 5 -7 ]; + +# Component zero + Poly.subsystems.zero.type = "SS"; + Poly.subsystems.zero.cr = "SS"; + Poly.subsystems.zero.arg = "0,0"; + Poly.subsystems.zero.repetitions = 1; + Poly.subsystems.zero.status = -1; + Poly.subsystems.zero.connections = [-9 ]; + +# Component mtt1 + Poly.subsystems.mtt1.type = "AE"; + Poly.subsystems.mtt1.cr = ""; + Poly.subsystems.mtt1.arg = ""; + Poly.subsystems.mtt1.repetitions = 1; + Poly.subsystems.mtt1.status = -1; + Poly.subsystems.mtt1.connections = [2 -1 ]; + +# Component mtt2 + Poly.subsystems.mtt2.type = "AE"; + Poly.subsystems.mtt2.cr = ""; + Poly.subsystems.mtt2.arg = ""; + Poly.subsystems.mtt2.repetitions = 1; + Poly.subsystems.mtt2.status = -1; + Poly.subsystems.mtt2.connections = [4 -3 ]; + +# Component mtt3 + Poly.subsystems.mtt3.type = "AE"; + Poly.subsystems.mtt3.cr = ""; + Poly.subsystems.mtt3.arg = ""; + Poly.subsystems.mtt3.repetitions = 1; + Poly.subsystems.mtt3.status = -1; + Poly.subsystems.mtt3.connections = [6 -5 ]; + +# Component mtt4 + Poly.subsystems.mtt4.type = "1"; + Poly.subsystems.mtt4.cr = ""; + Poly.subsystems.mtt4.arg = ""; + Poly.subsystems.mtt4.repetitions = 1; + Poly.subsystems.mtt4.status = -1; + Poly.subsystems.mtt4.connections = [7 -8 9 ]; + +# Ordered list of Port names + Poly.portlist(1,:) = "Pressure_1 "; + Poly.portlist(2,:) = "Temperature_1"; + Poly.portlist(3,:) = "Pressure_2 "; + Poly.portlist(4,:) = "Temperature_2"; + +# Ordered list of subsystem names + Poly.subsystemlist(1,:) = "r "; + Poly.subsystemlist(2,:) = "zero"; + Poly.subsystemlist(3,:) = "mtt1"; + Poly.subsystemlist(4,:) = "mtt2"; + Poly.subsystemlist(5,:) = "mtt3"; + Poly.subsystemlist(6,:) = "mtt4"; + +# Bonds + Poly.bonds = [ + 1 1 + 0 0 + 1 1 + 0 0 + 1 1 + 0 0 + 0 0 + 0 0 + 1 -1 + ]; + +# Aliases +# A double underscore __ represents a comma +Poly.alias.out = "Temperature_2"; +Poly.alias.P1 = "Pressure_1"; +Poly.alias.P2 = "Pressure_2"; +Poly.alias.T1 = "Temperature_1"; +Poly.alias.T2 = "Temperature_2"; +Poly.alias.alpha = "$1"; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_cr.r Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_cr.r ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_cr.r +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_cr.r @@ -0,0 +1,19 @@ +% Constitutive relation file for Poly (Poly_cr.r) +% Generated by MTT at Wed Mar 11 11:01:28 GMT 1998 + +OPERATOR Poly; + +% Ideal gas + +% Temperature output on port [T2] +FOR ALL alpha,P1,P2,T1,Nothing +LET Poly(alpha,effort,4, + P1,effort,1, + P2,effort,2, + T1,effort,3, + Nothing,flow,4 + ) = T1*(P2/P1)^alpha; + + + +END; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/Pump_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/Pump_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/Pump_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/Pump_abg.m @@ -0,0 +1,180 @@ +function [Pump] = Pump_abg +# This function is the acausal bond graph representation of Pump +# Generated by MTT on Thu Mar 16 10:38:10 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port Hydraulic_in + Pump.ports.Hydraulic_in.type = "SS"; + Pump.ports.Hydraulic_in.cr = "SS"; + Pump.ports.Hydraulic_in.arg = "external,external"; + Pump.ports.Hydraulic_in.repetitions = 1; + Pump.ports.Hydraulic_in.status = -1; + Pump.ports.Hydraulic_in.connections = [-5 ]; + +# Port Hydraulic_out + Pump.ports.Hydraulic_out.type = "SS"; + Pump.ports.Hydraulic_out.cr = "SS"; + Pump.ports.Hydraulic_out.arg = "external,external"; + Pump.ports.Hydraulic_out.repetitions = 1; + Pump.ports.Hydraulic_out.status = -1; + Pump.ports.Hydraulic_out.connections = [6 ]; + +# Port Shaft + Pump.ports.Shaft.type = "SS"; + Pump.ports.Shaft.cr = "SS"; + Pump.ports.Shaft.arg = "external,external"; + Pump.ports.Shaft.repetitions = 1; + Pump.ports.Shaft.status = -1; + Pump.ports.Shaft.connections = [-12 ]; + +# Port Thermal_in + Pump.ports.Thermal_in.type = "SS"; + Pump.ports.Thermal_in.cr = "SS"; + Pump.ports.Thermal_in.arg = "external,external"; + Pump.ports.Thermal_in.repetitions = 1; + Pump.ports.Thermal_in.status = -1; + Pump.ports.Thermal_in.connections = [-4 ]; + +# Port Thermal_out + Pump.ports.Thermal_out.type = "SS"; + Pump.ports.Thermal_out.cr = "SS"; + Pump.ports.Thermal_out.arg = "external,external"; + Pump.ports.Thermal_out.repetitions = 1; + Pump.ports.Thermal_out.status = -1; + Pump.ports.Thermal_out.connections = [16 ]; + +# Component pipe + Pump.subsystems.pipe.type = "wPipe"; + Pump.subsystems.pipe.cr = "none"; + Pump.subsystems.pipe.arg = "c_v;density,ideal_gas,r"; + Pump.subsystems.pipe.repetitions = 1; + Pump.subsystems.pipe.status = -1; + Pump.subsystems.pipe.connections = [3 -7 14 2 -1 ]; + +# Component poly + Pump.subsystems.poly.type = "Poly"; + Pump.subsystems.poly.cr = "Poly"; + Pump.subsystems.poly.arg = "alpha"; + Pump.subsystems.poly.repetitions = 1; + Pump.subsystems.poly.status = -1; + Pump.subsystems.poly.connections = [9 8 11 -10 ]; + +# Component T + Pump.subsystems.T.type = "SS"; + Pump.subsystems.T.cr = "SS"; + Pump.subsystems.T.arg = "external,0"; + Pump.subsystems.T.repetitions = 1; + Pump.subsystems.T.status = -1; + Pump.subsystems.T.connections = [17 ]; + +# Component k_p + Pump.subsystems.k_p.type = "TF"; + Pump.subsystems.k_p.cr = "lin"; + Pump.subsystems.k_p.arg = "flow,k_p"; + Pump.subsystems.k_p.repetitions = 1; + Pump.subsystems.k_p.status = -1; + Pump.subsystems.k_p.connections = [13 -14 ]; + +# Component mtt1 + Pump.subsystems.mtt1.type = "0"; + Pump.subsystems.mtt1.cr = ""; + Pump.subsystems.mtt1.arg = ""; + Pump.subsystems.mtt1.repetitions = 1; + Pump.subsystems.mtt1.status = -1; + Pump.subsystems.mtt1.connections = [1 10 -15 -17 ]; + +# Component mtt2 + Pump.subsystems.mtt2.type = "0"; + Pump.subsystems.mtt2.cr = ""; + Pump.subsystems.mtt2.arg = ""; + Pump.subsystems.mtt2.repetitions = 1; + Pump.subsystems.mtt2.status = -1; + Pump.subsystems.mtt2.connections = [-6 7 -11 ]; + +# Component mtt3 + Pump.subsystems.mtt3.type = "0"; + Pump.subsystems.mtt3.cr = ""; + Pump.subsystems.mtt3.arg = ""; + Pump.subsystems.mtt3.repetitions = 1; + Pump.subsystems.mtt3.status = -1; + Pump.subsystems.mtt3.connections = [-3 5 -9 ]; + +# Component mtt4 + Pump.subsystems.mtt4.type = "0"; + Pump.subsystems.mtt4.cr = ""; + Pump.subsystems.mtt4.arg = ""; + Pump.subsystems.mtt4.repetitions = 1; + Pump.subsystems.mtt4.status = -1; + Pump.subsystems.mtt4.connections = [-2 4 -8 ]; + +# Component mtt5 + Pump.subsystems.mtt5.type = "EBTF"; + Pump.subsystems.mtt5.cr = ""; + Pump.subsystems.mtt5.arg = ""; + Pump.subsystems.mtt5.repetitions = 1; + Pump.subsystems.mtt5.status = -1; + Pump.subsystems.mtt5.connections = [15 -16 ]; + +# Component mtt6 + Pump.subsystems.mtt6.type = "1"; + Pump.subsystems.mtt6.cr = ""; + Pump.subsystems.mtt6.arg = ""; + Pump.subsystems.mtt6.repetitions = 1; + Pump.subsystems.mtt6.status = -1; + Pump.subsystems.mtt6.connections = [12 -13 ]; + +# Ordered list of Port names + Pump.portlist(1,:) = "Hydraulic_in "; + Pump.portlist(2,:) = "Hydraulic_out"; + Pump.portlist(3,:) = "Shaft "; + Pump.portlist(4,:) = "Thermal_in "; + Pump.portlist(5,:) = "Thermal_out "; + +# Ordered list of subsystem names + Pump.subsystemlist(1,:) = "pipe"; + Pump.subsystemlist(2,:) = "poly"; + Pump.subsystemlist(3,:) = "T "; + Pump.subsystemlist(4,:) = "k_p "; + Pump.subsystemlist(5,:) = "mtt1"; + Pump.subsystemlist(6,:) = "mtt2"; + Pump.subsystemlist(7,:) = "mtt3"; + Pump.subsystemlist(8,:) = "mtt4"; + Pump.subsystemlist(9,:) = "mtt5"; + Pump.subsystemlist(10,:) = "mtt6"; + +# Bonds + Pump.bonds = [ + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + -1 -1 + 0 0 + 0 0 + 0 0 + 0 0 + 1 1 + ]; + +# Aliases +# A double underscore __ represents a comma +Pump.alias.out = "Thermal_out,Hydraulic_out"; +Pump.alias.Hy_out = "Hydraulic_out"; +Pump.alias.c_v = "$1"; +Pump.alias.flow__k_p = "$4"; +Pump.alias.Th_in = "Thermal_in"; +Pump.alias.Th_out = "Thermal_out"; +Pump.alias.Work = "Shaft"; +Pump.alias.alpha = "$3"; +Pump.alias.in = "Thermal_in,Hydraulic_in"; +Pump.alias.Hy_in = "Hydraulic_in"; +Pump.alias.density__ideal_gas__r = "$2"; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_abg.m @@ -0,0 +1,165 @@ +function [SimpleGasTurbineABG] = SimpleGasTurbineABG_abg +# This function is the acausal bond graph representation of SimpleGasTurbineABG +# Generated by MTT on Thu Mar 16 12:59:12 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Component c1 + SimpleGasTurbineABG.subsystems.c1.type = "Comb"; + SimpleGasTurbineABG.subsystems.c1.cr = "none"; + SimpleGasTurbineABG.subsystems.c1.arg = "m_c;v_c;r"; + SimpleGasTurbineABG.subsystems.c1.repetitions = 1; + SimpleGasTurbineABG.subsystems.c1.status = -1; + SimpleGasTurbineABG.subsystems.c1.connections = [14 -15 7 10 -11 ]; + +# Component j_s + SimpleGasTurbineABG.subsystems.j_s.type = "I"; + SimpleGasTurbineABG.subsystems.j_s.cr = "lin"; + SimpleGasTurbineABG.subsystems.j_s.arg = "flow,j_s"; + SimpleGasTurbineABG.subsystems.j_s.repetitions = 1; + SimpleGasTurbineABG.subsystems.j_s.status = -1; + SimpleGasTurbineABG.subsystems.j_s.connections = [2 ]; + +# Component comp + SimpleGasTurbineABG.subsystems.comp.type = "Pump"; + SimpleGasTurbineABG.subsystems.comp.cr = "none"; + SimpleGasTurbineABG.subsystems.comp.arg = "c_v;density,ideal_gas,r;alpha;effort,k"; + SimpleGasTurbineABG.subsystems.comp.repetitions = 1; + SimpleGasTurbineABG.subsystems.comp.status = -1; + SimpleGasTurbineABG.subsystems.comp.connections = [16 -14 1 12 -10 ]; + +# Component turb + SimpleGasTurbineABG.subsystems.turb.type = "Pump"; + SimpleGasTurbineABG.subsystems.turb.cr = "none"; + SimpleGasTurbineABG.subsystems.turb.arg = "c_v;density,ideal_gas,r;alpha;effort,k"; + SimpleGasTurbineABG.subsystems.turb.repetitions = 1; + SimpleGasTurbineABG.subsystems.turb.status = -1; + SimpleGasTurbineABG.subsystems.turb.connections = [15 -17 -6 11 -13 ]; + +# Component Work + SimpleGasTurbineABG.subsystems.Work.type = "SS"; + SimpleGasTurbineABG.subsystems.Work.cr = "SS"; + SimpleGasTurbineABG.subsystems.Work.arg = "0,external"; + SimpleGasTurbineABG.subsystems.Work.repetitions = 1; + SimpleGasTurbineABG.subsystems.Work.status = -1; + SimpleGasTurbineABG.subsystems.Work.connections = [4 ]; + +# Component Heat + SimpleGasTurbineABG.subsystems.Heat.type = "SS"; + SimpleGasTurbineABG.subsystems.Heat.cr = "SS"; + SimpleGasTurbineABG.subsystems.Heat.arg = "0,external"; + SimpleGasTurbineABG.subsystems.Heat.repetitions = 1; + SimpleGasTurbineABG.subsystems.Heat.status = -1; + SimpleGasTurbineABG.subsystems.Heat.connections = [9 ]; + +# Component Speed + SimpleGasTurbineABG.subsystems.Speed.type = "SS"; + SimpleGasTurbineABG.subsystems.Speed.cr = "SS"; + SimpleGasTurbineABG.subsystems.Speed.arg = "0,external"; + SimpleGasTurbineABG.subsystems.Speed.repetitions = 1; + SimpleGasTurbineABG.subsystems.Speed.status = -1; + SimpleGasTurbineABG.subsystems.Speed.connections = [5 ]; + +# Component T3 + SimpleGasTurbineABG.subsystems.T3.type = "SS"; + SimpleGasTurbineABG.subsystems.T3.cr = "SS"; + SimpleGasTurbineABG.subsystems.T3.arg = "external,external"; + SimpleGasTurbineABG.subsystems.T3.repetitions = 1; + SimpleGasTurbineABG.subsystems.T3.status = -1; + SimpleGasTurbineABG.subsystems.T3.connections = [-8 ]; + +# Component in + SimpleGasTurbineABG.subsystems.in.type = "In"; + SimpleGasTurbineABG.subsystems.in.cr = ""; + SimpleGasTurbineABG.subsystems.in.arg = ""; + SimpleGasTurbineABG.subsystems.in.repetitions = 1; + SimpleGasTurbineABG.subsystems.in.status = -1; + SimpleGasTurbineABG.subsystems.in.connections = [-16 -12 ]; + +# Component out + SimpleGasTurbineABG.subsystems.out.type = "Out"; + SimpleGasTurbineABG.subsystems.out.cr = ""; + SimpleGasTurbineABG.subsystems.out.arg = ""; + SimpleGasTurbineABG.subsystems.out.repetitions = 1; + SimpleGasTurbineABG.subsystems.out.status = -1; + SimpleGasTurbineABG.subsystems.out.connections = [17 13 ]; + +# Component mtt1 + SimpleGasTurbineABG.subsystems.mtt1.type = "1"; + SimpleGasTurbineABG.subsystems.mtt1.cr = ""; + SimpleGasTurbineABG.subsystems.mtt1.arg = ""; + SimpleGasTurbineABG.subsystems.mtt1.repetitions = 1; + SimpleGasTurbineABG.subsystems.mtt1.status = -1; + SimpleGasTurbineABG.subsystems.mtt1.connections = [-1 -2 -3 -5 6 ]; + +# Component mtt2 + SimpleGasTurbineABG.subsystems.mtt2.type = "Load"; + SimpleGasTurbineABG.subsystems.mtt2.cr = ""; + SimpleGasTurbineABG.subsystems.mtt2.arg = ""; + SimpleGasTurbineABG.subsystems.mtt2.repetitions = 1; + SimpleGasTurbineABG.subsystems.mtt2.status = -1; + SimpleGasTurbineABG.subsystems.mtt2.connections = [3 -4 ]; + +# Component mtt3 + SimpleGasTurbineABG.subsystems.mtt3.type = "PS"; + SimpleGasTurbineABG.subsystems.mtt3.cr = ""; + SimpleGasTurbineABG.subsystems.mtt3.arg = ""; + SimpleGasTurbineABG.subsystems.mtt3.repetitions = 1; + SimpleGasTurbineABG.subsystems.mtt3.status = -1; + SimpleGasTurbineABG.subsystems.mtt3.connections = [8 -7 -9 ]; + +# Ordered list of subsystem names + SimpleGasTurbineABG.subsystemlist(1,:) = "c1 "; + SimpleGasTurbineABG.subsystemlist(2,:) = "j_s "; + SimpleGasTurbineABG.subsystemlist(3,:) = "comp "; + SimpleGasTurbineABG.subsystemlist(4,:) = "turb "; + SimpleGasTurbineABG.subsystemlist(5,:) = "Work "; + SimpleGasTurbineABG.subsystemlist(6,:) = "Heat "; + SimpleGasTurbineABG.subsystemlist(7,:) = "Speed"; + SimpleGasTurbineABG.subsystemlist(8,:) = "T3 "; + SimpleGasTurbineABG.subsystemlist(9,:) = "in "; + SimpleGasTurbineABG.subsystemlist(10,:) = "out "; + SimpleGasTurbineABG.subsystemlist(11,:) = "mtt1 "; + SimpleGasTurbineABG.subsystemlist(12,:) = "mtt2 "; + SimpleGasTurbineABG.subsystemlist(13,:) = "mtt3 "; + +# Bonds + SimpleGasTurbineABG.bonds = [ + 0 0 + 1 1 + 0 0 + -1 -1 + -1 -1 + 0 0 + 0 0 + 1 1 + -1 -1 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + ]; + +# Aliases +# A double underscore __ represents a comma +# Explicit variable declarations +#VAR t_2 +#VAR t_3 +#VAR t_4 +#VAR p_2 +#VAR p_3 +#VAR p_4 +#VAR mdot +#VAR gamma_0 +#VAR q_0 +#VAR w_0 +#VAR omega_0 +#VAR r_p +#VAR c_p +#VAR mom_0 +endfunction ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_desc.tex Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_desc.tex ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_desc.tex +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_desc.tex @@ -0,0 +1,123 @@ +% -*-latex-*- used to set EMACS into LaTeX-mode +% Verbal description for system SimpleGasTurbineABG (SimpleGasTurbineABG_desc.tex) +% Generated by MTT on Tue Jan 13 18:01:55 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/05/18 15:45:50 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{SimpleGasTurbineABG} is + displayed in Figure \Ref{SimpleGasTurbineABG_abg} and its label + file is listed in Section \Ref{sec:SimpleGasTurbineABG_lbl}. + The subsystems are listed in Section \Ref{sec:SimpleGasTurbineABG_sub}. + + \textbf{SimpleGasTurbineABG} can be regarded as an single-spool gas + turbine (producing shaft power) with an ideal-gas working fluid. It + corresponds to the simple Joule Cycle as described in Chapter 12 of + Rogers and Mayhew and in Chapter 2 of Cohen, Rogers and + Saravanamutto. However, unlike those examples, the system is + written with dynamics in mind. + + The system is described using an energy Bond Graph- this ensures + that the first law is observed. In particular transformers are used + to explicitly convert between energy covariables. Although this is + a simple model, I believe that it provides the basis for building + complex thermodynamic systems involving gas power cycles. + + +There are five main components: +\begin{enumerate} +\item p1 -- a \textbf{Pump} component representing the compressor + stage. This converts shaft work to energy flow in the working fluid. +\item c1 -- a \textbf{Comb} component representing the combustion + chamber. This converts the heat obtained by burning fuel to energy + flow in the working fluid. +\item t1 -- a \textbf{Turb} component representing the turbine + component. This converts the energy flow in the working fluid to + shaft work +\item j\_s -- an \textbf{I} component representing the combined inertia + of the shaft and compressor and turbine rotors. +\item a \textbf{Load} component to absorb the shaft power. +\end{enumerate} +The components \textbf{In} and \textbf{Out} provide the inlet and +outlet conditions. + +Both \textbf{Pump} and \textbf{Turb} are implemented with the +\emph{polytropic} constitutive relationship with index $n$. When +$n=\gamma=\frac{c_p}{c_v}$ this corresponds to isentropic compression +and expansion and thus the \textbf{SimpleGasTurbineABG} achieves its +cycle efficiency. However, other values of $n$ can be used to account +for isentropic efficiency of less than unity. + +To obtain a very simple dynamic model (and to avoid the need for an +accurate combustion chamber model) there are no dynamics associated +with the combustion chamber, but rahter it is assumed that the +corresponding temperature is imposed on the component (that is $T_3$ +is the system input) the corresponding heat flow is then an output. + +Both heat input and work output are measured using the \textbf{PS} +(power sensor) component, that for work output is embedded in the +\textbf{Load} component. These can be monitored to give the efficiency +of the \textbf{SimpleGasTurbineABG}. + +A symbolic steady-state for the model was computed -- see Section +\ref{sec:SimpleGasTurbineABG_ss.tex}. In particular, the load +resistance was chosen to absorb all the generated work at the steady +state and the shaft inertia was chosen to give a unit time constant +for the linearised system. The mass flow and shaft speeds were taken +as unity. + +For the purposed of simulation, the numerical values given in Examples +12.1 of Chapter 12 of Rogers and Mayhew, except that the isentropic +efficiencies are 100\% ($n=\gamma$) -- see Section +\ref{sec:SimpleGasTurbineABG_numpar.tex}. + +Simulations were performed starting at the steady state and increasing +the combustion chamber temperature by 10\% at $t=1$ and reducing by +10\% at $t=5$. Graphs of the various outputs are plotted: +\begin{itemize} +\item Figure + \Ref{fig:SimpleGasTurbineABG_odeso.ps-SimpleGasTurbineABG-p1-T,SimpleGasTurbineABG-c1-T,SimpleGasTurbineABG-t1-T} + -- the temperatures at the output of the + \begin{itemize} + \item compressor, + \item combustion chamber and + \item turbine + \end{itemize} +\item Figure + \Ref{fig:SimpleGasTurbineABG_odeso.ps-SimpleGasTurbineABG-Heat,SimpleGasTurbineABG-Work} + -- the heat input and work output +\item Figure + \Ref{fig:SimpleGasTurbineABG_odeso.ps-SimpleGasTurbineABG-Speed} -- the shaft speed and +\item Figure + \Ref{fig:SimpleGasTurbineABG_odeso.ps-SimpleGasTurbineABG-p1-P,SimpleGasTurbineABG-c1-P,SimpleGasTurbineABG-t1-P} + -- the pressure at the output of the + \begin{itemize} + \item compressor, + \item combustion chamber and + \item turbine + \end{itemize} +\end{itemize} + +This model can be modified extended in various ways to yield related +dynamic systems. For example: +\begin{itemize} +\item an air cooler is obtained by changing the direction of heat and + work flows +\item additional \textbf{Turb} and \textbf{Comb} components add reheat + to the cycle +\item an isentropic nozzle can be added and the work output removed + to give a jet engine. +\end{itemize} + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_input.txt Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_input.txt ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_input.txt +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_input.txt @@ -0,0 +1,14 @@ +# Numerical parameter file (SimpleGasTurbineABG_input.txt) +# Generated by MTT at Tue Mar 31 12:38:39 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +t_3 = 1000; + +# Set the inputs +u(1) = t_3 + 0.1*t_3*(t>1) - 0.2*t_3*(t>5); # SimpleGasTurbineABG (T3) ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt @@ -0,0 +1,77 @@ +# Numerical parameter file (SimpleGasTurbine_numpar.txt) +# Generated by MTT at Tue Mar 31 12:15:00 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 16:55:29 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +#Dummies + alpha = 1; + c_v = 1; + density = 1; + ideal_gas = 1; + j_s = 1; + k = 1; + k_p = 1; + m = 1; + m_c = 1; + p_1 = 1; + r = 1; + r_l = 1; + t_1 = 1; + v = 1; + v_c = 1; + + +# Parameters +c_p = 1005.0; +c_v = 718.0; +gamma_0 = c_p/c_v; +alpha = (gamma_0-1)/gamma_0; +k = 1.0; +p_1 = 1e5; # 1 bar +p_4 = p_1; +r = c_p-c_v; +t_1 = 288.0; # In +v_c = 1.0; + +%Set the CC pressure and temperature +t_3 = 1000.0; +r_p = 6.0; +p_3 = r_p*p_1; + +%Find stored mass to give combustion chamber pressure p_3 (at +% temperature t_3 +m_c = (p_3*v_c)/(t_3*r); + +%Equate pressures +p_4 = p_1; +p_2 = p_3; + +%Compute ss temperatures (isentropic) +t_2 = t_1*pow((p_2/p_1),alpha); +t_4 = t_3*pow((p_4/p_3),alpha); + +%Find the steady-state work output +w_0 = c_p*(t_3-t_4) - c_p*(t_2-t_1); + +%Unit mass flow +mdot = 1; + +%Corresponding shaft speed +omega_0 = mdot/k; + +%Compute the corresponding load resistance (to absorb that work) +r_l = w_0/pow((omega_0),2); + +%Compute shaft inertia to give unit time constant (j_s*r_l) +j_s = r_l; + +%Find angular momentum to give shaft speed omega_0 +mom_0 = omega_0*j_s; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_rep.txt Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_rep.txt ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_rep.txt +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_rep.txt @@ -0,0 +1,35 @@ +# Outline report file for system SimpleGasTurbineABG (SimpleGasTurbineABG_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 16:55:29 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%mtt -abg -o -ss SimpleGasTurbineABG abg tex +mtt -abg -o -ss SimpleGasTurbineABG struc tex +mtt -abg -o -ss SimpleGasTurbineABG sympar tex +mtt -abg -o -ss SimpleGasTurbineABG ode tex + +mtt -abg -o -ss SimpleGasTurbineABG sspar r +mtt -abg -o -ss SimpleGasTurbineABG ss tex +mtt -abg -o -ss SimpleGasTurbineABG sm tex + + +mtt -abg -o -ss SimpleGasTurbineABG numpar tex +mtt -abg -o -ss SimpleGasTurbineABG input tex +mtt -abg -o -ss SimpleGasTurbineABG state tex +mtt -abg -o -ss SimpleGasTurbineABG simpar tex +mtt -abg -o -ss SimpleGasTurbineABG odeso ps 'SimpleGasTurbineABG_p1_T,SimpleGasTurbineABG_c1_T,SimpleGasTurbineABG_t1_T' +mtt -abg -o -ss SimpleGasTurbineABG odeso ps 'SimpleGasTurbineABG_Heat,SimpleGasTurbineABG_Work' +mtt -abg -o -ss SimpleGasTurbineABG odeso ps 'SimpleGasTurbineABG_Speed' +mtt -abg -o -ss SimpleGasTurbineABG odeso ps 'SimpleGasTurbineABG_p1_P,SimpleGasTurbineABG_c1_P,SimpleGasTurbineABG_t1_P' + + + + + ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_simp.r Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_simp.r ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_simp.r +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_simp.r @@ -0,0 +1,11 @@ +%% Reduce commands to simplify output for system SimpleGasTurbineABG (SimpleGasTurbineABG_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LET c_v = c_p - r; +END; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_sspar.r Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_sspar.r ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_sspar.r +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_sspar.r @@ -0,0 +1,49 @@ +% Steady-state parameter file (SimpleGasTurbineABG_sspar.r) +% Generated by MTT at Thu Mar 26 16:28:59 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%Find stored mass to give combustion chamber pressure p_3 (at +% temperature t_3 +m_c := (p_3*v_c)/(t_3*r); + +%Equate pressures +p_4 := p_1; +p_2 := p_3; + +%Compute ss temperatures (isentropic) +t_2 := t_1*(p_2/p_1)^alpha; +t_4 := t_3*(p_4/p_3)^alpha; + +%Find the steady-state work output +w_0 := c_p*(t_3-t_4) - c_p*(t_2-t_1); + +%Compute the corresponding load resistance (to absorb that work) +r_l := w_0/(omega_0)^2; + +%Unit mass flow +mdot := 1; + +%Corresponding shaft speed +omega_0 := mdot/k; + +%Compute shaft inertia to give unit time constant (j_s*r_l) +j_s := r_l; + +%Find angular momentum to give shaft speed omega_0 +mom_0 := omega_0*j_s; + + +% Steady-state states +MTTX1 := mom_0; + +% Steady-state inputs - combustion temperature +MTTU1 := t_3; % SimpleGasTurbineABG (T3) + +;;END; + ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_state.txt Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_state.txt ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_state.txt +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_state.txt @@ -0,0 +1,14 @@ +# Numerical parameter file (SimpleGasTurbineABG_state.txt) +# Generated by MTT at Tue Mar 31 12:37:17 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SimpleGasTurbineABG_numpar; + +# Set the states +x(1) = j_s/k ; # SimpleGasTurbineABG (j_s) ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/hPipe_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/hPipe_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/hPipe_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/hPipe_abg.m @@ -0,0 +1,105 @@ +function [hPipe] = hPipe_abg +# This function is the acausal bond graph representation of hPipe +# Generated by MTT on Thu Mar 16 10:33:07 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port Heat + hPipe.ports.Heat.type = "SS"; + hPipe.ports.Heat.cr = "SS"; + hPipe.ports.Heat.arg = "external,external"; + hPipe.ports.Heat.repetitions = 1; + hPipe.ports.Heat.status = -1; + hPipe.ports.Heat.connections = [-3 ]; + +# Port Hydraulic_in + hPipe.ports.Hydraulic_in.type = "SS"; + hPipe.ports.Hydraulic_in.cr = "SS"; + hPipe.ports.Hydraulic_in.arg = "external,external"; + hPipe.ports.Hydraulic_in.repetitions = 1; + hPipe.ports.Hydraulic_in.status = -1; + hPipe.ports.Hydraulic_in.connections = [-5 ]; + +# Port Hydraulic_out + hPipe.ports.Hydraulic_out.type = "SS"; + hPipe.ports.Hydraulic_out.cr = "SS"; + hPipe.ports.Hydraulic_out.arg = "external,external"; + hPipe.ports.Hydraulic_out.repetitions = 1; + hPipe.ports.Hydraulic_out.status = -1; + hPipe.ports.Hydraulic_out.connections = [6 ]; + +# Port Thermal_in + hPipe.ports.Thermal_in.type = "SS"; + hPipe.ports.Thermal_in.cr = "SS"; + hPipe.ports.Thermal_in.arg = "external,external"; + hPipe.ports.Thermal_in.repetitions = 1; + hPipe.ports.Thermal_in.status = -1; + hPipe.ports.Thermal_in.connections = [-2 ]; + +# Port Thermal_out + hPipe.ports.Thermal_out.type = "SS"; + hPipe.ports.Thermal_out.cr = "SS"; + hPipe.ports.Thermal_out.arg = "external,external"; + hPipe.ports.Thermal_out.repetitions = 1; + hPipe.ports.Thermal_out.status = -1; + hPipe.ports.Thermal_out.connections = [7 ]; + +# Component P2T + hPipe.subsystems.P2T.type = "TF"; + hPipe.subsystems.P2T.cr = "lin"; + hPipe.subsystems.P2T.arg = "flow,r*m/v"; + hPipe.subsystems.P2T.repetitions = 1; + hPipe.subsystems.P2T.status = -1; + hPipe.subsystems.P2T.connections = [5 -1 ]; + +# Component T2P + hPipe.subsystems.T2P.type = "TF"; + hPipe.subsystems.T2P.cr = "lin"; + hPipe.subsystems.T2P.arg = "effort,r*m/v"; + hPipe.subsystems.T2P.repetitions = 1; + hPipe.subsystems.T2P.status = -1; + hPipe.subsystems.T2P.connections = [4 -6 ]; + +# Component mtt1 + hPipe.subsystems.mtt1.type = "0"; + hPipe.subsystems.mtt1.cr = ""; + hPipe.subsystems.mtt1.arg = ""; + hPipe.subsystems.mtt1.repetitions = 1; + hPipe.subsystems.mtt1.status = -1; + hPipe.subsystems.mtt1.connections = [1 2 3 -4 -7 ]; + +# Ordered list of Port names + hPipe.portlist(1,:) = "Heat "; + hPipe.portlist(2,:) = "Hydraulic_in "; + hPipe.portlist(3,:) = "Hydraulic_out"; + hPipe.portlist(4,:) = "Thermal_in "; + hPipe.portlist(5,:) = "Thermal_out "; + +# Ordered list of subsystem names + hPipe.subsystemlist(1,:) = "P2T "; + hPipe.subsystemlist(2,:) = "T2P "; + hPipe.subsystemlist(3,:) = "mtt1"; + +# Bonds + hPipe.bonds = [ + 0 0 + 0 0 + 1 1 + 0 0 + 0 0 + 0 0 + 0 0 + ]; + +# Aliases +# A double underscore __ represents a comma +hPipe.alias.out = "Thermal_out,Hydraulic_out"; +hPipe.alias.Hy_out = "Hydraulic_out"; +hPipe.alias.Th_in = "Thermal_in"; +hPipe.alias.r = "$3"; +hPipe.alias.Th_out = "Thermal_out"; +hPipe.alias.m = "$1"; +hPipe.alias.v = "$2"; +hPipe.alias.in = "Thermal_in,Hydraulic_in"; +hPipe.alias.Hy_in = "Hydraulic_in"; ADDED mtt/lib/examples/ABG/SimpleGasTurbineABG/wPipe_abg.m Index: mtt/lib/examples/ABG/SimpleGasTurbineABG/wPipe_abg.m ================================================================== --- mtt/lib/examples/ABG/SimpleGasTurbineABG/wPipe_abg.m +++ mtt/lib/examples/ABG/SimpleGasTurbineABG/wPipe_abg.m @@ -0,0 +1,199 @@ +function [wPipe] = wPipe_abg +# This function is the acausal bond graph representation of wPipe +# Generated by MTT on Thu Mar 16 10:37:39 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Port Hydraulic_in + wPipe.ports.Hydraulic_in.type = "SS"; + wPipe.ports.Hydraulic_in.cr = "SS"; + wPipe.ports.Hydraulic_in.arg = "external,external"; + wPipe.ports.Hydraulic_in.repetitions = 1; + wPipe.ports.Hydraulic_in.status = -1; + wPipe.ports.Hydraulic_in.connections = [-1 ]; + +# Port Hydraulic_out + wPipe.ports.Hydraulic_out.type = "SS"; + wPipe.ports.Hydraulic_out.cr = "SS"; + wPipe.ports.Hydraulic_out.arg = "external,external"; + wPipe.ports.Hydraulic_out.repetitions = 1; + wPipe.ports.Hydraulic_out.status = -1; + wPipe.ports.Hydraulic_out.connections = [17 ]; + +# Port Shaft + wPipe.ports.Shaft.type = "SS"; + wPipe.ports.Shaft.cr = "SS"; + wPipe.ports.Shaft.arg = "external,external"; + wPipe.ports.Shaft.repetitions = 1; + wPipe.ports.Shaft.status = -1; + wPipe.ports.Shaft.connections = [-20 ]; + +# Port Thermal_in + wPipe.ports.Thermal_in.type = "SS"; + wPipe.ports.Thermal_in.cr = "SS"; + wPipe.ports.Thermal_in.arg = "external,external"; + wPipe.ports.Thermal_in.repetitions = 1; + wPipe.ports.Thermal_in.status = -1; + wPipe.ports.Thermal_in.connections = [-14 ]; + +# Port Thermal_out + wPipe.ports.Thermal_out.type = "SS"; + wPipe.ports.Thermal_out.cr = "SS"; + wPipe.ports.Thermal_out.arg = "external,external"; + wPipe.ports.Thermal_out.repetitions = 1; + wPipe.ports.Thermal_out.status = -1; + wPipe.ports.Thermal_out.connections = [16 ]; + +# Component rho1 + wPipe.subsystems.rho1.type = "Density"; + wPipe.subsystems.rho1.cr = "none"; + wPipe.subsystems.rho1.arg = "density,ideal_gas,r"; + wPipe.subsystems.rho1.repetitions = 1; + wPipe.subsystems.rho1.status = -1; + wPipe.subsystems.rho1.connections = [4 3 -5 ]; + +# Component rho2 + wPipe.subsystems.rho2.type = "Density"; + wPipe.subsystems.rho2.cr = "none"; + wPipe.subsystems.rho2.arg = "density,ideal_gas,r"; + wPipe.subsystems.rho2.repetitions = 1; + wPipe.subsystems.rho2.status = -1; + wPipe.subsystems.rho2.connections = [12 11 -10 ]; + +# Component p2pv + wPipe.subsystems.p2pv.type = "EMTF"; + wPipe.subsystems.p2pv.cr = "lin"; + wPipe.subsystems.p2pv.arg = "flow"; + wPipe.subsystems.p2pv.repetitions = 1; + wPipe.subsystems.p2pv.status = -1; + wPipe.subsystems.p2pv.connections = [2 -9 5 ]; + +# Component pv2p + wPipe.subsystems.pv2p.type = "EMTF"; + wPipe.subsystems.pv2p.cr = "lin"; + wPipe.subsystems.pv2p.arg = "effort"; + wPipe.subsystems.pv2p.repetitions = 1; + wPipe.subsystems.pv2p.status = -1; + wPipe.subsystems.pv2p.connections = [7 -18 10 ]; + +# Component t2u + wPipe.subsystems.t2u.type = "TF"; + wPipe.subsystems.t2u.cr = "lin"; + wPipe.subsystems.t2u.arg = "effort,c_v"; + wPipe.subsystems.t2u.repetitions = 1; + wPipe.subsystems.t2u.status = -1; + wPipe.subsystems.t2u.connections = [15 -6 ]; + +# Component u2t + wPipe.subsystems.u2t.type = "TF"; + wPipe.subsystems.u2t.cr = "lin"; + wPipe.subsystems.u2t.arg = "flow,c_v"; + wPipe.subsystems.u2t.repetitions = 1; + wPipe.subsystems.u2t.status = -1; + wPipe.subsystems.u2t.connections = [8 -13 ]; + +# Component mtt1 + wPipe.subsystems.mtt1.type = "0"; + wPipe.subsystems.mtt1.cr = ""; + wPipe.subsystems.mtt1.arg = ""; + wPipe.subsystems.mtt1.repetitions = 1; + wPipe.subsystems.mtt1.status = -1; + wPipe.subsystems.mtt1.connections = [-3 14 -15 ]; + +# Component mtt2 + wPipe.subsystems.mtt2.type = "0"; + wPipe.subsystems.mtt2.cr = ""; + wPipe.subsystems.mtt2.arg = ""; + wPipe.subsystems.mtt2.repetitions = 1; + wPipe.subsystems.mtt2.status = -1; + wPipe.subsystems.mtt2.connections = [1 -2 -4 ]; + +# Component mtt3 + wPipe.subsystems.mtt3.type = "1"; + wPipe.subsystems.mtt3.cr = ""; + wPipe.subsystems.mtt3.arg = ""; + wPipe.subsystems.mtt3.repetitions = 1; + wPipe.subsystems.mtt3.status = -1; + wPipe.subsystems.mtt3.connections = [6 -7 -8 9 19 ]; + +# Component mtt4 + wPipe.subsystems.mtt4.type = "0"; + wPipe.subsystems.mtt4.cr = ""; + wPipe.subsystems.mtt4.arg = ""; + wPipe.subsystems.mtt4.repetitions = 1; + wPipe.subsystems.mtt4.status = -1; + wPipe.subsystems.mtt4.connections = [-11 13 -16 ]; + +# Component mtt5 + wPipe.subsystems.mtt5.type = "0"; + wPipe.subsystems.mtt5.cr = ""; + wPipe.subsystems.mtt5.arg = ""; + wPipe.subsystems.mtt5.repetitions = 1; + wPipe.subsystems.mtt5.status = -1; + wPipe.subsystems.mtt5.connections = [-12 -17 18 ]; + +# Component mtt6 + wPipe.subsystems.mtt6.type = "1"; + wPipe.subsystems.mtt6.cr = ""; + wPipe.subsystems.mtt6.arg = ""; + wPipe.subsystems.mtt6.repetitions = 1; + wPipe.subsystems.mtt6.status = -1; + wPipe.subsystems.mtt6.connections = [-19 20 ]; + +# Ordered list of Port names + wPipe.portlist(1,:) = "Hydraulic_in "; + wPipe.portlist(2,:) = "Hydraulic_out"; + wPipe.portlist(3,:) = "Shaft "; + wPipe.portlist(4,:) = "Thermal_in "; + wPipe.portlist(5,:) = "Thermal_out "; + +# Ordered list of subsystem names + wPipe.subsystemlist(1,:) = "rho1"; + wPipe.subsystemlist(2,:) = "rho2"; + wPipe.subsystemlist(3,:) = "p2pv"; + wPipe.subsystemlist(4,:) = "pv2p"; + wPipe.subsystemlist(5,:) = "t2u "; + wPipe.subsystemlist(6,:) = "u2t "; + wPipe.subsystemlist(7,:) = "mtt1"; + wPipe.subsystemlist(8,:) = "mtt2"; + wPipe.subsystemlist(9,:) = "mtt3"; + wPipe.subsystemlist(10,:) = "mtt4"; + wPipe.subsystemlist(11,:) = "mtt5"; + wPipe.subsystemlist(12,:) = "mtt6"; + +# Bonds + wPipe.bonds = [ + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + 0 0 + -1 -1 + ]; + +# Aliases +# A double underscore __ represents a comma +wPipe.alias.out = "Thermal_out,Hydraulic_out"; +wPipe.alias.Hy_out = "Hydraulic_out"; +wPipe.alias.c_v = "$1"; +wPipe.alias.Th_in = "Thermal_in"; +wPipe.alias.Th_out = "Thermal_out"; +wPipe.alias.Work = "Shaft"; +wPipe.alias.in = "Thermal_in,Hydraulic_in"; +wPipe.alias.Hy_in = "Hydraulic_in"; +wPipe.alias.density__ideal_gas__r = "$2"; ADDED mtt/lib/examples/ABG/rcABG/rcABG_abg.m Index: mtt/lib/examples/ABG/rcABG/rcABG_abg.m ================================================================== --- mtt/lib/examples/ABG/rcABG/rcABG_abg.m +++ mtt/lib/examples/ABG/rcABG/rcABG_abg.m @@ -0,0 +1,76 @@ +function [rc] = rc_abg +# This function is the acausal bond graph representation of rc +# Generated by MTT on Thu Mar 16 08:45:29 2000 +# The file is in Octave format + +# Subsystems and Ports + +# Component c + rc.subsystems.c.type = "C"; + rc.subsystems.c.cr = "lin"; + rc.subsystems.c.arg = "effort,c"; + rc.subsystems.c.repetitions = 1; + rc.subsystems.c.status = -1; + rc.subsystems.c.connections = [5 ]; + +# Component r + rc.subsystems.r.type = "R"; + rc.subsystems.r.cr = "lin"; + rc.subsystems.r.arg = "flow,r"; + rc.subsystems.r.repetitions = 1; + rc.subsystems.r.status = -1; + rc.subsystems.r.connections = [4 ]; + +# Component e1 + rc.subsystems.e1.type = "SS"; + rc.subsystems.e1.cr = "SS"; + rc.subsystems.e1.arg = "external,internal"; + rc.subsystems.e1.repetitions = 1; + rc.subsystems.e1.status = -1; + rc.subsystems.e1.connections = [-1 ]; + +# Component e2 + rc.subsystems.e2.type = "SS"; + rc.subsystems.e2.cr = "SS"; + rc.subsystems.e2.arg = "external,0"; + rc.subsystems.e2.repetitions = 1; + rc.subsystems.e2.status = -1; + rc.subsystems.e2.connections = [3 ]; + +# Component mtt1 + rc.subsystems.mtt1.type = "1"; + rc.subsystems.mtt1.cr = ""; + rc.subsystems.mtt1.arg = ""; + rc.subsystems.mtt1.repetitions = 1; + rc.subsystems.mtt1.status = -1; + rc.subsystems.mtt1.connections = [1 -2 -4 ]; + +# Component mtt2 + rc.subsystems.mtt2.type = "0"; + rc.subsystems.mtt2.cr = ""; + rc.subsystems.mtt2.arg = ""; + rc.subsystems.mtt2.repetitions = 1; + rc.subsystems.mtt2.status = -1; + rc.subsystems.mtt2.connections = [2 -3 -5 ]; + +# Ordered list of subsystem names + rc.subsystemlist(1,:) = "c "; + rc.subsystemlist(2,:) = "r "; + rc.subsystemlist(3,:) = "e1 "; + rc.subsystemlist(4,:) = "e2 "; + rc.subsystemlist(5,:) = "mtt1"; + rc.subsystemlist(6,:) = "mtt2"; + +# Bonds + rc.bonds = [ + 1 1 + 0 0 + 1 1 + 0 0 + 0 0 + ]; + +# Aliases +# A double underscore __ represents a comma +rc.alias.r = "$2"; +rc.alias.c = "$1"; ADDED mtt/lib/examples/ABG/rcABG/rcABG_rep.txt Index: mtt/lib/examples/ABG/rcABG/rcABG_rep.txt ================================================================== --- mtt/lib/examples/ABG/rcABG/rcABG_rep.txt +++ mtt/lib/examples/ABG/rcABG/rcABG_rep.txt @@ -0,0 +1,15 @@ +% %% Outline report file for system rcABG (rcABG_rep.txt) +mtt rcABG struc tex +mtt rcABG ode tex +mtt rcABG sm tex +mtt rcABG tf tex +mtt rcABG sro ps +mtt rcABG lmfr ps +mtt rcABG nyfr ps + +mtt rcABG numpar txt +mtt rcABG input txt +mtt rcABG odeso ps +mtt rcABG rep txt + + ADDED mtt/lib/examples/AlgebraicLoops/aRC/aRC_abg.fig Index: mtt/lib/examples/AlgebraicLoops/aRC/aRC_abg.fig ================================================================== --- mtt/lib/examples/AlgebraicLoops/aRC/aRC_abg.fig +++ mtt/lib/examples/AlgebraicLoops/aRC/aRC_abg.fig @@ -0,0 +1,82 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 4680 630 6570 1620 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4725 1215 5175 1215 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4725 1080 5175 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4950 675 4950 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4950 1215 4950 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 6075 1530 6075 765 +4 0 1 1 0 0 20 0.0000 4 180 165 5355 1215 c\001 +4 0 1 1 0 0 20 0.0000 4 180 165 6300 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 255 180 6390 1305 2\001 +-6 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 1800 1125 162 162 1800 1125 1890 1260 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1802 4277 2702 4277 2477 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 4277 4052 4277 3827 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4502 4277 5402 4277 5177 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 4051 2926 3151 3151 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 4051 4276 3151 4501 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 4276 2701 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5401 4051 5401 4276 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5401 4276 5401 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 4051 2701 4276 +2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 2475 585 3375 585 3375 765 2475 765 2475 585 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 675 2475 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 945 1800 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 1575 1800 1260 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 4500 2925 5400 3150 5175 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6750 6075 6750 225 675 225 675 6075 6750 6075 +2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 3600 585 4500 585 4500 765 3600 765 3600 585 +2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 2 + 3375 675 3600 675 +2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 2 + 4500 675 5850 675 +2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 2 + 1755 1575 5850 1575 +2 1 0 2 4 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1935 5040 2160 5265 +2 1 0 2 4 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2070 5130 2706 4494 2706 4812 +4 1 -1 0 0 0 20 0.0000 4 255 180 2927 4367 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 4277 4367 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 825 5987 4367 SS:e2\001 +4 1 -1 0 0 0 20 0.0000 4 330 825 2926 2926 R:r_1\001 +4 1 -1 0 0 0 20 0.0000 4 255 495 4276 2926 C:c\001 +4 1 -1 0 0 0 20 0.0000 4 255 825 1395 4365 SS:e1\001 +4 0 1 1 0 0 20 0.0000 4 330 495 2880 450 r_1\001 +4 0 1 1 0 0 20 0.0000 4 180 165 1260 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 255 180 1350 1305 1\001 +4 1 1 1 0 0 20 0.0000 4 255 1545 3600 2025 Schematic\001 +4 1 1 1 0 0 20 0.0000 4 330 1725 4860 4860 Bond graph\001 +4 1 -1 0 0 0 20 0.0000 4 330 825 3015 5715 R:r_2\001 +4 0 1 1 0 0 20 0.0000 4 330 495 3870 450 r_2\001 +4 1 -1 0 0 0 20 0.0000 4 330 1110 1755 5535 SS:loop\001 ADDED mtt/lib/examples/AlgebraicLoops/aRC/aRC_desc.tex Index: mtt/lib/examples/AlgebraicLoops/aRC/aRC_desc.tex ================================================================== --- mtt/lib/examples/AlgebraicLoops/aRC/aRC_desc.tex +++ mtt/lib/examples/AlgebraicLoops/aRC/aRC_desc.tex @@ -0,0 +1,35 @@ +% Verbal description for system aRC (aRC_desc.tex) +% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:02:29 peterg +% %% To RCS +% %% +% %% Revision 1.1 1997/08/24 10:27:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{aRC} is + displayed in Figure \Ref{aRC_abg} and its label + file is listed in Section \Ref{sec:aRC_lbl}. + The subsystems are listed in Section \Ref{sec:aRC_sub}. + +The system \textbf{aRC} is the simple electrical rc circuit shown in +Figure \Ref{aRC_abg}. It can be regarded as a single-input +single-output system with input $e_1$ and output $e_2$. + +The two resistors ($r_1$ and $r_2$) are in series; this give an +undercausal system with a corresponding algebraic loop. The loop is +broken by adding the {\bf SS} component ``loop'' to localise the +algabraic equation byh choosing the corresponding flow such that the +corresponding effort is zero. This algebraic equation appears in +Section \Ref{sec:aRC_dae-noargs.tex}. + +This loop is algbraicly solved to give the ordinary differential +equation of Section \Ref{sec:aRC_ode-A.tex} and the transfer function of +Section \Ref{sec:aRC_tf-A.tex}. ADDED mtt/lib/examples/AlgebraicLoops/aRC/aRC_lbl.txt Index: mtt/lib/examples/AlgebraicLoops/aRC/aRC_lbl.txt ================================================================== --- mtt/lib/examples/AlgebraicLoops/aRC/aRC_lbl.txt +++ mtt/lib/examples/AlgebraicLoops/aRC/aRC_lbl.txt @@ -0,0 +1,48 @@ +%SUMMARY aRC: Simple RC circuit example with algebraic loop + +%% Label file for system aRC (aRC_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/05/20 16:03:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1997/05/12 15:11:47 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1997/04/18 13:27:54 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1997/04/18 13:20:13 peterg +% %% Initial revision +% %% Revision 1.1 1996/09/10 11:37:14 peter +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +% Source - effort source (e1) flow ignored +e1 SS external,internal + +% Sensor - effort sensor (e2) zero flow +e2 SS external,0 + +% R component - linear with resistance r (effort = r*flow) +r_1 lin flow,r_1 +r_2 lin flow,r_2 + +% C component - linear with capacitance c (state = c*effort) +c lin effort,c + +% Algebraic loop SS +loop SS zero,unknown + + + ADDED mtt/lib/examples/AlgebraicLoops/aRC/aRC_rep.txt Index: mtt/lib/examples/AlgebraicLoops/aRC/aRC_rep.txt ================================================================== --- mtt/lib/examples/AlgebraicLoops/aRC/aRC_rep.txt +++ mtt/lib/examples/AlgebraicLoops/aRC/aRC_rep.txt @@ -0,0 +1,30 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system aRC (aRC_rep.txt) +## Generated by MTT on" Fri Oct 15 14:56:13 EST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:02:29 peterg +## To RCS +## +############################################################### + +mtt aRC abg tex # The system description +mtt aRC cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt aRC struc tex # The system structure +mtt aRC dae tex # The system dae +mtt -A aRC ode tex # The system ode +## mtt aRC sspar tex # Steady-state parameters +## mtt aRC ss tex # Steady state +## mtt aRC dm tex # Descriptor matrices (of linearised system) +## mtt aRC sm tex # State matrices (of linearised system) +mtt -A aRC tf tex # Transfer function (of linearised system) +## mtt aRC lmfr ps # log modulus of frequency response (of linearised system) +## mtt aRC simpar tex # Simulation parameters +## mtt aRC numpar tex # Numerical simulation parameters +## mtt aRC input tex # Simulation input +## mtt aRC odeso ps # Simulation output ADDED mtt/lib/examples/AlgebraicLoops/aRC/aRC_sspar.r Index: mtt/lib/examples/AlgebraicLoops/aRC/aRC_sspar.r ================================================================== --- mtt/lib/examples/AlgebraicLoops/aRC/aRC_sspar.r +++ mtt/lib/examples/AlgebraicLoops/aRC/aRC_sspar.r @@ -0,0 +1,2 @@ +%% Reduce steady-state parameter file for aRC (aRC_sspar.r) cat /home/peter/mtt_new/mtt/trans/m/aRCs_header.txt +END; ADDED mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_abg.fig Index: mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_abg.fig ================================================================== --- mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_abg.fig +++ mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_abg.fig @@ -0,0 +1,291 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4201 7186 4201 6451 4336 6631 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4201 4801 4201 4066 4336 4246 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4276 7201 4801 6901 4651 6901 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9901 6151 10576 6151 10426 6001 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9901 5026 10576 5026 10426 4876 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4501 6226 5176 6226 5026 6076 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4501 5026 5176 5026 5026 4876 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9601 5266 9601 6001 9466 5821 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9901 3901 10576 3901 10426 3751 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4501 3901 5176 3901 5026 3751 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5401 1876 5701 1876 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5551 1201 5551 1876 5401 1726 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5926 1951 5926 2251 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 4051 3601 4351 3601 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 4501 1951 4501 2251 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 7351 1951 7351 2251 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4201 3601 6751 2326 6451 2251 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7051 2251 9526 3676 9526 3376 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5251 2101 4501 2101 4651 1951 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5926 2101 6601 2101 6451 1951 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7351 2101 8026 2101 7876 1951 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 9376 3676 9676 3676 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 8491 11341 8491 12076 8356 11896 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5491 14941 5491 15676 5356 15496 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5401 8401 5701 8401 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5371 10246 5671 10246 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5326 12076 5626 12076 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5326 13876 5626 13876 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5326 15676 5626 15676 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8326 15676 8626 15676 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8326 13876 8626 13876 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8326 12076 8626 12076 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8326 10276 8626 10276 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8326 8401 8626 8401 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 6901 14926 7201 14926 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 6901 13126 7201 13126 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 6901 11326 7201 11326 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 6901 9526 7201 9526 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 6901 7651 7201 7651 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7021 14941 7021 15676 6901 15496 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7021 13141 7021 13876 6901 13696 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7021 11341 7021 12076 6901 11896 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7021 9541 7021 10276 6901 10096 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7051 7651 7051 8386 6931 8206 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9526 7501 8851 11101 8776 10951 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9526 7501 8851 12901 8776 12751 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9526 7501 8851 14701 8776 14551 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 8476 7651 8476 8386 8341 8206 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 8491 9541 8491 10276 8356 10096 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 8491 13141 8491 13876 8356 13696 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 8491 14941 8491 15676 8356 15496 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5551 7651 5551 8386 5416 8206 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5536 9496 5536 10231 5401 10051 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5491 11341 5491 12076 5356 11896 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5491 13141 5491 13876 5356 13696 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7051 1876 7501 1501 7501 1726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7201 7501 7801 8101 7651 8101 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7201 9301 7801 9901 7651 9901 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7201 11101 7801 11701 7651 11701 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7201 12901 7801 13501 7651 13501 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7201 14701 7801 15301 7651 15301 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9601 4051 9601 4351 9526 4276 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9601 4576 9601 4876 9526 4801 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9601 6376 9601 6676 9526 6601 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9601 7051 9601 7351 9526 7276 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4201 5476 4201 5176 4276 5251 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4201 6076 4201 5776 4276 5851 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8178 9303 7878 9303 7953 9378 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7578 9303 7278 9303 7353 9378 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8177 9152 8177 9452 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8178 11103 7878 11103 7953 11178 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7578 11103 7278 11103 7353 11178 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8177 10952 8177 11252 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8178 12903 7878 12903 7953 12978 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7578 12903 7278 12903 7353 12978 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8177 12752 8177 13052 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8178 14703 7878 14703 7953 14778 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7578 14703 7278 14703 7353 14778 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 8177 14552 8177 14852 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 6676 14701 5926 14701 6076 14851 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 6676 12901 5926 12901 6076 13051 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 6676 11101 5926 11101 6076 11251 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 6676 9301 5926 9301 6076 9451 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 6676 7501 5926 7501 6076 7651 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9526 7501 8776 7501 8971 7636 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9526 7501 8851 9301 8776 9076 +2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9742 7410 10267 7110 10117 7110 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8101 7501 7801 7501 7876 7576 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7501 7501 7201 7501 7276 7576 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5102 9302 4802 9302 4877 9377 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5103 11103 4803 11103 4878 11178 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5028 12903 4728 12903 4803 12978 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5028 14703 4728 14703 4803 14778 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 9301 4201 7501 4351 7801 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4051 7576 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 3976 7576 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4051 7576 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4426 11101 4051 7576 4201 7801 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4426 12901 3901 7576 3976 7726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4426 14701 3676 7501 3826 7801 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5177 7502 4877 7502 4952 7577 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4577 7502 4277 7502 4352 7577 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 8700 9000 7050 6600 7050 6600 8700 9000 8700 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 12300 9000 10650 6600 10650 6600 12300 9000 12300 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 14175 9000 12525 6600 12525 6600 14175 9000 14175 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 15975 9000 14325 6600 14325 6600 15975 9000 15975 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 10500 9000 8850 6600 8850 6600 10500 9000 10500 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 13800 16125 300 16125 300 600 13800 600 13800 16125 +4 0 0 0 0 0 12 0.0000000 4 180 495 10276 7051 C:apc2\001 +4 0 0 0 0 0 12 0.0000000 4 180 510 4876 7051 C:vpc2\001 +4 0 0 0 0 0 12 0.0000000 4 180 495 10651 5101 C:apc1\001 +4 0 0 0 0 0 12 0.0000000 4 180 480 10651 6226 R:apr2\001 +4 0 0 0 0 0 12 0.0000000 4 180 480 10651 4051 R:apr1\001 +4 0 0 0 0 0 12 0.0000000 4 180 510 5251 5101 C:vpc1\001 +4 0 0 0 0 0 12 0.0000000 4 180 495 5251 6301 R:vpr2\001 +4 1 0 0 0 0 12 0.0000000 4 180 495 5551 3976 R:vpr1\001 +4 1 0 0 0 0 12 0.0000000 4 180 390 9601 6301 1:ap3\001 +4 1 0 0 0 0 12 0.0000000 4 180 405 4201 6301 1:vp3\001 +4 1 0 0 0 0 12 0.0000000 4 180 390 9601 5101 0:ap2\001 +4 1 0 0 0 0 12 0.0000000 4 180 405 4126 5101 0:vp2\001 +4 1 0 0 0 0 12 0.0000000 4 180 390 9526 3976 1:ap1\001 +4 1 0 0 0 0 12 0.0000000 4 180 405 4126 3976 1:vp1\001 +4 0 0 0 0 0 12 0.0000000 4 180 420 7576 1576 SS:ye\001 +4 0 0 0 0 0 12 0.0000000 4 135 390 5326 1201 SS:t0\001 +4 1 0 0 0 0 12 0.0000000 4 135 270 4201 2176 R:ri\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 5551 2176 1:fi\001 +4 1 0 0 0 0 12 0.0000000 4 135 225 7051 2176 0:ti\001 +4 1 0 0 0 0 12 0.0000000 4 135 285 8401 2176 C:ci\001 +4 0 0 0 0 0 12 0.0000000 4 135 345 8251 14776 1:fsa\001 +4 0 0 0 0 0 12 0.0000000 4 135 330 8251 12976 1:ffa\001 +4 0 0 0 0 0 12 0.0000000 4 135 315 8251 11176 1:fla\001 +4 0 0 0 0 0 12 0.0000000 4 135 360 8251 9376 1:fva\001 +4 0 0 0 0 0 12 0.0000000 4 135 360 8251 7576 1:fba\001 +4 0 0 0 0 0 12 0.0000000 4 135 360 5251 14776 1:fsv\001 +4 0 0 0 0 0 12 0.0000000 4 135 345 5251 12976 1:ffv\001 +4 0 0 0 0 0 12 0.0000000 4 135 330 5251 11176 1:flv\001 +4 0 0 0 0 0 12 0.0000000 4 135 375 5251 9376 1:fvv\001 +4 0 0 0 0 0 12 0.0000000 4 180 345 9601 7576 0:tap\001 +4 1 0 0 0 0 12 0.0000000 4 135 390 5476 15901 R:rs1\001 +4 1 0 0 0 0 12 0.0000000 4 135 405 5551 10501 R:rv1\001 +4 1 0 0 0 0 12 0.0000000 4 135 405 5551 8626 R:rb1\001 +4 0 0 0 0 0 12 0.0000000 4 180 420 7501 15601 SS:ys\001 +4 0 0 0 0 0 12 0.0000000 4 180 405 7501 13801 SS:yf\001 +4 1 0 0 0 0 12 0.0000000 4 180 390 7726 12001 SS:yl\001 +4 1 0 0 0 0 12 0.0000000 4 180 435 7801 10201 SS:yv\001 +4 1 0 0 0 0 12 0.0000000 4 180 435 7801 8326 SS:yb\001 +4 1 0 0 0 0 12 0.0000000 4 135 390 8476 15901 R:rs2\001 +4 1 0 0 0 0 12 0.0000000 4 135 405 8476 10501 R:rv2\001 +4 1 0 0 0 0 12 0.0000000 4 135 405 8476 8626 R:rb2\001 +4 1 0 0 0 0 12 0.0000000 4 135 315 6976 15901 C:cs\001 +4 1 0 0 0 0 12 0.0000000 4 135 300 7051 14101 C:cf\001 +4 1 0 0 0 0 12 0.0000000 4 135 285 6976 12376 C:cl\001 +4 1 0 0 0 0 12 0.0000000 4 135 330 6976 10501 C:cv\001 +4 1 0 0 0 0 12 0.0000000 4 135 330 7051 8626 C:cb\001 +4 1 0 0 0 0 12 0.0000000 4 135 255 7051 14776 0:ts\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 7051 12976 0:tf\001 +4 1 0 0 0 0 12 0.0000000 4 135 225 7051 11176 0:tl\001 +4 1 0 0 0 0 12 0.0000000 4 135 270 7051 9376 0:tv\001 +4 1 0 0 0 0 12 0.0000000 4 135 270 7051 7576 0:tb\001 +4 1 0 0 0 0 12 0.0000000 4 135 360 8476 12376 R:rl1\001 +4 1 0 0 0 0 12 0.0000000 4 135 375 8476 14101 R:rf1\001 +4 1 0 0 0 0 12 0.0000000 4 135 360 5476 12376 R:rl2\001 +4 1 0 0 0 0 12 0.0000000 4 135 375 5476 14101 R:rf2\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 9601 4501 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 9601 6901 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 4201 5701 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 7728 9378 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 7728 11178 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 7728 12978 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 7728 14778 AF\001 +4 0 0 0 0 0 12 0.0000000 4 135 375 5251 7576 1:fbv\001 +4 2 0 0 0 0 12 0.0000000 4 180 360 4126 7501 0:tvp\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 7651 7576 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 4652 9377 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 4653 11178 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 4578 12978 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 4578 14778 AF\001 +4 1 0 0 0 0 12 0.0000000 4 135 240 4727 7577 AF\001 ADDED mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_desc.tex Index: mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_desc.tex ================================================================== --- mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_desc.tex +++ mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_desc.tex @@ -0,0 +1,26 @@ +% Verbal description for system MaplesonModelP (MaplesonModelP_desc.tex) +% Generated by MTT on Wed Dec 10 09:04:14 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{MaplesonModelP} is + displayed in Figure \Ref{MaplesonModelP_abg} and its label + file is listed in Section \Ref{sec:MaplesonModelP_lbl}. + The subsystems are listed in Section \Ref{sec:MaplesonModelP_sub}. + +This is a Bond Graph interpretation of Mapleson's model P of the +pharmokokinetics of anaesthetic drug delivery. It is discussed in +detail in Chapter 9 of ``Metamodelling''. + +It badly needs conversion to hierarchical form. + + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_input.txt Index: mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_input.txt ================================================================== --- mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_input.txt +++ mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_input.txt @@ -0,0 +1,9 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System MaplesonModelP, representation input, language txt; +## File MaplesonModelP_input.txt; +## Generated by MTT on Fri Nov 10 10:45:52 GMT 2000; + + +MaplesonModelP__t0 = 0.75*760*(t<2); #75% atmospheric pressure for 2 sec. ADDED mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_lbl.txt Index: mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_lbl.txt ================================================================== --- mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_lbl.txt +++ mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_lbl.txt @@ -0,0 +1,167 @@ +#SUMMARY MaplesonModelP: Pharmokinetic model from section 9.6 of"Metamodelling" +#DESCRIPTION Detailed model with pools +#DESCRIPTION +#DESCRIPTION Note that the bond graph has been redrawn to replace active bonds with +#DESCRIPTION AF components. +#DESCRIPTION This would be much neater using a heirachical model. +#DESCRIPTION +#DESCRIPTION The following commands make the figures. +#DESCRIPTION +#DESCRIPTION Fig 9.17 mtt MaplesonModelP abg view +#DESCRIPTION Figs 9.18-19 mtt MaplesonModelP odeso view 'T=[0:0.1:6]' +#DESCRIPTION Fig 9.20 mtt MaplesonModelP lmfr view 'W=logspace(-2,2,100)' +#DESCRIPTION Fig 9.21 mtt MaplesonModelP lpfr view 'W=logspace(-2,2,100)' + + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.1 1996/08/30 18:37:56 peter +# ## Initial revision +# ## +# ############################################################### + +#VAR apools +#VAR breathing_interval +#VAR heart_interval +#VAR k_ap +#VAR k_b +#VAR k_f +#VAR k_i +#VAR k_l +#VAR k_s +#VAR k_v +#VAR k_vp +#VAR kb +#VAR kf +#VAR kl +#VAR ks +#VAR kv +#VAR lambdab +#VAR lambdablood +#VAR lambdaf +#VAR lambdal +#VAR lambdalung +#VAR lambdav +#VAR stroke_volume +#VAR t_1 +#VAR t_2 +#VAR t_b +#VAR t_f +#VAR t_i +#VAR t_l +#VAR t_s +#VAR t_v +#VAR v_i +#VAR vap +#VAR varterial +#VAR vb +#VAR vbp +#VAR vf +#VAR vfp +#VAR vgas +#VAR vl +#VAR vlp +#VAR vlung +#VAR vplung +#VAR vpools +#VAR vsp +#VAR vv +#VAR vvenous +#VAR vvp + +### Common tension junctions ### +ti +tb +tv +tl +tf +ts +tap +tvp + +##Common flow junctions - inspiration ### +fi + +##Common flow junctions - arteries ### +fba +fva +fla +ffa +fsa + +##Common flow junctions - veins ### +fbv +fvv +flv +ffv +fsv + +## More junctions +ap3 +vp3 +ap2 +vp2 +ap1 +vp1 + +### Resistances ### +rb1 lin flow,r_b +rv1 lin flow,r_v +rl1 lin flow,r_l +rf1 lin flow,r_f +rs1 lin flow,r_s + +rb2 lin flow,r_b +rv2 lin flow,r_v +rl2 lin flow,r_l +rf2 lin flow,r_f +rs2 lin flow,r_s + +ri lin flow,r_i + +## Capacities ### +cb lin effort,c_b +cv lin effort,c_v +cl lin effort,c_l +cf lin effort,c_f +cs lin effort,c_s +ci lin effort,c_i + + +### Input ### +t0 SS external,internal + +### Outputs ### +yb SS external,0 +yv SS external,0 +yl SS external,0 +yf SS external,0 +ys SS external,0 +ye SS external,0 + +### Arterial pool +# ap1 apool1 +# ap2 apool2 +# ap3 apool3 + +apc1 lin effort,c_ap +apc2 lin effort,c_ap + +apr1 lin flow,r_ap +apr2 lin flow,r_ap + + +### Venous pool +# vp1 vpool1 +# vp2 vpool2 +# vp3 vpool3 + +vpc1 lin effort,c_vp +vpc2 lin effort,c_vp +vpr1 lin flow,r_vp +vpr2 lin flow,r_vp + + ADDED mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_numpar.txt Index: mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_numpar.txt ================================================================== --- mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_numpar.txt +++ mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_numpar.txt @@ -0,0 +1,125 @@ +# Numerical parameter file (MaplesonModelP_numpar.txt) +# Generated by MTT at Mon Aug 11 14:45:13 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters + +# Modified 17/11/93 to correspond to Mapleson's 1973 paper. +# Like model O except that blood has its own pools distinct form the tissues. + + +Heart_interval = 1.0/60.0; +Breathing_interval = 4*Heart_interval; +Stroke_volume = 0.108; +lambdaBlood = 0.46; +vArterial = 1.4; +vVenous = 4.0; + +# %%%%%%%%%%%%%%%%%% Inspiration %%%%%%%%%%%%%%%%%%%%%%%%%%% +v_i = 0.4; +r_i = Breathing_interval/v_i; + +# %%%%%%%%%%%%%%%%%% Lung %%%%%%%%%%%%%%%%%%%%%%%%%%% +vLung = 0.6; +vPLung = 0; +vGas = 2.5; +lambdaLung = 0.46; + +c_i = lambdaLung*(vLung + vPLung) + vGas; +t_i = r_i*c_i; +# %%%%%%%%%%%%%%%%%% Brain %%%%%%%%%%%%%%%%%%%%%%%%%%% +kB = 0.000086; + +vB = 0.0007; +vBP = 0.0; + +lambdaB = 0.46; + +c_b = lambdaB*vB + lambdaBlood*vBP; +r_b = Heart_interval/(kB*lambdaBlood*Stroke_volume); +t_b = r_b*c_b; + +# %%%%%%%%%%%%%%%%%% Viscera %%%%%%%%%%%%%%%%%%%%%%%%%%% +kV = 0.63; + +vV = 6.2; +lambdaV = 0.46; +vVP = 0; + +c_v = lambdaV*vV + lambdaBlood*vVP; +r_v = Heart_interval/(kV*lambdaBlood*Stroke_volume); +t_v = r_v*c_v; + +# %%%%%%%%%%%%%%%%%% Lean %%%%%%%%%%%%%%%%%%%%%%%%%%% +kL = 0.131; + +vL = 39.2; +lambdaL = 0.46; +vLP = 0; + +c_l = lambdaL*vL + lambdaBlood*vLP; +r_l = Heart_interval/(kL*lambdaBlood*Stroke_volume); +t_l = r_l*c_l; + +# %%%%%%%%%%%%%%%%%% Fat %%%%%%%%%%%%%%%%%%%%%%%%%%% +kF = 0.04; + +vF = 12.2; +lambdaF = 1.40; +vFP = 0; + +c_f = lambdaF*vF + lambdaBlood*(vFP); +r_f = Heart_interval/(kF*lambdaBlood*Stroke_volume); +t_f = r_f*c_f; + +# %%%%%%%%%%%%%%%%%% Shunt %%%%%%%%%%%%%%%%%%%%%%%%%%% +kS = 0.199; + +vSP = 0.126*vVenous; + +c_s = lambdaBlood*(vSP); +r_s = Heart_interval/(kS*lambdaBlood*Stroke_volume); +t_s = r_s*c_s; + +# %%%%%%%%%%%%%%%%%% Time constants %%%%%%%%%%%%%%%%%%%%%%%%%%% +t_1 = t_b*t_v*t_l*t_f*t_s; +t_2 = t_1*t_i; + + +# %%%%%%%%%%%%%%%%%% Convert from rs to ks %%%%%%%%%%%%%%%%%%%% + +k_b = 1/r_b; +k_v = 1/r_v; +k_l = 1/r_l; +k_f = 1/r_f; +k_s = 1/r_s; +k_i = 1/r_i; + +# %%%%%%%%%%%%%%%%%% Arterial pools %%%%%%%%%%%%%%%%%%%%%%%%%%% +# Two pool version +aPools = 2; + +vAP = vArterial; + +c_ap = lambdaBlood*(vAP)/aPools; +r_ap = Heart_interval/(lambdaBlood*Stroke_volume); + +# %%%%%%%%%%%%%%%%%% Venous pools %%%%%%%%%%%%%%%%%%%%%%%%%%% +# Two pool version +vPools = 2; + +vVP = vVenous - vSP; + +c_vp = lambdaBlood*(vVP)/vPools; +r_vp = Heart_interval/(lambdaBlood*Stroke_volume); + +k_ap = 1/r_ap; +k_vp = 1/r_vp; + + ADDED mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_rep.txt Index: mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_rep.txt ================================================================== --- mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_rep.txt +++ mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_rep.txt @@ -0,0 +1,25 @@ +# Outline report file for system MaplesonModelP (MaplesonModelP_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1999/02/17 01:46:48 peterg +% %% Included simpar rep. +% %% +% %% Revision 1.1 1999/02/17 00:08:06 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt MaplesonModelP abg tex +mtt MaplesonModelP struc tex +mtt MaplesonModelP ode tex +mtt MaplesonModelP sm tex +mtt MaplesonModelP lmfr ps + +mtt MaplesonModelP simpar txt +mtt MaplesonModelP numpar txt +mtt MaplesonModelP input txt +mtt MaplesonModelP odeso ps ADDED mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_simpar.txt Index: mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_simpar.txt ================================================================== --- mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_simpar.txt +++ mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_simpar.txt @@ -0,0 +1,19 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system MaplesonModelP (MaplesonModelP_simpar.txt) +# Generated by MTT on Fri Nov 10 11:37:00 GMT 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +FIRST = 0.0; # First time in simulation output +DT = 0.1; # Print interval +LAST = 10.0; # Last time in simulation +STEPFACTOR = 10; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Chemical/Reactor/MakeFigure.m Index: mtt/lib/examples/Chemical/Reactor/MakeFigure.m ================================================================== --- mtt/lib/examples/Chemical/Reactor/MakeFigure.m +++ mtt/lib/examples/Chemical/Reactor/MakeFigure.m @@ -0,0 +1,42 @@ + + +par = Reactor_numpar; # Parameters +sym = Reactor_sympar; # Parameter indices + +F_s= [90:10:500]; # Range of flows + +Z_a = []; Z_b = []; P = []; +for f_s=F_s + par(sym.f_s) = f_s; + [A,B,C,D] = Reactor_sm(par); # Linearised system + + p = sort(eig(A)); + P = [P p]; + + C_a = C([1 3],:); # C vector for c_a and t + D_a = D([1 3],:); # D vector for c_a and t + z_a = tzero(A,B,C_a,D_a); # Transmission zeros for c_a and t + Z_a = [Z_a z_a]; + + C_b = C(2:3,:); # C vector for c_b and t + D_b = D(2:3,:); # D vector for c_b and t + z_b = tzero(A,B,C_b,D_b); # Transmission zeros for c_b and t + Z_b = [Z_b z_b]; +endfor + +grid; xlabel("f_s"); ylabel("p1,p2"); +plot(F_s,P(1:2,:)); +psfig("Reactor_pole_1_2"); + +grid; xlabel("f_s"); ylabel("p3"); +plot(F_s,P(3,:)); +psfig("Reactor_pole_3"); + +grid; xlabel("f_s"); ylabel("z_a"); +plot(F_s,Z_a); +psfig("Reactor_zero_a"); + +grid; xlabel("f_s"); ylabel("z_b"); +plot(F_s,Z_b); +psfig("Reactor_zero_b"); + ADDED mtt/lib/examples/Chemical/Reactor/Makefile Index: mtt/lib/examples/Chemical/Reactor/Makefile ================================================================== --- mtt/lib/examples/Chemical/Reactor/Makefile +++ mtt/lib/examples/Chemical/Reactor/Makefile @@ -0,0 +1,13 @@ +## Makes the schematic diagram and the (trasmission) zero figure +all: Reactor_pic.ps Reactor_zero_b.ps + +Reactor_pic.ps: Reactor_pic.fig + fig2dev -Lps Reactor_pic.fig> Reactor_pic.ps + +Reactor_zero_b.ps: Reactor_abg.fig + mtt -q Reactor sm m + mtt -q Reactor numpar m; + mtt -q Reactor sympar m; + octave MakeFigure.m + + ADDED mtt/lib/examples/Chemical/Reactor/Reactor_abg.fig Index: mtt/lib/examples/Chemical/Reactor/Reactor_abg.fig ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_abg.fig +++ mtt/lib/examples/Chemical/Reactor/Reactor_abg.fig @@ -0,0 +1,137 @@ +#FIG 3.2 +Portrait +Center +Inches +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3001 8701 3001 7801 3151 7951 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1801 9001 2701 9001 2551 9151 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 8776 2701 9226 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3301 9001 4201 9001 4051 9151 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 4201 9301 3601 9901 3826 9901 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5701 9001 4801 9001 4951 9151 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1800 6000 2700 6000 2550 6150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 10350 5025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 6000 1800 5775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 6225 1800 6000 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 10200 600 10200 600 7500 11100 7500 11100 10200 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 6600 600 6600 600 5400 11100 5400 11100 6600 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5700 8775 5700 9225 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 4425 9300 3975 9300 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 4800 4500 8700 4650 8550 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6000 4800 4800 8700 5025 8625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9000 4800 5100 8700 5400 8700 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 4725 4800 4275 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 4725 4200 4275 4200 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 6225 4800 5775 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 6225 4200 5775 4200 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 4800 8775 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 4200 8775 4200 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3000 7200 3000 6300 3150 6450 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 10500 4800 3300 6000 3525 6075 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 5100 600 5100 600 3300 11100 3300 11100 5100 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4485 2395 4485 4130 4633 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 2999 2395 2999 4130 3148 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5970 2395 5970 4130 6119 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 10428 2397 10428 4132 10577 3843 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 8943 2397 8943 4132 9091 3843 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1800 2100 2700 2100 2550 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3300 2100 4200 2100 4050 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4800 2100 5700 2100 5550 2250 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 4200 1800 3600 1200 3600 1425 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 1875 2700 2325 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 8701 1801 8101 1201 8101 1426 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9301 2101 10201 2101 10051 2251 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 6300 2100 7200 2100 7050 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7800 2100 8700 2100 8550 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 1950 4350 1650 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8550 1950 8850 1650 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 300 600 300 600 2700 11100 2700 11100 300 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3000 4800 3000 5700 3150 5550 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 9301 1801 9901 1201 9901 1426 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 10050 1350 9900 1200 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 1200 9750 1050 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 4801 1801 5401 1201 5401 1426 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5550 1350 5400 1200 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5400 1200 5250 1050 +4 1 0 0 0 0 20 0.0000 4 195 1065 3075 4575 FMR:rfa\001 +4 1 0 0 0 0 20 0.0000 4 195 1065 4575 4575 Rate:AD\001 +4 1 0 0 0 0 20 0.0000 4 195 1050 6000 4575 Rate:AB\001 +4 2 0 0 0 0 20 0.0000 4 255 810 1651 9076 SS:t_0\001 +4 2 0 0 0 0 20 0.0000 4 255 690 3451 9976 C:h_r\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3000 6075 1\001 +4 2 0 0 0 0 20 0.0000 4 210 525 1725 6075 SS:f\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3001 9076 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 4501 9076 0\001 +4 1 0 0 0 0 20 0.0000 4 195 1035 9001 4576 Rate:BC\001 +4 1 0 0 0 0 20 0.0000 4 210 1080 10576 4576 FMR:rfb\001 +4 1 1 1 0 3 20 0.0000 4 195 2595 9600 7800 THERMAL MODEL\001 +4 1 1 1 0 3 20 0.0000 4 195 2865 9450 5700 HYDRAULIC MODEL\001 +4 1 0 0 0 0 20 0.0000 4 195 915 3000 7575 FMR:rt\001 +4 2 0 0 0 0 20 0.0000 4 255 855 1650 2175 SS:c_0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3000 2175 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 4500 2175 0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 6000 2175 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 9001 2176 0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 10501 2176 1\001 +4 1 0 0 0 0 20 0.0000 4 195 375 7500 2175 AF\001 +4 1 0 0 0 0 20 0.0000 4 255 825 8100 1050 C:m_b\001 +4 1 0 0 0 0 20 0.0000 4 240 810 3600 1050 C:m_a\001 +4 1 1 1 0 3 20 0.0000 4 195 3645 9075 600 CONCENTRATION MODEL\001 +4 1 0 0 0 0 20 0.0000 4 210 510 6151 9076 SS:t\001 +4 1 0 0 0 0 20 0.0000 4 255 855 9975 1050 SS:c_b\001 +4 1 0 0 0 0 20 0.0000 4 255 840 5475 1050 SS:c_a\001 +4 1 1 1 0 3 20 0.0000 4 195 2640 9675 3750 REACTION MODEL\001 ADDED mtt/lib/examples/Chemical/Reactor/Reactor_desc.tex Index: mtt/lib/examples/Chemical/Reactor/Reactor_desc.tex ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_desc.tex +++ mtt/lib/examples/Chemical/Reactor/Reactor_desc.tex @@ -0,0 +1,62 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Reactor (Reactor_desc.tex) +% Generated by MTT on Fri Mar 3 12:43:33 GMT 2000. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\fig{Reactor_pic} +{Reactor_pic} {0.9} {System \textbf{Reactor}, Schematic} + +Figure \Ref{fig:Reactor_pic} is the schematic diagram od a chemical reactor. +The acausal bond graph of system \textbf{Reactor} is displayed in +Figure \Ref{fig:Reactor_abg.ps} and its label file is listed in +Section \Ref{sec:Reactor_lbl}. The subsystems are listed in Section +\Ref{sec:Reactor_sub}. + +This example of a (nonlinear) chemical reactor is due to Trickett and +Bogle\footnote{ K. J. Tricket, \emph{Quantification of Inverse + Responses for Controllability Assessment of Nonlinear Processes}, + PhD Thesis, University College London, 1994} is used in this +section. The reactor has two reaction mechanisms: $\text{A} +\rightarrow \text{B} \rightarrow \text{C}$ and $\text{2A} \rightarrow +\text{D}$. The reactor mass inflow and outflow $f_r$ are identical. +$q$ represents the heat inflow to the reactor. + +This is a two input, two-output unstable nonlinear system with unstable zero +dynamics. +The following figures illustrate the properties of the +\emph{linearised} system. + +\fig{Reactor_pole_1_2} +{Reactor_pole_1_2} {0.9} {System \textbf{Reactor}: poles 1 and 2 + v. steady-state flow $f_s$} + +\fig{Reactor_pole_3} +{Reactor_pole_3} {0.9} {System \textbf{Reactor}: pole 3 + v. steady-state flow $f_s$} + +\fig{Reactor_zero_a} +{Reactor_zero_a} {0.9} {System \textbf{Reactor}: zero of system with + $t$ and $c_a$ as output + v. steady-state flow $f_s$} + +\fig{Reactor_zero_b} +{Reactor_zero_b} {0.9} {System \textbf{Reactor}: pole 3 + v. steady-state flow $f_s$} + +\begin{itemize} +\item Figures \Ref{fig:Reactor_pole_1_2} and + \Ref{fig:Reactor_pole_3} show the three poles of the + \emph{linearised} system as the steady-state flow varies. +\item Figure \Ref{fig:Reactor_zero_a} shows the system zero (when $t$ and + $c_a$ are the two system outputs) as the + \emph{linearised} system as the steady-state flow varies. +\item Figure \Ref{fig:Reactor_zero_b} shows the system zero (when $t$ and + $c_b$ are the two system outputs) as the + \emph{linearised} system as the steady-state flow varies. +\end{itemize} ADDED mtt/lib/examples/Chemical/Reactor/Reactor_input.txt Index: mtt/lib/examples/Chemical/Reactor/Reactor_input.txt ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_input.txt +++ mtt/lib/examples/Chemical/Reactor/Reactor_input.txt @@ -0,0 +1,70 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (Reactor_input.txt) +# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2003/06/06 06:38:02 gawthrop +## Made compatible with current MTT. +## +## Revision 1.2 2000/12/28 18:52:24 peterg +## Updated for new formats +## +## Revision 1.1 2000/12/28 17:09:55 peterg +## To RCS +## +############################################################### + +## Reduce steady-state parameter file (Reactor_sspar.r) +## as siso_sspar ecxept that inputs/states have different meaning +## Steady state for constant c_a, c_b and t=t_s and f=f_s + +## Unit volume Reactor: +v_r = 1; + + +## The exponentials. +e_1 = exp(-q_1/t_s); +e_2 = exp(-q_2/t_s); +e_3 = exp(-q_3/t_s); + +## Solve for the steady-state concentrations +## Solve for ca - a quadratic. +a = k_3*e_3; #ca^2 +b = k_1*e_1 + f_s; #ca^1 +c = -c_0*f_s; + +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); + +## solve for c_b +c_b = c_a*k_1*e_1/(f_s+k_2*e_2); + + +#States (masses) +x1 = c_a*v_r; +x2 = c_b*v_r; + +#Thermal state +x3 = c_p*t_s*v_r; + + +#Steady-state input q needed to achieve steady-state t_s +q_s = -( (t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); + +## The two inputs at steady-state +u1 = f_s; +u2 = q_s; + + +# Set the inputs +## Removed by MTT on Thu Dec 28 18:44:39 GMT 2000: mttu(1) = u1 + 0.1*u1*(t>0.01); # f (Reactor) +## Removed by MTT on Thu Dec 28 18:44:39 GMT 2000: mttu(2) = u2 + 0.1*u2*(t>0.05) ; # t (Reactor) + + + +## Removed by MTT on Thu Jun 5 12:48:41 BST 2003: reactor_f = u1 + 0.1*u1*(t>0.01); # Added by MTT on Thu Dec 28 18:44:47 GMT 2000 +## Removed by MTT on Thu Jun 5 12:48:41 BST 2003: reactor_t = u2 + 0.1*u2*(t>0.05); # Added by MTT on Thu Dec 28 18:44:47 GMT 2000 +reactor__f = u1 + 0.1*u1*(t>0.01); # f (Reactor) +reactor__t = u2 + 0.1*u2*(t>0.05) ; # t (Reactor) ADDED mtt/lib/examples/Chemical/Reactor/Reactor_lbl.txt Index: mtt/lib/examples/Chemical/Reactor/Reactor_lbl.txt ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_lbl.txt +++ mtt/lib/examples/Chemical/Reactor/Reactor_lbl.txt @@ -0,0 +1,76 @@ +%% Label file for system Reactor (Reactor_lbl.txt) +%SUMMARY Reactor: Simple reactor model +%DESCRIPTION Pseudo bond graph reactor model (based on ancient version) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:09:55 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%ALIAS Rate Chemical/Rate + +% Extra variables +%VAR t_s +%VAR f_s +%VAR t_0 +%VAR c_0 +%VAR rho +%VAR v_r +%VAR e_1 +%VAR e_2 +%VAR e_3 +%VAR a +%VAR b +%VAR c +%VAR c_A +%VAR c_B +%VAR x1 +%VAR x2 +%VAR x3 +%VAR q_S +%VAR h +%VAR k +%VAR n +%VAR q + +%VAR u1 +%VAR u2 + +% Port aliases + +% Argument aliases + +%% each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- +% Component type C + m_a lin effort,1 + m_b lin effort,1 + h_r lin effort,c_p + +% Component type FMR + rfa lin effort,1 + rfb lin effort,1 + rt lin effort,c_p + +% Component type Rate + AB Rate k_1,q_1,h_1,1 + BC Rate k_2,q_2,h_2,1 + AD Rate k_3,q_3,h_3,2 + +% Component type SS + c_0 SS c_0,internal + c_a SS external,0 + c_b SS external,0 + f SS internal,external + t SS external,external + t_0 SS t_0,internal ADDED mtt/lib/examples/Chemical/Reactor/Reactor_numpar.txt Index: mtt/lib/examples/Chemical/Reactor/Reactor_numpar.txt ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_numpar.txt +++ mtt/lib/examples/Chemical/Reactor/Reactor_numpar.txt @@ -0,0 +1,84 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (Reactor_numpar.txt) +# Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:09:55 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Dummies +a = 0; # Dummy +b = 0; # Dummy +c = 0; # Dummy +c_0 = 0; # Dummy +c_a = 0; # Dummy +c_b = 0; # Dummy +c_p = 0; # Dummy +e_1 = 0; # Dummy +e_2 = 0; # Dummy +e_3 = 0; # Dummy +f_s = 0; # Dummy +h = 0; # Dummy +h_1 = 0; # Dummy +h_2 = 0; # Dummy +h_3 = 0; # Dummy +k = 0; # Dummy +k_1 = 0; # Dummy +k_2 = 0; # Dummy +k_3 = 0; # Dummy +n = 0; # Dummy +q = 0; # Dummy +q_1 = 0; # Dummy +q_2 = 0; # Dummy +q_3 = 0; # Dummy +q_s = 0; # Dummy +rho = 0; # Dummy +t_0 = 0; # Dummy +t_s = 0; # Dummy +v_r = 0; # Dummy +x1 = 0; # Dummy +x2 = 0; # Dummy +x3 = 0; # Dummy + +## The bulk liquid +rho = 900; # Density +c_p = 5.0; # Specific heat + +## Substance A +k_1 = 2.5e10; # Reaction rate constant +q_1 = 1e4; # Exotherm constant +h_1 = 1e4; # Heat of reaction + +## Substance B +k_2 = 2.65e12; # Reaction rate constant +q_2 = 1.2e4; # Exotherm constant +h_2 = 1.2e4; # Heat of reaction + +## Substance C +k_3 = 6e7; # Reaction rate constant +q_3 = 8e3; # Exotherm constant +h_3 = 3e4; # Heat of reaction + +## Inflow parameters +c_0 = 10; # Inflow conc +t_0 = 530; # Inflow temp + +## Steady-state values +t_s = 530; # Steady-state temp +f_s = 100; # Steady-state flow + + + + + + + + +u1 = 1.0; # Added by MTT on Thu Jun 05 12:45:35 BST 2003 +u2 = 1.0; # Added by MTT on Thu Jun 05 12:45:35 BST 2003 ADDED mtt/lib/examples/Chemical/Reactor/Reactor_pic.fig Index: mtt/lib/examples/Chemical/Reactor/Reactor_pic.fig ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_pic.fig +++ mtt/lib/examples/Chemical/Reactor/Reactor_pic.fig @@ -0,0 +1,52 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 2400 3150 3225 3375 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2625 3300 2925 3300 +4 0 -1 0 0 2 20 0.0000 4 210 210 2400 3375 A\001 +4 0 -1 0 0 2 20 0.0000 4 210 225 3000 3375 D\001 +-6 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 2100 2100 2100 3900 1500 3900 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 1500 4050 3900 4050 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 1500 4350 2100 4350 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2100 3600 3900 4200 3900 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 3600 4350 4200 4350 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 3900 4050 4200 4050 +2 1 1 2 -1 -1 0 0 -1 6.000 0 0 -1 0 0 2 + 2100 2400 3600 2400 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2400 2925 2700 2925 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3000 2925 3300 2925 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 2850 4800 2850 3750 +4 0 -1 0 0 2 20 0.0000 4 210 210 2175 3000 A\001 +4 0 -1 0 0 2 20 0.0000 4 210 195 2775 3000 B\001 +4 0 -1 0 0 2 20 0.0000 4 210 210 3375 3000 C\001 +4 0 -1 0 0 2 20 0.0000 4 210 150 2250 3375 2\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 1875 4950 0\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 2250 4950 0\001 +4 0 -1 0 0 3 20 0.0000 4 210 150 2775 5025 q\001 +4 0 -1 0 0 3 20 0.0000 4 285 765 1500 4800 f , c , t\001 +4 0 -1 0 0 3 20 0.0000 4 285 765 3600 4800 f , c , t\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 3975 4950 b\001 +4 0 -1 0 0 3 12 0.0000 4 90 75 4350 4950 r\001 ADDED mtt/lib/examples/Chemical/Reactor/Reactor_rep.txt Index: mtt/lib/examples/Chemical/Reactor/Reactor_rep.txt ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_rep.txt +++ mtt/lib/examples/Chemical/Reactor/Reactor_rep.txt @@ -0,0 +1,36 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system Reactor (Reactor_rep.txt) +## Generated by MTT on" Fri Mar 3 12:13:34 GMT 2000. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:09:55 peterg +## To RCS +## +############################################################### + +mtt Reactor abg tex # The system description +mtt Reactor cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt Reactor struc tex # The system structure +## mtt Reactor dae tex # The system dae +mtt Reactor ode tex # The system ode +mtt Reactor sspar tex # Steady-state parameters +mtt Reactor ss tex # Steady state +## mtt Reactor dm tex # Descriptor matrices (of linearised system) +mtt Reactor sm tex # State matrices (of linearised system) +## mtt Reactor tf tex # Transfer function (of linearised system) +## mtt Reactor lmfr ps # log modulus of frequency response (of linearised system) +mtt Reactor simpar tex # Simulation parameters +mtt Reactor numpar tex # Numerical simulation parameters +mtt Reactor input tex # Simulation input +mtt Reactor state tex # Simulation initial state + +## The system outputs +mtt Reactor odeso ps 'Reactor__c_a' +mtt Reactor odeso ps 'Reactor__c_b' +mtt Reactor odeso ps 'Reactor__t' + ADDED mtt/lib/examples/Chemical/Reactor/Reactor_simp.r Index: mtt/lib/examples/Chemical/Reactor/Reactor_simp.r ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_simp.r +++ mtt/lib/examples/Chemical/Reactor/Reactor_simp.r @@ -0,0 +1,21 @@ +%% Reduce comands to simplify output (mimo_sim.r) +m_r := rho*v_r; +%mttx1 := c_a*v_r; +%mttx2 := c_b*v_r; + +% THIS MUST BE CHANGED - probs with cp and FMRs +%c_p := 1; + +%let mttx3/c_p = t; + +let e^(q_1/(mttx3/c_p)) = 1/epsilon_1; +let e^(q_2/(mttx3/c_p)) = 1/epsilon_2; +let e^(q_3/(mttx3/c_p)) = 1/epsilon_3; + +let e^(q_1/t_s) = 1/epsilon_1; +let e^(q_2/t_s) = 1/epsilon_2; +let e^(q_3/t_s) = 1/epsilon_3; + +FACTOR mttx1,mttx2; + +END; ADDED mtt/lib/examples/Chemical/Reactor/Reactor_simpar.txt Index: mtt/lib/examples/Chemical/Reactor/Reactor_simpar.txt ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_simpar.txt +++ mtt/lib/examples/Chemical/Reactor/Reactor_simpar.txt @@ -0,0 +1,21 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system Reactor (Reactor_simpar.txt) +# Generated by MTT on Fri Mar 3 12:11:48 GMT 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/08/24 12:32:25 peterg +## Initial revision +## +############################################################### + + +LAST = 0.1; # Last time in simulation +DT = 0.0002; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Chemical/Reactor/Reactor_sspar.r Index: mtt/lib/examples/Chemical/Reactor/Reactor_sspar.r ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_sspar.r +++ mtt/lib/examples/Chemical/Reactor/Reactor_sspar.r @@ -0,0 +1,57 @@ +%% Reduce steady-state parameter file (Reactor_sspar.r) +%% as siso_sspar ecxept that inputs/states have different meaning +%% Steady state for constant c_a, c_b and t=t_s and f=f_s + +%% Unit volume Reactor: +v_r := 1; + +%% Do the inputs first -- this avoids problems with reduce not +%% recognising that complicated expressions are zero + +%% The exponentials. +e_1 := e^(-q_1/t_s); +e_2 := e^(-q_2/t_s); +e_3 := e^(-q_3/t_s); + +%Steady-state input q needed to achieve steady-state t_s +q_s := -( + + (t_0-t_s)*c_p*f_s + + e_1*h_1*k_1*x1 + + e_2*h_2*k_2*x2 + + e_3*h_3*k_3*x1^2 + ); + +%% The two inputs at steady-state +MTTu1 := f_s; +MTTu2 := q_s; + +%States (masses) +x1 := c_a*v_r; +x2 := c_b*v_r; + +%Thermal state +x3 := c_p*t_s*v_r; + +%Load up the vectors +MTTx1 := x1; +MTTx2 := x2; +MTTx3 := x3; + +MTTy1 := c_b; +MTTy2 := t_s; + +%% Finally, solve for the steady-state concentrations +%% Solve for ca - a quadratic. +a := k_3*e_3; %ca^2 +b := k_1*e_1 + f_s; %ca^1 +c := -c_0*f_s; + +c_a := (-b + sqrt(b^2 - 4*a*c))/(2*a); + +%% solve for c_b +c_b := c_a*k_1*e_1/(f_s+k_2*e_2); + + +END; + + ADDED mtt/lib/examples/Chemical/Reactor/Reactor_state.txt Index: mtt/lib/examples/Chemical/Reactor/Reactor_state.txt ================================================================== --- mtt/lib/examples/Chemical/Reactor/Reactor_state.txt +++ mtt/lib/examples/Chemical/Reactor/Reactor_state.txt @@ -0,0 +1,73 @@ +# -*-octave-*- Put Emacs into octave-mode +# State specification (Reactor_state.txt) +# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2003/06/06 06:38:31 gawthrop +## Made compatible with current MTT. +## +## Revision 1.2 2000/12/28 18:52:25 peterg +## Updated for new formats +## +## Revision 1.1 2000/12/28 17:09:55 peterg +## To RCS +## +############################################################### + +## Reduce steady-state parameter file (Reactor_sspar.r) +## as siso_sspar ecxept that states/states have different meaning +## Steady state for constant c_a, c_b and t=t_s and f=f_s + +## Unit volume Reactor: +v_r = 1; + + +## The exponentials. +e_1 = exp(-q_1/t_s); +e_2 = exp(-q_2/t_s); +e_3 = exp(-q_3/t_s); + +## Solve for the steady-state concentrations +## Solve for ca - a quadratic. +a = k_3*e_3; #ca^2 +b = k_1*e_1 + f_s; #ca^1 +c = -c_0*f_s; + +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); + +## solve for c_b +c_b = c_a*k_1*e_1/(f_s+k_2*e_2); + + +#States (masses) +x1 = c_a*v_r; +x2 = c_b*v_r; + +#Thermal state +x3 = c_p*t_s*v_r; + + +#Steady-state state q needed to achieve steady-state t_s +q_s = -((t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); + +## The two inputs at steady-state +u1 = f_s; +u2 = q_s; + +## Load up the states +## Removed by MTT on Thu Dec 28 18:46:20 GMT 2000: mttx(1) = x1; +## Removed by MTT on Thu Dec 28 18:46:20 GMT 2000: mttx(2) = x2; +## Removed by MTT on Thu Dec 28 18:46:20 GMT 2000: mttx(3) = x3; + + + + +## Removed by MTT on Thu Jun 5 12:47:23 BST 2003: reactor_h_r = x3; # Added by MTT on Thu Dec 28 18:46:25 GMT 2000 +## Removed by MTT on Thu Jun 5 12:47:23 BST 2003: reactor_m_a = x1; # Added by MTT on Thu Dec 28 18:46:25 GMT 2000 +## Removed by MTT on Thu Jun 5 12:47:23 BST 2003: reactor_m_b = x2; # Added by MTT on Thu Dec 28 18:46:25 GMT 2000 +reactor__h_r = x3; +reactor__m_a = x1; +reactor__m_b = x2; ADDED mtt/lib/examples/Chemical/ReactorTF/MakeFigure.m Index: mtt/lib/examples/Chemical/ReactorTF/MakeFigure.m ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/MakeFigure.m +++ mtt/lib/examples/Chemical/ReactorTF/MakeFigure.m @@ -0,0 +1,22 @@ +## Makes the figures + +par = ReactorTF_numpar; # Parameters +sym = ReactorTF_sympar; # Parameter indices + +F_s= [90:10:500]; # Range of flows + +Z = []; +for f_s=F_s + par(sym.f_s) = f_s; + z = sort(eig(ReactorTF_sm(par))); + Z = [Z z]; +endfor + + +grid; xlabel("f_s"); ylabel("z_1"); +plot(F_s,Z(1,:)); +psfig("ReactorTF_zero_1"); + +grid; xlabel("f_s"); ylabel("z_2"); +plot(F_s,Z(2,:)); +psfig("ReactorTF_zero_2"); ADDED mtt/lib/examples/Chemical/ReactorTF/Makefile Index: mtt/lib/examples/Chemical/ReactorTF/Makefile ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/Makefile +++ mtt/lib/examples/Chemical/ReactorTF/Makefile @@ -0,0 +1,14 @@ +## Makes the schematic diagram and the zero figure +all: ReactorTF_pic.ps ReactorTF_zero_1.ps ReactorTF_zero_2.ps + +ReactorTF_pic.ps: ReactorTF_pic.fig + fig2dev -Lps ReactorTF_pic.fig> ReactorTF_pic.ps + +ReactorTF_zero_1.ps: ReactorTF_abg.fig + mtt -q ReactorTF sm m; mtt -q ReactorTF numpar m; + mtt -q ReactorTF sympar m; + octave MakeFigure.m + +ReactorTF_zero_2.ps: ReactorTF_zero_1.ps + touch ReactorTF_zero_2.ps + ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_abg.fig Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_abg.fig ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_abg.fig +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_abg.fig @@ -0,0 +1,130 @@ +#FIG 3.2 +Portrait +Center +Inches +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3001 8701 3001 7801 3151 7951 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1801 9001 2701 9001 2551 9151 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 8776 2701 9226 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3301 9001 4201 9001 4051 9151 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 4201 9301 3601 9901 3826 9901 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5701 9001 4801 9001 4951 9151 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1800 6000 2700 6000 2550 6150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 10350 5025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 6000 1800 5775 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 10200 600 10200 600 7500 11100 7500 11100 10200 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 6600 600 6600 600 5400 11100 5400 11100 6600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 4800 4500 8700 4650 8550 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6000 4800 4800 8700 5025 8625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9000 4800 5100 8700 5400 8700 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 4725 4800 4275 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 4725 4200 4275 4200 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 6225 4800 5775 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 6225 4200 5775 4200 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 4800 8775 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 4200 8775 4200 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3000 7200 3000 6300 3150 6450 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 10500 4800 3300 6000 3525 6075 +2 4 1 2 1 7 1 0 -1 4.000 0 0 7 0 0 5 + 11100 5100 600 5100 600 3300 11100 3300 11100 5100 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4485 2395 4485 4130 4633 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 2999 2395 2999 4130 3148 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5970 2395 5970 4130 6119 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 10428 2397 10428 4132 10577 3843 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 8943 2397 8943 4132 9091 3843 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1800 2100 2700 2100 2550 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3300 2100 4200 2100 4050 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4800 2100 5700 2100 5550 2250 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 4200 1800 3600 1200 3600 1425 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 1875 2700 2325 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 8701 1801 8101 1201 8101 1426 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9301 2101 10201 2101 10051 2251 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 9301 1801 9901 1201 9901 1426 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 6300 2100 7200 2100 7050 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7800 2100 8700 2100 8550 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 1950 4350 1650 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 10050 1350 9900 1200 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 1200 9750 1050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8550 1950 8850 1650 +2 4 1 2 1 7 1 0 -1 4.000 0 0 7 0 0 5 + 11100 300 600 300 600 2700 11100 2700 11100 300 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3000 4800 3000 5700 3150 5550 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 4800 8775 4800 9000 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 5700 9000 5700 9225 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 6225 2700 6000 +4 1 0 0 0 0 20 0.0000 4 195 1065 3075 4575 FMR:rfa\001 +4 1 0 0 0 0 20 0.0000 4 195 1065 4575 4575 Rate:AD\001 +4 1 0 0 0 0 20 0.0000 4 195 1050 6000 4575 Rate:AB\001 +4 2 0 0 0 0 20 0.0000 4 255 810 1651 9076 SS:t_0\001 +4 2 0 0 0 0 20 0.0000 4 255 690 3451 9976 C:h_r\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3000 6075 1\001 +4 2 0 0 0 0 20 0.0000 4 210 525 1725 6075 SS:f\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3001 9076 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 4501 9076 0\001 +4 1 0 0 0 0 20 0.0000 4 195 1035 9001 4576 Rate:BC\001 +4 1 0 0 0 0 20 0.0000 4 210 1080 10576 4576 FMR:rfb\001 +4 1 1 1 0 3 20 0.0000 4 195 2595 9600 7800 THERMAL MODEL\001 +4 1 0 0 0 0 20 0.0000 4 195 915 3000 7575 FMR:rt\001 +4 1 1 1 0 3 20 0.0000 4 195 2640 9675 3750 REACTION MODEL\001 +4 2 0 0 0 0 20 0.0000 4 255 855 1650 2175 SS:c_0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3000 2175 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 4500 2175 0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 6000 2175 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 9001 2176 0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 10501 2176 1\001 +4 1 0 0 0 0 20 0.0000 4 195 375 7500 2175 AF\001 +4 1 0 0 0 0 20 0.0000 4 255 825 8100 1050 C:m_b\001 +4 1 0 0 0 0 20 0.0000 4 255 855 9975 1050 SS:c_b\001 +4 1 0 0 0 0 20 0.0000 4 240 810 3600 1050 C:m_a\001 +4 1 1 1 0 3 20 0.0000 4 195 3645 9075 600 CONCENTRATION MODEL\001 +4 1 0 0 0 0 20 0.0000 4 210 510 6151 9076 SS:t\001 +4 1 1 1 0 3 20 0.0000 4 195 2865 9450 5700 HYDRAULIC MODEL\001 ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_args.new Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_args.new ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_args.new +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_args.new @@ -0,0 +1,1 @@ + ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_desc.tex Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_desc.tex ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_desc.tex +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_desc.tex @@ -0,0 +1,50 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system ReactorTF (ReactorTF_desc.tex) +% Generated by MTT on Fri Mar 3 12:43:33 GMT 2000. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\fig{ReactorTF_pic} +{ReactorTF_pic} {0.9} {System \textbf{ReactorTF}, Schematic} + +Figure \Ref{fig:ReactorTF_pic} is the schematic diagram of a chemical +reactor. + +The acausal bond graph of system \textbf{ReactorTF} is displayed in +Figure \Ref{fig:ReactorTF_abg.ps} and its label file is listed in +Section \Ref{sec:ReactorTF_lbl}. The subsystems are listed in Section +\Ref{sec:ReactorTF_sub}. + +This example of a (nonlinear) chemical reactor is due to Trickett and +Bogle\footnote{ K. J. Tricket, \emph{Quantification of Inverse + Responses for Controllability Assessment of Nonlinear Processes}, + PhD Thesis, University College London, 1994} is used in this +section. The reactor has two reaction mechanisms: $\text{A} +\rightarrow \text{B} \rightarrow \text{C}$ and $\text{2A} \rightarrow +\text{D}$. The reactor mass inflow and outflow $f_r$ are identical. +$q$ represents the heat inflow to the reactor. + +The control loop $t$/$f$ has been inverted. The resulting SISO +system has two interpretations: +\begin{enumerate} +\item the \emph{dynamics} of the $c_b$/$q$ loop when the $t$/$f$ loop + is under perfect control and +\item the \emph{inverse} dynamics of the $t$/$f$ loop. +\end{enumerate} + +\fig{ReactorTF_zero_1} {ReactorTF_zero_1} {0.9} +{System\textbf{ReactorTF}: zero 1 v flow} +\fig{ReactorTF_zero_2} {ReactorTF_zero_2} {0.9} +{System\textbf{ReactorTF}: zero 2 v flow} + +Figures \Ref{fig:ReactorTF_zero_1} and \Ref{fig:ReactorTF_zero_2} +shows the poles of the linearised system as the steady-state flow +varies: these are the \emph{zeros} of the $t$/$f$ control-loop when +the $c_b$/$q$ loop is \emph{open}. + + ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt @@ -0,0 +1,55 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (ReactorTF_input.txt) +# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2003/06/06 06:38:44 gawthrop +## Made compatible with current MTT. +## +## Revision 1.1 2000/12/28 17:12:57 peterg +## To RCS +## +############################################################### + +## Reduce steady-state parameter file (ReactorTF_sspar.r) +## as siso_sspar ecxept that inputs/states have different meaning +## Steady state for constant c_a, c_b and t=t_s and f=f_s + +## Unit volume ReactorTF: +v_r = 1; + + +## The exponentials. +e_1 = exp(-q_1/t_s); +e_2 = exp(-q_2/t_s); +e_3 = exp(-q_3/t_s); + +## Solve for the steady-state concentrations +## Solve for ca - a quadratic. +a = k_3*e_3; #ca^2 +b = k_1*e_1 + f_s; #ca^1 +c = -c_0*f_s; + +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); + +## solve for c_b +c_b = c_a*k_1*e_1/(f_s+k_2*e_2); + + +#States (masses) +x1 = c_a*v_r; +x2 = c_b*v_r; + +#Thermal state +#x3 = c_p*t_s*v_r; + + +#Steady-state input q needed to achieve steady-state t_s +q_s = -( (t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); + +# Set the inputs +## Removed by MTT on Thu Jun 5 14:13:24 BST 2003: mttu(1) = q_s + 0.1*q_s*(t>0.01); # q (ReactorTF) +reactortf__t = q_s + 0.1*q_s*(t>0.01); # q (ReactorTF) ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_lbl.txt Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_lbl.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_lbl.txt +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_lbl.txt @@ -0,0 +1,77 @@ +%% Label file for system ReactorTF (ReactorTF_lbl.txt) +%SUMMARY ReactorTF: Simple reactor model -- TF loop inverted +%DESCRIPTION Pseudo bond graph reactor model (based on ancient version) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:12:57 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%ALIAS Rate Chemical/Rate + +% Extra variables +%VAR t_s +%VAR f_s +%VAR t_0 +%VAR c_0 +%VAR rho +%VAR v_r +%VAR e_1 +%VAR e_2 +%VAR e_3 +%VAR a +%VAR b +%VAR c +%VAR c_A +%VAR c_B +%VAR x1 +%VAR x2 +%VAR x3 +%VAR q_S + +%VAR h +%VAR k +%VAR n +%VAR q + + +% Port aliases + +% Argument aliases + +%% each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- +% Component type C + m_a lin effort,1 + m_b lin effort,1 + h_r lin effort,c_p + +% Component type FMR + rfa lin effort,1 + rfb lin effort,1 + rt lin effort,c_p + +% Component type Rate + AB Rate k_1,q_1,h_1,1 + BC Rate k_2,q_2,h_2,1 + AD Rate k_3,q_3,h_3,2 + +% Component type SS + c_0 SS c_0,internal + c_b SS external,0 + f SS internal,internal + t SS t_s,external + t_0 SS t_0,internal + + + ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.m Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.m ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.m +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.m @@ -0,0 +1,186 @@ +function mttpar = ReactorTF_numpar(); +% mttpar = ReactorTF_numpar(); +%System ReactorTF, representation numpar, language m; +%File ReactorTF_numpar.m; +%Generated by MTT on Thu Aug 24 14:28:46 BST 2000; +% + +#====== Set up the global variables ======# +global ... + a ... + b ... + c ... + c_0 ... + c_a ... + c_b ... + c_p ... + e_1 ... + e_2 ... + e_3 ... + f_s ... + h ... + h_1 ... + h_2 ... + h_3 ... + k ... + k_1 ... + k_2 ... + k_3 ... + n ... + q ... + q_1 ... + q_2 ... + q_3 ... + q_s ... + rho ... + t_0 ... + t_s ... + v_r ... + x1 ... + x2 ... + x3 ; +## Set parameters to zero + a = 0.0; + b = 0.0; + c = 0.0; + c_0 = 0.0; + c_a = 0.0; + c_b = 0.0; + c_p = 0.0; + e_1 = 0.0; + e_2 = 0.0; + e_3 = 0.0; + f_s = 0.0; + h = 0.0; + h_1 = 0.0; + h_2 = 0.0; + h_3 = 0.0; + k = 0.0; + k_1 = 0.0; + k_2 = 0.0; + k_3 = 0.0; + n = 0.0; + q = 0.0; + q_1 = 0.0; + q_2 = 0.0; + q_3 = 0.0; + q_s = 0.0; + rho = 0.0; + t_0 = 0.0; + t_s = 0.0; + v_r = 0.0; + x1 = 0.0; + x2 = 0.0; + x3 = 0.0; + % -*-octave-*- Put Emacs into octave-mode + % Numerical parameter file (ReactorTF_numpar.txt) + % Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 + + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % %% Version control history + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % %% $Id$ + % %% $Log$ + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % +a = 0; % Dummy +b = 0; % Dummy +c = 0; % Dummy +c_0 = 0; % Dummy +c_a = 0; % Dummy +c_b = 0; % Dummy +c_p = 0; % Dummy +e_1 = 0; % Dummy +e_2 = 0; % Dummy +e_3 = 0; % Dummy +f_s = 0; % Dummy +h = 0; % Dummy +h_1 = 0; % Dummy +h_2 = 0; % Dummy +h_3 = 0; % Dummy +k = 0; % Dummy +k_1 = 0; % Dummy +k_2 = 0; % Dummy +k_3 = 0; % Dummy +n = 0; % Dummy +q = 0; % Dummy +q_1 = 0; % Dummy +q_2 = 0; % Dummy +q_3 = 0; % Dummy +q_s = 0; % Dummy +rho = 0; % Dummy +t_0 = 0; % Dummy +t_s = 0; % Dummy +v_r = 0; % Dummy +x1 = 0; % Dummy +x2 = 0; % Dummy +x3 = 0; % Dummy + + % +rho = 900; % Density +c_p = 5.0; % Specific heat + + % +k_1 = 2.5e10; % Reaction rate constant +q_1 = 1e4; % Exotherm constant +h_1 = 1e4; % Heat of reaction + + % +k_2 = 2.65e12; % Reaction rate constant +q_2 = 1.2e4; % Exotherm constant +h_2 = 1.2e4; % Heat of reaction + + % +k_3 = 6e7; % Reaction rate constant +q_3 = 8e3; % Exotherm constant +h_3 = 3e4; % Heat of reaction + + % +c_0 = 10; % Inflow conc +t_0 = 500; % Inflow temp + + % +t_s = 530; % Steady-state temp +f_s = 100; % Steady-state flow + + + + + + + + +## Set up the parameter vector + mttpar(1) = a; + mttpar(2) = b; + mttpar(3) = c; + mttpar(4) = c_0; + mttpar(5) = c_a; + mttpar(6) = c_b; + mttpar(7) = c_p; + mttpar(8) = e_1; + mttpar(9) = e_2; + mttpar(10) = e_3; + mttpar(11) = f_s; + mttpar(12) = h; + mttpar(13) = h_1; + mttpar(14) = h_2; + mttpar(15) = h_3; + mttpar(16) = k; + mttpar(17) = k_1; + mttpar(18) = k_2; + mttpar(19) = k_3; + mttpar(20) = n; + mttpar(21) = q; + mttpar(22) = q_1; + mttpar(23) = q_2; + mttpar(24) = q_3; + mttpar(25) = q_s; + mttpar(26) = rho; + mttpar(27) = t_0; + mttpar(28) = t_s; + mttpar(29) = v_r; + mttpar(30) = x1; + mttpar(31) = x2; + mttpar(32) = x3; ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.txt Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.txt +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.txt @@ -0,0 +1,79 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (ReactorTF_numpar.txt) +# Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Dummies +a = 0; # Dummy +b = 0; # Dummy +c = 0; # Dummy +c_0 = 0; # Dummy +c_a = 0; # Dummy +c_b = 0; # Dummy +c_p = 0; # Dummy +e_1 = 0; # Dummy +e_2 = 0; # Dummy +e_3 = 0; # Dummy +f_s = 0; # Dummy +h = 0; # Dummy +h_1 = 0; # Dummy +h_2 = 0; # Dummy +h_3 = 0; # Dummy +k = 0; # Dummy +k_1 = 0; # Dummy +k_2 = 0; # Dummy +k_3 = 0; # Dummy +n = 0; # Dummy +q = 0; # Dummy +q_1 = 0; # Dummy +q_2 = 0; # Dummy +q_3 = 0; # Dummy +q_s = 0; # Dummy +rho = 0; # Dummy +t_0 = 0; # Dummy +t_s = 0; # Dummy +v_r = 0; # Dummy +x1 = 0; # Dummy +x2 = 0; # Dummy +x3 = 0; # Dummy + +## The bulk liquid +rho = 900; # Density +c_p = 5.0; # Specific heat + +## Substance A +k_1 = 2.5e10; # Reaction rate constant +q_1 = 1e4; # Exotherm constant +h_1 = 1e4; # Heat of reaction + +## Substance B +k_2 = 2.65e12; # Reaction rate constant +q_2 = 1.2e4; # Exotherm constant +h_2 = 1.2e4; # Heat of reaction + +## Substance C +k_3 = 6e7; # Reaction rate constant +q_3 = 8e3; # Exotherm constant +h_3 = 3e4; # Heat of reaction + +## Inflow parameters +c_0 = 10; # Inflow conc +t_0 = 500; # Inflow temp + +## Steady-state values +t_s = 530; # Steady-state temp +f_s = 100; # Steady-state flow + + + + + + + + ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_pic.fig Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_pic.fig ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_pic.fig +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_pic.fig @@ -0,0 +1,52 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 2400 3150 3225 3375 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2625 3300 2925 3300 +4 0 -1 0 0 2 20 0.0000 4 210 210 2400 3375 A\001 +4 0 -1 0 0 2 20 0.0000 4 210 225 3000 3375 D\001 +-6 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 2100 2100 2100 3900 1500 3900 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 1500 4050 3900 4050 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 1500 4350 2100 4350 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2100 3600 3900 4200 3900 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 3600 4350 4200 4350 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 3900 4050 4200 4050 +2 1 1 2 -1 -1 0 0 -1 6.000 0 0 -1 0 0 2 + 2100 2400 3600 2400 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2400 2925 2700 2925 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3000 2925 3300 2925 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 2850 4800 2850 3750 +4 0 -1 0 0 2 20 0.0000 4 210 210 2175 3000 A\001 +4 0 -1 0 0 2 20 0.0000 4 210 195 2775 3000 B\001 +4 0 -1 0 0 2 20 0.0000 4 210 210 3375 3000 C\001 +4 0 -1 0 0 2 20 0.0000 4 210 150 2250 3375 2\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 1875 4950 0\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 2250 4950 0\001 +4 0 -1 0 0 3 20 0.0000 4 210 150 2775 5025 q\001 +4 0 -1 0 0 3 20 0.0000 4 285 765 1500 4800 f , c , t\001 +4 0 -1 0 0 3 20 0.0000 4 285 765 3600 4800 f , c , t\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 3975 4950 b\001 +4 0 -1 0 0 3 12 0.0000 4 90 75 4350 4950 r\001 ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.tex Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.tex ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.tex +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.tex @@ -0,0 +1,152 @@ + + +\section{\textbf{ReactorTF}: representation \textbf{abg}, language \textbf{tex}} +\label{sec:ReactorTF_abg.tex} +\index{\textbf{ReactorTF} -- abg} + + +MTT command: +\begin{verbatim} +mtt ReactorTF abg tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_abg.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{cbg}, language \textbf{ps}} +\label{sec:ReactorTF_cbg.ps} +\index{\textbf{ReactorTF} -- cbg} + + +MTT command: +\begin{verbatim} +mtt ReactorTF cbg ps +\end{verbatim} +This representation is given as Figure \Ref{fig:ReactorTF_cbg.ps}. +\fig{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_cbg} + {ReactorTF_cbg.ps} + {0.9} + {System \textbf{ReactorTF}, representation cbg} + + +\section{\textbf{ReactorTF}: representation \textbf{struc}, language \textbf{tex}} +\label{sec:ReactorTF_struc.tex} +\index{\textbf{ReactorTF} -- struc} + + +MTT command: +\begin{verbatim} +mtt ReactorTF struc tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_struc.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{ode}, language \textbf{tex}} +\label{sec:ReactorTF_ode.tex} +\index{\textbf{ReactorTF} -- ode} + + +MTT command: +\begin{verbatim} +mtt ReactorTF ode tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_ode.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{sspar}, language \textbf{tex}} +\label{sec:ReactorTF_sspar.tex} +\index{\textbf{ReactorTF} -- sspar} + + +MTT command: +\begin{verbatim} +mtt ReactorTF sspar tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_sspar.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{ss}, language \textbf{tex}} +\label{sec:ReactorTF_ss.tex} +\index{\textbf{ReactorTF} -- ss} + + +MTT command: +\begin{verbatim} +mtt ReactorTF ss tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_ss.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{sm}, language \textbf{tex}} +\label{sec:ReactorTF_sm.tex} +\index{\textbf{ReactorTF} -- sm} + + +MTT command: +\begin{verbatim} +mtt ReactorTF sm tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_sm.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{simpar}, language \textbf{tex}} +\label{sec:ReactorTF_simpar.tex} +\index{\textbf{ReactorTF} -- simpar} + + +MTT command: +\begin{verbatim} +mtt ReactorTF simpar tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_simpar.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{numpar}, language \textbf{tex}} +\label{sec:ReactorTF_numpar.tex} +\index{\textbf{ReactorTF} -- numpar} + + +MTT command: +\begin{verbatim} +mtt ReactorTF numpar tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_numpar.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{input}, language \textbf{tex}} +\label{sec:ReactorTF_input.tex} +\index{\textbf{ReactorTF} -- input} + + +MTT command: +\begin{verbatim} +mtt ReactorTF input tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_input.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{state}, language \textbf{tex}} +\label{sec:ReactorTF_state.tex} +\index{\textbf{ReactorTF} -- state} + + +MTT command: +\begin{verbatim} +mtt ReactorTF state tex +\end{verbatim} + \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_state.tex} + + +\section{\textbf{ReactorTF}: representation \textbf{odeso}, language \textbf{ps}} +\label{sec:ReactorTF_odeso.ps} +\index{\textbf{ReactorTF} -- odeso} + + +MTT command: +\begin{verbatim} +mtt ReactorTF odeso ps +\end{verbatim} +This representation is given as Figure \Ref{fig:ReactorTF_odeso.ps}. +\fig{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_odeso} + {ReactorTF_odeso.ps} + {0.9} + {System \textbf{ReactorTF}, representation odeso} ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.txt Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.txt +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.txt @@ -0,0 +1,32 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system ReactorTF (ReactorTF_rep.txt) +## Generated by MTT on" Fri Mar 3 12:13:34 GMT 2000. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:12:57 peterg +## To RCS +## +############################################################### + +mtt ReactorTF abg tex # The system description +mtt ReactorTF cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt ReactorTF struc tex # The system structure +## mtt ReactorTF dae tex # The system dae +mtt ReactorTF ode tex # The system ode +mtt ReactorTF sspar tex # Steady-state parameters +mtt ReactorTF ss tex # Steady state +## mtt ReactorTF dm tex # Descriptor matrices (of linearised system) +mtt ReactorTF sm tex # State matrices (of linearised system) +## mtt ReactorTF tf tex # Transfer function (of linearised system) +## mtt ReactorTF lmfr ps # log modulus of frequency response (of linearised system) +mtt ReactorTF simpar tex # Simulation parameters +mtt ReactorTF numpar tex # Numerical simulation parameters +mtt ReactorTF input tex # Simulation input +mtt ReactorTF state tex # Simulation initial state +mtt ReactorTF odeso ps # Simulation + ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simp.r Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simp.r ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simp.r +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simp.r @@ -0,0 +1,21 @@ +%% Reduce comands to simplify output (mimo_sim.r) +m_r := rho*v_r; +%mttx1 := c_a*v_r; +%mttx2 := c_b*v_r; + +% THIS MUST BE CHANGED - probs with cp and FMRs +%c_p := 1; + +%let mttx3/c_p = t; + +let e^(q_1/(mttx3/c_p)) = 1/epsilon_1; +let e^(q_2/(mttx3/c_p)) = 1/epsilon_2; +let e^(q_3/(mttx3/c_p)) = 1/epsilon_3; + +let e^(q_1/t_s) = 1/epsilon_1; +let e^(q_2/t_s) = 1/epsilon_2; +let e^(q_3/t_s) = 1/epsilon_3; + +FACTOR mttx1,mttx2; + +END; ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simpar.txt Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simpar.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simpar.txt +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system ReactorTF (ReactorTF_simpar.txt) +# Generated by MTT on Fri Mar 3 12:11:48 GMT 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 0.05; # Last time in simulation +DT = 0.0002; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sm.m Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sm.m ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sm.m +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sm.m @@ -0,0 +1,185 @@ +function [mtta,mttb,mttc,mttd] = ReactorTF_sm(mttpar); +% [mtta,mttb,mttc,mttd] = ReactorTF_sm(mttpar); +%System ReactorTF, representation sm, language m; +%File ReactorTF_sm.m; +%Generated by MTT on Thu Aug 24 14:45:50 BST 2000; +% +%====== Set up the global variables ======% +global ... +a ... +b ... +c ... +c_0 ... +c_a ... +c_b ... +c_p ... +e_1 ... +e_2 ... +e_3 ... +f_s ... +h ... +h_1 ... +h_2 ... +h_3 ... +k ... +k_1 ... +k_2 ... +k_3 ... +n ... +q ... +q_1 ... +q_2 ... +q_3 ... +q_s ... +rho ... +t_0 ... +t_s ... +v_r ... +x1 ... +x2 ... +x3 ; +a = mttpar(1); +b = mttpar(2); +c = mttpar(3); +c_0 = mttpar(4); +c_a = mttpar(5); +c_b = mttpar(6); +c_p = mttpar(7); +e_1 = mttpar(8); +e_2 = mttpar(9); +e_3 = mttpar(10); +f_s = mttpar(11); +h = mttpar(12); +h_1 = mttpar(13); +h_2 = mttpar(14); +h_3 = mttpar(15); +k = mttpar(16); +k_1 = mttpar(17); +k_2 = mttpar(18); +k_3 = mttpar(19); +n = mttpar(20); +q = mttpar(21); +q_1 = mttpar(22); +q_2 = mttpar(23); +q_3 = mttpar(24); +q_s = mttpar(25); +rho = mttpar(26); +t_0 = mttpar(27); +t_s = mttpar(28); +v_r = mttpar(29); +x1 = mttpar(30); +x2 = mttpar(31); +x3 = mttpar(32); +%a matrix% +mtta = zeros(2,2); +mtt_t1 = exp((2.0*q_1+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s^2*h_3; +mtt_t1 = mtt_t1+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_0*f_s*h_3*k_3; +mtt_t1 = mtt_t1-(exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s*h_1*k_1); +mtt_t1 = mtt_t1+2.0*exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s*h_3*k_1; +mtt_t1 = mtt_t1-(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))^2*c_0*h_1*k_1*k_3); +mtt_t1 = mtt_t1+2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))^2*c_0*h_3*k_1*k_3; +mtt_t1 = mtt_t1-(exp(q_3/t_s)*abs(exp(q_1/t_s))^2*h_1*k_1^2); +mtt_t1 = mtt_t1+exp(q_3/t_s)*abs(exp(q_1/t_s))^2*h_3*k_1^2; +mtt_t3 = 2.0*exp((2.0*q_1+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t4 = 2.0*exp((2.0*q_1)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t4 = mtt_t4*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1-(mtt_t3*abs(exp(q_1/t_s))*f_s*h_3)-(mtt_t4*abs(exp(q_1/t_s))*c_0*h_3*k_3); +mtt_t5 = 2.0*exp((2.0*q_1)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t5 = mtt_t5*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t3 = 2.0*exp((2.0*q_1)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1-(mtt_t5*abs(exp(q_1/t_s))*c_p*k_3*t_0)+mtt_t3*abs(exp(q_1/t_s))*c_p*k_3*t_s; +mtt_t4 = exp((q_1+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t4 = mtt_t4*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t3 = 2.0*exp((q_1+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1+mtt_t4*abs(exp(q_1/t_s))*h_1*k_1-(mtt_t3*abs(exp(q_1/t_s))*h_3*k_1); +mtt_t1 = mtt_t1+exp((4.0*q_1+q_3)/t_s)*f_s^2*h_3; +mtt_t1 = mtt_t1+4.0*exp((4.0*q_1)/t_s)*c_0*f_s*h_3*k_3; +mtt_t1 = mtt_t1+2.0*exp((3.0*q_1+q_3)/t_s)*f_s*h_3*k_1; +mtt_t1 = mtt_t1+exp((2.0*q_1+q_3)/t_s)*h_3*k_1^2; +mtt_t2 = 2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_3*t_0; +mtta(1,1) = mtt_t1/(mtt_t2-(2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_3*t_s)); +mtt_t1 = -(exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*h_2*k_2); +mtt_t1 = mtt_t1-(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_0*h_2*k_2*k_3); +mtt_t3 = exp((q_1+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1-(exp(q_3/t_s)*abs(exp(q_1/t_s))*h_2*k_1*k_2)+mtt_t3*h_2*k_2; +mtt_t2 = 2.0*exp((q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*k_3*t_0; +mtta(1,2) = mtt_t1/(mtt_t2-(2.0*exp((q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*k_3*t_s)); +mtt_t1 = exp((2.0*q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s^2*h_3*k_1; +mtt_t1 = mtt_t1+2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))^2*c_p*f_s*k_1*k_3*t_0; +mtt_t1 = mtt_t1-(2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))^2*c_p*f_s*k_1*k_3*t_s); +mtt_t1 = mtt_t1+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_1*k_2*k_3*t_0; +mtt_t1 = mtt_t1-(2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_1*k_2*k_3*t_s); +mtt_t1 = mtt_t1-(exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s*h_1*k_1^2); +mtt_t1 = mtt_t1+2.0*exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s*h_3*k_1^2; +mtt_t1 = mtt_t1-(exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*h_1*k_1^3); +mtt_t1 = mtt_t1+exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*h_3*k_1^3; +mtt_t3 = 2.0*exp((2.0*q_1+q_2+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t4 = exp((q_1+q_2+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t4 = mtt_t4*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1-(mtt_t3*abs(exp(q_1/t_s))*f_s*h_3*k_1)+mtt_t4*abs(exp(q_1/t_s))*h_1*k_1^2; +mtt_t5 = 2.0*exp((q_1+q_2+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t5 = mtt_t5*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1-(mtt_t5*abs(exp(q_1/t_s))*h_3*k_1^2); +mtt_t1 = mtt_t1+exp((4.0*q_1+q_2+q_3)/t_s)*f_s^2*h_3*k_1; +mtt_t1 = mtt_t1+4.0*exp((4.0*q_1+q_2)/t_s)*c_0*f_s*h_3*k_1*k_3; +mtt_t1 = mtt_t1+2.0*exp((3.0*q_1+q_2+q_3)/t_s)*f_s*h_3*k_1^2; +mtt_t1 = mtt_t1+exp((2.0*q_1+q_2+q_3)/t_s)*h_3*k_1^3; +mtt_t2 = 2.0*exp((3.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))^2*c_p*f_s*k_3*t_0; +mtt_t2 = mtt_t2-(2.0*exp((3.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))^2*c_p*f_s*k_3*t_s); +mtt_t2 = mtt_t2+2.0*exp((3.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_2*k_3*t_0; +mtta(2,1) = mtt_t1/(mtt_t2-(2.0*exp((3.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_2*k_3*t_s)); +mtt_t1 = -(2.0*exp((2.0*q_1+2.0*q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s^2*k_3*t_0); +mtt_t1 = mtt_t1+2.0*exp((2.0*q_1+2.0*q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s^2*k_3*t_s; +mtt_t1 = mtt_t1-(4.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_2*k_3*t_0); +mtt_t1 = mtt_t1+4.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_2*k_3*t_s; +mtt_t1 = mtt_t1-(2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*c_p*k_2^2*k_3*t_0); +mtt_t1 = mtt_t1+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*c_p*k_2^2*k_3*t_s; +mtt_t1 = mtt_t1-(exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*h_2*k_1*k_2); +mtt_t1 = mtt_t1-(exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))*h_2*k_1^2*k_2); +mtt_t3 = exp((q_1+q_2+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1+mtt_t3*h_2*k_1*k_2; +mtt_t2 = 2.0*exp((2.0*q_1+2.0*q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_3*t_0; +mtt_t2 = mtt_t2-(2.0*exp((2.0*q_1+2.0*q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_3*t_s); +mtt_t2 = mtt_t2+2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*k_2*k_3*t_0; +mtta(2,2) = mtt_t1/(mtt_t2-(2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*k_2*k_3*t_s)); +%b matrix% +mttb = zeros(2,1); +mtt_t1 = -(exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))*f_s); +mtt_t1 = mtt_t1-(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_0*k_3); +mtt_t1 = mtt_t1-(exp(q_3/t_s)*abs(exp(q_1/t_s))*k_1); +mtt_t3 = exp((q_1+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t1 = mtt_t1+mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t4 = 2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_p*k_3*t_0; +mttb(1) = mtt_t1/(mtt_t4-(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_p*k_3*t_s)); +mtt_t1 = -(exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*k_1); +mtt_t3 = exp((q_1+q_2+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1-(exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))*k_1^2)+mtt_t3*k_1; +mtt_t2 = 2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_3*t_0; +mtt_t2 = mtt_t2-(2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_3*t_s); +mtt_t2 = mtt_t2+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*c_p*k_2*k_3*t_0; +mttb(2) = mtt_t1/(mtt_t2-(2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*c_p*k_2*k_3*t_s)); +%c matrix% +mttc = zeros(1,2); +mttc(1,2) = 1.0; +%d matrix% +mttd = zeros(1,1); ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sspar.r Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sspar.r ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sspar.r +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sspar.r @@ -0,0 +1,55 @@ +%% Reduce steady-state parameter file (ReactorTF_sspar.r) +%% as siso_sspar ecxept that inputs/states have different meaning +%% Steady state for constant c_a, c_b and t=t_s and f=f_s + +%% Unit volume ReactorTF: +v_r := 1; + +%% Do the inputs first -- this avoids problems with reduce not +%% recognising that complicated expressions are zero + +%% The exponentials. +e_1 := e^(-q_1/t_s); +e_2 := e^(-q_2/t_s); +e_3 := e^(-q_3/t_s); + +%Steady-state input q needed to achieve steady-state t_s +q_s := -( + + (t_0-t_s)*c_p*f_s + + e_1*h_1*k_1*x1 + + e_2*h_2*k_2*x2 + + e_3*h_3*k_3*x1^2 + ); + +%% The input at steady-state +MTTu1 := q_s; + +%States (masses) +x1 := c_a*v_r; +x2 := c_b*v_r; + +%Thermal state +x3 := c_p*t_s*v_r; + +%Load up the vectors +MTTx1 := x1; +MTTx2 := x2; + +MTTy1 := c_b; +%MTTy2 := t_s; + +%% Finally, solve for the steady-state concentrations +%% Solve for ca - a quadratic. +a := k_3*e_3; %ca^2 +b := k_1*e_1 + f_s; %ca^1 +c := -c_0*f_s; + +c_a := (-b + sqrt(b^2 - 4*a*c))/(2*a); + +%% solve for c_b +c_b := c_a*k_1*e_1/(f_s+k_2*e_2); + + +END; + + ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt @@ -0,0 +1,58 @@ +# -*-octave-*- Put Emacs into octave-mode +# State specification (ReactorTF_state.txt) +# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2003/06/06 06:39:05 gawthrop +## Made compatible with current MTT. +## +## Revision 1.1 2000/12/28 17:12:57 peterg +## To RCS +## +############################################################### + +## Reduce steady-state parameter file (ReactorTF_sspar.r) +## as siso_sspar ecxept that states/states have different meaning +## Steady state for constant c_a, c_b and t=t_s and f=f_s + +## Unit volume ReactorTF: +v_r = 1; + + +## The exponentials. +e_1 = exp(-q_1/t_s); +e_2 = exp(-q_2/t_s); +e_3 = exp(-q_3/t_s); + +## Solve for the steady-state concentrations +## Solve for ca - a quadratic. +a = k_3*e_3; #ca^2 +b = k_1*e_1 + f_s; #ca^1 +c = -c_0*f_s; + +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); + +## solve for c_b +c_b = c_a*k_1*e_1/(f_s+k_2*e_2); + + +#States (masses) +x1 = c_a*v_r; +x2 = c_b*v_r; + +#Thermal state +#x3 = c_p*t_s*v_r; + +## Load up the states +## Removed by MTT on Thu Jun 5 14:14:18 BST 2003: mttx(1) = x1; +## Removed by MTT on Thu Jun 5 14:14:18 BST 2003: mttx(2) = x2; +## Removed by MTT on Thu Jun 5 14:14:18 BST 2003: mttx(3) = x3; + + + + +reactortf__m_a = x1; +reactortf__m_b = x2; ADDED mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sympar.m Index: mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sympar.m ================================================================== --- mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sympar.m +++ mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sympar.m @@ -0,0 +1,40 @@ +function sympar = ReactorTF_sympar(); +% sympar = ReactorTF_sympar(); +%System ReactorTF, representation sympar, language m; +%File ReactorTF_sympar.m; +%Generated by MTT on Thu Aug 24 14:45:51 BST 2000; +% +global ... +mtt_no_globals ; + sympar.a = 1; # ReactorTF + sympar.b = 2; # ReactorTF + sympar.c = 3; # ReactorTF + sympar.c_0 = 4; # ReactorTF + sympar.c_A = 5; # ReactorTF + sympar.c_B = 6; # ReactorTF + sympar.c_p = 7; # ReactorTF + sympar.e_1 = 8; # ReactorTF + sympar.e_2 = 9; # ReactorTF + sympar.e_3 = 10; # ReactorTF + sympar.f_s = 11; # ReactorTF + sympar.h = 12; # Rate + sympar.h_1 = 13; # ReactorTF + sympar.h_2 = 14; # ReactorTF + sympar.h_3 = 15; # ReactorTF + sympar.k = 16; # Rate + sympar.k_1 = 17; # ReactorTF + sympar.k_2 = 18; # ReactorTF + sympar.k_3 = 19; # ReactorTF + sympar.n = 20; # Rate + sympar.q = 21; # Rate + sympar.q_1 = 22; # ReactorTF + sympar.q_2 = 23; # ReactorTF + sympar.q_3 = 24; # ReactorTF + sympar.q_S = 25; # ReactorTF + sympar.rho = 26; # ReactorTF + sympar.t_0 = 27; # ReactorTF + sympar.t_s = 28; # ReactorTF + sympar.v_r = 29; # ReactorTF + sympar.x1 = 30; # ReactorTF + sympar.x2 = 31; # ReactorTF + sympar.x3 = 32; # ReactorTF ADDED mtt/lib/examples/Chemical/ReactorTQ/MakeFigure.m Index: mtt/lib/examples/Chemical/ReactorTQ/MakeFigure.m ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/MakeFigure.m +++ mtt/lib/examples/Chemical/ReactorTQ/MakeFigure.m @@ -0,0 +1,19 @@ +## Makes the figures + +par = ReactorTQ_numpar; # Parameters +sym = ReactorTQ_sympar; # Parameter indices + +F_s= [90:10:500]; # Range of flows + +Z = []; +for f_s=F_s + par(sym.f_s) = f_s; + z = sort(eig(ReactorTQ_sm(par))); + Z = [Z z]; +endfor + + +grid; xlabel("f_s"); ylabel("z"); +plot(F_s,Z); +psfig("ReactorTQ_zero"); + ADDED mtt/lib/examples/Chemical/ReactorTQ/Makefile Index: mtt/lib/examples/Chemical/ReactorTQ/Makefile ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/Makefile +++ mtt/lib/examples/Chemical/ReactorTQ/Makefile @@ -0,0 +1,11 @@ +## Makes the schematic diagram and the zero figure +all: ReactorTQ_pic.ps ReactorTQ_zero.ps + +ReactorTQ_pic.ps: ReactorTQ_pic.fig + fig2dev -Lps ReactorTQ_pic.fig> ReactorTQ_pic.ps + +ReactorTQ_zero.ps: ReactorTQ_abg.fig + mtt -q ReactorTQ sm m; mtt -q ReactorTQ numpar m; + mtt -q ReactorTQ sympar m; + octave MakeFigure.m + ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_abg.fig Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_abg.fig ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_abg.fig +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_abg.fig @@ -0,0 +1,128 @@ +#FIG 3.2 +Portrait +Center +Inches +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3001 8701 3001 7801 3151 7951 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1801 9001 2701 9001 2551 9151 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 8776 2701 9226 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3301 9001 4201 9001 4051 9151 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 4201 9301 3601 9901 3826 9901 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5701 9001 4801 9001 4951 9151 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1800 6000 2700 6000 2550 6150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 10350 5025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 6000 1800 5775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 6225 1800 6000 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 10200 600 10200 600 7500 11100 7500 11100 10200 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 6600 600 6600 600 5400 11100 5400 11100 6600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 4800 4500 8700 4650 8550 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6000 4800 4800 8700 5025 8625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9000 4800 5100 8700 5400 8700 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 4725 4800 4275 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 4725 4200 4275 4200 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 6225 4800 5775 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 6225 4200 5775 4200 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 4800 8775 4800 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 4200 8775 4200 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3000 7200 3000 6300 3150 6450 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 10500 4800 3300 6000 3525 6075 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 5100 600 5100 600 3300 11100 3300 11100 5100 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4485 2395 4485 4130 4633 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 2999 2395 2999 4130 3148 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 5970 2395 5970 4130 6119 3841 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 10428 2397 10428 4132 10577 3843 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 1800 2100 2700 2100 2550 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3300 2100 4200 2100 4050 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 4800 2100 5700 2100 5550 2250 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 4200 1800 3600 1200 3600 1425 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 1875 2700 2325 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 8701 1801 8101 1201 8101 1426 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 9301 2101 10201 2101 10051 2251 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 9301 1801 9901 1201 9901 1426 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 6300 2100 7200 2100 7050 2250 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 7800 2100 8700 2100 8550 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 1950 4350 1650 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 10050 1350 9900 1200 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 1200 9750 1050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8550 1950 8850 1650 +2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 + 11100 300 600 300 600 2700 11100 2700 11100 300 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 3000 4800 3000 5700 3150 5550 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 2 + 4800 8775 4800 9225 +2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 + 8943 2397 8943 4132 9091 3843 +4 1 0 0 0 0 20 0.0000 4 195 1065 3075 4575 FMR:rfa\001 +4 1 0 0 0 0 20 0.0000 4 195 1065 4575 4575 Rate:AD\001 +4 1 0 0 0 0 20 0.0000 4 195 1050 6000 4575 Rate:AB\001 +4 2 0 0 0 0 20 0.0000 4 255 810 1651 9076 SS:t_0\001 +4 2 0 0 0 0 20 0.0000 4 255 690 3451 9976 C:h_r\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3000 6075 1\001 +4 2 0 0 0 0 20 0.0000 4 210 525 1725 6075 SS:f\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3001 9076 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 4501 9076 0\001 +4 1 0 0 0 0 20 0.0000 4 195 1035 9001 4576 Rate:BC\001 +4 1 0 0 0 0 20 0.0000 4 210 1080 10576 4576 FMR:rfb\001 +4 1 1 1 0 3 20 0.0000 4 195 2595 9600 7800 THERMAL MODEL\001 +4 1 1 1 0 3 20 0.0000 4 195 2865 9450 5700 HYDRAULIC MODEL\001 +4 1 0 0 0 0 20 0.0000 4 195 915 3000 7575 FMR:rt\001 +4 1 1 1 0 3 20 0.0000 4 195 2640 9675 3750 REACTION MODEL\001 +4 2 0 0 0 0 20 0.0000 4 255 855 1650 2175 SS:c_0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 3000 2175 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 4500 2175 0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 6000 2175 1\001 +4 1 0 0 0 0 20 0.0000 4 195 150 9001 2176 0\001 +4 1 0 0 0 0 20 0.0000 4 195 150 10501 2176 1\001 +4 1 0 0 0 0 20 0.0000 4 195 375 7500 2175 AF\001 +4 1 0 0 0 0 20 0.0000 4 255 825 8100 1050 C:m_b\001 +4 1 0 0 0 0 20 0.0000 4 255 855 9975 1050 SS:c_b\001 +4 1 0 0 0 0 20 0.0000 4 240 810 3600 1050 C:m_a\001 +4 1 1 1 0 3 20 0.0000 4 195 3645 9075 600 CONCENTRATION MODEL\001 +4 1 0 0 0 0 20 0.0000 4 210 510 6151 9076 SS:t\001 ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_args.new Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_args.new ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_args.new +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_args.new @@ -0,0 +1,1 @@ + ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_desc.tex Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_desc.tex ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_desc.tex +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_desc.tex @@ -0,0 +1,48 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system ReactorTQ (ReactorTQ_desc.tex) +% Generated by MTT on Fri Mar 3 12:43:33 GMT 2000. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\fig{ReactorTQ_pic} +{ReactorTQ_pic} {0.9} {System \textbf{ReactorTQ}, Schematic} + +Figure \Ref{fig:ReactorTQ_pic} is the schematic diagram of a chemical +reactor. + +The acausal bond graph of system \textbf{ReactorTQ} is displayed in +Figure \Ref{fig:ReactorTQ_abg.ps} and its label file is listed in +Section \Ref{sec:ReactorTQ_lbl}. The subsystems are listed in Section +\Ref{sec:ReactorTQ_sub}. + +This example of a (nonlinear) chemical reactor is due to Trickett and +Bogle\footnote{ K. J. Tricket, \emph{Quantification of Inverse + Responses for Controllability Assessment of Nonlinear Processes}, + PhD Thesis, University College London, 1994} is used in this +section. The reactor has two reaction mechanisms: $\text{A} +\rightarrow \text{B} \rightarrow \text{C}$ and $\text{2A} \rightarrow +\text{D}$. The reactor mass inflow and outflow $f_r$ are identical. +$q$ represents the heat inflow to the reactor. + +The control loop $t$/$q$ has been inverted. The resulting SISO +system has two interpretations: +\begin{enumerate} +\item the \emph{dynamics} of the $c_b$/$f$ loop when the $t$/$q$ loop + is under perfect control and +\item the \emph{inverse} dynamics of the $t$/$q$ loop. +\end{enumerate} + +\fig{ReactorTQ_zero} {ReactorTQ_zero} {0.9} +{System\textbf{ReactorTQ}: zeros v flow} + +Figure \Ref{fig:ReactorTQ_zero} +shows the poles of the linearised system as the steady-state flow +varies: these are the \emph{zeros} of the $c_b$/$f$ control-loop when +the $t$/$q$ loop is \emph{open}. + + ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt @@ -0,0 +1,51 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (ReactorTQ_input.txt) +# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2003/06/06 06:39:20 gawthrop +## Made compatible with current MTT. +## +## Revision 1.1 2000/12/28 17:19:08 peterg +## To RCS +## +############################################################### + +## Reduce steady-state parameter file (ReactorTQ_sspar.r) +## as siso_sspar ecxept that inputs/states have different meaning +## Steady state for constant c_a, c_b and t=t_s and f=f_s + +## Unit volume ReactorTQ: +v_r = 1; + + +## The exponentials. +e_1 = exp(-q_1/t_s); +e_2 = exp(-q_2/t_s); +e_3 = exp(-q_3/t_s); + +## Solve for the steady-state concentrations +## Solve for ca - a quadratic. +a = k_3*e_3; #ca^2 +b = k_1*e_1 + f_s; #ca^1 +c = -c_0*f_s; + +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); + +## solve for c_b +c_b = c_a*k_1*e_1/(f_s+k_2*e_2); + + +#States (masses) +x1 = c_a*v_r; +x2 = c_b*v_r; + +#Thermal state +x3 = c_p*t_s*v_r; + +# Set the inputs +## Removed by MTT on Thu Jun 5 14:27:42 BST 2003: mttu(1) = f_s + 0.1*f_s*(t>0.01); # f (ReactorTQ) +reactortq__f = f_s + 0.1*f_s*(t>0.01); # f (ReactorTQ) ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_lbl.txt Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_lbl.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_lbl.txt +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_lbl.txt @@ -0,0 +1,77 @@ +%% Label file for system ReactorTQ (ReactorTQ_lbl.txt) +%SUMMARY ReactorTQ: Simple reactor model - with TQ loop inverted +%DESCRIPTION Pseudo bond graph reactor model (based on ancient version) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:19:08 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%ALIAS Rate Chemical/Rate + +% Extra variables +%VAR t_s +%VAR f_s +%VAR t_0 +%VAR c_0 +%VAR rho +%VAR v_r +%VAR e_1 +%VAR e_2 +%VAR e_3 +%VAR a +%VAR b +%VAR c +%VAR c_A +%VAR c_B +%VAR x1 +%VAR x2 +%VAR x3 +%VAR q_S + +%VAR h +%VAR k +%VAR n +%VAR q + + +% Port aliases + +% Argument aliases + +%% each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- +% Component type C + m_a lin effort,1 + m_b lin effort,1 + h_r lin effort,c_p + +% Component type FMR + rfa lin effort,1 + rfb lin effort,1 + rt lin effort,c_p + +% Component type Rate + AB Rate k_1,q_1,h_1,1 + BC Rate k_2,q_2,h_2,1 + AD Rate k_3,q_3,h_3,2 + +% Component type SS + c_0 SS c_0,internal + c_b SS external,0 + f SS internal,external + t SS t_s,internal + t_0 SS t_0,internal + + + ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.m Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.m ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.m +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.m @@ -0,0 +1,186 @@ +function mttpar = ReactorTQ_numpar(); +% mttpar = ReactorTQ_numpar(); +%System ReactorTQ, representation numpar, language m; +%File ReactorTQ_numpar.m; +%Generated by MTT on Thu Aug 24 14:29:20 BST 2000; +% + +#====== Set up the global variables ======# +global ... + a ... + b ... + c ... + c_0 ... + c_a ... + c_b ... + c_p ... + e_1 ... + e_2 ... + e_3 ... + f_s ... + h ... + h_1 ... + h_2 ... + h_3 ... + k ... + k_1 ... + k_2 ... + k_3 ... + n ... + q ... + q_1 ... + q_2 ... + q_3 ... + q_s ... + rho ... + t_0 ... + t_s ... + v_r ... + x1 ... + x2 ... + x3 ; +## Set parameters to zero + a = 0.0; + b = 0.0; + c = 0.0; + c_0 = 0.0; + c_a = 0.0; + c_b = 0.0; + c_p = 0.0; + e_1 = 0.0; + e_2 = 0.0; + e_3 = 0.0; + f_s = 0.0; + h = 0.0; + h_1 = 0.0; + h_2 = 0.0; + h_3 = 0.0; + k = 0.0; + k_1 = 0.0; + k_2 = 0.0; + k_3 = 0.0; + n = 0.0; + q = 0.0; + q_1 = 0.0; + q_2 = 0.0; + q_3 = 0.0; + q_s = 0.0; + rho = 0.0; + t_0 = 0.0; + t_s = 0.0; + v_r = 0.0; + x1 = 0.0; + x2 = 0.0; + x3 = 0.0; + % -*-octave-*- Put Emacs into octave-mode + % Numerical parameter file (ReactorTQ_numpar.txt) + % Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 + + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % %% Version control history + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % %% $Id$ + % %% $Log$ + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % +a = 0; % Dummy +b = 0; % Dummy +c = 0; % Dummy +c_0 = 0; % Dummy +c_a = 0; % Dummy +c_b = 0; % Dummy +c_p = 0; % Dummy +e_1 = 0; % Dummy +e_2 = 0; % Dummy +e_3 = 0; % Dummy +f_s = 0; % Dummy +h = 0; % Dummy +h_1 = 0; % Dummy +h_2 = 0; % Dummy +h_3 = 0; % Dummy +k = 0; % Dummy +k_1 = 0; % Dummy +k_2 = 0; % Dummy +k_3 = 0; % Dummy +n = 0; % Dummy +q = 0; % Dummy +q_1 = 0; % Dummy +q_2 = 0; % Dummy +q_3 = 0; % Dummy +q_s = 0; % Dummy +rho = 0; % Dummy +t_0 = 0; % Dummy +t_s = 0; % Dummy +v_r = 0; % Dummy +x1 = 0; % Dummy +x2 = 0; % Dummy +x3 = 0; % Dummy + + % +rho = 900; % Density +c_p = 5.0; % Specific heat + + % +k_1 = 2.5e10; % Reaction rate constant +q_1 = 1e4; % Exotherm constant +h_1 = 1e4; % Heat of reaction + + % +k_2 = 2.65e12; % Reaction rate constant +q_2 = 1.2e4; % Exotherm constant +h_2 = 1.2e4; % Heat of reaction + + % +k_3 = 6e7; % Reaction rate constant +q_3 = 8e3; % Exotherm constant +h_3 = 3e4; % Heat of reaction + + % +c_0 = 10; % Inflow conc +t_0 = 530; % Inflow temp + + % +t_s = 530; % Steady-state temp +f_s = 100; % Steady-state flow + + + + + + + + +## Set up the parameter vector + mttpar(1) = a; + mttpar(2) = b; + mttpar(3) = c; + mttpar(4) = c_0; + mttpar(5) = c_a; + mttpar(6) = c_b; + mttpar(7) = c_p; + mttpar(8) = e_1; + mttpar(9) = e_2; + mttpar(10) = e_3; + mttpar(11) = f_s; + mttpar(12) = h; + mttpar(13) = h_1; + mttpar(14) = h_2; + mttpar(15) = h_3; + mttpar(16) = k; + mttpar(17) = k_1; + mttpar(18) = k_2; + mttpar(19) = k_3; + mttpar(20) = n; + mttpar(21) = q; + mttpar(22) = q_1; + mttpar(23) = q_2; + mttpar(24) = q_3; + mttpar(25) = q_s; + mttpar(26) = rho; + mttpar(27) = t_0; + mttpar(28) = t_s; + mttpar(29) = v_r; + mttpar(30) = x1; + mttpar(31) = x2; + mttpar(32) = x3; ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.txt Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.txt +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.txt @@ -0,0 +1,79 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (ReactorTQ_numpar.txt) +# Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Dummies +a = 0; # Dummy +b = 0; # Dummy +c = 0; # Dummy +c_0 = 0; # Dummy +c_a = 0; # Dummy +c_b = 0; # Dummy +c_p = 0; # Dummy +e_1 = 0; # Dummy +e_2 = 0; # Dummy +e_3 = 0; # Dummy +f_s = 0; # Dummy +h = 0; # Dummy +h_1 = 0; # Dummy +h_2 = 0; # Dummy +h_3 = 0; # Dummy +k = 0; # Dummy +k_1 = 0; # Dummy +k_2 = 0; # Dummy +k_3 = 0; # Dummy +n = 0; # Dummy +q = 0; # Dummy +q_1 = 0; # Dummy +q_2 = 0; # Dummy +q_3 = 0; # Dummy +q_s = 0; # Dummy +rho = 0; # Dummy +t_0 = 0; # Dummy +t_s = 0; # Dummy +v_r = 0; # Dummy +x1 = 0; # Dummy +x2 = 0; # Dummy +x3 = 0; # Dummy + +## The bulk liquid +rho = 900; # Density +c_p = 5.0; # Specific heat + +## Substance A +k_1 = 2.5e10; # Reaction rate constant +q_1 = 1e4; # Exotherm constant +h_1 = 1e4; # Heat of reaction + +## Substance B +k_2 = 2.65e12; # Reaction rate constant +q_2 = 1.2e4; # Exotherm constant +h_2 = 1.2e4; # Heat of reaction + +## Substance C +k_3 = 6e7; # Reaction rate constant +q_3 = 8e3; # Exotherm constant +h_3 = 3e4; # Heat of reaction + +## Inflow parameters +c_0 = 10; # Inflow conc +t_0 = 530; # Inflow temp + +## Steady-state values +t_s = 530; # Steady-state temp +f_s = 100; # Steady-state flow + + + + + + + + ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_pic.fig Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_pic.fig ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_pic.fig +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_pic.fig @@ -0,0 +1,52 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 2400 3150 3225 3375 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2625 3300 2925 3300 +4 0 -1 0 0 2 20 0.0000 4 210 210 2400 3375 A\001 +4 0 -1 0 0 2 20 0.0000 4 210 225 3000 3375 D\001 +-6 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 2100 2100 2100 3900 1500 3900 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 1500 4050 3900 4050 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 1500 4350 2100 4350 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 2100 3600 3900 4200 3900 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 3600 4350 4200 4350 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 + 3900 4050 4200 4050 +2 1 1 2 -1 -1 0 0 -1 6.000 0 0 -1 0 0 2 + 2100 2400 3600 2400 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2400 2925 2700 2925 +2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3000 2925 3300 2925 +2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 2850 4800 2850 3750 +4 0 -1 0 0 2 20 0.0000 4 210 210 2175 3000 A\001 +4 0 -1 0 0 2 20 0.0000 4 210 195 2775 3000 B\001 +4 0 -1 0 0 2 20 0.0000 4 210 210 3375 3000 C\001 +4 0 -1 0 0 2 20 0.0000 4 210 150 2250 3375 2\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 1875 4950 0\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 2250 4950 0\001 +4 0 -1 0 0 3 20 0.0000 4 210 150 2775 5025 q\001 +4 0 -1 0 0 3 20 0.0000 4 285 765 1500 4800 f , c , t\001 +4 0 -1 0 0 3 20 0.0000 4 285 765 3600 4800 f , c , t\001 +4 0 -1 0 0 3 12 0.0000 4 135 90 3975 4950 b\001 +4 0 -1 0 0 3 12 0.0000 4 90 75 4350 4950 r\001 ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_rep.txt Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_rep.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_rep.txt +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_rep.txt @@ -0,0 +1,32 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system ReactorTQ (ReactorTQ_rep.txt) +## Generated by MTT on" Fri Mar 3 12:13:34 GMT 2000. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:19:08 peterg +## To RCS +## +############################################################### + +mtt ReactorTQ abg tex # The system description +mtt ReactorTQ cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt ReactorTQ struc tex # The system structure +## mtt ReactorTQ dae tex # The system dae +mtt ReactorTQ ode tex # The system ode +## mtt ReactorTQ sspar tex # Steady-state parameters +## mtt ReactorTQ ss tex # Steady state +## mtt ReactorTQ dm tex # Descriptor matrices (of linearised system) +mtt ReactorTQ sm tex # State matrices (of linearised system) +## mtt ReactorTQ tf tex # Transfer function (of linearised system) +## mtt ReactorTQ lmfr ps # log modulus of frequency response (of linearised system) +mtt ReactorTQ simpar tex # Simulation parameters +mtt ReactorTQ numpar tex # Numerical simulation parameters +mtt ReactorTQ input tex # Simulation input +mtt ReactorTQ state tex # Simulation initial state + +mtt ReactorTQ odeso ps ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simp.r Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simp.r ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simp.r +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simp.r @@ -0,0 +1,21 @@ +%% Reduce comands to simplify output (mimo_sim.r) +m_r := rho*v_r; +%mttx1 := c_a*v_r; +%mttx2 := c_b*v_r; + +% THIS MUST BE CHANGED - probs with cp and FMRs +%c_p := 1; + +%let mttx3/c_p = t; + +let e^(q_1/(mttx3/c_p)) = 1/epsilon_1; +let e^(q_2/(mttx3/c_p)) = 1/epsilon_2; +let e^(q_3/(mttx3/c_p)) = 1/epsilon_3; + +let e^(q_1/t_s) = 1/epsilon_1; +let e^(q_2/t_s) = 1/epsilon_2; +let e^(q_3/t_s) = 1/epsilon_3; + +FACTOR mttx1,mttx2; + +END; ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simpar.txt Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simpar.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simpar.txt +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system ReactorTQ (ReactorTQ_simpar.txt) +# Generated by MTT on Fri Mar 3 12:11:48 GMT 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 0.05; # Last time in simulation +DT = 0.0002; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m @@ -0,0 +1,99 @@ +function [mtta,mttb,mttc,mttd] = ReactorTQ_sm(mttpar); +% [mtta,mttb,mttc,mttd] = ReactorTQ_sm(mttpar); +%System ReactorTQ, representation sm, language m; +%File ReactorTQ_sm.m; +%Generated by MTT on Thu Aug 24 14:47:46 BST 2000; +% +%====== Set up the global variables ======% +global ... +a ... +b ... +c ... +c_0 ... +c_a ... +c_b ... +c_p ... +e_1 ... +e_2 ... +e_3 ... +f_s ... +h ... +h_1 ... +h_2 ... +h_3 ... +k ... +k_1 ... +k_2 ... +k_3 ... +n ... +q ... +q_1 ... +q_2 ... +q_3 ... +q_s ... +rho ... +t_0 ... +t_s ... +v_r ... +x1 ... +x2 ... +x3 ; +a = mttpar(1); +b = mttpar(2); +c = mttpar(3); +c_0 = mttpar(4); +c_a = mttpar(5); +c_b = mttpar(6); +c_p = mttpar(7); +e_1 = mttpar(8); +e_2 = mttpar(9); +e_3 = mttpar(10); +f_s = mttpar(11); +h = mttpar(12); +h_1 = mttpar(13); +h_2 = mttpar(14); +h_3 = mttpar(15); +k = mttpar(16); +k_1 = mttpar(17); +k_2 = mttpar(18); +k_3 = mttpar(19); +n = mttpar(20); +q = mttpar(21); +q_1 = mttpar(22); +q_2 = mttpar(23); +q_3 = mttpar(24); +q_s = mttpar(25); +rho = mttpar(26); +t_0 = mttpar(27); +t_s = mttpar(28); +v_r = mttpar(29); +x1 = mttpar(30); +x2 = mttpar(31); +x3 = mttpar(32); +%a matrix% +mtta = zeros(2,2); +mtt_t1 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t1 = -sqrt((mtt_t1+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtta(1,1) = mtt_t1/abs(exp(q_1/t_s)); +mtta(2,1) = k_1/exp(q_1/t_s); +mtta(2,2) = (-(exp(q_2/t_s)*f_s)-k_2)/exp(q_2/t_s); +%b matrix% +mttb = zeros(2,1); +mtt_t1 = exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))*f_s+2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_0*k_3; +mtt_t1 = mtt_t1+exp(q_3/t_s)*abs(exp(q_1/t_s))*k_1; +mtt_t3 = exp((q_1+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t1 = mtt_t1-(mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s))); +mttb(1) = mtt_t1/(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*k_3); +mtt_t1 = exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*k_1; +mtt_t3 = exp((q_1+q_2+q_3)/t_s); +mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; +mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); +mtt_t1 = mtt_t1+exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))*k_1^2-(mtt_t3*k_1); +mtt_t2 = 2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*f_s*k_3; +mttb(2) = mtt_t1/(mtt_t2+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*k_2*k_3); +%c matrix% +mttc = zeros(1,2); +mttc(1,2) = 1.0; +%d matrix% +mttd = zeros(1,1); ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sspar.r Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sspar.r ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sspar.r +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sspar.r @@ -0,0 +1,51 @@ +%% Reduce steady-state parameter file (ReactorTQ_sspar.r) +%% as siso_sspar ecxept that inputs/states have different meaning +%% Steady state for constant c_a, c_b and t=t_s and f=f_s + +%% Unit volume ReactorTQ: +v_r := 1; + +%% Do the inputs first -- this avoids problems with reduce not +%% recognising that complicated expressions are zero + +%% The exponentials. +e_1 := e^(-q_1/t_s); +e_2 := e^(-q_2/t_s); +e_3 := e^(-q_3/t_s); + +%Steady-state input q needed to achieve steady-state t_s +q_s := -( + + (t_0-t_s)*f_s + + e_1*h_1*k_1*x1 + + e_2*h_2*k_2*x2 + + e_3*h_3*k_3*x1^2 + ); + +%% The input at steady-state +MTTu1 := f_s; + +%States (masses) +x1 := c_a*v_r; +x2 := c_b*v_r; + +%Load up the vectors +MTTx1 := x1; +MTTx2 := x2; + +MTTy1 := c_b; + +%% Finally, solve for the steady-state concentrations +%% Solve for ca - a quadratic. +a := k_3*e_3; %ca^2 +b := k_1*e_1 + f_s; %ca^1 +c := -c_0*f_s; + +c_a := (-b + sqrt(b^2 - 4*a*c))/(2*a); + +%% solve for c_b +c_b := c_a*k_1*e_1/(f_s+k_2*e_2); + + +END; + + ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt @@ -0,0 +1,54 @@ +# -*-octave-*- Put Emacs into octave-mode +# State specification (ReactorTQ_state.txt) +# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2003/06/06 06:39:39 gawthrop +## Made compatible with current MTT. +## +## Revision 1.1 2000/12/28 17:19:08 peterg +## To RCS +## +############################################################### + +## Reduce steady-state parameter file (ReactorTQ_sspar.r) +## as siso_sspar ecxept that states/states have different meaning +## Steady state for constant c_a, c_b and t=t_s and f=f_s + +## Unit volume ReactorTQ: +v_r = 1; + + +## The exponentials. +e_1 = exp(-q_1/t_s); +e_2 = exp(-q_2/t_s); +e_3 = exp(-q_3/t_s); + +## Solve for the steady-state concentrations +## Solve for ca - a quadratic. +a = k_3*e_3; #ca^2 +b = k_1*e_1 + f_s; #ca^1 +c = -c_0*f_s; + +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); + +## solve for c_b +c_b = c_a*k_1*e_1/(f_s+k_2*e_2); + + +#States (masses) +x1 = c_a*v_r; +x2 = c_b*v_r; + + +## The two inputs at steady-state +##mttu(1) = f_s; + +## Load up the states +## Removed by MTT on Thu Jun 5 14:25:48 BST 2003: mttx(1) = x1; +## Removed by MTT on Thu Jun 5 14:25:48 BST 2003: mttx(2) = x2; +reactortq__m_a = x1; +reactortq__m_b = x2; ADDED mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sympar.m Index: mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sympar.m ================================================================== --- mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sympar.m +++ mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sympar.m @@ -0,0 +1,40 @@ +function sympar = ReactorTQ_sympar(); +% sympar = ReactorTQ_sympar(); +%System ReactorTQ, representation sympar, language m; +%File ReactorTQ_sympar.m; +%Generated by MTT on Thu Aug 24 14:47:48 BST 2000; +% +global ... +mtt_no_globals ; + sympar.a = 1; # ReactorTQ + sympar.b = 2; # ReactorTQ + sympar.c = 3; # ReactorTQ + sympar.c_0 = 4; # ReactorTQ + sympar.c_A = 5; # ReactorTQ + sympar.c_B = 6; # ReactorTQ + sympar.c_p = 7; # ReactorTQ + sympar.e_1 = 8; # ReactorTQ + sympar.e_2 = 9; # ReactorTQ + sympar.e_3 = 10; # ReactorTQ + sympar.f_s = 11; # ReactorTQ + sympar.h = 12; # Rate + sympar.h_1 = 13; # ReactorTQ + sympar.h_2 = 14; # ReactorTQ + sympar.h_3 = 15; # ReactorTQ + sympar.k = 16; # Rate + sympar.k_1 = 17; # ReactorTQ + sympar.k_2 = 18; # ReactorTQ + sympar.k_3 = 19; # ReactorTQ + sympar.n = 20; # Rate + sympar.q = 21; # Rate + sympar.q_1 = 22; # ReactorTQ + sympar.q_2 = 23; # ReactorTQ + sympar.q_3 = 24; # ReactorTQ + sympar.q_S = 25; # ReactorTQ + sympar.rho = 26; # ReactorTQ + sympar.t_0 = 27; # ReactorTQ + sympar.t_s = 28; # ReactorTQ + sympar.v_r = 29; # ReactorTQ + sympar.x1 = 30; # ReactorTQ + sympar.x2 = 31; # ReactorTQ + sympar.x3 = 32; # ReactorTQ ADDED mtt/lib/examples/Components/OnePorts/OnePorts_abg.fig Index: mtt/lib/examples/Components/OnePorts/OnePorts_abg.fig ================================================================== --- mtt/lib/examples/Components/OnePorts/OnePorts_abg.fig +++ mtt/lib/examples/Components/OnePorts/OnePorts_abg.fig @@ -0,0 +1,43 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 2925 4725 2925 4500 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 2700 4725 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 3600 4725 3600 4500 3825 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3375 3375 3375 3825 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 4275 4725 4275 4500 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 4950 4725 4950 4500 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 4725 4725 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 5625 4725 5625 4500 5850 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 6300 4725 6300 4500 6525 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3375 6075 3375 6525 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 5850 6750 2025 6750 2025 2475 5850 2475 5850 6750 +4 1 0 100 0 18 18 0.0000 4 270 690 5265 3015 R:r_1\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 2790 3015 SS:ss_1\001 +4 1 0 100 0 18 18 0.0000 4 270 690 5265 3690 R:r_2\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 2790 3690 SS:ss_2\001 +4 1 0 100 0 18 18 0.0000 4 270 750 5265 4365 C:c_3\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 2790 4365 SS:ss_3\001 +4 1 0 100 0 18 18 0.0000 4 270 750 5265 5040 C:c_4\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 2790 5040 SS:ss_4\001 +4 1 0 100 0 18 18 0.0000 4 270 540 5265 5715 I:i_5\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 2790 5715 SS:ss_5\001 +4 1 0 100 0 18 18 0.0000 4 270 540 5265 6390 I:i_6\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 2790 6390 SS:ss_6\001 ADDED mtt/lib/examples/Components/OnePorts/OnePorts_desc.tex Index: mtt/lib/examples/Components/OnePorts/OnePorts_desc.tex ================================================================== --- mtt/lib/examples/Components/OnePorts/OnePorts_desc.tex +++ mtt/lib/examples/Components/OnePorts/OnePorts_desc.tex @@ -0,0 +1,39 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system OnePorts (OnePorts_desc.tex) +% Generated by MTT on Fri Apr 19 08:12:54 BST 2002. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2002/04/19 07:42:28 gawthrop +% %% Simple teaching examples +% %% +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{OnePorts} is + displayed in Figure \Ref{fig:OnePorts_abg.ps}; it contains the one + port components: \textbf{R}, \textbf{C} and \textbf{I} in each of + the two possible causalities. + + Note that the \textbf{R} has no prefered causality and, in this + case, a causal stroke must be provided by the user. On the other + hand, the \textbf{C} and \textbf{I} components are assigned + prefered causality by MTT in the 3rd and 5th cases where no stroke + is assigned by ther user. In the 4th and 6th cases, the user + provides a causal stroke to put the components into derivative + causality. \Ref{fig:OnePorts_cbg-noargs.ps} shows the causality + automatically completed for the 3rd and 5th cases. + + Section \Ref{sec:OnePorts_ode-noargs.tex} gives the system equations, $y_1$ to + $y_6$ are the outputs (with the given causality) of the 6 + components and $u_1$ to $u_6$ are the coresponding inputs. $x_1$ + and $x_2$ are the states of the 3rd and 5th cases (ie integrated + flow and effort respectively), $z_1$ and $z_2$ are the + corresponding quantities for the the 4th and 6th cases, the two + components in derivative causality. + ADDED mtt/lib/examples/Components/OnePorts/OnePorts_rep.txt Index: mtt/lib/examples/Components/OnePorts/OnePorts_rep.txt ================================================================== --- mtt/lib/examples/Components/OnePorts/OnePorts_rep.txt +++ mtt/lib/examples/Components/OnePorts/OnePorts_rep.txt @@ -0,0 +1,35 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system OnePorts (OnePorts_rep.txt) +## Generated by MTT on" Thu Apr 18 08:49:49 BST 2002. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt OnePorts abg tex # The system description +mtt OnePorts cbg ps # The causal bond graph +mtt OnePorts struc tex # The system structure +mtt OnePorts sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt OnePorts dae tex # The system dae +mtt OnePorts ode tex # The system ode +## mtt OnePorts sspar tex # Steady-state parameters +## mtt OnePorts ss tex # Steady state +## mtt OnePorts dm tex # Descriptor matrices (of linearised system) +## mtt OnePorts sm tex # State matrices (of linearised system) +## mtt OnePorts tf tex # Transfer function (of linearised system) +## mtt OnePorts lmfr ps # log modulus of frequency response (of linearised system) +## mtt OnePorts simpar tex # Simulation parameters +## mtt OnePorts numpar tex # Numerical simulation parameters +## mtt OnePorts state tex # Simulation initial state +## mtt OnePorts input tex # Simulation input +## mtt OnePorts logic tex # Logic control +## mtt OnePorts odeso ps # Simulation output + +## mtt OnePorts rep txt # This file ADDED mtt/lib/examples/Components/TwoPorts/TwoPorts_abg.fig Index: mtt/lib/examples/Components/TwoPorts/TwoPorts_abg.fig ================================================================== --- mtt/lib/examples/Components/TwoPorts/TwoPorts_abg.fig +++ mtt/lib/examples/Components/TwoPorts/TwoPorts_abg.fig @@ -0,0 +1,47 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 2925 4050 2925 3825 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5175 2925 6525 2925 6300 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 2700 5175 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 3825 4050 3825 3825 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5175 3825 6525 3825 6300 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 3600 4050 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4725 4050 4725 3825 4950 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5175 4725 6525 4725 6300 4950 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 4500 5175 4950 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 5625 4050 5625 3825 5850 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5175 5625 6525 5625 6300 5850 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 5400 4050 5850 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 8100 6300 1125 6300 1125 2250 8100 2250 8100 6300 +4 1 0 100 0 18 18 0.0000 4 270 900 4635 3015 TF:n_1\001 +4 2 0 100 0 18 18 0.0000 4 270 1200 2520 3015 SS:ss_11\001 +4 0 0 100 0 18 18 0.0000 4 270 1200 6705 3015 SS:ss_12\001 +4 1 0 100 0 18 18 0.0000 4 270 900 4635 3915 TF:n_2\001 +4 2 0 100 0 18 18 0.0000 4 270 1200 2520 3915 SS:ss_21\001 +4 0 0 100 0 18 18 0.0000 4 270 1200 6705 3915 SS:ss_22\001 +4 1 0 100 0 18 18 0.0000 4 270 960 4635 4815 GY:n_3\001 +4 2 0 100 0 18 18 0.0000 4 270 1200 2520 4815 SS:ss_31\001 +4 0 0 100 0 18 18 0.0000 4 270 1200 6705 4815 SS:ss_32\001 +4 1 0 100 0 18 18 0.0000 4 270 960 4635 5715 GY:n_4\001 +4 2 0 100 0 18 18 0.0000 4 270 1200 2520 5715 SS:ss_41\001 +4 0 0 100 0 18 18 0.0000 4 270 1200 6705 5715 SS:ss_42\001 ADDED mtt/lib/examples/Components/TwoPorts/TwoPorts_desc.tex Index: mtt/lib/examples/Components/TwoPorts/TwoPorts_desc.tex ================================================================== --- mtt/lib/examples/Components/TwoPorts/TwoPorts_desc.tex +++ mtt/lib/examples/Components/TwoPorts/TwoPorts_desc.tex @@ -0,0 +1,27 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system TwoPorts (TwoPorts_desc.tex) +% Generated by MTT on Fri Apr 19 08:12:54 BST 2002. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2002/04/19 07:47:45 gawthrop +% %% Simple teaching example. +% %% +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoPorts} is + displayed in Figure \Ref{fig:TwoPorts_abg.ps}; it contains the two + port components: \textbf{TF} and \textbf{GY} in each of + the two possible causalities. + + Note that the neither component has prefered causality and, in both + cases, a causal stroke must be provided by the user. + + Section \Ref{sec:TwoPorts_ode-noargs.tex} gives the system equations. + ADDED mtt/lib/examples/Components/TwoPorts/TwoPorts_rep.txt Index: mtt/lib/examples/Components/TwoPorts/TwoPorts_rep.txt ================================================================== --- mtt/lib/examples/Components/TwoPorts/TwoPorts_rep.txt +++ mtt/lib/examples/Components/TwoPorts/TwoPorts_rep.txt @@ -0,0 +1,35 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system TwoPorts (TwoPorts_rep.txt) +## Generated by MTT on" Thu Apr 18 08:45:30 BST 2002. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt TwoPorts abg tex # The system description +mtt TwoPorts cbg ps # The causal bond graph +mtt TwoPorts struc tex # The system structure +mtt TwoPorts sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt TwoPorts dae tex # The system dae + mtt TwoPorts ode tex # The system ode +## mtt TwoPorts sspar tex # Steady-state parameters +## mtt TwoPorts ss tex # Steady state +## mtt TwoPorts dm tex # Descriptor matrices (of linearised system) +## mtt TwoPorts sm tex # State matrices (of linearised system) +## mtt TwoPorts tf tex # Transfer function (of linearised system) +## mtt TwoPorts lmfr ps # log modulus of frequency response (of linearised system) +## mtt TwoPorts simpar tex # Simulation parameters +## mtt TwoPorts numpar tex # Numerical simulation parameters +## mtt TwoPorts state tex # Simulation initial state +## mtt TwoPorts input tex # Simulation input +## mtt TwoPorts logic tex # Logic control +## mtt TwoPorts odeso ps # Simulation output + +## mtt TwoPorts rep txt # This file ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_abg.fig Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_abg.fig ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_abg.fig +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_abg.fig @@ -0,0 +1,20 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1801 3151 2701 3151 2476 3376 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3151 4501 3151 4276 3376 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 2926 4726 2026 4951 2251 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 3151 5851 3151 5626 3376 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6975 4050 6975 1350 450 1350 450 4050 6975 4050 +4 1 -1 0 0 0 20 0.0000 4 195 375 3151 3241 AF\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 4726 3241 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 600 4726 1891 CX:c\001 +4 1 -1 0 0 0 20 0.0000 4 240 810 1306 3241 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 240 960 6346 3241 SS:[out]\001 ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_desc.tex Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_desc.tex ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_desc.tex +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_desc.tex @@ -0,0 +1,20 @@ +% Verbal description for system INTFX (INTFX_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:16 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/08/24 11:20:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{INTFX} is + displayed in Figure \Ref{INTFX_abg} and its label + file is listed in Section \Ref{sec:INTFX_lbl}. + The subsystems are listed in Section \Ref{sec:INTFX_sub}. + +\textbf{INTFX} is a two-port component where the effort on port [out] + is the integral of the flow on port [in]. ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_lbl.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_lbl.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_lbl.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_lbl.txt @@ -0,0 +1,24 @@ +%SUMMARY INTFX +%DESCRIPTION +%% Label file for system INTFX (INTFX_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type CX + c lin effort,1 + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/Makefile Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/Makefile ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/Makefile +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/Makefile @@ -0,0 +1,25 @@ +# Makefile for the Two link GMV example + +all: msdp_tf.m twolinkp_obs.m twolinkp_sm.m TwoLinkGMV_numpar.m + +msdP_tf.m: msdP_abg.fig + mtt -q msdP tf m + +msdp_tf.m: msdP_tf.m + tr [A-Z] [a-z] msdp_tf.m + +TwoLinkP_obs.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt + mtt -q TwoLinkP obs m + +twolinkp_obs.m: TwoLinkP_obs.m + tr [A-Z] [a-z] twolinkp_obs.m + +TwoLinkP_sm.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt + mtt -q TwoLinkP sm m + +twolinkp_sm.m: TwoLinkP_sm.m + tr [A-Z] [a-z] twolinkp_sm.m + +TwoLinkGMV_numpar.m: TwoLinkGMV_numpar.txt + mtt -q TwoLinkGMV numpar m + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_abg.fig Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_abg.fig ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_abg.fig +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_abg.fig @@ -0,0 +1,124 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4951 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 4950 1800 3375 1800 3600 +4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 IX:J\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTFX:th\001 +4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 2971 1216 SS:[x_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 2971 9361 SS:[x_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 8372 1217 SS:[y_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 8417 9362 SS:[y_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 1485 5671 1216 SS:[alpha_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 1485 5671 9361 SS:[alpha_b]\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 +4 1 4 0 0 0 20 0.0000 4 255 1215 1756 3286 SS:[alpha]\001 ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_desc.tex Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_desc.tex ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_desc.tex +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_desc.tex @@ -0,0 +1,25 @@ +% Verbal description for system RODaX (RODaX_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/04/12 15:25:35 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 09:41:19 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{RODaX} is + displayed in Figure \Ref{RODaX_abg} and its label + file is listed in Section \Ref{sec:RODaX_lbl}. + The subsystems are listed in Section \Ref{sec:RODaX_sub}. + +{\bf RODaX} is essentially as described in Figure 10.2 of +``Metamodelling''. It has an additional port ``[angle]'' to provide +access to the rod angle. + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_lbl.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_lbl.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_lbl.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_lbl.txt @@ -0,0 +1,55 @@ +%SUMMARY RODaX: rigid rod in two dimensions - angle port. +%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a +%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b +%DESCRIPTION Port [x_a]: x force/velocity - end a +%DESCRIPTION Port [x_b]: x force/velocity - end b +%DESCRIPTION Port [y_a]: y force/velocity - end a +%DESCRIPTION Port [y_b]: y force/velocity - end b +%DESCRIPTION Port [alpha]: rod angle +%DESCRIPTION +%DESCRIPTION Parameter 1: length from end 1 to mass centre +%DESCRIPTION Parameter 2: length from end 2 to mass centre +%DESCRIPTION Parameter 3: inertia about mass centre +%DESCRIPTION Parameter 4: mass +%DESCRIPTION See Section 10.2 of "Metamodelling" + + +%% Label file for system RODaX (RODaX_lbl.txt) + + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 1998/04/12 15:24:06 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,$3 +m_x lin flow,$4 +m_y lin flow,$4 + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,$1 +s2 lsin flow,$2 +c1 lcos flow,$1 +c2 lcos flow,$2 + + + + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_abg.fig Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_abg.fig ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_abg.fig +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_abg.fig @@ -0,0 +1,94 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 8550 9225 8550 9000 8775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 8325 9225 8775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 9450 9225 9450 9000 9675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 9225 9225 9675 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10215 2475 10215 2475 7650 11025 7650 11025 10215 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 8325 5625 8775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 9225 5625 9675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 3825 5625 3825 8550 5625 8550 5400 8775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 3375 6525 3375 9450 5625 9450 5400 9675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 5400 9225 5400 9000 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 5175 9225 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 6300 9225 6300 9000 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 6075 9225 6525 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 7065 2475 7065 2475 4500 11025 4500 11025 7065 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 5400 5625 5400 5400 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 5175 5625 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 6300 5625 6300 5400 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 6075 5625 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 5400 3600 5400 3375 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 5175 3600 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 6300 3150 6300 2925 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3150 6075 3150 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 2250 9225 2250 9000 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 2025 9225 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 3150 9225 3150 9000 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 2925 9225 3375 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 3915 2475 3915 2475 1350 11025 1350 11025 3915 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 2250 5625 2250 5400 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 2025 5625 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 3150 5625 3150 5400 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 2925 5625 3375 +4 0 -1 0 0 22 20 0.0000 4 270 1935 9315 8640 SS:Theta_1_m\001 +4 0 -1 0 0 22 20 0.0000 4 270 1935 9315 9540 SS:Theta_2_m\001 +4 1 -1 0 0 22 20 0.0000 4 210 2445 6750 9090 TwoLinkPX:model\001 +4 0 4 0 0 22 20 0.0000 4 270 1230 7920 8415 [Theta_1]\001 +4 0 4 0 0 22 20 0.0000 4 270 1230 7920 9315 [Theta_2]\001 +4 2 4 0 0 22 20 0.0000 4 270 1140 5535 8415 [Joint_1]\001 +4 2 4 0 0 22 20 0.0000 4 270 1140 5535 9315 [Joint_2]\001 +4 1 1 1 0 3 26 0.0000 4 270 1005 6750 10080 Model\001 +4 1 -1 0 0 22 20 0.0000 4 270 2415 6750 5940 TwoLinkP:system\001 +4 0 4 0 0 22 20 0.0000 4 270 1230 7920 5265 [Theta_1]\001 +4 0 4 0 0 22 20 0.0000 4 270 1230 7920 6165 [Theta_2]\001 +4 0 -1 0 0 22 20 0.0000 4 270 1530 9315 5490 SS:Theta_1\001 +4 0 -1 0 0 22 20 0.0000 4 270 1530 9315 6390 SS:Theta_2\001 +4 2 4 0 0 22 20 0.0000 4 270 1140 5535 5265 [Joint_1]\001 +4 2 4 0 0 22 20 0.0000 4 270 1140 5535 6165 [Joint_2]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3825 5490 0\001 +4 2 -1 0 0 22 20 0.0000 4 270 1275 1935 6390 SS:Tau_2\001 +4 2 -1 0 0 22 20 0.0000 4 270 1275 1980 5490 SS:Tau_1\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3375 6390 0\001 +4 1 1 1 0 3 26 0.0000 4 360 1110 6705 6885 System\001 +4 0 -1 0 0 22 20 0.0000 4 270 1785 9315 2340 SS:Theta_1_r\001 +4 0 -1 0 0 22 20 0.0000 4 270 1785 9315 3240 SS:Theta_2_r\001 +4 1 1 1 0 3 26 0.0000 4 360 2055 6705 3735 Specification\001 +4 1 -1 0 0 22 20 0.0000 4 270 1860 6795 2340 msdP:spec_1\001 +4 1 -1 0 0 22 20 0.0000 4 270 1860 6795 3195 msdP:spec_2\001 +4 2 -1 0 0 22 20 0.0000 4 270 1260 4005 2340 SS:Ref_1\001 +4 2 -1 0 0 22 20 0.0000 4 270 1260 3960 3240 SS:Ref_2\001 ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_args.new Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_args.new ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_args.new +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_args.new @@ -0,0 +1,1 @@ + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_desc.tex Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_desc.tex ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_desc.tex +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_desc.tex @@ -0,0 +1,97 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system TwoLinkGMV (TwoLinkGMV_desc.tex) +% Generated by MTT on Wed Apr 15 18:15:23 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/04/15 18:41:58 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLinkGMV} is + displayed in Figure \Ref{TwoLinkGMV_abg} and its label + file is listed in Section \Ref{sec:TwoLinkGMV_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLinkGMV_sub}. + +This composite system provides an illustration of nonlinear +generalised minimum variance (GMV) control (continuous-time) operating on a +twolink manipulator. GMV can also be interpreted as: +\begin{itemize} +\item the exact linearisation (by feedback) followed by a + pole-placement design on the resulting linear system and +\item a special case of generalised predictive control (GPC) were the + prediction horizon is zero and the $P(s)$ polynomial is the same as + the system relative degree and +\item One possible instance of physical-model-based control. +\end{itemize} + +The composite system of Figure \Ref{TwoLinkGMV_abg} has three +(visible) parts: +\begin{enumerate} +\item a linear decoupled \emph{specification} system that describes the desired + closed-loop system in terms of a physical system (two decoupled + mass-spring-damper systems), +\item the system itself (a two-link manipulator) representing the + system to be controlled, more details are given in Sections + \Ref{sec:TwoLinkP_ode.tex} and \Ref{sec:TwoLinkP_rfe.tex}. +\item a model of the system with additional state inputs to be used as + a state observer. +\end{enumerate} +The invisible parts are implemented in the text file +``TwoLinkGMV\_input.txt'' (see Section \Ref{sec:TwoLinkGMV_input.txt}). +These parts are: +\begin{itemize} +\item the reference signal (joint angles) + \begin{equation} + w(t) = + \begin{cases} + \begin{pmatrix} + \pi \\ + 0 + \end{pmatrix} & 0 \ge t > 10 \\ + \begin{pmatrix} + 2\pi \\ + 0 + \end{pmatrix} & 10 \ge t > 15 \\ + \begin{pmatrix} + 2\pi \\ + \pi + \end{pmatrix} & 15 \ge t > 30 \\ + \end{cases} + \end{equation} +\item The control signal (joint torques) being the solution of + \begin{equation} + \phi^*(t) = O_o(\hat x(t)) + O_h(\hat x(t)) u(t) = w(t) + \end{equation} +where $\hat x$ is the observed state. +\item The observer feedback signal + \begin{equation} + u_x = K ( y - \hat y) + \end{equation} +where $K$ is the observer gain matrix and $y$ and $\hat y$ are the +system and model outputs respectively. +\end{itemize} +The observer gain is set up on the basis of the \emph{linearised} +system using LQ theory. This is implemented in the text file +``TwoLinkGMV\_state.txt'' (see Section \Ref{sec:TwoLinkGMV_state.txt}) +using the Octave function ``lqe'' together with the MTT-generated +linearised system ``TwoLink\_sm''. + + +The system was simulated using Octave under MTT with the results given +in Figures +\Ref{fig:TwoLinkGMV_odeso.ps-TwoLinkGMV-Theta-1,TwoLinkGMV-Theta-1-r} +and +\Ref{fig:TwoLinkGMV_odeso.ps-TwoLinkGMV-Theta-2,TwoLinkGMV-Theta-2-r} +giving the actual and specification angles for joints 1 and 2 +respectively. + +The initial \emph{system} state was zero except that the angle of the +first rod was $\frac{\pi}{4}$. The initial \emph{observer} state was +(erroneously but deliberately) set at zero. This explains the +(decaying) discrepancy between the actual and specification angles. +Simulations with zero initial state gave precise matching. ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_input.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_input.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_input.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_input.txt @@ -0,0 +1,35 @@ +# Numerical parameter file (TwoLinkGMV_input.txt) +# Generated by MTT at Mon Apr 13 11:02:37 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +global ObserverGain; + +# Reference signals +u(1) = pi + pi*(t>10) ; # TwoLinkGMV (Ref_1) +u(2) = pi*(t>15) ; # TwoLinkGMV (Ref_2) + +# Control signals +w = u(1:2); # Reference signal +x_model = x(9:12); # Observed states +[O_o, O_h] = TwoLinkP_obs(x_model) #GPC O function (affine case) +[spec_n,spec_d] = msdP_tf; # Spec transfer function +P = spec_d(3:-1:1); # P poly with ascending coeffs +PP = [eye(2)*P(1) eye(2)*P(2) eye(2)*P(3)]; +PO_o = PP*O_o; # Compute Py with u zero +PO_h = PP*O_h; # Coefficient of u +u_control = PO_h\(w - PO_o); # GMV control signal + +u(3:4) = u_control; # TwoLinkGMV (Tau_1) + +# Observer +x_system = x(5:8); # System states +error = x_system-x_model; # Error in states +ObserverInput = ObserverGain*error; +u(5:8) = ObserverInput; # Set the state-input to the observer + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_lbl.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_lbl.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_lbl.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_lbl.txt @@ -0,0 +1,47 @@ +%SUMMARY TwoLinkGMV - GMV control of two-link manipulator +%DESCRIPTION This composite system provides an illustration +%DESCRIPTION of nonlinear generalised minimum variance (GMV) control +%DESCRIPTION (continuous-time) operating on a twolink manipulator. + +%% Label file for system TwoLinkGMV (TwoLinkGMV_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type SS + Ref_1 SS external,internal + Ref_2 SS external,internal + Tau_1 SS external,internal + Tau_2 SS external,internal + + Theta_1 SS external,0 + Theta_2 SS external,0 + + Theta_1_m SS external,0 + Theta_2_m SS external,0 + + Theta_1_r SS external,0 + Theta_2_r SS external,0 + +% Component type msdP + spec_1 + spec_2 + +% Component type TwoLinkP + system + +% Component type TwoLinkPX + model + + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_numpar.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_numpar.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_numpar.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_numpar.txt @@ -0,0 +1,18 @@ +# Numerical parameter file (TwoLinkGMV_numpar.txt) +# Generated by MTT at Mon Apr 13 10:57:02 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_s = 1.0; # msdP +j_s = 1.0; # msdP +r_s = 1.414; # msdP + +j_r = 1.0; # TwoLinkP,TwoLinkPX +l_r = 1.0; # TwoLinkP,TwoLinkPX +m_r = 1.0; # TwoLinkP,TwoLinkPX ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_obspar.r Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_obspar.r ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_obspar.r +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_obspar.r @@ -0,0 +1,29 @@ +%% Reduce GPC observability function parameters for system TwoLinkGMV (TwoLinkGMV_obspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MTTGPCNy := 2; +MTTGPCNu := 0; +Matrix MTTdU(5,1); +MTTdU(1,1) := MTTdU1; +MTTdU(2,1) := MTTdU2; +MTTdU(3,1) := MTTdU3; +MTTdU(4,1) := MTTdU4; +MTTdU(5,1) := MTTdU5; +Matrix MTTUU(2,5); +MTTUU(1,1) := MTTu1; +MTTUU(1,2) := MTTu11; +MTTUU(1,3) := MTTu12; +MTTUU(1,4) := MTTu13; +MTTUU(1,5) := MTTu14; +MTTUU(2,1) := MTTu2; +MTTUU(2,2) := MTTu21; +MTTUU(2,3) := MTTu22; +MTTUU(2,4) := MTTu23; +MTTUU(2,5) := MTTu24; +END; ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_rep.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_rep.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_rep.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_rep.txt @@ -0,0 +1,28 @@ +# Outline report file for system TwoLinkGMV (TwoLinkGMV_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt TwoLinkGMV abg tex +mtt TwoLinkGMV struc tex +mtt TwoLinkGMV sympar tex + +mtt TwoLinkP struc tex +mtt TwoLinkP rfe tex +mtt TwoLinkP ode tex +mtt TwoLinkP obs tex + +mtt TwoLinkP ss tex +mtt TwoLinkP sm tex + +mtt msdP tf tex + +mtt TwoLinkGMV numpar txt +mtt TwoLinkGMV state txt +mtt TwoLinkGMV input txt +mtt TwoLinkGMV odeso ps 'TwoLinkGMV_Theta_1,TwoLinkGMV_Theta_1_r' +mtt TwoLinkGMV odeso ps 'TwoLinkGMV_Theta_2,TwoLinkGMV_Theta_2_r' ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt @@ -0,0 +1,12 @@ +%% Simulation parameters for system TwoLinkGMV (TwoLinkGMV_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=30.0 +DT=0.2 +STEPFACTOR=1 ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt_old Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt_old ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt_old +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt_old @@ -0,0 +1,12 @@ +%% Simulation parameters for system TwoLinkGMV (TwoLinkGMV_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=30.0 +DT=0.2 +STEPFACTOR=1 ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_sspar.r Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_sspar.r ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_sspar.r +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_sspar.r @@ -0,0 +1,35 @@ +% Steady-state parameter file (TwoLinkGMV_sspar.r) +% Generated by MTT at Tue Apr 14 08:47:47 BST 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Steady-state states +MTTX1 := 0; % TwoLinkGMV_spec_1 (c_s) +MTTX2 := 0; % TwoLinkGMV_spec_1 (j_s) +MTTX3 := 0; % TwoLinkGMV_spec_2 (c_s) +MTTX4 := 0; % TwoLinkGMV_spec_2 (j_s) +MTTX5 := 0; % TwoLinkGMV_system_rod1 (J) +MTTX6 := 0; % TwoLinkGMV_system_rod1_th (3) +MTTX7 := 0; % TwoLinkGMV_system_rod2 (J) +MTTX8 := 0; % TwoLinkGMV_system_rod2_th (3) +MTTX9 := 0; % TwoLinkGMV_model_rod1_J (i) +MTTX10 := 0; % TwoLinkGMV_model_rod1_th_c (c) +MTTX11 := 0; % TwoLinkGMV_model_rod2_J (i) +MTTX12 := 0; % TwoLinkGMV_model_rod2_th_c (c) +% Steady-state inputs +MTTU1 := 1; % TwoLinkGMV (Ref_1) +MTTU2 := 1; % TwoLinkGMV (Ref_2) +MTTU3 := 0; % TwoLinkGMV (Tau_1) +MTTU4 := 0; % TwoLinkGMV (Tau_2) +MTTU5 := 0; % TwoLinkGMV_model_rod1_J (X) +MTTU6 := 0; % TwoLinkGMV_model_rod1_th_c (X) +MTTU7 := 0; % TwoLinkGMV_model_rod2_J (X) +MTTU8 := 0; % TwoLinkGMV_model_rod2_th_c (X) +;;END; ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_state.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_state.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_state.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_state.txt @@ -0,0 +1,31 @@ +# Numerical parameter file (TwoLinkGMV_state.txt) +# Generated by MTT at Tue Apr 14 08:54:28 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +global ObserverGain; + +# Set the states +x(1) = 0 ; # TwoLinkGMV_spec_1 (c_s) +x(2) = 0 ; # TwoLinkGMV_spec_1 (j_s) +x(3) = 0 ; # TwoLinkGMV_spec_2 (c_s) +x(4) = 0 ; # TwoLinkGMV_spec_2 (j_s) +x(5) = 0 ; # TwoLinkGMV_system_rod1 (J) +x(6) = pi/4 ; # TwoLinkGMV_system_rod1_th (3) +x(7) = 0 ; # TwoLinkGMV_system_rod2 (J) +x(8) = 0 ; # TwoLinkGMV_system_rod2_th (3) +x(9) = 0 ; # TwoLinkGMV_model_rod1_J (i) +x(10) = 0 ; # TwoLinkGMV_model_rod1_th_c (c) +x(11) = 0 ; # TwoLinkGMV_model_rod2_J (i) +x(12) = 0 ; # TwoLinkGMV_model_rod2_th_c (c) + +# Observer design +[A,B,C] = TwoLinkP_sm; # Get the linearised system +sigma = 0.1; # Measurement noise variance (pretend) +k = lqe(A,eye(4),C,eye(4),sigma*eye(2)) +ObserverGain = k*C; # This system happens to have a linear output ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_abg.fig Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_abg.fig ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_abg.fig +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_abg.fig @@ -0,0 +1,104 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3468 1128 3738 1128 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4593 2703 4863 2703 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 1128 4728 2703 4953 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4502 5492 4502 5762 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5627 4502 5627 4277 5852 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 7426 4951 7201 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3472 8647 3742 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4597 8647 4867 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5724 8649 5994 8649 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4730 8645 4730 10220 4955 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5855 8645 5855 10220 6080 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3826 3601 7426 3826 7201 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3826 5851 7426 6076 7201 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 11475 9450 225 180 225 180 11475 9450 11475 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 8622 3600 10197 3825 9972 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 7650 450 9405 450 9405 675 7650 675 7650 450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 3285 1575 3285 1800 3510 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3195 8055 1620 8055 1845 8280 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 3150 1350 2025 1575 2250 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 8325 1350 9450 1575 9225 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 7875 1350 3600 1575 3825 +4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000 4 195 1335 4729 3379 RODaX:rod1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1335 4731 8196 RODaX:rod2\001 +4 1 4 0 0 0 20 0.0000 4 255 1410 4771 946 SS:[Joint_1]\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 +4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 +4 1 -1 0 0 0 20 0.0000 4 255 810 5850 945 SS:v_y\001 +4 2 4 0 0 0 20 0.0000 4 255 1410 2882 5717 SS:[Joint_2]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 675 3510 3375 [alpha]\001 +4 1 4 0 0 0 16 0.0000 4 225 675 3555 8145 [alpha]\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 1308 8193 1\001 +4 1 4 0 0 0 20 0.0000 4 255 1530 1397 1892 SS:[Theta_1]\001 +4 1 4 0 0 0 20 0.0000 4 255 1530 1352 9767 SS:[Theta_2]\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 1263 3468 0\001 ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_desc.tex Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_desc.tex ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_desc.tex +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_desc.tex @@ -0,0 +1,42 @@ +% Verbal description for system TwoLinkPX (TwoLinkPX_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/19 14:20:07 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLinkPX} is + displayed in Figure \Ref{TwoLinkPX_abg} and its label + file is listed in Section \Ref{sec:TwoLinkPX_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLinkPX_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses the compound components: {\bf ROD}. {\bf +ROD} is essentially as described in Figure 10.2. +There is no gravity included in this model. + +This system has a number of dynamic elements (those corresponding to translation +motion) in derivative causality, thus the system is represnted as a +Differential-Algebraic Equation (Section +\Ref{sec:TwoLinkPX_dae.tex}). Hovever, this is of contrained-state form and +therfore can be written as a set of constrained-state equations (Section +\Ref{sec:TwoLinkPX_cse.tex}). The corresponding ordinary differential +equation is complicated due to the trig functions involved in +inverting the E matrix. + +As well as the standard representation the ``robot-form'' equations +appear in Section \Ref{sec:TwoLinkPX_rfe}. + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_lbl.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_lbl.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_lbl.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_lbl.txt @@ -0,0 +1,57 @@ +%SUMMARY TwoLinkPX: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (TwoLinkPX_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/12/05 12:39:49 peterg +% %% Documentation +% %% +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - uniform rods +rod1 none l_r;l_r;j_r;m_r +rod2 none l_r;l_r;j_r;m_r + +%Zero velocity sources +v_x SS internal,0 +v_y SS internal,0 + + +%Zero force/torque sources +F_x SS 0,internal +F_a SS 0,internal +F_y SS 0,internal + +%Named ports +[Joint_1] SS external,internal +[Joint_2] SS external,internal +[Theta_1] SS external,0 +[Theta_2] SS external,0 + +%Torque/velocity at joints +%f_a1 SS external,external +%f_a2 SS external,external + + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_abg.fig Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_abg.fig ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_abg.fig +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_abg.fig @@ -0,0 +1,104 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3468 1128 3738 1128 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4593 2703 4863 2703 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 1128 4728 2703 4953 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4502 5492 4502 5762 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5627 4502 5627 4277 5852 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 7426 4951 7201 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3472 8647 3742 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4597 8647 4867 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5724 8649 5994 8649 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4730 8645 4730 10220 4955 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5855 8645 5855 10220 6080 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3826 3601 7426 3826 7201 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3826 5851 7426 6076 7201 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 11475 9450 225 180 225 180 11475 9450 11475 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 8622 3600 10197 3825 9972 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 7650 450 9405 450 9405 675 7650 675 7650 450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 3285 1575 3285 1800 3510 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3195 8055 1620 8055 1845 8280 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 3150 1350 2025 1575 2250 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 8325 1350 9450 1575 9225 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 7875 1350 3600 1575 3825 +4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000 4 195 1335 4729 3379 RODa:rod1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1335 4731 8196 RODa:rod2\001 +4 1 4 0 0 0 20 0.0000 4 255 1410 4771 946 SS:[Joint_1]\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 +4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 +4 1 -1 0 0 0 20 0.0000 4 255 810 5850 945 SS:v_y\001 +4 2 4 0 0 0 20 0.0000 4 255 1410 2882 5717 SS:[Joint_2]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 675 3510 3375 [alpha]\001 +4 1 4 0 0 0 16 0.0000 4 225 675 3555 8145 [alpha]\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 1308 8193 1\001 +4 1 4 0 0 0 20 0.0000 4 255 1530 1397 1892 SS:[Theta_1]\001 +4 1 4 0 0 0 20 0.0000 4 255 1530 1352 9767 SS:[Theta_2]\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 1263 3468 0\001 ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_cr.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_cr.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_cr.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_cr.txt @@ -0,0 +1,3 @@ +lcos +lin +lsin ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_desc.tex Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_desc.tex ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_desc.tex +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_desc.tex @@ -0,0 +1,42 @@ +% Verbal description for system TwoLinkP (TwoLinkP_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/19 14:20:07 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLinkP} is + displayed in Figure \Ref{TwoLinkP_abg} and its label + file is listed in Section \Ref{sec:TwoLinkP_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLinkP_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses the compound components: {\bf ROD}. {\bf +ROD} is essentially as described in Figure 10.2. +There is no gravity included in this model. + +This system has a number of dynamic elements (those corresponding to translation +motion) in derivative causality, thus the system is represnted as a +Differential-Algebraic Equation (Section +\Ref{sec:TwoLinkP_dae.tex}). Hovever, this is of contrained-state form and +therfore can be written as a set of constrained-state equations (Section +\Ref{sec:TwoLinkP_cse.tex}). The corresponding ordinary differential +equation is complicated due to the trig functions involved in +inverting the E matrix. + +As well as the standard representation the ``robot-form'' equations +appear in Section \Ref{sec:TwoLinkP_rfe}. + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_lbl.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_lbl.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_lbl.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_lbl.txt @@ -0,0 +1,57 @@ +%SUMMARY TwoLinkP: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (TwoLinkP_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/12/05 12:39:49 peterg +% %% Documentation +% %% +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - uniform rods +rod1 none l_r;l_r;j_r;m_r +rod2 none l_r;l_r;j_r;m_r + +%Zero velocity sources +v_x SS internal,0 +v_y SS internal,0 + + +%Zero force/torque sources +F_x SS 0,internal +F_a SS 0,internal +F_y SS 0,internal + +%Named ports +[Joint_1] SS external,internal +[Joint_2] SS external,internal +[Theta_1] SS external,0 +[Theta_2] SS external,0 + +%Torque/velocity at joints +%f_a1 SS external,external +%f_a2 SS external,external + + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_obspar.r Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_obspar.r ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_obspar.r +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_obspar.r @@ -0,0 +1,29 @@ +%% Reduce GPC observability function parameters for system TwoLinkP (TwoLinkP_obspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MTTGPCNy := 2; +MTTGPCNu := 0; +Matrix MTTdU(5,1); +MTTdU(1,1) := MTTdU1; +MTTdU(2,1) := MTTdU2; +MTTdU(3,1) := MTTdU3; +MTTdU(4,1) := MTTdU4; +MTTdU(5,1) := MTTdU5; +Matrix MTTUU(2,5); +MTTUU(1,1) := MTTu1; +MTTUU(1,2) := MTTu11; +MTTUU(1,3) := MTTu12; +MTTUU(1,4) := MTTu13; +MTTUU(1,5) := MTTu14; +MTTUU(2,1) := MTTu2; +MTTUU(2,2) := MTTu21; +MTTUU(2,3) := MTTu22; +MTTUU(2,4) := MTTu23; +MTTUU(2,5) := MTTu24; +END; ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_subs.r Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_subs.r ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_subs.r +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_subs.r @@ -0,0 +1,24 @@ +%% Reduce substitution statements for system TwoLinkPX (TwoLinkPX_subs.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/03/22 20:13:25 peterg +% %% Trig simplification added +% %% +% %% Revision 1.1 1998/03/22 20:12:51 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +END; + ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_abg.fig Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_abg.fig ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_abg.fig +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_abg.fig @@ -0,0 +1,27 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 4050 4950 4050 4725 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 4275 3600 5400 3825 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 4050 3375 4050 3150 4275 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 6975 8325 1125 1125 1125 1125 6975 8325 6975 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 4050 6525 4050 6300 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3825 5175 2700 5400 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3825 3600 2700 3825 2925 +4 1 -1 0 0 0 20 0.0000 4 195 135 3600 4185 1\001 +4 2 4 0 0 0 20 0.0000 4 240 810 2160 4140 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 480 3600 5715 I:j_s\001 +4 1 1 1 0 0 20 0.0000 4 255 5355 4815 6345 Mass-spring-damper system (position output)\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5175 4140 0\001 +4 0 4 0 0 0 20 0.0000 4 240 960 6660 4140 SS:[out]\001 +4 1 -1 0 0 0 20 0.0000 4 255 615 3600 2565 R:r_s\001 +4 1 -1 0 0 0 20 0.0000 4 255 630 5175 2565 C:c_s\001 ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_desc.tex Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_desc.tex ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_desc.tex +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_desc.tex @@ -0,0 +1,31 @@ +% Verbal description for system msdP (msdP_desc.tex) +% Generated by MTT on Thu Nov 13 09:38:17 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{msdP} is + displayed in Figure \Ref{msdP_abg} and its label + file is listed in Section \Ref{sec:msdP_lbl}. + The subsystems are listed in Section \Ref{sec:msdP_sub}. + + + \textbf{msdP} is a simple Mass-Spring-Damper system with + force input and position output. It is set up to provide a specification system + for each link of the two-link maipulator. This is appropriate because + \begin{itemize} + \item it has compatible physical behaviour with the system itself, + \item it specifies two decoupled systems, + \item it has linear behaviour and + \item it has a simple performance interpretation in terms of system + rise-time and overshoot. + \end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_lbl.txt Index: mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_lbl.txt ================================================================== --- mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_lbl.txt +++ mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_lbl.txt @@ -0,0 +1,30 @@ +%SUMMARY msdP +%DESCRIPTION +%% Label file for system msdP (msdP_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_s lin effort,c_s + +% Component type I + j_s lin flow,j_s + +% Component type R + r_s lin flow,r_s + +% Component type SS + [in] SS external,internal + [out] SS external,0 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_abg.fig Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_abg.fig ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_abg.fig +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_abg.fig @@ -0,0 +1,20 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1801 3151 2701 3151 2476 3376 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3151 4501 3151 4276 3376 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 2926 4726 2026 4951 2251 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 3151 5851 3151 5626 3376 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6975 4050 6975 1350 450 1350 450 4050 6975 4050 +4 1 -1 0 0 0 20 0.0000 4 195 375 3151 3241 AF\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 4726 3241 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 600 4726 1891 CX:c\001 +4 1 -1 0 0 0 20 0.0000 4 240 810 1306 3241 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 240 960 6346 3241 SS:[out]\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_desc.tex Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_desc.tex ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_desc.tex +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_desc.tex @@ -0,0 +1,20 @@ +% Verbal description for system INTFX (INTFX_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:16 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/08/24 11:20:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{INTFX} is + displayed in Figure \Ref{INTFX_abg} and its label + file is listed in Section \Ref{sec:INTFX_lbl}. + The subsystems are listed in Section \Ref{sec:INTFX_sub}. + +\textbf{INTFX} is a two-port component where the effort on port [out] + is the integral of the flow on port [in]. ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_lbl.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_lbl.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_lbl.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_lbl.txt @@ -0,0 +1,24 @@ +%SUMMARY INTFX +%DESCRIPTION +%% Label file for system INTFX (INTFX_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type CX + c lin effort,1 + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_abg.fig Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_abg.fig ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_abg.fig +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_abg.fig @@ -0,0 +1,124 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4951 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 4950 1800 3375 1800 3600 +4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 IX:J\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTFX:th\001 +4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 2971 1216 SS:[x_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 2971 9361 SS:[x_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 8372 1217 SS:[y_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 990 8417 9362 SS:[y_b]\001 +4 1 4 0 0 0 20 0.0000 4 255 1485 5671 1216 SS:[alpha_a]\001 +4 1 4 0 0 0 20 0.0000 4 255 1485 5671 9361 SS:[alpha_b]\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 +4 1 4 0 0 0 20 0.0000 4 255 1215 1756 3286 SS:[alpha]\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_desc.tex Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_desc.tex ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_desc.tex +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_desc.tex @@ -0,0 +1,25 @@ +% Verbal description for system RODaX (RODaX_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/04/12 15:25:35 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 09:41:19 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{RODaX} is + displayed in Figure \Ref{RODaX_abg} and its label + file is listed in Section \Ref{sec:RODaX_lbl}. + The subsystems are listed in Section \Ref{sec:RODaX_sub}. + +{\bf RODaX} is essentially as described in Figure 10.2 of +``Metamodelling''. It has an additional port ``[angle]'' to provide +access to the rod angle. + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_lbl.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_lbl.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_lbl.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_lbl.txt @@ -0,0 +1,51 @@ +%SUMMARY RODaX: rigid rod in two dimensions - angle port. +%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a +%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b +%DESCRIPTION Port [x_a]: x force/velocity - end a +%DESCRIPTION Port [x_b]: x force/velocity - end b +%DESCRIPTION Port [y_a]: y force/velocity - end a +%DESCRIPTION Port [y_b]: y force/velocity - end b +%DESCRIPTION Port [alpha]: rod angle +%DESCRIPTION +%DESCRIPTION Parameter 1: length from end 1 to mass centre +%DESCRIPTION Parameter 2: length from end 2 to mass centre +%DESCRIPTION Parameter 3: inertia about mass centre +%DESCRIPTION Parameter 4: mass +%DESCRIPTION See Section 10.2 of "Metamodelling" + + +%% Label file for system RODaX (RODaX_lbl.txt) + + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 1998/04/12 15:24:06 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,$3 +m_x lin flow,$4 +m_y lin flow,$4 + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,$1 +s2 lsin flow,$2 +c1 lcos flow,$1 +c2 lcos flow,$2 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_abg.fig Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_abg.fig ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_abg.fig +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_abg.fig @@ -0,0 +1,32 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 2025 3825 2025 3600 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 2025 5850 2025 5625 2250 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 3600 7875 3600 7650 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 1800 2475 2295 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6075 3375 6075 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5850 1800 5850 2295 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 3600 3825 3600 3600 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 3600 6075 3600 5850 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 3330 6300 2205 6525 2430 +4 2 4 0 0 0 20 0.0000 4 240 720 2385 2115 SS:[v]\001 +4 1 -1 0 0 0 20 0.0000 4 195 420 4140 2115 GY\001 +4 1 -1 0 0 0 20 0.0000 4 195 840 6345 2070 AE:tau\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 6300 3690 1\001 +4 2 4 0 0 0 20 0.0000 4 255 720 2475 3690 SS:[p]\001 +4 0 4 0 0 0 20 0.0000 4 240 690 8055 3645 SS:[s]\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 4050 3690 AE\001 +4 2 4 0 0 0 20 0.0000 4 240 405 5760 1755 [in]\001 +4 2 4 0 0 0 20 0.0000 4 240 555 6255 2565 [out]\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_lbl.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_lbl.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_lbl.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_lbl.txt @@ -0,0 +1,25 @@ +%SUMMARY Sensor +%DESCRIPTION +%% Label file for system Sensor (Sensor_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type AE + tau lin tau + +% Component type SS + [p] SS external,external + [s] SS external,external + [v] SS external,external ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_abg.fig Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_abg.fig ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_abg.fig +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_abg.fig @@ -0,0 +1,94 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 8550 9225 8550 9000 8775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 8325 9225 8775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 9450 9225 9450 9000 9675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 9225 9225 9675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 8325 5625 8775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 9225 5625 9675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 3825 5625 3825 8550 5625 8550 5400 8775 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 3375 6525 3375 9450 5625 9450 5400 9675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 5400 9225 5400 9000 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 5175 9225 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 6300 9225 6300 9000 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 6075 9225 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 5400 5625 5400 5400 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 5175 5625 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 6300 5625 6300 5400 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 6075 5625 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 5400 3600 5400 3375 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 5175 3600 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 6300 3150 6300 2925 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3150 6075 3150 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 2250 9225 2250 9000 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 2025 9225 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 3150 9225 3150 9000 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9225 2925 9225 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 2250 5625 2250 5400 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 2025 5625 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 3150 5625 3150 5400 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 2925 5625 3375 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11475 3915 2475 3915 2475 1350 11475 1350 11475 3915 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11475 7020 2475 7020 2475 4500 11475 4500 11475 7020 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11475 10215 2475 10215 2475 7650 11475 7650 11475 10215 +4 0 -1 0 0 22 20 0.0000 4 270 1935 9315 8640 SS:Theta_1_m\001 +4 0 -1 0 0 22 20 0.0000 4 270 1935 9315 9540 SS:Theta_2_m\001 +4 1 -1 0 0 22 20 0.0000 4 210 2640 6750 9090 TwoLinkPSX:model\001 +4 0 4 0 0 22 20 0.0000 4 270 1230 7920 8415 [Theta_1]\001 +4 0 4 0 0 22 20 0.0000 4 270 1230 7920 9315 [Theta_2]\001 +4 2 4 0 0 22 20 0.0000 4 270 1140 5535 8415 [Joint_1]\001 +4 2 4 0 0 22 20 0.0000 4 270 1140 5535 9315 [Joint_2]\001 +4 1 1 1 0 3 26 0.0000 4 270 1005 6750 10080 Model\001 +4 1 -1 0 0 22 20 0.0000 4 270 2610 6750 5940 TwoLinkPS:system\001 +4 0 4 0 0 22 20 0.0000 4 270 1230 7920 5265 [Theta_1]\001 +4 0 4 0 0 22 20 0.0000 4 270 1230 7920 6165 [Theta_2]\001 +4 0 -1 0 0 22 20 0.0000 4 270 1530 9315 5490 SS:Theta_1\001 +4 0 -1 0 0 22 20 0.0000 4 270 1530 9315 6390 SS:Theta_2\001 +4 2 4 0 0 22 20 0.0000 4 270 1140 5535 5265 [Joint_1]\001 +4 2 4 0 0 22 20 0.0000 4 270 1140 5535 6165 [Joint_2]\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3825 5490 0\001 +4 2 -1 0 0 22 20 0.0000 4 270 1275 1935 6390 SS:Tau_2\001 +4 2 -1 0 0 22 20 0.0000 4 270 1275 1980 5490 SS:Tau_1\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 3375 6390 0\001 +4 1 1 1 0 3 26 0.0000 4 360 1110 6705 6885 System\001 +4 0 -1 0 0 22 20 0.0000 4 270 1785 9315 2340 SS:Theta_1_r\001 +4 0 -1 0 0 22 20 0.0000 4 270 1785 9315 3240 SS:Theta_2_r\001 +4 1 1 1 0 3 26 0.0000 4 360 2055 6705 3735 Specification\001 +4 1 -1 0 0 22 20 0.0000 4 270 1860 6795 2340 msdP:spec_1\001 +4 1 -1 0 0 22 20 0.0000 4 270 1860 6795 3195 msdP:spec_2\001 +4 2 -1 0 0 22 20 0.0000 4 270 1260 4005 2340 SS:Ref_1\001 +4 2 -1 0 0 22 20 0.0000 4 270 1260 3960 3240 SS:Ref_2\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_desc.tex Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_desc.tex ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_desc.tex +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_desc.tex @@ -0,0 +1,111 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system TwoLinkGPC (TwoLinkGPC_desc.tex) +% Generated by MTT on Wed Apr 15 18:15:23 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/04/15 18:41:58 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLinkGPC} is + displayed in Figure \Ref{TwoLinkGPC_abg} and its label + file is listed in Section \Ref{sec:TwoLinkGPC_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLinkGPC_sub}. + + This example provides an illustration of nonlinear generalised + predictive control (GPC) (continuous-time) operating on a twolink + manipulator with a modified sensor. The sensor is modified in a + rather contrived way to give a nonlinear system with an + \emph{unstable} inverse. The idea is that the sensor approximates a + pure delay of $\tau$ as: + \begin{equation} + e^{-s\tau} \approx 1 - s \tau + \end{equation} + + The example contrasts GPC with GMV, which can also be interpreted + as: +\begin{itemize} +\item the exact linearisation (by feedback) followed by a + pole-placement design on the resulting linear system and +\item a special case of generalised predictive control (GPC) were the + prediction horizon is zero and the $P(s)$ polynomial is the same as + the system relative degree and +\end{itemize} + + +The composite system of Figure \Ref{TwoLinkGPC_abg} has three +(visible) parts: +\begin{enumerate} +\item a linear decoupled \emph{specification} system that describes the desired + closed-loop system in terms of a physical system (two decoupled + mass-spring-damper systems), +\item the system itself (a two-link manipulator) representing the + system to be controlled, more details are given in Sections + \Ref{sec:TwoLinkP_ode.tex} and \Ref{sec:TwoLinkP_rfe.tex}. +\item a model of the system with additional state inputs to be used as + a state observer. +\end{enumerate} +The invisible parts are implemented in the text file +``TwoLinkGPC\_input.txt'' (see Section \Ref{sec:TwoLinkGPC_input.txt}). +These parts are: +\begin{itemize} +\item the reference signal (joint angles) + \begin{equation} + w(t) = + \begin{cases} + \begin{pmatrix} + \pi \\ + 0 + \end{pmatrix} & 0 \ge t > 10 \\ + \begin{pmatrix} + 2\pi \\ + 0 + \end{pmatrix} & 10 \ge t > 15 \\ + \begin{pmatrix} + 2\pi \\ + \pi + \end{pmatrix} & 15 \ge t > 30 \\ + \end{cases} + \end{equation} +\item The control signal (joint torques) being the solution of + \begin{equation} + \phi^*(t) = O_o(\hat x(t)) + O_h(\hat x(t)) u(t) = w(t) + \end{equation} +where $\hat x$ is the observed state. +\item The observer feedback signal + \begin{equation} + u_x = K ( y - \hat y) + \end{equation} +where $K$ is the observer gain matrix and $y$ and $\hat y$ are the +system and model outputs respectively. +\end{itemize} +The observer gain is set up on the basis of the \emph{linearised} +system using LQ theory. This is implemented in the text file +``TwoLinkGPC\_state.txt'' (see Section \Ref{sec:TwoLinkGPC_state.txt}) +using the Octave function ``lqe'' together with the MTT-generated +linearised system ``TwoLink\_sm''. + + +The system was simulated using Octave under MTT with the results given +in Figures +\Ref{fig:TwoLinkGPC_odeso.ps-TwoLinkGPC-Theta-1,TwoLinkGPC-Theta-1-r} +and +\Ref{fig:TwoLinkGPC_odeso.ps-TwoLinkGPC-Theta-2,TwoLinkGPC-Theta-2-r} +giving the actual and specification angles for joints 1 and 2 +respectively. + +The initial \emph{system} state was zero except that the angle of the +first rod was $\frac{\pi}{4}$. The initial \emph{observer} state was +(erroneously but deliberately) set at zero. This explains the +(decaying) discrepancy between the actual and specification angles. +Simulations with zero initial state gave precise matching. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.tex Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.tex ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.tex +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.tex @@ -0,0 +1,48 @@ +%% Tex file (TwoLinkGPC_input.txt) +%% Generated by MTT at Wed Apr 29 11:21:32 BST 1998 +\begin{verbatim} +# Numerical parameter file (TwoLinkGPC_input.txt) +# Generated by MTT at Mon Apr 13 11:02:37 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +global ObserverGain; + +if t<10 + tau = 0; +elseif t<20 + tau = 0.1; +else + tau = 0.2; +end + +# Reference signals +Period = 20; +u(1) = -pi*sign(cos(2*pi*t/Period))*(t>5); # TwoLinkGPC (Ref_1) +u(2) = pi*sign(sin(2*pi*t/Period)); # TwoLinkGPC (Ref_2) +w = u(1:2); # Reference signal + +# Control signals +x_model = x(9:12); # Observed states +[O_o, O_h] = TwoLinkPS_obs(x_model) #GPC O function (affine case) +[spec_n,spec_d] = msdP_tf; # Spec transfer function +P = spec_d(3:-1:1); # P poly with ascending coeffs +PP = [eye(2)*P(1) eye(2)*P(2) eye(2)*P(3)]; # Matrix version +PO_o = PP*O_o; # Compute Py with u zero +PO_h = PP*O_h; # Coefficient of u +u_control = PO_h\(w - PO_o); # GMV control signal + +u(3:4) = u_control; # TwoLinkGPC (Tau_1) + +# Observer +x_system = x(5:8); # System states +error = x_system-x_model; # Error in states +ObserverInput = ObserverGain*error; +u(5:8) = ObserverInput; # Set the state-input to the observer + +\end{verbatim} ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.txt @@ -0,0 +1,42 @@ +# Numerical parameter file (TwoLinkGPC_input.txt) +# Generated by MTT at Mon Apr 13 11:02:37 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +global ObserverGain; + +if t<10 + tau = 0; +else + tau = 0.1; +end + +# Reference signals +Period = 20; +u(1) = -pi*sign(cos(2*pi*t/Period))*(t>5); # TwoLinkGPC (Ref_1) +u(2) = pi*sign(sin(2*pi*t/Period)); # TwoLinkGPC (Ref_2) +w = u(1:2); # Reference signal + +# Control signals +x_model = x(9:12); # Observed states +[O_o, O_h] = TwoLinkPS_obs(x_model) #GPC O function (affine case) +[spec_n,spec_d] = msdP_tf; # Spec transfer function +P = spec_d(3:-1:1); # P poly with ascending coeffs +PP = [eye(2)*P(1) eye(2)*P(2) eye(2)*P(3)]; # Matrix version +PO_o = PP*O_o; # Compute Py with u zero +PO_h = PP*O_h; # Coefficient of u +u_control = PO_h\(w - PO_o); # GMV control signal + +u(3:4) = u_control; # TwoLinkGPC (Tau_1) + +# Observer +x_system = x(5:8); # System states +error = x_system-x_model; # Error in states +ObserverInput = ObserverGain*error; +u(5:8) = ObserverInput; # Set the state-input to the observer + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_lbl.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_lbl.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_lbl.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_lbl.txt @@ -0,0 +1,46 @@ +%SUMMARY TwoLinkGPC - GPC control of two-link manipulator with delay +%DESCRIPTION This composite system provides an illustration +%DESCRIPTION of nonlinear GPC (Generalised Predictive Control) control +%DESCRIPTION (continuous-time) operating on a twolink manipulator. + +%% Label file for system TwoLinkGPC (TwoLinkGPC_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/04/29 09:01:43 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type SS + Ref_1 SS external,internal + Ref_2 SS external,internal + Tau_1 SS external,internal + Tau_2 SS external,internal + Theta_1 SS external,0 + Theta_2 SS external,0 + Theta_1_m SS external,0 + Theta_2_m SS external,0 + Theta_1_r SS external,0 + Theta_2_r SS external,0 + +% Component type msdP + spec_1 + spec_2 + +% Component type TwoLinkP + system + +% Component type TwoLinkPX + model + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_numpar.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_numpar.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_numpar.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_numpar.txt @@ -0,0 +1,18 @@ +# Numerical parameter file (TwoLinkGPC_numpar.txt) +# Generated by MTT at Mon Apr 13 10:57:02 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_s = 1.0; # msdP +j_s = 1.0; # msdP +r_s = 2.0; # msdP +tau = 0.1; # msdP +l_r = 0.5; # TwoLinkP,TwoLinkPX +m_r = 1.0; # TwoLinkP,TwoLinkPX +j_r = m_r*l_r*l_r/3; # TwoLinkP,TwoLinkPX ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_obspar.r Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_obspar.r ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_obspar.r +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_obspar.r @@ -0,0 +1,29 @@ +%% Reduce GPC observability function parameters for system TwoLinkGPC (TwoLinkGPC_obspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MTTGPCNy := 2; +MTTGPCNu := 0; +Matrix MTTdU(5,1); +MTTdU(1,1) := MTTdU1; +MTTdU(2,1) := MTTdU2; +MTTdU(3,1) := MTTdU3; +MTTdU(4,1) := MTTdU4; +MTTdU(5,1) := MTTdU5; +Matrix MTTUU(2,5); +MTTUU(1,1) := MTTu1; +MTTUU(1,2) := MTTu11; +MTTUU(1,3) := MTTu12; +MTTUU(1,4) := MTTu13; +MTTUU(1,5) := MTTu14; +MTTUU(2,1) := MTTu2; +MTTUU(2,2) := MTTu21; +MTTUU(2,3) := MTTu22; +MTTUU(2,4) := MTTu23; +MTTUU(2,5) := MTTu24; +END; ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_rep.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_rep.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_rep.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_rep.txt @@ -0,0 +1,32 @@ +# Outline report file for system TwoLinkGPC (TwoLinkGPC_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt TwoLinkGPC abg tex +mtt TwoLinkGPC struc tex +mtt TwoLinkGPC sympar tex + +mtt TwoLinkPS struc tex +mtt TwoLinkPS rfe tex +mtt TwoLinkPS ode tex +mtt TwoLinkPS obs tex + +mtt TwoLinkPS ss tex +mtt TwoLinkPS sm tex + +mtt msdP tf tex + +mtt TwoLinkGPC numpar txt +mtt TwoLinkGPC state txt +mtt TwoLinkGPC input txt + +mtt TwoLinkGPC odeso ps 'TwoLinkGPC_Theta_1,TwoLinkGPC_Theta_1_r' +mtt TwoLinkGPC odeso ps 'TwoLinkGPC_Theta_2,TwoLinkGPC_Theta_2_r' + + + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt @@ -0,0 +1,13 @@ +%% Simulation parameters for system TwoLinkGPC (TwoLinkGPC_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=30 +DT=0.1 +STEPFACTOR=2 + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt_old Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt_old ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt_old +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt_old @@ -0,0 +1,13 @@ +%% Simulation parameters for system TwoLinkGPC (TwoLinkGPC_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=30 +DT=0.1 +STEPFACTOR=2 + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_state.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_state.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_state.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_state.txt @@ -0,0 +1,31 @@ +# Numerical parameter file (TwoLinkGPC_state.txt) +# Generated by MTT at Thu Apr 23 09:10:43 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +global ObserverGain; + +# Set the states +x(1) = 0 ; # TwoLinkGPC_spec_1 (c_s) +x(2) = 0 ; # TwoLinkGPC_spec_1 (j_s) +x(3) = 0 ; # TwoLinkGPC_spec_2 (c_s) +x(4) = 0 ; # TwoLinkGPC_spec_2 (j_s) +x(5) = 0 ; # TwoLinkGPC_system_rod1 (J) +x(6) = 0 ; # TwoLinkGPC_system_rod1_th (3) +x(7) = 0 ; # TwoLinkGPC_system_rod2 (J) +x(8) = 0 ; # TwoLinkGPC_system_rod2_th (3) +x(9) = 0 ; # TwoLinkGPC_model_rod1_J (i) +x(10) = 0 ; # TwoLinkGPC_model_rod1_th_c (c) +x(11) = 0 ; # TwoLinkGPC_model_rod2_J (i) +x(12) = 0 ; # TwoLinkGPC_model_rod2_th_c (c) + +# Observer design +[A,B,C] = TwoLinkPS_sm; # Get the linearised system +sigma = 0.1; # Measurement noise variance (pretend) +k = lqe(A,eye(4),C,eye(4),sigma*eye(2)) +ObserverGain = k*C; # This system happens to have a linear output ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_abg.fig Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_abg.fig ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_abg.fig +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_abg.fig @@ -0,0 +1,104 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3468 1128 3738 1128 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4593 2703 4863 2703 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 1128 4728 2703 4953 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4502 5492 4502 5762 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5627 4502 5627 4277 5852 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 7426 4951 7201 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3472 8647 3742 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4597 8647 4867 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5724 8649 5994 8649 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4730 8645 4730 10220 4955 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5855 8645 5855 10220 6080 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3826 3601 7426 3826 7201 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3826 5851 7426 6076 7201 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 11475 9450 225 180 225 180 11475 9450 11475 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 8622 3600 10197 3825 9972 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 7650 450 9405 450 9405 675 7650 675 7650 450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 3285 1575 3285 1800 3510 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3195 8055 1620 8055 1845 8280 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 3150 1350 2025 1575 2250 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 8325 1350 9450 1575 9225 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 7875 1350 3600 1575 3825 +4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000 4 195 1335 4729 3379 RODaX:rod1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1335 4731 8196 RODaX:rod2\001 +4 1 4 0 0 0 20 0.0000 4 255 1410 4771 946 SS:[Joint_1]\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 +4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 +4 1 -1 0 0 0 20 0.0000 4 255 810 5850 945 SS:v_y\001 +4 2 4 0 0 0 20 0.0000 4 255 1410 2882 5717 SS:[Joint_2]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 675 3510 3375 [alpha]\001 +4 1 4 0 0 0 16 0.0000 4 225 675 3555 8145 [alpha]\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 1308 8193 1\001 +4 1 4 0 0 0 20 0.0000 4 255 1530 1397 1892 SS:[Theta_1]\001 +4 1 4 0 0 0 20 0.0000 4 255 1530 1352 9767 SS:[Theta_2]\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 1263 3468 0\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_desc.tex Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_desc.tex ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_desc.tex +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_desc.tex @@ -0,0 +1,42 @@ +% Verbal description for system TwoLinkPSX (TwoLinkPSX_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/19 14:20:07 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLinkPSX} is + displayed in Figure \Ref{TwoLinkPSX_abg} and its label + file is listed in Section \Ref{sec:TwoLinkPSX_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLinkPSX_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses the compound components: {\bf ROD}. {\bf +ROD} is essentially as described in Figure 10.2. +There is no gravity included in this model. + +This system has a number of dynamic elements (those corresponding to translation +motion) in derivative causality, thus the system is represnted as a +Differential-Algebraic Equation (Section +\Ref{sec:TwoLinkPSX_dae.tex}). Hovever, this is of contrained-state form and +therfore can be written as a set of constrained-state equations (Section +\Ref{sec:TwoLinkPSX_cse.tex}). The corresponding ordinary differential +equation is complicated due to the trig functions involved in +inverting the E matrix. + +As well as the standard representation the ``robot-form'' equations +appear in Section \Ref{sec:TwoLinkPSX_rfe}. + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_lbl.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_lbl.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_lbl.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_lbl.txt @@ -0,0 +1,57 @@ +%SUMMARY TwoLinkPSX: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (TwoLinkPSX_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/12/05 12:39:49 peterg +% %% Documentation +% %% +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - uniform rods +rod1 none l_r;l_r;j_r;m_r +rod2 none l_r;l_r;j_r;m_r + +%Zero velocity sources +v_x SS internal,0 +v_y SS internal,0 + + +%Zero force/torque sources +F_x SS 0,internal +F_a SS 0,internal +F_y SS 0,internal + +%Named ports +[Joint_1] SS external,internal +[Joint_2] SS external,internal +[Theta_1] SS external,0 +[Theta_2] SS external,0 + +%Torque/velocity at joints +%f_a1 SS external,external +%f_a2 SS external,external + + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_abg.fig Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_abg.fig ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_abg.fig +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_abg.fig @@ -0,0 +1,126 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 11700 1800 485 485 11700 1800 11880 2250 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 11700 6300 485 485 11700 6300 12185 6785 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11745 11925 11745 450 45 450 45 11925 11745 11925 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 7650 900 4725 900 4725 3375 3375 3375 3600 3600 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4950 8505 4950 4230 5175 4455 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 6300 4052 6302 3827 6527 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 4275 6525 4275 8325 3150 8325 3375 8550 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 6300 7652 6300 7427 6525 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6618 1803 6888 1803 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8870 1805 9140 1805 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7743 3378 8013 3378 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7878 1125 7878 3378 8103 3153 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7652 6167 7652 6437 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7876 6526 7876 8101 8101 7876 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6622 9322 6892 9322 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7747 9322 8017 9322 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8874 9324 9144 9324 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7880 9320 7880 10895 8105 10670 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9005 9320 9005 10895 9230 10670 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6751 4501 6751 8101 6976 7876 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9001 4501 9001 8101 9226 7876 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9675 9450 9675 7875 6075 7875 6075 9450 9675 9450 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9675 7110 9675 5535 6075 5535 6075 7110 9675 7110 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9675 11925 9675 10350 6075 10350 6075 11925 9675 11925 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6753 1803 6753 3378 6978 3153 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9003 1803 9003 3378 9228 3153 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7876 4501 7876 6076 8101 5851 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9675 4725 6075 4725 6075 3150 9675 3150 9675 4725 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 9297 6750 10872 6975 10647 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11925 5850 11925 2250 11475 2250 11475 5850 11925 5850 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11925 10350 11925 6750 11475 6750 11475 10350 11925 10350 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 10800 1125 12555 1125 12555 1350 10800 1350 10800 1125 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9630 2745 9630 1170 6030 1170 6030 2745 9630 2745 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8910 900 8145 900 8370 1125 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2790 3735 2115 3735 2340 3960 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4725 3960 3330 3960 3555 4185 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 3960 5040 3960 5265 4185 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2700 8550 2025 8550 2250 8775 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 8775 3150 8775 3375 9000 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7200 8775 4905 8775 5130 9000 +4 0 -1 0 0 0 20 0.0000 4 195 135 4863 4053 0\001 +4 2 4 0 0 0 20 0.0000 4 255 1410 2702 6392 SS:[Joint_2]\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4188 6393 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 810 6753 1623 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 7833 6393 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 6758 11348 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 7883 11348 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 9053 11348 SS:F_y\001 +4 0 1 1 0 3 20 0.0000 4 210 720 9945 4050 Link 1\001 +4 0 1 1 0 3 20 0.0000 4 225 795 9900 6435 Joint 2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 9900 8865 Link 2\001 +4 0 1 1 0 3 20 0.0000 4 270 375 9900 11160 Tip\001 +4 0 1 1 0 3 20 0.0000 4 225 795 9900 1935 Joint 1\001 +4 1 4 0 0 0 16 0.0000 4 225 900 7875 3645 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 6750 4455 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 7875 4455 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 9000 4455 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 9000 3645 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 6755 8510 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 7880 8510 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 6757 9187 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 7883 9188 [alpha_b]\001 +4 1 -1 0 0 0 20 0.0000 4 255 810 9000 1620 SS:v_y\001 +4 1 4 0 0 0 16 0.0000 4 210 495 6750 3645 [x_a]\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 7788 993 1\001 +4 0 4 0 0 0 20 0.0000 4 255 1410 9046 991 SS:[Joint_1]\001 +4 2 4 0 0 0 20 0.0000 4 255 1530 1892 3827 SS:[Theta_1]\001 +4 1 4 0 0 0 16 0.0000 4 210 240 2700 3555 [s]\001 +4 1 -1 0 0 0 20 1.5708 4 195 780 3154 3731 Sensor\001 +4 1 4 0 0 0 16 0.0000 4 225 270 3420 3825 [p]\001 +4 1 4 0 0 0 16 0.0000 4 210 270 3330 3195 [v]\001 +4 1 -1 0 0 0 20 0.0000 4 195 1335 7879 4009 RODa:rod1\001 +4 1 4 0 0 0 16 0.0000 4 225 675 6885 4005 [alpha]\001 +4 1 4 0 0 0 16 0.0000 4 210 270 3375 8235 [v]\001 +4 1 4 0 0 0 16 0.0000 4 210 240 2655 8460 [s]\001 +4 1 -1 0 0 0 20 1.5708 4 195 780 3064 8546 Sensor\001 +4 2 4 0 0 0 20 0.0000 4 255 1530 1937 8642 SS:[Theta_2]\001 +4 1 4 0 0 0 16 0.0000 4 225 270 3375 8730 [p]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 8780 8510 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 8739 9189 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 675 7065 8820 [alpha]\001 +4 1 -1 0 0 0 20 0.0000 4 195 1335 8061 8826 RODa:rod2\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4593 8823 1\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_desc.tex Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_desc.tex ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_desc.tex +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_desc.tex @@ -0,0 +1,42 @@ +% Verbal description for system TwoLinkPS (TwoLinkPS_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/19 14:20:07 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLinkPS} is + displayed in Figure \Ref{TwoLinkPS_abg} and its label + file is listed in Section \Ref{sec:TwoLinkPS_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLinkPS_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses the compound components: {\bf ROD}. {\bf +ROD} is essentially as described in Figure 10.2. +There is no gravity included in this model. + +This system has a number of dynamic elements (those corresponding to translation +motion) in derivative causality, thus the system is represnted as a +Differential-Algebraic Equation (Section +\Ref{sec:TwoLinkPS_dae.tex}). Hovever, this is of contrained-state form and +therfore can be written as a set of constrained-state equations (Section +\Ref{sec:TwoLinkPS_cse.tex}). The corresponding ordinary differential +equation is complicated due to the trig functions involved in +inverting the E matrix. + +As well as the standard representation the ``robot-form'' equations +appear in Section \Ref{sec:TwoLinkPS_rfe}. + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_lbl.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_lbl.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_lbl.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_lbl.txt @@ -0,0 +1,57 @@ +%SUMMARY TwoLinkPS: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (TwoLinkPS_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/12/05 12:39:49 peterg +% %% Documentation +% %% +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - uniform rods +rod1 none l_r;l_r;j_r;m_r +rod2 none l_r;l_r;j_r;m_r + +%Zero velocity sources +v_x SS internal,0 +v_y SS internal,0 + + +%Zero force/torque sources +F_x SS 0,internal +F_a SS 0,internal +F_y SS 0,internal + +%Named ports +[Joint_1] SS external,internal +[Joint_2] SS external,internal +[Theta_1] SS external,0 +[Theta_2] SS external,0 + +%Torque/velocity at joints +%f_a1 SS external,external +%f_a2 SS external,external + + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_obspar.r Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_obspar.r ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_obspar.r +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_obspar.r @@ -0,0 +1,29 @@ +%% Reduce GPC observability function parameters for system TwoLinkPS (TwoLinkPS_obspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MTTGPCNy := 2; +MTTGPCNu := 0; +Matrix MTTdU(5,1); +MTTdU(1,1) := MTTdU1; +MTTdU(2,1) := MTTdU2; +MTTdU(3,1) := MTTdU3; +MTTdU(4,1) := MTTdU4; +MTTdU(5,1) := MTTdU5; +Matrix MTTUU(2,5); +MTTUU(1,1) := MTTu1; +MTTUU(1,2) := MTTu11; +MTTUU(1,3) := MTTu12; +MTTUU(1,4) := MTTu13; +MTTUU(1,5) := MTTu14; +MTTUU(2,1) := MTTu2; +MTTUU(2,2) := MTTu21; +MTTUU(2,3) := MTTu22; +MTTUU(2,4) := MTTu23; +MTTUU(2,5) := MTTu24; +END; ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_simp.r Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_simp.r ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_simp.r +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_simp.r @@ -0,0 +1,19 @@ +%% Reduce commands to simplify output for system TwoLinkP (TwoLinkP_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LET cos(mttx2) = c_2; +LET sin(mttx2) = s_2; + +LET cos(mttx4) = c_4; +LET sin(mttx4) = s_4; + +LET cos(mttx2-mttx4) = c; +LET sin(mttx2-mttx4) = s; + +END; ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_subs.r Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_subs.r ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_subs.r +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_subs.r @@ -0,0 +1,24 @@ +%% Reduce substitution statements for system TwoLinkPSX (TwoLinkPSX_subs.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/03/22 20:13:25 peterg +% %% Trig simplification added +% %% +% %% Revision 1.1 1998/03/22 20:12:51 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +END; + ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig @@ -0,0 +1,33 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 4050 4950 4050 4725 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 4275 3600 5400 3825 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 4050 3375 4050 3150 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 4050 6525 4050 6300 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3825 5175 2700 5400 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3825 3600 2700 3825 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 4050 8100 4050 7875 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9000 4050 10125 4050 9900 4275 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11475 6975 11475 1125 1125 1125 1125 6975 11475 6975 +4 1 -1 0 0 0 20 0.0000 4 195 135 3600 4185 1\001 +4 2 4 0 0 0 20 0.0000 4 240 810 2160 4140 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 480 3600 5715 I:j_s\001 +4 1 1 1 0 0 20 0.0000 4 255 7035 4815 6345 Mass-spring-damper system (position output with extra lag)\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5175 4140 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 615 3600 2565 R:r_s\001 +4 1 -1 0 0 0 20 0.0000 4 255 630 5175 2565 C:c_s\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 6750 4140 AE\001 +4 1 -1 0 0 0 20 0.0000 4 195 690 8550 4140 RC:rc\001 +4 0 4 0 0 0 20 0.0000 4 240 960 10260 4140 SS:[out]\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig.bak Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig.bak ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig.bak +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig.bak @@ -0,0 +1,27 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 4050 4950 4050 4725 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 4275 3600 5400 3825 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 4050 3375 4050 3150 4275 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 6975 8325 1125 1125 1125 1125 6975 8325 6975 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 4050 6525 4050 6300 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3825 5175 2700 5400 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3825 3600 2700 3825 2925 +4 1 -1 0 0 0 20 0.0000 4 195 135 3600 4185 1\001 +4 2 4 0 0 0 20 0.0000 4 240 810 2160 4140 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 480 3600 5715 I:j_s\001 +4 1 1 1 0 0 20 0.0000 4 255 5355 4815 6345 Mass-spring-damper system (position output)\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5175 4140 0\001 +4 0 4 0 0 0 20 0.0000 4 240 960 6660 4140 SS:[out]\001 +4 1 -1 0 0 0 20 0.0000 4 255 615 3600 2565 R:r_s\001 +4 1 -1 0 0 0 20 0.0000 4 255 630 5175 2565 C:c_s\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_desc.tex Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_desc.tex ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_desc.tex +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_desc.tex @@ -0,0 +1,31 @@ +% Verbal description for system msdPS (msdPS_desc.tex) +% Generated by MTT on Thu Nov 13 09:38:17 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{msdPS} is + displayed in Figure \Ref{msdPS_abg} and its label + file is listed in Section \Ref{sec:msdPS_lbl}. + The subsystems are listed in Section \Ref{sec:msdPS_sub}. + + + \textbf{msdPS} is a simple Mass-Spring-Damper system with + force input and position output. It is set up to provide a specification system + for each link of the two-link maipulator. This is appropriate because + \begin{itemize} + \item it has compatible physical behaviour with the system itself, + \item it specifies two decoupled systems, + \item it has linear behaviour and + \item it has a simple performance interpretation in terms of system + rise-time and overshoot. + \end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_lbl.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_lbl.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_lbl.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_lbl.txt @@ -0,0 +1,33 @@ +%SUMMARY msdPS +%DESCRIPTION +%% Label file for system msdPS (msdPS_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_s lin effort,c_s + +% Component type I + j_s lin flow,j_s + +% Component type R + r_s lin flow,r_s + +% Component type RC + rc none tau;1 + +% Component type SS + [in] SS external,internal + [out] SS external,0 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_abg.fig Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_abg.fig ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_abg.fig +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_abg.fig @@ -0,0 +1,27 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 4050 4950 4050 4725 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 4275 3600 5400 3825 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 4050 3375 4050 3150 4275 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 6975 8325 1125 1125 1125 1125 6975 8325 6975 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 4050 6525 4050 6300 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3825 5175 2700 5400 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3825 3600 2700 3825 2925 +4 1 -1 0 0 0 20 0.0000 4 195 135 3600 4185 1\001 +4 2 4 0 0 0 20 0.0000 4 240 810 2160 4140 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 480 3600 5715 I:j_s\001 +4 1 1 1 0 0 20 0.0000 4 255 5355 4815 6345 Mass-spring-damper system (position output)\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5175 4140 0\001 +4 0 4 0 0 0 20 0.0000 4 240 960 6660 4140 SS:[out]\001 +4 1 -1 0 0 0 20 0.0000 4 255 615 3600 2565 R:r_s\001 +4 1 -1 0 0 0 20 0.0000 4 255 630 5175 2565 C:c_s\001 ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_desc.tex Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_desc.tex ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_desc.tex +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_desc.tex @@ -0,0 +1,31 @@ +% Verbal description for system msdP (msdP_desc.tex) +% Generated by MTT on Thu Nov 13 09:38:17 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{msdP} is + displayed in Figure \Ref{msdP_abg} and its label + file is listed in Section \Ref{sec:msdP_lbl}. + The subsystems are listed in Section \Ref{sec:msdP_sub}. + + + \textbf{msdP} is a simple Mass-Spring-Damper system with + force input and position output. It is set up to provide a specification system + for each link of the two-link maipulator. This is appropriate because + \begin{itemize} + \item it has compatible physical behaviour with the system itself, + \item it specifies two decoupled systems, + \item it has linear behaviour and + \item it has a simple performance interpretation in terms of system + rise-time and overshoot. + \end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_lbl.txt Index: mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_lbl.txt ================================================================== --- mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_lbl.txt +++ mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_lbl.txt @@ -0,0 +1,30 @@ +%SUMMARY msdP +%DESCRIPTION +%% Label file for system msdP (msdP_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_s lin effort,c_s + +% Component type I + j_s lin flow,j_s + +% Component type R + r_s lin flow,r_s + +% Component type SS + [in] SS external,internal + [out] SS external,0 ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_abg.fig Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_abg.fig +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_abg.fig @@ -0,0 +1,21 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 1800 5400 1800 5175 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4230 2700 5355 2700 5130 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 1575 5400 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 2475 5400 2925 +4 0 0 100 0 18 20 0.0000 4 225 810 5625 1890 SS:z1\001 +4 0 0 100 0 18 20 0.0000 4 240 810 5625 2790 SS:z2\001 +4 2 4 100 0 18 20 0.0000 4 285 1305 4140 1890 SS:[y_in]\001 +4 2 4 100 0 18 20 0.0000 4 285 1860 4140 2790 SS:[theta_in]\001 ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_lbl.txt Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_lbl.txt +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_lbl.txt @@ -0,0 +1,30 @@ +%% Label file for system Fixed (Fixed_lbl.txt) +%SUMMARY Fixed +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in y_in,theta_in + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [theta_in] SS external,external + [y_in] SS external,external + z1 SS internal,0 + z2 SS internal,0 + ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_abg.fig Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_abg.fig +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_abg.fig @@ -0,0 +1,21 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 1800 5400 1800 5175 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4230 2700 5355 2700 5130 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 1575 5400 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 2475 5400 2925 +4 2 0 100 0 18 20 0.0000 4 225 810 4140 1890 SS:z1\001 +4 2 0 100 0 18 20 0.0000 4 240 810 4140 2790 SS:z2\001 +4 0 4 100 0 18 20 0.0000 4 285 1500 5490 1890 SS:[y_out]\001 +4 0 4 100 0 18 20 0.0000 4 285 2055 5445 2790 SS:[theta_out]\001 ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_lbl.txt Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_lbl.txt +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_lbl.txt @@ -0,0 +1,32 @@ +%% Label file for system Free (Free_lbl.txt) +%SUMMARY Free +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS out y_out,theta_out + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [theta_out] SS external,external + [y_out] SS external,external + z1 SS 0,internal + z2 SS 0,internal + + + ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Make_figures.m Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Make_figures.m ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Make_figures.m +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Make_figures.m @@ -0,0 +1,4 @@ +#!/bin/sh +## Script file Make_figures. + +ppp_1("PPPCantileverBeam",1:2,[1 2;1 3]); # 2 inputs; modes 1 2 and 1 and 3 ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_abg.fig Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_abg.fig +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_abg.fig @@ -0,0 +1,40 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1125 2700 2250 2700 2025 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 8775 2700 9900 2700 9675 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 2700 3825 2700 3600 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4230 2700 5355 2700 5130 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4095 6300 4095 4500 4320 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3870 4500 4320 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5850 2700 6975 2700 6750 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7380 2700 8505 2700 8280 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7245 6300 7245 4500 7470 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 7020 4500 7470 4500 +4 1 0 100 0 18 20 1.5708 4 225 630 1035 2700 Free\001 +4 1 0 100 0 18 20 1.5708 4 225 780 10260 2700 Fixed\001 +4 1 0 100 0 18 20 1.5708 4 285 3690 8775 2700 BernoulliEuler:Chunk_3*3\001 +4 1 0 100 0 18 20 1.5708 4 285 3690 2610 2700 BernoulliEuler:Chunk_1*3\001 +4 1 0 100 0 18 20 1.5708 4 300 3480 4140 2700 pBernoulliEuler:Patch_1\001 +4 1 4 100 0 18 16 0.0000 4 240 900 4095 4455 [torque]\001 +4 1 0 100 0 18 20 0.0000 4 285 1275 4050 6660 SS:tau_1\001 +4 1 0 100 0 18 20 1.5708 4 285 3690 5760 2700 BernoulliEuler:Chunk_2*8\001 +4 1 0 100 0 18 20 1.5708 4 300 3480 7290 2700 pBernoulliEuler:Patch_2\001 +4 1 4 100 0 18 16 0.0000 4 240 900 7245 4455 [torque]\001 +4 1 0 100 0 18 20 0.0000 4 285 1275 7200 6660 SS:tau_2\001 ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_desc.tex Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_desc.tex ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_desc.tex +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_desc.tex @@ -0,0 +1,64 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system PPPCantileverBeam (PPPCantileverBeam_desc.tex) +% Generated by MTT on Mon Apr 19 07:04:54 BST 1999. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/05/18 04:01:50 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The acausal bond graph of system \textbf{PPPCantileverBeam} is displayed in +Figure \Ref{fig:PPPCantileverBeam_abg.ps} and its label file is listed in +Section \Ref{sec:PPPCantileverBeam_lbl}. The subsystems are listed in Section +\Ref{sec:PPPCantileverBeam_sub}. + +This example represents the dynamics of a uniform beam with one fixed +and one free end. The beam is approximated by 16 equal lumps using +the Bernoulli-Euler approximation with damping. The ouputs are taken +to be the 16 lump velocities, the two inputs are taken to be torques +applied to lumps 3 away from each end; this approximates the effect of +two piezoelectric patches. + +The system parameters are given in Section +\Ref{sec:PPPCantileverBeam_numpar.tex}. +The system has 32 states (16 modes of vibration), 2 inputs and 12 +outputs. +The first 8 modal frequencies are given in Table \ref{tab:modes}. +\begin{table}[htbp] + \begin{center} + \begin{tabular}{||c|c||c|c||} + \hline + Mode & $\omega_i$ & Mode & $\omega_i$\\ + \hline + \hline + 1 & 0.0079504 & 5 & 0.4352376\\ + 2 & 0.0498140 & 6 & 0.6338899\\ + 3 & 0.1386209 & 7 & 0.8573604\\ + 4 & 0.2682835 & 8 & 1.0976942\\ + \hline + \end{tabular} + \caption{Modal frequencies} + \label{tab:modes} + \end{center} +\end{table} + +Figure \Ref{fig:PPPCantileverBeam_lmfr.ps} shows the log modulus of the frequency +response and Figure \Ref{fig:PPPCantileverBeam_pppy0.ps} shows the system transient +reponse with no control and an initial unit twist. + +Figure \Ref{fig:PPPCantileverBeam_pppy.ps} shows closed loop reponse when +controlled by a PPP controller attempting to damp modes 1 and 2 from +input 1 and modes 1 and three from input 2. Figure +\Ref{fig:PPPCantileverBeam_pppy.ps} shows the corresponding control signals. + + + + + + + ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_input.txt Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_input.txt ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_input.txt +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_input.txt @@ -0,0 +1,14 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (PPPCantileverBeam_input.txt) +# Generated by MTT at Thu Apr 22 00:12:54 BST 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Set the inputs +mttu(1) = exp(-t/0.1); # tau (PPPCantileverBeam) + +# Set the switches ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_lbl.txt Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_lbl.txt +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_lbl.txt @@ -0,0 +1,45 @@ +%% Label file for system PPPCantileverBeam (PPPCantileverBeam_lbl.txt) +%SUMMARY PPPCantileverBeam +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Declare some variables +%VAR Area +%VAR AreaMoment +%VAR BeamLength +%VAR BeamThickness +%VAR BeamWidth +%VAR Density +%VAR N +%VAR Youngs +%VAR EI +%VAR rhoA + +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type BenoulliEuler + Chunk_1 + Patch_1 + Chunk_2 + Patch_2 + Chunk_3 + + +% Component type SS + tau_1 SS external,external + tau_2 SS external,external ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt @@ -0,0 +1,32 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (PPPCantileverBeam_numpar.txt) +# Generated by MTT at Mon Apr 19 06:24:08 BST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:27:26 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +N = 16; +BeamLength = 0.58; +BeamWidth = 0.05; +BeamThickness = 0.005; +Youngs = 1e6; +Density = 1e5; +Area = BeamWidth*BeamThickness; +AreaMoment = (BeamThickness*pow(BeamWidth,2))/12; + + +EI= 58.6957 # from Reza +rhoA= 0.7989 # from Reza + +dz = BeamLength/N; # Incremental length +dm = rhoA*dz; # Incremental mass +dk = EI/dz; # Incremental stiffness +dr = 1e-2; # Damping ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_rep.txt Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_rep.txt ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_rep.txt +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_rep.txt @@ -0,0 +1,31 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system PPPCantileverBeam (PPPCantileverBeam_rep.txt) +## Generated by MTT on" Mon Apr 19 06:43:08 BST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt PPPCantileverBeam abg tex # The system description +## mtt PPPCantileverBeam cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt PPPCantileverBeam struc tex # The system structure +## mtt PPPCantileverBeam dae tex # The system dae +## mtt PPPCantileverBeam ode tex # The system ode +## mtt PPPCantileverBeam sspar tex # Steady-state parameters +## mtt PPPCantileverBeam ss tex # Steady state +## mtt PPPCantileverBeam dm tex # Descriptor matrices (of linearised system) +## mtt PPPCantileverBeam sm tex # State matrices (of linearised system) +## mtt PPPCantileverBeam tf tex # Transfer function (of linearised system) +mtt PPPCantileverBeam simpar tex # Simulation parameters +mtt PPPCantileverBeam numpar tex # Numerical simulation parameters +## mtt PPPCantileverBeam input tex # Simulation input +## mtt PPPCantileverBeam odeso ps # Simulation output +mtt PPPCantileverBeam lmfr ps # log modulus of frequency response (of linearised system) + +mtt PPPCantileverBeam pppy ps # PPP output +mtt PPPCantileverBeam pppu ps # PPP input +mtt PPPCantileverBeam pppy0 ps # PPP open-loop op ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system PPPCantileverBeam (PPPCantileverBeam_simpar.txt) +# Generated by MTT on Mon Apr 19 06:32:42 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 1.0; # Last time in simulation +DT = 0.01; # Print interval +STEPFACTOR = 10; # Integration steps per print interval +WMIN = 1; # Minimum frequency = 10^WMIN +WMAX = 4; # Maximum frequency = 10^WMAX +WSTEPS = 500; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt_old Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt_old ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt_old +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt_old @@ -0,0 +1,19 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system PPPCantileverBeam (PPPCantileverBeam_simpar.txt) +# Generated by MTT on Mon Apr 19 06:32:42 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 1.0; # Last time in simulation +DT = 0.01; # Print interval +STEPFACTOR = 10; # Integration steps per print interval +METHOD = Implicit; # Integration method +WMIN = 1; # Minimum frequency = 10^WMIN +WMAX = 4; # Maximum frequency = 10^WMAX +WSTEPS = 500; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/ppp_1.m Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/ppp_1.m ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/ppp_1.m +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/ppp_1.m @@ -0,0 +1,176 @@ +function ppp_1(Name,Inputs,Modes); + +# Name = "CantileverBeam" +# Inputs = 1:2 +# Modes = [1 2;1 3] + + path(path,"~/Research/CGPC/PPP"); + + Name,Inputs,Modes + + ## System + system(sprintf("mtt -q %s numpar m", Name)); + system(sprintf("mtt -q %s sm m", Name)); + par = eval(sprintf("%s_numpar;",Name)); + eval(sprintf("[A,B,C,D]=%s_sm(par);",Name)); + [n_x,n_u,n_y] = abcddim(A,B,C,D) + + + ## Change B + B = B(:,Inputs); + [junk,n_u]=size(B); + n_u + + ## Redo C and D to reveal ALL velocities + n_y = n_x/2 + C = zeros(n_y,n_x); + for i = 1:n_y + C(i,2*i-1) = 1; + endfor + + ## Sort out D + D = zeros(n_y,n_u); + + e = eig(A); # Eigenvalues + N = length(e); + frequencies = sort(imag(e)); + frequencies = frequencies(N/2+1:N); # Modal frequencies + + ## Controller + ## Controller design parameters + t = [0.9:0.01:1.0]; # Optimisation horizon + + ## Specify input basis functions + ## - damped sinusoids with same frequencies as beam + damping_ratio = [0.1 0.1]; # Damping ratio of inputs + A_u=[]; +# Modes = [1 3 +# 1 2]; # Choose modes to be controlled by each input + if n_u == 1 # Put all modes on each input + Modes = [Modes; Modes]; + endif + + Modes + + for i=Inputs + A_ui = damped_matrix(frequencies(Modes(i,:)),damping_ratio(i)*ones(size(Modes(i,:)))); + A_u = [A_u;A_ui]; + u_0 = ones(n_x,1); # Initial conditions + endfor + + + A_w = 0; # Setpoint + Q = ones(n_y,1); # Output weighting + + ## Design + disp("Control design - unconstrained"); + [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t); # Unconstrained design + + ## Organise some plots + dt = 0.002; # Time increment +# T = 0:dt:t(length(t)); # Time starting at zero but past horizon + T = 0:dt:1.0; # Time + + ## Set up an "typical" initial condition + x_0 = zeros(n_x,1); + x_0(2:2:n_x) = ones(1,n_x/2); # Set initial twist to 1. +# disp("Computing OL response"); +# [Ys,Us] = ppp_transient (T,A_u,-(K_x*x_0)',u_0,A,B,C,D,x_0); # Compute open-loop control + + + disp("Computing OL response (no control)"); + [Y_0] = ppp_sm2sr(A, B, C, D, T, zeros(n_u,1), x_0); # Compute Closed-loop control + title("Y (no control)"); + xlabel("Time") + grid; + plot(T,Y_0); + psfig(sprintf("%s_pppy0",Name)); + + disp("Computing Unconstrained CL response"); + [y_u,X_u] = ppp_sm2sr(A-B*k_x, B, C, D, T, zeros(n_u,1), x_0); + u_u = -k_x*X_u'; + + + title("Unconstrained closed-loop control - y"); + xlabel("Time") + grid; + plot(T,y_u); + psfig(sprintf("%s_pppy",Name)); + + title("Unconstrained closed-loop control - u"); + xlabel("Time") + grid; + plot(T,u_u); + psfig(sprintf("%s_pppu",Name)); + +# ## Constrained version + +# ## Constraints - u +# Tau_u = [0:0.01:1]; +# one = ones(size(Tau_u)); +# limit = 1e10; +# Min_u = -limit*one; +# Max_u = limit*one; +# Order_u = 0*one; + +# ## Constraints - y +# Tau_y = []; +# one = ones(size(Tau_y)); +# limit = 1e5; +# Min_y = -limit*one; +# Max_y = limit*one; +# Order_y = 0*one; + +# ## Simulation + +# ## Constrained - open-loop +# Gamma = []; +# gamma = []; +# for i=1:n_u # Put same constraints on each input +# [Gamma_i,gamma_i] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u,Order_u,i,n_u); +# Gamma = [Gamma; Gamma_i]; +# gamma = [gamma; gamma_i]; +# endfor + + +# disp("Open-loop simulations..."); +# ## Constrained OL simulation +# W = zeros(n_y,1); +# [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); +# T = [0:t(2)-t(1):t(length(t))]; +# [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); + +# title("Constrained y*"); +# xlabel("t"); +# grid; +# plot(T,ys) + +# ## Unconstrained OL simulation +# [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); +# [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); + +# title("Unconstrained y*"); +# xlabel("t"); +# grid; +# plot(T,ysu) + +# ## Non-linear - closed-loop +# disp("Closed-loop simulation"); +# Tc = [0:4e-4:1.0]; +# Delta_ol = 1.0; +# [yc,uc,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, T, Tau_u,Min_u,Max_u,Order_u, Tau_y,Min_y,Max_y,Order_y,W,x_0,Delta_ol); + +# title("y,y*,u and u*"); +# xlabel("t"); +# grid; +# plot(T1,y,T,ys,T1,u,T,us); + +endfunction + + + + + + + + ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppu_rep.make Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppu_rep.make ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppu_rep.make +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppu_rep.make @@ -0,0 +1,20 @@ +## Make file for the ppp output rep +## Symlinked to: +## pppy +## pppy0 +## pppu + +all: $(SYS)_pppy.ps $(SYS)_pppy0.ps $(SYS)_pppu.ps + +$(SYS)_pppy.ps: Make_figures.m ppp_1.m $(SYS)_sm.m $(SYS)_numpar.m + octave Make_figures.m +$(SYS)_pppy0.ps: $(SYS)_pppy.ps + touch $(SYS)_pppy0.ps +$(SYS)_pppu.ps: $(SYS)_pppy.ps + touch $(SYS)_pppu.ps + +$(SYS)_sm.m: + mtt $(SYS) sm m + +$(SYS)_numpar.m: + mtt $(SYS) numpar m ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy0_rep.make Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy0_rep.make ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy0_rep.make +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy0_rep.make @@ -0,0 +1,20 @@ +## Make file for the ppp output rep +## Symlinked to: +## pppy +## pppy0 +## pppu + +all: $(SYS)_pppy.ps $(SYS)_pppy0.ps $(SYS)_pppu.ps + +$(SYS)_pppy.ps: Make_figures.m ppp_1.m $(SYS)_sm.m $(SYS)_numpar.m + octave Make_figures.m +$(SYS)_pppy0.ps: $(SYS)_pppy.ps + touch $(SYS)_pppy0.ps +$(SYS)_pppu.ps: $(SYS)_pppy.ps + touch $(SYS)_pppu.ps + +$(SYS)_sm.m: + mtt $(SYS) sm m + +$(SYS)_numpar.m: + mtt $(SYS) numpar m ADDED mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy_rep.make Index: mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy_rep.make ================================================================== --- mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy_rep.make +++ mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy_rep.make @@ -0,0 +1,20 @@ +## Make file for the ppp output rep +## Symlinked to: +## pppy +## pppy0 +## pppu + +all: $(SYS)_pppy.ps $(SYS)_pppy0.ps $(SYS)_pppu.ps + +$(SYS)_pppy.ps: Make_figures.m ppp_1.m $(SYS)_sm.m $(SYS)_numpar.m + octave Make_figures.m +$(SYS)_pppy0.ps: $(SYS)_pppy.ps + touch $(SYS)_pppy0.ps +$(SYS)_pppu.ps: $(SYS)_pppy.ps + touch $(SYS)_pppu.ps + +$(SYS)_sm.m: + mtt $(SYS) sm m + +$(SYS)_numpar.m: + mtt $(SYS) numpar m ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_abg.fig @@ -0,0 +1,38 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4747 5175 6097 5175 5872 5400 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7447 5175 8797 5175 8572 5400 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2677 5175 4027 5175 3802 5400 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6772 3375 6772 4725 6997 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 6750 6750 5400 6975 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 8550 6750 7200 6975 7425 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 1575 6750 2925 6975 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9472 5175 10822 5175 10597 5400 +4 1 0 100 0 18 20 0.0000 4 225 405 6750 3240 AE\001 +4 1 0 100 0 18 20 0.0000 4 225 405 6750 7110 AE\001 +4 1 0 100 0 18 20 0.0000 4 225 405 4365 5265 AE\001 +4 1 4 100 0 18 20 0.0000 4 285 975 2115 5265 SS:[in]\001 +4 1 4 100 0 18 20 0.0000 4 285 1335 6795 1485 SS:[mod]\001 +4 1 4 100 0 18 20 0.0000 4 285 1500 6705 8820 SS:[smod]\001 +4 1 0 100 0 18 30 0.0000 4 330 660 6750 5265 R:r\001 +4 1 4 100 0 18 14 0.0000 4 210 270 5985 4995 [1]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 7560 4995 [2]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 6570 4590 [3]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 6570 5625 [4]\001 +4 1 0 100 0 18 20 0.0000 4 225 405 9135 5265 AE\001 +4 1 4 100 0 18 20 0.0000 4 285 1170 11475 5265 SS:[out]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_lbl.txt @@ -0,0 +1,44 @@ +%% Label file for system AE3 (AE3_lbl.txt) +%SUMMARY AE3 +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS mod mod +%ALIAS out out +%ALIAS smod smod + +% Argument aliases +%ALIAS $1 l + +% CR aliases +%ALIAS $1 slsin + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type R + r slsin -1*l + +% Component type SS + [in] SS external,external + [mod] SS external,external + [out] SS external,external + [smod] SS external,external + + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_abg.fig @@ -0,0 +1,38 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4747 5175 6097 5175 5872 5400 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7447 5175 8797 5175 8572 5400 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2677 5175 4027 5175 3802 5400 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6772 3375 6772 4725 6997 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 6750 6750 5400 6975 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 8550 6750 7200 6975 7425 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 1575 6750 2925 6975 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9472 5175 10822 5175 10597 5400 +4 1 0 100 0 18 20 0.0000 4 225 405 6750 3240 AE\001 +4 1 0 100 0 18 20 0.0000 4 225 405 6750 7110 AE\001 +4 1 4 100 0 18 20 0.0000 4 285 975 2115 5265 SS:[in]\001 +4 1 4 100 0 18 20 0.0000 4 285 1335 6795 1485 SS:[mod]\001 +4 1 4 100 0 18 20 0.0000 4 285 1500 6705 8820 SS:[smod]\001 +4 1 0 100 0 18 30 0.0000 4 330 660 6750 5265 R:r\001 +4 1 4 100 0 18 14 0.0000 4 210 270 5985 4995 [1]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 7560 4995 [2]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 6570 4590 [3]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 6570 5625 [4]\001 +4 1 0 100 0 18 20 0.0000 4 225 390 4365 5310 AF\001 +4 1 0 100 0 18 20 0.0000 4 225 390 9135 5265 AF\001 +4 1 4 100 0 18 20 0.0000 4 285 1170 11610 5265 SS:[out]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_lbl.txt @@ -0,0 +1,40 @@ +%% Label file for system AE3 (AE3_lbl.txt) +%SUMMARY AE3 +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS mod mod +%ALIAS out out +%ALIAS smod smod + +% Argument aliases +%ALIAS $1 l + +% CR aliases +%ALIAS $1 slsin + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type R + r slsin l + +% Component type SS + [in] SS external,external + [mod] SS external,external + [out] SS external,external + [smod] SS external,external ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_abg.fig @@ -0,0 +1,53 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3600 4275 4950 4275 4725 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 5400 3600 5400 3825 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4950 5175 4950 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3015 3150 4365 3150 4140 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4815 3150 6165 3150 5940 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4590 2925 4590 1575 4815 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4815 1575 4365 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4793 2934 6153 1574 6153 1893 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4387 2947 3027 1587 3346 1587 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7650 3150 9000 3150 8775 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3600 4050 3600 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5400 5400 6750 5400 6525 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6750 5175 6750 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5400 4275 6750 4275 6525 4500 +4 2 0 100 0 18 18 0.0000 4 270 2130 3510 4365 Sf:zero_velocity\001 +4 1 1 101 0 3 18 0.0000 4 255 1125 5310 4725 y-velocity\001 +4 1 1 101 0 3 18 0.0000 4 255 1155 5265 3735 x-velocity\001 +4 1 1 101 0 3 18 0.0000 4 255 1905 5175 5940 angular-velocity\001 +4 2 0 100 0 18 18 0.0000 4 270 720 3555 5490 R:r_p\001 +4 1 0 100 0 18 18 0.0000 4 195 150 4590 3240 1\001 +4 1 4 100 0 18 18 0.0000 4 270 765 6390 1440 SS:[x]\001 +4 1 0 100 0 18 18 0.0000 4 270 870 4635 1440 IS:m_c\001 +4 1 0 100 0 18 18 0.0000 4 270 690 2880 1440 R:r_c\001 +4 1 4 100 0 18 18 0.0000 4 270 1290 2250 3240 SS:[drive]\001 +4 0 0 100 0 18 18 0.0000 4 210 1560 9090 3240 De:Position\001 +4 1 0 100 0 18 18 0.0000 4 210 1035 6975 3240 INTFS:x\001 +4 1 0 100 0 18 18 0.0000 4 195 150 5175 5490 1\001 +4 1 4 100 0 18 18 0.0000 4 270 780 7245 5490 SS:[a]\001 +4 1 0 100 0 18 18 0.0000 4 195 150 5175 4365 1\001 +4 1 4 100 0 18 18 0.0000 4 270 765 7245 4365 SS:[y]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_lbl.txt @@ -0,0 +1,53 @@ +%% Label file for system Cart (Cart_lbl.txt) +%SUMMARY Cart +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in drive +%ALIAS pendulum|out x,y,a + +% Argument aliases +%ALIAS $1 m_c +%ALIAS $2 r_c +%ALIAS $3 r_p + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type IS + m_c lin flow,m_c;v_0 + +% Component type R + r_c lin flow,r_c + r_p lin flow,r_p + +% Component type INTFS + x none x_0 + +% Component type SS + [a] SS internal,0 + [drive] SS external,internal + [x] SS 0,internal + [y] SS 0,internal + +% Component type De + Position SS external + +% Component type Sf + zero_velocity SS 0 + + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_abg.fig @@ -0,0 +1,68 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3330 1305 3870 1395 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3375 1350 3825 1350 +-6 +6 7965 2475 8505 2565 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 8010 2520 8460 2520 +-6 +6 3330 2475 3420 3015 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3375 2520 3375 2970 +-6 +6 9810 2475 9900 3015 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 9855 2520 9855 2970 +-6 +6 7965 2430 8055 2970 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 8010 2475 8010 2925 +-6 +6 3735 2430 3825 2970 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3780 2475 3780 2925 +-6 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 4860 4730 4860 494 2293 494 2293 4730 4860 4730 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2036 2724 3371 2724 3063 2947 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3576 2501 3576 1342 3833 1609 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3782 2724 5116 2724 4808 2947 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3576 2947 3576 4106 3833 3839 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6656 2724 7991 2724 7683 2947 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8196 2947 8196 4106 8453 3839 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8453 2724 9788 2724 9480 2947 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9480 4730 9480 494 6913 494 6913 4730 9480 4730 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 12150 5175 45 5175 45 316 12150 316 12150 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8190 2501 8190 1341 8447 1609 +4 2 4 0 0 0 18 0.0000 4 240 1605 1980 2790 SS:[Electrical]\001 +4 1 -1 0 0 0 18 0.0000 4 195 135 3525 2858 1\001 +4 1 -1 0 0 0 18 0.0000 4 255 945 5938 2813 GY:k_m\001 +4 1 -1 0 0 0 18 0.0000 4 195 135 8196 2813 1\001 +4 1 -1 0 0 0 18 0.0000 4 255 630 3525 1252 IS:l_a\001 +4 1 -1 0 0 0 18 0.0000 4 255 600 3628 4463 R:r_a\001 +4 1 -1 0 0 0 18 0.0000 4 255 735 8248 4463 R:b_m\001 +4 1 1 1 0 0 18 0.0000 4 195 1065 3576 5043 Electrical\001 +4 1 1 1 0 0 18 0.0000 4 195 1290 8196 5043 Mechanical\001 +4 1 1 1 0 0 18 0.0000 4 195 600 10404 3170 Shaft\001 +4 1 1 1 0 0 18 0.0000 4 195 1155 1472 3170 Terminals\001 +4 0 4 0 0 0 18 0.0000 4 240 1830 9945 2835 SS:[Mechanical]\001 +4 1 -1 0 0 0 18 0.0000 4 255 585 8235 1215 I:j_m\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_lbl.txt @@ -0,0 +1,39 @@ +%SUMMARY DCS: DCS motor +%DESCRIPTION A special for the inverted pendulum system +%DESCRIPTION Derivative causality on the shaft +%DESCRIPTION No aliased parameters +%DESCRIPTION Built in causality - speeds things up +%DESCRIPTION Only the armature state and shaft resistance are variable + +%ALIAS in Electrical +%ALIAS out Mechanical + + +%% Label file for system DCS (DCS_lbl.txt) + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Motor gain +k_m lin flow,k_m + +% Electrical components +%Inductance +l_a lin flow,l_a;i_0 + +%Resistance +r_a lin flow,r_a + +% Mechanical components +%Inertia +j_m lin flow,j_m + +%Friction +b_m lin flow,b_m + +% Ports + [Electrical] SS external,external + [Mechanical] SS external,external ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_abg.fig @@ -0,0 +1,35 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3555 4005 3645 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3600 4050 3600 4500 +-6 +6 6255 4005 6345 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6300 4050 6300 4500 +-6 +2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 + 7650 4725 5850 4725 5850 3825 7650 3825 7650 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 4275 3600 4275 3375 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 4275 6300 4275 6075 4500 +2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 + 5175 4725 3375 4725 3375 3825 5175 3825 5175 4725 +2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 + 2610 4725 585 4725 585 3825 2610 3825 2610 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7425 4275 8775 4275 8550 4500 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 10125 4950 10125 2025 225 2025 225 4950 10125 4950 +4 1 0 100 0 18 20 0.0000 4 360 1815 1620 4410 OpenLoop\001 +4 1 0 100 0 18 20 0.0000 4 285 960 4320 4410 Drive\001 +4 1 0 100 0 18 20 0.0000 4 285 765 6795 4410 Cart\001 +4 1 0 100 0 18 20 0.0000 4 285 810 9225 4410 Zero\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_input.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_input.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_input.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_input.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (DriveCart_input.txt) +# Generated by MTT at Thu Aug 5 09:17:30 BST 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Set the inputs +#mttu(1) = 1.0*(t<1) -1.0*((t>=1)&&(t<2)); # u (DriveCart_F) +mttu(1) = 1; +mttu(2) = 0; +mttu(3) = 0; +mttu(4) = 0; + +# Set the switches ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_lbl.txt @@ -0,0 +1,30 @@ +%% Label file for system DriveCart (DriveCart_lbl.txt) +%SUMMARY DriveCart +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%VAR l_p #Pendulum length + +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + + + + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_numpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_numpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_numpar.txt @@ -0,0 +1,91 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (DriveCart_numpar.txt) +# Generated by MTT at Wed Aug 25 22:57:05 BST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +j_m = 3.87e-7; # Motor inertia +k_m = 0.00767; # Motor constant +r_a = 2.6; # Armature resistance +l_a = 0.18e-3; # Armature inductance + +k_g = 1/3.7; # Internal gear ratio +r = 0.635e-2; # Motor gear radius + +m_c = 0.455; # Cart mass + +b_m = 0.0; # Motor friction +r_c = 1.5; # Cart friction + +# l_p = 0.61; # Pendulum length +# m_p = 0.210; # Pendulum mass +# r_p = 0.0; # Pendulum friction + +# j_p = m_p*(l_p*l_p)/12; # Pendulum inertia about cm. + +# g = 9.81; # Gravity + + +## Sensitivity parameters +# m_cs = 0; # Cart mass +# b_ms = 0; # Motor friction +# r_cs = 0; # Cart friction +# r_ps = 0; # Pendulum friction + + +## Control parameters +k_1 = 1; +k_2 = 0; +k_3 = 0; + +## States +i_0 = 0; # Initial armature current +v_0 = 0; # Initial cart velocity +x_0 = 0; # Initial cart position + +# omega_0 = 0; # Initial pendulum velocity +# theta_0 = 0; # Initial pendulum angle + +## Control sensitivity parameters +# k_1s = 0; +# k_2s = 0; +# k_3s = 0; + +# ## Argument list +# if (mtt_n_parameters>1) +# r_cs= mtt_parameters(1); +# r_c = mtt_parameters(2); +# endif; + +# if (mtt_n_parameters>3) +# m_cs= mtt_parameters(3); +# m_c = mtt_parameters(4); +# endif; + +# if (mtt_n_parameters>5) +# k_1s= mtt_parameters(5); +# k_1 = mtt_parameters(6); +# endif; + +# if (mtt_n_parameters>7) +# k_2s= mtt_parameters(7); +# k_2 = mtt_parameters(8); +# endif; + +# if (mtt_n_parameters>9) +# k_3s= mtt_parameters(9); +# k_3 = mtt_parameters(10); +# endif; + + + + + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_rep.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_rep.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_rep.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_rep.txt @@ -0,0 +1,30 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system DriveCart (DriveCart_rep.txt) +## Generated by MTT on" Fri Oct 22 09:03:14 EST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:29:11 peterg +## To RCS +## +############################################################### + +mtt DriveCart abg tex # The system description +mtt DriveCart cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt DriveCart struc tex # The system structure +mtt DriveCart dae tex # The system dae +## mtt DriveCart ode tex # The system ode +## mtt DriveCart sspar tex # Steady-state parameters +## mtt DriveCart ss tex # Steady state +## mtt DriveCart dm tex # Descriptor matrices (of linearised system) +mtt DriveCart sm tex # State matrices (of linearised system) +## mtt DriveCart tf tex # Transfer function (of linearised system) +## mtt DriveCart lmfr ps # log modulus of frequency response (of linearised system) +mtt DriveCart simpar tex # Simulation parameters +mtt DriveCart numpar tex # Numerical simulation parameters +mtt DriveCart input tex # Simulation input +mtt DriveCart odeso ps # Simulation output ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_simpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_simpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_simpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system DriveCart (DriveCart_simpar.txt) +# Generated by MTT on Thu Aug 5 09:17:05 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 10.0; # Last time in simulation +DT = 0.1; # Print interval +STEPFACTOR = 1000; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_abg.fig @@ -0,0 +1,36 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 2475 3825 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 2700 3825 2700 3600 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5625 2700 6975 2700 6750 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 8325 2700 9675 2700 9450 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 10575 2700 11925 2700 11700 2925 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 14400 4725 14400 675 225 675 225 4725 14400 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6975 2475 6975 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 11925 2475 11925 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 9675 2475 9675 2925 +4 1 1 101 0 3 20 0.0000 4 255 1530 4590 3330 DC motor\001 +4 1 1 101 0 3 20 0.0000 4 330 2745 2205 3330 Power supply unit\001 +4 2 4 100 0 18 18 0.0000 4 270 1845 2430 2790 SS:[Electrical]\001 +4 1 0 100 0 18 18 0.0000 4 210 1470 4725 2790 DCS:motor\001 +4 1 0 100 0 18 18 0.0000 4 270 915 7695 2790 TF:k_g\001 +4 1 0 100 0 18 18 0.0000 4 210 540 10125 2790 TF:r\001 +4 0 4 100 0 18 18 0.0000 4 270 2115 12015 2790 SS:[Mechanical]\001 +4 1 1 101 0 3 20 0.0000 4 330 2010 7515 3330 Internal gear\001 +4 1 1 101 0 3 20 0.0000 4 330 1710 10080 3330 Motor gear\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_lbl.txt @@ -0,0 +1,34 @@ +%% Label file for system Drive (Drive_lbl.txt) +%SUMMARY Drive +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Electrical +%ALIAS out Mechanical + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type DC + motor + +% Component type SS + [Electrical] SS external,external + [Mechanical] SS external,external + +% Component type TF + k_g lin flow,k_g + r lin flow,r + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_abg.fig @@ -0,0 +1,27 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3376 3151 4276 3151 4051 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 2926 4501 2026 4726 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3151 5626 3151 5401 3376 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 10575 4950 45 4950 45 1350 10575 1350 10575 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1575 3150 2475 3150 2250 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6526 3150 7426 3150 7201 3375 +4 1 -1 0 0 0 20 0.0000 4 255 180 4501 3241 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 1110 4501 1891 CS:unit\001 +4 2 4 0 0 0 20 0.0000 4 315 1455 1530 3240 SS:[Flow]\001 +4 1 -1 0 0 0 20 0.0000 4 255 825 2925 3240 AF:af\001 +4 1 -1 0 0 0 20 0.0000 4 255 900 6075 3240 AE:ae\001 +4 0 4 0 0 0 20 0.0000 4 330 3045 7470 3240 SS:[Integrated_flow]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_lbl.txt @@ -0,0 +1,44 @@ +%% Label file for system INTFS (INTFS_lbl.txt) +%SUMMARY INTFS: flow integrator +%DESCRIPTION Port [in]: Flow to be integrated +%DESCRIPTION Port [out]: Effort = integral of flow on port [in] + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/07/16 07:35:10 peterg +% %% Aliased version +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Flow +%ALIAS out Integrated_flow + +% Argument aliases +%ALIAS $1 x_0 + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + + +% Component type CS + unit lin effort,1;x_0 + +% Component type AE + ae lin 1 + +% Component type AF + af lin 1 + +% Component type SS + [Flow] SS external,external + [Integrated_flow] SS external,external ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2340 3915 2610 4185 +4 1 0 100 0 18 20 0.0000 4 270 195 2475 4185 0\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 3825 2475 2475 2700 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 5625 2475 4275 2700 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4050 4050 4050 3825 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 3825 4050 4275 +4 1 0 100 0 18 20 0.0000 4 285 315 2475 2295 I:i\001 +4 0 0 100 0 18 20 0.0000 4 360 1035 4185 4185 Sf:f_0\001 +4 1 4 100 0 18 20 0.0000 4 360 1185 2475 6030 SS:[in]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_lbl.txt @@ -0,0 +1,36 @@ +%% Label file for system IS (IS_lbl.txt) +%SUMMARY IS I component with initial state + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in + +% Argument aliases +%ALIAS $1 flow,i +%ALIAS $2 f_0 + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type I + i lin flow,i + +% Component type SS + [in] SS external,external + +% Component type Sf + f_0 SS f_0 + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_abg.fig @@ -0,0 +1,37 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3555 4005 3645 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3600 4050 3600 4500 +-6 +6 6255 4005 6345 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6300 4050 6300 4500 +-6 +2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 + 7650 4725 5850 4725 5850 3825 7650 3825 7650 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 4275 3600 4275 3375 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 4275 6300 4275 6075 4500 +2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 + 5175 4725 3375 4725 3375 3825 5175 3825 5175 4725 +2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 + 2610 4725 585 4725 585 3825 2610 3825 2610 4725 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 9675 4950 9675 2025 225 2025 225 4950 9675 4950 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 3825 7705 2870 7705 3189 +2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 5 + 6952 3487 8347 2092 8527 2272 7177 3622 6997 3442 +4 1 0 100 0 18 20 0.0000 4 360 1815 1620 4410 OpenLoop\001 +4 1 0 100 0 18 20 0.0000 4 285 960 4320 4410 Drive\001 +4 1 0 100 0 18 20 0.0000 4 285 3255 7830 2835 InvertedPendulum\001 +4 1 0 100 0 18 20 0.0000 4 285 765 6795 4410 Cart\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_desc.tex Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_desc.tex ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_desc.tex +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_desc.tex @@ -0,0 +1,37 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system InvertedPendulumOnCart (InvertedPendulumOnCart_desc.tex) +% Generated by MTT on Thu Aug 5 10:38:16 BST 1999. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{InvertedPendulumOnCart} is + displayed in Figure \Ref{fig:InvertedPendulumOnCart_abg.ps} and its label + file is listed in Section \Ref{sec:InvertedPendulumOnCart_lbl}. + The subsystems are listed in Section \Ref{sec:InvertedPendulumOnCart_sub}. + +This is a one input, two output nonlinear system comprising an +inverted pendulum attached by a hinge to a cart constrained to move in +the horizontal direction. The input is the horizontal force acting on +the cart, and the two outputs are the horizontal position and the +pendulum angle respectively. + +The bond graph in Figure \Ref{InvertedPendulumOnCartPPP_abg} is augmented with the {\em +open-loop\/} controller comprising +\begin{itemize} +\item two effort source \textbf{Se} components ``u1'' and ``u2'' +\item two effort amplifier \textbf{AE} components ``ppp\_1'' and `ppp\_2'' +\end{itemize} + +This is a \emph{nonlinear} system and it is used to illustate +\emph{nonlinear} PPP control. Section +\Ref{sec:InvertedPendulumOnCartPPP_nppp.ps} shows the cart position +$x$ and the pendulum angle $\theta$ when the pendulum starts from the +initial condition of $\theta = \frac{\pi}{2}$ (ie the pendulum is +horizontal). + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_input.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_input.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_input.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_input.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (InvertedPendulumOnCartPPP_input.txt) +# Generated by MTT at Thu Aug 5 09:17:30 BST 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Set the inputs +#mttu(1) = 1.0*(t<1) -1.0*((t>=1)&&(t<2)); # u (InvertedPendulumOnCartPPP_F) +mttu(1) = 1; +mttu(2) = 0; +mttu(3) = 0; +mttu(4) = 0; + +# Set the switches ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_lbl.txt @@ -0,0 +1,30 @@ +%% Label file for system InvertedPendulumOnCartPPP (InvertedPendulumOnCartPPP_lbl.txt) +%SUMMARY InvertedPendulumOnCartPPP +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%VAR l_p #Pendulum length + +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + + + + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_nppp.m Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_nppp.m ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_nppp.m +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_nppp.m @@ -0,0 +1,141 @@ +## Figures.m +## Makes figures for the InvertedPendulumOnCart_PPP exasmple. +## $Log$ +## Revision 1.4 2000/08/17 12:34:58 peterg +## *** empty log message *** +## +## Revision 1.3 2000/08/11 16:01:27 peterg +## Fixed documentation error +## +## Revision 1.2 2000/05/21 06:39:40 peterg +## Parameterised _sm +## +## Revision 1.1 2000/05/20 11:30:41 peterg +## Initial revision +## +## Revision 1.2 2000/05/17 16:59:57 peterg +## Revised for Inverted pendulum - it works !!!! +## +## Revision 1.1 2000/05/17 14:07:53 peterg +## Initial revision +## +## Revision 1.1 2000/05/17 09:14:37 peterg +## Initial revision +## +system_name = "InvertedPendulumOnCartPPP"; + +## Uncomment the following the first time +## (Or do ./Make InvertedPendulumOnCartPPP in this directory) + +## MTT stuff for the system simulation +##system("Make InvertedPendulumOnCartPPP"); + +t_s=1.0*[0:0.1:10]; +u = [ones(4,length(t_s))]; +x_0 = InvertedPendulumOnCartPPP_state; +par = InvertedPendulumOnCartPPP_numpar; + +## Simulate the system +tick=time; +[y,x] = InvertedPendulumOnCartPPP_sim(x_0,u,t_s,par); +Elapsed = time-tick +plot(t_s,y, t_s,x); + +## Simulate the system to give just the final few points +t_s1 = 10*[9:0.1:10]; +tick=time; +[y,x] = InvertedPendulumOnCartPPP_sim(x_0,u,t_s1,par); +Elapsed = time-tick +plot(t_s1,y,t_s1,x); + +## Sensitivity system simulation parameters +x_0s = sInvertedPendulumOnCartPPP_state; +pars = sInvertedPendulumOnCartPPP_numpar; +sympars = sInvertedPendulumOnCartPPP_sympar; + +## Simulate the sensitivity system +sensitivities = [sympars.ppp_1s,sympars.ppp_2s,sympars.r_cs] +tick=time; +[y,ys] = sInvertedPendulumOnCartPPP_sim(x_0s,u,t_s,pars,sensitivities); +Elapsed = time-tick +plot(t_s,y,t_s,ys); + +### PPP parameters +A_w = [0;0]; +A_u = laguerre_matrix(4,20); # Specify basis functions: constant & + # exp(-5t) +tau = 0.5*[0.9:0.01:1]; # Optimisation interval +t_ol =0.5*[0:0.01:0.2]; # Open-loop interval +N = 20; # Number of open-loop intervals in simulation +w = [0;0]; # Setpoint + +## Linear system +## Linear system +[A,B,C,D] = InvertedPendulumOnCartPPP_sm(par); +Q = [1;1]; +ppp_lin_plot (A,B(:,1),C,D(:,1),A_u,A_w,tau,Q,w,x_0); +psfig("InvertedPendulumOnCartPPP_lin"); + +## Simulate non-linear PPP (on this nonlinear system) +extras.U_initial = "zero"; +extras.U_next = "continuation"; +extras.criterion = 1e-5; +extras.max_iterations = 10; +extras.v = 0; +extras.verbose = 0; + +# ## -- with no optimisation using linear PPP with continuation +# extras.U_initial = "linear"; +# extras.U_next = "continuation"; +# extras.criterion = 1e-5; +# extras.max_iterations = 0; +# [y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + +# ## -- with no optimisation using linear PPP at each step +# extras.U_initial = "linear"; +# extras.U_next = "linear"; +# extras.criterion = 1e-5; +# extras.max_iterations = 0; +# [y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + +## -- with optimisation using nonlinear PPP with continuation +extras.U_initial = "zero"; +extras.U_next = "continuation"; +extras.criterion = 1e-4; +extras.max_iterations = 100; +extras.v = 1e-3; +extras.verbose = 0; +[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + + +## Plots +title(""); + +## U, U_c and U_l +I = 1:N; +IU1 = [I' U(1,:)']; +IU1_c = [I' U_c(1,:)']; +IU1_l = [I' U_l(1,:)']; +gset grid; xlabel "Interval" +gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1" +psfig("InvertedPendulumOnCartPPP_U1"); + +IU2 = [I' U(2,:)']; +IU2_c = [I' U_c(2,:)']; +IU2_l = [I' U_l(2,:)']; +gset grid; xlabel "Interval " +gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2" +psfig("InvertedPendulumOnCartPPP_U2"); + +## y & u +gset grid; xlabel "Time (sec)" +tu = [t' u']; +gplot tu title "Output" +psfig("InvertedPendulumOnCartPPP_u"); + +gset grid; xlabel "Time (sec)" +ty_th = [t' y(1,:)'] ; +ty_x = [t' y(2,:)'] ; +gplot ty_th title "Theta",ty_x title "x" +psfig("InvertedPendulumOnCartPPP_nppp"); + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_numpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_numpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_numpar.txt @@ -0,0 +1,68 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (sInvertedPendulumOnCart_numpar.txt) +# Generated by MTT at Tue Apr 18 18:07:52 BST 2000 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Default parameters +b_m = 0.0; # sDCS +c = 0.0; # sC,sC,sCS,sCS +e_0 = 0.0; # sCS,sCS +e_s = 0.0; # Se,Se,Se,sSe,sSe,sSe +f_0 = 0.0; # sIS,sIS,sIS +f_s = 0.0; # Sf,Sf,Sf,sSf,sSf,sSf +g = 0.0; # AFe,AFe,sInvertedPendulum,sROD +i = 0.0; # sI,sI,sI,sI,sI,sI,sIS,sIS,sIS +i_0 = 0.0; # sDCS +j_m = 0.0; # sDCS,sROD +j_p = 0.0; # sInvertedPendulum +ppp_1 = 1.0; # sOpenLoop +ppp_2 = 0.0; # sOpenLoop +ppp_3 = 0.0; # sOpenLoop +ppp_4 = 0.0; # sOpenLoop +k_g = 0.0; # sDrive +k_m = 0.0; # sDCS +l_a = 0.0; # sDCS,sROD +l_b = 0.0; # sROD +l_p = 0.0; # sInvertedPendulum,sInvertedPendulumOnCart +m = 0.0; # sROD +m_c = 0.0; # sCart +m_p = 0.0; # sInvertedPendulum +m_t = 0.0; # sInvertedPendulum +omega_0 = 0.0; # sInvertedPendulum,sROD +r = 0.0; # sDrive,sR,sR +r_a = 0.0; # sDCS +r_c = 0.0; # sCart +r_p = 0.0; # sCart +theta_0 = 0.0; # sInvertedPendulum,sROD +v_0 = 0.0; # sCart +x_0 = 0.0; # sCart,sINTFS,sINTFS + + +## Pysical Parameters +j_m = 3.87e-7; # Motor inertia +k_m = 0.00767; # Motor constant +r_a = 2.6; # Armature resistance +l_a = 0.18e-3; # Armature inductance + +k_g = 1/3.7; # Internal gear ratio +r = 0.635e-2; # Motor gear radius + +m_c = 0.455; # Cart mass + +b_m = 0.0; # Motor friction +r_c = 1.5; # Cart friction + +l_p = 0.61; # Pendulum length +m_p = 0.210; # Pendulum mass +r_p = 0.0; # Pendulum friction + +j_p = m_p*(l_p*l_p)/12; # Pendulum inertia about cm. + +g = 9.81; # Gravity + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_rep.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_rep.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_rep.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_rep.txt @@ -0,0 +1,41 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system InvertedPendulumOnCartPPP (InvertedPendulumOnCartPPP_rep.txt) +## Generated by MTT on" Fri Oct 22 09:03:14 EST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:29:10 peterg +## To RCS +## +## Revision 1.3 2000/08/29 13:57:23 peterg +## Zapped some steps which prevent ppp from working ???? +## +## Revision 1.2 2000/05/20 17:45:38 peterg +## Tidied +## +## Revision 1.1 2000/05/20 17:43:40 peterg +## Initial revision +## +############################################################### + +mtt InvertedPendulumOnCartPPP abg tex # The system description +mtt InvertedPendulumOnCartPPP cbg ps # The causal bond graph +mtt InvertedPendulumOnCartPPP struc tex # The system structure +mtt InvertedPendulumOnCartPPP dae tex # The system dae +# mtt InvertedPendulumOnCartPPP sm tex # State matrices (of linearised system) + +# mtt InvertedPendulumOnCartPPP simpar tex # Simulation parameters +# mtt InvertedPendulumOnCartPPP numpar tex # Numerical simulation parameters +# mtt InvertedPendulumOnCartPPP input tex # Simulation input +# mtt InvertedPendulumOnCartPPP odeso ps # Simulation output + +mtt InvertedPendulumOnCartPPP nppp m # How its done +mtt InvertedPendulumOnCartPPP nppp ps # The PPP output + +mtt InvertedPendulumOnCartPPP rep txt # The report outline + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_simpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_simpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_simpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system InvertedPendulumOnCartPPP (InvertedPendulumOnCartPPP_simpar.txt) +# Generated by MTT on Thu Aug 5 09:17:05 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 10.0; # Last time in simulation +DT = 0.1; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_state.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_state.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_state.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_state.txt @@ -0,0 +1,16 @@ +# -*-octave-*- Put Emacs into octave-mode +# Initial state file (InvertedPendulumOnCartPPP_state.txt) +# Generated by MTT at Thu May 4 16:13:13 BST 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Set the states +mttx(1) = 0.0; # i (InvertedPendulumOnCartPPP_mtt2_motor_l_a) +mttx(2) = 0.0; # i (InvertedPendulumOnCartPPP_mtt3_rod_J) +mttx(3) = -pi/2; # c (InvertedPendulumOnCartPPP_mtt3_rod_th_unit) +mttx(4) = 0.0; # i (InvertedPendulumOnCartPPP_mtt4_m_c) +mttx(5) = 0.0; # c (InvertedPendulumOnCartPPP_mtt4_x_unit) ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_abg.fig @@ -0,0 +1,91 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3555 5085 6345 5310 +4 1 4 100 0 18 14 0.0000 4 210 510 3825 5265 [x_b]\001 +4 1 4 100 0 18 14 0.0000 4 210 525 4950 5265 [y_b]\001 +4 1 4 100 0 18 14 0.0000 4 210 525 6075 5265 [a_b]\001 +-6 +6 3555 4545 6345 4770 +4 1 4 100 0 18 14 0.0000 4 210 495 3825 4725 [x_a]\001 +4 1 4 100 0 18 14 0.0000 4 210 510 4950 4725 [y_a]\001 +4 1 4 100 0 18 14 0.0000 4 210 510 6075 4725 [a_a]\001 +-6 +6 5805 5355 6345 5445 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5850 5400 6300 5400 +-6 +6 3600 4455 4140 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3645 4500 4095 4500 +-6 +6 4635 4455 5175 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4680 4500 5130 4500 +-6 +6 5805 4455 6345 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5850 4500 6300 4500 +-6 +6 8505 4680 8595 5220 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 8550 4725 8550 5175 +-6 +6 4770 2790 5040 3060 +4 1 0 100 0 18 20 0.0000 4 270 195 4905 3060 1\001 +-6 +6 3690 2790 3960 3060 +4 1 0 100 0 18 20 0.0000 4 270 195 3825 3060 1\001 +-6 +6 3555 2655 4095 2745 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3600 2700 4050 2700 +-6 +6 4680 2655 5220 2745 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 2700 5175 2700 +-6 +6 4950 2520 5355 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5008 2552 5327 2870 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6525 4950 8550 4950 8325 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 2700 4950 1350 5175 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 2700 3825 1350 4050 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5143 2687 6098 1732 6098 2050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3600 6750 4050 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4725 6750 5175 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 6750 3825 5400 4050 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 6750 4950 5400 5175 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 6750 6075 5400 6300 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 4500 6075 3150 6300 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 4500 4950 3150 5175 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 4500 3825 3150 4050 3375 +4 1 0 100 0 18 20 0.0000 4 285 1515 4964 5040 ROD:rod\001 +4 1 0 100 0 18 18 0.0000 4 270 885 6030 3015 Se:a_0\001 +4 1 4 100 0 18 20 0.0000 4 360 1050 3780 7155 SS:[x]\001 +4 1 4 100 0 18 20 0.0000 4 360 1080 4950 7155 SS:[y]\001 +4 1 4 100 0 18 20 0.0000 4 360 1065 6075 7155 SS:[a]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 6300 4995 [a]\001 +4 0 0 100 0 18 20 0.0000 4 285 1515 8685 5085 De:theta\001 +4 1 0 100 0 18 18 0.0000 4 270 675 4995 1170 I:m_y\001 +4 1 0 100 0 18 18 0.0000 4 270 675 3870 1170 I:m_x\001 +4 0 0 100 0 18 20 0.0000 4 360 1110 6120 1800 Se:mg\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_lbl.txt @@ -0,0 +1,47 @@ +%% Label file for system InvertedPendulum (InvertedPendulum_lbl.txt) +%SUMMARY InvertedPendulum +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in x,y,a + + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + + +% Component type I + m_x lin flow,m_t + m_y lin flow,m_t + +% Component type Se + mg SS m_t*g + +% Component type De + theta SS external + +% Component type SS + [a] SS external,external + [x] SS external,external + [y] SS external,external + +% Component type Se + a_0 SS 0 + +% Component type gRod + rod none l_p;l_p;j_p;m_p;g;omega_0;theta_0 + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Make Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Make ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Make +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Make @@ -0,0 +1,30 @@ +#!/bin/sh + +## Makes the files needed for Figures.m +## Copyright (C) 2000 by Peter J. Gawthrop + +if [ -z "$1" ]; then + echo Usage ./Make system_name + exit +else + echo "Making simulation for system $1 (for use in Figures.m)" +fi + +## System +mtt -q -c -stdin $1 ode2odes out +mtt -q -c -stdin $1 sim m +mtt -q $1 state m +mtt -q $1 sympar m +mtt -q $1 numpar m + +## Sensitivity system +mtt -q -c -stdin -s s$1 ode2odes out +mtt -q -c -stdin -s s$1 sim m +mtt -q -s s$1 state m +mtt -q -s s$1 sympar m +mtt -q -s s$1 numpar m + +## Additional system reps for PPP +mtt -q $1 sm m +mtt -q $1 def m +mtt -q -s s$1 def m ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_abg.fig @@ -0,0 +1,72 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 6570 1530 7200 1935 +4 1 1 101 0 3 20 0.0000 4 270 495 6885 1845 u ( )\001 +4 1 1 101 0 0 20 0.0000 4 135 150 6840 1800 *\001 +4 1 1 101 0 32 20 0.0000 4 150 135 7065 1845 t\001 +-6 +6 1800 1530 2520 2025 +4 1 1 101 0 3 20 0.0000 4 270 555 2160 1845 U ( )\001 +4 1 1 101 0 3 16 0.0000 4 165 120 2070 2025 1\001 +4 1 1 101 0 0 20 0.0000 4 135 150 2115 1800 *\001 +4 1 1 101 0 32 20 0.0000 4 150 135 2340 1845 t\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6345 2250 7695 2250 7470 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 2250 5850 2250 5625 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1575 5400 2925 5400 2700 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4545 5400 5895 5400 5670 5625 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 5175 6075 4050 6300 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1575 3825 2925 3825 2700 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4545 3825 5895 3825 5670 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 3600 6075 2475 6300 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1575 6975 2925 6975 2700 7200 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4545 6975 5895 6975 5670 7200 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 6750 6075 5625 6300 5850 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1575 2250 2925 2250 2700 2475 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 9000 7875 9000 1125 225 1125 225 7875 9000 7875 +4 2 0 100 0 18 20 0.0000 4 300 1170 1485 2340 Se:Us_1\001 +4 1 0 100 0 18 20 0.0000 4 300 1035 3735 2340 AE:U_1\001 +4 1 0 100 0 18 20 0.0000 4 210 165 6075 2340 1\001 +4 1 0 100 0 18 20 0.0000 4 300 1035 3735 5490 AE:U_3\001 +4 2 0 100 0 18 20 0.0000 4 300 1170 1530 5535 Se:Us_3\001 +4 1 0 100 0 18 20 0.0000 4 210 165 6075 5535 1\001 +4 1 0 100 0 18 20 0.0000 4 300 1035 3735 3915 AE:U_2\001 +4 2 0 100 0 18 20 0.0000 4 300 1170 1530 3960 Se:Us_2\001 +4 1 0 100 0 18 20 0.0000 4 210 165 6075 3960 1\001 +4 1 0 100 0 18 20 0.0000 4 300 1035 3735 7065 AE:U_4\001 +4 2 0 100 0 18 20 0.0000 4 300 1170 1530 7110 Se:Us_4\001 +4 1 0 100 0 18 20 0.0000 4 210 165 6075 7110 1\001 +4 1 1 101 0 3 20 0.0000 4 270 555 2160 3420 U ( )\001 +4 1 1 101 0 3 16 0.0000 4 165 120 2070 3600 2\001 +4 1 1 101 0 0 20 0.0000 4 135 150 2115 3375 *\001 +4 1 1 101 0 32 20 0.0000 4 150 135 2340 3420 t\001 +4 1 1 101 0 3 20 0.0000 4 270 555 2160 4995 U ( )\001 +4 1 1 101 0 3 16 0.0000 4 165 120 2070 5175 3\001 +4 1 1 101 0 0 20 0.0000 4 135 150 2115 4950 *\001 +4 1 1 101 0 32 20 0.0000 4 150 135 2340 4995 t\001 +4 1 1 101 0 3 20 0.0000 4 270 555 2160 6570 U ( )\001 +4 1 1 101 0 3 16 0.0000 4 165 120 2070 6750 4\001 +4 1 1 101 0 0 20 0.0000 4 135 150 2115 6525 *\001 +4 1 1 101 0 32 20 0.0000 4 150 135 2340 6570 t\001 +4 0 4 100 0 18 20 0.0000 4 300 1005 7830 2340 SS:[us]\001 +4 1 1 101 0 3 20 0.0000 4 285 2370 3825 7695 Open-loop control\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_lbl.txt @@ -0,0 +1,40 @@ +%% Label file for system OpenLoop (OpenLoop_lbl.txt) +%SUMMARY OpenLoop +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS out us + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AE + U_1 lin ppp_1 + U_2 lin ppp_2 + U_3 lin ppp_3 + U_4 lin ppp_4 + +% Component type SS + [us] SS external,external + +% Component type Se + Us_1 SS external + Us_2 SS external + Us_3 SS external + Us_4 SS external + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_abg.fig @@ -0,0 +1,127 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4951 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8550 5400 9225 6075 8955 6075 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8685 5265 8415 5535 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 5175 2025 3825 2250 3825 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8550 4950 8550 5400 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 4950 2700 5400 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 6525 3150 7650 3150 7425 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5425 5419 4750 6094 4750 5869 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4273 3823 3148 2698 3373 2698 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 4950 4725 4275 4950 4275 +4 1 -1 0 0 0 20 0.0000 4 255 180 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 570 6933 5268 IS:J\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000 4 330 870 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000 4 330 900 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 1440 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000 4 255 1440 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000 4 255 1425 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000 4 255 1425 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000 4 255 180 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000 4 240 675 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000 4 255 1425 4681 5266 INTFS:th\001 +4 1 1 1 0 0 20 0.0000 4 255 270 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000 4 195 240 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000 4 255 240 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000 4 240 675 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 240 675 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000 4 240 675 3960 6210 [mod]\001 +4 1 4 0 0 0 20 0.0000 4 330 1785 2971 1216 SS:[xTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 330 1800 2971 9361 SS:[xTip_b]\001 +4 1 4 0 0 0 20 0.0000 4 330 1755 8372 1217 SS:[yTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 330 1770 8417 9362 SS:[yTip_b]\001 +4 1 4 0 0 0 20 0.0000 4 330 2700 5671 1216 SS:[angularTip_a]\001 +4 1 4 0 0 0 20 0.0000 4 330 2715 5671 9361 SS:[angularTip_b]\001 +4 1 1 1 0 0 20 0.0000 4 330 765 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000 4 255 1800 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000 4 330 780 1350 9855 Tip b\001 +4 1 -1 0 0 0 20 0.0000 4 330 930 9360 6345 Se:mg\001 +4 2 4 0 0 0 20 0.0000 4 330 1515 1935 3735 SS:[angle]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_lbl.txt @@ -0,0 +1,101 @@ +%SUMMARY ROD: rigid rod in two dimensions - with gravity and angle port +%DESCRIPTION See Section 10.2 of "Metamodelling" +%DESCRIPTION Gravity term added at centre + +%ALIAS $1 l_a # length from end a to mass centre +%ALIAS $2 l_b # length from end b to mass centre +%ALIAS $3 j_m # inertia about mass centre +%ALIAS $4 m # mass +%ALIAS $5 g # gravity + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a +%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b + +%ALIAS x_a xTip_a # Force/velocity at tip a in x direction +%ALIAS y_a yTip_a # Force/velocity at tip a in y direction +%ALIAS alpha_a|a_a angularTip_a # Torque/angular velocity at tip a + +%ALIAS x_b xTip_b # Force/velocity at tip b in x direction +%ALIAS y_b yTip_b # Force/velocity at tip b in y direction +%ALIAS alpha_b|a_b angularTip_b # Torque/angular velocity at tip b + +%ALIAS angle|a angle # Angle port + +%ALIAS INTF General/INTF # The flow integration component. + +%% Label file for system ROD (ROD_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/10/22 02:01:45 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1999/08/05 08:04:40 peterg +% %% Initial revision +% %% +% %% Revision 1.3 1998/11/30 10:47:53 peterg +% %% Added extra a_a and a_b aliases +% %% +% %% Revision 1.2 1998/11/25 13:55:42 peterg +% %% Added missig attribute field m*g,internal +% %% +% %% Revision 1.1 1998/11/25 10:48:34 peterg +% %% Initial revision +% %% +% %% Revision 1.5 1998/07/27 12:27:27 peterg +% %% Added vector port aliases +% %% +% %% Revision 1.4 1998/07/27 10:51:20 peterg +% %% Aliased INTF as well. +% %% +% %% Revision 1.3 1998/07/27 10:49:10 peterg +% %% Major revision to include aliases etc +% %% +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,j_m;omega_0 +m_x lin flow,m +m_y lin flow,m + +%Integrate angular velocity to get angle +th none theta_0 + +%Modulated transformers +s1 lsin flow,l_a +s2 lsin flow,l_b +c1 lcos flow,l_a +c2 lcos flow,l_b + + +% Component type Se + mg SS m*g + +% Component type SS + [angularTip_a] SS external,external + [angularTip_b] SS external,external + [xTip_a] SS external,external + [xTip_b] SS external,external + [yTip_a] SS external,external + [yTip_b] SS external,external + [angle] SS external,external + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_abg.fig @@ -0,0 +1,21 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 2700 4050 2700 3825 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 3375 4050 3375 3825 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4050 4050 4050 3825 4275 +4 1 4 100 0 18 18 0.0000 4 270 765 2160 2790 SS:[x]\001 +4 1 0 100 0 18 18 0.0000 4 210 570 4545 2790 Se:x\001 +4 1 4 100 0 18 18 0.0000 4 270 765 2160 3465 SS:[y]\001 +4 1 0 100 0 18 18 0.0000 4 270 570 4545 3465 Se:y\001 +4 1 4 100 0 18 18 0.0000 4 270 780 2160 4140 SS:[a]\001 +4 1 0 100 0 18 18 0.0000 4 210 525 4545 4140 Sf:a\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_lbl.txt @@ -0,0 +1,33 @@ +%% Label file for system Zero (Zero_lbl.txt) +%SUMMARY Zero +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in x,y,a + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + [a] SS external,external + [x] SS external,external + [y] SS external,external + +% Component type Se + x SS 0 + y SS 0 + +% Component type Sf + a SS external + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sCart_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sCart_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sCart_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sCart_lbl.txt @@ -0,0 +1,59 @@ +%% Label file for system sCart (sCart_lbl.txt) +%SUMMARY sCart +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in drive_1,drive_2 +%ALIAS pendulum|out x_1,x_2,y_1,y_2,a_1,a_2 + +% Argument aliases +%ALIAS $1 m_c +%ALIAS $2 r_c +%ALIAS $3 r_p + +%ALIAS $4 m_cs +%ALIAS $5 r_cs +%ALIAS $6 r_ps + +%ALIAS $7 v_0 +%ALIAS $8 v_0s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type I + m_c lin flow,m_c;v_0;m_cs;v_0s + +% Component type R + r_c lin flow,r_c;r_cs + r_p lin flow,r_p;r_ps + +% Component type sINTFS + x none x_0;x_0s + +% Component type SS + [a] SS external,external + [drive] SS external,external + [x] SS external,external + [y] SS external,external + +% Component type De + Position SS external;external + +% Component type Sf + zero_velocity SS 0;0 + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDCS_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDCS_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDCS_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDCS_lbl.txt @@ -0,0 +1,39 @@ +%SUMMARY sDCS: DC motor - sensitivity +%DESCRIPTION A special for the inverted pendulum system +%DESCRIPTION Derivative causality on the shaft +%DESCRIPTION No aliased parameters +%DESCRIPTION Built in causality - speeds things up +%DESCRIPTION Only the armature state and shaft resistance are variable + +%ALIAS in Electrical_1,Electrical_2 +%ALIAS out Mechanical_1,Mechanical_2 + + +%% Label file for system sDCS (sDCS_lbl.txt) + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Motor gain +k_m lin flow,k_m;0 + +% Electrical components +%Inductance +l_a lin flow,l_a;i_0;0;i_0s + +%Resistance +r_a lin flow,r_a;0 + +% Mechanical components +%Inertia +j_m lin flow,j_m;0 + +%Friction +b_m lin flow,b_m;b_ms + +% Ports + [Electrical] SS external,external + [Mechanical] SS external,external ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_identify.m Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_identify.m ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_identify.m +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_identify.m @@ -0,0 +1,109 @@ +function sDriveCart_identify () + + ## usage: sDriveCart_identify () + ## + ## + + ## Identify the Drive/cart friction + ## $Id$ + + system_name = "sDriveCart"; # Name of this system + input_name = sprintf("%s_input.dat", system_name); + ## disp("Create programs"); + ## system(sprintf("mtt -q -c -s -stdin %s ode2odes out", system_name)); # Create sim. code + ## system(sprintf("mtt -q -c -s -stdin %s numpar m", system_name)); # Create sim. code + ## system(sprintf("mtt -q -c -s -stdin %s def m", system_name)); # Create sim. code + + ## Optimisation parameters + crite = 1e-5; # Convergence criterion + alpha = 0.5; # Step reduction factor + max = 30; # Maximum iterations + View = 1 # View the optimisation process + + ## Parameters + global mtt_n_parameters + mtt_n_parameters = 0; + + eval(sprintf("%s_numpar;", system_name)); + + alpha = 0.75; + criterion = 1e-9; + max_iterations = 20; + + ## Real data + disp("Loading data"); + load -force data_020999.dat; + [N_data,M_data] = size(data_020999); + M = 10; + t = data_020999(1:M:N_data,1); + u = data_020999(1:M:N_data,2); + y = data_020999(1:M:N_data,3)/100; # convert from cm to m + + gset grid + gset title "" + gset xlabel "Time (sec)" + tu = [t u]; + ty = [t y]; + gplot tu title "input (V)", ty title "output (m)" + psfig("sDriveCart_yu"); + + + y_s = [u y]; # u is first o/p of system. + ## Start time at zero + t = t-t(1)*ones(size(t)); + + T_last = 40; + DT = t(2)-t(1); + + tu = [t u u u u]; # Put same signal on all inputs (only + # first used + save -ascii junk.dat tu + ## zap the octave comments + system(sprintf("grep -v \'#\' junk.dat > %s; rm -f junk.dat", input_name)); + + ## Set up theta + control = [1 0 0 0]; # Initial control parameters + unused = 0; # Unused parameter slot + r_c = 0; + parameters = [r_c m_c unused unused unused]; + i_r = 4+1; + i_m = 4+2; + state = [0 unused unused 0 0]; + i_v = 4+5+4; + i_x = 4+5+5; + i_i = 4+5+1; + theta_0 = [control parameters state]'; + + ## Weighting function - select output, not input + weight = ones(size(t))*[0 1]; + + ## Estimate r only + free = [i_r i_i i_v i_x]; + disp("Estimate cart friction ..."); + [theta,Theta,Error,Y] = mtt_optimise(system_name,y_s,theta_0,"time",\ + free,weight,crite,max,alpha,View); + + ## Plot results +# ix = [its Theta(i_x,:)']; +# iv = [its Theta(i_v,:)']; +# ii = [its Theta(i_i,:)']; + +# gplot \ +# ix with linespoints title "x_0",\ +# iv with linespoints title "p_0",\ +# ii with linespoints title "i_0" + +# psfig("sDriveCart_ident_x"); + + [N_th,M_th] = size(Theta); + its = [0:M_th-1]'; + gset grid + gset title "" + gset xlabel "Iterations" + ir = [its Theta(i_r,:)']; + gplot ir with linespoints title "r" + psfig("sDriveCart_ident_r"); + + r_c = theta(i_r) + +endfunction ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_numpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_numpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_numpar.txt @@ -0,0 +1,200 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (sInvertedPendulumOnCart_numpar.txt) +# Generated by MTT at Wed Aug 25 22:57:05 BST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 1999/12/03 00:50:28 peterg +# %% Initial revision +# %% +# %% Revision 1.1 1999/11/12 06:47:50 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Same as sInvertedpendulumOnCart with pendulum stuff removed. + +# Parameters +j_m = 3.87e-7; # Motor inertia +k_m = 0.00767; # Motor constant +r_a = 2.6; # Armature resistance +l_a = 0.18e-3; # Armature inductance + +k_g = 1/3.7; # Internal gear ratio +r = 0.635e-2; # Motor gear radius + +m_c = 0.455; # Cart mass + +b_m = 0.0; # Motor friction +r_c = 5.0; # Cart friction + +# l_p = 0.61; # Pendulum length +# m_p = 0.210; # Pendulum mass +# r_p = 0.0; # Pendulum friction +# j_p = m_p*(l_p*l_p)/12; # Pendulum inertia about cm. + +# g = +9.81; # Gravity + +# m_t = 0.0; # Tip mass + +## Sensitivity parameters +m_cs = 0; # Cart mass +b_ms = 0; # Motor friction +r_cs = 0; # Cart friction + +# j_ps = 0; # Pendulum inertia +# m_ps = 0; # Pendulum mass +# r_ps = 0; # Pendulum friction + +# m_ts = 0; # Tip mass + +## Initial states +i_0 = 0; # Initial armature current +# omega_0 = 0; # Initial pendulum velocity +# theta_0 = 0; # Initial pendulum angle +v_0 = 0; # Initial cart velocity +x_0 = 0; # Initial cart position + +## Sensitivity parameters +i_0s = 0; # Initial armature current +# omega_0s = 0; # Initial pendulum velocity +# theta_0s = 0; # Initial pendulum angle +v_0s = 0; # Initial cart velocity +x_0s = 0; # Initial cart position + +## Control parameters +k_1 = 1; +k_2 = 0; +k_3 = 0; +k_4 = 0; + +## Control sensitivity parameters +k_1s = 0; +k_2s = 0; +k_3s = 0; +k_4s = 0; + + +## Which sensitivity function? NB all other sens. coeffs MUST be zero - +## see above +if (mtt_n_parameters>=1) + mtti = mtt_parameters(1); + + if mtti==1 + k_1s = 1; + endif + + if mtti==2 + k_2s = 1; + endif + + if mtti==3 + k_3s = 1; + endif + + if mtti==4 + k_4s = 1; + endif + + if mtti==5 + r_cs = 1; + endif + + if mtti==6 + m_cs = 1; + endif + +# if mtti==7 +# r_ps = 1; +# endif + +# if mtti==8 +# m_ts = 1; +# endif + +# if mtti==9 +# j_ps = 1; +# endif + + if mtti==10 + i_0s = 1; # Initial armature current + endif + +# if mtti==11 +# omega_0s = 1; # Initial pendulum velocity +# endif + +# if mtti==12 +# theta_0s = 1; # Initial pendulum position +# endif + + if mtti==13 + v_0s = 1; # Initial cart velocity + endif + + if mtti==14 + x_0s = 1; # Initial cart angle + endif + +endif; + +## Control parameters + +if (mtt_n_parameters>=2) + k_1 = mtt_parameters(2); +endif; + +if (mtt_n_parameters>=3) + k_2 = mtt_parameters(3); +endif; + +if (mtt_n_parameters>=4) + k_3 = mtt_parameters(4); +endif; + +if (mtt_n_parameters>=5) + k_4 = mtt_parameters(5); +endif; + +## Physical parameters +if (mtt_n_parameters>=6) + r_c = mtt_parameters(6); +endif; + +if (mtt_n_parameters>=7) + m_c = mtt_parameters(7); +endif; + +# if (mtt_n_parameters>=8) +# r_p = mtt_parameters(8); +# endif; + +# if (mtt_n_parameters>=9) +# m_t = mtt_parameters(9); +# endif; + +# if (mtt_n_parameters>=10) +# j_p = mtt_parameters(10); +# endif; + +## Initial condition parameters - states are read in +if (mtt_n_parameters>=15) # + i_0 = mtt_parameters(11); # Initial armature current +# omega_0 = mtt_parameters(12); # Initial cart velocity +# theta_0 = mtt_parameters(13); # Initial cart position + v_0 = mtt_parameters(14); # Initial pendulum velocity + x_0 = mtt_parameters(15); # Initial pendulum angle +endif; + +## Simulation stuff + +if (mtt_n_parameters>=16) + LAST = mtt_parameters(16); +endif; +if (mtt_n_parameters>=17) + DT = mtt_parameters(17); +endif; + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_simpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_simpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_simpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_simpar.txt @@ -0,0 +1,19 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system sDriveCart (sDriveCart_simpar.txt) +# Generated by MTT on Fri Dec 3 10:30:48 EST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 40.0; # Last time in simulation +DT = 0.1; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDrive_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDrive_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDrive_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDrive_lbl.txt @@ -0,0 +1,36 @@ +%% Label file for system sDrive (sDrive_lbl.txt) +%SUMMARY sDrive +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Electrical_1,Electrical_2 +%ALIAS out Mechanical_1,Mechanical_2 + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type sDCS + motor + +% Component type SS + [Electrical] SS external,external + [Mechanical] SS external,external + +% Component type sTF + k_g lin flow,k_g;0 + r lin flow,r;0 + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_abg.fig @@ -0,0 +1,103 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2205 3555 2295 4095 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2250 3600 2250 4050 +-6 +6 2205 3555 2295 4095 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2250 3600 2250 4050 +-6 +6 2205 7155 2295 7695 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2250 7200 2250 7650 +-6 +6 3510 4005 4050 4095 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4005 4050 3555 4050 +-6 +6 3645 5850 4185 5940 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4140 5895 3690 5895 +-6 +6 8730 5355 9270 5445 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 9225 5400 8775 5400 +-6 +6 3600 7155 4140 7245 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4095 7200 3645 7200 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 7425 3600 7425 3375 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 7425 5400 7425 5175 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7425 7425 8775 7425 8550 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9225 7425 10575 7425 10350 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 3825 3600 3825 3375 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 3825 5400 3825 5175 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7425 3825 8775 3825 8550 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9225 3825 10575 3825 10350 4050 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 5895 9000 7200 9000 6975 +2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9006 5873 3831 7178 3831 6953 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 450 6300 1800 6525 1575 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 2250 6300 3600 6525 3375 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6075 1800 6525 1800 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 + 6075 2025 4275 2025 4275 5400 4500 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 4050 3825 5400 4050 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 9000 4050 9000 5400 9225 5175 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6525 2250 6525 7200 6750 6975 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 + 6525 2025 8550 2025 8550 5400 8775 5175 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 + 6525 8550 9225 8550 9225 5850 9450 6075 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 + 6075 8550 3600 8550 3600 5850 3375 6075 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 10125 6300 8775 6525 9000 +2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6075 8775 6525 8775 +4 1 4 100 0 18 20 0.0000 4 285 2415 6210 360 SS:[Actual_mod]\001 +4 1 5 100 0 18 20 0.0000 4 210 165 6300 2115 0\001 +4 1 4 100 0 18 20 0.0000 4 285 1845 1215 7515 SS:[Sens_in]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 3825 7515 1\001 +4 1 0 100 0 18 20 0.0000 4 225 1590 6435 7515 EMTF:sens\001 +4 1 0 100 0 18 20 0.0000 4 210 165 9000 7515 0\001 +4 1 4 100 0 18 20 0.0000 4 285 2040 11790 7515 SS:[Sens_out]\001 +4 1 4 100 0 18 20 0.0000 4 285 2055 1215 3915 SS:[Actual_in]\001 +4 1 0 100 0 18 20 0.0000 4 210 165 3825 3915 1\001 +4 1 0 100 0 18 20 0.0000 4 225 1785 6435 3915 EMTF:actual\001 +4 1 0 100 0 18 20 0.0000 4 210 165 9000 3915 0\001 +4 1 4 100 0 18 20 0.0000 4 285 2250 11790 3915 SS:[Actual_out]\001 +4 1 0 100 0 18 20 0.0000 4 225 1170 8955 5715 AE3:ae3\001 +4 1 0 100 0 18 20 0.0000 4 225 1095 3825 5715 AF3:af3\001 +4 2 4 100 0 18 14 0.0000 4 210 600 6255 3600 [mod]\001 +4 2 4 100 0 18 14 0.0000 4 210 600 6435 7155 [mod]\001 +4 1 4 100 0 18 20 0.0000 4 285 2205 6300 10395 SS:[Sens_mod]\001 +4 1 5 100 0 18 20 0.0000 4 210 165 6345 8640 0\001 +4 2 4 100 0 18 14 0.0000 4 210 720 3420 5985 [smod]\001 +4 0 4 100 0 18 14 0.0000 4 210 720 9540 5940 [smod]\001 +4 2 4 100 0 18 14 0.0000 4 210 600 8505 5355 [mod]\001 +4 0 4 100 0 18 14 0.0000 4 210 600 4455 5400 [mod]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_lbl.txt @@ -0,0 +1,52 @@ +%% Label file for system sEMTF (sEMTF_lbl.txt) +%SUMMARY sEMTF Effort modulated TF - sensitivity version +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Actual_in,Sens_in +%ALIAS out Actual_out,Sens_out +%ALIAS mod Actual_mod,Sens_mod + + +% Argument aliases +%ALIAS $1 l + +% CR aliases +%ALIAS $1 lsin +%ALIAS $2 slsin + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type EMTF + actual lsin flow,l + sens lsin flow,l + +% Component type AE3 (????NB NEGATIVE GAIN HERE!!!!) + ae3 slsin l + +% Component type AF3 + af3 slsin l + +% Component type SS + [Actual_in] SS external,external + [Actual_out] SS external,external + [Actual_mod] SS external,internal + [Sens_in] SS external,external + [Sens_out] SS external,external + [Sens_mod] SS external,internal + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_abg.fig @@ -0,0 +1,30 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3376 3151 4276 3151 4051 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 2926 4501 2026 4726 2251 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3151 5626 3151 5401 3376 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 10575 4950 45 4950 45 1350 10575 1350 10575 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1575 3150 2475 3150 2250 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6526 3150 7426 3150 7201 3375 +4 1 6 0 0 0 20 0.0000 4 256 181 4502 3242 [1,2]\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 4502 3241 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 1110 4501 1891 sCS:unit\001 +4 2 6 0 0 0 20 0.0000 4 316 1456 1531 3241 [1,2]\001 +4 2 4 0 0 0 20 0.0000 4 315 1455 1531 3240 SS:[Flow]\001 +4 1 -1 0 0 0 20 0.0000 4 255 825 2925 3240 sAF:af\001 +4 1 -1 0 0 0 20 0.0000 4 255 900 6075 3240 sAE:ae\001 +4 0 6 0 0 0 20 0.0000 4 331 3046 7471 3241 [1,2]\001 +4 0 4 0 0 0 20 0.0000 4 330 3045 7471 3240 SS:[Integrated_flow]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_lbl.txt @@ -0,0 +1,45 @@ +%% Label file for system sINTFS (sINTFS_lbl.txt) +%SUMMARY sINTFS: flow integrator +%DESCRIPTION Port [in]: Flow to be integrated +%DESCRIPTION Port [out]: Effort = integral of flow on port [in] + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/07/16 07:35:10 peterg +% %% Aliased version +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Flow_1,Flow_2 +%ALIAS out Integrated_flow_1,Integrated_flow_2 + +% Argument aliases +%ALIAS $1 x_0 +%ALIAS $2 x_0s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% CS + unit SS effort,1;x_0;0;x_0s + +% Component type AE + ae lin 1;0 + +% Component type AF + af lin 1;0 + + +% Component type SS + [Flow] SS external,external + [Integrated_flow] SS external,external ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2340 3915 2610 4185 +4 1 6 100 0 18 20 0.0000 4 271 196 2476 4186 [1,2]\001 +4 1 0 100 0 18 20 0.0000 4 270 195 2476 4185 0\001 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 3825 2475 2475 2700 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 5625 2475 4275 2700 4500 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 4050 4050 4050 3825 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 3825 4050 4275 +4 1 0 100 0 18 20 0.0000 4 285 315 2475 2295 sI:i\001 +4 0 0 100 0 18 20 0.0000 4 360 1035 4185 4185 sSf:f_0\001 +4 1 6 100 0 18 20 0.0000 4 361 1186 2476 6031 [1,2]\001 +4 1 4 100 0 18 20 0.0000 4 360 1185 2476 6030 SS:[in]\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_lbl.txt @@ -0,0 +1,37 @@ +%% Label file for system sIS (sIS_lbl.txt) +%SUMMARY sIS +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Port aliases +%ALIAS in in_1,in_2 + +% Argument aliases +%ALIAS $1 flow,i +%ALIAS $2 f_0 +%ALIAS $3 i_s +%ALIAS $4 f_0s + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [in] SS external,external + +% Component type sI + i lin flow,i;i_s + +% Component type sSf + f_0 SS f_0;f_0s ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_numpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_numpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_numpar.txt @@ -0,0 +1,92 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (sInvertedPendulumOnCart_numpar.txt) +# Generated by MTT at Tue Apr 18 18:07:52 BST 2000 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Default parameters +b_m = 0.0; # sDCS +b_ms = 0.0; # sDCS +c = 0.0; # sC,sC,sCS,sCS +c_s = 0.0; # sCS,sCS +e_0 = 0.0; # sCS,sCS +e_0s = 0.0; # sCS,sCS +e_s = 0.0; # Se,Se,Se,sSe,sSe,sSe +f_0 = 0.0; # sIS,sIS,sIS +f_0s = 0.0; # sIS,sIS,sIS +f_s = 0.0; # Sf,Sf,Sf,sSf,sSf,sSf +g = 0.0; # AFe,AFe,sInvertedPendulum,sROD +i = 0.0; # sI,sI,sI,sI,sI,sI,sIS,sIS,sIS +i_0 = 0.0; # sDCS +i_0s = 0.0; # sDCS +i_s = 0.0; # sIS,sIS,sIS +j_m = 0.0; # sDCS,sROD +j_p = 0.0; # sInvertedPendulum +j_ps = 0.0; # sInvertedPendulum +j_s = 0.0; # sROD +k = 0.0; # sAE,sAE,sAE,sAF,sAF,sGY,sTF +ppp_1 = 1.0; # sOpenLoop +ppp_1s = 0.0; # sOpenLoop +ppp_2 = 0.0; # sOpenLoop +ppp_2s = 0.0; # sOpenLoop +ppp_3 = 0.0; # sOpenLoop +ppp_3s = 0.0; # sOpenLoop +ppp_4 = 0.0; # sOpenLoop +ppp_4s = 0.0; # sOpenLoop +k_g = 0.0; # sDrive +k_m = 0.0; # sDCS +k_s = 0.0; # sAE,sAE,sAE,sAF,sAF,sC,sC,sGY,sI,sI,sI,sI,sI,sI,sR,sR,sSe,sSe,sSe,sSf,sSf,sSf,sTF +l = 0.0; # AE3,AF3,sEMTF +l_a = 0.0; # sDCS,sROD +l_b = 0.0; # sROD +l_p = 0.0; # sInvertedPendulum,sInvertedPendulumOnCart +m = 0.0; # sROD +m_c = 0.0; # sCart +m_cs = 0.0; # sCart +m_p = 0.0; # sInvertedPendulum +m_ps = 0.0; # sInvertedPendulum +m_s = 0.0; # sROD +m_t = 0.0; # sInvertedPendulum +m_ts = 0.0; # sInvertedPendulum +omega_0 = 0.0; # sInvertedPendulum,sROD +omega_0s = 0.0; # sInvertedPendulum,sROD +r = 0.0; # sDrive,sR,sR +r_a = 0.0; # sDCS +r_c = 0.0; # sCart +r_cs = 0.0; # sCart +r_p = 0.0; # sCart +r_ps = 0.0; # sCart +theta_0 = 0.0; # sInvertedPendulum,sROD +theta_0s = 0.0; # sInvertedPendulum,sROD +v_0 = 0.0; # sCart +v_0s = 0.0; # sCart +x_0 = 0.0; # sCart,sINTFS,sINTFS +x_0s = 0.0; # sCart,sINTFS,sINTFS + + +## Pysical Parameters +j_m = 3.87e-7; # Motor inertia +k_m = 0.00767; # Motor constant +r_a = 2.6; # Armature resistance +l_a = 0.18e-3; # Armature inductance + +k_g = 1/3.7; # Internal gear ratio +r = 0.635e-2; # Motor gear radius + +m_c = 0.455; # Cart mass + +b_m = 0.0; # Motor friction +r_c = 1.5; # Cart friction + +l_p = 0.61; # Pendulum length +m_p = 0.210; # Pendulum mass +r_p = 0.0; # Pendulum friction + +j_p = m_p*(l_p*l_p)/12; # Pendulum inertia about cm. + +g = 9.81; # Gravity ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_state.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_state.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_state.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_state.txt @@ -0,0 +1,21 @@ +# -*-octave-*- Put Emacs into octave-mode +# Initial state file (sInvertedPendulumOnCartPPP_state.txt) +# Generated by MTT at Thu May 4 14:57:10 BST 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Set the states +mttx(1) = 0.0; # i_1 (sInvertedPendulumOnCartPPP_mtt2_motor_l_a_i) +mttx(2) = 0.0; # i_2 (sInvertedPendulumOnCartPPP_mtt2_motor_l_a_i) +mttx(3) = 0.0; # i_1 (sInvertedPendulumOnCartPPP_mtt3_rod_J_i) +mttx(4) = 0.0; # i_2 (sInvertedPendulumOnCartPPP_mtt3_rod_J_i) +mttx(5) = pi/2; # c_1 (sInvertedPendulumOnCartPPP_mtt3_rod_th_unit_c) +mttx(6) = 0.0; # c_2 (sInvertedPendulumOnCartPPP_mtt3_rod_th_unit_c) +mttx(7) = 0.0; # i_1 (sInvertedPendulumOnCartPPP_mtt4_m_c_i) +mttx(8) = 0.0; # i_2 (sInvertedPendulumOnCartPPP_mtt4_m_c_i) +mttx(9) = 0.0; # c_1 (sInvertedPendulumOnCartPPP_mtt4_x_unit_c) +mttx(10) = 0.0; # c_2 (sInvertedPendulumOnCartPPP_mtt4_x_unit_c) ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_input.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_input.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_input.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_input.txt @@ -0,0 +1,37 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (sInvertedPendulumOnCart_input.txt) +# Generated by MTT at Thu Aug 5 09:17:30 BST 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Set the inputs +# mttu(1) = 1.0*(t<1) -1.0*((t>=1)&&(t<2)); # u (sInvertedPendulumOnCart_F) + + ## Doing control +# if (mtt_n_parameters>=1) +# if (mtt_parameters(1)<5) + mttu(1) = exp(-0.0*t); + mttu(2) = exp(-2.0*t); + mttu(3) = exp(-5.0*t); + mttu(4) = exp(-10.0*t); + +# mttu(1) = 1; +# mttu(2) = exp(-0.5*t);; +# mttu(3) = exp(-t); +# mttu(4) = exp(-2*t); + +# mttu(1) = (t<0.1); +# mttu(2) = ((t>=0.1)&&(t<0.2)); +# mttu(3) = ((t>=0.2)&&(t<0.3)); +# mttu(4) = ((t>=0.3)&&(t<0.4)); +# else +# ## Identification +# mttu(1) = (-1*((t>=3.37966)&&(t<= 5.36946)) + ((t>=10.36896)&&(t<=12.36876))); +# endif +# endif + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_lbl.txt @@ -0,0 +1,26 @@ +%% Label file for system sInvertedPendulumOnCart (sInvertedPendulumOnCart_lbl.txt) +%SUMMARY sInvertedPendulumOnCart +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%VAR l_p #Pendulum length + +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_rep.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_rep.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_rep.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_rep.txt @@ -0,0 +1,32 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system sInvertedPendulumOnCart (sInvertedPendulumOnCart_rep.txt) +## Generated by MTT on" Fri Oct 22 09:03:14 EST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:29:10 peterg +## To RCS +## +############################################################### + +mtt sInvertedPendulumOnCart abg tex # The system description +mtt sInvertedPendulumOnCart cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt sInvertedPendulumOnCart struc tex # The system structure +mtt sInvertedPendulumOnCart dae tex # The system dae +## mtt sInvertedPendulumOnCart ode tex # The system ode +## mtt sInvertedPendulumOnCart sspar tex # Steady-state parameters +## mtt sInvertedPendulumOnCart ss tex # Steady state +## mtt sInvertedPendulumOnCart dm tex # Descriptor matrices (of linearised system) +mtt sInvertedPendulumOnCart sm tex # State matrices (of linearised system) +## mtt sInvertedPendulumOnCart tf tex # Transfer function (of linearised system) +## mtt sInvertedPendulumOnCart lmfr ps # log modulus of frequency response (of linearised system) +mtt sInvertedPendulumOnCart simpar tex # Simulation parameters +mtt sInvertedPendulumOnCart numpar tex # Numerical simulation parameters +mtt sInvertedPendulumOnCart input tex # Simulation input +mtt -cse sInvertedPendulumOnCart odeso ps # Simulation output + +mtt sInvertedPendulumOnCart ppp ps # PPP control ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_simpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_simpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_simpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_simpar.txt @@ -0,0 +1,20 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system sInvertedPendulumOnCart (sInvertedPendulumOnCart_simpar.txt) +# Generated by MTT on Thu Aug 5 09:17:05 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 1.0; # Last time in simulation +DT = 0.05; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulum_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulum_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulum_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulum_lbl.txt @@ -0,0 +1,48 @@ +%% Label file for system sInvertedPendulum (sInvertedPendulum_lbl.txt) +%SUMMARY sInvertedPendulum +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in x_1,x_2,y_1,y_2,a_1,a_2 + + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type I + m_x lin flow,m_t;m_ts + m_y lin flow,m_t;m_ts + +% Component type Se + mg SS m_t*g;0 + +% Component type De + theta SS external;external + + + +% Component type SS + [a] SS external,external + [x] SS external,external + [y] SS external,external + +% Component type Se + a_0 SS 0;0 + +% Component type ROD + rod none l_p;l_p;j_p;m_p;g;omega_0;theta_0;j_ps;m_ps;omega_0s;theta_0s + ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sOpenLoop_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sOpenLoop_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sOpenLoop_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sOpenLoop_lbl.txt @@ -0,0 +1,54 @@ +%% Label file for system sOpenLoop (sOpenLoop_lbl.txt) +%SUMMARY sOpenLoop +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS out us_1,us_2 + +% Argument aliases +%ALIAS $1 U_1 +%ALIAS $2 U_1s +%ALIAS $3 U_2 +%ALIAS $4 U_2s +%ALIAS $5 U_3 +%ALIAS $6 U_3s +%ALIAS $7 U_4 +%ALIAS $8 U_4s +%ALIAS $9 us +%ALIAS $10 uss +%ALIAS $11 Us_1 +%ALIAS $12 Us_1s +%ALIAS $13 Us_2 +%ALIAS $14 Us_2s +%ALIAS $15 Us_3 +%ALIAS $16 Us_3s +%ALIAS $17 Us_4 +%ALIAS $18 Us_4s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + [us] SS external,external + +% Component type AE + U_1 lin ppp_1;ppp_1s + U_2 lin ppp_2;ppp_2s + U_3 lin ppp_3;ppp_3s + U_4 lin ppp_4;ppp_4s + +% Component type Se + Us_1 SS external;0 + Us_2 SS external;0 + Us_3 SS external;0 + Us_4 SS external;0 ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sROD_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sROD_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sROD_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sROD_lbl.txt @@ -0,0 +1,106 @@ +%SUMMARY sROD: rigid rod in two dimensions - with gravity and angle port +%DESCRIPTION See Section 10.2 of "Metamodelling" +%DESCRIPTION Gravity term added at centre + +%ALIAS $1 l_a # length from end a to mass centre +%ALIAS $2 l_b # length from end b to mass centre +%ALIAS $3 j_m # inertia about mass centre +%ALIAS $4 m # mass +%ALIAS $5 g # gravity + +%ALIAS $6 omega_0 # Initial angular velocity +%ALIAS $7 theta_0 # Initial angular velocity + +## Sensitivities +%ALIAS $8 j_s +%ALIAS $9 m_s + +%ALIAS $10 omega_0s # Initial angular velocity +%ALIAS $11 theta_0s # Initial angular velocity + + +%ALIAS in|Tip_a xTip_a_1,xTip_a_2,angularTip_a_1,angularTip_a_2,yTip_a_1,yTip_a_2 +%ALIAS out|Tip_b xTip_b_1,xTip_b_2,angularTip_b_1,angularTip_b_2,yTip_b_1,yTip_b_2 + +%ALIAS x_a xTip_a_1,xTip_a_2 # Force/velocity at tip a in x direction +%ALIAS y_a yTip_a_1,yTip_a_2 # Force/velocity at tip a in y direction +%ALIAS alpha_a|a_a angularTip_a_1,angularTip_a_2 # Torque/angular velocity at tip a + +%ALIAS x_b xTip_b_1,xTip_b_2 # Force/velocity at tip b in x direction +%ALIAS y_b yTip_b_1,yTip_b_2 # Force/velocity at tip b in y direction +%ALIAS alpha_b|a_b angularTip_b_1,angularTip_b_2 # Torque/angular velocity at tip b + +%ALIAS angle|a angle_1,angle_2 # Angle port + +%ALIAS INTF General/INTF # The flow integration component. + +%% Label file for system sROD (sROD_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/10/22 02:01:45 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1999/08/05 08:04:40 peterg +% %% Initial revision +% %% +% %% Revision 1.3 1998/11/30 10:47:53 peterg +% %% Added extra a_a and a_b aliases +% %% +% %% Revision 1.2 1998/11/25 13:55:42 peterg +% %% Added missig attribute field m*g,internal +% %% +% %% Revision 1.1 1998/11/25 10:48:34 peterg +% %% Initial revision +% %% +% %% Revision 1.5 1998/07/27 12:27:27 peterg +% %% Added vector port aliases +% %% +% %% Revision 1.4 1998/07/27 10:51:20 peterg +% %% Aliased INTF as well. +% %% +% %% Revision 1.3 1998/07/27 10:49:10 peterg +% %% Major revision to include aliases etc +% %% +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,j_m;omega_0;j_s;omega_0s +m_x lin flow,m;m_s +m_y lin flow,m;m_s + +%Integrate angular velocity to get angle +th none theta_0;theta_0s + +%Modulated transformers +s1 lsin;slsin l_a +s2 lsin;slsin l_b +c1 lcos;slcos l_a +c2 lcos;slcos l_b + + +% Component type Se + mg SS m*g;0 + +% Component type SS + [angularTip_a] SS external,external + [angularTip_b] SS external,external + [xTip_a] SS external,external + [xTip_b] SS external,external + [yTip_a] SS external,external + [yTip_b] SS external,external + [angle] SS external,external ADDED mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sZero_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sZero_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sZero_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sZero_lbl.txt @@ -0,0 +1,32 @@ +%% Label file for system sZero (sZero_lbl.txt) +%SUMMARY sZero +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in x_1,x_2,y_1,y_2,a_1,a_2 + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + [a] SS external,external + [x] SS external,external + [y] SS external,external + +% Component type Se + x SS 0;0 + y SS 0;0 + +% Component type Sf + a SS 0;0 ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_abg.fig @@ -0,0 +1,183 @@ +#FIG 3.2 +Portrait +Center +Inches +A4 +100.00 +Single +-2 +1200 2 +6 8550 825 13500 3375 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12595 1725 11695 1725 11845 1875 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12595 1350 11695 1350 11845 1500 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12595 975 11695 975 11845 1125 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12595 2100 11695 2100 11845 2250 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12595 2475 11695 2475 11845 2625 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12595 2850 11695 2850 11845 3000 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12595 3225 11695 3225 11845 3375 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 10200 2100 9300 2100 9450 2250 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 10200 975 8700 975 8700 1875 8550 1725 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 10200 1275 9000 1275 9000 1875 8850 1725 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 10200 1725 9300 1725 9300 1875 9150 1725 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 10200 3225 8700 3225 8700 2325 8550 2475 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 10200 2925 9000 2925 9000 2325 8850 2475 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 10200 2475 9300 2475 9300 2325 9150 2475 +4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 2175 AE:ppp_4\001 +4 1 -1 0 0 0 20 0.0000 4 285 810 13050 1800 Se:u_3\001 +4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 1800 AE:ppp_3\001 +4 1 -1 0 0 0 20 0.0000 4 285 810 13050 1425 Se:u_2\001 +4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 1425 AE:ppp_2\001 +4 1 -1 0 0 0 20 0.0000 4 285 810 13050 1050 Se:u_1\001 +4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 1050 AE:ppp_1\001 +4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 2550 AE:ppp_5\001 +4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 2925 AE:ppp_6\001 +4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 3300 AE:ppp_7\001 +4 1 -1 0 0 0 20 0.0000 4 285 810 13050 2550 Se:u_5\001 +4 1 -1 0 0 0 20 0.0000 4 285 810 13050 2925 Se:u_6\001 +4 1 -1 0 0 0 20 0.0000 4 285 810 13050 3300 Se:u_7\001 +4 1 -1 0 0 0 20 0.0000 4 285 810 13050 2175 Se:u_4\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 9000 2175 1\001 +-6 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2706 7206 3606 7206 3456 7356 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2406 7506 2406 8406 2556 8256 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3906 7506 3906 8406 4056 8256 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7208 7208 8108 7208 7958 7358 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8708 7208 9608 7208 9458 7358 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8408 7508 8408 8408 8558 8258 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7208 6908 8108 6008 8108 6233 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8708 6008 9608 6908 9383 6908 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9909 7509 9909 8409 10059 8259 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6908 7508 6908 8408 7058 8258 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11407 7507 11407 8407 11557 8257 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11406 5706 11406 4806 11556 4956 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4206 7206 5106 7206 4956 7356 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5406 7506 5406 8406 5556 8256 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4206 6906 5106 6006 5106 6231 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5405 5705 5405 4805 5555 4955 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2405 5705 2405 4805 2555 4955 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11707 7207 12607 7207 12457 7357 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11707 6007 12607 6907 12382 6907 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2105 4205 2105 3305 2255 3455 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2705 4205 2705 3305 2855 3455 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5706 7206 6606 7206 6456 7356 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5706 6006 6606 6906 6381 6906 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2704 6004 3604 6904 3379 6904 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1208 7208 2108 7208 1958 7358 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1208 6908 2108 6008 2108 6233 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 681 6006 1131 6006 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 906 6906 906 6006 1056 6156 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12905 6905 12905 6005 13055 6155 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10207 7207 11107 7207 10957 7357 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10207 6907 11107 6007 11107 6232 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8400 5700 8625 5700 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 12900 6000 13125 6000 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 12675 6000 12900 6000 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8175 5700 8400 5700 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 1501 7801 301 7801 301 5401 1501 5401 1501 7801 +2 2 1 2 1 7 1 0 -1 6.000 1 0 0 0 0 5 + 1502 2852 3302 2852 3302 5777 1502 5777 1502 2852 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 4501 9001 3301 9001 3301 6301 4501 6301 4501 9001 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 6000 9000 4800 9000 4800 4200 6000 4200 6000 9000 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 7501 9001 6301 9001 6301 6301 7501 6301 7501 9001 +2 4 1 2 1 7 2 0 -1 6.000 0 0 7 0 0 5 + 9000 9000 7800 9000 7800 4200 9000 4200 9000 9000 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 10501 9001 9301 9001 9301 6301 10501 6301 10501 9001 +2 4 1 2 1 -1 1 0 -1 6.000 0 0 7 0 0 5 + 12000 9000 10800 9000 10800 4200 12000 4200 12000 9000 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 13501 7801 12301 7801 12301 5401 13501 5401 13501 7801 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 8700 2100 8400 2100 8400 5700 8550 5550 +2 2 1 2 1 7 101 0 -1 6.000 0 0 -1 0 0 5 + 8100 600 13800 600 13800 3600 8100 3600 8100 600 +4 1 -1 0 0 0 20 0.0000 4 210 150 2406 7281 0\001 +4 1 -1 0 0 0 20 0.0000 4 285 690 3906 8781 I:m_1\001 +4 1 -1 0 0 0 20 0.0000 4 285 705 2405 8780 R:b_1\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 2405 6080 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 3906 7281 1\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 8408 7283 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 8408 6083 0\001 +4 1 -1 0 0 0 20 0.0000 4 285 705 8483 8783 R:b_3\001 +4 1 -1 0 0 0 20 0.0000 4 285 690 9906 8781 I:m_3\001 +4 1 -1 0 0 0 20 0.0000 4 285 690 6905 8780 I:m_2\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 11407 7282 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 11407 6082 0\001 +4 1 -1 0 0 0 20 0.0000 4 285 645 11406 4581 C:k_t\001 +4 1 -1 0 0 0 20 0.0000 4 285 645 11482 8782 R:b_t\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 5406 7281 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 5406 6081 0\001 +4 1 -1 0 0 0 20 0.0000 4 285 705 5481 8781 R:b_2\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 12909 7284 1\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 6908 7283 1\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 2404 4579 1\001 +4 1 -1 0 0 0 20 0.0000 4 285 705 2779 3154 C:p_1\001 +4 1 -1 0 0 0 20 0.0000 4 285 705 2104 3154 R:d_1\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 910 7285 1\001 +4 1 -1 0 0 0 20 0.0000 4 285 765 902 5777 Sf:v_b\001 +4 1 -1 0 0 0 20 0.0000 4 285 735 12905 5780 De:f_t\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 9909 7284 1\001 +4 1 -1 0 0 0 20 0.0000 4 285 705 5405 4580 C:k_2\001 +4 1 1 1 0 3 20 0.0000 4 210 1515 3901 9301 Macro mass\001 +4 1 1 1 0 3 20 0.0000 4 210 1770 2401 2776 Macro control\001 +4 1 1 1 0 3 20 0.0000 4 210 1470 900 8100 Macro base\001 +4 1 1 1 0 3 20 0.0000 4 285 1845 5400 4050 Compliant link\001 +4 1 1 1 0 3 20 0.0000 4 210 1425 6901 9301 Micro mass\001 +4 1 1 1 0 3 20 0.0000 4 210 1860 8475 4050 Micro actuator\001 +4 1 1 1 0 3 20 0.0000 4 285 1095 9901 9301 Tip mass\001 +4 1 1 1 0 3 20 0.0000 4 285 2940 11400 4050 Compliant environment\001 +4 1 1 1 0 3 20 0.0000 4 285 1275 12901 8101 Tip sensor\001 +4 1 1 1 0 3 20 0.0000 4 285 2370 6750 1275 Open-loop control\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_desc.tex Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_desc.tex ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_desc.tex +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_desc.tex @@ -0,0 +1,40 @@ +% Verbal description for system MacroMicroPPP (MacroMicroPPP_desc.tex) +% Generated by MTT on Tue Dec 9 17:55:41 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/05/21 16:10:07 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{MacroMicroPPP} is + displayed in Figure \Ref{MacroMicroPPP_abg} and its label + file is listed in Section \Ref{sec:MacroMicroPPP_lbl}. + The subsystems are listed in Section \Ref{sec:MacroMicroPPP_sub}. + +This is a Bond Graph model of the macro-micro manipulation system +discussed by Sharon in his thesis and BY Sharon, Hogan and Hardt in +various papers. + +It can be regarded as a single-input single-output system with input +$e_1$ and output $e_2$. The bond graph in Figure \Ref{rcPPP_abg} is +augmented with the {\em open-loop\/} controller comprising +\begin{itemize} +\item seven effort source \textbf{Se} components ``u1'' to``u7'' +\item seven effort amplifier \textbf{AE} components ``ppp\_1'' to `ppp\_7'' +\end{itemize} +This allows up to 7 input basis functions. + +This is a \emph{linear} system; but it is used to illustate +\emph{nonlinear} PPP control. +Section \Ref{sec:rcPPP_nppp.ps} compares +\begin{itemize} +\item linear open-loop PPP control +\item linear closed-loop PPP control +\item nonlinear PPP control +\end{itemize} +as linear open and closed-loop control. ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_lbl.txt @@ -0,0 +1,85 @@ +%% Label file for system MacroMicroPPP (MacroMicroPPP_lbl.txt) +%SUMMARY MacroMicroPPP +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/05/21 16:05:48 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases +%ALIAS $1 ppp_1 +%ALIAS $2 ppp_2 +%ALIAS $3 ppp_3 +%ALIAS $4 ppp_4 +%ALIAS $5 k_2 +%ALIAS $6 k_t +%ALIAS $7 p_1 +%ALIAS $8 f_t +%ALIAS $9 m_1 +%ALIAS $10 m_2 +%ALIAS $11 m_3 +%ALIAS $12 b_1 +%ALIAS $13 b_2 +%ALIAS $14 b_3 +%ALIAS $15 b_t +%ALIAS $16 d_1 +%ALIAS $17 u_1 +%ALIAS $18 u_2 +%ALIAS $19 u_3 +%ALIAS $20 u_4 +%ALIAS $21 v_b + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + ppp_1 lin ppp_1 + ppp_2 lin ppp_2 + ppp_3 lin ppp_3 + ppp_4 lin ppp_4 + ppp_5 lin ppp_5 + ppp_6 lin ppp_6 + ppp_7 lin ppp_7 + +% Component type C + k_2 lin state,k_2 + k_t lin state,k_t + p_1 lin state,p_1 + +% Component type De + f_t SS external + +% Component type I + m_1 lin flow,m_1 + m_2 lin flow,m_2 + m_3 lin flow,m_3 + +% Component type R + b_1 lin flow,b_1 + b_2 lin flow,b_2 + b_3 lin flow,b_3 + b_t lin flow,b_t + d_1 lin flow,d_1 + +% Component type Se + u_1 SS external + u_2 SS external + u_3 SS external + u_4 SS external + u_5 SS external + u_6 SS external + u_7 SS external + +% Component type Sf + v_b SS 0 ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_nppp.m Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_nppp.m ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_nppp.m +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_nppp.m @@ -0,0 +1,154 @@ +## MacroMicroPPP_nppp.m +## Makes figures for the MacroMicro_PPP exasmple. +## $Log$ +## Revision 1.4 2000/05/21 16:11:53 peterg +## 7 basis funs. +## +## Revision 1.3 2000/05/21 15:59:34 peterg +## Made into _nppp.m file +## Parameterised _sm +## +## Revision 1.2 2000/05/17 17:01:39 peterg +## Modified for Macro Micro example -- works!! +## +## Revision 1.1 2000/05/17 10:03:04 peterg +## Initial revision +## +## Revision 1.1 2000/05/17 09:14:37 peterg +## Initial revision +## +system_name = "MacroMicroPPP"; + +## Uncomment the following the first time +## (Or do ./Make MacroMicroPPP in this directory) + +## MTT stuff for the system simulation +##system("Make MacroMicroPPP"); + + + +t_s=0.1*[0:0.01:1]; +u = [ones(7,length(t_s))]; +x_0 = MacroMicroPPP_state; +par = MacroMicroPPP_numpar; + +## Simulate the system +tick=time; +[y] = MacroMicroPPP_sim(x_0,u,t_s,par); +Elapsed = time-tick +plot(t_s,y) + +## Simulate the system to give just the final few point +t_s1 = 0.1*[0.91:0.01:1]; +tick=time; +[y,x] = MacroMicroPPP_sim(x_0,u,t_s1,par); +Elapsed = time-tick +plot(t_s1,y,t_s1,x); + +## Sensitivity system simulation parameters +x_0s = sMacroMicroPPP_state; +pars = sMacroMicroPPP_numpar; +sympars = sMacroMicroPPP_sympar; + +## Simulate the sensitivity system +sensitivities = \ + [sympars.ppp_1s,\ + sympars.ppp_2s,\ + sympars.ppp_3s,\ + sympars.ppp_4s,\ + sympars.ppp_5s,\ + sympars.ppp_6s,\ + sympars.ppp_7s] +tick=time; +[y,ys] = sMacroMicroPPP_sim(x_0s,u,t_s,pars,sensitivities); +Elapsed = time-tick +plot(t_s,y,t_s,ys); + + +### PPP parameters +A_w = 0; +A_u = ppp_aug(A_w,laguerre_matrix(6,25)); # Specify basis functions + +tau = 0.5*[0.9:0.01:1]; # Optimisation interval +t_ol = 0.5*[0:0.01:0.1]; # Open-loop interval +N = 10; # Number of open-loop intervals in simulation +w = 1; # Setpoint + +## Linear system +[A,B,C,D] = MacroMicroPPP_sm(par); +Q = 1; +w = 1; +ppp_lin_plot (A,B(:,1),C(1,:),D(1,1),A_u,A_w,tau,Q,w,x_0); +psfig("MacroMicroPPP_lin"); + +## Simulate non-linear PPP (on this linear system) +extras.U_initial = "zero"; +extras.U_next = "continuation"; +extras.criterion = 1e-8; +extras.max_iterations = 10; +extras.v = 0.1; +extras.verbose = 0; + +## -- with no optimisation using linear PPP with continuation +extras.U_initial = "linear"; +extras.U_next = "continuation"; +extras.criterion = 1e-5; +extras.max_iterations = 0; + +[y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + +## -- with no optimisation using linear PPP at each step +extras.U_initial = "linear"; +extras.U_next = "linear"; +extras.criterion = 1e-5; +extras.max_iterations = 0; +[y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + +## -- with optimisation using nonlinear PPP with continuation +extras.U_initial = "zero"; +extras.U_next = "continuation"; +extras.criterion = 1e-5; +extras.max_iterations=100; +extras.verbose = 0; +extras.v = 1e-5; +disp("Non-linear optimisation ...."); +[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + + +## Plots +title(""); + +## U, U_c and U_l +I = 1:N; +IU1 = [I' U(1,:)']; +IU1_c = [I' U_c(1,:)']; +IU1_l = [I' U_l(1,:)']; +gset grid; xlabel "Interval" +gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1" +psfig("MacroMicroPPP_U1"); + +IU2 = [I' U(2,:)']; +IU2_c = [I' U_c(2,:)']; +IU2_l = [I' U_l(2,:)']; +gset grid; xlabel "Interval " +gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2" +psfig("MacroMicroPPP_U2"); + +## y & u +gset grid; xlabel "Time (sec)" +ty = [t' y'] ; tu = [t' u']; +gplot ty title "Output", tu title "Input" + +psfig("MacroMicroPPP_yu"); + +title(""); +gset grid; xlabel "Time (sec)" +ty_c = [t' y_c'] ; +ty_l = [t' y_l'] ; +ty = [t' y'] ; +tu = [t' u']; +gplot ty_c title "Continuation", ty_l title "Linear", ty title "Optimisation" +psfig("MacroMicroPPP_nppp"); + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_numpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_numpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_numpar.txt @@ -0,0 +1,36 @@ +## Dummies +b_1 = 0.0; +b_2 = 0.0; +b_3 = 0.0; +b_t = 0.0; +d_1 = 0.0; +e_s = 0.0; +f_s = 0.0; +k_2 = 0.0; +k_t = 0.0; +m_1 = 0.0; +m_2 = 0.0; +m_3 = 0.0; +p_1 = 0.0; +ppp_1 = 0.0; +ppp_2 = 0.0; +ppp_3 = 0.0; +ppp_4 = 0.0; +ppp_5 = 0.0; +ppp_6 = 0.0; +ppp_7 = 0.0; + +m_1 = 0.0169; # m_1; +m_2 = 0.0169; # m_2; +b_1 = 0.13; # b_1; +b_2 = 0.013; # b_2; +k_2 = 24; # k_2; +k_t = 150; # k_t; +b_t = 0.16; # b_t; +b_3 = 0.13; # b_3; +m_3 = 0.005; # m_3; +p_1 = 10; # p_1; +d_1 = 0.9; # d_1; + + +ppp_1 = 1.0; ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_rep.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_rep.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_rep.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_rep.txt @@ -0,0 +1,25 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system MacroMicroPPP (MacroMicroPPP_rep.txt) +## Generated by MTT on" Wed May 10 09:22:52 BST 2000. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/05/20 17:44:47 peterg +## Initial revision +## +############################################################### + +mtt MacroMicroPPP abg tex # The system description +#mtt -s sMacroMicroPPP abg tex # The system description + +mtt MacroMicroPPP struc tex # The system structure +mtt -s sMacroMicroPPP struc tex # The system structure + +mtt MacroMicroPPP nppp m # How its done +mtt MacroMicroPPP nppp ps # PPP output + +mtt MacroMicroPPP rep txt # The report. + ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/Make Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/Make ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/Make +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/Make @@ -0,0 +1,30 @@ +#!/bin/sh + +## Makes the files needed for Figures.m +## Copyright (C) 2000 by Peter J. Gawthrop + +if [ -z "$1" ]; then + echo Usage ./Make system_name + exit +else + echo "Making simulation for system $1 (for use in Figures.m)" +fi + +## System +mtt -q -c -stdin $1 ode2odes out +mtt -q -c -stdin $1 sim m +mtt -q $1 state m +mtt -q $1 sympar m +mtt -q $1 numpar m + +## Sensitivity system +mtt -q -c -stdin -s s$1 ode2odes out +mtt -q -c -stdin -s s$1 sim m +mtt -q -s s$1 state m +mtt -q -s s$1 sympar m +mtt -q -s s$1 numpar m + +## Additional system reps for PPP +mtt -q $1 sm m +mtt -q $1 def m +mtt -q -s s$1 def m ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_lbl.txt @@ -0,0 +1,103 @@ +%% Label file for system sMacroMicroPPP (sMacroMicroPPP_lbl.txt) +%SUMMARY sMacroMicroPPP +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases +%ALIAS $1 ppp_1 +%ALIAS $2 ppp_1s +%ALIAS $3 ppp_2 +%ALIAS $4 ppp_2s +%ALIAS $5 ppp_3 +%ALIAS $6 ppp_3s +%ALIAS $7 ppp_4 +%ALIAS $8 ppp_4s +%ALIAS $9 k_2 +%ALIAS $10 k_2s +%ALIAS $11 k_t +%ALIAS $12 k_ts +%ALIAS $13 p_1 +%ALIAS $14 p_1s +%ALIAS $15 f_t +%ALIAS $16 f_ts +%ALIAS $17 m_1 +%ALIAS $18 m_1s +%ALIAS $19 m_2 +%ALIAS $20 m_2s +%ALIAS $21 m_3 +%ALIAS $22 m_3s +%ALIAS $23 b_1 +%ALIAS $24 b_1s +%ALIAS $25 b_2 +%ALIAS $26 b_2s +%ALIAS $27 b_3 +%ALIAS $28 b_3s +%ALIAS $29 b_t +%ALIAS $30 b_ts +%ALIAS $31 d_1 +%ALIAS $32 d_1s +%ALIAS $33 u_1 +%ALIAS $34 u_1s +%ALIAS $35 u_2 +%ALIAS $36 u_2s +%ALIAS $37 u_3 +%ALIAS $38 u_3s +%ALIAS $39 u_4 +%ALIAS $40 u_4s +%ALIAS $41 v_b +%ALIAS $42 v_bs + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + ppp_1 lin ppp_1;ppp_1s + ppp_2 lin ppp_2;ppp_2s + ppp_3 lin ppp_3;ppp_3s + ppp_4 lin ppp_4;ppp_4s + ppp_5 lin ppp_5;ppp_5s + ppp_6 lin ppp_6;ppp_6s + ppp_7 lin ppp_7;ppp_7s + +% Component type C + k_2 lin state,k_2;k_2s + k_t lin state,k_t;k_ts + p_1 lin state,p_1;p_1s + +% Component type De + f_t SS external + +% Component type I + m_1 lin flow,m_1;m_1s + m_2 lin flow,m_2;m_2s + m_3 lin flow,m_3;m_3s + +% Component type R + b_1 lin flow,b_1;b_1s + b_2 lin flow,b_2;b_2s + b_3 lin flow,b_3;b_3s + b_t lin flow,b_t;b_ts + d_1 lin flow,d_1;d_1s + +% Component type Se + u_1 SS external;u_1s + u_2 SS external;u_2s + u_3 SS external;u_3s + u_4 SS external;u_4s + u_5 SS external;u_5s + u_6 SS external;u_6s + u_7 SS external;u_7s + +% Component type Sf + v_b SS 0;0 ADDED mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_numpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_numpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_numpar.txt @@ -0,0 +1,70 @@ +## Dummies +b_1 = 0.0; +b_1s = 0.0; +b_2 = 0.0; +b_2s = 0.0; +b_3 = 0.0; +b_3s = 0.0; +b_t = 0.0; +b_ts = 0.0; +c = 0.0; +d_1 = 0.0; +d_1s = 0.0; +e_s = 0.0; +f_s = 0.0; +g = 0.0; +i = 0.0; +k = 0.0; +k_2 = 0.0; +k_2s = 0.0; +k_s = 0.0; +k_t = 0.0; +k_ts = 0.0; +m_1 = 0.0; +m_1s = 0.0; +m_2 = 0.0; +m_2s = 0.0; +m_3 = 0.0; +m_3s = 0.0; +p_1 = 0.0; +p_1s = 0.0; +ppp_1 = 0.0; +ppp_1s = 0.0; +ppp_2 = 0.0; +ppp_2s = 0.0; +ppp_3 = 0.0; +ppp_3s = 0.0; +ppp_4 = 0.0; +ppp_4s = 0.0; +ppp_5 = 0.0; +ppp_5s = 0.0; +ppp_6 = 0.0; +ppp_6s = 0.0; +ppp_7 = 0.0; +ppp_7s = 0.0; +r = 0.0; +u_1s = 0.0; +u_2s = 0.0; +u_3s = 0.0; +u_4s = 0.0; +u_5s = 0.0; +u_6s = 0.0; +u_7s = 0.0; + +## Physical parameters +m_1 = 0.0169; # m_1; +m_2 = 0.0169; # m_2; +b_1 = 0.13; # b_1; +b_2 = 0.013; # b_2; +k_2 = 24; # k_2; +k_t = 150; # k_t; +b_t = 0.16; # b_t; +b_3 = 0.13; # b_3; +m_3 = 0.005; # m_3; +p_1 = 10; # p_1; +d_1 = 0.9; # d_1; + +## First gain +ppp_1 = 1.0; + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m @@ -0,0 +1,144 @@ +## Figures.m +## Makes figures for the rc_PPP exasmple. +## $Log$ +## Revision 1.2 2000/05/17 17:02:58 peterg +## Fixed documentation +## +## Revision 1.1 2000/05/17 09:14:37 peterg +## Initial revision +## +system_name = "rcPPP"; + +## Uncomment the following the first time +## (Or do ./Make rcPPP in this directory) + +## MTT stuff for the system simulation +##system("Make rcPPP"); + +# ## System info +par = rcPPP_numpar; +simpar = rcPPP_simpar; +x_0 = rcPPP_state(par); + +# ## Set up the input +# t = [0:simpar.dt:simpar.last]; +# A_w = 0; +# A_u = ppp_aug(A_w,laguerre_matrix(1,2.0)) # Specify basis functions: constant & exp(-t/T) +# u = ppp_ustar(A_u,1,t,0,0); + +# ## Simulate the system +# tick=time; +# [y,x] = rcPPP_sim(x_0,par,simpar,u); +# Elapsed = time-tick +# plot(t,y) + +## Sensitivity system simulation parameters +simpars = srcPPP_simpar; +sympars = srcPPP_sympar; +pars = srcPPP_numpar; +x_0s = srcPPP_state(pars); + +t = [0:simpars.dt:simpars.last]; +A_w = 0; +A_u = ppp_aug(A_w,laguerre_matrix(1,2.0)) # Specify basis functions: constant & exp(-t/T) +u = ppp_ustar(A_u,1,t,0,0); + + +## Setup the indices of the adjustable stuff +i_ppp = [sympars.ppp_1, sympars.ppp_1s + sympars.ppp_2, sympars.ppp_2s]; # PPP params +i_par = [sympars.x_0, sympars.x_0s + sympars.r, sympars.rs]; # State and r component + +## Simulate the sensitivity system +sensitivities = [i_ppp(:,2); i_par(:,2)] +u = ppp_ustar(A_u,1,t,0,0); +tick=time; +[y,ys,x] = srcPPP_ssim(x_0s,pars,simpars,u,sensitivities); +Elapsed = time-tick +plot(t,y,t,ys); + +### PPP parameters +tau = [0.9:0.01:1]; # Optimisation interval +t_ol = [0:0.01:0.2]; # Open-loop interval +N = 10; # Number of open-loop intervals in simulation +w = 1; # Setpoint +w_s = w*ones(10,1); # The setpoint witnin the horizon + +## Linear system +n_Tau = round(simpars.last/simpars.dt); +dtau = simpars.dt; +Tau = [0:n_Tau-1]'*dtau; +[n_tau,n_w] = size(w_s); +tau = Tau(n_Tau-n_tau+1:n_Tau) +[A,B,C,D] = rcPPP_sm(par); +Q = 1; +w = 1; +ppp_lin_plot (A,B(:,1),C(1,:),D(1,1),A_u,A_w,tau',Q,w); +psfig("rcPPP_lin"); + +## Simulate non-linear PPP (on this linear system) +extras.U_initial = "zero"; +extras.U_next = "continuation"; +extras.criterion = 1e-5; +extras.max_iterations = 10; +extras.alpha = 0.1; +extras.verbose = 0; +extras.v = 1e-5; + +## -- with no optimisation using linear PPP with continuation +extras.U_initial = "linear"; +extras.U_next = "continuation"; +extras.criterion = 1e-5; +extras.max_iterations = 0; +[y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras); + +## -- with no optimisation using linear PPP at each step +extras.U_initial = "linear"; +extras.U_next = "linear"; +extras.criterion = 1e-5; +extras.max_iterations = 0; +[y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras); + +## -- with optimisation using nonlinear PPP with continuation +extras.U_initial = "zero"; +extras.U_next = "continuation"; +extras.criterion = 1e-5; +extras.max_iterations = 100; +[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras); + + +## Plots +title(""); + +## U, U_c and U_l +I = [1:N]'; +IU1 = [I U(:,1)]; +IU1_c = [I U_c(:,1)]; +IU1_l = [I U_l(:,1)]; +gset grid; xlabel "Interval" +gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1" +psfig("rcPPP_U1"); + +IU2 = [I U(:,2)]; +IU2_c = [I U_c(:,2)]; +IU2_l = [I U_l(:,2)]; +gset grid; xlabel "Interval " +gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2" +psfig("rcPPP_U2"); + +## y & u +gset grid; xlabel "Time (sec)" +ty = [t y] ; tu = [t u]; +gplot ty title "Output", tu title "Input" + +psfig("rcPPP_yu"); + +gset grid; xlabel "Time (sec)" +ty_c = [t y_c] ; +ty_l = [t y_l] ; +ty = [t y] ; +tu = [t u]; +gplot ty_c title "Continuation", ty_l title "Linear", ty title "Optimisation" +psfig("rcPPP_ylco"); + ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make @@ -0,0 +1,46 @@ +#!/bin/sh + +## Makes the files needed for Figures.m +## Copyright (C) 2000 by Peter J. Gawthrop + +sys=$1 + +if [ -z "$2" ]; then + code=oct +else + code=$2 +fi + +if [ -z "$1" ]; then + echo 'Usage ./Make system_name [m|oct]' + exit +else + echo "Making sensitivity simulation for system ${sys} (code ${code})" +fi + +if [ "${code}" == "oct" ]; then + oct='-oct' +fi + +echo Switches ${oct} + +## System +mtt -q ${sys} sympar m +mtt -q ${sys} simpar m +mtt -q ${sys} numpar m +mtt -q ${sys} state m + + +## Sensitivity system +mtt -q -stdin -s s${sys} ssim m +mtt -q -stdin -s s${sys} sympar m +mtt -q -stdin -s s${sys} simpar m +mtt -q -stdin ${oct} -s s${sys} input ${code} +mtt -q -stdin ${oct} -s s${sys} ode2odes ${code} +mtt -q -stdin ${oct} -s s${sys} state ${code} +mtt -q -stdin ${oct} -s s${sys} numpar ${code} + +## Additional system reps for PPP +mtt -q -stdin ${sys} sm m +mtt -q -stdin ${sys} def m +mtt -q -stdin -s s${sys} def m ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_abg.fig Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_abg.fig ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_abg.fig +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_abg.fig @@ -0,0 +1,68 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 3600 1125 162 162 3600 1125 3690 1260 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4952 4277 5852 4277 5627 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6302 4277 7202 4277 6977 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 4051 4726 3151 4951 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6076 4051 6076 3151 6301 3376 +2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 4275 585 5175 585 5175 765 4275 765 4275 585 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5850 1215 6300 1215 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5850 1080 6300 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3600 675 4275 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5175 675 7200 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 6075 675 6075 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 6075 1215 6075 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3600 1575 7200 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3600 945 3600 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3600 1575 3600 1260 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 7200 1530 7200 765 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3866 3414 4502 4050 4184 4050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3870 5130 4505 4494 4505 4812 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1802 3375 2702 3375 2477 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1802 5175 2702 5175 2477 5400 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8550 5625 8550 225 900 225 900 5625 8550 5625 +4 1 -1 0 0 0 20 0.0000 4 210 150 4727 4367 1\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 6077 4367 0\001 +4 1 -1 0 0 0 20 0.0000 4 285 540 7787 4367 De:y\001 +4 1 -1 0 0 0 20 0.0000 4 210 375 4726 2926 R:r\001 +4 1 -1 0 0 0 20 0.0000 4 210 555 6076 2926 CS:c\001 +4 0 1 1 0 0 20 0.0000 4 150 120 4680 450 r\001 +4 0 1 1 0 0 20 0.0000 4 150 135 6480 1215 c\001 +4 0 1 1 0 0 20 0.0000 4 150 135 7425 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 210 150 7515 1305 2\001 +4 0 1 1 0 0 20 0.0000 4 150 135 3060 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 210 150 3150 1305 1\001 +4 1 1 1 0 0 20 0.0000 4 285 1425 5400 4995 Bond graph\001 +4 1 1 1 0 0 20 0.0000 4 210 1275 5400 2025 Schematic\001 +4 1 -1 0 0 0 20 0.0000 4 285 930 3285 5265 AE:ppp_2\001 +4 1 -1 0 0 0 20 0.0000 4 285 930 3285 3465 AE:ppp_1\001 +4 1 -1 0 0 0 20 0.0000 4 210 660 1440 3465 Se:u1\001 +4 1 -1 0 0 0 20 0.0000 4 210 660 1440 5265 Se:u2\001 ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_desc.tex Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_desc.tex ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_desc.tex +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_desc.tex @@ -0,0 +1,38 @@ +% Verbal description for system rcPPP (rcPPP_desc.tex) +% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/08/24 10:27:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The acausal bond graph of system \textbf{rcPPP} is +displayed in Figure \Ref{rcPPP_abg} and its label +file is listed in Section \Ref{sec:rcPPP_lbl}. +The subsystems are listed in Section \Ref{sec:rcPPP_sub}. +The system \textbf{rcPPP} is based on the simple electrical rc circuit shown in +Figure \Ref{rcPPP_abg}. + +It can be regarded as a single-input +single-output system with input $e_1$ and output $e_2$. +The bond graph in Figure \Ref{rcPPP_abg} is augmented with the {\em +open-loop\/} controller comprising +\begin{itemize} +\item two effort source \textbf{Se} components ``u1'' and ``u2'' +\item two effort amplifier \textbf{AE} components ``ppp\_1'' and `ppp\_2'' +\end{itemize} + +This is a \emph{linear} system; but it is used to illustate +\emph{nonlinear} PPP control. Not surprisingly, the \emph{nonlinear} +PPP control gives nearly the same result (Section \Ref{sec:rcPPP_nppp.ps}) +as linear open and closed-loop control. + + + + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_lbl.txt @@ -0,0 +1,44 @@ +%% Label file for system rcPPP (rcPPP_lbl.txt) +%SUMMARY rcPPP +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases +%ALIAS $1 ppp_1 +%ALIAS $2 ppp_2 +%ALIAS $3 c +%ALIAS $4 y +%ALIAS $5 r +%ALIAS $6 u1 +%ALIAS $7 u2 + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + ppp_1 lin ppp_1 + ppp_2 lin ppp_2 + +% Component type CS + c lin effort,c;q_0 + +% Component type De + y SS external + +% Component type R + r lin flow,r + +% Component type Se + u1 SS external + u2 SS external ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_nppp.m Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_nppp.m ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_nppp.m +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_nppp.m @@ -0,0 +1,146 @@ +## Figures.m +## Makes figures for the rc_PPP exasmple. +## $Log$ +## Revision 1.3 2000/08/12 10:39:33 peterg +## Levenberg-Marquardt version +## +## Revision 1.2 2000/05/21 06:39:23 peterg +## Parameterised _sm +## +## Revision 1.1 2000/05/19 13:15:38 peterg +## Initial revision +## +## Revision 1.2 2000/05/17 17:02:58 peterg +## Fixed documentation +## +## Revision 1.1 2000/05/17 09:14:37 peterg +## Initial revision +## +system_name = "rcPPP"; + +## Uncomment the following the first time +## (Or do ./Make rcPPP in this directory) + +## MTT stuff for the system simulation +##system("Make rcPPP"); + + + +t_s=[0:0.1:10]; +u = [ones(1,length(t_s));ones(1,length(t_s))]; +x_0 = rcPPP_state; +par = rcPPP_numpar; + +## Simulate the system +tick=time; +[y,x] = rcPPP_sim(x_0,u,t_s,par); +Elapsed = time-tick +plot(t_s,y,t_s,x); + +## Simulate the system to give just the final few point +t_s1 = [9:0.1:10]; +tick=time; +[y,x] = rcPPP_sim(x_0,u,t_s1,par); +Elapsed = time-tick +plot(t_s1,y,t_s1,x); + +## Sensitivity system simulation parameters +x_0s = srcPPP_state; +pars = srcPPP_numpar +sympars = srcPPP_sympar; + +## Simulate the sensitivity system +sensitivities = [sympars.ppp_1s,sympars.ppp_2s,sympars.rs] +tick=time; +[y,ys] = srcPPP_sim(x_0s,u,t_s,[sympars.r,2.0],sensitivities); +Elapsed = time-tick +plot(t_s,y,t_s,ys); + +### PPP parameters +A_w = 0; +A_u = ppp_aug(A_w,laguerre_matrix(1,10)); # Specify basis functions: constant & exp(-5t) +tau = [0.9:0.01:1]; # Optimisation interval +t_ol = [0:0.01:0.2]; # Open-loop interval +N = 5; # Number of open-loop intervals in simulation +w = 1; # Setpoint + +## Linear system +[A,B,C,D] = rcPPP_sm(par); +Q = 1; +w = 1; +ppp_lin_plot (A,B(:,1),C(1,:),D(1,1),A_u,A_w,tau,Q,w,x_0); +psfig("rcPPP_lin"); + +## Simulate non-linear PPP (on this linear system) +extras.U_initial = "zero"; +extras.U_next = "continuation"; +extras.criterion = 1e-5; +extras.max_iterations = 10; +extras.v = 0; +extras.verbose = 0; + +## -- with no optimisation using linear PPP with continuation +disp("Linear PPP at time zero with continuation trajectories") +extras.U_initial = "linear"; +extras.U_next = "continuation"; +extras.criterion = 1e-5; +extras.v = 0; +extras.max_iterations = 0; +[y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + +## -- with no optimisation using linear PPP at each step +disp("Linear PPP at each step") +extras.U_initial = "linear"; +extras.U_next = "linear"; +extras.criterion = 1e-5; +extras.max_iterations = 0; +extras.v = 0; +[y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + +## -- with optimisation using nonlinear PPP with continuation +disp("Nonlinear PPP"); +extras.U_initial = "zero"; +extras.U_next = "continuation"; +extras.v = 1e-5; +extras.criterion = 1e-5; +extras.max_iterations = 100; +extras.verbose = 0; +[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); + + +## Plots +title(""); + +## U, U_c and U_l +I = 1:N; +IU1 = [I' U(1,:)']; +IU1_c = [I' U_c(1,:)']; +IU1_l = [I' U_l(1,:)']; +gset grid; xlabel "Interval" +gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1" +psfig("rcPPP_U1"); + +IU2 = [I' U(2,:)']; +IU2_c = [I' U_c(2,:)']; +IU2_l = [I' U_l(2,:)']; +gset grid; xlabel "Interval " +gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2" +psfig("rcPPP_U2"); + +## y & u +gset grid; xlabel "Time (sec)" +ty = [t' y'] ; tu = [t' u']; +gplot ty title "Output", tu title "Input" + +psfig("rcPPP_yu"); + +title(""); +gset grid; xlabel "Time (sec)" +ty_c = [t' y_c'] ; +ty_l = [t' y_l'] ; +ty = [t' y'] ; +tu = [t' u']; +gplot ty_c title "Continuation", ty_l title "Linear", ty title "Optimisation" +psfig("rcPPP_nppp"); + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt @@ -0,0 +1,27 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (rcPPP_numpar.txt) +# Generated by MTT at Tue Apr 18 18:53:40 BST 2000 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:31:27 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c = 1.0; # CS,rcPPP +## Removed by MTT on Sat May 26 07:46:29 BST 2001: e_0 = 1.0; # CS +## Removed by MTT on Sat May 26 07:46:29 BST 2001: e_s = 1.0; # Se + +ppp_1 = 1.0; # rcPPP +ppp_2 = 0.0; # rcPPP + +## Physical parameters +c = 1.0; +q_0 = 0.0; +r = 1.0; + ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_rep.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_rep.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_rep.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_rep.txt @@ -0,0 +1,25 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system rcPPP (rcPPP_rep.txt) +## Generated by MTT on" Wed May 10 09:22:52 BST 2000. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/05/20 17:44:47 peterg +## Initial revision +## +############################################################### + +mtt rcPPP abg tex # The system description +#mtt -s srcPPP abg tex # The system description + +mtt rcPPP struc tex # The system structure +mtt -s srcPPP struc tex # The system structure + +mtt rcPPP nppp m # How its done +mtt rcPPP nppp ps # PPP output + +mtt rcPPP rep txt # PPP output + ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_input.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_input.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_input.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_input.txt @@ -0,0 +1,15 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (srcPPP_input.txt) +# Generated by MTT at Fri Apr 14 17:44:36 BST 2000 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Set the inputs +mttu(1) = 1.0; # u (srcPPP_u1_se_1) +mttu(2) = 0.0;#exp(-mttt); # u (srcPPP_u2_se_1) + +# Set the switches ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt @@ -0,0 +1,57 @@ +%% Label file for system srcPPP (srcPPP_lbl.txt) +%SUMMARY srcPPP +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:31:27 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases +%ALIAS $1 ppp_1 +%ALIAS $2 ppp_1s +%ALIAS $3 ppp_2 +%ALIAS $4 ppp_2s +%ALIAS $5 c +%ALIAS $6 cs +%ALIAS $7 y +%ALIAS $8 ys +%ALIAS $9 r +%ALIAS $10 rs +%ALIAS $11 u1 +%ALIAS $12 u1s +%ALIAS $13 u2 +%ALIAS $14 u2s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- +% Component type Ae + ppp_1 slin ppp_1;ppp_1s + ppp_2 slin ppp_2;ppp_2s + +% Component type CS + c slin effort,c;x_0;cs;x_0s + +% Component type De + y SS external + +% Component type R + r slin flow,r;rs + +% Component type Se + u1 SS external;0 + u2 SS external;0 + + ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt @@ -0,0 +1,25 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System srcPPP, representation numpar, language txt; +## File srcPPP_numpar.txt; +## Generated by MTT on Sat May 26 08:47:19 BST 2001; + + +## Parameters +c = 1.0; +r = 1.0; + +## PPP coefficients +ppp_1 = 0.0; # Default +ppp_2 = 1.0; # Default + +## State +x_0 = 0.0; # Default + +## Sensitivities +cs = 0.0; # Default +ppp_1s = 0.0; # Default +ppp_2s = 0.0; # Default +rs = 0.0; # Default +x_0s = 0.0; # Default ADDED mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt Index: mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt ================================================================== --- mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt +++ mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt @@ -0,0 +1,22 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system srcPPP (srcPPP_simpar.txt) +# Generated by MTT on Fri Apr 14 17:43:36 BST 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:31:27 peterg +## To RCS +## +############################################################### + + +FIRST = 0.0; # Last time in simulation +LAST = 2.0; # Last time in simulation +DT = 0.01; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_abg.fig @@ -0,0 +1,19 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1125 2475 2475 2475 2250 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2835 2250 2835 900 3060 1125 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2835 2700 2835 4050 3060 3825 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 2250 2475 2700 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 4725 4500 4725 450 225 450 225 4500 4725 4500 +4 2 -1 0 0 0 20 0.0000000 4 210 570 1035 2565 SS:u\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2835 2565 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 4365 R:b\001 +4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 765 I:m\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_desc.tex @@ -0,0 +1,23 @@ +% Verbal description for system Cruise (Cruise_desc.tex) +% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Cruise} is + displayed in Figure \Ref{Cruise_abg} and its label + file is listed in Section \Ref{sec:Cruise_lbl}. + The subsystems are listed in Section \Ref{sec:Cruise_sub}. + + +This is a simple teaching example to illustrare compensator design via +observer/state-feedback methods. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_lbl.txt @@ -0,0 +1,29 @@ +%SUMMARY Cruise: +%DESCRIPTION +%% Label file for system Cruise (Cruise_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/05/20 16:26:30 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type I + m lin flow,m + +% Component type R + b lin flow,b + +% Component type SS + u SS external,external ADDED mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_numpar.txt Index: mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_numpar.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_numpar.txt +++ mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_numpar.txt @@ -0,0 +1,27 @@ +# Numerical parameter file (Cruise_numpar.txt) +# Generated by MTT at Mon Jan 12 15:43:19 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +b = 1.0; # Parameter b for Cruise +b_m = 1.0; # Parameter b_m for Cruise +j = 1.0; # Parameter j for Cruise +j_m = 1.0; # Parameter j_m for Cruise +k = 1.0; # Parameter k for Cruise +k_m = 1.0; # Parameter k_m for Cruise +l = 1.0; # Parameter l for Cruise +l_a = 1.0; # Parameter l_a for Cruise +l_m = 1.0; # Parameter l_m for Cruise +r = 1.0; # Parameter r for Cruise +r_a = 1.0; # Parameter r_a for Cruise +r_m = 1.0; # Parameter r_m for Cruise + +# Initial states +x(1) = 0.0; # Initial state for Cruise_motor (l_a) +x(2) = 0.0; # Initial state for Cruise_motor (j_m) ADDED mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_params.r Index: mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_params.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_params.r +++ mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_params.r @@ -0,0 +1,11 @@ +%% Parameter file for system Cruise (Cruise_params.r) +%% This file provides symbolic parameters for simplification + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_rep.txt Index: mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_rep.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_rep.txt +++ mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_rep.txt @@ -0,0 +1,24 @@ +# Outline report file for system Cruise (Cruise_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt Cruise abg tex + +mtt -o Cruise sm tex +mtt -o Cruise tf tex + +mtt -o Cruise smc tex +mtt -o Cruise ssk tex + +mtt -o Cruise smo tex +mtt -o Cruise ssl tex + +mtt -o Cruise ctf tex + + + ADDED mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_simp.r Index: mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_simp.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_simp.r +++ mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_simp.r @@ -0,0 +1,19 @@ +%% Reduce comands to simplify output for system Cruise (Cruise_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% System +%J_m := 1; L_m := 0.1; k_m := 1; b_m := 0.1; r_m := 1; + +% Controller - poles at -2 and -10 +%alpha_c1 := 12; alpha_c2 := 20; + +% Observer - poles at -10 -50 +%alpha_o1 := 60; alpha_o2 := 500; + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_sspar.r Index: mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_sspar.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_sspar.r +++ mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_sspar.r @@ -0,0 +1,10 @@ +%% Reduce steady-state parameter file for Cruise (Cruise_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1125 2475 2475 2475 2250 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2835 2250 2835 900 3060 1125 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2835 2700 2835 4050 3060 3825 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 2250 2475 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 2475 4500 2475 4275 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 2475 6750 2475 6525 2700 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 7650 4455 7650 450 225 450 225 4455 7650 4455 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2835 2565 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 4365 R:b\001 +4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 765 I:m\001 +4 0 -1 0 0 0 20 0.0000000 4 270 570 6930 2565 SS:y\001 +4 2 -1 0 0 0 20 0.0000000 4 210 570 1035 2565 SS:u\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1080 4950 2565 INTF:int\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_desc.tex @@ -0,0 +1,33 @@ +% Verbal description for system CruiseP (CruiseP_desc.tex) +% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This is a simple teaching example to illustrate compensator design via +observer/state-feedback methods. + +The system represents a simple model of a vehicle moving along a road. +The vehicle +\begin{itemize} +\item has mass $m$ +\item is driven by a force $u=F$ +\item has velocity $v$ +\item has momentum $p=mv$ +\item has a distance along the road $y=d$ +\item The system states are taken to be: + \begin{equation} + x = + \begin{pmatrix} + p \\ d + \end{pmatrix} + \end{equation}\end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_lbl.txt @@ -0,0 +1,30 @@ +%SUMMARY CruiseP: +%DESCRIPTION +%% Label file for system CruiseP (CruiseP_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type I + m lin flow,m + +% Component type INTF + int lin flow,int + +% Component type R + b lin flow,b + +% Component type SS + u SS external,internal + y SS external,0 ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_numpar.txt Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_numpar.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_numpar.txt +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_numpar.txt @@ -0,0 +1,18 @@ +# Numerical parameter file (CruiseP_numpar.txt) +# Generated by MTT at Fri Feb 13 17:15:12 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +b = 1.0; # CruiseP +int = 1.0; # CruiseP +m = 1.0; # CruiseP + +# Initial states +x(1) = 0.0; # CruiseP (m) +x(2) = 0.0; # CruiseP_int (3) ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.fig Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.fig +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 3900 3900 309 309 3900 3900 4209 4209 +1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 2700 3900 309 309 2700 3900 3009 4209 +2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2400 2400 4200 2400 4200 3600 2400 3600 2400 2400 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 4500 2700 5700 2700 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 1200 3000 2400 3000 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 3900 1800 2700 1800 +4 0 -1 0 0 3 20 0.0000000 4 270 1380 5700 2400 v (velocity)\001 +4 0 -1 0 0 3 20 0.0000000 4 270 1095 525 2700 u (force)\001 +4 0 -1 0 0 3 20 0.0000000 4 270 1425 5700 3150 y (position)\001 +4 0 -1 0 0 3 20 0.0000000 4 255 1155 2700 3075 m (mass)\001 +4 0 -1 0 0 3 20 0.0000000 4 270 2235 3150 1575 bv (friction force)\001 +4 0 -1 0 0 3 16 0.0000000 4 195 2490 2325 5100 states: p=momentum=mv\001 +4 0 -1 0 0 3 16 0.0000000 4 210 1725 2325 5442 y=position\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.tex Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.tex +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.tex @@ -0,0 +1,7 @@ +\makebox[5.541in][l]{ + \vbox to 3.458in{ + \vfill + \special{psfile=CruiseP_pic.ps} + } + \vspace{-\baselineskip} +} ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.tex Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.tex +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.tex @@ -0,0 +1,108 @@ + + +\section{\textbf{CruiseP}: representation \textbf{abg}, language \textbf{tex}} +\label{sec:CruiseP_abg.tex} +\index{\textbf{CruiseP} -- abg} + + +MTT command: +\begin{verbatim} +mtt CruiseP abg tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_abg.tex} + + +\section{\textbf{CruiseP}: representation \textbf{ode}, language \textbf{tex}} +\label{sec:CruiseP_ode.tex} +\index{\textbf{CruiseP} -- ode} + + +MTT command: +\begin{verbatim} +mtt -o CruiseP ode tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_ode.tex} + + +\section{\textbf{CruiseP}: representation \textbf{sm}, language \textbf{tex}} +\label{sec:CruiseP_sm.tex} +\index{\textbf{CruiseP} -- sm} + + +MTT command: +\begin{verbatim} +mtt -o CruiseP sm tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_sm.tex} + + +\section{\textbf{CruiseP}: representation \textbf{tf}, language \textbf{tex}} +\label{sec:CruiseP_tf.tex} +\index{\textbf{CruiseP} -- tf} + + +MTT command: +\begin{verbatim} +mtt -o CruiseP tf tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_tf.tex} + + +\section{\textbf{CruiseP}: representation \textbf{smc}, language \textbf{tex}} +\label{sec:CruiseP_smc.tex} +\index{\textbf{CruiseP} -- smc} + + +MTT command: +\begin{verbatim} +mtt -o CruiseP smc tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_smc.tex} + + +\section{\textbf{CruiseP}: representation \textbf{ssk}, language \textbf{tex}} +\label{sec:CruiseP_ssk.tex} +\index{\textbf{CruiseP} -- ssk} + + +MTT command: +\begin{verbatim} +mtt -o CruiseP ssk tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_ssk.tex} + + +\section{\textbf{CruiseP}: representation \textbf{smo}, language \textbf{tex}} +\label{sec:CruiseP_smo.tex} +\index{\textbf{CruiseP} -- smo} + + +MTT command: +\begin{verbatim} +mtt -o CruiseP smo tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_smo.tex} + + +\section{\textbf{CruiseP}: representation \textbf{ssl}, language \textbf{tex}} +\label{sec:CruiseP_ssl.tex} +\index{\textbf{CruiseP} -- ssl} + + +MTT command: +\begin{verbatim} +mtt -o CruiseP ssl tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_ssl.tex} + + +\section{\textbf{CruiseP}: representation \textbf{ctf}, language \textbf{tex}} +\label{sec:CruiseP_ctf.tex} +\index{\textbf{CruiseP} -- ctf} + + +MTT command: +\begin{verbatim} +mtt -o CruiseP ctf tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_ctf.tex} ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.txt Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.txt +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.txt @@ -0,0 +1,24 @@ +# Outline report file for system CruiseP (CruiseP_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt CruiseP abg tex + +mtt -o CruiseP ode tex +mtt -o CruiseP sm tex +mtt -o CruiseP tf tex + +mtt -o CruiseP smc tex +mtt -o CruiseP ssk tex + +mtt -o CruiseP smo tex +mtt -o CruiseP ssl tex + +mtt -o CruiseP ctf tex + + ADDED mtt/lib/examples/Control/SimpleStateSpace/CruiseP/Makefile Index: mtt/lib/examples/Control/SimpleStateSpace/CruiseP/Makefile ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruiseP/Makefile +++ mtt/lib/examples/Control/SimpleStateSpace/CruiseP/Makefile @@ -0,0 +1,18 @@ +# +# TransFig makefile +# + +all: CruiseP_pic.tex + +# translation into ps + +CruiseP_pic.tex: CruiseP_pic.ps Makefile + fig2ps2tex CruiseP_pic.ps >CruiseP_pic.tex +clean:: + rm -f CruiseP_pic.tex + +CruiseP_pic.ps: CruiseP_pic.fig Makefile + fig2dev -L ps CruiseP_pic.fig > CruiseP_pic.ps +clean:: + rm -f CruiseP_pic.ps + ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1125 2475 2475 2475 2250 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2835 2250 2835 900 3060 1125 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2835 2700 2835 4050 3060 3825 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 2250 2475 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 2475 4500 2475 4275 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 2475 6750 2475 6525 2700 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 7650 4455 7650 450 225 450 225 4455 7650 4455 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2835 2565 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 4365 R:b\001 +4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 765 I:m\001 +4 0 -1 0 0 0 20 0.0000000 4 270 570 6930 2565 SS:y\001 +4 2 -1 0 0 0 20 0.0000000 4 210 570 1035 2565 SS:u\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1080 4950 2565 INTF:int\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_desc.tex @@ -0,0 +1,34 @@ +% Verbal description for system CruisePN (CruisePN_desc.tex) +% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This is a simple teaching example to illustrate compensator design via +observer/state-feedback methods. The equations are presented in +numerical (as opposed to symbolic) form. + +The system represents a simple model of a vehicle moving along a road. +The vehicle +\begin{itemize} +\item has mass $m$ +\item is driven by a force $u=F$ +\item has velocity $v$ +\item has momentum $p=mv$ +\item has a distance along the road $y=d$ +\item The system states are taken to be: + \begin{equation} + x = + \begin{pmatrix} + p \\ d + \end{pmatrix} + \end{equation}\end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_lbl.txt @@ -0,0 +1,30 @@ +%SUMMARY CruisePN: +%DESCRIPTION +%% Label file for system CruisePN (CruisePN_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type I + m lin flow,m + +% Component type INTF + int lin flow,int + +% Component type R + b lin flow,b + +% Component type SS + u SS external,internal + y SS external,0 ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_numpar.txt Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_numpar.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_numpar.txt +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_numpar.txt @@ -0,0 +1,18 @@ +# Numerical parameter file (CruisePN_numpar.txt) +# Generated by MTT at Fri Feb 13 17:15:12 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +b = 1.0; # CruisePN +int = 1.0; # CruisePN +m = 1.0; # CruisePN + +# Initial states +x(1) = 0.0; # CruisePN (m) +x(2) = 0.0; # CruisePN_int (3) ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.fig Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.fig +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 3900 3900 309 309 3900 3900 4209 4209 +1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 2700 3900 309 309 2700 3900 3009 4209 +2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2400 2400 4200 2400 4200 3600 2400 3600 2400 2400 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 4500 2700 5700 2700 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 1200 3000 2400 3000 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 3900 1800 2700 1800 +4 0 -1 0 0 3 20 0.0000000 4 270 1380 5700 2400 v (velocity)\001 +4 0 -1 0 0 3 20 0.0000000 4 270 1095 525 2700 u (force)\001 +4 0 -1 0 0 3 20 0.0000000 4 270 1425 5700 3150 y (position)\001 +4 0 -1 0 0 3 20 0.0000000 4 255 1155 2700 3075 m (mass)\001 +4 0 -1 0 0 3 20 0.0000000 4 270 2235 3150 1575 bv (friction force)\001 +4 0 -1 0 0 3 16 0.0000000 4 195 2490 2325 5100 states: p=momentum=mv\001 +4 0 -1 0 0 3 16 0.0000000 4 210 1725 2325 5442 y=position\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.tex Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.tex +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.tex @@ -0,0 +1,7 @@ +\makebox[5.541in][l]{ + \vbox to 3.458in{ + \vfill + \special{psfile=CruisePN_pic.ps} + } + \vspace{-\baselineskip} +} ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.tex Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.tex +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.tex @@ -0,0 +1,108 @@ + + +\section{\textbf{CruisePN}: representation \textbf{abg}, language \textbf{tex}} +\label{sec:CruisePN_abg.tex} +\index{\textbf{CruisePN} -- abg} + + +MTT command: +\begin{verbatim} +mtt CruisePN abg tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_abg.tex} + + +\section{\textbf{CruisePN}: representation \textbf{ode}, language \textbf{tex}} +\label{sec:CruisePN_ode.tex} +\index{\textbf{CruisePN} -- ode} + + +MTT command: +\begin{verbatim} +mtt -o CruisePN ode tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_ode.tex} + + +\section{\textbf{CruisePN}: representation \textbf{sm}, language \textbf{tex}} +\label{sec:CruisePN_sm.tex} +\index{\textbf{CruisePN} -- sm} + + +MTT command: +\begin{verbatim} +mtt -o CruisePN sm tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_sm.tex} + + +\section{\textbf{CruisePN}: representation \textbf{tf}, language \textbf{tex}} +\label{sec:CruisePN_tf.tex} +\index{\textbf{CruisePN} -- tf} + + +MTT command: +\begin{verbatim} +mtt -o CruisePN tf tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_tf.tex} + + +\section{\textbf{CruisePN}: representation \textbf{smc}, language \textbf{tex}} +\label{sec:CruisePN_smc.tex} +\index{\textbf{CruisePN} -- smc} + + +MTT command: +\begin{verbatim} +mtt -o CruisePN smc tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_smc.tex} + + +\section{\textbf{CruisePN}: representation \textbf{ssk}, language \textbf{tex}} +\label{sec:CruisePN_ssk.tex} +\index{\textbf{CruisePN} -- ssk} + + +MTT command: +\begin{verbatim} +mtt -o CruisePN ssk tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_ssk.tex} + + +\section{\textbf{CruisePN}: representation \textbf{smo}, language \textbf{tex}} +\label{sec:CruisePN_smo.tex} +\index{\textbf{CruisePN} -- smo} + + +MTT command: +\begin{verbatim} +mtt -o CruisePN smo tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_smo.tex} + + +\section{\textbf{CruisePN}: representation \textbf{ssl}, language \textbf{tex}} +\label{sec:CruisePN_ssl.tex} +\index{\textbf{CruisePN} -- ssl} + + +MTT command: +\begin{verbatim} +mtt -o CruisePN ssl tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_ssl.tex} + + +\section{\textbf{CruisePN}: representation \textbf{ctf}, language \textbf{tex}} +\label{sec:CruisePN_ctf.tex} +\index{\textbf{CruisePN} -- ctf} + + +MTT command: +\begin{verbatim} +mtt -o CruisePN ctf tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_ctf.tex} ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.txt Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.txt +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.txt @@ -0,0 +1,24 @@ +# Outline report file for system CruisePN (CruisePN_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt CruisePN abg tex + +mtt -o CruisePN ode tex +mtt -o CruisePN sm tex +mtt -o CruisePN tf tex + +mtt -o CruisePN smc tex +mtt -o CruisePN ssk tex + +mtt -o CruisePN smo tex +mtt -o CruisePN ssl tex + +mtt -o CruisePN ctf tex + + ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_simp.r Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_simp.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_simp.r +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_simp.r @@ -0,0 +1,21 @@ +%% Reduce comands to simplify output for system CruisePN (CruisePN_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +m := 1; +b := 0; + +alpha_o1 := 4; +alpha_o2 := 4; + +alpha_c1 := 2; +alpha_c2 := 1; + +END; + ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_sspar.r Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_sspar.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_sspar.r +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_sspar.r @@ -0,0 +1,10 @@ +%% Reduce steady-state parameter file for CruisePN (CruisePN_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruiseP_pic.tex Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruiseP_pic.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruiseP_pic.tex +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruiseP_pic.tex @@ -0,0 +1,7 @@ +\makebox[5.541in][l]{ + \vbox to 3.458in{ + \vfill + \special{psfile=CruiseP_pic.ps} + } + \vspace{-\baselineskip} +} ADDED mtt/lib/examples/Control/SimpleStateSpace/CruisePN/Makefile Index: mtt/lib/examples/Control/SimpleStateSpace/CruisePN/Makefile ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/CruisePN/Makefile +++ mtt/lib/examples/Control/SimpleStateSpace/CruisePN/Makefile @@ -0,0 +1,18 @@ +# +# TransFig makefile +# + +all: CruisePN_pic.tex + +# translation into ps + +CruisePN_pic.tex: CruisePN_pic.ps Makefile + fig2ps2tex CruisePN_pic.ps >CruisePN_pic.tex +clean:: + rm -f CruisePN_pic.tex + +CruisePN_pic.ps: CruisePN_pic.fig Makefile + fig2dev -L ps CruisePN_pic.fig > CruisePN_pic.ps +clean:: + rm -f CruisePN_pic.ps + ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_abg.fig @@ -0,0 +1,40 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 4050 4500 4050 225 1800 225 1800 4500 4050 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1575 2475 2745 2475 2475 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 2250 2925 1080 3150 1350 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3105 2475 4275 2475 4005 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 2700 2925 3870 3150 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 2475 6795 2475 6525 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 2295 6975 1125 7200 1395 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 2700 6975 3870 7200 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7200 2475 8370 2475 8100 2700 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8100 4500 8100 225 5850 225 5850 4500 8100 4500 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 4950 225 4950 225 45 9450 45 9450 4950 +4 1 -1 0 0 0 20 0.0000 4 195 135 2880 2610 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 990 4995 2565 GY:k_m\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 6975 2565 1\001 +4 1 4 0 0 0 20 0.0000 4 240 810 1080 2565 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000 4 255 510 2880 990 I:l_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 600 7065 990 I:j_m\001 +4 1 -1 0 0 0 20 0.0000 4 255 645 2970 4230 R:r_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 765 7020 4230 R:b_m\001 +4 1 1 1 0 0 20 0.0000 4 195 1095 2925 4815 Electrical\001 +4 1 1 1 0 0 20 0.0000 4 195 1335 6975 4815 Mechanical\001 +4 1 1 1 0 0 20 0.0000 4 195 630 8910 2925 Shaft\001 +4 1 1 1 0 0 20 0.0000 4 195 1170 1080 2925 Terminals\001 +4 1 4 0 0 0 20 0.0000 4 240 960 8910 2565 SS:[out]\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_desc.tex @@ -0,0 +1,37 @@ +% Verbal description for system DC (DC_desc.tex) +% Generated by MTT on Thu Sep 11 10:09:58 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{DC} is + displayed in Figure \Ref{DC_abg} and its label + file is listed in Section \Ref{sec:DC_lbl}. + The subsystems are listed in Section \Ref{sec:DC_sub}. + + \begin{table}[htbp] + \begin{center} + \leavevmode + \begin{tabular}{|l|l|} + \hline + Index & Parameter\\ + \hline + 1 & Motor gain ($k_m$) \\ + 2 & Armature inductance ($l_a$) \\ + 3 & Armature resistance ($r_a$) \\ + 4 & Inertia ($j_m$) \\ + 5 & Friction coefficient ($b_m$) \\ + \hline + \end{tabular} + \caption{DC motor parameters} + \label{tab:DC_components} + \end{center} + \end{table} +{\bf DC} is a two-port component representing a DC motor. It has the 5 +parameters listed in Table \Ref{tab:DC_components}. + + ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_lbl.txt @@ -0,0 +1,44 @@ +%SUMMARY DC: DC motor (or generator) +%DESCRIPTION Port [in]: Electrical (in) +%DESCRIPTION Port [out]: Mechanical (out) +%DESCRIPTION Parameter 1: Motor gain (k_m) +%DESCRIPTION Parameter 2: Armature inductance (l_a) +%DESCRIPTION Parameter 3: Armature resistance (r_a) +%DESCRIPTION Parameter 4: Inertia (j_m) +%DESCRIPTION Parameter 5: Friction coefficient (b_m) + + +%% Label file for system DC (DC_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/12/04 16:01:42 peterg +% %% Documantation added. +% %% +% %% Revision 1.1 1996/12/04 16:00:56 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Motor gain +k_m lin flow,$1 + +% Electrical components +%Inductance +l_a lin effort,$2 +%Resistance +r_a lin flow,$3 + +% Mechanical components +%Inertia +j_m lin flow,$4 +%Friction +b_m lin flow,$5 ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_abg.fig @@ -0,0 +1,14 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1125 2475 2475 2475 2250 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 2475 5175 2475 4950 2700 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6075 3150 6075 1800 225 1800 225 3150 6075 3150 +4 1 -1 0 0 0 20 0.0000000 4 210 1230 3195 2565 DC:motor\001 +4 0 -1 0 0 0 20 0.0000000 4 210 570 5310 2565 SS:v\001 +4 2 -1 0 0 0 20 0.0000000 4 210 555 1035 2565 SS:e\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_args.new Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_args.new ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_args.new +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_args.new @@ -0,0 +1,1 @@ + ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_desc.tex @@ -0,0 +1,36 @@ +% Verbal description for system DCexample (DCexample_desc.tex) +% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This is a simple teaching example to illustrate compensator design via +observer/state-feedback methods. + +The system represents a simple model of a DC motor including armature +resistance $r_m$, armature inductance $l_m$, motor constant $k_m$, +inertia $j_m$ and friction $b_m$. + +The DC motor has +\begin{itemize} +\item output angular velocity $y = \omega$ +\item input voltage $u = v$ +\item $\lambda = Li$ where $i$ is the armature current +\item angular momentum $p=j_m \omega$. +\item system states given by + \begin{equation} + x = + \begin{pmatrix} + \lambda \\ \omega + \end{pmatrix} + \end{equation} +\end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_lbl.txt @@ -0,0 +1,24 @@ +%SUMMARY DCexample: +%DESCRIPTION +%% Label file for system DCexample (DCexample_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type DC + motor lin k_m;l_m;r_m;j_m;b_m + +% Component type SS + e SS external,internal + v SS 0,external ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_numpar.txt Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_numpar.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_numpar.txt +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_numpar.txt @@ -0,0 +1,27 @@ +# Numerical parameter file (DCexample_numpar.txt) +# Generated by MTT at Mon Jan 12 15:43:19 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +b = 1.0; # Parameter b for DCexample +b_m = 1.0; # Parameter b_m for DCexample +j = 1.0; # Parameter j for DCexample +j_m = 1.0; # Parameter j_m for DCexample +k = 1.0; # Parameter k for DCexample +k_m = 1.0; # Parameter k_m for DCexample +l = 1.0; # Parameter l for DCexample +l_a = 1.0; # Parameter l_a for DCexample +l_m = 1.0; # Parameter l_m for DCexample +r = 1.0; # Parameter r for DCexample +r_a = 1.0; # Parameter r_a for DCexample +r_m = 1.0; # Parameter r_m for DCexample + +# Initial states +x(1) = 0.0; # Initial state for DCexample_motor (l_a) +x(2) = 0.0; # Initial state for DCexample_motor (j_m) ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_params.r Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_params.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_params.r +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_params.r @@ -0,0 +1,11 @@ +%% Parameter file for system DCexample (DCexample_params.r) +%% This file provides symbolic parameters for simplification + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.fig Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.fig +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.fig @@ -0,0 +1,32 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +6 3900 1725 7575 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 4801 1801 5701 1801 +2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5701 1726 6601 1726 6601 1876 5701 1876 5701 1726 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 + 1 1 2.00 120.00 240.00 + 6601 1801 7501 1801 7501 2401 +2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 3901 1726 4801 1726 4801 1876 3901 1876 3901 1726 +-6 +1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 7500 2700 270 270 7500 2700 7650 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 3000 1800 3900 1800 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 + 1 1 2.00 120.00 240.00 + 7500 3000 7500 3600 3000 3600 +2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 7950 2625 10800 2625 10800 2775 7950 2775 7950 2625 +2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 10800 1200 11400 1200 11400 4200 10800 4200 10800 1200 +4 0 -1 0 0 3 20 0.0000000 4 150 135 3000 2775 v\001 +4 0 -1 0 0 3 20 0.0000000 4 210 90 3300 1650 i\001 +4 2 -1 0 0 3 20 0.0000000 4 255 540 6675 2775 k_m\001 +4 2 -1 0 0 32 20 0.0000000 4 135 210 6975 2775 w\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.tex Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.tex +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.tex @@ -0,0 +1,7 @@ +\makebox[7.055in][l]{ + \vbox to 2.555in{ + \vfill + \special{psfile=DCexample_pic.ps} + } + \vspace{-\baselineskip} +} ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.tex Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.tex +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.tex @@ -0,0 +1,84 @@ + + +\section{\textbf{DCexample}: representation \textbf{abg}, language \textbf{tex}} +\label{sec:DCexample_abg.tex} +\index{\textbf{DCexample} -- abg} + + +MTT command: +\begin{verbatim} +mtt DCexample abg tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_abg.tex} + + +\section{\textbf{DCexample}: representation \textbf{sm}, language \textbf{tex}} +\label{sec:DCexample_sm.tex} +\index{\textbf{DCexample} -- sm} + + +MTT command: +\begin{verbatim} +mtt -o DCexample sm tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_sm.tex} + + +\section{\textbf{DCexample}: representation \textbf{tf}, language \textbf{tex}} +\label{sec:DCexample_tf.tex} +\index{\textbf{DCexample} -- tf} + + +MTT command: +\begin{verbatim} +mtt -o DCexample tf tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_tf.tex} + + +\section{\textbf{DCexample}: representation \textbf{smc}, language \textbf{tex}} +\label{sec:DCexample_smc.tex} +\index{\textbf{DCexample} -- smc} + + +MTT command: +\begin{verbatim} +mtt -o DCexample smc tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_smc.tex} + + +\section{\textbf{DCexample}: representation \textbf{ssk}, language \textbf{tex}} +\label{sec:DCexample_ssk.tex} +\index{\textbf{DCexample} -- ssk} + + +MTT command: +\begin{verbatim} +mtt -o DCexample ssk tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_ssk.tex} + + +\section{\textbf{DCexample}: representation \textbf{smo}, language \textbf{tex}} +\label{sec:DCexample_smo.tex} +\index{\textbf{DCexample} -- smo} + + +MTT command: +\begin{verbatim} +mtt -o DCexample smo tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_smo.tex} + + +\section{\textbf{DCexample}: representation \textbf{ssl}, language \textbf{tex}} +\label{sec:DCexample_ssl.tex} +\index{\textbf{DCexample} -- ssl} + + +MTT command: +\begin{verbatim} +mtt -o DCexample ssl tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_ssl.tex} ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.txt Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.txt +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.txt @@ -0,0 +1,21 @@ +# Outline report file for system DCexample (DCexample_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt DCexample abg tex + +mtt -o DCexample sm tex +mtt -o DCexample tf tex + +mtt -o DCexample smc tex +mtt -o DCexample ssk tex + +mtt -o DCexample smo tex +mtt -o DCexample ssl tex + + ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_simp.r Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_simp.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_simp.r +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_simp.r @@ -0,0 +1,19 @@ +%% Reduce comands to simplify output for system DCexample (DCexample_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% System +%J_m := 1; L_m := 0.1; k_m := 1; b_m := 0.1; r_m := 1; + +% Controller - poles at -2 and -10 +%alpha_c1 := 12; alpha_c2 := 20; + +% Observer - poles at -10 -50 +%alpha_o1 := 60; alpha_o2 := 500; + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_sspar.r Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_sspar.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_sspar.r +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_sspar.r @@ -0,0 +1,10 @@ +%% Reduce steady-state parameter file for DCexample (DCexample_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/DCexample/Makefile Index: mtt/lib/examples/Control/SimpleStateSpace/DCexample/Makefile ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/DCexample/Makefile +++ mtt/lib/examples/Control/SimpleStateSpace/DCexample/Makefile @@ -0,0 +1,18 @@ +# +# TransFig makefile +# + +all: DCexample_pic.tex + +# translation into ps + +DCexample_pic.tex: DCexample_pic.ps Makefile + fig2ps2tex DCexample_pic.ps >DCexample_pic.tex +clean:: + rm -f DCexample_pic.tex + +DCexample_pic.ps: DCexample_pic.fig Makefile + fig2dev -L ps DCexample_pic.fig > DCexample_pic.ps +clean:: + rm -f DCexample_pic.ps + ADDED mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2880 2655 2970 3195 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2925 2700 2925 3150 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 2700 3150 1350 3375 1575 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3172 3172 3172 4522 3397 4297 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1575 2925 2925 2925 2700 3150 +4 1 0 100 0 18 18 0.0000 4 195 150 3150 3015 0\001 +4 1 0 100 0 18 18 0.0000 4 270 540 3195 1215 I:j_1\001 +4 1 0 100 0 18 18 0.0000 4 270 540 3150 4860 I:j_2\001 +4 1 0 100 0 18 18 0.0000 4 270 750 990 3015 SS:yu\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_rep.txt Index: mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_rep.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_rep.txt +++ mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_rep.txt @@ -0,0 +1,28 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system Differential (Differential_rep.txt) +## Generated by MTT on" Wed Jan 26 10:13:44 GMT 2000. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt Differential abg tex # The system description +mtt Differential cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt Differential struc tex # The system structure +## mtt Differential dae tex # The system dae +mtt Differential ode tex # The system ode +## mtt Differential sspar tex # Steady-state parameters +## mtt Differential ss tex # Steady state +## mtt Differential dm tex # Descriptor matrices (of linearised system) +mtt Differential sm tex # State matrices (of linearised system) +mtt Differential tf tex # Transfer function (of linearised + +## mtt Differential lmfr ps # log modulus of frequency response (of linearised system) +## mtt Differential simpar tex # Simulation parameters +## mtt Differential numpar tex # Numerical simulation parameters +## mtt Differential input tex # Simulation input +mtt Differential odeso ps # Simulation output ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_abg.fig @@ -0,0 +1,55 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.0000000 1 0.000 8550 1125 485 485 8550 1125 8730 1575 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 1128 4728 2703 4953 2478 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 7650 450 9405 450 9405 675 7650 675 7650 450 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 8100 9450 225 855 225 855 8100 9450 8100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3871 3600 5446 3825 5221 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 3871 5850 5446 6075 5221 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3465 3870 3735 3870 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4590 3825 4860 3825 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5715 3870 5985 3870 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3465 1125 3735 1125 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4635 2700 4905 2700 +4 1 -1 0 0 0 20 0.0000000 4 240 870 3603 948 SS:v_x\001 +4 1 4 0 0 0 16 0.0000000 4 195 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000000 4 210 885 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000000 4 195 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 900 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 495 5850 2970 [y_a]\001 +4 1 -1 0 0 0 20 0.0000000 4 270 870 5850 945 SS:v_y\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1110 4729 3379 ROD:rod\001 +4 1 -1 0 0 0 20 0.0000000 4 240 825 3510 5760 SS:f_x\001 +4 1 -1 0 0 0 20 0.0000000 4 270 825 5760 5760 SS:f_y\001 +4 1 -1 0 0 0 20 0.0000000 4 240 810 4635 5760 SS:f_a\001 +4 0 1 1 0 3 20 0.0000000 4 240 720 6750 1260 Joint \001 +4 0 1 1 0 3 20 0.0000000 4 210 495 6795 3375 Rod\001 +4 1 -1 0 0 0 20 0.0000000 4 210 570 4771 946 SS:u\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_desc.tex @@ -0,0 +1,42 @@ +% Verbal description for system InvertedPendulumT (InvertedPendulumT_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/19 14:20:07 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{InvertedPendulumT} is + displayed in Figure \Ref{InvertedPendulumT_abg} and its label + file is listed in Section \Ref{sec:InvertedPendulumT_lbl}. + The subsystems are listed in Section \Ref{sec:InvertedPendulumT_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses the compound components: {\bf ROD}. {\bf +ROD} is essentially as described in Figure 10.2. +There is no gravity included in this model. + +This system has a number of dynamic elements (those corresponding to translation +motion) in derivative causality, thus the system is represnted as a +Differential-Algebraic Equation (Section +\Ref{sec:InvertedPendulumT_dae.tex}). Hovever, this is of contrained-state form and +therfore can be written as a set of constrained-state equations (Section +\Ref{sec:InvertedPendulumT_cse.tex}). The corresponding ordinary differential +equation is complicated due to the trig functions involved in +inverting the E matrix. + +As well as the standard representation the ``robot-form'' equations +appear in Section \Ref{sec:InvertedPendulumT_rfe}. + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_input.txt Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_input.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_input.txt +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_input.txt @@ -0,0 +1,14 @@ +# Numerical parameter file (InvertedPendulumT_input.txt) +# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +u(1) = (t<1.0); +u(2) = 0.0; # +u(3) = 0.0; # gravity ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_lbl.txt @@ -0,0 +1,43 @@ +%SUMMARY InvertedPendulumT: Pendulum with torque input at lower end + +%% Label (InvertedPendulumT_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/12/05 12:39:49 peterg +% %% Documentation +% %% +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - uniform rods +rod none l_1;l_1;j_1;m_1 + +%Zero velocity sources +v_x SS internal,0 +v_y SS internal,0 + + +%Zero force/torque sources +f_x SS 0,internal +f_a SS 0,internal +f_y SS 0,internal + + +%Torque/velocity at joint +u SS external,internal + + ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_numpar.txt Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_numpar.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_numpar.txt +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_numpar.txt @@ -0,0 +1,23 @@ +# Numerical parameter file (InvertedPendulumT_numpar.txt) +# Generated by MTT at Mon Jan 19 13:53:15 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +j_1 = 1.0; # Parameter j_1 for InvertedPendulumT +j_2 = 1.0; # Parameter j_2 for InvertedPendulumT +l_1 = 1.0; # Parameter l_1 for InvertedPendulumT +l_2 = 1.0; # Parameter l_2 for InvertedPendulumT +m_1 = 1.0; # Parameter m_1 for InvertedPendulumT +m_2 = 1.0; # Parameter m_2 for InvertedPendulumT + +# Initial states +x(1) = 0.0; # Initial state for InvertedPendulumT_rod1 (J) +x(2) = 0.0; # Initial state for InvertedPendulumT_rod1_th (3) +x(3) = 0.0; # Initial state for InvertedPendulumT_rod2 (J) +x(4) = 0.0; # Initial state for InvertedPendulumT_rod2_th (3) ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_rep.txt Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_rep.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_rep.txt +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_rep.txt @@ -0,0 +1,22 @@ +# Outline report file for system InvertedPendulumT (InvertedPendulumT_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt InvertedPendulumT abg tex + +mtt -o InvertedPendulumT ode tex +mtt -o InvertedPendulumT sm tex +mtt -o InvertedPendulumT tf tex + +mtt -o InvertedPendulumT smc tex +mtt -o InvertedPendulumT ssk tex + +mtt -o InvertedPendulumT smo tex +mtt -o InvertedPendulumT ssl tex + + ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_simp.r Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_simp.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_simp.r +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_simp.r @@ -0,0 +1,36 @@ +%% Reduce comands to simplify output for system InvertedPendulumT (InvertedPendulumT_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + + +m_1 := m; +l_1 := l; +j_1 := j; +mg := m*g; +j := m*l*l/12; + +%l:=1; + +alpha_c1 := 2; +alpha_c2 := 1; + +alpha_o1 := 20; +alpha_o2 := 100; + + +ORDER s,m,g; + + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_sspar.r Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_sspar.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_sspar.r +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_sspar.r @@ -0,0 +1,13 @@ +%% Reduce steady-state parameter file for InvertedPendulumT (InvertedPendulumT_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MTTx1 := 0; +MTTx2 := 0; + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_abg.fig @@ -0,0 +1,133 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4951 6526 5401 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 8550 7650 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8685 5265 8415 5535 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1372 3490 1372 3172 3375 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1507 3037 1237 3307 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9180 5724 9180 6042 8544 5406 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 315 6933 5268 I:J\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000000 4 270 735 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000000 4 240 735 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1170 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1170 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000000 4 210 150 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 570 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000000 4 210 990 4681 5266 INTF:th\001 +4 1 1 1 0 0 20 0.0000000 4 210 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000000 4 135 195 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000000 4 210 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000000 4 195 330 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000000 4 240 1065 2971 1216 SS:[x_a]\001 +4 1 4 0 0 0 20 0.0000000 4 240 1080 2971 9361 SS:[x_b]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1065 8372 1217 SS:[y_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1080 8417 9362 SS:[y_b]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1575 5671 1216 SS:[alpha_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1590 5671 9361 SS:[alpha_b]\001 +4 1 1 1 0 0 20 0.0000000 4 270 630 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000000 4 240 1470 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000000 4 270 645 1350 9855 Tip b\001 +4 1 -1 0 0 0 20 0.0000000 4 270 810 9225 6300 SS:mg\001 +4 2 -1 0 0 0 20 0.0000000 4 210 1020 1395 3060 SS:theta\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_desc.tex @@ -0,0 +1,20 @@ +% Verbal description for system ROD (ROD_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/08/15 09:41:19 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ROD} is + displayed in Figure \Ref{ROD_abg} and its label + file is listed in Section \Ref{sec:ROD_lbl}. + The subsystems are listed in Section \Ref{sec:ROD_sub}. + +{\bf ROD} is essentially as described in Figure 10.2 of +``Metamodelling''. ADDED mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_lbl.txt @@ -0,0 +1,58 @@ +%SUMMARY ROD: rigid rod in two dimensions +%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a +%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b +%DESCRIPTION Port [x_a]: x force/velocity - end a +%DESCRIPTION Port [x_b]: x force/velocity - end b +%DESCRIPTION Port [y_a]: y force/velocity - end a +%DESCRIPTION Port [y_b]: y force/velocity - end b +%DESCRIPTION +%DESCRIPTION Parameter 1: length from end 1 to mass centre +%DESCRIPTION Parameter 2: length from end 2 to mass centre +%DESCRIPTION Parameter 3: inertia about mass centre +%DESCRIPTION Parameter 4: mass +%DESCRIPTION See Section 10.2 of "Metamodelling" + + +%% Label file for system ROD (ROD_lbl.txt) + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,$3 +m_x lin flow,$4 +m_y lin flow,$4 + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,$1 +s2 lsin flow,$2 +c1 lcos flow,$1 +c2 lcos flow,$2 + +%Gravity +mg mg internal + +% Angle +theta external 0 + + ADDED mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_abg.fig @@ -0,0 +1,20 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1125 2475 2475 2475 2250 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 2475 4500 2475 4275 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5872 2497 7222 2497 6997 2722 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2835 2250 2835 900 3060 1125 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8145 3150 8145 450 270 450 270 3150 8145 3150 +4 1 -1 0 0 0 20 0.0000000 4 210 1080 5265 2565 INTF:int\001 +4 2 -1 0 0 0 20 0.0000000 4 210 570 1035 2565 SS:u\001 +4 0 -1 0 0 0 20 0.0000000 4 270 570 7380 2565 SS:y\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2835 2565 1\001 +4 1 -1 0 0 0 20 0.0000000 4 270 285 2880 765 I:j\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_desc.tex @@ -0,0 +1,23 @@ +% Verbal description for system Satellite (Satellite_desc.tex) +% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Satellite} is + displayed in Figure \Ref{Satellite_abg} and its label + file is listed in Section \Ref{sec:Satellite_lbl}. + The subsystems are listed in Section \Ref{sec:Satellite_sub}. + + +This is a simple teaching example to illustrare compensator design via +observer/state-feedback methods. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_lbl.txt @@ -0,0 +1,27 @@ +%SUMMARY Satellite: +%DESCRIPTION +%% Label file for system Satellite (Satellite_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type I + j lin flow,1 + +% Component type INTF + int + +% Component type SS + u SS external,internal + y SS external,0 ADDED mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_numpar.txt Index: mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_numpar.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_numpar.txt +++ mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_numpar.txt @@ -0,0 +1,27 @@ +# Numerical parameter file (Satellite_numpar.txt) +# Generated by MTT at Mon Jan 12 15:43:19 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +b = 1.0; # Parameter b for Satellite +b_m = 1.0; # Parameter b_m for Satellite +j = 1.0; # Parameter j for Satellite +j_m = 1.0; # Parameter j_m for Satellite +k = 1.0; # Parameter k for Satellite +k_m = 1.0; # Parameter k_m for Satellite +l = 1.0; # Parameter l for Satellite +l_a = 1.0; # Parameter l_a for Satellite +l_m = 1.0; # Parameter l_m for Satellite +r = 1.0; # Parameter r for Satellite +r_a = 1.0; # Parameter r_a for Satellite +r_m = 1.0; # Parameter r_m for Satellite + +# Initial states +x(1) = 0.0; # Initial state for Satellite_motor (l_a) +x(2) = 0.0; # Initial state for Satellite_motor (j_m) ADDED mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_rep.txt Index: mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_rep.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_rep.txt +++ mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_rep.txt @@ -0,0 +1,23 @@ +# Outline report file for system Satellite (Satellite_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt Satellite abg tex + +mtt -o Satellite ode tex +mtt -o Satellite sm tex +mtt -o Satellite tf tex + +mtt -o Satellite smc tex +mtt -o Satellite ssk tex + +mtt -o Satellite smo tex +mtt -o Satellite ssl tex +mtt -o Satellite ctf tex + + ADDED mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_simp.r Index: mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_simp.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_simp.r +++ mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_simp.r @@ -0,0 +1,20 @@ +%% Reduce comands to simplify output for system Satellite (Satellite_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% System + +% Controller - poles -1 +alpha_c1 := 2; alpha_c2 := 1; + +% Observer - poles at -1 +alpha_o1 := 2; alpha_o2 := 1; + +ON FACTOR; + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_sspar.r Index: mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_sspar.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_sspar.r +++ mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_sspar.r @@ -0,0 +1,10 @@ +%% Reduce steady-state parameter file for Satellite (Satellite_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/Makefile Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/Makefile ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/Makefile +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/Makefile @@ -0,0 +1,18 @@ +# +# TransFig makefile +# + +all: TwoTanks_pic.tex + +# translation into ps + +TwoTanks_pic.tex: TwoTanks_pic.ps Makefile + fig2ps2tex TwoTanks_pic.ps >TwoTanks_pic.tex +clean:: + rm -f TwoTanks_pic.tex + +TwoTanks_pic.ps: TwoTanks_pic.fig Makefile + fig2dev -L ps TwoTanks_pic.fig > TwoTanks_pic.ps +clean:: + rm -f TwoTanks_pic.ps + ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_abg.fig Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_abg.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_abg.fig +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_abg.fig @@ -0,0 +1,51 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1351 4276 2701 4276 2476 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 4501 3826 5401 3601 5401 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2971 4051 3871 3151 3871 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 3150 5625 3150 5400 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 5400 5625 5400 5400 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4051 2925 4051 1575 4276 1800 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 5670 4050 7020 4275 6795 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 2880 5850 1530 6075 1755 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 5670 5850 7020 6075 6795 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 3150 7425 3150 7200 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 5400 7425 5400 7200 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 3150 8775 4050 8505 4050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 5400 8775 4500 8775 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9001 4275 10351 4275 10126 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1350 4050 1350 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9000 4050 9000 4500 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2926 4366 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 4096 5491 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 4096 3241 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5895 3240 1\001 +4 1 -1 0 0 0 20 0.0000000 4 240 690 5895 1440 R:r_1\001 +4 1 -1 0 0 0 20 0.0000000 4 240 720 4050 1440 C:c_1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5850 5490 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 375 7650 3240 AF\001 +4 1 -1 0 0 0 20 0.0000000 4 210 375 7695 5490 AF\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8775 4365 0\001 +4 0 -1 0 0 0 20 0.0000000 4 240 825 10620 4320 SS:f_2\001 +4 2 -1 0 0 0 20 0.0000000 4 240 825 1260 4365 SS:f_1\001 +4 1 -1 0 0 0 20 0.0000000 4 240 720 4005 7335 C:c_2\001 +4 1 -1 0 0 0 20 0.0000000 4 240 690 5850 7335 R:r_2\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_desc.tex Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_desc.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_desc.tex +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_desc.tex @@ -0,0 +1,36 @@ +% Verbal description for system TwoTanks (TwoTanks_desc.tex) +% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This is a simple teaching example to illustrate compensator design via +observer/state-feedback methods. + +\begin{itemize} +\item Each tank is identical and of unit cross section. +\item Each tank has an identical inflow $f_1 = u$ +\item Each outflow is different and given by $\sigma_i v_i$ for $i=1$ + and $i=2$ where $v_i$ is the volume of liquid in tank i and + $\sigma_i$ the corresponding discharge coefficient. The net outflow + is thus $y = f_2 = \sigma_1 v_1 + \sigma_2 v_2$. +\item The system states are taken to be: + \begin{equation} + x = + \begin{pmatrix} + v_1 \\ v_2 + \end{pmatrix} + \end{equation} +\end{itemize} + + + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_lbl.txt Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_lbl.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_lbl.txt +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_lbl.txt @@ -0,0 +1,29 @@ +%SUMMARY TwoTanks: +%DESCRIPTION +%% Label file for system TwoTanks (TwoTanks_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_1 lin effort,1 + c_2 lin effort,1 + +% Component type R + r_1 lin effort,sigma_1 + r_2 lin effort,sigma_2 + +% Component type SS + f_1 SS internal,external + f_2 SS 0,external ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_params.r Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_params.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_params.r +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_params.r @@ -0,0 +1,11 @@ +%% Parameter file for system TwoTanks (TwoTanks_params.r) +%% This file provides symbolic parameters for simplification + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.fig Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.fig ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.fig +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.fig @@ -0,0 +1,33 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +6 2099 1799 3974 3974 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2100 1800 2100 3900 3900 3900 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3300 1800 3300 3600 3900 3600 +-6 +6 5025 1800 6900 3975 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6899 1801 6899 3901 5099 3901 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5699 1801 5699 3601 5099 3601 +-6 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 3 + 1 1 2.00 120.00 240.00 + 3600 3750 4200 3750 4200 4800 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 3 + 1 1 2.00 120.00 240.00 + 5400 3750 4800 3750 4800 4800 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 3 + 1 1 2.00 120.00 240.00 + 1800 1050 2400 1050 2400 2100 +2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 3 + 1 1 2.00 120.00 240.00 + 7200 1050 6600 1050 6600 2100 +4 0 -1 0 0 3 20 0.0000000 4 270 2610 3225 5250 y=total outflow = f_2\001 +4 0 -1 0 0 3 20 0.0000000 4 270 405 1950 900 f_1\001 +4 0 -1 0 0 3 20 0.0000000 4 270 405 6825 900 f_1\001 +4 0 -1 0 0 3 20 0.0000000 4 270 3525 2775 1500 u= inflow to each tank = f_1\001 ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.tex Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.tex +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.tex @@ -0,0 +1,7 @@ +\makebox[4.569in][l]{ + \vbox to 3.861in{ + \vfill + \special{psfile=TwoTanks_pic.ps} + } + \vspace{-\baselineskip} +} ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.tex Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.tex ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.tex +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.tex @@ -0,0 +1,84 @@ + + +\section{\textbf{TwoTanks}: representation \textbf{abg}, language \textbf{tex}} +\label{sec:TwoTanks_abg.tex} +\index{\textbf{TwoTanks} -- abg} + + +MTT command: +\begin{verbatim} +mtt TwoTanks abg tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_abg.tex} + + +\section{\textbf{TwoTanks}: representation \textbf{sm}, language \textbf{tex}} +\label{sec:TwoTanks_sm.tex} +\index{\textbf{TwoTanks} -- sm} + + +MTT command: +\begin{verbatim} +mtt -o TwoTanks sm tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_sm.tex} + + +\section{\textbf{TwoTanks}: representation \textbf{tf}, language \textbf{tex}} +\label{sec:TwoTanks_tf.tex} +\index{\textbf{TwoTanks} -- tf} + + +MTT command: +\begin{verbatim} +mtt -o TwoTanks tf tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_tf.tex} + + +\section{\textbf{TwoTanks}: representation \textbf{smc}, language \textbf{tex}} +\label{sec:TwoTanks_smc.tex} +\index{\textbf{TwoTanks} -- smc} + + +MTT command: +\begin{verbatim} +mtt -o TwoTanks smc tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_smc.tex} + + +\section{\textbf{TwoTanks}: representation \textbf{ssk}, language \textbf{tex}} +\label{sec:TwoTanks_ssk.tex} +\index{\textbf{TwoTanks} -- ssk} + + +MTT command: +\begin{verbatim} +mtt -o TwoTanks ssk tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_ssk.tex} + + +\section{\textbf{TwoTanks}: representation \textbf{smo}, language \textbf{tex}} +\label{sec:TwoTanks_smo.tex} +\index{\textbf{TwoTanks} -- smo} + + +MTT command: +\begin{verbatim} +mtt -o TwoTanks smo tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_smo.tex} + + +\section{\textbf{TwoTanks}: representation \textbf{ssl}, language \textbf{tex}} +\label{sec:TwoTanks_ssl.tex} +\index{\textbf{TwoTanks} -- ssl} + + +MTT command: +\begin{verbatim} +mtt -o TwoTanks ssl tex +\end{verbatim} + \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_ssl.tex} ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.txt Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.txt ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.txt +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.txt @@ -0,0 +1,21 @@ +# Outline report file for system TwoTanks (TwoTanks_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt TwoTanks abg tex + +mtt -o TwoTanks sm tex +mtt -o TwoTanks tf tex + +mtt -o TwoTanks smc tex +mtt -o TwoTanks ssk tex + +mtt -o TwoTanks smo tex +mtt -o TwoTanks ssl tex + + ADDED mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_simp.r Index: mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_simp.r ================================================================== --- mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_simp.r +++ mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_simp.r @@ -0,0 +1,10 @@ +%% Reduce comands to simplify output for system TwoTanks (TwoTanks_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_abg.dia Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_abg.dia ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_abg.dia +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_abg.dia @@ -0,0 +1,1864 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Rigid 2-dimensional bar# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[left_bottom]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[left_top]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[right_bottom]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[right_top]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #TF:a# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #TF:b# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #I:translational# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #I:rotational# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Se:weight# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_lbl.txt Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_lbl.txt ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_lbl.txt +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_lbl.txt @@ -0,0 +1,57 @@ +#SUMMARY RigidBar2D +#DESCRIPTION A rigid bar capable of motion in two directions: +#DESCRIPTION vertical translation and rotation about its centre of gravity. +#DESCRIPTION Parameters "a" and "b" are moment arms, +#DESCRIPTION "m" is the bar's mass and "J" is a moment of inertia. + +## System RigidBar2D, representation lbl, language txt +## File RigidBar2D_lbl.txt +## Generated by MTT on Thu Aug 12 21:04:24 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases +#ALIAS in left_bottom,right_bottom +#ALIAS out left_top,right_top + +## Argument aliases +#ALIAS $1 length_a +#ALIAS $2 length_b +#ALIAS $3 inertial_mass +#ALIAS $4 moment_of_inertia + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type SS + [left_bottom] SS external,external + [left_top] SS external,external + [right_bottom] SS external,external + [right_top] SS external,external + +## Component type Se + weight SS inertial_mass*gravity + +## Component type I + rotational lin flow,moment_of_inertia + translational lin flow,inertial_mass + +## Component type TF + a lin flow,length_a + b lin flow,length_b + +## Component type 0 (anonymous => default parameters) + # 0 + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + # 1 + # 1 + # 1 ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_abg.dia Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_abg.dia ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_abg.dia +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_abg.dia @@ -0,0 +1,3160 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #A stack of supported bars# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SupportedBar:bottom# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SupportedBar:top# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SupportedBar:middle*3# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[left_top,right_top]# + + + #[left_bottom,right_bottom]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Sf:ground_left# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Sf:ground_right# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[right_bottom]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:load_left# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:load_right# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[left_top]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[right_top]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[left_bottom]# + + + + + + + + + + + ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_input.txt Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_input.txt ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_input.txt +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_input.txt @@ -0,0 +1,13 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System StackOfSupportedBars, representation input, language txt; +## File StackOfSupportedBars_input.txt; +## Generated by MTT on Fri Aug 13 02:22:37 BST 2004; + + + +StackOfSupportedBars__ground_left__u = 0.0; # vertical velocity +StackOfSupportedBars__ground_right__u = 0.0; # vertical velocity +StackOfSupportedBars__load_left = 10.0 * (mttt > 5); # vertical load +StackOfSupportedBars__load_right = 0.0; # vertical load ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_lbl.txt Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_lbl.txt ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_lbl.txt +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_lbl.txt @@ -0,0 +1,43 @@ +#SUMMARY StackOfSupportedBars +#DESCRIPTION A stack of rigid 2D bars supported by spring-dampers. +#DESCRIPTION The model demonstrates hierarchical modelling in dia +#DESCRIPTION including vector ports, repeated components and +#DESCRIPTION aliasing of parameters and ports. + +## System StackOfSupportedBars, representation lbl, language txt +## File StackOfSupportedBars_lbl.txt +## Generated by MTT on Thu Aug 12 21:27:46 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases + +## Argument aliases + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type SS + load_left SS external,external + load_right SS external,external + +## Component type Sf + ground_left SS external + ground_right SS external + +## Component type SupportedBar + bottom none a;b;m_b;J_b;R_d;K_s + middle none a;b;m_b;J_b;R_d;K_s + top none a;b;m_b;J_b;R_d;K_s + +## Component type 1 (anonymous => default parameters) + # 1 + # 1 + + ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_numpar.txt Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_numpar.txt ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_numpar.txt +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_numpar.txt @@ -0,0 +1,16 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System StackOfSupportedBars, representation numpar, language txt; +## File StackOfSupportedBars_numpar.txt; +## Generated by MTT on Fri Aug 13 02:22:33 BST 2004; + + + +J_b = 3.0e-3; # bar's moment of inertia +K_s = 1.0e3; # spring's stiffness +R_d = 1.0; # damper's resistance +a = 0.5; # bar's half-length +b = 0.5; # bar's half-length +gravity = 9,81; # gravitational acceleration +m_b = 5.0; # bar's mass ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_abg.dia Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_abg.dia ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_abg.dia +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_abg.dia @@ -0,0 +1,1291 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Support# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[in]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[out]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #C:spring# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #R:damper# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_lbl.txt Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_lbl.txt ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_lbl.txt +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_lbl.txt @@ -0,0 +1,42 @@ +#SUMMARY Support +#DESCRIPTION Spring-damper support + +## System Support, representation lbl, language txt +## File Support_lbl.txt +## Generated by MTT on Thu Aug 12 21:14:12 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases + +## Argument aliases +#ALIAS $1 resistance +#ALIAS $2 stiffness + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type SS + [in] SS external,external + [out] SS external,external + +## Component type C + spring lin effort,1/stiffness + +## Component type R + damper lin flow,resistance + +## Component type 1 (anonymous => default parameters) + # 1 + # 1 + +## Component type 0 (anonymous => default parameters) + # 0 + # 0 + ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_abg.dia Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_abg.dia ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_abg.dia +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_abg.dia @@ -0,0 +1,1513 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Supported bar# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #RigidBar2D:bar# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Support:left# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Support:right# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[left_bottom]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[left_top]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[right_bottom]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[right_top]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[left_bottom]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[left_top]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[right_bottom]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[right_top]# + + + + + + + + + + + ADDED mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_lbl.txt Index: mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_lbl.txt ================================================================== --- mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_lbl.txt +++ mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_lbl.txt @@ -0,0 +1,43 @@ +#SUMMARY SupportedBar +#DESCRIPTION Rigid 2D bar with two spring-damper supports. + +## System SupportedBar, representation lbl, language txt +## File SupportedBar_lbl.txt +## Generated by MTT on Thu Aug 12 21:17:30 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases +#ALIAS in left_bottom,right_bottom +#ALIAS out left_top,right_top + +## Argument aliases +#ALIAS $1 length_a +#ALIAS $2 length_b +#ALIAS $3 inertial_mass +#ALIAS $4 moment_of_inertia +#ALIAS $5 resistance +#ALIAS $6 stiffness + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type SS + [left_bottom] SS external,external + [left_top] SS external,external + [right_bottom] SS external,external + [right_top] SS external,external + +## Component type RigidBar2D + bar none length_a;length_b;inertial_mass;moment_of_inertia + +## Component type Support + left none resistance;stiffness + right none resistance;stiffness + ADDED mtt/lib/examples/Dia/doubleOscillator/diaOscillator_abg.dia Index: mtt/lib/examples/Dia/doubleOscillator/diaOscillator_abg.dia ================================================================== --- mtt/lib/examples/Dia/doubleOscillator/diaOscillator_abg.dia +++ mtt/lib/examples/Dia/doubleOscillator/diaOscillator_abg.dia @@ -0,0 +1,752 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[in]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #I:inductance# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #R:resistance# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #C:capacitance# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[out]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ADDED mtt/lib/examples/Dia/doubleOscillator/diaOscillator_lbl.txt Index: mtt/lib/examples/Dia/doubleOscillator/diaOscillator_lbl.txt ================================================================== --- mtt/lib/examples/Dia/doubleOscillator/diaOscillator_lbl.txt +++ mtt/lib/examples/Dia/doubleOscillator/diaOscillator_lbl.txt @@ -0,0 +1,48 @@ +#SUMMARY diaOscillator +#DESCRIPTION Detailed description here + +## System diaOscillator, representation lbl, language txt +## File diaOscillator_lbl.txt +## Generated by MTT on Thu Aug 5 00:44:20 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases +#ALIAS in in +#ALIAS out out + +## Argument aliases +#ALIAS $1 capacitance +#ALIAS $2 inductance +#ALIAS $3 resistance + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type C + capacitance lin effort,capacitance + +## Component type SS + [in] SS external,external + +## Component type I + inductance lin flow,inductance + +## Component type 0 (anonymous => default parameters) + # 0 + +## Component type R + resistance lin flow,resistance + +## Component type SS + [out] SS external,external + ADDED mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_abg.dia Index: mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_abg.dia ================================================================== --- mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_abg.dia +++ mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_abg.dia @@ -0,0 +1,440 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:in# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #diaOscillator:do# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #xfigOscillator:xo# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:out# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ADDED mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_lbl.txt Index: mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_lbl.txt ================================================================== --- mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_lbl.txt +++ mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_lbl.txt @@ -0,0 +1,37 @@ +#SUMMARY doubleOscillator +#DESCRIPTION Detailed description here + +## System doubleOscillator, representation lbl, language txt +## File doubleOscillator_lbl.txt +## Generated by MTT on Thu Aug 5 00:44:56 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases + +## Argument aliases +#ALIAS $1 capacitance +#ALIAS $2 inductance +#ALIAS $3 resistance + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type diaOscillator + do lin C_d;L_d;R_d + +## Component type SS + in SS external,external + +## Component type xfigOscillator + xo lin C_x;L_x;R_x + +## Component type SS + out SS external,external + ADDED mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_abg.fig Index: mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_abg.fig ================================================================== --- mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_abg.fig +++ mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_abg.fig @@ -0,0 +1,54 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha5 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 720 3105 1620 3420 +4 2 4 100 0 18 18 0.0000 4 270 900 1620 3330 SS:[in]\001 +-6 +6 1800 3150 3240 3465 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1845 3195 3195 3195 2970 3420 +-6 +6 3420 1530 3780 2970 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3465 2925 3465 1575 3690 1800 +-6 +6 3150 3510 3510 4950 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3465 3555 3465 4905 3240 4680 +-6 +6 3780 3150 5220 3465 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 3195 5175 3195 4950 3420 +-6 +6 3420 3105 3600 3330 +4 1 0 100 0 18 18 0.0000 4 195 150 3510 3330 1\001 +-6 +6 5310 3015 5490 3240 +4 1 0 100 0 18 18 0.0000 4 195 150 5400 3240 0\001 +-6 +6 5400 1440 5760 2880 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5445 2835 5445 1485 5670 1710 +-6 +6 5670 3150 7110 3465 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 5715 3195 7065 3195 6840 3420 +-6 +6 7245 3105 8370 3420 +4 0 4 100 0 18 18 0.0000 4 270 1095 7245 3330 SS:[out]\001 +-6 +6 2970 990 4050 1260 +4 1 0 100 0 18 18 0.0000 4 210 1005 3510 1260 I:inductance\001 +-6 +6 4410 990 6480 1350 +4 1 0 100 0 18 18 0.0000 4 270 1965 5445 1260 C:capacitance\001 +-6 +6 2610 5040 4410 5310 +4 1 0 100 0 18 18 0.0000 4 210 1725 3510 5310 R:resistance\001 +-6 ADDED mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_lbl.txt Index: mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_lbl.txt ================================================================== --- mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_lbl.txt +++ mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_lbl.txt @@ -0,0 +1,46 @@ +#SUMMARY xfigOscillator +#DESCRIPTION Detailed description here + +## System xfigOscillator, representation lbl, language txt +## File xfigOscillator_lbl.txt +## Generated by MTT on Thu Aug 5 00:41:52 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases +#ALIAS in in +#ALIAS out out + +## Argument aliases +#ALIAS $1 capacitance +#ALIAS $2 inductance +#ALIAS $3 resistance + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + +## Component type 1 (anonymous => default parameters) + # 1 + +## Component type C + capacitance lin effort,capacitance + +## Component type I + inductance lin flow,inductance + +## Component type R + resistance lin flow,resistance + +## Component type SS + [in] SS external,external + [out] SS external,external + ADDED mtt/lib/examples/Dia/robotrain/make_trajectory.sh Index: mtt/lib/examples/Dia/robotrain/make_trajectory.sh ================================================================== --- mtt/lib/examples/Dia/robotrain/make_trajectory.sh +++ mtt/lib/examples/Dia/robotrain/make_trajectory.sh @@ -0,0 +1,21 @@ +#! /bin/sh +mtt -cc -no-reduce robotrain odeso ps +cd MTT_work +#set data style lines +cat < + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Train of passive off-hooked trailers pulled by a tractor# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #tractor:tractor# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #trailer:front# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #trailer:rear# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #trailer:middle# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:Fx# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:Fy# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[x2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[y2]# + + + + + + + + ADDED mtt/lib/examples/Dia/robotrain/robotrain_abg.ps Index: mtt/lib/examples/Dia/robotrain/robotrain_abg.ps ================================================================== --- mtt/lib/examples/Dia/robotrain/robotrain_abg.ps +++ mtt/lib/examples/Dia/robotrain/robotrain_abg.ps @@ -0,0 +1,892 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: robotrain_abg.dia +%%Creator: Dia v0.94 +%%CreationDate: Tue Sep 14 20:01:52 2004 +%%For: geraint +%%Orientation: Portrait +%%Magnification: 1.0000 +%%BoundingBox: 0 0 4402 1118 +%%BeginSetup +%%EndSetup +%%EndComments +%%BeginProlog +[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one +/two /three /four /five /six /seven /eight /nine /colon /semicolon +/less /equal /greater /question /at /A /B /C /D /E +/F /G /H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W /X /Y +/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c +/d /e /f /g /h /i /j /k /l /m +/n /o /p /q /r /s /t /u /v /w +/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright +/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf +/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde +/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring +/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave +/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def +/cp {closepath} bind def +/c {curveto} bind def +/f {fill} bind def +/a {arc} bind def +/ef {eofill} bind def +/ex {exch} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth pop} bind def +/tr {translate} bind def + +/ellipsedict 8 dict def +ellipsedict /mtrx matrix put +/ellipse +{ ellipsedict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def /savematrix mtrx currentmatrix def + x y tr xrad yrad sc + 0 0 1 startangle endangle arc + savematrix setmatrix + end +} def + +/mergeprocs { +dup length +3 -1 roll +dup +length +dup +5 1 roll +3 -1 roll +add +array cvx +dup +3 -1 roll +0 exch +putinterval +dup +4 2 roll +putinterval +} bind def +/Times-Roman-latin1 + /Times-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-Italic-latin1 + /Times-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-Bold-latin1 + /Times-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-BoldItalic-latin1 + /Times-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-Book-latin1 + /AvantGarde-Book findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-BookOblique-latin1 + /AvantGarde-BookOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-Demi-latin1 + /AvantGarde-Demi findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-DemiOblique-latin1 + /AvantGarde-DemiOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-Light-latin1 + /Bookman-Light findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-LightItalic-latin1 + /Bookman-LightItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-Demi-latin1 + /Bookman-Demi findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-DemiItalic-latin1 + /Bookman-DemiItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-latin1 + /Courier findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-Oblique-latin1 + /Courier-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-Bold-latin1 + /Courier-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-BoldOblique-latin1 + /Courier-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-latin1 + /Helvetica findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Oblique-latin1 + /Helvetica-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Bold-latin1 + /Helvetica-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-BoldOblique-latin1 + /Helvetica-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-latin1 + /Helvetica-Narrow findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-Oblique-latin1 + /Helvetica-Narrow-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-Bold-latin1 + /Helvetica-Narrow-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-BoldOblique-latin1 + /Helvetica-Narrow-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Roman-latin1 + /NewCenturySchoolbook-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Italic-latin1 + /NewCenturySchoolbook-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Bold-latin1 + /NewCenturySchoolbook-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-BoldItalic-latin1 + /NewCenturySchoolbook-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Roman-latin1 + /Palatino-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Italic-latin1 + /Palatino-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Bold-latin1 + /Palatino-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-BoldItalic-latin1 + /Palatino-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Symbol-latin1 + /Symbol findfont +definefont pop +/ZapfChancery-MediumItalic-latin1 + /ZapfChancery-MediumItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/ZapfDingbats-latin1 + /ZapfDingbats findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +28.346000 -28.346000 scale +38.883800 -42.978407 translate +%%EndProlog + + +0.749020 0.749020 0.749020 srgb +n -19.463800 25.034300 m -19.463800 25.934300 l -15.763800 25.934300 l -15.763800 25.034300 l f +n -19.463800 25.034300 m -19.463800 25.034300 0.000000 0.000000 180.000000 270.000000 ellipse f +n -15.763800 25.034300 m -15.763800 25.034300 0.000000 0.000000 270.000000 360.000000 ellipse f +n -19.463800 25.034300 m -19.463800 25.934300 l -15.763800 25.934300 l -15.763800 25.034300 l f +n -19.463800 25.934300 m -19.463800 25.934300 0.000000 0.000000 90.000000 180.000000 ellipse f +n -15.763800 25.934300 m -15.763800 25.934300 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n -19.463800 25.034300 m -15.763800 25.034300 l s +n -19.463800 25.934300 m -15.763800 25.934300 l s +n -19.463800 25.034300 0.000000 0.000000 180.000000 270.000000 ellipse s +n -15.763800 25.034300 0.000000 0.000000 270.000000 360.000000 ellipse s +n -19.463800 25.034300 m -19.463800 25.934300 l s +n -15.763800 25.034300 m -15.763800 25.934300 l s +n -19.463800 25.934300 0.000000 0.000000 90.000000 180.000000 ellipse s +n -15.763800 25.934300 0.000000 0.000000 0.000000 90.000000 ellipse s +n -19.533800 9.069260 m -19.533800 9.969260 l -15.833800 9.969260 l -15.833800 9.069260 l f +n -19.533800 9.069260 m -19.533800 9.069260 0.000000 0.000000 180.000000 270.000000 ellipse f +n -15.833800 9.069260 m -15.833800 9.069260 0.000000 0.000000 270.000000 360.000000 ellipse f +n -19.533800 9.069260 m -19.533800 9.969260 l -15.833800 9.969260 l -15.833800 9.069260 l f +n -19.533800 9.969260 m -19.533800 9.969260 0.000000 0.000000 90.000000 180.000000 ellipse f +n -15.833800 9.969260 m -15.833800 9.969260 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n -19.533800 9.069260 m -15.833800 9.069260 l s +n -19.533800 9.969260 m -15.833800 9.969260 l s +n -19.533800 9.069260 0.000000 0.000000 180.000000 270.000000 ellipse s +n -15.833800 9.069260 0.000000 0.000000 270.000000 360.000000 ellipse s +n -19.533800 9.069260 m -19.533800 9.969260 l s +n -15.833800 9.069260 m -15.833800 9.969260 l s +n -19.533800 9.969260 0.000000 0.000000 90.000000 180.000000 ellipse s +n -15.833800 9.969260 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n -25.513800 10.034300 m -25.513800 24.984300 l -9.713800 24.984300 l -9.713800 10.034300 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n -25.513800 10.034300 m -25.513800 24.984300 l -9.713800 24.984300 l -9.713800 10.034300 l cp s +0.749020 0.749020 0.749020 srgb +n -23.613800 7.184260 m -23.613800 9.034260 l -11.613800 9.034260 l -11.613800 7.184260 l f +n -23.613800 7.184260 m -23.613800 7.184260 0.000000 0.000000 180.000000 270.000000 ellipse f +n -11.613800 7.184260 m -11.613800 7.184260 0.000000 0.000000 270.000000 360.000000 ellipse f +n -23.613800 7.184260 m -23.613800 9.034260 l -11.613800 9.034260 l -11.613800 7.184260 l f +n -23.613800 9.034260 m -23.613800 9.034260 0.000000 0.000000 90.000000 180.000000 ellipse f +n -11.613800 9.034260 m -11.613800 9.034260 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n -23.613800 7.184260 m -11.613800 7.184260 l s +n -23.613800 9.034260 m -11.613800 9.034260 l s +n -23.613800 7.184260 0.000000 0.000000 180.000000 270.000000 ellipse s +n -11.613800 7.184260 0.000000 0.000000 270.000000 360.000000 ellipse s +n -23.613800 7.184260 m -23.613800 9.034260 l s +n -11.613800 7.184260 m -11.613800 9.034260 l s +n -23.613800 9.034260 0.000000 0.000000 90.000000 180.000000 ellipse s +n -11.613800 9.034260 0.000000 0.000000 0.000000 90.000000 ellipse s +0.749020 0.749020 0.749020 srgb +n -23.613100 25.948600 m -23.613100 27.798600 l -11.613100 27.798600 l -11.613100 25.948600 l f +n -23.613100 25.948600 m -23.613100 25.948600 0.000000 0.000000 180.000000 270.000000 ellipse f +n -11.613100 25.948600 m -11.613100 25.948600 0.000000 0.000000 270.000000 360.000000 ellipse f +n -23.613100 25.948600 m -23.613100 27.798600 l -11.613100 27.798600 l -11.613100 25.948600 l f +n -23.613100 27.798600 m -23.613100 27.798600 0.000000 0.000000 90.000000 180.000000 ellipse f +n -11.613100 27.798600 m -11.613100 27.798600 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n -23.613100 25.948600 m -11.613100 25.948600 l s +n -23.613100 27.798600 m -11.613100 27.798600 l s +n -23.613100 25.948600 0.000000 0.000000 180.000000 270.000000 ellipse s +n -11.613100 25.948600 0.000000 0.000000 270.000000 360.000000 ellipse s +n -23.613100 25.948600 m -23.613100 27.798600 l s +n -11.613100 25.948600 m -11.613100 27.798600 l s +n -23.613100 27.798600 0.000000 0.000000 90.000000 180.000000 ellipse s +n -11.613100 27.798600 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n -9.713830 16.034300 m -9.713830 17.934300 l 3.586170 17.934300 l 3.586170 16.034300 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n -9.713830 16.034300 m -9.713830 17.934300 l 3.586170 17.934300 l 3.586170 16.034300 l cp s +1.000000 1.000000 1.000000 srgb +n -38.833800 16.119300 m -38.833800 18.019300 l -25.533800 18.019300 l -25.533800 16.119300 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n -38.833800 16.119300 m -38.833800 18.019300 l -25.533800 18.019300 l -25.533800 16.119300 l cp s +1.000000 1.000000 1.000000 srgb +n 2.486170 16.984300 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 2.486170 16.984300 0.500000 0.500000 0 360 ellipse cp s +1.000000 1.000000 1.000000 srgb +n -37.813800 17.084300 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n -37.813800 17.084300 0.500000 0.500000 0 360 ellipse cp s +/Helvetica-latin1 ff 1.400000 scf sf +(Train of passive off-hooked trailers pulled by a tractor) -38.601000 4.963450 m gs 1 -1 sc sh gr +0.749020 0.749020 0.749020 srgb +n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f +n 21.150000 25.000000 m 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 24.850000 25.000000 m 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f +n 21.150000 25.900000 m 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 24.850000 25.900000 m 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 21.150000 25.000000 m 24.850000 25.000000 l s +n 21.150000 25.900000 m 24.850000 25.900000 l s +n 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 21.150000 25.000000 m 21.150000 25.900000 l s +n 24.850000 25.000000 m 24.850000 25.900000 l s +n 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse s +n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f +n 21.080000 9.035000 m 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 24.780000 9.035000 m 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f +n 21.080000 9.935000 m 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 24.780000 9.935000 m 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 21.080000 9.035000 m 24.780000 9.035000 l s +n 21.080000 9.935000 m 24.780000 9.935000 l s +n 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 21.080000 9.035000 m 21.080000 9.935000 l s +n 24.780000 9.035000 m 24.780000 9.935000 l s +n 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l cp s +0.749020 0.749020 0.749020 srgb +n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f +n 17.000000 7.150000 m 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 29.000000 7.150000 m 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f +n 17.000000 9.000000 m 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 29.000000 9.000000 m 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 17.000000 7.150000 m 29.000000 7.150000 l s +n 17.000000 9.000000 m 29.000000 9.000000 l s +n 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 17.000000 7.150000 m 17.000000 9.000000 l s +n 29.000000 7.150000 m 29.000000 9.000000 l s +n 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse s +0.749020 0.749020 0.749020 srgb +n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f +n 17.000700 25.914300 m 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse f +n 29.000700 25.914300 m 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse f +n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f +n 17.000700 27.764300 m 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse f +n 29.000700 27.764300 m 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 17.000700 25.914300 m 29.000700 25.914300 l s +n 17.000700 27.764300 m 29.000700 27.764300 l s +n 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse s +n 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse s +n 17.000700 25.914300 m 17.000700 27.764300 l s +n 29.000700 25.914300 m 29.000700 27.764300 l s +n 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse s +n 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 30.900000 16.000000 m 30.900000 17.900000 l 44.200000 17.900000 l 44.200000 16.000000 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 30.900000 16.000000 m 30.900000 17.900000 l 44.200000 17.900000 l 44.200000 16.000000 l cp s +1.000000 1.000000 1.000000 srgb +n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l cp s +1.000000 1.000000 1.000000 srgb +n 43.100000 16.950000 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 43.100000 16.950000 0.500000 0.500000 0 360 ellipse cp s +1.000000 1.000000 1.000000 srgb +n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse cp s +0.749020 0.749020 0.749020 srgb +n 61.854300 24.963600 m 61.854300 25.863600 l 65.554300 25.863600 l 65.554300 24.963600 l f +n 61.854300 24.963600 m 61.854300 24.963600 0.000000 0.000000 180.000000 270.000000 ellipse f +n 65.554300 24.963600 m 65.554300 24.963600 0.000000 0.000000 270.000000 360.000000 ellipse f +n 61.854300 24.963600 m 61.854300 25.863600 l 65.554300 25.863600 l 65.554300 24.963600 l f +n 61.854300 25.863600 m 61.854300 25.863600 0.000000 0.000000 90.000000 180.000000 ellipse f +n 65.554300 25.863600 m 65.554300 25.863600 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 61.854300 24.963600 m 65.554300 24.963600 l s +n 61.854300 25.863600 m 65.554300 25.863600 l s +n 61.854300 24.963600 0.000000 0.000000 180.000000 270.000000 ellipse s +n 65.554300 24.963600 0.000000 0.000000 270.000000 360.000000 ellipse s +n 61.854300 24.963600 m 61.854300 25.863600 l s +n 65.554300 24.963600 m 65.554300 25.863600 l s +n 61.854300 25.863600 0.000000 0.000000 90.000000 180.000000 ellipse s +n 65.554300 25.863600 0.000000 0.000000 0.000000 90.000000 ellipse s +n 61.784300 8.998550 m 61.784300 9.898550 l 65.484300 9.898550 l 65.484300 8.998550 l f +n 61.784300 8.998550 m 61.784300 8.998550 0.000000 0.000000 180.000000 270.000000 ellipse f +n 65.484300 8.998550 m 65.484300 8.998550 0.000000 0.000000 270.000000 360.000000 ellipse f +n 61.784300 8.998550 m 61.784300 9.898550 l 65.484300 9.898550 l 65.484300 8.998550 l f +n 61.784300 9.898550 m 61.784300 9.898550 0.000000 0.000000 90.000000 180.000000 ellipse f +n 65.484300 9.898550 m 65.484300 9.898550 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 61.784300 8.998550 m 65.484300 8.998550 l s +n 61.784300 9.898550 m 65.484300 9.898550 l s +n 61.784300 8.998550 0.000000 0.000000 180.000000 270.000000 ellipse s +n 65.484300 8.998550 0.000000 0.000000 270.000000 360.000000 ellipse s +n 61.784300 8.998550 m 61.784300 9.898550 l s +n 65.484300 8.998550 m 65.484300 9.898550 l s +n 61.784300 9.898550 0.000000 0.000000 90.000000 180.000000 ellipse s +n 65.484300 9.898550 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 55.804300 9.963550 m 55.804300 24.913550 l 71.604300 24.913550 l 71.604300 9.963550 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 55.804300 9.963550 m 55.804300 24.913550 l 71.604300 24.913550 l 71.604300 9.963550 l cp s +0.749020 0.749020 0.749020 srgb +n 57.704300 7.113550 m 57.704300 8.963550 l 69.704300 8.963550 l 69.704300 7.113550 l f +n 57.704300 7.113550 m 57.704300 7.113550 0.000000 0.000000 180.000000 270.000000 ellipse f +n 69.704300 7.113550 m 69.704300 7.113550 0.000000 0.000000 270.000000 360.000000 ellipse f +n 57.704300 7.113550 m 57.704300 8.963550 l 69.704300 8.963550 l 69.704300 7.113550 l f +n 57.704300 8.963550 m 57.704300 8.963550 0.000000 0.000000 90.000000 180.000000 ellipse f +n 69.704300 8.963550 m 69.704300 8.963550 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 57.704300 7.113550 m 69.704300 7.113550 l s +n 57.704300 8.963550 m 69.704300 8.963550 l s +n 57.704300 7.113550 0.000000 0.000000 180.000000 270.000000 ellipse s +n 69.704300 7.113550 0.000000 0.000000 270.000000 360.000000 ellipse s +n 57.704300 7.113550 m 57.704300 8.963550 l s +n 69.704300 7.113550 m 69.704300 8.963550 l s +n 57.704300 8.963550 0.000000 0.000000 90.000000 180.000000 ellipse s +n 69.704300 8.963550 0.000000 0.000000 0.000000 90.000000 ellipse s +0.749020 0.749020 0.749020 srgb +n 57.705000 25.877900 m 57.705000 27.727900 l 69.705000 27.727900 l 69.705000 25.877900 l f +n 57.705000 25.877900 m 57.705000 25.877900 0.000000 0.000000 180.000000 270.000000 ellipse f +n 69.705000 25.877900 m 69.705000 25.877900 0.000000 0.000000 270.000000 360.000000 ellipse f +n 57.705000 25.877900 m 57.705000 27.727900 l 69.705000 27.727900 l 69.705000 25.877900 l f +n 57.705000 27.727900 m 57.705000 27.727900 0.000000 0.000000 90.000000 180.000000 ellipse f +n 69.705000 27.727900 m 69.705000 27.727900 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 57.705000 25.877900 m 69.705000 25.877900 l s +n 57.705000 27.727900 m 69.705000 27.727900 l s +n 57.705000 25.877900 0.000000 0.000000 180.000000 270.000000 ellipse s +n 69.705000 25.877900 0.000000 0.000000 270.000000 360.000000 ellipse s +n 57.705000 25.877900 m 57.705000 27.727900 l s +n 69.705000 25.877900 m 69.705000 27.727900 l s +n 57.705000 27.727900 0.000000 0.000000 90.000000 180.000000 ellipse s +n 69.705000 27.727900 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 71.604300 15.963600 m 71.604300 17.863600 l 84.904300 17.863600 l 84.904300 15.963600 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 71.604300 15.963600 m 71.604300 17.863600 l 84.904300 17.863600 l 84.904300 15.963600 l cp s +1.000000 1.000000 1.000000 srgb +n 42.484300 16.048600 m 42.484300 17.948600 l 55.784300 17.948600 l 55.784300 16.048600 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 42.484300 16.048600 m 42.484300 17.948600 l 55.784300 17.948600 l 55.784300 16.048600 l cp s +1.000000 1.000000 1.000000 srgb +n 83.804300 16.913600 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 83.804300 16.913600 0.500000 0.500000 0 360 ellipse cp s +1.000000 1.000000 1.000000 srgb +n 43.504300 17.013600 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 43.504300 17.013600 0.500000 0.500000 0 360 ellipse cp s +0.749020 0.749020 0.749020 srgb +n 102.295000 24.858600 m 102.295000 25.758600 l 105.995000 25.758600 l 105.995000 24.858600 l f +n 102.295000 24.858600 m 102.295000 24.858600 0.000000 0.000000 180.000000 270.000000 ellipse f +n 105.995000 24.858600 m 105.995000 24.858600 0.000000 0.000000 270.000000 360.000000 ellipse f +n 102.295000 24.858600 m 102.295000 25.758600 l 105.995000 25.758600 l 105.995000 24.858600 l f +n 102.295000 25.758600 m 102.295000 25.758600 0.000000 0.000000 90.000000 180.000000 ellipse f +n 105.995000 25.758600 m 105.995000 25.758600 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 102.295000 24.858600 m 105.995000 24.858600 l s +n 102.295000 25.758600 m 105.995000 25.758600 l s +n 102.295000 24.858600 0.000000 0.000000 180.000000 270.000000 ellipse s +n 105.995000 24.858600 0.000000 0.000000 270.000000 360.000000 ellipse s +n 102.295000 24.858600 m 102.295000 25.758600 l s +n 105.995000 24.858600 m 105.995000 25.758600 l s +n 102.295000 25.758600 0.000000 0.000000 90.000000 180.000000 ellipse s +n 105.995000 25.758600 0.000000 0.000000 0.000000 90.000000 ellipse s +n 102.225000 8.893580 m 102.225000 9.793580 l 105.925000 9.793580 l 105.925000 8.893580 l f +n 102.225000 8.893580 m 102.225000 8.893580 0.000000 0.000000 180.000000 270.000000 ellipse f +n 105.925000 8.893580 m 105.925000 8.893580 0.000000 0.000000 270.000000 360.000000 ellipse f +n 102.225000 8.893580 m 102.225000 9.793580 l 105.925000 9.793580 l 105.925000 8.893580 l f +n 102.225000 9.793580 m 102.225000 9.793580 0.000000 0.000000 90.000000 180.000000 ellipse f +n 105.925000 9.793580 m 105.925000 9.793580 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 102.225000 8.893580 m 105.925000 8.893580 l s +n 102.225000 9.793580 m 105.925000 9.793580 l s +n 102.225000 8.893580 0.000000 0.000000 180.000000 270.000000 ellipse s +n 105.925000 8.893580 0.000000 0.000000 270.000000 360.000000 ellipse s +n 102.225000 8.893580 m 102.225000 9.793580 l s +n 105.925000 8.893580 m 105.925000 9.793580 l s +n 102.225000 9.793580 0.000000 0.000000 90.000000 180.000000 ellipse s +n 105.925000 9.793580 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 96.245000 9.858580 m 96.245000 24.808580 l 112.045000 24.808580 l 112.045000 9.858580 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 96.245000 9.858580 m 96.245000 24.808580 l 112.045000 24.808580 l 112.045000 9.858580 l cp s +0.749020 0.749020 0.749020 srgb +n 98.145000 7.008580 m 98.145000 8.858580 l 110.145000 8.858580 l 110.145000 7.008580 l f +n 98.145000 7.008580 m 98.145000 7.008580 0.000000 0.000000 180.000000 270.000000 ellipse f +n 110.145000 7.008580 m 110.145000 7.008580 0.000000 0.000000 270.000000 360.000000 ellipse f +n 98.145000 7.008580 m 98.145000 8.858580 l 110.145000 8.858580 l 110.145000 7.008580 l f +n 98.145000 8.858580 m 98.145000 8.858580 0.000000 0.000000 90.000000 180.000000 ellipse f +n 110.145000 8.858580 m 110.145000 8.858580 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 98.145000 7.008580 m 110.145000 7.008580 l s +n 98.145000 8.858580 m 110.145000 8.858580 l s +n 98.145000 7.008580 0.000000 0.000000 180.000000 270.000000 ellipse s +n 110.145000 7.008580 0.000000 0.000000 270.000000 360.000000 ellipse s +n 98.145000 7.008580 m 98.145000 8.858580 l s +n 110.145000 7.008580 m 110.145000 8.858580 l s +n 98.145000 8.858580 0.000000 0.000000 90.000000 180.000000 ellipse s +n 110.145000 8.858580 0.000000 0.000000 0.000000 90.000000 ellipse s +0.749020 0.749020 0.749020 srgb +n 98.145700 25.772900 m 98.145700 27.622900 l 110.145700 27.622900 l 110.145700 25.772900 l f +n 98.145700 25.772900 m 98.145700 25.772900 0.000000 0.000000 180.000000 270.000000 ellipse f +n 110.145700 25.772900 m 110.145700 25.772900 0.000000 0.000000 270.000000 360.000000 ellipse f +n 98.145700 25.772900 m 98.145700 27.622900 l 110.145700 27.622900 l 110.145700 25.772900 l f +n 98.145700 27.622900 m 98.145700 27.622900 0.000000 0.000000 90.000000 180.000000 ellipse f +n 110.145700 27.622900 m 110.145700 27.622900 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 98.145700 25.772900 m 110.145700 25.772900 l s +n 98.145700 27.622900 m 110.145700 27.622900 l s +n 98.145700 25.772900 0.000000 0.000000 180.000000 270.000000 ellipse s +n 110.145700 25.772900 0.000000 0.000000 270.000000 360.000000 ellipse s +n 98.145700 25.772900 m 98.145700 27.622900 l s +n 110.145700 25.772900 m 110.145700 27.622900 l s +n 98.145700 27.622900 0.000000 0.000000 90.000000 180.000000 ellipse s +n 110.145700 27.622900 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 82.925000 15.943600 m 82.925000 17.843600 l 96.225000 17.843600 l 96.225000 15.943600 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 82.925000 15.943600 m 82.925000 17.843600 l 96.225000 17.843600 l 96.225000 15.943600 l cp s +1.000000 1.000000 1.000000 srgb +n 84.196000 16.913600 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 84.196000 16.913600 0.500000 0.500000 0 360 ellipse cp s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 2.800000 scf sf +(tractor:tractor) dup sw 2 div 100.944292 ex sub 34.944953 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 2.800000 scf sf +(trailer:front) dup sw 2 div 61.348192 ex sub 34.703553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 2.800000 scf sf +(trailer:rear) dup sw 2 div -14.186558 ex sub 34.844953 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 2.800000 scf sf +(trailer:middle) dup sw 2 div 22.135452 ex sub 34.632853 m gs 1 -1 sc sh gr +0.200000 slw +[] 0 sd +[] 0 sd +1 slc +n 84.483555 34.044647 m 75.184070 33.987952 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 75.184070 33.987952 m 76.478511 34.745857 l s +0.200000 slw +[] 0 sd +[] 0 sd +1 slc +n 47.512349 33.878619 m 37.845646 33.861165 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 37.845646 33.861165 m 39.143328 34.613509 l s +0.200000 slw +[] 0 sd +[] 0 sd +1 slc +n 6.428436 33.924563 m -1.194715 33.969099 l s +/Helvetica-latin1 ff 0.560000 scf sf +n -1.194715 33.969099 m 0.108682 34.711497 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(SS:Fx) dup sw 2 div -20.875658 ex sub 25.173053 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(SS:Fy) dup sw 2 div -20.148458 ex sub 42.324853 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n -16.559165 30.791773 m -19.592400 26.632642 l s +n -16.559165 30.791773 m -15.953196 30.349842 l s +n -16.559165 30.791773 m -17.165133 31.233703 l s +n -19.592400 26.632642 m -18.220986 27.240280 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n -16.618011 37.299401 m -18.837856 40.270626 l s +n -16.618011 37.299401 m -16.017180 37.748291 l s +n -16.618011 37.299401 m -17.218842 36.850512 l s +n -18.837856 40.270626 m -17.459526 39.678846 l s +showpage ADDED mtt/lib/examples/Dia/robotrain/robotrain_desc.tex Index: mtt/lib/examples/Dia/robotrain/robotrain_desc.tex ================================================================== --- mtt/lib/examples/Dia/robotrain/robotrain_desc.tex +++ mtt/lib/examples/Dia/robotrain/robotrain_desc.tex @@ -0,0 +1,31 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system robotrain (robotrain_desc.tex) +% Generated by MTT on Sun Sep 12 20:03:30 BST 2004. + +The acausal bond graph of system \textbf{robotrain} is +displayed in Figure \Ref{fig:robotrain_abg.ps}. +The model is based on an off-hooked design of a passive multiple +trailer system for indoor service robots +\footnote{{Jaehyoung Lee, Woojin Chung, Munsang Kim, Chongwon Lee and Jeabok-Song, + A passive multiple trailer system for indoor service robots, + \emph{Proceedings of the 2001 IEEE/RSJ International Conference on Intelligent Robots and Systems}, + Maui, Hawaii, USA, 2001}} +The equations of motion for each trailer are given by: +\begin{align} + v_i &= v_{i-1}\cos \phi_i+D_{i-1}\dot\theta_{i-1}\sin \phi_i\\ + \dot\theta_i &= \frac{1}{L_i}\left(v_{i-1}\sin \phi_i+D_{i-1}\dot\theta_{i-1}\cos \phi_i\right)\\ + \phi_i &= \theta_{i-1}-\theta_i +\end{align} +where $v$ and $\dot\theta$ are the translational and rotational velocity of each trailer (in the body axis system), $L$ and $D$ are the lengths of the front and rear moment arms, and the subscripts $_i$ and $_{i-1}$ refer to any trailer and the one in front of it. + +The label file is listed in Section \Ref{sec:robotrain_lbl} and the +subsystems are listed in Section \Ref{sec:robotrain_sub}. + +\subsection{Trajectory} +The trajectory of each of the trailer hooks in response to a constant forward and rotational velocity is shown in figure \Ref{fig:trajectory.ps}. +\fig{trajectory}{trajectory.ps}{0.9}{Trajectory of trailer links} +The plot was generated with the following script: +\footnotesize +\verbatiminput{make_trajectory.sh} +\normalsize + ADDED mtt/lib/examples/Dia/robotrain/robotrain_input.txt Index: mtt/lib/examples/Dia/robotrain/robotrain_input.txt ================================================================== --- mtt/lib/examples/Dia/robotrain/robotrain_input.txt +++ mtt/lib/examples/Dia/robotrain/robotrain_input.txt @@ -0,0 +1,11 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System robotrain, representation input, language txt; +## File robotrain_input.txt; +## Generated by MTT on Fri Sep 10 00:39:34 BST 2004; + +robotrain__Fx = 0.0; +robotrain__Fy = 0.0; +robotrain__tractor__omega__u = 1.0; +robotrain__tractor__v__u = 1.0; ADDED mtt/lib/examples/Dia/robotrain/robotrain_lbl.txt Index: mtt/lib/examples/Dia/robotrain/robotrain_lbl.txt ================================================================== --- mtt/lib/examples/Dia/robotrain/robotrain_lbl.txt +++ mtt/lib/examples/Dia/robotrain/robotrain_lbl.txt @@ -0,0 +1,36 @@ +#SUMMARY robotrain +#DESCRIPTION Detailed description here + +## System robotrain, representation lbl, language txt +## File robotrain_lbl.txt +## Generated by MTT on Sun Sep 12 19:26:13 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases + +## Argument aliases +#ALIAS $1 D +#ALIAS $2 L + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type SS + Fx SS external,external + Fy SS external,external + +## Component type tractor + tractor lin D + +## Component type trailer + front lin D;L + middle lin D;L + rear lin D;L + ADDED mtt/lib/examples/Dia/robotrain/robotrain_rep.pdf Index: mtt/lib/examples/Dia/robotrain/robotrain_rep.pdf ================================================================== --- mtt/lib/examples/Dia/robotrain/robotrain_rep.pdf +++ mtt/lib/examples/Dia/robotrain/robotrain_rep.pdf cannot compute difference between binary files ADDED mtt/lib/examples/Dia/robotrain/robotrain_rep.txt Index: mtt/lib/examples/Dia/robotrain/robotrain_rep.txt ================================================================== --- mtt/lib/examples/Dia/robotrain/robotrain_rep.txt +++ mtt/lib/examples/Dia/robotrain/robotrain_rep.txt @@ -0,0 +1,25 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system robotrain (robotrain_rep.txt) +## Generated by MTT on" Sun Sep 12 20:02:40 BST 2004. + +mtt robotrain abg tex # The system description +#mtt robotrain cbg ps # The causal bond graph +mtt robotrain struc tex # The system structure +mtt robotrain sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt robotrain dae tex # The system dae +## mtt robotrain ode tex # The system ode +## mtt robotrain sspar tex # Steady-state parameters +## mtt robotrain ss tex # Steady state +## mtt robotrain dm tex # Descriptor matrices (of linearised system) +## mtt robotrain sm tex # State matrices (of linearised system) +## mtt robotrain tf tex # Transfer function (of linearised system) +## mtt robotrain lmfr ps # log modulus of frequency response (of linearised system) +## mtt robotrain simpar txt # Simulation parameters +## mtt robotrain numpar txt # Numerical simulation parameters +mtt robotrain state txt # Simulation initial state +mtt robotrain input txt # Simulation input +## mtt robotrain logic txt # Logic control +## mtt robotrain odeso ps # Simulation output + +## mtt robotrain rep txt # This file ADDED mtt/lib/examples/Dia/robotrain/robotrain_simpar.txt Index: mtt/lib/examples/Dia/robotrain/robotrain_simpar.txt ================================================================== --- mtt/lib/examples/Dia/robotrain/robotrain_simpar.txt +++ mtt/lib/examples/Dia/robotrain/robotrain_simpar.txt @@ -0,0 +1,12 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system robotrain (robotrain_simpar.txt) +# Generated by MTT on Sun Sep 12 18:45:47 BST 2004. + +FIRST = 0.0; # First time in simulation output +DT = 0.1; # Print interval +LAST = 10.0; # Last time in simulation +STEPFACTOR = 10; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Dia/robotrain/robotrain_state.txt Index: mtt/lib/examples/Dia/robotrain/robotrain_state.txt ================================================================== --- mtt/lib/examples/Dia/robotrain/robotrain_state.txt +++ mtt/lib/examples/Dia/robotrain/robotrain_state.txt @@ -0,0 +1,20 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System robotrain, representation state, language txt; +## File robotrain_state.txt; +## Generated by MTT on Sun Sep 12 18:46:40 BST 2004; + +robotrain__tractor__yaw__mttC = 0.0; + +robotrain__front__x_e__mttC = -D; +robotrain__front__y_e__mttC = 0.0; +robotrain__front__yaw__mttC = 0.0; + +robotrain__middle__x_e__mttC = -(D+L+D); +robotrain__middle__y_e__mttC = 0.0; +robotrain__middle__yaw__mttC = 0.0; + +robotrain__rear__x_e__mttC = -(D+L+D+L+D); +robotrain__rear__y_e__mttC = 0.0; +robotrain__rear__yaw__mttC = 0.0; ADDED mtt/lib/examples/Dia/robotrain/rotate_z.cr Index: mtt/lib/examples/Dia/robotrain/rotate_z.cr ================================================================== --- mtt/lib/examples/Dia/robotrain/rotate_z.cr +++ mtt/lib/examples/Dia/robotrain/rotate_z.cr @@ -0,0 +1,43 @@ +operator rotate_z; + +let rotate_z (R,~out_causality,1, + ~x1,~causality1,1, + ~y1,~causality2,2, + ~x2,~causality3,3, + ~y2,~causality4,4, + ~psi,~causality5,5) => % x1 + x2*cos(psi)-y2*sin(psi); + +let rotate_z (R,~out_causality,2, + ~x1,~causality1,1, + ~y1,~causality2,2, + ~x2,~causality3,3, + ~y2,~causality4,4, + ~psi,~causality5,5) => % y1 + x2*sin(psi)+y2*sin(psi); + +let rotate_z (R,~out_causality,3, + ~x1,~causality1,1, + ~y1,~causality2,2, + ~x2,~causality3,3, + ~y2,~causality4,4, + ~psi,~causality5,5) => % x2 + x1*cos(psi)+y1*sin(psi); + +let rotate_z (R,~out_causality,4, + ~x1,~causality1,1, + ~y1,~causality2,2, + ~x2,~causality3,3, + ~y2,~causality4,4, + ~psi,~causality5,5) => % y2 + -x1*sin(psi)+y1*cos(psi); + +let rotate_z (R,~out_causality,5, + ~x1,~causality1,1, + ~y1,~causality2,2, + ~x2,~causality3,3, + ~y2,~causality4,4, + ~psi,~causality5,5) => % x1 + 0; + +;end; ADDED mtt/lib/examples/Dia/robotrain/rotate_z.pm Index: mtt/lib/examples/Dia/robotrain/rotate_z.pm ================================================================== --- mtt/lib/examples/Dia/robotrain/rotate_z.pm +++ mtt/lib/examples/Dia/robotrain/rotate_z.pm @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# Model Transformation Tools +#------------------------------------------------------------------------------- + + +package rotate_z; + +#------------------------------------------------------------------------------- +# rotation of x-y plane about z +#------------------------------------------------------------------------------- + +use strict; +use warnings; + +#------------------------------------------------------------------------------- +# standard module header (see perlmod for explanation) +#------------------------------------------------------------------------------- +BEGIN { + use Exporter (); + our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION = 1.00; + + @ISA = qw(Exporter); + @EXPORT = qw(&rotate_z); # CR name + %EXPORT_TAGS = ( ); +} + +#------------------------------------------------------------------------------- +# declaration of specific component implementations +#------------------------------------------------------------------------------- +sub rotate_z_R(@); # R + +#------------------------------------------------------------------------------- +# main function: selects which subfunction to call +#------------------------------------------------------------------------------- +sub rotate_z (@) { + + my $retval; + + $_ = $_[0]; + + s/\((.*)\)/$1/; # strip brackets + my @args = split (/,/); # split arguments + + $_ = $args[0]; # get component type + + # select rule to use + if (/^R|r$/) { $retval = rotate_z_R (@args); } + + # if a substitution has been made ($retval) + if ($retval) + { + return $retval; # return substituted expression + } + else # return nothing + { + return; + } +} + +#------------------------------------------------------------------------------- +# R +#------------------------------------------------------------------------------- +sub rotate_z_R (@) { + + my @args = @_; + my $retval = ''; + + if ($#args == 18-1) + { + my ($component, + $out_causality, $out_port, + $x1, $causality1, $port1, + $y1, $causality2, $port2, + $x2, $causality3, $port3, + $y2, $causality4, $port4, + $psi, $causality5, $port5) = @args; + + # [ x2 ] [ +cos(psi) +sin(psi) 0 ] [ x1 ] + # [ y2 ] = [ -sin(psi) +cos(psi) 0 ] [ y1 ] + # [ z2 ] [ 0 0 1 ] [ z1 ] + + # for reverse transformation (x2->x1) use psi=-psi + # note that cos(-psi)=cos(psi) and sin(-psi)=-sin(psi) + + if ($out_port == 1) # x1 + { + $retval = "(($x2)*(+cos($psi))+($y2)*(-sin($psi)))"; + } + elsif ($out_port == 2) # y1 + { + $retval = "(($x2)*(+sin($psi))+($y2)*(+cos($psi)))"; + } + elsif ($out_port == 3) # x2 + { + $retval = "(($x1)*(+cos($psi))+($y1)*(+sin($psi)))"; + } + elsif ($out_port == 4) # y2 + { + $retval = "(($x1)*(-sin($psi))+($y1)*(+cos($psi)))"; + } + elsif ($out_port == 5) + { + $retval = "(0)"; + } + } + + if ($retval) + { + return $retval; + } + else + { + return; + } +} + +#------------------------------------------------------------------------------- +1; # return true + ADDED mtt/lib/examples/Dia/robotrain/rotation_abg.dia Index: mtt/lib/examples/Dia/robotrain/rotation_abg.dia ================================================================== --- mtt/lib/examples/Dia/robotrain/rotation_abg.dia +++ mtt/lib/examples/Dia/robotrain/rotation_abg.dia @@ -0,0 +1,1251 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Rotation about Z# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[x_1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[y_1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[x_2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[y_2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[psi]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #R:rotation# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[3]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[4]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #AE# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[5]# + + + + + + + + ADDED mtt/lib/examples/Dia/robotrain/rotation_abg.ps Index: mtt/lib/examples/Dia/robotrain/rotation_abg.ps ================================================================== --- mtt/lib/examples/Dia/robotrain/rotation_abg.ps +++ mtt/lib/examples/Dia/robotrain/rotation_abg.ps @@ -0,0 +1,535 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: rotation_abg.dia +%%Creator: Dia v0.94+bondgraph +%%CreationDate: Sun Sep 12 21:15:37 2004 +%%For: geraint +%%Orientation: Portrait +%%Magnification: 1.0000 +%%BoundingBox: 0 0 1082 815 +%%BeginSetup +%%EndSetup +%%EndComments +%%BeginProlog +[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one +/two /three /four /five /six /seven /eight /nine /colon /semicolon +/less /equal /greater /question /at /A /B /C /D /E +/F /G /H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W /X /Y +/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c +/d /e /f /g /h /i /j /k /l /m +/n /o /p /q /r /s /t /u /v /w +/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright +/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf +/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde +/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring +/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave +/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def +/cp {closepath} bind def +/c {curveto} bind def +/f {fill} bind def +/a {arc} bind def +/ef {eofill} bind def +/ex {exch} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth pop} bind def +/tr {translate} bind def + +/ellipsedict 8 dict def +ellipsedict /mtrx matrix put +/ellipse +{ ellipsedict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def /savematrix mtrx currentmatrix def + x y tr xrad yrad sc + 0 0 1 startangle endangle arc + savematrix setmatrix + end +} def + +/mergeprocs { +dup length +3 -1 roll +dup +length +dup +5 1 roll +3 -1 roll +add +array cvx +dup +3 -1 roll +0 exch +putinterval +dup +4 2 roll +putinterval +} bind def +/Times-Roman-latin1 + /Times-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-Italic-latin1 + /Times-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-Bold-latin1 + /Times-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-BoldItalic-latin1 + /Times-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-Book-latin1 + /AvantGarde-Book findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-BookOblique-latin1 + /AvantGarde-BookOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-Demi-latin1 + /AvantGarde-Demi findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-DemiOblique-latin1 + /AvantGarde-DemiOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-Light-latin1 + /Bookman-Light findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-LightItalic-latin1 + /Bookman-LightItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-Demi-latin1 + /Bookman-Demi findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-DemiItalic-latin1 + /Bookman-DemiItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-latin1 + /Courier findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-Oblique-latin1 + /Courier-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-Bold-latin1 + /Courier-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-BoldOblique-latin1 + /Courier-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-latin1 + /Helvetica findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Oblique-latin1 + /Helvetica-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Bold-latin1 + /Helvetica-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-BoldOblique-latin1 + /Helvetica-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-latin1 + /Helvetica-Narrow findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-Oblique-latin1 + /Helvetica-Narrow-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-Bold-latin1 + /Helvetica-Narrow-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-BoldOblique-latin1 + /Helvetica-Narrow-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Roman-latin1 + /NewCenturySchoolbook-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Italic-latin1 + /NewCenturySchoolbook-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Bold-latin1 + /NewCenturySchoolbook-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-BoldItalic-latin1 + /NewCenturySchoolbook-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Roman-latin1 + /Palatino-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Italic-latin1 + /Palatino-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Bold-latin1 + /Palatino-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-BoldItalic-latin1 + /Palatino-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Symbol-latin1 + /Symbol findfont +definefont pop +/ZapfChancery-MediumItalic-latin1 + /ZapfChancery-MediumItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/ZapfDingbats-latin1 + /ZapfDingbats findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +28.346000 -28.346000 scale +-0.900000 -26.307107 translate +%%EndProlog + + +/Helvetica-latin1 ff 1.400000 scf sf +0.000000 0.000000 0.000000 srgb +(Rotation about Z) 0.900000 -1.012500 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +0.000000 0.000000 1.000000 srgb +(SS:[x_1]) dup sw 2 div 4.837502 ex sub 3.103553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +(SS:[y_1]) dup sw 2 div 6.948192 ex sub 23.653553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +1.000000 0.000000 0.000000 srgb +(SS:[x_2]) dup sw 2 div 36.304442 ex sub 12.253553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +(SS:[y_2]) dup sw 2 div 18.410692 ex sub -0.896447 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +0.627451 0.125490 0.941176 srgb +(SS:[psi]) dup sw 2 div 18.441892 ex sub 25.603553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +(R:rotation) dup sw 2 div 18.450042 ex sub 12.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +0.000000 0.000000 1.000000 srgb +n 7.132941 4.354610 m 10.038120 6.254396 l s +n 10.038120 6.254396 m 8.540433 6.171136 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +1.000000 0.000000 0.000000 srgb +(0) dup sw 2 div 27.916942 ex sub 12.253553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +0.000000 0.000000 1.000000 srgb +(0) dup sw 2 div 11.741942 ex sub 7.618553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +(0) dup sw 2 div 12.841942 ex sub 17.768553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +1.000000 0.000000 0.000000 srgb +(0) dup sw 2 div 18.391942 ex sub 5.718553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +0.000000 0.000000 1.000000 srgb +n 8.605490 21.748750 m 11.267337 19.090836 l s +n 11.267337 19.090836 m 10.878037 20.539437 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +1.000000 0.000000 0.000000 srgb +n 29.783602 12.003600 m 32.563514 12.003600 l s +n 32.563514 12.003600 m 31.264476 12.753600 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 18.397452 3.514902 m 18.405148 0.807198 l s +n 18.405148 0.807198 m 19.151453 2.108362 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +0.000000 0.000000 1.000000 srgb +n 13.434240 8.525280 m 16.232361 10.437823 l s +n 16.232361 10.437823 m 14.736688 10.323972 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 14.418753 15.953866 m 16.780386 13.610382 l s +n 16.780386 13.610382 m 16.386571 15.057763 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +1.000000 0.000000 0.000000 srgb +n 22.566713 11.975343 m 26.049616 11.993738 l s +n 26.049616 11.993738 m 24.746634 12.736867 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 18.432499 10.000119 m 18.409401 7.422031 l s +n 18.409401 7.422031 m 19.171009 8.714298 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +0.627451 0.125490 0.941176 srgb +(AE) dup sw 2 div 18.460692 ex sub 18.953553 m gs 1 -1 sc sh gr +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 18.447422 23.400183 m 18.455178 20.657017 l s +n 18.455178 20.657017 m 19.201502 21.958170 l s +n 18.455178 20.657017 m 17.701508 21.953930 l s +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 18.457604 16.750263 m 18.453096 13.906937 l s +n 18.453096 13.906937 m 19.205155 15.204785 l s +n 18.453096 13.906937 m 17.705157 15.207163 l s +showpage ADDED mtt/lib/examples/Dia/robotrain/rotation_desc.tex Index: mtt/lib/examples/Dia/robotrain/rotation_desc.tex ================================================================== --- mtt/lib/examples/Dia/robotrain/rotation_desc.tex +++ mtt/lib/examples/Dia/robotrain/rotation_desc.tex @@ -0,0 +1,22 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system rotation (rotation_desc.tex) +% Generated by MTT on Sun Sep 12 22:06:34 BST 2004. + +The acausal bond graph of system \textbf{rotation} is +displayed in Figure \Ref{fig:rotation_abg.ps} +. +The label file is listed in Section \Ref{sec:rotation_lbl} and the +subsystems are listed in Section \Ref{sec:rotation_sub}. + +\subsubsection{rotate\_z constitutive relationship} +The rotation between body and Earth axes is achieved using the ``rotate\_z'' constitutive relationship which is implemented as a Reduce file (.cr) and a Perl module (.pm) to permit the model to be built with or without MTT's -no-reduce option. + +\paragraph{rotate\_z.cr} +\footnotesize +\verbatiminput{rotate_z.cr} +\normalsize + +\paragraph{rotate\_z.pm} +\footnotesize +\verbatiminput{rotate_z.pm} +\normalsize ADDED mtt/lib/examples/Dia/robotrain/rotation_lbl.txt Index: mtt/lib/examples/Dia/robotrain/rotation_lbl.txt ================================================================== --- mtt/lib/examples/Dia/robotrain/rotation_lbl.txt +++ mtt/lib/examples/Dia/robotrain/rotation_lbl.txt @@ -0,0 +1,44 @@ +#SUMMARY rotation +#DESCRIPTION Detailed description here + +## System rotation, representation lbl, language txt +## File rotation_lbl.txt +## Generated by MTT on Tue Sep 7 16:59:01 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases +#ALIAS in x_earth,y_earth +#ALIAS out x_body,y_body + +## Argument aliases + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 0 (anonymous => default parameters) + # 0 + # 0 + # 0 + # 0 + # 0 + +## Component type AF (anonymous => default parameters) + # AF + +## Component type R + rotation rotate_z + +## Component type SS + [psi] SS external,external + [x_body] SS external,external + [x_earth] SS external,external + [y_body] SS external,external + [y_earth] SS external,external + ADDED mtt/lib/examples/Dia/robotrain/tractor_abg.dia Index: mtt/lib/examples/Dia/robotrain/tractor_abg.dia ================================================================== --- mtt/lib/examples/Dia/robotrain/tractor_abg.dia +++ mtt/lib/examples/Dia/robotrain/tractor_abg.dia @@ -0,0 +1,1458 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Tractor# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #rotation:z2# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #TF:D# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[x2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[y2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[x_1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[y_1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[x_2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[y_2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Sf:v# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Sf:omega# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #INTF:yaw# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[psi]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #AE:negative# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ADDED mtt/lib/examples/Dia/robotrain/tractor_abg.ps Index: mtt/lib/examples/Dia/robotrain/tractor_abg.ps ================================================================== --- mtt/lib/examples/Dia/robotrain/tractor_abg.ps +++ mtt/lib/examples/Dia/robotrain/tractor_abg.ps @@ -0,0 +1,642 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: tractor_abg.dia +%%Creator: Dia v0.94+bondgraph +%%CreationDate: Sun Sep 12 21:15:57 2004 +%%For: geraint +%%Orientation: Portrait +%%Magnification: 1.0000 +%%BoundingBox: 0 0 1177 1288 +%%BeginSetup +%%EndSetup +%%EndComments +%%BeginProlog +[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one +/two /three /four /five /six /seven /eight /nine /colon /semicolon +/less /equal /greater /question /at /A /B /C /D /E +/F /G /H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W /X /Y +/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c +/d /e /f /g /h /i /j /k /l /m +/n /o /p /q /r /s /t /u /v /w +/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright +/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf +/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde +/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring +/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave +/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def +/cp {closepath} bind def +/c {curveto} bind def +/f {fill} bind def +/a {arc} bind def +/ef {eofill} bind def +/ex {exch} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth pop} bind def +/tr {translate} bind def + +/ellipsedict 8 dict def +ellipsedict /mtrx matrix put +/ellipse +{ ellipsedict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def /savematrix mtrx currentmatrix def + x y tr xrad yrad sc + 0 0 1 startangle endangle arc + savematrix setmatrix + end +} def + +/mergeprocs { +dup length +3 -1 roll +dup +length +dup +5 1 roll +3 -1 roll +add +array cvx +dup +3 -1 roll +0 exch +putinterval +dup +4 2 roll +putinterval +} bind def +/Times-Roman-latin1 + /Times-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-Italic-latin1 + /Times-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-Bold-latin1 + /Times-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-BoldItalic-latin1 + /Times-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-Book-latin1 + /AvantGarde-Book findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-BookOblique-latin1 + /AvantGarde-BookOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-Demi-latin1 + /AvantGarde-Demi findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-DemiOblique-latin1 + /AvantGarde-DemiOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-Light-latin1 + /Bookman-Light findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-LightItalic-latin1 + /Bookman-LightItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-Demi-latin1 + /Bookman-Demi findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-DemiItalic-latin1 + /Bookman-DemiItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-latin1 + /Courier findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-Oblique-latin1 + /Courier-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-Bold-latin1 + /Courier-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-BoldOblique-latin1 + /Courier-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-latin1 + /Helvetica findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Oblique-latin1 + /Helvetica-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Bold-latin1 + /Helvetica-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-BoldOblique-latin1 + /Helvetica-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-latin1 + /Helvetica-Narrow findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-Oblique-latin1 + /Helvetica-Narrow-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-Bold-latin1 + /Helvetica-Narrow-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-BoldOblique-latin1 + /Helvetica-Narrow-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Roman-latin1 + /NewCenturySchoolbook-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Italic-latin1 + /NewCenturySchoolbook-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Bold-latin1 + /NewCenturySchoolbook-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-BoldItalic-latin1 + /NewCenturySchoolbook-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Roman-latin1 + /Palatino-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Italic-latin1 + /Palatino-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Bold-latin1 + /Palatino-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-BoldItalic-latin1 + /Palatino-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Symbol-latin1 + /Symbol findfont +definefont pop +/ZapfChancery-MediumItalic-latin1 + /ZapfChancery-MediumItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/ZapfDingbats-latin1 + /ZapfDingbats findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +28.346000 -28.346000 scale +5.050000 -52.507107 translate +%%EndProlog + + +0.749020 0.749020 0.749020 srgb +n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f +n 21.150000 25.000000 m 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 24.850000 25.000000 m 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f +n 21.150000 25.900000 m 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 24.850000 25.900000 m 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 21.150000 25.000000 m 24.850000 25.000000 l s +n 21.150000 25.900000 m 24.850000 25.900000 l s +n 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 21.150000 25.000000 m 21.150000 25.900000 l s +n 24.850000 25.000000 m 24.850000 25.900000 l s +n 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse s +n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f +n 21.080000 9.035000 m 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 24.780000 9.035000 m 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f +n 21.080000 9.935000 m 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 24.780000 9.935000 m 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 21.080000 9.035000 m 24.780000 9.035000 l s +n 21.080000 9.935000 m 24.780000 9.935000 l s +n 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 21.080000 9.035000 m 21.080000 9.935000 l s +n 24.780000 9.035000 m 24.780000 9.935000 l s +n 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l cp s +0.749020 0.749020 0.749020 srgb +n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f +n 17.000000 7.150000 m 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 29.000000 7.150000 m 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f +n 17.000000 9.000000 m 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 29.000000 9.000000 m 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 17.000000 7.150000 m 29.000000 7.150000 l s +n 17.000000 9.000000 m 29.000000 9.000000 l s +n 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 17.000000 7.150000 m 17.000000 9.000000 l s +n 29.000000 7.150000 m 29.000000 9.000000 l s +n 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse s +0.749020 0.749020 0.749020 srgb +n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f +n 17.000700 25.914300 m 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse f +n 29.000700 25.914300 m 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse f +n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f +n 17.000700 27.764300 m 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse f +n 29.000700 27.764300 m 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 17.000700 25.914300 m 29.000700 25.914300 l s +n 17.000700 27.764300 m 29.000700 27.764300 l s +n 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse s +n 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse s +n 17.000700 25.914300 m 17.000700 27.764300 l s +n 29.000700 25.914300 m 29.000700 27.764300 l s +n 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse s +n 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l cp s +1.000000 1.000000 1.000000 srgb +n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse cp s +/Helvetica-latin1 ff 1.400000 scf sf +(Tractor) -3.804070 8.965100 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +(rotation:z2) dup sw 2 div 8.466942 ex sub 36.053553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(TF:D) dup sw 2 div 15.973192 ex sub 43.653553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(SS:[x2]) dup sw 2 div -2.589308 ex sub 36.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(SS:[y2]) dup sw 2 div 8.410692 ex sub 29.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(1) dup sw 2 div 23.816942 ex sub 36.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(1) dup sw 2 div 24.216942 ex sub 51.853553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 21.950301 35.891440 m 12.833155 35.832044 l s +n 12.833155 35.832044 m 14.127279 36.590491 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 22.641483 49.986534 m 17.640695 45.012255 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 17.640695 45.012255 m 18.032772 46.460107 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 14.320247 41.691015 m 10.119893 37.466185 l s +n 10.119893 37.466185 m 11.567648 37.858621 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 4.100304 35.843095 m 0.871380 35.872299 l s +n 4.100304 35.843095 m 4.107087 36.593064 l s +n 4.100304 35.843095 m 4.093521 35.093125 l s +n 0.871380 35.872299 m 2.177148 36.610520 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 8.451012 33.849745 m 8.426618 30.857455 l s +n 8.451012 33.849745 m 9.200987 33.843631 l s +n 8.451012 33.849745 m 7.701037 33.855859 l s +n 8.426618 30.857455 m 9.187183 32.150336 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(Sf:v) dup sw 2 div 33.566942 ex sub 36.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(Sf:omega) dup sw 2 div 33.423192 ex sub 51.853553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(INTF:yaw) dup sw 2 div 24.191942 ex sub 47.453553 m gs 1 -1 sc sh gr +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 24.205823 49.604007 m 24.202977 49.103193 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 24.202977 49.103193 m 24.960346 50.397949 l s +n 24.202977 49.103193 m 23.460370 50.406472 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(0) dup sw 2 div 24.216942 ex sub 43.203553 m gs 1 -1 sc sh gr +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 24.203373 45.203178 m 24.205412 44.856616 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 24.205412 44.856616 m 24.947757 46.160043 l s +n 24.205412 44.856616 m 23.447783 46.151220 l s +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 15.079625 38.564846 m 11.673015 37.142354 l s +n 11.673015 37.142354 m 12.582750 38.334991 l s +n 11.673015 37.142354 m 13.160736 36.950819 l s +n 11.673015 37.142354 m 11.384022 37.834440 l s +n 11.673015 37.142354 m 11.962008 36.450268 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 30.950033 35.903600 m 25.683950 35.903600 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 25.683950 35.903600 m 26.982988 36.653600 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 29.399573 51.553600 m 26.082238 51.553600 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 26.082238 51.553600 m 27.381276 52.303600 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(AE:negative) dup sw 2 div 18.285642 ex sub 40.153553 m gs 1 -1 sc sh gr +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 22.457897 42.013896 m 21.061956 41.307830 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 21.061956 41.307830 m 21.882638 42.563410 l s +n 21.061956 41.307830 m 22.559662 41.224889 l s +showpage ADDED mtt/lib/examples/Dia/robotrain/tractor_lbl.txt Index: mtt/lib/examples/Dia/robotrain/tractor_lbl.txt ================================================================== --- mtt/lib/examples/Dia/robotrain/tractor_lbl.txt +++ mtt/lib/examples/Dia/robotrain/tractor_lbl.txt @@ -0,0 +1,49 @@ +#SUMMARY tractor +#DESCRIPTION Detailed description here + +## System tractor, representation lbl, language txt +## File tractor_lbl.txt +## Generated by MTT on Wed Sep 8 00:42:45 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases +#ALIAS out x2,y2 + +## Argument aliases +#ALIAS $1 D + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 1 (anonymous => default parameters) + # 1 + # 1 + # 1 + +## Component type AE + negative lin effort,-1 + +## Component type INTF + yaw none + +## Component type SS + [x2] SS external,external + [y2] SS external,external + +## Component type Sf + omega SS external + v SS external + +## Component type TF + D lin flow,-D + +## Component type rotation + z2 rotate_z + ADDED mtt/lib/examples/Dia/robotrain/trailer_abg.dia Index: mtt/lib/examples/Dia/robotrain/trailer_abg.dia ================================================================== --- mtt/lib/examples/Dia/robotrain/trailer_abg.dia +++ mtt/lib/examples/Dia/robotrain/trailer_abg.dia @@ -0,0 +1,2672 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Passive off-hooked trailer# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #rotation:z1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #rotation:z2# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #TF:D# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #TF:L# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[x2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[y2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[x_1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[y_1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[x_2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[y_2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[x_1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[y_1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[x_2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[y_2]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Df:v# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Df:omega# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #INTF:yaw# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #0# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[psi]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #[psi]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #AE:negative# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #INTF:x_e# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #INTF:y_e# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[y1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SS:[x1]# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #De:y# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #De:x# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ADDED mtt/lib/examples/Dia/robotrain/trailer_abg.ps Index: mtt/lib/examples/Dia/robotrain/trailer_abg.ps ================================================================== --- mtt/lib/examples/Dia/robotrain/trailer_abg.ps +++ mtt/lib/examples/Dia/robotrain/trailer_abg.ps @@ -0,0 +1,854 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: trailer_abg.dia +%%Creator: Dia v0.94+bondgraph +%%CreationDate: Sun Sep 12 21:16:23 2004 +%%For: geraint +%%Orientation: Portrait +%%Magnification: 1.0000 +%%BoundingBox: 0 0 1776 1439 +%%BeginSetup +%%EndSetup +%%EndComments +%%BeginProlog +[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one +/two /three /four /five /six /seven /eight /nine /colon /semicolon +/less /equal /greater /question /at /A /B /C /D /E +/F /G /H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W /X /Y +/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c +/d /e /f /g /h /i /j /k /l /m +/n /o /p /q /r /s /t /u /v /w +/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright +/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf +/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde +/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring +/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave +/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def +/cp {closepath} bind def +/c {curveto} bind def +/f {fill} bind def +/a {arc} bind def +/ef {eofill} bind def +/ex {exch} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth pop} bind def +/tr {translate} bind def + +/ellipsedict 8 dict def +ellipsedict /mtrx matrix put +/ellipse +{ ellipsedict begin + /endangle exch def + /startangle exch def + /yrad exch def + /xrad exch def + /y exch def + /x exch def /savematrix mtrx currentmatrix def + x y tr xrad yrad sc + 0 0 1 startangle endangle arc + savematrix setmatrix + end +} def + +/mergeprocs { +dup length +3 -1 roll +dup +length +dup +5 1 roll +3 -1 roll +add +array cvx +dup +3 -1 roll +0 exch +putinterval +dup +4 2 roll +putinterval +} bind def +/Times-Roman-latin1 + /Times-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-Italic-latin1 + /Times-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-Bold-latin1 + /Times-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Times-BoldItalic-latin1 + /Times-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-Book-latin1 + /AvantGarde-Book findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-BookOblique-latin1 + /AvantGarde-BookOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-Demi-latin1 + /AvantGarde-Demi findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/AvantGarde-DemiOblique-latin1 + /AvantGarde-DemiOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-Light-latin1 + /Bookman-Light findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-LightItalic-latin1 + /Bookman-LightItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-Demi-latin1 + /Bookman-Demi findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Bookman-DemiItalic-latin1 + /Bookman-DemiItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-latin1 + /Courier findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-Oblique-latin1 + /Courier-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-Bold-latin1 + /Courier-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Courier-BoldOblique-latin1 + /Courier-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-latin1 + /Helvetica findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Oblique-latin1 + /Helvetica-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Bold-latin1 + /Helvetica-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-BoldOblique-latin1 + /Helvetica-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-latin1 + /Helvetica-Narrow findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-Oblique-latin1 + /Helvetica-Narrow-Oblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-Bold-latin1 + /Helvetica-Narrow-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Helvetica-Narrow-BoldOblique-latin1 + /Helvetica-Narrow-BoldOblique findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Roman-latin1 + /NewCenturySchoolbook-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Italic-latin1 + /NewCenturySchoolbook-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-Bold-latin1 + /NewCenturySchoolbook-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/NewCenturySchoolbook-BoldItalic-latin1 + /NewCenturySchoolbook-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Roman-latin1 + /Palatino-Roman findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Italic-latin1 + /Palatino-Italic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-Bold-latin1 + /Palatino-Bold findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Palatino-BoldItalic-latin1 + /Palatino-BoldItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/Symbol-latin1 + /Symbol findfont +definefont pop +/ZapfChancery-MediumItalic-latin1 + /ZapfChancery-MediumItalic findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +/ZapfDingbats-latin1 + /ZapfDingbats findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding isolatin1encoding def + currentdict end +definefont pop +28.346000 -28.346000 scale +4.050000 -57.857107 translate +%%EndProlog + + +0.749020 0.749020 0.749020 srgb +n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f +n 21.150000 25.000000 m 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 24.850000 25.000000 m 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f +n 21.150000 25.900000 m 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 24.850000 25.900000 m 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 21.150000 25.000000 m 24.850000 25.000000 l s +n 21.150000 25.900000 m 24.850000 25.900000 l s +n 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 21.150000 25.000000 m 21.150000 25.900000 l s +n 24.850000 25.000000 m 24.850000 25.900000 l s +n 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse s +n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f +n 21.080000 9.035000 m 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 24.780000 9.035000 m 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f +n 21.080000 9.935000 m 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 24.780000 9.935000 m 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +n 21.080000 9.035000 m 24.780000 9.035000 l s +n 21.080000 9.935000 m 24.780000 9.935000 l s +n 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 21.080000 9.035000 m 21.080000 9.935000 l s +n 24.780000 9.035000 m 24.780000 9.935000 l s +n 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l cp s +0.749020 0.749020 0.749020 srgb +n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f +n 17.000000 7.150000 m 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse f +n 29.000000 7.150000 m 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse f +n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f +n 17.000000 9.000000 m 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse f +n 29.000000 9.000000 m 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 17.000000 7.150000 m 29.000000 7.150000 l s +n 17.000000 9.000000 m 29.000000 9.000000 l s +n 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse s +n 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse s +n 17.000000 7.150000 m 17.000000 9.000000 l s +n 29.000000 7.150000 m 29.000000 9.000000 l s +n 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse s +n 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse s +0.749020 0.749020 0.749020 srgb +n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f +n 17.000700 25.914300 m 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse f +n 29.000700 25.914300 m 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse f +n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f +n 17.000700 27.764300 m 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse f +n 29.000700 27.764300 m 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 17.000700 25.914300 m 29.000700 25.914300 l s +n 17.000700 27.764300 m 29.000700 27.764300 l s +n 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse s +n 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse s +n 17.000700 25.914300 m 17.000700 27.764300 l s +n 29.000700 25.914300 m 29.000700 27.764300 l s +n 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse s +n 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse s +1.000000 1.000000 1.000000 srgb +n 30.900000 16.000000 m 30.900000 17.900000 l 44.200000 17.900000 l 44.200000 16.000000 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 30.900000 16.000000 m 30.900000 17.900000 l 44.200000 17.900000 l 44.200000 16.000000 l cp s +1.000000 1.000000 1.000000 srgb +n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l f +0.100000 slw +[] 0 sd +[] 0 sd +0 slj +0.000000 0.000000 0.000000 srgb +n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l cp s +1.000000 1.000000 1.000000 srgb +n 43.100000 16.950000 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 43.100000 16.950000 0.500000 0.500000 0 360 ellipse cp s +1.000000 1.000000 1.000000 srgb +n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse f +0.100000 slw +[] 0 sd +[] 0 sd +0.000000 0.000000 0.000000 srgb +n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse cp s +/Helvetica-latin1 ff 1.400000 scf sf +(Passive off-hooked trailer) -3.804070 8.965100 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +(rotation:z1) dup sw 2 div 37.316942 ex sub 36.153553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Helvetica-latin1 ff 0.700000 scf sf +(rotation:z2) dup sw 2 div 8.316942 ex sub 36.153553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(TF:D) dup sw 2 div 14.723192 ex sub 43.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(TF:L) dup sw 2 div 30.660692 ex sub 44.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(SS:[x2]) dup sw 2 div -1.589308 ex sub 36.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(SS:[y2]) dup sw 2 div 8.410692 ex sub 29.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 45.549905 35.985115 m 41.683312 35.946832 l s +n 41.683312 35.946832 m 42.974861 36.709656 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 37.310793 30.925048 m 37.314507 33.952852 l s +n 37.314507 33.952852 m 38.062913 32.652895 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(1) dup sw 2 div 23.816942 ex sub 36.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(1) dup sw 2 div 23.816942 ex sub 53.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 32.949728 35.903600 m 25.684133 35.903600 l s +n 32.949728 35.903600 m 32.949728 36.653600 l s +n 32.949728 35.903600 m 32.949728 35.153600 l s +n 25.684133 35.903600 m 26.983171 36.653600 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 35.883879 37.625929 m 32.093721 42.181271 l s +n 35.883879 37.625929 m 36.460416 38.105622 l s +n 35.883879 37.625929 m 35.307342 37.146236 l s +n 32.093721 42.181271 m 33.501110 41.662373 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 21.949852 35.903600 m 12.681067 35.903600 l s +n 21.949852 35.903600 m 21.949852 36.653600 l s +n 21.949852 35.903600 m 21.949852 35.153600 l s +n 12.681067 35.903600 m 13.980105 36.653600 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 29.331926 45.651016 m 25.145674 51.156184 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 25.145674 51.156184 m 26.528977 50.576121 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 22.322407 51.260163 m 16.263229 44.597112 l s +n 16.263229 44.597112 m 17.692081 45.053599 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 13.176908 41.213996 m 9.863232 37.593204 l s +n 13.176908 41.213996 m 13.730183 40.707649 l s +n 13.176908 41.213996 m 12.623633 41.720342 l s +n 9.863232 37.593204 m 11.293525 38.045159 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 3.949758 35.903600 m 1.870928 35.903600 l s +n 3.949758 35.903600 m 3.949758 36.653600 l s +n 3.949758 35.903600 m 3.949758 35.153600 l s +n 1.870928 35.903600 m 3.169966 36.653600 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 8.343080 33.951785 m 8.384550 30.855415 l s +n 8.343080 33.951785 m 9.093013 33.961829 l s +n 8.343080 33.951785 m 7.593148 33.941742 l s +n 8.384550 30.855415 m 9.117086 32.164380 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(Df:v) dup sw 2 div 23.566992 ex sub 30.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(Df:omega) dup sw 2 div 23.841942 ex sub 57.203553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 23.735599 33.951585 m 23.648301 31.855615 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 23.648301 31.855615 m 24.451710 33.122317 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 23.829110 54.857194 m 23.829690 54.950006 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 23.829110 54.857194 m 24.587214 56.151519 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(INTF:yaw) dup sw 2 div 23.741942 ex sub 48.253553 m gs 1 -1 sc sh gr +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 23.787299 50.949909 m 23.771501 49.907291 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 23.771501 49.907291 m 24.541095 51.194817 l s +n 23.771501 49.907291 m 23.041268 51.217542 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(0) dup sw 2 div 23.816942 ex sub 43.203553 m gs 1 -1 sc sh gr +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 23.770904 46.000671 m 23.787896 44.856529 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 23.787896 44.856529 m 24.518523 46.166562 l s +n 23.787896 44.856529 m 23.018688 46.144287 l s +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 25.571888 41.993606 m 34.593330 37.315821 l s +n 34.593330 37.315821 m 33.785341 38.579607 l s +n 34.593330 37.315821 m 33.094865 37.247975 l s +n 34.593330 37.315821 m 34.938568 37.981637 l s +n 34.593330 37.315821 m 34.248092 36.650006 l s +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 15.214768 38.274599 m 12.037872 37.182601 l s +n 12.037872 37.182601 m 13.022564 38.314140 l s +n 12.037872 37.182601 m 13.510160 36.895602 l s +n 12.037872 37.182601 m 11.794074 37.891870 l s +n 12.037872 37.182601 m 12.281670 36.473332 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(AE:negative) dup sw 2 div 18.935642 ex sub 39.803553 m gs 1 -1 sc sh gr +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 22.129609 41.745601 m 21.148531 41.072280 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 21.148531 41.072280 m 21.795193 42.425730 l s +n 21.148531 41.072280 m 22.643984 41.188979 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(1) dup sw 2 div 47.416942 ex sub 36.303553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(1) dup sw 2 div 37.308342 ex sub 29.274253 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(INTF) dup sw 2 div 47.435692 ex sub 40.903553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(INTF) dup sw 2 div 42.499992 ex sub 29.253553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(SS:[y1]) dup sw 2 div 37.260692 ex sub 21.703553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(SS:[x1]) dup sw 2 div 56.110692 ex sub 36.153553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 52.650329 35.913304 m 49.283266 35.971398 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 52.650329 35.913304 m 52.663268 36.663193 l s +n 52.650329 35.913304 m 52.637391 35.163416 l s +n 49.283266 35.971398 m 50.595049 36.698877 l s +0.100000 slw +[] 0 sd +[] 0 sd +1 slc +n 37.272986 23.353614 m 37.296114 27.024286 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 37.272986 23.353614 m 38.022971 23.348889 l s +n 37.272986 23.353614 m 36.523001 23.358340 l s +n 37.296114 27.024286 m 38.037914 25.720548 l s +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 39.172814 28.966866 m 39.664062 28.964907 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 39.664062 28.964907 m 38.368025 29.720081 l s +n 39.664062 28.964907 m 38.362044 28.220093 l s +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 47.424885 37.957339 m 47.427716 38.650142 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 47.427716 38.650142 m 48.172401 37.348049 l s +n 47.427716 38.650142 m 46.672413 37.354179 l s +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(De:y) dup sw 2 div 48.321492 ex sub 29.353553 m gs 1 -1 sc sh gr +0.100000 slw +[] 0 sd +[] 0 sd +0 slc +0 slj +0 slc +0 slj +[] 0 sd +/Times-Roman-latin1 ff 0.700000 scf sf +(De:x) dup sw 2 div 47.421442 ex sub 45.253553 m gs 1 -1 sc sh gr +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 45.333284 29.002269 m 45.570649 29.006347 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 45.570649 29.006347 m 44.258922 29.733925 l s +n 45.570649 29.006347 m 44.284684 28.234146 l s +0.050000 slw +[] 0 sd +[] 0 sd +1 slc +n 47.429326 42.556219 m 47.427874 43.000981 l s +/Helvetica-latin1 ff 0.560000 scf sf +n 47.427874 43.000981 m 48.182111 41.704398 l s +n 47.427874 43.000981 m 46.682119 41.699501 l s +showpage ADDED mtt/lib/examples/Dia/robotrain/trailer_lbl.txt Index: mtt/lib/examples/Dia/robotrain/trailer_lbl.txt ================================================================== --- mtt/lib/examples/Dia/robotrain/trailer_lbl.txt +++ mtt/lib/examples/Dia/robotrain/trailer_lbl.txt @@ -0,0 +1,61 @@ +#SUMMARY trailer +#DESCRIPTION Detailed description here + +## System trailer, representation lbl, language txt +## File trailer_lbl.txt +## Generated by MTT on Wed Sep 8 00:41:53 BST 2004 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +## Port aliases +#ALIAS in x1,y1 +#ALIAS out x2,y2 + +## Argument aliases +#ALIAS $1 D +#ALIAS $2 L + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type 1 (anonymous => default parameters) + # 1 + # 1 + # 1 + +## Component type AE + negative lin effort,-1 + +## Component type De + x SS external + y SS external + +## Component type Df + omega SS external + v SS external + +## Component type INTF + x_e none + y_e none + yaw none + +## Component type SS + [x1] SS external,external + [x2] SS external,external + [y1] SS external,external + [y2] SS external,external + +## Component type TF + D lin flow,-D + L lin effort,L + +## Component type rotation + z1 rotate_z + z2 rotate_z + ADDED mtt/lib/examples/Dia/robotrain/trajectory.ps Index: mtt/lib/examples/Dia/robotrain/trajectory.ps ================================================================== --- mtt/lib/examples/Dia/robotrain/trajectory.ps +++ mtt/lib/examples/Dia/robotrain/trajectory.ps @@ -0,0 +1,927 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: trajectory.eps +%%Creator: gnuplot 4.0 patchlevel 0 +%%CreationDate: Sun Sep 12 19:59:53 2004 +%%DocumentFonts: (atend) +%%BoundingBox: 50 50 410 302 +%%Orientation: Portrait +%%EndComments +/gnudict 256 dict def +gnudict begin +/Color false def +/Solid false def +/gnulinewidth 5.000 def +/userlinewidth gnulinewidth def +/vshift -46 def +/dl {10.0 mul} def +/hpt_ 31.5 def +/vpt_ 31.5 def +/hpt hpt_ def +/vpt vpt_ def +/Rounded false def +/M {moveto} bind def +/L {lineto} bind def +/R {rmoveto} bind def +/V {rlineto} bind def +/N {newpath moveto} bind def +/C {setrgbcolor} bind def +/f {rlineto fill} bind def +/vpt2 vpt 2 mul def +/hpt2 hpt 2 mul def +/Lshow { currentpoint stroke M + 0 vshift R show } def +/Rshow { currentpoint stroke M + dup stringwidth pop neg vshift R show } def +/Cshow { currentpoint stroke M + dup stringwidth pop -2 div vshift R show } def +/UP { dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def + /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def } def +/DL { Color {setrgbcolor Solid {pop []} if 0 setdash } + {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse } def +/BL { stroke userlinewidth 2 mul setlinewidth + Rounded { 1 setlinejoin 1 setlinecap } if } def +/AL { stroke userlinewidth 2 div setlinewidth + Rounded { 1 setlinejoin 1 setlinecap } if } def +/UL { dup gnulinewidth mul /userlinewidth exch def + dup 1 lt {pop 1} if 10 mul /udl exch def } def +/PL { stroke userlinewidth setlinewidth + Rounded { 1 setlinejoin 1 setlinecap } if } def +/LTw { PL [] 1 setgray } def +/LTb { BL [] 0 0 0 DL } def +/LTa { AL [1 udl mul 2 udl mul] 0 setdash 0 0 0 setrgbcolor } def +/LT0 { PL [] 1 0 0 DL } def +/LT1 { PL [4 dl 2 dl] 0 1 0 DL } def +/LT2 { PL [2 dl 3 dl] 0 0 1 DL } def +/LT3 { PL [1 dl 1.5 dl] 1 0 1 DL } def +/LT4 { PL [5 dl 2 dl 1 dl 2 dl] 0 1 1 DL } def +/LT5 { PL [4 dl 3 dl 1 dl 3 dl] 1 1 0 DL } def +/LT6 { PL [2 dl 2 dl 2 dl 4 dl] 0 0 0 DL } def +/LT7 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.3 0 DL } def +/LT8 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def +/Pnt { stroke [] 0 setdash + gsave 1 setlinecap M 0 0 V stroke grestore } def +/Dia { stroke [] 0 setdash 2 copy vpt add M + hpt neg vpt neg V hpt vpt neg V + hpt vpt V hpt neg vpt V closepath stroke + Pnt } def +/Pls { stroke [] 0 setdash vpt sub M 0 vpt2 V + currentpoint stroke M + hpt neg vpt neg R hpt2 0 V stroke + } def +/Box { stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M + 0 vpt2 neg V hpt2 0 V 0 vpt2 V + hpt2 neg 0 V closepath stroke + Pnt } def +/Crs { stroke [] 0 setdash exch hpt sub exch vpt add M + hpt2 vpt2 neg V currentpoint stroke M + hpt2 neg 0 R hpt2 vpt2 V stroke } def +/TriU { stroke [] 0 setdash 2 copy vpt 1.12 mul add M + hpt neg vpt -1.62 mul V + hpt 2 mul 0 V + hpt neg vpt 1.62 mul V closepath stroke + Pnt } def +/Star { 2 copy Pls Crs } def +/BoxF { stroke [] 0 setdash exch hpt sub exch vpt add M + 0 vpt2 neg V hpt2 0 V 0 vpt2 V + hpt2 neg 0 V closepath fill } def +/TriUF { stroke [] 0 setdash vpt 1.12 mul add M + hpt neg vpt -1.62 mul V + hpt 2 mul 0 V + hpt neg vpt 1.62 mul V closepath fill } def +/TriD { stroke [] 0 setdash 2 copy vpt 1.12 mul sub M + hpt neg vpt 1.62 mul V + hpt 2 mul 0 V + hpt neg vpt -1.62 mul V closepath stroke + Pnt } def +/TriDF { stroke [] 0 setdash vpt 1.12 mul sub M + hpt neg vpt 1.62 mul V + hpt 2 mul 0 V + hpt neg vpt -1.62 mul V closepath fill} def +/DiaF { stroke [] 0 setdash vpt add M + hpt neg vpt neg V hpt vpt neg V + hpt vpt V hpt neg vpt V closepath fill } def +/Pent { stroke [] 0 setdash 2 copy gsave + translate 0 hpt M 4 {72 rotate 0 hpt L} repeat + closepath stroke grestore Pnt } def +/PentF { stroke [] 0 setdash gsave + translate 0 hpt M 4 {72 rotate 0 hpt L} repeat + closepath fill grestore } def +/Circle { stroke [] 0 setdash 2 copy + hpt 0 360 arc stroke Pnt } def +/CircleF { stroke [] 0 setdash hpt 0 360 arc fill } def +/C0 { BL [] 0 setdash 2 copy moveto vpt 90 450 arc } bind def +/C1 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 0 90 arc closepath fill + vpt 0 360 arc closepath } bind def +/C2 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 90 180 arc closepath fill + vpt 0 360 arc closepath } bind def +/C3 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 0 180 arc closepath fill + vpt 0 360 arc closepath } bind def +/C4 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 180 270 arc closepath fill + vpt 0 360 arc closepath } bind def +/C5 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 0 90 arc + 2 copy moveto + 2 copy vpt 180 270 arc closepath fill + vpt 0 360 arc } bind def +/C6 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 90 270 arc closepath fill + vpt 0 360 arc closepath } bind def +/C7 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 0 270 arc closepath fill + vpt 0 360 arc closepath } bind def +/C8 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 270 360 arc closepath fill + vpt 0 360 arc closepath } bind def +/C9 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 270 450 arc closepath fill + vpt 0 360 arc closepath } bind def +/C10 { BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill + 2 copy moveto + 2 copy vpt 90 180 arc closepath fill + vpt 0 360 arc closepath } bind def +/C11 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 0 180 arc closepath fill + 2 copy moveto + 2 copy vpt 270 360 arc closepath fill + vpt 0 360 arc closepath } bind def +/C12 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 180 360 arc closepath fill + vpt 0 360 arc closepath } bind def +/C13 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 0 90 arc closepath fill + 2 copy moveto + 2 copy vpt 180 360 arc closepath fill + vpt 0 360 arc closepath } bind def +/C14 { BL [] 0 setdash 2 copy moveto + 2 copy vpt 90 360 arc closepath fill + vpt 0 360 arc } bind def +/C15 { BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill + vpt 0 360 arc closepath } bind def +/Rec { newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto + neg 0 rlineto closepath } bind def +/Square { dup Rec } bind def +/Bsquare { vpt sub exch vpt sub exch vpt2 Square } bind def +/S0 { BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare } bind def +/S1 { BL [] 0 setdash 2 copy vpt Square fill Bsquare } bind def +/S2 { BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def +/S3 { BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare } bind def +/S4 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def +/S5 { BL [] 0 setdash 2 copy 2 copy vpt Square fill + exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def +/S6 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare } bind def +/S7 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill + 2 copy vpt Square fill + Bsquare } bind def +/S8 { BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare } bind def +/S9 { BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare } bind def +/S10 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill + Bsquare } bind def +/S11 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill + Bsquare } bind def +/S12 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare } bind def +/S13 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill + 2 copy vpt Square fill Bsquare } bind def +/S14 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill + 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def +/S15 { BL [] 0 setdash 2 copy Bsquare fill Bsquare } bind def +/D0 { gsave translate 45 rotate 0 0 S0 stroke grestore } bind def +/D1 { gsave translate 45 rotate 0 0 S1 stroke grestore } bind def +/D2 { gsave translate 45 rotate 0 0 S2 stroke grestore } bind def +/D3 { gsave translate 45 rotate 0 0 S3 stroke grestore } bind def +/D4 { gsave translate 45 rotate 0 0 S4 stroke grestore } bind def +/D5 { gsave translate 45 rotate 0 0 S5 stroke grestore } bind def +/D6 { gsave translate 45 rotate 0 0 S6 stroke grestore } bind def +/D7 { gsave translate 45 rotate 0 0 S7 stroke grestore } bind def +/D8 { gsave translate 45 rotate 0 0 S8 stroke grestore } bind def +/D9 { gsave translate 45 rotate 0 0 S9 stroke grestore } bind def +/D10 { gsave translate 45 rotate 0 0 S10 stroke grestore } bind def +/D11 { gsave translate 45 rotate 0 0 S11 stroke grestore } bind def +/D12 { gsave translate 45 rotate 0 0 S12 stroke grestore } bind def +/D13 { gsave translate 45 rotate 0 0 S13 stroke grestore } bind def +/D14 { gsave translate 45 rotate 0 0 S14 stroke grestore } bind def +/D15 { gsave translate 45 rotate 0 0 S15 stroke grestore } bind def +/DiaE { stroke [] 0 setdash vpt add M + hpt neg vpt neg V hpt vpt neg V + hpt vpt V hpt neg vpt V closepath stroke } def +/BoxE { stroke [] 0 setdash exch hpt sub exch vpt add M + 0 vpt2 neg V hpt2 0 V 0 vpt2 V + hpt2 neg 0 V closepath stroke } def +/TriUE { stroke [] 0 setdash vpt 1.12 mul add M + hpt neg vpt -1.62 mul V + hpt 2 mul 0 V + hpt neg vpt 1.62 mul V closepath stroke } def +/TriDE { stroke [] 0 setdash vpt 1.12 mul sub M + hpt neg vpt 1.62 mul V + hpt 2 mul 0 V + hpt neg vpt -1.62 mul V closepath stroke } def +/PentE { stroke [] 0 setdash gsave + translate 0 hpt M 4 {72 rotate 0 hpt L} repeat + closepath stroke grestore } def +/CircE { stroke [] 0 setdash + hpt 0 360 arc stroke } def +/Opaque { gsave closepath 1 setgray fill grestore 0 setgray closepath } def +/DiaW { stroke [] 0 setdash vpt add M + hpt neg vpt neg V hpt vpt neg V + hpt vpt V hpt neg vpt V Opaque stroke } def +/BoxW { stroke [] 0 setdash exch hpt sub exch vpt add M + 0 vpt2 neg V hpt2 0 V 0 vpt2 V + hpt2 neg 0 V Opaque stroke } def +/TriUW { stroke [] 0 setdash vpt 1.12 mul add M + hpt neg vpt -1.62 mul V + hpt 2 mul 0 V + hpt neg vpt 1.62 mul V Opaque stroke } def +/TriDW { stroke [] 0 setdash vpt 1.12 mul sub M + hpt neg vpt 1.62 mul V + hpt 2 mul 0 V + hpt neg vpt -1.62 mul V Opaque stroke } def +/PentW { stroke [] 0 setdash gsave + translate 0 hpt M 4 {72 rotate 0 hpt L} repeat + Opaque stroke grestore } def +/CircW { stroke [] 0 setdash + hpt 0 360 arc Opaque stroke } def +/BoxFill { gsave Rec 1 setgray fill grestore } def +/BoxColFill { + gsave Rec + /Fillden exch def + currentrgbcolor + /ColB exch def /ColG exch def /ColR exch def + /ColR ColR Fillden mul Fillden sub 1 add def + /ColG ColG Fillden mul Fillden sub 1 add def + /ColB ColB Fillden mul Fillden sub 1 add def + ColR ColG ColB setrgbcolor + fill grestore } def +% +% PostScript Level 1 Pattern Fill routine +% Usage: x y w h s a XX PatternFill +% x,y = lower left corner of box to be filled +% w,h = width and height of box +% a = angle in degrees between lines and x-axis +% XX = 0/1 for no/yes cross-hatch +% +/PatternFill { gsave /PFa [ 9 2 roll ] def + PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate + PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec + gsave 1 setgray fill grestore clip + currentlinewidth 0.5 mul setlinewidth + /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def + 0 0 M PFa 5 get rotate PFs -2 div dup translate + 0 1 PFs PFa 4 get div 1 add floor cvi + { PFa 4 get mul 0 M 0 PFs V } for + 0 PFa 6 get ne { + 0 1 PFs PFa 4 get div 1 add floor cvi + { PFa 4 get mul 0 2 1 roll M PFs 0 V } for + } if + stroke grestore } def +% +/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont +dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall +currentdict end definefont pop +end +%%EndProlog +gnudict begin +gsave +50 50 translate +0.050 0.050 scale +0 setgray +newpath +(Helvetica) findfont 140 scalefont setfont +1.000 UL +LTb +1.000 UL +LTa +714 560 M +6248 0 V +1.000 UL +LTb +714 560 M +63 0 V +6185 0 R +-63 0 V +630 560 M +gsave 0 setgray +(-1) Rshow +grestore +1.000 UL +LTb +1.000 UL +LTa +714 1140 M +6248 0 V +1.000 UL +LTb +714 1140 M +63 0 V +6185 0 R +-63 0 V +-6269 0 R +gsave 0 setgray +(-0.5) Rshow +grestore +1.000 UL +LTb +1.000 UL +LTa +714 1720 M +6248 0 V +1.000 UL +LTb +714 1720 M +63 0 V +6185 0 R +-63 0 V +-6269 0 R +gsave 0 setgray +( 0) Rshow +grestore +1.000 UL +LTb +1.000 UL +LTa +714 2300 M +6248 0 V +1.000 UL +LTb +714 2300 M +63 0 V +6185 0 R +-63 0 V +-6269 0 R +gsave 0 setgray +( 0.5) Rshow +grestore +1.000 UL +LTb +1.000 UL +LTa +714 2880 M +6248 0 V +1.000 UL +LTb +714 2880 M +63 0 V +6185 0 R +-63 0 V +-6269 0 R +gsave 0 setgray +( 1) Rshow +grestore +1.000 UL +LTb +1.000 UL +LTa +714 3460 M +6248 0 V +1.000 UL +LTb +714 3460 M +63 0 V +6185 0 R +-63 0 V +-6269 0 R +gsave 0 setgray +( 1.5) Rshow +grestore +1.000 UL +LTb +1.000 UL +LTa +714 4040 M +6248 0 V +1.000 UL +LTb +714 4040 M +63 0 V +6185 0 R +-63 0 V +-6269 0 R +gsave 0 setgray +( 2) Rshow +grestore +1.000 UL +LTb +1.000 UL +LTa +714 4620 M +6248 0 V +1.000 UL +LTb +714 4620 M +63 0 V +6185 0 R +-63 0 V +-6269 0 R +gsave 0 setgray +( 2.5) Rshow +grestore +1.000 UL +LTb +1.000 UL +LTa +714 560 M +0 4060 V +1.000 UL +LTb +714 560 M +0 63 V +0 3997 R +0 -63 V +714 420 M +gsave 0 setgray +(-5) Cshow +grestore +1.000 UL +LTb +1.000 UL +LTa +1607 560 M +0 3577 V +0 420 R +0 63 V +1.000 UL +LTb +1607 560 M +0 63 V +0 3997 R +0 -63 V +0 -4137 R +gsave 0 setgray +(-4) Cshow +grestore +1.000 UL +LTb +1.000 UL +LTa +2499 560 M +0 4060 V +1.000 UL +LTb +2499 560 M +0 63 V +0 3997 R +0 -63 V +0 -4137 R +gsave 0 setgray +(-3) Cshow +grestore +1.000 UL +LTb +1.000 UL +LTa +3392 560 M +0 4060 V +1.000 UL +LTb +3392 560 M +0 63 V +0 3997 R +0 -63 V +0 -4137 R +gsave 0 setgray +(-2) Cshow +grestore +1.000 UL +LTb +1.000 UL +LTa +4284 560 M +0 4060 V +1.000 UL +LTb +4284 560 M +0 63 V +0 3997 R +0 -63 V +0 -4137 R +gsave 0 setgray +(-1) Cshow +grestore +1.000 UL +LTb +1.000 UL +LTa +5177 560 M +0 4060 V +1.000 UL +LTb +5177 560 M +0 63 V +0 3997 R +0 -63 V +0 -4137 R +gsave 0 setgray +( 0) Cshow +grestore +1.000 UL +LTb +1.000 UL +LTa +6069 560 M +0 4060 V +1.000 UL +LTb +6069 560 M +0 63 V +0 3997 R +0 -63 V +0 -4137 R +gsave 0 setgray +( 1) Cshow +grestore +1.000 UL +LTb +1.000 UL +LTa +6962 560 M +0 4060 V +1.000 UL +LTb +6962 560 M +0 63 V +0 3997 R +0 -63 V +0 -4137 R +gsave 0 setgray +( 2) Cshow +grestore +1.000 UL +LTb +1.000 UL +LTb +714 560 M +6248 0 V +0 4060 V +-6248 0 V +714 560 L +LTb +140 2590 M +gsave 0 setgray +currentpoint gsave translate 90 rotate 0 0 M +(y) Cshow +grestore +grestore +LTb +3838 210 M +gsave 0 setgray +(x) Cshow +grestore +LTb +3838 4830 M +gsave 0 setgray +(MTT model "robotrain": trajectory of trailer links) Cshow +grestore +210 70 M +gsave 0 setgray +(Sun Sep 12 19:59:53 2004) Lshow +grestore +1.000 UP +1.000 UP +1.000 UL +LT0 +LTb +1302 4487 M +gsave 0 setgray +(front) Rshow +grestore +LT0 +4284 1720 Pls +4377 1609 Pls +4479 1511 Pls +4587 1427 Pls +4701 1357 Pls +4820 1302 Pls +4942 1263 Pls +5067 1240 Pls +5193 1234 Pls +5319 1244 Pls +5444 1270 Pls +5566 1312 Pls +5684 1369 Pls +5797 1442 Pls +5904 1529 Pls +6004 1630 Pls +6095 1743 Pls +6178 1867 Pls +6250 2001 Pls +6312 2144 Pls +6362 2294 Pls +6401 2451 Pls +6427 2611 Pls +6441 2774 Pls +6443 2938 Pls +6431 3101 Pls +6408 3262 Pls +6372 3419 Pls +6324 3571 Pls +6265 3716 Pls +6195 3852 Pls +6114 3979 Pls +6025 4094 Pls +5927 4198 Pls +5822 4288 Pls +5710 4364 Pls +5593 4425 Pls +5472 4471 Pls +5347 4500 Pls +5222 4514 Pls +5096 4511 Pls +4970 4492 Pls +4847 4456 Pls +4727 4405 Pls +4612 4338 Pls +4502 4257 Pls +4399 4162 Pls +4304 4054 Pls +4218 3935 Pls +4141 3804 Pls +4075 3665 Pls +4020 3517 Pls +3976 3363 Pls +3945 3205 Pls +3926 3043 Pls +3919 2879 Pls +3925 2715 Pls +3943 2553 Pls +3974 2394 Pls +4017 2240 Pls +4072 2092 Pls +4138 1952 Pls +4214 1821 Pls +4299 1701 Pls +4394 1592 Pls +4496 1496 Pls +4606 1414 Pls +4721 1347 Pls +4840 1295 Pls +4963 1258 Pls +5089 1238 Pls +5215 1234 Pls +5340 1247 Pls +5465 1276 Pls +5586 1320 Pls +5703 1381 Pls +5816 1456 Pls +5921 1545 Pls +6020 1648 Pls +6110 1763 Pls +6190 1889 Pls +6261 2025 Pls +6321 2169 Pls +6369 2320 Pls +6406 2477 Pls +6430 2638 Pls +6442 2801 Pls +6442 2965 Pls +6428 3128 Pls +6403 3289 Pls +6365 3445 Pls +6315 3596 Pls +6254 3740 Pls +6182 3874 Pls +6100 3999 Pls +6009 4113 Pls +5910 4214 Pls +5803 4302 Pls +5690 4375 Pls +5573 4434 Pls +5451 4477 Pls +1585 4487 Pls +1.000 UP +1.000 UL +LT1 +LTb +1302 4347 M +gsave 0 setgray +(middle) Rshow +grestore +LT1 +2499 1720 Crs +2599 1820 Crs +2715 1882 Crs +2839 1910 Crs +2965 1909 Crs +3090 1884 Crs +3212 1840 Crs +3330 1784 Crs +3446 1719 Crs +3560 1647 Crs +3672 1573 Crs +3784 1497 Crs +3897 1423 Crs +4011 1352 Crs +4126 1285 Crs +4243 1223 Crs +4362 1168 Crs +4483 1121 Crs +4605 1083 Crs +4730 1055 Crs +4855 1037 Crs +4981 1031 Crs +5107 1036 Crs +5233 1054 Crs +5357 1085 Crs +5479 1128 Crs +5597 1184 Crs +5712 1253 Crs +5821 1334 Crs +5925 1428 Crs +6022 1533 Crs +6111 1649 Crs +6192 1775 Crs +6264 1910 Crs +6325 2053 Crs +6377 2203 Crs +6417 2358 Crs +6446 2518 Crs +6463 2680 Crs +6468 2844 Crs +6461 3008 Crs +6442 3170 Crs +6410 3329 Crs +6368 3483 Crs +6313 3631 Crs +6248 3772 Crs +6173 3903 Crs +6088 4025 Crs +5995 4135 Crs +5893 4232 Crs +5785 4317 Crs +5671 4386 Crs +5552 4441 Crs +5430 4481 Crs +5305 4504 Crs +5179 4511 Crs +5053 4502 Crs +4928 4477 Crs +4806 4436 Crs +4688 4379 Crs +4574 4308 Crs +4467 4222 Crs +4366 4122 Crs +4274 4011 Crs +4191 3887 Crs +4117 3754 Crs +4055 3612 Crs +4003 3462 Crs +3963 3306 Crs +3935 3146 Crs +3920 2984 Crs +3917 2820 Crs +3927 2656 Crs +3950 2495 Crs +3984 2337 Crs +4031 2185 Crs +4089 2039 Crs +4157 1902 Crs +4237 1774 Crs +4325 1657 Crs +4422 1552 Crs +4527 1460 Crs +4638 1383 Crs +4754 1320 Crs +4875 1272 Crs +4999 1241 Crs +5124 1225 Crs +5251 1226 Crs +5376 1244 Crs +5500 1277 Crs +5620 1326 Crs +5736 1391 Crs +5846 1471 Crs +5950 1564 Crs +6046 1670 Crs +6133 1789 Crs +6211 1918 Crs +6279 2056 Crs +6335 2203 Crs +6380 2356 Crs +6413 2514 Crs +1585 4347 Crs +1.000 UP +1.000 UL +LT2 +LTb +1302 4207 M +gsave 0 setgray +(rear) Rshow +grestore +LT2 +714 1720 Star +819 1631 Star +942 1601 Star +1068 1614 Star +1190 1655 Star +1309 1711 Star +1426 1771 Star +1544 1830 Star +1664 1882 Star +1786 1925 Star +1910 1956 Star +2035 1973 Star +2161 1977 Star +2287 1968 Star +2412 1946 Star +2536 1912 Star +2658 1869 Star +2777 1817 Star +2895 1758 Star +3011 1694 Star +3126 1625 Star +3240 1554 Star +3353 1481 Star +3466 1409 Star +3579 1337 Star +3693 1267 Star +3809 1199 Star +3925 1136 Star +4043 1078 Star +4163 1025 Star +4284 979 Star +4406 940 Star +4530 909 Star +4655 887 Star +4781 874 Star +4907 871 Star +5033 879 Star +5159 897 Star +5283 927 Star +5405 968 Star +5524 1021 Star +5641 1085 Star +5752 1161 Star +5859 1249 Star +5960 1347 Star +6055 1455 Star +6142 1574 Star +6221 1702 Star +6292 1838 Star +6353 1981 Star +6404 2131 Star +6444 2287 Star +6474 2446 Star +6492 2608 Star +6499 2772 Star +6494 2936 Star +6478 3099 Star +6450 3259 Star +6411 3414 Star +6360 3565 Star +6299 3708 Star +6227 3843 Star +6146 3969 Star +6056 4084 Star +5958 4187 Star +5853 4278 Star +5742 4355 Star +5625 4417 Star +5504 4465 Star +5381 4497 Star +5255 4513 Star +5129 4513 Star +5003 4497 Star +4880 4465 Star +4759 4417 Star +4642 4355 Star +4531 4277 Star +4426 4186 Star +4329 4082 Star +4240 3965 Star +4160 3838 Star +4090 3702 Star +4031 3557 Star +3984 3405 Star +3948 3247 Star +3925 3086 Star +3914 2923 Star +3915 2759 Star +3929 2596 Star +3955 2436 Star +3994 2279 Star +4044 2129 Star +4106 1986 Star +4178 1851 Star +4260 1727 Star +4351 1614 Star +4451 1513 Star +4557 1425 Star +4670 1352 Star +4788 1294 Star +4910 1251 Star +1585 4207 Star +1.000 UL +LTb +714 560 M +6248 0 V +0 4060 V +-6248 0 V +714 560 L +1.000 UP +stroke +grestore +end +showpage +%%Trailer +%%DocumentFonts: Helvetica ADDED mtt/lib/examples/Electrical/rc/pulse/rc_input.txt Index: mtt/lib/examples/Electrical/rc/pulse/rc_input.txt ================================================================== --- mtt/lib/examples/Electrical/rc/pulse/rc_input.txt +++ mtt/lib/examples/Electrical/rc/pulse/rc_input.txt @@ -0,0 +1,10 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System rc, representation input, language txt; +## File rc_input.txt; +## Generated by MTT on Wed May 1 08:47:22 BST 2002; + + + +rc__e1 = 1.0*(t<1); # On for t<1 ADDED mtt/lib/examples/Electrical/rc/r10/rc_numpar.txt Index: mtt/lib/examples/Electrical/rc/r10/rc_numpar.txt ================================================================== --- mtt/lib/examples/Electrical/rc/r10/rc_numpar.txt +++ mtt/lib/examples/Electrical/rc/r10/rc_numpar.txt @@ -0,0 +1,11 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System rc, representation numpar, language txt; +## File rc_numpar.txt; +## Generated by MTT on Wed May 1 10:18:33 BST 2002; + + + +c = 1.0; # c = 1 F +r = 10.0; # r = 10 ohms ADDED mtt/lib/examples/Electrical/rc/rc_abg.fig Index: mtt/lib/examples/Electrical/rc/rc_abg.fig ================================================================== --- mtt/lib/examples/Electrical/rc/rc_abg.fig +++ mtt/lib/examples/Electrical/rc/rc_abg.fig @@ -0,0 +1,63 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 1800 1125 162 162 1800 1125 1890 1260 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1802 4277 2702 4277 2477 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 4277 4052 4277 3827 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4502 4277 5402 4277 5177 4502 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 4051 2926 3151 3151 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 4051 4276 3151 4501 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 4276 2701 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5401 4051 5401 4276 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5401 4276 5401 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 4051 2701 4276 +2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 2475 585 3375 585 3375 765 2475 765 2475 585 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4050 1215 4500 1215 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4050 1080 4500 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 675 2475 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3375 675 5400 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4275 675 4275 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4275 1215 4275 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 1575 5400 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 945 1800 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 1575 1800 1260 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 5400 1530 5400 765 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6750 5625 6750 225 675 225 675 5625 6750 5625 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 4367 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 4277 4367 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 660 5987 4367 SS:e2\001 +4 1 -1 0 0 0 20 0.0000 4 195 375 2926 2926 R:r\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 4276 2926 C:c\001 +4 1 -1 0 0 0 20 0.0000 4 195 660 1395 4365 SS:e1\001 +4 0 1 1 0 0 20 0.0000 4 135 105 2880 450 r\001 +4 0 1 1 0 0 20 0.0000 4 135 120 4680 1215 c\001 +4 0 1 1 0 0 20 0.0000 4 135 120 5625 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 195 135 5715 1305 2\001 +4 0 1 1 0 0 20 0.0000 4 135 120 1260 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 195 135 1350 1305 1\001 +4 1 1 1 0 0 20 0.0000 4 255 1350 3600 4995 Bond graph\001 +4 1 1 1 0 0 20 0.0000 4 195 1200 3600 2025 Schematic\001 ADDED mtt/lib/examples/Electrical/rc/rc_desc.tex Index: mtt/lib/examples/Electrical/rc/rc_desc.tex ================================================================== --- mtt/lib/examples/Electrical/rc/rc_desc.tex +++ mtt/lib/examples/Electrical/rc/rc_desc.tex @@ -0,0 +1,21 @@ +% Verbal description for system rc (rc_desc.tex) +% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/08/24 10:27:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{rc} is + displayed in Figure \Ref{rc_abg} and its label + file is listed in Section \Ref{sec:rc_lbl}. + The subsystems are listed in Section \Ref{sec:rc_sub}. + +The system \textbf{rc} is the simple electrical rc circuit shown in +Figure \Ref{rc_abg}. It can be regarded as a single-input +single-output system with input $e_1$ and output $e_2$. ADDED mtt/lib/examples/Electrical/rc/rc_lbl.txt Index: mtt/lib/examples/Electrical/rc/rc_lbl.txt ================================================================== --- mtt/lib/examples/Electrical/rc/rc_lbl.txt +++ mtt/lib/examples/Electrical/rc/rc_lbl.txt @@ -0,0 +1,36 @@ +## Label file for system rc (rc_lbl.txt) +#SUMMARY rc a simple rc circuit +#DESCRIPTION A basic linear voltage-in voltage-out RC circuit +#DESCRIPTION A standard test example for MTT + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.1 2000/12/28 17:40:36 peterg +# ## To RCS +# ## +# ############################################################### + + +# Port aliases + +# Argument aliases +#ALIAS $1 c +#ALIAS $2 r + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# component-name cr_name arg1,arg2,..argn +# blank + +# ---- Component labels ---- + c lin effort,c + +# Component type R + r lin flow,r + +# Component type SS + e1 SS external,internal + e2 SS external,0 ADDED mtt/lib/examples/Electrical/rc/rc_rep.txt Index: mtt/lib/examples/Electrical/rc/rc_rep.txt ================================================================== --- mtt/lib/examples/Electrical/rc/rc_rep.txt +++ mtt/lib/examples/Electrical/rc/rc_rep.txt @@ -0,0 +1,55 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system rc (rc_rep.txt) +## Generated by MTT on" Wed May 1 08:56:38 BST 2002. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt rc abg tex # The system description +mtt rc cbg ps # The causal bond graph +mtt rc struc tex # The system structure +mtt rc sympar txt # The system parameters +## Uncomment the following lines or add others +## mtt rc dae tex # The system dae +mtt rc ode tex # The system ode +## mtt rc sspar tex # Steady-state parameters +## mtt rc ss tex # Steady state +## mtt rc dm tex # Descriptor matrices (of linearised system) +mtt rc sm tex # State matrices (of linearised system) +mtt rc tf tex # Transfer function (of linearised system) +mtt rc lmfr ps # log modulus of frequency response (of linearised system) +mtt rc simpar txt # Simulation parameters +## mtt rc state tex # Simulation initial state + +## Default +mtt rc numpar txt # Numerical simulation parameters +mtt rc input txt # Simulation input +mtt rc odeso ps # Simulation output + +## Step input +mtt -dr step rc input txt # Simulation input +mtt -dr step rc odeso ps # Simulation output + +## Pulse input +mtt -dr pulse rc input txt # Simulation input +mtt -dr pulse rc odeso ps # Simulation output + +## r = 10 +## Step input +mtt -dr step -dr r10 rc numpar txt # Numerical simulation parameters +mtt -dr step -dr r10 rc input txt # Simulation input +mtt -dr step -dr r10 rc odeso ps # Simulation output + +## Pulse input +mtt -dr pulse -dr r10 rc numpar txt # Numerical simulation parameters +mtt -dr pulse -dr r10 rc input txt # Simulation input +mtt -dr pulse -dr r10 rc odeso ps # Simulation output + +mtt rc rep txt # This file ADDED mtt/lib/examples/Electrical/rc/step/rc_input.txt Index: mtt/lib/examples/Electrical/rc/step/rc_input.txt ================================================================== --- mtt/lib/examples/Electrical/rc/step/rc_input.txt +++ mtt/lib/examples/Electrical/rc/step/rc_input.txt @@ -0,0 +1,10 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System rc, representation input, language txt; +## File rc_input.txt; +## Generated by MTT on Wed May 1 08:51:26 BST 2002; + + + +rc__e1 = 1.0; # Step ADDED mtt/lib/examples/Electrical/rc2/rc2_abg.fig Index: mtt/lib/examples/Electrical/rc2/rc2_abg.fig ================================================================== --- mtt/lib/examples/Electrical/rc2/rc2_abg.fig +++ mtt/lib/examples/Electrical/rc2/rc2_abg.fig @@ -0,0 +1,19 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1350 1800 2700 1800 2475 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 1800 5400 1800 5175 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 1800 8100 1800 7875 2025 +4 1 0 100 0 18 18 0.0000 4 270 1050 3330 1890 RC:rc_1\001 +4 1 0 100 0 18 18 0.0000 4 270 1050 6075 1890 RC:rc_2\001 +4 1 0 100 0 18 18 0.0000 4 270 600 8550 1890 De:y\001 +4 1 0 100 0 18 18 0.0000 4 210 600 945 1845 Se:u\001 ADDED mtt/lib/examples/Electrical/rc2/rc2_lbl.txt Index: mtt/lib/examples/Electrical/rc2/rc2_lbl.txt ================================================================== --- mtt/lib/examples/Electrical/rc2/rc2_lbl.txt +++ mtt/lib/examples/Electrical/rc2/rc2_lbl.txt @@ -0,0 +1,39 @@ +#SUMMARY rc2 Simple example of a heirachical system +#DESCRIPTION Uses 2 copies of the RC subsystem + +## System rc2, representation lbl, language txt +## File rc2_lbl.txt +## Generated by MTT on Thu Mar 13 16:27:26 GMT 2003 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type De + y SS external + +## Component type RC + rc_1 lin c_1;r_1 + rc_2 lin c_2;r_2 + +## Component type Se + u SS external + ADDED mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_abg.fig Index: mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_abg.fig ================================================================== --- mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_abg.fig +++ mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_abg.fig @@ -0,0 +1,31 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 900 2925 2475 2925 2250 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2970 2925 4545 2925 4320 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2700 2700 2700 1125 2925 1350 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 2700 2475 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 2925 7200 2925 6975 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7447 2722 7447 1147 7672 1372 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7650 2925 9225 2925 9000 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7650 2700 7650 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7425 3150 7425 4725 7650 4500 +4 1 -1 0 0 0 20 0.0000 4 195 135 2700 3015 1\001 +4 2 -1 0 0 0 20 0.0000 4 195 615 855 3015 SS:V\001 +4 1 -1 0 0 0 20 0.0000 4 195 375 2745 990 R:r\001 +4 1 -1 0 0 0 20 0.0000 4 195 870 5130 3015 CM:cm\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 7425 3015 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 405 7425 1035 C:k\001 +4 0 -1 0 0 0 20 0.0000 4 195 540 9495 3015 SS:v\001 +4 1 -1 0 0 0 20 0.0000 4 195 405 7380 5040 R:d\001 ADDED mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_desc.tex Index: mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_desc.tex ================================================================== --- mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_desc.tex +++ mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_desc.tex @@ -0,0 +1,21 @@ +% Verbal description for system Electrostatic (Electrostatic_desc.tex) +% Generated by MTT on Fri Sep 19 18:07:08 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Electrostatic} is + displayed in Figure \Ref{Electrostatic_abg} and its label + file is listed in Section \Ref{sec:Electrostatic_lbl}. + The subsystems are listed in Section \Ref{sec:Electrostatic_sub}. + +This is a simple electrostatic speaker using the \textbf{CM} +transducer component together with an electrical \textbf{R} and a +mechanical \textbf{R} and \textbf{C} components to model a compliant +support for the moving plate. See Karnopp, Margolis and Rosenberg +Section 8.2 for a similar example. + ADDED mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_input.txt Index: mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_input.txt ================================================================== --- mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_input.txt +++ mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (Electrostatic_input.txt) +# Generated by MTT at Fri Sep 19 17:34:53 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:42:25 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Thu Jun 5 15:47:51 BST 2003: u(1) = 1.0; # V (Default value) +electrostatic__v = 1.0; # Added by MTT on Thu Jun 05 15:47:54 BST 2003 ADDED mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_lbl.txt Index: mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_lbl.txt ================================================================== --- mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_lbl.txt +++ mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_lbl.txt @@ -0,0 +1,31 @@ +%SUMMARY Electrostatic: Simple electrostatic speaker model (uses CM) +%DESCRIPTION See Karnopp, Margolis & Rosenberg Section 8.2 +%% Label file for system Electrostatic (Electrostatic_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + k lin state,k + +% Component type CM + cm none c_0;x_0;m + +% Component type R + d lin flow,d + r lin flow,r + +% Component type SS + V SS external,internal + v SS 0,external ADDED mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_numpar.txt Index: mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_numpar.txt ================================================================== --- mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_numpar.txt +++ mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_numpar.txt @@ -0,0 +1,26 @@ +# Numerical parameter file (Electrostatic_numpar.txt) +# Generated by MTT at Fri Sep 19 17:43:25 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:42:25 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_0 = 1.0; # Parameter c_0 for Electrostatic +d = 1.0; # Parameter d for Electrostatic +k = 100.0; # Parameter k for Electrostatic +m = 1.0; # Parameter m for Electrostatic +r = 1.0; # Parameter r for Electrostatic +x_0 = 1.0; # Parameter x_0 for Electrostatic + +# Initial states +## Removed by MTT on Thu Jun 5 15:45:05 BST 2003: x(1) = 0.0; # Initial state for Electrostatic (k) +## Removed by MTT on Thu Jun 5 15:45:05 BST 2003: x(2) = 0.0; # Initial state for Electrostatic_cm (transducer) +## Removed by MTT on Thu Jun 5 15:45:05 BST 2003: x(3) = 1.0; # Initial state for Electrostatic_cm (transducer) +## Removed by MTT on Thu Jun 5 15:45:05 BST 2003: x(4) = 0.0; # Initial state for Electrostatic_cm (mass) ADDED mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_rep.txt Index: mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_rep.txt ================================================================== --- mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_rep.txt +++ mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_rep.txt @@ -0,0 +1,19 @@ +# Outline report file for system Electrostatic (Electrostatic_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:42:25 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt Electrostatic abg tex +mtt Electrostatic struc tex +mtt Electrostatic ode tex +mtt Electrostatic numpar txt +mtt Electrostatic input txt +mtt Electrostatic simpar txt +mtt Electrostatic odeso ps ADDED mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_simp.r Index: mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_simp.r ================================================================== --- mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_simp.r +++ mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_simp.r @@ -0,0 +1,10 @@ +%% Reduce comands to simplify output for system Electrostatic (Electrostatic_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_state.txt Index: mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_state.txt ================================================================== --- mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_state.txt +++ mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_state.txt @@ -0,0 +1,17 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System Electrostatic, representation state, language txt; +## File Electrostatic_state.txt; +## Generated by MTT on Mon Feb 5 16:40:35 GMT 2001; + + + +## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: Electrostatic_cm_1_mass = 0.0; # Default +## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: Electrostatic_cm_1_transducer = 0.0; # Default +## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: ## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: Electrostatic_cm_1_transducer_2 = 1.0; # plate displacement +## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: Electrostatic_k = 0.0; # Default +electrostatic__cm__mass = 0.0; +electrostatic__cm__transducer = 0.0; +electrostatic__cm__transducer_2 = 1.0; +electrostatic__k = 0.0; ADDED mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_abg.fig Index: mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_abg.fig ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_abg.fig +++ mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_abg.fig @@ -0,0 +1,50 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 6930 405 13770 3600 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8328 2028 9903 2028 9903 2928 8328 2928 8328 2028 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 2475 8190 2475 7965 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11475 2250 11475 1035 11700 1260 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11700 2475 12915 2475 12690 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 12915 2250 12915 2700 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 12150 3150 10800 3150 10800 450 12150 450 12150 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10035 2475 11250 2475 11025 2700 +4 1 -1 0 0 0 20 0.0000 4 255 1110 9138 2568 DC:gener\001 +4 1 1 1 0 3 20 0.0000 4 255 1575 9225 3510 DC generator\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 11475 2610 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 675 13410 2610 SS:v2\001 +4 1 -1 0 0 0 20 0.0000 4 255 585 11475 900 R:r_l\001 +4 1 1 1 0 3 20 0.0000 4 210 1575 11475 3510 Resistive load\001 +-6 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1170 2475 2385 2475 2160 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4186 2476 5401 2476 5176 2701 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 13185 4275 13185 225 45 225 45 4275 13185 4275 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 2476 2026 4051 2026 4051 2926 2476 2926 2476 2026 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 7245 2925 4950 2925 4950 2025 7245 2025 7245 2925 +4 1 -1 0 0 0 20 0.0000 4 195 1170 3286 2566 DC:motor\001 +4 1 1 1 0 3 20 0.0000 4 195 1155 3285 3510 DC motor\001 +4 1 -1 0 0 0 20 0.0000 4 195 1275 6120 2520 Shaft:shaft\001 +4 1 1 1 0 3 20 0.0000 4 270 1605 6165 3510 Flexible shaft\001 +4 1 4 100 0 18 14 0.0000 4 210 1110 2250 1890 [Electrical]\001 +4 1 4 100 0 18 14 0.0000 4 210 1110 10170 1980 [Electrical]\001 +4 1 4 100 0 18 14 0.0000 4 210 1335 4140 1890 [Mechanical]\001 +4 1 4 100 0 18 14 0.0000 4 210 1335 8325 1980 [Mechanical]\001 +4 1 -1 0 0 0 20 0.0000 4 195 885 675 2565 PSU:v1\001 ADDED mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_desc.tex Index: mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_desc.tex ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_desc.tex +++ mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_desc.tex @@ -0,0 +1,117 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system MotorGenerator (MotorGenerator_desc.tex) +% Generated by MTT on Thu Nov 16 13:11:36 GMT 2000. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:43:16 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{MotorGenerator} is + displayed in Figure \Ref{fig:MotorGenerator_abg.ps} and its label + file is listed in Section \Ref{sec:MotorGenerator_lbl}. + The subsystems are listed in Section \Ref{sec:MotorGenerator_sub}. + +This example illustates: +\begin{itemize} +\item The reuse of the DC model as both a motor and a generator +\item The assignment of a \emph{domain} and \emph{units} to component ports. +\end{itemize} + +The command: +\begin{verbatim} +mtt -I MotorGenerator ese r +\end{verbatim} +gives the following output (irrelevant parts ommitted) +\begin{verbatim} +MTT (Model Transformation Tools) version 4.8 +($Date$) +This is free software with ABSOLUTELY NO WARRANTY. +Type `mtt warranty' for details. + +Creating MotorGenerator_rbg.m +Creating MotorGenerator_cmp.m +Creating MotorGenerator_fig.fig +Creating MotorGenerator_sabg.fig +Creating MotorGenerator_alias.txt +Creating MotorGenerator_alias.m +Creating MotorGenerator_sub.sh +Copying DC from /home/peterg/mtt_new/mtt-lib/comp/compound/Electromechanical/DC to . +Creating DC_rbg.m +Creating DC_cmp.m +Creating DC_fig.fig +Creating DC_sabg.fig +Creating DC_alias.txt +Creating DC_alias.m +Creating DC_sub.sh +Creating DC_abg.m +Checking port domains and units + domains and units are OK + +... + +Creating PSU_rbg.m +Creating PSU_cmp.m +Creating PSU_fig.fig +Creating PSU_sabg.fig +Creating PSU_alias.txt +Creating PSU_alias.m +Creating PSU_sub.sh +Copying Se from /home/peterg/mtt_new/mtt-lib/comp/compound/General/Se to . +Creating Se_rbg.m +Creating Se_cmp.m +Creating Se_fig.fig +Creating Se_sabg.fig +Creating Se_alias.txt +Creating Se_alias.m +Creating Se_sub.sh +Creating Se_abg.m +Checking port domains and units + no domains or units declared +.... + +Creating PSU_abg.m +Checking port domains and units + domains and units are OK +... + +Creating Shaft_rbg.m +Creating Shaft_cmp.m +Creating Shaft_fig.fig +Creating Shaft_sabg.fig +Creating Shaft_alias.txt +Creating Shaft_alias.m +Creating Shaft_sub.sh +Creating Shaft_abg.m +Checking port domains and units + domains and units are OK +.... + +Creating MotorGenerator_abg.m +Checking port domains and units + no domains or units declared + +Creating MotorGenerator_cbg.m (maximise integral causality) +Creating MotorGenerator_type.sh + ..... +Creating MotorGenerator_ese.r +Creating MotorGenerator_def.r +Creating MotorGenerator_struc.txt +... +INFORMATION: Component MotorGenerator connects ports with units volt and volt +INFORMATION: Component MotorGenerator connects ports with units amp and amp +... +INFORMATION: Component MotorGenerator connects ports with units N*m and N*m +INFORMATION: Component MotorGenerator connects ports with units radians/s and radians/s +... +INFORMATION: Component MotorGenerator connects ports with units N*m and N*m +INFORMATION: Component MotorGenerator connects ports with units radians/s and radians/s +Creating MotorGenerator_aliased.txt +Copying MotorGenerator_ese.r + +\end{verbatim} ADDED mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_input.txt Index: mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_input.txt ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_input.txt +++ mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_input.txt @@ -0,0 +1,11 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System MotorGenerator, representation input, language txt; +## File MotorGenerator_input.txt; +## Generated by MTT on Mon Dec 9 09:08:54 UTC 2002; + + + +## Removed by MTT on Thu Jun 5 16:43:47 BST 2003: MotorGenerator_v1_v_u = 1.0; # Default +motorgenerator__v1__v__u = 1.0; # Added by MTT on Thu Jun 05 16:43:50 BST 2003 ADDED mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_lbl.txt Index: mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_lbl.txt ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_lbl.txt +++ mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_lbl.txt @@ -0,0 +1,48 @@ +%SUMMARY MotorGenerator: Motor-generator example +%DESCRIPTION A simple example of DC motor driving a generator via +%DESCRIPTION a flexible shaft + +%% Label file for system MotorGenerator (MotorGenerator_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/11/16 09:58:49 peterg +% %% Initial revision +% %% +% %% Revision 1.3 2000/05/20 16:38:40 peterg +% %% New SS foramt +% %% +% %% Revision 1.2 1998/04/04 10:51:59 peterg +% %% New version using port coercion +% %% +% %% Revision 1.1 1996/12/04 16:24:01 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Voltage in +v1 SS external,internal + +% Voltage out +v2 SS external,0 + +%Motor +motor lin k_m;l_m;r_m;j_m;b_m + +%Shaft +shaft lin c_s + +%Generator +gener lin k_g;l_g;r_g;j_g;b_g + +% Resistive load +r_l lin flow,r_l + ADDED mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_numpar.txt Index: mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_numpar.txt ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_numpar.txt +++ mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_numpar.txt @@ -0,0 +1,31 @@ +# Numerical parameter file (MotorGenerator_numpar.txt) +# Generated by MTT at Wed Dec 10 08:29:31 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/04 14:42:47 peterg +# %% Initial revision +# %% +# %% Revision 1.1 2000/08/01 12:26:48 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +b_g = 0.0; # Parameter b_g for MotorGenerator +b_m = 0.0; # Parameter b_m for MotorGenerator +c_s = 0.01; # Parameter c_s for MotorGenerator +j_g = 1.0; # Parameter j_g for MotorGenerator +j_m = 1.0; # Parameter j_m for MotorGenerator +k_g = 1.0; # Parameter k_g for MotorGenerator +k_m = 1.0; # Parameter k_m for MotorGenerator +l_g = 0.1; # Parameter l_g for MotorGenerator +l_m = 0.1; # Parameter l_m for MotorGenerator +r_g = 0.1; # Parameter r_g for MotorGenerator +r_l = 1.0; # Parameter r_l for MotorGenerator +## Removed by MTT on Mon Dec 4 14:44:19 GMT 2000: r_m_1 = 0.1; # Parameter r_m for MotorGenerator + +r_m = 0.1; # Added by MTT on Mon Dec 04 14:44:44 GMT 2000 ADDED mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_rep.txt Index: mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_rep.txt ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_rep.txt +++ mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_rep.txt @@ -0,0 +1,33 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system MotorGenerator (MotorGenerator_rep.txt) +## Generated by MTT on" Thu Nov 16 13:37:07 GMT 2000. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt MotorGenerator abg tex # The system description +mtt MotorGenerator cbg ps # The causal bond graph +mtt MotorGenerator struc tex # The system structure +mtt MotorGenerator sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt MotorGenerator dae tex # The system dae +mtt MotorGenerator ode tex # The system ode +## mtt MotorGenerator sspar tex # Steady-state parameters +## mtt MotorGenerator ss tex # Steady state +## mtt MotorGenerator dm tex # Descriptor matrices (of linearised system) +mtt MotorGenerator sm tex # State matrices (of linearised system) +##mtt MotorGenerator tf tex # Transfer function (of linearised system) +## mtt MotorGenerator lmfr ps # log modulus of frequency response (of linearised system) +## mtt MotorGenerator simpar tex # Simulation parameters +## mtt MotorGenerator numpar tex # Numerical simulation parameters +## mtt MotorGenerator state tex # Simulation initial state +## mtt MotorGenerator input tex # Simulation input +## mtt MotorGenerator logic tex # Logic control +mtt MotorGenerator odeso ps # Simulation output + +mtt MotorGenerator rep txt # This file + ADDED mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_simpar.txt Index: mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_simpar.txt ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_simpar.txt +++ mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_simpar.txt @@ -0,0 +1,19 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system MotorGenerator (MotorGenerator_simpar.txt) +# Generated by MTT on Fri Dec 1 18:03:55 GMT 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +FIRST = 0.0; # First time in simulation output +DT = 0.1; # Print interval +LAST = 10.0; # Last time in simulation +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Electromechanical/MotorGenerator/PSU_abg.fig Index: mtt/lib/examples/Electromechanical/MotorGenerator/PSU_abg.fig ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/PSU_abg.fig +++ mtt/lib/examples/Electromechanical/MotorGenerator/PSU_abg.fig @@ -0,0 +1,19 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3780 1710 4860 2025 +4 0 4 100 0 18 18 0.0000 4 270 1065 3780 1935 SS:[out]\001 +-6 +6 1530 675 4995 3015 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 4950 2970 1575 2970 1575 720 4950 720 4950 2970 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 1845 3600 1845 3375 2070 +4 1 0 100 0 18 18 0.0000 4 210 570 1890 1935 Se:v\001 ADDED mtt/lib/examples/Electromechanical/MotorGenerator/PSU_lbl.txt Index: mtt/lib/examples/Electromechanical/MotorGenerator/PSU_lbl.txt ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/PSU_lbl.txt +++ mtt/lib/examples/Electromechanical/MotorGenerator/PSU_lbl.txt @@ -0,0 +1,30 @@ +%% Label file for system PSU (PSU_lbl.txt) +%SUMMARY PSU +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%UNITS out electrical volt amp +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [out] SS external,external + +% Component type Se + v SS external + ADDED mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_abg.fig Index: mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_abg.fig ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_abg.fig +++ mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_abg.fig @@ -0,0 +1,30 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 1440 405 4410 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 2250 2925 1035 3150 1260 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1486 2476 2701 2476 2476 2701 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 3600 3150 2250 3150 2250 450 3600 450 3600 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 2475 4365 2475 4140 2700 +4 1 -1 0 0 0 20 0.0000 4 195 135 2925 2565 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 630 2925 900 C:c_s\001 +4 1 1 1 0 3 20 0.0000 4 270 1605 2925 3510 Flexible shaft\001 +-6 +6 540 2340 1440 2655 +4 2 4 100 0 18 18 0.0000 4 270 870 1440 2565 SS:[in]\001 +-6 +6 4455 2340 5535 2655 +4 0 4 100 0 18 18 0.0000 4 270 1065 4455 2565 SS:[out]\001 +-6 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 5850 3825 450 3825 450 225 5850 225 5850 3825 ADDED mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_lbl.txt Index: mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_lbl.txt ================================================================== --- mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_lbl.txt +++ mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_lbl.txt @@ -0,0 +1,38 @@ +%% Label file for system Shaft (Shaft_lbl.txt) +%SUMMARY Shaft +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:43:16 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + + +% Unit definitions +%UNITS in rotational N*m radians/s +%UNITS out rotational N*m radians/s + +% Argument aliases +%ALIAS $1 c_s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + c_s lin effort,c_s + +% Component type SS + [in] SS external,external + [out] SS external,external ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_abg.fig Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_abg.fig ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_abg.fig +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_abg.fig @@ -0,0 +1,30 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 4 1 7 1 0 -1 0.000 0 0 -1 0 0 4 + 2700 2025 7875 2025 7875 9450 2700 9450 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 6525 5625 7875 5850 7650 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 3780 5625 5130 5850 4905 +2 2 0 2 1 3 1 0 20 0.000 0 0 0 0 0 5 + 2700 5175 7875 5175 7875 6525 2700 6525 2700 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2835 855 2835 5850 3060 5625 +2 2 0 2 1 3 1 0 20 0.000 0 0 0 0 0 5 + 2700 1575 2970 1575 2970 5175 2700 5175 2700 1575 +2 1 1 2 1 7 1 0 -1 6.000 0 0 -1 0 0 2 + 2700 585 2700 9855 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 10125 9450 225 1125 225 1125 10125 9450 10125 +4 1 4 0 0 0 20 0.0000 4 240 3075 5625 8190 [mechanical,mass,thermal]\001 +4 1 -1 0 0 0 30 0.0000 4 300 1950 5625 8595 CG:bottom\001 +4 1 4 0 0 0 20 0.0000 4 255 3885 5625 6345 [mechanical_b,mass_b,thermal_b]\001 +4 1 -1 0 0 0 30 0.0000 4 405 3345 5625 5940 LeakyPiston:piston\001 +4 1 -1 0 0 0 30 0.0000 4 405 1260 5625 3285 CG:top\001 +4 1 4 0 0 0 20 0.0000 4 240 3075 5625 3600 [mechanical,mass,thermal]\001 +4 1 4 0 0 0 20 0.0000 4 255 3750 5625 5400 [mechanical_t,mass_t,thermal_t]\001 +4 1 4 0 0 0 20 0.0000 4 240 750 3375 5895 [shaft]\001 +4 0 -1 0 0 0 20 0.0000 4 195 975 2925 900 SS:shaft\001 ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_desc.tex Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_desc.tex ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_desc.tex +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_desc.tex @@ -0,0 +1,33 @@ +% Verbal description for system LeakyCylinder (LeakyCylinder_desc.tex) +% Generated by MTT on Tue Nov 25 17:22:29 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:44:35 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{LeakyCylinder} is + displayed in Figure \Ref{LeakyCylinder_abg} and its label + file is listed in Section \Ref{sec:LeakyCylinder_lbl}. + The subsystems are listed in Section \Ref{sec:LeakyCylinder_sub}. + +This example roughly corresponds to the Example in section 12.4.3 +(Fig. 12.17) of Karnopp, Margolis and Rosenberg (1990). It is a pseudo bond +graph representation based on the ``thermal accumulator'' of section +12.4.1 and the ``isentropic nozzle'' of section 12.4.2 of that book. + +[ +Notes added by PJG 10 June 03. +\begin{enumerate} +\item The parameters/states used in the simulation (odeso) are + meaningless at the moment. +\item The steady-state parameters (sspar.r) need to be calculated; at + the moment, the state mattrices (sm) are in terms of the + steady-state states. +\end{enumerate} +] ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_input.txt Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_input.txt ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_input.txt +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_input.txt @@ -0,0 +1,12 @@ +# Numerical parameter file (LeakyCylinder_input.txt) +# Generated by MTT at Tue Nov 25 17:00:09 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +u(1) = 0.0; # shaft ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_lbl.txt Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_lbl.txt ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_lbl.txt +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_lbl.txt @@ -0,0 +1,36 @@ +%SUMMARY LeakyCylinder: Pseudo bond graph model of compressible gas dynamics + +%DESCRIPTION This example roughly corresponds to the Example in +%DESCRIPTION section 12.4.3 (Fig. 12.17) of Karnopp, Margolis and Rosenberg +%DESCRIPTION (1990). It is a pseudo bond graph representation based on the +%DESCRIPTION "thermal acummulator" of section 12.4.1 and the "isentropic +%DESCRIPTION nozzle" of section 12.4.2 of that book. + +%% Label file for system LeakyCylinder (LeakyCylinder_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/04 09:56:05 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type CG + bottom none c_v;r + top none c_v;r + +% Component type LeakyPiston + piston none m_p;a_b;a_t;gamma;r;0 + +% Component type SS + shaft SS external,external ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_numpar.txt Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_numpar.txt ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_numpar.txt +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_numpar.txt @@ -0,0 +1,26 @@ +# Numerical parameter file (LeakyCylinder_numpar.txt) +# Generated by MTT at Mon Dec 1 08:59:51 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:44:35 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +a_b = 1.0; # Parameter a_b for LeakyCylinder +## Removed by MTT on Tue Jun 10 09:55:26 BST 2003: a_l = 1.0; # Parameter a_l for LeakyCylinder +a_t = 1.0; # Parameter a_t for LeakyCylinder +c_v = 1.0; # Parameter c_v for LeakyCylinder +gamma = 1.0; # Parameter gamma for LeakyCylinder +m_p = 1.0; # Parameter m_p for LeakyCylinder +r = 1.0; # Parameter r for LeakyCylinder + +# Initial states +## Removed by MTT on Tue Jun 10 09:55:26 BST 2003: x(3) = 0.0; # Initial state for LeakyCylinder_bottom (cg) +## Removed by MTT on Tue Jun 10 09:55:26 BST 2003: x(6) = 0.0; # Initial state for LeakyCylinder_top (cg) +## Removed by MTT on Tue Jun 10 09:55:26 BST 2003: x(7) = 0.0; # Initial state for LeakyCylinder_piston_piston (m_p) ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_rep.txt Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_rep.txt ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_rep.txt +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_rep.txt @@ -0,0 +1,26 @@ +# Outline report file for system LeakyCylinder (LeakyCylinder_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2003/06/11 15:57:57 gawthrop +% %% Updated examples for latest MTT. +% %% +% %% Revision 1.1 2000/12/28 17:44:35 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt LeakyCylinder abg tex +mtt LeakyCylinder struc tex +mtt LeakyCylinder sympar tex +mtt LeakyCylinder ode tex +mtt LeakyCylinder ss tex +mtt LeakyCylinder sm tex +##mtt LeakyCylinder odeso ps + +mtt LeakyCylinder rep txt + + ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_simp.r Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_simp.r ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_simp.r +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_simp.r @@ -0,0 +1,10 @@ +%% Reduce comands to simplify output for system LeakyCylinder (LeakyCylinder_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_sspar.r Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_sspar.r ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_sspar.r +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_sspar.r @@ -0,0 +1,10 @@ +%% Reduce steady-state parameter file for LeakyCylinder (LeakyCylinder_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_abg.fig Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_abg.fig ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_abg.fig +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_abg.fig @@ -0,0 +1,54 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 3375 6300 4725 6525 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7200 3375 7200 4725 7425 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 6075 6300 8122 6525 7897 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7245 6075 7245 8100 7470 7875 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4500 9000 9225 9000 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 450 9000 4050 9000 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 4050 9675 4050 450 450 450 450 9675 4050 9675 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9225 9675 4500 9675 4500 450 9225 450 9225 9675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 2925 6300 1575 6525 1800 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7200 2925 7200 1575 7425 1800 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 2925 3150 1575 3375 1800 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 3375 3150 4725 3375 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2056 4711 1101 3756 1101 4074 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 6075 3150 7425 3375 7200 +4 0 4 0 0 0 20 0.0000 4 255 1440 7200 5040 [thermal_in]\001 +4 1 4 0 0 0 20 0.0000 4 255 1110 6300 5040 [mass_in]\001 +4 1 4 0 0 0 20 0.0000 4 255 1260 6300 5895 [mass_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 1590 7200 5895 [thermal_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 1755 7155 8505 SS:[thermal_b]\001 +4 2 4 0 0 0 20 0.0000 4 255 1425 6255 8505 SS:[mass_b]\001 +4 1 1 1 0 0 20 0.0000 4 195 1335 6750 9450 Leak model\001 +4 1 1 1 0 0 20 0.0000 4 195 1515 2250 9405 Piston Model\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 6300 3240 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 7200 3240 0\001 +4 2 4 0 0 0 20 0.0000 4 255 2115 3195 1305 SS:[mechanical_t]\001 +4 2 4 0 0 0 20 0.0000 4 255 1380 6345 1305 SS:[mass_t]\001 +4 0 4 0 0 0 20 0.0000 4 255 1710 7155 1350 SS:[thermal_t]\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 3150 3240 0\001 +4 1 4 0 0 0 20 0.0000 4 255 540 3150 5040 [top]\001 +4 1 4 0 0 0 20 0.0000 4 240 750 2070 5040 [shaft]\001 +4 1 4 0 0 0 20 0.0000 4 240 1155 1080 3645 SS:[shaft]\001 +4 2 4 0 0 0 20 0.0000 4 255 2160 3150 7785 SS:[mechanical_b]\001 +4 1 4 0 0 0 20 0.0000 4 240 990 3150 5940 [bottom]\001 +4 1 -1 0 0 0 30 0.0000 4 300 1425 6885 5535 RG:leak\001 +4 1 -1 0 0 0 30 0.0000 4 405 2295 2700 5535 Piston:piston\001 ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_desc.tex Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_desc.tex ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_desc.tex +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system LeakyPiston (LeakyPiston_desc.tex) +% Generated by MTT on Fri Nov 28 12:09:15 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{LeakyPiston} is + displayed in Figure \Ref{LeakyPiston_abg} and its label + file is listed in Section \Ref{sec:LeakyPiston_lbl}. + The subsystems are listed in Section \Ref{sec:LeakyPiston_sub}. ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_lbl.txt Index: mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_lbl.txt ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_lbl.txt +++ mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_lbl.txt @@ -0,0 +1,35 @@ +%SUMMARY LeakyPiston: Leaky piston sub model +%DESCRIPTION +%% Label file for system LeakyPiston (LeakyPiston_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/04 10:00:11 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type Piston + piston lin $1;$2;$3 + +% Component type RG + leak lin $4;$5;$6 + +% Component type SS + [mass_b] SS external,external + [mass_t] SS external,external + [mechanical_b] SS external,external + [mechanical_t] SS external,external + [shaft] SS external,external + [thermal_b] SS external,external + [thermal_t] SS external,external ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_abg.fig Index: mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_abg.fig ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_abg.fig +++ mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_abg.fig @@ -0,0 +1,31 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 1575 6075 3150 6300 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 3600 6075 4275 6300 4050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 4636 6075 5311 6300 5086 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 4500 4500 4500 4725 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5905 4281 4950 3326 4950 3645 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 5850 6075 7200 6300 6975 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3375 8100 6975 8100 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6975 8775 6975 900 3375 900 3375 8775 6975 8775 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9945 9225 9945 450 450 450 450 9225 9945 9225 +4 1 -1 0 0 0 20 0.0000 4 255 780 6120 3465 TF:a_t\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 6075 4590 1\001 +4 2 4 0 0 0 20 0.0000 4 240 1155 4905 3240 SS:[shaft]\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 4050 4545 I:m_p\001 +4 1 -1 0 0 0 20 0.0000 4 255 825 6075 5670 TF:a_b\001 +4 2 4 0 0 0 20 0.0000 4 240 1395 6120 7650 SS:[bottom]\001 +4 1 1 1 0 0 20 0.0000 4 195 1515 5175 8505 Piston Model\001 +4 2 4 0 0 0 20 0.0000 4 255 945 6120 1395 SS:[top]\001 ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_desc.tex Index: mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_desc.tex ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_desc.tex +++ mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_desc.tex @@ -0,0 +1,22 @@ +% Verbal description for system Piston (Piston_desc.tex) +% Generated by MTT on Fri Nov 28 12:09:27 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Piston} is + displayed in Figure \Ref{Piston_abg} and its label + file is listed in Section \Ref{sec:Piston_lbl}. + The subsystems are listed in Section \Ref{sec:Piston_sub}. + +The two {\bf TF} components convert pressure to force. The {\bf I} +component represents piston inertia. + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_lbl.txt Index: mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_lbl.txt ================================================================== --- mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_lbl.txt +++ mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_lbl.txt @@ -0,0 +1,32 @@ +%SUMMARY Piston: simple model of the piston +%DESCRIPTION Inludes inertia and pressure effects. +%% Label file for system Piston (Piston_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/04 10:01:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type I + m_p lin flow,$1 + +% Component type SS + [bottom] SS external,external + [shaft] SS external,external + [top] SS external,external + +% Component type TF + a_b lin flow,$2 + a_t lin effort,$3 ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_abg.fig Index: mtt/lib/examples/Hybrid/Bounce/Bounce_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_abg.fig +++ mtt/lib/examples/Hybrid/Bounce/Bounce_abg.fig @@ -0,0 +1,64 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +6 3150 4410 5940 4995 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 + 3154 4730 5449 4730 5404 4730 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3379 4730 3154 4955 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3604 4730 3379 4955 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3829 4730 3604 4955 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4054 4730 3829 4955 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4279 4730 4054 4955 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4505 4731 4280 4956 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4730 4731 4505 4956 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4955 4731 4730 4956 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5180 4731 4955 4956 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5405 4731 5180 4956 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 5897 4413 5627 4683 +-6 +1 3 0 2 1 7 1 0 -1 0.0000000 1 0.000 4276 2206 612 612 4276 2206 4636 2701 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 0 0 2.00 120.00 240.00 + 5176 1531 4906 1801 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 2475 5175 3600 5175 3330 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 2250 2925 2250 3150 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 2250 5625 2250 5400 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 2070 4275 946 4500 1171 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 4050 4275 2475 4500 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4297 4522 4297 5646 4522 5421 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 3600 7875 3600 7650 3825 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 6300 8775 225 225 225 225 6300 8775 6300 +4 2 -1 0 0 2 20 0.0000000 4 240 2130 2835 2250 R:air_resistance\001 +4 1 -1 0 0 2 20 0.0000000 4 210 150 4276 2341 1\001 +4 1 1 1 0 3 20 0.0000000 4 210 525 5176 1441 Ball\001 +4 0 -1 0 0 2 20 0.0000000 4 270 1365 5760 2340 SS:gravity\001 +4 1 -1 0 0 2 20 0.0000000 4 240 1515 4275 810 I:ball_mass\001 +4 1 -1 0 0 2 20 0.0000000 4 270 1710 4320 5940 CSW:ground\001 +4 1 1 1 0 3 20 0.0000000 4 210 960 6030 4275 Ground\001 +4 1 1 1 0 3 20 0.0000000 4 150 135 4590 3465 v\001 +4 1 1 1 0 3 20 0.0000000 4 150 315 4590 5220 -v\001 +4 1 -1 0 0 2 20 0.0000000 4 210 150 4275 4365 0\001 +4 1 -1 0 0 2 20 0.0000000 4 210 1275 5985 3690 INTF:intf\001 +4 0 -1 0 0 2 20 0.0000000 4 210 585 8010 3690 SS:x\001 ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_desc.tex Index: mtt/lib/examples/Hybrid/Bounce/Bounce_desc.tex ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_desc.tex +++ mtt/lib/examples/Hybrid/Bounce/Bounce_desc.tex @@ -0,0 +1,47 @@ +% Verbal description for system Bounce (Bounce_desc.tex) +% Generated by MTT on Wed Jul 2 10:55:51 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:45:24 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Bounce}, togehter with a + schematic diagram is + displayed in Figure \Ref{Bounce_abg} and its label + file is listed in Section \Ref{sec:Bounce_lbl}. + The subsystems are listed in Section \Ref{sec:Bounce_sub}. + +The model uses the {\bf CSW} switched {\bf C} element to simulate +contact with the ground. The corresponding switching function (See +Section \ref{sec:Bounce_input-noargs.txt}), is based on the height above the +ground $h$ as follows: +\begin{equation} +i_{sw} = + \begin{cases} + 0 & \text{if $h > 0$}\\ + -1 & \text{if $h \le 0$} + \end{cases} +\end{equation} + +In other words, the component acts as an ideal spring when the ball is +in contact with the ground yet has no effect when the ball is not in +contact with the ground. + +The ball is modelled as a point mass (the \textbf{I} component) and a +linear resistance to motion (the (the \textbf{R} component). + +The system was simulated for 100 time units and the resultant height +is plotted in Figure \ref{fig:Bounce_odeso-noargs.ps}. The ball was released at zero +velocity from a height of ten units. The bounce height decreases due to +the effect of the modelled air resistance. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_input.txt Index: mtt/lib/examples/Hybrid/Bounce/Bounce_input.txt ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_input.txt +++ mtt/lib/examples/Hybrid/Bounce/Bounce_input.txt @@ -0,0 +1,29 @@ +# Numerical parameter file (Bounce_input.txt) +# Generated by MTT at Wed Jul 2 10:47:49 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.4 2001/10/05 11:24:29 gawthrop +# %% Updated for new mtt features - input.txt etc +# %% +# %% Revision 1.3 2000/05/18 11:30:14 peterg +# %% Moved switch logic to logic.txt +# %% +# %% Revision 1.2 1998/10/01 19:20:33 peterg +# %% Cahged switch function +# %% +# %% Revision 1.1 1998/07/25 18:35:02 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Fri Oct 5 10:37:56 BST 2001: mttu(1) = 9.81; + + +## Removed by MTT on Tue Jun 10 10:22:08 BST 2003: bounce_gravity = 9.81; # Added by MTT on Fri Oct 05 10:37:59 BST 2001 +bounce__gravity = 9.81; + ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_lbl.txt Index: mtt/lib/examples/Hybrid/Bounce/Bounce_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_lbl.txt +++ mtt/lib/examples/Hybrid/Bounce/Bounce_lbl.txt @@ -0,0 +1,37 @@ +%SUMMARY Bounce: Bouncing ball example (hybrid) +%DESCRIPTION +%% Label file for system Bounce (Bounce_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/09/11 09:54:22 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type INTF + intf + +% Component type CSW + ground lin state,k_g + +% Component type I + ball_mass lin flow,m + +% Component type R + air_resistance lin flow,r + +% Component type SS + gravity SS external,internal + x SS external,0 + ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_logic.txt Index: mtt/lib/examples/Hybrid/Bounce/Bounce_logic.txt ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_logic.txt +++ mtt/lib/examples/Hybrid/Bounce/Bounce_logic.txt @@ -0,0 +1,24 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system Bounce (Bounce_logic.txt) +# Generated by MTT on Thu May 18 12:29:15 BST 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2002/09/29 13:14:12 geraint +## Updated names. +## +## Revision 1.2 2000/12/28 17:45:24 peterg +## To RCS +## +## Revision 1.1 2000/05/18 11:29:58 peterg +## Initial revision +## +############################################################### + + +# Set the switches + +## On when below ground level +bounce__ground__mtt_switch_logic = (bounce__intf__mttc < 0); ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_numpar.txt Index: mtt/lib/examples/Hybrid/Bounce/Bounce_numpar.txt ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_numpar.txt +++ mtt/lib/examples/Hybrid/Bounce/Bounce_numpar.txt @@ -0,0 +1,17 @@ +# Numerical parameter file (Bounce_numpar.txt) +# Generated by MTT at Wed Jul 2 10:47:47 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:45:24 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +k_g = 100.0; # Ground stiffness +m = 1.0; # Ball mass +r = 1.0; # Air resistance ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_rep.txt Index: mtt/lib/examples/Hybrid/Bounce/Bounce_rep.txt ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_rep.txt +++ mtt/lib/examples/Hybrid/Bounce/Bounce_rep.txt @@ -0,0 +1,25 @@ +# Outline report file for system Bounce (Bounce_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/05/19 07:09:19 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt Bounce abg tex +mtt Bounce struc tex +mtt Bounce ode tex + + +mtt Bounce simpar txt +mtt Bounce input txt +mtt Bounce logic txt +mtt Bounce numpar txt + +mtt Bounce odeso ps + +mtt Bounce rep txt ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_simpar.txt Index: mtt/lib/examples/Hybrid/Bounce/Bounce_simpar.txt ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_simpar.txt +++ mtt/lib/examples/Hybrid/Bounce/Bounce_simpar.txt @@ -0,0 +1,16 @@ +# Simulation parameters for system Bounce (Bounce_simpar.txt) +# Generated by MTT on Sat Jul 25 15:57:56 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/10/01 19:21:04 peterg +## Initial revision +## +############################################################### +FIRST=0.0; +LAST=10.0; +DT=0.02; +STEPFACTOR=1; + ADDED mtt/lib/examples/Hybrid/Bounce/Bounce_state.txt Index: mtt/lib/examples/Hybrid/Bounce/Bounce_state.txt ================================================================== --- mtt/lib/examples/Hybrid/Bounce/Bounce_state.txt +++ mtt/lib/examples/Hybrid/Bounce/Bounce_state.txt @@ -0,0 +1,29 @@ +# -*-octave-*- +# Initial state file (Bounce_state.txt) +# Generated by MTT at Sat Jul 25 15:56:57 BST 1998 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.4 2002/09/29 13:14:12 geraint +## Updated names. +## +## Revision 1.3 2001/10/05 11:24:30 gawthrop +## Updated for new mtt features - input.txt etc +## +## Revision 1.2 1998/07/25 20:34:05 peterg +## *** empty log message *** +## +## Revision 1.1 1998/07/25 14:59:11 peterg +## Initial revision +## +############################################################### + +# Set the states +## Removed by MTT on Tue Jun 10 10:23:07 BST 2003: bounce_ball_mass = 0.0; # +## Removed by MTT on Tue Jun 10 10:23:07 BST 2003: bounce_ground_mtt_switch = 0.0; # +## Removed by MTT on Tue Jun 10 10:23:07 BST 2003: bounce_intf_mttc = 10.0; # +bounce__ball_mass = 0.0; # Zero velocity +bounce__ground__mtt_switch = 0.0; # Not on ground +bounce__intf__mttc = 10.0; # 10m above ground ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_abg.fig Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_abg.fig +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_abg.fig @@ -0,0 +1,161 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +6 3513 9498 8733 9858 +6 3513 9498 4953 9813 +6 3513 9498 4233 9768 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3514 9724 3739 9499 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3739 9724 3964 9499 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3964 9724 4189 9499 +-6 +6 4189 9499 4909 9769 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4190 9725 4415 9500 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4415 9725 4640 9500 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4640 9725 4865 9500 +-6 +-6 +6 4864 9499 6304 9814 +6 4864 9499 5584 9769 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4865 9725 5090 9500 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5090 9725 5315 9500 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5315 9725 5540 9500 +-6 +6 5540 9500 6260 9770 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5541 9726 5766 9501 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5766 9726 5991 9501 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 5991 9726 6216 9501 +-6 +-6 +6 6214 9499 6934 9769 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 6215 9725 6440 9500 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 6440 9725 6665 9500 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 6665 9725 6890 9500 +-6 +6 6890 9500 7610 9770 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 6891 9726 7116 9501 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 7116 9726 7341 9501 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 7341 9726 7566 9501 +-6 +6 7565 9500 8285 9770 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 7566 9726 7791 9501 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 7791 9726 8016 9501 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 8016 9726 8241 9501 +-6 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3514 9499 8689 9499 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 8242 9727 8467 9502 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 8467 9727 8692 9502 +-6 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4727 2072 4727 3647 4952 3422 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6077 2072 6077 3647 6302 3422 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4502 3647 4952 3647 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5852 3647 6302 3647 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7202 3647 7652 3647 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 8823 4728 10398 4953 10173 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 6571 2926 6571 3151 6796 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2251 6797 2251 8372 2476 8147 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9923 6774 9923 8349 10148 8124 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5851 4771 6301 4771 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 8372 4726 6797 4951 7022 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4501 6346 4501 6796 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7651 6346 7651 6796 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7629 6571 9204 6571 8979 6796 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 6347 4726 4772 4951 4997 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2521 4186 4096 4186 3871 4411 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4096 3961 4096 4411 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 4770 7426 6345 7651 6120 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 6795 7426 8370 7651 8145 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8101 4186 9676 4186 9451 4411 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8101 3961 8101 4411 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 3647 7426 2072 7651 2297 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6076 4772 6076 6347 6301 6122 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 8820 7426 10395 7651 10170 +2 2 0 2 1 3 1 0 20 0.000 0 0 0 0 0 5 + 3827 3422 8327 3422 8327 4997 3827 4997 3827 3422 +2 1 0 3 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 3.00 180.00 360.00 + 9226 2521 8371 3196 +2 1 0 3 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 3.00 180.00 360.00 + 11458 7718 10603 8393 +2 1 0 3 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 3.00 180.00 360.00 + 701 7685 1556 8360 +4 1 -1 0 0 2 20 0.0000000 4 210 1470 2115 6660 INTF:intfL\001 +4 1 -1 0 0 2 20 0.0000000 4 210 1215 6077 4322 ROD:rod\001 +4 1 4 0 0 2 20 0.0000000 4 240 360 6077 3962 [p7]\001 +4 1 4 0 0 2 20 0.0000000 4 240 360 6077 4637 [p8]\001 +4 1 -1 0 0 2 20 0.0000000 4 210 150 4727 6662 1\001 +4 1 -1 0 0 2 20 0.0000000 4 210 150 7427 6662 1\001 +4 1 -1 0 0 2 20 0.0000000 4 210 150 4728 8688 0\001 +4 1 -1 0 0 2 20 0.0000000 4 270 1905 4728 10713 CSW:groundL\001 +4 1 -1 0 0 2 20 0.0000000 4 210 150 7428 8688 0\001 +4 1 -1 0 0 2 20 0.0000000 4 270 1365 6077 6662 SS:gravity\001 +4 1 -1 0 0 2 20 0.0000000 4 210 795 10217 4277 SS:aR\001 +4 1 -1 0 0 2 20 0.0000000 4 210 1485 10126 6661 INTF:intfR\001 +4 1 -1 0 0 2 20 0.0000000 4 210 795 2251 8641 SS:hL\001 +4 1 -1 0 0 2 20 0.0000000 4 210 810 9946 8641 SS:hR\001 +4 1 -1 0 0 2 20 0.0000000 4 210 795 6077 1937 SS:xC\001 +4 1 -1 0 0 2 20 0.0000000 4 270 1920 7426 10711 CSW:groundR\001 +4 1 -1 0 0 2 20 0.0000000 4 210 780 4727 1937 SS:xL\001 +4 1 -1 0 0 2 20 0.0000000 4 210 795 7427 1937 SS:xR\001 +4 1 4 0 0 2 20 0.0000000 4 240 360 4727 3962 [p3]\001 +4 1 4 0 0 2 20 0.0000000 4 240 360 7427 3962 [p4]\001 +4 1 4 0 0 2 20 0.0000000 4 240 360 4727 4637 [p5]\001 +4 1 4 0 0 2 20 0.0000000 4 240 360 7426 4636 [p6]\001 +4 1 -1 0 0 2 20 0.0000000 4 210 780 2026 4276 SS:aL\001 +4 1 4 0 0 2 20 0.0000000 4 240 360 4411 4276 [p1]\001 +4 1 4 0 0 2 20 0.0000000 4 240 360 7876 4321 [p2]\001 +4 0 1 1 0 3 30 0.0000000 4 300 1470 5311 10171 Ground\001 +4 0 1 1 0 3 30 0.0000000 4 390 2685 8326 2476 Bouncing Rod\001 +4 0 1 1 0 3 30 0.0000000 4 390 3315 11026 7651 Height of right tip\001 +4 2 1 1 0 3 30 0.0000000 4 390 3000 1800 7515 Height of left tip\001 ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_desc.tex Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_desc.tex ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_desc.tex +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_desc.tex @@ -0,0 +1,51 @@ +% Verbal description for system BouncingRod (BouncingRod_desc.tex) +% Generated by MTT on Sun Jul 6 17:21:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1999/12/20 09:36:24 peterg +% %% *** empty log message *** +% %% +% Revision 1.1 1997/07/06 16:35:20 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The acausal bond graph of system \textbf{BouncingRod} is displayed in +Figure \Ref{BouncingRod_abg} and its label file is listed in Section +\Ref{sec:BouncingRod_lbl}. + The subsystems are listed in Section +\Ref{sec:BouncingRod_sub}. + +The system consists of a uniform rod of mass 1kg, length 2m (and +therefore of inertia about the mass centre of $\frac{1}{3} +\text{kgm}^2$. The rod is released at an angle of $\frac{\pi}{4}$ from +the vertical, the mass centre is $10\text{m}$ above the ground and all +velocities are initially zero. The gravitational constant is taken as unity. + +The ground is modeled as an ideal compliance in the vertical +direction with compliance of $0.1 \text{mN}^{-1}$ and it is assumed +that contact takes place at the rod tips only. There is no +horizontal resistance to motion. This idealised setup is modeled by a +two {\bf CSW} components, one for each rod tip, modulated by the +height of each rod tip above the ground: each {\bf CSW} is off when +the corresponding height is positive. + +The system was simulated for 100 time units and the resultant height +of each tip is plotted in Figure \ref{fig:BouncingRod_odeso-noargs.ps}. The rod was +released at zero velocity from a height of ten units and at an angle +of $\frac{\pi}{4}$ radians to the vertical. The oscillations in height +are due to rod rotation about its mass centre. The bounce height +changes due to energy transfer to and from the rod rotation about its +mass centre. + + + + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: "yes" +%%% End: ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_input.txt Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_input.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_input.txt +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_input.txt @@ -0,0 +1,21 @@ +# Numerical parameter file (BouncingRod_input.txt) +# Generated by MTT at Fri Jul 4 14:09:14 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.2 2000/12/04 08:27:42 peterg +# %% New version +# %% +# %% Revision 1.1 1997/07/06 16:17:48 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Mon Dec 4 08:27:04 GMT 2000: u(1) = 9.81; # gravity (Default value) +## Removed by MTT on Tue Jun 10 10:33:30 BST 2003: bouncingrod_gravity = 9.81; # Added by MTT on Mon Dec 04 08:27:10 GMT 2000 +bouncingrod__gravity = 9.81; # Gravity + ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_lbl.txt Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_lbl.txt +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_lbl.txt @@ -0,0 +1,55 @@ +%SUMMARY BouncingRod: Two-dimensional bouncing rod (hybrid) +%DESCRIPTION A uniform rod bounces on a compliant surface -- the +%DESCRIPTION CSW component is used. + +%% Label file for system BouncingRod (BouncingRod_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.5 2000/12/04 08:36:23 peterg +% %% Declare pi +% %% +% %% Revision 1.4 2000/05/18 10:30:39 peterg +% %% New SS form +% %% +% %% Revision 1.3 1997/09/11 09:55:25 peterg +% %% Added documentation +% %% +% %% Revision 1.2 1997/09/11 08:37:29 peterg +% %% Added description +% %% +% %% Revision 1.1 1997/07/06 16:18:37 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type CSW + groundL lin effort,epsilon + groundR lin effort,epsilon + +% Component type INTF + intfL + intfR + +% Component type ROD + rod none l;l;j;m + +% Component type SS + aL SS 0,internal + aR SS 0,internal + gravity SS external,internal + hL SS external,0 + hR SS external,0 + xC SS 0,internal + xL SS 0,internal + xR SS 0,internal ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_logic.txt Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_logic.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_logic.txt +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_logic.txt @@ -0,0 +1,21 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system BouncingRod (BouncingRod_logic.txt) +# Generated by MTT on Thu May 18 12:14:35 BST 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2002/09/29 15:31:39 geraint +## Updated names. +## +## Revision 1.1 2000/12/28 17:45:59 peterg +## To RCS +## +############################################################### + +# Set the switches +## Removed by MTT on Tue Jun 10 10:45:53 BST 2003: bouncingrod_groundl_mtt_switch_logic = (bouncingrod_intfl_mttc <= 0); +## Removed by MTT on Tue Jun 10 10:45:53 BST 2003: bouncingrod_groundr_mtt_switch_logic = (bouncingrod_intfr_mttc <= 0); +bouncingrod__groundl__mtt_switch_logic = (bouncingrod__intfl__mttc <= 0); +bouncingrod__groundr__mtt_switch_logic = (bouncingrod__intfr__mttc <= 0); ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_numpar.txt Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_numpar.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_numpar.txt +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_numpar.txt @@ -0,0 +1,24 @@ +# Numerical parameter file (BouncingRod_numpar.txt) +# Generated by MTT at Fri Jul 4 14:09:11 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.2 2000/12/28 17:45:59 peterg +# %% To RCS +# %% +# %% Revision 1.1 1997/07/06 16:17:27 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +epsilon = 0.01; +l = 1.0; # Default value +m = 1.0; # Default value +j = l*l*m/3; + + + ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_odes.h Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_odes.h ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_odes.h +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_odes.h @@ -0,0 +1,7 @@ +/* +%% Parameter file for system BouncingRod (BouncingRod_odes.h) +%% This file provides the params for simulation: +*/ +#define DT 0.1 /* Time step (for printing) */ +#define LAST 99.9 /* Last time */ +#define STEPFACTOR 1000 /* Integration steps per time step */ ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_rep.txt Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_rep.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_rep.txt +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_rep.txt @@ -0,0 +1,25 @@ +# Outline report file for system BouncingRod (BouncingRod_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 17:45:59 peterg +% %% To RCS +% %% +% %% Revision 1.1 1997/07/06 16:20:44 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt BouncingRod abg tex +mtt BouncingRod struc tex +mtt BouncingRod ode tex +mtt BouncingRod numpar txt +mtt BouncingRod input txt +mtt BouncingRod logic txt +mtt BouncingRod odeso ps + + + ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_simpar.txt Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_simpar.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_simpar.txt +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_simpar.txt @@ -0,0 +1,17 @@ +# Simulation parameters for system BouncingRod (BouncingRod_simpar.txt) +# Generated by MTT on Sun Jul 26 12:14:17 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1999/12/21 08:07:38 peterg +## Initial revision +## +############################################################### + +LAST=20; +DT=0.01; +STEPFACTOR=1; + + ADDED mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_state.txt Index: mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_state.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_state.txt +++ mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_state.txt @@ -0,0 +1,37 @@ +# Initial state file (BouncingRod_state.txt) +# Generated by MTT at Sun Jul 26 12:19:13 BST 1998 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2002/09/29 15:31:39 geraint +## Updated names. +## +## Revision 1.2 2002/05/10 12:38:11 gawthrop +## Updated to new format +## +## Revision 1.1 2000/12/28 17:45:59 peterg +## To RCS +## +############################################################### + + +# Set the states + +## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_groundl_mtt_switch = 0.0; +## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_groundr_mtt_switch = 0.0; +## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_intfl_mttc = 10 + sin(pi/4); +## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_intfr_mttc = 10 - sin(pi/4); +## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_rod_j = 0.0; +## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_rod_m_x = 0.0; +## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_rod_m_y = 0.0; +## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_rod_th_mttc = pi/4; +bouncingrod__groundl__mtt_switch = 0.0; +bouncingrod__groundr__mtt_switch = 0.0; +bouncingrod__intfl__mttc = 10 + sin(pi/4); # Start at 45 degree angle +bouncingrod__intfr__mttc = 10 - sin(pi/4); # Start at 45 degree angle +bouncingrod__rod__j = 0.0; +bouncingrod__rod__m_x = 0.0; +bouncingrod__rod__m_y = 0.0; +bouncingrod__rod__th__mttc = pi/4; # Start at 45 degree angle ADDED mtt/lib/examples/Hybrid/BouncingRod/CSW_lbl.txt Index: mtt/lib/examples/Hybrid/BouncingRod/CSW_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/CSW_lbl.txt +++ mtt/lib/examples/Hybrid/BouncingRod/CSW_lbl.txt @@ -0,0 +1,30 @@ +%SUMMARY ISW: Switched I component +%DESCRIPTION ISW acts as an I component except when the -s -c option is used. +%DESCRIPTION When the -s -c option is used: +%DESCRIPTION The component label is used as a variable name (eg Name) +%DESCRIPTION In the ode simulation: +%DESCRIPTION Name = 1 implies normal I (closed switch) +%DESCRIPTION Name = 0 implies state=0 (open switch) +%DESCRIPTION Name = -1 implies state>0 (Diode) + +%% Label file for system ISW (ISW_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/06/03 15:26:09 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type I + MTT_SWITCH $1 $1 ADDED mtt/lib/examples/Hybrid/BouncingRod/ROD_abg.fig Index: mtt/lib/examples/Hybrid/BouncingRod/ROD_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/ROD_abg.fig +++ mtt/lib/examples/Hybrid/BouncingRod/ROD_abg.fig @@ -0,0 +1,125 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 3600 675 2250 675 2250 9675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 4 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 4 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 4 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2700 5625 2700 5400 1800 6300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 5401 5625 9001 5850 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 7875 2925 9000 3195 8730 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 7875 8325 9000 8595 8730 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8550 5400 9450 6300 9225 6300 +4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 I:J\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 +4 1 -1 0 0 0 20 0.0000 4 240 720 8372 1217 SS:[p5]\001 +4 1 -1 0 0 0 20 0.0000 4 240 720 5671 9361 SS:[p2]\001 +4 1 -1 0 0 0 20 0.0000 4 240 720 8417 9362 SS:[p6]\001 +4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000 4 210 270 4501 4456 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 4501 3781 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 3826 4051 [mod]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 6301 4006 [mod]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 6211 6526 [mod]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 4591 5896 [in]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 4591 6841 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 3916 6526 [mod]\001 +4 1 -1 0 0 0 20 0.0000 4 240 720 2971 1216 SS:[p3]\001 +4 1 -1 0 0 0 20 0.0000 4 240 720 5671 1216 SS:[p1]\001 +4 1 -1 0 0 0 20 0.0000 4 240 720 2971 9361 SS:[p4]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 4411 5446 [out]\001 +4 1 26 0 0 0 16 0.0000 4 210 270 4906 5446 [in]\001 +4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTF:th\001 +4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 +4 1 4 1 0 0 20 0.0000 4 255 390 1350 2700 Tip\001 +4 1 4 1 0 0 20 0.0000 4 255 390 1350 9855 Tip\001 +4 1 4 1 0 0 20 0.0000 4 195 1380 1080 6120 Mass centre\001 +4 1 -1 0 0 0 20 0.0000 4 240 720 1710 6615 SS:[p7]\001 +4 1 -1 0 0 0 20 0.0000 4 240 720 9495 6570 SS:[p8]\001 ADDED mtt/lib/examples/Hybrid/BouncingRod/ROD_desc.tex Index: mtt/lib/examples/Hybrid/BouncingRod/ROD_desc.tex ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/ROD_desc.tex +++ mtt/lib/examples/Hybrid/BouncingRod/ROD_desc.tex @@ -0,0 +1,17 @@ +% Verbal description for system ROD (ROD_desc.tex) +% Generated by MTT on Fri Jul 4 10:30:17 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ROD} is + displayed in Figure \Ref{ROD_abg} and its label + file is listed in Section \Ref{sec:ROD_lbl}. + The subsystems are listed in Section \Ref{sec:ROD_sub}. + + +This is a special version just for this problem. ADDED mtt/lib/examples/Hybrid/BouncingRod/ROD_lbl.txt Index: mtt/lib/examples/Hybrid/BouncingRod/ROD_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/BouncingRod/ROD_lbl.txt +++ mtt/lib/examples/Hybrid/BouncingRod/ROD_lbl.txt @@ -0,0 +1,60 @@ +%SUMMARY ROD: rigid rod in two dimensions +%DESCRIPTION Port [1]: Angular torque/velocity - end 1 +%DESCRIPTION Port [2]: Angular torque/velocity - end 2 +%DESCRIPTION Port [3]: x force/velocity - end 1 +%DESCRIPTION Port [4]: x force/velocity - end 2 +%DESCRIPTION Port [5]: y force/velocity - end 1 +%DESCRIPTION Port [6]: y force/velocity - end 2 +%DESCRIPTION Port [7]: x force/velocity - centre +%DESCRIPTION Port [8]: y force/velocity - centre +%DESCRIPTION +%DESCRIPTION Parameter 1: length from end 1 to mass centre +%DESCRIPTION Parameter 2: length from end 2 to mass centre +%DESCRIPTION Parameter 3: inertia about mass centre +%DESCRIPTION Parameter 4: mass +%DESCRIPTION See Section 10.2 of "Metamodelling" + + +%% Label file for system ROD (ROD_lbl.txt) + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,$3 +m_x lin flow,$4 +m_y lin flow,$4 + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,$1 +s2 lsin flow,$2 +c1 lcos flow,$1 +c2 lcos flow,$2 + +% ports + +[p1] SS external,external +[p2] SS external,external +[p3] SS external,external +[p4] SS external,external +[p5] SS external,external +[p6] SS external,external +[p7] SS external,external +[p8] SS external,external ADDED mtt/lib/examples/Hybrid/Clutch/Clutch_abg.fig Index: mtt/lib/examples/Hybrid/Clutch/Clutch_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Clutch_abg.fig +++ mtt/lib/examples/Hybrid/Clutch/Clutch_abg.fig @@ -0,0 +1,23 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 4726 3376 4726 2026 2476 2026 2476 3376 4726 3376 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8101 3376 8101 2026 5851 2026 5851 3376 8101 3376 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11476 3376 11476 2026 9226 2026 9226 3376 11476 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4501 2701 6076 2701 5941 2836 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7876 2701 9451 2701 9316 2836 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1126 2701 2701 2701 2566 2836 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11925 5400 11925 225 225 225 225 5400 11925 5400 +4 1 -1 0 0 0 20 0.0000 4 195 1170 3511 2791 DC:motor\001 +4 1 -1 0 0 0 20 0.0000 4 195 1140 10306 2791 Load:load\001 +4 1 -1 0 0 0 20 0.0000 4 195 1290 7021 2791 Drive:drive\001 +4 1 -1 0 0 0 20 0.0000 4 195 525 765 2790 SS:e\001 ADDED mtt/lib/examples/Hybrid/Clutch/Clutch_desc.tex Index: mtt/lib/examples/Hybrid/Clutch/Clutch_desc.tex ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Clutch_desc.tex +++ mtt/lib/examples/Hybrid/Clutch/Clutch_desc.tex @@ -0,0 +1,28 @@ +% Verbal description for system Clutch (Clutch_desc.tex) +% Generated by MTT on Thu Jul 3 13:57:59 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:46:44 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Clutch} is displayed in + Figure \Ref{Clutch_abg} and its label file is listed in Section + \Ref{sec:Clutch_lbl}. The subsystems are listed in Section + \Ref{sec:Clutch_sub}. The details of the DC motor and the load are + hidden behind a word bond graph so as to focus on the clutch + mechanism as modelled by the \textbf{CSW} component. + It is natural to model the clutch shaft by a +compliance to absorb the shock of engaging the clutch; therefore the +drive model contains a \textbf{CSW} component. + + +Figure \ref{fig:Clutch_odeso-noargs.ps}, shows the angular velocities of the motor +and load. The clutch is engaged from time $t$ given by $0= 5)&&(t < 15)); # ADDED mtt/lib/examples/Hybrid/Clutch/Clutch_numpar.txt Index: mtt/lib/examples/Hybrid/Clutch/Clutch_numpar.txt ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Clutch_numpar.txt +++ mtt/lib/examples/Hybrid/Clutch/Clutch_numpar.txt @@ -0,0 +1,19 @@ +# Numerical parameter file (Clutch_numpar.txt) +# Generated by MTT at Thu Jul 3 12:12:35 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +b_m = 0.1; # Default value +epsilon = 0.01; +j_l = 1.0; # Default value +j_m = 10.0; # Default value +k_m = 1.0; # Default value +l_a = 0.1; # Default value +r_a = 1.0; # Default value +r_l = 5.0; # Default value ADDED mtt/lib/examples/Hybrid/Clutch/Clutch_rep.txt Index: mtt/lib/examples/Hybrid/Clutch/Clutch_rep.txt ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Clutch_rep.txt +++ mtt/lib/examples/Hybrid/Clutch/Clutch_rep.txt @@ -0,0 +1,28 @@ +# Outline report file for system Clutch (Clutch_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/05/19 07:16:07 peterg +% %% Added logic +% %% +% %% Revision 1.1 1999/02/21 08:18:25 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt Clutch abg tex +mtt Clutch struc tex +mtt Clutch ode tex +mtt Clutch dm tex + +mtt Clutch simpar txt +mtt Clutch input txt +mtt Clutch logic txt +mtt Clutch numpar txt + +mtt Clutch odeso ps + +mtt Clutch rep txt ADDED mtt/lib/examples/Hybrid/Clutch/Clutch_simpar.txt Index: mtt/lib/examples/Hybrid/Clutch/Clutch_simpar.txt ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Clutch_simpar.txt +++ mtt/lib/examples/Hybrid/Clutch/Clutch_simpar.txt @@ -0,0 +1,16 @@ +# Simulation parameters for system Clutch (Clutch_simpar.txt) +# Generated by MTT on Sun Jul 26 13:26:44 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1999/12/21 09:13:19 peterg +## Initial revision +## +############################################################### + +LAST=20.0; +DT=0.1; +STEPFACTOR=1; + ADDED mtt/lib/examples/Hybrid/Clutch/Drive_abg.fig Index: mtt/lib/examples/Hybrid/Clutch/Drive_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Drive_abg.fig +++ mtt/lib/examples/Hybrid/Clutch/Drive_abg.fig @@ -0,0 +1,31 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1800 2475 2925 2475 2700 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3397 2497 4522 2497 4297 2722 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4950 2475 6075 2475 5850 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6547 2497 7672 2497 7447 2722 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 2700 3150 3825 3375 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 2700 6300 3825 6525 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4725 2250 4725 1125 4950 1350 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2925 2700 3375 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6030 2700 6525 2700 +4 1 -1 0 0 0 20 0.0000 4 195 135 3150 2565 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 6300 2565 1\001 +4 1 4 0 0 0 20 0.0000 4 240 810 1305 2565 SS:[in]\001 +4 1 4 0 0 0 20 0.0000 4 240 960 8235 2565 SS:[out]\001 +4 1 -1 0 0 0 20 0.0000 4 195 675 3150 4185 SS:v1\001 +4 1 -1 0 0 0 20 0.0000 4 195 675 6300 4185 SS:v2\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 4725 2610 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 1410 4725 945 CSW:clutch\001 ADDED mtt/lib/examples/Hybrid/Clutch/Drive_desc.tex Index: mtt/lib/examples/Hybrid/Clutch/Drive_desc.tex ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Drive_desc.tex +++ mtt/lib/examples/Hybrid/Clutch/Drive_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system Drive (Drive_desc.tex) +% Generated by MTT on Thu Jul 3 13:58:26 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Drive} is + displayed in Figure \Ref{Drive_abg} and its label + file is listed in Section \Ref{sec:Drive_lbl}. + The subsystems are listed in Section \Ref{sec:Drive_sub}. ADDED mtt/lib/examples/Hybrid/Clutch/Drive_lbl.txt Index: mtt/lib/examples/Hybrid/Clutch/Drive_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Drive_lbl.txt +++ mtt/lib/examples/Hybrid/Clutch/Drive_lbl.txt @@ -0,0 +1,35 @@ +%SUMMARY Drive: The clutch/shaft drive subsystem +%DESCRIPTION +%% Label file for system Drive (Drive_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/05/18 10:32:32 peterg +% %% New SS form +% %% +% %% Revision 1.1 1997/09/11 09:39:16 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type CSW + clutch lin effort,epsilon + +% Component type R +% r_d lin flow,r_d + +% Component type SS + v1 SS 0,external + v2 SS 0,external + [in] SS external,external + [out] SS external,external ADDED mtt/lib/examples/Hybrid/Clutch/Load_abg.fig Index: mtt/lib/examples/Hybrid/Clutch/Load_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Load_abg.fig +++ mtt/lib/examples/Hybrid/Clutch/Load_abg.fig @@ -0,0 +1,22 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 3376 2926 3376 2701 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 3151 3151 2251 3376 2476 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 3601 3151 4501 3376 4276 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 2476 1801 3826 1801 3826 4951 2476 4951 2476 1801 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 2026 3151 2476 3151 2476 3601 2026 3601 2026 3151 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6075 5400 6075 900 495 900 495 5400 6075 5400 +4 1 -1 0 0 0 20 0.0000 4 195 135 3151 3466 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 450 3151 2161 I:j_l\001 +4 1 -1 0 0 0 20 0.0000 4 255 585 3196 4816 R:r_l\001 +4 1 4 0 0 0 20 0.0000 4 240 810 1576 3466 SS:[in]\001 +4 1 1 1 0 0 20 0.0000 4 255 4395 3331 1531 Rotating load with inertia and friction\001 ADDED mtt/lib/examples/Hybrid/Clutch/Load_desc.tex Index: mtt/lib/examples/Hybrid/Clutch/Load_desc.tex ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Load_desc.tex +++ mtt/lib/examples/Hybrid/Clutch/Load_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system Load (Load_desc.tex) +% Generated by MTT on Thu Jul 3 13:58:38 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Load} is + displayed in Figure \Ref{Load_abg} and its label + file is listed in Section \Ref{sec:Load_lbl}. + The subsystems are listed in Section \Ref{sec:Load_sub}. ADDED mtt/lib/examples/Hybrid/Clutch/Load_lbl.txt Index: mtt/lib/examples/Hybrid/Clutch/Load_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/Clutch/Load_lbl.txt +++ mtt/lib/examples/Hybrid/Clutch/Load_lbl.txt @@ -0,0 +1,29 @@ +%SUMMARY Load: An inertial/frictional load +%DESCRIPTION +%% Label file for system Load (Load_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/09/11 09:39:29 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type I + j_l lin flow,j_l + +% Component type R + r_l lin flow,r_l + +% Component type SS + [in] SS external,external ADDED mtt/lib/examples/Hybrid/Weirs/Weir_abg.fig Index: mtt/lib/examples/Hybrid/Weirs/Weir_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weir_abg.fig +++ mtt/lib/examples/Hybrid/Weirs/Weir_abg.fig @@ -0,0 +1,28 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1350 2025 2475 2025 2250 2250 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 1800 2700 675 2925 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2925 2025 4050 2025 3825 2250 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 2025 5625 2025 5400 2250 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 1800 4275 675 4500 900 +2 4 0 2 31 7 99 0 -1 6.000 0 0 7 0 0 5 + 6975 3600 6975 180 225 180 225 3600 6975 3600 +4 1 0 100 0 0 20 0.0000 4 195 150 2700 2115 1\001 +4 1 0 100 0 0 20 0.0000 4 210 1065 2700 585 ISW:isw\001 +4 1 4 100 0 0 20 0.0000 4 255 870 765 2115 SS:[in]\001 +4 1 4 100 0 0 20 0.0000 4 255 1020 6255 2115 SS:[out]\001 +4 1 0 100 0 0 20 0.0000 4 195 150 4275 2115 1\001 +4 1 0 100 0 0 20 0.0000 4 195 390 4230 585 R:r\001 +4 1 1 99 0 1 20 0.0000 4 270 2250 3375 2835 Simple weir model\001 ADDED mtt/lib/examples/Hybrid/Weirs/Weir_desc.tex Index: mtt/lib/examples/Hybrid/Weirs/Weir_desc.tex ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weir_desc.tex +++ mtt/lib/examples/Hybrid/Weirs/Weir_desc.tex @@ -0,0 +1,24 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system Weir (Weir_desc.tex) +% Generated by MTT on Tue Mar 2 22:05:29 GMT 1999. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Weir} is + displayed in Figure \Ref{Weir_abg} and its label + file is listed in Section \Ref{sec:Weir_lbl}. + The subsystems are listed in Section \Ref{sec:Weir_sub}. + + +The weir is modelled by an \textbf{ISW} component in series with an +\textbf{R} component. Physicaly, the former represents the inertia of +the fluid together with the switching effect of the weir; the latter +represents the flow resistance. + +The switching logic is on if the level on either side of the weir +reaches the level of the weir. ADDED mtt/lib/examples/Hybrid/Weirs/Weir_lbl.txt Index: mtt/lib/examples/Hybrid/Weirs/Weir_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weir_lbl.txt +++ mtt/lib/examples/Hybrid/Weirs/Weir_lbl.txt @@ -0,0 +1,54 @@ +#SUMMARY Weir +#DESCRIPTION Detailed description here + +## System Weir, representation lbl, language txt +## File Weir_lbl.txt +## Generated by MTT on Fri Oct 5 10:50:46 BST 2001 + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.2 2001/07/03 22:59:10 gawthrop + ## Fixed problems with argument passing for CRs + ## + ############################################################### + +## Port aliases +#ALIAS in in +#ALIAS out out + +## Argument aliases +#ALIAS $1 i_s +#ALIAS $2 r + +## Each line should be of one of the following forms: +## a comment (ie starting with #) +## component-name cr_name arg1,arg2,..argn +## blank + +## ---- Component labels ---- + +## Component type ISW + isw lin flow,i_s + +## Component type R + r lin flow,r + +## Component type R + [in] SS external,external + [out] SS external,external + + + + + + + + + ADDED mtt/lib/examples/Hybrid/Weirs/Weirs_abg.fig Index: mtt/lib/examples/Hybrid/Weirs/Weirs_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weirs_abg.fig +++ mtt/lib/examples/Hybrid/Weirs/Weirs_abg.fig @@ -0,0 +1,73 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 6075 2025 4950 2250 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 675 6300 1800 6300 1530 6570 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 6525 2025 7650 2250 7425 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 675 6075 675 6525 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 7650 2250 7650 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 6525 6750 7200 6570 7200 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 6300 3375 6300 3105 6570 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 6300 5625 6300 5355 6570 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 6300 7200 6300 6930 6570 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 6300 9450 6300 9180 6570 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 6076 5851 4951 6076 5176 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5850 6525 5850 7650 6075 7425 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 7650 6075 7650 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9677 6077 9677 4952 9902 5177 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9675 6525 9675 7650 9900 7425 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9450 7650 9900 7650 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4860 3150 4860 1980 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 7110 3150 7110 1395 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 3 + 1 0 2.00 120.00 240.00 + 2610 450 3285 450 3285 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 + 3060 675 3060 3150 5760 3150 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 + 5985 3150 8955 3150 8955 675 +2 1 0 2 1 7 99 0 -1 0.000 0 0 -1 1 0 2 + 1 0 1.00 60.00 120.00 + 5850 2925 5850 3600 +4 1 -1 0 0 0 20 0.0000 4 195 150 2025 6390 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 960 2025 4815 C:tank1\001 +4 1 -1 0 0 0 20 0.0000 4 270 720 1980 7965 SS:p1\001 +4 1 -1 0 0 0 20 0.0000 4 210 525 315 6390 SS:f\001 +4 0 -1 0 0 0 20 0.0000 4 210 795 6300 7515 R:leak\001 +4 1 -1 0 0 0 20 0.0000 4 195 1065 3960 6390 Weir:w1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1065 7785 6390 Weir:w2\001 +4 1 -1 0 0 0 20 0.0000 4 210 960 5851 4816 C:tank2\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5851 6391 0\001 +4 1 -1 0 0 0 20 0.0000 4 270 720 5850 7965 SS:p2\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 9677 6392 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 960 9677 4817 C:tank3\001 +4 1 -1 0 0 0 20 0.0000 4 270 720 9630 7965 SS:p3\001 +4 1 1 1 0 3 20 0.0000 4 270 105 2970 315 f\001 +4 1 1 99 0 1 20 0.0000 4 210 825 3780 2565 Tank 1\001 +4 1 1 99 0 1 20 0.0000 4 210 825 5940 2565 Tank 2\001 +4 1 1 99 0 1 20 0.0000 4 210 825 8055 2565 Tank 3\001 +4 1 1 99 0 1 20 0.0000 4 210 585 5895 3870 Leak\001 ADDED mtt/lib/examples/Hybrid/Weirs/Weirs_desc.tex Index: mtt/lib/examples/Hybrid/Weirs/Weirs_desc.tex ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weirs_desc.tex +++ mtt/lib/examples/Hybrid/Weirs/Weirs_desc.tex @@ -0,0 +1,69 @@ +% Verbal description for system Weirs (Weirs_desc.tex) +% Generated by MTT on Thu Jul 3 10:27:26 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:47:43 peterg +% %% To RCS +% %% +% Revision 1.1 1997/09/11 10:31:48 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Weirs} is + displayed in Figure \Ref{Weirs_abg} and its label + file is listed in Section \Ref{sec:Weirs_lbl}. + The subsystems are listed in Section \Ref{sec:Weirs_sub}. + +%Each weir is modeled by two {\bf ISW} components: one for flow +%left-right and one for flow right-left. The switching is such that +%they become non-return valves when the left hand (respectively +%right-hand) level reaches an appropriate value. The parameters appear +%in Section \Ref{sec:Weirs_numpar.txt} and the switching conditions in +%Section \Ref{sec:Weirs_input.txt}. + +Aircraft fuel tanks are often fitted with baffles to reduce fuel +slosh. A simple model relating to such a system is shown in Figure +\Ref{Weirs_abg} which corresponds to a single tank containing two +dividing weirs. Liquid with flow rate $f$ enters the left-hand +compartment; liquid leaks out of the centre compartment at a flow rate +determined by gravity and the properties of the corresponding orifice. + +The Bond Graph appearing in Figure \Ref{Weirs_abg} represents each of +the three compartments by a \textbf{C} component (labelled tank1 to +tank3), the corresponding pressures are measured by the \textbf{SS} +elements p1--p3. The leak is represented by the \textbf{R} component +labelled leak. The flows over the two weirs are represented by the four +\textbf{ISW} components; each weir has a separate \textbf{ISW} +component for each flow direction. Each \textbf{ISW} component is +switched by the appropriate level. + +%It could be argued that, when switched on, each \textbf{ISW} component +%corresponds to flow inertia; but it is admitted that ideal +%\textbf{Sw} components would give a simpler approximation in this +%case. So the modeller has the choice of having a simple simulation +%problem but with four extra states, or a complex simulation with model +%switching but without the four extra states. + +The system was simulated for 20 time units and the resultant level of +each tank partition is plotted in Figure \Ref{fig:Weirs_odeso-noargs.ps}. Each +partition has unit cross section, and the two weir heights are $1$ and +$2$ respectively; the inflow $f$ is given by: +\begin{equation} + f = + \begin{cases} + 1 & \text{if $t \le 10$}\\ + 0 & \text{if $t > 10$} + \end{cases} +\end{equation} +and the leak resistance is linear with flow resistance 5. + + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Hybrid/Weirs/Weirs_input.txt Index: mtt/lib/examples/Hybrid/Weirs/Weirs_input.txt ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weirs_input.txt +++ mtt/lib/examples/Hybrid/Weirs/Weirs_input.txt @@ -0,0 +1,25 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (Weirs_input.txt) +# Generated by MTT at Tue Mar 2 07:48:04 GMT 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2001/10/05 11:24:35 gawthrop +## Updated for new mtt features - input.txt etc +## +## Revision 1.1 2000/05/19 07:12:04 peterg +## Initial revision +## +############################################################### + +# Set the inputs +## Removed by MTT on Fri Oct 5 10:47:20 BST 2001: mttu(1) = 1.0*(t<10); # f (Weirs) + + + +## Removed by MTT on Tue Jun 10 10:53:48 BST 2003: weirs_f = 1.0*(t<10); # Added by MTT on Fri Oct 05 10:48:01 BST 2001 + + +weirs__f = 1.0*(t<10); ADDED mtt/lib/examples/Hybrid/Weirs/Weirs_lbl.txt Index: mtt/lib/examples/Hybrid/Weirs/Weirs_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weirs_lbl.txt +++ mtt/lib/examples/Hybrid/Weirs/Weirs_lbl.txt @@ -0,0 +1,47 @@ +%% Label file for system Weirs (Weirs_lbl.txt) +%SUMMARY Weirs Double-weir tanks system (hybrid) +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/03/09 00:12:12 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases +%ALIAS $1 tank1 +%ALIAS $2 tank2 +%ALIAS $3 tank3 +%ALIAS $4 leak + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + tank1 lin effort,c_1 + tank2 lin effort,c_2 + tank3 lin effort,c_3 + +% Component type R + leak lin flow,r_l + +% Component type SS + f SS internal,external + p1 SS external,0 + p2 SS external,0 + p3 SS external,0 + +% Component type Weir + w1 none epsilon_i;epsilon_r + w2 none epsilon_i;epsilon_r ADDED mtt/lib/examples/Hybrid/Weirs/Weirs_logic.txt Index: mtt/lib/examples/Hybrid/Weirs/Weirs_logic.txt ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weirs_logic.txt +++ mtt/lib/examples/Hybrid/Weirs/Weirs_logic.txt @@ -0,0 +1,31 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system Weirs (Weirs_logic.txt) +# Generated by MTT on Thu May 18 12:29:15 BST 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 2002/09/29 14:23:16 geraint +## Updated switch names. +## +## Revision 1.2 2001/10/05 11:24:35 gawthrop +## Updated for new mtt features - input.txt etc +## +## Revision 1.1 2000/05/19 07:13:29 peterg +## Initial revision +## +## Revision 1.1 2000/05/18 11:29:58 peterg +## Initial revision +## +############################################################### + + +# Set the switches +# First weir - height 1 +# Second weir - height 2 +## Removed by MTT on Tue Jun 10 10:54:35 BST 2003: weirs_w1_isw_mtt_switch_logic = ((weirs_tank1 > 1) | (weirs_tank2 > 1)); +## Removed by MTT on Tue Jun 10 10:54:35 BST 2003: weirs_w2_isw_mtt_switch_logic = ((weirs_tank2 > 2) | (weirs_tank3 > 2)); +weirs__w1__isw__mtt_switch_logic = ((weirs__tank1 > 1) | (weirs__tank2 > 1)); +weirs__w2__isw__mtt_switch_logic = ((weirs__tank2 > 2) | (weirs__tank3 > 2)); + ADDED mtt/lib/examples/Hybrid/Weirs/Weirs_numpar.txt Index: mtt/lib/examples/Hybrid/Weirs/Weirs_numpar.txt ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weirs_numpar.txt +++ mtt/lib/examples/Hybrid/Weirs/Weirs_numpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (Weirs_numpar.txt) +# Generated by MTT at Tue Mar 2 07:55:47 GMT 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_1 = 1.0; # Weirs +c_2 = 1.0; # Weirs +c_3 = 1.0; # Weirs +epsilon_i = 0.01; # weir +epsilon_r = 0.1; # weir +r_l = 5.0; # Weirs ADDED mtt/lib/examples/Hybrid/Weirs/Weirs_rep.txt Index: mtt/lib/examples/Hybrid/Weirs/Weirs_rep.txt ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weirs_rep.txt +++ mtt/lib/examples/Hybrid/Weirs/Weirs_rep.txt @@ -0,0 +1,46 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system Weirs (Weirs_rep.txt) +## Generated by MTT on" Tue Mar 2 22:02:59 GMT 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.5 2000/05/19 07:15:04 peterg +## Added logic +## +## Revision 1.4 1999/12/21 09:24:26 peterg +## Euler integration - compiled +## +## Revision 1.3 1999/03/02 22:19:22 peterg +## Added switch rep +## +## Revision 1.2 1999/03/02 22:09:49 peterg +## Addded switch rep +## +## Revision 1.1 1999/03/02 22:04:11 peterg +## Initial revision +## +############################################################### + +mtt Weirs abg tex # The system description +## mtt Weirs cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt Weirs struc tex # The system structure +## mtt Weirs dae tex # The system dae +mtt Weirs ode tex # The system ode +mtt Weirs switch txt # The system switches +## mtt Weirs sspar tex # Steady-state parameters +## mtt Weirs ss tex # Steady state +## mtt Weirs dm tex # Descriptor matrices (of linearised system) +## mtt Weirs sm tex # State matrices (of linearised system) +## mtt Weirs tf tex # Transfer function (of linearised system) +## mtt Weirs lmfr ps # log modulus of frequency response (of linearised system) +mtt Weirs simpar tex # Simulation parameters +mtt Weirs numpar tex # Numerical simulation parameters +mtt Weirs input tex # Simulation input +mtt Weirs logic tex # Switch logic +mtt Weirs odeso ps # Simulation output + +mtt Weirs rep txt ADDED mtt/lib/examples/Hybrid/Weirs/Weirs_simpar.txt Index: mtt/lib/examples/Hybrid/Weirs/Weirs_simpar.txt ================================================================== --- mtt/lib/examples/Hybrid/Weirs/Weirs_simpar.txt +++ mtt/lib/examples/Hybrid/Weirs/Weirs_simpar.txt @@ -0,0 +1,16 @@ +# Simulation parameters for system Weirs (Weirs_simpar.txt) +# Generated by MTT on Sun Jul 26 13:55:27 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1999/12/21 09:22:43 peterg +## Initial revision +## +############################################################### + + +LAST=19.9; +DT=0.01; +STEPFACTOR=1; ADDED mtt/lib/examples/Hybrid/Weirs/weir_abg.fig Index: mtt/lib/examples/Hybrid/Weirs/weir_abg.fig ================================================================== --- mtt/lib/examples/Hybrid/Weirs/weir_abg.fig +++ mtt/lib/examples/Hybrid/Weirs/weir_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1350 2025 2475 2025 2250 2250 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 1800 2700 675 2925 900 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2700 2250 2700 3375 2925 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2925 2025 4050 2025 3825 2250 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 2025 5625 2025 5400 2250 +4 1 0 100 0 0 20 0.0000 4 195 150 2700 2115 1\001 +4 1 0 100 0 0 20 0.0000 4 210 1065 2700 585 ISW:isw\001 +4 1 0 100 0 0 20 0.0000 4 195 390 2700 3690 R:r\001 +4 1 0 100 0 0 20 0.0000 4 255 870 765 2115 SS:[in]\001 +4 1 0 100 0 0 20 0.0000 4 255 1020 6255 2115 SS:[out]\001 +4 1 0 100 0 0 20 0.0000 4 195 150 4275 2115 1\001 ADDED mtt/lib/examples/Hybrid/Weirs/weir_lbl.txt Index: mtt/lib/examples/Hybrid/Weirs/weir_lbl.txt ================================================================== --- mtt/lib/examples/Hybrid/Weirs/weir_lbl.txt +++ mtt/lib/examples/Hybrid/Weirs/weir_lbl.txt @@ -0,0 +1,37 @@ +%% Label file for system weir (weir_lbl.txt) +%SUMMARY weir +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS out out + +% Argument aliases +%ALIAS $1 r + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type ISW + isw lin effort,epsilon_i + +% Component type R + r lin flow,epsilon_r + +% Component type SS + [in] SS external,external + [out] SS external,external + + ADDED mtt/lib/examples/Identification/idNonlinearTanks/README Index: mtt/lib/examples/Identification/idNonlinearTanks/README ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/README +++ mtt/lib/examples/Identification/idNonlinearTanks/README @@ -0,0 +1,10 @@ +This is the example from: +@Article{Gaw00c, + author = {Peter J Gawthrop}, + title = {Sensitivity Bond Graphs}, + journal = JFI, + year = {2000} +} + + +NB Compile with -i euler ADDED mtt/lib/examples/Identification/idNonlinearTanks/conical.cr Index: mtt/lib/examples/Identification/idNonlinearTanks/conical.cr ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/conical.cr +++ mtt/lib/examples/Identification/idNonlinearTanks/conical.cr @@ -0,0 +1,9 @@ +%% CR for conical tank example + +OPERATOR conical; +%% State input. +FOR ALL COMP, rho,g,V_0,V LET + conical(COMP, rho,g,V_0,effort,1,V,state,1) = rho*g*(12*(V+V_0)/pi)^(1/3); + + +END;; ADDED mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr Index: mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr +++ mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr @@ -0,0 +1,13 @@ +%% CR for pipe discharge + + +OPERATOR discharge; +%% Flow input +FOR ALL COMP, alpha,beta,F LET + discharge(COMP, alpha,beta,effort,1,F,flow,1) = beta*F^alpha; + +%% Effort input +FOR ALL COMP, alpha,beta,P LET + discharge(COMP, alpha,beta,flow,1,P,effort,1) = (P/beta)^(1/alpha); + +END;; ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_abg.fig Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_abg.fig ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_abg.fig +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_abg.fig @@ -0,0 +1,39 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1575 2925 2745 2925 2520 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 2925 4320 2925 4095 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4725 2925 5895 2925 5670 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 2925 7470 2925 7245 3150 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2925 2700 2925 1530 3150 1755 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 2700 4500 1530 4725 1755 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 2700 6075 1530 6300 1755 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7650 2700 7650 1530 7875 1755 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 3150 6075 4320 6300 4095 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1575 2700 1575 3150 +4 1 0 100 0 18 20 0.0000 4 270 195 2925 3015 0\001 +4 1 0 100 0 18 20 0.0000 4 270 195 4500 3015 1\001 +4 1 0 100 0 18 20 0.0000 4 270 195 7650 3015 1\001 +4 1 0 100 0 18 20 0.0000 4 285 705 2925 1440 C:t1\001 +4 1 0 100 0 18 20 0.0000 4 360 780 4545 1440 R:p1\001 +4 1 0 100 0 18 20 0.0000 4 360 780 7695 1440 R:p2\001 +4 1 0 100 0 18 20 0.0000 4 285 705 6075 1440 C:t2\001 +4 1 0 100 0 18 20 0.0000 4 270 195 6075 3015 0\001 +4 1 0 100 0 18 20 0.0000 4 360 825 6075 4680 De:y\001 +4 1 0 100 0 18 20 0.0000 4 285 720 1125 3060 Sf:u\001 ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_desc.tex Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_desc.tex ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_desc.tex +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_desc.tex @@ -0,0 +1,34 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system idNonlinearTanks (idRC_desc.tex) +% Generated by MTT on Thu Apr 5 11:04:33 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{idNonlinearTanks} is + displayed in Figure \Ref{fig:idRC_abg.ps} and its label + file is listed in Section \Ref{sec:idRC_lbl}. + The subsystems are listed in Section \Ref{sec:idRC_sub}. + + + This example illustrates the sensitivity approach to model-based + system identification\footnote{Peter J Gawthrop, \emph{Sensitivity + Bond Graphs}, Journal Franklin Institute, \textbf{337}, 2000, + pp 907--922}. + + The system compprises two non-linear tanks (see the paper for details). + The method identifies four parameters: the two initial states ans + the two parameters of the non-linear flow resistance. + + To see the results, type: +\begin{verbatim} +mtt -oct -i euler -pdf idNonlinearTanks ippp view +\end{verbatim} + ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_ippp.m Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_ippp.m ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_ippp.m +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_ippp.m @@ -0,0 +1,57 @@ + +## Set up parameters +name = "idNonlinearTanks"; +sim = sidNonlinearTanks_simpar; # Simulation parameter +sym = sidNonlinearTanks_sympar; # Parameter names +par = sidNonlinearTanks_numpar; # Parameter values +x0 = sidNonlinearTanks_state(par); # Initial state + +## Simulation of "actual" system +t = [0:sim.dt:sim.last]'; +T = 5; # Period +u = ones(size(t)); +y_0 = sidNonlinearTanks_ssim(x0,par,sim,u,2); + +plot(t,y_0); + +## The initial parameters +par_0 = par; +par_0(sym.V_1) = 2.0; +par_0(sym.V_2) = 1.0; +par_0(sym.alpha) = 1.0; +par_0(sym.beta) = 2.0; + +## Identify +extras.criterion = 1e-5; +extras.max_iterations = 10; +extras.v = 10; # Use a really big initial value +extras.verbose = 1; # Show what is going on +[par,Par,Error,Y] = ppp_identify (name,u,y_0,["V_1 ";"V_2 ";"alpha";"beta "],par_0,extras); + +par = par + +grid; +xlabel("Time") +title("Output"); +plot(t,y_0); +figfig("idNonlinearTanks_output","pdf"); +figfig("idNonlinearTanks_output","ps"); +grid; + +xlabel("Time") +title("Estimated output"); +plot(t,y_0,t,Y); +figfig("idNonlinearTanks_outputs","pdf"); +figfig("idNonlinearTanks_outputs","ps"); + +xlabel("Iteration") +title("Estimation error"); +plot(Error); +figfig("idNonlinearTanks_error","pdf"); +figfig("idNonlinearTanks_error","ps"); + +xlabel("Iteration") +title("Estimated Parameter"); +plot(Par'); +figfig("idNonlinearTanks_parameters","pdf"); +figfig("idNonlinearTanks_parameters","ps"); ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_lbl.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_lbl.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_lbl.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_lbl.txt @@ -0,0 +1,26 @@ +%% Label file for system idNonlinearTanks (NonlinearTanks_lbl.txt) +%SUMMARY NonlinearTanks +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Component type C + t1 conical rho,g,V_1 + t2 conical rho,g,V_2 + +% Component type R + p1 discharge alpha,beta + p2 discharge alpha,beta + +% Component type Sf + u SS external + +% Component type De + y SS external + ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_numpar.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_numpar.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_numpar.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_numpar.txt @@ -0,0 +1,26 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (sNonlinearTanks_numpar.txt) +# Generated by MTT at Mon Nov 29 17:36:54 EST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Parameters + +## States +v_1 = 0.5; # Tank 1 +v_2 = 0.25; # Tank 2 + +## Tank parameters +g = 1; #Gravity +rho = 1; # sC,sNonlinearTanks +alpha = 1.5; + +## Pipe parameters +beta = 1; + + ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.tex Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.tex ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.tex +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.tex @@ -0,0 +1,133 @@ + + +\section{\textbf{abg.tex}: System idNonlinearTanks, representation \textbf{abg}, language \textbf{tex}} +\label{sec:idNonlinearTanks_abg.tex} +\index{\textbf{idNonlinearTanks} -- abg} + + +MTT command: +\begin{verbatim} +mtt idNonlinearTanks abg tex +\end{verbatim} + \input{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_abg.tex} + + +\section{\textbf{cbg.ps}: System idNonlinearTanks, representation \textbf{cbg}, language \textbf{ps}} +\label{sec:idNonlinearTanks_cbg.ps} +\index{\textbf{idNonlinearTanks} -- cbg} + + +MTT command: +\begin{verbatim} +mtt idNonlinearTanks cbg ps +\end{verbatim} +This representation is given as Figure \Ref{fig:idNonlinearTanks_cbg.ps}. +\fig{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_cbg} + {idNonlinearTanks_cbg.ps} + {0.9} + {System \textbf{idNonlinearTanks}, representation cbg} + + +\section{\textbf{struc.tex}: System idNonlinearTanks, representation \textbf{struc}, language \textbf{tex}} +\label{sec:idNonlinearTanks_struc.tex} +\index{\textbf{idNonlinearTanks} -- struc} + + +MTT command: +\begin{verbatim} +mtt idNonlinearTanks struc tex +\end{verbatim} + \input{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_struc.tex} + + +\section{\textbf{sympar.tex}: System idNonlinearTanks, representation \textbf{sympar}, language \textbf{tex}} +\label{sec:idNonlinearTanks_sympar.tex} +\index{\textbf{idNonlinearTanks} -- sympar} + + +MTT command: +\begin{verbatim} +mtt idNonlinearTanks sympar tex +\end{verbatim} + \input{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_sympar.tex} + + +\section{\textbf{odeso.ps}: System sidNonlinearTanks, representation \textbf{odeso}, language \textbf{ps}} +\label{sec:sidNonlinearTanks_odeso.ps} +\index{\textbf{sidNonlinearTanks} -- odeso} + + +MTT command: +\begin{verbatim} +mtt -oct -s sidNonlinearTanks odeso ps +\end{verbatim} +This representation is given as Figure \Ref{fig:sidNonlinearTanks_odeso.ps}. +\fig{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/sidNonlinearTanks_odeso} + {sidNonlinearTanks_odeso.ps} + {0.9} + {System \textbf{sidNonlinearTanks}, representation odeso} + + +\section{\textbf{ippp.ps}: System idNonlinearTanks, representation \textbf{ippp}, language \textbf{ps}} +\label{sec:idNonlinearTanks_ippp.ps} +\index{\textbf{idNonlinearTanks} -- ippp} + + +MTT command: +\begin{verbatim} +mtt -oct -i euler idNonlinearTanks ippp ps +\end{verbatim} +This representation is given as Figure \Ref{fig:idNonlinearTanks_ippp.ps}. +\fig{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_ippp} + {idNonlinearTanks_ippp.ps} + {0.9} + {System \textbf{idNonlinearTanks}, representation ippp} + + +\section{\textbf{rep.txt}: System idNonlinearTanks, representation \textbf{rep}, language \textbf{txt}} +\label{sec:idNonlinearTanks_rep.txt} +\index{\textbf{idNonlinearTanks} -- rep} + + +MTT command: +\begin{verbatim} +mtt idNonlinearTanks rep txt +\end{verbatim} + \begin{verbatim} +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system idNonlinearTanks (idRC_rep.txt) +## Generated by MTT on" Thu Apr 5 11:17:27 BST 2001. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt idNonlinearTanks abg tex # The system description +mtt idNonlinearTanks cbg ps # The causal bond graph +mtt idNonlinearTanks struc tex # The system structure +mtt idNonlinearTanks sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt idNonlinearTanks dae tex # The system dae +## mtt idNonlinearTanks ode tex # The system ode +## mtt idNonlinearTanks sspar tex # Steady-state parameters +## mtt idNonlinearTanks ss tex # Steady state +## mtt idNonlinearTanks dm tex # Descriptor matrices (of linearised system) +## mtt idNonlinearTanks sm tex # State matrices (of linearised system) +## mtt idNonlinearTanks tf tex # Transfer function (of linearised system) +## mtt idNonlinearTanks lmfr ps # log modulus of frequency response (of linearised system) +## mtt idNonlinearTanks simpar tex # Simulation parameters +## mtt idNonlinearTanks numpar tex # Numerical simulation parameters +## mtt idNonlinearTanks state tex # Simulation initial state +## mtt idNonlinearTanks input tex # Simulation input +## mtt idNonlinearTanks logic tex # Logic control + mtt -oct -s sidNonlinearTanks odeso ps # Simulation output + mtt -oct -i euler idNonlinearTanks ippp ps + +mtt idNonlinearTanks rep txt # This file + \end{verbatim} ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt @@ -0,0 +1,39 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system idNonlinearTanks (idRC_rep.txt) +## Generated by MTT on" Thu Apr 5 11:17:27 BST 2001. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2001/04/05 12:00:18 gawthrop +## Identification example +## +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt idNonlinearTanks abg tex # The system description +mtt idNonlinearTanks cbg ps # The causal bond graph +mtt idNonlinearTanks struc tex # The system structure +mtt idNonlinearTanks sympar tex # The system parameters +## Uncomment the following lines or add others +##mtt idNonlinearTanks dae tex # The system dae + mtt idNonlinearTanks ode tex # The system ode +## mtt idNonlinearTanks sspar tex # Steady-state parameters +## mtt idNonlinearTanks ss tex # Steady state +## mtt idNonlinearTanks dm tex # Descriptor matrices (of linearised system) +## mtt idNonlinearTanks sm tex # State matrices (of linearised system) +## mtt idNonlinearTanks tf tex # Transfer function (of linearised system) +## mtt idNonlinearTanks lmfr ps # log modulus of frequency response (of linearised system) +## mtt idNonlinearTanks simpar tex # Simulation parameters +## mtt idNonlinearTanks numpar tex # Numerical simulation parameters +## mtt idNonlinearTanks state tex # Simulation initial state +## mtt idNonlinearTanks input tex # Simulation input +## mtt idNonlinearTanks logic tex # Logic control +## mtt -oct -s sidNonlinearTanks odeso ps # Simulation output + mtt -i euler idNonlinearTanks ident ps + +mtt idNonlinearTanks rep txt # This file ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_simpar.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_simpar.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_simpar.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_simpar.txt @@ -0,0 +1,22 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system idNonlinearTanks (sidNonlinearTanks_simpar.txt) +# Generated by MTT on Wed Apr 4 15:25:33 BST 2001. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + + +FIRST = 0.0; # First time in simulation output +DT = 0.1; # Print interval +LAST = 10.0; # Last time in simulation +STEPFACTOR = 10; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_subs.r Index: mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_subs.r ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_subs.r +++ mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_subs.r @@ -0,0 +1,23 @@ +% Default SUBS file +% File idRC_subs.r +% Generated by MTT on Tue Apr 3 09:43:38 BST 2001. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2001/04/05 12:00:18 gawthrop +% %% Identification example +% %% +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Put algebraic substitution commands here + +%The following is now done automatically +% FOR ALL x,y LET x^y = pow(x,y); +END; ADDED mtt/lib/examples/Identification/idNonlinearTanks/sC_abg.fig Index: mtt/lib/examples/Identification/idNonlinearTanks/sC_abg.fig ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sC_abg.fig +++ mtt/lib/examples/Identification/idNonlinearTanks/sC_abg.fig @@ -0,0 +1,26 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3105 3105 3195 3645 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3150 3150 3150 3600 +-6 +6 6705 3105 6795 3645 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6750 3150 6750 3600 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 3375 5400 3375 5625 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 3375 4500 3375 4275 3600 +4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 +4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 +4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 +4 1 0 100 0 18 18 0.0000 4 210 450 4950 3465 C:c\001 ADDED mtt/lib/examples/Identification/idNonlinearTanks/sC_lbl.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/sC_lbl.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sC_lbl.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/sC_lbl.txt @@ -0,0 +1,29 @@ +%% Label file for system sC (sC_lbl.txt) +%SUMMARY sC +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in actual,sensitivity + +% Argument aliases +%ALIAS $1 rho,g,V_0,V_0s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + c sconical rho,g,V_0,V_0s + +% Component type SS + [actual] SS external,external + [sensitivity] SS external,external ADDED mtt/lib/examples/Identification/idNonlinearTanks/sR_abg.fig Index: mtt/lib/examples/Identification/idNonlinearTanks/sR_abg.fig ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sR_abg.fig +++ mtt/lib/examples/Identification/idNonlinearTanks/sR_abg.fig @@ -0,0 +1,26 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 4455 3105 4545 3645 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4500 3150 4500 3600 +-6 +6 5355 3105 5445 3645 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 3150 5400 3600 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6750 3375 5400 3375 5625 3600 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 3375 4500 3375 4275 3600 +4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 +4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 +4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 +4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 +4 1 0 100 0 18 18 0.0000 4 210 390 4950 3465 R:r\001 ADDED mtt/lib/examples/Identification/idNonlinearTanks/sR_lbl.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/sR_lbl.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sR_lbl.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/sR_lbl.txt @@ -0,0 +1,29 @@ +%% Label file for system sR (sR_lbl.txt) +%SUMMARY sR +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in actual,sensitivity + +% Argument aliases +%ALIAS $1 alpha,beta,alpha_s,beta_s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + r sdischarge alpha,beta,alpha_s,beta_s + +% Component type SS + [actual] SS external,external + [sensitivity] SS external,external ADDED mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr Index: mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr +++ mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr @@ -0,0 +1,21 @@ +%% CR for conical tank example - sensitivity + +in "conical.cr"; + +OPERATOR sconical; +%% The actual port (1) +FOR ALL COMP, rho,g,V_0,V_0s,V,sV LET + sconical(COMP, rho,g,V_0,V_0s,effort,1, + V,state,1, + sV,state,2) + = conical(COMP, rho,g,V_0,effort,1,V,state,1); + +%% The sensitivity port (2) +FOR ALL COMP, rho,g,V_0,V_0s,V,sV LET + sconical(COMP, rho,g,V_0,V_0s,effort,2, + V,state,1, + sV,state,2) + = df(conical(COMP, rho,g,V_0,effort,1,V,state,1),V) * sV + + df(conical(COMP, rho,g,V_0,effort,1,V,state,1),V_0)* V_0s; + +END;; ADDED mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr Index: mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr +++ mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr @@ -0,0 +1,31 @@ +%% CR file for the sR component. - 2 port. +%% Special version just for this example. + +%% CR for non-linear pipe discharge +%% Just do for flow input causality. + +in "discharge.cr"; + +PROCEDURE l_discharge(COMP, alpha,beta,P); +BEGIN + result := sub({x=P},df(discharge(COMP, alpha,beta,flow,1,x,effort,1), x)); + return result; +END; + +OPERATOR sdischarge; +%% The actual port (1) -- Pressure input +FOR ALL COMP, alpha,beta,alpha_s,beta_s,P,sP LET + sdischarge(COMP, alpha,beta,alpha_s,beta_s,flow,1, + P,effort,1, + sP,effort,2) + = discharge(COMP, alpha,beta,flow,1,P,effort,1); + +%% The sensitivity port (2) -- Pressure input +FOR ALL COMP, alpha,beta,alpha_s,beta_s,P,sP LET + sdischarge(COMP, alpha,beta,alpha_s,beta_s,flow,2, + P,effort,1, + sP,effort,2) + = l_discharge(COMP, alpha,beta,P) * sP + + df(discharge(COMP, alpha,beta,flow,1,P,effort,1), alpha)* alpha_s + + df(discharge(COMP, alpha,beta,flow,1,P,effort,1), beta) * beta_s; +END;; ADDED mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_lbl.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_lbl.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_lbl.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_lbl.txt @@ -0,0 +1,32 @@ +%% Label file for system NonlinearTanks (NonlinearTanks_lbl.txt) +%SUMMARY NonlinearTanks +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + t1 sconical rho,g,V_1,V_1s + t2 sconical rho,g,V_2,V_2s + +% Component type R + p1 sdischarge alpha,beta,alphas,betas + p2 sdischarge alpha,beta,alphas,betas + +% Component type Sf + u SS external;0 + +% Component type De + y SS external;external + ADDED mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt @@ -0,0 +1,35 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (sNonlinearTanks_numpar.txt) +# Generated by MTT at Mon Nov 29 17:36:54 EST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2001/04/05 12:00:18 gawthrop +# %% Identification example +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Parameters + +## States +v_1 = 2.0; # Tank 1 +v_2 = 1.0; # Tank 2 + +## Tank parameters +g = 1; #Gravity +rho = 1; # sC,sNonlinearTanks +alpha = 1.0; + +## Pipe parameters +beta = 2.0; + +## Sensitivity. +v_1s = 0; # Tank 1 +v_2s = 0; # Tank 2 + +alphas = 0; +betas = 0; + ADDED mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_simpar.txt Index: mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_simpar.txt ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_simpar.txt +++ mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_simpar.txt @@ -0,0 +1,22 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system sidNonlinearTanks (sidNonlinearTanks_simpar.txt) +# Generated by MTT on Wed Apr 4 15:25:33 BST 2001. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + + +FIRST = 0.0; # First time in simulation output +DT = 0.1; # Print interval +LAST = 10.0; # Last time in simulation +STEPFACTOR = 10; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_subs.r Index: mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_subs.r ================================================================== --- mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_subs.r +++ mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_subs.r @@ -0,0 +1,22 @@ +% Default SUBS file +% File idRC_subs.r +% Generated by MTT on Tue Apr 3 09:43:38 BST 2001. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Put algebraic substitution commands here + +FOR ALL x,y LET x^y = pow(x,y); % Use the pow function + +ON ROUNDED; % No integer output + +END; ADDED mtt/lib/examples/Identification/idRC/create_data.m Index: mtt/lib/examples/Identification/idRC/create_data.m ================================================================== --- mtt/lib/examples/Identification/idRC/create_data.m +++ mtt/lib/examples/Identification/idRC/create_data.m @@ -0,0 +1,12 @@ +## Create some data + c = 1; + r = 5; + tau = r*c; + + t = [0:0.1:10]'; # time + one = ones(size(t)); + u = one; # Step input + y = one - exp(-t/tau); # Exact step response + + save idRC_ident_data.dat y u t + ADDED mtt/lib/examples/Identification/idRC/idRC_abg.fig Index: mtt/lib/examples/Identification/idRC/idRC_abg.fig ================================================================== --- mtt/lib/examples/Identification/idRC/idRC_abg.fig +++ mtt/lib/examples/Identification/idRC/idRC_abg.fig @@ -0,0 +1,18 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2250 2475 3600 2475 3375 2700 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4500 2475 5850 2475 5625 2700 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 6975 3600 1125 3600 1125 1800 6975 1800 6975 3600 +4 1 0 100 0 18 18 0.0000 4 210 600 1800 2565 Se:u\001 +4 1 0 100 0 18 18 0.0000 4 210 750 4050 2565 RC:rc\001 +4 1 0 100 0 18 18 0.0000 4 270 600 6345 2565 De:y\001 ADDED mtt/lib/examples/Identification/idRC/idRC_desc.tex Index: mtt/lib/examples/Identification/idRC/idRC_desc.tex ================================================================== --- mtt/lib/examples/Identification/idRC/idRC_desc.tex +++ mtt/lib/examples/Identification/idRC/idRC_desc.tex @@ -0,0 +1,48 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system idRC (idRC_desc.tex) +% Generated by MTT on Thu Apr 5 11:04:33 BST 2001. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 2003/08/18 08:06:11 gawthrop +% %% A working version with more explantion +% %% +% %% Revision 1.2 2002/09/23 11:16:27 gawthrop +% %% New example for ident representation +% %% +% %% Revision 1.1 2001/04/05 11:57:29 gawthrop +% %% Identification example +% %% +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{idRC} is + displayed in Figure \Ref{fig:idRC_abg.ps} and its label + file is listed in Section \Ref{sec:idRC_lbl}. + The subsystems are listed in Section \Ref{sec:idRC_sub}. + + + This example illustrates the sensitivity approach to model-based + system identification\footnote{Peter J Gawthrop, \emph{Sensitivity + Bond Graphs}, Journal Franklin Institute, \textbf{337}, 2000, + pp 907--922}. + + The system is a simple RC circuit with zero initial condition; the + method identifies the resitance $r$. + + The data is created by typing: +\begin{verbatim} +make +\end{verbatim} +To see the results, type: +\begin{verbatim} +mtt -oct -i euler idRC ident view +\end{verbatim} + + \paragraph{NB} All sensitivity coefficients in idRC\_simpar.txt must + be set to zero. ADDED mtt/lib/examples/Identification/idRC/idRC_ident_numpar.m Index: mtt/lib/examples/Identification/idRC/idRC_ident_numpar.m ================================================================== --- mtt/lib/examples/Identification/idRC/idRC_ident_numpar.m +++ mtt/lib/examples/Identification/idRC/idRC_ident_numpar.m @@ -0,0 +1,71 @@ +function [y,u,t,par_names,Q,extras] = idRC_ident_numpar; + + ## usage: [y,u,t,par_names,Q,extras] = idRC_ident_numpar; + ## Edit for your own requirements + ## Created by MTT on + + + ## This section sets up the data source + ## simulate = 0 Real data (you supply idRC_ident_data.dat) + ## simulate = 1 Real data input, simulated output + ## simulate = 2 Unit step input, simulated output + simulate = 0; + + + ## System info + [n_x,n_y,n_u,n_z,n_yz] = idRC_def; + simpars = sidRC_simpar; + + ## Access or create data + if (simulate<2) # Get the real data + if (exist("idRC_ident_data.dat")==2) + printf("Loading idRC_ident_data.dat\n"); + load idRC_ident_data.dat + else + printf("Please create a loadable file idRC_ident_data.dat containing y,u and t\n"); + return + endif + else + switch simulate + case 2 # Step simulation + t = [0:simpars.dt:simpars.last]'; + u = ones(size(t)); + otherwise + error(sprintf("simulate = %i not implemented", simulate)); + endswitch + endif + + if (simulate>0) + par = idRC_numpar(); + x_0 = idRC_state(par); + dt = t(2)-t(1); + simpars.dt = dt; + simpars.last = t(length(t)); + y = idRC_sim(zeros(n_x,1), par, simpars, u); + endif + + ## Default parameter names - Put in your own here + sympar = idRC_sympar; # Symbolic params as structure + par_names = struct_elements (sympar); # Symbolic params as strings + [n,m] = size(par_names); # Size the string list + + ## Sort by index + for [i,name] = sympar + par_names(i,:) = sprintf("%s%s",name, blanks(m-length(name))); + endfor + + par_names = "r"; # Estimate r only + + ## Output weighting vector + Q = ones(n_y,1); + + ## Extra parameters + extras.criterion = 1e-5; + extras.emulate_timing = 0; + extras.max_iterations = 10; + extras.simulate = simulate; + extras.v = 1e-2; + extras.verbose = 1; + extras.visual = 1; + +endfunction ADDED mtt/lib/examples/Identification/idRC/idRC_rep.txt Index: mtt/lib/examples/Identification/idRC/idRC_rep.txt ================================================================== --- mtt/lib/examples/Identification/idRC/idRC_rep.txt +++ mtt/lib/examples/Identification/idRC/idRC_rep.txt @@ -0,0 +1,46 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system idRC (idRC_rep.txt) +## Generated by MTT on" Thu Jun 27 17:03:00 BST 2002. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2002/09/23 11:42:14 gawthrop +## Example uses simulated data from idRC_ident_data +## +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt idRC abg tex # The system description +##mtt idRC cbg ps # The causal bond graph +mtt idRC struc tex # The system structure +mtt idRC sympar tex # The system parameters + +## Uncomment the following lines or add others +## mtt idRC dae tex # The system dae +## mtt idRC ode tex # The system ode +## mtt idRC sspar tex # Steady-state parameters +## mtt idRC ss tex # Steady state +## mtt idRC dm tex # Descriptor matrices (of linearised system) +## mtt idRC sm tex # State matrices (of linearised system) +## mtt idRC tf tex # Transfer function (of linearised system) +## mtt idRC lmfr ps # log modulus of frequency response (of linearised system) +## mtt idRC simpar txt # Simulation parameters +## mtt idRC numpar txt # Numerical simulation parameters +## mtt idRC state txt # Simulation initial state +## mtt idRC input txt # Simulation input +## mtt idRC logic txt # Logic control +## mtt idRC odeso ps # Simulation output + + +## Linear identificationm +##mtt idRC ident_numpar tex +mtt idRC ident ps +##mtt idRC ident_comparison ps +mtt idRC ident_par tex + +mtt idRC rep txt # This file ADDED mtt/lib/examples/Identification/idRC/sidRC_numpar.txt Index: mtt/lib/examples/Identification/idRC/sidRC_numpar.txt ================================================================== --- mtt/lib/examples/Identification/idRC/sidRC_numpar.txt +++ mtt/lib/examples/Identification/idRC/sidRC_numpar.txt @@ -0,0 +1,15 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System sidRC, representation numpar, language txt; +## File sidRC_numpar.txt; +## Generated by MTT on Mon Sep 23 11:39:27 BST 2002; + + + +c = 1.0; # Default +cs = 0.0; # MUST BE ZERO +r = 1.0; # Default +rs = 0.0; # MUST BE ZERO +us = 0.0; # MUST BE ZERO + ADDED mtt/lib/examples/Inverse/iMacroMicro/Make Index: mtt/lib/examples/Inverse/iMacroMicro/Make ================================================================== --- mtt/lib/examples/Inverse/iMacroMicro/Make +++ mtt/lib/examples/Inverse/iMacroMicro/Make @@ -0,0 +1,7 @@ +%Makes the figures for the paper/report. +mtt macmic cbg ps +mtt imacmic cbg ps +mtt imacmic sm m +mtt imacmic numpar m + +octave figures.m ADDED mtt/lib/examples/Inverse/iMacroMicro/figures.m Index: mtt/lib/examples/Inverse/iMacroMicro/figures.m ================================================================== --- mtt/lib/examples/Inverse/iMacroMicro/figures.m +++ mtt/lib/examples/Inverse/iMacroMicro/figures.m @@ -0,0 +1,56 @@ +% Set up the parameters +imacmic_numpar; + +% Range of damping for the macro controller +D_1 = [0:0.1:2]; + +% Compute the damping factor d and save in arrray DD +% -- uses zeros of system +% $$$ DD = []; +% $$$ for d_1 = D_1 +% $$$ [A,B,C,D] = macmic_dm(m_1,m_2,b_1,b_2,k_2,k_t,b_t,b_3,m_3,p_1,d_1); +% $$$ zz = ss2zp(A,B,C,D,1); +% $$$ z = (zz(:,2)); +% $$$ re = sort(real(z)); +% $$$ im = sort(imag(z)); +% $$$ d = -re./sqrt(re.^2 + im.^2); +% $$$ d = sort(d); +% $$$ DD = [DD d]; +% $$$ end; +% $$$ +% $$$ plot(D_1,min(DD)); grid +% $$$ xlabel('Derivative gain'); +% $$$ ylabel('Damping factor'); +% $$$ +% $$$ + +% Compute the damping factor d and save in arrray DD +% -- uses poles of inverse system +DD1 = []; +for d_1 = D_1 + [A] = imacmic_sm; + z = eig(A); + + re = (real(z)); + im = (imag(z)); + d = -re./sqrt(re.^2 + im.^2); + d = sort(d); + DD1 = [DD1 d]; +end; +minDD1 = min(DD1); + +plot(D_1,minDD1); grid +xlabel('Derivative gain'); +ylabel('Damping factor'); + +Maximum_Damping = max(minDD1) +index = minDD1 == Maximum_Damping*ones(size(minDD1)); +Opt_gain = index*D_1' + +% Plot on disk +set term postscript +set output "damping.ps" +plot(D_1,minDD1); grid + + + ADDED mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_abg.fig Index: mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_abg.fig +++ mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_abg.fig @@ -0,0 +1,151 @@ +#FIG 3.2 +Portrait +Center +Inches +A4 +100.00 +Single +-2 +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2706 4806 3606 4806 3456 4956 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2406 5106 2406 6006 2556 5856 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3906 5106 3906 6006 4056 5856 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7208 4808 8108 4808 7958 4958 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8708 4808 9608 4808 9458 4958 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8408 5108 8408 6008 8558 5858 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7208 4508 8108 3608 8108 3833 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8708 3608 9608 4508 9383 4508 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9909 5109 9909 6009 10059 5859 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6908 5108 6908 6008 7058 5858 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8405 2405 8405 3305 8555 3155 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11407 5107 11407 6007 11557 5857 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11406 3306 11406 2406 11556 2556 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4206 4806 5106 4806 4956 4956 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5406 5106 5406 6006 5556 5856 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4206 4506 5106 3606 5106 3831 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5405 3305 5405 2405 5555 2555 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2405 3305 2405 2405 2555 2555 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11707 4807 12607 4807 12457 4957 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11707 3607 12607 4507 12382 4507 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2105 1805 2105 905 2255 1055 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2705 1805 2705 905 2855 1055 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5706 4806 6606 4806 6456 4956 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5706 3606 6606 4506 6381 4506 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2704 3604 3604 4504 3379 4504 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1208 4808 2108 4808 1958 4958 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1208 4508 2108 3608 2108 3833 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 681 3606 1131 3606 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 906 4506 906 3606 1056 3756 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12905 4505 12905 3605 13055 3755 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10207 4807 11107 4807 10957 4957 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10207 4507 11107 3607 11107 3832 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8400 3300 8625 3300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 12900 3600 13125 3600 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 12675 4500 12900 4500 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8175 2400 8400 2400 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 1501 5401 301 5401 301 3001 1501 3001 1501 5401 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 3300 2700 1500 2700 1500 450 3300 450 3300 2700 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 3000 6600 1800 6600 1800 3000 3000 3000 3000 6600 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 4501 6601 3301 6601 3301 3901 4501 3901 4501 6601 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 6000 6600 4800 6600 4800 1800 6000 1800 6000 6600 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 7501 6601 6301 6601 6301 3901 7501 3901 7501 6601 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 9000 6600 7800 6600 7800 1800 9000 1800 9000 6600 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 10501 6601 9301 6601 9301 3901 10501 3901 10501 6601 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 12000 6600 10800 6600 10800 1800 12000 1800 12000 6600 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 13501 5401 12301 5401 12301 3001 13501 3001 13501 5401 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 11700 4575 11700 4800 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 12600 4800 12600 5025 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 10200 4575 10200 4800 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 11100 4800 11100 5025 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 9600 4500 9450 4650 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 8700 3600 8850 3450 +4 1 -1 0 0 0 20 0.0000 4 195 150 2406 4881 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 585 3906 6381 I:m1\001 +4 1 -1 0 0 0 20 0.0000 4 210 585 2405 6380 R:b1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 2405 3680 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 3906 4881 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 8408 4883 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 8408 3683 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 585 8483 6383 R:b3\001 +4 1 -1 0 0 0 20 0.0000 4 210 675 8407 2182 SS:f2\001 +4 1 -1 0 0 0 20 0.0000 4 195 585 9906 6381 I:m3\001 +4 1 -1 0 0 0 20 0.0000 4 195 585 6905 6380 I:m2\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 11407 4882 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 11407 3682 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 525 11406 2181 C:kt\001 +4 1 -1 0 0 0 20 0.0000 4 210 525 11482 6382 R:bt\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5406 4881 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5406 3681 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 585 5481 6381 R:b2\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 12909 4884 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 6908 4883 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 2404 2179 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 585 2779 754 C:p1\001 +4 1 -1 0 0 0 20 0.0000 4 210 585 2104 754 R:d1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 910 4885 1\001 +4 1 -1 0 0 0 20 0.0000 4 210 675 902 3377 SS:fb\001 +4 1 -1 0 0 0 20 0.0000 4 210 615 12905 3380 SS:ft\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 9909 4884 1\001 +4 1 -1 0 0 0 20 0.0000 4 210 585 5405 2180 C:k2\001 +4 1 1 1 0 3 20 0.0000 4 210 1455 900 5700 Macro base\001 +4 1 1 1 0 3 20 0.0000 4 210 1800 2401 376 Macro control\001 +4 1 1 1 0 3 20 0.0000 4 195 1950 2400 6900 Macro actuator\001 +4 1 1 1 0 3 20 0.0000 4 195 1530 3900 3825 Macro mass\001 +4 1 1 1 0 3 20 0.0000 4 195 1470 6900 3825 Micro mass\001 +4 1 1 1 0 3 20 0.0000 4 270 1890 5400 1650 Compliant link\001 +4 1 1 1 0 3 20 0.0000 4 195 1890 8475 1650 Micro actuator\001 +4 1 1 1 0 3 20 0.0000 4 255 1125 9900 3825 Tip mass\001 +4 1 1 1 0 3 20 0.0000 4 270 2985 11400 1650 Compliant environment\001 +4 1 1 1 0 3 20 0.0000 4 255 1305 12901 5701 Tip sensor\001 ADDED mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_desc.tex Index: mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_desc.tex +++ mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_desc.tex @@ -0,0 +1,31 @@ +% Verbal description for system iMacroMicro (iMacroMicro_desc.tex) +% Generated by MTT on Tue Dec 9 18:13:04 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/02/22 22:24:27 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{iMacroMicro} is + displayed in Figure \Ref{iMacroMicro_abg} and its label + file is listed in Section \Ref{sec:iMacroMicro_lbl}. + The subsystems are listed in Section \Ref{sec:iMacroMicro_sub}. + +This is a Bond Graph model of the macro-micro manipulation system +discussed by Sharon in his thesis and by Sharon, Hogan and Hardt in +various papers. The micro loop is inverted whilst leaving the macro +control in place. This {\em partial inverse\/} gives information about +the {\em zero dynamics\/} of the micro control system with the +particular macro controller in place and allows desidn of the macro +controller to ease the design of the micro controller. + + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_lbl.txt Index: mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_lbl.txt +++ mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_lbl.txt @@ -0,0 +1,32 @@ +%% Label file (macmic_lbl.txt) +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Masses +m1 lin flow,m_1 +m2 lin flow,m_2 +m3 lin flow,m_3 + +%Springs +k2 lin state,k_2 +kt lin state,k_t + +%Dampers +b1 lin flow,b_1 +b2 lin flow,b_2 +b3 lin flow,b_3 +bt lin flow,b_t + +%Source/sensors +f2 SS external,internal +ft SS external,0 +fb SS internal,0 + +%Control +p1 lin flow,p_1 +d1 lin flow,d_1 + + + ADDED mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_numpar.txt Index: mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_numpar.txt +++ mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_numpar.txt @@ -0,0 +1,11 @@ +m_1 = 0.0169; # m_1; +m_2 = 0.0169; # m_2; +b_1 = 0.13; # b_1; +b_2 = 0.013; # b_2; +k_2 = 24; # k_2; +k_t = 150; # k_t; +b_t = 0.16; # b_t; +b_3 = 0.13; # b_3; +m_3 = 0.005; # m_3; +p_1 = 10; # p_1; +d_1 = 0.9; # d_1; ADDED mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_rep.txt Index: mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_rep.txt +++ mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_rep.txt @@ -0,0 +1,24 @@ +# Outline report file for system iMacroMicro (iMacroMicro_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:49:22 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt iMacroMicro abg tex +mtt iMacroMicro cbg ps +mtt iMacroMicro struc tex +mtt iMacroMicro dae tex +mtt iMacroMicro dm tex +mtt iMacroMicro tf tex +mtt iMacroMicro numpar txt +mtt iMacroMicro lmfr ps +mtt iMacroMicro lpfr ps +mtt iMacroMicro sro ps +mtt iMacroMicro odeso ps + ADDED mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_simpar.txt Index: mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_simpar.txt ================================================================== --- mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_simpar.txt +++ mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system iMacroMicro (iMacroMicro_simpar.txt) +# Generated by MTT on Wed Nov 18 10:08:20 GMT 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 10.0; # Last time in simulation +DT = 0.1; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -2; # Minimum frequency = 10^WMIN +WMAX = 4; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Inverse/iNMP/NMP/NMP_abg.fig Index: mtt/lib/examples/Inverse/iNMP/NMP/NMP_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iNMP/NMP/NMP_abg.fig +++ mtt/lib/examples/Inverse/iNMP/NMP/NMP_abg.fig @@ -0,0 +1,68 @@ +#FIG 3.2 +Portrait +Center +Inches +A4 +100.00 +Single +-2 +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3903 2403 4803 2403 4653 2553 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5403 2403 6303 2403 6153 2553 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 2103 3603 1203 3753 1353 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2702 3002 3302 2402 3302 2627 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3905 4201 4805 4201 4655 4351 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5405 4201 6305 4201 6155 4351 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3605 4501 3605 5401 3755 5251 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2702 3602 3302 4202 3077 4202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7803 3302 8703 3302 8553 3452 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1203 3302 2103 3302 1953 3452 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2101 3076 2101 3301 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2101 3301 2101 3526 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8701 3076 8701 3301 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8701 3301 8701 3526 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5103 2103 5103 1203 5253 1353 +2 4 1 2 -1 7 0 0 -1 6.000 0 0 7 0 0 5 + 5700 3000 5700 600 3000 600 3000 3000 5700 3000 +2 4 1 2 -1 7 0 0 -1 6.000 0 0 7 0 0 5 + 5700 6000 5700 3600 3000 3600 3000 6000 5700 6000 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 4200 7650 3600 7650 3825 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7052 2402 7652 3002 7427 3002 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5100 4500 5100 5400 5250 5250 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4800 4501 4164 5137 4376 5137 +4 1 -1 0 0 0 20 0.0000 4 195 150 3603 2478 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5103 2478 0\001 +4 1 -1 0 0 0 20 0.0000 4 240 660 3602 1052 R:r_s\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 2402 3377 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 3603 4278 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5103 4278 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 720 6603 4278 AE:m\001 +4 1 -1 0 0 0 20 0.0000 4 240 645 3603 5778 R:r_f\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 7577 3377 1\001 +4 1 -1 0 0 0 20 0.0000 4 210 705 751 3376 SS:e1\001 +4 1 -1 0 0 0 20 0.0000 4 210 705 9151 3376 SS:e2\001 +4 1 -1 0 0 0 20 0.0000 4 240 690 5102 1052 C:c_s\001 +4 1 1 1 0 3 20 0.0000 4 270 1515 4200 375 Slow system\001 +4 1 1 1 0 3 20 0.0000 4 255 1470 4200 6450 Fast system\001 +4 1 -1 0 0 0 20 0.0000 4 255 630 6678 2478 AE:p\001 +4 1 -1 0 0 0 20 0.0000 4 240 675 5104 5779 C:c_f\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 4203 5478 R:r\001 ADDED mtt/lib/examples/Inverse/iNMP/NMP/NMP_desc.tex Index: mtt/lib/examples/Inverse/iNMP/NMP/NMP_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iNMP/NMP/NMP_desc.tex +++ mtt/lib/examples/Inverse/iNMP/NMP/NMP_desc.tex @@ -0,0 +1,21 @@ +% Verbal description for system NMP (NMP_desc.tex) +% Generated by MTT on Tue Dec 9 17:34:06 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{NMP} is + displayed in Figure \Ref{NMP_abg} and its label + file is listed in Section \Ref{sec:NMP_lbl}. + The subsystems are listed in Section \Ref{sec:NMP_sub}. + +This is a simple non-minimum phase system with an inverse-type +response. It is the standard fast negative and slow positive systems +in parallel. The corresponding inverse system \textbf{iNMP} is +unstable. + + ADDED mtt/lib/examples/Inverse/iNMP/NMP/NMP_lbl.txt Index: mtt/lib/examples/Inverse/iNMP/NMP/NMP_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iNMP/NMP/NMP_lbl.txt +++ mtt/lib/examples/Inverse/iNMP/NMP/NMP_lbl.txt @@ -0,0 +1,49 @@ +%% Label file for system NMP (NMP_lbl.txt) +%SUMMARY NMP A simple non-minimum phase system +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/05/20 16:40:54 peterg +% %% New SS format +% %% +% %% Revision 1.1 1999/03/09 00:08:21 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases +%ALIAS $1 c_f +%ALIAS $2 c_s +%ALIAS $3 r_f +%ALIAS $4 r_s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AE + m lin -1 + p lin 1 + +% Component type C + c_f lin effort,c_f + c_s lin effort,c_s + +% Component type R + r lin flow,r + r_f lin flow,r_f + r_s lin flow,r_s + +% Component type SS + e1 SS external,internal + e2 SS external,0 ADDED mtt/lib/examples/Inverse/iNMP/NMP/NMP_numpar.txt Index: mtt/lib/examples/Inverse/iNMP/NMP/NMP_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iNMP/NMP/NMP_numpar.txt +++ mtt/lib/examples/Inverse/iNMP/NMP/NMP_numpar.txt @@ -0,0 +1,17 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (NMP_numpar.txt) +# Generated by MTT at Thu Oct 8 09:25:16 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_f = 0.5; # NMP +c_s = 1.0; # NMP +r = 1.0; # NMP +r_f = 1.0; # NMP +r_s = 1.0; # NMP ADDED mtt/lib/examples/Inverse/iNMP/NMP/NMP_rep.txt Index: mtt/lib/examples/Inverse/iNMP/NMP/NMP_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iNMP/NMP/NMP_rep.txt +++ mtt/lib/examples/Inverse/iNMP/NMP/NMP_rep.txt @@ -0,0 +1,18 @@ +# Outline report file for system NMP (NMP_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt NMP abg tex +mtt NMP struc tex +mtt NMP ode tex +mtt NMP sm tex +mtt NMP tf tex + +mtt NMP sro ps +mtt NMP lmfr ps +mtt NMP lpfr ps ADDED mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_abg.fig Index: mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_abg.fig +++ mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_abg.fig @@ -0,0 +1,72 @@ +#FIG 3.2 +Portrait +Center +Inches +A4 +100.00 +Single +-2 +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3903 2403 4803 2403 4653 2553 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5403 2403 6303 2403 6153 2553 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 2103 3603 1203 3753 1353 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2702 3002 3302 2402 3302 2627 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3905 4201 4805 4201 4655 4351 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5405 4201 6305 4201 6155 4351 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3605 4501 3605 5401 3755 5251 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2702 3602 3302 4202 3077 4202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7803 3302 8703 3302 8553 3452 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1203 3302 2103 3302 1953 3452 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2101 3301 2101 3526 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8701 3301 8701 3526 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5103 2103 5103 1203 5253 1353 +2 4 1 2 -1 7 0 0 -1 6.000 0 0 7 0 0 5 + 5700 3000 5700 600 3000 600 3000 3000 5700 3000 +2 4 1 2 -1 7 0 0 -1 6.000 0 0 7 0 0 5 + 5700 6000 5700 3600 3000 3600 3000 6000 5700 6000 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 4200 7650 3600 7650 3825 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7052 2402 7652 3002 7427 3002 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5100 4500 5100 5400 5250 5250 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4800 4501 4164 5137 4376 5137 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1200 3075 1200 3300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7800 3075 7800 3300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6300 2400 6300 2625 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5400 2175 5400 2400 +4 1 -1 0 0 0 20 0.0000 4 195 150 3603 2478 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5103 2478 0\001 +4 1 -1 0 0 0 20 0.0000 4 240 660 3602 1052 R:r_s\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 2402 3377 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 3603 4278 1\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5103 4278 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 720 6603 4278 AE:m\001 +4 1 -1 0 0 0 20 0.0000 4 240 645 3603 5778 R:r_f\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 7577 3377 1\001 +4 1 -1 0 0 0 20 0.0000 4 210 705 751 3376 SS:e1\001 +4 1 -1 0 0 0 20 0.0000 4 210 705 9151 3376 SS:e2\001 +4 1 -1 0 0 0 20 0.0000 4 240 690 5102 1052 C:c_s\001 +4 1 1 1 0 3 20 0.0000 4 270 1515 4200 375 Slow system\001 +4 1 1 1 0 3 20 0.0000 4 255 1470 4200 6450 Fast system\001 +4 1 -1 0 0 0 20 0.0000 4 255 630 6678 2478 AE:p\001 +4 1 -1 0 0 0 20 0.0000 4 240 675 5104 5779 C:c_f\001 +4 1 -1 0 0 0 20 0.0000 4 195 390 4203 5478 R:r\001 ADDED mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_desc.tex Index: mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_desc.tex +++ mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_desc.tex @@ -0,0 +1,21 @@ +% Verbal description for system iNMP (iNMP_desc.tex) +% Generated by MTT on Tue Dec 9 17:34:06 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{iNMP} is + displayed in Figure \Ref{iNMP_abg} and its label + file is listed in Section \Ref{sec:iNMP_lbl}. + The subsystems are listed in Section \Ref{sec:iNMP_sub}. + +This is a simple non-minimum phase system with an inverse-type +response. It is the standard fast negative and slow positive systems +in parallel. The corresponding inverse system \textbf{iiNMP} is +unstable. + + ADDED mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_lbl.txt Index: mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_lbl.txt +++ mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_lbl.txt @@ -0,0 +1,49 @@ +%% Label file for system iNMP (iNMP_lbl.txt) +%SUMMARY iNMP Inverse simple non-minimum phase system +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/05/20 16:42:42 peterg +% %% New SS format +% %% +% %% Revision 1.1 1999/03/09 00:10:07 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases +%ALIAS $1 c_f +%ALIAS $2 c_s +%ALIAS $3 r_f +%ALIAS $4 r_s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type AE + m lin -1 + p lin 1 + +% Component type C + c_f lin effort,c_f + c_s lin effort,c_s + +% Component type R + r lin flow,r + r_f lin flow,r_f + r_s lin flow,r_s + +% Component type SS + e1 SS external,internal + e2 SS external,0 ADDED mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_numpar.txt Index: mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_numpar.txt +++ mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_numpar.txt @@ -0,0 +1,17 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (NMP_numpar.txt) +# Generated by MTT at Thu Oct 8 09:25:16 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_f = 0.5; # NMP +c_s = 1.0; # NMP +r = 1.0; # NMP +r_f = 1.0; # NMP +r_s = 1.0; # NMP ADDED mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_rep.txt Index: mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_rep.txt +++ mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_rep.txt @@ -0,0 +1,17 @@ +# Outline report file for system iNMP (iNMP_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt iNMP abg tex +mtt iNMP struc tex +mtt iNMP ode tex +mtt iNMP dm tex +mtt iNMP tf tex + +mtt iNMP lmfr ps +mtt iNMP lpfr ps ADDED mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_abg.fig Index: mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_abg.fig +++ mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_abg.fig @@ -0,0 +1,54 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 3600 3375 3600 3150 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3375 5175 2475 5400 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 3376 8325 2476 8550 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 3600 4950 3600 4725 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7200 3601 8100 3601 7875 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 3600 4050 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 3780 6525 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 3600 6525 3600 6300 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3345 3600 2445 3825 2670 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 3346 6750 2446 6975 2671 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 3780 2475 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 3600 2475 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3465 3375 3780 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 3780 4050 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4995 3375 5310 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8145 3375 8460 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6615 2475 6930 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 3600 6525 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7200 3780 7200 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7200 3555 7200 3375 +4 0 -1 0 0 2 20 0.0000000 4 210 150 5085 3735 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 3510 3690 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 6660 3691 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 8235 3736 0\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 3465 2250 R:r_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 4995 2250 C:c_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 6525 2250 R:r_2\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 8100 2295 C:c_2\001 +4 2 -1 0 0 2 20 0.0000000 4 270 750 2385 3690 SS:uy\001 ADDED mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_desc.tex Index: mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_desc.tex +++ mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_desc.tex @@ -0,0 +1,20 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system iRC2c (iRC2c_desc.tex) +% Generated by MTT on Mon Apr 6 10:46:00 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{iRC2c} is + displayed in Figure \Ref{iRC2c_abg} and its label + file is listed in Section \Ref{sec:iRC2c_lbl}. + The subsystems are listed in Section \Ref{sec:iRC2c_sub}. + +This example gives the inverse of a double RC circuit with +\emph{collocated} sensor/actuator pairing. + + ADDED mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_input.txt Index: mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_input.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_input.txt +++ mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_input.txt @@ -0,0 +1,12 @@ +# Numerical parameter file (iRC2c_input.txt) +# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +u(1) = 1 ; # iRC2c (u_s) ADDED mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_lbl.txt Index: mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_lbl.txt +++ mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_lbl.txt @@ -0,0 +1,30 @@ +%SUMMARY iRC2c Inverse of double RC circuit with collocated io +%DESCRIPTION +%% Label file for system iRC2c (iRC2c_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_1 lin effort,c_1 + c_2 lin effort,c_2 + +% Component type R + r_1 lin flow,r_1 + r_2 lin flow,r_2 + +% Component type SS + uy SS external,external + + ADDED mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_numpar.txt Index: mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_numpar.txt +++ mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_numpar.txt @@ -0,0 +1,25 @@ +# Numerical parameter file (iRC2c_numpar.txt) +# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_1 = 1.0; # iRC2c +c_1s = 0.1; # iRC2c +c_2 = 1.0; # iRC2c +c_2s = 0.1; # iRC2c +r_1 = 1.0; # iRC2c +r_1s = 1.0; # iRC2c +r_2 = 1.0; # iRC2c +r_2s = 1.0; # iRC2c + +# Initial states +x(1) = 0.0; # iRC2c (c_1) +x(2) = 0.0; # iRC2c (c_1s) +x(3) = 0.0; # iRC2c (c_2) +x(4) = 0.0; # iRC2c (c_2s) ADDED mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_rep.txt Index: mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_rep.txt +++ mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_rep.txt @@ -0,0 +1,16 @@ +# Outline report file for system iRC2c (iRC2c_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt iRC2c abg tex +mtt iRC2c struc tex +mtt iRC2c dae tex +mtt iRC2c dm tex +mtt iRC2c tf tex + + ADDED mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_abg.fig Index: mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_abg.fig +++ mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_abg.fig @@ -0,0 +1,68 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5625 3600 5625 3420 +2 1 2 2 1 7 1 0 -1 4.500 0 0 7 0 0 4 + 9585 3465 8325 3465 8190 3375 8190 2565 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 3600 3375 3600 3150 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3375 5175 2475 5400 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 3376 8325 2476 8550 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 3600 4950 3600 4725 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7200 3601 8100 3601 7875 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8775 3601 9675 3601 9450 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3465 3375 3780 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5040 2475 5355 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6615 3375 6930 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8190 2475 8505 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 3600 2475 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3375 3780 3375 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 3600 4050 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 3780 4950 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 3780 6525 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 3600 6525 3600 6300 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7200 3600 7200 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8100 3780 8100 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8775 3600 8775 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9675 3600 9675 3780 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3345 3600 2445 3825 2670 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 3346 6750 2446 6975 2671 +2 1 1 1 1 7 1 0 -1 4.000 0 0 7 0 0 4 + 9585 3510 5400 3510 5310 3420 5310 2790 +2 1 2 2 1 -1 1 0 -1 3.000 0 0 7 0 0 9 + 8392 2632 8392 3712 6862 3712 6862 2497 6727 2362 6592 2497 + 6592 3442 5242 3442 5242 2632 +4 0 -1 0 0 2 20 0.0000000 4 210 150 5085 3735 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 3510 3690 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 6660 3691 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 8235 3736 0\001 +4 2 -1 0 0 2 20 0.0000000 4 210 600 2295 3645 SS:u\001 +4 0 -1 0 0 2 20 0.0000000 4 270 585 9810 3690 SS:y\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 3465 2250 R:r_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 4995 2250 C:c_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 6525 2250 R:r_2\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 8100 2295 C:c_2\001 ADDED mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_desc.tex Index: mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_desc.tex +++ mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_desc.tex @@ -0,0 +1,19 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system iRC2n (iRC2n_desc.tex) +% Generated by MTT on Mon Apr 6 10:46:52 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{iRC2n} is + displayed in Figure \Ref{iRC2n_abg} and its label + file is listed in Section \Ref{sec:iRC2n_lbl}. + The subsystems are listed in Section \Ref{sec:iRC2n_sub}. + +This example gives the inverse of a double RC circuit with +\emph{non-collocated} sensor/actuator pairing. + ADDED mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_input.txt Index: mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_input.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_input.txt +++ mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_input.txt @@ -0,0 +1,12 @@ +# Numerical parameter file (iRC2n_input.txt) +# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +u(1) = 1 ; # iRC2n (u_s) ADDED mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_lbl.txt Index: mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_lbl.txt +++ mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_lbl.txt @@ -0,0 +1,32 @@ +%SUMMARY iRC2n Inverse of double RC circuit with non-collocated io +%DESCRIPTION +%% Label file for system iRC2n (iRC2n_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/05/20 16:43:52 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_1 lin effort,c_1 + c_2 lin effort,c_2 + +% Component type R + r_1 lin flow,r_1 + r_2 lin flow,r_2 + +% Component type SS + u SS external,internal + y SS external,0 ADDED mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_numpar.txt Index: mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_numpar.txt +++ mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_numpar.txt @@ -0,0 +1,25 @@ +# Numerical parameter file (iRC2n_numpar.txt) +# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_1 = 1.0; # iRC2n +c_1s = 0.1; # iRC2n +c_2 = 1.0; # iRC2n +c_2s = 0.1; # iRC2n +r_1 = 1.0; # iRC2n +r_1s = 1.0; # iRC2n +r_2 = 1.0; # iRC2n +r_2s = 1.0; # iRC2n + +# Initial states +x(1) = 0.0; # iRC2n (c_1) +x(2) = 0.0; # iRC2n (c_1s) +x(3) = 0.0; # iRC2n (c_2) +x(4) = 0.0; # iRC2n (c_2s) ADDED mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_rep.txt Index: mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_rep.txt +++ mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_rep.txt @@ -0,0 +1,17 @@ +# Outline report file for system iRC2n (iRC2n_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt iRC2n abg tex +mtt iRC2n struc tex +mtt iRC2n dae tex +mtt iRC2n dm tex +mtt iRC2n tf tex + + + ADDED mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_simp.r Index: mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_simp.r ================================================================== --- mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_simp.r +++ mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_simp.r @@ -0,0 +1,12 @@ +%% Reduce commands to simplify output for system iRC2n (iRC2n_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MTTu1 := y; + +END; ADDED mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_abg.fig Index: mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_abg.fig +++ mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_abg.fig @@ -0,0 +1,134 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 3601 4051 3601 3826 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3376 5851 2476 6076 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9001 3377 9001 2477 9226 2702 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3601 5626 3601 5401 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7876 3602 8776 3602 8551 3827 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4726 3601 4726 3421 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7201 3781 7201 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6301 3601 7201 3601 6976 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 3346 4276 2446 4501 2671 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 3347 7426 2447 7651 2672 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5671 3376 5986 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8821 3376 9136 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7291 2476 7606 2476 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7201 3601 7201 3421 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7876 3781 7876 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 3825 2925 4725 3150 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 5175 2925 6075 3150 5850 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 6301 4051 6301 3826 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 6076 5851 5176 6076 5401 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9001 6077 9001 5177 9226 5402 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 6301 5626 6301 5401 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7876 6302 8776 6302 8551 6527 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4726 6301 4726 6121 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7201 6481 7201 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6301 6301 7201 6301 6976 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 6046 4276 5146 4501 5371 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 6047 7426 5147 7651 5372 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3151 6481 3151 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3151 6301 3151 6121 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4141 6076 4456 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4726 6481 4726 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5671 6076 5986 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8821 6076 9136 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7291 5176 7606 5176 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7201 6301 7201 6121 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7876 6481 7876 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1756 6301 2656 6301 2431 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 3780 4050 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 3600 4050 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4141 2475 4456 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4725 3781 4725 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7875 3645 7875 3465 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7875 6300 7875 6120 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 3375 2700 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1801 3600 2701 3600 2476 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 3825 3150 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3105 5175 2925 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2925 5175 2745 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1755 6480 1755 6300 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1755 6300 1755 6120 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 9900 4050 9900 1530 3600 1530 3600 4050 9900 4050 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 9900 7020 9900 4500 3600 4500 3600 7020 9900 7020 +4 2 -1 0 0 2 20 0.0000000 4 240 870 1710 3645 SS:u_s\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 7336 3692 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 8911 3737 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 4231 3691 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 5806 3736 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 7336 6392 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 8911 6437 0\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 4141 4951 R:r_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 5671 4951 C:c_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 7201 4951 R:r_2\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 4231 6391 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 5806 6436 0\001 +4 2 -1 0 0 2 20 0.0000000 4 210 600 1665 6345 SS:u\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 8775 4950 C:c_2\001 +4 2 -1 0 0 2 20 0.0000000 4 210 150 3016 3691 1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 4141 2251 R:r_1s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 5671 2251 C:c_1s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 7201 2251 R:r_2s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 8775 2250 C:c_2s\001 +4 0 -1 0 0 2 20 0.0000000 4 210 390 2835 5040 AF\001 +4 2 -1 0 0 2 20 0.0000000 4 210 150 3016 6391 0\001 +4 1 1 1 0 0 20 0.0000000 4 210 450 2565 4455 e=0\001 +4 1 1 1 0 0 20 0.0000000 4 210 420 2070 6570 f=0\001 +4 1 1 1 0 0 20 0.0000000 4 270 2550 6750 1845 Specification system\001 +4 1 1 1 0 0 20 0.0000000 4 270 1830 6615 6840 Inverse system\001 ADDED mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_desc.tex Index: mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_desc.tex +++ mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_desc.tex @@ -0,0 +1,24 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system saRC2c (saRC2c_desc.tex) +% Generated by MTT on Mon Apr 6 10:47:43 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{saRC2c} is + displayed in Figure \Ref{saRC2c_abg} and its label + file is listed in Section \Ref{sec:saRC2c_lbl}. + The subsystems are listed in Section \Ref{sec:saRC2c_sub}. + +This example gives the inverse of a double RC circuit with +\begin{itemize} +\item specification system, +\item amplifier connection and +\item collocated sensor/actuator pairing. +\end{itemize} + + ADDED mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_input.txt Index: mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_input.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_input.txt +++ mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (saRC2c_input.txt) +# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:53:33 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Tue Jun 10 16:20:22 BST 2003: u(1) = 1 ; # saRC2c (u_s) +sarc2c__u_s = 1.0; ADDED mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_lbl.txt Index: mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_lbl.txt +++ mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_lbl.txt @@ -0,0 +1,33 @@ +%SUMMARY saRC2c +%DESCRIPTION +%% Label file for system saRC2c (saRC2c_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_1 lin effort,c_1 + c_1s lin effort,c_1s + c_2 lin effort,c_2 + c_2s lin effort,c_2s + +% Component type R + r_1 lin flow,r_1 + r_1s lin flow,r_1s + r_2 lin flow,r_2 + r_2s lin flow,r_2s + +% Component type SS + u SS external,0 + u_s SS external,external ADDED mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_numpar.txt Index: mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_numpar.txt +++ mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_numpar.txt @@ -0,0 +1,28 @@ +# Numerical parameter file (saRC2c_numpar.txt) +# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:53:33 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_1 = 1.0; # saRC2c +c_1s = 0.1; # saRC2c +c_2 = 1.0; # saRC2c +c_2s = 0.1; # saRC2c +r_1 = 1.0; # saRC2c +r_1s = 1.0; # saRC2c +r_2 = 1.0; # saRC2c +r_2s = 1.0; # saRC2c + +# Initial states +## Removed by MTT on Tue Jun 10 16:19:14 BST 2003: x(1) = 0.0; # saRC2c (c_1) +## Removed by MTT on Tue Jun 10 16:19:14 BST 2003: x(2) = 0.0; # saRC2c (c_1s) +## Removed by MTT on Tue Jun 10 16:19:14 BST 2003: x(3) = 0.0; # saRC2c (c_2) +## Removed by MTT on Tue Jun 10 16:19:14 BST 2003: x(4) = 0.0; # saRC2c (c_2s) ADDED mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_rep.txt Index: mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_rep.txt +++ mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_rep.txt @@ -0,0 +1,22 @@ +# Outline report file for system saRC2c (saRC2c_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:53:33 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt saRC2c abg tex +mtt saRC2c struc tex +mtt saRC2c dae tex +mtt saRC2c dm tex +mtt saRC2c tf tex + +mtt saRC2c odeso ps +mtt saRC2c lmfr ps + + ADDED mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_abg.fig Index: mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_abg.fig +++ mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_abg.fig @@ -0,0 +1,141 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 3601 4051 3601 3826 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3376 5851 2476 6076 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9001 3377 9001 2477 9226 2702 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3601 5626 3601 5401 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7876 3602 8776 3602 8551 3827 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4726 3601 4726 3421 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7201 3781 7201 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6301 3601 7201 3601 6976 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 3346 4276 2446 4501 2671 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 3347 7426 2447 7651 2672 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5671 3376 5986 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8821 3376 9136 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7291 2476 7606 2476 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7201 3601 7201 3421 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7876 3781 7876 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 3825 2925 4725 3150 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2925 5175 2925 6075 3150 5850 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3151 6301 4051 6301 3826 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 6076 5851 5176 6076 5401 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9001 6077 9001 5177 9226 5402 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 6301 5626 6301 5401 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7876 6302 8776 6302 8551 6527 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4726 6301 4726 6121 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7201 6481 7201 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6301 6301 7201 6301 6976 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 6046 4276 5146 4501 5371 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7426 6047 7426 5147 7651 5372 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3151 6481 3151 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3151 6301 3151 6121 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4141 6076 4456 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4726 6481 4726 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5671 6076 5986 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8821 6076 9136 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7291 5176 7606 5176 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7201 6301 7201 6121 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7876 6481 7876 6301 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1756 6301 2656 6301 2431 6526 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1801 4950 2701 4950 2476 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 4950 2700 4770 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 5130 1800 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2655 6480 2655 6300 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 3780 4050 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 3600 4050 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4141 2475 4456 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4725 3781 4725 3601 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7875 3645 7875 3465 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7875 6300 7875 6120 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 3375 2700 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1801 3600 2701 3600 2476 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 3825 3150 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2925 6075 2745 6075 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3105 5175 2925 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1755 6300 1755 6120 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 9900 4275 9900 1125 3600 1125 3600 4275 9900 4275 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 9900 7650 9900 4500 3600 4500 3600 7650 9900 7650 +4 2 -1 0 0 2 20 0.0000000 4 240 870 1710 3645 SS:u_s\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 7336 3692 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 8911 3737 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 4231 3691 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 5806 3736 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 7336 6392 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 8911 6437 0\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 4141 4951 R:r_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 5671 4951 C:c_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 7201 4951 R:r_2\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 4231 6391 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 5806 6436 0\001 +4 2 -1 0 0 2 20 0.0000000 4 210 600 1665 6345 SS:u\001 +4 2 -1 0 0 2 20 0.0000000 4 210 990 1620 5040 SS:zero\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 8775 4950 C:c_2\001 +4 2 -1 0 0 2 20 0.0000000 4 210 150 3016 3691 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 2835 5040 0\001 +4 2 -1 0 0 2 20 0.0000000 4 210 150 3016 6391 1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 4141 2251 R:r_1s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 5671 2251 C:c_1s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 7201 2251 R:r_2s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 8775 2250 C:c_2s\001 +4 1 1 1 0 3 20 0.0000000 4 210 450 2250 4860 e=0\001 +4 1 1 1 0 3 20 0.0000000 4 270 420 2250 5220 f=0\001 +4 1 1 1 0 3 20 0.0000000 4 270 1845 6525 7110 Inverse system\001 +4 1 1 1 0 3 20 0.0000000 4 270 2565 6660 1665 Specification system\001 ADDED mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_desc.tex Index: mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_desc.tex +++ mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_desc.tex @@ -0,0 +1,24 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system szRC2c (szRC2c_desc.tex) +% Generated by MTT on Mon Apr 6 10:50:51 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{szRC2c} is + displayed in Figure \Ref{szRC2c_abg} and its label + file is listed in Section \Ref{sec:szRC2c_lbl}. + The subsystems are listed in Section \Ref{sec:szRC2c_sub}. + + +This example gives the inverse of a double RC circuit with +\begin{itemize} +\item specification system, +\item zero-zero \textbf{SS} connection and +\item collocated sensor/actuator pairing. +\end{itemize} + ADDED mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_input.txt Index: mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_input.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_input.txt +++ mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (szRC2c_input.txt) +# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:54:15 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Tue Jun 10 16:39:19 BST 2003: u(1) = 1 ; # szRC2c (u_s) +szrc2c__u_s = 1.0; ADDED mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_lbl.txt Index: mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_lbl.txt +++ mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_lbl.txt @@ -0,0 +1,40 @@ +%SUMMARY szRC2c Specification inverse of double RC circuit with collocated io +%DESCRIPTION +%% Label file for system szRC2c (szRC2c_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:54:15 peterg +% %% To RCS +% %% +% %% Revision 1.1 2000/05/20 16:44:55 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_1 lin effort,c_1 + c_1s lin effort,c_1s + c_2 lin effort,c_2 + c_2s lin effort,c_2s + +% Component type R + r_1 lin flow,r_1 + r_1s lin flow,r_1s + r_2 lin flow,r_2 + r_2s lin flow,r_2s + +% Component type SS + u_s SS external,external + zero SS 0,0 + u SS external,internal ADDED mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_numpar.txt Index: mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_numpar.txt +++ mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_numpar.txt @@ -0,0 +1,28 @@ +# Numerical parameter file (szRC2c_numpar.txt) +# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:54:15 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_1 = 1.0; # szRC2c +c_1s = 0.1; # szRC2c +c_2 = 1.0; # szRC2c +c_2s = 0.1; # szRC2c +r_1 = 1.0; # szRC2c +r_1s = 1.0; # szRC2c +r_2 = 1.0; # szRC2c +r_2s = 1.0; # szRC2c + +# Initial states +## Removed by MTT on Tue Jun 10 16:38:56 BST 2003: x(1) = 0.0; # szRC2c (c_1) +## Removed by MTT on Tue Jun 10 16:38:56 BST 2003: x(2) = 0.0; # szRC2c (c_1s) +## Removed by MTT on Tue Jun 10 16:38:56 BST 2003: x(3) = 0.0; # szRC2c (c_2) +## Removed by MTT on Tue Jun 10 16:38:56 BST 2003: x(4) = 0.0; # szRC2c (c_2s) ADDED mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_rep.txt Index: mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_rep.txt +++ mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_rep.txt @@ -0,0 +1,22 @@ +# Outline report file for system szRC2c (szRC2c_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:54:15 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt szRC2c abg tex +mtt szRC2c struc tex +mtt szRC2c dae tex +mtt szRC2c dm tex +mtt szRC2c tf tex + +mtt zRC2c odeso ps +mtt szRC2c lmfr ps + + ADDED mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_abg.fig Index: mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_abg.fig +++ mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_abg.fig @@ -0,0 +1,151 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2251 4726 3151 4726 2926 4951 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 4501 4951 3601 5176 3826 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8101 4502 8101 3602 8326 3827 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4726 4726 4726 4501 4951 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6976 4727 7876 4727 7651 4952 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 4727 9451 4727 9226 4952 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3151 4906 3151 4726 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4726 3826 4546 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6301 4906 6301 4726 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5401 4726 6301 4726 6076 4951 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6976 4726 6976 4546 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3825 4905 3825 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4770 4500 5085 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6345 3600 6660 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6975 4905 6975 4725 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7920 4500 8235 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9450 4725 9450 4905 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9450 4680 9450 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10126 6301 9901 6076 11026 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9901 6076 9901 5896 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 11026 6256 11026 6076 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9675 4950 9675 5850 9900 5625 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5402 7427 5402 7247 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2252 7427 3152 7427 2927 7652 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4952 7202 4952 6302 5177 6527 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8102 7203 8102 6303 8327 6528 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3827 7427 4727 7427 4502 7652 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 7428 7877 7428 7652 7653 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8552 7428 9452 7428 9227 7653 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3242 7202 3557 7202 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4817 6302 5132 6302 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6392 7202 6707 7202 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7967 6302 8282 6302 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2252 7427 2252 7247 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3152 7607 3152 7427 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3827 7427 3827 7247 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4727 7607 4727 7427 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6302 7607 6302 7427 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5402 7427 6302 7427 6077 7652 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6977 7427 6977 7247 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7877 7607 7877 7427 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8552 7427 8552 7247 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3377 7172 3377 6272 3602 6497 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6527 7173 6527 6273 6752 6498 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9450 7425 9450 7605 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3150 4725 3150 4545 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3240 3600 3555 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9901 4725 10801 4725 10576 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 10800 4725 10800 4905 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 10800 4725 10800 4545 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 4516 3375 3616 3600 3841 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 4517 6525 3617 6750 3842 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9495 5850 9810 5850 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9675 6300 9855 6300 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9675 6313 9675 7213 9900 6988 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9675 7245 9495 7245 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 9045 5355 9045 2250 2475 2250 2475 5355 9045 5355 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 9045 8730 9045 5625 2475 5625 2475 8730 9045 8730 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6300 4680 6300 4500 +4 0 -1 0 0 2 20 0.0000000 4 210 150 4861 4861 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 3286 4816 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 6436 4817 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 8011 4862 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 9586 4816 0\001 +4 2 -1 0 0 2 20 0.0000000 4 240 870 2071 4771 SS:u_s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 3241 3376 R:r_1s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 6301 3376 R:r_2s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 4771 3376 C:c_1s\001 +4 0 -1 0 0 2 20 0.0000000 4 240 870 7875 3375 C:c_2s\001 +4 0 -1 0 0 2 20 0.0000000 4 210 990 11206 6166 SS:zero\001 +4 1 1 1 0 3 20 0.0000000 4 210 450 10441 5986 e=0\001 +4 1 1 1 0 3 20 0.0000000 4 270 420 10441 6346 f=0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 9585 6210 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 4862 7562 0\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 3287 7517 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 6437 7518 1\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 8012 7563 0\001 +4 2 -1 0 0 2 20 0.0000000 4 210 600 2072 7472 SS:u\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 3242 6077 R:r_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 4772 6077 C:c_1\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 6302 6077 R:r_2\001 +4 0 -1 0 0 2 20 0.0000000 4 240 750 7876 6076 C:c_2\001 +4 0 -1 0 0 2 20 0.0000000 4 210 150 9630 7515 0\001 +4 0 -1 0 0 2 20 0.0000000 4 270 855 10935 4815 SS:y_s\001 +4 1 1 1 0 3 20 0.0000000 4 270 420 10260 5085 f=0\001 +4 1 1 1 0 3 20 0.0000000 4 270 2565 5625 2745 Specification system\001 +4 1 1 1 0 3 20 0.0000000 4 270 1845 5535 8280 Inverse system\001 ADDED mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_desc.tex Index: mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_desc.tex +++ mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_desc.tex @@ -0,0 +1,29 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system szRC2n (szRC2n_desc.tex) +% Generated by MTT on Mon Apr 6 10:52:26 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{szRC2n} is + displayed in Figure \Ref{szRC2n_abg} and its label + file is listed in Section \Ref{sec:szRC2n_lbl}. + The subsystems are listed in Section \Ref{sec:szRC2n_sub}. + +This example gives the inverse of a double RC circuit with +\begin{itemize} +\item specification system, +\item zero-zero \textbf{SS} connection and +\item non-collocated sensor/actuator pairing. +\end{itemize} + + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_input.txt Index: mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_input.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_input.txt +++ mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (szRC2n_input.txt) +# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:54:46 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Tue Jun 10 16:43:05 BST 2003: u(1) = 1 ; # szRC2n (u_s) +szrc2n__u_s = 1.0; ADDED mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_lbl.txt Index: mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_lbl.txt +++ mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_lbl.txt @@ -0,0 +1,41 @@ +%SUMMARY szRC2n Specification inverse of double RC circuit with noncollocated io +%DESCRIPTION +%% Label file for system szRC2n (szRC2n_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:54:46 peterg +% %% To RCS +% %% +% %% Revision 1.1 2000/05/20 16:45:37 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + c_1 lin effort,c_1 + c_1s lin effort,c_1s + c_2 lin effort,c_2 + c_2s lin effort,c_2s + +% Component type R + r_1 lin flow,r_1 + r_1s lin flow,r_1s + r_2 lin flow,r_2 + r_2s lin flow,r_2s + +% Component type SS + u_s SS external,internal + y_s SS external,0 + zero SS 0,0 + u SS external,internal ADDED mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_numpar.txt Index: mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_numpar.txt +++ mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_numpar.txt @@ -0,0 +1,28 @@ +# Numerical parameter file (szRC2n_numpar.txt) +# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:54:46 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_1 = 1.0; # szRC2n +c_1s = 0.1; # szRC2n +c_2 = 1.0; # szRC2n +c_2s = 0.1; # szRC2n +r_1 = 1.0; # szRC2n +r_1s = 1.0; # szRC2n +r_2 = 1.0; # szRC2n +r_2s = 1.0; # szRC2n + +# Initial states +## Removed by MTT on Tue Jun 10 16:42:56 BST 2003: x(1) = 0.0; # szRC2n (c_1) +## Removed by MTT on Tue Jun 10 16:42:56 BST 2003: x(2) = 0.0; # szRC2n (c_1s) +## Removed by MTT on Tue Jun 10 16:42:56 BST 2003: x(3) = 0.0; # szRC2n (c_2) +## Removed by MTT on Tue Jun 10 16:42:56 BST 2003: x(4) = 0.0; # szRC2n (c_2s) ADDED mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_rep.txt Index: mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_rep.txt +++ mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_rep.txt @@ -0,0 +1,22 @@ +# Outline report file for system szRC2n (szRC2n_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:54:46 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt szRC2n abg tex +mtt szRC2n struc tex +mtt szRC2n dae tex +mtt szRC2n dm tex +mtt szRC2n tf tex + +mtt szRC2n odeso ps +mtt szRC2n lmfr ps + + ADDED mtt/lib/examples/Inverse/iTanks/iTanks_abg.fig Index: mtt/lib/examples/Inverse/iTanks/iTanks_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iTanks/iTanks_abg.fig +++ mtt/lib/examples/Inverse/iTanks/iTanks_abg.fig @@ -0,0 +1,77 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 900 3150 2025 3150 1755 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 3150 3600 3150 3330 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 2925 2250 1800 2520 2070 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7201 3151 8326 3151 8056 3421 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8776 3151 9901 3151 9631 3421 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6976 2926 6976 1801 7246 2071 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 2926 8551 1801 8821 2071 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 3150 5175 3150 4905 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5625 3150 6750 3150 6480 3420 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 2925 3825 1800 4095 2070 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 2925 5400 1800 5670 2070 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 3375 6975 4500 7245 4230 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11295 5625 11295 450 45 450 45 5625 11295 5625 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 + 3150 1125 3150 2700 1305 2700 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 4 + 4500 1125 4500 2700 6300 2700 6300 1125 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 + 7650 1125 7650 2700 9675 2700 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1350 3600 9720 3600 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 3375 3825 4500 4095 4230 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 900 2925 900 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2025 3150 2025 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 3375 3825 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3825 4500 4095 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 2925 9900 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8775 3150 8775 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6705 3375 6930 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6975 4500 7200 4500 +4 1 -1 0 0 2 20 0.0000 4 195 135 2250 3240 1\001 +4 1 -1 0 0 2 20 0.0000 4 195 210 2250 1665 R\001 +4 1 -1 0 0 2 20 0.0000 4 195 135 8551 3241 1\001 +4 1 -1 0 0 2 20 0.0000 4 195 135 6976 3241 0\001 +4 1 -1 0 0 2 20 0.0000 4 195 210 8551 1666 R\001 +4 1 -1 0 0 2 20 0.0000 4 195 210 6976 1666 C\001 +4 1 -1 0 0 2 20 0.0000 4 195 135 5400 3240 1\001 +4 1 -1 0 0 2 20 0.0000 4 195 135 3825 3240 0\001 +4 1 -1 0 0 2 20 0.0000 4 195 210 5400 1665 R\001 +4 1 -1 0 0 2 20 0.0000 4 195 210 3825 1665 C\001 +4 1 -1 0 0 2 20 0.0000 4 195 705 495 3240 SS:u1\001 +4 1 -1 0 0 2 20 0.0000 4 195 705 10440 3240 SS:u2\001 +4 1 -1 0 0 2 20 0.0000 4 255 675 3825 4725 SS:y1\001 +4 1 -1 0 0 2 20 0.0000 4 255 675 6975 4770 SS:y2\001 +4 1 1 1 0 3 20 0.0000 4 270 510 2295 1125 Pipe\001 +4 1 1 1 0 3 20 0.0000 4 270 510 5445 1125 Pipe\001 +4 1 1 1 0 3 20 0.0000 4 270 510 8595 1125 Pipe\001 +4 1 1 1 0 3 20 0.0000 4 210 600 3870 1125 Tank\001 +4 1 1 1 0 3 20 0.0000 4 210 600 6975 1125 Tank\001 +4 1 1 1 0 3 20 0.0000 4 270 1665 5265 5445 System inverse\001 ADDED mtt/lib/examples/Inverse/iTanks/iTanks_desc.tex Index: mtt/lib/examples/Inverse/iTanks/iTanks_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iTanks/iTanks_desc.tex +++ mtt/lib/examples/Inverse/iTanks/iTanks_desc.tex @@ -0,0 +1,65 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system iTanks (iTanks_desc.tex) +% Generated by MTT on Wed Nov 18 11:04:33 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +Figure \Ref{iTanks_abg} shows the bond graph of a two-tank system +superimposed on a schematic diagram. +The two \textbf{C} components corresponds to the fluid storage and how +it relates to the pressure at the base of the tanks. In this case, for +simplicity, each tank ($i=1$ or $i=2$) is assumed to have a unity constitutive relationship: +\begin{equation} + \text{pressure} = p_i = v_i = \text{volume} +\end{equation} +The volumetric flow rate into the first, and out of the second, tank +is represented by the two unlabelled \textbf{R} components. Again, +each is assumed to have a unit constitutive relationship: +\begin{equation} + \text{flow} = f_i = \Delta_i = \text{pressure drop} +\end{equation} +The volumetric flow rate between the first and the second tanks +is represented \textbf{R} component labelled $k$. The constitutive relationship is assumed +linear of the form: +\begin{equation} + \text{flow} = f = k \Delta = \text{pressure drop} +\end{equation} + +The system has two inputs: +\begin{equation} + \begin{aligned} + u_1 &= \text{input pressure at left-hand pipe} \\ + u_2 &= \text{input pressure at right-hand pipe} + \end{aligned} +\end{equation} +and two outputs: +\begin{equation} + \begin{aligned} + y_1 &= p_1 = \text{pressure at left-hand tank} \\ + y_2 &= p_2 = \text{pressure at right-hand tank} + \end{aligned} +\end{equation} +The system transfer-function matrix is given by: +\begin{equation} + \begin{aligned} +G_{11} = G_{22} &= \frac{(s + k + 1)}{(s^2 + 2 s {(k + 1)} + 2 k + 1)}\\ +G_{12} = G_{21} &= \frac{k}{(s^2 + 2 s {(k + 1)} + 2 k + 1)} +\end{aligned} +\end{equation} + +However, Figure \Ref{iTanks_abg} shows the causality of the +\textbf{SS} components to \emph{invert} the system with respect to its +inputs and outputs. Figure \Ref{fig:iTanks_cbg.ps} shows the causally +complete bond graph; this system has no dynamic components in integral +causality -- the inverse has no poles and therefore the system has no +zeros. + +Some further representations of the inverse appear in the following +sections. + + ADDED mtt/lib/examples/Inverse/iTanks/iTanks_lbl.txt Index: mtt/lib/examples/Inverse/iTanks/iTanks_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iTanks/iTanks_lbl.txt +++ mtt/lib/examples/Inverse/iTanks/iTanks_lbl.txt @@ -0,0 +1,24 @@ +%SUMMARY iTanks: Inversion of a two-tanks system +%DESCRIPTION This inverse system has no poles thus +%DESCRIPTION the system itself has no (multivariable) zeros +%% Label file for system iTanks (iTanks_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type SS + u1 SS external,internal + u2 SS external,internal + y1 SS external,0 + y2 SS external,0 ADDED mtt/lib/examples/Inverse/iTanks/iTanks_rep.txt Index: mtt/lib/examples/Inverse/iTanks/iTanks_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iTanks/iTanks_rep.txt +++ mtt/lib/examples/Inverse/iTanks/iTanks_rep.txt @@ -0,0 +1,26 @@ +# Outline report file for system iTanks (iTanks_rep.txt) +# Generated by MTT on" Wed Nov 18 10:44:55 GMT 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt iTanks abg tex # The system description +mtt iTanks cbg ps # The causal bond graph +# Uncomment the following lines or add others + mtt iTanks struc tex # The system structure +# mtt iTanks dae tex # The system dae +# mtt iTanks ode tex # The system ode +# mtt iTanks sspar tex # Steady-state parameters +# mtt iTanks ss tex # Steady state +mtt iTanks dm tex # Descriptor matrices (of linearised system) +mtt iTanks tf tex +mtt iTanks lmfr ps # log modulus of frequency response (of linearised system) +mtt iTanks lpfr ps # log modulus of frequency response (of linearised system) +# mtt iTanks simpar tex # Simulation parameters +# mtt iTanks numpar tex # Numerical simulation parameters +# mtt iTanks input tex # Simulation input +# mtt iTanks odeso ps # Simulation output ADDED mtt/lib/examples/Inverse/iTwoLink/ROD_abg.fig Index: mtt/lib/examples/Inverse/iTwoLink/ROD_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/ROD_abg.fig +++ mtt/lib/examples/Inverse/iTwoLink/ROD_abg.fig @@ -0,0 +1,123 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 4950 2700 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5850 4950 5850 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8550 4950 8550 5400 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 315 6933 5268 I:J\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000000 4 270 735 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000000 4 240 735 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1170 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1170 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000000 4 210 150 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 570 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000000 4 210 990 4681 5266 INTF:th\001 +4 1 1 1 0 0 20 0.0000000 4 210 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000000 4 135 195 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000000 4 210 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000000 4 195 330 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000000 4 240 1065 2971 1216 SS:[x_a]\001 +4 1 4 0 0 0 20 0.0000000 4 240 1080 2971 9361 SS:[x_b]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1065 8372 1217 SS:[y_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1080 8417 9362 SS:[y_b]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1575 5671 1216 SS:[alpha_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1590 5671 9361 SS:[alpha_b]\001 +4 1 1 1 0 0 20 0.0000000 4 270 630 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000000 4 240 1470 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000000 4 270 645 1350 9855 Tip b\001 ADDED mtt/lib/examples/Inverse/iTwoLink/ROD_desc.tex Index: mtt/lib/examples/Inverse/iTwoLink/ROD_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/ROD_desc.tex +++ mtt/lib/examples/Inverse/iTwoLink/ROD_desc.tex @@ -0,0 +1,17 @@ +% Verbal description for system ROD (ROD_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ROD} is + displayed in Figure \Ref{ROD_abg} and its label + file is listed in Section \Ref{sec:ROD_lbl}. + The subsystems are listed in Section \Ref{sec:ROD_sub}. + +{\bf ROD} is essentially as described in Figure 10.2 of +``Metamodelling''. ADDED mtt/lib/examples/Inverse/iTwoLink/ROD_lbl.txt Index: mtt/lib/examples/Inverse/iTwoLink/ROD_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/ROD_lbl.txt +++ mtt/lib/examples/Inverse/iTwoLink/ROD_lbl.txt @@ -0,0 +1,53 @@ +%SUMMARY ROD: rigid rod in two dimensions +%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a +%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b +%DESCRIPTION Port [x_a]: x force/velocity - end a +%DESCRIPTION Port [x_b]: x force/velocity - end b +%DESCRIPTION Port [y_a]: y force/velocity - end a +%DESCRIPTION Port [y_b]: y force/velocity - end b +%DESCRIPTION +%DESCRIPTION Parameter 1: length from end 1 to mass centre +%DESCRIPTION Parameter 2: length from end 2 to mass centre +%DESCRIPTION Parameter 3: inertia about mass centre +%DESCRIPTION Parameter 4: mass +%DESCRIPTION See Section 10.2 of "Metamodelling" + + +%% Label file for system ROD (ROD_lbl.txt) + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,$3 +m_x lin flow,$4 +m_y lin flow,$4 + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,$1 +s2 lsin flow,$2 +c1 lcos flow,$1 +c2 lcos flow,$2 + + + ADDED mtt/lib/examples/Inverse/iTwoLink/iTwoLink_abg.fig Index: mtt/lib/examples/Inverse/iTwoLink/iTwoLink_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/iTwoLink_abg.fig +++ mtt/lib/examples/Inverse/iTwoLink/iTwoLink_abg.fig @@ -0,0 +1,74 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 2476 4951 2701 5176 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4051 3376 4051 4726 4276 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3781 4726 4276 4726 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2476 4726 2476 5221 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 4951 5626 4951 5401 5176 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6526 4681 6526 5176 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 2250 2475 2250 2700 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 675 4050 2025 4275 1800 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3780 2025 4275 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 2025 2475 2520 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4275 2250 5625 2250 5400 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 1980 6525 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 2250 7875 2250 7650 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 4950 7875 4950 7650 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8371 3376 7876 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8101 3376 8101 4726 8326 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8326 4726 8326 5221 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8370 675 7875 675 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8100 675 8100 2025 8325 1800 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8325 2025 8325 2520 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 5175 6075 675 6075 675 225 5175 225 5175 6075 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 675 5625 5175 5625 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 11475 6075 6975 6075 6975 225 11475 225 11475 6075 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 6975 5625 11475 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 2250 9450 3375 9225 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8325 4950 9450 3825 9225 3825 +4 1 -1 0 0 0 20 0.0000000 4 210 150 4051 5041 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 4050 2340 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 780 4050 585 SS:t1s\001 +4 1 -1 0 0 0 20 0.0000000 4 210 750 6120 2340 AF:a1\001 +4 1 -1 0 0 0 20 0.0000000 4 270 1290 1845 2340 msd:spec1\001 +4 1 -1 0 0 0 20 0.0000000 4 270 1290 1846 5041 msd:spec2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 780 4051 3286 SS:t2s\001 +4 1 -1 0 0 0 20 0.0000000 4 210 750 6121 5041 AF:a2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8101 5041 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8100 2340 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 660 8100 585 SS:t1\001 +4 1 1 1 0 0 20 0.0000000 4 270 1620 2880 5940 Specification\001 +4 1 1 1 0 0 20 0.0000000 4 270 900 9270 5940 System\001 +4 1 -1 0 0 0 20 0.0000000 4 210 660 8101 3286 SS:t2\001 +4 1 -1 0 0 0 20 0.0000000 4 270 1500 9900 3690 twolink:syst\001 +4 0 4 0 0 0 20 0.0000000 4 270 1080 9585 3330 [joint_1]\001 +4 0 4 0 0 0 20 0.0000000 4 270 1080 9540 4140 [joint_2]\001 ADDED mtt/lib/examples/Inverse/iTwoLink/iTwoLink_desc.tex Index: mtt/lib/examples/Inverse/iTwoLink/iTwoLink_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/iTwoLink_desc.tex +++ mtt/lib/examples/Inverse/iTwoLink/iTwoLink_desc.tex @@ -0,0 +1,53 @@ +% Verbal description for system iTwoLink (iTwoLink_desc.tex) +% Generated by MTT on Mon Nov 17 10:42:48 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/01/19 10:08:21 peterg +% %% Added comment about linearisation point +% %% +% %% Revision 1.2 1998/01/19 09:57:26 peterg +% %% Added a discussion of the relevance of G(s). +% %% +% Revision 1.1 1997/12/09 16:53:27 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{iTwoLink} is + displayed in Figure \Ref{iTwoLink_abg} and its label + file is listed in Section \Ref{sec:iTwoLink_lbl}. + The subsystems are listed in Section \Ref{sec:iTwoLink_sub}. + +This example illustrates the inversion of two link manipulator +dynamics using two identical simple mass-spring-damper systems as +specification systems. + +The velocities $\omega_1=\omega_2$ specified by the specification +systems are given in Figure \Ref{fig:iTwoLink_odeso.ps-iTwoLink-t1s} +together with the input defined in Section \Ref{sec:iTwoLink_input.txt}. +The torques $\tau_1$ and $\tau_2$ required to give the these +velocities specified by the specification system are given in Figures +\Ref{fig:iTwoLink_odeso.ps-iTwoLink-t1} and +\Ref{fig:iTwoLink_odeso.ps-iTwoLink-t2} respectively. + +The corresponding velocity/torque diagrams for joints 1 and 2 appear in +Figures \Ref{fig:iTwoLink_odeso.ps-iTwoLink-t1s:iTwoLink-t1} +\Ref{fig:iTwoLink_odeso.ps-iTwoLink-t2s:iTwoLink-t2} respectively. +Such diagrams can be used for actuator sizing in terms of torque, +velocity and power. + + +This non-linear system can be linearised (about the various +configurations) and small-signal frequency response methods applied. +For example, the four transfer functions $G_11$ to $G_22$ in Section +\Ref{sec:iTwoLink_tf} (representing the system linearised about zero +angles and velocities), give the small-signal relations between the +two spec. torques and the required system torques. Used together with +$G_31$ and $G_42$ (relating the spec. torques and the joint +velocities) gives, in principle, a method for evaluating actuator +requirements (for small signals) as a function of frequency. + ADDED mtt/lib/examples/Inverse/iTwoLink/iTwoLink_input.txt Index: mtt/lib/examples/Inverse/iTwoLink/iTwoLink_input.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/iTwoLink_input.txt +++ mtt/lib/examples/Inverse/iTwoLink/iTwoLink_input.txt @@ -0,0 +1,18 @@ +# Numerical parameter file (iTwoLink_input.txt) +# Generated by MTT at Mon Nov 17 10:40:37 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:56:50 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Mon Aug 18 18:15:41 BST 2003: u(1) = 1.0 - 2.0*(t>5.0) + 2.0*(t>15.0);; # t1s input torque +## Removed by MTT on Mon Aug 18 18:15:41 BST 2003: u(2) = 1.0 - 2.0*(t>5.0) + (t>15.0); # t2s input torque +itwolink__t1s = 1.0 - 2.0*(t>5.0) + 2.0*(t>15.0); # t1s input torque +itwolink__t2s = 1.0 - 2.0*(t>5.0) + (t>15.0); # t2s input torque ADDED mtt/lib/examples/Inverse/iTwoLink/iTwoLink_lbl.txt Index: mtt/lib/examples/Inverse/iTwoLink/iTwoLink_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/iTwoLink_lbl.txt +++ mtt/lib/examples/Inverse/iTwoLink/iTwoLink_lbl.txt @@ -0,0 +1,40 @@ +%SUMMARY iTwoLink: Inverse of two-link manipulator +%DESCRIPTION Uses the specification system idea to get an ordinary +%DESCRIPTION differential equation inverse. +%% Label file for system iTwoLink (iTwoLink_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/11/17 15:50:45 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%ALIAS INTF General/INTF + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type AF + a1 lin flow,1 + a2 lin flow,1 + +% Component type SS + t1 SS external,0 + t2 SS external,0 + t1s SS external,external + t2s SS external,external + +% Component type msd + spec1 + spec2 + +% Component type onelink + syst ADDED mtt/lib/examples/Inverse/iTwoLink/iTwoLink_numpar.txt Index: mtt/lib/examples/Inverse/iTwoLink/iTwoLink_numpar.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/iTwoLink_numpar.txt +++ mtt/lib/examples/Inverse/iTwoLink/iTwoLink_numpar.txt @@ -0,0 +1,17 @@ +# Numerical parameter file (iTwoLink_numpar.txt) +# Generated by MTT at Mon Nov 17 10:40:34 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +d_s = 1.0; # Parameter d_s for msd +k_s = 1.0; # Parameter k_s for msd +m_s = 1.0; # Parameter m_s for msd +j_s = 1.0; # Parameter j_s for twolink +l = 1.0; # Parameter l for twolink +m_s = 1.0; # Parameter m_s for twolink ADDED mtt/lib/examples/Inverse/iTwoLink/iTwoLink_rep.txt Index: mtt/lib/examples/Inverse/iTwoLink/iTwoLink_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/iTwoLink_rep.txt +++ mtt/lib/examples/Inverse/iTwoLink/iTwoLink_rep.txt @@ -0,0 +1,37 @@ +# Outline report file for system iTwoLink (iTwoLink_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 17:56:50 peterg +% %% To RCS +% %% +% %% Revision 1.1 1997/12/09 16:53:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt iTwoLink abg tex +mtt iTwoLink struc tex +mtt iTwoLink simp r +mtt iTwoLink dae tex +mtt iTwoLink ode tex +mtt iTwoLink sspar r +mtt iTwoLink sm tex +mtt iTwoLink tf tex + +mtt iTwoLink numpar txt +mtt iTwoLink input txt +mtt iTwoLink odeso ps 'iTwoLink__t1' +mtt iTwoLink odeso ps 'iTwoLink__t2' +mtt iTwoLink odeso ps 'iTwoLink__t1s' +mtt iTwoLink odeso ps 'iTwoLink__t1s:iTwoLink__t1' +mtt iTwoLink odeso ps 'iTwoLink__t2s:iTwoLink__t2' + + + + + + ADDED mtt/lib/examples/Inverse/iTwoLink/iTwoLink_simp.r Index: mtt/lib/examples/Inverse/iTwoLink/iTwoLink_simp.r ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/iTwoLink_simp.r +++ mtt/lib/examples/Inverse/iTwoLink/iTwoLink_simp.r @@ -0,0 +1,17 @@ +%% Reduce comands to simplify output for system twolink (twolink_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +END; ADDED mtt/lib/examples/Inverse/iTwoLink/iTwoLink_sspar.r Index: mtt/lib/examples/Inverse/iTwoLink/iTwoLink_sspar.r ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/iTwoLink_sspar.r +++ mtt/lib/examples/Inverse/iTwoLink/iTwoLink_sspar.r @@ -0,0 +1,17 @@ +%% Reduce steady-state parameter file for ionelink (ionelink_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mttx1 := 0; +mttx2 := 0; +mttx3 := 0; +mttx4 := 0; +mttx5 := 0; +mttx6 := 0; + +END; ADDED mtt/lib/examples/Inverse/iTwoLink/itwolink_rep.txt Index: mtt/lib/examples/Inverse/iTwoLink/itwolink_rep.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/itwolink_rep.txt +++ mtt/lib/examples/Inverse/iTwoLink/itwolink_rep.txt @@ -0,0 +1,35 @@ +# Outline report file for system itwolink (itwolink_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -c itwolink abg tex +mtt -c itwolink struc tex +mtt -c itwolink simp r +mtt -c itwolink dae tex +mtt -c itwolink cse tex +mtt -c itwolink ode tex +mtt -c itwolink sspar r +mtt -c itwolink dm tex +mtt -c itwolink sm tex +mtt -c itwolink tf tex +mtt -c itwolink lmfr ps + +mtt -c itwolink odes h +mtt -c itwolink numpar txt +mtt -c itwolink input txt +mtt -c itwolink odeso ps 'itwolink_t1' +mtt -c itwolink odeso ps 'itwolink_t2' +mtt -c itwolink odeso ps 'itwolink_t1s' +mtt -c itwolink odeso ps 'itwolink_t1s:itwolink_t1' +mtt -c itwolink odeso ps 'itwolink_t1s:itwolink_t2' +mtt -c itwolink rep txt + + + + + ADDED mtt/lib/examples/Inverse/iTwoLink/msd_abg.fig Index: mtt/lib/examples/Inverse/iTwoLink/msd_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/msd_abg.fig +++ mtt/lib/examples/Inverse/iTwoLink/msd_abg.fig @@ -0,0 +1,21 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 4050 4950 4050 4725 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3825 3600 2700 3825 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 4275 3600 5400 3825 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2250 4050 3375 4050 3150 4275 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6750 6975 6750 1125 900 1125 900 6975 6750 6975 +4 1 -1 0 0 0 20 0.0000000 4 210 150 3600 4185 1\001 +4 0 -1 0 0 0 20 0.0000000 4 270 1200 5085 4140 R:damper\001 +4 1 1 1 0 0 20 0.0000000 4 270 3585 3555 6300 Mass-spring-damper system\001 +4 2 4 0 0 0 20 0.0000000 4 240 870 2160 4140 SS:[in]\001 +4 1 -1 0 0 0 20 0.0000000 4 210 990 3600 5715 I:inertia\001 +4 1 -1 0 0 0 20 0.0000000 4 270 1050 3555 2610 C:spring\001 ADDED mtt/lib/examples/Inverse/iTwoLink/msd_desc.tex Index: mtt/lib/examples/Inverse/iTwoLink/msd_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/msd_desc.tex +++ mtt/lib/examples/Inverse/iTwoLink/msd_desc.tex @@ -0,0 +1,31 @@ +% Verbal description for system msd (msd_desc.tex) +% Generated by MTT on Thu Nov 13 09:38:17 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{msd} is + displayed in Figure \Ref{msd_abg} and its label + file is listed in Section \Ref{sec:msd_lbl}. + The subsystems are listed in Section \Ref{sec:msd_sub}. + + + \textbf{msd} is a simple Mass-Spring-Damper system with collocated + force and velocity. It is set up to provide a specification system + for each link of the two-link maipulator. This is appropriate because + \begin{itemize} + \item it has compatible physical behaviour with the system itself, + \item it specifies two decoupled systems, + \item it has linear behaviour and + \item it has a simple performance interpretation in terms of system + rise-time and overshoot. + \end{itemize} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Inverse/iTwoLink/msd_lbl.txt Index: mtt/lib/examples/Inverse/iTwoLink/msd_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/msd_lbl.txt +++ mtt/lib/examples/Inverse/iTwoLink/msd_lbl.txt @@ -0,0 +1,29 @@ +%SUMMARY msd: Simple mass-spring damper +%DESCRIPTION +%% Label file for system msd (msd_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type C + spring lin state,k_s + +% Component type I + inertia lin flow,m_s + +% Component type R + damper lin flow,d_s + +% Component type SS + [in] SS external,external ADDED mtt/lib/examples/Inverse/iTwoLink/oldROD_abg.fig Index: mtt/lib/examples/Inverse/iTwoLink/oldROD_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/oldROD_abg.fig +++ mtt/lib/examples/Inverse/iTwoLink/oldROD_abg.fig @@ -0,0 +1,123 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 4278 5403 4953 5178 4953 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5854 5404 6529 6079 6304 6079 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 6078 5403 5403 5403 5628 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 4953 6528 4278 6528 4503 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 + 4277 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 2702 4277 3827 4052 3827 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 6527 8102 7652 7877 7652 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 7652 4277 6527 4277 6752 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3827 8102 2702 8102 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5852 5177 6527 5177 6392 5312 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 2927 2927 4952 3152 4727 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5402 2927 7427 3152 7202 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2701 5176 2026 5176 2161 5311 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 1351 2926 2476 3196 2206 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 7876 2926 9001 3196 8731 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 2928 8328 4953 8553 4728 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8328 5403 8328 7428 8553 7203 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 1352 8327 2477 8597 2207 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8327 7877 8327 9002 8597 8732 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 1351 5626 4951 5851 4726 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5626 5401 5626 9001 5851 8776 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8551 5176 9226 5176 9091 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 4951 6526 4051 6436 4231 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3826 4996 3826 5356 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 5176 3826 5176 3961 5311 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3826 5401 6301 6301 6121 6301 +2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 5401 4051 6301 3826 6301 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 4951 4051 4051 4051 4276 +2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5536 5176 5086 5176 5221 5311 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6300 9675 6300 675 4950 675 4950 9675 6300 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 9000 9675 9000 675 7650 675 7650 9675 9000 9675 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11025 10305 11025 225 225 225 225 10305 11025 10305 +2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3600 9675 2250 9675 2250 675 3600 675 3600 9675 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 2250 990 2250 990 900 10125 900 10125 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 5850 990 5850 990 4500 10125 4500 10125 5850 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 10125 9450 990 9450 990 8100 10125 8100 10125 9450 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2700 4950 2700 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5850 4950 5850 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8550 4950 8550 5400 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5628 5268 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 315 6933 5268 I:J\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 5312 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2972 2792 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 7742 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 5313 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8373 2793 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 7743 0\001 +4 1 -1 0 0 0 20 0.0000000 4 270 735 9676 5266 I:m_y\001 +4 1 -1 0 0 0 20 0.0000000 4 240 735 1531 5221 I:m_x\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1170 4636 4141 EMTF:c1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1170 4681 6391 EMTF:c2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 4141 EMTF:s1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 6391 EMTF:s2\001 +4 1 5 0 0 0 20 0.0000000 4 210 150 3603 5313 0\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 6751 4456 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 6751 3781 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 6751 6076 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 6751 6706 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 570 6211 6526 [mod]\001 +4 1 5 0 0 0 20 0.0000000 4 210 990 4681 5266 INTF:th\001 +4 1 1 1 0 0 20 0.0000000 4 210 210 2925 10035 X\001 +4 1 1 1 0 32 20 0.0000000 4 135 195 5580 9990 a\001 +4 1 1 1 0 0 20 0.0000000 4 210 210 8280 9990 Y\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 3960 4140 [mod]\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 6345 4095 [mod]\001 +4 2 26 0 0 0 16 0.0000000 4 195 570 3960 6210 [mod]\001 +4 1 26 0 0 0 16 0.0000000 4 195 330 4590 4455 [in]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 4545 3780 [out]\001 +4 1 26 0 0 0 16 0.0000000 4 195 450 4590 6660 [out]\001 +4 0 26 0 0 0 16 0.0000000 4 195 330 4365 6030 [in]\001 +4 1 4 0 0 0 20 0.0000000 4 240 1065 2971 1216 SS:[x_a]\001 +4 1 4 0 0 0 20 0.0000000 4 240 1080 2971 9361 SS:[x_b]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1065 8372 1217 SS:[y_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1080 8417 9362 SS:[y_b]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1575 5671 1216 SS:[alpha_a]\001 +4 1 4 0 0 0 20 0.0000000 4 270 1590 5671 9361 SS:[alpha_b]\001 +4 1 1 1 0 0 20 0.0000000 4 270 630 1350 2700 Tip a\001 +4 1 1 1 0 0 20 0.0000000 4 240 1470 1260 6300 Mass centre\001 +4 1 1 1 0 0 20 0.0000000 4 270 645 1350 9855 Tip b\001 ADDED mtt/lib/examples/Inverse/iTwoLink/oldROD_desc.tex Index: mtt/lib/examples/Inverse/iTwoLink/oldROD_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/oldROD_desc.tex +++ mtt/lib/examples/Inverse/iTwoLink/oldROD_desc.tex @@ -0,0 +1,20 @@ +% Verbal description for system oldROD (oldROD_desc.tex) +% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/08/15 09:41:19 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{oldROD} is + displayed in Figure \Ref{oldROD_abg} and its label + file is listed in Section \Ref{sec:oldROD_lbl}. + The subsystems are listed in Section \Ref{sec:oldROD_sub}. + +{\bf oldROD} is essentially as described in Figure 10.2 of +``Metamodelling''. ADDED mtt/lib/examples/Inverse/iTwoLink/oldROD_lbl.txt Index: mtt/lib/examples/Inverse/iTwoLink/oldROD_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/oldROD_lbl.txt +++ mtt/lib/examples/Inverse/iTwoLink/oldROD_lbl.txt @@ -0,0 +1,53 @@ +%SUMMARY oldROD: rigid rod in two dimensions +%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a +%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b +%DESCRIPTION Port [x_a]: x force/velocity - end a +%DESCRIPTION Port [x_b]: x force/velocity - end b +%DESCRIPTION Port [y_a]: y force/velocity - end a +%DESCRIPTION Port [y_b]: y force/velocity - end b +%DESCRIPTION +%DESCRIPTION Parameter 1: length from end 1 to mass centre +%DESCRIPTION Parameter 2: length from end 2 to mass centre +%DESCRIPTION Parameter 3: inertia about mass centre +%DESCRIPTION Parameter 4: mass +%DESCRIPTION See Section 10.2 of "Metamodelling" + + +%% Label file for system oldROD (oldROD_lbl.txt) + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1997/08/15 09:43:06 peterg +% %% Now has lablelled (as opposed to numbered) ports. +% %% +% Revision 1.1 1996/11/07 10:57:17 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Inertias +J lin flow,$3 +m_x lin flow,$4 +m_y lin flow,$4 + +%Integrate angular velocity to get angle +th + +%Modulated transformers +s1 lsin flow,$1 +s2 lsin flow,$2 +c1 lcos flow,$1 +c2 lcos flow,$2 + + + ADDED mtt/lib/examples/Inverse/iTwoLink/twolink_abg.fig Index: mtt/lib/examples/Inverse/iTwoLink/twolink_abg.fig ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/twolink_abg.fig +++ mtt/lib/examples/Inverse/iTwoLink/twolink_abg.fig @@ -0,0 +1,82 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3468 1128 3738 1128 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 5625 4502 5627 4277 5852 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 7426 4951 7201 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3472 8647 3742 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4597 8647 4867 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5724 8649 5994 8649 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4730 8645 4730 10220 4955 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5855 8645 5855 10220 6080 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3826 3601 7426 3826 7201 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3826 5851 7426 6076 7201 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 11475 9450 225 180 225 180 11475 9450 11475 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 8622 3600 10197 3825 9972 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 2025 2250 4725 2250 4725 2700 4950 2475 +4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000 4 195 1200 4729 3379 ROD:rod1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1200 4731 8196 ROD:rod2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 +4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 +4 2 4 0 0 0 20 0.0000 4 255 1380 1936 2341 SS:[joint_1]\001 +4 2 4 0 0 0 20 0.0000 4 255 1380 1936 5716 SS:[joint_2]\001 +4 1 -1 0 0 0 20 0.0000 4 255 810 5808 948 SS:v_y\001 ADDED mtt/lib/examples/Inverse/iTwoLink/twolink_desc.tex Index: mtt/lib/examples/Inverse/iTwoLink/twolink_desc.tex ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/twolink_desc.tex +++ mtt/lib/examples/Inverse/iTwoLink/twolink_desc.tex @@ -0,0 +1,28 @@ +% Verbal description for system twolink (twolink_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{twolink} is + displayed in Figure \Ref{twolink_abg} and its label + file is listed in Section \Ref{sec:twolink_lbl}. + The subsystems are listed in Section \Ref{sec:twolink_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses two compound components: {\bf ROD} and {\bf +GRAV}. {\bf ROD} is essentially as described in Figure 10.2 {\bf +GRAV} represents gravity by a vertical accelleration as in Section +10.9 of "Metamodelling" + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Inverse/iTwoLink/twolink_lbl.txt Index: mtt/lib/examples/Inverse/iTwoLink/twolink_lbl.txt ================================================================== --- mtt/lib/examples/Inverse/iTwoLink/twolink_lbl.txt +++ mtt/lib/examples/Inverse/iTwoLink/twolink_lbl.txt @@ -0,0 +1,54 @@ +%SUMMARY twolink: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (twolink_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/12/05 12:39:49 peterg +% %% Documentation +% %% +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - identical rods +rod1 none l;l;j_s;m_s +rod2 none l;l;j_s;m_s + +%Zero velocity sources +v_x SS internal,0 +v_y SS internal,0 + + +%Zero force/torque sources +F_x SS 0,internal +F_a SS 0,internal +F_y SS 0,internal + + +%Torque at joints +%f_a1 SS external,external +%f_a2 SS external,external + +%Gravity +%g + ADDED mtt/lib/examples/Makefile Index: mtt/lib/examples/Makefile ================================================================== --- mtt/lib/examples/Makefile +++ mtt/lib/examples/Makefile @@ -0,0 +1,32 @@ +#! /usr/bin/make -f + +# DESTDIR prefix required by Debian build process +INSTDIR=$(DESTDIR)/usr/share/mtt/lib/examples + +configure: configure-stamp +configure-stamp: + @touch configure-stamp + +build: configure build-stamp +build-stamp: + @touch build-stamp + +clean: + @touch clean.sh + @-chmod a+x clean.sh + @./clean.sh + @rm -f clean.sh + +distclean: clean + +install: build clean.sh + @install -d $(INSTDIR) + @cp -a $(filter-out CVS Makefile debian, $(wildcard *)) $(INSTDIR) + +.PHONY: FORCE + +clean.sh: FORCE + @echo '#! /bin/sh' >>clean.sh + @echo '# This file is auto-generated - do not edit' >>clean.sh + @echo "rm -f $(INSTDIR)/examples" >>clean.sh + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_abg.fig @@ -0,0 +1,16 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1125 2700 2250 2700 2025 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2745 2700 3870 2700 3645 2925 +4 1 0 100 0 18 20 1.5708 4 225 675 1035 2700 Free\001 +4 1 0 100 0 18 20 1.5708 4 300 3405 2610 2700 BernoulliEuler:Lump*20\001 +4 1 0 100 0 18 20 1.5708 4 225 795 4230 2700 Fixed\001 ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_desc.tex @@ -0,0 +1,59 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system CantileverBeam (CantileverBeam_desc.tex) +% Generated by MTT on Mon Apr 19 07:04:54 BST 1999. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/05/18 04:01:50 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The acausal bond graph of system \textbf{CantileverBeam} is displayed in +Figure \Ref{fig:CantileverBeam_abg.ps} and its label file is listed in +Section \Ref{sec:CantileverBeam_lbl}. The subsystems are listed in Section +\Ref{sec:CantileverBeam_sub}. + +This example represents the dynamics of a uniform beam with one fixed +and one free end. The beam is approximated by 20 equal lumps using +the Bernoulli-Euler approximation with damping. +The input is the angular velocity of the fixed end, the output is the +linear velocity of the free end. + +The system parameters are given in Section +\Ref{sec:CantileverBeam_numpar.tex}. Note that the numer of ban +segments has been set to 21. + + The system has 20 states (10 +modes of vibration), 1 inputs and 1 outputs. + +The first 5 vibration frequencies are given in Table \ref{tab:freq} +togtherr with the theoretical (based on the Bernoulli-Euler beam with +the same values of $EI$ and $\rho A$. +\begin{table}[htbp] + \begin{center} + \begin{tabular}{||l|l|l||} + \hline + \hline + Mode & Frequency & Theoretical frequency\\ + \hline + 1 & 76.14 & 76.14\\ + 2 & 477.11 & 484.50\\ + 3 &1330.62 &1334.55\\ + 4 &2586.77 &2617.19\\ + 5 &4225.14 &4323.77\\ + \hline + \hline + \end{tabular} + \caption{Mode frequencies (rad $s^{-1}$)} + \label{tab:freq} + \end{center} +\end{table} + + + + + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_input.txt @@ -0,0 +1,19 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (CantileverBeam_input.txt) +# Generated by MTT at Thu Apr 22 00:12:54 BST 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 2003/05/08 18:48:49 gawthrop +## Modified for new format with __ +## +## Revision 1.1 2000/12/28 17:58:27 peterg +## To RCS +## +############################################################### + +# Set the inputs +## Removed by MTT on Thu May 8 16:55:10 BST 2003: mttu(1) = exp(-t/0.1); # tau (CantileverBeam) +cantileverbeam__mttfixed__u__u = exp(-t/0.1); # tau (CantileverBeam) ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_lbl.txt @@ -0,0 +1,37 @@ +%% Label file for system CantileverBeam (CantileverBeam_lbl.txt) +%SUMMARY CantileverBeam +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%VAR n +%VAR BeamLength +%VAR BeamWidth +%VAR BeamThickness +%VAR Youngs +%VAR Density +%VAR Area +%VAR AreaMoment +%VAR EI +%VAR rhoA +%VAR k + +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type BernoulliEuler + Lump ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt @@ -0,0 +1,45 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (CantileverBeam_numpar.txt) +# Generated by MTT at Mon Apr 19 06:24:08 BST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 17:58:27 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +N = 21; +BeamLength = 0.58; +BeamWidth = 0.05; +BeamThickness = 0.005; +Youngs = 68.94e9; +Density = 2712.8; +Area = BeamWidth*BeamThickness; +AreaMoment = (BeamWidth*pow(BeamThickness,3))/12; + +EI = Youngs*AreaMoment; +rhoA = Density*Area; + +dz = BeamLength/N; # Incremental length +dm = rhoA*dz; # Incremental mass +dk = EI/dz; # Incremental stiffness +dr = 0; # Damping + +K = sqrt(EI/rhoA)/pow(BeamLength,2); # Normalising factor + + +# EI= 58.6957 # from Reza +# rhoA= 0.7989 # from Reza + + + + + + + + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_rep.txt @@ -0,0 +1,28 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system CantileverBeam (CantileverBeam_rep.txt) +## Generated by MTT on" Mon Apr 19 06:43:08 BST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt CantileverBeam abg tex # The system description +## mtt CantileverBeam cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt CantileverBeam struc tex # The system structure +## mtt CantileverBeam dae tex # The system dae +## mtt CantileverBeam ode tex # The system ode +## mtt CantileverBeam sspar tex # Steady-state parameters +## mtt CantileverBeam ss tex # Steady state +## mtt CantileverBeam dm tex # Descriptor matrices (of linearised system) +## mtt CantileverBeam sm tex # State matrices (of linearised system) +## mtt CantileverBeam tf tex # Transfer function (of linearised system) +mtt CantileverBeam simpar tex # Simulation parameters +mtt CantileverBeam numpar tex # Numerical simulation parameters +## mtt CantileverBeam input tex # Simulation input +## mtt CantileverBeam odeso ps # Simulation output +mtt CantileverBeam lmfr ps # log modulus of frequency response (of linearised system) + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system CantileverBeam (CantileverBeam_simpar.txt) +# Generated by MTT on Mon Apr 19 06:32:42 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 1.0; # Last time in simulation +DT = 0.001; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = 1; # Minimum frequency = 10^WMIN +WMAX = 4; # Maximum frequency = 10^WMAX +WSTEPS = 200; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_abg.fig @@ -0,0 +1,21 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 1800 5400 1800 5175 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4230 2700 5355 2700 5130 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 1575 5400 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 2475 5400 2925 +4 0 0 100 0 18 20 0.0000 4 225 1065 5625 1890 Sf:zero\001 +4 0 0 100 0 18 20 0.0000 4 225 585 5625 2790 Sf:u\001 +4 2 4 100 0 18 20 0.0000 4 300 1230 4140 1890 SS:[y_in]\001 +4 2 4 100 0 18 20 0.0000 4 300 1785 4140 2790 SS:[theta_in]\001 ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_lbl.txt @@ -0,0 +1,31 @@ +%% Label file for system Fixed (Fixed_lbl.txt) +%SUMMARY Fixed +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in y_in,theta_in + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [theta_in] SS external,external + [y_in] SS external,external + +% Component type Sf + u SS external + zero SS 0 ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_abg.fig @@ -0,0 +1,21 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 1800 5400 1800 5175 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4230 2700 5355 2700 5130 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 1575 5400 2025 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5400 2475 5400 2925 +4 2 0 100 0 18 20 0.0000 4 300 585 4140 1890 Df:y\001 +4 2 0 100 0 18 20 0.0000 4 225 1125 4140 2790 Se:zero\001 +4 0 4 100 0 18 20 0.0000 4 300 1440 5490 1890 SS:[y_out]\001 +4 0 4 100 0 18 20 0.0000 4 300 1995 5445 2790 SS:[theta_out]\001 ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_lbl.txt @@ -0,0 +1,35 @@ +%% Label file for system Free (Free_lbl.txt) +%SUMMARY Free +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS out y_out,theta_out + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type Df + y SS external + +% Component type SS + [theta_out] SS external,external + [y_out] SS external,external + +% Component type Se + zero SS 0 + + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/frequencies.m Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/frequencies.m ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/frequencies.m +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/frequencies.m @@ -0,0 +1,14 @@ +function [w_r,w_a,n_null] = frequencies (A,B,C,D) + + ## usage: [w_r,w_a] = frequencies (A,B,C,D) + ## + ## Resonant and antiresonant frequencies for undampled beam + + poles = eig(A); + Np = length(poles); + zeros = tzero(A,B,C,D); + Nz = length(zeros); + w_r = sort(imag(poles)); w_r = w_r(Np/2+1:Np); + w_a = sort(imag(zeros)); w_a = nozeros(w_a(Nz/2+1:Nz))'; + n_null = (Nz/2-length(w_a))*2; +endfunction ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Fixed_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Fixed_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Fixed_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Fixed_lbl.txt @@ -0,0 +1,31 @@ +%% Label file for system Fixed (Fixed_lbl.txt) +%SUMMARY Fixed +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in y_in,theta_in + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [theta_in] SS external,external + [y_in] SS external,external + +% Component type Sf + u SS external + zero SS 0 ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Free_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Free_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Free_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Free_lbl.txt @@ -0,0 +1,35 @@ +%% Label file for system Free (Free_lbl.txt) +%SUMMARY Free +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS out y_out,theta_out + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type Df + y SS external + +% Component type SS + [theta_out] SS external,external + [y_out] SS external,external + +% Component type Se + zero SS 0 + + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/MakeFreqTable.m Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/MakeFreqTable.m ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/MakeFreqTable.m +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/MakeFreqTable.m @@ -0,0 +1,64 @@ +# ## Makes the table of resonant frequencies + +# ## Actual resonant freqs +# fr_measured = [ +# 2.0683e+01 +# 7.5310e+01 +# 1.7080e+02 +# 3.0532e+02 +# 4.7414e+02]; + +# fa_measured = [ +# 2.0896e+01 +# 7.6867e+01 +# 1.7794e+02 +# 3.1890e+02 +# 4.8768e+02]; + +## Parameters - ideal pinned beam +PinnedBeam_numpar; + +## Ideal pinned beam - theory +[fr_theory] = beam_frequencies("pinned",ei,rhoa,beamlength)/(2*pi); +[fa_theory] = beam_frequencies("clamped-pinned",ei,rhoa,beamlength)/(2*pi); + +## SM form to get poles and zeros of the model +# ## Ideal pinned +# [A,B,C,D] = PinnedBeam_sm; +# fr_model_ideal = frequencies(A,B,C,D)/(2*pi); + +# ## Actual with non-ideal pins +# PinnedBeam_numpar; + +[A,B,C,D] = PinnedBeam_sm; + +[w_r, w_a] = frequencies(A,B,C,D); +fr_model = w_r/(2*pi); +fa_model = w_a/(2*pi); + + +printf("\nIndex \t& Theory \t& Model \t& Theory \t& Model \\\\ \n"); +printf("\\hline\n"); +for i = 1:5 + printf("%i \t& %3.2f \t& %3.2f \t& %3.2f \t& %3.2f\\\\ \n", i, \ + fr_theory(i), fr_model(i), fa_theory(i), fa_model(i)); +endfor + +# printf("\nMode \t& Theory \t& Model(ideal) \t& Model \t& Actual \\\\ \n"); +# printf("\\hline\n"); +# for i = 1:5 +# printf("%i \t& %3.2f \t& %3.2f \t& %3.2f \t& %3.2f\\\\ \n", i, fr_theory(i), \ +# fr_model_ideal(i), fr_model(i), fr_measured(i)); +# endfor + +# printf("\nMode \t& Theory \t& Model \t& Actual \\\\ \n"); +# printf("\\hline\n"); +# for i = 1:5 +# printf("%i \t& %3.2f \t& %3.2f \t& %3.2f \\\\ \n", i, fa_theory(i), fa_model(i), fa_measured(i)); +# endfor + + + + + + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_abg.fig @@ -0,0 +1,50 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2925 1980 3015 2520 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2970 2025 2970 2475 +-6 +6 4005 2880 4095 3420 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 2925 4050 3375 +-6 +6 8955 1980 9045 2520 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 9000 2025 9000 2475 +-6 +6 7830 2880 7920 3420 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 7875 2925 7875 3375 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4770 2700 5895 2700 5670 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6300 2700 7425 2700 7200 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2970 2250 4095 2250 3870 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2925 3150 4050 3150 3825 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7875 2250 9000 2250 8775 2475 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 7875 3150 9000 3150 8775 3375 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 1125 225 1125 5400 10800 5400 10800 225 1125 225 +4 1 0 100 0 18 20 1.5708 4 360 3855 4635 2700 BernoulliEuler:LumpL\001 +4 1 0 100 0 18 20 1.5708 4 360 4170 6165 2700 BernoulliEuler:Lump*18\001 +4 1 0 100 0 18 20 1.5708 4 360 3885 7740 2700 BernoulliEuler:LumpR\001 +4 2 4 100 0 18 14 0.0000 4 210 585 3915 2070 [y_in]\001 +4 2 4 100 0 18 14 0.0000 4 210 990 3915 2970 [theta_in]\001 +4 0 4 100 0 18 14 0.0000 4 210 735 7965 1980 [y_out]\001 +4 0 4 100 0 18 14 0.0000 4 210 1140 7965 2970 [theta_out]\001 +4 2 0 100 0 18 20 0.0000 4 285 1230 2835 3285 SS:ssL\001 +4 0 0 100 0 18 20 0.0000 4 285 1515 9135 2385 Sf:zeroR\001 +4 0 0 100 0 18 20 0.0000 4 285 1260 9135 3285 SS:ssR\001 +4 2 0 100 0 18 20 0.0000 4 285 1485 2835 2385 Sf:zeroL\001 ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_desc.tex @@ -0,0 +1,101 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system PinnedBeam (PinnedBeam_desc.tex) +% Generated by MTT on Mon Apr 19 07:04:54 BST 1999. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1999/11/24 22:17:26 peterg +% %% Updated to correspond to Reza's beam +% %% +% %% Revision 1.1 1999/10/11 05:08:14 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1999/05/18 04:01:50 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The acausal bond graph of system \textbf{PinnedBeam} is displayed in +Figure \Ref{fig:PinnedBeam_abg.ps} and its label file is listed in +Section \Ref{sec:PinnedBeam_lbl}. The subsystems are listed in Section +\Ref{sec:PinnedBeam_sub}. + +This example represents the dynamics of a uniform beam with two pinned +ends. The left-hand end is driven by a torque input and the +corresponding collocated angular velocity is measured. The beam is +approximated by 20 equal lumps using the Bernoulli-Euler. Because the +two end lumps have different causality to the rest of the beam lumps, +they are represented seperately. The system has 40 states (20 modes +of vibration), 1 input and 1 output. + +\begin{table}[htbp] + \begin{center} + \begin{tabular}{|l|l|} + \hline + Name & Value\\ + \hline + Beam Length, $L$ & 0.60 m\\ + Beam Width $w$ & 0.05 m\\ + Beam Thickness $t_b$ & 0.003\\ + Young's Modulus $E$ & $68.94 \times 10^9$ \\ + Density $\rho$ & 2712.8\\ + \hline + Derived quantities & \\ + \hline + $EI$ & 7.76\\ + $\rho A$ & 0.40692 \\ + \hline + \end{tabular} + \caption{Beam parameters} + \label{tab:beam} + \end{center} +\end{table} + + +The beam was made of aluminium with physical dimensions and constants +given in Table \ref{tab:beam}. The derived beam constants are given by the +formulae: +\begin{equation} + \label{eq:formulae} + \begin{align} + EI &= E \times w \frac{1}{12} t_b^3\\ + \rho A &= \rho \times w t_b + \end{align} +\end{equation} + +The system parameters are also given in Section +\Ref{sec:PinnedBeam_numpar.tex}. + + +\begin{table}[htbp] + \begin{center} + \begin{tabular}{||l|l|l|l|l||} + \hline + \hline +Index & $f_r$ (theory) & $f_r$ (model)& $f_a$ (theory) & $f_a$ (model) \\ +\hline +1 & 19.05 & 19.01 & 29.72 & 31.28\\ +2 & 76.24 & 75.57 & 96.50 & 100.80\\ +3 & 171.58 & 168.29 & 200.73 & 208.20\\ +4 & 304.76 & 294.89 & 344.13 & 350.88\\ +5 & 476.34 & 452.25 & 524.98 & 525.23\\ + \hline + \hline + \end{tabular} + \caption{Resonant and anti-resonant frequencies (Hz)} + \label{tab:freq} + \end{center} +\end{table} + +Standard modal analysis give the theoretical system resonant +frequencies $f_r$ (based on the Bernoulli-Euler beam with the same values of +$EI$ and $\rho A$). The system anti-resonances $f_a$ correspond to those of +the \emph{inverse} system with reversed causality, that the driven +pinned end is replaced by a clamped end; again modal analysis of the +inverse system gives the system anti resonances. The model and +theoretical values are compared in Table \ref{tab:freq} for the first +5 modes. (This table was generated using the script MakeFreqTable.m) + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_input.txt @@ -0,0 +1,17 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (PinnedBeam_input.txt) +# Generated by MTT at Thu Apr 22 00:12:54 BST 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 17:59:05 peterg +## To RCS +## +############################################################### + +# Set the inputs +pinnedbeam__mttfixed__u__u = exp(-t/0.1); # tau (PinnedBeam) + +# Set the switches ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_lbl.txt @@ -0,0 +1,54 @@ +%% Label file for system PinnedBeam (PinnedBeam_lbl.txt) +%SUMMARY PinnedBeam +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/08/01 12:11:57 peterg +% %% Added %Vars +% %% +% %% Revision 1.1 1999/10/11 05:08:22 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%VAR Lumps +%VAR BeamLength +%VAR BeamWidth +%VAR BeamThickness +%VAR Youngs +%VAR Density +%VAR Area +%VAR AreaMoment +%VAR EI +%VAR rhoA + +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type BernoulliEuler + Lump + LumpL + LumpR + +% Component type SS + ssL SS external,external + ssR SS 0,internal + +% Component type Sf + zeroL none 0 + zeroR none 0 + + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt @@ -0,0 +1,37 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (pPinnedBeam_numpar.txt) +# Generated by MTT at Mon Apr 19 06:24:08 BST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.2 2003/06/11 16:03:06 gawthrop +# %% Updated examples for latest MTT. +# %% +# %% Revision 1.1 2000/12/28 17:59:05 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +## Number of lumps +Lumps = 20; # Number of lumps + +## Beam physical parameters +BeamLength = 0.60; +BeamWidth = 0.05; +BeamThickness = 0.003; +Youngs = 68.94e9; +Density = 2712.8; +Area = BeamWidth*BeamThickness; +AreaMoment = (BeamWidth*pow(BeamThickness,3))/12; +EI = Youngs*AreaMoment; +rhoA = Density*Area; + +## Segments +dz = BeamLength/Lumps; # Incremental length +dm = rhoA*dz; # Incremental mass +dk = EI/dz; # Incremental stiffness +dr = 0; # Damping + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_rep.txt @@ -0,0 +1,28 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system PinnedBeam (PinnedBeam_rep.txt) +## Generated by MTT on" Mon Apr 19 06:43:08 BST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt PinnedBeam abg tex # The system description +## mtt PinnedBeam cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt PinnedBeam struc tex # The system structure +## mtt PinnedBeam dae tex # The system dae +## mtt PinnedBeam ode tex # The system ode +## mtt PinnedBeam sspar tex # Steady-state parameters +## mtt PinnedBeam ss tex # Steady state +## mtt PinnedBeam dm tex # Descriptor matrices (of linearised system) +## mtt PinnedBeam sm tex # State matrices (of linearised system) +## mtt PinnedBeam tf tex # Transfer function (of linearised system) +mtt PinnedBeam simpar tex # Simulation parameters +mtt PinnedBeam numpar tex # Numerical simulation parameters +## mtt PinnedBeam input tex # Simulation input +## mtt PinnedBeam odeso ps # Simulation output +mtt PinnedBeam lmfr ps # log modulus of frequency response (of linearised system) + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system PinnedBeam (PinnedBeam_simpar.txt) +# Generated by MTT on Mon Apr 19 06:32:42 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 1.0; # Last time in simulation +DT = 0.01; # Print interval +STEPFACTOR = 10; # Integration steps per print interval +WMIN = 1; # Minimum frequency = 10^WMIN +WMAX = 4; # Maximum frequency = 10^WMAX +WSTEPS = 200; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_abg.fig @@ -0,0 +1,132 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2706 4806 3606 4806 3456 4956 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2406 5106 2406 6006 2556 5856 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3906 5106 3906 6006 4056 5856 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7208 4808 8108 4808 7958 4958 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8708 4808 9608 4808 9458 4958 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8408 5108 8408 6008 8558 5858 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7208 4508 8108 3608 8108 3833 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8708 3608 9608 4508 9383 4508 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9909 5109 9909 6009 10059 5859 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6908 5108 6908 6008 7058 5858 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 8405 2405 8405 3305 8555 3155 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11407 5107 11407 6007 11557 5857 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11406 3306 11406 2406 11556 2556 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4206 4806 5106 4806 4956 4956 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5406 5106 5406 6006 5556 5856 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4206 4506 5106 3606 5106 3831 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5405 3305 5405 2405 5555 2555 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2405 3305 2405 2405 2555 2555 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11707 4807 12607 4807 12457 4957 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11707 3607 12607 4507 12382 4507 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2105 1805 2105 905 2255 1055 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2705 1805 2705 905 2855 1055 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5706 4806 6606 4806 6456 4956 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5706 3606 6606 4506 6381 4506 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2704 3604 3604 4504 3379 4504 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1208 4808 2108 4808 1958 4958 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1208 4508 2108 3608 2108 3833 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 681 3606 1131 3606 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 906 4506 906 3606 1056 3756 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12905 4505 12905 3605 13055 3755 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10207 4807 11107 4807 10957 4957 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10207 4507 11107 3607 11107 3832 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8400 3300 8625 3300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 12900 3600 13125 3600 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 12675 3600 12900 3600 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8175 3300 8400 3300 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 1501 5401 301 5401 301 3001 1501 3001 1501 5401 +2 2 1 2 1 7 1 0 -1 6.000 1 0 0 0 0 5 + 1502 452 3302 452 3302 3377 1502 3377 1502 452 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 4501 6601 3301 6601 3301 3901 4501 3901 4501 6601 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 6000 6600 4800 6600 4800 1800 6000 1800 6000 6600 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 7501 6601 6301 6601 6301 3901 7501 3901 7501 6601 +2 4 1 2 1 7 2 0 -1 6.000 0 0 7 0 0 5 + 9000 6600 7800 6600 7800 1800 9000 1800 9000 6600 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 10501 6601 9301 6601 9301 3901 10501 3901 10501 6601 +2 4 1 2 1 -1 1 0 -1 6.000 0 0 7 0 0 5 + 12000 6600 10800 6600 10800 1800 12000 1800 12000 6600 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 13501 5401 12301 5401 12301 3001 13501 3001 13501 5401 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2406 4881 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 585 3906 6381 I:m1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 585 2405 6380 R:b1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2405 3680 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 3906 4881 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8408 4883 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 8408 3683 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 585 8483 6383 R:b3\001 +4 1 -1 0 0 0 20 0.0000000 4 210 675 8407 2182 SS:f2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 585 9906 6381 I:m3\001 +4 1 -1 0 0 0 20 0.0000000 4 210 585 6905 6380 I:m2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 11407 4882 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 11407 3682 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 525 11406 2181 C:kt\001 +4 1 -1 0 0 0 20 0.0000000 4 210 525 11482 6382 R:bt\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5406 4881 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5406 3681 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 585 5481 6381 R:b2\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 12909 4884 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 6908 4883 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 2404 2179 1\001 +4 1 -1 0 0 0 20 0.0000000 4 270 585 2779 754 C:p1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 585 2104 754 R:d1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 910 4885 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 675 902 3377 SS:fb\001 +4 1 -1 0 0 0 20 0.0000000 4 210 615 12905 3380 SS:ft\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 9909 4884 1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 585 5405 2180 C:k2\001 +4 1 1 1 0 3 20 0.0000000 4 240 1530 3901 6901 Macro mass\001 +4 1 1 1 0 3 20 0.0000000 4 240 1800 2401 376 Macro control\001 +4 1 1 1 0 3 20 0.0000000 4 240 1455 900 5700 Macro base\001 +4 1 1 1 0 3 20 0.0000000 4 270 1890 5400 1650 Compliant link\001 +4 1 1 1 0 3 20 0.0000000 4 240 1470 6901 6901 Micro mass\001 +4 1 1 1 0 3 20 0.0000000 4 240 1890 8475 1650 Micro actuator\001 +4 1 1 1 0 3 20 0.0000000 4 270 1125 9901 6901 Tip mass\001 +4 1 1 1 0 3 20 0.0000000 4 270 2985 11400 1650 Compliant environment\001 +4 1 1 1 0 3 20 0.0000000 4 270 1305 12901 5701 Tip sensor\001 ADDED mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_desc.tex @@ -0,0 +1,18 @@ +% Verbal description for system MacroMicro (MacroMicro_desc.tex) +% Generated by MTT on Tue Dec 9 17:55:41 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{MacroMicro} is + displayed in Figure \Ref{MacroMicro_abg} and its label + file is listed in Section \Ref{sec:MacroMicro_lbl}. + The subsystems are listed in Section \Ref{sec:MacroMicro_sub}. + +This is a Bond Graph model of the macro-micro manipulation system +discussed by Sharon in his thesis and BY Sharon, Hogan and Hardt in +various papers. ADDED mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_lbl.txt @@ -0,0 +1,32 @@ +%% Label file (macmic_lbl.txt) +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Masses +m1 lin flow,m_1 +m2 lin flow,m_2 +m3 lin flow,m_3 + +%Springs +k2 lin state,k_2 +kt lin state,k_t + +%Dampers +b1 lin flow,b_1 +b2 lin flow,b_2 +b3 lin flow,b_3 +bt lin flow,b_t + +%Source/sensors +f2 SS external,internal +ft SS external,0 +fb SS internal,0 + +%Control +p1 lin flow,p_1 +d1 lin flow,d_1 + + + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_numpar.txt @@ -0,0 +1,12 @@ + +m_1 = 0.0169; # m_1; +m_2 = 0.0169; # m_2; +b_1 = 0.13; # b_1; +b_2 = 0.013; # b_2; +k_2 = 24; # k_2; +k_t = 150; # k_t; +b_t = 0.16; # b_t; +b_3 = 0.13; # b_3; +m_3 = 0.005; # m_3; +p_1 = 10; # p_1; +d_1 = 0.9; # d_1; ADDED mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_rep.txt @@ -0,0 +1,19 @@ +# Outline report file for system MacroMicro (MacroMicro_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt MacroMicro abg tex +mtt MacroMicro cbg ps +mtt MacroMicro struc tex +mtt MacroMicro dae tex +mtt MacroMicro dm tex +mtt MacroMicro tf tex +mtt MacroMicro numpar txt +mtt MacroMicro lmfr ps +mtt MacroMicro sro ps + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_simpar.txt @@ -0,0 +1,19 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system MacroMicro (MacroMicro_simpar.txt) +# Generated by MTT on Thu Nov 9 15:19:17 GMT 2000. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +FIRST = 0.0; # First time in simulation output +DT = 0.01; # Print interval +LAST = 1.0; # Last time in simulation +STEPFACTOR = 10; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_state.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_state.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_state.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_state.txt @@ -0,0 +1,14 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System MacroMicro, representation state, language txt; +## File MacroMicro_state.txt; +## Generated by MTT on Thu Nov 9 15:19:28 GMT 2000; + + +MacroMicro_k2 = 0.0; # Default +MacroMicro_kt = 0.0; # Default +MacroMicro_m1 = 0.0; # Default +MacroMicro_m2 = 0.0; # Default +MacroMicro_m3 = 0.0; # Default +MacroMicro_p1 = 0.0; # Default ADDED mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_abg.fig @@ -0,0 +1,45 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +0 32 #969296 +0 33 #e7e7cf +0 34 #9e9a9e +0 35 #cf9200 +0 36 #f761ae +0 37 #7171ff +0 38 #595d59 +1 3 0 3 1 7 55 0 -1 0.000 1 0.0000 1845 2430 186 186 1845 2430 2031 2430 +2 2 0 1 1 7 55 0 47 0.000 0 0 -1 0 0 5 + 1800 2475 4500 2475 4500 2925 1800 2925 1800 2475 +2 1 0 3 1 7 55 0 -1 0.000 0 0 -1 0 0 2 + 1830 2467 3180 129 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 5625 4725 5625 4500 5850 +2 1 0 3 1 7 55 0 -1 0.000 0 0 -1 0 0 12 + 4453 2442 4177 1964 3884 2024 4282 1579 3700 1707 4103 1268 + 3521 1396 3914 946 3337 1077 3749 632 3445 696 3158 215 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2925 5625 1575 5625 1800 5850 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 5400 3150 4050 3375 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 7200 3150 5850 3375 6075 +4 1 1 55 0 32 30 0.0000 4 315 240 2385 2295 q\001 +4 0 1 55 0 3 30 0.0000 4 300 270 2025 1260 L\001 +4 0 1 55 0 3 30 0.0000 4 300 270 3105 3510 L\001 +4 1 1 55 0 32 30 0.0000 4 225 195 1530 2250 t\001 +4 1 0 100 0 18 18 0.0000 4 195 150 3150 5715 1\001 +4 1 0 100 0 18 18 0.0000 4 210 390 3195 3915 R:r\001 +4 1 4 100 0 18 18 0.0000 4 270 930 3060 7515 SS:[yu]\001 +4 1 0 100 0 18 18 0.0000 4 270 240 1305 5715 I:j\001 +4 0 0 100 0 18 18 0.0000 4 270 8610 4860 5715 C:k:mtt_e=k*(l^2)*cos(mtt_f/2)*2*(sin(mtt_f/2)-sin(alpha/2))+0*eta\001 +4 0 1 101 0 3 20 0.0000 4 270 3255 4950 675 Rod (length L) hinged at left\001 +4 0 1 101 0 3 20 0.0000 4 270 4275 4950 1125 Spring (stiffness k) unstretched when \001 +4 0 1 101 0 32 20 0.0000 4 210 510 9225 1125 q=a\001 +4 0 1 101 0 3 20 0.0000 4 270 3120 4950 1575 eta is the equilibrium angle\001 ADDED mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_desc.tex @@ -0,0 +1,127 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system NonlinearMSD (NonlinearMSD_desc.tex) +% Generated by MTT on Thu Mar 7 14:48:47 GMT 2002. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 09:13:38 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This example illustrates the use of \textbf{MTT} to \emph{linaerise} a +nonlinear system -- a non-linear mass-spring-damper system called +\textbf{NonlinearMSD}. The model is considered in Section +\ref{sec:model} and linearisation in Section \Ref{sec:linearisation}. + +Further work is suggested in Section \Ref{sec:further}. + +\subsection{Bond Graph model}\label{sec:model} + +The schematic diagram of the system +\textbf{NonlinearMSD} is displayed in Figure +\ref{fig:NonlinearMSD_abg.ps}. The system comprises +\begin{itemize} +\item a rigid foundation, +\item a rod of length $L$ hinged at the left-hand end and +\item a linear spring of stiffness $k$ attached to the rigid + foundation a distance $L$ from the hinge and to the free end of the rod. +\end{itemize} +The spring is unstretched when the rod makes an angle $\theta = \alpa += \frac{pi}{3}$ with the foundation. + +Using elementary geometry, the effectice angular spring generates a +torque $\tau$ given by (\ref{eq:spring}) +\begin{equation}\label{eq:spring} + \tau = -2kl^2 \cos{\frac{\theta}{2}} (\sin{\frac{\theta}{2}}-\sin{\frac{\alpha}{2}}) +\end{equation} + +The acausal bond graph of system \textbf{NonlinearMSD} is also +displayed in Figure \Ref{fig:NonlinearMSD_abg.ps}. This shows the +three bond graph components representing the friction \textbf{R}, the +inertia \textbf{I} and the spring \textbf{C} components. The +non-linear spring characteristic is given explicitly\footnote{The + additional 0*eta term has no effect - it merely introduced the + variable $\eta$ -- the equilibrium angle -- into the model}. + +The (nonlinear) system ordinary differential equation is given by +\textbf{MTT} in Section \Ref{sec:NonlinearMSD_ode.tex}. This is a +special case of the general non-linear ordinary differential equation: +\begin{equation} + \label{eq:non-state} + \begin{cases} + \dot{x} = f(x,u)\\ + y = g(x,u) + \end{cases} +\end{equation} + +\subsection{Linearisation} +\label{sec:linearisation} + +The first step in linearisation is to determine a set of (constant) +states $x_e$ and (constant) inputs $u_e$ so that the system is in +equilibrium - that is +\begin{equation} + \label{eq:eqilibrium} + \dot{x} = f(x_e,u_e) = 0 +\end{equation} + +In this case, choosing an angle $\theta=\eta$ and an input: +\begin{equation}\label{eq:u_e} + u_e = -\tau = 2kl^2 \cos{\frac{\eta}{2}} (\sin{\frac{\eta}{2}}-\sin{\frac{\alpha}{2}}) +\end{equation} +together with zero velocity gives an equilibrium. + +With this choice +The linearised system is given in terms of the $A$, $B$, $C$ and $D$ +matrices appearing in the state equation: +\begin{equation} + \label{eq:state} + \begin{cases} + \dot{x} = Ax + Bu\\ + y = Cx + Du + \end{cases} +\end{equation} + +\textbf{MTT} automatically generates these matrices -- see Section +\Ref{sec:NonlinearMSD_sm.tex}. + +\subsection{Further work} +\label{sec:further} +\begin{enumerate} +\item Derive the system ordinary differential equation appearing in + Section \Ref{sec:NonlinearMSD_ode.tex}. +\item Explain how the input of (\ref{eq:u_e}) gives equilibrium for + all $\eta$. +\item Explain how the elements of the $A$, $B$, $C$ and $D$ appearing + Section \Ref{sec:NonlinearMSD_sm.tex} arise from the ordinary + differential equation of Section \Ref{sec:NonlinearMSD_ode.tex} + together with the input of (\ref{eq:u_e}). +\item Setting up parameters, inputs and initial state as in Sections + \Ref{sec:NonlinearMSD_numpar.tex}, \Ref{sec:NonlinearMSD_input.tex} + and \Ref{sec:NonlinearMSD_state.tex}, perform simulations as in + Section \Ref{sec:NonlinearMSD_state.tex} - the figure shows the + angular \emph{velocity} $\dot{\theta}$. +\item Repeat the simulation with different perturbations by modifying + the file ``NonlinearMSD\_input.tex'' (see Section + \Ref{sec:NonlinearMSD_input.tex}) + \begin{enumerate} + \item note that for smaller perturbations, the graphs are of similar + shape (scaled by the perturbation input) + \item note that for larger perturbations the graphs are quite + different - this is a non-linear system. + \end{enumerate} +\item \label{item:1} Repeat the simulation with different equilibrium angles $\eta$ by modifying + the file ``NonlinearMSD\_numpar.tex'' (see Section + \Ref{sec:NonlinearMSD_numpar.tex}) appropriately. Note that when + $\eta=\pi$, the linearised system is \emph{unstable}. +\item The (2,1) element of the $A$ matrix in Section + \Ref{sec:NonlinearMSD_sm.tex} is the \emph{linearised} stiffness + $k_l$. Plot this against $\eta$ and explain the observation in item + \ref{item:1}. +\end{enumerate} + + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt @@ -0,0 +1,11 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System NonlinearMSD, representation input, language txt; +## File NonlinearMSD_input.txt; +## Generated by MTT on Thu Mar 7 10:50:46 GMT 2002; + +## First term is the equilibrium input; last term is the perturbation input. + +nonlinearmsd__yu = k*(pow(l,2))*cos(eta/2)*2*(sin(eta/2)-sin(alpha/2)) + 1e-2; + ADDED mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_numpar.txt @@ -0,0 +1,15 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System NonlinearMSD, representation numpar, language txt; +## File NonlinearMSD_numpar.txt; +## Generated by MTT on Thu Mar 7 14:03:19 GMT 2002; + + + +alpha = pi/3; # Angle for unstretched string +eta = pi/3; # Equilibrium angle +j = 1.0; # Inertia +k = 1.0; # Spring constant +l = 1.0; # Rod length +r = 1.0; # Rotational resistance ADDED mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt @@ -0,0 +1,33 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system NonlinearMSD (NonlinearMSD_rep.txt) +## Generated by MTT on" Thu Mar 7 14:44:37 GMT 2002. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 11:58:07 peterg +## Put under RCS +## +############################################################### + +mtt NonlinearMSD abg tex # The system description +mtt NonlinearMSD sympar tex # The system parameters +## Uncomment the following lines or add others +## mtt NonlinearMSD dae tex # The system dae +mtt NonlinearMSD ode tex # The system ode +mtt NonlinearMSD sspar tex # Steady-state parameters +mtt NonlinearMSD ss tex # Steady state +## mtt NonlinearMSD dm tex # Descriptor matrices (of linearised system) +mtt NonlinearMSD sm tex # State matrices (of linearised system) +## mtt NonlinearMSD tf tex # Transfer function (of linearised system) +## mtt NonlinearMSD lmfr ps # log modulus of frequency response (of linearised system) +## mtt NonlinearMSD simpar tex # Simulation parameters +mtt NonlinearMSD numpar tex # Numerical simulation parameters +mtt NonlinearMSD state tex # Simulation initial state +mtt NonlinearMSD input tex # Simulation input +## mtt NonlinearMSD logic tex # Logic control +mtt NonlinearMSD odeso ps # Simulation output + +## mtt NonlinearMSD rep txt # This file ADDED mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r Index: mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r +++ mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r @@ -0,0 +1,25 @@ +% Steady-state parameter file (NonlinearMSD_sspar.r) +% Generated by MTT at Thu Mar 7 10:39:15 GMT 2002 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 2000/12/28 09:32:04 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%% This one corresponds to the unstretched spring at theta = pi/3 +%% Note that U is calculated to give equilibrium for all angles + +alpha := pi/3; + +% Steady-state states +MTTX1 := eta; %Initial angle (corresponds to u=0) +MTTX2 := 0; %Initial anglular velocity +% Steady-state inputs +MTTU1 := k*(l^2)*cos(MTTX1/2)*2*(sin(MTTX1/2)-sin(alpha/2)); +;;END; ADDED mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt Index: mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt +++ mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt @@ -0,0 +1,13 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System NonlinearMSD, representation state, language txt; +## File NonlinearMSD_state.txt; +## Generated by MTT on Thu Mar 7 10:50:45 GMT 2002; + + + +## Removed by MTT on Tue Jun 10 16:51:50 BST 2003: NonlinearMSD_j = 0.0; % Initial angular momentum +## Removed by MTT on Tue Jun 10 16:51:50 BST 2003: NonlinearMSD_k = eta; % Initial angle +nonlinearmsd__j = 0.0; # Added by MTT on Tue Jun 10 16:51:52 BST 2003 +nonlinearmsd__k = eta; # initial angle ADDED mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m Index: mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m +++ mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m @@ -0,0 +1,18 @@ +## Plots the effective spring constant. + +p = NonlinearMSD_numpar; # Numerical parameters +s = NonlinearMSD_sympar # Symbolic parameters + +Eta = eta=[0:0.01:1]*pi; K = []; +for eta=Eta + p(s.eta) = eta; # Change the eta parameter + A = NonlinearMSD_sm(p); # SS A matrix + k = -A(2,1); + K = [K k]; +endfor + +grid; +ylabel("k"); +xlabel("eta"); +plot(Eta,K); +figfig("k","eps"); ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_abg.fig @@ -0,0 +1,51 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4050 2925 4050 1575 4275 1800 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 3150 5625 3150 5400 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4950 5625 4950 5400 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2475 3825 2475 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 3150 3825 3150 3600 3375 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 4950 2475 4950 2700 5175 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 2925 2870 1970 2870 2289 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4288 2957 5243 2002 5243 2320 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6525 3150 7875 3150 7650 3375 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 9900 5850 225 5850 225 900 9900 900 9900 5850 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 4050 3825 4050 3600 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4050 5625 4050 5400 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4275 3780 4275 4230 +4 1 1 101 0 3 20 0.0000 4 270 1215 4140 3600 x-velocity\001 +4 1 0 100 0 18 20 0.0000 4 210 165 4050 3240 1\001 +4 1 4 100 0 18 20 0.0000 4 285 1425 1710 3240 SS:[drive]\001 +4 1 1 101 0 3 20 0.0000 4 270 1200 4185 4500 y-velocity\001 +4 1 1 101 0 3 20 0.0000 4 270 2055 4050 5490 angular-velocity\001 +4 1 0 100 0 18 20 0.0000 4 210 165 4050 5040 1\001 +4 1 4 100 0 18 20 0.0000 4 285 870 6165 5040 SS:[a]\001 +4 2 0 100 0 18 20 0.0000 4 300 780 2430 5040 R:r_p\001 +4 1 0 100 0 18 20 0.0000 4 285 765 2835 1845 R:r_c\001 +4 1 4 100 0 18 20 0.0000 4 285 870 4050 1440 SS:[x]\001 +4 1 0 100 0 18 20 0.0000 4 285 795 5355 1845 I:m_c\001 +4 1 0 100 0 18 20 0.0000 4 225 660 6075 3240 INTF\001 +4 0 0 100 0 18 20 0.0000 4 225 1665 8010 3240 De:Position\001 +4 1 0 100 0 18 20 0.0000 4 210 165 4050 4140 1\001 +4 1 4 100 0 18 20 0.0000 4 285 870 6165 4140 SS:[y]\001 +4 2 0 100 0 18 20 0.0000 4 285 2310 2430 4140 Sf:zero_velocity\001 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_lbl.txt @@ -0,0 +1,55 @@ +%% Label file for system Cart (Cart_lbl.txt) +%SUMMARY Cart +%DESCRIPTION Simple cart model + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 18:00:45 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in drive +%ALIAS pendulum|out x,y,a +%UNITS drive translational N m/s +b%UNITS x translational N m/s +%UNITS y translational N m/s +%UNITS a rotational N*m radian/s + + +% Argument aliases +%ALIAS $1 m_c + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type I + m_c lin flow,m_c + +% Component type R + r_c lin flow,r_c + r_p lin flow,r_p + +% Component type SS + [a] SS external,external + [drive] SS external,external + [x] SS external,external + [y] SS external,external + +% Component type De + Position SS external + +% Component type Sf + zero_velocity SS 0 + + + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_abg.fig @@ -0,0 +1,28 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3780 4005 3870 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3825 4050 3825 4500 +-6 +1 4 0 2 1 7 51 0 -1 0.000 1 0.0000 3700 4909 203 203 3497 4909 3903 4909 +1 4 0 2 1 7 51 0 -1 0.000 1 0.0000 4817 4902 203 203 4614 4902 5020 4902 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2475 4275 3825 4275 3600 4500 +2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 + 5175 4725 3375 4725 3375 3825 5175 3825 5175 4725 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4275 4050 5230 3095 5230 3414 +2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 5 + 4477 3712 5872 2317 6052 2497 4702 3847 4522 3667 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 6750 5400 1125 5400 1125 2025 6750 2025 6750 5400 +4 1 0 100 0 18 20 0.0000 4 210 570 4275 4365 Cart\001 +4 1 0 100 0 18 20 0.0000 4 270 840 2070 4365 SS:[F]\001 +4 1 0 100 0 18 20 0.0000 4 210 2445 5355 3060 InvertedPendulum\001 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_desc.tex @@ -0,0 +1,21 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system InvertedPendulumOnCart (InvertedPendulumOnCart_desc.tex) +% Generated by MTT on Thu Aug 5 10:38:16 BST 1999. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{InvertedPendulumOnCart} is + displayed in Figure \Ref{fig:InvertedPendulumOnCart_abg.ps} and its label + file is listed in Section \Ref{sec:InvertedPendulumOnCart_lbl}. + The subsystems are listed in Section \Ref{sec:InvertedPendulumOnCart_sub}. + +This is a one input, two output nonlinear system comprising an +inverted pendulum attached by a hinge to a cart constrained to move in +the horizontal direction. The input is the horizontal force acting on +the cart, and the two outputs are the horizontal position and the +pendulum angle respectively. ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_input.txt @@ -0,0 +1,10 @@ +## -*-octave-*- Put Emacs into octave-mode ## + +## +## System InvertedPendulumOnCart, representation input, language txt; +## File idInvertedPendulumOnCart_input.txt; +## Generated by MTT on Thu Apr 5 15:27:30 BST 2001; + + + +InvertedPendulumOnCart_f = 1.0*(t<1); # Force for 1 sec ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_lbl.txt @@ -0,0 +1,34 @@ +%% Label file for system InvertedPendulumOnCart (InvertedPendulumOnCart_lbl.txt) +%SUMMARY InvertedPendulumOnCart +%DESCRIPTION An Inverted Pendulum on a Cart + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 18:00:45 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in F +%UNITS F translational N m/s + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type SS + [F] SS external,internal + + + + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_numpar.txt @@ -0,0 +1,27 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (InvertedPendulumOnCart_numpar.txt) +# Generated by MTT at Thu Aug 5 10:07:08 BST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: e_s = 1.0; # Se +## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: f_s = 1.0; # Sf +g = 1.0; # Pendulum,gRODa +## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: j_m = 1.0; # gRODa +j_r = 1.0; # Pendulum +l = 1.0; # Pendulum +## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: l_a = 1.0; # gRODa +## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: l_b = 1.0; # gRODa +## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: m = 1.0; # gRODa +## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: m_c = 1.0; # Cart +## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: m_r = 1.0; # Pendulum +r_c = 0.1; # Cart +r_p = 0.1; # Cart +m_c = 1.0; # Added by MTT on Thu Nov 09 17:22:55 GMT 2000 +m_r = 1.0; # Added by MTT on Thu Nov 09 17:22:55 GMT 2000 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_rep.txt @@ -0,0 +1,30 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system InvertedPendulumOnCart (InvertedPendulumOnCart_rep.txt) +## Generated by MTT on" Fri Oct 22 09:03:14 EST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 18:00:45 peterg +## To RCS +## +############################################################### + +mtt InvertedPendulumOnCart abg tex # The system description +mtt InvertedPendulumOnCart cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt InvertedPendulumOnCart struc tex # The system structure +mtt InvertedPendulumOnCart dae tex # The system dae +## mtt InvertedPendulumOnCart ode tex # The system ode +## mtt InvertedPendulumOnCart sspar tex # Steady-state parameters +## mtt InvertedPendulumOnCart ss tex # Steady state +## mtt InvertedPendulumOnCart dm tex # Descriptor matrices (of linearised system) +## mtt InvertedPendulumOnCart dm tex # State matrices (of linearised system) +## mtt InvertedPendulumOnCart tf tex # Transfer function (of linearised system) +## mtt InvertedPendulumOnCart lmfr ps # log modulus of frequency response (of linearised system) +## mtt InvertedPendulumOnCart simpar tex # Simulation parameters +## mtt InvertedPendulumOnCart numpar tex # Numerical simulation parameters +## mtt InvertedPendulumOnCart input tex # Simulation input +## mtt InvertedPendulumOnCart odeso ps # Simulation output ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system InvertedPendulumOnCart (InvertedPendulumOnCart_simpar.txt) +# Generated by MTT on Thu Aug 5 09:17:05 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 100.0; # Last time in simulation +DT = 0.1; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_subs.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_subs.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_subs.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_subs.r @@ -0,0 +1,27 @@ +% Default SUBS file +% File InvertedPendulumOnCart_subs.r +% Generated by MTT on Thu Nov 9 18:55:44 GMT 2000. + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2001/04/02 10:57:57 gawthrop +% %% Added missing ; +% %% +% %% Revision 1.1 2000/12/28 18:00:45 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Put algebraic substitution commands here + +for all x let cos(x)^2+sin(x)^2 = 1; + +FOR ALL x,y LET x^y = pow(x,y); % Use the pow function + +ON ROUNDED; % No integer output + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_abg.fig @@ -0,0 +1,50 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3780 3105 6345 4545 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 3150 4950 4500 5175 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 3150 6075 4500 6300 4275 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 3150 3825 4500 4050 4275 +-6 +6 3780 5355 6345 6795 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4950 5400 4950 6750 5175 6525 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6075 5400 6075 6750 6300 6525 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3825 5400 3825 6750 4050 6525 +-6 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 6840 4950 8190 4950 7965 5175 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 9675 7425 3150 7425 3150 2475 9675 2475 9675 7425 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 4050 6750 3600 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5175 6750 4725 6750 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 6300 5400 5850 5400 +4 1 4 100 0 18 20 0.0000 4 285 870 3825 7065 SS:[x]\001 +4 1 4 100 0 18 20 0.0000 4 285 870 4950 7065 SS:[y]\001 +4 1 4 100 0 18 20 0.0000 4 285 870 6075 7065 SS:[a]\001 +4 1 0 100 0 18 20 0.0000 4 285 1590 4964 5040 gRODa:rod\001 +4 1 0 100 0 18 20 0.0000 4 285 960 3825 3015 Se:x_0\001 +4 1 0 100 0 18 20 0.0000 4 285 960 4950 3015 Se:y_0\001 +4 1 0 100 0 18 20 0.0000 4 285 960 6030 3015 Se:a_0\001 +4 1 4 100 0 18 14 0.0000 4 195 270 6660 4995 [a]\001 +4 1 0 100 0 18 20 0.0000 4 225 1200 8865 5040 De:theta\001 +4 1 4 100 0 18 14 0.0000 4 195 510 3825 4725 [x_a]\001 +4 1 4 100 0 18 14 0.0000 4 195 510 4950 4725 [y_a]\001 +4 1 4 100 0 18 14 0.0000 4 195 510 6075 4725 [a_a]\001 +4 1 4 100 0 18 14 0.0000 4 195 525 3825 5265 [x_b]\001 +4 1 4 100 0 18 14 0.0000 4 195 525 4950 5265 [y_b]\001 +4 1 4 100 0 18 14 0.0000 4 195 525 6075 5265 [a_b]\001 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_lbl.txt @@ -0,0 +1,49 @@ +%% Label file for system InvertedPendulum (InvertedPendulum_lbl.txt) +%SUMMARY InvertedPendulum +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 18:00:45 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%UNITS x translational N m/s +%UNITS y translational N m/s +%UNITS a rotational N*m radian/s + + +%ALIAS in|cart x,y,a + + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type De + theta SS external + +% Component type SS + [a] SS external,external + [x] SS external,external + [y] SS external,external + +% Component type Se + a_0 SS 0 + x_0 SS 0 + y_0 SS 0 + +% Component type gRod + rod none l;l;j_r;m_r;g + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_abg.fig @@ -0,0 +1,51 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3017 1577 3287 1577 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5269 1579 5539 1579 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 1577 3152 3152 3377 2927 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4142 3152 4412 3152 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4277 1577 4277 3152 4502 2927 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5402 1577 5402 3152 5627 2927 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3019 4279 3289 4279 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4144 4279 4414 4279 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5271 4281 5541 4281 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4277 4277 4277 5852 4502 5627 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5402 4277 5402 5852 5627 5627 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 7200 2250 7200 675 1575 675 1575 2250 7200 2250 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 7200 4500 7200 2925 1575 2925 1575 4500 7200 4500 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 7200 6750 7200 5175 1575 5175 1575 6750 7200 6750 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3150 4299 3150 5874 3375 5649 +4 1 -1 0 0 0 20 0.0000000 4 240 870 3152 1397 SS:v_x\001 +4 1 -1 0 0 0 20 0.0000000 4 240 810 4277 1397 SS:f_a\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1110 4278 3828 ROD:rod\001 +4 1 -1 0 0 0 20 0.0000000 4 240 885 3155 6305 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000000 4 240 870 4280 6305 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000000 4 270 885 5450 6305 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000000 4 270 1920 5986 1396 ACCEL:gravity\001 +4 1 1 1 0 3 20 0.0000000 4 240 1245 7965 1440 Fixed end\001 +4 1 1 1 0 3 20 0.0000000 4 240 1110 7920 6075 Free end\001 +4 1 1 1 0 3 20 0.0000000 4 270 1755 8280 3735 Rod dynamics\001 +4 1 4 0 0 0 16 0.0000000 4 195 495 3152 3467 [x_a]\001 +4 1 4 0 0 0 16 0.0000000 4 210 885 4277 3467 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000000 4 210 495 5402 3467 [y_a]\001 +4 1 4 0 0 0 16 0.0000000 4 195 510 3154 4144 [x_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 900 4280 4145 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 510 5406 4146 [y_b]\001 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_desc.tex @@ -0,0 +1,25 @@ +% Verbal description for system Pendulum (Pendulum_desc.tex) +% Generated by MTT on Fri Aug 15 09:52:55 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Pendulum} is + displayed in Figure \Ref{Pendulum_abg} and its label + file is listed in Section \Ref{sec:Pendulum_lbl}. + The subsystems are listed in Section \Ref{sec:Pendulum_sub}. + +This is a heirachical version of the example from Section 10.3 of +``Metamodelling''. It uses two compound components: {\bf ROD} and {\bf +GRAV}. {\bf ROD} is +essentially as described in Figure 10.2 {\bf GRAV} represents gravity by a +vertical accelleration as in Section 10.9 of "Metamodelling". + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_input.txt @@ -0,0 +1,22 @@ +# -*-octave-*- Put Emacs into octave-mode' +# Numerical parameter file (Pendulum_input.txt) +# Generated by MTT at Fri Aug 15 09:02:02 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.2 1998/07/27 11:27:05 peterg +# %% Reformatted +# %% +# Revision 1.1 1997/08/15 08:04:01 peterg +# Initial revision +# +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Tue Jun 10 17:17:50 BST 2003: u(1) = 0.0; # no torque at joint +## Removed by MTT on Tue Jun 10 17:17:50 BST 2003: u(2) = 9.81; # g +pendulum__f_a = 0.0; # No joint torque +pendulum__gravity__force = 9.81; # g ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_lbl.txt @@ -0,0 +1,50 @@ +%SUMMARY Pendulum: Pendulum example from Section 10.3 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.3 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling". + +%ALIAS ACCEL Mechanical-2D/ACCEL # Constant acceleration +%% Label file for system pend (pend_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1997/08/15 09:46:22 peterg +% %% New labeled ports version +% %% +% Revision 1.1 1996/11/09 18:44:58 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters +rod none l;l;j;m + +%Zero velocity sources +v_x SS internal,0 + +%Zero force/torque sources +F_x SS 0,internal +F_y SS 0,internal +F_a SS 0,internal + +%Torque at end +f_a SS external,external + +%Gravity +gravity + + + + + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_numpar.txt @@ -0,0 +1,15 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (Pendulum_numpar.txt) +# Generated by MTT at Mon Jul 27 12:38:25 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +l = 1.0; # Pendulum +m = 1.0; # Pendulum +j = m*l*l/12.0; # Pendulum ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_rep.txt @@ -0,0 +1,24 @@ +# Outline report file for system Pendulum (Pendulum_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/05/19 17:34:30 peterg +% %% Put in -c +% %% +% %% Revision 1.1 1999/02/22 09:17:59 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt Pendulum abg tex +mtt Pendulum struc tex +mtt Pendulum dae tex +mtt Pendulum cse tex +## mtt Pendulum rfe tex +mtt Pendulum ode tex +mtt Pendulum input txt +mtt Pendulum numpar txt +mtt Pendulum odeso ps ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_simpar.txt @@ -0,0 +1,23 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system Pendulum (Pendulum_simpar.txt) +# Generated by MTT on Mon Jul 27 12:27:43 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1999/12/23 20:16:47 peterg +## Removed MTHOD +## +## Revision 1.2 1999/02/22 10:08:05 peterg +## +## +## Revision 1.1 1998/07/27 11:29:13 peterg +## Initial revision +## +############################################################### + + +LAST=10.0; # Last time in simulation +DT=0.1; # Print interval +STEPFACTOR=10; # Integration steps per print interval ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_state.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_state.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_state.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_state.txt @@ -0,0 +1,21 @@ +# -*-octave-*- Put Emacs into octave-mode +# Initial state file (Pendulum_state.txt) +# Generated by MTT at Mon Jul 27 12:34:12 BST 1998 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/07/27 11:41:39 peterg +## Initial revision +## +############################################################### + +# Set the states +## Removed by MTT on Tue Jun 10 17:16:38 BST 2003: mttx(1) = 0.0; # J (Pendulum_rod) +## Removed by MTT on Tue Jun 10 17:16:38 BST 2003: mttx(2) = pi/4; # 3 (Pendulum_rod_th) +## Removed by MTT on Tue Jun 10 17:16:38 BST 2003: mttx(3) = 0.0; # 2 (Pendulum_gravity) +pendulum__gravity__mtti = 0.0; +pendulum__rod__j = 0.0; +pendulum__rod__th__mttc = pi/4; + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_subs.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_subs.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_subs.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_subs.r @@ -0,0 +1,17 @@ +%% Reduce comands to sunstitute in system Pendulum (Pendulum_subs.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_abg.fig @@ -0,0 +1,88 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.0000000 1 0.000 8550 1125 485 485 8550 1125 8730 1575 +1 3 0 2 1 7 1 0 -1 0.0000000 1 0.000 8550 5625 485 485 8550 5625 9035 6110 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3468 1128 3738 1128 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4593 2703 4863 2703 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 1128 4728 2703 4953 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4502 5492 4502 5762 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5627 4502 5627 4277 5852 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 7426 4951 7201 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3472 8647 3742 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4597 8647 4867 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5724 8649 5994 8649 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4730 8645 4730 10220 4955 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5855 8645 5855 10220 6080 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3826 3601 7426 3826 7201 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3826 5851 7426 6076 7201 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 11475 9450 225 180 225 180 11475 9450 11475 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 8622 3600 10197 3825 9972 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 7650 450 9405 450 9405 675 7650 675 7650 450 +4 1 -1 0 0 0 20 0.0000000 4 240 870 3603 948 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000000 4 210 150 4683 5718 0\001 +4 1 -1 0 0 0 20 0.0000000 4 240 960 2432 5717 SS:f_a2\001 +4 1 -1 0 0 0 20 0.0000000 4 240 885 3608 10673 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000000 4 240 870 4733 10673 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000000 4 270 885 5903 10673 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1260 4729 3379 ROD:rod1\001 +4 1 -1 0 0 0 20 0.0000000 4 210 1260 4731 8196 ROD:rod2\001 +4 1 -1 0 0 0 20 0.0000000 4 240 960 4771 946 SS:f_a1\001 +4 0 1 1 0 3 20 0.0000000 4 240 810 6795 3375 Link 1\001 +4 0 1 1 0 3 20 0.0000000 4 240 870 6750 5760 Joint 2\001 +4 0 1 1 0 3 20 0.0000000 4 240 810 6750 8190 Link 2\001 +4 0 1 1 0 3 20 0.0000000 4 270 420 6750 10485 Tip\001 +4 0 1 1 0 3 20 0.0000000 4 240 870 6750 1260 Joint 1\001 +4 1 4 0 0 0 16 0.0000000 4 195 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000000 4 210 885 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000000 4 195 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 900 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 495 5850 2970 [y_a]\001 +4 1 4 0 0 0 16 0.0000000 4 195 495 3605 7835 [x_a]\001 +4 1 4 0 0 0 16 0.0000000 4 210 885 4730 7835 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000000 4 210 495 5855 7835 [y_a]\001 +4 1 4 0 0 0 16 0.0000000 4 195 510 3607 8512 [x_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 900 4733 8513 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000000 4 210 510 5859 8514 [y_b]\001 +4 1 -1 0 0 0 20 0.0000000 4 270 870 5850 945 SS:v_y\001 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_desc.tex @@ -0,0 +1,42 @@ +% Verbal description for system TwoLink (TwoLink_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/19 14:20:07 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLink} is + displayed in Figure \Ref{TwoLink_abg} and its label + file is listed in Section \Ref{sec:TwoLink_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLink_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses the compound components: {\bf ROD}. {\bf +ROD} is essentially as described in Figure 10.2. +There is no gravity included in this model. + +This system has a number of dynamic elements (those corresponding to +translation motion) in derivative causality, thus the system is +represnted as a Differential-Algebraic Equation (Section +\Ref{sec:TwoLink_dae.tex}). Hovever, this is of contrained-state form +and therfore can be written as a set of constrained-state equations +(Section \Ref{sec:TwoLink_cse.tex}). The corresponding ordinary +differential equation is complicated due to the trig functions +involved in inverting the E matrix. + +As well as the standard representation the ``robot-form'' equations +appear in Section \Ref{sec:TwoLink_rfe}. + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_input.txt @@ -0,0 +1,20 @@ +# Numerical parameter file (TwoLink_input.txt) +# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 1998/07/27 10:44:59 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Tue Jun 10 17:24:08 BST 2003: u(1) = (t<1.0); # Torque on Joint 1 +## Removed by MTT on Tue Jun 10 17:24:08 BST 2003: u(2) = -(t>10.0)&&(t<11.0); # Torque on Joint 2 +## Removed by MTT on Tue Jun 10 17:24:08 BST 2003: u(3) = 0.0; # Gravity +twolink__f_a1 = (t<1.0); # Torque on Joint 1 +twolink__f_a2 = -(t>10.0)&&(t<11.0); # Torque on Joint 2 + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_lbl.txt @@ -0,0 +1,55 @@ +%SUMMARY TwoLink: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (TwoLink_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/07/27 10:45:22 peterg +% %% Initial revision +% %% +% %% Revision 1.2 1996/12/05 12:39:49 peterg +% %% Documentation +% %% +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - uniform rods +rod1 none l_1;l_1;j_1;m_1 +rod2 none l_2;l_2;j_2;m_2 + +%Zero velocity sources +v_x SS internal,0 +v_y SS internal,0 + + +%Zero force/torque sources +F_x SS 0,internal +F_a SS 0,internal +F_y SS 0,internal + + +%Torque/velocity at joints +f_a1 SS external,external +f_a2 SS external,external + + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_numpar.txt @@ -0,0 +1,18 @@ +# Numerical parameter file (TwoLink_numpar.txt) +# Generated by MTT at Mon Jan 19 13:53:15 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +j_1 = 1.0; # Parameter j_1 for TwoLink +j_2 = 1.0; # Parameter j_2 for TwoLink +l_1 = 1.0; # Parameter l_1 for TwoLink +l_2 = 1.0; # Parameter l_2 for TwoLink +m_1 = 1.0; # Parameter m_1 for TwoLink +m_2 = 1.0; # Parameter m_2 for TwoLink + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_rep.txt @@ -0,0 +1,32 @@ +# Outline report file for system TwoLink (TwoLink_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.4 2000/05/19 17:35:34 peterg +% %% -c +% %% +% %% Revision 1.3 1999/02/22 09:18:33 peterg +% %% Removed -c +% %% +% %% Revision 1.2 1998/01/19 14:21:21 peterg +% %% Removed ordinary differential equation representation - its to +% %% verbose. +% %% +% %% Revision 1.1 1998/01/19 14:15:52 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt TwoLink abg tex +mtt TwoLink struc tex +mtt TwoLink sympar tex +mtt TwoLink dae tex +mtt TwoLink cse tex +## mtt TwoLink rfe tex + +mtt TwoLink input txt +mtt TwoLink numpar txt +mtt -i euler TwoLink odeso ps ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simp.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simp.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simp.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simp.r @@ -0,0 +1,11 @@ +%% Reduce comands to simplify output for system TwoLink (TwoLink_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simpar.txt @@ -0,0 +1,24 @@ +# Simulation parameters for system TwoLink (TwoLink_simpar.txt) +# Generated by MTT on Mon Jul 27 08:16:50 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ + +## Revision 1.3 1999/02/22 10:07:24 peterg +## Step facttor 10 +## +## Revision 1.2 1999/02/22 10:06:13 peterg +## +## Revision 1.1 1998/07/27 10:46:30 peterg +## Initial revision +## +############################################################### + + +LAST=50.0; +DT=0.1; +STEPFACTOR=10; + + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_subs.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_subs.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_subs.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_subs.r @@ -0,0 +1,20 @@ +%% Reduce substitution statements for system TwoLink (TwoLink_subs.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/03/22 20:12:51 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_desc.tex @@ -0,0 +1,25 @@ +% Verbal description for system twolink (twolink_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{twolink} is + displayed in Figure \Ref{twolink_abg} and its label + file is listed in Section \Ref{sec:twolink_lbl}. + The subsystems are listed in Section \Ref{sec:twolink_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses two compound components: {\bf ROD} and {\bf +GRAV}. {\bf ROD} is essentially as described in Figure 10.2 {\bf +GRAV} represents gravity by a vertical accelleration as in Section +10.9 of "Metamodelling" + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_lbl.txt @@ -0,0 +1,50 @@ +%SUMMARY twolink: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (twolink_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - identical rods +rod1 none l;l;j;m +rod2 none l;l;j;m + +%Zero velocity sources +v_x internal 0 + + +%Zero force/torque sources +F_x 0 internal +F_a 0 internal +F_y 0 internal + + +%Torque at joints +f_a1 external external +f_a2 external external + + +%Gravity +g ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_params.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_params.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_params.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_params.r @@ -0,0 +1,24 @@ +%% Parameter file for system twolink (twolink_params.r) +%% This file provides symbolic parameters for simplification + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Useful trig simplifications + + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +% Some simplifications -- see book +j := m*l*l/3; + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_rep.txt @@ -0,0 +1,19 @@ +%% Outline report file for system twolink (twolink_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +abg tex +struc tex +dae tex +csm tex +sro ps +lmfr ps +odeso ps +input txt +numpar txt + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_simp.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_simp.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_simp.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_simp.r @@ -0,0 +1,14 @@ +%% Reduce comands to simplify output for system twolink (twolink_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%simplify the output equations +% Joint angles +mttx2 := theta_1; +mttx4 := theta_1 + theta_2; +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_abg.fig @@ -0,0 +1,86 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3468 1128 3738 1128 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4593 2703 4863 2703 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 1128 4728 2703 4953 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4502 5492 4502 5762 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5627 4502 5627 4277 5852 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 7426 4951 7201 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3472 8647 3742 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4597 8647 4867 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5724 8649 5994 8649 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4730 8645 4730 10220 4955 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5855 8645 5855 10220 6080 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3826 3601 7426 3826 7201 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3826 5851 7426 6076 7201 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 11475 9450 225 180 225 180 11475 9450 11475 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 8622 3600 10197 3825 9972 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 +4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 900 2432 5717 SS:f_a2\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000 4 195 1200 4729 3379 ROD:rod1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1200 4731 8196 ROD:rod2\001 +4 1 -1 0 0 0 20 0.0000 4 255 900 4771 946 SS:f_a1\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 +4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 1170 5850 945 ACCEL:g\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_desc.tex @@ -0,0 +1,31 @@ +% Verbal description for system TwoLinkxyc (TwoLinkxyc_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLinkxyc} is + displayed in Figure \Ref{TwoLinkxyc_abg} and its label + file is listed in Section \Ref{sec:TwoLinkxyc_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLinkxyc_sub}. + +This system is identical to \textbf{twolink} except that the two +colocated {\bf SS} components act at the tip in the $x$ and $y$ +directions instead of at the two joints. + +It uses two compound components: {\bf ROD} and {\bf GRAV}. {\bf ROD} +is essentially as described in Figure 10.2 of "Metamodelling" and {\bf +GRAV} represents gravity by a vertical acceleration as in Section +10.9 of "Metamodelling" + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_input.txt @@ -0,0 +1,20 @@ +# Numerical parameter file (TwoLinkxyc_input.txt) +# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:02:44 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Wed Jun 11 14:02:21 BST 2003: u(1) = (t<1.0); +## Removed by MTT on Wed Jun 11 14:02:21 BST 2003: u(2) = 0.0; # +## Removed by MTT on Wed Jun 11 14:02:21 BST 2003: u(3) = 0.0; # gravity +twolinkxyc__f_x = (t<1.0); +twolinkxyc__f_y = 0.0; +twolinkxyc__g__force = 0.0; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_lbl.txt @@ -0,0 +1,51 @@ +%SUMMARY TwoLinkxyc: two-link manipulator with collocated tip source-sensors. +%DESCRIPTION This is related to a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" +%DESCRIPTION except that the collocated source-sensors act at the +%DESCRIPTION tip rather than at the joints. + +%% Label (TwoLinkxyc_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/06 15:56:31 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - identical rods +rod1 none l;l;j;m;mg +rod2 none l;l;j;m;mg + +%Zero velocity sources +v_x SS internal,0 + + +%Zero force/torque sources +F_a SS 0,internal + + +%Torque at joints +f_a1 SS 0,internal +f_a2 SS 0,internal + +%Forces at tip +F_x SS external,external +F_y SS external,external + + +%Gravity +g + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_numpar.txt @@ -0,0 +1,21 @@ +# Numerical parameter file (TwoLinkxyc_numpar.txt) +# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.2 2000/05/20 15:44:26 peterg +# %% Split from old numpar file +# %% +# %% Revision 1.1 2000/05/20 15:43:27 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +l = 1.0; # Default value +m = 1.0; # Default value +j = m*l*l/12.0; # Uniform rod +mg = m*9.81; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_rep.txt @@ -0,0 +1,19 @@ +# Outline report file for system TwoLinkxyc (TwoLinkxyc_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 18:02:44 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt TwoLinkxyc abg tex +mtt TwoLinkxyc struc tex +mtt TwoLinkxyc dae tex +mtt TwoLinkxyc cse tex +mtt TwoLinkxyc input txt +mtt TwoLinkxyc numpar txt +mtt -i euler TwoLinkxyc odeso ps ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simp.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simp.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simp.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simp.r @@ -0,0 +1,17 @@ +%% Reduce comands to simplify output for system TwoLinkxyc (TwoLinkxyc_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simpar.txt @@ -0,0 +1,21 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system TwoLinkxyc (TwoLinkxyc_simpar.txt) +# Generated by MTT on Mon Feb 22 09:44:37 GMT 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1999/02/22 10:09:34 peterg +## Initial revision +## +############################################################### + + +LAST = 10.0; # Last time in simulation +DT = 0.1; # Print interval +STEPFACTOR = 10; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_sspar.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_sspar.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_sspar.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_sspar.r @@ -0,0 +1,10 @@ +%% Reduce steady-state parameter file for TwoLinkxyc (TwoLinkxyc_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_state.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_state.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_state.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_state.txt @@ -0,0 +1,24 @@ +# State initialisation file file (TwoLinkxyc_numpar.txt) +# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/05/20 15:44:48 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Initial states +## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(1) = 0.0; # Initial state for TwoLinkxyc_rod1 (J) +## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(2) = 0.0; # Initial state for TwoLinkxyc_rod1_th (3) +## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(3) = 0.0; # Initial state for TwoLinkxyc_rod2 (J) +## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(4) = 3.142/4; # Initial state for TwoLinkxyc_rod2_th (3) - 45 deg. +## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(5) = 0.0; # Initial state for TwoLinkxyc_g (2) +twolinkxyc__g__mtti = 0.0; +twolinkxyc__rod1__j = 0.0; +twolinkxyc__rod1__th__mttc = 0.0; +twolinkxyc__rod2__j = 0.0; +twolinkxyc__rod2__th__mttc = 3.142/4; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_abg.fig @@ -0,0 +1,86 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3468 1128 3738 1128 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4593 2703 4863 2703 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 1128 4728 2703 4953 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4502 5492 4502 5762 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5627 4502 5627 4277 5852 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 7426 4951 7201 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3472 8647 3742 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4597 8647 4867 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5724 8649 5994 8649 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4730 8645 4730 10220 4955 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5855 8645 5855 10220 6080 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3826 3601 7426 3826 7201 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3826 5851 7426 6076 7201 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 11475 9450 225 180 225 180 11475 9450 11475 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 8622 3600 10197 3825 9972 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 +4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 900 2432 5717 SS:f_a2\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000 4 195 1200 4729 3379 ROD:rod1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1200 4731 8196 ROD:rod2\001 +4 1 -1 0 0 0 20 0.0000 4 255 900 4771 946 SS:f_a1\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 +4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 1170 5850 945 ACCEL:g\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_desc.tex @@ -0,0 +1,31 @@ +% Verbal description for system TwoLinkxyn (TwoLinkxyn_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1998/01/06 17:36:33 peterg +% Initial revision +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TwoLinkxyn} is + displayed in Figure \Ref{TwoLinkxyn_abg} and its label + file is listed in Section \Ref{sec:TwoLinkxyn_lbl}. + The subsystems are listed in Section \Ref{sec:TwoLinkxyn_sub}. + +This system is identical to \textbf{twolink} except that there are +now two non-collocated input-output pairs: The torque input to joint 1 +-- x velocity of the tip and the torque input to joint 2 +-- y velocity of the tip. + +It uses two compound components: {\bf ROD} and {\bf GRAV}. {\bf ROD} +is essentially as described in Figure 10.2 of "Metamodelling" and {\bf +GRAV} represents gravity by a vertical acceleration as in Section +10.9 of "Metamodelling" + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_input.txt @@ -0,0 +1,20 @@ +# Numerical parameter file (TwoLinkxyn_input.txt) +# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:03:12 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Wed Jun 11 14:14:40 BST 2003: u(1) = (t<1.0); +## Removed by MTT on Wed Jun 11 14:14:40 BST 2003: u(2) = 0.0; # +## Removed by MTT on Wed Jun 11 14:14:40 BST 2003: u(3) = 0.0; # gravity +twolinkxyn__f_a1 = (t<1.0); +twolinkxyn__f_a2 = 0.0; +twolinkxyn__g__force = 0.0; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_lbl.txt @@ -0,0 +1,51 @@ +%SUMMARY TwoLinkxyn: two-link manipulator with collocated tip source-sensors. +%DESCRIPTION This is related to a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" +%DESCRIPTION except that the source sensors are not collocated: +%DESCRIPTION sources at the joints, sensors at the xy motion of the tip. + +%% Label (TwoLinkxyn_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/06 17:37:55 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - identical rods +rod1 none l;l;j;m;mg +rod2 none l;l;j;m;mg + +%Zero velocity sources +v_x SS internal,0 + + +%Zero force/torque sources +F_a SS 0,internal + + +%Torque at joints +f_a1 SS external,internal +f_a2 SS external,internal + +%Forces at tip +F_x SS 0,external +F_y SS 0,external + + +%Gravity +g + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_numpar.txt @@ -0,0 +1,19 @@ +# Numerical parameter file (TwoLinkxyn_numpar.txt) +# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/05/20 15:50:31 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +l = 1.0; # Default value +m = 1.0; # Default value +j = m*l*l/12.0; # Uniform rod +mg = m*9.81; + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_rep.txt @@ -0,0 +1,24 @@ +# Outline report file for system TwoLinkxyn (TwoLinkxyn_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/05/19 17:36:55 peterg +% %% -c +% %% +% %% Revision 1.1 1999/02/22 10:01:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt TwoLinkxyn abg tex +mtt TwoLinkxyn struc tex +mtt TwoLinkxyn dae tex +mtt TwoLinkxyn cse tex +##mtt TwoLinkxyn rfe tex +##mtt TwoLinkxyn ode tex +mtt TwoLinkxyn input txt +mtt TwoLinkxyn numpar txt +mtt -i euler TwoLinkxyn odeso ps ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simp.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simp.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simp.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simp.r @@ -0,0 +1,17 @@ +%% Reduce comands to simplify output for system TwoLinkxyn (TwoLinkxyn_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system TwoLinkxyn (TwoLinkxyn_simpar.txt) +# Generated by MTT on Mon Feb 22 09:53:04 GMT 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 10.0; # Last time in simulation +DT = 0.1; # Print interval +STEPFACTOR = 10; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_sspar.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_sspar.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_sspar.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_sspar.r @@ -0,0 +1,10 @@ +%% Reduce steady-state parameter file for TwoLinkxyn (TwoLinkxyn_sspar.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_state.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_state.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_state.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_state.txt @@ -0,0 +1,25 @@ +# State file (TwoLinkxyn_state.txt) +# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/05/20 15:50:57 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Initial states +## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(1) = 0.0; # Initial state for TwoLinkxyn_rod1 (J) +## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(2) = 0.0; # Initial state for TwoLinkxyn_rod1_th (3) +## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(3) = 0.0; # Initial state for TwoLinkxyn_rod2 (J) +## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(4) = 3.142/4; # Initial state for TwoLinkxyn_rod2_th (3) - 45 deg. +## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(5) = 0.0; # Initial state for TwoLinkxyn_g (2) +twolinkxyn__g__mtti = 0.0; +twolinkxyn__rod1__j = 0.0; +twolinkxyn__rod1__th__mttc = 0.0; +twolinkxyn__rod2__j = 0.0; +twolinkxyn__rod2__th__mttc = 3.142/4; + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_abg.fig Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_abg.fig ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_abg.fig +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_abg.fig @@ -0,0 +1,86 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3468 1128 3738 1128 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5720 1130 5990 1130 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4593 2703 4863 2703 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4728 1128 4728 2703 4953 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4502 5492 4502 5762 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2927 5627 4502 5627 4277 5852 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 5851 4726 7426 4951 7201 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3472 8647 3742 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4597 8647 4867 8647 +2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5724 8649 5994 8649 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4730 8645 4730 10220 4955 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5855 8645 5855 10220 6080 9995 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3601 3826 3601 7426 3826 7201 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5851 3826 5851 7426 6076 7201 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 2025 6525 450 2925 450 2925 2025 6525 2025 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 11475 9450 225 180 225 180 11475 9450 11475 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3603 1128 3603 2703 3828 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5853 1128 5853 2703 6078 2478 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4726 3826 4726 5401 4951 5176 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 8622 3600 10197 3825 9972 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 +2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 +4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 +4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 900 2432 5717 SS:f_a2\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 +4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 +4 1 -1 0 0 0 20 0.0000 4 195 1200 4729 3379 ROD:rod1\001 +4 1 -1 0 0 0 20 0.0000 4 195 1200 4731 8196 ROD:rod2\001 +4 1 -1 0 0 0 20 0.0000 4 255 900 4771 946 SS:f_a1\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 +4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 +4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 +4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 1170 5850 945 ACCEL:g\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 +4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 +4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 +4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_desc.tex @@ -0,0 +1,43 @@ +% Verbal description for system gTwoLink (gTwoLink_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/01/19 14:20:07 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/08/15 13:31:00 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{gTwoLink} is + displayed in Figure \Ref{gTwoLink_abg} and its label + file is listed in Section \Ref{sec:gTwoLink_lbl}. + The subsystems are listed in Section \Ref{sec:gTwoLink_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses the compound components: {\bf ROD}. {\bf +ROD} is essentially as described in Figure 10.2. +Gravity is included as discussed in "Metamodelling" by accelerating +the manipulator vertically using the {\bf ACCEL} component. + +This system has a number of dynamic elements (those corresponding to +translation motion) in derivative causality, thus the system is +represnted as a Differential-Algebraic Equation (Section +\Ref{sec:gTwoLink_dae.tex}). Hovever, this +is of contrained-state form and therfore can be written as a set of +constrained-state equations (Section \Ref{sec:gTwoLink_cse.tex}). The +corresponding ordinary differential equation is complicated due to the +trig functions involved in inverting the E matrix. + +As well as the standard representation the ``robot-form'' equations +appear in Section \Ref{sec:gTwoLink_rfe.tex}. + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_input.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_input.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_input.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_input.txt @@ -0,0 +1,21 @@ +# Numerical parameter file (gTwoLink_input.txt) +# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:03:41 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Wed Jun 11 14:23:00 BST 2003: u(1) = (t<1.0); +## Removed by MTT on Wed Jun 11 14:23:00 BST 2003: u(2) = 0.0; # +## Removed by MTT on Wed Jun 11 14:23:00 BST 2003: u(3) = 0.0; # gravity +gtwolink__f_a1 = (t<1.0); +gtwolink__f_a2 = 0.0; +gtwolink__g__force = 0.0; + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_lbl.txt @@ -0,0 +1,53 @@ +%SUMMARY gTwoLink: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (gTwoLink_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1996/12/05 12:39:49 peterg +% %% Documentation +% %% +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - identical rods +rod1 none l;l;j;m;mg +rod2 none l;l;j;m;mg + +%Zero velocity sources +v_x SS internal,0 + + +%Zero force/torque sources +F_x SS 0,internal +F_a SS 0,internal +F_y SS 0,internal + + +%Torque at joints +f_a1 SS external,external +f_a2 SS external,external + +%Gravity +g + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_numpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_numpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_numpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_numpar.txt @@ -0,0 +1,19 @@ +# Numerical parameter file (gTwoLink_numpar.txt) +# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:03:41 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +l = 1.0; # Default value +m = 1.0; # Default value +j = m*l*l/12.0; # Uniform rod + +mg = m*9.81; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_rep.txt @@ -0,0 +1,23 @@ +# Outline report file for system gTwoLink (gTwoLink_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 18:03:41 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/02/22 09:18:53 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt gTwoLink abg tex +mtt gTwoLink struc tex +mtt gTwoLink sympar tex +mtt gTwoLink dae tex +mtt gTwoLink cse tex +mtt gTwoLink input txt +mtt gTwoLink numpar txt +mtt -i euler gTwoLink odeso ps ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simp.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simp.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simp.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simp.r @@ -0,0 +1,17 @@ +%% Reduce comands to simplify output for system gTwoLink (gTwoLink_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simpar.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simpar.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simpar.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simpar.txt @@ -0,0 +1,19 @@ +# Simulation parameters for system gTwoLink (gTwoLink_simpar.txt) +# Generated by MTT on Mon Jul 27 08:11:02 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.2 1999/12/23 20:18:54 peterg +## Removed METHOD +## +## Revision 1.1 1999/02/22 10:06:54 peterg +## Initial revision +## +############################################################### + + +LAST=5.0; +DT=0.1; +STEPFACTOR=10; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_state.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_state.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_state.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_state.txt @@ -0,0 +1,24 @@ +# Initial state file (gTwoLink_state.txt) +# Generated by MTT at Mon Jul 27 07:54:23 BST 1998 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/07/27 06:59:25 peterg +## Initial revision +## +############################################################### + +# Set the states +## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(1) = 0.0; # J (gTwoLink_rod1) +## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(2) = 0.0; # 3 (gTwoLink_rod1_th) +## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(3) = 0.0; # J (gTwoLink_rod2) +## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(4) = pi/4; # 3 (gTwoLink_rod2_th) +## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(5) = 0.0; # 2 (gTwoLink_g) +gtwolink__g__mtti = 0.0; +gtwolink__rod1__j = 0.0; +gtwolink__rod1__th__mttc = 0.0; +gtwolink__rod2__j = 0.0; +gtwolink__rod2__th__mttc = pi/4; + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_desc.tex Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_desc.tex ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_desc.tex +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_desc.tex @@ -0,0 +1,25 @@ +% Verbal description for system twolink (twolink_desc.tex) +% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{twolink} is + displayed in Figure \Ref{twolink_abg} and its label + file is listed in Section \Ref{sec:twolink_lbl}. + The subsystems are listed in Section \Ref{sec:twolink_sub}. + +This is a heirachical version of the example from Section 10.5 of +"Metamodelling". It uses two compound components: {\bf ROD} and {\bf +GRAV}. {\bf ROD} is essentially as described in Figure 10.2 {\bf +GRAV} represents gravity by a vertical accelleration as in Section +10.9 of "Metamodelling" + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_lbl.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_lbl.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_lbl.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_lbl.txt @@ -0,0 +1,50 @@ +%SUMMARY twolink: two-link manipulator from Section 10.5 of "Metamodelling" +%DESCRIPTION This is a heirachical version of the +%DESCRIPTION example from Section 10.5 of "Metamodelling". +%DESCRIPTION It uses two compound components: ROD and GRA +%DESCRIPTION ROD is essentially as described in Figure 10.2 +%DESCRIPTION GRAV represents gravity by a vertical accelleration +%DESCRIPTION as in Section 10.9 of "Metamodelling" + + +%% Label (twolink_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1996/12/05 12:17:15 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1996/11/14 10:48:42 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%Rod parameters - identical rods +rod1 none l;l;j;m +rod2 none l;l;j;m + +%Zero velocity sources +v_x internal 0 + + +%Zero force/torque sources +F_x 0 internal +F_a 0 internal +F_y 0 internal + + +%Torque at joints +f_a1 external external +f_a2 external external + + +%Gravity +g ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_params.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_params.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_params.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_params.r @@ -0,0 +1,24 @@ +%% Parameter file for system twolink (twolink_params.r) +%% This file provides symbolic parameters for simplification + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Useful trig simplifications + + + trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, + cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, + sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, + cos(~x)^2 => (1+cos(2*x))/2, + sin(~x)^2 => (1-cos(2*x))/2}; + LET trig1; + +% Some simplifications -- see book +j := m*l*l/3; + +END; ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_rep.txt Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_rep.txt ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_rep.txt +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_rep.txt @@ -0,0 +1,19 @@ +%% Outline report file for system twolink (twolink_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +abg tex +struc tex +dae tex +csm tex +sro ps +lmfr ps +odeso ps +input txt +numpar txt + ADDED mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_simp.r Index: mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_simp.r ================================================================== --- mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_simp.r +++ mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_simp.r @@ -0,0 +1,14 @@ +%% Reduce comands to simplify output for system twolink (twolink_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%simplify the output equations +% Joint angles +mttx2 := theta_1; +mttx4 := theta_1 + theta_2; +END; ADDED mtt/lib/examples/Sensitivity/sRCc/sRCc_abg.fig Index: mtt/lib/examples/Sensitivity/sRCc/sRCc_abg.fig ================================================================== --- mtt/lib/examples/Sensitivity/sRCc/sRCc_abg.fig +++ mtt/lib/examples/Sensitivity/sRCc/sRCc_abg.fig @@ -0,0 +1,69 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 1800 1125 162 162 1800 1125 1890 1260 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1802 4277 2702 4277 2477 4502 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 4277 4052 4277 3827 4502 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4502 4277 5402 4277 5177 4502 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 4051 2926 3151 3151 3376 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 4051 4276 3151 4501 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 4276 2701 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5401 4051 5401 4276 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5401 4276 5401 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 4051 2701 4276 +2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 2475 585 3375 585 3375 765 2475 765 2475 585 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4050 1215 4500 1215 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4050 1080 4500 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 675 2475 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3375 675 5400 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4275 675 4275 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4275 1215 4275 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 1575 5400 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 945 1800 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 1575 1800 1260 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 5400 1530 5400 765 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6750 5625 6750 225 675 225 675 5625 6750 5625 +4 1 -1 0 0 0 20 0.0000 4 255 180 2927 4367 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 4277 4367 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 600 2926 2926 sR:r\001 +4 1 -1 0 0 0 20 0.0000 4 255 645 4276 2926 sC:c\001 +4 1 -1 0 0 0 20 0.0000 4 255 945 1395 4365 sSe:e1\001 +4 0 1 1 0 0 20 0.0000 4 180 120 2880 450 r\001 +4 0 1 1 0 0 20 0.0000 4 180 165 4680 1215 c\001 +4 0 1 1 0 0 20 0.0000 4 180 165 5625 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 255 180 5715 1305 2\001 +4 0 1 1 0 0 20 0.0000 4 180 165 1260 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 255 180 1350 1305 1\001 +4 1 1 1 0 0 20 0.0000 4 330 1725 3600 4995 Bond graph\001 +4 1 1 1 0 0 20 0.0000 4 255 1545 3600 2025 Schematic\001 +4 1 -1 0 0 0 20 0.0000 4 255 1005 5987 4367 sDe:e2\001 +4 1 4 100 0 18 4 0.0000 4 120 270 4500 4005 [1,2]\001 +4 1 4 100 0 18 4 0.0000 4 120 270 3105 4005 [1,2]\001 ADDED mtt/lib/examples/Sensitivity/sRCc/sRCc_desc.tex Index: mtt/lib/examples/Sensitivity/sRCc/sRCc_desc.tex ================================================================== --- mtt/lib/examples/Sensitivity/sRCc/sRCc_desc.tex +++ mtt/lib/examples/Sensitivity/sRCc/sRCc_desc.tex @@ -0,0 +1,33 @@ +% Verbal description for system sRCc (sRCc_desc.tex) +% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/07/29 05:17:04 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1997/08/24 10:27:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{sRCc} is + displayed in Figure \Ref{sRCc_abg} and its label + file is listed in Section \Ref{sec:sRCc_lbl}. + The subsystems are listed in Section \Ref{sec:sRCc_sub}. + +The system \textbf{sRCc} is the the sensitivity version of the simple +electrical sRCc circuit shown in Figure \Ref{sRCc_abg}. The circuit itself can be +regarded as a single-input single-output system with input $e_1$ and +output $e_2$; the sensitivity system has {\em two\/} outputs: $e_2$ +and $\frac{\partial e_2}{\partial r}$. + +All bonds are two-bond vector bonds, and the {\bf sR} and {\bf sC} +components are two-port versions of the usual {\bf R} and {\bf C} +components respectively. One port conveys the usual effort/flow pair; +the other port conveys the sensitivity of the effort and flow with +respect to the $c$ parameter. + ADDED mtt/lib/examples/Sensitivity/sRCc/sRCc_lbl.txt Index: mtt/lib/examples/Sensitivity/sRCc/sRCc_lbl.txt ================================================================== --- mtt/lib/examples/Sensitivity/sRCc/sRCc_lbl.txt +++ mtt/lib/examples/Sensitivity/sRCc/sRCc_lbl.txt @@ -0,0 +1,40 @@ +%% Label file for system sRCc (sRCc_lbl.txt) +%SUMMARY sRCc Sensitivity of output of RC circuit wrt value of r +%DESCRIPTION Uses the sR and sC components and vector bonds + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/10/18 07:34:32 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1999/07/29 05:18:59 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type sSe + e1 slin external;0 + +% Component type sDe + e2 + +% Component type sC + c slin effort,c;1 + +% Component type sR + r slin flow,r;0 ADDED mtt/lib/examples/Sensitivity/sRCc/sRCc_rep.txt Index: mtt/lib/examples/Sensitivity/sRCc/sRCc_rep.txt ================================================================== --- mtt/lib/examples/Sensitivity/sRCc/sRCc_rep.txt +++ mtt/lib/examples/Sensitivity/sRCc/sRCc_rep.txt @@ -0,0 +1,27 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system sRCc (sRCc_rep.txt) +## Generated by MTT on" Thu Jul 29 06:02:47 BST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt sRCc abg tex # The system description +## mtt sRCc cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt sRCc struc tex # The system structure +## mtt sRCc dae tex # The system dae +mtt sRCc ode tex # The system ode +## mtt sRCc sspar tex # Steady-state parameters +## mtt sRCc ss tex # Steady state +## mtt sRCc dm tex # Descriptor matrices (of linearised system) +mtt sRCc sm tex # State matrices (of linearised system) +mtt sRCc tf tex # Transfer function (of linearised system) +mtt sRCc lmfr ps # log modulus of frequency response (of linearised system) +## mtt sRCc simpar tex # Simulation parameters +## mtt sRCc numpar tex # Numerical simulation parameters +## mtt sRCc input tex # Simulation input + mtt sRCc odeso ps # Simulation output ADDED mtt/lib/examples/Sensitivity/sRCr/sRCr_abg.fig Index: mtt/lib/examples/Sensitivity/sRCr/sRCr_abg.fig ================================================================== --- mtt/lib/examples/Sensitivity/sRCr/sRCr_abg.fig +++ mtt/lib/examples/Sensitivity/sRCr/sRCr_abg.fig @@ -0,0 +1,69 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 1800 1125 162 162 1800 1125 1890 1260 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1802 4277 2702 4277 2477 4502 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 4277 4052 4277 3827 4502 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4502 4277 5402 4277 5177 4502 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2926 4051 2926 3151 3151 3376 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4276 4051 4276 3151 4501 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 4276 2701 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5401 4051 5401 4276 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5401 4276 5401 4501 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2701 4051 2701 4276 +2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 + 2475 585 3375 585 3375 765 2475 765 2475 585 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4050 1215 4500 1215 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4050 1080 4500 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 675 2475 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 3375 675 5400 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4275 675 4275 1080 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 4275 1215 4275 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 1575 5400 1575 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 945 1800 675 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 + 1800 1575 1800 1260 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 5400 1530 5400 765 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6750 5625 6750 225 675 225 675 5625 6750 5625 +4 1 -1 0 0 0 20 0.0000 4 255 180 2927 4367 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 180 4277 4367 0\001 +4 1 -1 0 0 0 20 0.0000 4 255 600 2926 2926 sR:r\001 +4 1 -1 0 0 0 20 0.0000 4 255 645 4276 2926 sC:c\001 +4 1 -1 0 0 0 20 0.0000 4 255 945 1395 4365 sSe:e1\001 +4 0 1 1 0 0 20 0.0000 4 180 120 2880 450 r\001 +4 0 1 1 0 0 20 0.0000 4 180 165 4680 1215 c\001 +4 0 1 1 0 0 20 0.0000 4 180 165 5625 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 255 180 5715 1305 2\001 +4 0 1 1 0 0 20 0.0000 4 180 165 1260 1170 e\001 +4 0 1 1 0 0 20 0.0000 4 255 180 1350 1305 1\001 +4 1 1 1 0 0 20 0.0000 4 330 1725 3600 4995 Bond graph\001 +4 1 1 1 0 0 20 0.0000 4 255 1545 3600 2025 Schematic\001 +4 1 -1 0 0 0 20 0.0000 4 255 1005 5987 4367 sDe:e2\001 +4 1 4 100 0 18 10 0.0000 4 150 345 4545 4005 [1,2]\001 +4 1 4 100 0 18 10 0.0000 4 150 345 3195 4005 [1,2]\001 ADDED mtt/lib/examples/Sensitivity/sRCr/sRCr_desc.tex Index: mtt/lib/examples/Sensitivity/sRCr/sRCr_desc.tex ================================================================== --- mtt/lib/examples/Sensitivity/sRCr/sRCr_desc.tex +++ mtt/lib/examples/Sensitivity/sRCr/sRCr_desc.tex @@ -0,0 +1,33 @@ +% Verbal description for system sRCr (sRCr_desc.tex) +% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1999/07/29 05:17:04 peterg +% %% Initial revision +% %% +% %% Revision 1.1 1997/08/24 10:27:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{sRCr} is + displayed in Figure \Ref{sRCr_abg} and its label + file is listed in Section \Ref{sec:sRCr_lbl}. + The subsystems are listed in Section \Ref{sec:sRCr_sub}. + +The system \textbf{sRCr} is the the sensitivity version of the simple +electrical sRCr circuit shown in Figure \Ref{sRCr_abg}. The circuit itself can be +regarded as a single-input single-output system with input $e_1$ and +output $e_2$; the sensitivity system has {\em two\/} outputs: $e_2$ +and $\frac{\partial e_2}{\partial r}$. + +All bonds are two-bond vector bonds, and the {\bf sR} and {\bf sC} +components are two-port versions of the usual {\bf R} and {\bf C} +components respectively. One port conveys the usual effort/flow pair; +the other port conveys the sensitivity of the effort and flow with +respect to the $r$ parameter. + ADDED mtt/lib/examples/Sensitivity/sRCr/sRCr_lbl.txt Index: mtt/lib/examples/Sensitivity/sRCr/sRCr_lbl.txt ================================================================== --- mtt/lib/examples/Sensitivity/sRCr/sRCr_lbl.txt +++ mtt/lib/examples/Sensitivity/sRCr/sRCr_lbl.txt @@ -0,0 +1,40 @@ +%% Label file for system sRCr (sRCr_lbl.txt) +%SUMMARY sRCr Sensitivity of output of RC circuit wrt value of r +%DESCRIPTION Uses the sR and sC components and vector bonds + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 18:04:59 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/07/29 05:18:59 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases + +% Argument aliases + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type sSe + e1 slin external;0 + +% Component type sDe + e2 + +% Component type sC + c slin effort,c;0 + +% Component type sR + r slin flow,r;1 ADDED mtt/lib/examples/Sensitivity/sRCr/sRCr_rep.txt Index: mtt/lib/examples/Sensitivity/sRCr/sRCr_rep.txt ================================================================== --- mtt/lib/examples/Sensitivity/sRCr/sRCr_rep.txt +++ mtt/lib/examples/Sensitivity/sRCr/sRCr_rep.txt @@ -0,0 +1,27 @@ +## -*-octave-*- Put Emacs into octave-mode +## Outline report file for system sRCr (sRCr_rep.txt) +## Generated by MTT on" Thu Jul 29 06:02:47 BST 1999. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt sRCr abg tex # The system description +## mtt sRCr cbg ps # The causal bond graph +## Uncomment the following lines or add others +mtt sRCr struc tex # The system structure +## mtt sRCr dae tex # The system dae +mtt sRCr ode tex # The system ode +## mtt sRCr sspar tex # Steady-state parameters +## mtt sRCr ss tex # Steady state +## mtt sRCr dm tex # Descriptor matrices (of linearised system) +mtt sRCr sm tex # State matrices (of linearised system) +mtt sRCr tf tex # Transfer function (of linearised system) +mtt sRCr lmfr ps # log modulus of frequency response (of linearised system) +## mtt sRCr simpar tex # Simulation parameters +## mtt sRCr numpar tex # Numerical simulation parameters +## mtt sRCr input tex # Simulation input + mtt sRCr odeso ps # Simulation output ADDED mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_abg.fig Index: mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_abg.fig ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_abg.fig +++ mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_abg.fig @@ -0,0 +1,37 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 3150 5850 3150 5625 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 4275 5850 4275 5625 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1800 3150 3150 3150 2925 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3150 2925 3150 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 4050 1800 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1777 4275 3127 4275 2902 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 4095 4500 4545 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 3150 8325 3150 8100 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6975 2925 6975 3375 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 2925 2025 4725 2025 4725 5400 2925 5400 2925 2025 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 5850 9450 1575 450 1575 450 5850 9450 5850 +4 0 -1 0 0 0 20 0.0000000 4 240 870 6030 3240 RT:r_2\001 +4 2 4 0 0 0 20 0.0000000 4 240 690 2835 3060 [t_in]\001 +4 0 4 0 0 0 20 0.0000000 4 240 840 4770 3015 [t_out]\001 +4 2 4 0 0 0 20 0.0000000 4 240 735 2880 4185 [e_in]\001 +4 0 4 0 0 0 20 0.0000000 4 240 885 4770 4185 [e_out]\001 +4 2 -1 0 0 0 20 0.0000000 4 240 900 1620 3240 SS:T_1\001 +4 0 -1 0 0 0 20 0.0000000 4 240 900 8460 3240 SS:T_2\001 +4 2 -1 0 0 0 20 0.0000000 4 240 780 1665 4365 SS:I_r\001 +4 0 -1 0 0 0 20 0.0000000 4 240 930 5985 4365 SS:V_0\001 +4 1 -1 0 0 0 20 0.0000000 4 270 1575 3780 3825 Segment:s*100\001 ADDED mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_input.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_input.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_input.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (BigHeatedRod_input.txt) +# Generated by MTT at Thu Sep 4 16:11:06 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:06:11 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Sun Aug 17 13:03:18 BST 2003: u(1) = 10.0*(t<5.0); # I_r +bigheatedrod__i_r = 10.0*(t<5.0); # I_r ADDED mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_lbl.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_lbl.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_lbl.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_lbl.txt @@ -0,0 +1,52 @@ +#SUMMARY BigHeatedRod: Thermal/Electrical model of Electric rod +#DESCRIPTION Introduces the idea of the ES component which +#DESCRIPTION transforms a relative-temperature/enthalpy pseudo bond +#DESCRIPTION (at the [e]port) into an absolute-temperature/enntropy +#DESCRIPTION energy bond (at the [s] port) and vice versa. + +#PAR rod_length +#PAR rod_radius +#PAR electrical_resistivity +#PAR thermal_resistivity +#PAR thermal_capacity +#PAR segments +#PAR area +#PAR delta_x +#PAR volume +#PAR density +#PAR mass +#PAR pi + +## Label file for system BigHeatedRod (BigHeatedRod_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.1 2000/12/28 18:06:11 peterg +# ## To RCS +# ## +# ## Revision 1.1 1997/09/11 16:16:29 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + +# Component type RT + r_2 lin flow,r_2 + +# Component type SS + I_r SS internal,external + T_1 SS t_0,internal + T_2 SS t_0,internal + V_0 SS internal,internal + +# Component type Segment + s ADDED mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_numpar.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_numpar.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_numpar.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_numpar.txt @@ -0,0 +1,40 @@ +# Numerical parameter file (BigHeatedRod_numpar.txt) +# Generated by MTT at Thu Sep 4 16:11:04 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:06:11 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +# Constants for copper +density = 8.96; +rod_length = 1.0; +rod_radius = 1e-3; +electrical_resistivity = 16.8*0.000000001; +thermal_resistivity = 1/390.0; +thermal_capacity = 380.0; + +pi = 3.142; + +segments = 100; +area = pi*rod_radius*rod_radius; +delta_x = rod_length/segments; +volume = area*delta_x; +mass = volume*density; + +# Parameters +c_t = thermal_capacity*mass; +r = electrical_resistivity*delta_x/area; +r_t = thermal_resistivity*delta_x/area; +r_2 = r_t; +t_0 = 300; # Ambient + + + + ADDED mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_rep.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_rep.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_rep.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_rep.txt @@ -0,0 +1,21 @@ +# Outline report file for system BigHeatedRod (BigHeatedRod_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2003/08/17 17:02:31 gawthrop +% %% Updated for new MTT +% %% +% %% Revision 1.1 1998/11/23 13:37:55 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -o BigHeatedRod abg tex + +mtt -o BigHeatedRod numpar txt +mtt -o BigHeatedRod input txt +mtt -o BigHeatedRod odeso ps + ADDED mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_simpar.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_simpar.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_simpar.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_simpar.txt @@ -0,0 +1,20 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system BigHeatedRod (BigHeatedRod_simpar.txt) +# Generated by MTT on Tue Aug 24 01:20:41 BST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 10.0; # Last time in simulation +DT = 0.1; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input + +DT = 1.0; # Print interval ADDED mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_state.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_state.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_state.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_state.txt @@ -0,0 +1,214 @@ +# -*-octave-*- Put Emacs into octave-mode +# Initial state file (BigHeatedRod_state.txt) +# Generated by MTT at Friday August 14 18:38:47 BST 1998 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 18:06:11 peterg +## To RCS +## +############################################################### + +# Set the states +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(1) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(2) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(3) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(4) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(5) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(6) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(7) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(8) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(9) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(10) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(11) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(12) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(13) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(14) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(15) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(16) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(17) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(18) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(19) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(20) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(21) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(22) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(23) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(24) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(25) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(26) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(27) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(28) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(29) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(30) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(31) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(32) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(33) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(34) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(35) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(36) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(37) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(38) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(39) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(40) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(41) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(42) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(43) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(44) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(45) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(46) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(47) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(48) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(49) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(50) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(51) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(52) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(53) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(54) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(55) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(56) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(57) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(58) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(59) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(60) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(61) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(62) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(63) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(64) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(65) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(66) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(67) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(68) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(69) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(70) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(71) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(72) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(73) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(74) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(75) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(76) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(77) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(78) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(79) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(80) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(81) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(82) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(83) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(84) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(85) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(86) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(87) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(88) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(89) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(90) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(91) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(92) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(93) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(94) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(95) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(96) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(97) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(98) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(99) = c_t*t_0; # c (BigHeatedRod_s_c_t) +## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(100) = c_t*t_0; # c (BigHeatedRod_s_c_t) +bigheatedrod__s__100__c_t__c = c_t*t_0; +bigheatedrod__s__10__c_t__c = c_t*t_0; +bigheatedrod__s__11__c_t__c = c_t*t_0; +bigheatedrod__s__12__c_t__c = c_t*t_0; +bigheatedrod__s__13__c_t__c = c_t*t_0; +bigheatedrod__s__14__c_t__c = c_t*t_0; +bigheatedrod__s__15__c_t__c = c_t*t_0; +bigheatedrod__s__16__c_t__c = c_t*t_0; +bigheatedrod__s__17__c_t__c = c_t*t_0; +bigheatedrod__s__18__c_t__c = c_t*t_0; +bigheatedrod__s__19__c_t__c = c_t*t_0; +bigheatedrod__s__20__c_t__c = c_t*t_0; +bigheatedrod__s__21__c_t__c = c_t*t_0; +bigheatedrod__s__22__c_t__c = c_t*t_0; +bigheatedrod__s__23__c_t__c = c_t*t_0; +bigheatedrod__s__24__c_t__c = c_t*t_0; +bigheatedrod__s__25__c_t__c = c_t*t_0; +bigheatedrod__s__26__c_t__c = c_t*t_0; +bigheatedrod__s__27__c_t__c = c_t*t_0; +bigheatedrod__s__28__c_t__c = c_t*t_0; +bigheatedrod__s__29__c_t__c = c_t*t_0; +bigheatedrod__s__2__c_t__c = c_t*t_0; +bigheatedrod__s__30__c_t__c = c_t*t_0; +bigheatedrod__s__31__c_t__c = c_t*t_0; +bigheatedrod__s__32__c_t__c = c_t*t_0; +bigheatedrod__s__33__c_t__c = c_t*t_0; +bigheatedrod__s__34__c_t__c = c_t*t_0; +bigheatedrod__s__35__c_t__c = c_t*t_0; +bigheatedrod__s__36__c_t__c = c_t*t_0; +bigheatedrod__s__37__c_t__c = c_t*t_0; +bigheatedrod__s__38__c_t__c = c_t*t_0; +bigheatedrod__s__39__c_t__c = c_t*t_0; +bigheatedrod__s__3__c_t__c = c_t*t_0; +bigheatedrod__s__40__c_t__c = c_t*t_0; +bigheatedrod__s__41__c_t__c = c_t*t_0; +bigheatedrod__s__42__c_t__c = c_t*t_0; +bigheatedrod__s__43__c_t__c = c_t*t_0; +bigheatedrod__s__44__c_t__c = c_t*t_0; +bigheatedrod__s__45__c_t__c = c_t*t_0; +bigheatedrod__s__46__c_t__c = c_t*t_0; +bigheatedrod__s__47__c_t__c = c_t*t_0; +bigheatedrod__s__48__c_t__c = c_t*t_0; +bigheatedrod__s__49__c_t__c = c_t*t_0; +bigheatedrod__s__4__c_t__c = c_t*t_0; +bigheatedrod__s__50__c_t__c = c_t*t_0; +bigheatedrod__s__51__c_t__c = c_t*t_0; +bigheatedrod__s__52__c_t__c = c_t*t_0; +bigheatedrod__s__53__c_t__c = c_t*t_0; +bigheatedrod__s__54__c_t__c = c_t*t_0; +bigheatedrod__s__55__c_t__c = c_t*t_0; +bigheatedrod__s__56__c_t__c = c_t*t_0; +bigheatedrod__s__57__c_t__c = c_t*t_0; +bigheatedrod__s__58__c_t__c = c_t*t_0; +bigheatedrod__s__59__c_t__c = c_t*t_0; +bigheatedrod__s__5__c_t__c = c_t*t_0; +bigheatedrod__s__60__c_t__c = c_t*t_0; +bigheatedrod__s__61__c_t__c = c_t*t_0; +bigheatedrod__s__62__c_t__c = c_t*t_0; +bigheatedrod__s__63__c_t__c = c_t*t_0; +bigheatedrod__s__64__c_t__c = c_t*t_0; +bigheatedrod__s__65__c_t__c = c_t*t_0; +bigheatedrod__s__66__c_t__c = c_t*t_0; +bigheatedrod__s__67__c_t__c = c_t*t_0; +bigheatedrod__s__68__c_t__c = c_t*t_0; +bigheatedrod__s__69__c_t__c = c_t*t_0; +bigheatedrod__s__6__c_t__c = c_t*t_0; +bigheatedrod__s__70__c_t__c = c_t*t_0; +bigheatedrod__s__71__c_t__c = c_t*t_0; +bigheatedrod__s__72__c_t__c = c_t*t_0; +bigheatedrod__s__73__c_t__c = c_t*t_0; +bigheatedrod__s__74__c_t__c = c_t*t_0; +bigheatedrod__s__75__c_t__c = c_t*t_0; +bigheatedrod__s__76__c_t__c = c_t*t_0; +bigheatedrod__s__77__c_t__c = c_t*t_0; +bigheatedrod__s__78__c_t__c = c_t*t_0; +bigheatedrod__s__79__c_t__c = c_t*t_0; +bigheatedrod__s__7__c_t__c = c_t*t_0; +bigheatedrod__s__80__c_t__c = c_t*t_0; +bigheatedrod__s__81__c_t__c = c_t*t_0; +bigheatedrod__s__82__c_t__c = c_t*t_0; +bigheatedrod__s__83__c_t__c = c_t*t_0; +bigheatedrod__s__84__c_t__c = c_t*t_0; +bigheatedrod__s__85__c_t__c = c_t*t_0; +bigheatedrod__s__86__c_t__c = c_t*t_0; +bigheatedrod__s__87__c_t__c = c_t*t_0; +bigheatedrod__s__88__c_t__c = c_t*t_0; +bigheatedrod__s__89__c_t__c = c_t*t_0; +bigheatedrod__s__8__c_t__c = c_t*t_0; +bigheatedrod__s__90__c_t__c = c_t*t_0; +bigheatedrod__s__91__c_t__c = c_t*t_0; +bigheatedrod__s__92__c_t__c = c_t*t_0; +bigheatedrod__s__93__c_t__c = c_t*t_0; +bigheatedrod__s__94__c_t__c = c_t*t_0; +bigheatedrod__s__95__c_t__c = c_t*t_0; +bigheatedrod__s__96__c_t__c = c_t*t_0; +bigheatedrod__s__97__c_t__c = c_t*t_0; +bigheatedrod__s__98__c_t__c = c_t*t_0; +bigheatedrod__s__99__c_t__c = c_t*t_0; +bigheatedrod__s__9__c_t__c = c_t*t_0; +bigheatedrod__s__c_t__c = c_t*t_0; ADDED mtt/lib/examples/Simulation/BigHeatedRod/HR_input.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/HR_input.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/HR_input.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/HR_input.txt @@ -0,0 +1,12 @@ +# Numerical parameter file (HR_input.txt) +# Generated by MTT at Thu Sep 4 16:11:06 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +u(1) = 10.0*(t<5.0); # I_r ADDED mtt/lib/examples/Simulation/BigHeatedRod/HR_numpar.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/HR_numpar.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/HR_numpar.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/HR_numpar.txt @@ -0,0 +1,36 @@ +# Numerical parameter file (HR_numpar.txt) +# Generated by MTT at Thu Sep 4 16:11:04 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +# Constants for copper +density = 8.96; +rod_length = 1.0; +rod_radius = 1e-3; +electrical_resistivity = 16.8*0.000000001; +thermal_resistivity = 1/390.0; +thermal_capacity = 380.0; + + +segments = 2; +area = pi*rod_radius*rod_radius; +delta_x = rod_length/segments; +volume = area*delta_x; +mass = volume*density; + +# Parameters +c_t = thermal_capacity*mass; +r = electrical_resistivity*delta_x/area; +r_t = thermal_resistivity*delta_x/area; +r_2 = r_t/100; +t_0 = 300; # Ambient + + + + ADDED mtt/lib/examples/Simulation/BigHeatedRod/HR_simpar.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/HR_simpar.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/HR_simpar.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/HR_simpar.txt @@ -0,0 +1,19 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system HR (HR_simpar.txt) +# Generated by MTT on Wednesday July 29 13:59:50 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 10; # Last time in simulation +WMIN = 1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps + +STEPFACTOR = 1; # Added automatically +METHOD = IMPLICIT; # Added automatically +DT = 0.25; # Added automatically ADDED mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_desc.tex Index: mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_desc.tex ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_desc.tex +++ mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_desc.tex @@ -0,0 +1,39 @@ +% Verbal description for system HeatedRod (HeatedRod_desc.tex) +% Generated by MTT on Thu Sep 4 18:05:09 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + + The acausal bond graph of system \textbf{HeatedRod} is + displayed in Figure \Ref{HeatedRod_abg} and its label + file is listed in Section \Ref{sec:HeatedRod_lbl}. +The subsystems are listed in Section \Ref{sec:HeatedRod_sub}. + + System \textbf{HeatedRod} is a model of a rod of copper with an + electric current passing through it which warms it up. The two ends of + the rod are fixed at ambient temperature; this is where all the heat + loss occurs. + + This system introduces the idea of the {\bf ES} component which + transforms a relative-temperature/enthalpy pseudo bond (at the [e] + port) into an absolute-temperature/enntropy energy bond (at the [s] + port) and vice versa. + + The model is similar to that described in chapter 8 of + Cellier's book. However, instead of representing the thermal + resistance by {\bf RS} components and reinserting the entropy flow, + the {\bf RT} component uses two {\bf ES} components to convert from + true to pseudo bonds and back again. Similary, the thermal capacity is + modelled by the {\bf CT} component. + + + The rod parameters are given in the numpar file and the input current + in the input file. ADDED mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_lbl.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_lbl.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_lbl.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_lbl.txt @@ -0,0 +1,33 @@ +%SUMMARY HeatedRod: Thermal/Electrical model of Electric rod +%DESCRIPTION Introduces the idea of the ES component which +%DESCRIPTION transforms a relative-temperature/enthalpy pseudo bond +%DESCRIPTION (at the [e]port) into an absolute-temperature/enntropy +%DESCRIPTION energy bond (at the [s] port) and vice versa. + +%% Label file for system HeatedRod (HeatedRod_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type RT + r_2 lin flow,r_2 + +% Component type SS + I_r internal external + T_1 t_0 internal + T_2 t_0 internal + V_0 0 internal + +% Component type Segment + s ADDED mtt/lib/examples/Simulation/BigHeatedRod/Run Index: mtt/lib/examples/Simulation/BigHeatedRod/Run ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/Run +++ mtt/lib/examples/Simulation/BigHeatedRod/Run @@ -0,0 +1,129 @@ +#! /bin/sh +# Shell script for running the large HeatedRod systems to compare +# four integration methods. +# Usage example: Run 100 0.25 runf the 100 segment example at interval 0.25 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.3 1998/08/17 09:42:26 peterg +## Third argument gives the desired methods. +## +## Revision 1.2 1998/08/15 14:07:11 peterg +## Don't do ImplicitL +## +## Revision 1.1 1998/08/15 13:58:27 peterg +## Initial revision +## +############################################################### + + +n=$1 +DT=$2 + +if [ -z "$n" ]; then + echo "First argument is N: number of segments (eg 100)" + exit +fi +if [ -z "$DT" ]; then + echo "Second argument is DT: the sample interval (eg 0.25)" + exit +fi +if [ -z "$3" ]; then + METHODS='ImplicitS Euler Implicit' +else + METHODS=$3 +fi + +echo "Running system HR$1 with DT = $DT" +echo "using methods $METHODS" + +#Create the system +mtt -q rename HR HR$n >/dev/null +rm -f MTT_work/HR$1_state.* #Why ?? + +# Is it already correct? +count=`grep -c "*$n" HR$1_abg.fig` + +# if not, then set the correct number of segments +if [ "$count" = "0" ]; then + echo Setting number of segments to $n + mv HR$1_abg.fig HR$1_abg.old + sed "s/\*[0-9]*/*$1/"HR$1_abg.fig + + mv HR$1_numpar.txt HR$1_numpar.old + sed "s/segments = [0-9]*/segments = $1/"HR$1_numpar.txt + + echo "Making the default HR$1_state.txt" + rm -f HR$1_state.txt MTT_work/HR$1_state.txt + mtt -q HR$1 state txt + echo "Setting $n states to c_t*t_0" + mv HR$1_state.txt HR$1_state.old + sed "s/0.0/c_t*t_0/"HR$1_state.txt +fi + + + + + + +rm -f HR$1_table.txt + +#Do the methods of interest + +for METHOD in $METHODS; do + +case $METHOD in + Euler) + # What is the minimum step size for Euler? + mtt -q HR$n numpar m + mtt -q HR$n sm m +octave -q <HR$1.tmp1 + HR$1_numpar; + A=HR$1_sm; + Max_Eig=max(eig(-A)) + STEPFACTOR=ceil( Max_Eig*$DT/2 ) +EOF + MinSTEPFACTOR=`gawk '{if ($1=="STEPFACTOR") print $3}' HR$1.tmp1` + STEPFACTOR=$MinSTEPFACTOR + ;; + ImplicitS) + # What is the empirical step size for sparse method? + octave -q <HR$1.tmp1 + if $n>100 + SparseSTEPFACTOR=10*$n + else + SparseSTEPFACTOR=5*$n + endif +EOF + SparseSTEPFACTOR=`gawk '{if ($1=="SparseSTEPFACTOR") print $3}' HR$1.tmp1` + + STEPFACTOR=$SparseSTEPFACTOR + ;; + *) + STEPFACTOR=1 + ;; +esac + + + echo "Doing HR$1 with DT=$DT using $METHOD (STEPFACTOR = $STEPFACTOR)" + + # Modify the simpar.txt files + grep -v 'STEPFACTOR' HR_simpar.txt | grep -v 'METHOD' | grep -v 'DT' > HR$1_simpar.txt + echo "STEPFACTOR = $STEPFACTOR; # Added automatically" >>HR$1_simpar.txt + echo "METHOD = $METHOD; # Added automatically" >>HR$1_simpar.txt + echo "DT = $DT; # Added automatically" >>HR$1_simpar.txt + mtt -q -c -o HR$1 odeso ps > junk 2>>junk #HR$1_$METHOD.tmp + grep user junk |\ + gawk '{print System " &\t" METHOD " &\t" DT " &\t" STEPFACTOR " &\t" $2 "\\\\"}'\ + METHOD=$METHOD STEPFACTOR=$STEPFACTOR System=HR$1 DT=$DT >> HR$1_table.txt + + cp HR$1_odeso.ps HR$1.$METHOD.$DT.ps +done + +cat HR$1_table.txt + + + ADDED mtt/lib/examples/Simulation/BigHeatedRod/Run_All Index: mtt/lib/examples/Simulation/BigHeatedRod/Run_All ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/Run_All +++ mtt/lib/examples/Simulation/BigHeatedRod/Run_All @@ -0,0 +1,20 @@ +#! /bin/sh +# Generates the tables of timings +# PJG 17/8/98 + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +Run 2 0.25 'ImplicitS Implicit Euler' +Run 10 0.25 'ImplicitS Implicit Euler' +Run 20 0.25 'ImplicitS Implicit Euler' +Run 50 0.25 'ImplicitS Implicit Euler' +Run 100 0.25 'ImplicitS Implicit Euler' +Run 200 0.25 'ImplicitS Implicit' + +cat Run*_table.txt | sort ADDED mtt/lib/examples/Simulation/BigHeatedRod/Segment_abg.fig Index: mtt/lib/examples/Simulation/BigHeatedRod/Segment_abg.fig ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/Segment_abg.fig +++ mtt/lib/examples/Simulation/BigHeatedRod/Segment_abg.fig @@ -0,0 +1,64 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2835 2205 2925 2745 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2880 2250 2880 2700 +-6 +6 8505 2250 8595 2790 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 8550 2295 8550 2745 +-6 +6 5310 6255 5400 6795 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5355 6300 5355 6750 +-6 +6 5805 6255 5895 6795 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 5850 6300 5850 6750 +-6 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1306 2476 2881 2476 2656 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3781 2476 5356 2476 5131 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5761 2476 8550 2475 8325 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5581 4276 5581 2701 5806 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5581 6301 5581 4726 5806 4951 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 6525 5356 6526 5131 6751 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5806 6526 8550 6525 8325 6750 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5806 2701 6920 3815 6601 3815 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5581 2251 5581 676 5806 901 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5356 676 5806 676 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9900 7425 9900 90 45 90 45 7425 9900 7425 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 7650 4455 7650 1800 1575 1800 1575 4455 7650 4455 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 7650 6975 7650 4545 1575 4545 1575 6975 7650 6975 +4 1 -1 0 0 0 20 0.0000 4 240 810 3331 2566 RT:r_t\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5581 2566 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 555 5581 4591 RS:r\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5581 6616 1\001 +4 1 -1 0 0 0 20 0.0000 4 240 840 7021 4141 CT:c_t\001 +4 1 -1 0 0 0 20 0.0000 4 255 870 5581 586 SS:T_s\001 +4 2 4 0 0 0 20 0.0000 4 255 1110 1261 2566 SS:[t_in]\001 +4 0 4 0 0 0 20 0.0000 4 255 1260 8685 2565 SS:[t_out]\001 +4 2 4 0 0 0 20 0.0000 4 255 1155 1260 6615 SS:[e_in]\001 +4 0 4 0 0 0 20 0.0000 4 255 1305 8685 6615 SS:[e_out]\001 +4 0 1 1 0 0 20 0.0000 4 210 1875 1845 4050 Thermal model\001 +4 0 1 1 0 0 20 0.0000 4 210 2025 1800 5175 Electrical model\001 +4 0 1 1 0 0 20 0.0000 4 255 2415 6075 585 Temperature sensor\001 ADDED mtt/lib/examples/Simulation/BigHeatedRod/Segment_lbl.txt Index: mtt/lib/examples/Simulation/BigHeatedRod/Segment_lbl.txt ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/Segment_lbl.txt +++ mtt/lib/examples/Simulation/BigHeatedRod/Segment_lbl.txt @@ -0,0 +1,38 @@ +%SUMMARY Segment: Segment of HeatedRod +%DESCRIPTION Part of the HeatedRod example. +%% Label file for system Segment (Segment_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/08/10 12:29:48 peterg +% %% Added missing ports. +% %% +% %% Revision 1.1 1997/09/11 16:17:14 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +% Component type CT + c_t lin effort,c_t + +% Component type RS + r lin flow,r + +% Component type RT + r_t lin flow,r_t + +% Component type SS + T_s SS external,0 + [t_in] SS external,internal + [t_out] SS internal,external + [e_in] SS external,internal + [e_out] SS external,internal + ADDED mtt/lib/examples/Simulation/BigHeatedRod/examples.m Index: mtt/lib/examples/Simulation/BigHeatedRod/examples.m ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/examples.m +++ mtt/lib/examples/Simulation/BigHeatedRod/examples.m @@ -0,0 +1,17 @@ + +mttdt = 1; +mttx=(zeros(200,1)); +mttu=(zeros(200,1)); +BigHeatedRod_numpar; +alpha = BigHeatedRod_smx(mttx,mttu,mttdt); +show_matrix (alpha); +psfig("sparsity.ps"); + + +[N,junk] = size(alpha); +A = eye(N) - alpha; +plot(log10(abs(eig(A)))) +grid; +xlabel("i"); +ylabel("e_i"); +psfig("eig.ps"); ADDED mtt/lib/examples/Simulation/BigHeatedRod/time_svdlu.m Index: mtt/lib/examples/Simulation/BigHeatedRod/time_svdlu.m ================================================================== --- mtt/lib/examples/Simulation/BigHeatedRod/time_svdlu.m +++ mtt/lib/examples/Simulation/BigHeatedRod/time_svdlu.m @@ -0,0 +1,16 @@ +function [N,Ts,Tl]=time_svdlu; + + N=[100:100:700]; + + Ts=[]; Tl=[]; + for n=N + n + M=rand(n,n); + ts=time; svd(M); ts=time-ts + tl=time; lu(M); tl=time-tl + Ts=[Ts,ts]; + Tl=[Tl,tl]; + endfor; + +endfunction; + ADDED mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_abg.fig Index: mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_abg.fig ================================================================== --- mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_abg.fig +++ mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_abg.fig @@ -0,0 +1,21 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 900 3150 2250 3150 2025 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 3150 4950 3150 4725 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 3150 7425 3150 7200 3375 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8550 5175 8550 900 45 900 45 5175 8550 5175 +4 1 -1 0 0 10 20 0.0000 4 210 570 495 3240 Se:u\001 +4 1 -1 0 0 10 20 0.0000 4 210 1095 2925 3240 RC:slow\001 +4 1 -1 0 0 10 20 0.0000 4 210 1005 5535 3240 RC:fast\001 +4 1 -1 0 0 10 20 0.0000 4 270 600 7830 3240 De:y\001 ADDED mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_desc.tex Index: mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_desc.tex ================================================================== --- mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_desc.tex +++ mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_desc.tex @@ -0,0 +1,168 @@ +% -*-latex-*- Put EMACS into LaTeX-mode +% Verbal description for system ImplicitRC (ImplicitRC_desc.tex) +% Generated by MTT on Wednesday June 24 09:50:17 BST 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 18:06:50 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This report describes the \emph{implicit} integration methods +available in MTT. They are introduced to provide simulation +of systems within the following context: +\begin{enumerate} +\item The system may be stiff with a mixture of slow and fast + (possibly due to approximating algebraic loops) subsystems. +\item The fast parts of the response are of no interest +\item A fixed sample interval is required -- possibly for real-time + simulation or control +\item The system is nonlinear. +\item The solution of nonlinear algebraic equations is to be avaided. +\end{enumerate} + +The following sections consider the linear and nonlinear versions +respectively. The ideas are based on a standard textbook +\footnote{Press et al: \emph{Numerical Recipes in C}, 2nd edition, + 1992. Cambridge, Section 16.6}. + + +\subsection{Implicit integration - the linear case} +\label{sec:linear} + +Consider the \emph{linear} system: +\begin{equation} + \label{eq:sys} + \dot x = A x + B u +\end{equation} + +For the purposes of simulation, it can be discretised (with sample +interval $\Delta t$) in at least two +ways: +\begin{enumerate} +\item $ \dot x \approx \frac{x_{i+1} - x_{i}}{\Delta t}$ +\item $ \dot x \approx \frac{x_{i} - x_{i-1}}{\Delta t}$ +\end{enumerate} +The former is gives rise to the \emph{forward} Euler or \emph{explicit} +integration scheme: +\begin{equation} + x_{i+1} = x_{i} + \Delta t \left [ A x_{i} + B_{i} u \right ] +\end{equation} +and the latter gives rise to the \emph{backward} Euler or \emph{implicit} +integration scheme: +\begin{equation} + x_{i} = x_{i-1} + \Delta t \left [ A x_{i} + B_{i} u \right ] +\end{equation} +which must be rewritten as: +\begin{equation} + x_{i} = \left [ I - \Delta t A \right ]^{-1} x_{i-1} + \Delta t B_{i} u +\end{equation} +for the purposes of implementation. + +The explicit method gives simple implementation whereas the implicit +method requires matrix inversion. However, the explicit method is only +stable if: +\begin{equation} + \Delta t < \frac{2}{| \lambda |} +\end{equation} +where $\lambda$ is the \emph{largest} eigenvalue of $A$. If this +largest eigenvalue is real so $\lambda = \frac{1}{\tau}$ where $\tau$ +is the \emph{smallest} system time constant: +\begin{equation} + \Delta t < 2 \tau +\end{equation} + +If the system is stiff, that is it contains at least one small time +constant relative to the dominant time constants, Euler integration is +not feasible due to the very small sample interval $\Delta t$ +required. + +In contrast, the implicit method is stable. + + +\subsubsection{Example} + The acausal bond graph of system \textbf{ImplicitRC} is + displayed in Figure \Ref{fig:ImplicitRC_abg.ps} and its label + file is listed in Section \Ref{sec:ImplicitRC_lbl} + The subsystems are listed in Section \Ref{sec:ImplicitRC_sub}. + +The system represents two simple RC circuits in series with +differential equations as given in Section \Ref{sec:ImplicitRC_ode-noargs.tex} and +transfer function as given in Section \Ref{sec:ImplicitRC_tf-noargs.tex}. + +For the purposes of this example the two time constants are $1$ and +$\epsilon=10^{-3}$ -- this is a stiff system. All of the simulations +use a sample interval of $\Delta t = 0.1$ ang the input is a unit +step. Section \Ref{sec:ImplicitRC_sro-noargs.ps} shows the exact (computed from +the matrix exponential) solution, and Section {sec:ImplicitRC_odeso-cc.ps} +shows the solution by implicit integration. + +The explicit solution is not shown, but was found to be unstable for +$\Delta t > 0.002$ as predicted. + +\subsection{Implicit integration - the nonlinear case}} +\label{sec:nonlinear} + +Consider the \emph{nonlinear} system: +\begin{equation} + \label{eq:sys} + \dot x = f(x,u) +\end{equation} +and suppose it can be linearised about any state and input to give: +\begin{equation} + A(x,u) = \frac{\partial f(x,u)}{\partial x} +\end{equation} + +The corresponding \emph{implicit} scheme is: +\begin{equation} + x_{i} = x_{i-1} + \Delta t f(x_{i},u_{i}) +\end{equation} +This is not easy to solve in general due to the set of non-linear +equations that need to be solved. To avoid this, consider a further +approximation: +\begin{equation} + f(x_{i},u_{i}) \approx f(x_{i-1},u_{i}) + A(x_{i-1},u_i) ( x_{i} - x_{i-1} ) +\end{equation} +This then gives the \emph{semi-implicit} scheme +\begin{equation} + x_{i} = x_{i-1} + \Delta t \left [ f(x_{i-1},u_{i}) + A(x_{i-1},u_i) ( + x_{i} - x_{i-1} ) \right ] +\end{equation} +which can be rewritten as: +\begin{equation}\label{eq:implicit} + x_{i} = \left [ I - \Delta t A(x_{i-1},u_i) \right ]^{-1} + \Delta t \left [ f(x_{i-1},u_{i}) - A(x_{i-1},u_i) x_{i-1} \right ] +\end{equation} + + +Because of the approximations invoved, Equation \ref{eq:implicit} is +not guarenteed to be stable. Nevertheless, it should do a much better +job than the corresponding \emph{explicit} method for reasonably +smooth systems. +This method is chosen by setting +\begin{verbatim} +METHOD='Implicit' +\end{verbatim} +in the MTT simpar.txt file. + +A further approximation arises by setting $A(x_{i-1},u_i) = +A(x_{0},u_0)$ ie computing it one only at the beginning of the +simulation. +This method is chosen by setting +\begin{verbatim} +METHOD='ImplicitL' +\end{verbatim} +in the MTT simpar.txt file. + +Both methods make use of the \textbf{smx} ``state-matrix with state $x$'' +representation of MTT which is generated symbolically from the system +bond graph. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_lbl.txt Index: mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_lbl.txt ================================================================== --- mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_lbl.txt +++ mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_lbl.txt @@ -0,0 +1,30 @@ +%SUMMARY ImplicitRC +%DESCRIPTION +%% Label file for system ImplicitRC (ImplicitRC_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type RC + fast lin epsilon;1 + slow lin 1;1 + +% Component type SS + u SS external + y SS external + + + + + ADDED mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_numpar.txt Index: mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_numpar.txt ================================================================== --- mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_numpar.txt +++ mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_numpar.txt @@ -0,0 +1,18 @@ +# Numerical parameter file (ImplicitRC_numpar.txt) +# Generated by MTT at Wednesday June 24 09:21:23 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:06:50 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +epsilon = 1e-3; # ImplicitRC +## Removed by MTT on Sun Aug 17 13:59:26 BST 2003: ## Removed by MTT on Sun Aug 17 13:59:26 BST 2003: c = 1.0; +## Removed by MTT on Sun Aug 17 13:59:26 BST 2003: r = 1.0; + ADDED mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_rep.txt Index: mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_rep.txt ================================================================== --- mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_rep.txt +++ mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_rep.txt @@ -0,0 +1,28 @@ +# Outline report file for system ImplicitRC (ImplicitRC_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2003/08/17 17:03:02 gawthrop +% %% Updated for new MTT +% %% +% %% Revision 1.1 2000/12/28 18:06:50 peterg +% %% To RCS +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt ImplicitRC abg tex +mtt ImplicitRC struc tex +mtt ImplicitRC ode tex +mtt ImplicitRC sm tex +mtt ImplicitRC sm m +mtt ImplicitRC tf tex + +mtt ImplicitRC sro ps + +mtt ImplicitRC numpar tex + +mtt ImplicitRC simpar tex +mtt ImplicitRC odeso ps ADDED mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_simpar.txt Index: mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_simpar.txt ================================================================== --- mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_simpar.txt +++ mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_simpar.txt @@ -0,0 +1,15 @@ +%% Simulation parameters for system ImplicitRC (ImplicitRC_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/08/12 13:29:02 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=10.0 +DT=0.1 +STEPFACTOR=1 ADDED mtt/lib/examples/Simulation/ImplicitRC/examples.sh Index: mtt/lib/examples/Simulation/ImplicitRC/examples.sh ================================================================== --- mtt/lib/examples/Simulation/ImplicitRC/examples.sh +++ mtt/lib/examples/Simulation/ImplicitRC/examples.sh @@ -0,0 +1,28 @@ +#! /bin/sh + +mv ImplicitRC_simpar.txt SAVE +Delta="0.01 0.2 1.0" +for delta in $Delta; do + echo Doing with sample interval = $delta + + cp SAVE ImplicitRC_simpar.txt +cat <>ImplicitRC_simpar.txt +DT=$delta +EOF + mtt -q ImplicitRC odeso dat + cp ImplicitRC_odeso.dat ImplicitRC_odeso.$delta +done + +gnuplot < +%ALIAS in|out Th_out,Hy_out +%% Label file for system In (In_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/07/04 09:41:53 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type SS + [Hy_out] SS external,external + [Th_out] SS external,external + Hy_in SS p_1,internal + Th_in SS t_1,internal + ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_abg.fig Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_abg.fig ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_abg.fig +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_abg.fig @@ -0,0 +1,24 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2700 900 2700 2250 2925 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2700 2700 2700 4050 2925 3825 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4050 2475 5400 2475 5175 2700 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6795 5175 6795 225 1350 225 1350 5175 6795 5175 +4 1 4 0 0 22 20 0.0000 4 270 900 2745 720 SS:[in]\001 +4 1 -1 0 0 22 20 0.0000 4 210 2325 2880 2565 PS:PowerSensor\001 +4 1 4 0 0 22 20 0.0000 4 270 420 2385 2250 [in]\001 +4 1 4 0 0 22 20 0.0000 4 270 615 2385 2835 [out]\001 +4 1 4 0 0 22 20 0.0000 4 270 1035 3735 2250 [power]\001 +4 1 -1 0 0 22 20 0.0000 4 210 1095 6030 2565 Df:Work\001 +4 1 -1 0 0 22 20 0.0000 4 270 630 2655 4410 R:r_l\001 ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_lbl.txt Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_lbl.txt +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_lbl.txt @@ -0,0 +1,36 @@ +%% Label file for system Load (Load_lbl.txt) +%SUMMARY Load +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in + +% Argument aliases +%ALIAS $1 r_l + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + + + PowerSensor + +% Component type Df + Work SS external + +% Component type R + r_l lin flow,r_l + +% Component type SS + [in] SS external,external ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_abg.fig Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_abg.fig ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_abg.fig +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_abg.fig @@ -0,0 +1,21 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2252 4952 3197 4952 3017 5132 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 5400 5625 5400 1530 675 1530 675 5625 5400 5625 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2205 2250 3150 2250 2970 2430 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2250 4725 2250 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2250 2250 2250 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2250 1980 2250 2250 +4 0 -1 0 0 0 20 0.0000000 4 240 1290 3465 2340 SS:Th_out\001 +4 0 -1 0 0 0 20 0.0000000 4 270 1320 3375 5040 SS:Hy_out\001 +4 2 4 0 0 0 20 0.0000000 4 270 1380 2160 5040 SS:[Hy_in]\001 +4 2 4 0 0 0 20 0.0000000 4 240 1350 2115 2340 SS:[Th_in]\001 ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_desc.tex Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_desc.tex ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_desc.tex +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system Out (Out_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:44 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Out} is + displayed in Figure \Ref{Out_abg} and its label + file is listed in Section \Ref{sec:Out_lbl}. + The subsystems are listed in Section \Ref{sec:Out_sub}. ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_lbl.txt Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_lbl.txt +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_lbl.txt @@ -0,0 +1,25 @@ +%SUMMARY Out: Outflow conditions +%DESCRIPTION +%ALIAS in Th_in,Hy_in +%% Label file for system Out (Out_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type SS + [Hy_in] SS external,external + [Th_in] SS external,external + Hy_out SS p_1,internal + Th_out SS t_1,internal + ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_abg.fig Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_abg.fig ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_abg.fig +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_abg.fig @@ -0,0 +1,27 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 1620 2700 2970 2700 2745 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 2700 4725 2700 4500 2925 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 2925 3150 4275 3375 4050 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3150 2475 3150 1125 3375 1350 +2 4 0 2 31 7 50 0 -1 0.000 0 0 7 0 0 5 + 6075 4950 6075 450 450 450 450 4950 6075 4950 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3375 2475 4330 1520 4330 1839 +4 1 0 100 0 18 18 0.0000 4 195 150 3150 2790 1\001 +4 1 0 100 0 18 18 0.0000 4 270 540 3150 990 I:j_s\001 +4 1 4 100 0 18 18 0.0000 4 270 870 1170 2790 SS:[in]\001 +4 1 4 100 0 18 18 0.0000 4 270 1065 5310 2790 SS:[out]\001 +4 1 4 100 0 18 18 0.0000 4 270 1215 3195 4680 SS:[load]\001 +4 1 0 100 0 18 18 0.0000 4 270 1245 4455 1395 Df:speed\001 ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_lbl.txt Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_lbl.txt +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_lbl.txt @@ -0,0 +1,35 @@ +%% Label file for system Shaft (Shaft_lbl.txt) +%SUMMARY Shaft +%DESCRIPTION + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in in +%ALIAS load load +%ALIAS out out + +% Argument aliases +%ALIAS $1 j_s + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + speed SS external + +% Component type I + j_s lin flow,j_s + +% Component type SS + [in] SS external,external + [load] SS external,external + [out] SS external,external ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_abg.fig Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_abg.fig ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_abg.fig +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_abg.fig @@ -0,0 +1,45 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6078 1803 6078 2944 6303 2719 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4230 3375 5584 3375 5359 3600 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6750 3375 8104 3375 7879 3600 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1575 3375 2704 3375 2479 3600 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9450 3375 10579 3375 10354 3600 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 4 + 8550 3870 8550 5850 6975 5850 7200 6075 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 4 + 5175 5850 3375 5850 3375 3825 3600 4050 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6075 6284 6075 7425 6300 7200 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 12152 8550 12152 675 225 675 225 8550 12152 8550 +4 1 4 0 0 2 12 0.0000 4 180 540 8510 3740 [Shaft]\001 +4 1 4 0 0 2 12 0.0000 4 180 540 3379 3739 [Shaft]\001 +4 1 1 1 0 2 30 0.0000 4 300 210 2162 3017 1\001 +4 1 1 1 0 2 30 0.0000 4 300 210 4817 3017 2\001 +4 1 1 1 0 2 30 0.0000 4 300 210 7292 3017 3\001 +4 1 1 1 0 2 30 0.0000 4 300 210 9947 3017 4\001 +4 1 4 0 0 2 12 0.0000 4 180 540 6078 3198 [Heat]\001 +4 1 -1 0 0 22 20 0.0000 4 210 570 1217 3467 In:in\001 +4 1 -1 0 0 2 20 0.0000 4 195 1050 6167 3467 Comb:c1\001 +4 0 -1 0 0 22 20 0.0000 4 210 1005 10758 3468 Out:out\001 +4 1 -1 0 0 2 20 0.0000 4 255 1455 3469 3469 Pump:comp\001 +4 1 -1 0 0 2 20 0.0000 4 255 1335 8780 3470 Pump:turb\001 +4 1 4 0 0 2 12 0.0000 4 180 465 6075 6165 [load]\001 +4 1 -1 0 0 22 20 0.0000 4 210 1500 6078 5943 Shaft:shaft\001 +4 1 -1 0 0 22 20 0.0000 4 210 1380 6075 7740 Load:load\001 +4 1 1 1 0 3 25 0.0000 4 270 1425 6030 8145 Work out\001 +4 1 -1 0 0 22 20 0.0000 4 210 1185 6030 1665 Fuel:fuel\001 +4 1 1 1 0 3 25 0.0000 4 270 1140 5985 1215 Heat in\001 ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_desc.tex Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_desc.tex ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_desc.tex +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_desc.tex @@ -0,0 +1,123 @@ +% -*-latex-*- used to set EMACS into LaTeX-mode +% Verbal description for system SimpleGasTurbine (SimpleGasTurbine_desc.tex) +% Generated by MTT on Tue Jan 13 18:01:55 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/05/18 15:45:50 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{SimpleGasTurbine} is + displayed in Figure \Ref{SimpleGasTurbine_abg} and its label + file is listed in Section \Ref{sec:SimpleGasTurbine_lbl}. + The subsystems are listed in Section \Ref{sec:SimpleGasTurbine_sub}. + + \textbf{SimpleGasTurbine} can be regarded as an single-spool gas + turbine (producing shaft power) with an ideal-gas working fluid. It + corresponds to the simple Joule Cycle as described in Chapter 12 of + Rogers and Mayhew and in Chapter 2 of Cohen, Rogers and + Saravanamutto. However, unlike those examples, the system is + written with dynamics in mind. + + The system is described using an energy Bond Graph- this ensures + that the first law is observed. In particular transformers are used + to explicitly convert between energy covariables. Although this is + a simple model, I believe that it provides the basis for building + complex thermodynamic systems involving gas power cycles. + + +There are five main components: +\begin{enumerate} +\item p1 -- a \textbf{Pump} component representing the compressor + stage. This converts shaft work to energy flow in the working fluid. +\item c1 -- a \textbf{Comb} component representing the combustion + chamber. This converts the heat obtained by burning fuel to energy + flow in the working fluid. +\item t1 -- a \textbf{Turb} component representing the turbine + component. This converts the energy flow in the working fluid to + shaft work +\item j\_s -- an \textbf{I} component representing the combined inertia + of the shaft and compressor and turbine rotors. +\item a \textbf{Load} component to absorb the shaft power. +\end{enumerate} +The components \textbf{In} and \textbf{Out} provide the inlet and +outlet conditions. + +Both \textbf{Pump} and \textbf{Turb} are implemented with the +\emph{polytropic} constitutive relationship with index $n$. When +$n=\gamma=\frac{c_p}{c_v}$ this corresponds to isentropic compression +and expansion and thus the \textbf{SimpleGasTurbine} achieves its +cycle efficiency. However, other values of $n$ can be used to account +for isentropic efficiency of less than unity. + +To obtain a very simple dynamic model (and to avoid the need for an +accurate combustion chamber model) there are no dynamics associated +with the combustion chamber, but rahter it is assumed that the +corresponding temperature is imposed on the component (that is $T_3$ +is the system input) the corresponding heat flow is then an output. + +Both heat input and work output are measured using the \textbf{PS} +(power sensor) component, that for work output is embedded in the +\textbf{Load} component. These can be monitored to give the efficiency +of the \textbf{SimpleGasTurbine}. + +A symbolic steady-state for the model was computed -- see Section +\ref{sec:SimpleGasTurbine_ss.tex}. In particular, the load +resistance was chosen to absorb all the generated work at the steady +state and the shaft inertia was chosen to give a unit time constant +for the linearised system. The mass flow and shaft speeds were taken +as unity. + +For the purposed of simulation, the numerical values given in Examples +12.1 of Chapter 12 of Rogers and Mayhew, except that the isentropic +efficiencies are 100\% ($n=\gamma$) -- see Section +\ref{sec:SimpleGasTurbine_numpar.tex}. + +Simulations were performed starting at the steady state and increasing +the combustion chamber temperature by 10\% at $t=1$ and reducing by +10\% at $t=5$. Graphs of the various outputs are plotted: +\begin{itemize} +\item Figure + \Ref{fig:SimpleGasTurbine_odeso-SimpleGasTurbine-comp-1-T,SimpleGasTurbine-c1-1-T,SimpleGasTurbine-turb-1-T.ps} + -- the temperatures at the output of the + \begin{itemize} + \item compressor, + \item combustion chamber and + \item turbine + \end{itemize} +\item Figure + \Ref{fig:SimpleGasTurbine_odeso-SimpleGasTurbine-fuel-1-Heat-1-y,SimpleGasTurbine-load-1-Work-1-y.ps} + -- the heat input and work output +\item Figure + \Ref{fig:SimpleGasTurbine_odeso-SimpleGasTurbine-shaft-1-speed-1-y.ps} -- the shaft speed and +\item Figure + \Ref{fig:SimpleGasTurbine_odeso-SimpleGasTurbine-c1-1-P.ps} + -- the pressure at the output of the + \begin{itemize} + \item compressor, + \item combustion chamber and + \item turbine + \end{itemize} +\end{itemize} + +This model can be modified extended in various ways to yield related +dynamic systems. For example: +\begin{itemize} +\item an air cooler is obtained by changing the direction of heat and + work flows +\item additional \textbf{Turb} and \textbf{Comb} components add reheat + to the cycle +\item an isentropic nozzle can be added and the work output removed + to give a jet engine. +\end{itemize} + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_input.txt Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_input.txt ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_input.txt +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_input.txt @@ -0,0 +1,20 @@ +# Numerical parameter file (SimpleGasTurbine_input.txt) +# Generated by MTT at Tue Mar 31 12:38:39 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:08:28 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +t_3 = 1000; + +# Set the inputs +## Removed by MTT on Mon Nov 27 15:18:54 GMT 2000: u(1) = t_3 + 0.1*t_3*(t>1) - 0.2*t_3*(t>5); # SimpleGasTurbine (T3) +## Removed by MTT on Wed Jun 11 15:42:11 BST 2003: simplegasturbine_fuel_1_t3_1_u = t_3 + 0.1*t_3*(t>1) - 0.2*t_3*(t>5); + +simplegasturbine__fuel__t3__u = t_3 + 0.1*t_3*(t>1) - 0.2*t_3*(t>5); ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_lbl.txt Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_lbl.txt +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_lbl.txt @@ -0,0 +1,91 @@ +#SUMMARY SimpleGasTurbine: single-spool gas turbine producing shaft power +#DESCRIPTION SimpleGasTurbine can be regarded as an single-spool gas +#DESCRIPTION turbine (producing shaft power) with an ideal-gas working fluid. It +#DESCRIPTION corresponds to the simple Joule Cycle as described in Chapter 12 of +#DESCRIPTION Rogers and Mayhew and in Chapter 2 of Cohen, Rogers and +#DESCRIPTION Saravanamutto. However, unlike those examples, the system is +#DESCRIPTION written with dynamics in mind. + +## Explicitly copy appropriate components +#ALIAS Pump CompressibleFlow/Pump +#ALIAS Comb CompressibleFlow/Comb + +#PAR t_2 +#PAR t_3 +#PAR t_4 +#PAR p_2 +#PAR p_3 +#PAR p_4 +#PAR mdot +#PAR gamma_0 +#PAR q_0 +#PAR w_0 +#PAR omega_0 +#PAR r_p +#PAR c_p +#PAR mom_0 + +#NOTPAR density +#NOTPAR ideal_gas +#NOTPAR q_0 + +## Label file for system SimpleGasTurbine (SimpleGasTurbine_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.5 2000/12/28 18:08:28 peterg +# ## To RCS +# ## +# ## Revision 1.4 1998/07/30 15:27:42 peterg +# ## Use #VAR inplace of dummy component. +# ## +# ## Revision 1.3 1998/07/03 14:54:45 peterg +# ## k_p --> k +# ## k_t --> k +# ## +# ## Revision 1.2 1998/07/03 14:53:38 peterg +# ## Renames tank to comb to be consistent. +# ## +# ## Revision 1.1 1998/05/18 15:46:02 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + +# Component type Fuel + fuel + +# Component type In + in + +# Component type Pump + comp none c_v;density,ideal_gas,r;alpha;effort,k + +# Component type Comb + c1 none m_c;v_c;r + +# Component type Pump + turb none c_v;density,ideal_gas,r;alpha;effort,k + +# Component type Out + out + +# Component type Shaft + shaft none j_s + +# Component type Load + load none r_l + + + + + + + ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt @@ -0,0 +1,59 @@ +# Numerical parameter file (SimpleGasTurbine_numpar.txt) +# Generated by MTT at Tue Mar 31 12:15:00 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:08:28 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_p = 1005.0; +c_v = 718.0; +gamma_0 = c_p/c_v; +alpha = (gamma_0-1)/gamma_0; +k = 1.0; +p_1 = 1e5; # 1 bar +p_4 = p_1; +r = c_p-c_v; +t_1 = 288.0; # In +v_c = 1.0; + +%Set the CC pressure and temperature +t_3 = 1000.0; +r_p = 6.0; +p_3 = r_p*p_1; + +%Find stored mass to give combustion chamber pressure p_3 (at +% temperature t_3 +m_c = (p_3*v_c)/(t_3*r); + +%Equate pressures +p_4 = p_1; +p_2 = p_3; + +%Compute ss temperatures (isentropic) +t_2 = t_1*pow((p_2/p_1),alpha); +t_4 = t_3*pow((p_4/p_3),alpha); + +%Find the steady-state work output +w_0 = c_p*(t_3-t_4) - c_p*(t_2-t_1); + +%Unit mass flow +mdot = 1; + +%Corresponding shaft speed +omega_0 = mdot/k; + +%Compute the corresponding load resistance (to absorb that work) +r_l = w_0/pow((omega_0),2); + +%Compute shaft inertia to give unit time constant (j_s*r_l) +j_s = r_l; + +%Find angular momentum to give shaft speed omega_0 +mom_0 = omega_0*j_s; ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_rep.txt Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_rep.txt ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_rep.txt +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_rep.txt @@ -0,0 +1,43 @@ +# Outline report file for system SimpleGasTurbine (SimpleGasTurbine_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 2003/06/11 16:10:37 gawthrop +% %% Updated examples for latest MTT. +% %% +% %% Revision 1.2 2000/12/28 18:08:28 peterg +% %% To RCS +% %% +% %% Revision 1.1 2000/11/27 18:16:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -o -ss SimpleGasTurbine abg tex +mtt -o -ss SimpleGasTurbine struc tex +mtt -o -ss SimpleGasTurbine sympar tex +mtt -o -ss SimpleGasTurbine ode tex + +mtt -o -ss SimpleGasTurbine sspar r +mtt -o -ss SimpleGasTurbine ss tex +mtt -o -ss SimpleGasTurbine sm tex + +mtt -o -ss SimpleGasTurbine numpar tex +mtt -o -ss SimpleGasTurbine input tex +mtt -o -ss SimpleGasTurbine state tex +mtt -o -ss SimpleGasTurbine simpar tex +mtt -o -ss SimpleGasTurbine odeso ps 'SimpleGasTurbine__comp__T,SimpleGasTurbine__c1__T,SimpleGasTurbine__turb__T' + +mtt -o -ss SimpleGasTurbine odeso ps 'SimpleGasTurbine_fuel_1_Heat_1_y,SimpleGasTurbine_load_1_Work_1_y' + +mtt -o -ss SimpleGasTurbine odeso ps 'SimpleGasTurbine_shaft_1_speed_1_y' + +mtt -o -ss SimpleGasTurbine odeso ps 'SimpleGasTurbine_c1_1_P' + + + + + ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_simp.r Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_simp.r ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_simp.r +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_simp.r @@ -0,0 +1,11 @@ +%% Reduce commands to simplify output for system SimpleGasTurbine (SimpleGasTurbine_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LET c_v = c_p - r; +END; ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r @@ -0,0 +1,51 @@ +% Steady-state parameter file (SimpleGasTurbine_sspar.r) +% Generated by MTT at Thu Mar 26 16:28:59 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 2000/12/28 18:08:28 peterg +% % To RCS +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%Find stored mass to give combustion chamber pressure p_3 (at +% temperature t_3 +m_c := (p_3*v_c)/(t_3*r); + +%Equate pressures +p_4 := p_1; +p_2 := p_3; + +%Compute ss temperatures (isentropic) +t_2 := t_1*pow((p_2/p_1),alpha); +t_4 := t_3*pow((p_4/p_3),alpha); + +%Find the steady-state work output +w_0 := c_p*(t_3-t_4) - c_p*(t_2-t_1); + +%Compute the corresponding load resistance (to absorb that work) +r_l := w_0/pow((omega_0),2); + +%Unit mass flow +mdot := 1; + +%Corresponding shaft speed +omega_0 := mdot/k; + +%Compute shaft inertia to give unit time constant (j_s*r_l) +j_s := r_l; + +%Find angular momentum to give shaft speed omega_0 +mom_0 := omega_0*j_s; + +% Steady-state states +MTTX1 := mom_0; + +% Steady-state inputs - combustion temperature +MTTU1 := t_3; % SimpleGasTurbine (T3) + +;;END; + ADDED mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_state.txt Index: mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_state.txt ================================================================== --- mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_state.txt +++ mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_state.txt @@ -0,0 +1,19 @@ +# State initialisation file (SimpleGasTurbine_state.txt) +# Generated by MTT at Tue Mar 31 12:37:17 BST 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:08:28 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +# Set the states +## Removed by MTT on Mon Nov 27 15:20:21 GMT 2000: x(1) = j_s/k ; # SimpleGasTurbine (j_s) + +## Removed by MTT on Wed Jun 11 15:41:26 BST 2003: simplegasturbine_shaft_1_j_s = j_s/k ; +simplegasturbine__shaft__j_s = j_s/k; ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_abg.fig @@ -0,0 +1,32 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 1351 4051 1351 3826 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4051 1126 4051 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2027 2702 4052 2702 3827 2927 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 2702 6976 2702 6751 2927 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 1351 6976 1351 6751 1576 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8550 3375 8550 405 450 405 450 3375 8550 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 2475 4050 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 2475 4950 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 1125 4950 1575 +4 2 4 0 0 0 20 0.0000000 4 240 930 4096 991 [Th_in]\001 +4 2 -1 0 0 22 20 0.0000000 4 285 1065 1936 1441 SS:Th_in\001 +4 2 -1 0 0 22 20 0.0000000 4 285 1080 1937 2792 SS:Hy_in\001 +4 2 4 0 0 0 20 0.0000000 4 270 960 4097 2342 [Hy_in]\001 +4 0 -1 0 0 22 20 0.0000000 4 285 1215 7111 1441 SS:Th_out\001 +4 0 4 0 0 0 20 0.0000000 4 240 1080 4951 991 [Th_out]\001 +4 0 4 0 0 0 20 0.0000000 4 270 1110 4951 2342 [Hy_out]\001 +4 0 -1 0 0 22 20 0.0000000 4 285 1230 7111 2792 SS:Hy_out\001 +4 1 -1 0 0 22 20 0.0000000 4 285 1110 4545 1980 Pipe:pipe\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_lbl.txt @@ -0,0 +1,29 @@ +%SUMMARY TestPipe +%DESCRIPTION +%% Label file for system TestPipe (TestPipe_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1998/11/20 08:02:53 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%ALIAS Pipe IncompressibleFlow/Pipe + +% Component type Pipe + pipe lin rho;c_p;lin,r + +% Component type SS + Hy_in SS external,external + Hy_out SS external,external + Th_in SS external,external + Th_out SS external,external ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_rep.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_rep.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_rep.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_rep.txt @@ -0,0 +1,26 @@ +# Outline report file for system TestPipe (TestPipe_rep.txt) +# Generated by MTT on" Fri Nov 20 08:16:40 GMT 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt TestPipe abg tex # The system description +mtt TestPipe cbg ps # The causal bond graph +# Uncomment the following lines or add others +mtt TestPipe struc tex # The system structure +mtt TestPipe dae tex # The system dae +# mtt TestPipe ode tex # The system ode +# mtt TestPipe sspar tex # Steady-state parameters +# mtt TestPipe ss tex # Steady state +# mtt TestPipe dm tex # Descriptor matrices (of linearised system) +# mtt TestPipe sm tex # State matrices (of linearised system) +# mtt TestPipe tf tex # Transfer function (of linearised system) +# mtt TestPipe lmfr ps # log modulus of frequency response (of linearised system) +# mtt TestPipe simpar tex # Simulation parameters +# mtt TestPipe numpar tex # Numerical simulation parameters +# mtt TestPipe input tex # Simulation input +# mtt TestPipe odeso ps # Simulation output ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_abg.fig @@ -0,0 +1,38 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 1351 4051 1351 3826 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2027 2702 4052 2702 3827 2927 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 2702 6976 2702 6751 2927 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 1351 6976 1351 6751 1576 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8550 3375 8550 405 450 405 450 3375 8550 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 4500 4500 2475 4725 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4275 4500 4725 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 2475 4050 2925 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 2476 4950 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 1125 4950 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 1125 4050 1575 +4 2 4 0 0 0 20 0.0000 4 255 870 4096 991 [Th_in]\001 +4 2 -1 0 0 22 20 0.0000 4 270 1200 1936 1441 SS:Th_in\001 +4 2 -1 0 0 22 20 0.0000 4 270 1245 1937 2792 SS:Hy_in\001 +4 0 -1 0 0 22 20 0.0000 4 270 1395 7111 1441 SS:Th_out\001 +4 0 4 0 0 0 20 0.0000 4 255 1020 4951 991 [Th_out]\001 +4 0 -1 0 0 22 20 0.0000 4 270 1440 7111 2792 SS:Hy_out\001 +4 2 4 0 0 0 20 0.0000 4 255 885 3735 2565 [Hy_in]\001 +4 0 4 0 0 0 20 0.0000 4 255 1035 5355 2565 [Hy_out]\001 +4 1 4 0 0 0 20 0.0000 4 240 810 4545 2340 [Shaft]\001 +4 1 -1 0 0 22 20 0.0000 4 210 1200 4500 4815 SS:Shaft\001 +4 1 -1 0 0 22 20 0.0000 4 270 1740 4545 1980 lPump:pump\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_lbl.txt @@ -0,0 +1,43 @@ +%SUMMARY TestPump: test of incompressible-flow pump component +%DESCRIPTION +%% Label file for system TestPump (TestPump_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.5 1998/11/20 13:00:27 peterg +% %% Replaces Pump by lPump in ALIAS +% %% +% %% Revision 1.4 1998/11/20 08:31:24 peterg +% %% Fixed alias error +% %% +% %% Revision 1.3 1998/11/20 08:28:41 peterg +% %% Tidied +% %% +% %% Revision 1.2 1998/11/20 08:09:57 peterg +% %% Added alias for Pump +% %% +% %% Revision 1.1 1998/11/20 08:06:28 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%ALIAS lPump IncompressibleFlow/lPump + + +% Component type lPump + pump lin;lin rho;c_p;flow,r_p;k_p;flow,r_l + +% Component type SS + Hy_in SS external,external + Hy_out SS external,external + Shaft SS external,external + Th_in SS external,external + Th_out SS external,external ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_rep.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_rep.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_rep.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_rep.txt @@ -0,0 +1,26 @@ +# Outline report file for system TestPump (TestPump_rep.txt) +# Generated by MTT on" Fri Nov 20 08:19:56 GMT 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt TestPump abg tex # The system description +mtt TestPump cbg ps # The causal bond graph +# Uncomment the following lines or add others +mtt TestPump struc tex # The system structure +#mtt TestPump dae tex # The system dae +mtt TestPump ode tex # The system ode +# mtt TestPump sspar tex # Steady-state parameters +# mtt TestPump ss tex # Steady state +# mtt TestPump dm tex # Descriptor matrices (of linearised system) +# mtt TestPump sm tex # State matrices (of linearised system) +# mtt TestPump tf tex # Transfer function (of linearised system) +# mtt TestPump lmfr ps # log modulus of frequency response (of linearised system) +# mtt TestPump simpar tex # Simulation parameters +# mtt TestPump numpar tex # Numerical simulation parameters +# mtt TestPump input tex # Simulation input +# mtt TestPump odeso ps # Simulation output ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_abg.fig @@ -0,0 +1,36 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 1351 4051 1351 3826 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2027 2702 4052 2702 3827 2927 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 2702 6976 2702 6751 2927 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4951 1351 6976 1351 6751 1576 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8550 3375 8550 405 450 405 450 3375 8550 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2025 1125 2025 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6975 1126 6975 1576 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6975 2476 6975 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2025 2476 2025 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4502 4500 4502 2475 4727 2700 +4 2 4 0 0 0 20 0.0000000 4 240 930 4096 991 [Th_in]\001 +4 2 -1 0 0 22 20 0.0000000 4 285 1065 1936 1441 SS:Th_in\001 +4 2 -1 0 0 22 20 0.0000000 4 285 1080 1937 2792 SS:Hy_in\001 +4 0 -1 0 0 22 20 0.0000000 4 285 1215 7111 1441 SS:Th_out\001 +4 0 4 0 0 0 20 0.0000000 4 240 1080 4951 991 [Th_out]\001 +4 0 -1 0 0 22 20 0.0000000 4 285 1230 7111 2792 SS:Hy_out\001 +4 1 -1 0 0 22 20 0.0000000 4 225 1140 4545 1980 Tank:tank\001 +4 1 4 0 0 0 20 0.0000000 4 240 1170 4590 2295 [Heat_in]\001 +4 2 4 0 0 0 20 0.0000000 4 270 960 3915 2565 [Hy_in]\001 +4 0 4 0 0 0 20 0.0000000 4 270 1110 5130 2565 [Hy_out]\001 +4 1 -1 0 0 0 20 0.0000000 4 240 1590 4500 4860 SS:[Heat_in]\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_lbl.txt @@ -0,0 +1,37 @@ +%SUMMARY TestTank: Equations for incompressible-flow Tank component +%DESCRIPTION +%% Label file for system TestTank (TestTank_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/11/20 08:36:30 peterg +% %% Corrected alias +% %% +% %% Revision 1.2 1998/11/20 08:09:20 peterg +% %% Added alias for Tank +% %% +% %% Revision 1.1 1998/11/20 08:07:20 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%ALIAS Tank IncompressibleFlow/Tank + +% Component type SS + Heat_in SS external,external + Hy_in SS external,external + Hy_out SS external,external + Th_in SS external,external + Th_out SS external,external + +% Component type Tank + tank none rho;c_p;c + ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_rep.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_rep.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_rep.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_rep.txt @@ -0,0 +1,26 @@ +# Outline report file for system TestTank (TestTank_rep.txt) +# Generated by MTT on" Fri Nov 20 08:11:01 GMT 1998. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +mtt TestTank abg tex # The system description +mtt TestTank cbg ps # The causal bond graph +# Uncomment the following lines or add others +mtt TestTank struc tex # The system structure +# mtt TestTank dae tex # The system dae +mtt TestTank ode tex # The system ode +# mtt TestTank sspar tex # Steady-state parameters +# mtt TestTank ss tex # Steady state +# mtt TestTank dm tex # Descriptor matrices (of linearised system) +# mtt TestTank sm tex # State matrices (of linearised system) +# mtt TestTank tf tex # Transfer function (of linearised system) +# mtt TestTank lmfr ps # log modulus of frequency response (of linearised system) +# mtt TestTank simpar tex # Simulation parameters +# mtt TestTank numpar tex # Numerical simulation parameters +# mtt TestTank input tex # Simulation input +# mtt TestTank odeso ps # Simulation output ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2253 2253 3198 2253 3018 2433 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2252 4952 3197 4952 3017 5132 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3196 2026 3196 2476 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3195 4725 3195 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3602 4950 4547 4950 4367 5130 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3602 2250 4547 2250 4367 2430 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 7200 5670 7200 1530 675 1530 675 5670 7200 5670 +4 2 -1 0 0 0 20 0.0000 4 255 1095 2026 2341 SS:Th_in\001 +4 2 -1 0 0 0 20 0.0000 4 255 1110 2071 5041 SS:Hy_in\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 3376 5041 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 3376 2341 0\001 +4 0 4 0 0 0 20 0.0000 4 255 2235 4727 5042 SS:[Hydraulic_out]\001 +4 0 4 0 0 0 20 0.0000 4 255 2085 4772 2342 SS:[Thermal_out]\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_desc.tex Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_desc.tex ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_desc.tex +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system In (In_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:36 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{In} is + displayed in Figure \Ref{In_abg} and its label + file is listed in Section \Ref{sec:In_lbl}. + The subsystems are listed in Section \Ref{sec:In_sub}. ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_lbl.txt @@ -0,0 +1,27 @@ +%SUMMARY In: Inflow conditions +%DESCRIPTION +%% Label file for system In (In_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%ALIAS out Thermal_out,Hydraulic_out +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + + + +% Component type SS + Hy_in SS p_0,external + Th_in SS t_0,external + [Hydraulic_out] SS external,external + [Thermal_out] SS external,external ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_abg.fig @@ -0,0 +1,41 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6302 1127 6302 2252 6527 2027 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6077 1127 6527 1127 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9495 2700 10534 2703 10309 2928 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 6075 5175 3600 5175 3600 3150 3849 3399 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6076 5401 6526 5401 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 4950 6300 4050 6525 4275 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 8775 3150 8775 5175 6525 5175 6750 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6301 6299 6301 5399 6526 5624 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 2700 3060 2700 2835 2925 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4497 2698 5715 2700 5490 2925 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6930 2700 8145 2700 7920 2925 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11925 7200 11925 225 900 225 900 7200 11925 7200 +4 1 4 0 0 2 16 0.0000 4 210 750 3602 3062 [Shaft]\001 +4 1 4 0 0 2 16 0.0000 4 225 1005 6302 2477 [Heat_in]\001 +4 1 4 0 0 2 16 0.0000 4 210 750 8733 3063 [Shaft]\001 +4 1 -1 0 0 2 20 0.0000 4 255 1185 3737 2792 lPump:p1\001 +4 1 -1 0 0 22 20 0.0000 4 210 1110 6257 1037 SS:Heat\001 +4 1 -1 0 0 22 20 0.0000 4 195 150 6301 5266 1\001 +4 1 -1 0 0 22 20 0.0000 4 210 1170 6391 6751 SS:Work\001 +4 1 -1 0 0 22 20 0.0000 4 270 555 6300 3915 I:j_s\001 +4 1 -1 0 0 2 20 0.0000 4 195 1065 6302 2792 Tank:C1\001 +4 1 -1 0 0 2 20 0.0000 4 255 1140 8868 2793 lPump:t1\001 +4 1 -1 0 0 22 20 0.0000 4 210 570 1620 2790 In:in\001 +4 1 -1 0 0 22 20 0.0000 4 210 1005 11116 2791 Out:out\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_desc.tex Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_desc.tex ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_desc.tex +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_desc.tex @@ -0,0 +1,37 @@ +% -*-latex-*- used to set EMACS into LaTeX-mode +% Verbal description for system LiquidTurbine (LiquidTurbine_desc.tex) +% Generated by MTT on Tue Jan 13 18:01:55 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{LiquidTurbine} is + displayed in Figure \Ref{LiquidTurbine_abg} and its label + file is listed in Section \Ref{sec:LiquidTurbine_lbl}. + The subsystems are listed in Section \Ref{sec:LiquidTurbine_sub}. + +\textbf{LiquidTurbine} can be regarded as a single-spool gas turbine +with an incompressible working fluid. Of course, such a device cannot +convert heat to work; however, it provides a useful first step towards +modelling a gas turbine. + +There are three main components: +\begin{enumerate} +\item p1 -- a leaky pump \textbf{lPump} component. This is analogous + to the gas turbine compressor. +\item c1 -- a tank \textbf{Tank} component. This is analogous + to the gas turbine combustion chamber. +\item t1 -- a leaky turbine \textbf{lTurb} component. This is analogous + to the gas turbine turbine. +\end{enumerate} +The components \textbf{In} and \textbf{Out} provide the inlet and +outlet conditions. + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_lbl.txt @@ -0,0 +1,46 @@ +%SUMMARY LiquidTurbine +%DESCRIPTION +%% Label file for system LiquidTurbine (LiquidTurbine_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%ALIAS lPump IncompressibleFlow/lPump +%ALIAS Tank IncompressibleFlow/Tank + +%VAR p_0 +%VAR q_0 +%VAR t_0 + + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +% Component type I + j_s lin flow,j_s + +% Component type Pump + p1 lin;lin rho;c_p;flow,r_p;k_p;flow,r_pl + +% Component type SS + Heat SS external,external + Work SS external,external + +% Component type Turb + t1 lin;lin rho;c_p;flow,r_t;k_t;flow,r_tl + +% Component type Tank + C1 none rho;c_p;c_t + +% Component type In + in + +% Component type Out + out + ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_numpar.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_numpar.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_numpar.txt @@ -0,0 +1,27 @@ +# Numerical parameter file (LiquidTurbine_numpar.txt) +# Generated by MTT at Mon Mar 9 09:16:28 GMT 1998 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:11:16 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_p = 1.0; # LiquidTurbine +c_t = 1.0; # LiquidTurbine +j_s = 1.0; # LiquidTurbine +k_p = 1.0; # LiquidTurbine +k_t = 1.0; # LiquidTurbine +p_0 = 1e5; # In,Out +q_0 = 1e5; # Heat in +r_p = 1.0; # LiquidTurbine +r_pl = 100.0; # LiquidTurbine +r_t = 1.0; # LiquidTurbine +r_tl = 100.0; # LiquidTurbine +rho = 1.0; # LiquidTurbine +t_0 = 300.0; # In,Out ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_rep.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_rep.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_rep.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_rep.txt @@ -0,0 +1,30 @@ +# Outline report file for system LiquidTurbine (LiquidTurbine_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1999/12/21 23:50:25 peterg +% %% Use compiled version +% %% +% %% Revision 1.1 1999/02/21 02:13:25 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -o -ss LiquidTurbine abg tex +mtt -o -ss LiquidTurbine struc tex +mtt -o -ss LiquidTurbine sympar tex +mtt -o -ss LiquidTurbine ss tex +mtt -o -ss LiquidTurbine ode tex + + +mtt -o -ss LiquidTurbine numpar txt +mtt -o -ss LiquidTurbine input txt + +mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__Heat' +mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__Work' +mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__in__Hy_in' +mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__out__Hy_out' +mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__out__Th_out' ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_sspar.r Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_sspar.r ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_sspar.r +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_sspar.r @@ -0,0 +1,23 @@ +% Steady-state parameter file (LiquidTurbine_sspar.r) +% Generated by MTT at Fri Nov 20 11:42:16 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 2000/12/28 18:11:16 peterg +% % To RCS +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Steady-state states +MTTX1 := 1; % LiquidTurbine (j_s) +MTTX2 := p_0*c_t/rho; % LiquidTurbine_C1 (tank) - pressure = p0 +MTTX3 := t_0*p_0*c_t*c_p; % LiquidTurbine_C1 (tank) - temp = t0 +% Steady-state inputs +MTTU1 := q_0; % LiquidTurbine (Heat) +MTTU2 := 0; % LiquidTurbine (Work) +;;END; ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2252 4952 3197 4952 3017 5132 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2205 2250 3150 2250 2970 2430 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2250 4725 2250 5175 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2205 2025 2205 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 4950 4545 4950 4365 5130 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3555 2250 4500 2250 4320 2430 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6075 5850 6075 1530 45 1530 45 5850 6075 5850 +4 2 4 0 0 0 20 0.0000 4 255 2085 2160 5040 SS:[Hydraulic_in]\001 +4 2 4 0 0 0 20 0.0000 4 255 1935 2115 2340 SS:[Thermal_in]\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 3375 5040 0\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 3375 2340 0\001 +4 0 -1 0 0 0 20 0.0000 4 255 1245 4590 2340 SS:Th_out\001 +4 0 -1 0 0 0 20 0.0000 4 255 1260 4635 5040 SS:Hy_out\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_desc.tex Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_desc.tex ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_desc.tex +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system Out (Out_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:44 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Out} is + displayed in Figure \Ref{Out_abg} and its label + file is listed in Section \Ref{sec:Out_lbl}. + The subsystems are listed in Section \Ref{sec:Out_sub}. ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_lbl.txt @@ -0,0 +1,27 @@ +%SUMMARY Out: Outflow conditions +%DESCRIPTION +%% Label file for system Out (Out_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + + +% Component type SS + Hy_out SS p_0,external + Th_out SS t_0,external + [Hydraulic_in] SS external,external + [Thermal_in] SS external,external + ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2253 2253 3198 2253 3018 2433 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2252 4952 3197 4952 3017 5132 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3196 2026 3196 2476 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3602 4950 4547 4950 4367 5130 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3602 2250 4547 2250 4367 2430 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 7200 5670 7200 1530 675 1530 675 5670 7200 5670 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2250 4725 2250 5175 +4 2 -1 0 0 0 20 0.0000 4 285 1140 2026 2341 SS:Th_in\001 +4 2 -1 0 0 0 20 0.0000 4 285 1125 2071 5041 SS:Hy_in\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 3376 5041 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 3376 2341 0\001 +4 0 4 0 0 0 20 0.0000 4 285 2295 4727 5042 SS:[Hydraulic_out]\001 +4 0 4 0 0 0 20 0.0000 4 285 2175 4772 2342 SS:[Thermal_out]\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_desc.tex Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_desc.tex ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_desc.tex +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system In (In_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:36 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{In} is + displayed in Figure \Ref{In_abg} and its label + file is listed in Section \Ref{sec:In_lbl}. + The subsystems are listed in Section \Ref{sec:In_sub}. ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_lbl.txt @@ -0,0 +1,27 @@ +%SUMMARY In: Inflow conditions +%DESCRIPTION +%% Label file for system In (In_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%ALIAS out Thermal_out,Hydraulic_out +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + + + +% Component type SS + Hy_in SS internal,external + Th_in SS external,internal + [Hydraulic_out] SS external,external + [Thermal_out] SS external,external ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_abg.fig @@ -0,0 +1,29 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2252 4952 3197 4952 3017 5132 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2205 2250 3150 2250 2970 2430 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2250 4725 2250 5175 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2205 2025 2205 2475 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 4950 4545 4950 4365 5130 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3555 2250 4500 2250 4320 2430 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 6075 5850 6075 1530 45 1530 45 5850 6075 5850 +4 2 4 0 0 0 20 0.0000 4 285 2145 2160 5040 SS:[Hydraulic_in]\001 +4 2 4 0 0 0 20 0.0000 4 285 2025 2115 2340 SS:[Thermal_in]\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 3375 5040 0\001 +4 1 -1 0 0 0 20 0.0000 4 210 150 3375 2340 0\001 +4 0 -1 0 0 0 20 0.0000 4 285 1290 4590 2340 SS:Th_out\001 +4 0 -1 0 0 0 20 0.0000 4 285 1275 4635 5040 SS:Hy_out\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_desc.tex Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_desc.tex ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_desc.tex +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system Out (Out_desc.tex) +% Generated by MTT on Tue Jan 13 18:02:44 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Out} is + displayed in Figure \Ref{Out_abg} and its label + file is listed in Section \Ref{sec:Out_lbl}. + The subsystems are listed in Section \Ref{sec:Out_sub}. ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_lbl.txt @@ -0,0 +1,26 @@ +%SUMMARY Out: Outflow conditions +%DESCRIPTION +%% Label file for system Out (Out_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + + +% Component type SS + Hy_out SS p_0,internal + Th_out SS t_0,internal + [Hydraulic_in] SS external,external + [Thermal_in] SS external,external ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_abg.fig @@ -0,0 +1,39 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 6210 4140 6390 4365 +4 1 0 100 0 18 18 0.0000 4 195 150 6300 4365 0\001 +-6 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9495 2700 10534 2703 10309 2928 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2025 2700 3060 2700 2835 2925 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4497 2698 5715 2700 5490 2925 +2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6930 2700 8145 2700 7920 2925 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 11925 7200 11925 225 900 225 900 7200 11925 7200 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6300 4050 6300 2925 6525 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6525 4275 7650 4275 7425 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4950 4275 6075 4275 5850 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2475 4275 3600 4275 3375 4500 +4 1 4 0 0 2 16 0.0000 4 240 1020 6302 2477 [Heat_in]\001 +4 1 -1 0 0 2 20 0.0000 4 210 1245 6302 2792 TankC:t1\001 +4 1 -1 0 0 2 20 0.0000 4 285 945 8868 2793 Pipe:p2\001 +4 1 -1 0 0 22 20 0.0000 4 225 600 1620 2790 In:in\001 +4 1 -1 0 0 22 20 0.0000 4 225 1080 11116 2791 Out:out\001 +4 1 -1 0 0 2 20 0.0000 4 285 945 3737 2792 Pipe:p1\001 +4 1 0 100 0 18 18 0.0000 4 210 1305 4275 4365 RS:heater\001 +4 1 0 100 0 18 18 0.0000 4 270 1020 1935 4365 Se:V_in\001 +4 1 0 100 0 18 18 0.0000 4 270 1215 8280 4365 De:T_out\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_desc.tex Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_desc.tex ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_desc.tex +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_desc.tex @@ -0,0 +1,55 @@ +% -*-latex-*- used to set EMACS into LaTeX-mode +% Verbal description for system ShowerHeater (ShowerHeater_desc.tex) +% Generated by MTT on Tue Jan 13 18:01:55 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{ShowerHeater} is + displayed in Figure \Ref{ShowerHeater_abg} and its label + file is listed in Section \Ref{sec:ShowerHeater_lbl}. + The subsystems are listed in Section \Ref{sec:ShowerHeater_sub}. + +\textbf{ShowerHeater} is a very elementary model of an electric heater suitable for +a shower. It illustates the use of bond graph components which are +internally pseudo, but externally true bond graphs +(temperature/entropy flow). + +There are three main components: +\begin{enumerate} +\item p1 and p2 -- a \textbf{Pipe} component (see Section + \Ref{sec:Pipe}). It is assumed that the pipes have zero flow + resistance and thus do not generate heat via flow resistance. +\item t1 -- a tank \textbf{Tank} component. +\item Heater -- a resistive heater modelled by the thermodynamic + \textbf{R} component \textbf{RS}. +\end{enumerate} +Other components could be added to represent thermal conduction and +thermal capacities. + +The components \textbf{In} and \textbf{Out} provide the inlet and +outlet conditions. + +The three inputs are +\begin{description} +\item[$u_1$] The flow rate +\item[$u_2$] The inlet temperature +\item[$u_3$] The voltage across the heating element. +\end{description} +The single output is +\begin{description} +\item[$y_1$] The outflow temperature +\end{description} +and the state is +\begin{description} +\item[$x_1$] The heat contained in the tank. +\end{description} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_input.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_input.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_input.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_input.txt @@ -0,0 +1,17 @@ +# -*-octave-*- Put Emacs into octave-mode +# Input specification (ShowerHeater_input.txt) +# Generated by MTT at Tue Dec 14 10:03:59 EST 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 18:11:47 peterg +## To RCS +## +############################################################### + +# Set the inputs +showerheater__in__hy_in = 1e-4*(t>30); # Inflow +showerheater__in__th_in = 280; # In temperature +showerheater__v_in__u = 240*((t<60)&&(t>1)); # Input voltage ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_lbl.txt @@ -0,0 +1,46 @@ +#SUMMARY ShowerHeater +#DESCRIPTION +## Label file for system ShowerHeater (ShowerHeater_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.1 2000/12/28 18:11:47 peterg +# ## To RCS +# ## +# ############################################################### + +#NOTPAR t_0 + +#ALIAS Pipe IncompressibleFlow/Pipe + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + +# Component type Pipe + p1 lin rho;c_p;flow,0 + p2 lin rho;c_p;flow,0 + + +# Component type TankC + t1 TankC rho;c_p;v + +# Component type In + in + +# Component type Out + out + +# Component type RS + heater lin flow,r_h + +# Component type Se + V_in SS external + +# Component type De + T_out SS external ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_numpar.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_numpar.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_numpar.txt @@ -0,0 +1,21 @@ +# -*-octave-*- Put Emacs into octave-mode +# Numerical parameter file (ShowerHeater_numpar.txt) +# Generated by MTT at Tue Dec 14 09:52:42 EST 1999 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:11:47 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Parameters +c_p = 4.184*1e3; # Specific heat +p_0 = 0.0; # Ambient pressure +r_h = 10.0; # Heater resistance +rho = 1e3; # Density +v = 1e-3; # Volume (1 lit) +t_0 = 1.0; # Added by MTT on Wed Aug 06 19:05:01 BST 2003 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_rep.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_rep.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_rep.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_rep.txt @@ -0,0 +1,26 @@ +# Outline report file for system ShowerHeater (ShowerHeater_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 2000/12/28 18:11:47 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/02/21 02:13:25 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt ShowerHeater abg tex +mtt ShowerHeater struc tex +mtt ShowerHeater sympar tex +mtt ShowerHeater ode tex + + +mtt ShowerHeater numpar txt +mtt ShowerHeater input txt + +mtt ShowerHeater odeso ps + ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system ShowerHeater (ShowerHeater_simpar.txt) +# Generated by MTT on Tue Dec 14 10:05:57 EST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 100.0; # Last time in simulation +DT = 0.5; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt_old Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt_old ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt_old +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt_old @@ -0,0 +1,18 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system ShowerHeater (ShowerHeater_simpar.txt) +# Generated by MTT on Tue Dec 14 10:05:57 EST 1999. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + + +LAST = 100.0; # Last time in simulation +DT = 0.5; # Print interval +STEPFACTOR = 1; # Integration steps per print interval +WMIN = -1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps +INPUT = 1; # Index of the input ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_sspar.r Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_sspar.r ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_sspar.r +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_sspar.r @@ -0,0 +1,20 @@ +% Steady-state parameter file (ShowerHeater_sspar.r) +% Generated by MTT at Fri Nov 20 11:42:16 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Steady-state states +MTTX1 := 1; % ShowerHeater (j_s) +MTTX2 := p_0*c/rho; % ShowerHeater_C1 (tank) - pressure = p0 +MTTX3 := t_0*p_0*c*c_p; % ShowerHeater_C1 (tank) - temp = t0 +% Steady-state inputs +MTTU1 := q_0; % ShowerHeater (Heat) +MTTU2 := 0; % ShowerHeater (Work) +;;END; ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_state.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_state.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_state.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_state.txt @@ -0,0 +1,16 @@ +# -*-octave-*- Put Emacs into octave-mode +# Initial state file (ShowerHeater_state.txt) +# Generated by MTT at Tue Dec 14 10:06:08 EST 1999 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 18:11:47 peterg +## To RCS +## +############################################################### + +# Set the states +## Removed by MTT on Wed Aug 6 19:07:29 BST 2003: mttx(1) +showerheater__t1__tank = 280*rho*v*c_p; # Initial heat in tank ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_TankC_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_TankC_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_TankC_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_TankC_abg.fig @@ -0,0 +1,81 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2430 2070 3600 3105 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2445 2477 3570 2477 3345 2702 +4 1 1 1 0 3 20 0.0000 4 210 180 2850 2297 T\001 +4 1 1 1 0 3 20 0.0000 4 210 150 2985 2387 1\001 +4 1 1 1 0 3 20 0.0000 4 210 150 2985 3062 1\001 +4 1 1 1 0 3 20 0.0000 4 210 180 2850 2927 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2850 2657 .\001 +-6 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5865 2477 6990 2477 6765 2702 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4065 5627 6990 5627 6765 5852 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7440 2478 8565 2478 8340 2703 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9241 2479 10366 2479 10141 2704 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7440 5626 10365 5626 10140 5851 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 8609 6571 5864 6571 5864 1801 8609 1801 8609 6571 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6989 2701 7439 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7214 2702 7214 3827 7439 3602 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 5850 4050 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 1127 3825 2252 4050 2027 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4065 2475 5190 2475 4965 2700 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 12825 7155 12825 225 225 225 225 7155 12825 7155 +4 0 4 0 0 0 20 0.0000 4 285 2295 10546 5719 SS:[Hydraulic_out]\001 +4 0 4 0 0 0 20 0.0000 4 285 2175 10501 2569 SS:[Thermal_out]\001 +4 2 4 0 0 0 20 0.0000 4 285 2145 4019 5716 SS:[Hydraulic_in]\001 +4 1 -1 0 0 22 20 0.0000 4 225 390 5550 2567 ES\001 +4 1 1 1 0 3 20 0.0000 4 210 150 4606 5538 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 4471 5808 .\001 +4 1 1 1 0 3 20 0.0000 4 210 180 4471 5448 P\001 +4 1 1 1 0 3 20 0.0000 4 210 210 4471 6078 V\001 +4 1 4 0 0 0 20 0.0000 4 270 300 5280 2252 [s]\001 +4 1 4 0 0 0 20 0.0000 4 270 315 5820 2252 [e]\001 +4 1 1 1 0 3 20 0.0000 4 210 150 6406 2388 1\001 +4 1 1 1 0 3 20 0.0000 4 210 660 6584 2206 T - T\001 +4 1 1 1 0 3 20 0.0000 4 210 150 6899 2386 0\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6497 2659 .\001 +4 1 1 1 0 3 20 0.0000 4 210 195 6497 2929 E\001 +4 1 -1 0 0 22 20 0.0000 4 225 915 7214 4186 C:tank\001 +4 1 -1 0 0 22 20 0.0000 4 210 165 7215 5762 0\001 +4 1 -1 0 0 22 20 0.0000 4 225 390 8925 2568 ES\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9648 5811 .\001 +4 1 1 1 0 3 20 0.0000 4 210 180 9648 5451 P\001 +4 1 1 1 0 3 20 0.0000 4 210 210 9648 6081 V\001 +4 1 1 1 0 3 20 0.0000 4 210 150 9783 5541 2\001 +4 1 1 1 0 3 20 0.0000 4 210 195 7846 2930 E\001 +4 1 4 0 0 0 20 0.0000 4 270 315 8655 2208 [e]\001 +4 1 4 0 0 0 20 0.0000 4 270 300 9150 2208 [s]\001 +4 1 1 1 0 3 20 0.0000 4 210 180 9648 2301 T\001 +4 1 1 1 0 3 20 0.0000 4 210 150 9783 2391 2\001 +4 1 1 1 0 3 20 0.0000 4 210 180 9648 2931 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9648 2661 .\001 +4 1 1 1 0 3 20 0.0000 4 210 150 9783 3066 2\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7846 2660 .\001 +4 1 1 1 0 3 20 0.0000 4 210 660 7936 2209 T - T\001 +4 1 1 1 0 3 20 0.0000 4 210 150 8251 2389 0\001 +4 1 1 1 0 3 20 0.0000 4 210 150 7758 2391 2\001 +4 1 1 1 0 3 20 0.0000 4 285 2550 7259 6346 Pseudo Bond Graph\001 +4 1 4 0 0 0 20 0.0000 4 285 1530 3870 945 SS:[Heat_in]\001 +4 1 -1 0 0 22 20 0.0000 4 210 165 7245 2565 0\001 +4 1 -1 0 0 22 20 0.0000 4 210 165 3825 2565 0\001 +4 2 4 0 0 0 20 0.0000 4 285 2025 2385 2565 SS:[Thermal_in]\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_abg.fig Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_abg.fig ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_abg.fig +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_abg.fig @@ -0,0 +1,81 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 2430 2070 3600 3105 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2445 2477 3570 2477 3345 2702 +4 1 1 1 0 3 20 0.0000 4 210 180 2850 2297 T\001 +4 1 1 1 0 3 20 0.0000 4 210 150 2985 2387 1\001 +4 1 1 1 0 3 20 0.0000 4 210 150 2985 3062 1\001 +4 1 1 1 0 3 20 0.0000 4 210 180 2850 2927 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 2850 2657 .\001 +-6 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5865 2477 6990 2477 6765 2702 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4065 5627 6990 5627 6765 5852 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7440 2478 8565 2478 8340 2703 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 9241 2479 10366 2479 10141 2704 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7440 5626 10365 5626 10140 5851 +2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 + 8609 6571 5864 6571 5864 1801 8609 1801 8609 6571 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6989 2701 7439 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7214 2702 7214 3827 7439 3602 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4050 5850 4050 5400 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3825 1127 3825 2252 4050 2027 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4065 2475 5190 2475 4965 2700 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 12825 7155 12825 225 225 225 225 7155 12825 7155 +4 0 4 0 0 0 20 0.0000 4 285 2295 10546 5719 SS:[Hydraulic_out]\001 +4 0 4 0 0 0 20 0.0000 4 285 2175 10501 2569 SS:[Thermal_out]\001 +4 2 4 0 0 0 20 0.0000 4 285 2145 4019 5716 SS:[Hydraulic_in]\001 +4 1 -1 0 0 22 20 0.0000 4 225 390 5550 2567 ES\001 +4 1 1 1 0 3 20 0.0000 4 210 150 4606 5538 1\001 +4 1 1 1 0 3 30 0.0000 4 60 120 4471 5808 .\001 +4 1 1 1 0 3 20 0.0000 4 210 180 4471 5448 P\001 +4 1 1 1 0 3 20 0.0000 4 210 210 4471 6078 V\001 +4 1 4 0 0 0 20 0.0000 4 270 300 5280 2252 [s]\001 +4 1 4 0 0 0 20 0.0000 4 270 315 5820 2252 [e]\001 +4 1 1 1 0 3 20 0.0000 4 210 150 6406 2388 1\001 +4 1 1 1 0 3 20 0.0000 4 210 660 6584 2206 T - T\001 +4 1 1 1 0 3 20 0.0000 4 210 150 6899 2386 0\001 +4 1 1 1 0 3 30 0.0000 4 60 120 6497 2659 .\001 +4 1 1 1 0 3 20 0.0000 4 210 195 6497 2929 E\001 +4 1 -1 0 0 22 20 0.0000 4 225 915 7214 4186 C:tank\001 +4 1 -1 0 0 22 20 0.0000 4 210 165 7215 5762 0\001 +4 1 -1 0 0 22 20 0.0000 4 225 390 8925 2568 ES\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9648 5811 .\001 +4 1 1 1 0 3 20 0.0000 4 210 180 9648 5451 P\001 +4 1 1 1 0 3 20 0.0000 4 210 210 9648 6081 V\001 +4 1 1 1 0 3 20 0.0000 4 210 150 9783 5541 2\001 +4 1 1 1 0 3 20 0.0000 4 210 195 7846 2930 E\001 +4 1 4 0 0 0 20 0.0000 4 270 315 8655 2208 [e]\001 +4 1 4 0 0 0 20 0.0000 4 270 300 9150 2208 [s]\001 +4 1 1 1 0 3 20 0.0000 4 210 180 9648 2301 T\001 +4 1 1 1 0 3 20 0.0000 4 210 150 9783 2391 2\001 +4 1 1 1 0 3 20 0.0000 4 210 180 9648 2931 S\001 +4 1 1 1 0 3 30 0.0000 4 60 120 9648 2661 .\001 +4 1 1 1 0 3 20 0.0000 4 210 150 9783 3066 2\001 +4 1 1 1 0 3 30 0.0000 4 60 120 7846 2660 .\001 +4 1 1 1 0 3 20 0.0000 4 210 660 7936 2209 T - T\001 +4 1 1 1 0 3 20 0.0000 4 210 150 8251 2389 0\001 +4 1 1 1 0 3 20 0.0000 4 210 150 7758 2391 2\001 +4 1 1 1 0 3 20 0.0000 4 285 2550 7259 6346 Pseudo Bond Graph\001 +4 1 4 0 0 0 20 0.0000 4 285 1530 3870 945 SS:[Heat_in]\001 +4 1 -1 0 0 22 20 0.0000 4 210 165 7245 2565 0\001 +4 1 -1 0 0 22 20 0.0000 4 210 165 3825 2565 0\001 +4 2 4 0 0 0 20 0.0000 4 285 2025 2385 2565 SS:[Thermal_in]\001 ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_cr.r Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_cr.r ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_cr.r +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_cr.r @@ -0,0 +1,15 @@ +% Constitutive relation file for TankC (TankC_cr.r) +% Generated by MTT at Thu Mar 5 10:30:23 GMT 1998 + +OPERATOR TankC; + +%Pressure +% -- not relevant here + +%Temperature +FOR ALL COMP,rho,c_p,volume,Energy +LET TankC(COMP,rho,c_p,volume,effort,1, + Energy,state,1 + ) = Energy/(volume*rho*c_p); + +END; ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_desc.tex Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_desc.tex ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_desc.tex +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_desc.tex @@ -0,0 +1,14 @@ +% Verbal description for system TankC (TankC_desc.tex) +% Generated by MTT on Tue Jan 13 18:03:04 GMT 1998. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{TankC} is + displayed in Figure \Ref{TankC_abg} and its label + file is listed in Section \Ref{sec:TankC_lbl}. + The subsystems are listed in Section \Ref{sec:TankC_sub}. ADDED mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_lbl.txt Index: mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_lbl.txt +++ mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_lbl.txt @@ -0,0 +1,58 @@ +%% Label file for system TankC (TankC_lbl.txt) +%SUMMARY TankC: TankC of hot incompressible liquid - fixed volume +%DESCRIPTION rho - density; c_p - specific heat; v - volume +%DESCRIPTION Typical lable: tank TankC rho;c_p;v + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.3 1998/11/20 13:20:27 peterg +% %% Aliased ports +% %% +% %% Revision 1.2 1998/11/20 09:46:34 peterg +% %% Modernised lbl syntax +% %% +% %% Revision 1.1 1998/11/20 08:57:19 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Port aliases +%ALIAS in Thermal_in,Hydraulic_in +%ALIAS out Thermal_out,Hydraulic_out + +%ALIAS Th_in Thermal_in +%ALIAS Hy_in Hydraulic_in + +%ALIAS Th_out Thermal_out +%ALIAS Hy_out Hydraulic_out + +%ALIAS Heat Heat_in + +% Argument aliases +%ALIAS $1 rho +%ALIAS $2 c_p +%ALIAS $3 v + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% component-name cr_name arg1,arg2,..argn +% blank + +% ---- Component labels ---- + +% Component type C + tank TankC rho,c_p,v + +% Component type SS + [Heat_in] SS external,external + [Hydraulic_in] SS external,external + [Hydraulic_out] SS external,external + [Thermal_in] SS external,external + [Thermal_out] SS external,external + + + ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_abg.fig Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_abg.fig +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_abg.fig @@ -0,0 +1,37 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 3150 5850 3150 5625 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 4500 4275 5850 4275 5625 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1800 3150 3150 3150 2925 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3150 2925 3150 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1800 4050 1800 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1777 4275 3127 4275 2902 4500 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 4095 4500 4545 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6975 3150 8325 3150 8100 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6975 2925 6975 3375 +2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 + 2925 2025 4725 2025 4725 5400 2925 5400 2925 2025 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9450 5850 9450 1575 450 1575 450 5850 9450 5850 +4 0 -1 0 0 0 20 0.0000000 4 240 870 6030 3240 RT:r_2\001 +4 2 4 0 0 0 20 0.0000000 4 240 690 2835 3060 [t_in]\001 +4 0 4 0 0 0 20 0.0000000 4 240 840 4770 3015 [t_out]\001 +4 2 4 0 0 0 20 0.0000000 4 240 735 2880 4185 [e_in]\001 +4 0 4 0 0 0 20 0.0000000 4 240 885 4770 4185 [e_out]\001 +4 2 -1 0 0 0 20 0.0000000 4 240 900 1620 3240 SS:T_1\001 +4 0 -1 0 0 0 20 0.0000000 4 240 900 8460 3240 SS:T_2\001 +4 2 -1 0 0 0 20 0.0000000 4 240 780 1665 4365 SS:I_r\001 +4 0 -1 0 0 0 20 0.0000000 4 240 930 5985 4365 SS:V_0\001 +4 1 -1 0 0 0 20 0.0000000 4 270 1575 3780 3825 Segment:s*20\001 ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_desc.tex Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_desc.tex +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_desc.tex @@ -0,0 +1,67 @@ +% Verbal description for system HeatedRod (HeatedRod_desc.tex) +% Generated by MTT on Thu Sep 4 18:05:09 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/09/11 16:16:50 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{table}[htbp] + \begin{center} + \leavevmode + \begin{tabular}{l l l} + \hline + Parameter & Symbol & Value \\ + \hline + Length & $L_r$ & 1m \\ + Diameter & $D_r$ & 1mm \\ + Resistivity & $\rho$ & $1.68\times10^{-9} \Omega$m \\ + Thermal conductivity & $\sigma$ & 390 W$\text{m}^{-1}$\\ + Thermal capacity & $\kappa$ & 380 J$\text{m}^{-3}$\\ + \hline + \end{tabular} + \caption{Heated rod parameters} + \label{tab:rod} + \end{center} +\end{table} + + System \textbf{HeatedRod} is a model of a well-insulated rod of copper with an + electric current passing through it which warms it up. The two ends of + the rod are fixed at ambient temperature; this is where all the heat + loss occurs. + + This example introduces the idea of the {\bf FP}, \textbf{RT} and + \textbf{CT} components in the context of thermal conduction. + + The model is similar to that described in chapter 8 of \citeN{Cel91}. + However, instead of representing the thermal resistance by {\bf RS} + components and reinserting the entropy flow, the {\bf RT} component + uses two {\bf FP} components to convert from true to pseudo bonds and + back again. Similary, the thermal capacity is modelled by the {\bf + CT} component. + + This distributed system (which strictly speaking has a partial + differential equation model) is approximated by an ordinary + diffferential equation model by modelling the system by a number of + discrete segments of length $\Delta x$. Each segment model consists + of two conceptual parts. + \begin{itemize} + \item An ideal lump of copper with no thermal resistance but with the + normal attributes of electrical resistance (modelled by the + \textbf{RS} component and thermal capacity (modelled by the + \textbf{CF} component). + \item A thin lump wtih thermal resistance but no thermal capacity or + electrical resistance (modeled by the \textbf{RT} component). + \end{itemize} +At this level of the hierarchy, all bonds are true energy bonds and +thus energy conservation is assured. Note that the \textbf{RS} +component correctely transforms electrical to thermal energy. + +The system was simulated with a total of nine lumps whilst passing a +current of 1A though the rod for a total of 10s. The initial +temperature and the end temperatures were all set at 300K. ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_input.txt Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_input.txt ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_input.txt +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_input.txt @@ -0,0 +1,19 @@ +# Numerical parameter file (HeatedRod_input.txt) +# Generated by MTT at Thu Sep 4 16:11:06 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:12:41 peterg +# %% To RCS +# %% +# %% Revision 1.1 1998/08/15 13:40:20 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Thu Jun 12 14:33:52 BST 2003: u() = 10.0*(t<5.0); # I_r +heatedrod__i_r = 10.0*(t<5.0); # I_r ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_lbl.txt Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_lbl.txt +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_lbl.txt @@ -0,0 +1,48 @@ +%SUMMARY HeatedRod: Thermal/Electrical model of Electric rod +%DESCRIPTION Introduces the idea of the ES component which +%DESCRIPTION transforms a relative-temperature/enthalpy pseudo bond +%DESCRIPTION (at the [e]port) into an absolute-temperature/enntropy +%DESCRIPTION energy bond (at the [s] port) and vice versa. + +%VAR rod_length +%VAR rod_radius +%VAR electrical_resistivity +%VAR thermal_resistivity +%VAR thermal_capacity +%VAR segments +%VAR area +%VAR delta_x +%VAR volume +%VAR density +%VAR mass + +%% Label file for system HeatedRod (HeatedRod_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.1 1997/09/11 16:16:29 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type RT + r_2 lin flow,r_2 + +% Component type SS + I_r SS internal,external + T_1 SS t_0,internal + T_2 SS t_0,internal + V_0 SS internal,internal + +% Component type Segment + s ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_numpar.txt Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_numpar.txt +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_numpar.txt @@ -0,0 +1,39 @@ +# Numerical parameter file (HeatedRod_numpar.txt) +# Generated by MTT at Thu Sep 4 16:11:04 BST 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 1998/08/15 13:40:33 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +# Constants for copper +density = 8.96; +rod_length = 1.0; +rod_radius = 1e-3; +electrical_resistivity = 16.8*0.000000001; +thermal_resistivity = 1/390.0; +thermal_capacity = 380.0; + + +segments = 20; +area = pi*rod_radius*rod_radius; +delta_x = rod_length/segments; +volume = area*delta_x; +mass = volume*density; + +# Parameters +c_t = thermal_capacity*mass; +r = electrical_resistivity*delta_x/area; +r_t = thermal_resistivity*delta_x/area; +r_2 = r_t; +t_0 = 300; # Ambient + + + + ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_rep.txt Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_rep.txt ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_rep.txt +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_rep.txt @@ -0,0 +1,26 @@ +# Outline report file for system HeatedRod (HeatedRod_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1999/12/21 23:53:04 peterg +% %% Compiled version +% %% +% %% Revision 1.1 1999/02/21 02:14:29 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -o -ss HeatedRod abg tex +mtt -o -ss HeatedRod struc tex +mtt -o -ss HeatedRod ode tex +mtt -o -ss HeatedRod ss tex +mtt -o -ss HeatedRod sm tex +mtt -o -ss HeatedRod lmfr ps + +mtt -o -ss HeatedRod numpar txt +mtt -o -ss HeatedRod input txt +mtt -o -ss HeatedRod odeso ps + ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_simpar.txt Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_simpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_simpar.txt +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_simpar.txt @@ -0,0 +1,21 @@ +# -*-octave-*- Put Emacs into octave-mode +# Simulation parameters for system HR (HR_simpar.txt) +# Generated by MTT on Wednesday July 29 13:59:50 BST 1998. +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 1998/08/15 13:40:47 peterg +## Initial revision +## +############################################################### + + +LAST = 10; # Last time in simulation +WMIN = 1; # Minimum frequency = 10^WMIN +WMAX = 2; # Maximum frequency = 10^WMAX +WSTEPS = 100; # Number of frequency steps + +STEPFACTOR = 1; # Added automatically +DT = 0.1; # Added automatically ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_sspar.r Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_sspar.r ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_sspar.r +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_sspar.r @@ -0,0 +1,27 @@ +% Steady-state parameter file (HeatedRod_sspar.r) +% Generated by MTT at Thu Jun 25 09:32:38 BST 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Steady-state states +MTTX1 := t_0*c_t; % HeatedRod_s_c_t (c) +MTTX2 := t_0*c_t; % HeatedRod_s_c_t (c) +MTTX3 := t_0*c_t; % HeatedRod_s_c_t (c) +MTTX4 := t_0*c_t; % HeatedRod_s_c_t (c) +MTTX5 := t_0*c_t; % HeatedRod_s_c_t (c) +MTTX6 := t_0*c_t; % HeatedRod_s_c_t (c) +MTTX7 := t_0*c_t; % HeatedRod_s_c_t (c) +MTTX8 := t_0*c_t; % HeatedRod_s_c_t (c) +MTTX9 := t_0*c_t; % HeatedRod_s_c_t (c) + +% Steady-state inputs +MTTU1 := 1.0; % HeatedRod (I_r) + +;;END; ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_state.txt Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_state.txt ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_state.txt +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_state.txt @@ -0,0 +1,56 @@ +# -*-octave-*- Put Emacs into octave-mode +# Initial state file (HeatedRod_state.txt) +# Generated by MTT at Sat Aug 15 15:34:41 BST 1998 +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +## Revision 1.1 2000/12/28 18:12:41 peterg +## To RCS +## +############################################################### + +# Set the states +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(1) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(2) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(3) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(4) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(5) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(6) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(7) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(8) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(9) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(10) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(11) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(12) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(13) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(14) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(15) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(16) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(17) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(18) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(19) = c_t*t_0; # c (HeatedRod_s_c_t) +## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(20) = +## c_t*t_0; # c (HeatedRod_s_c_t) + +heatedrod__s__10__c_t__c = c_t*t_0; +heatedrod__s__11__c_t__c = c_t*t_0; +heatedrod__s__12__c_t__c = c_t*t_0; +heatedrod__s__13__c_t__c = c_t*t_0; +heatedrod__s__14__c_t__c = c_t*t_0; +heatedrod__s__15__c_t__c = c_t*t_0; +heatedrod__s__16__c_t__c = c_t*t_0; +heatedrod__s__17__c_t__c = c_t*t_0; +heatedrod__s__18__c_t__c = c_t*t_0; +heatedrod__s__19__c_t__c = c_t*t_0; +heatedrod__s__20__c_t__c = c_t*t_0; +heatedrod__s__2__c_t__c = c_t*t_0; +heatedrod__s__3__c_t__c = c_t*t_0; +heatedrod__s__4__c_t__c = c_t*t_0; +heatedrod__s__5__c_t__c = c_t*t_0; +heatedrod__s__6__c_t__c = c_t*t_0; +heatedrod__s__7__c_t__c = c_t*t_0; +heatedrod__s__8__c_t__c = c_t*t_0; +heatedrod__s__9__c_t__c = c_t*t_0; +heatedrod__s__c_t__c = c_t*t_0; ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_abg.fig Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_abg.fig +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_abg.fig @@ -0,0 +1,44 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1306 2476 2881 2476 2656 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3781 2476 5356 2476 5131 2701 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5761 2476 8550 2475 8325 2700 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5581 4276 5581 2701 5806 2926 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5581 6301 5581 4726 5806 4951 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1350 6525 5356 6526 5131 6751 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5806 6526 8550 6525 8325 6750 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5806 2701 6920 3815 6601 3815 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5581 2251 5581 676 5806 901 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5356 676 5806 676 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9900 7425 9900 90 45 90 45 7425 9900 7425 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 7650 4455 7650 1800 1575 1800 1575 4455 7650 4455 +2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 + 7650 6975 7650 4545 1575 4545 1575 6975 7650 6975 +4 1 -1 0 0 0 20 0.0000000 4 240 810 3331 2566 RT:r_t\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5581 2566 0\001 +4 1 -1 0 0 0 20 0.0000000 4 210 555 5581 4591 RS:r\001 +4 1 -1 0 0 0 20 0.0000000 4 210 150 5581 6616 1\001 +4 1 -1 0 0 0 20 0.0000000 4 240 840 7021 4141 CT:c_t\001 +4 1 -1 0 0 0 20 0.0000000 4 240 870 5581 586 SS:T_s\001 +4 2 4 0 0 0 20 0.0000000 4 240 1020 1261 2566 SS:[t_in]\001 +4 0 4 0 0 0 20 0.0000000 4 240 1020 8685 2565 SS:[t_out]\001 +4 2 4 0 0 0 20 0.0000000 4 240 1065 1260 6615 SS:[e_in]\001 +4 0 4 0 0 0 20 0.0000000 4 240 1065 8685 6615 SS:[e_out]\001 +4 0 1 1 0 0 20 0.0000000 4 240 1875 1845 4050 Thermal model\001 +4 0 1 1 0 0 20 0.0000000 4 240 2025 1800 5175 Electrical model\001 +4 0 1 1 0 0 20 0.0000000 4 270 2415 6075 585 Temperature sensor\001 ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_desc.tex Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_desc.tex +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_desc.tex @@ -0,0 +1,19 @@ +% Verbal description for system Segment (Segment_desc.tex) +% Generated by MTT on Thu Sep 4 18:05:43 BST 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + The acausal bond graph of system \textbf{Segment} is + displayed in Figure \ref{Segment_abg} and its label + file is listed in Section \ref{sec:Segment_lbl}. + The subsystems are listed in Section \ref{sec:Segment_sub}. + + + ADDED mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_lbl.txt Index: mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_lbl.txt +++ mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_lbl.txt @@ -0,0 +1,39 @@ +%SUMMARY Segment: Segment of HeatedRod +%DESCRIPTION Part of the HeatedRod example. +%% Label file for system Segment (Segment_lbl.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/08/10 12:29:48 peterg +% %% Added missing ports. +% %% +% %% Revision 1.1 1997/09/11 16:17:14 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Each line should be of one of the following forms: +% a comment (ie starting with %) +% Component-name CR_name arg1,arg2,..argn +% blank + + + +% Component type CT + c_t lin effort,c_t + +% Component type RS + r lin flow,r + +% Component type RT + r_t lin flow,r_t + +% Component type SS + T_s SS external,0 + [t_in] SS external,external + [t_out] SS external,external + [e_in] SS external,external + [e_out] SS external,external ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_abg.fig Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_abg.fig +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_abg.fig @@ -0,0 +1,36 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3827 3152 5402 3152 5177 3377 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 6977 3152 8552 3152 8327 3377 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 8552 2927 8552 3377 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 902 3150 2477 3150 2252 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 2925 2475 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3825 2925 3825 3375 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3152 1125 3152 2700 2927 2475 +2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 9900 5175 -450 5175 -450 450 9900 450 9900 5175 +4 1 -1 0 0 0 20 0.0000 4 285 1440 6212 3242 Cycle:cycle\001 +4 0 -1 0 0 0 20 0.0000 4 210 1050 8687 3242 Sf:Work\001 +4 1 1 1 0 3 20 0.0000 4 210 735 4456 3466 dS/dT\001 +4 1 1 1 0 3 20 0.0000 4 195 180 4501 2926 T\001 +4 1 1 1 0 3 20 0.0000 4 195 180 7921 2926 P\001 +4 1 1 1 0 3 20 0.0000 4 210 765 7786 3466 dV/dT\001 +4 1 1 1 0 3 30 0.0000 4 405 2325 5085 4635 Carnot cycle\001 +4 2 -1 0 0 0 20 0.0000 4 210 975 810 3240 Se:Heat\001 +4 1 -1 0 0 0 20 0.0000 4 195 1005 3150 3240 FMRT:r\001 +4 1 4 100 0 18 14 0.0000 4 195 600 3150 2925 [mod]\001 +4 1 -1 0 0 0 20 0.0000 4 210 1170 3150 990 Sf:switch\001 ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_desc.tex Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_desc.tex +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_desc.tex @@ -0,0 +1,72 @@ +% Verbal description for system CarnotCycle (CarnotCycle_desc.tex) +% Generated by MTT on Tue Dec 9 12:13:57 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{CarnotCycle} is + displayed in Figure \Ref{CarnotCycle_abg} and its label + file is listed in Section \Ref{sec:CarnotCycle_lbl}. + The subsystems are listed in Section \Ref{sec:CarnotCycle_sub}. + +The Carnot cycle is a simple closed thermodynamic cycle with four parts: +\begin{enumerate} +\item Isentropic compression +\item Heat injection at constant temperature +\item Isentropic expansion +\item Heat extraction at constant temperature +\end{enumerate} + +The subsystem \textbf{Cycle} (Section \Ref{sec:Cycle}) is a two-port +component describing an ideal gas. It has two energy ports which, with +integral causality correspond to +\begin{enumerate} +\item Entropy flow in; temperature out +\item Volume rate of change in; pressure out +\end{enumerate} + +In contast to the Otto cycle (see Table +\Ref{tab:cycles} where each table entry gives the causality on the +heat and work ports respectively). The ideal Carnot cycle has +derivative causality on the {\bf [Heat]} port for two parts of the +cycle. + +To avoid this causlity change, the Carnot cycle is approximated by +applying the heat from a temperature source via a thermal resistance +{\bf RT} component. During the {\em heat injection\/} and {\em heat +extraction\/} parts of the cycle, the resistance parameter $r\approx +0$, but during the {\em isentropic compression\/} and {\em isentropic +expansion\/} parts of the cycle, the resistance parameter $r\approx +\inf$. + +The simulation parameters appear in Section +\Ref{sec:CarnotCycle_numpar.txt}. The results are plotted against time +as follows: +\begin{itemize} +\item Volume (Figure \Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-V}) +\item Pressure (Figure +\Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-P}) +\item Entropy (Figure \Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-S}) +\item Temperature (Figure +\Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-T}) +\end{itemize} + +These values are replotted as the standard PV and TS diagrams in +Figures +\Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-V:CarnotCycle-cycle-P} +and +\Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-S:CarnotCycle-cycle-T} +respectively. + +The PV diagram shows the long and thin form typical of the Carnot +cycle -- this implies a poor work ratio. The TS diagram is not +informative; it is not the expected rectangle because both T and S +change in a stepwise manner. + + + + ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_input.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_input.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_input.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_input.txt @@ -0,0 +1,42 @@ +# Input file (CarnotCycle_input.txt) +# Generated by MTT at Mon Dec 8 20:05:30 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:14:40 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +alpha = 0.553; + +# Set the inputs +if ((t>=0.0)&&(t<1.0)) #Cooling + carnotcycle__heat__u= 300.0; # Source temperature + carnotcycle__switch__u = 1e10; # Large conductance - isothermal + carnotcycle__work__u = -alpha; # Volume rate-of-change +endif; + +if ((t>=1.0)&&(t<2.0)) #Compression + carnotcycle__heat__u = 300.0; # Source temperature + carnotcycle__switch__u = 0; # Small conductance -- isentropic + carnotcycle__work__u = -(0.8-alpha); # Volume rate-of-change +endif; + +if ((t>=2.0)&&(t<3.0)) #Heating + TopTemp = x(1)/(m_g*c_v); + carnotcycle__heat__u = TopTemp; # Source temperature + carnotcycle__switch__u = 1e10; # Large conductance - isothermal + carnotcycle__work__u = (0.8-alpha); # Volume rate-of-change +endif; + +if (t>=3.0) #Cooling + carnotcycle__heat__u = 300.0; # Source temperature + carnotcycle__switch__u = 0; # Small conductance -- isentropic + carnotcycle__work__u = alpha; # Volume rate-of-change +endif; + ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_lbl.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_lbl.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_lbl.txt @@ -0,0 +1,56 @@ +#SUMMARY CarnotCycle: a simple closed thermodynamic cycle +#DESCRIPTION The Carnot cycle is a simple closed thermodynamic cycle +#DESCRIPTION with four parts: +#DESCRIPTION o Isentropic compression +#DESCRIPTION o Heat injection at constant temperature +#DESCRIPTION o Isentropic expansion +#DESCRIPTION o Heat extraction at constant temperature + +#PAR P_0 +#PAR T_0 +#PAR V_0 +#PAR alpha +#PAR TopTemp + + +#NOTPAR ideal_gas + +## Label file for system CarnotCycle (CarnotCycle_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.3 2003/08/13 17:03:00 gawthrop +# ## Updated for new MTT +# ## Use FMR in place of R +# ## Fixed bug in sspar +# ## +# ## Revision 1.2 1998/08/10 16:40:07 peterg +# ## Added VARs and parametrs +# ## +# ## Revision 1.1 1998/07/21 15:18:18 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + +# Component type Cycle + cycle none ideal_gas;c_v;gamma_g;m_g + +# Component type RT + r lin flow,1 + +# Component type Se + Heat SS external + +# Component type Sf + Work SS external + switch SS external ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_numpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_numpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_numpar.txt @@ -0,0 +1,34 @@ +# Numerical parameter file (CarnotCycle_numpar.txt) +# Generated by MTT at Mon Dec 8 20:02:31 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.3 2003/08/13 17:03:10 gawthrop +# %% Updated for new MTT +# %% Use FMR in place of R +# %% Fixed bug in sspar +# %% +# %% Revision 1.2 2000/12/28 18:14:40 peterg +# %% To RCS +# %% +# %% Revision 1.1 1998/03/04 11:49:01 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Initial states -- needed to choose an approppriate mass +P_0 = 1e5; +V_0 = 1; +T_0 = 300; + +# Parameters +c_v = 718.0; # Parameter c_v for CU +gamma_g = 1.4; # Parameter gamma for CU +m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU + +## Use in input.txt +alpha = 1.0; # Added by MTT on Thu Aug 14 11:42:15 BST 2003 +toptemp = 1.0; # Added by MTT on Thu Aug 14 11:42:15 BST 2003 ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_params.r Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_params.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_params.r +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_params.r @@ -0,0 +1,11 @@ +%% Parameter file for system CarnotCycle (CarnotCycle_params.r) +%% This file provides symbolic parameters for simplification + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_rep.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_rep.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_rep.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_rep.txt @@ -0,0 +1,29 @@ +# Outline report file for system CarnotCycle (CarnotCycle_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 18:14:40 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/02/21 02:15:05 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -ss -o CarnotCycle abg tex +mtt -ss -o CarnotCycle struc tex +mtt -ss -o CarnotCycle ode tex +mtt -ss -o CarnotCycle ss tex + +mtt -ss -o CarnotCycle numpar txt +mtt -ss -o CarnotCycle input txt + +mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__V' +mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__P' +mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__S' +mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__T' +mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__V:CarnotCycle__cycle__P' +mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__S:CarnotCycle__cycle__T' ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simp.r Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simp.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simp.r +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simp.r @@ -0,0 +1,10 @@ +%% Reduce comands to simplify output for system CarnotCycle (CarnotCycle_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simpar.txt @@ -0,0 +1,12 @@ +%% Simulation parameters for system OttoCycle (OttoCycle_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=4.0 +DT=0.01 +STEPFACTOR=10 ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_sspar.r Index: mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_sspar.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_sspar.r +++ mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_sspar.r @@ -0,0 +1,48 @@ +% Steady-state parameter file (CarnotCycle_sspar.r) +% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.2 2000/12/28 18:14:40 peterg +% % To RCS +% % +% % Revision 1.1 1998/03/04 11:49:14 peterg +% % Initial revision +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% Set a pressure of 1 bar +%P_0 := 10^5; + +% Unit initial volume +%V_0 := 1; + +% Internal energy +U_0 := P_0*V_0/(gamma_g-1); + +% Set initial temperature of 300k +%T_0 := 300; + +% Deduce the mass of gas +m_g := U_0/(T_0*c_v); + +% Entropy +S_0 := U_0/T_0; + +% Steady-state states +MTTX1 := U_0; % CarnotCycle_cycle_gas (c) +MTTX2 := V_0; % CarnotCycle_cycle_gas (c) +MTTX3 := S_0; % CarnotCycle_cycle_volume (3) +MTTX4 := V_0; % CarnotCycle_cycle_entropy (3) + +% Steady-state inputs +MTTU1 := T_0; % CarnotCycle (Heat) +MTTU2 := 0; % CarnotCycle (Work) +MTTU3 := 0; % Switch (conduction) +;;END; + ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_abg.fig Index: mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_abg.fig +++ mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_abg.fig @@ -0,0 +1,27 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 3151 3601 3151 3376 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5176 3151 6751 3151 6526 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6751 2926 6751 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2026 2926 2026 3376 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 5850 8325 450 675 450 675 5850 8325 5850 +4 1 -1 0 0 0 20 0.0000 4 285 1440 4411 3241 Cycle:cycle\001 +4 0 -1 0 0 0 20 0.0000 4 210 1050 6886 3241 Sf:Work\001 +4 2 -1 0 0 0 20 0.0000 4 210 945 1936 3241 Sf:Heat\001 +4 1 1 1 0 3 20 0.0000 4 210 735 2655 3465 dS/dT\001 +4 1 1 1 0 3 20 0.0000 4 195 180 2700 2925 T\001 +4 1 1 1 0 3 20 0.0000 4 195 180 6120 2925 P\001 +4 1 1 1 0 3 20 0.0000 4 210 765 5985 3465 dV/dT\001 +4 1 1 1 0 3 30 0.0000 4 405 1815 4365 4770 Otto cycle\001 ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_desc.tex Index: mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_desc.tex +++ mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_desc.tex @@ -0,0 +1,65 @@ +% Verbal description for system OttoCycle (OttoCycle_desc.tex) +% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/12/08 09:37:04 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{OttoCycle} is + displayed in Figure \Ref{OttoCycle_abg} and its label + file is listed in Section \Ref{sec:OttoCycle_lbl}. + The subsystems are listed in Section \Ref{sec:OttoCycle_sub}. + + +The Otto cycle is a simple closed thermodynamic cycle with four parts: +\begin{enumerate} +\item Isentropic compression +\item Heating at constant volume +\item Isentropic expansion +\item Cooling at constant volume +\end{enumerate} + +The subsystem \textbf{Cycle} (Section \Ref{sec:Cycle}) is a two-port +component describing an ideal gas. It has two energy ports which, with +integral causality correspond to +\begin{enumerate} +\item Entropy flow in; temperature out +\item Volume rate of change in; pressure out +\end{enumerate} + +In Bond Graph terms, each of the four parts of the Otto cycle +correspond to integral causality as in each case a \emph{flow} is +constrained. This is in contrast to other cycles listed in Table +\Ref{tab:cycles} where each table entry gives the causality on the +heat and work ports respectively. This is possibly why the Otto cycle +is conceptually and practically simple. + +The simulation parameters appear in Section +\Ref{sec:OttoCycle_numpar.txt}. The results are plotted against time +as follows: +\begin{itemize} +\item Volume (Figure \Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-V}) +\item Pressure (Figure +\Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-P}) +\item Entropy (Figure \Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-S}) +\item Temperature (Figure +\Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-T}) +\end{itemize} + +These values are replotted as the standard PV and TS diagrams in +Figures +\Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-V:OttoCycle-cycle-P} +and +\Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-S:OttoCycle-cycle-T} +respectively. + + + + + ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_input.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_input.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_input.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_input.txt @@ -0,0 +1,45 @@ +# Numerical parameter file (OttoCycle_input.txt) +# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.3 2000/12/28 18:42:16 peterg +# %% New input definition. +# %% NB Needs to handle mutiports properly and state.txt modified accordingly +# %% +# %% Revision 1.2 2000/12/28 18:15:52 peterg +# %% To RCS +# %% +# %% Revision 1.1 1998/08/10 14:42:13 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs + +if ((t>=0.0)&&(t<1.0)) #Compression + OttoCycle__Heat__u = 0.0; # Entropy flow + OttoCycle__Work__u = -0.8; # Volume rate-of-change +endif; + +if ((t>=1.0)&&(t<2.0)) #Heating + OttoCycle__Heat__u = 1000; # Entropy flow + OttoCycle__Work__u = 0.0; # Volume rate-of-change +endif; + +if ((t>=2.0)&&(t<3.0)) #Expansion + OttoCycle__Heat__u = 0.0; # Entropy flow + OttoCycle__Work__u = 0.8; # Volume rate-of-change +endif; + +if (t>=3.0) #Cooling + OttoCycle__Heat__u = -1000; # Entropy flow + OttoCycle__Work__u = 0.0; # Volume rate-of-change +endif; + + + + ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_lbl.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_lbl.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_lbl.txt @@ -0,0 +1,49 @@ +#SUMMARY OttoCycle: a simple closed thermodynamic cycle +#DESCRIPTION The Otto cycle is a simple closed thermodynamic cycle +#DESCRIPTION with four parts: +#DESCRIPTION o Isentropic compression +#DESCRIPTION o Heating at constant volume +#DESCRIPTION o Isentropic expansion +#DESCRIPTION o Cooling at constant volume + +#PAR P_0 +#PAR T_0 +#PAR V_0 +#NOTPAR ideal_gas + + +## Label file for system OttoCycle (OttoCycle_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.4 2000/12/28 18:42:17 peterg +# ## New input definition. +# ## NB Needs to handle mutiports properly and state.txt modified accordingly +# ## +# ## Revision 1.3 1998/08/10 16:05:52 peterg +# ## Added VARs and parameters +# ## +# ## Revision 1.2 1998/07/21 15:15:27 peterg +# ## Documentation + new format +# ## +# ## Revision 1.1 1998/07/21 15:12:21 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + +# Component type Cycle + cycle none ideal_gas;c_v;gamma_g;m_g + +# Component type Sf + Heat SS external + Work SS external ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_numpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_numpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_numpar.txt @@ -0,0 +1,23 @@ +# Numerical parameter file (OttoCycle_numpar.txt) +# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 1998/03/04 11:45:49 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Initial states -- needed to choose an appropriate mass +P_0 = 1e5; +V_0 = 1; +T_0 = 300; + +# Parameters +c_v = 718.0; # Parameter c_v for CU +gamma_g = 1.4; # Parameter gamma for CU +m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v);# Parameter m for CU + ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_rep.txt Index: mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_rep.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_rep.txt +++ mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_rep.txt @@ -0,0 +1,33 @@ +# Outline report file for system OttoCycle (OttoCycle_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 18:15:52 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/02/21 02:16:17 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -o -ss OttoCycle abg tex +mtt -o -ss OttoCycle struc tex +mtt -o -ss OttoCycle ode tex +mtt -o -ss OttoCycle ss tex + +mtt -o -ss OttoCycle numpar txt +mtt -o -ss OttoCycle input txt + +mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__V' +mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__P' +mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__S' +mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__T' +mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__V:OttoCycle__cycle__P' +mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__S:OttoCycle__cycle__T' + + + + ADDED mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_sspar.r Index: mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_sspar.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_sspar.r +++ mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_sspar.r @@ -0,0 +1,42 @@ +% Steady-state parameter file (OttoCycle_sspar.r) +% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% % Revision 1.1 2000/12/28 18:15:52 peterg +% % To RCS +% % +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Set a pressure of 1 bar +%%P_0 := 10^5; + +% Unit initial volume +%%V_0 := 1; + +% Internal energy +U_0 := P_0*V_0/(gamma_g-1); + +% Set initial temperature of 300k +%%T_0 := 300; + +% Deduce the mass of gas +m_g := U_0/(T_0*c_v); + +% Entropy +S_0 := U_0/T_0; + +% Steady-state states +MTTX1 := U_0; % OttoCycle_cycle_gas (c) +MTTX2 := V_0; % OttoCycle_cycle_gas (c) +MTTX3 := S_0; % OttoCycle_cycle_entropy (3) +MTTX4 := V_0; % OttoCycle_cycle_volume (3) + +% Steady-state inputs +MTTU1 := 0; % OttoCycle (Heat) +MTTU2 := 0; % OttoCycle (Work) +;;END; ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_abg.fig Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_abg.fig +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 3151 3601 3151 3376 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5176 3151 6751 3151 6526 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6751 2926 6751 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2026 2926 2026 3376 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 5850 8325 450 675 450 675 5850 8325 5850 +4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001 +4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001 +4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 2700 2925 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001 +4 1 1 1 0 3 30 0.0000000 4 390 3360 4365 4770 Isentropic process\001 +4 1 1 1 0 3 20 0.0000000 4 210 480 2700 3555 S=0\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 2565 3330 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 195 6120 3555 V\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 6165 3285 .\001 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_desc.tex Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_desc.tex +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_desc.tex @@ -0,0 +1,16 @@ +% Verbal description for system Isentropic (Isentropic_desc.tex) +% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/12/09 12:30:26 peterg +% Initial revision +% +% Revision 1.1 1997/12/08 09:37:04 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_input.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_input.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_input.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (Isentropic_input.txt) +# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:16:47 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Wed Aug 6 10:14:17 BST 2003: u(1) = -0.8; # Volume rate-of-change +isentropic__work = -0.8; # Volume rate-of-change ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_lbl.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_lbl.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_lbl.txt @@ -0,0 +1,40 @@ +#SUMMARY Isentropic: Isentropic thermodynamic process - ideal gas +#DESCRIPTION A dynamic simulation of an isentropic process using +#DESCRIPTION the Cycle component and the two-prt CU component. + +#PAR P_0 +#PAR T_0 +#PAR V_0 + +#NOTPAR ideal_gas + + + +## Label file for system Isentropic (Isentropic_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.2 2000/12/28 18:16:47 peterg +# ## To RCS +# ## +# ## Revision 1.1 1998/07/21 14:27:44 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + +# Component type Cycle + cycle none ideal_gas;c_v;gamma_g;m_g + +# Component type SS + Heat SS internal,0 + Work SS internal,external ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_numpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_numpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_numpar.txt @@ -0,0 +1,23 @@ +# Numerical parameter file (Isentropic_numpar.txt) +# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 1998/03/04 11:45:49 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Initial states -- needed to choose an approppriate mass +P_0 = 1e5; +V_0 = 1; +T_0 = 300; + +# Parameters +c_v = 718.0; # Parameter c_v for CU +gamma_g = 1.4; # Parameter gamma for CU +m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_rep.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_rep.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_rep.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_rep.txt @@ -0,0 +1,29 @@ +# Outline report file for system Isentropic (Isentropic_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 18:16:47 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/02/21 02:18:41 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -o -ss Isentropic abg tex +mtt -o -ss Isentropic struc tex +mtt -o -ss Isentropic ode tex +mtt -o -ss Isentropic ss tex + +mtt -o -ss Isentropic numpar txt +mtt -o -ss Isentropic input txt + +mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__V' +mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__P' +mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__S' +mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__T' +mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__V:Isentropic__cycle__P' +mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__S:Isentropic__cycle__T' ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt @@ -0,0 +1,13 @@ +%% Simulation parameters for system Isentropic (Isentropic_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=1.0 +DT=0.01 +STEPFACTOR=1 + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt_old Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt_old ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt_old +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt_old @@ -0,0 +1,13 @@ +%% Simulation parameters for system Isentropic (Isentropic_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=1.0 +DT=0.01 +STEPFACTOR=1 + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_sspar.r Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_sspar.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_sspar.r +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_sspar.r @@ -0,0 +1,39 @@ +% Steady-state parameter file (Isentropic_sspar.r) +% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Set a pressure of 1 bar +P_0 := 10^5; + +% Unit initial volume +V_0 := 1; + +% Internal energy +U_0 := P_0*V_0/(gamma_g-1); + +% Set initial temperature of 300k +T_0 := 300; + +% Deduce the mass of gas +m := U_0/(T_0*c_v); + +% Entropy +S_0 := U_0/T_0; + +% Steady-state states +MTTX1 := U_0; % Isentropic_cycle_gas (c) +MTTX2 := V_0; % Isentropic_cycle_gas (c) +MTTX3 := S_0; % Isentropic_cycle_entropy (3) +MTTX4 := V_0; % Isentropic_cycle_volume (3) + +% Steady-state inputs +MTTU1 := 0; % Isentropic (Heat) +MTTU2 := 0; % Isentropic (Work) +;;END; ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_abg.fig Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_abg.fig +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_abg.fig @@ -0,0 +1,89 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 1800 6750 1800 6525 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 2025 5175 3375 5400 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3825 5175 5175 5400 4950 +2 2 0 3 1 7 1 0 -1 0.000 1 0 -1 0 0 5 + 6075 900 9000 900 9000 2700 6075 2700 6075 900 +2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 + 8325 900 8550 900 8550 2700 8325 2700 8325 900 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10125 3825 10125 5175 10350 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 1800 9900 1800 9675 2025 +2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 + 8550 1665 9585 1665 9585 1935 8550 1935 8550 1665 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 4725 1440 5805 1440 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 9675 1440 10755 1440 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 7785 3465 8415 2835 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 1800 4950 1800 4725 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1755 1800 3105 1800 2880 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 2025 3375 5175 3600 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3150 5175 3600 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10350 1800 11700 1800 11475 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12150 1800 13500 1800 13275 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 11700 5175 12150 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11925 2025 11925 5175 12150 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10125 2025 10125 3375 10350 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 2025 5400 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 2025 10350 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 5175 10350 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 5175 5400 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5400 1575 5400 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7875 1575 7875 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 1755 1575 1755 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 12150 1575 12150 2025 +4 1 -1 0 0 0 20 0.0000 4 255 915 7290 1890 CU:gas\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 5175 1890 1\001 +4 1 -1 0 0 0 20 0.0000 4 270 1695 5175 3690 INTF:entropy\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 10125 1890 1\001 +4 1 1 1 0 3 20 0.0000 4 270 1140 7200 1440 Ideal gas\001 +4 1 1 1 0 3 20 0.0000 4 195 945 4635 1305 Heat in\001 +4 1 1 1 0 3 20 0.0000 4 210 1170 10170 1305 Work out\001 +4 1 1 1 0 3 20 0.0000 4 270 1980 5130 5895 Entropy change\001 +4 1 1 1 0 3 20 0.0000 4 270 1485 7110 3690 Ideal piston\001 +4 1 -1 0 0 0 20 0.0000 4 210 1680 10125 3690 INTF:volume\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 3375 1890 0\001 +4 2 4 0 0 0 20 0.0000 4 255 1215 1575 1890 SS:[Heat]\001 +4 1 -1 0 0 0 20 0.0000 4 210 600 3375 5490 SS:T\001 +4 1 1 1 0 3 20 0.0000 4 255 1620 3240 5895 Temperature\001 +4 1 -1 0 0 0 20 0.0000 4 210 585 5130 5490 SS:S\001 +4 1 -1 0 0 0 20 0.0000 4 210 645 10125 5490 SS:V\001 +4 1 -1 0 0 0 20 0.0000 4 210 585 11880 5490 SS:P\001 +4 0 4 0 0 0 20 0.0000 4 255 1320 13680 1890 SS:[Work]\001 +4 1 1 1 0 3 20 0.0000 4 270 1950 10080 5850 Volume change\001 +4 1 1 1 0 3 20 0.0000 4 195 1095 11925 5850 Pressure\001 +4 1 -1 0 0 0 20 0.0000 4 195 150 11925 1890 0\001 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_desc.tex Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_desc.tex +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_desc.tex @@ -0,0 +1,74 @@ +% Verbal description for system Cycle (Cycle_desc.tex) +% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/06/30 12:46:49 peterg +% %% Changed CT2 to CU +% %% +% %% Revision 1.1 1998/06/30 12:46:24 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/12/08 09:37:04 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Cycle} is + displayed in Figure \Ref{Cycle_abg} and its label + file is listed in Section \Ref{sec:Cycle_lbl}. + The subsystems are listed in Section \Ref{sec:Cycle_sub}. + +The system has two heat engine ports: +\begin{enumerate} +\item \textbf{[Heat]} and +\item \textbf{[Work]} +\end{enumerate} +By convention, energy flows in to the \textbf{[Heat]} port and out of +the \textbf{[Work]} port. Both ports are true energy ports. + + +The subsystem \textbf{CU} (Section \Ref{sec:CU}) is a two-port +component describing an ideal gas. It has two energy ports which, with +integral causality correspond to +\begin{enumerate} +\item Entropy flow in; temperature out +\item Volume rate of change in; pressure out +\end{enumerate} + +Four \textbf{SS} components are set up as sensors to measure the +important quantities pertaining to the cycle: +\begin{enumerate} +\item \textbf{S} to measure the integrated entropy flow +\item \textbf{T} to measure the (absolute) temperature +\item \textbf{V} to measure the integrated volume change +\item \textbf{P} to measure the pressure +\end{enumerate} + + \begin{table}[htbp] + \begin{center} + \leavevmode + \begin{tabular}{|l|l|l|l|l|} + \hline + Cycle & Compression & Heating & Expansion & Cooling \\ + \hline + Otto & II & II & II & II \\ + Carnot & II & DI & II & DI \\ + Diesel & II & ID & II & II \\ + Joule & II & ID & II & ID \\ + \hline + \end{tabular} + \caption{Cycles and their causality} + \label{tab:cycles} + \end{center} + \end{table} + + A number of cycles can be built depending on the causality of the + two ports \textbf{[Heat]} and \textbf{[Work]} of \textbf{Cycle} + Some possible cycles listed in Tables \Ref{tab:cycles} where each + table entry gives the causality on the heat and work ports + respectively. + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_lbl.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_lbl.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_lbl.txt @@ -0,0 +1,54 @@ +#SUMMARY Cycle: Closed cycle with ideal gas +#DESCRIPTION Uses the CU two-port thermal capacitor. + +#ALIAS in Heat +#ALIAS out Work + +#ALIAS $1 ideal_gas +#ALIAS $2 c_v +#ALIAS $3 gamma_g +#ALIAS $4 m_g + +## Label file for system Cycle (Cycle_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.2 1998/07/21 14:21:04 peterg +# ## New style file +# ## +# ## Revision 1.1 1997/12/08 20:24:43 peterg +# ## Initial revision +# ## +# ## Revision 1.1 1997/12/07 20:38:05 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + + +# Component type CU + gas CU ideal_gas,c_v,gamma_g,m_g + +# Component type INTF + entropy + volume + +# Component type SS + S SS external,0 + T SS external,0 + V SS external,0 + P SS external,0 + [Heat] SS external,external + [Work] SS external,external + + + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_simp.r Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_simp.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_simp.r +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_simp.r @@ -0,0 +1,10 @@ +%% Reduce commands to simplify output for system Cycle (Cycle_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_abg.fig Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_abg.fig +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 3151 3601 3151 3376 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5176 3151 6751 3151 6526 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2026 2926 2026 3376 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 5850 8325 450 675 450 675 5850 8325 5850 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5175 2925 5175 3375 +4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001 +4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001 +4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 2700 2925 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001 +4 1 1 1 0 3 30 0.0000000 4 390 3015 4365 4770 Isobaric process\001 +4 1 1 1 0 3 20 0.0000000 4 210 480 2700 3555 S=0\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 2565 3330 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 195 6120 3555 V\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 6165 3285 .\001 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_desc.tex Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_desc.tex +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_desc.tex @@ -0,0 +1,16 @@ +% Verbal description for system Isobaric (Isobaric_desc.tex) +% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/12/09 12:30:26 peterg +% Initial revision +% +% Revision 1.1 1997/12/08 09:37:04 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_input.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_input.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_input.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (Isobaric_input.txt) +# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:17:13 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Wed Aug 6 11:41:46 BST 2003: u(1) = 1000; #Entropy flow +isobaric__heat = 1000; #Entropy flow ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_lbl.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_lbl.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_lbl.txt @@ -0,0 +1,38 @@ +#SUMMARY Isobaric: Isobaric thermodynamic process - ideal gas +#DESCRIPTION A dynamic simulation of an isobaric (constant pressure) +#DESCRIPTION process using the Cycle component and the two-port CU component. + +#PAR P_0 +#PAR T_0 +#PAR V_0 + +#NOTPAR ideal_gas + +## Label file for system Isobaric (Isobaric_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.2 2000/12/28 18:17:13 peterg +# ## To RCS +# ## +# ## Revision 1.1 1998/07/21 14:32:49 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + +# Component type Cycle + cycle none ideal_gas;c_v;gamma_g;m_g + +# Component type SS + Heat SS internal,external + Work SS P_0,internal ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_numpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_numpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_numpar.txt @@ -0,0 +1,23 @@ +# Numerical parameter file (Isobaric_numpar.txt) +# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 1998/03/04 11:45:49 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Initial states -- needed to choose an approppriate mass +P_0 = 1e5; +V_0 = 1; +T_0 = 300; + +# Parameters +c_v = 718.0; # Parameter c_v for CU +gamma_g = 1.4; # Parameter gamma_g for CU +m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_rep.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_rep.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_rep.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_rep.txt @@ -0,0 +1,33 @@ +# Outline report file for system Isobaric (Isobaric_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 18:17:13 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/02/21 02:19:31 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -ss Isobaric abg tex +mtt -ss Isobaric struc tex +mtt -ss Isobaric ode tex +mtt -ss Isobaric ss tex + +mtt -ss Isobaric numpar txt +mtt -ss Isobaric input txt + +mtt -ss Isobaric odeso ps 'Isobaric__cycle__V' +mtt -ss Isobaric odeso ps 'Isobaric__cycle__P' +mtt -ss Isobaric odeso ps 'Isobaric__cycle__S' +mtt -ss Isobaric odeso ps 'Isobaric__cycle__T' +mtt -ss Isobaric odeso ps 'Isobaric__cycle__V:Isobaric__cycle__P' +mtt -ss Isobaric odeso ps 'Isobaric__cycle__S:Isobaric__cycle__T' + + + + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt @@ -0,0 +1,12 @@ +%% Simulation parameters for system Isobaric (Isobaric_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=1.0 +DT=0.01 +STEPFACTOR=1 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt_old Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt_old ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt_old +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt_old @@ -0,0 +1,12 @@ +%% Simulation parameters for system Isobaric (Isobaric_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=1.0 +DT=0.01 +STEPFACTOR=1 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_sspar.r Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_sspar.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_sspar.r +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_sspar.r @@ -0,0 +1,38 @@ +% Steady-state parameter file (Isobaric_sspar.r) +% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Set a pressure of 1 bar +P_0 := 10^5; + +% Unit initial volume +V_0 := 1; + +% Internal energy +U_0 := P_0*V_0/(gamma_g-1); + +% Set initial temperature of 300k +T_0 := 300; + +% Deduce the mass of gas +m := U_0/(T_0*c_v); + +% Entropy +S_0 := U_0/T_0; + +% Steady-state states +MTTX1 := U_0; % Isobaric_cycle_gas (c) +%MTTX2 := V_0; % Isobaric_cycle_gas (c) +MTTX2 := S_0; % Isobaric_cycle_entropy (3) +MTTX3 := V_0; % Isobaric_cycle_volume (3) + +% Steady-state inputs +MTTU1 := 0; % Isobaric (Heat) +;;END; ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_abg.fig Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_abg.fig +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_abg.fig @@ -0,0 +1,81 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5400 1800 6750 1800 6525 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 2025 5175 3375 5400 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5175 3825 5175 5175 5400 4950 +2 2 0 3 1 7 1 0 -1 0.000 1 0 -1 0 0 5 + 6075 900 9000 900 9000 2700 6075 2700 6075 900 +2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 + 8325 900 8550 900 8550 2700 8325 2700 8325 900 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10125 3825 10125 5175 10350 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 7875 1800 9900 1800 9675 2025 +2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 + 8550 1665 9585 1665 9585 1935 8550 1935 8550 1665 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 4725 1440 5805 1440 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 9675 1440 10755 1440 +2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 + 1 0 2.00 120.00 240.00 + 7785 3465 8415 2835 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3600 1800 4950 1800 4725 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 1755 1800 3105 1800 2880 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 3375 2025 3375 5175 3600 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3150 5175 3600 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10350 1800 11700 1800 11475 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 12150 1800 13500 1800 13275 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 11700 5175 12150 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 11925 2025 11925 5175 12150 4950 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 10125 2025 10125 3375 10350 3150 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 2025 5400 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 2025 10350 2025 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 5175 10350 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4950 5175 5400 5175 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6750 2025 6750 1575 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 9900 2025 9900 1575 +4 1 -1 0 0 0 20 0.0000 4 255 855 7290 1890 CU:gas\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 5175 1890 1\001 +4 1 -1 0 0 0 20 0.0000 4 255 1590 5175 3690 INTF:entropy\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 10125 1890 1\001 +4 1 1 1 0 3 20 0.0000 4 270 1035 7200 1440 Ideal gas\001 +4 1 1 1 0 3 20 0.0000 4 210 885 4635 1305 Heat in\001 +4 1 1 1 0 3 20 0.0000 4 210 1080 10170 1305 Work out\001 +4 1 1 1 0 3 20 0.0000 4 270 1800 5130 5895 Entropy change\001 +4 1 1 1 0 3 20 0.0000 4 270 1365 7110 3690 Ideal piston\001 +4 1 -1 0 0 0 20 0.0000 4 195 1560 10125 3690 INTF:volume\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 3375 1890 0\001 +4 2 4 0 0 0 20 0.0000 4 240 1140 1575 1890 SS:[Heat]\001 +4 1 -1 0 0 0 20 0.0000 4 195 585 3375 5490 SS:T\001 +4 1 1 1 0 3 20 0.0000 4 255 1485 3240 5895 Temperature\001 +4 1 -1 0 0 0 20 0.0000 4 195 570 5130 5490 SS:S\001 +4 1 -1 0 0 0 20 0.0000 4 195 615 10125 5490 SS:V\001 +4 1 -1 0 0 0 20 0.0000 4 195 570 11880 5490 SS:P\001 +4 0 4 0 0 0 20 0.0000 4 240 1230 13680 1890 SS:[Work]\001 +4 1 1 1 0 3 20 0.0000 4 270 1815 10080 5850 Volume change\001 +4 1 1 1 0 3 20 0.0000 4 195 975 11925 5850 Pressure\001 +4 1 -1 0 0 0 20 0.0000 4 195 135 11925 1890 0\001 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_desc.tex Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_desc.tex +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_desc.tex @@ -0,0 +1,74 @@ +% Verbal description for system Cycle (Cycle_desc.tex) +% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 1998/06/30 12:46:49 peterg +% %% Changed CT2 to CU +% %% +% %% Revision 1.1 1998/06/30 12:46:24 peterg +% %% Initial revision +% %% +% Revision 1.1 1997/12/08 09:37:04 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + The acausal bond graph of system \textbf{Cycle} is + displayed in Figure \Ref{Cycle_abg} and its label + file is listed in Section \Ref{sec:Cycle_lbl}. + The subsystems are listed in Section \Ref{sec:Cycle_sub}. + +The system has two heat engine ports: +\begin{enumerate} +\item \textbf{[Heat]} and +\item \textbf{[Work]} +\end{enumerate} +By convention, energy flows in to the \textbf{[Heat]} port and out of +the \textbf{[Work]} port. Both ports are true energy ports. + + +The subsystem \textbf{CU} (Section \Ref{sec:CU}) is a two-port +component describing an ideal gas. It has two energy ports which, with +integral causality correspond to +\begin{enumerate} +\item Entropy flow in; temperature out +\item Volume rate of change in; pressure out +\end{enumerate} + +Four \textbf{SS} components are set up as sensors to measure the +important quantities pertaining to the cycle: +\begin{enumerate} +\item \textbf{S} to measure the integrated entropy flow +\item \textbf{T} to measure the (absolute) temperature +\item \textbf{V} to measure the integrated volume change +\item \textbf{P} to measure the pressure +\end{enumerate} + + \begin{table}[htbp] + \begin{center} + \leavevmode + \begin{tabular}{|l|l|l|l|l|} + \hline + Cycle & Compression & Heating & Expansion & Cooling \\ + \hline + Otto & II & II & II & II \\ + Carnot & II & DI & II & DI \\ + Diesel & II & ID & II & II \\ + Joule & II & ID & II & ID \\ + \hline + \end{tabular} + \caption{Cycles and their causality} + \label{tab:cycles} + \end{center} + \end{table} + + A number of cycles can be built depending on the causality of the + two ports \textbf{[Heat]} and \textbf{[Work]} of \textbf{Cycle} + Some possible cycles listed in Tables \Ref{tab:cycles} where each + table entry gives the causality on the heat and work ports + respectively. + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_lbl.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_lbl.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_lbl.txt @@ -0,0 +1,54 @@ +#SUMMARY Cycle: Closed cycle with ideal gas +#DESCRIPTION Uses the CU two-port thermal capacitor. + +#ALIAS in Heat +#ALIAS out Work + +#ALIAS $1 ideal_gas +#ALIAS $2 c_v +#ALIAS $3 gamma_g +#ALIAS $4 m_g + +## Label file for system Cycle (Cycle_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.2 1998/07/21 14:21:04 peterg +# ## New style file +# ## +# ## Revision 1.1 1997/12/08 20:24:43 peterg +# ## Initial revision +# ## +# ## Revision 1.1 1997/12/07 20:38:05 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + + +# Component type CU + gas CU ideal_gas,c_v,gamma_g,m_g + +# Component type INTF + entropy + volume + +# Component type SS + S SS external,0 + T SS external,0 + V SS external,0 + P SS external,0 + [Heat] SS external,external + [Work] SS external,external + + + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_simp.r Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_simp.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_simp.r +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_simp.r @@ -0,0 +1,10 @@ +%% Reduce commands to simplify output for system Cycle (Cycle_simp.r) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +END; ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_abg.fig Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_abg.fig +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 3151 3601 3151 3376 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5176 3151 6751 3151 6526 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6751 2926 6751 3376 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 5850 8325 450 675 450 675 5850 8325 5850 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3600 2925 3600 3375 +4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001 +4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001 +4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001 +4 1 1 1 0 3 30 0.0000000 4 390 3510 4365 4770 Isothermal process\001 +4 1 1 1 0 3 20 0.0000000 4 210 195 6120 3555 V\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 6165 3285 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 165 2700 3555 S\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 2700 3285 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 1005 2700 2925 T=const\001 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_desc.tex Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_desc.tex +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_desc.tex @@ -0,0 +1,16 @@ +% Verbal description for system Isothermal (Isothermal_desc.tex) +% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/12/09 12:30:26 peterg +% Initial revision +% +% Revision 1.1 1997/12/08 09:37:04 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_input.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_input.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_input.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (Isothermal_input.txt) +# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:17:37 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Wed Aug 6 10:47:34 BST 2003: u(1) = -0.8; # Volume rate-of-change +isothermal__work = -0.8; # Volume rate-of-change ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_lbl.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_lbl.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_lbl.txt @@ -0,0 +1,38 @@ +#SUMMARY Isothermal: Isothermal thermodynamic process - ideal gas +#DESCRIPTION A dynamic simulation of an isothermal process using +#DESCRIPTION the Cycle component and the two-port CU component. + +#PAR P_0 +#PAR T_0 +#PAR V_0 + +#NOTPAR ideal_gas + +## Label file for system Isothermal (Isothermal_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.2 2000/12/28 18:17:37 peterg +# ## To RCS +# ## +# ## Revision 1.1 1998/07/21 14:30:29 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + +# Component type Cycle + cycle none ideal_gas;c_v;gamma_g;m_g + +# Component type SS + Heat SS T_0,internal + Work SS internal,external ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_numpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_numpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_numpar.txt @@ -0,0 +1,23 @@ +# Numerical parameter file (Isothermal_numpar.txt) +# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 1998/03/04 11:45:49 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Initial states -- needed to choose an approppriate mass +P_0 = 1e5; +V_0 = 1; +T_0 = 300; + +# Parameters +c_v = 718.0; # Parameter c_v for CU +gamma_g = 1.4; # Parameter gamma_g for CU +m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_rep.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_rep.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_rep.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_rep.txt @@ -0,0 +1,33 @@ +# Outline report file for system Isothermal (Isothermal_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 18:17:37 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/02/21 02:20:18 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -ss Isothermal abg tex +mtt -ss Isothermal struc tex +mtt -ss Isothermal ode tex +mtt -ss Isothermal ss tex + +mtt -ss Isothermal numpar txt +mtt -ss Isothermal input txt + +mtt -ss Isothermal odeso ps 'Isothermal__cycle__V' +mtt -ss Isothermal odeso ps 'Isothermal__cycle__P' +mtt -ss Isothermal odeso ps 'Isothermal__cycle__S' +mtt -ss Isothermal odeso ps 'Isothermal__cycle__T' +mtt -ss Isothermal odeso ps 'Isothermal__cycle__V:Isothermal__cycle__P' +mtt -ss Isothermal odeso ps 'Isothermal__cycle__S:Isothermal__cycle__T' + + + + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt @@ -0,0 +1,12 @@ +%% Simulation parameters for system Isothermal (Isothermal_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=1.0 +DT=0.01 +STEPFACTOR=1 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt_old Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt_old ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt_old +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt_old @@ -0,0 +1,12 @@ +%% Simulation parameters for system Isothermal (Isothermal_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=1.0 +DT=0.01 +STEPFACTOR=1 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_sspar.r Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_sspar.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_sspar.r +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_sspar.r @@ -0,0 +1,37 @@ +% Steady-state parameter file (Isothermal_sspar.r) +% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Set a pressure of 1 bar +P_0 := 10^5; + +% Unit initial volume +V_0 := 1; + +% Internal energy +U_0 := P_0*V_0/(gamma_g-1); + +% Set initial temperature of 300k +T_0 := 300; + +% Deduce the mass of gas +m := U_0/(T_0*c_v); + +% Entropy +S_0 := U_0/T_0; + +% Steady-state states +MTTX1 := V_0; % Isothermal_cycle_gas (c) +MTTX2 := S_0; % Isothermal_cycle_entropy (3) +MTTX3 := V_0; % Isothermal_cycle_volume (3) + +% Steady-state inputs +MTTU1 := 0; % Isothermal (Work) +;;END; ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_abg.fig Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_abg.fig ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_abg.fig +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_abg.fig @@ -0,0 +1,25 @@ +#FIG 3.1 +Portrait +Center +Metric +1200 2 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 2026 3151 3601 3151 3376 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 + 5176 3151 6751 3151 6526 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6751 2926 6751 3376 +2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2026 2926 2026 3376 +2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 + 8325 5850 8325 450 675 450 675 5850 8325 5850 +4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001 +4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001 +4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 2700 2925 T\001 +4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001 +4 1 1 1 0 3 30 0.0000000 4 390 4020 4365 4770 Isovolumetric process\001 +4 1 1 1 0 3 20 0.0000000 4 210 510 6120 3555 V=0\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 5940 3285 .\001 +4 1 1 1 0 3 20 0.0000000 4 210 165 2700 3555 S\001 +4 1 1 1 0 3 30 0.0000000 4 60 105 2700 3285 .\001 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_desc.tex Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_desc.tex ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_desc.tex +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_desc.tex @@ -0,0 +1,16 @@ +% Verbal description for system Isovolumetric (Isovolumetric_desc.tex) +% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% Revision 1.1 1997/12/09 12:30:26 peterg +% Initial revision +% +% Revision 1.1 1997/12/08 09:37:04 peterg +% Initial revision +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_input.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_input.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_input.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_input.txt @@ -0,0 +1,16 @@ +# Numerical parameter file (Isovolumetric_input.txt) +# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 2000/12/28 18:17:57 peterg +# %% To RCS +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Set the inputs +## Removed by MTT on Wed Aug 6 11:04:07 BST 2003: u(1) = 1000; #Entropy flow +isovolumetric__heat = 1000; #Entropy flow ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_lbl.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_lbl.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_lbl.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_lbl.txt @@ -0,0 +1,40 @@ +#SUMMARY Isovolumetric: Isovolumetric thermodynamic process - ideal gas +#DESCRIPTION A dynamic simulation of an Isovolumetric (constant volume) +#DESCRIPTION process using the Cycle component and the two-port CU component. +#DESCRIPTION +#DESCRIPTION the Cycle component and the two-port CU component. + +#PAR P_0 +#PAR T_0 +#PAR V_0 + +#NOTPAR ideal_gas + +## Label file for system Isovolumetric (Isovolumetric_lbl.txt) + +# ############################################################### +# ## Version control history +# ############################################################### +# ## $Id$ +# ## $Log$ +# ## Revision 1.2 2000/12/28 18:17:57 peterg +# ## To RCS +# ## +# ## Revision 1.1 1998/07/21 14:37:03 peterg +# ## Initial revision +# ## +# ############################################################### + +## Each line should be of one of the following forms: +# a comment (ie starting with #) +# Component-name CR_name arg1,arg2,..argn +# blank + + + +# Component type Cycle + cycle none ideal_gas;c_v;gamma_g;m_g + +# Component type SS + Heat SS internal,external + Work SS internal,0 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_numpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_numpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_numpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_numpar.txt @@ -0,0 +1,23 @@ +# Numerical parameter file (Isovolumetric_numpar.txt) +# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% Version control history +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# %% $Id$ +# %% $Log$ +# %% Revision 1.1 1998/03/04 11:45:49 peterg +# %% Initial revision +# %% +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +# Initial states -- needed to choose an approppriate mass +P_0 = 1e5; +V_0 = 1; +T_0 = 300; + +# Parameters +c_v = 718.0; # Parameter c_v for CU +gamma_g = 1.4; # Parameter gamma_g for CU +m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_rep.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_rep.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_rep.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_rep.txt @@ -0,0 +1,33 @@ +# Outline report file for system Isovolumetric (Isovolumetric_rep.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %% Revision 1.2 2000/12/28 18:17:57 peterg +% %% To RCS +% %% +% %% Revision 1.1 1999/02/21 02:21:03 peterg +% %% Initial revision +% %% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +mtt -o -ss Isovolumetric abg tex +mtt -o -ss Isovolumetric struc tex +mtt -o -ss Isovolumetric ode tex +mtt -o -ss Isovolumetric ss tex + +mtt -o -ss Isovolumetric numpar txt +mtt -o -ss Isovolumetric input txt + +mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__V' +mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__P' +mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__S' +mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__T' +mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__V:Isovolumetric__cycle__P' +mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__S:Isovolumetric__cycle__T' + + + + ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt @@ -0,0 +1,12 @@ +%% Simulation parameters for system Isovolumetric (Isovolumetric_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=1.0 +DT=0.01 +STEPFACTOR=1 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt_old Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt_old ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt_old +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt_old @@ -0,0 +1,12 @@ +%% Simulation parameters for system Isovolumetric (Isovolumetric_simpar.txt) + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %% $Id$ +% %% $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +LAST=1.0 +DT=0.01 +STEPFACTOR=1 ADDED mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_sspar.r Index: mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_sspar.r ================================================================== --- mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_sspar.r +++ mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_sspar.r @@ -0,0 +1,39 @@ +% Steady-state parameter file (Isovolumetric_sspar.r) +% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% Set a pressure of 1 bar +P_0 := 10^5; + +% Unit initial volume +V_0 := 1; + +% Internal energy +U_0 := P_0*V_0/(gamma_g-1); + +% Set initial temperature of 300k +T_0 := 300; + +% Deduce the mass of gas +m := U_0/(T_0*c_v); + +% Entropy +S_0 := U_0/T_0; + +% Steady-state states +MTTX1 := U_0; % Isovolumetric_cycle_gas (c) +MTTX2 := V_0; % Isovolumetric_cycle_gas (c) +MTTX3 := S_0; % Isovolumetric_cycle_entropy (3) +MTTX4 := V_0; % Isovolumetric_cycle_volume (3) + +% Steady-state inputs +MTTU1 := 0; % Isovolumetric (Heat) +MTTU2 := 0; % Isovolumetric (Work) +;;END; ADDED mtt/lib/examples/debian/README.Debian Index: mtt/lib/examples/debian/README.Debian ================================================================== --- mtt/lib/examples/debian/README.Debian +++ mtt/lib/examples/debian/README.Debian @@ -0,0 +1,6 @@ +mtt-examples for Debian +----------------------- + +Library of examples for MTT (Model Transformation Tools). + + -- Geraint Paul Bevan , Wed, 18 Feb 2004 22:47:08 +0000 ADDED mtt/lib/examples/debian/changelog Index: mtt/lib/examples/debian/changelog ================================================================== --- mtt/lib/examples/debian/changelog +++ mtt/lib/examples/debian/changelog @@ -0,0 +1,6 @@ +mtt-examples (5.0-1) unstable; urgency=low + + * Initial Release. + + -- Geraint Paul Bevan Wed, 18 Feb 2004 22:47:08 +0000 + ADDED mtt/lib/examples/debian/compat Index: mtt/lib/examples/debian/compat ================================================================== --- mtt/lib/examples/debian/compat +++ mtt/lib/examples/debian/compat @@ -0,0 +1,1 @@ +4 ADDED mtt/lib/examples/debian/conffiles.ex Index: mtt/lib/examples/debian/conffiles.ex ================================================================== --- mtt/lib/examples/debian/conffiles.ex +++ mtt/lib/examples/debian/conffiles.ex @@ -0,0 +1,7 @@ +# +# If you want to use this conffile, remove all comments and put files that +# you want dpkg to process here using their absolute pathnames. +# See the policy manual +# +# for example: +# /etc/mtt-examples/mtt-examples.conf ADDED mtt/lib/examples/debian/control Index: mtt/lib/examples/debian/control ================================================================== --- mtt/lib/examples/debian/control +++ mtt/lib/examples/debian/control @@ -0,0 +1,15 @@ +Source: mtt-examples +Section: contrib/math +Priority: optional +Maintainer: Geraint Paul Bevan +Build-Depends: debhelper (>= 4.0.0) +Standards-Version: 3.6.0 + +Package: mtt-examples +Architecture: all +Depends: mtt +Description: Library of examples for Model Transformation Tools + A library of examples containing models of systems which span a range of physical domains (including chemical, electrical, hydraulic, mechanical and thermal) and which demonstrate several uses of bond graph modelling with MTT, such as analysis, control and simulation. + . + The MTT homepage is located at http://mtt.sourceforge.net. An on-line manual is available at http://mtt.sourceforge.net/doc. + . ADDED mtt/lib/examples/debian/copyright Index: mtt/lib/examples/debian/copyright ================================================================== --- mtt/lib/examples/debian/copyright +++ mtt/lib/examples/debian/copyright @@ -0,0 +1,16 @@ +This package was debianized by Geraint Paul Bevan on +Wed, 18 Feb 2004 22:47:08 +0000. + +It was downloaded from http://sourceforge.net/projects/mtt + +Upstream Author(s): Peter Gawthrop + +Copyright: + +mtt-examples is copyright (c) 1989-2004 by Peter J. Gawthrop. + +You are free to distribute this software under the terms of the +GNU General Public License (GPL). + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL. ADDED mtt/lib/examples/debian/cron.d.ex Index: mtt/lib/examples/debian/cron.d.ex ================================================================== --- mtt/lib/examples/debian/cron.d.ex +++ mtt/lib/examples/debian/cron.d.ex @@ -0,0 +1,4 @@ +# +# Regular cron jobs for the mtt-examples package +# +0 4 * * * root mtt-examples_maintenance ADDED mtt/lib/examples/debian/dirs Index: mtt/lib/examples/debian/dirs ================================================================== --- mtt/lib/examples/debian/dirs +++ mtt/lib/examples/debian/dirs @@ -0,0 +1,2 @@ +usr/bin + ADDED mtt/lib/examples/debian/docs Index: mtt/lib/examples/debian/docs ================================================================== --- mtt/lib/examples/debian/docs +++ mtt/lib/examples/debian/docs ADDED mtt/lib/examples/debian/emacsen-install.ex Index: mtt/lib/examples/debian/emacsen-install.ex ================================================================== --- mtt/lib/examples/debian/emacsen-install.ex +++ mtt/lib/examples/debian/emacsen-install.ex @@ -0,0 +1,45 @@ +#! /bin/sh -e +# /usr/lib/emacsen-common/packages/install/mtt-examples + +# Written by Jim Van Zandt , borrowing heavily +# from the install scripts for gettext by Santiago Vila +# and octave by Dirk Eddelbuettel . + +FLAVOR=$1 +PACKAGE=mtt-examples + +if [ ${FLAVOR} = emacs ]; then exit 0; fi + +echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} + +#FLAVORTEST=`echo $FLAVOR | cut -c-6` +#if [ ${FLAVORTEST} = xemacs ] ; then +# SITEFLAG="-no-site-file" +#else +# SITEFLAG="--no-site-file" +#fi +FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" + +ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} + +# Install-info-altdir does not actually exist. +# Maybe somebody will write it. +if test -x /usr/sbin/install-info-altdir; then + echo install/${PACKAGE}: install Info links for ${FLAVOR} + install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz +fi + +install -m 755 -d ${ELCDIR} +cd ${ELDIR} +FILES=`echo *.el` +cp ${FILES} ${ELCDIR} +cd ${ELCDIR} + +cat << EOF > path.el +(setq load-path (cons "." load-path) byte-compile-warnings nil) +EOF +${FLAVOR} ${FLAGS} ${FILES} +rm -f *.el path.el + +exit 0 ADDED mtt/lib/examples/debian/emacsen-remove.ex Index: mtt/lib/examples/debian/emacsen-remove.ex ================================================================== --- mtt/lib/examples/debian/emacsen-remove.ex +++ mtt/lib/examples/debian/emacsen-remove.ex @@ -0,0 +1,15 @@ +#!/bin/sh -e +# /usr/lib/emacsen-common/packages/remove/mtt-examples + +FLAVOR=$1 +PACKAGE=mtt-examples + +if [ ${FLAVOR} != emacs ]; then + if test -x /usr/sbin/install-info-altdir; then + echo remove/${PACKAGE}: removing Info links for ${FLAVOR} + install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/mtt-examples.info.gz + fi + + echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} + rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} +fi ADDED mtt/lib/examples/debian/emacsen-startup.ex Index: mtt/lib/examples/debian/emacsen-startup.ex ================================================================== --- mtt/lib/examples/debian/emacsen-startup.ex +++ mtt/lib/examples/debian/emacsen-startup.ex @@ -0,0 +1,19 @@ +;; -*-emacs-lisp-*- +;; +;; Emacs startup file for the Debian mtt-examples package +;; +;; Originally contributed by Nils Naumann +;; Modified by Dirk Eddelbuettel +;; Adapted for dh-make by Jim Van Zandt + +;; The mtt-examples package follows the Debian/GNU Linux 'emacsen' policy and +;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, +;; xemacs19, emacs20, xemacs20...). The compiled code is then +;; installed in a subdirectory of the respective site-lisp directory. +;; We have to add this to the load-path: +(let ((package-dir (concat "/usr/share/" + (symbol-name flavor) + "/site-lisp/mtt-examples"))) + (when (file-directory-p package-dir) + (setq load-path (cons package-dir load-path)))) + ADDED mtt/lib/examples/debian/init.d.ex Index: mtt/lib/examples/debian/init.d.ex ================================================================== --- mtt/lib/examples/debian/init.d.ex +++ mtt/lib/examples/debian/init.d.ex @@ -0,0 +1,74 @@ +#! /bin/sh +# +# skeleton example file to build /etc/init.d/ scripts. +# This file should be used to construct scripts for /etc/init.d. +# +# Written by Miquel van Smoorenburg . +# Modified for Debian +# by Ian Murdock . +# +# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/mtt-examples +NAME=mtt-examples +DESC=mtt-examples + +test -x $DAEMON || exit 0 + +# Include mtt-examples defaults if available +if [ -f /etc/default/mtt-examples ] ; then + . /etc/default/mtt-examples +fi + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON + echo "$NAME." + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # /var/run/$NAME.pid --exec $DAEMON + #;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 ADDED mtt/lib/examples/debian/manpage.1.ex Index: mtt/lib/examples/debian/manpage.1.ex ================================================================== --- mtt/lib/examples/debian/manpage.1.ex +++ mtt/lib/examples/debian/manpage.1.ex @@ -0,0 +1,60 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH MTT-EXAMPLES SECTION "February 18, 2004" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +mtt-examples \- program to do something +.SH SYNOPSIS +.B mtt-examples +.RI [ options ] " files" ... +.br +.B bar +.RI [ options ] " files" ... +.SH DESCRIPTION +This manual page documents briefly the +.B mtt-examples +and +.B bar +commands. +This manual page was written for the Debian distribution +because the original program does not have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBmtt-examples\fP is a program that... +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +For a complete description, see the Info files. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-v, \-\-version +Show version of program. +.SH SEE ALSO +.BR bar (1), +.BR baz (1). +.br +The programs are documented fully by +.IR "The Rise and Fall of a Fooish Bar" , +available via the Info system. +.SH AUTHOR +This manual page was written by Geraint Paul Bevan , +for the Debian project (but may be used by others). ADDED mtt/lib/examples/debian/manpage.sgml.ex Index: mtt/lib/examples/debian/manpage.sgml.ex ================================================================== --- mtt/lib/examples/debian/manpage.sgml.ex +++ mtt/lib/examples/debian/manpage.sgml.ex @@ -0,0 +1,156 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + + + The docbook-to-man binary is found in the docbook-to-man package. + Please remember that if you create the nroff version in one of the + debian/rules file targets (such as build), you will need to include + docbook-to-man in your Build-Depends control field. + + --> + + + FIRSTNAME"> + SURNAME"> + + February 18, 2004"> + + SECTION"> + geraint@users.sourceforge.net"> + + MTT-EXAMPLES"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
    + &dhemail; +
    + + &dhfirstname; + &dhsurname; + + + 2003 + &dhusername; + + &dhdate; +
    + + &dhucpackage; + + &dhsection; + + + &dhpackage; + + program to do something + + + + &dhpackage; + + + + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; and bar + commands. + + This manual page was written for the &debian; distribution + because the original program does not have a manual page. + Instead, it has documentation in the &gnu; + Info format; see below. + + &dhpackage; is a program that... + + + + OPTIONS + + These programs follow the usual &gnu; command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + Info files. + + + + + + + + Show summary of options. + + + + + + + + Show version of program. + + + + + + SEE ALSO + + bar (1), baz (1). + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + Info system. + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
    + + + + ADDED mtt/lib/examples/debian/manpage.xml.ex Index: mtt/lib/examples/debian/manpage.xml.ex ================================================================== --- mtt/lib/examples/debian/manpage.xml.ex +++ mtt/lib/examples/debian/manpage.xml.ex @@ -0,0 +1,148 @@ + +.
    will be generated. You may view the +manual page with: nroff -man .
    | less'. A +typical entry in a Makefile or Makefile.am is: + +DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ +manpages/docbook.xsl +XP=xsltproc -''-nonet + +manpage.1: manpage.dbk + $(XP) $(DB2MAN) $< + +The xsltproc binary is found in the xsltproc package. The +XSL files are in docbook-xsl. Please remember that if you +create the nroff version in one of the debian/rules file +targets (such as build), you will need to include xsltproc +and docbook-xsl in your Build-Depends control field. + +--> + + + FIRSTNAME"> + SURNAME"> + + February 18, 2004"> + + SECTION"> + geraint@users.sourceforge.net"> + + MTT-EXAMPLES"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
    + &dhemail; +
    + + &dhfirstname; + &dhsurname; + + + 2003 + &dhusername; + + &dhdate; +
    + + &dhucpackage; + + &dhsection; + + + &dhpackage; + + program to do something + + + + &dhpackage; + + + + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; and bar + commands. + + This manual page was written for the &debian; distribution + because the original program does not have a manual page. + Instead, it has documentation in the &gnu; + Info format; see below. + + &dhpackage; is a program that... + + + + OPTIONS + + These programs follow the usual &gnu; command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + Info files. + + + + + + + + Show summary of options. + + + + + + + + Show version of program. + + + + + + SEE ALSO + + bar (1), baz (1). + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + Info system. + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
    + ADDED mtt/lib/examples/debian/menu.ex Index: mtt/lib/examples/debian/menu.ex ================================================================== --- mtt/lib/examples/debian/menu.ex +++ mtt/lib/examples/debian/menu.ex @@ -0,0 +1,2 @@ +?package(mtt-examples):needs=X11|text|vc|wm section=Apps/see-menu-manual\ + title="mtt-examples" command="/usr/bin/mtt-examples" ADDED mtt/lib/examples/debian/mtt-examples-default.ex Index: mtt/lib/examples/debian/mtt-examples-default.ex ================================================================== --- mtt/lib/examples/debian/mtt-examples-default.ex +++ mtt/lib/examples/debian/mtt-examples-default.ex @@ -0,0 +1,10 @@ +# Defaults for mtt-examples initscript +# sourced by /etc/init.d/mtt-examples +# installed at /etc/default/mtt-examples by the maintainer scripts + +# +# This is a POSIX shell fragment +# + +# Additional options that are passed to the Daemon. +DAEMON_OPTS="" ADDED mtt/lib/examples/debian/mtt-examples.doc-base.EX Index: mtt/lib/examples/debian/mtt-examples.doc-base.EX ================================================================== --- mtt/lib/examples/debian/mtt-examples.doc-base.EX +++ mtt/lib/examples/debian/mtt-examples.doc-base.EX @@ -0,0 +1,22 @@ +Document: mtt-examples +Title: Debian mtt-examples Manual +Author: +Abstract: This manual describes what mtt-examples is + and how it can be used to + manage online manuals on Debian systems. +Section: unknown + +Format: debiandoc-sgml +Files: /usr/share/doc/mtt-examples/mtt-examples.sgml.gz + +Format: postscript +Files: /usr/share/doc/mtt-examples/mtt-examples.ps.gz + +Format: text +Files: /usr/share/doc/mtt-examples/mtt-examples.text.gz + +Format: HTML +Index: /usr/share/doc/mtt-examples/html/index.html +Files: /usr/share/doc/mtt-examples/html/*.html + + ADDED mtt/lib/examples/debian/postinst.ex Index: mtt/lib/examples/debian/postinst.ex ================================================================== --- mtt/lib/examples/debian/postinst.ex +++ mtt/lib/examples/debian/postinst.ex @@ -0,0 +1,42 @@ +#! /bin/sh +# postinst script for mtt-examples +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +case "$1" in + configure) + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ADDED mtt/lib/examples/debian/postrm.ex Index: mtt/lib/examples/debian/postrm.ex ================================================================== --- mtt/lib/examples/debian/postrm.ex +++ mtt/lib/examples/debian/postrm.ex @@ -0,0 +1,38 @@ +#! /bin/sh +# postrm script for mtt-examples +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 ADDED mtt/lib/examples/debian/preinst.ex Index: mtt/lib/examples/debian/preinst.ex ================================================================== --- mtt/lib/examples/debian/preinst.ex +++ mtt/lib/examples/debian/preinst.ex @@ -0,0 +1,44 @@ +#! /bin/sh +# preinst script for mtt-examples +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) +# if [ "$1" = "upgrade" ] +# then +# start-stop-daemon --stop --quiet --oknodo \ +# --pidfile /var/run/mtt-examples.pid \ +# --exec /usr/sbin/mtt-examples 2>/dev/null || true +# fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ADDED mtt/lib/examples/debian/prerm.ex Index: mtt/lib/examples/debian/prerm.ex ================================================================== --- mtt/lib/examples/debian/prerm.ex +++ mtt/lib/examples/debian/prerm.ex @@ -0,0 +1,39 @@ +#! /bin/sh +# prerm script for mtt-examples +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) +# install-info --quiet --remove /usr/info/mtt-examples.info.gz + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ADDED mtt/lib/examples/debian/rules Index: mtt/lib/examples/debian/rules ================================================================== --- mtt/lib/examples/debian/rules +++ mtt/lib/examples/debian/rules @@ -0,0 +1,98 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #/usr/bin/docbook-to-man debian/mtt-examples.sgml > mtt-examples.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/mtt-examples. + $(MAKE) install DESTDIR=$(CURDIR)/debian/mtt-examples + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs +# dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure ADDED mtt/lib/examples/debian/watch.ex Index: mtt/lib/examples/debian/watch.ex ================================================================== --- mtt/lib/examples/debian/watch.ex +++ mtt/lib/examples/debian/watch.ex @@ -0,0 +1,6 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# Site Directory Pattern Version Script +version=2 +sunsite.unc.edu /pub/Linux/Incoming mtt-examples-(.*)\.tar\.gz debian uupdate ADDED mtt/lib/latex/bg.sty Index: mtt/lib/latex/bg.sty ================================================================== --- mtt/lib/latex/bg.sty +++ mtt/lib/latex/bg.sty @@ -0,0 +1,35 @@ +%% Bond Graph commands +\newcommand{\B}[1]{\text{\sffamily\textbf{#1}}} +\newcommand{\AmpE}{\B{AE }} +\newcommand{\AF}{\B{AF }} +\newcommand{\C}{\B{C }} +\newcommand{\CSW}{\B{CSW }} +\newcommand{\De}{\B{De }} +\newcommand{\Df}{\B{Df }} +\newcommand{\I}{\B{I }} +\newcommand{\INTF}{\B{INTF }} +\newcommand{\ISW}{\B{ISW }} +\newcommand{\R}{\B{R }} +\newcommand{\Se}{\B{Se }} +\newcommand{\Sf}{\B{Sf }} +\newcommand{\Ss}{\B{SS }} +\newcommand{\one}{\B{1 }} +\newcommand{\zero}{\B{0 }} +\newcommand{\TF}{\B{TF }} +\newcommand{\GY}{\B{GY }} + +%% Bond Graph components with label +\newcommand{\BB}[2]{$\B{#1}$:$\mathbf{#2}$} %Generic + +\newcommand{\BC}[1]{\BB{C}{#1}} +\newcommand{\BI}[1]{\BB{I}{#1}} +\newcommand{\BR}[1]{\BB{R}{#1}} + +\newcommand{\BSS}[1]{\BB{SS}{#1}} +\newcommand{\BSe}[1]{\BB{Se}{#1}} +\newcommand{\BSf}[1]{\BB{Sf}{#1}} +\newcommand{\BDe}[1]{\BB{De}{#1}} +\newcommand{\BDf}[1]{\BB{Df}{#1}} + +\newcommand{\BTF}[1]{\BB{TF}{#1}} +\newcommand{\BGY}[1]{\BB{TF}{#1}} ADDED mtt/lib/octave/.octaverc Index: mtt/lib/octave/.octaverc ================================================================== --- mtt/lib/octave/.octaverc +++ mtt/lib/octave/.octaverc @@ -0,0 +1,16 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Startup file for Octave for use with MTT +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +implicit_str_to_num_ok = 1; +empty_list_elements_ok = 1; +warn_string_concat = 0; + +## Turn off irrelevant warnings +warning off Octave:possible-matlab-short-circuit-operator +warning off Octave:deprecated-syntax + +## No more core dumps +crash_dumps_octave_core(0) +sigterm_dumps_octave_core(0) +sighup_dumps_octave_core(0) ADDED mtt/lib/octave/README Index: mtt/lib/octave/README ================================================================== --- mtt/lib/octave/README +++ mtt/lib/octave/README @@ -0,0 +1,1 @@ +This contains some octave specific helps to MTT ADDED mtt/lib/octave/mkoctfile Index: mtt/lib/octave/mkoctfile ================================================================== --- mtt/lib/octave/mkoctfile +++ mtt/lib/octave/mkoctfile @@ -0,0 +1,202 @@ +#! /bin/sh +# +# mkoctfile -- create a .oct file suitable for dynamic linking by +# Octave. +echo mkoctfile with optimisation level 0 +# Exit immediately on any error. + +set -e + +# Default values for these variables are filled in when Octave is +# compiled. + +: ${CPPFLAGS=""} +: ${INCFLAGS="-I/usr/include -I/usr/include/octave-2.0.16"} +: ${F77="g77"} +: ${FFLAGS="-O0"} +: ${FPICFLAG="-fPIC"} +: ${CC="gcc"} +: ${CFLAGS="-DHAVE_CONFIG_H -mieee-fp -O0"} +: ${CPICFLAG="-fPIC"} +: ${CXX="c++"} +: ${CXXFLAGS="-O0"} +: ${CXXPICFLAG="-fPIC"} +: ${XTRA_CFLAGS="-mieee-fp -fno-rtti -fno-exceptions -fno-implicit-templates"} +: ${XTRA_CXXFLAGS="-mieee-fp -fno-rtti -fno-exceptions -fno-implicit-templates"} + +: ${SH_LD="c++"} +: ${SH_LDFLAGS="-shared"} + +: ${ALL_FFLAGS="$FFLAGS"} + +: ${ALL_CFLAGS="$INCFLAGS $XTRA_CFLAGS $CFLAGS"} + +: ${ALL_CXXFLAGS="$INCFLAGS $XTRA_CXXFLAGS $CXXFLAGS"} + +# Local variables. + +usage_msg="usage: mkoctfile [options] file ..." + +cfiles= +ccfiles= +f77files= +objfiles= +octfiles= +octfile= +incflags= +defs= +ldflags= +dbg=: +strip=false + +if [ $# -eq 0 ]; then + echo $usage_msg + exit 1; +fi + +while [ $# -gt 0 ]; do + file= + case "$1" in + *.c) + file=$1 + cfiles="$cfiles $file" + ;; + *.cc | *.C | *.cpp) + file=$1 + ccfiles="$ccfiles $file" + ;; + *.f | *.F) + file=$1 + f77files="$f77files $file" + ;; + *.o) + file=$1 + objfiles="$objfiles $file" + ;; + -d | --debug | -v | --verbose) + dbg=echo + ;; + -h | -\? | --help) + echo $usage_msg + cat << EOF + +Options: + + -h, -?, --help Print this message. + -IDIR Add -IDIR to compile commands. + -DDEF Add -DDEF to compile commands. + -lLIB Add library LIB to link command. + -LDIR Add -LDIR to link command. + -o FILE, --output FILE Output file name. Default extension is .oct. + -s, --strip Strip output file. + -v, --verbose Echo commands as they are executed. + + FILE Compile or link FILE. Recognized file types are: + + .c C source + .cc C++ source + .C C++ source + .cpp C++ source + .f Fortran source + .F Fortran source + .o object file + +EOF + exit 0 + ;; + -I*) + incflags="$incflags $1" + ;; + -D*) + defs="$defs $1" + ;; + -[lL]*) + ldflags="$ldflags $1" + ;; + -o | --output) + shift + if [ $# -gt 0 ]; then + octfile=`echo $1 | sed 's,\.[^.]*$,,'`.oct + else + echo "mkoctfile: output file name missing" + fi + ;; + -s | --strip) + strip=true + ;; + *) + echo "mkoctfile: unrecognized argument $1" + exit 1 + ;; + esac + if [ -n "$file" ]; then + if [ -z "$octfile" ]; then + octfile=`echo $file | sed 's,\.[^.]*$,,'`.oct + fi + fi + shift +done + +# Compile Fortran, C, and C++ files. Add the name of each object file +# that is produced to the overall list of object files. + +if [ -n "$f77files" ]; then + for f in $f77files; do + case $f in + *.f) + b=`echo $f | sed 's,\.f$,,'` + ;; + *.F) + b=`echo $f | sed 's,\.F$,,'` + ;; + esac + o=$b.o + objfiles="$objfiles $o" + $dbg $F77 -c $FPICFLAG $ALL_FFLAGS $f -o $o + eval $F77 -c $FPICFLAG $ALL_FFLAGS $f -o $o + done +fi + +if [ -n "$cfiles" ]; then + for f in $cfiles; do + b=`echo $f | sed 's,\.c$,,'` + o=$b.o + objfiles="$objfiles $o" + $dbg $CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $incflags $defs $f -o $o + eval $CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $incflags $defs $f -o $o + done +fi + +if [ -n "$ccfiles" ]; then + for f in $ccfiles; do + case $f in + *.cc) + b=`echo $f | sed 's,\.cc$,,'` + ;; + *.C) + b=`echo $f | sed 's,\.C$,,'` + ;; + *.cpp) + b=`echo $f | sed 's,\.cpp$,,'` + ;; + esac + o=$b.o + objfiles="$objfiles $o" + $dbg $CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $incflags $defs $f -o $o + eval $CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $incflags $defs $f -o $o + done +fi + +# Link all the object files. + +$dbg $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags +eval $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags + +# Maybe strip it. + +if $strip; then + $dbg strip $octfile + eval strip $octfile +fi + +exit 0 ADDED mtt/lib/reduce/fix_c.r Index: mtt/lib/reduce/fix_c.r ================================================================== --- mtt/lib/reduce/fix_c.r +++ mtt/lib/reduce/fix_c.r @@ -0,0 +1,26 @@ +%% Fixes for c-code generation + +%% Set PI explicitly here to avoid later conflict with cc headers +%% if PI is not already a number (i.e. on rounded has not been set) +IF NOT NUMBERP (pi) THEN LET PI = 3.14159$ + +ON ROUNDED$ % No integer output + +%% Changes x^y to pow(x,y) + OPERATOR pow$ + FOR ALL x,y LET x^y = pow(x,y)$ % Use the pow function + FOR ALL x,y LET x**y = pow(x,y)$ % Use the pow function + + %% Derivatives + FOR ALL f,g,x LET df(pow(f,g),x)= + pow(f,g-1) * (df(f,x)*g + df(g,x)*f*log(f))$ + + %% Special cases + FOR ALL x LET pow(x,0) = 1$ + FOR ALL x LET pow(x,1) = x$ + +OPERATOR fabs$ +FOR ALL x let abs(x) = fabs(x)$ + + +END$ ADDED mtt/lib/reduce/reserved_words.make Index: mtt/lib/reduce/reserved_words.make ================================================================== --- mtt/lib/reduce/reserved_words.make +++ mtt/lib/reduce/reserved_words.make @@ -0,0 +1,15 @@ +#! /bin/sh + +reduce_reserved_word_manual_page=${1:-"/usr/local/reduce/doc/manual/appenda.tex"} +output="reserved_words.txt" + +cat $reduce_reserved_word_manual_page |\ + tr "\n" " " |\ + sed 's/\\\_/_/g' |\ + sed 's/\\tt\ \([A-Za-z0-9_]*\)/\"\1\"/g' |\ + tr " " "\n" |\ + sed 's/\{//g' |\ + sed 's/\}//g' |\ + gawk -F\" '(NF==3) { printf "%s\n",$2 }' |\ + sort -u \ +> $output ADDED mtt/lib/reduce/reserved_words.txt Index: mtt/lib/reduce/reserved_words.txt ================================================================== --- mtt/lib/reduce/reserved_words.txt +++ mtt/lib/reduce/reserved_words.txt @@ -0,0 +1,279 @@ +ABS +ACOS +ACOSH +ACOT +ACOTH +ACSC +ACSCH +ADJPREC +ALGEBRAIC +ALGINT +ALLBRANCH +ALLFAC +AND +ANTISYMMETRIC +APPEND +ARGLENGTH +ARRAY +ASEC +ASECH +ASIN +ASINH +ATAN +ATAN2 +ATANH +BEGIN +BFSPACE +BYE +CARD_NO +CEILING +CLEAR +CLEARRULES +COEFF +COEFFN +COFACTOR +COMBINEEXPT +COMBINELOGS +COMMENT +COMP +COMPLEX +CONJ +CONS +CONT +COS +COSH +COT +COTH +CRAMER +CREF +CSC +CSCH +DECOMPOSE +DEFINE +DEFN +DEG +DEMO +DEN +DEPEND +DET +DF +DIFFERENCE +DILOG +DISPLAY +DIV +DO +E +ECHO +ED +EDITDEF +EI +END +EPS +EQ +EQUAL +ERF +ERRCONT +EVALLHSEQP +EVAL_MODE +EVEN +EVENP +EXP +EXPANDLOGS +EXPR +EXPT +EZGCD +FACTOR +FACTORIAL +FACTORIZE +FEXPR +FIRST +FIX +FIXP +FLOOR +FOR +FORALL +FOREACH +FORT +FORT_WIDTH +FREEOF +FULLROOTS +G +GCD +GEQ +GO +GOTO +GREATERP +HIGH_POW +HYPOT +I +IF +IFACTOR +IMPART +IN +INDEX +INFINITY +INFIX +INPUT +INT +INTEGER +INTERPOL +INTSTR +K +KORDER +LAMBDA +LCM +LCOF +LENGTH +LEQ +LESSP +LET +LHS +LINEAR +LINELENGTH +LISP +LIST +LISTARGP +LISTARGS +LN +LOAD +LOAD_PACKAGE +LOG +LOG10 +LOGB +LOW_POW +LTERM +MACRO +MAINVAR +MASS +MAT +MATCH +MATEIGEN +MATRIX +MAX +MCD +MEMBER +MEMQ +MIN +MINUS +MKID +MODULAR +MSG +MSHELL +MULTIPLICITIES +NAT +NEQ +NERO +NEXTPRIME +NIL +NODEPEND +NONCOM +NONZERO +NOSPLIT +NOSPUR +NULLSPACE +NUM +NUMBERP +ODD +OFF +ON +OPERATOR +OR +ORDER +ORDP +OUT +OUTPUT +PART +PAUSE +PERIOD +PF +PI +PLUS +PRECEDENCE +PRECISE +PRECISION +PRET +PRI +PRIMEP +PRINT_PRECISION +PROCEDURE +PRODUCT +QUIT +QUOTIENT +RANDOM +RANDOM_NEW_SEED +RANK +RAT +RATARG +RATIONAL +RATIONALIZE +RATPRI +REAL +REDERR +REDUCT +REMAINDER +REMFAC +REMIND +REPART +REPEAT +REST +RESULTANT +RETRY +RETURN +REVERSE +REVPRI +RHS +RLISP88 +ROOT_MULTIPLICITY +ROUND +ROUNDALL +ROUNDBF +ROUNDED +SAVEAS +SAVESTRUCTR +SCALAR +SEC +SECH +SECOND +SET +SETMOD +SETQ +SHARE +SHOWRULES +SHOWTIME +SHUT +SIGN +SIN +SINH +SMACRO +SOLVE +SOLVESINGULAR +SPUR +SQRT +STRUCTR +SUB +SUM +SYMBOLIC +SYMMETRIC +T +TAN +TANH +THIRD +TIME +TIMES +TP +TRA +TRACE +TRFAC +TRIGFORM +TRINT +UNTIL +VARNAME +VECDIM +VECTOR +WEIGHT +WHEN +WHERE +WHILE +WRITE +WS +WTLEVEL ADDED mtt/lib/rep/cxxsim.cc Index: mtt/lib/rep/cxxsim.cc ================================================================== --- mtt/lib/rep/cxxsim.cc +++ mtt/lib/rep/cxxsim.cc @@ -0,0 +1,672 @@ +/* cxxsim: creates a C++ simulation from MTT elementary system equations + * Copyright (C) 2000,2002 Geraint Paul Bevan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include + +namespace cxxsim { + + class cr { + + public: + + cr (std::string system_name); + + void read (std::ifstream &file); + void write (std::ofstream &file); + + friend std::ifstream &operator>> (std::ifstream &file, cr &c); + friend std::ofstream &operator<< (std::ofstream &file, cr &c); + + private: + + std::string name; + + std::list L; + }; + + class equations { + + public: + + equations (std::string system_name); + + void read (std::ifstream &file); + void write (std::ofstream &file); + + friend std::ifstream &operator>> (std::ifstream &file, equations &e); + friend std::ofstream &operator<< (std::ofstream &file, equations &e); + + private: + + void descend (std::string s); + void parse (void); + + std::string name; // system name + + // list of statements collected by reader + std::list statements; + + std::list leqn; // final expressions + std::list lvar; // intermediate expressions + std::list loop; // algebraic loops + + // table of final and intermediate expressions + std::map meqn; // lhs, rhs mapping + std::map mvar; + + // tag is symbol denoting an intermediate variable + std::string tag; // denotes intermediates + + // token delimiters (not ([{.`'" or alphanumeric) + std::string delim; + }; + + class parameter { + + public: + + parameter (std::string system_name); + + void read (std::ifstream &file); + void write (std::ofstream &file); + + friend std::ifstream &operator>> (std::ifstream &file, parameter &p); + friend std::ofstream &operator<< (std::ofstream &file, parameter &p); + + private: + + std::string name; + + struct record { + std::string variable; + std::string component; + }; + + typedef struct record record_t; + std::list L; + }; + + class structure { + + public: + + structure (std::string system_name); + + void read (std::ifstream &file); + void write (std::ofstream &file); + + friend std::ifstream &operator>> (std::ifstream &file, structure &s); + friend std::ofstream &operator<< (std::ofstream &file, structure &s); + + private: + + void write_declare (std::ofstream &file); + void write_input (std::ofstream &file); + void write_logic (std::ofstream &file); + void write_state (std::ofstream &file); + + std::string name; + + struct record { + std::string vec; // vector: u, x, y, yz + unsigned int num; // position of element in vector + std::string cmp; // component + std::string fnm; // full name + unsigned int rpt; // number of repetitions + std::string cty; // causality + }; + + typedef struct record record_t; + std::list Lu; + std::list Lx; + std::list Ly; + std::list Lyz; + std::list::iterator i; + }; + + cr::cr (std::string system_name){ + name = system_name; + } + + void + cr::read (std::ifstream &file){ + std::string r; + while (file >> r){ + L.push_back(r); + } + } + + void + cr::write (std::ofstream &file){ + file << "enum causality { effort, flow, state };" << std::endl + << "typedef enum causality causality_t;" << std::endl; + std::list::iterator i; + for (i = L.begin(); i != L.end(); i++){ + if ((*i != "SS") && (*i != "ISW")){ + file << "#include <" << *i << ".hh>" << std::endl; + } + } + file << std::endl; + } + + std::ifstream &operator>> (std::ifstream &file, cr &c){ + c.read(file); + return file; + } + + std::ofstream &operator<< (std::ofstream &file, cr &c){ + c.write(file); + return file; + } + + equations::equations (std::string system_name){ + name = system_name; + tag = system_name; + delim = "~!@#$%^&*)-+=]}\\|;:,<>/?"; + }; + + void + equations::read (std::ifstream &file){ + + char c; + std::string s; + std::string t; + + unsigned int i; + + // file.unsetf(std::ios::skipws); + file.setf(std::ios::skipws); + + // read lines from file (no max length, unlike std::getline) + while (file >> c){ + s = ""; + while (c != ';' && file){ + if (c == '%'){ + file.unsetf(std::ios::skipws); + while ((c != '\n') && file){ + file >> c; // eat comment + } + file.setf(std::ios::skipws); + } else { + if ((c != ' ') && (c != '\t')){ // strip whitespace + s += c; + } + file >> c; + } + } + + // fix vector references + t = "MTTu("; + while ((i = s.find(t)) < s.length()){ + s.replace(i, 5, "mttu["); + i += s.substr(i, s.length()).find(",1)"); + s.replace(i, 3, "]"); + } + t = "MTTx("; + while ((i = s.find(t)) < s.length()){ + s.replace(i, 5, "mttx["); + i += s.substr(i, s.length()).find(",1)"); + s.replace(i, 3, "]"); + } + t = "MTTdX("; + while ((i = s.find(t)) < s.length()){ + s.replace(i, 6, "mttdx["); + i += s.substr(i, s.length()).find(",1)"); + s.replace(i, 3, "]"); + } + t = "MTTy("; + while ((i = s.find(t)) < s.length()){ + s.replace(i, 5, "mtty["); + i += s.substr(i, s.length()).find(",1)"); + s.replace(i, 3, "]"); + } + + // strip newlines + while ((i = s.find('\n')) < s.length()){ + s.replace(i, 1, ""); + } + + if ((s != "") && (s != "END")){ + // add statement to list + statements.push_back(s); + } + } + + // finished reading, time to comprehend ... + this->parse(); + } + + void + equations::write (std::ofstream &file){ + + std::list::iterator eqn; + + file << "void" << std::endl + << this->name << "_ode(const double t," << std::endl + << "\tdouble *mttu," << std::endl + << "\tdouble *mttx," << std::endl + << "\tdouble *mttdx," << std::endl + << "\tdouble *mtty)" << std::endl + << "{" << std::endl; + for (eqn = leqn.begin(); eqn != leqn.end(); eqn++){ + file << *eqn << " = " << meqn[*eqn] << ";" << std::endl; + } + file << "} // " << this->name << "_ode" << std::endl; + }; + + void + equations::descend (std::string s){ + + char c; + unsigned int i; + bool cont; + + std::list::iterator var; + + loop.push_back(s); + + // find algebraic loops + for (var = loop.begin(); var != loop.end(); var++){ + if ((i = mvar[s].find(*var)) < mvar[s].length()){ + c = mvar[s].c_str()[i + var->length()]; + if (delim.find(c) < delim.length()){ + std::cerr << std::endl + << "warning: algebraic loop" << std::endl + << '\t' << s << " = " << mvar[s].substr(0, 60); + if (mvar[s].length() > 60){ + std::cerr << " ..."; + } + std::cerr << std::endl << std::endl; + mvar[s] = s + "____loop"; + } + } + } + + // substitutes intermediate variables for their expansion + do { + cont = false; + for (var = lvar.begin(); var != lvar.end(); var++){ + // check for token match + while ((i = mvar[s].find(*var)) < mvar[s].length()){ + // ensure exact match + c = mvar[s].c_str()[i + var->length()]; + if (delim.find(c) < delim.length()){ + // expand expression recursively + this->descend(*var); + // check match again, map may have changed + if ((i = mvar[s].find(*var)) < mvar[s].length()){ + c = mvar[s].c_str()[i + var->length()]; + if (delim.find(c) < delim.length()){ + // substitute expression + mvar[s].replace(i, var->length(), mvar[*var]); + // continue + cont = true; + } + } + } + } + } + } while (cont); + loop.pop_back(); + } + + void + equations::parse (void){ + + char c; + unsigned int i; + + std::string lhs; + std::string rhs; + + std::list::iterator s; + + std::list::iterator eqn; + std::list::iterator var; + + for (s = statements.begin(); s != statements.end(); s++){ + // parse statement + if ((i = s->find(":=")) < s->length()){ + lhs = s->substr(0, i); + rhs = s->substr(i+2, s->length()); + + // separate intermediate and final variables + if (s->substr(0, tag.length()) == tag){ + // add to table of intermediate variables + lvar.push_back(lhs); + mvar[lhs] = "(" + rhs + ")"; + } else { + // add to table of final variables + leqn.push_back(lhs); + meqn[lhs] = rhs + ";"; + } + } else { + std::cerr << std::endl + << "warning: non-assignment -- ignoring" + << std::endl + << '\t' << *s << std::endl + << std::endl; + } + } + + // expand rhs of intermediate variables + for (var = lvar.begin(); var != lvar.end(); var++){ + loop.clear(); + descend(*var); + } + + // substitute expanded expressions into final equations + for (eqn = leqn.begin(); eqn != leqn.end(); eqn++){ + for (var = lvar.begin(); var != lvar.end(); var++){ + while ((i = meqn[*eqn].find(*var)) < meqn[*eqn].length()){ + c = meqn[*eqn].c_str()[i + var->length()]; + if (delim.find(c) < delim.length()){ + meqn[*eqn].replace(i, var->length(), mvar[*var]); + } + } + } + } + } + + std::ifstream &operator>> (std::ifstream &file, equations &e){ + e.read(file); + return file; + } + + std::ofstream &operator<< (std::ofstream &file, equations &e){ + e.write(file); + return file; + } + + parameter::parameter (std::string system_name){ + name = system_name; + }; + + void + parameter::read (std::ifstream &file){ + record_t r; + while (file >> r.variable >> r.component){ + if (r.variable.find("#") == 0){ + file.unsetf(std::ios::skipws); + char c = '\0'; + while (c != '\n'){ + file >> c; + } + file.setf(std::ios::skipws); + } else { + L.push_back(r); + } + } + } + + void + parameter::write (std::ofstream &file){ + std::list::iterator i; + std::string type; + std::string value; + for (i = L.begin(); i != L.end(); i++){ + if (i->variable.substr(0, 6) == "bool__"){ + type = "bool"; + value = "false"; + } else if (i->variable.substr(0, 6) == "char__"){ + type = "char"; + value = "\0"; + } else if (i->variable.substr(0, 8) == "double__"){ + type = "double"; + value = "1.0"; + } else if (i->variable.substr(0, 7) == "float__"){ + type = "float"; + value = "1.0"; + } else if (i->variable.substr(0, 5) == "int__"){ + type = "int"; + value = "1"; + } else if (i->variable.substr(0, 7) == "string__"){ + type = "std::string"; + value = "hello world!"; + } else { + type = "double"; + value = "1.0"; + } + file << "static " << type << "\t" << i->variable << " = " << value + << ";\t// " << i->component << std::endl; + } + file << std::endl; + } + + std::ifstream &operator>> (std::ifstream &file, parameter &p){ + p.read(file); + return file; + } + + std::ofstream &operator<< (std::ofstream &file, parameter &p){ + p.write(file); + return file; + } + + structure::structure (std::string system_name){ + name = system_name; + }; + + void + structure::read (std::ifstream &file){ + std::list *p; + record_t r; + if (! file){ + std::cerr << "warning: no structure data found (empty file)" << std::endl; + } + while (file >> r.vec >> r.num >> r.cmp >> r.fnm >> r.rpt >> r.cty){ + if (r.vec == "input"){ + p = &(this->Lu); + } else if (r.vec == "state"){ + p = &(this->Lx); + } else if (r.vec == "output"){ + p = &(this->Ly); + } else { + p = &(this->Lyz); + } + p->push_back(r); + } + }; + + void + structure::write (std::ofstream &file){ + this->write_declare(file); + file << std::endl; + this->write_input(file); + file << std::endl; + this->write_logic(file); + file << std::endl; + this->write_state(file); + file << std::endl; + } + + void + structure::write_declare (std::ofstream &file){ + file << "const int mttNu\t= " << this->Lu.size() + 1 << ";" << std::endl + << "const int mttNx\t= " << this->Lx.size() + 1 << ";" << std::endl + << "const int mttNy\t= " << this->Ly.size() + 1 << ";" << std::endl + << "static double mttu[mttNu];" << std::endl + << "static double mttx[mttNx];" << std::endl + << "static double mtty[mttNy];" << std::endl + << "static double mttdx[mttNx];" << std::endl + << std::endl; + } + + void + structure::write_input (std::ofstream &file){ + file << "void" << std::endl + << this->name << "_input(const double t," << std::endl + << "\tdouble *mttu," << std::endl + << "\tdouble *mttx," << std::endl + << "\tdouble *mtty)" << std::endl + << "{" << std::endl; + for (i = Lu.begin(); i != Lu.end(); i++){ + file << "\tmttu[" << i->num << "]\t= 1.0;" + << "\t// " << i->cmp + << "\t(" << i->fnm << ")" << std::endl; + } + file << "} // " << this->name << "_input" << std::endl; + } + + void + structure::write_logic (std::ofstream &file){ + file << "void" << std::endl + << this->name << "_logic(const double t," << std::endl + << "\tdouble *mttu," << std::endl + << "\tdouble *mttx," << std::endl + << "\tdouble *mttdx," << std::endl + << "\tdouble *mtty)" << std::endl + << "{" << std::endl; + for (i = Lx.begin(); i != Lx.end(); i++){ + if (i->cmp == "MTT_SWITCH"){ + file << "int " << i->fnm << " = 1;" << std::endl + << "if ((" << i->fnm << " == 0)" + << " || ((" << i->fnm << " < 0)" + << " && (mttx[" << i->num << "] < 0.0))){" << std::endl + << "\tmttx[" << i->num << "]\t = 0.0;" << std::endl + << "\tmttdx[" << i->num << "]\t = 0.0;" << std::endl + << "}" << std::endl; + } + } + file << "} // " << this->name << "_logic" << std::endl; + } + + void + structure::write_state (std::ofstream &file){ + file << "void" << std::endl + << this->name << "_state(double *mttx)" << std::endl + << "{" << std::endl; + for (i = Lx.begin(); i != Lx.end(); i++){ + file << "\tmttx[" << i->num << "]\t= 0.0;" + << "\t// " << i->cmp + << "\t(" << i->fnm << ")" << std::endl; + } + file << "} // " << this->name << "_state" << std::endl; + } + + std::ifstream &operator>> (std::ifstream &file, structure &s){ + s.read(file); + return file; + } + + std::ofstream &operator<< (std::ofstream &file, structure &s){ + s.write(file); + return file; + } + +}; + +void +usage(const char *program){ + std::cerr << std::endl + << "usage: " << program << " system" << std::endl + << std::endl; +} + +int main(int argc, char *argv[]) +{ + // check usage + if (argc != 2){ + usage(argv[0]); + return 1; + } + std::string system_name = argv[1]; + + // open files for reading and writing + std::string cr_filename = system_name + "_cr.txt"; + std::string parameter_filename = system_name + "_sympar.txt"; + std::string structure_filename = system_name + "_struc.txt"; + std::string equations_filename = system_name + "_ese.r"; + std::string cxxsim_filename = system_name + "_cxxsim.cc"; + + std::ifstream cr_file (cr_filename.c_str()); + std::ifstream parameter_file(parameter_filename.c_str()); + std::ifstream structure_file(structure_filename.c_str()); + std::ifstream equations_file(equations_filename.c_str()); + std::ofstream cxxsim_file(cxxsim_filename.c_str()); + + // announce transformation + std::clog << "Creating " << cxxsim_filename << std::endl; + + // do transformations (abracadabra!) + cxxsim::cr system_cr (system_name); + cxxsim::parameter system_parameter(system_name); + cxxsim::structure system_structure(system_name); + cxxsim::equations system_equations(system_name); + + cr_file >> system_cr; + parameter_file >> system_parameter; + structure_file >> system_structure; + equations_file >> system_equations; + + + cxxsim_file << system_cr + << system_parameter + << system_structure + << system_equations + << std::endl; + + cxxsim_file << std::endl + << "int" << std::endl + << "main(void){" << std::endl + << std::endl + << " double mttdt = 0.1; // integration time step" << std::endl + << " double mttt;" << std::endl + << " int i;" << std::endl + << std::endl + << " for (mttt = 0.0; mttt <= 10.0; mttt += mttdt){" << std::endl + << std::endl + << " // get inputs and rates" << std::endl + << " " << system_name << "_input(mttt,mttu,mttx,mtty);" << std::endl + << " " << system_name << "_ode(mttt,mttu,mttx,mttdx,mtty);" << std::endl + << std::endl + << " // integrate states (euler)" << std::endl + << " for (i = 1; i <= mttNx; i++){" << std::endl + << " mttx[i] += mttdx[i] * mttdt;" << std::endl + << " }" << std::endl + << std::endl + << " // overwrite switch states" << std::endl + << " " << system_name << "_logic(mttt,mttu,mttx,mttdx,mtty);" << std::endl + << std::endl + << " // write: time outputs time states" << std::endl + << " std::cout << mttt << '\\t';" << std::endl + << " for (i = 1; i <= mttNy; i++){" << std::endl + << " std::cout << mtty[i] << ' ';" << std::endl + << " }" << std::endl + << " std::cout << '\\t' << mttt;" << std::endl + << " for (i = 1; i <= mttNx; i++){" << std::endl + << " std::cout << ' ' << mttx[i];" << std::endl + << " }" << std::endl + << " std::cout << std::endl;" << std::endl + << " }" << std::endl + << " return 0;" << std::endl + << "}" << std::endl; + + // close files + cr_file.close(); + parameter_file.close(); + structure_file.close(); + equations_file.close(); + cxxsim_file.close(); + + return 0; +} ADDED mtt/lib/rep/cxxsim_rep.make Index: mtt/lib/rep/cxxsim_rep.make ================================================================== --- mtt/lib/rep/cxxsim_rep.make +++ mtt/lib/rep/cxxsim_rep.make @@ -0,0 +1,95 @@ +# -*-makefile-*- + +# usage: mtt cxxsim view + +# example: +# mtt copy MotorGenerator && cd MotorGenerator && mtt MotorGenerator cxxsim view + +# cxxsim creates a very simple C++ simulation without using Reduce +# it doesn't use MTT's normal .txt files so the resultant .cc must be edited +# manually to alter parameter, input and logic values + +# a more intelligent version would just do ese_r2cc to create _ese.cc +# this could then be embedded into MTT's normal code like _ode.cc +# maybe another day ... + +CC=g++ + +INCLUDE=-I. -I${MTT_LIB}/cr/hh +OPTIMISE=-O3 +WARNINGS=-Wall -ansi -pedantic + +ifeq ("","$(MTT_ARG)") +TARGET=$(MTT_SYS)_cxxsim.$(MTT_LANG) +else +TARGET=$(MTT_SYS)_cxxsim-$(MTT_ARG).$(MTT_LANG) +endif + +all: $(TARGET) + +# rule copied from gnuplot_rep.make +# need it here to prevent MTT using the default route (via dae) +$(MTT_SYS)_cxxsim.gnuplot: $(MTT_SYS)_gnuplot.wish $(MTT_SYS)_odes.dat2 + sh $(MTT_SYS)_gnuplot.wish |\ + tee gnuplot_in.log |\ + gnuplot -geometry 400x300 \ + > gnuplot_out.log 2> gnuplot_err.log & + +$(MTT_SYS)_cxxsim.view: $(MTT_SYS)_cxxsim-odes.ps $(MTT_SYS)_cxxsim-odeso.ps + ${PSVIEW} $(MTT_SYS)_cxxsim-odes.ps + ${PSVIEW} $(MTT_SYS)_cxxsim-odeso.ps + +$(MTT_SYS)_cxxsim.ps: $(MTT_SYS)_cxxsim-odeso.ps + cp $< $@ + +$(MTT_SYS)_cxxsim-ode%.ps: $(MTT_SYS)_ode%.fig + fig2dev -Leps $(MTT_SYS)_ode$*.fig $@ + +$(MTT_SYS)_ode%.fig: $(MTT_SYS)_ode%.gdat + gdat2fig $(MTT_SYS)_ode$* + +$(MTT_SYS)_ode%.gdat: $(MTT_SYS)_ode%.dat + dat2gdat $(MTT_SYS) ode$* + +$(MTT_SYS)_ode%.dat: $(MTT_SYS)_def.r $(MTT_SYS)_odes.dat2 + dat22dat $(MTT_SYS) ode $* + +$(MTT_SYS)_odes.dat2: $(MTT_SYS)_cxxsim.exe + ./$< > $@ + +$(MTT_SYS)_cxxsim.exe: $(MTT_SYS)_cxxsim.cc + echo Creating $(MTT_SYS)_cxxsim.exe + $(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE) + +$(MTT_SYS)_cxxsim.cc: $(MTT_SYS)_cr.txt $(MTT_SYS)_ese.r $(MTT_SYS)_struc.txt $(MTT_SYS)_sympar.txt cxxsim + ./cxxsim $(MTT_SYS) + cp $@ .. + +cxxsim: ${MTT_LIB}/rep/cxxsim.cc + echo creating $@ + echo Compiling $^ + $(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE) + +# list of constitutive relationships +$(MTT_SYS)_cr.txt: + mtt -q $(MTT_OPTS) $(MTT_SYS) cr txt + +# array sizes +$(MTT_SYS)_def.r: + mtt -q $(MTT_OPTS) $(MTT_SYS) def r + +# elementary system equations +$(MTT_SYS)_ese.r: + mtt -q $(MTT_OPTS) $(MTT_SYS) ese r + +# system structure +$(MTT_SYS)_struc.txt: + mtt -q $(MTT_OPTS) $(MTT_SYS) struc txt + +# list of symbolic parameters +$(MTT_SYS)_sympar.txt: + mtt -q $(MTT_OPTS) $(MTT_SYS) sympar txt + +# gnuplot script +$(MTT_SYS)_gnuplot.wish: + mtt -q $(MTT_OPTS) $(MTT_SYS) gnuplot wish ADDED mtt/lib/rep/gnuplot_rep.make Index: mtt/lib/rep/gnuplot_rep.make ================================================================== --- mtt/lib/rep/gnuplot_rep.make +++ mtt/lib/rep/gnuplot_rep.make @@ -0,0 +1,21 @@ +# -*-makefile-*- +# create a gnuplot input file + +MTTFLAGS = $(MTT_OPTS) + +all: $(MTT_SYS)_gnuplot.$(MTT_LANG) + +$(MTT_SYS)_gnuplot.view: $(MTT_SYS)_gnuplot.wish + mtt $(MTT_OPTS) $(MTT_SYS) odes dat2 + sh $(MTT_SYS)_gnuplot.wish |\ + tee gnuplot_in.log |\ + gnuplot -name $(MTT_SYS) -geometry 400x300 \ + > gnuplot_out.log 2> gnuplot_err.log & + +$(MTT_SYS)_gnuplot.wish: $(MTT_SYS)_struc.txt + $(MTTPATH)/trans/struc2gnuplot_txt2wish $(MTT_SYS) + +$(MTT_SYS)_struc.txt: + mtt $(MTTFLAGS) $(MTT_SYS) struc txt + + ADDED mtt/lib/rep/ident_rep.make Index: mtt/lib/rep/ident_rep.make ================================================================== --- mtt/lib/rep/ident_rep.make +++ mtt/lib/rep/ident_rep.make @@ -0,0 +1,145 @@ +# -*-makefile-*- + +#SUMMARY Identification +#DESCRIPTION Partially know system identification using +#DESCRIPTION using bond graphs + +# Makefile for representation ident +# File ident_rep.make + +#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop + +## Model targets +model_reps = ${MTT_SYS}_sympar.m ${MTT_SYS}_simpar.m ${MTT_SYS}_state.m +model_reps += ${MTT_SYS}_numpar.m ${MTT_SYS}_input.m ${MTT_SYS}_ode2odes.m +model_reps += ${MTT_SYS}_def.m + +## Prepend s to get the sensitivity targets +sensitivity_reps = ${model_reps:%=s%} + +## Model prerequisites +model_pre = ${MTT_SYS}_abg.fig ${MTT_SYS}_lbl.txt +model_pre += ${MTT_SYS}_rdae.r ${MTT_SYS}_numpar.txt + +## Prepend s to get the sensitivity targets +sensitivity_pre = ${model_pre:%=s%} + + +## Simulation targets +sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m + +## m-files needed for ident +ident_m = ${MTT_SYS}_ident.m ${MTT_SYS}_ident_numpar.m + +## The input data +ident_data = ${MTT_SYS}_ident_data.dat + +## Targets for the ident simulation +ident_reps = ${ident_m} ${sims} ${model_reps} ${sensitivity_reps} + +## ps output files etc +psfile = ${MTT_SYS}_ident.ps +psfiles = ${MTT_SYS}_ident.ps ${MTT_SYS}_ident.comparison.ps ${MTT_SYS}_ident_pars.ps +figfiles = ${psfiles:%.ps=%.fig} +gdatfiles = ${psfiles:%.ps=%.gdat} +datfiles = ${psfiles:%.ps=%.dat2} + +## LaTeX files etc +latexfiles = ${MTT_SYS}_ident_par.tex + +all: ${MTT_SYS}_ident.${MTT_LANG} + +echo: + echo "sims: ${sims}" + echo "model_reps: ${model_reps}" + echo "sensitivity_reps: ${sensitivity_reps}" + echo "ident_reps: ${ident_reps}" + +${MTT_SYS}_ident.view: ${psfiles} + ident_rep.sh ${MTT_SYS} view + +${psfiles}: ${figfiles} + ident_rep.sh ${MTT_SYS} ps + touch ${psfiles} + +${figfiles}: ${gdatfiles} + ident_rep.sh ${MTT_SYS} fig + touch ${figfiles} + +${gdatfiles}: ${datfiles} + ident_rep.sh ${MTT_SYS} gdat + touch ${gdatfiles} + +${datfiles} ${latexfiles}: ${ident_reps} ${ident_data} + ident_rep.sh ${MTT_SYS} dat2 + touch ${datfiles} + +${MTT_SYS}_ident.m: + ident_rep.sh ${MTT_SYS} m + +${MTT_SYS}_ident_numpar.m: + ident_rep.sh ${MTT_SYS} numpar.m + +## System model reps +## Generic txt files +${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt + +## Specific m files +${MTT_SYS}_ode2odes.m: ${model_pre} + mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m + +${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m + +## Numpar files +${MTT_SYS}_numpar.m: + mtt ${MTT_SYS} numpar m + +## Sympar files +${MTT_SYS}_sympar.m: + mtt ${MTT_SYS} sympar m + +## Generic txt to m +${MTT_SYS}_%.m: ${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m + +## r files +${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r + +${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r + +## Sensitivity model reps +## Generic txt files +s${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} $* txt + +## Specific m files +## Numpar files +s${MTT_SYS}_numpar.m: + mtt -s s${MTT_SYS} numpar m + +## Sympar files +s${MTT_SYS}_sympar.m: + mtt -s s${MTT_SYS} sympar m + +s${MTT_SYS}_ode2odes.m: ${sensitivity_pre} + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ode2odes m + +s${MTT_SYS}_ssim.m: + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ssim m + +s${MTT_SYS}_def.m: + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} def m + + +## Generic txt to m +s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m + +## r files +s${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r + ADDED mtt/lib/rep/ident_rep.sh Index: mtt/lib/rep/ident_rep.sh ================================================================== --- mtt/lib/rep/ident_rep.sh +++ mtt/lib/rep/ident_rep.sh @@ -0,0 +1,293 @@ +#! /bin/sh + +## ident_rep.sh +## DIY representation "ident" for mtt +# Copyright (C) 2002 by Peter J. Gawthrop + +ps=ps + +sys=$1 +rep=ident +lang=$2 +mtt_parameters=$3 +rep_parameters=$4 + +## Some names +target=${sys}_${rep}.${lang} +def_file=${sys}_def.r +dat2_file=${sys}_ident.dat2 +dat2s_file=${sys}_idents.dat2 +ident_numpar_file=${sys}_ident_numpar.m +option_file=${sys}_ident_mtt_options.txt + +## Get system information +if [ -f "${def_file}" ]; then + echo Using ${def_file} +else + mtt -q ${sys} def r +fi + +ny=`mtt_getsize $1 y` +nu=`mtt_getsize $1 u` + +check_new_options() { + if [ -f "${option_file}" ]; then + old_options=`cat ${option_file}` + if [ "${mtt_options}" != "${old_options}" ]; then + echo ${mtt_options} > ${option_file} + fi + else + echo ${mtt_options} > ${option_file} + fi +} + +## Make the _ident.m file +make_ident() { +filename=${sys}_${rep}.m +date=`date` +echo Creating ${filename} + +cat > ${filename} < ${sys}_ident_numpar.m <0) + par = ${sys}_numpar(); + x_0 = ${sys}_state(par); + dt = t(2)-t(1); + simpars.dt = dt; + simpars.last = t(length(t)); + y = ${sys}_sim(zeros(n_x,1), par, simpars, u); + endif + + ## Default parameter names - Put in your own here + sympar = ${sys}_sympar; # Symbolic params as structure + par_names = struct_elements (sympar); # Symbolic params as strings + [n,m] = size(par_names); # Size the string list + + ## Sort by index + for [i,name] = sympar + par_names(i,:) = sprintf("%s%s",name, blanks(m-length(name))); + endfor + + ## Output weighting vector + Q = ones(n_y,1); + + ## Extra parameters + extras.criterion = 1e-5; + extras.emulate_timing = 0; + extras.max_iterations = 10; + extras.simulate = simulate; + extras.v = 1e-2; + extras.verbose = 1; + extras.visual = 1; + extras.domain = "time"; + +endfunction +EOF +} + +make_dat2() { + +## Inform user +echo Creating ${dat2_file} + +## Use octave to generate the data +octave -q < mtt_junk +sed -e "s/_\([a-z0-9,]*\)/_{\1}/g" < mtt_junk >${sys}_ident_par.tex +rm mtt_junk +} + +case ${lang} in + numpar.m) + ## Make the numpar stuff + make_ident_numpar; + ;; + m) + ## Make the code + make_ident; + ;; + dat2) + ## The dat2 language (output data) & fig file + make_dat2; + ;; + gdat) + cp ${dat2_file} ${dat2s_file} + dat22dat ${sys} ${rep} + dat2gdat ${sys} ${rep} + ;; + fig) + gdat2fig ${sys}_${rep} + ;; + ps) + figs=`ls ${sys}_ident*.fig | sed -e 's/\.fig//'` + for fig in ${figs}; do + fig2dev -Leps ${fig}.fig > ${fig}.ps + done + texs=`ls ${sys}_ident*.tex | sed -e 's/\.tex//'` + for tex in ${texs}; do + makedoc "" "${sys}" "ident_par" "tex" "" "" "$ps" + doc2$ps ${sys}_ident_par "$documenttype" + done + ;; + view) + pss=`ls ${sys}_ident*.ps` + echo Viewing ${pss} + for ps in ${pss}; do + ${PSVIEW} ${ps}& + done + ;; + *) + echo Language ${lang} not supported by ${rep} representation + exit 3 +esac + + ADDED mtt/lib/rep/ippp_rep.make Index: mtt/lib/rep/ippp_rep.make ================================================================== --- mtt/lib/rep/ippp_rep.make +++ mtt/lib/rep/ippp_rep.make @@ -0,0 +1,78 @@ +# -*-makefile-*- +# Makefile for representation ippp - ppp system identification +# File ippp_rep.make + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.5 2002/12/12 17:18:42 geraint + ## Fixed [ 647664 ] Namespace clash: LANG + ## Prepended MTT_ to SYS, OPTS and LANG environment variables. + ## + ## Revision 1.4 2001/04/23 15:06:21 gawthrop + ## Removed stdin bug workaround + ## + ## Revision 1.3 2001/04/11 07:52:45 gawthrop + ## Temporary fix to avoid incorrect _input.cc with stdin + ## + ## Revision 1.2 2001/04/05 11:49:07 gawthrop + ## Fixed a number of bugs to as to work with reports. + ## + ## Revision 1.1 2001/04/04 10:05:38 gawthrop + ## Reresentation for system identification for ppp + ## + ############################################################### + +#Copyright (C) 2000 by Peter J. Gawthrop + +all: $(MTT_SYS)_ippp.$(MTT_LANG) + +$(MTT_SYS)_ippp.view: $(MTT_SYS)_ippp.pdf + acroread *.pdf + +$(MTT_SYS)_ippp.ps: $(MTT_SYS)_parameters.ps $(MTT_SYS)_error.ps $(MTT_SYS)_outputs.ps $(MTT_SYS)_ippp.pdf + cp $(MTT_SYS)_parameters.ps $(MTT_SYS)_ippp.ps + +$(MTT_SYS)_ippp.pdf: $(MTT_SYS)_parameters.pdf $(MTT_SYS)_error.pdf $(MTT_SYS)_outputs.pdf + cp $(MTT_SYS)_parameters.pdf $(MTT_SYS)_ippp.pdf + +$(MTT_SYS)_parameters.ps: s$(MTT_SYS)_ode2odes.m s$(MTT_SYS)_ssim.m $(MTT_SYS)_ippp.m s$(MTT_SYS)_sympar.m s$(MTT_SYS)_simpar.m + octave $(MTT_SYS)_ippp.m + +$(MTT_SYS)_error.ps: $(MTT_SYS)_parameters.ps + touch $(MTT_SYS)_error.ps + +$(MTT_SYS)_outputs.ps: $(MTT_SYS)_parameters.ps + touch $(MTT_SYS)_outputs.ps + +$(MTT_SYS)_parameters.pdf: s$(MTT_SYS)_ode2odes.m s$(MTT_SYS)_ssim.m $(MTT_SYS)_ippp.m s$(MTT_SYS)_sympar.m s$(MTT_SYS)_simpar.m + octave $(MTT_SYS)_ippp.m + +$(MTT_SYS)_error.pdf: $(MTT_SYS)_parameters.pdf + touch $(MTT_SYS)_error.pdf + +$(MTT_SYS)_outputs.pdf: $(MTT_SYS)_parameters.pdf + touch $(MTT_SYS)_outputs.pdf + +s$(MTT_SYS)_ode2odes.m: + echo Starting creation of s$(MTT_SYS)_ode2odes.m with options $(MTT_OPTS) + mtt -q $(MTT_OPTS) -stdin -s s$(MTT_SYS) ode2odes m + +s$(MTT_SYS)_ssim.m: s$(MTT_SYS)_def.m + mtt -q $(MTT_OPTS) -s s$(MTT_SYS) ssim m + +s$(MTT_SYS)_sympar.m: + mtt -q $(MTT_OPTS) -s s$(MTT_SYS) sympar m + +s$(MTT_SYS)_simpar.m: + mtt -q $(MTT_OPTS) -s s$(MTT_SYS) simpar m + +s$(MTT_SYS)_def.m: + mtt -q $(MTT_OPTS) -s s$(MTT_SYS) def m + ADDED mtt/lib/rep/mtt_rep_diy Index: mtt/lib/rep/mtt_rep_diy ================================================================== --- mtt/lib/rep/mtt_rep_diy +++ mtt/lib/rep/mtt_rep_diy @@ -0,0 +1,138 @@ +#! /bin/sh + +rep_name="diy" + +help_message=" + A representation you can create all by yourself! + + The purpose of this representation is to help in the creation of a new DIY rep structure. + Eventually it should form a template for creating new representations. +" + +non_standard_options=" + --crash: make the computer crash, wiping the hard drive in the process + --recover: attempt to recover data after crash (by crying very loudly for 10 minutes) +" + +texi_message=" +This message should be really, really helpful. +@node Stuff, More Stuff, Top, Top +Stuff! +@node More Stuff, Top, Top, Top +More Stuff +" + +# function definitions for non-standard options (should have same name) +crash () { + touch .crash + echo "IDIOT!" + exit 99 +} +recover () { + if [ -f .crash ]; then + cat < /dev/null || warn "option --${option} unknown" + shift + done + export Language="$*" + fi +} + +process_arguments $* +if [ ! "${Language}" ]; then + error "no language specified" ${NoLanguageSpecified} +fi + +process_language ${Language} + ADDED mtt/lib/rep/nppp_rep.make Index: mtt/lib/rep/nppp_rep.make ================================================================== --- mtt/lib/rep/nppp_rep.make +++ mtt/lib/rep/nppp_rep.make @@ -0,0 +1,106 @@ +# -*-makefile-*- + +#SUMMARY Nonlinear pole-placement predictive control (nPPP) +#DESCRIPTION + +# Makefile for representation nppp +# File nppp_rep.make + +#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop + +## Model targets +model_reps = ${MTT_SYS}_sympar.m ${MTT_SYS}_simpar.m ${MTT_SYS}_state.m +model_reps += ${MTT_SYS}_numpar.m ${MTT_SYS}_input.m ${MTT_SYS}_ode2odes.m +model_reps += ${MTT_SYS}_def.m + +## Prepend s to get the sensitivity targets +sensitivity_reps = ${model_reps:%=s%} + +## Simulation targets +sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m + +## m-files needed for nppp +nppp_m = ${MTT_SYS}_nppp.m ${MTT_SYS}_nppp_numpar.m + +## Targets for the nppp simulation +nppp_reps = ${nppp_m} ${sims} ${model_reps} ${sensitivity_reps} + +## ps output files +psfiles = ${MTT_SYS}_nppp.ps ${MTT_SYS}_nppp.basis.ps ${MTT_SYS}_nppp.par.ps ${MTT_SYS}_nppp.U.ps +figfiles = ${psfiles:%.ps=%.fig} + +all: ${MTT_SYS}_nppp.${MTT_LANG} + +echo: + echo "sims: ${sims}" + echo "model_reps: ${model_reps}" + echo "sensitivity_reps: ${sensitivity_reps}" + echo "nppp_reps: ${nppp_reps}" + +${MTT_SYS}_nppp.view: ${MTT_SYS}_nppp.ps + nppp_rep.sh ${MTT_SYS} view + +${psfiles}: ${MTT_SYS}_nppp.fig + nppp_rep.sh ${MTT_SYS} ps + +${MTT_SYS}_nppp.gdat: ${MTT_SYS}_nppp.dat2 + nppp_rep.sh ${MTT_SYS} gdat + +${MTT_SYS}_nppp.fig ${MTT_SYS}_nppp.dat2: ${nppp_reps} + nppp_rep.sh ${MTT_SYS} dat2 + +${MTT_SYS}_nppp.m: + nppp_rep.sh ${MTT_SYS} m + +${MTT_SYS}_nppp_numpar.m: + nppp_rep.sh ${MTT_SYS} numpar.m + +## System model reps +## Generic txt files +${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt + +## Specific m files +${MTT_SYS}_ode2odes.m: ${MTT_SYS}_rdae.r + mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m + +${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m + +## Generic txt to m +${MTT_SYS}_%.m: ${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m + +## r files +${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r + +${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r + +## Sensitivity model reps +## Generic txt files +s${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* txt + +## Specific m files +s${MTT_SYS}_ode2odes.m: s${MTT_SYS}_rdae.r + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ode2odes m + +s${MTT_SYS}_ssim.m: + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ssim m + +s${MTT_SYS}_def.m: + mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} def m + + +## Generic txt to m +s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m + + +## r files +s${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r + + ADDED mtt/lib/rep/nppp_rep.sh Index: mtt/lib/rep/nppp_rep.sh ================================================================== --- mtt/lib/rep/nppp_rep.sh +++ mtt/lib/rep/nppp_rep.sh @@ -0,0 +1,331 @@ +#! /bin/sh + +## nppp_rep.sh +## DIY representation "nppp" for mtt +# Copyright (C) 2002 by Peter J. Gawthrop + +sys=$1 +rep=nppp +lang=$2 +mtt_parameters=$3 +rep_parameters=$4 + +## Some names +target=${sys}_${rep}.${lang} +def_file=${sys}_def.r +dat2_file=${sys}_nppp.dat2 +dat2s_file=${sys}_nppps.dat2 +nppp_numpar_file=${sys}_nppp_numpar.m +option_file=${sys}_nppp_mtt_options.txt + +## Get system information +if [ -f "${def_file}" ]; then + echo Using ${def_file} +else + mtt -q ${sys} def r +fi + +ny=`mtt_getsize $1 y` +nu=`mtt_getsize $1 u` + +check_new_options() { + if [ -f "${option_file}" ]; then + old_options=`cat ${option_file}` + if [ "${mtt_options}" != "${old_options}" ]; then + echo ${mtt_options} > ${option_file} + fi + else + echo ${mtt_options} > ${option_file} + fi +} + +## Make the _nppp.m file +make_nppp() { +filename=${sys}_${rep}.m +echo Creating ${filename} + +cat > ${filename} <0 + P = P(1:n-1,:); # Loose last point + PP = []; + for j=1:m + pp = [P(:,j) P(:,j)]'; + PP = [PP pp(:)]; + endfor + + oneplot; + gset output "${sys}_nppp.par.fig" + title(""); + xlabel("Time (s)"); + ylabel("Parameters"); + plot(TT,PP); + endif + + [n,m] = size(U); + if m>0 oneplot; + gset output "${sys}_nppp.U.fig" + title(""); + xlabel("Time (s)"); + ylabel("U"); + [n,m] = size(U); + U = U(1:n-1,:); # Loose last point + UU = []; + for j=1:m + uu = [U(:,j) U(:,j)]'; + UU = [UU uu(:)]; + endfor + plot(TT,UU); + endif + +endfunction + +EOF +} + +make_nppp_numpar() { +echo Creating ${nppp_numpar_file} +cat > ${sys}_nppp_numpar.m < ${fig}.ps + done + ;; + view) + pss=`ls ${sys}_nppp*.ps` + echo Viewing ${pss} + for ps in ${pss}; do + gv ${ps}& + done + ;; + *) + echo Language ${lang} not supported by ${rep} representation + exit 3 +esac + + ADDED mtt/lib/rep/odeso_rep.make Index: mtt/lib/rep/odeso_rep.make ================================================================== --- mtt/lib/rep/odeso_rep.make +++ mtt/lib/rep/odeso_rep.make @@ -0,0 +1,13 @@ +# -*-makefile-*- + +all: ${MTT_SYS}_odeso.${MTT_LANG} + +${MTT_SYS}_odeso.gnuplot: + @mtt -q ${MTT_OPTS} ${MTT_SYS} gnuplot view + +ifneq ("${MTT_LANG}","gnuplot") +${MTT_SYS}_odeso.${MTT_LANG}: + @touch odeso_rep.make.ignore + @mtt -q ${MTT_OPTS} ${MTT_SYS} odeso ${MTT_LANG} + @rm odeso_rep.make.ignore +endif ADDED mtt/lib/rep/sfun_rep.make Index: mtt/lib/rep/sfun_rep.make ================================================================== --- mtt/lib/rep/sfun_rep.make +++ mtt/lib/rep/sfun_rep.make @@ -0,0 +1,4 @@ +# -*-makefile-*- + +all: + ${MTT_REP}/sfun_rep.sh "$(MTT_OPTS)" "$(MTT_SYS)" "$(MTT_LANG)" ADDED mtt/lib/rep/sfun_rep.sh Index: mtt/lib/rep/sfun_rep.sh ================================================================== --- mtt/lib/rep/sfun_rep.sh +++ mtt/lib/rep/sfun_rep.sh @@ -0,0 +1,1383 @@ +#! /bin/sh + +set -e + +# +# function definitions +# + + +set_debug () +{ + debug=$1 + if ( $debug ); then + set -x + make_debug='--debug=a' + else + set +x + make_debug='' + fi +} + +exit_error () +{ + message="$1" + case $message in + "Invalid Input" ) errno = 2 ;; + "Unknown Template" ) errno = 3 ;; + * ) errno = -1 ;; + esac + echo "#Error: " $message + exit errno; +} + +check_for_valid_input () +{ + return 0; +} + +# +# file templates +# + +# template_README compilation instructions +# template_mdk simulink sub-system model + +# template_mex_ae_c +# template_sfun_c +# template_sfun_debug_h +# template_sfun_input_c +# template_sfun_interface_c + +write_template () +{ + filename="$1" + + case $filename in + + README) + + cat < model without using MTT: + +mex _sfun.c + +The input block can be created with: + +mex _sfun_input.c + +If numerical solution of algebraic equations is also required: + +mex _sfun_ae.c + +The interface block can be created with + +mex _sfun_interface.c + +EOF + ;; + + mdl) + + cat <" + Version 4.00 + SampleTimeColors off + LibraryLinkDisplay "all" + WideLines off + ShowLineDimensions on + ShowPortDataTypes off + ShowStorageClass off + ExecutionOrder off + RecordCoverage off + CovPath "/" + CovSaveName "covdata" + CovMetricSettings "dw" + CovNameIncrementing off + CovHtmlReporting on + BlockNameDataTip off + BlockParametersDataTip off + BlockDescriptionStringDataTip off + ToolBar on + StatusBar on + BrowserShowLibraryLinks off + BrowserLookUnderMasks off + Created "Mon May 20 13:21:21 2002" + Creator "geraint" + UpdateHistory "UpdateHistoryNever" + ModifiedByFormat "%" + LastModifiedBy "geraint" + ModifiedDateFormat "%" + LastModifiedDate "Thu May 23 16:35:42 2002" + ModelVersionFormat "1.%" + ConfigurationManager "None" + SimParamPage "Solver" + StartTime "0.0" + StopTime "10.0" + SolverMode "Auto" + Solver "ode45" + RelTol "1e-3" + AbsTol "auto" + Refine "1" + MaxStep "auto" + MinStep "auto" + MaxNumMinSteps "-1" + InitialStep "auto" + FixedStep "auto" + MaxOrder 5 + OutputOption "RefineOutputTimes" + OutputTimes "[]" + LoadExternalInput off + ExternalInput "[t, u]" + SaveTime on + TimeSaveName "tout" + SaveState off + StateSaveName "xout" + SaveOutput on + OutputSaveName "yout" + LoadInitialState off + InitialState "xInitial" + SaveFinalState off + FinalStateName "xFinal" + SaveFormat "Array" + LimitDataPoints on + MaxDataPoints "1000" + Decimation "1" + AlgebraicLoopMsg "warning" + MinStepSizeMsg "warning" + UnconnectedInputMsg "warning" + UnconnectedOutputMsg "warning" + UnconnectedLineMsg "warning" + InheritedTsInSrcMsg "warning" + SingleTaskRateTransMsg "none" + MultiTaskRateTransMsg "error" + IntegerOverflowMsg "warning" + CheckForMatrixSingularity "none" + UnnecessaryDatatypeConvMsg "none" + Int32ToFloatConvMsg "warning" + InvalidFcnCallConnMsg "error" + SignalLabelMismatchMsg "none" + LinearizationMsg "none" + VectorMatrixConversionMsg "none" + SfunCompatibilityCheckMsg "none" + BlockPriorityViolationMsg "warning" + ArrayBoundsChecking "none" + ConsistencyChecking "none" + ZeroCross on + Profile off + SimulationMode "normal" + RTWSystemTargetFile "grt.tlc" + RTWInlineParameters off + RTWRetainRTWFile off + RTWTemplateMakefile "grt_default_tmf" + RTWMakeCommand "make_rtw" + RTWGenerateCodeOnly off + TLCProfiler off + TLCDebug off + TLCCoverage off + AccelSystemTargetFile "accel.tlc" + AccelTemplateMakefile "accel_default_tmf" + AccelMakeCommand "make_rtw" + TryForcingSFcnDF off + ExtModeMexFile "ext_comm" + ExtModeBatchMode off + ExtModeTrigType "manual" + ExtModeTrigMode "normal" + ExtModeTrigPort "1" + ExtModeTrigElement "any" + ExtModeTrigDuration 1000 + ExtModeTrigHoldOff 0 + ExtModeTrigDelay 0 + ExtModeTrigDirection "rising" + ExtModeTrigLevel 0 + ExtModeArchiveMode "off" + ExtModeAutoIncOneShot off + ExtModeIncDirWhenArm off + ExtModeAddSuffixToVar off + ExtModeWriteAllDataToWs off + ExtModeArmWhenConnect on + ExtModeSkipDownloadWhenConnect off + ExtModeLogAll on + ExtModeAutoUpdateStatusClock off + OptimizeBlockIOStorage on + BufferReuse on + ParameterPooling on + BlockReductionOpt on + RTWExpressionDepthLimit 5 + BooleanDataType off + BlockDefaults { + Orientation "right" + ForegroundColor "black" + BackgroundColor "white" + DropShadow off + NamePlacement "normal" + FontName "Helvetica" + FontSize 10 + FontWeight "normal" + FontAngle "normal" + ShowName on + } + AnnotationDefaults { + HorizontalAlignment "center" + VerticalAlignment "middle" + ForegroundColor "black" + BackgroundColor "white" + DropShadow off + FontName "Helvetica" + FontSize 10 + FontWeight "normal" + FontAngle "normal" + } + LineDefaults { + FontName "Helvetica" + FontSize 9 + FontWeight "normal" + FontAngle "normal" + } + System { + Name "" + Location [51, 441, 346, 574] + Open on + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + ZoomFactor "100" + ReportName "simulink-default.rpt" + Block { + BlockType Inport + Name "In1" + Position [25, 43, 55, 57] + Port "1" + LatchInput off + DataType "double" + SignalType "real" + Interpolate on + } + Block { + BlockType SubSystem + Name "MTT Model\n" + Ports [1, 1] + Position [100, 20, 140, 80] + ForegroundColor "blue" + BackgroundColor "lightBlue" + ShowPortLabels on + TreatAsAtomicUnit off + RTWSystemCode "Auto" + RTWFcnNameOpts "Auto" + RTWFileNameOpts "Auto" + System { + Name "MTT Model\n" + Location [45, 448, 1008, 720] + Open off + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + ZoomFactor "100" + Block { + BlockType Inport + Name "In1" + Position [590, 203, 620, 217] + Port "1" + LatchInput off + DataType "double" + SignalType "real" + Interpolate on + } + Block { + BlockType "S-Function" + Name "MTT Model Inputs" + Ports [1, 1] + Position [390, 59, 565, 91] + BackgroundColor "lightBlue" + DropShadow on + FunctionName "_sfun_input" + PortCounts "[]" + SFunctionModules "''" + Port { + PortNumber 1 + Name "MTT Model Inputs: MTTU" + TestPoint off + LinearAnalysisOutput off + LinearAnalysisInput off + RTWStorageClass "Auto" + } + } + Block { + BlockType "S-Function" + Name "MTT Plant Model" + Ports [1, 2] + Position [65, 61, 250, 199] + BackgroundColor "lightBlue" + DropShadow on + FunctionName "_sfun" + PortCounts "[]" + SFunctionModules "''" + Port { + PortNumber 1 + Name "MTT Model States: MTTX" + TestPoint off + LinearAnalysisOutput off + LinearAnalysisInput off + RTWStorageClass "Auto" + } + Port { + PortNumber 2 + Name "MTT Model Outputs: MTTY" + TestPoint off + LinearAnalysisOutput off + LinearAnalysisInput off + RTWStorageClass "Auto" + } + } + Block { + BlockType "S-Function" + Name "S-Function" + Ports [4, 2] + Position [710, 47, 840, 238] + BackgroundColor "lightBlue" + DropShadow on + FunctionName "_sfun_interface" + PortCounts "[]" + SFunctionModules "''" + } + Block { + BlockType Outport + Name "Out1" + Position [905, 183, 935, 197] + Port "1" + OutputWhenDisabled "held" + InitialOutput "[]" + } + Line { + Name "MTT Model States: MTTX" + Labels [2, 0] + SrcBlock "MTT Plant Model" + SrcPort 1 + Points [0, 0; 105, 0] + Branch { + Points [0, -20] + DstBlock "MTT Model Inputs" + DstPort 1 + } + Branch { + Points [0, 25] + DstBlock "S-Function" + DstPort 2 + } + } + Line { + Name "MTT Model Outputs: MTTY" + Labels [1, 0] + SrcBlock "MTT Plant Model" + SrcPort 2 + DstBlock "S-Function" + DstPort 3 + } + Line { + Name "MTT Model Inputs: MTTU" + Labels [1, 0] + SrcBlock "MTT Model Inputs" + SrcPort 1 + DstBlock "S-Function" + DstPort 1 + } + Line { + SrcBlock "S-Function" + SrcPort 1 + Points [30, 0; 0, -70; -850, 0; 0, 105] + DstBlock "MTT Plant Model" + DstPort 1 + } + Line { + SrcBlock "In1" + SrcPort 1 + DstBlock "S-Function" + DstPort 4 + } + Line { + SrcBlock "S-Function" + SrcPort 2 + DstBlock "Out1" + DstPort 1 + } + } + } + Block { + BlockType Outport + Name "Out1" + Position [185, 43, 215, 57] + Port "1" + OutputWhenDisabled "held" + InitialOutput "[]" + } + Line { + SrcBlock "MTT Model\n" + SrcPort 1 + DstBlock "Out1" + DstPort 1 + } + Line { + SrcBlock "In1" + SrcPort 1 + DstBlock "MTT Model\n" + DstPort 1 + } + } +} + +EOF + ;; + + mex_ae.c) + + cat <_sfun_ae.c: + * Matlab mex algebraic equations for + */ + +#include +#include +#include +#include +#include "sfun_debug.h" +#include "_def.h" +#include "_sympar.h" + +/* utility procedures */ + +double * +array_of_double (size_t n) +{ + void *p = calloc (n, sizeof (double)); + if (! p) { + fprintf (stderr, "*** Error: failed to allocate memory\n"); + } + return (double *) p; +} + +/* system equations */ + +static double * +_ae (double *mttyz, + const double *mttx, + const double *mttu, + const double mttt, + const double *mttpar) +{ +#include "_ae.c" + PRINT_LEAVE; +} + +/* generic mex function */ + +#ifdef __cplusplus +extern "C" { +#endif + +void +mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) +{ + double *mttyz; /* residuals */ + + double *mttx; /* states */ + double *mttu; /* known + unknown inputs */ + double mttt; /* time */ + double *mttpar; /* parameters */ + + unsigned int i; + double *p; + + PRINT_ENTER; + + mttyz = array_of_double (MTTNYZ); + + mttx = array_of_double (MTTNX); + mttu = array_of_double (MTTNU + MTTNYZ); + mttpar = array_of_double (MTTNPAR); + + /* get trial values */ + p = mxGetPr (prhs[0]); + for (i = 0; i < MTTNYZ; i++) { + mttu[MTTNU + i] = p[i]; + } + + /* get states */ + p = mxGetPr (prhs[1]); + for (i = 0; i < MTTNX; i++) { + mttx[i] = p[i]; + } + + /* get known inputs */ + p = mxGetPr (prhs[2]); + for (i = 0; i < MTTNU; i++) { + mttu[i] = p[i]; + } + + /* get time */ + p = mxGetPr (prhs[3]); + mttt = *p; + + /* get parameters */ + p = mxGetPr (prhs[4]); + for (i = 0; i < MTTNPAR; i++) { + mttpar[i] = p[i]; + } + + /* evaluate residuals */ + _ae (mttyz, mttx, mttu, mttt, mttpar); + + /* return residuals */ + plhs[0] = mxCreateDoubleMatrix (MTTNYZ, 1, mxREAL); + p = mxGetPr (plhs[0]); + for (i = 0; i < MTTNYZ; i++) { + p[i] = mttyz[i]; + } + + /* release memory */ + free (mttx); + free (mttu); + free (mttpar); + free (mttyz); + + PRINT_LEAVE; +} + +#ifdef __cplusplus +} +#endif + +EOF + ;; + + sfun_c) + + cat <_sfun.c: + * Matlab S-function simulation of + */ + +#define S_FUNCTION_NAME _sfun +#define S_FUNCTION_LEVEL 2 + +#include +#include +#include +#include "simstruc.h" +#include "sfun_debug.h" +#include "_def.h" +#include "_sympar.h" + +static double *mttdx; /* pointer to rates */ +static double *mttu; /* pointer to inputs */ +static double *mttpar; /* pointer to parameters */ +static double *mttx; /* pointer to states */ +static double *mtty; /* pointer to outputs */ +static double *mttyz; /* pointer to residuals */ +static double mttt; /* time */ + +static unsigned int i; /* loop counter */ + +/* system equations */ + +static void +_ae (void) +{ +#include "_ae.c" + PRINT_LEAVE; +} + +static void +_numpar (void) +{ +#include "_numpar.c" + PRINT_LEAVE; +} + +static void +_ode (void) +{ +#include "_ode.c" + PRINT_LEAVE; +} + +static void +_odeo (void) +{ +#include "_odeo.c" + PRINT_LEAVE; +} + +static void +_state (void) +{ +#include "_state.c" + PRINT_LEAVE; +} + +/* utility procedures */ + +static double * +array_of_double (size_t n) +{ + void *p = calloc (n, sizeof (double)); + if (! p) { + fprintf (stderr, "*** Error: failed to allocate memory\n"); + } + return (double *) p; +} + +static void +initialise_arrays (void) +{ + PRINT_ENTER; + + mttdx = array_of_double (MTTNX); + mttpar = array_of_double (MTTNPAR); + mttu = array_of_double (MTTNU + MTTNYZ); + mttx = array_of_double (MTTNX); + mtty = array_of_double (MTTNY); + mttyz = array_of_double (MTTNYZ); + + PRINT_LEAVE; +} + +static void +update_states_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + for (i = 0; i < MTTNX; i++) { + mttx[i] = ssGetContStates (S)[i]; + } + PRINT_LEAVE; +} + +static void +update_inputs_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + for (i = 0; i < MTTNU; i++) { + mttu[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; + } + PRINT_LEAVE; +} + +static void +update_inputs_from_solver (void) +{ + mxArray *MTT_MATLAB_P; + mxArray *MTT_MATLAB_T; + mxArray *MTT_MATLAB_U; + mxArray *MTT_MATLAB_Ui; + mxArray *MTT_MATLAB_X; + + double *p; + + PRINT_ENTER; + + /* starting value for solver - start with zero */ + MTT_MATLAB_Ui = mxCreateDoubleMatrix (MTTNYZ, 1, mxREAL); + mxSetName (MTT_MATLAB_Ui, "MTT_Ui"); + p = mxGetPr (MTT_MATLAB_Ui); + for (i = 0; i < MTTNYZ; i++) { + p[i] = 0.0; + } + mexPutArray (MTT_MATLAB_Ui, "base"); + + /* put states into matlab workspace */ + MTT_MATLAB_X = mxCreateDoubleMatrix (MTTNX, 1, mxREAL); + mxSetName (MTT_MATLAB_X, "MTT_X"); + p = mxGetPr (MTT_MATLAB_X); + for (i = 0; i < MTTNX; i++) { + p[i] = mttx[i]; + } + mexPutArray (MTT_MATLAB_X, "base"); + + /* put known inputs into matlab workspace */ + MTT_MATLAB_U = mxCreateDoubleMatrix (MTTNU, 1, mxREAL); + mxSetName (MTT_MATLAB_U, "MTT_U"); + p = mxGetPr (MTT_MATLAB_U); + for (i = 0; i < MTTNU; i++) { + p[i] = mttu[i]; + } + mexPutArray (MTT_MATLAB_U, "base"); + + /* put time into matlab workspace */ + MTT_MATLAB_T = mxCreateDoubleMatrix (1, 1, mxREAL); + mxSetName (MTT_MATLAB_T, "MTT_T"); + *mxGetPr (MTT_MATLAB_T) = mttt; + mexPutArray (MTT_MATLAB_T, "base"); + + /* put parameters into matlab workspace */ + MTT_MATLAB_P = mxCreateDoubleMatrix (MTTNPAR, 1, mxREAL); + mxSetName (MTT_MATLAB_P, "MTT_P"); + p = mxGetPr (MTT_MATLAB_P); + for (i = 0; i < MTTNPAR; i++) { + p[i] = mttpar[i]; + } + mexPutArray (MTT_MATLAB_P, "base"); + + /* call fsolve */ + mexEvalString ("MTT_Ui = fsolve (@_sfun_ae, MTT_Ui, optimset('display','off'), MTT_X, MTT_U, MTT_T, MTT_P);"); + + /* retrieve result */ + MTT_MATLAB_Ui = mexGetArray ("MTT_Ui", "base"); + p = mxGetPr (MTT_MATLAB_Ui); + for (i = 0; i < MTTNYZ; i++) { + mttu[MTTNU + i] = p[i]; + } + + /* free memory */ + mxDestroyArray (MTT_MATLAB_P); + mxDestroyArray (MTT_MATLAB_T); + mxDestroyArray (MTT_MATLAB_U); + mxDestroyArray (MTT_MATLAB_Ui); + mxDestroyArray (MTT_MATLAB_X); + + PRINT_LEAVE; +} + +static void +update_simtime_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + mttt = ssGetT (S); + PRINT_LEAVE; +} + +/* S-function methods */ + +static void mdlInitializeSizes(SimStruct *S) +{ + PRINT_ENTER; + + ssSetNumSFcnParams(S, 0); + if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { + PRINT_LEAVE; + return; + } + + ssSetNumContStates(S, MTTNX); + ssSetNumDiscStates(S, 0); + + if (!ssSetNumInputPorts(S, 1)) return; + ssSetInputPortWidth(S, 0, MTTNU); + ssSetInputPortDirectFeedThrough(S, 0, 1); + + if (!ssSetNumOutputPorts(S, 2)) return; + ssSetOutputPortWidth(S, 0, MTTNX); + ssSetOutputPortWidth(S, 1, MTTNY); + + ssSetNumSampleTimes(S, 1); + ssSetNumRWork(S, 0); + ssSetNumIWork(S, 0); + ssSetNumPWork(S, 0); + ssSetNumModes(S, 0); + ssSetNumNonsampledZCs(S, 0); + + ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); + + initialise_arrays (); + + PRINT_LEAVE; +} + +static void mdlInitializeSampleTimes(SimStruct *S) +{ + PRINT_ENTER; + + ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); + ssSetOffsetTime(S, 0, 0.0); + + PRINT_LEAVE; +} + +#define MDL_INITIALIZE_CONDITIONS +static void mdlInitializeConditions(SimStruct *S) +{ + PRINT_ENTER; + + _numpar (); + _state (); + + for (i = 0; i < MTTNX; i++) { + ssGetContStates (S)[i] = mttx[i]; + } + + PRINT_LEAVE; +} + +static void mdlOutputs(SimStruct *S, int_T tid) +{ + PRINT_ENTER; + + update_states_from_simulink (S); + update_inputs_from_simulink (S); + if (MTTNYZ > 0) { + update_inputs_from_solver (); + } + update_simtime_from_simulink (S); + + UNUSED_ARG(tid); /* not used in single tasking mode */ + + _odeo (); + + for (i = 0; i < MTTNX; i++) { + ssGetOutputPortRealSignal (S, 0)[i] = mttx[i]; + } + + for (i = 0; i < MTTNY; i++) { + ssGetOutputPortRealSignal (S, 1)[i] = mtty[i]; + } + + PRINT_LEAVE; +} + +#define MDL_DERIVATIVES +static void mdlDerivatives(SimStruct *S) +{ + PRINT_ENTER; + + update_states_from_simulink (S); + update_inputs_from_simulink (S); + if (MTTNYZ > 0) { + update_inputs_from_solver (); + } + update_simtime_from_simulink (S); + + _ode (); + + for (i = 0; i < MTTNX; i++) { + ssGetdX (S)[i] = mttdx[i]; + } + + PRINT_LEAVE; +} + +static void mdlTerminate(SimStruct *S) +{ + PRINT_ENTER; + UNUSED_ARG(S); + + free (mttdx); + free (mttpar); + free (mttu); + free (mttx); + free (mtty); + free (mttyz); + + PRINT_LEAVE; +} + +#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ +#include "simulink.c" /* MEX-file interface mechanism */ +#else +#include "cg_sfun.h" /* Code generation registration function */ +#endif + +EOF + ;; + + sfun_debug.h) + + cat < +#define PRINT_ENTER fprintf (stderr, "debug> Entered '%s'\n", __FUNCTION__); +#define PRINT_LEAVE fprintf (stderr, "debug> Leaving '%s'\n", __FUNCTION__); + +#elif defined DEBUG && ! defined __GNUC__ + +#include +#define PRINT_ENTER fprintf (stderr, "debug> Entered a function\n"); +#define PRINT_LEAVE fprintf (stderr, "debug> Leaving a function\n"); + +#elif ! defined DEBUG + +#define PRINT_ENTER +#define PRINT_LEAVE + +#else + +#error "Momentary lapse of logic : unreachable statement reached" + +#endif + + +#endif /* HAVE_SFUN_DEBUG_H */ + +EOF + ;; + + sfun_input.c) + + cat <_sfun_input.c: + * Matlab S-function inputs for + */ + +#define S_FUNCTION_NAME _sfun_input +#define S_FUNCTION_LEVEL 2 + +#include +#include +#include +#include "simstruc.h" +#include "sfun_debug.h" +#include "_def.h" +#include "_sympar.h" + +static double *mttu; /* pointer to inputs */ +static double *mttpar; /* pointer to parameters */ +static double *mttx; /* pointer to states */ +static double *mtty; /* pointer to outputs */ +static double mttt; /* time */ + +static unsigned int i; /* loop counter */ + +/* system equations */ + +static void +_input (void) +{ +#include "_input.c" + PRINT_LEAVE; +} + +static void +_numpar (void) +{ +#include "_numpar.c" + PRINT_LEAVE; +} + +/* utility procedures */ + +static double * +array_of_double (size_t n) +{ + void *p = calloc (n, sizeof (double)); + if (! p) { + fprintf (stderr, "*** Error: failed to allocate memory\n"); + } + return (double *) p; +} + +static void +initialise_arrays (void) +{ + PRINT_ENTER; + + mttpar = array_of_double (MTTNPAR); + mttu = array_of_double (MTTNU + MTTNYZ); + mttx = array_of_double (MTTNX); + mtty = array_of_double (MTTNY); + + PRINT_LEAVE; +} + +static void +update_inputs_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + for (i = 0; i < MTTNX; i++) { + mttx[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; + } + PRINT_LEAVE; +} + +static void +update_simtime_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + mttt = ssGetT (S); + PRINT_LEAVE; +} + +/* S-function methods */ + +static void mdlInitializeSizes(SimStruct *S) +{ + PRINT_ENTER; + + ssSetNumSFcnParams(S, 0); + if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { + PRINT_LEAVE; + return; + } + + ssSetNumContStates(S, 0); + ssSetNumDiscStates(S, 0); + + if (!ssSetNumInputPorts(S, 1)) return; + ssSetInputPortWidth(S, 0, MTTNX); + ssSetInputPortDirectFeedThrough(S, 0, 1); + + if (!ssSetNumOutputPorts(S, 1)) return; + ssSetOutputPortWidth(S, 0, MTTNU); + + ssSetNumSampleTimes(S, 1); + ssSetNumRWork(S, 0); + ssSetNumIWork(S, 0); + ssSetNumPWork(S, 0); + ssSetNumModes(S, 0); + ssSetNumNonsampledZCs(S, 0); + + ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); + + initialise_arrays (); + + PRINT_LEAVE; +} + +static void mdlInitializeSampleTimes(SimStruct *S) +{ + PRINT_ENTER; + ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); + ssSetOffsetTime(S, 0, 0.0); + PRINT_LEAVE; +} + +#define MDL_INITIALIZE_CONDITIONS +static void mdlInitializeConditions(SimStruct *S) +{ + PRINT_ENTER; + _numpar (); + PRINT_LEAVE; +} + +static void mdlOutputs(SimStruct *S, int_T tid) +{ + PRINT_ENTER; + + update_inputs_from_simulink (S); + update_simtime_from_simulink (S); + + UNUSED_ARG(tid); /* not used in single tasking mode */ + + _input (); + + for (i = 0; i < MTTNU; i++) { + ssGetOutputPortRealSignal (S, 0)[i] = mttu[i]; + } + + PRINT_LEAVE; +} + +#define MDL_DERIVATIVES +static void mdlDerivatives(SimStruct *S) +{ + PRINT_ENTER; + + update_inputs_from_simulink (S); + update_simtime_from_simulink (S); + + PRINT_LEAVE; +} + +static void mdlTerminate(SimStruct *S) +{ + PRINT_ENTER; + + UNUSED_ARG(S); + + free (mttpar); + free (mttu); + free (mttx); + free (mtty); + + PRINT_LEAVE; +} + +#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ +#include "simulink.c" /* MEX-file interface mechanism */ +#else +#include "cg_sfun.h" /* Code generation registration function */ +#endif + +EOF + ;; + + sfun_interface.c) + + cat <_sfun_interface.c: + * Matlab S-function to process inputs and outputs of + */ + + +#define S_FUNCTION_NAME _sfun_interface +#define S_FUNCTION_LEVEL 2 + +#include +#include +#include +#include "simstruc.h" +#include "sfun_debug.h" +#include "_def.h" +#include "_sympar.h" + +static double *mttu; /* pointer to inputs */ +static double *mttpar; /* pointer to parameters */ +static double *mttx; /* pointer to states */ +static double *mtty; /* pointer to outputs */ +static double mttt; /* time */ + +static double *controller_inputs; +static double *controller_outputs; + +static unsigned int i; /* loop counter */ + +/* Start EDIT */ +/* Edit this block to define the number of controller inputs, outputs and parameters */ +const int NumberOfControllerInputs = 1; /* inputs TO controller */ +const int NumberOfControllerOutputs = 1; /* outputs FROM controller */ +/* End EDIT */ + +static void +_process_inputs (void) +{ + /* insert _struc.c */ + + /* Start EDIT */ + /* Edit this block to process the model inputs and outputs */ + + /* Remove the following line */ + fprintf (stderr, "*** Error: _sfun_interface.c has not been customised!\n"); return; + + /* simple example follows */ + + /* Get total of all outputs and input to controller */ + controller_inputs[0] = 0.0; + for (i = 0; i < MTTNY; i++) { + controller_inputs[0] += mtty[i]; + } + + /* overwrite first model input with output from controller */ + mttu[0] = controller_outputs[0]; + + /* End EDIT */ +} + + +/****************************************************************************** + * DO NOT EDIT ANYTHING BELOW THIS LINE * + ******************************************************************************/ + +/* system equations */ + +static void +_numpar (void) +{ +#include "_numpar.c" + PRINT_LEAVE; +} + +/* utility procedures */ + +static double * +array_of_double (size_t n) +{ + void *p = calloc (n, sizeof (double)); + if (! p) { + fprintf (stderr, "*** Error: failed to allocate memory\n"); + } + return (double *) p; +} + +static void +initialise_arrays (void) +{ + PRINT_ENTER; + + mttpar = array_of_double (MTTNPAR); + mttu = array_of_double (MTTNU + MTTNYZ); + mttx = array_of_double (MTTNX); + mtty = array_of_double (MTTNY); + + controller_inputs = array_of_double (NumberOfControllerInputs); + controller_outputs = array_of_double (NumberOfControllerOutputs); + + PRINT_LEAVE; +} + +static void +update_inputs_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + for (i = 0; i < MTTNU; i++) { + mttu[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; + } + for (i = 0; i < MTTNX; i++) { + mttx[i] = *ssGetInputPortRealSignalPtrs (S, 1)[i]; + } + for (i = 0; i < MTTNY; i++) { + mtty[i] = *ssGetInputPortRealSignalPtrs (S, 2)[i]; + } + for (i = 0; i < NumberOfControllerOutputs; i++) { + controller_outputs[i] = *ssGetInputPortRealSignalPtrs (S, 3)[i]; + } + PRINT_LEAVE; +} + +static void +update_simtime_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + mttt = ssGetT (S); + PRINT_LEAVE; +} + +/* S-function methods */ + +static void mdlInitializeSizes(SimStruct *S) +{ + PRINT_ENTER; + + ssSetNumSFcnParams(S, 0); + if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { + PRINT_LEAVE; + return; + } + + ssSetNumContStates(S, 0); + ssSetNumDiscStates(S, 0); + + if (!ssSetNumInputPorts(S, 4)) return; + ssSetInputPortWidth(S, 0, MTTNU); + ssSetInputPortWidth(S, 1, MTTNX); + ssSetInputPortWidth(S, 2, MTTNY); + ssSetInputPortWidth(S, 3, NumberOfControllerOutputs); /* inputs from controller */ + ssSetInputPortDirectFeedThrough(S, 0, 1); + ssSetInputPortDirectFeedThrough(S, 1, 1); + ssSetInputPortDirectFeedThrough(S, 2, 1); + ssSetInputPortDirectFeedThrough(S, 3, 1); + + if (!ssSetNumOutputPorts(S, 2)) return; + ssSetOutputPortWidth(S, 0, MTTNU); /* altered inputs */ + ssSetOutputPortWidth(S, 1, NumberOfControllerInputs); /* outputs to controller */ + + ssSetNumSampleTimes(S, 1); + ssSetNumRWork(S, 0); + ssSetNumIWork(S, 0); + ssSetNumPWork(S, 0); + ssSetNumModes(S, 0); + ssSetNumNonsampledZCs(S, 0); + + ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); + + initialise_arrays (); + + PRINT_LEAVE; +} + +static void mdlInitializeSampleTimes(SimStruct *S) +{ + PRINT_ENTER; + ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); + ssSetOffsetTime(S, 0, 0.0); + PRINT_LEAVE; +} + +#define MDL_INITIALIZE_CONDITIONS +static void mdlInitializeConditions(SimStruct *S) +{ + PRINT_ENTER; + _numpar (); + PRINT_LEAVE; +} + +static void mdlOutputs(SimStruct *S, int_T tid) +{ + PRINT_ENTER; + + update_inputs_from_simulink (S); + update_simtime_from_simulink (S); + + _process_inputs (); + + UNUSED_ARG(tid); /* not used in single tasking mode */ + + for (i = 0; i < MTTNU; i++) { + ssGetOutputPortRealSignal (S, 0)[i] = mttu[i]; + } + + for (i = 0; i < NumberOfControllerInputs; i++) { + ssGetOutputPortRealSignal (S, 1)[i] = controller_inputs[i]; + } + + PRINT_LEAVE; +} + +#define MDL_DERIVATIVES +static void mdlDerivatives(SimStruct *S) +{ + PRINT_ENTER; + PRINT_LEAVE; +} + +static void mdlTerminate(SimStruct *S) +{ + PRINT_ENTER; + + UNUSED_ARG(S); + + free (mttpar); + free (mttu); + free (mttx); + free (mtty); + + free (controller_inputs); + free (controller_outputs); + + PRINT_LEAVE; +} + +#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ +#include "simulink.c" /* MEX-file interface mechanism */ +#else +#include "cg_sfun.h" /* Code generation registration function */ +#endif + +EOF + ;; + + *) + exit_error "Unknown Template"; + ;; + + esac +} + + + + + + + +### main program + +set_debug false +check_for_valid_input "$*" + +MTT_OPTS="$1" MTT_SYS="$2" MTT_LANG="$3" make $make_debug -f ${MTT_REP}/sfun_rep/Makefile ${2}_sfun.${3} +exit 0 ADDED mtt/lib/rep/sfun_rep/Makefile Index: mtt/lib/rep/sfun_rep/Makefile ================================================================== --- mtt/lib/rep/sfun_rep/Makefile +++ mtt/lib/rep/sfun_rep/Makefile @@ -0,0 +1,105 @@ +#! /usr/bin/make -f + +all: $(MTT_SYS)_sfun.mexglx + +$(MTT_SYS)_sfun.mexglx: $(MTT_SYS)_sfun.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_numpar.c $(MTT_SYS)_ode.c $(MTT_SYS)_odeo.c $(MTT_SYS)_state.c $(MTT_SYS)_sfun_ae.mexglx $(MTT_SYS)_sfun_input.mexglx $(MTT_SYS)_sfun_interface.mexglx $(MTT_SYS).mdl + echo Creating $@ + mex $(MTT_SYS)_sfun.c + cp *_sfun*mexglx $(MTT_SYS).mdl .. + +$(MTT_SYS)_sfun.c:: ${MTT_REP}/sfun_rep/sfun.c.tmpl $(MTT_SYS)_def.r + echo Creating $@ + cat $< | sed 's//$(MTT_SYS)/g' |\ + sed s/\/`mtt_getsize $(MTT_SYS) yz`/ > $@ + +$(MTT_SYS)_sfun_ae.mexglx: $(MTT_SYS)_sfun_ae.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_ae.c + echo Creating $@ + mex $(MTT_SYS)_sfun_ae.c + +$(MTT_SYS)_sfun_ae.c:: ${MTT_REP}/sfun_rep/mex_ae.c.tmpl $(MTT_SYS)_def.r + echo Creating $@ + cat $< | sed 's//$(MTT_SYS)/g' |\ + sed s/\/`mtt_getsize $(MTT_SYS) yz`/ > $@ + +$(MTT_SYS)_sfun_input.mexglx: $(MTT_SYS)_sfun_input.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_input.c $(MTT_SYS)_numpar.c + echo Creating $@ + mex $(MTT_SYS)_sfun_input.c + +$(MTT_SYS)_sfun_input.c:: ${MTT_REP}/sfun_rep/sfun_input.c.tmpl + echo Creating $@ + cat $^ | sed 's//$(MTT_SYS)/g' > $@ + +$(MTT_SYS)_sfun_interface.mexglx: $(MTT_SYS)_sfun_interface.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_numpar.c + echo Creating $@ + mex $(MTT_SYS)_sfun_interface.c + +$(MTT_SYS)_sfun_interface.c: ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl $(MTT_SYS)_struc.c + echo Creating $@ + cat ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl |\ + sed 's//$(MTT_SYS)/g' |\ + ${MTT_REP}/sfun_rep/insert_file.sh > $@ + +$(MTT_SYS)_sfun.zip: $(MTT_SYS)_sfun.c sfun_debug.h useful-functions.hh $(MTT_SYS)_sfun_ae.c $(MTT_SYS)_sfun_input.c $(MTT_SYS)_sfun_interface.c \ + $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h\ + $(MTT_SYS)_ae.c $(MTT_SYS)_input.c $(MTT_SYS)_numpar.c $(MTT_SYS)_ode.c $(MTT_SYS)_odeo.c $(MTT_SYS)_state.c \ + $(MTT_SYS).mdl README + echo Creating $@ + zip $@ $^ + +$(MTT_SYS).mdl: ${MTT_REP}/sfun_rep/mdl.tmpl + echo Creating $@ + cat $^ | sed 's//$(MTT_SYS)/g' > $@ + +README:: ${MTT_REP}/sfun_rep/README.tmpl README.CVS + echo Creating $@ + date > $@ + cat $^ | sed 's//$(MTT_SYS)/g' >> $@ + rm -f README.CVS + +README.CVS: + echo Getting CVS status + (cvs status ../$(MTT_SYS)_abg.fig || echo -e "\n$(MTT_SYS)_abg.fig is not under CVS\n") > $@ 2>1 + +$(MTT_SYS)_ae.c: $(MTT_SYS)_ae.m + echo Creating $@ + ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) ae c cat + +$(MTT_SYS)_input.c: $(MTT_SYS)_input.m + echo Creating $@ + ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) input c cat + +$(MTT_SYS)_numpar.c: $(MTT_SYS)_numpar.m + echo Creating $@ + ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) numpar c cat + +$(MTT_SYS)_ode.c: $(MTT_SYS)_ode.m + echo Creating $@ + ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) ode c cat + +$(MTT_SYS)_odeo.c: $(MTT_SYS)_odeo.m + echo Creating $@ + ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) odeo c cat + +$(MTT_SYS)_state.c: $(MTT_SYS)_state.m + echo Creating $@ + ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) state c cat + +$(MTT_SYS)_struc.c: $(MTT_SYS)_struc.txt + echo Creating $@ + gawk '\ +($$1 == "input") { printf " double *%s\t= &(mttu[%d]);\t/* input and output */\n", $$4, $$2-1 }\ +($$1 == "state") { printf " const double *_%s\t= &(mttx[%d]);\t/* input */\n", $$4, $$2-1 }\ +($$1 == "output") { printf " const double *_%s\t= &(mtty[%d]);\t/* input */\n", $$4, $$2-1 }\ +($$1 != "input" && $$1 != "state" && $$1 != "output") { }\ + ' $^ > $@ + +sfun_debug.h:: ${MTT_REP}/sfun_rep/sfun_debug.h + echo Copying $@ + cp $^ $@ + +useful-functions.hh:: ${MTT_CC}/include/useful-functions.hh + echo Copying $@ + cp $^ $@ + +%:: + mtt -cc -q $(MTT_OPTS) `echo $* | sed 's/\(.*\)_\(.*\)\.\(.*\)/\1 \2 \3/'` ADDED mtt/lib/rep/sfun_rep/README.tmpl Index: mtt/lib/rep/sfun_rep/README.tmpl ================================================================== --- mtt/lib/rep/sfun_rep/README.tmpl +++ mtt/lib/rep/sfun_rep/README.tmpl @@ -0,0 +1,16 @@ + +To build a Simulink funtion of the model without using MTT: + +mex -I. _sfun.c + +The input block can be created with: + +mex -I. _sfun_input.c + +If numerical solution of algebraic equations is also required: + +mex -I. _sfun_ae.c + +The interface block can be created with + +mex -I. _sfun_interface.c ADDED mtt/lib/rep/sfun_rep/insert_file.sh Index: mtt/lib/rep/sfun_rep/insert_file.sh ================================================================== --- mtt/lib/rep/sfun_rep/insert_file.sh +++ mtt/lib/rep/sfun_rep/insert_file.sh @@ -0,0 +1,4 @@ +#! /usr/bin/gawk -f +# script to replace the line: "/* insert filename */" with the contents of file "filename" +($1 != "/*" || $2 != "insert" || $4 != "*/") { print } +($1 == "/*" && $2 == "insert" && $4 == "*/") { cmd = "cat " $3 ; system(cmd) } ADDED mtt/lib/rep/sfun_rep/mdl.tmpl Index: mtt/lib/rep/sfun_rep/mdl.tmpl ================================================================== --- mtt/lib/rep/sfun_rep/mdl.tmpl +++ mtt/lib/rep/sfun_rep/mdl.tmpl @@ -0,0 +1,381 @@ +Model { + Name "mdl" + Version 4.00 + SampleTimeColors off + LibraryLinkDisplay "all" + WideLines off + ShowLineDimensions on + ShowPortDataTypes off + ShowStorageClass off + ExecutionOrder off + RecordCoverage off + CovPath "/" + CovSaveName "covdata" + CovMetricSettings "dw" + CovNameIncrementing off + CovHtmlReporting on + BlockNameDataTip off + BlockParametersDataTip off + BlockDescriptionStringDataTip off + ToolBar on + StatusBar on + BrowserShowLibraryLinks off + BrowserLookUnderMasks off + Created "Mon May 20 13:21:21 2002" + Creator "geraint" + UpdateHistory "UpdateHistoryNever" + ModifiedByFormat "%" + LastModifiedBy "geraint" + ModifiedDateFormat "%" + LastModifiedDate "Tue Jun 18 18:49:28 2002" + ModelVersionFormat "1.%" + ConfigurationManager "None" + SimParamPage "Solver" + StartTime "0.0" + StopTime "10.0" + SolverMode "Auto" + Solver "ode45" + RelTol "1e-3" + AbsTol "auto" + Refine "1" + MaxStep "auto" + MinStep "auto" + MaxNumMinSteps "-1" + InitialStep "auto" + FixedStep "auto" + MaxOrder 5 + OutputOption "RefineOutputTimes" + OutputTimes "[]" + LoadExternalInput off + ExternalInput "[t, u]" + SaveTime on + TimeSaveName "tout" + SaveState off + StateSaveName "xout" + SaveOutput on + OutputSaveName "yout" + LoadInitialState off + InitialState "xInitial" + SaveFinalState off + FinalStateName "xFinal" + SaveFormat "Array" + LimitDataPoints on + MaxDataPoints "1000" + Decimation "1" + AlgebraicLoopMsg "warning" + MinStepSizeMsg "warning" + UnconnectedInputMsg "warning" + UnconnectedOutputMsg "warning" + UnconnectedLineMsg "warning" + InheritedTsInSrcMsg "warning" + SingleTaskRateTransMsg "none" + MultiTaskRateTransMsg "error" + IntegerOverflowMsg "warning" + CheckForMatrixSingularity "none" + UnnecessaryDatatypeConvMsg "none" + Int32ToFloatConvMsg "warning" + InvalidFcnCallConnMsg "error" + SignalLabelMismatchMsg "none" + LinearizationMsg "none" + VectorMatrixConversionMsg "none" + SfunCompatibilityCheckMsg "none" + BlockPriorityViolationMsg "warning" + ArrayBoundsChecking "none" + ConsistencyChecking "none" + ZeroCross on + Profile off + SimulationMode "normal" + RTWSystemTargetFile "grt.tlc" + RTWInlineParameters off + RTWRetainRTWFile off + RTWTemplateMakefile "grt_default_tmf" + RTWMakeCommand "make_rtw" + RTWGenerateCodeOnly off + TLCProfiler off + TLCDebug off + TLCCoverage off + AccelSystemTargetFile "accel.tlc" + AccelTemplateMakefile "accel_default_tmf" + AccelMakeCommand "make_rtw" + TryForcingSFcnDF off + ExtModeMexFile "ext_comm" + ExtModeBatchMode off + ExtModeTrigType "manual" + ExtModeTrigMode "normal" + ExtModeTrigPort "1" + ExtModeTrigElement "any" + ExtModeTrigDuration 1000 + ExtModeTrigHoldOff 0 + ExtModeTrigDelay 0 + ExtModeTrigDirection "rising" + ExtModeTrigLevel 0 + ExtModeArchiveMode "off" + ExtModeAutoIncOneShot off + ExtModeIncDirWhenArm off + ExtModeAddSuffixToVar off + ExtModeWriteAllDataToWs off + ExtModeArmWhenConnect on + ExtModeSkipDownloadWhenConnect off + ExtModeLogAll on + ExtModeAutoUpdateStatusClock off + OptimizeBlockIOStorage on + BufferReuse on + ParameterPooling on + BlockReductionOpt on + RTWExpressionDepthLimit 5 + BooleanDataType off + BlockDefaults { + Orientation "right" + ForegroundColor "black" + BackgroundColor "white" + DropShadow off + NamePlacement "normal" + FontName "Helvetica" + FontSize 10 + FontWeight "normal" + FontAngle "normal" + ShowName on + } + AnnotationDefaults { + HorizontalAlignment "center" + VerticalAlignment "middle" + ForegroundColor "black" + BackgroundColor "white" + DropShadow off + FontName "Helvetica" + FontSize 10 + FontWeight "normal" + FontAngle "normal" + } + LineDefaults { + FontName "Helvetica" + FontSize 9 + FontWeight "normal" + FontAngle "normal" + } + System { + Name "mdl" + Location [61, 487, 356, 620] + Open on + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + ZoomFactor "100" + ReportName "simulink-default.rpt" + Block { + BlockType Inport + Name "In1" + Position [25, 43, 55, 57] + Port "1" + LatchInput off + DataType "double" + SignalType "real" + Interpolate on + } + Block { + BlockType SubSystem + Name "MTT Model\n" + Ports [1, 1] + Position [100, 20, 140, 80] + ForegroundColor "blue" + BackgroundColor "lightBlue" + ShowPortLabels on + TreatAsAtomicUnit off + RTWSystemCode "Auto" + RTWFcnNameOpts "Auto" + RTWFileNameOpts "Auto" + System { + Name "MTT Model\n" + Location [55, 494, 1018, 766] + Open off + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + ZoomFactor "100" + Block { + BlockType Inport + Name "In1" + Position [590, 203, 620, 217] + Port "1" + LatchInput off + DataType "double" + SignalType "real" + Interpolate on + } + Block { + BlockType "S-Function" + Name "MTT Model Inputs" + Ports [1, 1] + Position [390, 59, 565, 91] + BackgroundColor "lightBlue" + DropShadow on + FunctionName "_sfun_input" + PortCounts "[]" + SFunctionModules "''" + Port { + PortNumber 1 + Name "MTT Model Inputs: MTTU" + TestPoint off + LinearAnalysisOutput off + LinearAnalysisInput off + RTWStorageClass "Auto" + } + } + Block { + BlockType "S-Function" + Name "MTT Plant Model" + Ports [1, 2] + Position [65, 61, 250, 199] + BackgroundColor "lightBlue" + DropShadow on + FunctionName "_sfun" + PortCounts "[]" + SFunctionModules "''" + Port { + PortNumber 1 + Name "MTT Model States: MTTX" + TestPoint off + LinearAnalysisOutput off + LinearAnalysisInput off + RTWStorageClass "Auto" + } + Port { + PortNumber 2 + Name "MTT Model Outputs: MTTY" + TestPoint off + LinearAnalysisOutput off + LinearAnalysisInput off + RTWStorageClass "Auto" + } + } + Block { + BlockType Memory + Name "Memory" + Position [870, 80, 900, 110] + X0 "0" + InheritSampleTime off + RTWStateStorageClass "Auto" + } + Block { + BlockType Memory + Name "Memory1" + Position [860, 175, 890, 205] + X0 "0" + InheritSampleTime off + RTWStateStorageClass "Auto" + } + Block { + BlockType "S-Function" + Name "S-Function" + Ports [4, 2] + Position [710, 47, 840, 238] + BackgroundColor "lightBlue" + DropShadow on + FunctionName "_sfun_interface" + PortCounts "[]" + SFunctionModules "''" + } + Block { + BlockType Outport + Name "Out1" + Position [905, 183, 935, 197] + Port "1" + OutputWhenDisabled "held" + InitialOutput "[]" + } + Line { + Name "MTT Model States: MTTX" + Labels [2, 0] + SrcBlock "MTT Plant Model" + SrcPort 1 + Points [0, 0; 105, 0] + Branch { + Points [0, -20] + DstBlock "MTT Model Inputs" + DstPort 1 + } + Branch { + Points [0, 25] + DstBlock "S-Function" + DstPort 2 + } + } + Line { + Name "MTT Model Outputs: MTTY" + Labels [1, 0] + SrcBlock "MTT Plant Model" + SrcPort 2 + DstBlock "S-Function" + DstPort 3 + } + Line { + Name "MTT Model Inputs: MTTU" + Labels [1, 0] + SrcBlock "MTT Model Inputs" + SrcPort 1 + DstBlock "S-Function" + DstPort 1 + } + Line { + SrcBlock "In1" + SrcPort 1 + DstBlock "S-Function" + DstPort 4 + } + Line { + SrcBlock "S-Function" + SrcPort 1 + DstBlock "Memory" + DstPort 1 + } + Line { + SrcBlock "Memory" + SrcPort 1 + Points [0, -55; -855, 0] + DstBlock "MTT Plant Model" + DstPort 1 + } + Line { + SrcBlock "Memory1" + SrcPort 1 + DstBlock "Out1" + DstPort 1 + } + Line { + SrcBlock "S-Function" + SrcPort 2 + DstBlock "Memory1" + DstPort 1 + } + } + } + Block { + BlockType Outport + Name "Out1" + Position [185, 43, 215, 57] + Port "1" + OutputWhenDisabled "held" + InitialOutput "[]" + } + Line { + SrcBlock "MTT Model\n" + SrcPort 1 + DstBlock "Out1" + DstPort 1 + } + Line { + SrcBlock "In1" + SrcPort 1 + DstBlock "MTT Model\n" + DstPort 1 + } + } +} ADDED mtt/lib/rep/sfun_rep/mex_ae.c.tmpl Index: mtt/lib/rep/sfun_rep/mex_ae.c.tmpl ================================================================== --- mtt/lib/rep/sfun_rep/mex_ae.c.tmpl +++ mtt/lib/rep/sfun_rep/mex_ae.c.tmpl @@ -0,0 +1,122 @@ +/* -*-c-*- Put emacs into c-mode + * _sfun_ae.c: + * Matlab mex algebraic equations for + */ + +#if /* have_algebraic_equations */ + +#include +#include +#include +#include +#include "sfun_debug.h" +#include "useful-functions.hh" +#include "_def.h" +#include "_sympar.h" +#include "_cr.h" + +/* utility procedures */ + +double * +array_of_double (size_t n) +{ + void *p = calloc (n, sizeof (double)); + if (! p) { + fprintf (stderr, "*** Error: failed to allocate memory\n"); + } + return (double *) p; +} + +/* system equations */ + +static void +_ae (double *mttyz, + const double *mttx, + const double *mttu, + const double mttt, + const double *mttpar) +{ +#include "_ae.c" + PRINT_LEAVE; +} + +/* generic mex function */ + +#ifdef __cplusplus +extern "C" { +#endif + +void +mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) +{ + double *mttyz; /* residuals */ + + double *mttx; /* states */ + double *mttu; /* known + unknown inputs */ + double mttt; /* time */ + double *mttpar; /* parameters */ + + unsigned int i; + double *p; + + PRINT_ENTER; + + mttyz = array_of_double (MTTNYZ); + + mttx = array_of_double (MTTNX); + mttu = array_of_double (MTTNU + MTTNYZ); + mttpar = array_of_double (MTTNPAR); + + /* get trial values */ + p = mxGetPr (prhs[0]); + for (i = 0; i < MTTNYZ; i++) { + mttu[MTTNU + i] = p[i]; + } + + /* get states */ + p = mxGetPr (prhs[1]); + for (i = 0; i < MTTNX; i++) { + mttx[i] = p[i]; + } + + /* get known inputs */ + p = mxGetPr (prhs[2]); + for (i = 0; i < MTTNU; i++) { + mttu[i] = p[i]; + } + + /* get time */ + p = mxGetPr (prhs[3]); + mttt = *p; + + /* get parameters */ + p = mxGetPr (prhs[4]); + for (i = 0; i < MTTNPAR; i++) { + mttpar[i] = p[i]; + } + + /* evaluate residuals */ + _ae (mttyz, mttx, mttu, mttt, mttpar); + + /* return residuals */ + plhs[0] = mxCreateDoubleMatrix (MTTNYZ, 1, mxREAL); + p = mxGetPr (plhs[0]); + for (i = 0; i < MTTNYZ; i++) { + p[i] = mttyz[i]; + } + + /* release memory */ + free (mttx); + free (mttu); + free (mttpar); + free (mttyz); + + PRINT_LEAVE; +} + +#ifdef __cplusplus +} +#endif + +#endif /* have_algebraic_equations */ ADDED mtt/lib/rep/sfun_rep/sfun.c.tmpl Index: mtt/lib/rep/sfun_rep/sfun.c.tmpl ================================================================== --- mtt/lib/rep/sfun_rep/sfun.c.tmpl +++ mtt/lib/rep/sfun_rep/sfun.c.tmpl @@ -0,0 +1,322 @@ +/* -*-c-*- Put emacs into c-mode + * _sfun.c: + * Matlab S-function simulation of + */ + +#define S_FUNCTION_NAME _sfun +#define S_FUNCTION_LEVEL 2 + +#include +#include +#include +#include "simstruc.h" +#include "sfun_debug.h" +#include "useful-functions.hh" +#include "_def.h" +#include "_sympar.h" +#include "_cr.h" + +static double *mttdx; /* pointer to rates */ +static double *mttu; /* pointer to inputs */ +static double *mttpar; /* pointer to parameters */ +static double *mttx; /* pointer to states */ +static double *mtty; /* pointer to outputs */ +static double *mttyz; /* pointer to residuals */ +static double mttt; /* time */ + +static unsigned int i; /* loop counter */ + +/* system equations */ + +static void +_ae (void) +{ +#include "_ae.c" + PRINT_LEAVE; +} + +static void +_numpar (void) +{ +#include "_numpar.c" + PRINT_LEAVE; +} + +static void +_ode (void) +{ +#include "_ode.c" + PRINT_LEAVE; +} + +static void +_odeo (void) +{ +#include "_odeo.c" + PRINT_LEAVE; +} + +static void +_state (void) +{ +#include "_state.c" + PRINT_LEAVE; +} + +/* utility procedures */ + +static double * +array_of_double (size_t n) +{ + void *p = calloc (n, sizeof (double)); + if (! p) { + fprintf (stderr, "*** Error: failed to allocate memory\n"); + } + return (double *) p; +} + +static void +initialise_arrays (void) +{ + PRINT_ENTER; + + mttdx = array_of_double (MTTNX); + mttpar = array_of_double (MTTNPAR); + mttu = array_of_double (MTTNU + MTTNYZ); + mttx = array_of_double (MTTNX); + mtty = array_of_double (MTTNY); + mttyz = array_of_double (MTTNYZ); + + PRINT_LEAVE; +} + +static void +update_states_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + for (i = 0; i < MTTNX; i++) { + mttx[i] = ssGetContStates (S)[i]; + } + PRINT_LEAVE; +} + +static void +update_inputs_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + for (i = 0; i < MTTNU; i++) { + mttu[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; + } + PRINT_LEAVE; +} + +static void +update_inputs_from_solver (void) +{ +#if /* have_algebraic_equations */ + mxArray *MTT_MATLAB_P; + mxArray *MTT_MATLAB_T; + mxArray *MTT_MATLAB_U; + mxArray *MTT_MATLAB_Ui; + mxArray *MTT_MATLAB_X; + + double *p; + + PRINT_ENTER; + + /* starting value for solver - start with zero */ + MTT_MATLAB_Ui = mxCreateDoubleMatrix (MTTNYZ, 1, mxREAL); + p = mxGetPr (MTT_MATLAB_Ui); + for (i = 0; i < MTTNYZ; i++) { + p[i] = 0.0; + } + mexPutVariable ("base", "MTT_Ui", MTT_MATLAB_Ui); + + /* put states into matlab workspace */ + MTT_MATLAB_X = mxCreateDoubleMatrix (MTTNX, 1, mxREAL); + p = mxGetPr (MTT_MATLAB_X); + for (i = 0; i < MTTNX; i++) { + p[i] = mttx[i]; + } + mexPutVariable ("base", "MTT_X", MTT_MATLAB_X); + + /* put known inputs into matlab workspace */ + MTT_MATLAB_U = mxCreateDoubleMatrix (MTTNU, 1, mxREAL); + p = mxGetPr (MTT_MATLAB_U); + for (i = 0; i < MTTNU; i++) { + p[i] = mttu[i]; + } + mexPutVariable ("base", "MTT_U", MTT_MATLAB_U); + + /* put time into matlab workspace */ + MTT_MATLAB_T = mxCreateDoubleMatrix (1, 1, mxREAL); + *mxGetPr (MTT_MATLAB_T) = mttt; + mexPutVariable ("base", "MTT_T", MTT_MATLAB_T); + + /* put parameters into matlab workspace */ + MTT_MATLAB_P = mxCreateDoubleMatrix (MTTNPAR, 1, mxREAL); + p = mxGetPr (MTT_MATLAB_P); + for (i = 0; i < MTTNPAR; i++) { + p[i] = mttpar[i]; + } + mexPutVariable ("base", "MTT_P", MTT_MATLAB_P); + + /* call solver */ + mexEvalString ("MTT_Ui = lsqnonlin (@_sfun_ae, MTT_Ui, [], [], optimset('display','off','diagnostics','off','TolX',1e-2,'TolFun',1e-2), MTT_X, MTT_U, MTT_T, MTT_P);"); + + /* retrieve result */ + MTT_MATLAB_Ui = mexGetVariable ("base", "MTT_Ui"); + p = mxGetPr (MTT_MATLAB_Ui); + for (i = 0; i < MTTNYZ; i++) { + mttu[MTTNU + i] = p[i]; + } + + /* free memory */ + mxDestroyArray (MTT_MATLAB_P); + mxDestroyArray (MTT_MATLAB_T); + mxDestroyArray (MTT_MATLAB_U); + mxDestroyArray (MTT_MATLAB_Ui); + mxDestroyArray (MTT_MATLAB_X); + + PRINT_LEAVE; +#endif /* have_algebraic_equations */ + ; +} + +static void +update_simtime_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + mttt = ssGetT (S); + PRINT_LEAVE; +} + +/* S-function methods */ + +static void mdlInitializeSizes(SimStruct *S) +{ + PRINT_ENTER; + + ssSetNumSFcnParams(S, 0); + if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { + PRINT_LEAVE; + return; + } + + ssSetNumContStates(S, MTTNX); + ssSetNumDiscStates(S, 0); + + if (!ssSetNumInputPorts(S, 1)) return; + ssSetInputPortWidth(S, 0, MTTNU); + ssSetInputPortDirectFeedThrough(S, 0, 1); + + if (!ssSetNumOutputPorts(S, 2)) return; + ssSetOutputPortWidth(S, 0, MTTNX); + ssSetOutputPortWidth(S, 1, MTTNY); + + ssSetNumSampleTimes(S, 1); + ssSetNumRWork(S, 0); + ssSetNumIWork(S, 0); + ssSetNumPWork(S, 0); + ssSetNumModes(S, 0); + ssSetNumNonsampledZCs(S, 0); + + ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); + + initialise_arrays (); + + PRINT_LEAVE; +} + +static void mdlInitializeSampleTimes(SimStruct *S) +{ + PRINT_ENTER; + + ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); + ssSetOffsetTime(S, 0, 0.0); + + PRINT_LEAVE; +} + +#define MDL_INITIALIZE_CONDITIONS +static void mdlInitializeConditions(SimStruct *S) +{ + PRINT_ENTER; + + _numpar (); + _state (); + + for (i = 0; i < MTTNX; i++) { + ssGetContStates (S)[i] = mttx[i]; + } + + PRINT_LEAVE; +} + +static void mdlOutputs(SimStruct *S, int_T tid) +{ + PRINT_ENTER; + + update_states_from_simulink (S); + update_inputs_from_simulink (S); + if (MTTNYZ > 0) { + update_inputs_from_solver (); + } + update_simtime_from_simulink (S); + + UNUSED_ARG(tid); /* not used in single tasking mode */ + + _odeo (); + + for (i = 0; i < MTTNX; i++) { + ssGetOutputPortRealSignal (S, 0)[i] = mttx[i]; + } + + for (i = 0; i < MTTNY; i++) { + ssGetOutputPortRealSignal (S, 1)[i] = mtty[i]; + } + + PRINT_LEAVE; +} + +#define MDL_DERIVATIVES +static void mdlDerivatives(SimStruct *S) +{ + PRINT_ENTER; + + update_states_from_simulink (S); + update_inputs_from_simulink (S); + if (MTTNYZ > 0) { + update_inputs_from_solver (); + } + update_simtime_from_simulink (S); + + _ode (); + + for (i = 0; i < MTTNX; i++) { + ssGetdX (S)[i] = mttdx[i]; + } + + PRINT_LEAVE; +} + +static void mdlTerminate(SimStruct *S) +{ + PRINT_ENTER; + UNUSED_ARG(S); + + free (mttdx); + free (mttpar); + free (mttu); + free (mttx); + free (mtty); + free (mttyz); + + PRINT_LEAVE; +} + +#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ +#include "simulink.c" /* MEX-file interface mechanism */ +#else +#include "cg_sfun.h" /* Code generation registration function */ +#endif ADDED mtt/lib/rep/sfun_rep/sfun_debug.h Index: mtt/lib/rep/sfun_rep/sfun_debug.h ================================================================== --- mtt/lib/rep/sfun_rep/sfun_debug.h +++ mtt/lib/rep/sfun_rep/sfun_debug.h @@ -0,0 +1,30 @@ + +#ifndef HAVE_SFUN_DEBUG_H +#define HAVE_SFUN_DEBUG_H + + +#if defined DEBUG && defined __GNUC__ + +#include +#define PRINT_ENTER fprintf (stderr, "debug> Entered '%s'\n", __FUNCTION__); +#define PRINT_LEAVE fprintf (stderr, "debug> Leaving '%s'\n", __FUNCTION__); + +#elif defined DEBUG && ! defined __GNUC__ + +#include +#define PRINT_ENTER fprintf (stderr, "debug> Entered a function\n"); +#define PRINT_LEAVE fprintf (stderr, "debug> Leaving a function\n"); + +#elif ! defined DEBUG + +#define PRINT_ENTER +#define PRINT_LEAVE + +#else + +#error "Momentary lapse of logic : unreachable statement reached" + +#endif + + +#endif /* HAVE_SFUN_DEBUG_H */ ADDED mtt/lib/rep/sfun_rep/sfun_input.c.tmpl Index: mtt/lib/rep/sfun_rep/sfun_input.c.tmpl ================================================================== --- mtt/lib/rep/sfun_rep/sfun_input.c.tmpl +++ mtt/lib/rep/sfun_rep/sfun_input.c.tmpl @@ -0,0 +1,185 @@ +/* -*-c-*- Put emacs into c-mode + * _sfun_input.c: + * Matlab S-function inputs for + */ + +#define S_FUNCTION_NAME _sfun_input +#define S_FUNCTION_LEVEL 2 + +#include +#include +#include +#include "simstruc.h" +#include "sfun_debug.h" +#include "useful-functions.hh" +#include "_def.h" +#include "_sympar.h" +#include "_cr.h" + +static double *mttu; /* pointer to inputs */ +static double *mttpar; /* pointer to parameters */ +static double *mttx; /* pointer to states */ +static double *mtty; /* pointer to outputs */ +static double mttt; /* time */ + +static unsigned int i; /* loop counter */ + +/* system equations */ + +static void +_input (void) +{ +#include "_input.c" + PRINT_LEAVE; +} + +static void +_numpar (void) +{ +#include "_numpar.c" + PRINT_LEAVE; +} + +/* utility procedures */ + +static double * +array_of_double (size_t n) +{ + void *p = calloc (n, sizeof (double)); + if (! p) { + fprintf (stderr, "*** Error: failed to allocate memory\n"); + } + return (double *) p; +} + +static void +initialise_arrays (void) +{ + PRINT_ENTER; + + mttpar = array_of_double (MTTNPAR); + mttu = array_of_double (MTTNU + MTTNYZ); + mttx = array_of_double (MTTNX); + mtty = array_of_double (MTTNY); + + PRINT_LEAVE; +} + +static void +update_inputs_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + for (i = 0; i < MTTNX; i++) { + mttx[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; + } + PRINT_LEAVE; +} + +static void +update_simtime_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + mttt = ssGetT (S); + PRINT_LEAVE; +} + +/* S-function methods */ + +static void mdlInitializeSizes(SimStruct *S) +{ + PRINT_ENTER; + + ssSetNumSFcnParams(S, 0); + if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { + PRINT_LEAVE; + return; + } + + ssSetNumContStates(S, 0); + ssSetNumDiscStates(S, 0); + + if (!ssSetNumInputPorts(S, 1)) return; + ssSetInputPortWidth(S, 0, MTTNX); + ssSetInputPortDirectFeedThrough(S, 0, 1); + + if (!ssSetNumOutputPorts(S, 1)) return; + ssSetOutputPortWidth(S, 0, MTTNU); + + ssSetNumSampleTimes(S, 1); + ssSetNumRWork(S, 0); + ssSetNumIWork(S, 0); + ssSetNumPWork(S, 0); + ssSetNumModes(S, 0); + ssSetNumNonsampledZCs(S, 0); + + ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); + + initialise_arrays (); + + PRINT_LEAVE; +} + +static void mdlInitializeSampleTimes(SimStruct *S) +{ + PRINT_ENTER; + ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); + ssSetOffsetTime(S, 0, 0.0); + PRINT_LEAVE; +} + +#define MDL_INITIALIZE_CONDITIONS +static void mdlInitializeConditions(SimStruct *S) +{ + PRINT_ENTER; + _numpar (); + PRINT_LEAVE; +} + +static void mdlOutputs(SimStruct *S, int_T tid) +{ + PRINT_ENTER; + + update_inputs_from_simulink (S); + update_simtime_from_simulink (S); + + UNUSED_ARG(tid); /* not used in single tasking mode */ + + _input (); + + for (i = 0; i < MTTNU; i++) { + ssGetOutputPortRealSignal (S, 0)[i] = mttu[i]; + } + + PRINT_LEAVE; +} + +#define MDL_DERIVATIVES +static void mdlDerivatives(SimStruct *S) +{ + PRINT_ENTER; + + update_inputs_from_simulink (S); + update_simtime_from_simulink (S); + + PRINT_LEAVE; +} + +static void mdlTerminate(SimStruct *S) +{ + PRINT_ENTER; + + UNUSED_ARG(S); + + free (mttpar); + free (mttu); + free (mttx); + free (mtty); + + PRINT_LEAVE; +} + +#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ +#include "simulink.c" /* MEX-file interface mechanism */ +#else +#include "cg_sfun.h" /* Code generation registration function */ +#endif ADDED mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl Index: mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl ================================================================== --- mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl +++ mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl @@ -0,0 +1,275 @@ +/* -*-c-*- Put emacs into c-mode + * _sfun_interface.c: + * Matlab S-function to process inputs and outputs of + */ + + +#define S_FUNCTION_NAME _sfun_interface +#define S_FUNCTION_LEVEL 2 + +#include +#include +#include +#include "simstruc.h" +#include "sfun_debug.h" +#include "useful-functions.hh" +#include "_def.h" +#include "_sympar.h" + +static double *mttu; /* pointer to inputs */ +static double *mttpar; /* pointer to parameters */ +static double *mttx; /* pointer to states */ +static double *mtty; /* pointer to outputs */ +static double mttt; /* time */ + +static double *MTT_outputs; +static double *MTT_inputs; + +static unsigned int i; /* loop counter */ + +/* Start EDIT */ +/* Edit this block to define the number of simulink inputs, outputs and parameters */ +#define NumberOfSimulinkInputs MTTNY /* MTT outputs */ +#define NumberOfSimulinkOutputs MTTNU /* MTT inputs */ +/* End EDIT */ + +static void +_process_inputs (SimStruct *S) +{ + /* insert _struc.c */ + + /* Start EDIT */ + /* Edit this block to process the model inputs and outputs */ + + /* Error messages can be set using the following line */ + /* ssSetErrorStatus (S, "_some error message!\n"); */ + + /* Default is to expose all MTT inputs, outputs and states */ + + /* Get all the MTT model outputs and pass them to simulink */ + for (i = 0; i < NumberOfSimulinkInputs; i++) { + MTT_outputs[i] = mtty[i]; + } + + /* Get all inputs from Simulink and pass them to the MTT model */ + /* Any inputs not over-written here will be read from _input.c */ + for (i = 0; i < NumberOfSimulinkOutputs; i++) { + mttu[i] = MTT_inputs[i]; + } + + /* End EDIT */ +} + + +/****************************************************************************** + * DO NOT EDIT ANYTHING BELOW THIS LINE * + ******************************************************************************/ + +/* system equations */ + +static void +_numpar (void) +{ +#include "_numpar.c" + PRINT_LEAVE; +} + +/* utility procedures */ + +static double * +array_of_double (size_t n) +{ + void *p = calloc (n, sizeof (double)); + if (! p) { + fprintf (stderr, "*** Error: failed to allocate memory\n"); + } + return (double *) p; +} + +static void +check_finite(SimStruct *S, double *array, unsigned int index) +{ + const char *array_name; + char warning[128]; + if ((array[index] <= 0.0) || (array[index] >= 0.0)) { + ; /* no problem */ + } else { + if (array == mttpar) { + array_name = "mttpar"; + } else if (array == mttu) { + array_name = "mttu"; + } else if (array == mttx) { + array_name = "mttx"; + } else if (array == mtty) { + array_name = "mtty"; + } else if (array == MTT_outputs) { + array_name = "MTT_outputs"; + } else if (array == MTT_inputs) { + array_name = "MTT_inputs"; + } else { + array_name = "unknown_array"; + } + sprintf(warning, "(time %f) Non-finite array element: %s[%d]\n", mttt, array_name, index); + ssWarning(S, warning); + } +} + +static void +initialise_arrays (void) +{ + PRINT_ENTER; + + mttpar = array_of_double (MTTNPAR); + mttu = array_of_double (MTTNU + MTTNYZ); + mttx = array_of_double (MTTNX); + mtty = array_of_double (MTTNY); + + MTT_outputs = array_of_double (NumberOfSimulinkInputs); + MTT_inputs = array_of_double (NumberOfSimulinkOutputs); + + PRINT_LEAVE; +} + +static void +update_inputs_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + for (i = 0; i < MTTNU; i++) { + mttu[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; + check_finite(S, mttu, i); + } + for (i = 0; i < MTTNX; i++) { + mttx[i] = *ssGetInputPortRealSignalPtrs (S, 1)[i]; + check_finite(S, mttx, i); + } + for (i = 0; i < MTTNY; i++) { + mtty[i] = *ssGetInputPortRealSignalPtrs (S, 2)[i]; + check_finite(S, mtty, i); + } + for (i = 0; i < NumberOfSimulinkOutputs; i++) { + MTT_inputs[i] = *ssGetInputPortRealSignalPtrs (S, 3)[i]; + check_finite(S, MTT_inputs, i); + } + PRINT_LEAVE; +} + +static void +update_simtime_from_simulink (SimStruct *S) +{ + PRINT_ENTER; + mttt = ssGetT (S); + PRINT_LEAVE; +} + +/* S-function methods */ + +static void mdlInitializeSizes(SimStruct *S) +{ + PRINT_ENTER; + + ssSetNumSFcnParams(S, 0); + if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { + PRINT_LEAVE; + return; + } + + ssSetNumContStates(S, 0); + ssSetNumDiscStates(S, 0); + + if (!ssSetNumInputPorts(S, 4)) return; + ssSetInputPortWidth(S, 0, MTTNU); + ssSetInputPortWidth(S, 1, MTTNX); + ssSetInputPortWidth(S, 2, MTTNY); + ssSetInputPortWidth(S, 3, NumberOfSimulinkOutputs); /* inputs from simulink */ + ssSetInputPortDirectFeedThrough(S, 0, 1); + ssSetInputPortDirectFeedThrough(S, 1, 1); + ssSetInputPortDirectFeedThrough(S, 2, 1); + ssSetInputPortDirectFeedThrough(S, 3, 1); + + if (!ssSetNumOutputPorts(S, 2)) return; + ssSetOutputPortWidth(S, 0, MTTNU); /* altered inputs */ + ssSetOutputPortWidth(S, 1, NumberOfSimulinkInputs); /* outputs to simulink */ + + ssSetNumSampleTimes(S, 1); + ssSetNumRWork(S, 0); + ssSetNumIWork(S, 0); + ssSetNumPWork(S, 0); + ssSetNumModes(S, 0); + ssSetNumNonsampledZCs(S, 0); + + ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); + + initialise_arrays (); + + PRINT_LEAVE; +} + +static void mdlInitializeSampleTimes(SimStruct *S) +{ + PRINT_ENTER; + ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); + ssSetOffsetTime(S, 0, 0.0); + PRINT_LEAVE; +} + +#define MDL_INITIALIZE_CONDITIONS +static void mdlInitializeConditions(SimStruct *S) +{ + PRINT_ENTER; + _numpar (); + PRINT_LEAVE; +} + +static void mdlOutputs(SimStruct *S, int_T tid) +{ + PRINT_ENTER; + + update_inputs_from_simulink (S); + update_simtime_from_simulink (S); + + _process_inputs (S); + + UNUSED_ARG(tid); /* not used in single tasking mode */ + + for (i = 0; i < MTTNU; i++) { + check_finite(S, mttu, i); + ssGetOutputPortRealSignal (S, 0)[i] = mttu[i]; + } + + for (i = 0; i < NumberOfSimulinkInputs; i++) { + check_finite(S, MTT_outputs, i); + ssGetOutputPortRealSignal (S, 1)[i] = MTT_outputs[i]; + } + + PRINT_LEAVE; +} + +#define MDL_DERIVATIVES +static void mdlDerivatives(SimStruct *S) +{ + PRINT_ENTER; + PRINT_LEAVE; +} + +static void mdlTerminate(SimStruct *S) +{ + PRINT_ENTER; + + UNUSED_ARG(S); + + free (mttpar); + free (mttu); + free (mttx); + free (mtty); + + free (MTT_outputs); + free (MTT_inputs); + + PRINT_LEAVE; +} + +#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ +#include "simulink.c" /* MEX-file interface mechanism */ +#else +#include "cg_sfun.h" /* Code generation registration function */ +#endif ADDED mtt/lib/xfig/Basic/0.fig Index: mtt/lib/xfig/Basic/0.fig ================================================================== --- mtt/lib/xfig/Basic/0.fig +++ mtt/lib/xfig/Basic/0.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 0\001 ADDED mtt/lib/xfig/Basic/1.fig Index: mtt/lib/xfig/Basic/1.fig ================================================================== --- mtt/lib/xfig/Basic/1.fig +++ mtt/lib/xfig/Basic/1.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 1\001 ADDED mtt/lib/xfig/Basic/AE.fig Index: mtt/lib/xfig/Basic/AE.fig ================================================================== --- mtt/lib/xfig/Basic/AE.fig +++ mtt/lib/xfig/Basic/AE.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 AE:ae_1\001 ADDED mtt/lib/xfig/Basic/AEf.fig Index: mtt/lib/xfig/Basic/AEf.fig ================================================================== --- mtt/lib/xfig/Basic/AEf.fig +++ mtt/lib/xfig/Basic/AEf.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 AEf:aef_1\001 ADDED mtt/lib/xfig/Basic/AF.fig Index: mtt/lib/xfig/Basic/AF.fig ================================================================== --- mtt/lib/xfig/Basic/AF.fig +++ mtt/lib/xfig/Basic/AF.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 AF:af_1\001 ADDED mtt/lib/xfig/Basic/AFe.fig Index: mtt/lib/xfig/Basic/AFe.fig ================================================================== --- mtt/lib/xfig/Basic/AFe.fig +++ mtt/lib/xfig/Basic/AFe.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 AFe:afe_1\001 ADDED mtt/lib/xfig/Basic/C.fig Index: mtt/lib/xfig/Basic/C.fig ================================================================== --- mtt/lib/xfig/Basic/C.fig +++ mtt/lib/xfig/Basic/C.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 C:c_1\001 ADDED mtt/lib/xfig/Basic/De.fig Index: mtt/lib/xfig/Basic/De.fig ================================================================== --- mtt/lib/xfig/Basic/De.fig +++ mtt/lib/xfig/Basic/De.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 De:de_1\001 ADDED mtt/lib/xfig/Basic/DescriptiveText.fig Index: mtt/lib/xfig/Basic/DescriptiveText.fig ================================================================== --- mtt/lib/xfig/Basic/DescriptiveText.fig +++ mtt/lib/xfig/Basic/DescriptiveText.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 1 101 0 3 20 0.0000 4 255 2025 1395 630 Descriptive text.\001 ADDED mtt/lib/xfig/Basic/Df.fig Index: mtt/lib/xfig/Basic/Df.fig ================================================================== --- mtt/lib/xfig/Basic/Df.fig +++ mtt/lib/xfig/Basic/Df.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 Df:df_1\001 ADDED mtt/lib/xfig/Basic/EMTF.fig Index: mtt/lib/xfig/Basic/EMTF.fig ================================================================== --- mtt/lib/xfig/Basic/EMTF.fig +++ mtt/lib/xfig/Basic/EMTF.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 EMTF:emtf_1\001 ADDED mtt/lib/xfig/Basic/GY.fig Index: mtt/lib/xfig/Basic/GY.fig ================================================================== --- mtt/lib/xfig/Basic/GY.fig +++ mtt/lib/xfig/Basic/GY.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 GY:gy_1\001 ADDED mtt/lib/xfig/Basic/I.fig Index: mtt/lib/xfig/Basic/I.fig ================================================================== --- mtt/lib/xfig/Basic/I.fig +++ mtt/lib/xfig/Basic/I.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 I:i_1\001 ADDED mtt/lib/xfig/Basic/INTF.fig Index: mtt/lib/xfig/Basic/INTF.fig ================================================================== --- mtt/lib/xfig/Basic/INTF.fig +++ mtt/lib/xfig/Basic/INTF.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 INTF:intf_1\001 ADDED mtt/lib/xfig/Basic/InPort.fig Index: mtt/lib/xfig/Basic/InPort.fig ================================================================== --- mtt/lib/xfig/Basic/InPort.fig +++ mtt/lib/xfig/Basic/InPort.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 2 4 100 0 18 18 0.0000 4 270 870 1890 855 SS:[in]\001 ADDED mtt/lib/xfig/Basic/MAKE_COMPONENT Index: mtt/lib/xfig/Basic/MAKE_COMPONENT ================================================================== --- mtt/lib/xfig/Basic/MAKE_COMPONENT +++ mtt/lib/xfig/Basic/MAKE_COMPONENT @@ -0,0 +1,22 @@ +#!/bin/sh +## Makes a new component + +if [ -z "$2" ]; then + label=$1 +else + label=$2 +fi + +case $1 in + 0) + echo Making new component $1 with no label + sed "s/TEXT/$1/" $1.fig + ;; + 1) + echo Making new component $1 with no label + sed "s/TEXT/$1/" $1.fig + ;; + *) + echo Making new component $1 with label $label + sed "s/TEXT/$1:$label/" $1.fig +esac ADDED mtt/lib/xfig/Basic/MAKE_COMPONENTS Index: mtt/lib/xfig/Basic/MAKE_COMPONENTS ================================================================== --- mtt/lib/xfig/Basic/MAKE_COMPONENTS +++ mtt/lib/xfig/Basic/MAKE_COMPONENTS @@ -0,0 +1,28 @@ +#!/bin/sh +## Makes all components + +./MAKE_COMPONENT R r_1 +./MAKE_COMPONENT C c_1 +./MAKE_COMPONENT I i_1 + +./MAKE_COMPONENT 0 +./MAKE_COMPONENT 1 + +./MAKE_COMPONENT SS ss_1 +./MAKE_COMPONENT Se se_1 +./MAKE_COMPONENT Sf sf_1 +./MAKE_COMPONENT De de_1 +./MAKE_COMPONENT Df df_1 + +./MAKE_COMPONENT TF tf_1 +./MAKE_COMPONENT GY gy_1 +./MAKE_COMPONENT AE ae_1 +./MAKE_COMPONENT AEf aef_1 +./MAKE_COMPONENT AF af_1 +./MAKE_COMPONENT AFe afe_1 + + +./MAKE_COMPONENT EMTF emtf_1 +./MAKE_COMPONENT INTF intf_1 + +./MAKE_COMPONENT Subsystem sub_1 ADDED mtt/lib/xfig/Basic/OutPort.fig Index: mtt/lib/xfig/Basic/OutPort.fig ================================================================== --- mtt/lib/xfig/Basic/OutPort.fig +++ mtt/lib/xfig/Basic/OutPort.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 0 4 100 0 18 18 0.0000 4 270 1065 1890 855 SS:[out]\001 ADDED mtt/lib/xfig/Basic/Port.fig Index: mtt/lib/xfig/Basic/Port.fig ================================================================== --- mtt/lib/xfig/Basic/Port.fig +++ mtt/lib/xfig/Basic/Port.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 4 100 0 18 18 0.0000 4 300 1620 1890 855 SS:[port_1]\001 ADDED mtt/lib/xfig/Basic/PortLabel.fig Index: mtt/lib/xfig/Basic/PortLabel.fig ================================================================== --- mtt/lib/xfig/Basic/PortLabel.fig +++ mtt/lib/xfig/Basic/PortLabel.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 4 100 0 18 14 0.0000 4 210 825 855 630 [port_1]\001 ADDED mtt/lib/xfig/Basic/PortLabel.txt Index: mtt/lib/xfig/Basic/PortLabel.txt ================================================================== --- mtt/lib/xfig/Basic/PortLabel.txt +++ mtt/lib/xfig/Basic/PortLabel.txt @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 4 100 0 18 14 0.0000 4 210 825 855 630 [port_1]\001 ADDED mtt/lib/xfig/Basic/R.fig Index: mtt/lib/xfig/Basic/R.fig ================================================================== --- mtt/lib/xfig/Basic/R.fig +++ mtt/lib/xfig/Basic/R.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 R:r_1\001 ADDED mtt/lib/xfig/Basic/SS.fig Index: mtt/lib/xfig/Basic/SS.fig ================================================================== --- mtt/lib/xfig/Basic/SS.fig +++ mtt/lib/xfig/Basic/SS.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 SS:ss_1\001 ADDED mtt/lib/xfig/Basic/Se.fig Index: mtt/lib/xfig/Basic/Se.fig ================================================================== --- mtt/lib/xfig/Basic/Se.fig +++ mtt/lib/xfig/Basic/Se.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 Se:se_1\001 ADDED mtt/lib/xfig/Basic/Sf.fig Index: mtt/lib/xfig/Basic/Sf.fig ================================================================== --- mtt/lib/xfig/Basic/Sf.fig +++ mtt/lib/xfig/Basic/Sf.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 Sf:sf_1\001 ADDED mtt/lib/xfig/Basic/Subsystem.fig Index: mtt/lib/xfig/Basic/Subsystem.fig ================================================================== --- mtt/lib/xfig/Basic/Subsystem.fig +++ mtt/lib/xfig/Basic/Subsystem.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 Subsystem:sub_1\001 ADDED mtt/lib/xfig/Basic/TF.fig Index: mtt/lib/xfig/Basic/TF.fig ================================================================== --- mtt/lib/xfig/Basic/TF.fig +++ mtt/lib/xfig/Basic/TF.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 TF:tf_1\001 ADDED mtt/lib/xfig/Basic/blue-box.fig Index: mtt/lib/xfig/Basic/blue-box.fig ================================================================== --- mtt/lib/xfig/Basic/blue-box.fig +++ mtt/lib/xfig/Basic/blue-box.fig @@ -0,0 +1,11 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 4 1 2 1 7 101 0 -1 6.000 0 0 7 0 0 5 + 3825 2700 450 2700 450 450 3825 450 3825 2700 ADDED mtt/lib/xfig/Basic/bond.fig Index: mtt/lib/xfig/Basic/bond.fig ================================================================== --- mtt/lib/xfig/Basic/bond.fig +++ mtt/lib/xfig/Basic/bond.fig @@ -0,0 +1,11 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 900 675 2250 675 2025 900 ADDED mtt/lib/xfig/Basic/gold-box.fig Index: mtt/lib/xfig/Basic/gold-box.fig ================================================================== --- mtt/lib/xfig/Basic/gold-box.fig +++ mtt/lib/xfig/Basic/gold-box.fig @@ -0,0 +1,11 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 + 3825 2700 450 2700 450 450 3825 450 3825 2700 ADDED mtt/lib/xfig/Basic/halfstroke.fig Index: mtt/lib/xfig/Basic/halfstroke.fig ================================================================== --- mtt/lib/xfig/Basic/halfstroke.fig +++ mtt/lib/xfig/Basic/halfstroke.fig @@ -0,0 +1,11 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1350 1125 1350 1350 ADDED mtt/lib/xfig/Basic/stroke.fig Index: mtt/lib/xfig/Basic/stroke.fig ================================================================== --- mtt/lib/xfig/Basic/stroke.fig +++ mtt/lib/xfig/Basic/stroke.fig @@ -0,0 +1,11 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 675 675 675 1125 ADDED mtt/lib/xfig/Basic/template.txt Index: mtt/lib/xfig/Basic/template.txt ================================================================== --- mtt/lib/xfig/Basic/template.txt +++ mtt/lib/xfig/Basic/template.txt @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 TEXT\001 ADDED mtt/lib/xfig/Thermal/CT.fig Index: mtt/lib/xfig/Thermal/CT.fig ================================================================== --- mtt/lib/xfig/Thermal/CT.fig +++ mtt/lib/xfig/Thermal/CT.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 CT:ct_1\001 ADDED mtt/lib/xfig/Thermal/MAKE_COMPONENT Index: mtt/lib/xfig/Thermal/MAKE_COMPONENT ================================================================== --- mtt/lib/xfig/Thermal/MAKE_COMPONENT +++ mtt/lib/xfig/Thermal/MAKE_COMPONENT @@ -0,0 +1,16 @@ +#!/bin/sh +## Makes a new component + +if [ -z "$2" ]; then + label=$1 +else + label=$2 +fi + +if [ "$1" = "0" ]||[ "$1" = "1" ]; then + echo Making new component $1 with no label + sed "s/TEXT/$1/" $1.fig +else + echo Making new component $1 with label $label + sed "s/TEXT/$1:$label/" $1.fig +fi ADDED mtt/lib/xfig/Thermal/MAKE_COMPONENTS Index: mtt/lib/xfig/Thermal/MAKE_COMPONENTS ================================================================== --- mtt/lib/xfig/Thermal/MAKE_COMPONENTS +++ mtt/lib/xfig/Thermal/MAKE_COMPONENTS @@ -0,0 +1,7 @@ +#!/bin/sh +## Makes all components + +./MAKE_COMPONENT RS rs_1 +./MAKE_COMPONENT RT rt_1 +./MAKE_COMPONENT CT ct_1 + ADDED mtt/lib/xfig/Thermal/RS.fig Index: mtt/lib/xfig/Thermal/RS.fig ================================================================== --- mtt/lib/xfig/Thermal/RS.fig +++ mtt/lib/xfig/Thermal/RS.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 RS:rs_1\001 ADDED mtt/lib/xfig/Thermal/RT.fig Index: mtt/lib/xfig/Thermal/RT.fig ================================================================== --- mtt/lib/xfig/Thermal/RT.fig +++ mtt/lib/xfig/Thermal/RT.fig @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 RT:rt_1\001 ADDED mtt/lib/xfig/Thermal/template.txt Index: mtt/lib/xfig/Thermal/template.txt ================================================================== --- mtt/lib/xfig/Thermal/template.txt +++ mtt/lib/xfig/Thermal/template.txt @@ -0,0 +1,10 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 1 0 100 0 18 18 0.0000 4 285 765 900 765 TEXT\001 ADDED mtt/lib/xfig/libs.txt Index: mtt/lib/xfig/libs.txt ================================================================== --- mtt/lib/xfig/libs.txt +++ mtt/lib/xfig/libs.txt @@ -0,0 +1,4 @@ +/home/peterg/mtt_new/mtt/lib/xfig/Basic Basic +/home/peterg/mtt_new/mtt/lib/comp/compound/Electrical Electrical +/home/peterg/mtt_new/mtt/lib/comp/compound/Thermal Thermal + DELETED mttroot/CVSROOT/checkoutlist Index: mttroot/CVSROOT/checkoutlist ================================================================== --- mttroot/CVSROOT/checkoutlist +++ mttroot/CVSROOT/checkoutlist @@ -1,14 +0,0 @@ -# The "checkoutlist" file is used to support additional version controlled -# administrative files in $CVSROOT/CVSROOT, such as template files. -# -# The first entry on a line is a filename which will be checked out from -# the corresponding RCS file in the $CVSROOT/CVSROOT directory. -# The remainder of the line is an error message to use if the file cannot -# be checked out. -# -# File format: -# -# [] -# -# comment lines begin with '#' -syncmail DELETED mttroot/CVSROOT/commitinfo Index: mttroot/CVSROOT/commitinfo ================================================================== --- mttroot/CVSROOT/commitinfo +++ mttroot/CVSROOT/commitinfo @@ -1,15 +0,0 @@ -# The "commitinfo" file is used to control pre-commit checks. -# The filter on the right is invoked with the repository and a list -# of files to check. A non-zero exit of the filter program will -# cause the commit to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". DELETED mttroot/CVSROOT/config Index: mttroot/CVSROOT/config ================================================================== --- mttroot/CVSROOT/config +++ mttroot/CVSROOT/config @@ -1,11 +0,0 @@ -# Set this to "no" if pserver shouldn't check system users/passwords -#SystemAuth=no - -# Set `PreservePermissions' to `yes' to save file status information -# in the repository. -#PreservePermissions=no - -# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top -# level of the new working directory when using the `cvs checkout' -# command. -#TopLevelAdmin=no DELETED mttroot/CVSROOT/cvswrappers Index: mttroot/CVSROOT/cvswrappers ================================================================== --- mttroot/CVSROOT/cvswrappers +++ mttroot/CVSROOT/cvswrappers @@ -1,23 +0,0 @@ -# This file affects handling of files based on their names. -# -# The -t/-f options allow one to treat directories of files -# as a single file, or to transform a file in other ways on -# its way in and out of CVS. -# -# The -m option specifies whether CVS attempts to merge files. -# -# The -k option specifies keyword expansion (e.g. -kb for binary). -# -# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) -# -# wildcard [option value][option value]... -# -# where option is one of -# -f from cvs filter value: path to filter -# -t to cvs filter value: path to filter -# -m update methodology value: MERGE or COPY -# -k expansion mode value: b, o, kkv, &c -# -# and value is a single-quote delimited value. -# For example: -#*.gif -k 'b' DELETED mttroot/CVSROOT/editinfo Index: mttroot/CVSROOT/editinfo ================================================================== --- mttroot/CVSROOT/editinfo +++ mttroot/CVSROOT/editinfo @@ -1,21 +0,0 @@ -# The "editinfo" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. DELETED mttroot/CVSROOT/loginfo Index: mttroot/CVSROOT/loginfo ================================================================== --- mttroot/CVSROOT/loginfo +++ mttroot/CVSROOT/loginfo @@ -1,31 +0,0 @@ -# The "loginfo" file controls where "cvs commit" log information -# is sent. The first entry on a line is a regular expression which must match -# the directory that the change is being made to, relative to the -# $CVSROOT. If a match is found, then the remainder of the line is a filter -# program that should expect log information on its standard input. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name ALL appears as a regular expression it is always used -# in addition to the first matching regex or DEFAULT. -# -# You may specify a format string as part of the -# filter. The string is composed of a `%' followed -# by a single format character, or followed by a set of format -# characters surrounded by `{' and `}' as separators. The format -# characters are: -# -# s = file name -# V = old version number (pre-checkin) -# v = new version number (post-checkin) -# -# For example: -#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog -# or -#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog - -# Lines to mail changes -CVSROOT $CVSROOT/CVSROOT/syncmail %{sVv} mtt@gawthrop.net -DEFAULT $CVSROOT/CVSROOT/syncmail %{sVv} mtt-cvs@lists.sourceforge.net - DELETED mttroot/CVSROOT/modules Index: mttroot/CVSROOT/modules ================================================================== --- mttroot/CVSROOT/modules +++ mttroot/CVSROOT/modules @@ -1,26 +0,0 @@ -# Three different line formats are valid: -# key -a aliases... -# key [options] directory -# key [options] directory files... -# -# Where "options" are composed of: -# -i prog Run "prog" on "cvs commit" from top-level of module. -# -o prog Run "prog" on "cvs checkout" of module. -# -e prog Run "prog" on "cvs export" of module. -# -t prog Run "prog" on "cvs rtag" of module. -# -u prog Run "prog" on "cvs update" of module. -# -d dir Place module in directory "dir" instead of module name. -# -l Top-level directory only -- do not recurse. -# -# NOTE: If you change any of the "Run" options above, you'll have to -# release and re-checkout any working directories of these modules. -# -# And "directory" is a path to a directory relative to $CVSROOT. -# -# The "-a" option specifies an alias. An alias is interpreted as if -# everything on the right of the "-a" had been typed on the command line. -# -# You can encode a module within a module by using the special '&' -# character to interpose another module into the current module. This -# can be useful for creating a module that consists of many directories -# spread out over the entire source repository. DELETED mttroot/CVSROOT/notify Index: mttroot/CVSROOT/notify ================================================================== --- mttroot/CVSROOT/notify +++ mttroot/CVSROOT/notify @@ -1,12 +0,0 @@ -# The "notify" file controls where notifications from watches set by -# "cvs watch add" or "cvs edit" are sent. The first entry on a line is -# a regular expression which is tested against the directory that the -# change is being made to, relative to the $CVSROOT. If it matches, -# then the remainder of the line is a filter program that should contain -# one occurrence of %s for the user to notify, and information on its -# standard input. -# -# "ALL" or "DEFAULT" can be used in place of the regular expression. -# -# For example: -#ALL mail %s -s "CVS notification" DELETED mttroot/CVSROOT/rcsinfo Index: mttroot/CVSROOT/rcsinfo ================================================================== --- mttroot/CVSROOT/rcsinfo +++ mttroot/CVSROOT/rcsinfo @@ -1,13 +0,0 @@ -# The "rcsinfo" file is used to control templates with which the editor -# is invoked on commit and import. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being made to, relative to the -# $CVSROOT. For the first match that is found, then the remainder of the -# line is the name of the file that contains the template. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". DELETED mttroot/CVSROOT/syncmail Index: mttroot/CVSROOT/syncmail ================================================================== --- mttroot/CVSROOT/syncmail +++ mttroot/CVSROOT/syncmail @@ -1,459 +0,0 @@ -#! /usr/bin/python - -# Copyright (c) 2002, 2003, Barry Warsaw, Fred Drake, and contributors -# All rights reserved. -# See the accompanying LICENSE file for details. - -# Compatibility: Python 2.2.3, tied to the version of Python on SourceForge's -# authenticated CVS server. - -"""Complicated notification for CVS checkins. - -This script is used to provide email notifications of changes to the CVS -repository. These email changes will include context diffs of the changes. -Really big diffs will be trimmed. - -This script is run from a CVS loginfo file (see $CVSROOT/CVSROOT/loginfo). To -set this up, create a loginfo entry that looks something like this: - - mymodule /path/to/this/script %%s some-email-addr@your.domain - -In this example, whenever a checkin that matches `mymodule' is made, this -script is invoked, which will generate the diff containing email, and send it -to some-email-addr@your.domain. - - Note: This module used to also do repository synchronizations via - rsync-over-ssh, but since the repository has been moved to SourceForge, - this is no longer necessary. The syncing functionality has been ripped - out in the 3.0, which simplifies it considerably. Access the 2.x versions - to refer to this functionality. Because of this, the script is misnamed. - -It no longer makes sense to run this script from the command line. Doing so -will only print out this usage information. - -Usage: - - %(PROGRAM)s [options] <%%S> email-addr [email-addr ...] - -Where options are: - - --cvsroot= - Use as the environment variable CVSROOT. Otherwise this - variable must exist in the environment. - - --context=# - -C # - Include # lines of context around lines that differ (default: 2). - - -c - Produce a context diff (default). - - -m hostname - --mailhost hostname - The hostname of an available SMTP server. The default is - 'localhost'. - - -u - Produce a unified diff (smaller). - - -S TEXT - --subject-prefix=TEXT - Prepend TEXT to the email subject line. - - -R ADDR - --reply-to=ADDR - Add a "Reply-To: ADDR" header to the email message. - - --quiet / -q - Don't print as much status to stdout. - - --fromhost=hostname - -f hostname - The hostname that email messages appear to be coming from. The From: - header of the outgoing message will look like user@hostname. By - default, hostname is the machine's fully qualified domain name. - - --help / -h - Print this text. - -The rest of the command line arguments are: - - <%%S> - CVS %%s loginfo expansion. When invoked by CVS, this will be a single - string containing the directory the checkin is being made in, relative - to $CVSROOT, followed by the list of files that are changing. If the - %%s in the loginfo file is %%{sVv}, context diffs for each of the - modified files are included in any email messages that are generated. - - email-addrs - At least one email address. -""" -__version__ = '1.2' - -import os -import sys -import re -import time -import string -import getopt -import smtplib -import pwd -import socket - -try: - from socket import getfqdn -except ImportError: - def getfqdn(): - # Python 1.5.2 :( - hostname = socket.gethostname() - byaddr = socket.gethostbyaddr(socket.gethostbyname(hostname)) - aliases = byaddr[1] - aliases.insert(0, byaddr[0]) - aliases.insert(0, hostname) - for fqdn in aliases: - if '.' in fqdn: - break - else: - fqdn = 'localhost.localdomain' - return fqdn - - -from cStringIO import StringIO - -# Which SMTP server to do we connect to? -MAILHOST = 'localhost' -MAILPORT = 25 - -# Diff trimming stuff -DIFF_HEAD_LINES = 20 -DIFF_TAIL_LINES = 20 -DIFF_TRUNCATE_IF_LARGER = 1000 - -COMMASPACE = ', ' - -PROGRAM = sys.argv[0] - -BINARY_EXPLANATION_LINES = [ - "(This appears to be a binary file; contents omitted.)\n" - ] - -NOVERSION = "Couldn't generate diff; no version number found for file: %s" -BACKSLASH = "Couldn't generate diff: backslash in filespec's filename: %s" - - - -def usage(code, msg=''): - print __doc__ % globals() - if msg: - print msg - sys.exit(code) - - - -def calculate_diff(entry, contextlines): - file = entry.name - oldrev = entry.revision - newrev = entry.new_revision - - # Make sure we can find a CVS version number - if oldrev is None and newrev is None: - return NOVERSION % file - - if string.find(file, "'") <> -1: - # Those crazy users put single-quotes in their file names! Now we - # have to escape everything that is meaningful inside double-quotes. - filestr = string.replace(file, '\\', '\\\\') - filestr = string.replace(filestr, '`', '\`') - filestr = string.replace(filestr, '"', '\"') - filestr = string.replace(filestr, '$', '\$') - # and quote it with double-quotes. - filestr = '"' + filestr + '"' - else: - # quote it with single-quotes. - filestr = "'" + file + "'" - if oldrev is None: - # File is being added. - try: - if os.path.exists(file): - fp = open(file) - else: - update_cmd = "cvs -fn update -r %s -p %s" % (newrev, filestr) - fp = os.popen(update_cmd) - lines = fp.readlines() - fp.close() - # Is this a binary file? Let's look at the first few - # lines to figure it out: - for line in lines[:5]: - for c in string.rstrip(line): - if c in string.whitespace: - continue - if c < ' ' or c > chr(127): - lines = BINARY_EXPLANATION_LINES[:] - break - lines.insert(0, '--- NEW FILE: %s ---\n' % file) - except IOError, e: - lines = ['***** Error reading new file: ', - str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] - elif newrev is None: - lines = ['--- %s DELETED ---\n' % file] - else: - # File has been changed. - # This /has/ to happen in the background, otherwise we'll run into CVS - # lock contention. What a crock. - if contextlines > 0: - difftype = "-C " + str(contextlines) - else: - difftype = "-u" - diffcmd = "/usr/bin/cvs -f diff -kk %s --minimal -r %s -r %s %s" \ - % (difftype, oldrev, newrev, filestr) - fp = os.popen(diffcmd) - lines = fp.readlines() - # ignore the error code, it always seems to be 1 :( - fp.close() - if len(lines) > DIFF_TRUNCATE_IF_LARGER: - removedlines = len(lines) - DIFF_HEAD_LINES - DIFF_TAIL_LINES - del lines[DIFF_HEAD_LINES:-DIFF_TAIL_LINES] - lines.insert(DIFF_HEAD_LINES, - '[...%d lines suppressed...]\n' % removedlines) - return string.join(lines, '') - - - -rfc822_specials_re = re.compile(r'[\(\)\<\>\@\,\;\:\\\"\.\[\]]') - -def quotename(name): - if name and rfc822_specials_re.search(name): - return '"%s"' % string.replace(name, '"', '\\"') - else: - return name - - - -def blast_mail(subject, people, entries, contextlines, fromhost, replyto): - # cannot wait for child process or that will cause parent to retain cvs - # lock for too long. Urg! - if not os.fork(): - # in the child - # give up the lock you cvs thang! - time.sleep(2) - # Create the smtp connection to the localhost - conn = smtplib.SMTP() - conn.connect(MAILHOST, MAILPORT) - user = pwd.getpwuid(os.getuid())[0] - name = string.split(pwd.getpwuid(os.getuid())[4], ',')[0] - domain = fromhost or getfqdn() - address = '%s@%s' % (user, domain) - s = StringIO() - sys.stdout = s - datestamp = time.strftime('%a, %d %b %Y %H:%M:%S +0000', - time.gmtime(time.time())) - try: - vars = {'address' : address, - 'name' : quotename(name), - 'people' : string.join(people, COMMASPACE), - 'subject' : subject, - 'version' : __version__, - 'date' : datestamp, - } - print '''\ -From: %(name)s <%(address)s> -To: %(people)s''' % vars - if replyto: - print 'Reply-To: %s' % replyto - print '''\ -Subject: %(subject)s -Date: %(date)s -X-Mailer: Python syncmail %(version)s -''' % vars - s.write(sys.stdin.read()) - # append the diffs if available - print - for entry in entries: - print calculate_diff(entry, contextlines) - finally: - sys.stdout = sys.__stdout__ - resp = conn.sendmail(address, people, s.getvalue()) - conn.close() - os._exit(0) - - - -class CVSEntry: - def __init__(self, name, revision, timestamp, conflict, options, tagdate): - self.name = name - self.revision = revision - self.timestamp = timestamp - self.conflict = conflict - self.options = options - self.tagdate = tagdate - -def get_entry(prefix, mapping, line, filename): - line = string.strip(line) - parts = string.split(line, "/") - _, name, revision, timestamp, options, tagdate = parts - key = namekey(prefix, name) - try: - entry = mapping[key] - except KeyError: - if revision == "0": - revision = None - if string.find(timestamp, "+") != -1: - timestamp, conflict = tuple(string.split(timestamp, "+")) - else: - conflict = None - entry = CVSEntry(key, revision, timestamp, conflict, - options, tagdate) - mapping[key] = entry - return entry - -def namekey(prefix, name): - if prefix: - return os.path.join(prefix, name) - else: - return name - -def load_change_info(prefix=None): - if prefix is not None: - entries_fn = os.path.join(prefix, "CVS", "Entries") - else: - entries_fn = os.path.join("CVS", "Entries") - entries_log_fn = entries_fn + ".Log" - mapping = {} - f = open(entries_fn) - while 1: - line = f.readline() - if not line: - break -## if string.strip(line) == "D": -## continue - # we could recurse down subdirs, except the Entries.Log files - # we need haven't been written to the subdirs yet, so it - # doesn't do us any good -## if line[0] == "D": -## name = string.split(line, "/")[1] -## dirname = namekey(prefix, name) -## if os.path.isdir(dirname): -## m = load_change_info(dirname) -## mapping.update(m) - if line[0] == "/": - # normal file - get_entry(prefix, mapping, line, entries_fn) - # else: bogus Entries line - f.close() - if os.path.isfile(entries_log_fn): - f = open(entries_log_fn) - while 1: - line = f.readline() - if not line: - break - if line[1:2] != ' ': - # really old version of CVS - break - entry = get_entry(prefix, mapping, line[2:], entries_log_fn) - parts = string.split(line, "/")[1:] - if line[0] == "A": - # adding a file - entry.new_revision = parts[1] - elif line[0] == "R": - # removing a file - entry.new_revision = None - f.close() - for entry in mapping.values(): - if not hasattr(entry, "new_revision"): - print 'confused about file', entry.name, '-- ignoring' - del mapping[entry.name] - return mapping - -def load_branch_name(): - tag_fn = os.path.join("CVS", "Tag") - if os.path.isfile(tag_fn): - f = open(tag_fn) - line = string.strip(f.readline()) - f.close() - if line[:1] == "T": - return line[1:] - return None - -# scan args for options -def main(): - # XXX Should really move all the options to an object, just to - # avoid threading so many positional args through everything. - try: - opts, args = getopt.getopt( - sys.argv[1:], 'hC:cuS:R:qf:m:', - ['fromhost=', 'context=', 'cvsroot=', 'mailhost=', - 'subject-prefix=', 'reply-to=', - 'help', 'quiet']) - except getopt.error, msg: - usage(1, msg) - - # parse the options - contextlines = 2 - verbose = 1 - subject_prefix = "" - replyto = None - fromhost = None - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - elif opt == '--cvsroot': - os.environ['CVSROOT'] = arg - elif opt in ('-C', '--context'): - contextlines = int(arg) - elif opt == '-c': - if contextlines <= 0: - contextlines = 2 - elif opt == '-u': - contextlines = 0 - elif opt in ('-S', '--subject-prefix'): - subject_prefix = arg - elif opt in ('-R', '--reply-to'): - replyto = arg - elif opt in ('-q', '--quiet'): - verbose = 0 - elif opt in ('-f', '--fromhost'): - fromhost = arg - elif opt in ('-m', '--mailhost'): - global MAILHOST - MAILHOST = arg - - # What follows is the specification containing the files that were - # modified. The argument actually must be split, with the first component - # containing the directory the checkin is being made in, relative to - # $CVSROOT, followed by the list of files that are changing. - if not args: - usage(1, 'No CVS module specified') - changes = load_change_info() - branch = load_branch_name() - subject = subject_prefix + args[0] - specs = string.split(args[0]) - del args[0] - - # The remaining args should be the email addresses - if not args: - usage(1, 'No recipients specified') - - # Now do the mail command - people = args - - if specs[-3:] == ['-', 'Imported', 'sources']: - print 'Not sending email for imported sources.' - return - - if verbose: -## print 'Python version', sys.version -## os.system("type python1.6; type python2;" -## " type python2.0; type python2.1; type python2.2;" -## " type rcsdiff; type rlog") - print 'Mailing %s...' % string.join(people, COMMASPACE) - print 'Generating notification message...' - blast_mail(subject, people, changes.values(), - contextlines, fromhost, replyto) - if verbose: - print 'Generating notification message... done.' - - - -if __name__ == '__main__': - main() - sys.exit(0) DELETED mttroot/CVSROOT/taginfo Index: mttroot/CVSROOT/taginfo ================================================================== --- mttroot/CVSROOT/taginfo +++ mttroot/CVSROOT/taginfo @@ -1,20 +0,0 @@ -# The "taginfo" file is used to control pre-tag checks. -# The filter on the right is invoked with the following arguments: -# -# $1 -- tagname -# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d -# $3 -- repository -# $4-> file revision [file revision ...] -# -# A non-zero exit of the filter program will cause the tag to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". DELETED mttroot/CVSROOT/verifymsg Index: mttroot/CVSROOT/verifymsg ================================================================== --- mttroot/CVSROOT/verifymsg +++ mttroot/CVSROOT/verifymsg @@ -1,21 +0,0 @@ -# The "verifymsg" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. DELETED mttroot/gino/AUTHORS Index: mttroot/gino/AUTHORS ================================================================== --- mttroot/gino/AUTHORS +++ mttroot/gino/AUTHORS @@ -1,1 +0,0 @@ -Peter J. Gawthrop (peter@gawthrop.net) DELETED mttroot/gino/COPYING Index: mttroot/gino/COPYING ================================================================== --- mttroot/gino/COPYING +++ mttroot/gino/COPYING @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. DELETED mttroot/gino/INSTALL Index: mttroot/gino/INSTALL ================================================================== --- mttroot/gino/INSTALL +++ mttroot/gino/INSTALL @@ -1,16 +0,0 @@ -======================================================================= -Prerequisites - -Octave and ginsh must be installed before installing gino - - -======================================================================= -Simple system installation - -$ tar xzf gino-.tar.gz -$ cd gino- -$ make clean -$ make - -As superuser -# make install DELETED mttroot/gino/Makefile Index: mttroot/gino/Makefile ================================================================== --- mttroot/gino/Makefile +++ mttroot/gino/Makefile @@ -1,15 +0,0 @@ -## Makefile for gino library - -all: g_funs - -g_funs: - ./create_gino.sh - -clean: - rm -rf g_funs - -install: g_funs - cp -rf ../gino /usr/share/octave/site/m - - - DELETED mttroot/gino/README Index: mttroot/gino/README ================================================================== --- mttroot/gino/README +++ mttroot/gino/README @@ -1,23 +0,0 @@ -Gino is a symbolic toolbox for octave (www.octave.org) using ginsh - -the shell interface to ginac (www.ginac.de). - -ginsh.m provides a low-level octave interface to ginsh. All of the -ginsh functions are implemented by octave functions of the form -g_fun(arglist). - -All in and out arguments of the toolbox functions are octave strings -containing valid ginsh expressions. Where appropriate, these can be -turned into matlab scalars, matrices and lists using octave's eval -function. Spurious output is avoided by setting -default_eval_print_flag=0. - -This provides a clear division between symbolic expressions (always -contained in strings) and octave expressions. It also allows the -powerful octave string machinery to be used to manipulate symbolic -expressions. - -gino_examples.m contains some introductory examples. - -P.J.Gawthrop. 19th December 2002. - - DELETED mttroot/gino/create_gino.sh Index: mttroot/gino/create_gino.sh ================================================================== --- mttroot/gino/create_gino.sh +++ mttroot/gino/create_gino.sh @@ -1,73 +0,0 @@ -#! /bin/sh -## Creates gino functions by querying ginsh -# Copyright (C) 2002 by Peter J. Gawthrop - -prefix="g_" # Prefix function names by this -subdir=${prefix}funs # Where the generated functions live -ginsh="/usr/bin/ginsh" # Location of ginsh - -create_fun() { - funname=${prefix}$1 - filename=${funname}.m - - ## Creates an octave function - echo Creating ${subdir}/${filename} - - ## Find usage string - - usage=`echo "?$1" | ginsh | head -1` - - ## The octave function - cat< ${subdir}/${filename} -function res = ${funname} (arg1,arg2,arg3) - - ## usage: res = ${prefix}${usage} - - ## Generated by create_gino.sh on `date` - ## DO NOT EDIT ME - - if nargin<1 - arg1 = ""; - endif - - if nargin<2 - arg2 = ""; - endif - - if nargin<3 - arg3 = ""; - endif - - res = gino("$1", arg1, arg2, arg3); - -endfunction -EOF -} - -create_readme() { - cat > ${subdir}/README <0) # Strip trailing NL - go_out = substr(go_out,1,length(go_out)-1); - endif -endfunction DELETED mttroot/gino/go_append.m Index: mttroot/gino/go_append.m ================================================================== --- mttroot/gino/go_append.m +++ mttroot/gino/go_append.m @@ -1,18 +0,0 @@ -function new_list = go_append (list,element) - - ## usage: new_list = go_append (list,element) - ## - ## Appends element to list to give new list - ## This is missing from ginsh - ## Copyright (C) 2002 by Peter J. Gawthrop - - new_list = deblank(list); # Remove trailing blanks - new_list = new_list(1:length(new_list)-1); # Zap final } - if (g_nops(list)=="0") - new_list = sprintf("%s%s}", new_list, element); - else - new_list = sprintf("%s,%s}", new_list, element); - endif - - -endfunction DELETED mttroot/gino/go_diff.m Index: mttroot/gino/go_diff.m ================================================================== --- mttroot/gino/go_diff.m +++ mttroot/gino/go_diff.m @@ -1,26 +0,0 @@ -function [dfdx_l, dfdx_m] = go_diff (f,x) - - ## usage: [dfdx_l dfdx_m] = go_diff (f,x) - ## - ## dfdx_l is a list with ith element df/dx - ## dfdx_m the corresponing matrix (in ginsh form) - ## f may itself be a list - ## The elements of x must be symbols - - N = eval(g_nops(f)); - M = eval(g_nops(x)); - - dfdx = "{}"; - - ## Find derivatives of f for each x_i and append to list - for j = 1:M - dfdx = go_append(dfdx, g_diff(f,g_op(x,int2str(j-1)))); - endfor - - ## Convert to matrix and transpose - dfdx_m = g_transpose(go_lst_to_matrix(dfdx)); - - ## And back to a list - dfdx_l = go_matrix_to_lst(dfdx_m); - -endfunction DELETED mttroot/gino/go_gmatrix2mmatrix.m Index: mttroot/gino/go_gmatrix2mmatrix.m ================================================================== --- mttroot/gino/go_gmatrix2mmatrix.m +++ mttroot/gino/go_gmatrix2mmatrix.m @@ -1,9 +0,0 @@ -function M_m = go_gmatrix2mmatrix (M-g) - - ## usage: M_m = go_gmatrix2mmatrix (M-g) - ## - ## Converts a ginsh format matrix to a matlab format matrix - - M_m = strrep(M_g,"],[","];["); - -endfunction DELETED mttroot/gino/go_lin.m Index: mttroot/gino/go_lin.m ================================================================== --- mttroot/gino/go_lin.m +++ mttroot/gino/go_lin.m @@ -1,30 +0,0 @@ -function [A,B,C,D] = go_lin (f,g) - - ## usage: [A,B,C,D] = go_lin (f,g) - ## - ## - - n_x = eval(g_nops(f)); # Number of states - n_y = eval(g_nops(g)); # Number of outputs - - n_u = n_y; - - ## Create symbolic state list - x = "{}"; - for i=1:n_x - x = go_append(x,sprintf("x_%i", i)); - endfor - - - ## Create symbolic input list - u = "{}"; - for i=1:n_u - u = go_append(u,sprintf("u_%i", i)); - endfor - - [A_l,A] = go_diff(f,x); - [B_l,B] = go_diff(f,u); - [C_l,C] = go_diff(g,x); - [D_l,D] = go_diff(g,u); - -endfunction DELETED mttroot/gino/go_list.m Index: mttroot/gino/go_list.m ================================================================== --- mttroot/gino/go_list.m +++ mttroot/gino/go_list.m @@ -1,23 +0,0 @@ -function list = go_list (exp0,exp1,exp2,exp3,exp4,exp5,exp6,exp7,exp8,exp9) - - ## usage: list = go_list - ## (exp0[,exp1,exp2,exp3,exp4,exp5,exp6,exp7,exp8,exp9]) - ## Creates a list containing the expressions in the argument list - ## - - ## Copyright (C) 2002 by Peter J. Gawthrop - if nargin>10 - error("Only 10 expressions allowed in argument list"); - endif - - N = nargin; - - list=exp0; - for i=1:N-1 - exp = eval(sprintf("exp%i;",i)); - list=sprintf("%s, %s", list, exp); - endfor - - list = sprintf("{%s}", list); - -endfunction DELETED mttroot/gino/go_lst_to_matrix.m Index: mttroot/gino/go_lst_to_matrix.m ================================================================== --- mttroot/gino/go_lst_to_matrix.m +++ mttroot/gino/go_lst_to_matrix.m @@ -1,41 +0,0 @@ -function M = go_lst_to_matrix (L) - - ## usage: M = go_lst_to_matrix (L) - ## - ## Converts a list to a matrix - ## Assumes list contains equal-length lists as elements - ## Not in ginsh - ## Copyright (C) 2002 by Peter J. Gawthrop - - n = eval(g_nops(L)); - m = eval(g_nops(g_op(L,"0"))); - - M = ""; - for i = 1:n - M = sprintf("%s[",M); - m_i = g_op(L,int2str(i-1)); - if (eval(g_nops(m_i))!=m) - error("All list elements must be lists of same length"); - endif - - for j = 1:m - m_ij = g_op(m_i,int2str(j-1)); - if j>1 - jsep = ", "; - else - jsep = ""; - endif - M = sprintf("%s%s%s", M, jsep, m_ij); - endfor - if i $(CONFDIR)/mtt.conf - @install mtt.sh $(PROGDIR)/mtt - @install xmtt.sh $(PROGDIR)/xmtt - -install-cc: build-cc clean-cc.sh - @install -d $(INSTDIR)/bin/trans - @install cc/parse_m2cc.exe $(INSTDIR)/bin/trans - -install-doc: build-doc clean-doc.sh - @install -d $(DOCDIR) $(INFODIR) - @cd doc ; DOCPATH=$(DOCDIR) INFOPATH=$(INFODIR) make -s install-doc - @cd doc ; install Makefile mtt.info* mtt.pdf mtt.ps.gz $(DOCDIR) - @install doc/mtt.info* $(INFODIR) - -install-xfig: clean-xfig.sh - @install -d $(XFIGDIR) - @cp -a lib/xfig $(XFIGDIR)/MTT_Bond_Graph - -.PHONY: FORCE - -clean.sh: FORCE - @echo '#! /bin/sh' >>clean.sh - @echo '# This file is auto-generated - do not edit' >>clean.sh - @echo 'rm -f $(PROGDIR)/mtt $(PROGDIR)/xmtt' >>clean.sh - @echo 'rm -fr $(INSTDIR)' >>clean.sh - -clean-cc.sh: FORCE - @echo '#! /bin/sh' >>clean-cc.sh - @echo '# This file is auto-generated - do not edit' >>clean-cc.sh - @echo 'rm -f $(INSTDIR)/bin/trans/parse_m2cc.exe' >>clean-cc.sh - -clean-conf.sh: FORCE - @echo '#! /bin/sh' >>clean-conf.sh - @echo '# This file is auto-generated - do not edit' >>clean-conf.sh - @echo 'rm -f $(CONFDIR)/mtt.conf' >>clean-conf.sh - -clean-doc.sh: FORCE - @echo '#! /bin/sh' >>clean-doc.sh - @echo '# This file is auto-generated - do not edit' >>clean-doc.sh - @echo 'rm -fr $(DOCDIR)' >>clean-doc.sh - @echo 'rm -f $(INFODIR)/mtt.info*' >>clean-doc.sh - -clean-xfig.sh: FORCE - @echo '#! /bin/sh' >>clean-xfig.sh - @echo '# This file is auto-generated - do not edit' >>clean-xfig.sh - @echo 'rm -f $(XFIGDIR)/MTT_Bond_Graph' >>clean-xfig.sh - -mtt.sh.tmp: - @echo '#! /bin/sh' > mtt.sh.tmp - @echo '# This file is auto-generated - do not edit' >>mtt.sh.tmp - @echo '' >>mtt.sh.tmp - @echo 'mtt_config_file=$(CONFDIR)/mtt.conf' >>mtt.sh.tmp - @echo 'mtt_program_dir=$(PROGDIR)' >>mtt.sh.tmp - @echo 'mtt_install_dir=$(INSTDIR)' >>mtt.sh.tmp - @echo '' >>mtt.sh.tmp - @echo '# get site-specific settings' >>mtt.sh.tmp - @echo 'if [ -r $${mtt_config_file} ]; then' >>mtt.sh.tmp - @echo ' . $${mtt_config_file} $${mtt_install_dir} >/dev/null' >>mtt.sh.tmp - @echo '' >>mtt.sh.tmp - @echo 'elif [ -r $${mtt_install_dir}/bin/mttrc ]; then' >>mtt.sh.tmp - @echo ' . $${mtt_install_dir}/bin/mttrc $${mtt_install_dir}' >>mtt.sh.tmp - @echo 'fi' >>mtt.sh.tmp - @echo '' >>mtt.sh.tmp - @echo '# get user-specific settings' >>mtt.sh.tmp - @echo 'if [ -r $${HOME}/.mttrc ]; then' >>mtt.sh.tmp - @echo ' . $${HOME}/.mttrc' >>mtt.sh.tmp - @echo 'fi' >>mtt.sh.tmp - @echo '' >>mtt.sh.tmp - @echo '# get directory-specific settings' >>mtt.sh.tmp - @echo 'if [ -r ./.mttrc ]; then' >>mtt.sh.tmp - @echo ' . ./.mttrc' >>mtt.sh.tmp - @echo 'fi' >>mtt.sh.tmp - @echo '' >>mtt.sh.tmp - -mtt.sh: mtt.sh.tmp - @cat mtt.sh.tmp bin/mtt > mtt.sh - -xmtt.sh: mtt.sh.tmp - @cat mtt.sh.tmp bin/xmtt > xmtt.sh DELETED mttroot/mtt/bin/capitalise_initial Index: mttroot/mtt/bin/capitalise_initial ================================================================== --- mttroot/mtt/bin/capitalise_initial +++ mttroot/mtt/bin/capitalise_initial @@ -1,6 +0,0 @@ -#! /bin/sh - -phrase="$*" -initial=$(echo $phrase | sed 's/\(.\).*/\1/') -Initial=$(echo $initial | tr [a-z] [A-Z]) -echo $phrase | sed s/$initial/$Initial/ DELETED mttroot/mtt/bin/check_integration Index: mttroot/mtt/bin/check_integration ================================================================== --- mttroot/mtt/bin/check_integration +++ mttroot/mtt/bin/check_integration @@ -1,17 +0,0 @@ -#!/bin/sh - -## Check if obsolete method of specifiying integration method in use. -if [ -f "$1_simpar.txt" ]; then - method_line=`grep -i METHOD $1_simpar.txt` - if [ -n "`echo $method_line | grep -i euler`" ]; then - echo "$1_simpar.txt contains Euler method - please use mtt -i euler in future" - mtt_switches="$mtt_switches -i euler"; - elif [ -n "`echo $method_line | grep -i implicit`" ]; then - echo "$1_simpar.txt contains Implicit method - please use mtt -i implicit in future" - mtt_switches="$mtt_switches -i implicit"; - fi -fi - -echo Invoking mtt $mtt_switches $1 $2 $3 $4 - -mtt $mtt_switches $1 $2 $3 $4 DELETED mttroot/mtt/bin/mtt Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -1,4095 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt -# This is the main shell script for MTT - -# P.J.Gawthrop Oct 1989, Dec 1989, 1990, 1991, Oct 1993, Dec 1993, Jan 1994, Dec 95, Nov 1996. -# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997,1998,1999 -# Copyright (C) 2000 by Peter J. Gawthrop -# Copyright (C) 2001 by Peter J. Gawthrop - - -############################################################### -## Version control history -############################################################### -## $Header$ -## $Log$ -## Revision 1.419 2014/04/18 02:02:08 gawthrop -## Added sum.tex representation -- this was in a very old MTT and -## summerises the structure. -## -## Revision 1.418 2013/07/19 05:40:26 gawthrop -## Added -nas (No alphabetic sort) switch in help options -## -## Revision 1.417 2008/07/22 17:37:01 geraint -## Fixed case of MTT_EXAMPLES -## -## Revision 1.416 2006/09/27 13:03:20 geraint -## Fixed fr.view and enabled commands to directly build ??fr.m -## -## Revision 1.415 2006/02/09 23:58:24 geraint -## rtxi: builds but does not yet work. -## -## Revision 1.414 2005/11/18 17:23:19 geraint -## rtxi. -## -## Revision 1.413 2005/11/16 00:43:15 geraint -## rtxi -## -## Revision 1.412 2005/09/29 13:46:25 gawthrop -## Converts labg.fig -> ps/eps correctly (using fig2ps) -## -## Revision 1.411 2005/03/15 15:03:28 gawthrop -## Now works for Hierarchical systems -## -## Revision 1.410 2005/03/15 13:35:50 gawthrop -## Pretty abg figure in reports. -## -## Revision 1.409 2005/03/15 12:03:17 gawthrop -## New labg.fig rep - pretty LaTeX figures. -## -## Revision 1.408 2005/02/18 16:59:02 gawthrop -## Don't check files when using -s -## -## Revision 1.407 2005/02/17 18:36:38 geraint -## Removed a bash-ism: replaced [[ conditional ]] with [ conditional ] -## -## Revision 1.406 2005/01/06 15:36:06 geraint -## Tidied output of options. -## -## Revision 1.405 2005/01/06 12:47:53 geraint -## Fixed generation of sese.r with -make-sort option. -## -## Revision 1.404 2004/09/10 21:05:15 geraint -## Ensure that the system exists before proceeding. -## This should stop me from copying my home directory to MTT_work. -## -## Revision 1.403 2004/09/07 20:38:44 geraint -## Applies CRs before creating sese.make to avoid Circular dependencies. -## -## Revision 1.402 2004/09/03 08:35:27 geraint -## Copies Perl CRs to an mtt subdirectory (=> mtt:: workspace). -## -## Revision 1.401 2004/09/02 22:04:06 geraint -## Passes ${use_reduce} to mtt_make_sympar so that it can decide -## if to issue warnings about Reduce reserved words -## -## Revision 1.400 2004/08/31 01:29:48 geraint -## CRs are applied to sorted equation files during production. -## -## Revision 1.399 2004/08/29 16:09:49 geraint -## Added option -no-reduce -## -## Code sorting can now be used with Reduce (via sese.r) so that existing CRs -## work with sorted code (using -make-sort or -sort), or without by using -## -no-reduce; this option implies -make-sort. -## -## Revision 1.398 2004/08/29 14:39:23 geraint -## Added rule to create dae from sorted equations (sese) if sorting is requested. -## -## Revision 1.397 2004/08/29 13:17:30 geraint -## Added rules to use sae (sorted algebraic equations) instead -## of ae if sorted equations are being used. -## -## Converted temporary variable names to lowercase in sorted -## sympar.h to match code output from mtt_r2m. -## -## Revision 1.396 2004/08/29 02:59:30 geraint -## Added -make-sort option and rules to generate simulation using sesx and sesy. -## -## Revision 1.395 2004/08/28 23:48:06 geraint -## Removed dependency of ae.r on cse.r if -ae is not specified as an option. -## This prevents an implicit -A and thus removes a dependency on cse -## (and hence Reduce) for sorted systems. -## -## Revision 1.394 2004/08/28 22:14:12 geraint -## Removed -ibg option: now the default method. -## -## Revision 1.393 2004/08/26 16:20:17 geraint -## Creates postscript files of either dia or fig bond graphs. -## -## Revision 1.392 2004/08/26 12:50:12 geraint -## Replaced some implicit rules with explicit tests and patterns. -## Better than having make search through every possible implicit rule. -## -## Revision 1.391 2004/08/26 00:07:06 geraint -## Added rule to create cbg.dia. -## -## Revision 1.390 2004/08/13 09:49:13 geraint -## Only use one level of MTT_work to prevent MTT from repeatedly copying or creating the same files. -## -## Revision 1.389 2004/08/13 01:32:03 geraint -## Use ibg.m by default for both Xfig and Dia models. -## -## Revision 1.388 2004/08/11 08:18:07 geraint -## Ignores diy make files if the file ${rep}_rep.make.ignore exists, thus allowing user-defined makefiles to use the default MTT rules for languages which they do not override. See odes_rep.make and odeso_rep.make for an example of its use. -## -## Revision 1.387 2004/08/11 07:44:18 geraint -## Included cmp.m as a prerequisite for abg.m -## -## Revision 1.386 2004/08/05 00:02:57 geraint -## Uses lbl2cmp_txt2m.pl to generate _cmp.m. -## -## Revision 1.385 2004/08/02 20:25:47 geraint -## abg.m requires lbl.txt to allow units to be checked. -## -## Revision 1.384 2004/08/01 20:13:30 geraint -## ibg2abg transformation does not require lbl.txt (directly) -## -## Revision 1.383 2004/08/01 19:50:07 geraint -## Moved rules for ibg.m and abg.m so that -ibg can be used with dia models. -## Need to create cmp.m files before this combination will work. -## -## Revision 1.382 2003/09/23 20:53:49 geraint -## Updated version number (5.0). -## -## Revision 1.381 2003/08/10 18:56:55 gawthrop -## Explicitly generate eps files -## -## Revision 1.380 2003/08/06 14:44:51 gawthrop -## Don't include -q or -u in long file names via ${__ARGS} -## -## Revision 1.379 2003/08/06 10:33:42 gawthrop -## User now warned not to use -c which is unsupported. -## -## Revision 1.378 2003/08/04 09:15:09 gawthrop -## -ss switch reinstated -## -## Revision 1.377 2003/06/11 15:48:02 gawthrop -## Copies (aliased) subsystems first. -## Include switches in .ps file names. -## -## Revision 1.376 2003/05/09 09:46:35 gawthrop -## Fixed html output of figures -## -## Revision 1.375 2003/05/08 18:42:52 gawthrop -## Generate pdf from ps (using hyperref package for links etc) -## -## Revision 1.374 2003/04/17 20:57:27 geraint -## Added -sort option to allow direct generation of ode2odes.m using sese.m -## instead of ode/csex. -## -## "mtt -sort rc odeso view" works without Reduce installed!!! -## -## Revision 1.373 2003/04/17 20:07:32 geraint -## Added rule to create _sese.m -## -## Revision 1.372 2003/03/24 12:03:36 gawthrop -## Added -I switch to sese transformation -## -## Revision 1.371 2003/03/13 15:47:35 gawthrop -## Added sese rep. -## -## Revision 1.370 2003/02/11 20:04:08 geraint -## Reverted to line-by-line optimisation as default and added caution to -## description of -optg. -## -## Global optimisation has been observed to create assignments using -## uninitialised temporary variables. -## -## Revision 1.369 2003/02/06 20:28:40 geraint -## Added -ibg switch to aid testing during development of ibg2abg.m -## -## Revision 1.368 2002/12/12 17:18:41 geraint -## Fixed [ 647664 ] Namespace clash: LANG -## Prepended MTT_ to SYS, OPTS and LANG environment variables. -## -## Revision 1.367 2002/12/09 00:14:08 geraint -## Hierarchical dia and mixed dia/fig bond graphs now working. -## -## Revision 1.366 2002/12/06 21:56:21 geraint -## Cosmetic change: removed commented-out lines. -## -## Revision 1.365 2002/12/06 12:45:25 gawthrop -## Simplified rule for sub.sh: both fig and dia go via cmp.txt now. -## -## Revision 1.364 2002/12/03 23:28:44 geraint -## Added dependencies for bond graphs built with dia. -## -## Revision 1.363 2002/11/30 13:39:50 gawthrop -## Split abg2lbl_fig2txt into two parts: -## abg2cmp_fig2txt -## cmp2lbl_txt -## and incorporated into mtt -## -## Revision 1.362 2002/09/19 08:12:53 gawthrop -## Merged version after documentation update -## -## Revision 1.361 2002/09/16 08:08:00 geraint -## Merged changes from global-optimisation branch. -## -## Revision 1.360.2.3 2002/09/16 07:59:26 geraint -## Changed default optimisation to global. -## -## Revision 1.360.2.2 2002/09/04 10:44:59 geraint -## Added option to specify number of tmp variables declared (-ntmpvar ). -## -## Revision 1.360.2.1 2002/09/03 23:44:43 geraint -## adding global optimisation (-optg). -## -## Revision 1.360 2002/08/20 15:51:16 gawthrop -## Update to work with ident DIY rep -## -## Revision 1.359 2002/08/07 14:27:14 geraint -## Changes to make "-i dassl" work again. -## -## Revision 1.358 2002/08/07 11:04:40 geraint -## Now updates timestamp on lbl.txt after processing in make. This eliminates the delay where MTT spends a long period of time uselessly recursing through the model on subsequent passes if the label file is older than the bondgraph. -## -## Revision 1.357 2002/06/28 10:13:40 geraint -## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. -## -## Revision 1.356 2002/06/17 13:14:50 geraint -## Fixed some rules to reduce number of implicit rule searches. -## -## Revision 1.355 2002/06/10 23:18:44 geraint -## Adjusted cr.h comment delimiters to be C compliant. -## -## Revision 1.354 2002/06/10 10:43:19 gawthrop -## ode2odes now prerequisite for sim.m and ssim.m -## -## Revision 1.353 2002/05/28 18:08:38 geraint -## Fixed [ 547294 ] CRs are not sought from MTT_CRS. -## -## Revision 1.352 2002/05/24 11:04:10 geraint -## Removed unnecessary message about *.log file not existing when -D option is used. -## -## Revision 1.351 2002/05/23 17:08:20 geraint -## `mtt sys sfun zip` now produces an input block and an interface block for MTT models. -## Models can be embedded within larger Simulink models by the 2 ports. -## The user must edit 2 code blocks in _sfun_interface.c before compiling with mex. -## -## Revision 1.350 2002/05/21 08:45:36 gawthrop -## DIY reps: no longer skips rep if file exists already. -## Avoids problems in rep.txt when options change -## -## Revision 1.349 2002/05/20 10:29:59 gawthrop -## -oct now forces an m target language to be oct -## (if the rep is an the list: "ae input logic numpar simpar state") -## -## Revision 1.348 2002/05/20 08:50:12 geraint -## Cleans _sfun_ae.mexglx. -## -## Revision 1.347 2002/05/20 07:12:05 gawthrop -## Trying to get oct files generated with -oct -## -## Revision 1.346 2002/05/17 11:15:38 gawthrop -## Messages about copying when using -dr now only appear in verbose (-v) mode. -## -## Revision 1.345 2002/05/15 14:22:25 geraint -## Code for Simulink S-function target written direct to sfun.cc instead of -## calling .mexglx files. This eliminates the sfun dependency on Octave -## ColumnVectors. sys_sfun.cc should build directly on a MS Windows machine -## (can't test this yet). -## -## added sfun.zip target to create source code to export. -## -## Revision 1.344 2002/05/11 01:14:17 geraint -## Fix for [ 553218 ] simpar.oct and simpar.m different. -## Translation added between ColumnVector in base .cc and Octave_map in .oct. -## -## Revision 1.343 2002/05/10 14:07:16 geraint -## Preserve .cc files. -## -## Revision 1.342 2002/05/10 13:24:58 geraint -## Added initial support for building Simulink S-functions. -## Rates do not update properly yet. -## Inertial switches do not work yet. -## Implicit integration not supported yet. -## -## build with: mtt -i euler MotorGenerator sfun mexglx. -## -## Revision 1.341 2002/05/09 15:40:22 gawthrop -## -dr touches copied files to redo timestamp -## -## Revision 1.340 2002/05/08 22:13:47 geraint -## Removed redundant path from mtt_*.cc targets in mexglx build line. -## -## Revision 1.339 2002/05/08 21:32:26 geraint -## Tidied up $1_ode2odes_*.* targets and renamed dummies as *.stamp. -## -## Revision 1.338 2002/05/08 16:03:32 geraint -## Added mex support for ode2odes: mtt sys ode2odes mexglx. -## This mex stuff seems to require octave2.1-headers. -## -## Revision 1.337 2002/05/08 14:51:03 geraint -## Moved matlab/octave data type conversion functions to a separate file. -## -## Revision 1.336 2002/05/07 23:50:34 geraint -## Preliminary support for Matlab dynamically linked shared objects: -## invoke with: mtt -cc sys rep mexglx -## ode2odes support is not yet included. -## -## Revision 1.335 2002/05/01 17:30:55 geraint -## Improved pre-processor directives to better accommodate future alternatives (matlab) -## if necessary. -## -## Revision 1.334 2002/05/01 14:10:22 gawthrop -## Added -dr foo (reads from dir foo) option -## -## Revision 1.333 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.332 2002/04/26 23:19:00 geraint -## Fixed path to info files for "mtt info". -## -## Revision 1.331 2002/04/19 09:24:29 gawthrop -## 2 changes to ode2odes_out generation: only compiles the specified c -## file; outside the computation=c clause -## -## Revision 1.330 2002/04/17 10:03:12 geraint -## Marked .sg as a major representation. -## -## Revision 1.329 2002/04/16 14:58:00 gawthrop -## mtt copy does NOT now copy the CVS directory -## $directory --> ${directory} (just to be tidy) -## -## Revision 1.328 2002/02/19 16:27:05 geraint -## Changes to make MTT work out of the box with Debian. -## -## Revision 1.327 2001/11/15 02:56:17 geraint -## Added DASSL as an option for solution of algebraic equations (-ae dassl). -## Requires octave-2.1.35. -## -## Revision 1.326 2001/10/26 01:01:47 geraint -## fixcc when rdae_is_dae (-cr). -## -## Revision 1.325 2001/10/11 03:15:55 geraint -## Fixed make dependencies for c++ simulation code -## - re-simulation no longer required for different output format. -## -## Revision 1.324 2001/10/05 23:39:43 geraint -## Made odes.dat2 .PRECIOUS to prevent deletion when simulation receives ^C. -## -## Revision 1.323 2001/08/08 02:14:59 geraint -## Rationalisation of solver code, beginning with algebraic solvers. -## -## Revision 1.322 2001/08/01 04:06:07 geraint -## Added -i dassl for -cc and -oct. -## -## Revision 1.321 2001/07/27 23:43:34 geraint -## Added -cc to usage options (required for use with xmtt). -## -## Revision 1.320 2001/07/27 23:38:38 geraint -## Changed comment below (# SUMMARY) - fixes xmtt. -## -## Revision 1.319 2001/07/27 23:29:10 geraint -## *** empty log message *** -## -## Revision 1.318 2001/07/24 04:17:30 gawthrop -## Removed all " from # SUMMARY lines - messes up xmtt -## -## Revision 1.317 2001/07/24 00:55:17 gawthrop -## Resolved clashes -- marked with ## >>> -## -## Revision 1.316 2001/07/22 19:24:03 geraint -## Multiple '-v' increases verbosity. -## -## Revision 1.315 2001/07/13 04:54:04 geraint -## Branch merge: numerical-algebraic-solution back to main. -## -## Revision 1.314 2001/07/13 04:19:03 gawthrop -## Now loads _subs.r with _cr.r file when using -cr option -## -## Revision 1.313 2001/06/13 14:53:59 gawthrop -## MTT now gas the double-colon option in the abg.fig file -## eg R:r:a^2+3*b -## -## Revision 1.312 2001/06/11 19:43:49 gawthrop -## MTT is now much more sophisticated in generating lbl files -## Labels can contain maths -## Repetative components are now broken -## -## Revision 1.311 2001/05/26 18:36:43 gawthrop -## Further modifications. Now works on rcPPP -## -- next jobs: -## add identification to ppp_nlin_sim -## create real-time ppp_nlin_run -## -## Revision 1.310 2001/05/08 08:30:12 gawthrop -## Added line to reverse the x^y --> pow(x,y) in default _simp file to -## prettyfy LaTeX -## -## Revision 1.309.2.3 2001/07/13 04:02:31 geraint -## Implemented numerical algebraic solution for _ode2odes.oct. -## -## Revision 1.309.2.2 2001/06/05 03:20:39 geraint -## added -ae option to select algebraic equation solution method. -## -## Revision 1.309.2.1 2001/05/04 04:07:24 geraint -## Numerical solution of algebraic equations. -## sys_ae.cc written for unsolved inputs. -## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). -## -## Revision 1.309 2001/04/28 03:15:03 geraint -## Fixed comment (interfered with "mtt help representations"). -## -## Revision 1.308 2001/04/25 22:17:45 geraint -## Fixed icd.txt2 dependency. -## -## Revision 1.307 2001/04/15 21:15:41 geraint -## Added interface definition rep: _ICD.(txt|c|cc|m). -## -## Revision 1.305 2001/04/11 09:44:26 gawthrop -## Fixed cc and c problems to do with pow(x,y) and integers -## mtt/lib/reduce/fix_c.r is included in rdae2dae and cse2smx_lang for -## -c, -cc and -oct options -## -## Revision 1.304 2001/04/11 07:35:22 gawthrop -## Now uses system_cr.h in place of system.h in .c rep - -## compatible with older code -## -## Revision 1.303 2001/04/10 12:54:50 gawthrop -## Minor fixes for sensitivity versions -## -## Revision 1.302 2001/04/06 05:24:30 geraint -## -stdin for .cc reps. -## -## Revision 1.301 2001/04/05 03:46:12 geraint -## Added mtt_prepend.sh, -p preserves time attribute of base file -## - eliminates error in dependencies due to update of ese.r by modpar.r. -## -## Revision 1.300 2001/04/04 10:06:49 gawthrop -## New ssim (sensitiveity simulation) rep -## -## Revision 1.299 2001/04/03 14:49:42 gawthrop -## Revised to incorporate new ssim (sensitivity simulation) -## representation (m only just now). -## -## Revision 1.298 2001/04/02 17:36:20 gawthrop -## Resolved $sys name clash when using -s -## -## Revision 1.297 2001/03/29 19:20:45 gawthrop -## Can now use c representations of crs when using -c option -## -## Revision 1.296 2001/03/27 01:07:34 geraint -## Improved determination of Octave version for ode2odes.exe creation. -## Removed FORCE check_update of .txts. -## -## Revision 1.295 2001/03/23 11:21:29 gawthrop -## Show -pdf oprion in help list -## -## Revision 1.294 2001/03/19 02:28:52 geraint -## Branch merge: merging-ode2odes-exe back to MAIN. -## -## Revision 1.293.2.8 2001/03/19 01:35:31 geraint -## Reverted forced update check to main branch form, ready for merge. -## -## Revision 1.293.2.7 2001/03/17 09:51:06 geraint -## Implemented Runge-Kutta IV fixed-step method (-i rk4). -## -## Revision 1.293.2.6 2001/03/03 06:50:38 geraint -## Added summary lines for ode2odes. -## -## Revision 1.293.2.5 2001/03/03 00:27:14 geraint -## Fixed ar options to work with GNU ar. Allow mtt to create dependencies for mtt_%.cc when making mtt_%.oct. -## -## Revision 1.293.2.4 2001/03/02 00:45:21 geraint -## Separated Euler and Implicit methods in .cc code and dependencies. -## -## Revision 1.293.2.3 2001/03/01 05:05:53 geraint -## Minor revisions. -## -## Revision 1.293.2.2 2001/02/23 03:53:53 geraint -## Minor revisions. (ode2odes.exe works on GNU/Linux and ~GNU/Irix) -## -## Revision 1.293.2.1 2001/02/22 06:41:40 geraint -## Initial merge of ode2odes.exe into main mtt. -## standalone_rep.make deleted: rules moved to mtt, variables to mttrc. -## -## Revision 1.293 2001/02/06 04:39:08 geraint -## Added _standalone.exe representation. -## -## Revision 1.292 2001/02/05 17:27:40 gawthrop -## Make sure _def.r exists before creating _state.txt -## -## Revision 1.291 2000/12/27 14:50:40 peterg -## This is the first CVS version (4.9). -## Commented out code now deleted -## -## Revision 1.290 2000/12/05 09:59:37 peterg -## Generates $1_cr.h - allows inclusion of c functions for crs -## -## Revision 1.289 2000/12/05 09:01:52 peterg -## Changed == to = -## -## Revision 1.288 2000/12/01 17:59:01 peterg -## Added .PRECIOUS: %.cc to hang on to cc files - thanks Geraint -## -## Revision 1.287 2000/12/01 16:04:24 peterg -## More partitioning achieved -- now needs the connections to be properly -## sorted in cbg2ese_r -## -## Revision 1.286 2000/12/01 14:18:44 peterg -## -partition now partially works up to cse.m -## but need to think about indexing, struc files etc for subsystems. -## -## Revision 1.285 2000/11/27 11:51:21 peterg -## Fixed a few pdf /fig bugs -## -## Revision 1.284 2000/11/27 10:33:35 peterg -## -pdf option now coerces ps-->pdf -## -## Revision 1.283 2000/11/24 15:11:50 peterg -## -pdf switch for simple displays -## -## Revision 1.282 2000/11/24 14:53:53 peterg -## Added lagrange rep : lde.r and lde.tex -## -## Revision 1.281 2000/11/16 13:51:15 peterg -## Added units stuff -## -## Revision 1.280 2000/11/10 14:45:16 peterg -## Finished up changes to incorporate Geraint's cc stuff -## -## Revision 1.279 2000/11/08 09:51:52 peterg -## Started incorporating Geraints CC/oct conversions -## -## Revision 1.278 2000/11/07 16:39:21 peterg -## *** empty log message *** -## -## Revision 1.277 2000/10/17 09:54:07 peterg -## logic rep sorted out -## -## Revision 1.276 2000/10/15 09:30:31 peterg -## *** empty log message *** -## -## Revision 1.275 2000/10/12 18:38:47 peterg -## New method of sympar generation implemented - uses mtt_make_sympar -## Check/update of numpar.txt is forced. -## -## Revision 1.274 2000/10/12 15:11:54 peterg -## Added the update function for numpar only -## -## Revision 1.273 2000/10/10 21:00:27 peterg -## More changes for new code gneration -## -## Revision 1.272 2000/10/06 16:20:00 peterg -## added ode_write rule -## -## Revision 1.271 2000/10/03 12:14:25 peterg -## Version 4.8 -## -## Revision 1.270 2000/10/03 12:13:51 peterg -## Corrected MTT_LIB paths -## -## Revision 1.269 2000/09/30 14:12:03 peterg -## Fixed bug with no-parameter systems - changed mtt_txt2m and mtt_m2p -## -## Revision 1.268 2000/09/27 16:15:55 peterg -## Now sh (as opposed to bash) compatible - fixed dat22dat again -## -## Revision 1.267 2000/09/21 10:08:30 peterg -## Version 4.7.1 - bug in odes.dat representation fixed in dat22dat -## -## Revision 1.266 2000/09/19 07:47:38 peterg -## fig2dev back to eps - ps produces a4 style output. -## -## Revision 1.265 2000/09/19 07:45:28 peterg -## Version 4.7 -## -## Revision 1.264 2000/09/15 08:37:27 peterg -## Fixed bug using -sub in cbg view -## -## Revision 1.263 2000/09/15 07:33:35 peterg -## Replace fig2dev language eps by ps to avoid version problem. -## -## Revision 1.262 2000/09/14 17:16:33 peterg -## Fixes some outstanding bugs: -## perpendicular strokes in cbg.fig -## proper display of hierachical cbg file (-sub and -viewlevel) -## -## Revision 1.261 2000/09/14 12:43:46 peterg -## view of ps s files now uses -sub and -viewlevel options -## -## Revision 1.260 2000/09/14 09:59:08 peterg -## Added -viewlevel switch -## -## Revision 1.259 2000/09/11 08:21:27 peterg -## Introduced MML - but for _tf rep only. -## -## Revision 1.258 2000/09/11 08:17:28 peterg -## Extended _simp.r to incude default switches -## -## Revision 1.257 2000/09/02 15:53:53 peterg -## Now does partitioning up to dae.view -## -## Revision 1.256 2000/09/02 14:24:06 peterg -## -sub switch introduced - works up to dae.r -## -## Revision 1.255 2000/08/30 11:43:04 peterg -## Put in the -opt switch for code optimisation -## -## Revision 1.254 2000/08/29 09:59:47 peterg -## Version 4.5 -- includes code optimisation using the "Scope" package in reduce -## -## Revision 1.253 2000/08/24 08:53:35 peterg -## New makesubs to create a .subs.r file with output switches to simplify output. -## -## Revision 1.252 2000/08/09 10:31:17 peterg -## Use -d option to find if its a book-style report -## -## Revision 1.251 2000/08/04 10:54:33 peterg -## Rationalised call to gcc using -lp2c to access p2c lib. -## -## Revision 1.250 2000/08/01 19:29:27 peterg -## Explcit zero of input in the simulations -## -## Revision 1.249 2000/08/01 12:28:02 peterg -## VERSION 4.4 -## euler now works -## stepfactor applies to both int. algorithms -## -## Revision 1.248 2000/07/20 07:46:07 peterg -## Version 4.3 -## -## Revision 1.247 2000/07/13 07:21:12 peterg -## Interface to Octave Control Systems Toolbox (OCST) - mtt2sys.m -## -## Revision 1.246 2000/05/21 18:00:11 peterg -## Make manual if not already done. -## Released 4.2 version -## (Train Durham -- Glasgow). -## -## Revision 1.245 2000/05/19 17:50:10 peterg -## Changes to state rep - now has parameter -## -## Revision 1.244 2000/05/19 14:19:46 peterg -## Added library path for representations -## -## Revision 1.243 2000/05/19 11:36:36 peterg -## Added logic rep. -## -## Revision 1.242 2000/05/18 20:12:02 peterg -## Version 4.2 -## -## Revision 1.241 2000/05/16 11:42:14 peterg -## Addded /usr/lib/libp2c.a to gcc -## -## Revision 1.240 2000/05/10 09:38:58 peterg -## Added Make to list of copied files. -## -## Revision 1.239 2000/04/11 18:08:33 peterg -## Fixed cse.tex bug -## -## Revision 1.238 2000/04/10 10:06:41 peterg -## Sorted out implicit rules for p2oct conversion -## -## Revision 1.237 2000/04/07 19:10:24 peterg -## New smxa and smxax reps -## -## Revision 1.236 2000/04/06 10:55:36 peterg -## Removed debug lines -## -## Revision 1.235 2000/04/06 10:52:53 peterg -## Replace $PWD with `pwd` for sh compatibility -## -## Revision 1.234 2000/04/04 16:14:08 peterg -## Sorted mtt help -## -## Revision 1.233 2000/03/16 10:16:11 peterg -## Clean no longer zaps the abg.m files -## -## Revision 1.232 2000/03/16 09:43:35 peterg -## Put in $mtt_switches in mtt comand line when creating _state.txt and -## _input.txt -## -## Revision 1.231 2000/03/15 21:24:23 peterg -## Version 4.1: -## Fixed problems with -abg mode -## Old-style SS lbl no longer supported -## -## Revision 1.230 2000/03/15 20:31:06 peterg -## Replaced lbl2cr by abg2cr_m2txt -## -## Revision 1.229 2000/03/15 19:39:40 peterg -## Replaced sub creation cmp2sub_m2sh by abg2sub_m2sh -## -## Revision 1.228 2000/03/07 10:54:14 peterg -## Added $1_lbl.txt to sympar.txt -## -## Revision 1.227 2000/02/16 15:05:46 peterg -## Replaced spurious 8spaces by tab -## -## Revision 1.226 2000/02/10 18:51:31 peterg -## Included OFF exp; in subs.r default -## -## Revision 1.225 2000/02/10 15:03:10 peterg -## Put subs.r file into the m-code generation -- allows the off exp; -## switch for simpler expresions. -## -## Revision 1.224 2000/02/08 10:27:04 peterg -## Removed obselete .h stuff -## -## Revision 1.223 2000/02/08 09:55:00 peterg -## Added .oct language for ode -## -- octave loadable builtin -## -## Revision 1.222 1999/12/23 10:03:42 peterg -## Added $1_sympars.txt to numpar.m target -## -## Revision 1.221 1999/12/22 05:15:51 peterg -## Set to version 4.0. -## -## Revision 1.220 1999/12/17 03:17:57 peterg -## reps_made is now $1_reps_made - stops clash between two reps per directory -## -## Revision 1.219 1999/12/14 00:36:50 peterg -## Changed $source to $stdin and added to mtt_m2p arg list -## -## Revision 1.218 1999/12/03 00:04:50 peterg -## Version to eric. -## -stdin switch added -## -## Revision 1.217 1999/11/16 22:15:55 peterg -## Changed compcopy to test for abg, not lbl file -## -## Revision 1.216 1999/11/16 05:53:21 peterg -## Added sensitivity (-s) switch -## -## Revision 1.215 1999/11/15 22:45:31 peterg -## Reorganised integration method using -i switch -## Introduced -r (reset) switch -## -## Revision 1.214 1999/11/14 21:27:11 peterg -## *** empty log message *** -## -## Revision 1.213 1999/09/02 23:24:40 peterg -## Now explicitly generates executable _ode2odes.out file -## Which takes command line arguments -## -## Revision 1.212 1999/08/18 06:20:32 peterg -## Put -u back again ..... -## -## Revision 1.211 1999/08/17 04:10:38 peterg -## Removed the -u switch from cp - it doesnt work on non GNU cps -## -## Revision 1.210 1999/08/02 12:52:12 peterg -## Removed redundant .p copying. -## -## Revision 1.209 1999/07/27 03:50:13 peterg -## Fixed odeo.p bug. -## Fixed compound object bug in fig. -## -## Revision 1.208 1999/07/20 23:43:05 peterg -## V 3.8 ( to Eric) -## -## Revision 1.207 1999/04/02 07:17:37 peterg -## Upped version to 3.6 -- the new implicit solver with switches -## -## Revision 1.206 1999/04/02 06:28:54 peterg -## New implicit method - solves numerical prob with ISW -## -## Revision 1.205 1999/03/15 23:27:43 peterg -## Modified generation of odes.dat2 data -## -## Revision 1.204 1999/03/15 05:53:33 peterg -## Put in user-defined representations -## -## Revision 1.203 1999/03/08 03:51:12 peterg -## Version 3.5 for Linux Red Hat 5.2 (Newcastle) -## -## Revision 1.202 1999/02/17 01:59:20 peterg -## Now handles html copy correctely (ie mv directory to ..) -## Fixed path probs with html -## -## Revision 1.201 1999/02/16 03:50:09 peterg -## Removed explicit _smx targets -## -## Revision 1.200 1998/12/03 17:11:03 peterg -## Added -dc (derivative causality) switch. -## -## Revision 1.199 1998/12/03 16:53:50 peterg -## Now completes causality using component, not bond, status. -## -## Revision 1.198 1998/11/20 16:12:30 peterg -## Now copies aliased systems BEFORE generating rgb etc. -## -## Revision 1.197 1998/11/20 09:00:45 peterg -## Number of changes to underlying tools -## -## Revision 1.196 1998/11/10 11:55:40 peterg -## Added $info_switch to abg2cbg invocation -## -## Revision 1.195 1998/10/28 13:58:57 peterg -## Added $1_sympars.txt prerequisite to _tf.m target -## -## Revision 1.194 1998/10/20 09:00:43 peterg -## Added a few summary lines - to help with xmtt -## -## Revision 1.193 1998/10/01 16:11:42 peterg -## Implicit integration now handles switches -## -## Revision 1.192 1998/09/29 20:09:46 peterg -## Fixed nyfr and nifr plotting bug -## -## Revision 1.191 1998/09/02 12:05:39 peterg -## Added INPUT to simpar -## Revision 1.190 1998/09/02 11:48:51 peterg -## VERSION 3.2 (Swansea) -## abg data structure now uses explicti port and subsystem lists so that -## processing is in predetermined order. -## -## Revision 1.189 1998/08/31 10:49:15 peterg -## Minor changes to -abg operation -## -## Revision 1.188 1998/08/27 08:33:21 peterg -## New reduce integration methods - euler/Implicit only -## -## Revision 1.187 1998/08/25 20:06:56 peterg -## New data structure for abg.m and cbg.m -## -## Revision 1.186 1998/08/18 10:49:05 peterg -## VERSION 3.1 release -## -## Revision 1.185 1998/08/18 09:21:14 peterg -## Removed "" from default simpar file. -## -## Revision 1.184 1998/08/18 09:08:26 peterg -## Now grabs components (specified in lbl file as alias) at the rbg stage -## - this makes sure that they are there when needed. -## -## Revision 1.183 1998/08/18 08:48:43 peterg -## Sorted out problem with ifeq ($REPTYPE,data) block - added else. -## -## Revision 1.182 1998/08/17 15:48:39 peterg -## Replaced SVD solver with LUD solver -## -## Revision 1.181 1998/08/15 13:45:28 peterg -## Added new integration methods in Pascal/c version -## Revised the various translations appropriately -## -## Revision 1.180 1998/08/12 14:15:13 peterg -## Implicit integration - c implemetation now included. -## -## Revision 1.179 1998/08/12 12:29:18 peterg -## Put back some of the args stuff -- needed for plots. -## -## Revision 1.178 1998/08/11 13:38:35 peterg -## Zapped the obsolete args stuff -## -## Revision 1.177 1998/07/30 17:32:44 peterg -## VERSION 3.0 -## -## Revision 1.176 1998/07/27 20:25:15 peterg -## Sorted out new mtt_r2m -## -## Revision 1.175 1998/07/27 18:49:09 peterg -## Fixed the frequency stuff -## -## Revision 1.174 1998/07/27 07:10:10 peterg -## Removed dummy global stuff. -## -## Revision 1.173 1998/07/26 14:38:20 peterg -## *** empty log message *** -## -## Revision 1.172 1998/07/26 11:13:38 peterg -## Fixed name classes with globs - ide is that all @strong{MTT} variables -## start with @strong{MTT} -## -## Revision 1.171 1998/07/25 20:37:22 peterg -## Removes -s (switches) option -- they are now assumed to be present -## I still need to shift the old switch -## -## Revision 1.170 1998/07/25 19:16:22 peterg -## Sorted out sympar + switch variables - new sympars rep combines both -## -## Revision 1.169 1998/07/25 16:35:12 peterg -## Incorporated mtt_p2c (uses p2c) -## -## Revision 1.168 1998/07/25 09:44:25 peterg -## Uses Pascal as step on the way to c code -- MUCH nicer! -## State and input now use the simple default - no steady states -## -## Revision 1.167 1998/07/24 17:10:34 peterg -## *** empty log message *** -## -## Revision 1.166 1998/07/22 08:37:30 peterg -## Implicit integration now the default - for octave anyway. -## -## Revision 1.165 1998/07/19 16:00:22 peterg -## Added smx representation -## -## Revision 1.164 1998/07/17 19:45:58 peterg -## Component aliases implemented. -## -## Revision 1.163 1998/07/17 08:27:33 peterg -## Added find target -## -## Revision 1.162 1998/07/16 16:14:27 peterg -## Now stops if a transformation forces error. -## -## Revision 1.161 1998/07/08 11:21:32 peterg -## Added -I switch -## -## Revision 1.160 1998/07/04 11:38:51 peterg -## Version 3.0-- (Seascale) -## -## Revision 1.159 1998/07/04 11:37:43 peterg -## Aliases implemented for parameters + lots of associated goodies -## New-style lbl files - no more SS nonsense. -## -## Revision 1.158 1998/07/03 09:06:39 peterg -## Alias implemented for ports -## -## Revision 1.157 1998/07/01 10:22:11 peterg -## Moved tidy stuff to end of preamble -- needed to make muti-plot copy -## correctely -## Now copies ps file with arguments to WD -## -## Revision 1.156 1998/06/26 14:19:43 peterg -## Copy hidden files (eg .octaverc) in tidy mode -## -## Revision 1.155 1998/06/24 07:43:42 peterg -## Version 2.91 -- includes implicit integration (octave) -## -## Revision 1.154 1998/06/17 14:14:09 peterg -## Removed struc.txt prerequisite for simpar.txt - switch version -## -## Revision 1.153 1998/05/28 09:36:38 peterg -## --version and --versions switch -## -## Revision 1.152 1998/05/24 15:43:10 peterg -## Added symbolic solution of alg. equations (-A) -## -## Revision 1.151 1998/05/23 16:18:37 peterg -## ordinary differential equation.m files generated with the new ode2lang -## method. -## -## Revision 1.150 1998/05/19 19:47:37 peterg -## Updated the odesso representation to use simpar file. -## -## Revision 1.149 1998/05/14 15:16:13 peterg -## Sorted out Differential-Algebraic Equation simulation -## Added LSODE methode to ordinary differential equation simulation -## -## Revision 1.148 1998/05/12 14:42:07 peterg -## Added ese_tidy and new method for organising ese files - -## Each subsystem has an array of variables - effort, flow and state for -## each bond -## -## Revision 1.147 1998/04/15 18:41:47 peterg -## Fixed various probs with multiple systems in one directory -## -## Revision 1.146 1998/04/04 11:00:20 peterg -## Modified various parts to allow coercing directions at ports -## -## Revision 1.145 1998/04/03 11:17:44 peterg -## VERSION 2.9 -## -## Revision 1.144 1998/03/27 13:32:25 peterg -## Removed sympar prerequisites from ss reps. -## -## Revision 1.143 1998/03/22 21:14:03 peterg -## Added obspar.r representation -## Help now case insensitive -## -## Revision 1.142 1998/03/20 15:09:26 peterg -## Changed order of prerequisites for _dae.r to put _rdae.r first. -## -## Revision 1.141 1998/03/11 10:45:19 peterg -## Added rclean - recursive clean -## -## Revision 1.140 1998/03/09 10:23:30 peterg -## PS view now runs as a background process. -## -## Revision 1.139 1998/03/07 16:04:23 peterg -## Added some more txt view reps: input, lbl, numpar, state -## -## Revision 1.138 1998/03/07 15:23:40 peterg -## Uses sort_sympar to uniquely produce the sympar list. -## -## Revision 1.137 1998/03/07 14:04:17 peterg -## dae creation split into 2 parts: -## 1. create a raw (ie without constitutive relationship) dae (rdae) -## 2. add the raw dae to the crs to get the dae. -## reduce has less work to do with this approach -## -## Revision 1.136 1998/03/04 16:34:19 peterg -## New local (_cr.r) and generic (.cr) CR structure. -## CR and lbl now have view mode. -## CRS in abg_tex. -## -## Revision 1.135 1998/02/25 22:09:48 peterg -## Added simpar representation. -## -## Revision 1.134 1998/02/25 15:28:34 peterg -## Added state.m rep. -## -## Revision 1.133 1998/02/24 22:35:33 peterg -## Added -p (preserve) switch to cp in tidy mode. -## -## Revision 1.132 1998/02/24 22:33:23 peterg -## new state reresentation included -## -## Revision 1.131 1998/02/23 16:21:21 peterg -## Just do model name in summary line of lbl file -## -## Revision 1.130 1998/02/19 13:40:24 peterg -## Removed prerequisit from sspar.r target. -## -## Revision 1.129 1998/02/12 08:18:42 peterg -## VERSION 2.8 (St. Annes) -## -## Revision 1.128 1998/02/12 07:48:04 peterg -## Tidy mode copies all files (containing .) to work dir -- this makes -## sure that files such a .c .constitutive relationship go across. -## -## Revision 1.127 1998/02/11 19:36:29 peterg -## Only displays one level of cbg file now. -## -## Revision 1.126 1998/02/11 19:26:03 peterg -## Added verbose (-v) mode. -## -## Revision 1.125 1998/02/11 11:36:28 peterg -## Updated version control mode - make it untidy. -## cp --> cp -u after tidy-mode . -## -## Revision 1.124 1998/02/10 13:03:36 peterg -## Now includes controller transfer function (ctf). -## -## Revision 1.123 1998/02/09 13:51:04 peterg -## Fixed directory string bug. -## -## Revision 1.122 1998/02/06 15:02:26 peterg -## New default sspar -- sets all states to zero. -## -## Revision 1.121 1998/02/06 14:36:51 peterg -## Report on copying back from MTT_work -## -## Revision 1.120 1998/02/05 16:06:53 peterg -## Removed debugging lines. -## Auto parts in books. -## -## Revision 1.119 1998/02/05 15:04:25 peterg -## Fixed problem with book in tidy mode. -## -## Revision 1.118 1998/02/05 12:00:11 peterg -## Tidy mode now default. -## It seems to work ok but not for book type documents. -## -## Revision 1.117 1998/02/04 16:50:50 peterg -## Introduced the tidy (-t and -T) options -## -## Revision 1.116 1998/02/04 11:00:04 peterg -## Added view of subsystems. -## -## Revision 1.115 1998/01/29 19:37:31 peterg -## Fixed spurious call to X server bug -## -## Revision 1.114 1998/01/23 13:38:07 peterg -## VERSION 2.7 -## -## Revision 1.113 1998/01/23 13:27:13 peterg -## Added state-feedback control representations: -## smc,smo,ssk,ssl -## -## Revision 1.112 1998/01/21 09:24:46 peterg -## Removed 'touch $1_rep.txt' -- perhaps best to do this by hand if -## necessary. As it is, it cuased probs wene reediting the _rep.txt file. -## -## Revision 1.111 1998/01/16 14:56:59 peterg -## Argument now correctely recognised as a string beginning with - -## (rather than containing -) -## -# Revision 1.110 1998/01/06 13:59:30 peterg -# Added rename function. -# -# Revision 1.109 1998/01/06 09:20:02 peterg -# Made LATEX2HTML an environment variable. -# -# Revision 1.108 1997/12/19 08:48:55 peterg -# Lille modifications - bicausal algebraic loops supported -# -## Revision 1.107 1997/12/11 10:59:50 peterg -## This is version 2.6 -## -# Revision 1.106 1997/12/11 10:59:07 peterg -# Added debug -D switch + echos directory when -d switch used. -# -# Revision 1.105 1997/12/11 09:04:47 peterg -# Reduced default rep.txt file to just abg.txt -- this is to document -# components which may not be causally complete -# -# Revision 1.104 1997/12/07 21:05:10 peterg -# Removed a debbugging echo -# -## Revision 1.103 1997/12/07 20:10:36 peterg -## Fixed bugs with reprots and distinguish between book, article and -## section reports. -## -## Revision 1.102 1997/12/07 12:14:43 peterg -## Hnadles book, article and section reports seperately -## -## Revision 1.101 1997/12/06 18:54:53 peterg -## Now tidies up after itself. -## Major modifications to do a rep on a directory -- creates a book with -## each example as a chapter. -## -## Revision 1.100 1997/12/06 12:14:39 peterg -## Put a conditional around the PS data rep to check for set arguments. -## -## Revision 1.99 1997/12/04 22:06:53 peterg -## Added view arguments for graph plotting -## -## Revision 1.98 1997/12/04 10:58:15 peterg -## Tidied up switches -## -## Revision 1.97 1997/12/04 10:44:33 peterg -## Changed $cc to $CC -## -## Revision 1.96 1997/12/04 10:40:26 peterg -## Added -p switch - print enviromment variables -## -## Revision 1.95 1997/12/04 10:05:02 peterg -## Compiler now symbolocic $cc -## -# Revision 1.94 1997/11/20 11:23:16 peterg -# Changed gcc to cc -# -## Revision 1.93 1997/09/18 16:57:28 peterg -## _sympar.txt now has a second column - the system type from whence the -## parameter (in the first column) came. -## Done on the train Glasgow-Warrington ! -## -## Revision 1.92 1997/09/11 17:08:46 peterg -## Added spreadsheet version of odeso -## -## Revision 1.91 1997/09/11 08:21:08 peterg -## copy utility split into two: -## copy: copies examples (copies the entire directory) -## compcopy: (just used internally) copies components. -## -## Revision 1.90 1997/08/30 19:35:39 peterg -## Added date to mtt line -## -## Revision 1.89 1997/08/26 15:20:25 peterg -## Added explicit evaluation of report representations -## Version now 2.5++ -## -## Revision 1.88 1997/08/25 07:51:47 peterg -## Version 2.5. -## -## Revision 1.87 1997/07/27 13:11:11 peterg -## Added path checking code -- mtt_check_vars -## -# Revision 1.86 1997/06/29 19:05:51 peterg -# Seascale changes -- mainly to new rep format. -# -## Revision 1.85 1997/06/27 12:14:49 peterg -## Upped version to 2.4++ -## -# Revision 1.84 1997/06/13 14:08:23 peterg -# Changed default rep.txt -# -# Revision 1.83 1997/06/13 09:18:28 peterg -# Removed all params.m -# -# Revision 1.82 1997/06/13 08:59:03 peterg -# Set to version 2.4 -# -## Revision 1.81 1997/05/22 10:11:04 peterg -## Fixed dat2gdat bug (with parameters) -## -## Revision 1.80 1997/05/22 07:38:27 peterg -## Added command line info to .doc files (makedoc) -## -## Revision 1.79 1997/05/19 16:44:12 peterg -## Many changes to get rep.html mode working properly. -## -# Revision 1.78 1997/05/19 13:17:50 peterg -# Explicit inclusion of mtt.sty in .doc files -- latex2html prefers this -# -# Revision 1.77 1997/05/19 11:29:37 peterg -# Added desc.tex and abg.tex descriptions. -# -# Revision 1.76 1997/05/15 09:43:46 peterg -# New version of _input.txt for -s option -# -# Revision 1.75 1997/05/15 09:15:54 peterg -# Included switch.c in dependancy list for _input.c (when -s switch set) -# -# Revision 1.74 1997/05/13 16:58:02 peterg -# Added -s switch to get mtt to search for (Bond Graph) switches -# -## Revision 1.73 1997/05/09 09:18:45 peterg -## Put ./ in front of a.out (again) -## -# Revision 1.72 1997/05/06 13:54:21 peterg -# Changed gcc arguments for the ode simulation -- all files now included -# in the _odes.c file -# -# Revision 1.71 1997/05/03 15:50:18 peterg -# c functions not included in gcc arg list -- they are now included in -# the main prog. -# -# Revision 1.70 1997/05/03 14:17:13 peterg -# Now copies c utilities (eg dsvdcmp.c) from $MTTPATH/trans/c. -# -# Revision 1.69 1997/05/03 13:58:35 peterg -# Implicit integration for sm representation added. -# -# Revision 1.68 1997/05/01 08:39:20 peterg -# params.c and params.m not used any more. -# _numpar.txt is the common base from which _numpar.c and numpar.m is -# generated. -# -# Revision 1.67 1997/04/23 07:26:49 peterg -# Added -o switch -- ode and dae are the same -# Added switches to default menu -# -# Revision 1.66 1997/04/16 09:46:01 peterg -# More informative copy message -# -# Revision 1.65 1997/04/15 15:16:12 peterg -# Added structure (_struc) files. -# Fixed prob with dvi2ps conversion -- removed .doc extension. -# -# Revision 1.64 1997/04/09 09:26:44 peterg -# Added crcopy feature to pull crs from library -- similar to copy -# feature. -# -# Revision 1.63 1997/03/22 17:09:11 peterg -# Fixed bug in recursive cr.txt generation. -# Fixed bug in recursive sympar.txt generation. -# -# Revision 1.62 1997/03/20 17:48:50 peterg -# Better _input.c file default. -# -# Revision 1.61 1997/03/20 16:53:01 peterg -# Generates c files using include statements. -# -# Revision 1.60 1997/03/20 10:25:41 peterg -# Generates a compehensive default params file. -# -# Revision 1.59 1997/03/19 10:14:04 peterg -# Now produces a stripped acausal bond graph. -# -# Revision 1.58 1997/03/18 17:58:12 peterg -# Generates label files containing all variables in fig file. -# Generates sympar file for all levels in system. -# Generates txt version of sympar file. -# -# Revision 1.57 1997/03/10 09:24:58 peterg -# a.out now deleted in the clean operation -# -# Revision 1.56 1997/03/05 08:24:09 peterg -# Delete a.out after it has run. -# -# Revision 1.55 1997/02/24 19:31:10 peterg -# Removed numpar.m requirement from .m files -# -## Revision 1.54 1997/02/09 20:33:13 peterg -## Replaced a.out with ./a.out -## -## Revision 1.53 1997/02/09 20:30:04 peterg -## Copied from tweedledum. -## -# Revision 1.54 1997/02/07 13:33:03 peterg -# Added ; to _input.c file - bug fix. -# -# Revision 1.53 1997/02/07 13:25:04 peterg -# Version 2.3 -# -# Revision 1.52 1997/01/21 22:55:59 peterg -# Minor bug fixes -# -## Revision 1.51 1997/01/21 13:16:40 peterg -## Included transformations to language c for: -## ode -## params -## numpar -## -## Revision 1.50 1996/12/21 19:46:52 peterg -## Set to 2.2++ -## Changed \* --> \\* in rbg_fig2m.awk -## -## Revision 1.49 1996/12/19 19:55:22 peterg -## Version 2.2 -- Linux. -## -## Revision 1.48 1996/12/07 21:33:52 peterg -## Changed _input file to give unit step on ALL inputs -## -## Revision 1.47 1996/12/07 20:50:16 peterg -## *** empty log message *** -## -## Revision 1.46 1996/12/05 10:48:51 peterg -## Put sympar in clean list. -## sympar now sucks in params.r file -## -## Revision 1.45 1996/12/05 10:41:39 peterg -## Saved many changes over past 2 weeks. -## -# Revision 1.44 1996/11/12 16:04:25 peterg -# Really VERSION 2.1 -# -# Revision 1.43 1996/11/12 08:52:57 peterg -# Fixed bug in test arg to if - missing "". -# -# Revision 1.42 1996/11/11 17:23:03 peterg -# Added numpar.m requirement to all .m targets -# -## Revision 1.41 1996/11/11 17:18:32 peterg -## VERSION 2.1 -## -## Revision 1.40 1996/11/09 21:17:38 peterg -## Fixed bug with copying at level 0. -## -## Revision 1.39 1996/11/09 20:22:54 peterg -## VERSION 2.0 -## -## Revision 1.38 1996/11/09 20:17:34 peterg -## Fixed bug with null ARGS argument -## Put in new lib paths. -## -## Revision 1.37 1996/11/09 18:47:46 peterg -## Added new copy command (using find). -## More documaentation stuff. -## -# Revision 1.36 1996/11/03 21:19:02 peterg -# Recursice generation of Constitutive Relationship files. -# -## Revision 1.35 1996/11/02 10:19:19 peterg -## Constitutive Relationship generation from lbl file -## -## Revision 1.34 1996/11/01 13:34:35 peterg -## -q (quiet) switch added -## -## Revision 1.33 1996/11/01 12:34:45 peterg -## Added browser - mtt_help -## -## Revision 1.32 1996/10/31 20:48:41 peterg -## Revised html generation. -## Stopped deletion of rep.txt file. -## -# Revision 1.31 1996/10/20 19:23:54 peterg -# Automatic generation of sub-system abg.m files. -# -## Revision 1.30 1996/10/01 14:08:05 peterg -## Replaced $() by `` -## Replaced make with gmake -## -# Revision 1.29 1996/10/01 11:04:05 peter -# Changed name of html document. -# -## Revision 1.28 1996/09/13 18:44:11 peter -## Added params dependencies. -## -## Revision 1.27 1996/09/12 19:24:56 peter -## New numpar/params setup. -## -## Revision 1.26 1996/09/10 17:04:47 peter -## Added impulse response (ir) representation. -## -## Revision 1.25 1996/08/30 20:03:45 peter -## Removed dependencies from vc -## -## Revision 1.24 1996/08/30 18:37:17 peter -## inor changes. -## -## Revision 1.23 1996/08/30 11:10:37 peter -## More files in clean up. -## -## Revision 1.22 1996/08/30 10:07:51 peter -## Removed impicit creation of abg.fig file. -## -## Revision 1.21 1996/08/22 12:19:51 peter -## Added various document viewers. -## -## Revision 1.20 1996/08/20 08:24:53 peter -## Now with version control. -## -## Revision 1.19 1996/08/19 15:33:22 peter -## Included new state matric (sm) rep. -## Generate step response (sr) from sm. -## -## Revision 1.18 1996/08/19 13:30:54 peter -## New CLEAN target. -## -## Revision 1.17 1996/08/19 06:48:14 peter -## Explicit figure editing. -## -## Revision 1.16 1996/08/18 19:58:36 peter -## Report generation included. -## -## Revision 1.15 1996/08/18 12:01:01 peter -## Unified format of time responses. -## -## Revision 1.14 1996/08/16 14:52:24 peter -## Added two alternative view options - dview and pview. -## -## Revision 1.13 1996/08/16 08:24:31 peter -## Correctly chooses how to make a ps file using $REPTYPE. -## -## Revision 1.12 1996/08/15 16:47:47 peter -## DAE solution (experimental) included. -## -## Revision 1.11 1996/08/15 11:55:30 peter -## Checks for changed argument. -## Handles frequency response. -## -## Revision 1.10 1996/08/15 07:44:24 peter -## Now handles generic transformations using %. -## -## Revision 1.9 1996/08/14 09:16:08 peter -## Step response now goes through m, dat and gdat conversions -## -## Revision 1.8 1996/08/12 20:19:52 peter -## Arguments now passed via $1_args.m file -## -## Revision 1.7 1996/08/11 19:49:27 peter -## Parameter passing (via $4) added. -## -## Revision 1.6 1996/08/11 10:40:56 peter -## Added new numpar stuff. -## Added step response. -## -## Revision 1.5 1996/08/10 14:13:47 peter -## Added impulse and frequency response stuff. -## -## Revision 1.4 1996/08/10 09:19:48 peter -## Put in help, info and warranty stuff. -## -## Revision 1.3 1996/08/09 15:13:13 peter -## Generic viewing of any representation via ps files implemented. -## -## Revision 1.2 1996/08/05 19:50:55 peter -## Put in fig.fig target. -## -## Revision 1.1 1996/08/04 17:29:42 peter -## Initial revision -## -############################################################### - -set_oct() { -## Sets ${m} to oct if such a rep is supported - m=m - supported_reps="ae input logic numpar simpar state" - for supported_rep in ${supported_reps}; do - if [ "${rep}" = "${supported_rep}" ]; then - m=oct - fi - done -} - -#Check $MTTPATH has been set -mtt_check_var "$MTTPATH" "MTTPATH" - -#Version -version='5.0' - -# MTT recursion level is zero unless explicitly set -level=0 - -#Computation mode is octave by default -computation=octave - -#By default, Reduce is used if available -if [ -n "$SYMBOLIC" ]; then - use_reduce='yes' -else - use_reduce='no' -fi - -#By default, the dae and ode representations are different -dae_is_ode=0 - -#By default, the ode and cse reps are different -ode_is_cse=0 - -# By default, don't look for BG switches -switches=0 - -#By default, don't print the environment variables -print=''; - -# By default, make it tidy -tidy=tidy; - -# Default not verbose -verbose=' -s' -verbosity=0 - -# Default integration method -integration_method=implicit; - -# Default algebraic equation solver -algebraic_solver=noAlgebraicSolver; - -# Default no info -info_switch='' - -# Default use m, not oct files -m='m'; - -# Default use ps files -ps=ps -eps=eps -psview=$PSVIEW - -# Default declare 500 temporary variables -num_tmp_var=500 - -# Default no equation sorting -do_sort='' -sort_method='' - -#Initialise list of switches -mtt_switches=''; - -#Initialise read dirs -read_dirs='' - -#Initialise view_level -viewlevel=0 - -#Look for a command line argument -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -q ) - mtt_switches="$mtt_switches $1"; - quiet=quiet;; - -r ) - mtt_switches="$mtt_switches $1"; - reset=reset;; - - -p ) - mtt_switches="$mtt_switches $1"; - print='-p';; - -c ) - echo "-c is obsolete. Please use -cc instead" - fixcc='-fixcc' - mtt_switches="$mtt_switches $1"; - matrix_smxa="-matrix"; - computation=c ;; - -cc ) - fixcc='-fixcc' - mtt_switches="$mtt_switches $1"; - matrix_smxa="-matrix"; - computation=cc ;; - -cr ) - mtt_switches="$mtt_switches $1"; - rdae_is_dae=1 ; - cr_first='-cr';; - -o ) - mtt_switches="$mtt_switches $1"; - dae_is_ode=1 ;; - -nocr ) - mtt_switches="$mtt_switches $1"; - rdae_is_dae=1 ;; - -no-reduce ) - mtt_switches="$mtt_switches $1"; - use_reduce='no'; - do_sort='-sort'; - sort_method='make'; - rdae_is_dae=1 ; - cr_first='-cr'; - Solve=''; - num_tmp_var=0 ; - integration_method="euler" ;; - -i ) - mtt_switches="$mtt_switches $1"; - shift; - case $1 in - dassl) - integration_method=dassl; - mtt_switches="$mtt_switches dassl"; - ;; - euler) - integration_method=euler; - mtt_switches="$mtt_switches euler"; - ;; - implicit) - integration_method=implicit; - mtt_switches="$mtt_switches implicit"; - ;; - rk4) - integration_method=rk4; - mtt_switches="$mtt_switches rk4"; - ;; - *) - echo $1 is an unknown integration method - use dassl, euler, rk4 or implicit; - exit;; - esac;; - -ae ) - mtt_switches="$mtt_switches $1"; - case $2 in - dassl) - mtt_switches="$mtt_switches $2"; - algebraic_solver=Dassl_Solver; - shift; - ;; - fsolve | hybrd) - mtt_switches="$mtt_switches $2"; - algebraic_solver=Hybrd_Solver; - shift; - ;; - hooke) - mtt_switches="$mtt_switches $2"; - algebraic_solver=HJ_Solver; - shift; - ;; - reduce) - mtt_switches="$mtt_switches $2"; - algebraic_solver=Reduce_Solver; - Solve='-A'; - shift; - ;; - *) - echo $1 is an unknown solver - use hybrd, hooke or reduce; - exit;; - esac;; - -s ) - sensitivity_switch='-s'; - mtt_switches="$mtt_switches $1"; - sensitivity=sensitivity ;; - -make-sort ) - mtt_switches="$mtt_switches $1"; - do_sort='-sort'; - sort_method="make"; - num_tmp_var=0 ;; - -sort ) - mtt_switches="$mtt_switches $1"; - do_sort='-sort'; - sort_method="seqn"; - integration_method="sorted_euler";; - -ss ) - mtt_switches="$mtt_switches $1"; - steadystate_computation=yes ;; - -d ) - directory=$2; cd $directory; shift ;; - -dc ) - mtt_switches="$mtt_switches $1"; - causality_switch='-derivative' ;; - -S ) - directory=$2; shift;; - -D ) - mtt_switches="$mtt_switches $1"; - debug=debug ;; - -v ) - mtt_switches="$mtt_switches $1"; - info_switch='-I'; - Verbose='verbose'; - verbosity=`expr $verbosity + 1`; - if [ $verbosity -ge 1 ]; then verbose=' -w '; fi; - if [ $verbosity -ge 2 ]; then set -x; fi; - if [ $verbosity -ge 3 ]; then verbose_make=' -d '; fi; - ;; - -I ) - mtt_switches="$mtt_switches $1"; - info_switch='-I' ;; - -t ) - tidy=tidy ;; - -trace ) - mtt_switches="$mtt_switches $1"; - trace='-n' ;; - -T ) - tidy=tidy; - verytidy=verytidy ;; - -u ) - tidy=untidy ; - mtt_switches="$mtt_switches $1"; - ;; - -l ) - mtt_switches="$mtt_switches $1 $2"; - level=$2; shift ;; - -A ) - mtt_switches="$mtt_switches $1"; - Solve='-A';; - -abg ) - mtt_switches="$mtt_switches $1"; - start_at_abg='yes';; - -stdin ) - mtt_switches="$mtt_switches $1"; - stdin=stdin;; - -sub ) mtt_switches="$mtt_switches $1 $2"; - sub='-sub'; - subsystem="_"$2; - shift;; - -oct ) - fixcc='-fixcc' - mtt_switches="$mtt_switches $1"; - using_oct=yes; - ;; - -opt | -optl ) - mtt_switches="$mtt_switches $1"; - optimise='-optimise_local';; - -optg ) - mtt_switches="$mtt_switches $1"; - optimise='-optimise_global';; - -ntmpvar ) - num_tmp_var=$2; - mtt_switches="$mtt_switches $1 $2"; - shift;; - -partition ) mtt_switches="$mtt_switches $1"; - partition='-partition'; - ;; - -pdf ) mtt_switches="$mtt_switches $1"; - ## ps=pdf; - ## eps=pdf; - ## pdf='-pdf'; - psview=$PDFVIEW; - ;; - -dr ) mtt_switches="$mtt_switches $1"; shift - mtt_switches="$mtt_switches $1"; read_dir=$1 - if [ -d "${read_dir}" ]; then - read_dirs="${read_dirs} ${read_dir}" - else - echo "${read_dir} does not exist - ignoring" - fi - ;; - -nas ) no_alpha_sort="no_alpha_sort"; - mtt_switches="$mtt_switches $1"; - ;; - -viewlevel ) mtt_switches="$mtt_switches $1 $2"; - viewlevel=$2; - shift;; - --version) - echo 'MTT version' $version; exit;; - --versions) - mtt_versions; exit;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -## Create switches string for adding to file names. - MTT_SWITCHES=`echo ${mtt_switches} | sed 's/ //g' | sed 's/^-u-q//'` - -#Print header if not in quiet (-q) mode. -if [ "$quiet" != "quiet" ]; then - echo - echo 'MTT (Model Transformation Tools) version' $version - echo '($Date$)' - echo 'This is free software with ABSOLUTELY NO WARRANTY.' - echo 'Type `mtt warranty'\' 'for details.' - echo - # Print current directory if in -d mode - if [ -n "$directory" ]; then - echo Using directory $directory - echo - fi -fi - -#Print what's going on if in verbose mode -if [ -n "$Verbose" ]; then - echo Starting mtt $mtt_switches $1 $2 $3 $4 at level $level - echo " " current wd `pwd` -fi - -#Check the principle paths -mtt_check_vars $print - -# Exit if just printing paths -if [ "$print" != "" ]; then - exit -fi - -if [ -z "$1" ]; then - if [ -z "$print" ]; then - cat < clean - mtt copy - mtt rename - mtt vc - mtt - mtt - -Options: - -A solve algebraic equations symbolically - -abg start at abg.m representation - -ae algebraic equation solver: reduce|hybrd|dassl|hooke - -cc C++ code generation - -cr use cr before resolving equations - -D debug -- leave log files etc - -d use directory - -dc maximise derivative (not integral) causality - -dr use files contained in - -I prints more information - -i integration method: implicit|euler|rk4|dassl - -nas no alphabetic sort (of components) - -o ode is same as dae - -oct use oct files in place of m files where appropriate - -opt optimise code generation (equivalent to -optl) - -optl locally optimise code generation (line-by-line) - -ntmpvar declare temporary variables (default=$num_tmp_var) - -p print environment variables - -partition partition hierachical system - -pdf generate pdf in place of ps - -q quiet mode -- suppress MTT banner - -r reset time stamp on representation - -s generate sensitivity BG (use mtt -s sSys rep lang) - -ss use steady-state info to initialise simulations - -stdin read input data from standard input for simulations - -sub operate on subsystem - -t tidy mode (default) - -trace just indicate what mtt will do - but do not do it - -u untidy mode (leaves files in current dir) - -v verbose mode (multiple uses increment the verbosity) - --version print version and exit - --versions print version of mtt and components and exit - -viewlevel view levels of hierachy - -Experimental options: - -optg globally optimise code generation (full vector) - -make-sort use sorted equations (sese, generated by make) - -no-reduce try not to use symbolic algebra - -sort use sorted equations (sese, generated by seqn) - -Deprecated options: - -c c-code generation - -EOF - exit - fi -fi - - -if [ "$1" = "info" ] && [ "$3" = "" ]; then - (cd $MTT_DOC ; make --silent mtt.info) - echo "Invoking info in xterm" - xterm -e info -f $MTT_DOC/mtt.info $2 - exit -fi - -if [ "$1" = "help" ]; then - mtt_help $2 $3 - exit -fi - -if [ "$1" = "hinfo" ] && [$2 = ""]; then - mtt_check_var "$HTMLVIEW" HTMLVIEW - (cd $MTT_DOC/; make --silent mtt.html) - echo Invoking $HTMLVIEW - (cd $MTT_DOC; $HTMLVIEW file://$MTT_DOC/mtt.html)& - exit -fi - -if [ "$1" = "manual" ] && [$2 = ""]; then - mtt_check_var "$PDFVIEW" PDFVIEW - (cd $MTT_DOC/; make --silent mtt.pdf) - echo Invoking $PDFVIEW - $PDFVIEW $MTT_DOC/mtt.pdf & - exit -fi - -if [ $1 = "find" ]&& [$3 = ""]; then - mtt_find $MTT_COMPONENTS $2 - find_status=$? - if [ $find_status = "1" ]; then - echo Component $2 not found - is MTT_COMPONENTS set correctly? - fi - exit $find_status -fi - -if [ "$1" = "warranty" ] && [$2 = ""]; then - cat << EOF -Copyright (C) 1989, 1990, 1991, 1992, 1993, - 1994, 1995, 1996, 1997, 1998, 1999 Peter J. Gawthrop -This is free software with ABSOLUTELY NO WARRANTY. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -EOF - exit -fi - -# Start at abg representation -if [ -n "$start_at_abg" ]; then - if [ -f "$1_abg.m" ]; then - if [ "$quiet" != "quiet" ]; then - echo Starting from $1_abg.m - fi - else - echo $1_abg.m does not exist - exit - fi -fi - -# Clean up -if [ "$1" = "clean" ]; then - echo Removing intermediate files in `pwd` - rm -fr MTT_work - exit -fi - -# Recursively clean up -if [ "$1" = "rclean" ]; then - echo 'Removing intermediate files recursively' - dir2paths '.' | gawk '{print "mtt -q -d " $1 " clean " $2}' | sh - exit -fi - -# The big clean up -if [ "$1" = "Clean" ] && [ "$2" = "" ]; then - echo 'Removing all generated files for all systems' - rm -f *.log mtt_info.txt warning.txt - rm -f *_abg.ps *_args.* *_cr.txt *_abg.tex - rm -f *_sabg.fig *_sabg.ps *_head.fig *_bnd.fig - rm -f *_labg.fig *_lcbg.fig - rm -f *_sympar.r *_sympar.c *_sympar.h *_sympar.txt? *_sympar.tex - rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.* *_alias.* - rm -f *_sub.* *_type.sh - rm -f *_dae*.* *_cse.* *_ode.* - rm -f *_obs.* *_rfe.* *_ss.* - rm -f *_dm.* *_csm.* *_tf.* *_sr*.* *_ir*.* *_*fr.* - rm -f *_numpar.c *_input.m *_input.c *_switch.c *_switch.txt - rm -f *_sm.* *_can.* - rm -f *_struc.* *_sympar.txt *_sympar.c *_sympar.h *_sympar.m - rm -f *_odes.c *_odes.dat *_odes.gdat *_odes.m *_odes.ps *_odes.sg - rm -f *_odeso.dat *_odeso.gdat *_odeso.sdat *_odeso.m *_odeso.ps - rm -f *_*.doc *_*.idx *_*.ind *_*.ilg *_*.dvi *_*.aux *_*.lof *_*.toc - rm -f *_rep.tex - rm -f *_unique_raw_list *_raw_list - rm -f mtt_error.txt mtt_info.txt *_ode2odes.out - rm -f *_*_write.r *_simpar.m *_simpar.p - rm -f *_cseo.oct *_input.oct *_simpar.oct *_smxax.oct - rm -f *_csex.oct *_numpar.oct *_smxa.oct *_state.oct - rm -f *_ode.oct *_odeo.oct - rm -f *_cseo.mexglx *_input.mexglx *_simpar.mexglx *_smxax.mexglx - rm -f *_csex.mexglx *_numpar.mexglx *_smxa.mexglx *_state.mexglx - rm -f *_ode.mexglx *_odeo.mexglx - rm -f *_sfun.mexglx *_sfun_*.mexglx - rm -f *_cseo.cc *_input.cc *_simpar.cc *_smxax.cc - rm -f *_csex.cc *_numpar.cc *_smxa.cc *_state.cc - rm -f *_ode.cc *_odeo.cc - rm -f *_logic.m *_logic.cc *_logic.oct - rm -f *_state.m *_state.cc *_state.oct - rm -f *_ode2odes.* *.dat2 MTT.core - rm -f *_modpar.txt *_modpar.r - rm -f *_ICD.txt *_ICD.c *_ICD.cc *_ICD.m - rm -f *_ae.r *_ae.m *_ae.cc *_ae.oct - rm -f *_sese.r *_sese.m - rm -f *_sese.make *_sesx.* *_sesy.* _sae.* - rm -fR *_rep MTT_work - exit -fi - -# Clean up named system -if [ "$2" = "Clean" ] && [ "$3" = "" ]; then - echo 'Removing all generated files for system ' $1 - rm -f *.log mtt_info.txt warning.txt - rm -f $1_abg.ps $1_args.* $1_cr.txt $1_abg.tex - rm -f $1_sabg.fig $1_sabg.ps $1_head.fig $1_bnd.fig - rm -f $1_labg.fig $1_lcbg.fig - rm -f $1_sympar.r $1_sympar.c $1_sympar.h $1_sympar.txt? $1_sympar.tex - rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.* $1_alias.* - rm -f $1_sub.* $1_type.sh - rm -f $1_dae*.* $1_cse.* $1_ode.* $1_obs.* $1_rfe.* $1_ss.* - rm -f $1_dm.* $1_csm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.* - rm -f $1_numpar.m $1_numpar.c $1_input.m $1_input.c $1_switch.c $1_switch.txt - rm -f $1_sm*.* $1_can.* - rm -f $1_struc.* $1_sympar.txt $1_sympar.c $1_sympar.h $1_sympar.m - rm -f $1_odes.c $1_odes.dat $1_odes.gdat $1_odes.sdat $1_odes.m $1_odes.ps $1_odes.sg - rm -f $1_odeso.dat $1_odeso.gdat $1_odeso.m $1_odeso.ps - rm -f $1_*.doc $1_*.idx $1_*.ind $1_*.ilg $1_*.dvi $1_*.aux $1_*.lof $1_*.toc - rm -f $1_rep.tex - rm -f $1_unique_raw_list $1_raw_list - rm -f mtt_error.txt mtt_info.txt $1_ode2odes.out - rm -f $1_*_write.r $1_simpar.m $1_simpar.p - rm -f $1_cseo.oct $1_input.oct $1_simpar.oct $1_smxax.oct - rm -f $1_csex.oct $1_numpar.oct $1_smxa.oct $1_state.oct - rm -f $1_ode.oct $1_odeo.oct - rm -f $1_cseo.mexglx $1_input.mexglx $1_simpar.mexglx $1_smxax.mexglx - rm -f $1_csex.mexglx $1_numpar.mexglx $1_smxa.mexglx $1_state.mexglx - rm -f $1_ode.mexglx $1_odeo.mexglx - rm -f $1_sfun.mexglx $1_sfun_*.mexglx - rm -f $1_cseo.cc $1_input.cc $1_simpar.cc $1_smxax.cc - rm -f $1_csex.cc $1_numpar.cc $1_smxa.cc $1_state.cc - rm -f $1_ode.cc $1_odeo.cc - rm -f $1_logic.m $1_logic.cc $1_logic.oct - rm -f $1_state.m $1_state.cc $1_state.oct - rm -f $1_ode2odes.* $1.dat2 - rm -f $1_modpar.txt $1_modpar.r - rm -f $1_ICD.txt $1_ICD.c $1_ICD.cc $1_ICD.m - rm -f $1_ae.r $1_ae.m $1_ae.cc $1_ae.oct - rm -f $1_sese.r $1_sese.m - rm -f $1_sese.make $1_sesx.* $1_sesy.* $1_sae.* - rm -fR $1_rep MTT_work - exit -fi - -if [ "$2" = "rep" ]; then - documenttype=article - # See if we are making a book -- ie representation rep on a directory - isMTT_work=`pwd | grep 'MTT_work'` - if [ -n "$isMTT_work" ]; then - dotdot='../' - fi - - #isdirectory=`file $dotdot$1 | gawk '{print $2}' | grep directory` - if [ -d "$dotdot$1" ]; then - documenttype=book - fi -else - documenttype=section -fi - -case $2 in - nyfr) - NyquistStyle='True' - ;; - nifr) - NyquistStyle='True' - ;; - *) -esac - -#SUMMARY abg* acausal bond graph (fig) -#SUMMARY abg* acausal bond graph (dia) -#SUMMARY abg* acausal bond graph (ps) -#SUMMARY abg* acausal bond graph (view) -# Invoke explicit requests for modification -if [ "$2" = "abg" ] && [ "$3" = "fig" ]; then - mtt_check_var "$FIG" FIG - echo Editing $1_$2.$3 - ($FIG $1_$2.$3; cp $1_abg.fig $1_$1_abg.fig) & - exit -fi - -# Rename a system -if [ "$1" = "rename" ]; then - mtt_rename_all $2 $3 - exit -fi - -# Copy systems from the example library -if [ "$1" = "copy" ]; then - #set up source and destination dirs - source=$3 - if [ -z "$source" ]; then - source=$MTT_EXAMPLES - fi - destination=$4 - if [ -z "${destination}" ]; then - destination=$2 - fi -# check that its not here already - file_exists=`ls ${destination}/$2_abg.fig 2> /dev/null` - if [ -n "$file_exists" ]; then - if [ "$quiet" != "quiet" ]; then - echo System $2 exists already - no action taken - fi - else - source=$3 - if [ -z "$source" ]; then - source=$MTT_EXAMPLES - fi - destination=$4 - if [ -z "${destination}" ]; then - destination=$2 - fi -echo Copying system $2 from $source into directory ${destination} - find $source -name "$2" -exec cp -fr {} . \; - rm -rf ${destination}/CVS - fi - exit -fi - -# Copy components from the library -if [ "$1" = "compcopy" ]; then - - #Pull out the base name (we may have a library as well) - name=`basename $2` - - #set up source and destination dirs - source=$3 - if [ -z "$source" ]; then - source=$MTT_COMPONENTS - fi - destination=$4 - if [ -z "${destination}" ]; then - destination='.' - fi - - # check that its not here already - file_exists=`ls ${destination}/"$name"_abg.fig 2> /dev/null` - if [ -n "$file_exists" ]; then - if [ "$quiet" != "quiet" ]; then - echo Component $name exists already - no action taken - fi - else - if [ $source = "." ]; then - cp -u *_*.* ${destination} - else - comp_path=`mtt_find $source $2 path_only` - n_found=`echo $comp_path | wc | gawk '{print $2}'` - - if [ "$n_found" = "1" ]; then - echo Copying $2 from $comp_path to ${destination} - cp $comp_path/*_*.* ${destination} - exit 0 - elif [ "$n_found" = "0" ]; then - if [ "$quiet" != "quiet" ]; then - echo Component $2 not found - is MTT_COMPONENTS set correctly? - fi - exit 1 - elif [ "$n_found" > "1" ]; then - echo "Multiple versions of $2 found (see below) - use a more explicit alias" - mtt -q find $2 - exit 2 - fi - fi - fi - exit -fi - -# Copy CRs from the library -if [ "$1" = "crcopy" ]; then - # check that its not here already (or a _cr.r version) - file_exists=`ls $2.cr $2_cr.r 2> /dev/null` - if [ -n "$file_exists" ]; then - if [ "$quiet" != "quiet" ]; then - echo $2.cr or $2_cr.r exists already - no action taken - fi - else - path_name=$3 - if [ -z "$path_name" ]; then - path_name="" - for path in `echo $MTT_CRS | sed 's/:/ /g'`; do - path_name="$path_name $path/r" - done - fi - echo Copying CR $2 to here from $3 - find $path_name -name "$2.cr" -exec cp {} . \; - fi - exit -fi - - -# Version control -VC='' - -if [ "$3" = "vc" ]; then - tidy=untidy; - if [ -n "$4" ]; then - log_message=$4 - else - log_message="No Message" - fi - case $2 in - abg ) - VC='ok' - VCext='fig' ;; - lbl ) - VC='ok' - VCext='txt' ;; - desc ) - VC='ok' - VCext='tex' ;; - simp ) - VC='ok' - VCext='r' ;; - rep ) - VC='ok' - VCext='txt' ;; - numpar ) - VC='ok' - VCext='txt' ;; - input ) - VC='ok' - VCext='txt' ;; - state ) - VC='ok' - VCext='txt' ;; - odes ) - VC='ok' - VCext='h' ;; - sspar ) - VC='ok' - VCext='r' ;; - *) - echo Version control is not appropriate for representation $2 - exit ;; - esac -fi - -# Classify the representation - needed for conversion route to postscript -PLOTTYPE='single'; -case $2 in - abg ) - REPTYPE='bg' ;; - labg ) - REPTYPE='lbg' ;; - sabg ) - REPTYPE='bg' ;; - cbg ) - REPTYPE='bg' ;; - input ) - REPTYPE='txt' ;; - numpar ) - REPTYPE='txt' ;; - state ) - REPTYPE='txt' ;; - simpar ) - REPTYPE='txt' ;; - obspar ) - REPTYPE='txt' ;; - odes) - REPTYPE='data'; PLOTTYPE='multiple' ;; - odeso) - REPTYPE='data'; PLOTTYPE='multiple' ;; - sms) - REPTYPE='data'; PLOTTYPE='multiple' ;; - smso) - REPTYPE='data'; PLOTTYPE='multiple' ;; - odess) - REPTYPE='data' ;; - odesso) - REPTYPE='data' ;; - daes) - REPTYPE='data'; PLOTTYPE='multiple' ;; - daeso) - REPTYPE='data'; PLOTTYPE='multiple' ;; - ir) - REPTYPE='data' ;; - iro) - REPTYPE='data' ;; - sr) - REPTYPE='data' ;; - sro) - REPTYPE='data' ;; - fr) - REPTYPE='data' ;; - lmfr) - REPTYPE='data' ;; - lpfr) - REPTYPE='data' ;; - nyfr) - REPTYPE='data' ;; - nifr) - REPTYPE='data' ;; - *) - REPTYPE='tex' ;; -esac - - -## Set up the main arguments -sys=$1 -rep=$2 -lang=$3 - -## Make ps pdf if -pdf set -if [ "$lang" = "ps" ]; then - lang=$ps -fi - - -# Create some strings -Subsystem=$1$subsystem; - -Subsystem_=$Subsystem"_" -Subsystem_ese=$Subsystem"_ese" -Subsystem_def=$Subsystem"_def" -Subsystem_rdae=$Subsystem"_rdae" -Subsystem_dae=$Subsystem"_dae" -Subsystem_subs=$Subsystem"_subs" -Subsystem_cr=$Subsystem"_cr" -Subsystem_cbg=$Subsystem"_cbg" - - -## Create the make target name -if [ -z "${using_oct}" ]; then - target=${sys}_${rep}.${lang} -else - set_oct; - if [ "${lang}" = "m" ]; then - target=${sys}_${rep}.${m} - else - target=${sys}_${rep}.${lang} - fi -fi - -##echo $target -##target=${sys}_${rep}.${lang} - -## Arguments -ARGS=$4; _ARGS=-$4; __ARGS=`echo $_ARGS | tr ',' '-'` -__ARGS="${MTT_SWITCHES}${__ARGS}" -__ARGS=`echo ${__ARGS} | sed -e 's/-q//g' -e 's/-u//g'` - -# Save up the argument list in a file; but only if argument has changed -#DIFF doesn't like empty files - so put a blank if empty -#if [ -z "$ARGS" ]; then -# ARGS=' '; -# _ARGS=''; -#fi - -#cat > $1_args.new </dev/null` - -#if [ -n "$DIFF" ]; then -# mv $1_args.new $1_args.m -#fi - -## If in MTT_work, then copy from -dr read dirs -this_dir=`basename $PWD` -if [ "${this_dir}" = "MTT_work" ]; then - # Copy from read dirs to MTT_work - for dir in ${read_dirs}; do - if [ -n "$Verbose" ]; then - echo Copying ${dir}/* - cp --force ${dir}/* . - else - cp --force ${dir}/* . 2> /dev/null - fi - read_files=`echo ${dir}/*` - for read_file in ${read_files}; do - read_file_name=`basename ${read_file}` - touch ${read_file_name} - done - done -fi - -# Tidy mode - operate in the directory MTT-work -if [ "$tidy" = "tidy" ] && [ "$level" = "0" ]; then - # make sure that a system exists in this directory - if [ "${sys}_${rep}.${lang}" != "${sys}_abg.dia" ] && [ "${sys}_${rep}.${lang}" != "${sys}_abg.fig" ]; then - nabgs=`ls ${sys}_abg.* 2>/dev/null | wc -l` - if [ $nabgs -eq 0 ]&&[ -z "$sensitivity" ]; then - echo "MTT Error: System $sys does not exist" - exit -1; - fi - fi - mkdir -p MTT_work - valid_files=`ls | grep -v '^MTT'` - ##cp -p -u Makefile Make *.* .* MTT_work 2>/dev/null - cp -p -u -R --force ${valid_files} MTT_work 2>/dev/null - - # Go to MTT_work - cd MTT_work - - if [ -f ".octaverc" ]; then - touch .octaverc - else - echo Copying .octaverc - cp $MTT_LIB/octave/.octaverc . - fi - - if [ -f "useful-functions.hh" ]; then - touch useful-functions.hh - else - echo Copying useful-functions.hh - cp $MTT_CC/include/useful-functions.hh . - fi - - if [ -z "$directory" ]; then - Directory='' - else - Directory=$directory/MTT_work - fi - - mtt -u -q $mtt_switches -S "$Directory" $1 $2 $3 $4 - mtt_status=$? - - # Exit on failure - if [ "$mtt_status" != "0" ]; then - echo Exiting MTT with error $mtt_status - exit 1 - fi - - # Copy back from working directory - if [ "$3" != "view" ] && [ "$3" != "hview" ] && [ -z "$reset" ]; then - if [ "$3" = "html" ]; then - echo Moving $1_$2 - mv $1_$2 .. - else - if [ "$PLOTTYPE" = "multiple" -a -f $1_$2__ARGS.$ps ]; then - echo Copying $1_$2$__ARGS.$ps - cp $1_$2$__ARGS.$ps .. - else - if [ -f $1$subsystem"_"$2.$lang ]; then - echo Copying $1$subsystem"_"$2.$lang - cp -p -u $1$subsystem"_"$2.$lang .. - fi - fi - fi - fi - - # Remove the MTT_work directory if very tidy - if [ "$verytidy" = "verytidy" ]; then - echo Removing all working files - rm -rf ../MTT_work - fi -exit -fi - -# User defined representations -## Copy from library if not already here - -## .make versions -if [ -f "$MTT_REP/$2_rep.make" ]; then - if [ -f "$2_rep.make" ]; then - echo Using $2_rep.make - else - echo Copying $2_rep.make from $MTT_REP - cp $MTT_REP/$2_rep.make . - fi -fi - -if [ -f "$2_rep.make" ]; then - if [ -n "$4" ]; then - filename=$1_$2-$4.$3 - else - filename=$1_$2.$3 - fi - - #if [ -f "$filename" ]; then - # echo $filename exists - #else - if [ ! -f "$2_rep.make.ignore" ]; then - if [ -n "$Verbose" ]; then - echo make -s -f $2_rep.make "MTT_SYS=$1" "MTT_LANG=$3" "MTT_ARG=$4" "MTT_OPTS=$mtt_switches" - fi - make -s -f $2_rep.make "MTT_SYS=$1" "MTT_LANG=$3" "MTT_ARG=$4" "MTT_OPTS=$mtt_switches" - if [ -n "$4" ]; then - echo Copying $1_$2$__ARGS.$ps - cp $1_$2$__ARGS.$ps .. - fi - #fi - exit - fi -fi - -## Check for pre version 4.0 integration method specification. -if [ $level = "0" ]; then - if [ -f "$1_simpar.txt" ]; then - method_line=`grep -i METHOD $1_simpar.txt` - if [ -n "`echo $method_line | grep -i euler`" ]; then - echo Obsolete $1_simpar.txt contains: $method_line - echo " please use mtt -i euler in future" - mtt_switches="$mtt_switches -i euler"; - elif [ -n "`echo $method_line | grep -i implicit`" ]; then - echo Obsolete $1_simpar.txt contains: $method_line - echo " please use mtt -i implicit in future" - mtt_switches="$mtt_switches -i implicit"; - fi - fi -fi - -if [ -n "$reset" ]; then - if [ -f "$1_$2.$3" ]; then - echo Resetting time stamp on $1_$2.$3 - touch $1_$2.$3 - else - echo $1_$2.$3 does not exist - no action taken - fi - exit; -fi - - -if [ -n "$sensitivity" ]; then - sys_s=`echo $1 | cut -c 2-` - sys_abg=${sys_s}_abg -fi - -## Check octave version -case `$MATRIX --version | gawk -F\. '{print $2}'` in - 0) define_octave_dev="";; # stable - 1) define_octave_dev="-DOCTAVE_DEV";; # development - *) define_octave_dev="-DOCTAVE_DEV";; -esac - -################################ -# This is the main mtt programme -################################ - -#echo Target is $target, Subsystem is $Subsystem, options are $mtt_switches -##<<<<<<< mtt -##$MAKE -S ${trace} ${verbose} -f - ${target} << EOF -##======= -##$MAKE -S $verbose $verbose_make -f - $target << EOF -##>>>>>>> 1.316 -$MAKE -S ${trace} $verbose $verbose_make -f - $target << EOF - -# Cancel implicit rules I don't want -%.dvi: %.tex - -# MTT implicit rules -## .oct files -$1_%.oct: $1_%.cc $1_def.h $1_sympar.h $1_cr.h - echo Creating $1_\$*.oct; $MKOCTFILE ${MTT_CXXINCS} -DCODEGENTARGET=OCTAVEDLD $1_\$*.cc - -## pdf files from ps (new version) -$1_%.pdf: $1_%.ps - echo Creating $1_\$*.pdf; ps2pdf $1_\$*.ps $1_\$*.pdf - -## eps from ps (NB ps files are actually eps anyway) -$1_%.eps: $1_%.ps - echo Creating $1_\$*.eps; cp $1_\$*.ps $1_\$*.eps - -.PRECIOUS: mtt_%.oct -.PRECIOUS: $1_%.oct -mtt_%.oct: mtt_%.cc - echo Compiling \$< - ${MKOCTFILE} ${MTT_CXXINCS} -DCODEGENTARGET=OCTAVEDLD $define_octave_dev \$< - -## .mex files -$1_%.mexglx: $1_%.cc $1_def.h $1_sympar.h $1_cr.h mtt_kpathsea.cc mtt_matlab_octave.cc mtt_matlab_octave.hh - echo Creating $1_\$*.mexglx - ${MTT_CXX} -shared -o $1_\$*.mexglx $1_\$*.cc \ - ${MTT_MATLAB_FLAGS} -DCODEGENTARGET=MATLABMEX \ - ${MTT_CXXINCS} ${MTT_CXXLIBS} ${MTT_CXXFLAGS} mtt_kpathsea.cc mtt_matlab_octave.cc - -## .cc files -.PRECIOUS: %.cc # Don't let mtt delete them -.PRECIOUS: $1_%.cc # Don't let mtt delete them -$1_%.cc: $1_%.m - mtt_m2cc.sh $1 \$* cc cat - -mtt_%.cc:: ${MTT_LIB}/cc/mtt_%.cc - cp ${MTT_LIB}/cc/mtt_\$*.cc mtt_\$*.cc - -mtt_%.hh:: ${MTT_LIB}/cc/mtt_%.hh - cp ${MTT_LIB}/cc/mtt_\$*.hh mtt_\$*.hh - -## .o files -.PRECIOUS: $1_%.o -$1_%.o: $1_%.cc $1_def.h $1_sympar.h $1_cr.h - echo Compiling $1_\$*.cc - ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $< -DCODEGENTARGET=STANDALONE - -.PRECIOUS: mtt_%.o -mtt_%.o: mtt_%.cc - echo Compiling mtt_\$*.cc - ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $< -DCODEGENTARGET=STANDALONE $define_octave_dev - -# Copy aliased subsystems -$1_aliased_subsystems_copied: - lbl2component $1 | sh || exit 1 # Grab specified components now - touch $1_aliased_subsystems_copied - -# Generates code to write reduce code -$1_ode_write.r: $1_def.m - def2write_r $1 $2 $computation - -ifeq ("$sensitivity","sensitivity") -ifeq ("$level","0") -$1_abg.fig: $sys_abg.fig - abg2sensitivity_fig $sys_s -else # Either find the sensitivity model or fetch the model and create sensitivity model -$1_abg.fig: - mtt -q -u $mtt_switches compcopy $1 || abg2sensitivity_fig $sys_s -endif -endif - -ifneq ("$sensitivity","sensitivity") -ifneq ("$level","0") -# If level>0, try and get subsystem files; creating if necessary -ifneq ("\$(wildcard $1_abg.dia)","$1_abg.dia") -$1_abg.fig: - mtt -q -u $mtt_switches compcopy $1 -else -$1_abg.fig: -endif -endif -endif - -# Create an arg file if it doesn't exist -$1_args.m: - touch $1_args.m - -#Create list of components -ifeq ("\$(wildcard $1_abg.dia)","$1_abg.dia") -$1_cmp.txt: $1_abg.dia - abg2cmp_dia2txt $1 -else -$1_cmp.txt: $1_abg.fig - abg2cmp_fig2txt $1 -endif - -#Create skeleton files (with titles) if not already there -#SUMMARY lbl* label file (txt) -#SUMMARY lbl label file (txt) -#SUMMARY lbl* label file (view) -#SUMMARY lbl label file (view) -#SUMMARY lbl* label file (tex) -#SUMMARY lbl label file (tex) -$1_lbl.txt: $1_cmp.txt - cmp2lbl_txt $1 $sensitivity - touch $1_lbl.txt - -$1_lbl.tex: $1_lbl.txt - lbl_txt2tex $1 - -#SUMMARY alias name aliases for each subsystem (txt) -$1_alias.txt: $1_lbl.txt - lbl2alias_txt2txt $1 - -#SUMMARY modpar name modulated parameters for each subsystem (txt) -$1_modpar.txt: $1_lbl.txt - lbl2modpar_txt $1 - -#SUMMARY modpar name modulated parameters for each subsystem (r) -$1_modpar.r: $1_modpar.txt $1_struc.txt - modpar_txt2r $1 - -#SUMMARY alias name aliases for each subsystem (m) -$1_alias.m: $1_alias.txt - alias_txt2m $1 - -##SUMMARY icd interface definition for system (c) -##SUMMARY icd interface definition for system (cc) -##SUMMARY icd interface definition for system (m) -##SUMMARY icd interface definition for system (txt) - -$1_ICD.c: $1_ICD.txt - ICD_txt2lang.sh $1 c - -$1_ICD.cc: $1_ICD.txt - ICD_txt2lang.sh $1 cc - -$1_ICD.m: $1_ICD.txt - ICD_txt2lang.sh $1 m - -$1_ICD.txt: $1_icd.txt2 - icd2ICD_txt22txt.sh $1 - -$1_icd.txt2: $1_ese.r - touch $1_icd.txt2 - -#SUMMARY icd interface definitions for each subsystem (m) -$1_icd.m: $1_icd.txt - icd_txt2m.sh $1 - -#SUMMARY icd interface definitions for each subsystem (txt) -$1_icd.txt: $1_lbl.txt - lbl2icd_txt2txt.sh $1 - -#SUMMARY cr constitutive relationship for each subsystem (txt) -$1_cr.txt: $1_abg.m $1_sub.sh - abg2cr_m2txt $1 - - if [ "$level" = "0" ]; then \ - mv $1_cr.txt MTT_cr.txt; \ - else \ - cat $1_cr.txt >> MTT_cr.txt; \ - fi - - sh $1_sub.sh "rm -f " '_cr.txt' # Remove the txt.cr files - sh $1_sub.sh "mtt $mtt_switches -q -u -l $level+1 " ' cr txt' #Create new ones - - if [ "$level" = "0" ]; then \ - sort -u MTT_cr.txt> $1_cr.txt; \ - fi - -#SUMMARY cr constitutive relationship for each subsystem (r) -$1_cr.r: $1_cr.txt - cr_txt2r $1 - -#SUMMARY cr constitutive relationship header (c) -$1_cr.h: - echo Creating $1_cr.h - echo "/* CR headers for system $1 */" > $1_cr.h - -# Cheat a bit and use the top level cr file for the subsystem as well -ifneq ($sub,) -$Subsystem_cr.r: $1_cr.r - echo Creating $Subsystem_cr.r "(copying $1_cr.r)" - cp $1_cr.r $Subsystem_cr.r -endif -#SUMMARY cr constitutive relationship for each subsystem (tex) -#SUMMARY cr constitutive relationship for each subsystem (view) -$1_cr.tex: $1_cr.r - txt2tex $1 cr r - -#SUMMARY sympar symbolic parameters (txt) -#SUMMARY sympar* symbolic parameters (view) -$1_sympar.txt: $1_type.sh $1_abg.m $1_aliased.txt - mtt_make_sympar $1 ${use_reduce} - -#SUMMARY sympar symbolic parameters (r) -$1_sympar.r: $1_sympar.txt - sympar_txt2r $1 -$1_sympar.m: $1_sympar.txt - sympar_txt2m $1 -ifneq ($sort_method,make) -$1_sympar.h: $1_sympar.txt - sympar_txt2h.sh $1 $num_tmp_var -else -$1_sympar.h: $1_sympar.txt $1_sese.make - sympar_txt2h.sh $1 $num_tmp_var - declaration="static double" \ - make -f $1_sese.make declare_tmpvars |\ - tr [A-Z] [a-z] >> \$@ -endif - -#SUMMARY sympar symbolic parameters (c) -# txt to c sympar conversion -$1_sympar.c: $1_sympar.txt - sympar_txt2c $1 - -#SUMMARY sympar symbolic parameters (tex) -# txt to tex (LaTeX) sympar conversion -$1_sympar.tex: $1_sympar.txt - sympar_txt2tex $1 - -#SUMMARY logic Dynamic switch logic (tex) -#SUMMARY logic Dynamic switch logic (view) -$1_logic.tex: $1_logic.txt - txt2tex $1 logic txt - - -#SUMMARY switch Dynamic switch information (txt) -$1_switch.txt: $1_struc.txt - struc2switch_txt $1 -#$1_switchopen.m: $1_switch.txt $1_sympars.txt $1_logic.txt -# switch_txt2m $1 - -#SUMMARY sympars sympar + dynamic switch information (txt) -$1_sympars.txt: $1_sympar.txt $1_switch.txt - echo Creating $1_sympars.txt - cat $1_sympar.txt $1_switch.txt > $1_sympars.txt - -#SUMMARY simp simplification information (r) -$1_simp.r: - echo Creating $1_simp.r - ( \ - echo "%% Reduce commands to simplify output for system $1 ($1_simp.r)"; \ - cat $MTTPATH/trans/m/rcs_header.txt; \ - echo 'ON ALLFAC; %Multiplicative factors'; \ - echo 'OFF DIV; %Polynomial division'; \ - echo 'OFF FACTOR; %Factorise polynomials'; \ - echo 'OFF LIST; %Each term on a new line'; \ - echo 'FOR ALL x,y LET pow(x,y) = x^y; %Readable pow function'; \ - echo 'END;'; \ - )> $1_simp.r - -#SUMMARY subs algebraic substitution (r) -$Subsystem_subs.r: - mtt $mtt_switches -q -u $1 sympar txt; - makesubs $Subsystem; - -#SUMMARY obspar GPC observability function parameters (r) -$1_obspar.r: - echo Creating $1_obspar.r - ( \ - echo "%% Reduce GPC observability function parameters for system $1 ($1_obspar.r)"; \ - cat $MTTPATH/trans/m/rcs_header.txt; \ - echo 'MTTGPCNy := 5;'; \ - echo 'MTTGPCNu := 0;'; \ - echo 'Matrix MTTdU(5,1);'; \ - echo 'MTTdU(1,1) := MTTdU1;'; \ - echo 'MTTdU(2,1) := MTTdU2;'; \ - echo 'MTTdU(3,1) := MTTdU3;'; \ - echo 'MTTdU(4,1) := MTTdU4;'; \ - echo 'MTTdU(5,1) := MTTdU5;'; \ - echo 'Matrix MTTUU(1,5);'; \ - echo 'MTTUU(1,1) := MTTu1;'; \ - echo 'MTTUU(1,2) := MTTu11;'; \ - echo 'MTTUU(1,3) := MTTu12;'; \ - echo 'MTTUU(1,4) := MTTu13;'; \ - echo 'MTTUU(1,5) := MTTu14;'; \ - echo 'END;'; \ - )> $1_obspar.r - -#SUMMARY simpar simulation information (txt) -$1_simpar.txt: - echo Creating $1_simpar.txt - ( \ - echo '# -*-octave-*- Put Emacs into octave-mode'; \ - echo "# Simulation parameters for system $1 ($1_simpar.txt)"; \ - echo "# Generated by MTT on" `date`.; \ - cat $MTTPATH/trans/rcs_header.sh; \ - echo ;\ - echo 'FIRST = 0.0; # First time in simulation output'; \ - echo 'DT = 0.1; # Print interval'; \ - echo 'LAST = 10.0; # Last time in simulation'; \ - echo 'STEPFACTOR = 1; # Integration steps per print interval'; \ - echo 'WMIN = -1; # Minimum frequency = 10^WMIN'; \ - echo 'WMAX = 2; # Maximum frequency = 10^WMAX'; \ - echo 'WSTEPS = 100; # Number of frequency steps'; \ - echo 'INPUT = 1; # Index of the input'; \ - )> $1_simpar.txt - -#SUMMARY simpar simulation information (m) -$1_simpar.m: $1_simpar.txt $1_def.r $1_sympar.txt - mtt_txt2m $1 simpar - - -#SUMMARY numpar numerical parameter declaration -- default (txt) -$1_numpar.txt : $1_sympar.txt $1_def.r -ifeq ($target,$1_numpar.txt) - mtt_update $1 numpar update -else - mtt_update $1 numpar -endif - -#SUMMARY state numerical state declaration -- default (txt) -ifeq ($steadystate_computation,yes) -$1_state.txt : $1_struc.txt $1_sympar.txt $1_def.r $1_ss.r -else -$1_state.txt : $1_struc.txt $1_sympar.txt $1_def.r -endif - -ifeq ($target,$1_state.txt) - mtt_update $1 state update -else - mtt_update $1 state -endif - -#SUMMARY input numerical state declaration -- default (txt) -$1_input.txt : $1_struc.txt $1_sympar.txt -ifeq ($target,$1_input.txt) - mtt_update $1 input update -else - mtt_update $1 input -endif - -#SUMMARY logic Dynamic switch logic (txt) -$1_logic.txt : $1_def.r $1_struc.txt $1_sympar.txt -ifeq ($target,$1_logic.txt) - mtt_update $1 logic update -else - mtt_update $1 logic -endif - -# Dummy target -FORCE: - -ifeq ($use_reduce,yes) -$1_ode2odes_common_%.stamp: $1_ae.% $1_input.% $1_logic.% $1_numpar.% $1_simpar.% $1_state.% - touch \$@ -$1_ode2odes_common.o: $1_ae.o $1_input.o $1_logic.o $1_numpar.o $1_simpar.o $1_state.o - @echo "Creating $1_ode2odes_common.o" - ar -cr \$@ \$^ -else -$1_ode2odes_common_%.stamp: $1_sae.% $1_input.% $1_logic.% $1_numpar.% $1_simpar.% $1_state.% - touch \$@ -$1_ode2odes_common.o: $1_sae.o $1_input.o $1_logic.o $1_numpar.o $1_simpar.o $1_state.o - @echo "Creating $1_ode2odes_common.o" - ar -cr \$@ \$^ -endif - -ifeq ($use_reduce,yes) -$1_ode2odes_euler_%.stamp $1_ode2odes_rk4_%.stamp: $1_ode.% $1_odeo.% - touch \$@ -$1_ode2odes_euler.o $1_ode2odes_rk4.o: $1_ode.o $1_odeo.o mtt_euler.o - @echo "Creating \$@" - ar -cr \$@ \$^ -else -$1_ode2odes_euler_%.stamp $1_ode2odes_rk4_%.stamp: $1_sesx.% $1_sesy.% - touch \$@ -$1_ode2odes_euler.o $1_ode2odes_rk4.o: $1_sesx.o $1_sesy.o mtt_euler.o - @echo "Creating \$@" - ar -cr \$@ \$^ -endif - -ifeq ($use_reduce,yes) -$1_ode2odes_implicit_%.stamp: $1_cseo.% $1_csex.% $1_smxa.% $1_smxax.% - touch \$@ -$1_ode2odes_implicit.o: $1_cseo.o $1_csex.o $1_smxa.o $1_smxax.o mtt_implicit.o - @echo "Creating $1_ode2odes_implicit.o" - ar -cr \$@ \$^ -endif # no alternative - -ifeq ($use_reduce,yes) -$1_ode2odes_dassl_oct.stamp: $1_ode.oct $1_odeo.oct mtt_dassl.oct - touch \$@ -$1_ode2odes_dassl_o.stamp: $1_ode.o $1_odeo.o mtt_dassl.o - touch \$@ -$1_ode2odes_dassl_%.stamp: $1_ode.% $1_odeo.% - touch \$@ -$1_ode2odes_dassl.o: $1_ode.o $1_odeo.o mtt_dassl.o - @echo "Creating \$@" - ar -cr \$@ \$^ -else -$1_ode2odes_dassl_oct.stamp: $1_sesx.oct $1_sesy.oct mtt_dassl.oct - touch \$@ -$1_ode2odes_dassl_o.stamp: $1_sesx.o $1_sesy.o mtt_dassl.o - touch \$@ -$1_ode2odes_dassl_%.stamp: $1_sesx.% $1_sesy.% - touch \$@ -$1_ode2odes_dassl.o: $1_sesx.o $1_sesy.o mtt_dassl.o - @echo "Creating \$@" - ar -cr \$@ \$^ -endif - -$1_ode2odes_${algebraic_solver}.cc: mtt_Solver.cc mtt_AlgebraicSolver.cc mtt_${algebraic_solver}.hh mtt_${algebraic_solver}.cc - -$1_ode2odes_${algebraic_solver}.o: mtt_Solver.o mtt_AlgebraicSolver.o mtt_${algebraic_solver}.o - @echo "Creating $1_ode2odes_${algebraic_solver}.o" - ar -cr \$@ \$^ - -#SUMMARY numpar numerical parameter declaration (m) -$1_numpar.m: $1_numpar.txt $1_sympars.txt - mtt_txt2m $1 numpar - -#SUMMARY numpar numerical parameter declaration (c) -#SUMMARY numpar numerical parameter declaration (view) -$1_numpar.c: $1_numpar.txt $1_sympar.c - txt2c $1 numpar - - - -#SUMMARY logic logic input declaration (m) -$1_logic.m: $1_logic.txt $1_switch.txt - mtt_txt2m $1 logic - -#SUMMARY state state declaration -- default (txt) -#$1_state.txt: -# mtt $mtt_switches $1 struc txt; -# mtt $mtt_switches $1 ss r; -# struc2state_txt2txt $1 - -#SUMMARY state state declaration (m) -$1_state.m: $1_state.txt $1_sympars.txt - mtt_txt2m $1 state - -#SUMMARY desc Verbal description of system (tex) -$1_desc.tex: - makedesc $1 - - -#SUMMARY params symbolic parameter setting (r) - $1_params.r: - echo Creating $1_params.r - ( \ - echo "%% Parameter file for system $1 ($1_params.r)"; \ - echo "%% This file provides symbolic parameters for simplification";\ - cat $MTTPATH/trans/m/rcs_header.txt; \ - echo 'END;'; \ - )> $1_params.r - - -#SUMMARY sspar steady-state definition (r) -$1_sspar.r: - struc2sspar_txt2r $1 - -#SUMMARY sspar steady-state parameters (tex) -#SUMMARY sspar steady-state parameters (view) -$1_sspar.tex: $1_sspar.r - txt2tex $1 sspar r - -#SUMMARY rep* report (txt) -#SUMMARY rep report (tex) -#SUMMARY rep* report (view) -#SUMMARY rep* report (html) - - -ifeq ($documenttype,book) -$1_rep.txt: - dir2rep $1 $dotdot; -else -$1_rep.txt: - makerep_txt $1; -endif - -#SUMMARY rbg raw bond graph (m) -#Raw bond graph: fig file to mfile -$1_rbg.m: $1_abg.fig $1_lbl.txt - rbg_fig2m $1 $no_alpha_sort - -$1_cmp.m: $1_lbl.txt $1_cmp.txt - lbl2cmp_txt2m.pl --sys=$1 --$debug - -$1_fig.fig: $1_rbg.m - -#SUMMARY sabg stripped acausal bond graph (fig) -#SUMMARY sabg stripped acausal bond graph (ps) -#SUMMARY sabg stripped acausal bond graph (view) -$1_sabg.fig: $1_rbg.m - -#SUMMARY labg latex-ready acausal bond graph (fig) -$1_labg.fig: $1_rbg.m -$1_labg.tex: $1_labg.fig - fig2dev -L pstex_t -p $1_labg.eps $1_labg.fig $1_labg.tex - fig2dev -L pstex $1_labg.fig $1_labg.eps - cp -v $1_labg.eps .. - -#Subsystem creation commands -#SUMMARY sub Executable subsystem list (sh) -ifeq ($start_at_abg,yes) -$1_sub.sh: $1_abg.m - abg2sub_m2sh $1 -else -$1_sub.sh: $1_cmp.txt $1_aliased_subsystems_copied - cmp2sub_txt2sh $1 -endif - -#SUMMARY sub LaTeX subsystem list (tex) -#SUMMARY sub subsystem list (ps) -#SUMMARY sub subsystem list (view) -$1_sub.tex: $1_sub.sh -ifeq ($documenttype,section) - sub_sh2tex $1 -else - sub_sh2tex -l $1 -endif - -#SUMMARY abg acausal bond graph (m) -#Raw bond graph to acausal bond graph: mfile - -ifneq ($start_at_abg,yes) -$1_abg.m: $1_ibg.m $1_cmp.m $1_lbl.txt $1_alias.m $1_sub.sh $1_icd.m - @echo "Creating \$@" - (sh $1_sub.sh "mtt $mtt_switches -q -u -l $level+1 " ' abg m null || exit 1') || exit 1 - ibg2abg_m $info_switch $1 -endif - -ifeq ("\$(wildcard $1_abg.dia)","$1_abg.dia") -$1_ibg.m: $1_abg.dia $1_alias.m - abg2ibg_dia2m $1 -else -$1_ibg.m: $1_abg.fig $1_rbg.m - @echo "Creating \$@" - rbg2ibg_m $info_switch $1 -endif - -$1_connections.dat: $1_abg.m - abg2connections_m2dat $1 - -#SUMMARY cbg* causal bond graph (m) -#Acausal bond graph to causal bond graph: mfile -$1_cbg.m: $1_abg.m - abg2cbg_m $info_switch $causality_switch $1 - -$1_type.sh: $1_cbg.m - touch $1_type.sh - -#SUMMARY cbg* causal bond graph (fig) -#SUMMARY cbg* causal bond graph (dia) -#SUMMARY cbg* causal bond graph (ps) -#SUMMARY cbg* causal bond graph (view) -#Causal bond graph: mfile to fig conversion -$1_cbg.fig: $1_cbg.m $1_fig.fig $1_type.sh - sh $1_type.sh 'echo cbg_m2fig ' ' ' ' ' | sh - -$1_cbg.dia: $1_cbg.m - @sh $1_type.sh 'cbg_m2dia ' ' ' ' ' - -#SUMMARY ese elementary system equations (r) -#SUMMARY def definitions - system orders etc. (r) -#SUMMARY def definitions - system orders etc. (m) -#SUMMARY def definitions - system orders etc. (h) -#SUMMARY struc* structure - list of inputs, outputs and states (txt) -#SUMMARY struc structure - list of inputs, outputs and states (tex) -#SUMMARY struc* structure - list of inputs, outputs and states (view) -#SUMMARY sum structure summary - matrix of inputs, outputs and states (tex) -#SUMMARY sum* structure summary - matrix of inputs, outputs and states (view) -#Elementary system equations + definitions -${sys}_ese.r: ${sys}_cbg.m - cbg2ese_m2r $partition $info_switch $Subsystem; #ese_tidy $1 - -ifeq ($sort_method,seqn) -${sys}_sese.m: ${sys}_def.r ${sys}_sese.r ${sys}_sympar.txt - echo Creating \$@ - mtt_r2m ${sys} sese m -${sys}_sese.r: ${sys}_cbg.m ${sys}_struc.m - echo Creating \$@ - cbg2sese_m2r $info_switch $Subsystem -endif - -ifeq ($sort_method,make) -${sys}_sesx.m: ${sys}_def.r ${sys}_sesx.r ${sys}_sympar.txt - echo Creating \$@ - mtt_r2m ${sys} sesx m -${sys}_sesy.m: ${sys}_def.r ${sys}_sesy.r ${sys}_sympar.txt - echo Creating \$@ - mtt_r2m ${sys} sesy m -${sys}_sae.m: ${sys}_def.r ${sys}_sae.r ${sys}_sympar.txt - echo Creating \$@ - mtt_r2m ${sys} sae m - -${sys}_sese.r: ${sys}_sese.make - echo Creating \$@ - make -f \$< MTTdX MTTy > \$@ - echo 'END;' >> \$@ -${sys}_sesx.r: ${sys}_sese.make - echo Creating \$@ - make -f \$< MTTdX > \$@ -${sys}_sesy.r: ${sys}_sese.make - echo Creating \$@ - make -f \$< MTTy > \$@ -${sys}_sae.r: ${sys}_sese.make - echo Creating \$@ - make -f \$< MTTyz > \$@ - -${sys}_sese.make: ${sys}_ese.txt - echo Creating \$@ - ese_txt2make.pl --sys=${sys} --infile=${sys}_ese.txt --outfile=\$@ --$debug - -${sys}_ese.txt: ${sys}_ese.r ${sys}_cr.txt perl_crs.stamp - echo Creating \$@ - ese_r2txt.pl < \$< |\ - apply_crs ${sys} > \$@ - -perl_crs.stamp: - echo Copying CRs from ${MTT_LIB}/cr/perl - mkdir -p mtt - cp ${MTT_LIB}/cr/perl/*.pm mtt/ - touch \$@ -endif - -$1_def.r: $1_ese.r - touch $1_def.r -$1_struc.txt: $1_ese.r - touch $1_struc.txt -$1_aliased.txt: $1_ese.r - touch $1_aliased.txt -$1_struc.tex: $1_struc.txt - struc_txt2tex $1 -$1_sum.tex: $1_struc.txt - struc2sum_txt2tex $1 -$1_struc.m: $1_struc.txt - struc_txt2m $1 -$1_def.m: $1_def.r - def_r2m $1; matlab_tidy $1_def.m; -$1_def.h: $1_def.m $1_sympar.txt - def_m2h.sh $1 - -#SUMMARY rdae raw differential-algebraic equations (r) -#SUMMARY dae differential-algebraic equations (r) -#SUMMARY dae* differential-algebraic equations (m) -#SUMMARY dae differential-algebraic equations (tex) -#SUMMARY dae* differential-algebraic equations (view) -#SUMMARY dae differential-algebraic equations (ps) -#Differential-algebraic equations - -ifeq ($do_sort,) -${sys}_rdae.r: ${sys}_ese.r ${sys}_def.r $1_modpar.r ${Subsystem}_cr.r ${Subsystem}_subs.r -else -${sys}_rdae.r: ${sys}_sese.r ${sys}_def.r $1_modpar.r ${Subsystem}_cr.r ${Subsystem}_subs.r -endif -ifneq ($partition,) - echo Doing subsystems - mtt_make_subsystems ${sys} rdae r -endif - mtt_prepend.sh -p $1_modpar.r $1_ese.r # Add modulated parameters to start - ese2rdae_r ${cr_first} ${fixcc} ${do_sort} ${Subsystem} - tidy ${Subsystem}_rdae.r - -${sys}_dae.r: ${Subsystem}_rdae.r ${Subsystem}_def.r ${Subsystem}_subs.r ${Subsystem}_cr.r -ifneq ($partition,) - echo Doing subsystems - mtt_make_subsystems ${sys} dae r -endif -ifeq ($rdae_is_dae,1) - echo Copying $1_rdae.r to $1_dae.r - cp $1_rdae.r $1_dae.r -else - rdae2dae_r ${fixcc} ${Subsystem}; tidy ${Subsystem}_dae.r -endif - -$1_dae.m: $1_def.r $1_dae.r $1_sympars.txt - dae_r2m $1; matlab_tidy $1_dae.m; matlab_tidy $1_daeo.m -$1_dae.c: $1_def.r $1_dae.r $1_sympar.r - dae_r2c $1; c_tidy $1_dae.c -$1_dae.tex: $1_dae.r $1_simp.r - dae_r2tex $partition $1; latex_tidy $1_dae.tex - -#SUMMARY ae algebraic equations - unknown inputs (r) -#SUMMARY ae algebraic equations - unknown inputs (m) -#SUMMARY ae algebraic equations - unknown inputs (cc) - -ifeq ($algebraic_solver,noAlgebraicSolver) -$1_ae.r: -else -$1_ae.r: $1_cse.r -endif - touch \$@ - -$1_ae.m: $1_ae.r - mtt_r2m $1 ae - -#SUMMARY cse constrained-state equations (r) -#SUMMARY cse* constrained-state equations (m) -#SUMMARY cse* constrained-state equations (oct) -#SUMMARY cse constrained-state equations (tex) -#SUMMARY cse* constrained-state equations (view) -#SUMMARY cse constrained-state equations (ps) -#Constrained-state equations -${sys}_cse.r: ${Subsystem}_dae.r ${Subsystem}_dae.r ${Subsystem}_def.r ${Subsystem}_subs.r -ifneq ($partition,) - echo Doing subsystems - mtt_make_subsystems ${sys} cse r -endif - dae2cse_r $fixcc $optimise $Solve ${Subsystem}; tidy ${Subsystem}_cse.r #$1_subs.r -$1_csex.r: $1_cse.r - touch $1_csex.r -$1_cseo.r: $1_cse.r - touch $1_cseo.r - -#$1_cse.m: $1_def.r $1_cse.r $1_sympar.r $1_subs.r -# cse_r2m $1; matlab_tidy $1_cse.m -${sys}_cse.m: ${Subsystem}_def.r ${Subsystem}_cse.r ${sys}_sympars.txt -ifneq ($partition,) - echo Doing subsystems - mtt_cp_subrep ${sys} sympars txt - mtt_make_subsystems ${sys} cse m -endif - mtt_r2m ${Subsystem} cse;# matlab_tidy $1_cse.m; matlab_tidy $1_cseo.m; - -${sys}_cseo.m: ${Subsystem}_def.r ${Subsystem}_cseo.r ${sys}_sympars.txt -ifneq ($partition,) - echo Doing subsystems - mtt_cp_subrep ${sys} sympars txt - mtt_make_subsystems ${sys} cseo m -endif - mtt_r2m ${Subsystem} cseo - -${sys}_csex.m: ${Subsystem}_def.r ${Subsystem}_csex.r ${sys}_sympars.txt -ifneq ($partition,) - echo Doing subsystems - mtt_cp_subrep ${sys} sympars txt - mtt_make_subsystems ${sys} csex m -endif - mtt_r2m ${Subsystem} csex - -$1_cse.tex: $1_cse.r $1_sympar.r $1_simp.r - cse_r2tex $1 $2; latex_tidy $1_cse.tex - - -#SUMMARY scse sensitivity constrained-state equations (r) -#SUMMARY scse sensitivity constrained-state equations (tex) -#SUMMARY scse sensitivity constrained-state equations (ps) - -$1_scse.r: $1_cse.r $1_def.r - cse2scse_r $1 "$4"; tidy $1_scse.r - -#$1_cse.m: $1_def.r $1_cse.r $1_sympar.r $1_subs.r -# cse_r2m $1; matlab_tidy $1_cse.m -$1_scse.m: $1_def.m $1_scse.r $1_sympars.txt - mtt_r2m $optimise -parameters $1 scse; - matlab_tidy $1_scse.m; matlab_tidy $1_scseo.m; - -$1_scse.tex: $1_scse.r $1_sympar.r $1_simp.r - cse_r2tex $1 $2; latex_tidy $1_scse.tex - - -#SUMMARY ode ordinary differential equations (r) -#SUMMARY ode* ordinary differential equations (m) -#SUMMARY ode ordinary differential equations (c) -#SUMMARY ode ordinary differential equations (tex) -#SUMMARY ode* ordinary differential equations (view) -#SUMMARY ode ordinary differential equations (ps) -#SUMMARY ode ordinary differential equations (oct) -#Ordinary differential equations - -ifeq ($dae_is_ode,1) -$1_ode.r: $1_dae.r - echo Copying $1_dae.r to $1_ode.r - cp $1_dae.r $1_ode.r -else -$1_ode.r: $1_cse.r $1_cseo.r $1_def.r $1_sympar.r $1_subs.r - cse2ode_r $optimise $1; tidy $1_ode.r -endif - -$1_odeo.r: $1_ode.r - touch $1_odeo.r - -$1_ode.m: $1_def.r $1_ode.r - mtt_r2m $optimise -parameters $1 ode m; # matlab_tidy $1_ode.m -$1_odeo.m: $1_def.r $1_odeo.r - mtt_r2m $1 odeo m - -$1_odea.m: $1_ode.m - touch $1_odea.m - -$1_ode.tex: $1_ode.r $1_sympar.r $1_simp.r - ode_r2tex $1; latex_tidy $1_ode.tex - - -$1_lde.r: $1_dae.r - dae2lde_r $optimise $1; tidy $1_lde.r - -$1_lde.tex: $1_lde.r $1_sympar.r $1_simp.r - lde_r2tex $1; latex_tidy $1_lde.tex - -# The main simulation programme -ifeq ($integration_method,implicit) -$1_ode2odes.m : $1_def.r $1_sympars.txt \ - $1_smxa.m $1_smxax.m\ - $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ - $1_csex.m $1_cseo.m $1_logic.m -ifeq ($using_oct,yes) - touch $1_ode2odes.m # Create a dummy which wont' be used - mtt $mtt_switches -q -u $1 ode2odes oct -else - make_ode2odes $1 m $integration_method $algebraic_solver $sort_method -endif -endif -ifneq ($integration_method,implicit) -ifeq ($sort_method,seqn) -$1_ode2odes.m : $1_def.r $1_sympars.txt\ - $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ - $1_sese.m $1_logic.m -else -ifeq ($use_reduce,no) -$1_ode2odes.m : $1_def.r $1_sympars.txt\ - $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ - $1_sesx.m $1_sesy.m $1_logic.m -else -$1_ode2odes.m : $1_def.r $1_sympars.txt\ - $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ - $1_ode.m $1_odeo.m $1_logic.m -endif -endif -ifeq ($using_oct,yes) - echo "*** Warning: Shouldn't be here! Creating dummy $1_ode2odes.m" - touch $1_ode2odes.m # Create a dummy which wont' be used - mtt $mtt_switches -q -u $1 ode2odes oct -else - make_ode2odes $1 m $integration_method $algebraic_solver $sort_method -endif -endif - -#SUMMARY ode2odes Simulation function (m) -#SUMMARY ode2odes Simulation function (cc) -#SUMMARY ode2odes Simulation function (oct) -#SUMMARY ode2odes_rtxi Simulation function (o) -#SUMMARY ode2odes Simulation function (exe) -$1_ode2odes.exe: $1_def.h $1_sympar.h\ - $1_ode2odes.o $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o mtt_kpathsea.o - echo Creating $1_ode2odes.exe - ${MTT_CXX} ${MTT_CXXFLAGS} -o $1_ode2odes.exe\ - $1_ode2odes.o $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o mtt_kpathsea.o\ - ${MTT_LDFLAGS} ${MTT_CXXLIBS} - -$1_ode2odes.o: $1_ode2odes.cc $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o - echo Creating $1_ode2odes.o - ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $1_ode2odes.cc -DCODEGENTARGET=STANDALONE - -$1_ode2odes.oct: $1_ode2odes.cc $1_ode2odes_common_oct.stamp $1_ode2odes_${integration_method}_oct.stamp $1_ode2odes_${algebraic_solver}.o - touch $1_ode2odes.m - echo Creating $1_ode2odes.oct - $MKOCTFILE ${MTT_CXXINCS} -DCODEGENTARGET=OCTAVEDLD $1_ode2odes.cc mtt_${algebraic_solver}.cc mtt_Solver.cc mtt_AlgebraicSolver.cc - -$1_ode2odes.mexglx: $1_ode2odes.cc $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o - touch $1_ode2odes.m - echo Creating $1_ode2odes.mexglx - ${MTT_CXX} -DCODEGENTARGET=MATLABMEX -o $1_ode2odes.mexglx $1_ode2odes.cc \ - $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o \ - ${MTT_MATLAB_FLAGS} ${MTT_CXXINCS} ${MTT_CXXLIBS} ${MTT_CXXFLAGS} \ - ${MTT_LIB}/cc/mtt_kpathsea.cc ${MTT_LIB}/cc/mtt_matlab_octave.cc - -$1_ode2odes.cc: $1_def.r $1_sympars.txt\ - $1_ode2odes_common_m.stamp $1_ode2odes_common_cc.stamp\ - $1_ode2odes_${integration_method}_m.stamp $1_ode2odes_${integration_method}_cc.stamp\ - mtt_Solver.cc mtt_AlgebraicSolver.cc mtt_${algebraic_solver}.cc mtt_${algebraic_solver}.hh - touch $1_ode2odes.m - make_ode2odes $1 cc $integration_method $algebraic_solver $sort_method - -#SUMMARY rtxi real time module (cc) -#SUMMARY rtxi real time module (so) -$1_ode2odes_rtxi.lo: $1_ode2odes.cc $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o \ - $1_rtxi.cc $1_rtxi.h - @echo "Creating \$@" - ${MTT_RTXI_CXXCOMPILE} ${MTT_RTXI_CXXFLAGS} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $1_ode2odes.cc -DCODEGENTARGET=RTXI -o \$@ - @echo compilation complete - -$1_rtxi.so: $1_rtxi.cc $1_ode2odes_rtxi.lo $1_rtxi.h - @echo Compiling module - ${MTT_RTXI_CXXCOMPILE} ${MTT_RTXI_CXXFLAGS} -c $1_rtxi.cc -o $1_rtxi.lo - @echo Compilation complete - ${MTT_RTXI_CXXLINK} ${MTT_RTXI_LIBS} ${MTT_RTXI_LDFLAGS} ${MTT_CXXLIBS} -rpath ${MTT_RTXI_RPATH}$1 -o $1_rtxi.la $1_rtxi.lo $1_ode2odes_rtxi.lo - @echo Module created - -$1_rtxi.install: $1_rtxi.so - @echo Installing module in ${MTT_RTXI_RPATH}$1) - ${MTT_RTXI_LIBTOOL} --mode=install cp $1_rtxi.la ${MTT_RTXI_RPATH}$1 - -$1_rtxi.cc: $1_struc.txt $1_sympar.txt - echo Creating \$@ - sympar2rtxi_txt2cc $1 - -$1_rtxi.h: $1_sympar.txt - echo Creating \$@ - sympar2rtxi_txt2h $1 - - - -#Conversion of m to p to c -#SUMMARY ode ordinary differential equations (c) -#SUMMARY ode ordinary differential equations (p) -#SUMMARY state state declaration (c) -#SUMMARY state state declaration (p) -$1_simpar.p : $1_def.r $1_simpar.m - mtt_m2p $1_simpar.m -$1_numpar.p : $1_def.r $1_numpar.m - mtt_m2p $1_numpar.m -$1_state.p : $1_def.r $1_state.m - mtt_m2p $1_state.m - -#SUMMARY input numerical input declaration (m) -ifeq ($stdin,stdin) -$1_input.m : $1_def.r - make_stdin $1 m -$1_input.p : $1_def.r - make_stdin $1 p -$1_input.cc: - make_stdin $1 cc -else -$1_input.m: $1_input.txt $1_sympars.txt - mtt_txt2m $1 input -$1_input.p : $1_def.r $1_input.m - mtt_m2p $1_input.m -endif - -$1_ode.p : $1_def.r $1_ode.m - mtt_m2p $1_ode.m -$1_odeo.p : $1_def.r $1_odeo.m - mtt_m2p $1_odeo.m -$1_csex.p : $1_def.r $1_cse.m - mtt_m2p $1_csex.m -$1_cseo.p : $1_def.r $1_cseo.m - mtt_m2p $1_cseo.m -$1_smx.p : $1_def.r $1_smx.m - mtt_m2p $1_smx.m -$1_smxa.p : $1_def.r $1_smxa.m - mtt_m2p $1_smxa.m -$1_smxax.p : $1_def.r $1_smxax.m - mtt_m2p $1_smxax.m -$1_logic.p : $1_def.r $1_logic.m - mtt_m2p $1_logic.m - -ifeq ($integration_method,implicit) -$1_ode2odes.p : $1_ode2odes.m $1_def.r $1_smxa.p $1_smxax.p\ - $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ - $1_csex.p $1_cseo.p $1_logic.p - mtt_m2p $1_ode2odes.m $integration_method $stdin -endif -ifneq ($integration_method,implicit) -$1_ode2odes.p : $1_ode2odes.m $1_def.r\ - $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ - $1_ode.p $1_odeo.p $1_logic.p - mtt_m2p $1_ode2odes.m $integration_method $stdin -endif - -$1_ode2odes.c: $1_ode2odes.p - mtt_p2c $info_switch $1 ode2odes - -##SUMMARY sim Octave simulation function (m) - -#ifeq ($computation,octave) -#$1_sim.m: $1_def.r $1_sympar.txt $1_cse.m $1_cseo.m $1_smxa.m $1_smxax.m $1_numpar.m $1_state.m - mtt_make_sim $1 $integration_method $computation -#endif - -#ifeq ($computation,c) -#$1_sim.m: $1_def.r $1_sympar.txt $1_ode2odes.out $1_numpar.m $1_state.m -# mtt_make_sim $1 $integration_method $computation -#endif - -#SUMMARY ssim Octave sensitivity simulation function (m) -$1_ssim.m: $1_def.r $1_ode2odes.${m} - make_ssim $1 m - -#SUMMARY sim Octave simulation function (m) -$1_sim.m: $1_def.r $1_ode2odes.${m} - make_sim $1 m - -#SUMMARY obs observer equations for CGPC (r) -#SUMMARY obs* observer equations for CGPC (m) -#SUMMARY obs observer equations for CGPC (tex) -#SUMMARY obs* observer equations for CGPC (view) -#SUMMARY obs observer equations for CGPC (ps) -#Observer functions for GPC -$1_obs.r: $1_ode.r $1_def.r $1_obspar.r $1_subs.r - ode2obs_r $1; tidy $1_obs.r -$1_obs.m: $1_def.r $1_sympars.txt $1_obs.r $1_obspar.r $1_numpar.m - mtt_r2m $optimise -parameters $1 obs -$1_obs.tex: $1_obs.r $1_sympar.r $1_simp.r - obs_r2tex $1; latex_tidy $1_obs.tex - - -#SUMMARY rfe robot-form equations (r) -#SUMMARY rfe robot-form equations (tex) -#SUMMARY rfe* robot-form equations (view) -#SUMMARY rfe robot-form equations (ps) -#Robot-form equations -$1_rfe.r: $1_cse.r $1_csm.r $1_def.r $1_sympar.r - cse2rfe_r $1; tidy $1_rfe.r -$1_rfe.tex: $1_rfe.r $1_sympar.r $1_simp.r - rfe_r2tex $1; latex_tidy $1_rfe.tex - -#SUMMARY ss steady-state equations (r) -#SUMMARY ss* steady-state equations (m) -#SUMMARY ss steady-state equations (tex) -#SUMMARY ss* steady-state equations (view) -#SUMMARY ss steady-state equations (ps) -#Steady-states -$1_ss.r: $1_def.r $1_sspar.r $1_cr.r $1_ode.r - sspar2ss_r $1; tidy $1_ss.r -$1_ss.m: $1_def.r $1_ss.r $1_numpar.m - ss_r2m $1; matlab_tidy $1_ss.m -$1_ss.tex: $1_def.r $1_ss.r $1_simp.r - ss_r2tex $1; latex_tidy $1_ss.tex - - -#SUMMARY dm descriptor matrices (r) -#SUMMARY dm* descriptor matrices (m) -#SUMMARY dm descriptor matrices (tex) -#SUMMARY dm* descriptor matrices (view) -#SUMMARY dm descriptor matrices (ps) -#Linearised system: descriptor matrices -$1_dm.r: $1_dae.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r - dae2dm_r $1; tidy $1_dm.r -$1_dm.m: $1_def.r $1_dm.r $1_sympars.txt - mtt_r2m $optimise -parameters $1 dm -$1_dm.tex: $1_dm.r $1_sympar.r $1_simp.r - dm_r2tex $1; latex_tidy $1_dm.tex - - - -#SUMMARY csm constrained-state matrices (r) -#SUMMARY csm constrained-state matrices (m) -#SUMMARY csm constrained-state matrices (tex) -#SUMMARY csm constrained-state matrices (view) -#SUMMARY csm constrained-state matrices (ps) -#Linearised system: constrained-state matrices -$1_csm.r: $1_cse.r $1_def.r $1_cr.r $1_sspar.r - cse2csm_r $1 csm; tidy $1_csm.r -$1_csm.m: $1_def.r $1_csm.r $1_sympars.txt - mtt_r2m $optimise -parameters $1 csm; matlab_tidy $1_csm.m -$1_csm.tex: $1_csm.r $1_sympar.r $1_simp.r - csm_r2tex $1 csm; latex_tidy $1_csm.tex -#SUMMARY scsm sensitivity constrained-state matrices (r) -#SUMMARY scsm sensitivity constrained-state matrices (m) -#SUMMARY scsm sensitivity constrained-state matrices (tex) -#SUMMARY scsm sensitivity constrained-state matrices (view) -#SUMMARY scsm sensitivity constrained-state matrices (ps) -#Linearised system: sensitivity constrained-state matrices -$1_scsm.r: $1_scse.r $1_def.r $1_cr.r $1_sympar.r $1_sspar.r - cse2csm_r $1 scsm; tidy $1_scsm.r -$1_scsm.m: $1_def.r $1_scsm.r $1_sympars.txt - csm_r2m $1 scsm; matlab_tidy $1_scsm.m -$1_scsm.tex: $1_scsm.r $1_sympar.r $1_simp.r - csm_r2tex $1 scsm; latex_tidy $1_scsm.tex - -#SUMMARY sm state matrices (r) -#SUMMARY sm* state matrices (m) -#SUMMARY sm state matrices (icad) -#SUMMARY sm state matrices (tex) -#SUMMARY sm state matrices (c) -#SUMMARY sm* state matrices (view) -#SUMMARY sm state matrices (ps) -#Linearised system: state matrices -$1_sm.r: $1_csm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r - csm2sm_r $optimise $1 sm; tidy $1_sm.r -$1_sm.m: $1_def.r $1_sm.r $1_sympars.txt - mtt_r2m $optimise -parameters $1 sm -$1_sm.icad: $1_sm.m $1_numpar.m - sm_m2icad $1 -$1_sm.c: $1_def.r $1_sm.r $1_sympar.c - sm_r2c $1 -$1_sm.tex: $1_sm.r $1_sympar.r $1_simp.r - sm_r2tex $1 sm; latex_tidy $1_sm.tex - -#SUMMARY ssm sensitivity state matrices (r) -#SUMMARY ssm sensitivity state matrices (icad) -#SUMMARY ssm sensitivity state matrices (tex) -#SUMMARY ssm sensitivity state matrices (c) -#SUMMARY ssm sensitivity state matrices (ps) -#Linearised system: sensitivity state matrices -$1_ssm.r: $1_scsm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r - csm2sm_r $optimise $1 ssm; tidy $1_ssm.r -$1_ssm.m: $1_def.r $1_ssm.r $1_sympars.txt - mtt_r2m $optimise -parameters $1 ssm -$1_ssm.tex: $1_ssm.r $1_sympar.r $1_simp.r - sm_r2tex $1 ssm; latex_tidy $1_ssm.tex - -#SUMMARY smx state matrices with variable state x (r) -#SUMMARY smx state matrices with variable state x (m) -#SUMMARY smxx Sparse computation of Ax (m) -#SUMMARY smxtx Sparse computation of ATx (m) -$1_smx.r: $1_def.r $1_def.m $1_ode.r $1_subs.r - ode2smx_lang $1 r; tidy $1_smx.r - -$1_smx.m: $1_def.r $1_def.m $1_cse.r $1_sympars.txt $1_subs.r - cse2smx_lang $fixcc $optimise -parameters $1 smx m - -$1_smxa.m: $1_def.r $1_def.m $1_cse.r $1_sympars.txt $1_subs.r - cse2smx_lang $fixcc $optimise -parameters $matrix_smxa $1 smxa m - -$1_smxax.m: $1_def.r $1_def.m $1_cse.r $1_sympars.txt $1_subs.r - cse2smx_lang $fixcc $optimise -parameters $1 smxax m - -#SUMMARY smc controller form state matrices etc. - siso only (r) -#SUMMARY smc controller form state matrices etc. - siso only (tex) -#SUMMARY smc* controller form state matrices etc. - siso only (m) -#SUMMARY smc* controller form state matrices etc. - siso only (view) -#SUMMARY smc controller form state matrices etc. - siso only (ps) -#Linearised system: controller form state matrices etc. -$1_smc.r: $1_sm.r $1_def.r $1_tf.r - sm2smc_r $1; tidy $1_smc.r -$1_smc.tex: $1_smc.r $1_simp.r - smc_r2tex $1; latex_tidy $1_smc.tex -$1_smc.m: $1_def.r $1_smc.r $1_numpar.m - smc_r2m $1; matlab_tidy $1_smc.m - -#SUMMARY smo observer form state matrices etc. - siso only (r) -#SUMMARY smo observer form state matrices etc. - siso only (tex) -#SUMMARY smo* observer form state matrices etc. - siso only (m) -#SUMMARY smo* observer form state matrices etc. - siso only (view) -#SUMMARY smo observer form state matrices etc. - siso only (ps) -#Linearised system: observer form state matrices etc. -$1_smo.r: $1_sm.r $1_def.r $1_tf.r - sm2smo_r $1; tidy $1_smo.r -$1_smo.tex: $1_smo.r $1_simp.r - smo_r2tex $1; latex_tidy $1_smo.tex -$1_smo.m: $1_def.r $1_smo.r $1_numpar.m - smo_r2m $1; matlab_tidy $1_smo.m - -#SUMMARY ssk State-space controller gain - siso only (r) -#SUMMARY ssk State-space controller gain - siso only (tex) -#SUMMARY ssk* State-space controller gain - siso only (m) -#SUMMARY ssk* State-space controller gain - siso only (view) -#SUMMARY ssk State-space controller gain - siso only (ps) -#Linearised system: State-space controller gain -$1_ssk.r: $1_def.r $1_smc.r - smc2ssk_r $1; tidy $1_ssk.r -$1_ssk.tex: $1_ssk.r $1_simp.r - ssk_r2tex $1; latex_tidy $1_ssk.tex -$1_ssk.m: $1_def.r $1_ssk.r $1_numpar.m - ssk_r2m $1; matlab_tidy $1_ssk.m - -#SUMMARY ssl State-space observer gain - siso only (r) -#SUMMARY ssl State-space observer gain - siso only (tex) -#SUMMARY ssl* State-space observer gain - siso only (m) -#SUMMARY ssl* State-space observer gain - siso only (view) -#SUMMARY ssl State-space observer gain - siso only (ps) -#Linearised system: State-space observer gain -$1_ssl.r: $1_def.r $1_smo.r - smo2ssl_r $1; tidy $1_ssl.r -$1_ssl.tex: $1_ssl.r $1_simp.r - ssl_r2tex $1; latex_tidy $1_ssl.tex -$1_ssl.m: $1_def.r $1_ssl.r $1_numpar.m - ssl_r2m $1; matlab_tidy $1_ssl.m - -#SUMMARY tf transfer function (r) -#SUMMARY tf* transfer function (m) -#SUMMARY tf transfer function (tex) -#SUMMARY tf* transfer function (view) -#SUMMARY tf transfer function (ps) -#Linearised system: transfer function -$1_tf.r: $1_dm.r $1_sympar.r - dm2tf_r $1; tidy $1_tf.r -$1_tf.m: $1_def.r $1_sympars.txt $1_tf.r - tf_r2m $1; matlab_tidy $1_tf.m -$1_tf.tex: $1_def.r $1_tf.r $1_sympar.r $1_simp.r - tf_r2tex $1; latex_tidy $1_tf.tex - -#SUMMARY pkim partialyy-known system identification matrix (r) -#SUMMARY pkim partialyy-known system identification matrix (tex) -#SUMMARY pkim partialyy-known system identification matrix (view) -#SUMMARY pkim partialyy-known system identification matrix (ps) -$1_pkim.r: $1_tf.r $1_sympar.r - tf2pkim_r $1; tidy $1_pkim.r -$1_pkim.tex: $1_def.r $1_pkim.r $1_simp.r - pkim_r2tex $1; latex_tidy $1_pkim.tex - -#SUMMARY ctf controller transfer function (r) -#SUMMARY ctf controller transfer function (m) -#SUMMARY ctf controller transfer function (tex) -#SUMMARY ctf controller transfer function (view) -#SUMMARY ctf controller transfer function (ps) -#Linearised system: transfer function -$1_ctf.r: $1_dm.r $1_ssk.r $1_ssl.r $1_sm.r - ssk2ctf_r $1; tidy $1_ctf.r -$1_ctf.m: $1_def.r $1_ctf.r - ctf_r2m $1; matlab_tidy $1_ctf.m -$1_ctf.tex: $1_def.r $1_ctf.r $1_sympar.r $1_simp.r - ctf_r2tex $1; latex_tidy $1_ctf.tex - -#SUMMARY ir impulse response - state (m) -#SUMMARY ir impulse response - state (dat) -#SUMMARY ir impulse response - state (ps) -#SUMMARY ir impulse response - state (view) - -#SUMMARY iro impulse response - output (m) -#SUMMARY iro impulse response - output (dat) -#SUMMARY iro impulse response - output (ps) -#SUMMARY iro impulse response - output (view) - -#SUMMARY sr step response - state (m) -#SUMMARY sr step response - state (dat) -#SUMMARY sr step response - state (ps) -#SUMMARY sr step response - state (view) - -#SUMMARY sro* step response - output (m) -#SUMMARY sro step response - output (dat) -#SUMMARY sro step response - output (ps) -#SUMMARY sro* step response - output (view) - -#SUMMARY odes ode solution - state (m) -#SUMMARY odes* ode solution - state (dat) -#SUMMARY odes* ode solution - state & output for SciGraphica (sg) -#SUMMARY odes* ode solution - state (ps) -#SUMMARY odes* ode solution - state (view) - -#SUMMARY sms ode (in state matrix form) solution - state & output (c) - -#SUMMARY odeso ode solution - output (m) -#SUMMARY odeso* ode solution - output (dat) -#SUMMARY odeso* ode solution - output for spreadsheet (sdat) -#SUMMARY odeso ode solution - output (ps) -#SUMMARY odeso* ode solution - output (view) - -#SUMMARY daes dae solution - state (m) -#SUMMARY daes dae solution - state (dat) -#SUMMARY daes dae solution - state (ps) -#SUMMARY daes dae solution - state (view) - -#SUMMARY daeso dae solution - output (m) -#SUMMARY daeso dae solution - output (dat) -#SUMMARY daeso dae solution - output (ps) -#SUMMARY daeso dae solution - output (view) - -#Time responses -$1_ir.m: $1_sm.m $1_numpar.m $1_def.m $1_simpar.m - sm2ir_m $1 '$ARGS' -$1_iro.m: $1_ir.m - touch $1_iro.m -$1_ir.dat: $1_ir.m - m2dat $1_ir -$1_iro.dat: $1_iro.m - m2dat $1_iro -$1_sr.m: $1_sm.m $1_numpar.m $1_simpar.m $1_def.m - sm2sr_m $1 -$1_sr.dat: $1_sr.m - m2dat $1_sr -$1_sro.m: $1_sr.m - touch $1_sro.m$ -$1_sro.dat: $1_sro.m - m2dat $1_sro -1_odes.c: $1_ode.c $1_def.r $1_sympar.r - ode2odes_r2c $1 -$1_sms.c: $1_sm.c $1_def.r $1_sympar.r - sm2sms_r2c $1 - -.PRECIOUS: $1_odes.dat2 -ifeq ($computation,octave) -ifeq ($using_oct,yes) -$1_odes.dat2: $1_ode2odes.oct - time octave_ode2odes $1 -else -$1_odes.dat2: $1_ode2odes.m - time octave_ode2odes $1 -endif -endif - -$1_ode2odes.out: $1_ode2odes.c $1_cr.h - echo Creating $1_odes.out by compiling $1_ode2odes.c - $CC $1_ode2odes.c -lp2c -lm -o $1_ode2odes.out - -ifeq ($computation,c) -$1_odes.dat2: $1_ode2odes.out - echo Creating $1_odes.dat2 using c version - time ./$1_ode2odes.out>$1_odes.dat2 -endif - -ifeq ($computation,cc) -$1_sim.exe: $1_ese.r - mtt $mtt_switches -q $1 sim exe - -$1_odes.dat2: $1_ode2odes.exe - echo Creating $1_odes.dat2 using cc version $ARGS - time ./$1_ode2odes.exe $ARGS >$1_odes.dat2 -endif - - -#$1_odeso.m: $1_odes.m -# touch $1_odeso.m -#$1_smso.m: $1_sms.m -# touch $1_smso.m -#$1_daes.m: $1_dae.m $1_numpar.m $1_def.m $1_input.m $1_simpar.m -# dae2daes_m $1 '$ARGS' -#$1_daeso.m: $1_daes.m -# touch $1_daeso.m - - -#Conversion of data files from dat to sdat format -$1_odeso.sdat: $1_odeso.dat $1_struc.txt - odeso_dat2sdat $1 - -$1_odes.sdat: $1_odes.dat $1_struc.txt - odes_dat2sdat $1 - -#Conversion of data to SciGraphica -$1_odes.sg: $1_struc.m $1_odes.dat2 - echo Creating $1_odes.sg - dat22sg.sh $1 - -#SUMMARY odess ode numerical steady-states - states (m) -#SUMMARY odess ode numerical steady-states - states (dat) -#SUMMARY odess ode numerical steady-states - states (ps) -#SUMMARY odess ode numerical steady-states - states (view) - -#SUMMARY odesso ode numerical steady-states - outputs (m) -#SUMMARY odesso ode numerical steady-states - outputs (dat) -#SUMMARY odesso ode numerical steady-states - outputs (ps) -#SUMMARY odesso ode numerical steady-states - outputs (view) - -#Numerical steady states -$1_odess.dat2: $1_ode.m $1_odeo.m $1_numpar.m $1_input.m $1_simpar.m - ode2odess_m2dat2 $1 -#$1_odess.m: $1_ode.m $1_odeo.m $1_numpar.m $1_input.m $1_simpar.m -# ode2odess_m $1 -#$1_odesso.m: $1_odess.m -# touch $1_odesso.m - - -#SUMMARY fr frequency response (m) -#SUMMARY fr frequency response (dat) -#SUMMARY fr frequency response (ps) -#SUMMARY fr frequency response (view) - -#SUMMARY lmfr loglog modulus frequency response (m) -#SUMMARY lmfr loglog modulus frequency response (dat) -#SUMMARY lmfr loglog modulus frequency response (ps) -#SUMMARY lmfr* loglog modulus frequency response (view) - -#SUMMARY lpfr semilog phase frequency response (m) -#SUMMARY lpfr semilog phase frequency response (dat) -#SUMMARY lpfr semilog phase frequency response (ps) -#SUMMARY lpfr* semilog phase frequency response (view) - -#SUMMARY nyfr Nyquist style frequency response (m) -#SUMMARY nyfr Nyquist style frequency response (dat) -#SUMMARY nyfr Nyquist style frequency response (ps) -#SUMMARY nyfr Nyquist style frequency response (view) - -#SUMMARY nifr Nichols style frequency response (m) -#SUMMARY nifr Nichols style frequency response (dat) -#SUMMARY nifr Nichols style frequency response (ps) -#SUMMARY nifr Nichols style frequency response (view) - - -#Frequency responses -$1_fr.m: $1_dm.m $1_numpar.m $1_def.m $1_simpar.m - dm2fr_m $1 -$1_lmfr.m $1_lpfr.m $1_nyfr.m $1_nifr.m: $1_fr.m - -$1_fr.dat: $1_fr.m - m2dat $1_fr -$1_lmfr.dat: $1_lmfr.m - m2dat $1_lmfr -$1_lpfr.dat: $1_lpfr.m - m2dat $1_lpfr -$1_nyfr.dat: $1_nyfr.m - m2dat $1_nyfr -$1_nifr.dat: $1_nifr.m - m2dat $1_nifr - - -ifeq ($REPTYPE,txt) -#Generic conversion of txt files to tex files -$1_$2.tex: $1_$2.txt - txt2tex $1 $2 txt - endif - -#Conversion of dat2 files to dat format -$1_odeso.dat: $1_odes.dat2 $1_def.r - echo Creating $1_odeso.dat - dat22dat $1 ode so -$1_odes.dat: $1_odes.dat2 $1_def.r - echo Creating $1_odes.dat - dat22dat $1 ode s -$1_odesso.dat: $1_odess.dat2 $1_def.r - echo Creating $1_odesso.dat - dat22dat $1 odes so -$1_odess.dat: $1_odess.dat2 $1_def.r - echo Creating $1_odess.dat - dat22dat $1 odes s - -#Generic conversion of data files from dat to (gplot) gdat format -$1_$2.gdat: $1_$2.dat $1_struc.txt $1_args.m - dat2gdat $1 $2 "$ARGS" "$NyquistStyle" - -## Conversion of gdat to fig files -ifeq ($REPTYPE,data) -$1_$2.fig: $1_$2.gdat - gdat2fig $1_$2 - -ifneq ($ARGS,) ## Multiple plots - echo Creating $1_$2$__ARGS.fig - mv $1_$2.fig $1_$2$__ARGS.fig - rm -f $1_$2.gdat -endif - -## Conversion of gdat fig files to ps/pdf -ifeq ($ARGS,) # single plot -$1_$2.$ps : $1_$2.fig - echo Creating $1_$2.$ps - fig2dev -L$eps $1_$2.fig > $1_$2.$ps -else ## Multiple plots -$1_$2.$ps : $1_$2.fig - mtt -q -r $1 $2 dat $4 - echo Creating $1_$2$__ARGS.$ps - fig2dev -L$eps $1_$2$__ARGS.fig > $1_$2$__ARGS.$ps -endif - -endif - - -#Generic conversion of Latex to latex document -mtt.sty: - echo Copying mtt.sty to here - cp $MTTPATH/trans/mtt.sty . -$1_$2.doc: $1_$2.tex - makedoc "$mtt_switches" "$1" "$2" "$3" "$4" "$documenttype" "$ps" - - -#Create PostScript version of dia and fig files -ifeq ($REPTYPE,bg) -ifeq ("\$(wildcard $1_abg.dia)","$1_abg.dia") -$1_$2.$ps : $1_$2.dia -else -$1_$2.$ps : $1_$2.fig -endif - echo Creating $1_$2.$ps - bg2eps $1 $2 $ps $eps -endif - -ifeq ($REPTYPE,lbg) -$1_$2.$ps : $1_$2.fig - labg_fig2ps $1_$2 -endif - -ifeq ($REPTYPE,tex) -#Generic conversion of LaTeX doc to dvi or pdf -$1_$2.$ps: $1_$2.doc - doc2$ps $1_$2 "$documenttype" -endif - - -ifeq ($REPTYPE,tex) -#Create html version of dvi file -$1_$2.html: $1_$2.doc - echo Creating $1_$2/$1_$2.html - $LATEX2HTML $1_$2.doc>latex2html.log 2>latex2html.log -endif - -#Default view -ifeq ($REPTYPE,bg) -$1_$2.view : $Subsystem_$2.pview -endif - -ifeq ($REPTYPE,data) -$1_$2.view: $1_$2.$ps -ifeq ($ARGS,) # single plot - echo Creating view of $1_$2 - $ps file - $psview $1_$2.$ps& -else - echo Creating view of $1_$2$__ARGS - $ps file - $psview $1_$2$__ARGS.$ps& -endif -endif - -ifeq ($REPTYPE,tex) -$1_$2.view : $1_$2.pview -endif - -ifeq ($REPTYPE,txt) -$1_$2.view : $1_$2.tview -endif - -# Hypertext view -$1_$2.hview: $1_$2.html - $HTMLVIEW $1_$2/$1_$2.html& - -#View a ps file -$Subsystem_$2.pview: $1_$2.$ps - echo Creating view of $Subsystem_$2 - $ps file - mtt_multi $psview $Subsystem $2 $ps $viewlevel | sh - -#View a gdat file -$1_$2.dview: $1_$2.gdat - echo Creating view of $1_$2 - gdat2view $1_$2 '$ARGS'& - -#View a tex file -$1_$2.tview: $1_$2.dvi - echo Creating view of $1_$2 - $DVIVIEW $1_$2.dvi& - -#Report generation -$1_rep.make: $1_rep.txt - rep_txt2make $1 "$mtt_switches" - -$1_reps_made: - rep_txt2sh $1 "$mtt_switches"; touch $1_reps_made - -$1_rep.tex: $1_rep.txt $1_reps_made - rep_txt2tex $1 "$documenttype" "$directory" "$mtt_switches"; - -#SUMMARY abg Acausal bond graph report (tex) -$1_abg.tex: $1_sub.sh $1_labg.tex - sh $1_sub.sh "mtt -q " " labg tex" - abg2tex $pdf ${sensitivity_switch} $1 - -#SUMMARY tf Transfer function (mml) -$1_$2.mml: $1_$2.r - mtt_r2mml $1 $2 - - -# Version control system - uses RCS -RCS: - echo Creating RCS - mkdir RCS -$1_$2.vc: RCS - echo Version control on $1_$2.$VCext with message: $log_message - ci -m"$log_message" -I $1_$2.$VCext /dev/null -fi - -#Print what's going on if in verbose mode -if [ -n "$Verbose" ]; then - echo Finishing mtt $mtt_switches $1 $2 $3 $4 at level $level -fi - -if [ "$make_status" != "0" ]; then - echo Exiting MTT with error $make_status - exit 1 -fi DELETED mttroot/mtt/bin/mtt_backup Index: mttroot/mtt/bin/mtt_backup ================================================================== --- mttroot/mtt/bin/mtt_backup +++ mttroot/mtt/bin/mtt_backup @@ -1,74 +0,0 @@ -#!/bin/sh -# Does a backup with date of selected files. - - -while [ -n "`echo $1 | grep '^-'`" ]; do -case $1 in - -d) - format=date; - shift - ;; - -v) - format=version; - shift - ;; - -h) - echo "Usage: mtt_backup [-d|-v] [lib|doc]"; - exit - ;; - *) - format=date; -esac -done - -#Name of archive -if [ -z "$1" ]; then - mtt="mtt" - dirs='mtt mtt-lib mtt-cc mtt-doc' -else - mtt="mtt-$1" - dirs=$mtt -fi - -## Create appropriate filename -case $format in - date) - filename=`date | gawk '{printf("%s_%s%s_%s.tgz\n", mtt, $2,$3,$6)}' mtt=$mtt`; - shift - ;; - version) - filename=`mtt --version | gawk '{printf("%s-%s.tar.gz\n", mtt, $NF)}' mtt=$mtt`; - shift - ;; - - *) - -esac - -echo Backup file $filename - - - -#Check whether archive exists here -if [ -f "$filename" ]; then - echo File $filename already exists - exiting - exit -fi - -# Listing files to ignore -#echo Finding irrelevant files -#find $dirs -name '*.*' -print |\ -# grep 'dvi$\|ps$\|gif$\|log$\|dat$\|MTT_work\|core\|~$' >IGNORE -#wc IGNORE | gawk '{print "Ignoring", $1, "files"}' - -#echo examples >> IGNORE - -#Inform user -echo Backing up $dirs to $filename - -#Tar the files -#tar --exclude-from IGNORE --create --gzip --file $filename $dir -tar --create --gzip --file $filename $dirs -#Size info -ls -l $filename -# DELETED mttroot/mtt/bin/mtt_backups Index: mttroot/mtt/bin/mtt_backups ================================================================== --- mttroot/mtt/bin/mtt_backups +++ mttroot/mtt/bin/mtt_backups @@ -1,16 +0,0 @@ -#!/bin/sh -# Does a backup with date of all mtt components -# $Log$ -# Revision 1.2 2000/10/03 12:17:58 peterg -# Prints usage line -# - -if [ -z "$1" ]; then - echo "Usage: mtt_backups [-v|-d]" - exit -fi -mtt_backup $1 -mtt_backup $1 cc -mtt_backup $1 lib -mtt_backup $1 doc - DELETED mttroot/mtt/bin/mtt_check_sese Index: mttroot/mtt/bin/mtt_check_sese ================================================================== --- mttroot/mtt/bin/mtt_check_sese +++ mttroot/mtt/bin/mtt_check_sese @@ -1,30 +0,0 @@ -#! /bin/sh -## This script tests the sese generation by comparing the -## dae files generated by the conventional approach -## Copyright (C) 2003 by Peter J. Gawthrop - -sys=$1 - -## Correct dae file. -rm -vf ${sys}_ese.r MTT_work/${sys}_ese.r -mtt -q ${sys} dae r -mv -v ${sys}_dae.r ${sys}_dae.r_CORRECT - -## sese file -rm -vf ${sys}_sese.r MTT_work/${sys}_sese.r -mtt -q ${sys} sese r - -## Create the dae file from the sese file -cp -v ${sys}_sese.r ${sys}_ese.r -mtt -q ${sys} dae r - -## And test -diff ${sys}_dae.r ${sys}_dae.r_CORRECT > mtt_diffs - -## Result -if [ "$?" = "0" ]; then - echo "****** dae files are the same ******" -else - echo "****** dae files are different ******" - cat mtt_diffs -fi DELETED mttroot/mtt/bin/mtt_check_var Index: mttroot/mtt/bin/mtt_check_var ================================================================== --- mttroot/mtt/bin/mtt_check_var +++ mttroot/mtt/bin/mtt_check_var @@ -1,40 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_check_var - -# P.J.Gawthrop July 1997 -# Copyright (c) P.J.Gawthrop 1997 - - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -# Revision 1.2 1997/12/04 10:41:15 peterg -# Added third argument to print env. variables. -# -## Revision 1.1 1997/07/27 13:11:37 peterg -## Initial revision -## -############################################################### - -var=$1 -name=$2 -print=$3 -software=$4 - -if [ -z "$1" ]; then - echo '*** MTT WARNING Environment variable' $name 'not set. *****' - echo "Please check that software package $software has been correctely installed" - echo - exit -fi - -if [ "$print" = "print" ]; then - echo Environment variable $name set to $var -fi DELETED mttroot/mtt/bin/mtt_check_vars Index: mttroot/mtt/bin/mtt_check_vars ================================================================== --- mttroot/mtt/bin/mtt_check_vars +++ mttroot/mtt/bin/mtt_check_vars @@ -1,92 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_check_vars - -# P.J.Gawthrop July 1997 -# Copyright (c) P.J.Gawthrop 1997 - - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.8.2.1 2001/03/06 03:48:43 geraint -## Print additional environment variable for "mtt -p". -## MTT_LDFLAGS defaults to " " to avoid installation warning. -## -## Revision 1.8 2000/12/27 13:11:42 peterg -## *** empty log message *** -## -## Revision 1.7 2000/08/04 15:48:30 peterg -## Added PDF -## -## Revision 1.6 2000/05/22 12:37:24 peterg -## *** empty log message *** -## -## Revision 1.5 2000/05/22 12:34:07 peterg -## Added MTT_REP -## -## Revision 1.4 1998/07/30 17:30:41 peterg -## Added some more paths -## -## Revision 1.3 1998/01/23 13:33:47 peterg -## Removed OCTAVE_PATH -## Removed RMATRIX -## -# Revision 1.2 1997/12/04 10:41:49 peterg -# Added -p argument to print environment variables -# -## Revision 1.1 1997/07/27 13:12:03 peterg -## Initial revision -## -############################################################### - -#Look for a command line argument -while [ -n "`echo $1 | grep '-'`" ]; do - case $1 in - -p ) - print=print ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -# Octave -#mtt_check_var "$OCTAVE_PATH" "OCTAVE_PATH" "$print" "Octave" - -# LaTeX -#mtt_check_var "$TEXFORMATS" "TEXFORMATS" "$print" "LaTeX" -#mtt_check_var "$TEXINPUTS" "TEXINPUTS" "$print" "LaTeX" -#mtt_check_var "$TEXFONTS" "TEXFONTS" "$print" "LaTeX" - -# MTT variables -mtt_check_var "$MAKE" "MAKE" "$print" "MTT" -mtt_check_var "$MTTPATH" "MTTPATH" "$print" "MTT" -mtt_check_var "$MTT_CRS" "MTT_CRS" "$print" "MTT" -mtt_check_var "$MTT_COMPONENTS" "MTT_COMPONENTS" "$print" "MTT" -mtt_check_var "$MTT_EXAMPLES" "MTT_EXAMPLES" "$print" "MTT" -mtt_check_var "$MTT_LIB" "MTT_LIB" "$print" "MTT" -mtt_check_var "$MTT_REP" "MTT_REP" "$print" "MTT" -mtt_check_var "$MATRIX" "MATRIX" "$print" "MTT" -mtt_check_var "$SYMBOLIC" "SYMBOLIC" "$print" "MTT" -mtt_check_var "$FIG" "FIG" "$print" "MTT" -mtt_check_var "$PSVIEW" "PSVIEW" "$print" "MTT" -mtt_check_var "$PDFVIEW" "PDFVIEW" "$print" "MTT" -mtt_check_var "$HTMLVIEW" "HTMLVIEW" "$print" "MTT" -mtt_check_var "$DVIVIEW" "DVIVIEW" "$print" "MTT" -mtt_check_var "$CC" "CC" "$print" "MTT" -mtt_check_var "$LATEX2HTML" "LATEX2HTML" "$print" "MTT" -mtt_check_var "$MKOCTFILE" "MKOCTFILE" "$print" "MTT" -mtt_check_var "$MTT_CXX" "MTT_CXX" "$print" "MTT" -mtt_check_var "$MTT_CXXFLAGS" "MTT_CXXFLAGS" "$print" "MTT" -mtt_check_var "$MTT_CXXLIBS" "MTT_CXXLIBS" "$print" "MTT" -mtt_check_var "$MTT_CXXINCS" "MTT_CXXINCS" "$print" "MTT" -mtt_check_var "$MTT_LDFLAGS" "MTT_LDFLAGS" "$print" "MTT" - - DELETED mttroot/mtt/bin/mtt_cvs2deb Index: mttroot/mtt/bin/mtt_cvs2deb ================================================================== --- mttroot/mtt/bin/mtt_cvs2deb +++ mttroot/mtt/bin/mtt_cvs2deb @@ -1,190 +0,0 @@ -#! /bin/sh - -# Script to create a .deb package from the current cvs sources. - -usage () -{ - cat < .disk/info -tmpfile=`mktemp mtt_deb2cd.tmp.XXXXXXXXXX` -echo "Scanning .deb packages" -dpkg-scanpackages . ${tmpfile} | gzip > ./Packages.gz -rm ${tmpfile} -# create Redhat package -echo "Creating .rpm, please wait ..." -alien --to-rpm ${debfile} -chown -R ${my_user:-"root"}.${my_group:-"root"} . -cd .. - -echo "Directory created (${tmpdir}) - copy this to iso9660 image as /" - -exit 0 DELETED mttroot/mtt/bin/mtt_find Index: mttroot/mtt/bin/mtt_find ================================================================== --- mttroot/mtt/bin/mtt_find +++ mttroot/mtt/bin/mtt_find @@ -1,124 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_find -# mtt_find path name operation -# P.J.Gawthrop Nov 1996 -# Copyright (c) P.J.Gawthrop 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 2000/10/03 18:29:57 peterg -## *** empty log message *** -## -## Revision 1.6 1998/07/17 19:47:35 peterg -## Minor changes -## -## Revision 1.5 1998/07/17 07:50:33 peterg -## Now handles library name -## Returns a status -## 0 if exactly one result -## 1 if no results -## 2 if two or more results -## 3 if utterly confused -## -## Revision 1.4 1998/07/16 20:40:24 peterg -## Cleaned up algorithms -## -## Revision 1.3 1998/07/16 09:15:34 peterg -## Now prints: -## dir -## name_lbl.txt -## access time -## -## Revision 1.2 1997/09/04 09:15:19 peterg -## Includes summary line as well as description lines -## -## Revision 1.1 1996/11/10 10:48:45 peterg -## Initial revision -## -############################################################### - -# Set up dummy file -rm -f mtt_junk -touch mtt_junk - -# Interpret the arguments -path="$1" - -if [ -n "$2" ]; then - name=`basename $2` - longname=$2 - Name="-name $name" -else - name='*' -fi - -# If this is non-empty just print the path -path_only=$3 - -# Find all dirs in path with same name as component -# AND the path contains the full (name+library) name -paths=`echo $path | tr ":" " "` -foundpath=`\ -for thepath in $paths; do - find $thepath -type d $Name -print -done |\ -sort -u |\ -grep "$longname"` - -# If empty set foundpath to the simple components path -if [ -z "$foundpath" ]; then - foundpath="$MTT_LIB/comp/simple" -fi - -# If non-null result, check that the name_ext file exists in dir name -# and print dirname and file name and last access time -if [ -n "$foundpath" ]; then - if [ -n "$path_only" ]; then - format='%h\n'; - else - format='%h\t%f\t%Ac\n'; - fi - for thepath in $foundpath ; do - if [ "$thepath" = "$MTT_COMPONENTS/simple" ]; then - ext='cause.m'; # finds _cause.m - simple='simple'; - else - ext='lbl.txt'; # finds _lbl.txt - fi - dirname=`basename $thepath` - if [ -n "$simple" ]; then - fullname="$name"_"$ext" - else - fullname="$dirname"_"$ext" - fi - find $thepath -maxdepth 1 -name $fullname -printf $format; - done |\ - tee mtt_junk -fi - -# Check exit status and return -hits=`wc mtt_junk | gawk '{print $1}'` -rm -f mtt_junk - -if [ $hits = "1" ]; then - exit 0 -elif [ $hits = "0" ]; then - exit 1 -elif [ $hits > "1" ]; then - exit 2 -else - exit 3 -fi - - - - - DELETED mttroot/mtt/bin/mtt_help Index: mttroot/mtt/bin/mtt_help ================================================================== --- mttroot/mtt/bin/mtt_help +++ mttroot/mtt/bin/mtt_help @@ -1,197 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_help - -# P.J.Gawthrop Nov 1996 -# Copyright (c) P.J.Gawthrop 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.14 2000/10/03 18:29:26 peterg -## crs now works after a fashion -## -## Revision 1.13 2000/04/04 15:22:44 peterg -## Major changes: simple components now work -## Single components now work -## -## Revision 1.12 1998/07/21 08:47:59 peterg -## Default null $2 (regexp) to '^' - ie match any line -## -## Revision 1.11 1998/07/16 20:41:05 peterg -## Now uses new mtt_help -## -## Revision 1.10 1998/05/18 08:35:19 peterg -## Surround arguments to tr with "" -## -## Revision 1.9 1998/03/26 08:23:02 peterg -## Use mixed case Topic for *) part of case sttement -## -## Revision 1.8 1998/03/22 21:13:17 peterg -## Fixed bug in above -## -## Revision 1.7 1998/03/22 20:21:11 peterg -## $topic now converted to lower case. -## -## Revision 1.6 1997/09/04 09:35:04 peterg -## Changed $ext to give accurate match -- matches t ot m at end of -## filename -## -# Revision 1.5 1997/09/04 09:21:01 peterg -# Added context-dependent sort. -# -# Revision 1.4 1997/09/04 09:16:29 peterg -# Removed sort -u -# -## Revision 1.3 1996/11/09 21:10:20 peterg -## Tidied up searches by putting everyrhing into lib. -## -# Revision 1.2 1996/11/02 10:22:54 peterg -# Now browses crs. -# -## Revision 1.1 1996/11/01 12:34:54 peterg -## Initial revision -## -############################################################### - -comment='#'; -Topic=$1 -topic=`echo $Topic | tr "[A-Z]" "[a-z]"` - -if [ -n "$2" ]; then - regexp=$2; -else - regexp='^'; -fi - -if [ "$topic" = "" ]; then - echo 'Usage: mtt help representations' - echo ' mtt help simple' - echo ' mtt help components' - echo ' mtt help examples' - echo ' mtt help CRs' - echo ' mtt help representations ' - echo ' mtt help components ' - echo ' mtt help examples ' - echo ' mtt help CRs ' - echo ' mtt help ' - exit -fi - -ext='_[cl]*.*[mt]' -summary='[%#]SUMMARY' -description='[%#]DESCRIPTION' -alias='[%#]ALIAS' -lbl="_lbl.txt" - -case $topic in - components) - key=$summary - find_path="$MTT_COMPONENTS" - name='' - sort='sort -u' - blurb="components";; - - simple) - key=$summary - find_path="$MTT_COMPONENTS/simple" - name='' - sort='sort -u' - blurb="simple components";; - - crs) - key=$summary - find_path=$MTT_CRS/r - name='*.cr' - sort='sort -u' - blurb="constitutive relationships";; - - examples) - key=$summary - find_path=$MTT_EXAMPLES - name='' - all='all' - sort='sort -u' - blurb="Examples";; - - representations) - key=$summary - find_path=$MTTPATH - name='mtt' - all='all' - sort='sort -u' - blurb="Representations";; - - *) - other=OTHER; - key="$summary|$description|$alias" - find_path=$MTT_LIB - name=$Topic - all='all' - sort='cat' - blurb=$Topic;; -esac - -subtopic=$2 -if [ "$subtopic" = "" ]; then - subtopic='.' -fi; - - -case $topic in - representations) - echo $comment $blurb - mtt2reps_txt - - ;; - crs) - echo $comment $blurb - find $find_path -name "$name" -print |\ - gawk '{print "grep", key, $1}' key=$key | sh |\ - sed "s/$key //" | $sort - ;; - *) - - fullnames=`mtt_find $find_path "$name" | gawk '{printf("%s/%s\n",$1,$2)}'` - N=`echo $fullnames | wc -w`; - if [ -z "$fullnames" ]; then - echo $comment No $blurb found. - else - echo $comment $N $blurb found. - for fullname in $fullnames; do - name=`basename $fullname` - if [ -n "$other" ]; then - cat $fullname | egrep $key - else - info=`cat $fullname | egrep $key | gawk '{for (i=2;i<=NF;i++) print $i}'` - category=`echo $fullname | sed "s!$find_path/!!" ` - category=`dirname $category` - echo $category $name $info - fi - done - fi - esac -exit - - - gawk '{print "cat " $1 "/" $2}' | sh |\ - egrep $key | egrep $regexp |\ - sed "s/$summary[ ]*//" |\ - sed "s/$description[ ]*/ /" |\ - sed "s/$alias[ ]*/ Alias: /" |\ - sed "s!$find_path/!!" |\ - $sort - - - - - - - - DELETED mttroot/mtt/bin/mtt_pause Index: mttroot/mtt/bin/mtt_pause ================================================================== --- mttroot/mtt/bin/mtt_pause +++ mttroot/mtt/bin/mtt_pause @@ -1,10 +0,0 @@ -#! /bin/sh - -## mtt_pause: Just waits for an EOF -## P J Gawthrop April 2000 -## Copyright (C) 2000 by Peter J. Gawthrop - -echo $* - -mtt $* -cat>/dev/null DELETED mttroot/mtt/bin/mtt_rename Index: mttroot/mtt/bin/mtt_rename ================================================================== --- mttroot/mtt/bin/mtt_rename +++ mttroot/mtt/bin/mtt_rename @@ -1,57 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_rename - -# P.J.Gawthrop Jan 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2002/04/22 08:05:26 gawthrop -## New regexp. -## -## Revision 1.5 2000/12/27 13:11:42 peterg -## *** empty log message *** -## -## Revision 1.4 1998/08/15 13:50:22 peterg -## Doesn't zap preexisting files -## -## Revision 1.3 1998/08/14 15:37:38 peterg -## rename now copies - no delete -## -## Revision 1.2 1998/01/06 13:57:39 peterg -## Now removes old version after copying -## -# Revision 1.1 1998/01/06 13:48:23 peterg -# Initial revision -# -############################################################### - -old_name=$1 -new_name=$2 -extension=$3 - -left='[^a-zA-Z]' -right=$left -if [ -f "$new_name$extension" ]; then - echo "$new_name$extension already exists -- no action taken" - exit -fi -if ls $old_name$extension > /dev/null 2>&1 - then - echo Renaming $old_name$extension to $new_name$extension - sed \ - -e "s/\($left\)$old_name\($right\)/\1$new_name\2/g" \ - -e "s/^$old_name\($right\)/$new_name\1/g" \ - <$old_name$extension >$new_name$extension -fi - - - DELETED mttroot/mtt/bin/mtt_rename_all Index: mttroot/mtt/bin/mtt_rename_all ================================================================== --- mttroot/mtt/bin/mtt_rename_all +++ mttroot/mtt/bin/mtt_rename_all @@ -1,58 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_rename_all - -# P.J.Gawthrop Jan 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 2000/03/17 11:50:18 peterg -## Added pic.fig -- schematic -## -## Revision 1.6 1998/07/22 15:20:06 peterg -## Added state.txt -## -## Revision 1.5 1998/04/13 09:15:36 peterg -## Added obspar -## -## Revision 1.4 1998/03/27 07:38:32 peterg -## simpar.r ---> simpar.txt -## -## Revision 1.3 1998/03/26 14:47:43 peterg -## Addes subs and cr -## -## Revision 1.2 1998/03/02 17:14:06 peterg -## Added simpar to list -## -## Revision 1.1 1998/01/06 13:57:59 peterg -## Initial revision -## -############################################################### - -old_name=$1 -new_name=$2 - -mtt_rename $old_name $new_name _abg.fig -mtt_rename $old_name $new_name _cr.r -mtt_rename $old_name $new_name _desc.tex -mtt_rename $old_name $new_name _input.txt -mtt_rename $old_name $new_name _lbl.txt -mtt_rename $old_name $new_name _logic.txt -mtt_rename $old_name $new_name _numpar.txt -mtt_rename $old_name $new_name _obspar.r -mtt_rename $old_name $new_name _odes.h -mtt_rename $old_name $new_name _rep.txt -mtt_rename $old_name $new_name _pic.fig -mtt_rename $old_name $new_name _simp.r -mtt_rename $old_name $new_name _simpar.txt -mtt_rename $old_name $new_name _sspar.r -mtt_rename $old_name $new_name _state.txt -mtt_rename $old_name $new_name _subs.r DELETED mttroot/mtt/bin/mtt_version Index: mttroot/mtt/bin/mtt_version ================================================================== --- mttroot/mtt/bin/mtt_version +++ mttroot/mtt/bin/mtt_version @@ -1,47 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_version -# Prints out version of a GNU-style tool - -# P.J.Gawthrop May 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1999/12/20 02:08:38 peterg -## Added second arg option -## -## Revision 1.2 1998/05/28 09:31:44 peterg -## Cosmetic changes -## -## Revision 1.1 1998/05/28 09:31:13 peterg -## Initial revision -## -############################################################### - -if [ -z "$2" ]; then - echo Trying $1 ... - ver=`$1 --version | head -1` - if [ -n "$ver" ]; then - echo is OK and has version $ver. - else - echo Either $1 does not exist or is not the GNU version. - fi -else - echo $1: $2 -fi - - - - - - - - DELETED mttroot/mtt/bin/mtt_versions Index: mttroot/mtt/bin/mtt_versions ================================================================== --- mttroot/mtt/bin/mtt_versions +++ mttroot/mtt/bin/mtt_versions @@ -1,88 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_versions - -# P.J.Gawthrop May 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2005/02/17 22:15:35 geraint -## Added missing quotes to conditional expression. -## -## Revision 1.5 2005/02/17 18:36:38 geraint -## Removed a bash-ism: replaced [[ conditional ]] with [ conditional ] -## -## Revision 1.4 2003/08/06 22:39:40 geraint -## Fixed reporting of non-existent software, no longer says "is OK and has version .". -## -## Revision 1.3 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.2 2000/11/13 21:40:26 peterg -## Sorted out the non-gnu -## -## Revision 1.1 1998/05/28 09:24:41 peterg -## Initial revision -## -############################################################### - -echo Versions of mtt and its components on `date` - -## gnu standard --version -mtt_version mtt - -echo Doing the GNU components -mtt_version gawk -mtt_version basename -mtt_version cat -mtt_version cp -mtt_version dirname -mtt_version gcc -mtt_version grep -mtt_version head -mtt_version make -mtt_version octave -mtt_version sed -mtt_version tail -mtt_version tr - -## Non standards -echo Doing the non-GNU components - -print_version () -{ - program=${1:-"Error: unknown program"} - shift; - version=$* - if [ "${version:-""}" ]; then - echo is OK and has version $version. - else - echo $program does not exist. - fi -} - -echo Trying xfig ... -xfig -help 2> mtt_junk; version=`grep Xfig mtt_junk` -print_version xfig $version - -echo Trying fig2dev ... -fig2dev -h > mtt_junk; version=`grep -i patchlevel mtt_junk` -print_version fig2dev $version - -echo Trying reduce ... -reduce -w >mtt_junk 2>1 < ghostview -## -## Revision 1.38 2003/07/13 21:53:24 geraint -## Updated to conform to latest Octave (tested with 2.1.49). -## - the pathsearch library was merged into liboctave last year -## - static_cast no longer seems to work between Matrix and ColumnVector -## -## Revision 1.37 2002/09/19 08:08:15 gawthrop -## Updated documentation documentation -## -## Revision 1.36 2002/08/28 15:48:00 geraint -## Updated mttrc to make standalone C++ compilation configuration clearer. -## -## Revision 1.35 2002/08/06 09:56:54 geraint -## Updated to work with changes in unstable version of Octave 2.1.36. -## Tested with 2.0.17 (ok) but will break earlier unstables (2.1.(<=35)). -## -## Revision 1.34 2002/05/08 14:51:03 geraint -## Moved matlab/octave data type conversion functions to a separate file. -## -## Revision 1.33 2002/05/08 11:39:36 gawthrop -## Added MTT_REP to PATH -## -## Revision 1.32 2002/05/07 23:50:34 geraint -## Preliminary support for Matlab dynamically linked shared objects: -## invoke with: mtt -cc sys rep mexglx -## ode2odes support is not yet included. -## -## Revision 1.31 2002/05/02 20:12:45 geraint -## Added -Wl,--rpath to MTT_CXXLIBS. Sets the runtime linker path so that the -## sys-admin does not have to ldconfig the octave directory for -cc to work. -## -## Revision 1.30 2002/05/02 11:10:11 geraint -## s/loctave/loctinterp/ -## -## Revision 1.29 2002/05/02 11:03:46 geraint -## Reinstated -liboctinterp and -lncurses; needed by xleftdiv. -## -## Revision 1.28 2002/05/01 12:21:29 geraint -## No longer uses save_ascii_data_for_plotting function to write data -## - eliminates dependence on liboctinterp (and libncurses) for .cc. -## -## Revision 1.27 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.26 2002/04/26 16:16:33 geraint -## Removed unnecessary variables PLAT and GCCVERS. -## -## Revision 1.25 2002/04/02 09:16:39 geraint -## Tidied up library search paths, now assumes that system libraries are set up correctly. -## For Debian, this means installing the following: blas-dev, fftw-dev, lapack-dev, libncurses5-dev, libkpathsea-dev, libreadline-dev -## It may also be necessary to run /sbin/ldconfig on the relevant directories (especially Octave's). -## -## Revision 1.24 2001/10/15 14:28:35 gawthrop -## Now has . at start of components library path $MTT_COMPONENTS -## -## Revision 1.23 2001/07/24 22:32:49 gawthrop -## Use gv, not ghostview -## -## Revision 1.22 2001/04/12 03:08:00 geraint -## Improved sh->csh conversion, reduces environment namespace pollution. -## Still need to do proper if [ -z $MTT_BASE ] ... else ... fi conversion. -## -## Revision 1.21 2001/04/10 13:56:13 gawthrop -## Uses standard mkoctfile -## -## Revision 1.20 2001/04/10 13:08:19 gawthrop -## Smoother translation to .cs using sh2csh -## -## Revision 1.19 2001/03/30 15:13:49 gawthrop -## Rationalised simulation modes to each return mtt_data -## -## Revision 1.18 2001/03/19 02:28:52 geraint -## Branch merge: merging-ode2odes-exe back to MAIN. -## -## Revision 1.17.2.4 2001/03/06 03:48:43 geraint -## Print additional environment variable for "mtt -p". -## MTT_LDFLAGS defaults to " " to avoid installation warning. -## -## Revision 1.17.2.3 2001/03/01 05:05:53 geraint -## Minor revisions. -## -## Revision 1.17.2.2 2001/02/23 03:53:53 geraint -## Minor revisions. (ode2odes.exe works on GNU/Linux and ~GNU/Irix) -## -## Revision 1.17.2.1 2001/02/22 06:41:40 geraint -## Initial merge of ode2odes.exe into main mtt. -## standalone_rep.make deleted: rules moved to mtt, variables to mttrc. -## -## Revision 1.17 2000/12/27 16:46:13 peterg -## Stripped the mtt- from paths -## -## Revision 1.16 2000/12/27 15:16:44 peterg -## If then else format -## -## Revision 1.15 2000/12/27 14:57:43 peterg -## Now takes the base path as an argument -## -## Revision 1.14 2000/12/27 13:11:43 peterg -## *** empty log message *** -## -## Revision 1.13 2000/10/03 12:12:14 peterg -## New path structure to account for three way split in mtt tree -## -## Revision 1.12 2000/09/18 12:17:07 peterg -## Now includes to control system toolbox in OCTAVE_PATH -## Don't use -path stuff - use :: instead. -## -## Revision 1.11 2000/05/21 17:55:15 peterg -## New rep path -## -## Revision 1.10 2000/05/16 11:41:23 peterg -## *** empty log message *** -## -## Revision 1.9 1999/03/11 04:02:19 peterg -## Revised so that sh2csh does its stuff. -## -## Revision 1.8 1998/07/17 19:48:46 peterg -## *** empty log message *** -## -## Revision 1.7 1998/03/24 09:11:49 peterg -## Compatible with .csh version -## -## Revision 1.6 1998/03/13 11:53:29 peterg -## reduce --> reduce 64 -## -## Revision 1.5 1998/01/16 08:55:01 peterg -## MAKE=make -## -## Revision 1.4 1998/01/06 09:14:51 peterg -## Added latex2html to setup -## -# Revision 1.3 1998/01/06 09:11:26 peterg -# Removed matlab from the setup -# -# Revision 1.2 1997/12/04 10:49:16 peterg -# Put under RCS at last -# Added CC variable -# -############################################################### - -## When using csh, replace $1 by the mtt base path, eg /usr/share/mtt/latest -export MTT_BASE=$1 - -if [ -z "$MTT_BASE" ]; then - echo mttrc requires one argument: eg mttrc /usr/share/mtt/latest -else - echo Setting paths with base $MTT_BASE - # The following line sets up the make to use -- gmake is the standard - # but you may wish to use lsmake for parallelism - export MAKE='make' - - # The following sets up the c compiler - export CC='gcc' - - # Setup the paths - export MTTPATH=$MTT_BASE/bin - export MTT_LIB=$MTT_BASE/lib - export MTT_DOC=$MTT_BASE/doc - export MTT_CC=$MTT_BASE/cc - - export MTT_COMPONENTS=.:$MTT_LIB/comp - export MTT_CRS=$MTT_LIB/cr - export MTT_EXAMPLES=$MTT_LIB/examples - export MTT_REP=$MTT_LIB/rep - - export PATH=$PATH\:$MTTPATH\:$MTTPATH/trans\:$MTT_CC\:$MTT_REP - - #Setup octave -##<<<<<<< mttrc -## export MATRIX_PATH=$MTTPATH/trans/m/ -## export MATRIX_PATH=$MATRIX_PATH\:$MTT_LIB/comp/simple/ -## export MATRIX_PATH=$MATRIX_PATH\:$MTT_LIB/control/ -## export MATRIX_PATH=$MATRIX_PATH\:$MTT_LIB/octave/\:\: - -##======= - MATRIX="octave" - #MATRIX_PATH1=$(echo "genpath('$MTTPATH/trans/m')" |$MATRIX -q | awk '{print $3}') - #MATRIX_PATH2=$(echo "genpath('$MTT_LIB/comp/simple')" |$MATRIX -q | awk '{print $3}') - #MATRIX_PATH3=$(echo "genpath('$MTT_LIB/control')" |$MATRIX -q | awk '{print $3}') - #MATRIX_PATH4=$(echo "genpath('$MTT_LIB/octave')" |$MATRIX -q | awk '{print $3}') - #export MATRIX_PATH=$MATRIX_PATH1:$MATRIX_PATH2:$MATRIX_PATH3:$MATRIX_PATH4 - MATRIX_PATH1=$(find $MTTPATH/trans/m -type d|grep -v CVS|awk '{printf ":%s", $0}') - MATRIX_PATH2=$(find $MTT_LIB/comp/simple -type d|grep -v CVS|awk '{printf ":%s", $0}') - MATRIX_PATH3=$(find $MTT_LIB/control -type d|grep -v CVS|awk '{printf ":%s", $0}') - MATRIX_PATH4=$(find $MTT_LIB/octave -type d|grep -v CVS|awk '{printf ":%s", $0}') - export MATRIX_PATH=$MATRIX_PATH1:$MATRIX_PATH2:$MATRIX_PATH3:$MATRIX_PATH4 -##>>>>>>> 1.45 - export OCTAVE_PATH=.\:$MATRIX_PATH -##<<<<<<< mttrc - export MATRIX="octave --path $OCTAVE_PATH" -##======= -## export MATRIX="$MATRIX --path $OCTAVE_PATH" -##>>>>>>> 1.45 - - # Setup the symbolic stuff - ##export SYMBOLIC='reduce 64' - export SYMBOLIC='reduce -w' - - - # Setup xfig - export FIG="xfig \ - -startfontsize 20 \ - -metric \ - -portrait \ - -startgridmode 2 \ - -pheight 21 \ - -pwidth 30 \ - -library_dir $MTT_LIB/xfig/\ - " - - # Setup ps viewer - export PSVIEW='evince' - - # Setup pdf viewer - export PDFVIEW='acroread' - - # Setup html viewer - export HTMLVIEW='firefox' - - # Setup dvi viewer - export DVIVIEW='xdvi' - - # Setup latex2html - export LATEX2HTML="latex2html -contents_in_navigation -index_in_navigation -address http://mtt.sourceforge.net" - - # Ascend stuff - export ASCENDLIBRARY=$MTTPATH/ascend/lib - - # Oct file generation - use version with no optimisation. - #export MKOCTFILE=$MTT_LIB/octave/mkoctfile # This for no optimisation - export MKOCTFILE=mkoctfile - - ######################################################################################### - ## - ## Configure environment for standalone compilation of files linked with Octave libraries - ## (required for ode2odes.exe only) - - # location of Octave directories on local system (usually /usr, /usr/local or /opt) - - OCTAVEPREFIX="/usr" - - # include paths for Octave - - IOCTAVE="-I${OCTAVEPREFIX}/include/octave/ -I${OCTAVEPREFIX}/include/octave/octave" - - # include and library paths for Octave - - if [ -z `which ${MKOCTFILE}` ]; then - # Octave development stuff not installed - # C++ and .oct representations will not work - OCTAVE_INC_FLAGS=" " - OCTAVE_LIB_FLAGS=" " - else - OCTAVE_INC_FLAGS="`${MKOCTFILE} --print INCFLAGS`" - OCTAVE_LIB_FLAGS="\ - `${MKOCTFILE} --print LFLAGS` \ - `${MKOCTFILE} --print LIBOCTAVE` \ - `${MKOCTFILE} --print LIBCRUFT` \ - `${MKOCTFILE} --print LIBOCTINTERP` \ - `${MKOCTFILE} --print BLAS_LIBS` \ - `${MKOCTFILE} --print FFTW_LIBS` \ - `${MKOCTFILE} --print LIBS` \ - `${MKOCTFILE} --print FLIBS` \ - `${MKOCTFILE} --print RLD_FLAG`" - fi - - # C++ compiler options - - DEBUG="-g" - OPTIM="-O3" - FLAGS="-fno-rtti -fno-exceptions -fno-implicit-templates" - - # exported variables - - export MTT_CXX="g++" - export MTT_CXXFLAGS="${DEBUG} ${OPTIM} ${FLAGS}" - export MTT_CXXLIBS="${OCTAVE_LIB_FLAGS}" - export MTT_CXXINCS="-I. -I${MTT_LIB}/cc ${OCTAVE_INC_FLAGS}" - export MTT_LDFLAGS=" " - - ## End of Octave environment configuration - ## - ######################################################################################### - - ############################################################ - ## - ## Configure environment for compilation of Matlab mex files - - MATLAB_ARCH="glnx86" - MATLAB_ROOT="/usr/local/matlab6p1" - MATLAB_FLAGS="-shared -fPIC -ansi -D_GNU_SOURCE -pthread" - MATLAB_INCS="-I${MATLAB_ROOT}/extern/include" - MATLAB_LIBS="-Wl,--rpath-link,${MATLAB_ROOT}/extern/lib/${MATLAB_ARCH},--rpath-link,${MATLAB_ROOT}/bin/${MATLAB_ARCH} -L${MATLAB_ROOT}/bin/${MATLAB_ARCH} -lmx -lmex -lm" - - # exported variables - - export MTT_MATLAB_FLAGS="${MATLAB_FLAGS} ${MATLAB_INCS} ${MATLAB_LIBS}" - - ## End of Matlab environment configuration - ## - ############################################################# - - ####################################################### - ## - ## Configure environment for compilation of RTXI module - -##<<<<<<< mttrc - ## RTXI_INCS="-I/usr/local/src/mtt/rtxi/rtxi_cvs_30Sep05/include -I/usr/include/qt3 -I/home/peterg/Development/rtxi/include" -# MORE_RTXI_INCS="-I/usr/realtime/include -I/usr/src/linux/include" -##======= - ROOT="/usr/local/rtxi-knoppix" - - RTXI_LIBTOOL="${ROOT}/usr/local/lib/rtxi/libtool" - RTXI_CXX="g++-3.3" - RTXI_CXXLD="g++-3.3" - RTXI_CXXCOMPILE="${RTXI_LIBTOOL} --mode=compile --tag CXX ${RTXI_CXX}" - RTXI_CXXLINK="${RTXI_LIBTOOL} --mode=link --tag CXX ${RTXI_CXXLD}" - - RTXI_INCS="" - RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/share/qt3/include" - RTXI_INCS="${RTXI_INCS} -I." - RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/realtime/include" - RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/share/qt3/include" - RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/src/comedi/include" - RTXI_INCS="${RTXI_INCS} -I${ROOT}/usr/src/rtxi/include" - - RTXI_DEFS="-D_REENTRANT -DQT_THREAD_SUPPORT" - RTXI_CXXFLAGS="-g -O2 ${RTXI_INCS} ${RTXI_DEFS}" - RTXI_LIBS="-L${ROOT}/usr/share/qt3/lib -lqt-mt" -##>>>>>>> 1.45 - RTXI_FLAGS="-DHAVE_CONFIG_H -D_REENTRANT -DQT_THREAD_SUPPORT" - RTXI_LDFLAGS="-L${ROOT}/usr/realtime/lib -lpthread -module -avoid-version" - RTXI_RPATH="${ROOT}/usr/local/lib/rtxi/models/" - - export MTT_RTXI_CXXCOMPILE="${RTXI_CXXCOMPILE}" - export MTT_RTXI_CXXLINK="${RTXI_CXXLINK}" - export MTT_RTXI_LIBTOOL="${RTXI_LIBTOOL}" - export MTT_RTXI_CXXFLAGS="${RTXI_CXXFLAGS}" - export MTT_RTXI_LIBS="${RTXI_LIBS}" - export MTT_RTXI_FLAGS="${RTXI_RTXI_FLAGS}" - export MTT_RTXI_LDFLAGS="${RTXI_LDFLAGS}" - export MTT_RTXI_RPATH="${RTXI_RPATH}" - - ## End of RTXI environment configuration - ## - ############################################################# - -fi DELETED mttroot/mtt/bin/mttrc.csh Index: mttroot/mtt/bin/mttrc.csh ================================================================== --- mttroot/mtt/bin/mttrc.csh +++ mttroot/mtt/bin/mttrc.csh @@ -1,275 +0,0 @@ -#!/bin/csh -## Automatically generated from bashrc on Wed Aug 28 15:17:42 BST 2002 - DO NOT EDIT -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mttrc - sets up paths etc for mtt -# Usage: mttrc - -# Copyright (c) P.J.Gawthrop 1996,1977. - - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.35 2002/08/06 09:56:54 geraint -## Updated to work with changes in unstable version of Octave 2.1.36. -## Tested with 2.0.17 (ok) but will break earlier unstables (2.1.(<=35)). -## -## Revision 1.34 2002/05/08 14:51:03 geraint -## Moved matlab/octave data type conversion functions to a separate file. -## -## Revision 1.33 2002/05/08 11:39:36 gawthrop -## Added MTT_REP to PATH -## -## Revision 1.32 2002/05/07 23:50:34 geraint -## Preliminary support for Matlab dynamically linked shared objects: -## invoke with: mtt -cc sys rep mexglx -## ode2odes support is not yet included. -## -## Revision 1.31 2002/05/02 20:12:45 geraint -## Added -Wl,--rpath to MTT_CXXLIBS. Sets the runtime linker path so that the -## sys-admin does not have to ldconfig the octave directory for -cc to work. -## -## Revision 1.30 2002/05/02 11:10:11 geraint -## s/loctave/loctinterp/ -## -## Revision 1.29 2002/05/02 11:03:46 geraint -## Reinstated -liboctinterp and -lncurses; needed by xleftdiv. -## -## Revision 1.28 2002/05/01 12:21:29 geraint -## No longer uses save_ascii_data_for_plotting function to write data -## - eliminates dependence on liboctinterp (and libncurses) for .cc. -## -## Revision 1.27 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.26 2002/04/26 16:16:33 geraint -## Removed unnecessary variables PLAT and GCCVERS. -## -## Revision 1.25 2002/04/02 09:16:39 geraint -## Tidied up library search paths, now assumes that system libraries are set up correctly. -## For Debian, this means installing the following: blas-dev, fftw-dev, lapack-dev, libncurses5-dev, libkpathsea-dev, libreadline-dev -## It may also be necessary to run /sbin/ldconfig on the relevant directories (especially Octave's). -## -## Revision 1.24 2001/10/15 14:28:35 gawthrop -## Now has . at start of components library path $MTT_COMPONENTS -## -## Revision 1.23 2001/07/24 22:32:49 gawthrop -## Use gv, not ghostview -## -## Revision 1.22 2001/04/12 03:08:00 geraint -## Improved sh->csh conversion, reduces environment namespace pollution. -## -## Revision 1.21 2001/04/10 13:56:13 gawthrop -## Uses standard mkoctfile -## -## Revision 1.20 2001/04/10 13:08:19 gawthrop -## Smoother translation to .cs using sh2csh -## -## Revision 1.19 2001/03/30 15:13:49 gawthrop -## Rationalised simulation modes to each return mtt_data -## -## Revision 1.18 2001/03/19 02:28:52 geraint -## Branch merge: merging-ode2odes-exe back to MAIN. -## -## Revision 1.17.2.4 2001/03/06 03:48:43 geraint -## Print additional environment variable for "mtt -p". -## MTT_LDFLAGS defaults to " " to avoid installation warning. -## -## Revision 1.17.2.3 2001/03/01 05:05:53 geraint -## Minor revisions. -## -## Revision 1.17.2.2 2001/02/23 03:53:53 geraint -## Minor revisions. (ode2odes.exe works on GNU/Linux and ~GNU/Irix) -## -## Revision 1.17.2.1 2001/02/22 06:41:40 geraint -## Initial merge of ode2odes.exe into main mtt. -## standalone_rep.make deleted: rules moved to mtt, variables to mttrc. -## -## Revision 1.17 2000/12/27 16:46:13 peterg -## Stripped the mtt- from paths -## -## Revision 1.16 2000/12/27 15:16:44 peterg -## -## Revision 1.15 2000/12/27 14:57:43 peterg -## Now takes the base path as an argument -## -## Revision 1.14 2000/12/27 13:11:43 peterg -## *** empty log message *** -## -## Revision 1.13 2000/10/03 12:12:14 peterg -## New path structure to account for three way split in mtt tree -## -## Revision 1.12 2000/09/18 12:17:07 peterg -## Now includes to control system toolbox in OCTAVE_PATH -## Don't use -path stuff - use :: instead. -## -## Revision 1.11 2000/05/21 17:55:15 peterg -## New rep path -## -## Revision 1.10 2000/05/16 11:41:23 peterg -## *** empty log message *** -## -## Revision 1.9 1999/03/11 04:02:19 peterg -## Revised so that sh2csh does its stuff. -## -## Revision 1.8 1998/07/17 19:48:46 peterg -## *** empty log message *** -## -## Revision 1.7 1998/03/24 09:11:49 peterg -## Compatible with .csh version -## -## Revision 1.6 1998/03/13 11:53:29 peterg -## reduce --> reduce 64 -## -## Revision 1.5 1998/01/16 08:55:01 peterg -## MAKE=make -## -## Revision 1.4 1998/01/06 09:14:51 peterg -## Added latex2html to setup -## -# Revision 1.3 1998/01/06 09:11:26 peterg -# Removed matlab from the setup -# -# Revision 1.2 1997/12/04 10:49:16 peterg -# Put under RCS at last -# Added CC variable -# -############################################################### - -## When using csh, replace /usr/local/mtt/mttroot/mtt by the mtt base path, eg /usr/share/mtt/latest -setenv MTT_BASE /usr/local/mtt/mttroot/mtt - - echo Setting paths with base $MTT_BASE - # The following line sets up the make to use -- gmake is the standard - # but you may wish to use lsmake for parallelism - setenv MAKE 'make' - - # The following sets up the c compiler - setenv CC 'gcc' - - # Setup the paths - setenv MTTPATH $MTT_BASE/bin - setenv MTT_LIB $MTT_BASE/lib - setenv MTT_DOC $MTT_BASE/doc - setenv MTT_CC $MTT_BASE/cc - - setenv MTT_COMPONENTS .:$MTT_LIB/comp - setenv MTT_CRS $MTT_LIB/cr - setenv MTT_EXAMPLES $MTT_LIB/examples - setenv MTT_REP $MTT_LIB/rep - - setenv PATH $PATH\:$MTTPATH\:$MTTPATH/trans\:$MTT_CC\:$MTT_REP - - #Setup octave - setenv MATRIX_PATH $MTTPATH/trans/m// - setenv MATRIX_PATH $MATRIX_PATH\:$MTT_LIB/comp/simple// - setenv MATRIX_PATH $MATRIX_PATH\:$MTT_LIB/control// - setenv MATRIX_PATH $MATRIX_PATH\:$MTT_LIB/octave//\:\: - - setenv OCTAVE_PATH .\:$MATRIX_PATH - setenv MATRIX "octave" - - # Setup the symbolic stuff - setenv SYMBOLIC 'reduce 64' - - - # Setup xfig - setenv FIG "xfig \ - -startfontsize 20 \ - -metric \ - -portrait \ - -startgridmode 2 \ - -pheight 21 \ - -pwidth 30 \ - -library_dir $MTT_LIB/xfig/\ - " - - # Setup ps viewer - setenv PSVIEW 'gv' - - # Setup pdf viewer - setenv PDFVIEW 'acroread' - - # Setup html viewer - setenv HTMLVIEW 'netscape' - - # Setup dvi viewer - setenv DVIVIEW 'xdvi' - - # Setup latex2html - setenv LATEX2HTML "latex2html -contents_in_navigation -index_in_navigation -address http://mtt.sourceforge.net" - - # Ascend stuff - setenv ASCENDLIBRARY $MTTPATH/ascend/lib - - # Oct file generation - use version with no optimisation. - #setenv MKOCTFILE $MTT_LIB/octave/mkoctfile # This for no optimisation - setenv MKOCTFILE mkoctfile - - ######################################################################################### - ## - ## Configure environment for standalone compilation of files linked with Octave libraries - ## (required for ode2odes.exe only) - - # location of Octave directories on local system (usually /usr, /usr/local or /opt) - -set OCTAVEPREFIX="/usr" - - # include paths for Octave - -set IOCTAVE="-I${OCTAVEPREFIX}/include/octave/ -I${OCTAVEPREFIX}/include/octave/octave" - - # library paths for Octave - -set OCTAVEVERS=`octave --version | head -1 | gawk '{ print $4 }'` -set OCTAVEMINOR=`echo ${OCTAVEVERS} | gawk -F\. '{print $2}'` - if [ "${OCTAVEMINOR}" = "0" ] ; then # stable - LOCTAVE="-L${OCTAVEPREFIX}/lib/octave-${OCTAVEVERS} -loctave -lcruft -loctinterp -Wl,--rpath,${OCTAVEPREFIX}/lib/octave-${OCTAVEVERS}" - LOCTAVE="-L${OCTAVEPREFIX}/lib/octave-${OCTAVEVERS} -loctave -lcruft -loctinterp -Wl,--rpath,${OCTAVEPREFIX}/lib/octave-${OCTAVEVERS} -loct-pathsearch -loct-readline" - fi -set LSYSTEM="-ldl -lm -lncurses -lkpathsea -lreadline -lblas -llapack -lfftw -lg2c" - - # C++ compiler options - -set DEBUG="-g" -set OPTIM="-O3" -set FLAGS="-fno-rtti -fno-exceptions -fno-implicit-templates" - - # exported variables - - setenv MTT_CXX "g++" - setenv MTT_CXXFLAGS "${DEBUG} ${OPTIM} ${FLAGS}" - setenv MTT_CXXLIBS "${LOCTAVE} ${LSYSTEM}" - setenv MTT_CXXINCS "-I. -I${MTT_LIB}/cc ${IOCTAVE}" - setenv MTT_LDFLAGS " " - - ## End of Octave environment configuration - ## - ######################################################################################### - - ############################################################ - ## - ## Configure environment for compilation of Matlab mex files - -set MATLAB_ARCH="glnx86" -set MATLAB_ROOT="/usr/local/matlab6p1" -set MATLAB_FLAGS="-shared -fPIC -ansi -D_GNU_SOURCE -pthread" -set MATLAB_INCS="-I${MATLAB_ROOT}/extern/include" -set MATLAB_LIBS="-Wl,--rpath-link,${MATLAB_ROOT}/extern/lib/${MATLAB_ARCH},--rpath-link,${MATLAB_ROOT}/bin/${MATLAB_ARCH} -L${MATLAB_ROOT}/bin/${MATLAB_ARCH} -lmx -lmex -lm" - - # exported variables - - setenv MTT_MATLAB_FLAGS "${MATLAB_FLAGS} ${MATLAB_INCS} ${MATLAB_LIBS}" - - ## End of Matlab environment configuration - ## - ############################################################# - DELETED mttroot/mtt/bin/sh2csh Index: mttroot/mtt/bin/sh2csh ================================================================== --- mttroot/mtt/bin/sh2csh +++ mttroot/mtt/bin/sh2csh @@ -1,46 +0,0 @@ -#!/bin/sh -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2001/04/12 03:08:00 geraint -## Improved sh->csh conversion, reduces environment namespace pollution. -## Still need to do proper if [ -z $MTT_BASE ] ... else ... fi conversion. -## -## Revision 1.2 1999/03/11 04:12:26 peterg -## Put in heading. -## -## Revision 1.1 1999/03/11 04:02:45 peterg -## Initial revision -## -############################################################### - -#Converts mttrc to csh form. - -date=`date` -wd=`pwd` -base=`dirname $wd` - -echo Converting $1 to $1.csh using $base as default - -cat<$1.csh -#!/bin/csh -## Automatically generated from bashrc on $date - DO NOT EDIT -EOF - -# grep -v lines need to be replaced with proper if...then conversion -cat $1 |\ - sed 's/export[ \t]*\([A-Za-z0-9_]*\)=/setenv\ \1\ /' |\ - sed 's/^\([\ \t]*\)\([A-Za-z0-9_]*\)=/set\ \2=/' |\ - grep -v "if \[ -z " |\ - grep -v "echo mttrc requires one argument: eg mttrc /usr/share/mtt/latest" |\ - grep -v "else" |\ - grep -v -e "^fi" |\ - sed "s%\$1%$base%" \ ->>$1.csh - - -echo done. - - DELETED mttroot/mtt/bin/trans/ICD_txt2lang.sh Index: mttroot/mtt/bin/trans/ICD_txt2lang.sh ================================================================== --- mttroot/mtt/bin/trans/ICD_txt2lang.sh +++ mttroot/mtt/bin/trans/ICD_txt2lang.sh @@ -1,54 +0,0 @@ -#! /bin/sh - -sys=$1 -lang=$2 - -ICD=${sys}_ICD.${lang} -txt=${sys}_ICD.txt -struc=${sys}_struc.txt - -case ${lang} in - c) lb='['; rb=']'; offset=0; comment='//';; - cc) lb='('; rb=')'; offset=1; comment='//';; - m) lb='('; rb=')'; offset=0; comment='#';; - *) echo Language ${lang} not yet supported.; exit -1;; -esac - -echo Creating ${ICD} - -cat < ${ICD} -${comment} Interface Control Definition mappings for system ${sys} -${comment} ${ICD}: Generated by MTT `date` - -EOF - -# ICD.txt Format: -# Input|Output ICD_Name PortName Causality: causality Units: units -# $1 $2 $3 $4 $5 $6 $7 - -cat <> ${ICD} - -${comment} Inputs - -EOF -for name in `cat ${txt} | gawk '($1 == "Input:") { print $3 }'` -do - num=`grep ${name} ${struc} | gawk '($1 == "input") { print $2 }'` - grep ^Input ${txt} |\ - gawk '($3 == name) { printf ("\tmttu%c%d%c\t= %s;\n", lb, num-offset, rb, $2) }'\ - lb=${lb} rb=${rb} name=${name} num=${num} offset=${offset} >> ${ICD} -done - -cat <> ${ICD} - -${comment} Outputs - -EOF -for name in `cat ${txt} | gawk '($1 == "Output:") { print $3 }'` -do - num=`grep ${name} ${struc} | gawk '($1 == "output") { print $2 }'` - grep ^Output ${txt} |\ - gawk '($3 == name) { printf ("\t%-30s = mtty%c%d%c;\n", $2, lb, num-offset, rb) }'\ - lb=${lb} rb=${rb} name=${name} num=${num} offset=${offset} >> ${ICD} -done - DELETED mttroot/mtt/bin/trans/abg2cbg_m Index: mttroot/mtt/bin/trans/abg2cbg_m ================================================================== --- mttroot/mtt/bin/trans/abg2cbg_m +++ mttroot/mtt/bin/trans/abg2cbg_m @@ -1,191 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: abg2cbg_m -# -# Acausal bond graph to causal bond graph: mfile format - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.17 2001/07/28 21:09:22 geraint -## Eliminated duplicate lines in type.sh. -## -## Revision 1.16 2001/07/26 04:07:28 gawthrop -## Changed a to w on open (Geraint's suggestion) -## Explictly close files -## -## Revision 1.15 2001/07/23 23:24:02 gawthrop -## Now only writes to type.sh and cbg.m when causality is complete -## -## Revision 1.14 2000/12/28 12:16:13 peterg -## *** empty log message *** -## -## Revision 1.13 1998/07/27 20:30:12 peterg -## *** empty log message *** -## -## Revision 1.12 1998/07/10 08:43:46 peterg -## Added -I switch -## -## Revision 1.11 1998/01/23 13:29:54 peterg -## $RMATRIX --> $MATRIX -## -# Revision 1.10 1996/12/04 21:51:02 peterg -# Now uses filenum instead of line name. -# Uses fopen -# -# Revision 1.9 1996/11/06 15:49:33 peterg -# Cahged $MATRIX to $RMATRIX -# -# Revision 1.8 1996/08/25 09:31:49 peter -# More error handling. -# -## Revision 1.7 1996/08/25 09:22:55 peter -## # Print errors, if any. -## mtt_error error.txt -## -## Revision 1.6 1996/08/24 14:36:01 peter -## Error handling included. -## -## Revision 1.5 1996/08/19 15:38:31 peter -## Removed bug work round. -## -## Revision 1.4 1996/08/16 14:28:45 peter -## Some debugging lines removed. -## -## Revision 1.3 1996/08/08 18:06:55 peter -## Unified naming scheme. -## -## Revision 1.2 1996/08/05 11:25:00 peter -## Removed bonds argument from abg2cbg. -## Removed call to $1_abg. -## -## Revision 1.1 1996/08/04 17:45:11 peter -## Initial revision -## -############################################################### - -# The causal BG is described by four matrices -# (the same structure as the acausal BG except that Causality is 1 ot -1): -# junctions: describes the junctions - -# Column 1 Index of component (see components) -# Column 2.. Indices of bonds on junction (see jbonds) -# rows may be padded with zeros -# -# cjbonds: describes the true bonds - -# Column 1 Index of component (see components) -# Column 2 Direction -# 1 away from junction -# -1 towards junction -# Column 3 Effort causality -# 1 stroke at arrow end -# -1 stroke at other end -# 0 no stroke (ie acausal) -# Column 4 Flow causality -# 1 stroke at arrow end -# -1 stroke at other end -# 0 no stroke (ie acausal) -# Columns 5:6 x,y coordinates of non-arrow end (in Fig) -# Columns 7:8 x,y coordinates of arrow end (in Fig) -# -# mbonds: describes the modulation bonds - -# Column 1 Index of component at non-arrow end -# Column 2 Index of component at arrow end -# Columns 4:5 x,y coordinates of non-arrow end (in Fig) -# Columns 6:7 x,y coordinates of arrow end (in Fig) -# -# components: describes the comonents - -# Column 1 Type of component -# 0 0-junction -# 1 1-junction -# 2 R component -# 3 C component -# 4 I component -# 11 TF component -# 12 GY component -# 13 A component -# Column 2 Flag for explicit junction -# 4 Explicit component (4 means text type) -# 0 Implicit component -# Column 3-14 fig file information (see fig documentation) -# -# Lists of under- and over-causal junctions are displayed. -# -# P.J.Gawthrop May 1996 -# Copyright (c) P.J.Gawthrop, 1996. - - -# P.J.Gawthrop May 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -derivative=0;blurb=integral -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I ) - info=info;; - -derivative ) - derivative=1; blurb=derivative;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -infofile='mtt_info.txt' -errorfile='mtt_error.txt' -typefile="$1_type.sh" - -# Remove the old log file -rm -f abg2cbg_m.log -rm -f $1_cbg.m -rm -f $typefile -rm -f $infofile - - -#Inform user -echo "Creating $1_cbg.m (maximise $blurb causality)" -echo Creating $1_type.sh - -## Start the type.sh file -mtt_header $1 type sh > $typefile - -# Use matrix manipulation to accomplish the transformation -$MATRIX << EOF >abg2cbg_m.log #2>mtt_error.txt - - infofilenum = fopen("$infofile",'wt'); - errorfilenum = fopen("$errorfile",'wt'); - typefilenum = fopen("$typefile",'wt'); - - %Convert from acausal to causal bond graph in m-file form. - system_name='$1'; - - port_bonds = []; - port_direction = []; - port_status = []; - [cbonds,status] = abg2cbg(system_name, '', '', port_bonds, port_direction, port_status, ... - $derivative,typefilenum, infofilenum, errorfilenum); - - ## close the files - fclose(infofilenum); - fclose(errorfilenum); - fclose(typefilenum); - -EOF - -cat $typefile | sort -u > ${typefile}.tmp -mv ${typefile}.tmp $typefile - -if [ "$info" = "info" ]; then - cat $infofile -fi - -# cp $1_$1_cbg.m $1_cbg.m 2>> mtt_error.txt - -# Print errors, if any. -mtt_error mtt_error.txt - DELETED mttroot/mtt/bin/trans/abg2cmp_dia2txt Index: mttroot/mtt/bin/trans/abg2cmp_dia2txt ================================================================== --- mttroot/mtt/bin/trans/abg2cmp_dia2txt +++ mttroot/mtt/bin/trans/abg2cmp_dia2txt @@ -1,14 +0,0 @@ -#! /bin/sh - -### abg2cmp_dia2txt -## Creates list of components contained in _abg.dia -## Copyright (C) 2002 by Geraint Paul Bevan - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -set -e - -mtt_uncompress.sh $1_abg.dia -dia2abg.pl --create_component_list --diagram_name=$1 DELETED mttroot/mtt/bin/trans/abg2cmp_fig2txt Index: mttroot/mtt/bin/trans/abg2cmp_fig2txt ================================================================== --- mttroot/mtt/bin/trans/abg2cmp_fig2txt +++ mttroot/mtt/bin/trans/abg2cmp_fig2txt @@ -1,79 +0,0 @@ -#! /bin/sh - -### abg2cmp_fig2txt -## Creates list of components contained in _abg.fig -## Copyright (C) 2002 by Peter J. Gawthrop - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Log$ - ## Revision 1.3 2002/12/06 22:12:28 geraint - ## Removed unique option from sort - ## - prevents multiple anonymous components from existing - ## - duplicate named components are caught by rbg_fig2m.awk anyway - ## - ## Revision 1.2 2002/12/06 11:47:49 gawthrop - ## Checks levels in fig file to extract genuine components - ## Puts comments at top of cmp.txt file - ## - ## Revision 1.1 2002/12/01 14:54:39 gawthrop - ## Replaces defunct abg2lbl_fig2txt - ## - ## - ############################################################### - -system=$1 -infile=${system}_abg.fig -outfile=${system}_cmp.txt -date=`date` - -echo Creating ${outfile} - -header() { - cat < ${outfile} - -## Make list of components -get_valid_components < ${infile} |\ - remove_port_labels |\ - sort >> ${outfile} DELETED mttroot/mtt/bin/trans/abg2connections_m2dat Index: mttroot/mtt/bin/trans/abg2connections_m2dat ================================================================== --- mttroot/mtt/bin/trans/abg2connections_m2dat +++ mttroot/mtt/bin/trans/abg2connections_m2dat @@ -1,32 +0,0 @@ -#! /bin/sh - -### abg2connections_m2dat -## Creates connections.dat from abg.m -## Copyright (C) 2004 by Geraint Paul Bevan - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -set -e - -sys=$1 - -file=${sys}_connections.dat - -${MATRIX} <abg2connections_m.log - -abg = ${sys}_abg; - -${sys}_connections = abg2connections (abg); - -str = save_header_format_string; -save_header_format_string = ["# Model Transformation Tools\t", ... - " -*-octave-*-\n", ... - "# Created by abg2connections_m\n", ... - str]; - -save -text ${file} ${sys}_connections; - -EOF - DELETED mttroot/mtt/bin/trans/abg2cr_m2txt Index: mttroot/mtt/bin/trans/abg2cr_m2txt ================================================================== --- mttroot/mtt/bin/trans/abg2cr_m2txt +++ mttroot/mtt/bin/trans/abg2cr_m2txt @@ -1,48 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: abg2cr_m2txt - -# Abg file to constitutive relationship conversion -# P.J.Gawthrop march 2000 -# Copyright (C) 2000 by Peter J. Gawthrop - - - -# Inform user -if [ "$1_cr.txt" -nt "$1_abg.m" ]; then - echo "Using $1_cr.txt" - exit -else - echo "Creating $1_cr.txt" -fi - - -rm -f mtt_error - - -# This is the main transformation using awk -# And remove crs with same name as system -grep 'cr = ' $1_abg.m | gawk ' -BEGIN { -# Include lin cr anyway. -print "lin" -} -{ - crs=substr($3,2,length($3)-3); - N=split(crs,cr,";"); - for (i=1;i<=N;i++){ - if (length(cr[i])>0) - print cr[i]; - } -}' 2>mtt_error.txt | sort -u | grep -v none | grep -v '\$[0-9]'> $1_cr.txt - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - - - DELETED mttroot/mtt/bin/trans/abg2ibg_dia2m Index: mttroot/mtt/bin/trans/abg2ibg_dia2m ================================================================== --- mttroot/mtt/bin/trans/abg2ibg_dia2m +++ mttroot/mtt/bin/trans/abg2ibg_dia2m @@ -1,14 +0,0 @@ -#! /bin/sh - -### abg2ibg_dia2m -## Creates _ibg.m from _abg.dia -## Copyright (C) 2004 by Geraint Paul Bevan - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -set -e - -mtt_uncompress.sh $1_abg.dia -dia2abg.pl --create_ibg --diagram_name=$1 DELETED mttroot/mtt/bin/trans/abg2lbl_fig2txt Index: mttroot/mtt/bin/trans/abg2lbl_fig2txt ================================================================== --- mttroot/mtt/bin/trans/abg2lbl_fig2txt +++ mttroot/mtt/bin/trans/abg2lbl_fig2txt @@ -1,350 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: abg2lbl_fig2txt -# -# Acausal bond graph to causal bond graph: mfile format - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.27 2002/05/10 09:08:55 gawthrop -## Added EMTF and INTF -## Fixed bug in writing out component headings -## -## Revision 1.26 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.25 2001/10/15 14:27:00 gawthrop -## Now handles [1:N] style port labels -## -## Revision 1.24 2001/08/02 03:24:48 geraint -## Replaced mtt_version.sh with mtt_banner.sh - I think this was the intent. -## -## Revision 1.23 2001/07/26 04:08:35 gawthrop -## Removed lines deleting _type.sh and cbg.m -## -- how did they get there ?? -## -## Revision 1.22 2001/07/08 03:28:11 gawthrop -## Fixed a bug: abg2sympar_m2txt neads a _lbl.txt file when using -## "usinglabel" option -## -## Revision 1.21 2001/07/06 00:46:50 gawthrop -## Added -cr option -- forces cr to be loaded before the ese.r file -## This avoids causality problems when using multi-port Rs to represent -## arbitary equations -## -## Revision 1.20 2001/07/04 05:19:57 gawthrop -## Added RT & CT to list -## -## Revision 1.19 2001/07/03 23:51:10 gawthrop -## Now puts outline #Summary and #Description lines at top of lbl file -## -## Revision 1.18 2001/06/13 18:24:10 gawthrop -## Made "lin" default in place of "none" -## Still needs arg and cr alias clashes to be sorted .... -## -## Revision 1.17 2001/06/13 10:41:06 gawthrop -## Further changes towards aouto creation of lbl files. -## Prettified lbl files -## -## Revision 1.16 2001/06/11 19:43:49 gawthrop -## MTT is now much more sophisticated in generating lbl files -## Labels can contain maths -## Repetative components are now broken -## -## Revision 1.15 2001/06/11 16:53:49 gawthrop -## Now uses abg2sympar_m2txt to get the arguments -## -## Revision 1.14 2001/06/11 15:06:58 gawthrop -## Now handles user-defined components -## -## Revision 1.13 2001/06/04 08:13:37 gawthrop -## Various changes to support PPP -## -## Revision 1.12 2001/05/08 15:18:10 gawthrop -## Added trig and hyperbolic functions to argument exclusion list -## -## Revision 1.11 2000/09/19 11:14:30 peterg -## Now writes the first component type header correctely -## -## Revision 1.10 2000/01/26 10:11:10 peterg -## Added I component -## -## Revision 1.9 1999/11/10 00:47:08 peterg -## Replaced ifs by a table of cr/arg information -## -## Revision 1.8 1999/11/09 22:32:41 peterg -## Under RCS ready for using arrays to contaain defaults. -## -## Revision 1.7 1998/07/04 10:37:21 peterg -## Major revision to include: -## aliases -## new Style -## prettyfied -## -## Revision 1.6 1998/03/05 10:09:47 peterg -## Corrected bug in writing "other" components -## -## Revision 1.5 1998/03/02 09:26:18 peterg -## Now does default CR and args for the basic components only -## SS,I,R,C,GY,TF -## C now has a default of effort input. -## -## Revision 1.4 1998/02/23 16:20:33 peterg -## Summary line just contains the model name -## -## Revision 1.3 1997/05/09 14:21:35 peterg -## Default to flow,component_name -## -# Revision 1.2 1997/03/19 12:08:01 peterg -# No longer writes out non-unique names - now done in rbg_fig2m -# -# Revision 1.1 1997/03/18 13:55:01 peterg -# Initial revision -# -############################################################### - - -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997 - -infofile='mtt_info.txt' -typefile="$1_type.sh" -sensitivity=$2; -system=$1 -outfile=$1_lbl.txt - -if [ -n "$sensitivity" ]; then - sys="-s ${system}" -else - sys=${system} -fi - -# Remove unwanted files -rm -f abg2lbl_fig2txt.log -rm -f $infofile -rm -f mtt_junk* - -## Create lbl files beneath this one -mtt -q -u -l 1 ${sys} sub sh # Create the list -sh $1_sub.sh "abg2lbl_fig2txt " " $sensitivity" - -if [ -f "$1_lbl.txt" ]; then - ##echo "$1_lbl.txt exists in `pwd` - no action taken" - exit -##else - ##echo "$1_lbl.txt dosn not exist in `pwd` " -fi - -#Inform user -if [ -n "$sensitivity" ]; then - echo "Creating ${outfile} (sensitivity version)" -else - echo "Creating ${outfile}" -fi - -write_header() - -{ -cat< $1_unique_raw_list - - -#Write out non-unique names -#echo 'Non-unique names (if any):' -#diff $1_unique_raw_list $1_raw_list | grep '>' | sed 's/>/ /' - -#Write out the outline lbl file -grep -v '\[[0-9]*\]' $1_unique_raw_list | \ -gawk --field-separator ':' ' - BEGIN { - OldComponent="None"; - default_cr = "lin"; - } - { - Component = $1; - Name = $2; - Arg = $3; - -##Aliases - if (Component == "SS") { - port_alias[++j] = Name; - } - else { - alias[++i] = Name; - if (length(sensitivity)>0) { - s_arg = sprintf("%ss",Name); - alias[++i] = s_arg; - s_arg = sprintf(";%s",s_arg); - Component_type = Component; - Component = substr(Component,2); - lin = "slin" - } - else { - Component_type = Component; - lin = "lin"; - } - - } - - ## Table of components - cr["SS"] = "SS"; arg["SS"] = "external,external"; - - cr["Se"] = "SS"; arg["Se"] = sprintf("external%s", s_arg); - cr["Sf"] = "SS"; arg["Sf"] = sprintf("external%s", s_arg); - - cr["De"] = "SS"; arg["De"] = "external"; - cr["Df"] = "SS"; arg["Df"] = "external"; - - cr["R"] = lin; arg["R"] = sprintf("flow,%s%s", Name, s_arg); - cr["C"] = lin; arg["C"] = sprintf("effort,%s%s", Name, s_arg); - cr["I"] = lin; arg["I"] = sprintf("flow,%s%s", Name, s_arg); - - cr["INTF"] = lin; arg["INTF"] = ""; - - cr["CS"] = "lin"; arg["CS"] = sprintf("effort,%s;%s_x0%s", Name, Name, s_arg); - cr["IS"] = "lin"; arg["IS"] = sprintf("flow,%s;%s_x0%s", Name, Name, s_arg); - cr["INTFS"] = "lin"; arg["INTFS"] = sprintf("%s_x0%s", Name, s_arg); - - cr["TF"] = "lin"; arg["TF"] = sprintf("flow,%s%s", Name, s_arg); - cr["GY"] = "lin"; arg["GY"] = sprintf("flow,%s%s", Name, s_arg); - - ##cr["EMTF"] = sprintf("%s", Name); arg["EMTF"] = sprintf("l%s", s_arg); - cr["EMTF"] = "lin"; arg["EMTF"] = sprintf("flow,%s%s", Name, s_arg); - - cr["AE"] = "lin"; arg["AE"] = sprintf("%s%s", Name, s_arg); - cr["AF"] = "lin"; arg["AF"] = sprintf("%s%s", Name, s_arg); - cr["AEf"] = "lin"; arg["AEf"] = sprintf("%s%s", Name, s_arg); - cr["AFe"] = "lin"; arg["AFe"] = sprintf("%s%s", Name, s_arg); - - cr["CDx"] = "lin"; arg["CDx"] = sprintf("%s%s", Name, s_arg); - - - cr["FMR"] = lin; arg["FMR"] = sprintf("effort,%s%s", Name, s_arg); - - cr["RS"] = lin; arg["RS"] = sprintf("flow,%s%s", Name, s_arg); - cr["RT"] = lin; arg["RT"] = sprintf("flow,%s%s", Name, s_arg); - cr["CT"] = lin; arg["CT"] = sprintf("effort,%s%s", Name, s_arg); - - ## Put in the explicit arguments - if (length(Arg)>0) { - arg[Component] = Arg; - if (match(Arg,"=")>0) # Its an equation type cr - cr[Component] = "cr" - else # assume a linear cr - cr[Component] = "lin"; - } - - ## Print component header - if (Component != OldComponent) print "\n## Component type", Component_type - - ## Print Component - printf("\t%s\t", Name); - if (Component in cr) - printf("%s\t\t", cr[Component]) - else - printf("%s\t\t", default_cr); - - if (Component in arg) - printf("%s\t\t\n", arg[Component]) - else { - print "lbl2args_txt2out", Component_type | "/bin/sh"; close("/bin/sh") - } - - OldComponent=Component; - delete arg[Component]; # Zap the element - delete cr[Component]; # Zap the element - } - END{ - print "\n## Port aliases" >> "mtt_junk_alias.txt"; - for (k=1;k<=j;k++){ - if (port_alias[k] ~ "\\["){ # Only do ports - port_name = substr(port_alias[k],2,length(port_alias[k])-2); - if (length(sensitivity)==0) - print "#ALIAS\t" port_name "\t" port_name >> "mtt_junk_alias.txt"; - else - print "#ALIAS\t" port_name "\t" port_name "_1," port_name "_2" >> "mtt_junk_alias.txt"; - } - } - -# print "\n% Argument aliases" >> "mtt_junk_alias.txt"; -# for (k=1;k<=i;k++){ -# print "%ALIAS\t\$" k "\t" alias[k] >> "mtt_junk_alias.txt"; -# } - }' sensitivity=$sensitivity -} - -create_arg_aliases() -{ -cat < $1_lbl.txt -create_arg_aliases > mtt_args.txt # using $1_lbl.txt -mv $1_lbl.txt mtt_junk_lbl.txt - -write_header > ${outfile} -cat mtt_junk_alias.txt >> ${outfile} -cat mtt_args.txt >> ${outfile} -write_blurb >> ${outfile} -cat mtt_junk_lbl.txt >> ${outfile} -## Put a blank line at end -cat >> ${outfile} <$sfilename - - - DELETED mttroot/mtt/bin/trans/abg2sub_fig2sh Index: mttroot/mtt/bin/trans/abg2sub_fig2sh ================================================================== --- mttroot/mtt/bin/trans/abg2sub_fig2sh +++ mttroot/mtt/bin/trans/abg2sub_fig2sh @@ -1,110 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: abg2sub_m2sh - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.4 2002/04/22 10:25:47 gawthrop - ## Handles unnamed components & ingnores artwork - ## - ## Revision 1.3 2001/10/15 14:27:34 gawthrop - ## Now handles [1:N] style port labels - ## - ## Revision 1.2 2001/07/23 23:26:23 gawthrop - ## Removed some boring user feedback - ## - ## Revision 1.1 2001/06/11 19:47:49 gawthrop - ## Makes the sub.sh file directly from the abg.fig file - ## Used for making lbl files (abg2lbl_fig2txt) - ## - ## - ############################################################### - -# Copyright (C) 1996--2002 by Peter J. Gawthrop - - - -get_valid_components() - -{ -gawk ' -function modulo10(x) { - return x-int(x/10)*10 - } -BEGIN{ - polyline = 2; - text = 4; - compound_object = 6; - -} -{ -object = $1; -zero_depth = (modulo10($4)==0)&&(object==text); -if (zero_depth) print $0 - -}' < $1_abg.fig - -} -#if [ -f "$1_sub.sh" ]; then -# echo Using "$1_sub.sh" -# exit -#else - #Inform user - echo Creating $1_sub.sh -#fi - -echo '# Commands to generate subsystem representations'> $1_sub.sh -echo "# File $1_sub.sh" >> $1_sub.sh -echo "# Generated by MTT on `date`." >> $1_sub.sh -echo >> $1_sub.sh - -# Get a list of all components from the _abg file -get_valid_components $1 |\ -grep -v '\[[0-9]*:[0-9]*\]' |\ -grep -v '\[.*\]' |\ -gawk '{if ($1==4) split($14,a,":"); print a[1]}' |\ -sed 's/\\001//' |\ -sort -u > mtt_tmp1 - -# Remove all components starting with 0 or 1 -grep -v '^[01]' < mtt_tmp1 > mtt_tmp4 - -# Get a list of all standard simple components -ls $MTT_LIB/comp/simple |\ - gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2 - -# Get a list of all standard compound components -#ls $MTTPATH/comp/compound |\ -# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2 - -# Sorted combined list -cat mtt_tmp2 | \ - sed 's/^zero$/0/' |\ - sed 's/^one$/1/' |\ - sort -u >mtt_tmp3 - -# Print the non-standard components -comm mtt_tmp4 mtt_tmp3 |\ - gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \ - >>$1_sub.sh - -# Clean up mtt_tmp files -#rm -f mtt_tmp? - - - - - - - - DELETED mttroot/mtt/bin/trans/abg2sub_m2sh Index: mttroot/mtt/bin/trans/abg2sub_m2sh ================================================================== --- mttroot/mtt/bin/trans/abg2sub_m2sh +++ mttroot/mtt/bin/trans/abg2sub_m2sh @@ -1,78 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: abg2sub_m2sh - -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2000/10/03 11:34:53 peterg -## Correct $MTT_LIB -## -## Revision 1.2 2000/03/17 09:53:10 peterg -## Removed irritating echo Using "$1_sub.sh" -## -## Revision 1.1 2000/03/15 21:23:20 peterg -## Initial revision -## -############################################################### - - -if [ -f "$1_sub.sh" ]; then - #echo Using "$1_sub.sh" - exit -else - #Inform user - echo Creating $1_sub.sh -fi - - -echo '# Commands to generate subsystem representations'> $1_sub.sh -echo "# File $1_sub.sh" >> $1_sub.sh -echo "# Generated by MTT on `date`." >> $1_sub.sh -echo >> $1_sub.sh - -# Get a list of all components for the _abg file -gawk '/type = / {print substr($3,2,length($3)-3)}' $1_abg.m |\ -sort -u > mtt_tmp1 - -# Remove all components starting with 0 or 1 -grep -v '^[01]' < mtt_tmp1 > mtt_tmp4 - -# Get a list of all standard simple components -echo ls $MTT_LIB/comp/simple -ls $MTT_LIB/comp/simple |\ - gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2 - -# Get a list of all standard compound components -#ls $MTTPATH/comp/compound |\ -# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2 - -# Sorted combined list -cat mtt_tmp2 | \ - sed 's/^zero$/0/' |\ - sed 's/^one$/1/' |\ - sort -u >mtt_tmp3 - -# Print the non-standard components -comm mtt_tmp4 mtt_tmp3 |\ - gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \ - >>$1_sub.sh - -# Clean up mtt_tmp files -#rm -f mtt_tmp? - - - - - - - - DELETED mttroot/mtt/bin/trans/abg2sympar_m2txt Index: mttroot/mtt/bin/trans/abg2sympar_m2txt ================================================================== --- mttroot/mtt/bin/trans/abg2sympar_m2txt +++ mttroot/mtt/bin/trans/abg2sympar_m2txt @@ -1,86 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: abg2sympar_m2txt - -# Label file to symbolic parameters conversion -# Copyright (C) 2000 by Peter J. Gawthrop - -# Inform user -##echo "Creating $1_sympar.txt" with $1 $2 $3 - -# Separation characters -SEPS='^=*;+/()-' -# Replace by , -REPS='[,*]' - -SystemName=$2 -UseLabelFile=$3 - -if [ -n "$UseLabelFile" ]; then ## Take input from lbl.txt - strip_comments < $1_lbl.txt | tr $SEPS $REPS |\ - gawk '{printf("%s %s \"%s\",\n",$1,$2,$3)}' > mtt_stripped_file -else ## Take input from _abg.m - cat $1_abg.m | grep "arg =" | tr $SEPS $REPS > mtt_stripped_file -fi - -rm -f mtt_error -# This is the main transformation using gawk -cat mtt_stripped_file | \ -gawk ' -function exact_match(name1, name2) { - return ((match(name1,name2)>0)&&(length(name1)==length(name2))) -} - -function matches(names, name) { - n_matches = split(names,match_name); - matched = 0; - for (i_matches = 1; i_matches <= n_matches; i_matches++) { - if ( exact_match(name,match_name[i_matches]) ) { - matched = 1; - break; - } - } - return matched; -} - -BEGIN { - var = "[%|#][PAR|VAR]"; - not_an_arg = "effort flow state internal external zero unknown\ - mtt_e mtt_f\ - sqrt exp log sign sin asin cos acos tan atan \ - sin asin cos acos tan atan \ - sinh asinh cosh acosh tanh atanh \ - none abs"; - arg_line = "arg = "; -} -{ - ## Explicit VAR declarations - if (match($1,var)>0) print $2 "\t" system_name; - - ## Implicit declarations from the arg list -## if (match($1,"arg")>0) { - args= substr($3,2,length($3)-3); - if (length(args)>0) - printf("%s\t%s\n", args,system_name) -## } -}' system_name=$SystemName |\ -grep -v '^\$' | mtt_strip_args | sort -u > mtt_stripped_args - - -## Now get the explicit declarations -if [ -n "$UseLabelFile" ]; then ## Take input from lbl.txt - ext=_lbl.txt -else - ext=_abg.m -fi - -strip_pars.sh $1${ext} $1 | sort -u > mtt_explicit_args - -## And write sorted list -cat mtt_explicit_args mtt_stripped_args - - DELETED mttroot/mtt/bin/trans/abg2tex Index: mttroot/mtt/bin/trans/abg2tex ================================================================== --- mttroot/mtt/bin/trans/abg2tex +++ mttroot/mtt/bin/trans/abg2tex @@ -1,178 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: abg2tex -# Creates a tex file describing the system abg -# P.J.Gawthrop May 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 2004/08/26 16:11:48 geraint -## Fixed ignore() and pipe so that subsystems are included in reports again. -## -## Revision 1.6 2004/02/11 10:10:04 gawthrop -## Includes a _pic.fig file (schematic) if such exists -## -## Revision 1.5 2004/02/10 16:12:21 gawthrop -## Don't give details of Se De Sf Df INTF -## -## Revision 1.4 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.3 2001/07/12 04:02:53 gawthrop -## Now fixes multiports for input and output as well as state -## -## Revision 1.2 2000/11/27 17:45:00 peterg -## Removed "System" from heading -## -## Revision 1.1 2000/11/27 15:11:15 peterg -## Initial revision -## -## Revision 1.7 1997/12/06 16:20:37 peterg -## Added another argument - the label -## -## Revision 1.6 1997/12/06 15:49:35 peterg -## Changed order of fig arguments to put filename first. -## -## Revision 1.5 1997/08/15 11:32:05 peterg -## Removed an echo left in by mistake -## -# Revision 1.4 1997/08/15 11:19:25 peterg -# Minto cosmetics. -# -## Revision 1.3 1997/05/21 12:07:22 peterg -## Replaced echo by cat -- much simpler. -## -## Revision 1.2 1997/05/19 16:25:53 peterg -## Explicit include of tex files .. latex2html seems to prefer this! -## -# Revision 1.1 1997/05/19 11:30:00 peterg -# Initial revision -# -############################################################### - -## Subsystems that don't need documentation -ignore(){ - gawk ' -BEGIN{ -ignored = " Se De Sf Df INTF "; -} -{ - subsys = sprintf(" %s ", $1); - if (match(ignored,subsys)==0) - print $1 - }' -} - -#Look for a command line argument -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -pdf ) pdf='-pdf' - ;; - -s ) sensitivity='-s' - ;; - - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - - -if [ -z "$2" ]; then - filename="$1_abg.tex"; - echo > $filename - echo Creating $filename - subsection='section' -else - filename=$2 - subsection='subsection' -fi - - -#Section heading (if not at top level) -if [ -n "$2" ]; then -cat<> $filename - -%% Subsystem $1 - \subsection{\textbf{$1}} - \label{sec:$1} - \index{\textbf{$1} -- abg} - -EOF -else -mtt -q -u ${sensitivity} $1 abg m # Make sure all the subsystems exist -- nasty kludge -cat< $filename - % abg report for system $1 ($filename) - % Generated by MTT at `date` -EOF -fi - -# Figure -##echo mtt -q -u $pdf $1 abg ps -mtt -q -u $pdf $1 abg ps -cat <> $filename - -%% \fig{`pwd`/$1_labg}{$1_abg}{0.9}{System \textbf{$1}: acausal bond graph} - \tfig{`pwd`/$1_labg}{$1_abg}{0.9}{System \textbf{$1}: acausal bond graph} - -EOF - -## Put a schematic if exists (_pic.fig) -if [ -e "$1_pic.fig" ]; then - echo Inserting $1_pic.fig - fig2dev -L eps $1_pic.fig > $1_pic.ps -cat <> $filename - - \fig{`pwd`/$1_pic}{$1_pic.ps}{0.9}{System \textbf{$1}: schematic diagram} - -EOF -fi - -# Description -mtt -q -u $1 desc tex -# Put in absolute pathnames in figures -- and fix bug in old desc files -sed "s;fig{;fig{`pwd`/;g" < $1_desc.tex |\ -sed "s/Ref{$1_abg}/Ref{fig:$1_abg.ps}/" >> $filename - -# Label file -mtt -q -u $1 lbl tex -cat<> $filename - \sub$subsection{Summary information} - \label{sec:$1_lbl} - \index{\textbf{$1} -- lbl} -EOF -cat $1_lbl.tex >> $filename - - -# CRs -#mtt -q -u $1 cr tex -#cat<> $filename -# \sub$subsection{Constitutive relationships} -# \label{sec:$1_cr} -# \index{\textbf{$1} -- cr} -#EOF -#cat $1_cr.tex >> $filename - -# Subsystems -mtt -q -u $1 sub tex -cat<> $filename - \sub$subsection{Subsystems} - \label{sec:$1_sub} - \index{\textbf{$1} -- subsystems} -EOF -cat $1_sub.tex >> $filename - -#Now do the subsystems (if at top level) -if [ -z "$2" ]; then - sub2subs $1 | sort -u | ignore |\ - gawk '{print "abg2tex", pdf, $1, filename}' pdf=$pdf filename=$filename | sh -fi DELETED mttroot/mtt/bin/trans/abg_m2a4c Index: mttroot/mtt/bin/trans/abg_m2a4c ================================================================== --- mttroot/mtt/bin/trans/abg_m2a4c +++ mttroot/mtt/bin/trans/abg_m2a4c @@ -1,33 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: abg_m2a4c -# -# Acausal bond graph to ascend format - -infofile='mtt_info.txt' -errorfile='mtt_error.txt' - - -# Remove the old log file -rm -f abg_m2a4c_m.log -rm -f $1_abg.a4c - - - -#Inform user -echo "Creating $1_abg.a4c" - -# Use matrix manipulation to accomplish the transformation -octave -q << EOF >$1_abg.a4c - ABG = $1_abg; - name = "$1"; - abg_m2a4c(ABG,name); -EOF - -if [ "$info" = "info" ]; then - cat $infofile -fi DELETED mttroot/mtt/bin/trans/alias_txt2m Index: mttroot/mtt/bin/trans/alias_txt2m ================================================================== --- mttroot/mtt/bin/trans/alias_txt2m +++ mttroot/mtt/bin/trans/alias_txt2m @@ -1,50 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: alias_m -# Creates the component aliases in text form - -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/07/02 19:16:03 peterg -## Prettyfied output -## -## Revision 1.1 1998/07/02 09:21:55 peterg -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_alias.m - -#Create the alias file complete with headers. -echo "function alias = $1_alias" > $1_alias.m -echo "%% Alias file ($1_alias.m)" >> $1_alias.m -echo "%% Generated by MTT at `date`" >> $1_alias.m - -#Write out the variables -gawk '{ - if (NF==2) {i++; print "alias."$1 "\t = \""$2"\";"} - - } - END{ - if (i==0) print "alias = 0;" - }' $1_alias.txt >> $1_alias.m - - - - - - - - - DELETED mttroot/mtt/bin/trans/apply_crs Index: mttroot/mtt/bin/trans/apply_crs ================================================================== --- mttroot/mtt/bin/trans/apply_crs +++ mttroot/mtt/bin/trans/apply_crs @@ -1,16 +0,0 @@ -#! /bin/sh - -sys=$1 - -# check for the existence of CRs that we need -crs='' -for cr in `cat ${sys}_cr.txt`; do - if [ -f ${cr}.pm -o -f mtt/${cr}.pm ]; then - crs="$crs $cr" - fi -done - -# should be reading the output from ese_r2make -# on standard input -${MTT_LIB}/cr/perl/apply_cr.pl ${crs} - DELETED mttroot/mtt/bin/trans/awk/lbl2cr.awk Index: mttroot/mtt/bin/trans/awk/lbl2cr.awk ================================================================== --- mttroot/mtt/bin/trans/awk/lbl2cr.awk +++ mttroot/mtt/bin/trans/awk/lbl2cr.awk @@ -1,86 +0,0 @@ -###################################### -##### Model Transformation Tools ##### -###################################### - -# gawk script: lbl2cr.awk -# Label file to symbolic parameters conversion -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.9 1998/03/08 21:01:40 peterg -## Now does multiple crs -## -## Revision 1.8 1998/03/06 09:15:28 peterg -## Ignores SS fields (assumes that if first field is a symbol then other -## field is and SS-style field. -## -## Revision 1.7 1997/04/22 12:50:15 peterg -## New much simpler version -- does not check for multiple crs -- these -## are removed later anyway. -## -# Revision 1.6 1997/03/22 15:15:44 peterg -# Ignores symbolic ($i) crs. -# -# Revision 1.5 1997/03/20 12:05:31 peterg -# Now just writes out the cr name. -# -# Revision 1.4 1996/11/09 20:38:45 peterg -# Put in new lib pat -# -## Revision 1.3 1996/11/04 14:51:14 peterg -## Added none to no cr list -## -# Revision 1.2 1996/11/02 10:22:22 peterg -# Now ignores SS lines. -# -############################################################### - - -function exact_match(name1, name2) { - return ((match(name1,name2)>0)&&(length(name1)==length(name2))) - } - -function matches(names, name) { - n_matches = split(names,match_name); - matched = 0; - for (i_matches = 1; i_matches <= n_matches; i_matches++) { - if ( exact_match(name,match_name[i_matches]) ) { - matched = 1; - break; - } - } - return matched; - } - - -BEGIN { -comment = "%|#"; -cr_delimiter = ";"; -not_a_cr = "effort flow state internal external zero none"; -is_a_SS = "internal external zero"; -numeric = "[0-9]"; -symbolic = "\044"; # Ascii $ -symbol_count = 0; -symbols = ""; - -# Include lin cr anyway. -print "lin" -} -{ - if ( (match($1,comment)==0) && (NF>=3) ) { - crs = $2 - n_crs = split(crs,cr,cr_delimiter); - for (i = 1; i <= n_crs; i++) { - first_char = substr(cr[i],1,1); - if ( (matches(not_a_cr,cr[i])==0) && - (match(numeric,first_char)==0) && - (matches(is_a_SS,$3)==0)) - print cr[i]; - } - } -} DELETED mttroot/mtt/bin/trans/awk/lbl2sympar.awk Index: mttroot/mtt/bin/trans/awk/lbl2sympar.awk ================================================================== --- mttroot/mtt/bin/trans/awk/lbl2sympar.awk +++ mttroot/mtt/bin/trans/awk/lbl2sympar.awk @@ -1,107 +0,0 @@ -###################################### -##### Model Transformation Tools ##### -###################################### - -# gawk script: lbl2sympar.awk -# Label file to symbolic parameters conversion -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.13 1998/07/15 09:26:50 peterg -## Reinstated the second column of the sympar file - the system name -## -## Revision 1.12 1998/07/04 11:09:46 peterg -## Cleaned up - assumes new lbl style for SS -## -## Revision 1.11 1998/05/13 12:39:23 peterg -## Added `unknown' to list od names to avoid -## -## Revision 1.10 1998/03/26 13:03:23 peterg -## Changed SS field fudge. -## -## Revision 1.9 1998/02/16 16:09:57 peterg -## And taken it out again! -## -## Revision 1.8 1998/02/16 12:08:38 peterg -## Put back the matrix declaration -## -# Revision 1.7 1997/03/18 17:25:24 peterg -# Now just generates names - formatting removed. -# -# Revision 1.6 1996/12/07 20:02:43 peterg -# Fixed symbolic parameter bug. -# -## Revision 1.5 1996/12/07 18:06:50 peterg -## Now detects symbolic args ($1 etc) and ignores them. -## -# Revision 1.4 1996/08/30 18:45:32 peter -# Removed header stuff. -# -## Revision 1.3 1996/08/30 10:30:54 peter -## Switched order of args in matches. -## -## Revision 1.2 1996/08/30 09:35:10 peter -## Fixed problem with global variable in function. -## -## Revision 1.1 1996/08/24 13:34:48 peter -## Initial revision -## -############################################################### - - - -function exact_match(name1, name2) { - return ((match(name1,name2)>0)&&(length(name1)==length(name2))) -} - -function matches(names, name) { - n_matches = split(names,match_name); - matched = 0; - for (i_matches = 1; i_matches <= n_matches; i_matches++) { - if ( exact_match(name,match_name[i_matches]) ) { - matched = 1; - break; - } - } - return matched; -} - - -BEGIN { -sys_name = ARGV[1]; -comment = "%|#"; -var = "[%|#]VAR"; -arg_delimiter = ","; -not_an_arg = "effort flow state internal external zero unknown 0 1"; -SS_parameter = "internal external zero 0 1"; -numeric = "[0-9-]"; -symbol_count = 0; -symbols = ""; -} -{ - if (match($1,var)>0) print $2 "\t" name; - - if ( (match($1,comment)==0) && (NF>=3) ) { - n_args = split($3,arg,arg_delimiter); - for (i = 1; i <= n_args; i++) { - first_char = substr(arg[i],1,1); - if ( (matches(not_an_arg,arg[i])==0) \ - && (match(first_char,numeric)==0) \ - && (match(arg[i],"\\$")==0) \ - && (length(arg[i])>0) \ - && (matches(symbols,arg[i]) ==0) ) { - print arg[i] "\t" name; - } - } - } -} - - - - - DELETED mttroot/mtt/bin/trans/awk/rbg_fig2m.awk Index: mttroot/mtt/bin/trans/awk/rbg_fig2m.awk ================================================================== --- mttroot/mtt/bin/trans/awk/rbg_fig2m.awk +++ mttroot/mtt/bin/trans/awk/rbg_fig2m.awk @@ -1,854 +0,0 @@ -###################################### -##### Model Transformation Tools ##### -###################################### - -# gawk script: rbg_fig2m.awk -# Raw bond-graph conversion from fig to matlab -# P.J.Gawthrop June 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.46 2004/08/04 19:46:42 geraint -## Sorts components alphabetically (type:name) within the categories: -## internal ports, components, 0 junctions and 1 junctions. -## -## Standardising the order in which components are listed allows models -## built with different editors to interact correctly by separating the -## graphical information from the data which is required to build models. -## -## Revision 1.45 2004/04/07 12:17:43 gawthrop -## Handles new Fig header line. -## -## Revision 1.44 2002/05/25 09:23:47 gawthrop -## Self-naming components: name is mttTYPE or mttTYPE_2 ... -## -## Revision 1.43 2002/05/22 10:33:18 gawthrop -## Nameless components are now named according to type - replaces old -## mtt1 etc style. -## -## Revision 1.42 2002/03/26 12:05:27 geraint -## Escaped characters to eliminate awk warnings. -## -## Revision 1.41 2001/06/13 10:41:06 gawthrop -## Further changes towards aouto creation of lbl files. -## Prettified lbl files -## -## Revision 1.40 2001/06/11 19:43:50 gawthrop -## MTT is now much more sophisticated in generating lbl files -## Labels can contain maths -## Repetative components are now broken -## -## Revision 1.39 2001/05/09 08:50:02 gawthrop -## Uses _art.fig to transmit the art work to the cbg.fig rep. -## -## Revision 1.38 2001/03/23 14:57:31 gawthrop -## Now puts space after header fields + writes _port.fig -## -## Revision 1.37 2000/09/14 08:43:32 peterg -## Add additional directional informatiuon to rbonds: -## cols 7-8 Arrow end directional bond -## cols 9-10 Arrow end directional bond -## -## Revision 1.36 1999/11/19 04:00:26 peterg -## Changed a comment to be more accurate. -## -## Revision 1.35 1999/07/25 22:19:45 peterg -## Fixed bug with false objects when compound objects present. -## -- Reset object to 0 after processing text. -## -## Revision 1.34 1999/02/17 06:23:49 peterg -## Bugs arising from Fig 3.2 fixed -## -## -- depth now zero modulo 10 (3.2 defaults to depth 100!!) -## -- horrible bug using = in place of == fixed. -## -## Revision 1.33 1998/08/10 15:51:06 peterg -## Comments may now be prefaced by # as well as % -## -## Revision 1.32 1998/07/27 20:30:03 peterg -## *** empty log message *** -## -## Revision 1.31 1998/04/16 13:18:13 peterg -## Now ignores spurious ports (in lbl but not Figure \ref{) but gives -## warning -## -## Revision 1.30 1998/04/12 15:01:17 peterg -## Converted to uniform port notation - always use [] -## -## Revision 1.29 1998/04/12 12:35:32 peterg -## Named and unnamed SS handled in a uniform manner - in particular, the -## attributes are passed through -## wrote_component function used. -## -## Revision 1.28 1998/04/06 08:41:48 peterg -## Fixed bug due to adding (and then removing) 0 and 1 as port types -## -## Revision 1.27 1998/04/04 10:54:58 peterg -## Remove a debugging print statement -## -## Revision 1.26 1998/04/04 07:29:26 peterg -## SS now only port component -## -## Revision 1.25 1998/04/03 15:07:20 peterg -## Now correctly write 0/1 port names -## -## Revision 1.24 1998/04/03 14:02:50 peterg -## Added 0 and 1 to list of possible ports -## -## Revision 1.23 1998/02/01 18:37:41 peterg -## Don't print irritating warnings about ports listed in lbl files. -## -# Revision 1.22 1997/08/09 14:42:39 peterg -# Added underscore to port regexp -# -## Revision 1.21 1997/08/04 12:49:17 peterg -## Modified to use named (as opposed to numbered) ports. -## Generates a list of component ports in the .rbg file. -## As octave handles string vectors properly, the .cmp file format is not -## really necessary - but I've let it be for the moment. -## -## Revision 1.20 1997/03/19 12:02:01 peterg -## Now writes an error message if a lable is used twice in the fig file. -## -# Revision 1.19 1997/03/19 09:49:39 peterg -# Ports now written in cmp file. -# -# Revision 1.18 1997/03/19 09:42:08 peterg -# Now writes out the following additional fig files: -# _head.fig The fig header -# _bnd.fig The bonds actually used -# _cmp.fig The components actually used. -# -# Revision 1.17 1997/01/02 11:21:17 peterg -# Now assumes all components bonds etc at depth zero in fig file. -# Ie anything at depth>0 is ignored. -# Thanks to Donald for suggesting this. -# -## Revision 1.16 1996/12/30 20:00:29 peterg -## Fixed bent-bond bug. -## NB unfixed problems: -## 1. xfig writes multi line fields if more than about 5 segments. -## 2. rbg2abg takes a multi-segment bond as a straignt line between the -## end points - so computation of stroke and arrow directions may be -## iffy. -## -## Revision 1.15 1996/12/30 19:23:35 peterg -## Allows for bent bonds - ie bonds with more than 2 line segments. -## -## Revision 1.14 1996/12/21 19:47:53 peterg -## Changed \* to \\* -## -## Revision 1.13 1996/12/21 19:47:23 peterg -## Put back under VC -## -# Revision 1.12 1996/08/24 16:30:12 peter -# Fixed error in nonport_regexp. -# -## Revision 1.11 1996/08/19 10:48:57 peter -## Added `-' to the component regexp. -## -## Revision 1.10 1996/08/19 09:03:13 peter -## Parses repetative components: ie suffixed by *n. -## -## Revision 1.9 1996/08/09 08:23:11 peter -## Fixed bug: ports not recognised. -## -## Revision 1.8 1996/08/05 20:12:43 peter -## Now writes a _fig.fig file. -## -## Revision 1.7 1996/08/05 18:44:56 peter -## Now writes out a _cbg file without ----- symbol. -## -## Revision 1.6 1996/08/05 12:17:37 peter -## n_ports now appear in the _abg file instead. -## -## Revision 1.5 1996/08/05 12:01:28 peter -## The _cmp function now returns the number of ports. -## -## Revision 1.4 1996/08/05 10:14:46 peter -## Made ports appear, in order, at top of component lists -## -## Revision 1.3 1996/08/04 20:32:28 peter -## Stopped complaint about missing lbl entry for port components -## -## Revision 1.2 1996/08/04 20:05:25 peter -## Included port components - eg SS:[1] -## -## Revision 1.1 1996/08/04 20:01:58 peter -## Initial revision -## -############################################################### - - -############################################################## -# This (g)awk script reads a fig file in fig 3.1 format. -# It interprets the picture as: bonds, arrows and components -# as follows: -# -# Bonds are firm (not dashed etc) polylines with n line segments - -# fig represents this by a firstline record where -# field 1 = 2 (always 2) -# field 2 = 1 (polyline) -# field 3 = 0 (style is a firm line) -# field 7 = 0 (depth is zero [top level]) -# field 14 = 0 (no forward arrow) -# field 15 = 0 (backward arrow) -# field 16 = Number of point in line (points=segments+1) -# a data field starting with a tab followed by points (x,y) cordinates -# -# -# Strokes are polylines with 1 line segment and and no arrow -# fig represents this by a firstline record where -# field 1 = 2 (always 2) -# field 2 = 1 (polyline) -# field 3 = 0 (style is a firm line) -# field 14 = 0 (no forward arrow) -# field 15 = 0 (backward arrow) -# field 16 = Number of point in line =2 -# a data field starting with a tab followed by 2 (x,y) cordinates -# -# Arrows are polylines with 1 line segment and an arrow -# fig represents this by a firstline record where -# field 1 = 2 (always 2) -# field 2 = 1 (polyline) -# field 3 = 0 (style is a firm line) -# field 14 = 1 for a forward arrow -# field 15 = 1 for a backward arrow -# an additional data files -# a data field starting with a tab followed by 2(x,y) cordinates -# -# Components appear in two files -- the fig file and the lbl file -# these two files are concatenated with the lbl file first -# The lbl file represents components by 3 fields -# field 1 is the name -# field 2 is the CR name -# field 3 is the CR arguments -# The fig file represents components by 14 fields -# field 1 = 4 -# fields 12 and 13 are the coordinates -# field 14 is the type:name string terminated by \001 -# To prevent text being confused with components, components consist -# of alphanumeric characters and : and _ only. -# -# Components are sorted alphabetically ("type:name") -# within the following categories: -# 1) internal ports (SS:[...]) -# 2) basic components, subsystems and external ports -# 3) 0 junctions -# 4) 1 junctions -############################################################## - -function modulo10(x) { - return x-int(x/10)*10 - } - -function exact_match(name1, name2) { - return ((match(name1,name2)>0)&&(length(name1)==length(name2))) - } - -function write_component(i) { - name = label[i,1]; - cr = label[i,2]; - arg = label[i,3]; - if (length(x[name])==0) { - # print error - its in lbl but not fig file - printf(warning_l, name); - } - else { - component_index++; - print x[name], y[name], info[name] >> b_file; - printf("if i==%1.0f\n", component_index) >> c_file; - printf("\tcomp_type = %s%s%s;\n", q, comp_type[name], q) >> c_file; - printf("\tname = %s%s%s;\n", q, name, q) >> c_file; - printf("\tcr = %s%s%s;\n", q, cr, q) >> c_file; - printf("\targ = %s%s%s;\n", q, arg, q) >> c_file; - printf("\trepetitions = %s;\n", reps[name]) >> c_file; - print "end" >> c_file - } - } - -function process_lbl() { -# This puts the components in the lable file at the top of the list -# and saves up the corresponding CR and arguments -# note that there may be more than one component per label - if ((match($1,comment_regexp)==0)&&(NF>0)) - { - i_label++; - name = $1; - CR = $2; - args = $3; - - label[i_label,1] = name; - label[i_label,2] = CR; - label[i_label,3] = args; - } -} - -function sort_cmp() { -# Sorts components alphabetically by type then name - for (i = 1; i <= i_label; i++) { - name = label[i,1]; - type = comp_type[name]; - cmp_list[i] = sprintf ("'%s:%s'", type, name); - } - - if (no_alpha_sort=="no_alpha_sort") - print "Not sorting components alphabetically" - else { - print "Sorting components alphabetically"; - asort (cmp_list) - }; - - for (i = 1; i <= i_label; i++) { - for (j = 1; j <= i_label; j++) { - name = label[j,1]; - type = comp_type[name]; - typename = sprintf ("'%s:%s'", type, name); - if (typename == cmp_list[i]) { - sort_cmp_list[i] = j; - } - } - } -} - -function fig_info() { -# Grabs the fig-file information for a component - return(sprintf("%s %s %s %s %s %s %s %s %s %s %s ", \ - $1, $2, $3, $4, $5, $6, $7, \ - $8, $9, $10, $11)) - } - -function type_name(type) { -# if (type==1) -# return "one" -# else { -# if (type==0) -# return "zero" -# else -# return type -# } - return sprintf("mtt%s", type); -} - -function process_text() { -# The text string is field 14 onwards - str = $14; - for (i=15; i<=NF; i++) { - str = sprintf("%s %s", str, $i) - } - -# The depth is field 4 (for strings) - depth = modulo10($4); - -# It is terminated by \001 - so delete this termination - str = substr(str,1,length(str)-4); - -# Zap maths - ##gsub(/[()-+*/]/,"",str); - -# Lose the cr stuff (if present) - if (depth==0) { - N=split(str,a,delimiter); - if (N==3) - str=sprintf("%s%s%s", a[1],delimiter,a[2]); - } - -# A component string contains only alphanumeric _ and : - isa_plain_component = match(str, component_regexp)==0; -# It must also be specified at depth 0 (modulo 10) - isa_plain_component = isa_plain_component && (depth==0); - -# A port is a string within [] - isa_port = (match(str, port_regexp)>0) - -# It must also be specified at depth 0 - isa_port = isa_port && (depth==0); - -# Vector port definitions - isa_PORT = ((match(str, PORT_regexp)>0) && (depth==0)); - - if (isa_PORT) { - print str - } - -# A port component is an SS followed by a port string - isa_port_component = 0; - if (match(str, delimiter)) { - split(str,a,delimiter); - isa_port_component = (match(a[1], port_component_regexp))&& - (match(a[2], port_regexp)>0) - } - -# It must also be specified at depth 0 - isa_port_component = isa_port_component && (depth==0); - -# A component is a plain or a port component - isa_component = isa_plain_component||isa_port_component; - -# Coordinates in fields 12 & 13 - x_coord = $12; - y_coord = $13; - -# Do the ports - if (isa_port) { - i_port++; - port_name = str; - ports[i_port] = sprintf("%s %s %s", x_coord, y_coord, port_name); - } - -# Do the port components -# if (isa_port_component) { -# i_port_component++; -# type = a[1]; -# # Port name is the bit between the [] -# port_label = substr(a[2],2,length(a[2])-2); -# x_port[i_port_component] = x_coord; -# y_port[i_port_component] = y_coord; -# info_port[i_port_component] = fig_info(); -# port_labels[i_port_component] = port_label; -# } - -# Do the components - if (isa_component) { - i_text++; - -# Get repetitions (if any) - if (match(str,repetition_regexp) > 0) { - split(str,b,repetition_delimiter); - repetitions = b[2]; - str = b[1]; - } - else { - repetitions = "1"; - }; - - named_component = (match(str,delimiter) > 0); - if (named_component) { - split(str,a,delimiter); - type = a[1]; - name = a[2]; -# Check if name is in label file and if used already - found = 0; name_used = 0; - for (i=1; i<=i_label; i++) { - lname = label[i,1]; - if ( lname==name ) { - found = 1; - if (name in used) { - name_used = 1; - CR = label[i,2]; - args = label[i,3]; - } - else { - used[name] = 1 - } - break - } - } - -if (!found) { -printf(warning_f, name); -i_label++; -CR = default_cr; -args = ""; -label[i_label,1] = name; -label[i_label,2] = CR; -label[i_label,3] = args -} - -# Give it a new entry if already used -# -- also tell user as it is an error now(?) - if (name_used) { - printf(warning_u, name); - i_label++; - i_name++; - name = sprintf("%1.0f", i_name); - label[i_label,1] = name; - label[i_label,2] = CR; - label[i_label,3] = args - } - } - -# Unnamed component - if (named_component==0) { - type = str; - - if (type in name_index) - name_index[type]++ - else - name_index[type] = 1; - - if (name_index[type]==1) - name = sprintf("%s", type_name(type)) - else - name = sprintf("%s_%i", type_name(type), name_index[type]); - - i_label++; - label[i_label,1] = name; - label[i_label,2] = default_cr; - label[i_label,3] = default_args - } - -# Save in associative arrays by name - comp_type[name] = type; - x[name] = x_coord; - y[name] = y_coord; - info[name] = fig_info(); - reps[name] = repetitions; - } - -} - -#Euclidean length of a line between (first_x,first_y) and (second_x,second_y) -function line_length(first_x,first_y,second_x,second_y) { - x_length = second_x-first_x; - y_length = second_y-first_y; - return sqrt( x_length*x_length + y_length*y_length ); -} - -# Returns 1 if (bond) arrow at beginning of field or 2 if arrow at end of field -function arrow_end(first_x,first_y,second_x,second_y,penultimate_x,penultimate_y,last_x,last_y) { - if ( line_length(first_x,first_y,second_x,second_y) < line_length(first_x,first_y,second_x,second_y) ) { - return 1 - } - else { - return 2 - } -} - -function process_bond() { - - arg_count++; - if ( (arg_count-arrow)==1 ) - { - -#Save up bond coords - no arrow and more segments than a stroke has. -# Allows for bent bonds - but just write out the relevant coordinates - if ( (!arrow)&& (NF>2*stroke_coords+1) ) { - i_bond++; - a_end = arrow_end($2,$3,$4,$5,$(NF-3),$(NF-2),$(NF-1),$NF); - if (a_end==1) { - arrow_end_vector_x = $6-$4; - arrow_end_vector_y = $7-$5; - other_end_vector_x = $(NF-1)-$(NF-3); - other_end_vector_y = $(NF)-$(NF-2); - bonds[i_bond] = sprintf("%s %s %s %s %s %s %s %s %s %s", \ - $2, $3, $4, $5, $(NF-1), $(NF), - arrow_end_vector_x, - arrow_end_vector_y, - other_end_vector_x, - other_end_vector_y); - } - else { - other_end_vector_x = $4-$2; - other_end_vector_y = $5-$3; - arrow_end_vector_x = $(NF-3)-$(NF-5); - arrow_end_vector_y = $(NF-2)-$(NF-4); - bonds[i_bond] = sprintf("%s %s %s %s %s %s %s %s %s %s", \ - $2, $3, $(NF-3),$(NF-2),$(NF-1),$NF, - arrow_end_vector_x, - arrow_end_vector_y, - other_end_vector_x, - other_end_vector_y); - } - } - -#Save up arrow coords - if ( (arrow)&&(NF==(2*arrow_coords+1)) ) { - i_arrow++; - arrows[i_arrow] = sprintf("%s %s %s %s", $2, $3, $4, $5); - } - -#Save up stroke coords - if ( (!arrow)&&(NF==(2*stroke_coords+1)) ) { - i_stroke++; - strokes[i_stroke] = sprintf("%s %s %s %s", $2, $3, $4, $5); - } - } -} - -function write_fig() { -# Create _fig.fig file from _abg file - not components -# and write out the components in a _cmp.fig file -# and write out the bonds in a _bnd.fig file - -# The artwork -- not header and not zero depth - - if ((NF>2)&&(!zero_depth)) { - art=$0; - sub("----"," ",art) - printf("%s\n", art) >> art_file - } - - -#Everything except components - if ( ((object!=text)||(isa_component==0)) ) { - #Replace the data_symbol - if (exact_match($1,data_symbol)) { - field_1 = out_data_symbol - } - else { - field_1 = $1 - } - - printf("%s",field_1) >> fig_file - for (i=2; i<=NF; i++) - printf(" %s", $i) >> fig_file; - if (NF==1) - printf(" ") >> fig_file; # Put space after header fields - printf("\n") >> fig_file - } - -# Header - if ($1=="#FIG") - printf("%s", $0) >> head_file; - - if ( NF<3 ) { - printf("%s", $1) >> head_file; - for (i=2; i<=NF; i++) - printf(" %s", $i) >> head_file; - if (NF==1) - printf(" ") >> head_file; # Put space after header fields - printf("\n") >> head_file - } -# Bonds - if (isa_bond) { - - #Replace the data_symbol - if (exact_match($1,data_symbol)) { - field_1 = out_data_symbol - } - else { - field_1 = $1 - } - - printf field_1 >> bnd_file - for (i=2; i<=NF; i++) - printf(" %s", $i) >> bnd_file; - printf("\n") >> bnd_file - } - -# Components & ports - if ( isa_component||isa_port ) { - for (i=1; i<=NF; i++) - printf(" %s", $i) >> cmp_file; - printf("\n") >> cmp_file - } - -# Ports - if ( isa_port_component ||isa_port) { - for (i=1; i<=NF; i++) - printf(" %s", $i) >> port_file; - printf("\n") >> port_file -} -} - -function process_fig() { -# Test for the fig format first line and data line - data_line = (match($1,data_symbol)>0); - first_line = (data_line==0)&&(NF>min_line_length); - -#Process firstline - if (first_line) { - object = $1; - sub_type = $2; - style = $3; - zero_depth = ((modulo10($7)==0)&&(object==polyline)) || ((modulo10($4)==0)&&(object==text)) - f_arrow = ($14==1)&&(object=polyline); - b_arrow = ($15==1)&&(object=polyline); - arrow = f_arrow||b_arrow; - arg_count = 0; - } - -#Process text - if (object==text) { - process_text(); - object = 0; # Text on one line so reset object to zero- avoids compound problem - } - -# Process bond -isa_bond = (zero_depth &&\ - (object==polyline)&& \ - (sub_type==sub_polyline)&& \ - (style==firm_style) \ - ); - -if ( isa_bond && data_line) -{ - process_bond() - } - -if (isa_fig_file){ - write_fig() - } - - } - -BEGIN { - sys_name = ARGV[1]; - delete ARGV[1]; - - b_file = sprintf("%s_rbg.m", sys_name); - c_file = sprintf("%s_cmp.m", sys_name); - fig_file = sprintf("%s_fig.fig", sys_name); - cmp_file = sprintf("%s_cmp.fig", sys_name); - port_file = sprintf("%s_port.fig", sys_name); - bnd_file = sprintf("%s_bnd.fig", sys_name); - head_file = sprintf("%s_head.fig", sys_name); - art_file = sprintf("%s_art.fig", sys_name); - - warning_f = "WARNING %s \t in fig file but not lbl file - using\n"; - warning_l = "WARNING %s \t in lbl file but not fig file - ignoring\n"; - warning_p = "ERROR system ports are not consecutively numbered\n"; - warning_u = "ERROR %s has already appeared in the fig file\n"; - - comment_regexp = "%|#" - data_symbol = "----"; - out_data_symbol = "\t"; - default_cr = ""; - default_args = ""; - delimiter = ":"; - repetition_delimiter = "*"; - repetition_regexp = "\\*"; - q = "\047"; - terminator = "\\001"; - component_regexp = "[^0-9a-zA-Z_:*-]"; - port_regexp = "^[[a-zA-Z0-9_,]*]"; - nonport_regexp = "[a-zA-Z]"; - PORT_regexp = "^PORT .*="; - port_component_regexp = "SS"; - isa_fig_file = 0; - min_line_length = 10; - object = 0; - polyline = 2; - sub_polyline=1; - firm_style = 0; - text = 4; - compound_object = 6; - bond_coords = 3; - stroke_coords = 2; - arrow_coords = 2; - - i_bond = 0; - i_port = 0; - i_stroke = 0; - i_arrow = 0; - i_label = 0; - i_text = 0; - i_port_component = 0; - - component_index = 0; -} -{ -# Start of .fig file? - if ($1=="#FIG") { - isa_fig_file=1; - } - if (isa_fig_file==0) { - process_lbl() - } - else { - process_fig() - } -} - -END { -#Print out the Octave functions - printf("function [rbonds, rstrokes,rcomponents,port_coord,port_name,port_list] = %s_rbg\n", sys_name) > b_file; - printf("%% [rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = %s_rbg\n", sys_name) > b_file; - printf("%% Generated by MTT\n\n") > b_file; - - printf("function [comp_type, name, cr, arg, repetitions] = %s_cmp(i)\n",\ - sys_name) > c_file; - printf("%% [comp_type, name, cr, arg, repetitions] = %s_cmp\n", sys_name) > c_file; - printf("%% Generated by MTT\n\n") > c_file; - - printf("rbonds = [\n") >> b_file; - for (i = 1; i <= i_bond; i++) - print bonds[i] >> b_file; - for (i = 1; i <= i_arrow; i++) - print arrows[i], "-1 -1" >> b_file; - printf("];\n") >> b_file; - - printf("rstrokes = [\n") >> b_file; - for (i = 1; i <= i_stroke; i++) - print strokes[i] >> b_file; - printf("];\n") >> b_file; - - printf("rcomponents = [") >> b_file; - j = 0; - - sort_cmp(); # sort components alphabetically - -# Do the port components, in order of appearance, first. - for (i = 1; i <= i_label; i++) { - num = sort_cmp_list[i]; - name = label[num,1]; - if (match(name,port_regexp)) - write_component(num); - } - -# then do the ordinary components, in order of appearance. - for (i = 1; i <= i_label; i++) { - num = sort_cmp_list[i]; - name = label[num,1]; - if (!match(name,port_regexp)) - if ((!match(comp_type[name],"0"))&& - (!match(comp_type[name],"1"))) - write_component(num); - } - -# followed by the 0 junctions - for (i = 1; i <= i_label; i++) { - num = sort_cmp_list[i]; - name = label[num,1]; - if (!match(name,port_regexp)) - if (match(comp_type[name],"0")) - write_component(num); - } -# and finally the 1 junctions - for (i = 1; i <= i_label; i++) { - num = sort_cmp_list[i]; - name = label[num,1]; - if (!match(name,port_regexp)) - if (match(comp_type[name],"1")) - write_component(num); - } - printf("];\n") >> b_file; - -# Print the (internal) ports list - printf("port_coord = [\n") >> b_file; - for (i = 1; i <= i_port; i++) { - split(ports[i],a, " "); - printf("%s %s\n", a[1], a[2]) >> b_file; - } - printf("];\n\n") >> b_file; - - printf("port_name = [\n") >> b_file; - for (i = 1; i <= i_port; i++) { - split(ports[i],a, " "); - # Dont Remove the [] - # name = substr(a[3],2,length(a[3])-2); - name = a[3]; - printf("'%s'\n", name) >> b_file; - } - printf("];\n\n") >> b_file; - -# Print the (external) port list - ignore spurious ports (in lbl, not fig) - printf("port_list = [\n") >> b_file; - for (i = 1; i <= i_label; i++) { - name = label[i,1]; - if (length(x[name])>0) { - if (match(name,port_regexp)) - printf("'%s'\n", name) >> b_file; - } - } - printf("];\n\n") >> b_file; - -} - - - DELETED mttroot/mtt/bin/trans/awk/rep_txt2make.awk Index: mttroot/mtt/bin/trans/awk/rep_txt2make.awk ================================================================== --- mttroot/mtt/bin/trans/awk/rep_txt2make.awk +++ mttroot/mtt/bin/trans/awk/rep_txt2make.awk @@ -1,34 +0,0 @@ -###################################### -##### Model Transformation Tools ##### -###################################### - -# gawk script: rep_txt2make -# Converts the text file describing a report to makefile dependencies -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -# Revision 1.3 1997/05/19 15:40:04 peterg -# Pass mtt swithches to the new make file -# -# Revision 1.2 1996/11/21 15:57:28 peterg -# Now runs mtt quietly. -# -# Revision 1.1 1996/08/18 19:59:00 peter -# Initial revision -# -############################################################### - - -{ - if (NF==2) - if( match("tex txt r m ps",$2)>0) - print "mtt -q", switches, system_name, $1, $2 -} - - - DELETED mttroot/mtt/bin/trans/awk/rep_txt2tex.awk Index: mttroot/mtt/bin/trans/awk/rep_txt2tex.awk ================================================================== --- mttroot/mtt/bin/trans/awk/rep_txt2tex.awk +++ mttroot/mtt/bin/trans/awk/rep_txt2tex.awk @@ -1,80 +0,0 @@ -###################################### -##### Model Transformation Tools ##### -###################################### - -# gawk script: rep_txt2tex -# Converts the text file describing a report to a report. -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -# Revision 1.5 1997/05/22 11:12:34 peterg -# Chaged figure label. -# -## Revision 1.4 1997/05/22 07:36:35 peterg -## \ref --> \Ref -## -## Revision 1.3 1997/05/19 16:43:34 peterg -## Explicit include of tex files 'cos latex2html prefers this! -## -# Revision 1.2 1997/05/19 16:11:10 peterg -# Modified section headers. -# -# Revision 1.1 1996/08/18 19:58:49 peter -# Initial revision -# -############################################################### - - -BEGIN { - split(ARGV[1],a,"_"); - system_name = a[1]; - args = ARGV[2]; - comment="\%"; -} -{ - if ((match($1,comment)==0)&&(NF==2)) { - Representation = $1; - Language = $2; - Rep_lang = sprintf("%s_%s", Representation, Language); - section_head = sprintf("System \\textbf{%s}: representation \\textbf{%s}, language \\textbf{%s}", \ - system_name,Representation,Language); -# section headings - print "\\section{" section_head "}"; - print "\\label{" Rep_lang "}"; - print "\\index{\\textbf{" system_name "} -- " Representation "}"; - -# tex files - if( match("tex",Language)>0) { - # printf(" \\input{%s_%s.%s}\n", system_name, Representation, Language); - command = sprintf("cat %s_%s.%s", system_name, Representation, Language); - system(command); } -# text files - if( match("txt r m c h",Language)>0) { - print " \\begin{verbatim}"; - command = sprintf("cat %s_%s.%s", system_name, Representation, Language); - system(command); - print " \\end{verbatim}"; - } -# ps files - if( match("ps",Language)>0) { - printf("This representation is given as Figure \\Ref{fig:%s}.\n", Rep_lang); - print " \\begin{figure}"; - printf(" \\shadowbox{ \\epsfig{file=%s_%s.%s,width=0.9\\linewidth} }\n", \ - system_name, Representation, Language); - printf(" \\caption{System \\textbf{%s}, representation %s}\n", system_name, Representation); - printf(" \\label{fig:%s}\n", Rep_lang); - print " \\end{figure}"; - } - } -} -END { - -} - - - DELETED mttroot/mtt/bin/trans/awk/tex2doc.awk Index: mttroot/mtt/bin/trans/awk/tex2doc.awk ================================================================== --- mttroot/mtt/bin/trans/awk/tex2doc.awk +++ mttroot/mtt/bin/trans/awk/tex2doc.awk @@ -1,41 +0,0 @@ -###################################### -##### Model Transformation Tools ##### -###################################### - -# gawk script: tex2doc -# Encapsulates a tex file in a document. -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -# Revision 1.2 1997/04/15 11:18:49 peterg -# Uses supertabular package -# -# Revision 1.1 1996/08/18 20:00:10 peter -# Initial revision -# -############################################################### - - -END{ -# split(ARGV[1],a,"_"); -# system_name = a[1]; -# split(a[2],b,"."); -# representation = b[1]; - makefile = sprintf("%s_rep.make", $system_name, $representation); - print "\\documentclass[12pt,a4paper]{article}"; - printf("\\title{System %s, representation %s}\n", \ - system_name, representation) - print "\\author{Generated by MTT}"; - print " \\usepackage{epsfig}"; - print " \\usepackage{supertabular}"; - print "\\begin{document}"; - print " \\maketitle"; - print" \\input{}", system_nam,e $representation; - print $system_name $representation - print "\\end{document}" -} DELETED mttroot/mtt/bin/trans/bg2eps Index: mttroot/mtt/bin/trans/bg2eps ================================================================== --- mttroot/mtt/bin/trans/bg2eps +++ mttroot/mtt/bin/trans/bg2eps @@ -1,24 +0,0 @@ -#! /bin/sh - -set +e # prevent dia errors from halting MTT - -sys=$1 -rep=$2 -ps=$3 -eps=$4 - -dia_files=`ls ${sys}*_${rep}.dia 2>/dev/null | sed 's/\.dia$//'` -fig_files=`ls ${sys}*_${rep}.fig 2>/dev/null | sed 's/\.fig$//'` - -for file in ${dia_files} - do - dia --export-to-format=eps ${file}.dia - if [ "${ps}" != "eps" ] - then mv ${file}.eps ${file}.${ps} - fi -done - -for file in ${fig_files} - do - fig2dev -L${eps} ${file}.fig > ${file}.${ps} -done DELETED mttroot/mtt/bin/trans/c-tidy Index: mttroot/mtt/bin/trans/c-tidy ================================================================== --- mttroot/mtt/bin/trans/c-tidy +++ mttroot/mtt/bin/trans/c-tidy @@ -1,37 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1997/02/04 18:50:07 peterg -## Initial revision -## -## Revision 1.2 1996/08/20 08:26:06 peter -## Version control header added. -## -############################################################### - -# Bourne shell script: c_tidy -# Tidies up C format files -# P.J.Gawthrop 14 June 1990 13 Nov 1990, 19 Nov 93, April 1994, Dec 1994, -# June 1995 -# Copyright (c) P.J.Gawthrop, 1990, 1994, 1995. - -# Remove blank lines -cat $1 | \ -tr -s '\012' '\012'\ ->junk -mv junk $1 - - - - - - - DELETED mttroot/mtt/bin/trans/c_tidy Index: mttroot/mtt/bin/trans/c_tidy ================================================================== --- mttroot/mtt/bin/trans/c_tidy +++ mttroot/mtt/bin/trans/c_tidy @@ -1,41 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1997/02/04 18:52:34 peterg -## Copied from matlab tidy -- removed everthing except removal of blank -## lines -## -## Revision 1.1 1997/02/04 18:50:07 peterg -## Initial revision -## -## Revision 1.2 1996/08/20 08:26:06 peter -## Version control header added. -## -############################################################### - -# Bourne shell script: c_tidy -# Tidies up C format files -# P.J.Gawthrop 14 June 1990 13 Nov 1990, 19 Nov 93, April 1994, Dec 1994, -# June 1995 -# Copyright (c) P.J.Gawthrop, 1990, 1994, 1995. - -# Remove blank lines -cat $1 | \ -tr -s '\012' '\012'\ ->junk -mv junk $1 - - - - - - - DELETED mttroot/mtt/bin/trans/can_r2m Index: mttroot/mtt/bin/trans/can_r2m ================================================================== --- mttroot/mtt/bin/trans/can_r2m +++ mttroot/mtt/bin/trans/can_r2m @@ -1,122 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: can_r2m -# Reduce canonical forsm to matlab -# P.J.Gawthrop January 8th 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - - -# Inform user -echo Creating $1_can.m - -# Remove the old log file -rm -f can_r2m.log - -# Use reduce to accomplish the transformation -reduce >can_r2m.log << EOF - -%Read in the definitions file -IN "$1_def.r"; - -%Read the reduce state-space A,B,C and D matrices file -IN "$1_can.r"; - -%Set up the number of argument variables to zero in case the user has forgotten -MTTNVar := 0; - -%Read in the parameter file -IN "$1_sympar.r"; - -OUT "$1_can.m"; -%Headings - Matlab style -%(Note. The ;; are deleted by for2mat) - -write "function [A_c,B_c,C_c,D_c,Con,Obs,K,L,A_comp,B_comp,C_comp] = $1_can;;"; -write "%function [A_c,B_c,C_c,D_c,Con,Obs,K,L,A_comp,B_comp,C_comp] = $1_can;;"; - -write "%Canonical forms and controller design for system $1"; -write "%File $1_can.m"; -write "%Generated by MTT"; -write ""; - -IF MTTNvar>0 THEN -BEGIN - write "% Set the parameters"; - write "global ...;;"; - FOR i := 1:MTTNx DO - write "alpha_c",i, " alpha_o",i, "...;;"; - - FOR i := 1:MTTNvar DO - BEGIN - IF numberp(MTTVar(i,1)) - THEN - BEGIN - % Do nowt - END - ELSE - BEGIN - write MTTVar(i,1), " ..."; - END; - END; - write " "; -END; - - -%Fortran switches - one line expressions -OFF echo; -ON fort$ -cardno!* := 1$ -fortwidth!* := 100$ -OFF period$ - -write "MTTA_c = zeros(", MTTNx, ",", MTTNx, ");"; -write "MTTB_c = zeros(", MTTNx, ",", MTTNu, ");"; -write "MTTC_c = zeros(", MTTNy, ",", MTTNx, ");"; -write "MTTD_c = zeros(", MTTNy, ",", MTTNu, ");"; - -write "MTTCon = zeros(", MTTNx, ",", MTTNx, ");"; -write "MTTObs = zeros(", MTTNx, ",", MTTNx, ");"; - -write "MTTK = zeros(", MTTNy, ",", MTTNx, ");"; -write "MTTL = zeros(", MTTNx, ",", MTTNu, ");"; - -write "MTTA_comp = zeros(", MTTNx, ",", MTTNx, ");"; -write "MTTB_comp = zeros(", MTTNx, ",", MTTNy, ");"; -write "MTTC_comp = zeros(", MTTNu, ",", MTTNx, ");"; - - -ON NERO; % Suppress zero elements. -MTTA_c := MTTA_c; -MTTB_c := MTTB_c; -MTTC_c := MTTC_c; -MTTD_c := MTTD_c; - -MTTCon := MTTCon; -MTTObs := MTTObs; - - -MTTK := MTTK; -MTTL := MTTL; - -MTTA_comp := MTTA_comp; -MTTB_comp := MTTB_comp; -MTTC_comp := MTTC_comp; -MTTD_comp := MTTD_comp; - - -OFF FORT; -write ""; - -SHUT "$1_can.m"; DELETED mttroot/mtt/bin/trans/can_r2tex Index: mttroot/mtt/bin/trans/can_r2tex ================================================================== --- mttroot/mtt/bin/trans/can_r2tex +++ mttroot/mtt/bin/trans/can_r2tex @@ -1,193 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: can_r2tex -# Reduce constrained-state matrices to LaTex constrained-state matrices. -# P.J.Gawthrop January 8th 1997 -# Copyright (c) P.J.Gawthrop, 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -# Inform user -echo Creating $1_can.tex - -# Remove the old log file -rm -f can_r2tex.log - -# Use reduce to accomplish the transformation -reduce >can_r2tex.log<< EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the canonical-form matrices file -in "$1_can.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; - -OUT "$1_can.tex"; - -%Write out the canonical matrices -write "%Canonical-form matrices $1"; -write "%File: $1_can.tex"; -write""; - - -% Controllable form -MTT_Matrix := MTTA_c$ -MTT_Matrix_name := "MTTA_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTB_c$ -MTT_Matrix_name := "MTTB_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTC_c$ -MTT_Matrix_name := "MTTC_c"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - - -% Observable form -MTT_Matrix := MTTA_o$ -MTT_Matrix_name := "MTTA_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTB_o$ -MTT_Matrix_name := "MTTB_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTC_o$ -MTT_Matrix_name := "MTTC_o"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% - Controllability matrix"; -MTT_Matrix := MTTCon$ -MTT_Matrix_name := "MTTCon"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% -Observability matrix"; -MTT_Matrix := MTTObs$ -MTT_Matrix_name := "MTTObs"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% -Controllability matrix - controller form"; -MTT_Matrix := MTTCon_c$ -MTT_Matrix_name := "MTTCon_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% - Transformation matrix - controller form"; -MTT_Matrix := MTTT_c$ -MTT_Matrix_name := "MTTT_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% - Gain matrix - controller form"; -MTT_Matrix := MTTK_c$ -MTT_Matrix_name := "MTTK_c"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% - Gain matrix - physical form"; -MTT_Matrix := MTTK$ -MTT_Matrix_name := "MTTK"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - - -write "% -Observability matrix - Observer form"; -MTT_Matrix := MTTObs_o$ -MTT_Matrix_name := "MTTObs_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% - Transformation matrix - Observer form"; -MTT_Matrix := MTTT_o$ -MTT_Matrix_name := "MTTT_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% - Observer Gain matrix - observer form"; -MTT_Matrix := MTTL_o$ -MTT_Matrix_name := "MTTL_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNy$ -LaTeX_Matrix()$ - -write "% - Gain matrix - physical form"; -MTT_Matrix := MTTL$ -MTT_Matrix_name := "MTTL"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNy$ -LaTeX_Matrix()$ - - -% Controllable form -MTT_Matrix := MTTA_comp$ -MTT_Matrix_name := "MTTA_comp"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTB_comp$ -MTT_Matrix_name := "MTTB_comp"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTC_comp$ -MTT_Matrix_name := "MTTC_comp"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - - - -write "\begin{equation}"; - write "MTTur = {", MTTu_r, "}"; -write "\end{equation}"; - -SHUT "$1_can.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/cbg2ese_m2r Index: mttroot/mtt/bin/trans/cbg2ese_m2r ================================================================== --- mttroot/mtt/bin/trans/cbg2ese_m2r +++ mttroot/mtt/bin/trans/cbg2ese_m2r @@ -1,385 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cbg2ese_m -# -# -# P.J.Gawthrop June 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## -## $Log$ -## Revision 1.32 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.31 2001/07/13 04:54:04 geraint -## Branch merge: numerical-algebraic-solution back to main. -## -## Revision 1.30 2001/07/12 04:02:53 gawthrop -## Now fixes multiports for input and output as well as state -## -## Revision 1.29.2.1 2001/06/26 22:29:05 geraint -## mtt_xargs.sh eliminates Arg list too long error for large models. -## (UNIX xargs does not work if the environment is too large). -## -## Revision 1.29 2001/03/29 19:24:14 gawthrop -## Can now use c representations of crs when using -c option -## -## Revision 1.28 2001/02/05 17:19:52 gawthrop -## Now gives unique names to the states of multiports. Second name -## onwards labeled with port number -## -## Revision 1.27 2000/12/05 12:09:56 peterg -## Changed function name to name() -## -## Revision 1.26 2000/12/05 09:04:54 peterg -## *** empty log message *** -## -## Revision 1.25 2000/12/01 14:51:26 peterg -## Major changes towards partioning -## -## - generates sub ese, def and struc -## - generates indices for conversion of subsystem in/out/state - but not used yet -## -## Revision 1.24 2000/11/30 15:12:55 peterg -## Zapped the declaration of subsystem connections - now in individual -## .def files -## -## Revision 1.23 2000/11/30 15:07:28 peterg -## Sorted out mtt_getsize -## -## Revision 1.22 2000/11/12 17:18:30 peterg -## Changed ' to " -## -## Revision 1.21 2000/10/16 08:40:35 peterg -## Whoops! Must touch mtt_aliased -## -## Revision 1.20 2000/10/16 08:36:31 peterg -## Creat empty _aliased file if it doesn't exist -## -## Revision 1.19 2000/10/12 19:25:39 peterg -## Now generateds the _aliased.txt file -## -## Revision 1.18 2000/09/15 08:09:42 peterg -## Removed another debugging line -## -## Revision 1.17 2000/09/15 08:06:17 peterg -## Removed debug lines -## -## Revision 1.16 2000/09/02 15:55:51 peterg -## *** empty log message *** -## -## Revision 1.15 1998/07/08 14:43:12 peterg -## Restored inforfile -## -## Revision 1.14 1998/07/08 08:26:26 peterg -## Added -I option -- if set prints out the information messages -## -## Revision 1.13 1998/05/12 14:49:10 peterg -## Don't write END; any more - ese-tidy does this now! -## -## Revision 1.12 1998/01/23 13:30:46 peterg -## $RMATRIX --> $MATRIX -## -## Revision 1.11 1997/12/16 18:05:03 peterg -## Increased size of structure vector by on to include unknown_inputs as -## 6th element -## -## Revision 1.10 1997/04/15 09:18:26 peterg -## Added structure file -## -# Revision 1.9 1996/12/07 18:21:25 peterg -# Now uses fopen + file number -# -## Revision 1.8 1996/12/05 10:05:28 peterg -## Removed the Octave switch: empty_list_elements_ok = 1; -## This is now in .octaverc -## -# Revision 1.7 1996/08/30 11:29:49 peter -# Added constitutive relationship to argument list. -# Put in explicit argument list to cbg2ese. -# -# Revision 1.6 1996/08/26 13:25:07 peterg -# Corrected error handling. -# -# Revision 1.5 1996/08/24 14:38:11 peter -# Error handling included. -# -## Revision 1.4 1996/08/19 09:02:12 peter -## Errors go to user - not log. -## -## Revision 1.3 1996/08/18 20:05:55 peter -## Included zero outputs. -## -## Revision 1.2 1996/08/08 18:08:37 peter -## Sorted out file naming scheme. -## -## Revision 1.1 1996/08/08 15:57:15 peter -## Initial revision -## -############################################################### - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I ) - info=info;; - -partition ) - partition=yes; - blurb='with partitioning'; - ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - - -infofile='mtt_info.txt'; -structurefile="$1_struc.txt"; -eqnfile="$1_ese.r"; -deffile="$1_def.r"; - - -# Remove the old log file -rm -f cbg2ese_m.log - -# Remove the info and error files -rm -f mtt_info.txt -rm -f mtt_error.txt -rm -f mtt_aliased.txt - -# Remove relevent ese files -rm -f $1_ese.r $1_*_ese.r - -#Inform user -echo Creating $eqnfile $blurb -echo Creating $deffile -echo Creating $structurefile - -# Use matrix manipulation to accomplish the transformation -# This creates an ese file for every subsystem. -$MATRIX << EOF > cbg2ese_m2r.log 2>mtt_error.txt - -infofile = "$infofile";; -infofilenum = fopen(infofile,"wt"); -structurefile = "$structurefile";; -structurefilenum = fopen(structurefile,"wt"); -deffile = "$1_def.r"; -deffilenum = fopen(deffile,"wt"); - -system_name = "$1"; -system_type = ""; -system_cr = ""; -system_args = ""; -full_name = ""; -full_name_repetition = ""; - -% Structure matrix [states,nonstates,inputs,outputs,zero_outputs] - -structure = zeros(1,7); # Initialise structure vector - -structure = cbg2ese(system_name, system_type, system_cr, ... - system_args, full_name, full_name_repetition, ... - 1, structure, structurefilenum, infofilenum); -makedef(structure,deffilenum); -EOF - -echo "END;" >> $1_def.r - -if [ "$info" = "info" ]; then - cat $infofile -fi - -if [ -z "$partition" ]; then - ## Don't partition - - # Create the composite ese file - mtt_xargs.sh cat "$1_ese.r $1_*_ese.r $1_modpar.r" > $1_ese.tmp 2>> /dev/null - - mv $1_ese.tmp $1_ese.r - - # Zap the sub ese files - mtt_xargs.sh "rm -f" "$1_*_ese.r" - - echo "END;" >> $1_ese.r - -else # Partition the system - - # Save up the full def file - mv $1_def.r mtt_all_def.r - -## Recreate def file from the ese file directly -makedef () -{ - -echo Creating $1_def.r - -Nx=`mtt_getsize -external $1 dX` -Nz=`mtt_getsize -external $1 z` -Ny=`mtt_getsize -external $1 y` -Nu=`mtt_getsize -external $1 u` -Nui=`mtt_getsize -external $1 ui` -Nuc=`mtt_getsize -internal $1 u` - -# echo Ny $Ny Nu $Nu Nx $Nx Nui $Nui Nuc $Nuc - -## Definitions file -octave -q <> $1_def.r -} - - -get_indices () -{ - sys=$1 - which=$2 - gawk '{if ($1==which) print $2}' which=$which < ${sys}_struc.txt -} - -convert_indices () -{ - sys=$1 - Which="input output state" - for which in $Which; do - - indices=`get_indices ${sys} $which` - - case $which in - input) - name=u - ;; - output) - name=y - ;; - state) - name=x - ;; - *) - - esac - - new=0 - for old in $indices; do - new=`expr $new + 1` - pattern="MTT${name}(${old},1)" - replacement="MTT${name}(${new},1)" - mv ${sys}_ese.r mtt_junk - sed "s/$pattern/$replacement/" ${sys}_ese.r - done - done -} - # Find subsystems - subsystems=`mtt_get_subsystems $1` - - # Top level - makedef $1; - echo "END;" >> $1_ese.r - - ## Subsystems - for subsystem in $subsystems; do - echo Connecting $subsystem -# Ny=`mtt_getsize -internal ${subsystem}_1 y` -# Nu=`mtt_getsize -internal ${subsystem}_1 u` -# Nx=`mtt_getsize -internal ${subsystem}_1 u` -# echo Ny $Ny Nu $Nu Nx $Nx - - -# echo MATRIX "MTT_"$subsystem"_uc("$Nu",1);" >> $1_def.r - - echo >> $1_ese.r - echo %Subsystem input connections for $subsystem >> $1_ese.r - octave -q <> $1_ese.r - for i=1:$Nu - printf("MTT_%s_uc(%i,1) := %s_1_MTTu%i;\n", "$subsystem", i, "$subsystem", i); - endfor; -EOF - ## Subsystems (Only works when no repetitions at this level) - esefile=${subsystem}_ese.r - echo Creating $esefile - mtt_xargs.sh cat "${subsystem}_1_ese.r ${subsystem}_1_*_ese.r" > $esefile 2> /dev/null - echo "END;" >> $esefile - - ## Def file for subsystem - makedef ${subsystem} - - echo Creating ${subsystem}_struc.txt - grep $subsystem < $1_struc.txt > ${subsystem}_struc.txt - - echo Converting subsystem indices - convert_indices ${subsystem} - - done - -fi - - -# Create the _alised file -touch mtt_aliased.txt -echo Creating $1_aliased.txt -mv mtt_aliased.txt $1_aliased.txt - -# Sort the struc file -mv $structurefile junk -sort -k 1,1 -k 2,2n junk >$structurefile - -# Relabel states with multiple ports -relabel_multiple_definitions(){ - mv $structurefile junk - gawk ' - BEGIN{ - var_type_index=1; - oldname=""; - } - { - name=$4; - newname=name; - if ($1==var_type) { - if (name==oldname) - newname = sprintf("%s_%i",name, ++var_type_index); - else - var_type_index=1; - } - $4 = newname - for (i=1;i $structurefile -} - -relabel_multiple_definitions input; -relabel_multiple_definitions output; -relabel_multiple_definitions state; - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - - - - - - DELETED mttroot/mtt/bin/trans/cbg2pcbg Index: mttroot/mtt/bin/trans/cbg2pcbg ================================================================== --- mttroot/mtt/bin/trans/cbg2pcbg +++ mttroot/mtt/bin/trans/cbg2pcbg @@ -1,31 +0,0 @@ -#! /bin/bash - -## Colour the reactions in the path - -## Colours -blue=1 -green=2 -cyan=3 -red=4 -magenta=5 -yellow=6 -colour=$magenta - -## Fonts -Times_Bold_Italic=3 -Helvetica_Bold_Oblique=19 -Helvetica_Narrow_Bold_Oblique=23 -font=${Helvetica_Bold_Oblique} - -sys=$1 -path="$2" - -cp ${sys}_cbg.fig tmp.fig -for p in $path; do - ##echo doing $p - sed "s/\([0-9] [0-9]\) [0-9]* \([0-9]* [0-9]*\) [0-9]* \(.*:$p.001$\)/\1 $colour \2 $font \3/" \ - < tmp.fig >TMP.fig - mv TMP.fig tmp.fig -done - -mv tmp.fig ${sys}_pcbg.fig DELETED mttroot/mtt/bin/trans/cbg2sese_m2r Index: mttroot/mtt/bin/trans/cbg2sese_m2r ================================================================== --- mttroot/mtt/bin/trans/cbg2sese_m2r +++ mttroot/mtt/bin/trans/cbg2sese_m2r @@ -1,146 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.1 2003/03/13 15:44:53 gawthrop - ## The main transformation for sorted elementary equations - ## - ## 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 - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I ) - info=info;; - - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -infofile='mtt_info.txt'; -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 - -## Print info - -if [ "$info" = "info" ]; then - cat $infofile -fi DELETED mttroot/mtt/bin/trans/cbg_m2dia Index: mttroot/mtt/bin/trans/cbg_m2dia ================================================================== --- mttroot/mtt/bin/trans/cbg_m2dia +++ mttroot/mtt/bin/trans/cbg_m2dia @@ -1,90 +0,0 @@ -#! /bin/sh - -### cbg_m2dia -## -## Creates cbg.dia from: -## abg.dia, ibg.m, connections.dat, cbg.m -## -## Copyright (C) 2004 by Geraint Paul Bevan - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -set -e - -sys=$1 -name=$2 - -## need to fix MTT to create connections.dat using make -## in the meantime: -mtt -q ${sys} connections dat - -dia=${sys}_abg.dia -if [ ! -f ${dia} ]; then - # probably not a dia model - exit; -fi - -echo Creating ${name}_cbg.dia -- component type ${sys} - -con=${sys}_connections.dat -out=${name}_cbg.dia - -${MATRIX:-octave} -q < cbg_m2dia_spec.txt -ibg = ${sys}_ibg; -cbg = ${name}_cbg; - -## get connections data: ${sys}_connections -## structure with two cell arrays: head and tail -## the index of each array element is the bond index -## the value of each array element is a component name -load -text ${sys}_connections.dat; -con = ${sys}_connections; - -nibgbonds = length (fieldnames (ibg.bonds)); -ncbgbonds = length (con.head); - -## map cbg data to connection data -for [bond, bond_name] = ibg.bonds - - head = bond.head.component; - tail = bond.tail.component; - - i = index (head, ':'); - head = substr (head, i+1, length(head)-i); - - i = index (tail, ':'); - tail = substr (tail, i+1, length(tail)-i); - - ## index of bond in diagram - idia = str2num (strrep (bond_name, "bond", "")); - - ## find index of bond in cbg - e(idia) = f(idia) = 0; - for i = 1 : ncbgbonds - if (strcmp (con.head{i}, deblank (head)) && ... - strcmp (con.tail{i}, deblank (tail))) - e (idia) = cbg.bonds (i, 1); # effort - f (idia) = cbg.bonds (i, 2); # flow - endif - endfor -endfor - -espec = "--change_effort_causality "; -fspec = "--change_flow_causality "; -for i = 1 : nibgbonds - espec = sprintf ("%s%d:%d;", espec, i, e(i)); - fspec = sprintf ("%s%d:%d;", fspec, i, f(i)); -endfor -disp (espec) -disp (fspec) -EOF - -spec=`cat cbg_m2dia_spec.txt` - -/usr/local/src/mtt/mttroot/mtt/bin/trans/dia2abg.pl \ - --diagram_name $sys \ - --dia_input_file $dia \ - --dia_output_file $out \ - $spec DELETED mttroot/mtt/bin/trans/cbg_m2fig Index: mttroot/mtt/bin/trans/cbg_m2fig ================================================================== --- mttroot/mtt/bin/trans/cbg_m2fig +++ mttroot/mtt/bin/trans/cbg_m2fig @@ -1,94 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cbg_m2fig -# -# Causal bond graph: mfile format to fig file format -# The resultant fig file is the original _abg.fig with -# additional causal strokes superimposed. -# -# P.J.Gawthrop May 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.12 2001/03/23 14:55:03 gawthrop -## Fixed cosmetic bugs -- component display -## -## Revision 1.11 2000/12/28 12:19:49 peterg -## *** empty log message *** -## -## Revision 1.10 2000/09/14 12:04:48 peterg -## New 2 parameter version -## -## Revision 1.9 1998/01/23 13:31:23 peterg -## $RMATRIX --> $MATRIX -## -## Revision 1.8 1996/12/07 19:23:07 peterg -## Registered agian. -## -# Revision 1.7 1996/11/09 19:04:34 peterg -# Removed cp $1_$1_cbg.fig $1_cbg.fig. -# -## Revision 1.6 1996/11/06 15:58:46 peterg -## Changed Matrix to RMATRIX -## -# Revision 1.5 1996/11/02 10:16:50 peterg -# Changed stroke length to 150 -# -# Revision 1.4 1996/08/25 09:28:59 peter -# More error handling. -# -## Revision 1.3 1996/08/24 14:40:31 peter -## Error handling included. -## -## Revision 1.2 1996/08/08 18:07:31 peter -## Sorted out naming scheme for files -## -## Revision 1.1 1996/08/05 20:13:56 peter -## Initial revision -## -############################################################### - - -# Remove the old log file -rm -f cbg_m2fig.log -rm -f mtt_info.txt - -# The following sets up the fig header file for the system -# and each sub system. -# (ls $1_*_cbg.m \ -# | sed 's/\(.*_\)\(.*_\)cbg.m/cp \2fig.fig \1\2cbg.fig/' \ -#| sh ) 2>mtt_error.txt - -#sh $1_type.sh 'cp ' '_fig.fig ' '_cbg.fig'> mtt_error.txt - -# Copy the unchaging part of the figure file -cat $1_head.fig $1_port.fig $1_bnd.fig $1_art.fig> $2_cbg.fig - -#Inform user -echo Creating $2_cbg.fig -- component type $1 - -# Use matrix manipulation to accomplish the transformation -$MATRIX <mtt_error.txt > cbg_m2fig.log - - system_type = "$1" - system_name = "$2" - - thick = 3; length = 150; red = 4; blue = 1; green = 12; font = 18; - cbg2fig(system_name, system_type, '', ... - length, thick, blue, ... - font, green, red); -EOF - -#cp $1_$1_cbg.fig $1_cbg.fig 2>> mtt_error.txt - -# Print errors, if any. -mtt_error mtt_error.txt - DELETED mttroot/mtt/bin/trans/cmp2cmp_m Index: mttroot/mtt/bin/trans/cmp2cmp_m ================================================================== --- mttroot/mtt/bin/trans/cmp2cmp_m +++ mttroot/mtt/bin/trans/cmp2cmp_m @@ -1,75 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cmp2cmp_m -# Revises the component file (cmp) to account for aliases. - -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 12:20:04 peterg -## Initial revision -## -############################################################### - -# Inform user -echo Revising $1_cmp.m - -# Copy the alias and cmp files. -cat $1_alias.txt $1_cmp.m > junk - -#Create the cmp file complete with headers. -#echo "# Component file ($1_cmp.m)" #> $1_cmp.m -#echo "# Revised by MTT at `date`" #>> $1_cmp.m - -#Write out the variables -gawk ' -BEGIN{ -alias_file=1 -Parameter_Regexp = "^_Parameter_" -Line_Regexp = "cr|arg" -quote = "\047" -} -{ - if (alias_file) { - if (match($1,Parameter_Regexp)>0){ - alias[$2] = $1; - sub(Parameter_Regexp,"$",alias[$2]); # Replace by $ format - } - } - else { - if (match($1,Line_Regexp)){ - cr_or_args = substr($3,2,length($3)-3); # It it a cr or arg line - N=split(cr_or_args,a,";"); # Split into parts - for (i=1;i<=N;i++){ - if (a[i] in alias) # Replace by alias - a[i] = alias[a[i]]; - } - cr_or_args = a[1]; # Recombine - for (i=2;i<=N;i++) - cr_or_args = sprintf("%s;%s", cr_or_args, a[i]); - print "\t" $1 "\t" $2 "\t" quote cr_or_args quote - } - else - print $0 - } - if ($1=="###_END_OF_ALIAS_###") - alias_file=0; -}' $1_cmp.m - -rm -f junk - - - - - - - - DELETED mttroot/mtt/bin/trans/cmp2lbl_txt Index: mttroot/mtt/bin/trans/cmp2lbl_txt ================================================================== --- mttroot/mtt/bin/trans/cmp2lbl_txt +++ mttroot/mtt/bin/trans/cmp2lbl_txt @@ -1,361 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cmp2lbl_txt -# -# Component list to skeleton lable file -# Hacked from (now redundent) abg2lbl_txt - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2002/12/06 11:45:57 gawthrop -## Strips comments from _cmp.txt before processing -## -## Revision 1.1 2002/12/01 14:54:52 gawthrop -## Replaces defunct abg2lbl_fig2txt -## -## -## Old log from abg2lbl_fig2txt -## Revision 1.28 2002/10/30 00:04:22 gawthrop -## Added AEf and AFe to list -## -## Revision 1.27 2002/05/10 09:08:55 gawthrop -## Added EMTF and INTF -## Fixed bug in writing out component headings -## -## Revision 1.26 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.25 2001/10/15 14:27:00 gawthrop -## Now handles [1:N] style port labels -## -## Revision 1.24 2001/08/02 03:24:48 geraint -## Replaced mtt_version.sh with mtt_banner.sh - I think this was the intent. -## -## Revision 1.23 2001/07/26 04:08:35 gawthrop -## Removed lines deleting _type.sh and cbg.m -## -- how did they get there ?? -## -## Revision 1.22 2001/07/08 03:28:11 gawthrop -## Fixed a bug: abg2sympar_m2txt neads a _lbl.txt file when using -## "usinglabel" option -## -## Revision 1.21 2001/07/06 00:46:50 gawthrop -## Added -cr option -- forces cr to be loaded before the ese.r file -## This avoids causality problems when using multi-port Rs to represent -## arbitary equations -## -## Revision 1.20 2001/07/04 05:19:57 gawthrop -## Added RT & CT to list -## -## Revision 1.19 2001/07/03 23:51:10 gawthrop -## Now puts outline #Summary and #Description lines at top of lbl file -## -## Revision 1.18 2001/06/13 18:24:10 gawthrop -## Made "lin" default in place of "none" -## Still needs arg and cr alias clashes to be sorted .... -## -## Revision 1.17 2001/06/13 10:41:06 gawthrop -## Further changes towards aouto creation of lbl files. -## Prettified lbl files -## -## Revision 1.16 2001/06/11 19:43:49 gawthrop -## MTT is now much more sophisticated in generating lbl files -## Labels can contain maths -## Repetative components are now broken -## -## Revision 1.15 2001/06/11 16:53:49 gawthrop -## Now uses abg2sympar_m2txt to get the arguments -## -## Revision 1.14 2001/06/11 15:06:58 gawthrop -## Now handles user-defined components -## -## Revision 1.13 2001/06/04 08:13:37 gawthrop -## Various changes to support PPP -## -## Revision 1.12 2001/05/08 15:18:10 gawthrop -## Added trig and hyperbolic functions to argument exclusion list -## -## Revision 1.11 2000/09/19 11:14:30 peterg -## Now writes the first component type header correctely -## -## Revision 1.10 2000/01/26 10:11:10 peterg -## Added I component -## -## Revision 1.9 1999/11/10 00:47:08 peterg -## Replaced ifs by a table of cr/arg information -## -## Revision 1.8 1999/11/09 22:32:41 peterg -## Under RCS ready for using arrays to contaain defaults. -## -## Revision 1.7 1998/07/04 10:37:21 peterg -## Major revision to include: -## aliases -## new Style -## prettyfied -## -## Revision 1.6 1998/03/05 10:09:47 peterg -## Corrected bug in writing "other" components -## -## Revision 1.5 1998/03/02 09:26:18 peterg -## Now does default CR and args for the basic components only -## SS,I,R,C,GY,TF -## C now has a default of effort input. -## -## Revision 1.4 1998/02/23 16:20:33 peterg -## Summary line just contains the model name -## -## Revision 1.3 1997/05/09 14:21:35 peterg -## Default to flow,component_name -## -# Revision 1.2 1997/03/19 12:08:01 peterg -# No longer writes out non-unique names - now done in rbg_fig2m -# -# Revision 1.1 1997/03/18 13:55:01 peterg -# Initial revision -# -############################################################### - - -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997 -# Copyright (C) 2002 by Peter J. Gawthrop - -infofile='mtt_info.txt' -typefile="$1_type.sh" -sensitivity=$2; -system=$1 -outfile=$1_lbl.txt - -if [ -n "$sensitivity" ]; then - sys="-s ${system}" - sensitivity_switch=" -s " -else - sys=${system} -fi - -# Remove unwanted files -rm -f abg2lbl_fig2txt.log -rm -f $infofile -rm -f mtt_junk* - -## Create lbl files beneath this one -mtt -q -u -l 1 ${sys} sub sh # Create the list -sh $1_sub.sh "echo mtt -q -l 1 ${sensitivity_switch}" " lbl txt" | sh - -if [ -f "$1_lbl.txt" ]; then - ##echo "$1_lbl.txt exists in `pwd` - no action taken" - exit -##else - ##echo "$1_lbl.txt dosn not exist in `pwd` " -fi - -#Inform user -if [ -n "$sensitivity" ]; then - echo "Creating ${outfile} (sensitivity version)" -else - echo "Creating ${outfile}" -fi - -write_header() - -{ -cat< default parameters)"; - Name = "# " $1; - cr[Component] = "\t"; - arg[Component] = "\t"; -} -(NF > 1) { - Component = $1; - Name = $2; - Arg = $3; -} -{ -##Aliases - if (Component == "SS") { - port_alias[++j] = Name; - Component_type = Component; - } - else { - alias[++i] = Name; - if (length(sensitivity)>0) { - s_arg = sprintf("%ss",Name); - alias[++i] = s_arg; - s_arg = sprintf(";%s",s_arg); - Component_type = Component; - Component = substr(Component,2); - lin = "slin" - } - else { - Component_type = Component; - lin = "lin"; - } - - } - - ## Table of components - cr["SS"] = "SS"; arg["SS"] = "external,external"; - - cr["Se"] = "SS"; arg["Se"] = sprintf("external%s", s_arg); - cr["Sf"] = "SS"; arg["Sf"] = sprintf("external%s", s_arg); - - cr["De"] = "SS"; arg["De"] = "external"; - cr["Df"] = "SS"; arg["Df"] = "external"; - - cr["R"] = lin; arg["R"] = sprintf("flow,%s%s", Name, s_arg); - cr["C"] = lin; arg["C"] = sprintf("effort,%s%s", Name, s_arg); - cr["I"] = lin; arg["I"] = sprintf("flow,%s%s", Name, s_arg); - - cr["INTF"] = lin; arg["INTF"] = ""; - - cr["CS"] = "lin"; arg["CS"] = sprintf("effort,%s;%s_x0%s", Name, Name, s_arg); - cr["IS"] = "lin"; arg["IS"] = sprintf("flow,%s;%s_x0%s", Name, Name, s_arg); - cr["INTFS"] = "lin"; arg["INTFS"] = sprintf("%s_x0%s", Name, s_arg); - - cr["TF"] = "lin"; arg["TF"] = sprintf("flow,%s%s", Name, s_arg); - cr["GY"] = "lin"; arg["GY"] = sprintf("flow,%s%s", Name, s_arg); - - ##cr["EMTF"] = sprintf("%s", Name); arg["EMTF"] = sprintf("l%s", s_arg); - cr["EMTF"] = "lin"; arg["EMTF"] = sprintf("flow,%s%s", Name, s_arg); - - cr["AE"] = "lin"; arg["AE"] = sprintf("%s%s", Name, s_arg); - cr["AF"] = "lin"; arg["AF"] = sprintf("%s%s", Name, s_arg); - cr["AEf"] = "lin"; arg["AEf"] = sprintf("%s%s", Name, s_arg); - cr["AFe"] = "lin"; arg["AFe"] = sprintf("%s%s", Name, s_arg); - - cr["CDx"] = "lin"; arg["CDx"] = sprintf("%s%s", Name, s_arg); - - - cr["FMR"] = lin; arg["FMR"] = sprintf("effort,%s%s", Name, s_arg); - - cr["RS"] = lin; arg["RS"] = sprintf("flow,%s%s", Name, s_arg); - cr["RT"] = lin; arg["RT"] = sprintf("flow,%s%s", Name, s_arg); - cr["CT"] = lin; arg["CT"] = sprintf("effort,%s%s", Name, s_arg); - - ## Put in the explicit arguments - if (length(Arg)>0) { - arg[Component] = Arg; - if (match(Arg,"=")>0) # Its an equation type cr - cr[Component] = "cr" - else # assume a linear cr - cr[Component] = "lin"; - } - - ## Print component header - if (Component != OldComponent) print "\n## Component type", Component_type - - ## Print Component - printf("\t%s\t", Name); - if (Component in cr) - printf("%s\t\t", cr[Component]) - else - printf("%s\t\t", default_cr); - - if (Component in arg) - printf("%s\t\t\n", arg[Component]) - else { - print "lbl2args_txt2out", Component_type | "/bin/sh"; close("/bin/sh") - } - - OldComponent=Component; - delete arg[Component]; # Zap the element - delete cr[Component]; # Zap the element - } - END{ - print "\n## Port aliases" >> "mtt_junk_alias.txt"; - for (k=1;k<=j;k++){ - if (port_alias[k] ~ "\\["){ # Only do ports - port_name = substr(port_alias[k],2,length(port_alias[k])-2); - if (length(sensitivity)==0) - print "#ALIAS\t" port_name "\t" port_name >> "mtt_junk_alias.txt"; - else - print "#ALIAS\t" port_name "\t" port_name "_1," port_name "_2" >> "mtt_junk_alias.txt"; - } - } - -# print "\n% Argument aliases" >> "mtt_junk_alias.txt"; -# for (k=1;k<=i;k++){ -# print "%ALIAS\t\$" k "\t" alias[k] >> "mtt_junk_alias.txt"; -# } - }' sensitivity=$sensitivity -} - -create_arg_aliases() -{ -cat < $1_lbl.txt -create_arg_aliases > mtt_args.txt # using $1_lbl.txt -mv $1_lbl.txt mtt_junk_lbl.txt - -write_header > ${outfile} -cat mtt_junk_alias.txt >> ${outfile} -cat mtt_args.txt >> ${outfile} -write_blurb >> ${outfile} -cat mtt_junk_lbl.txt >> ${outfile} - -## Put a blank line at end -cat >> ${outfile} < $1_sub.sh -echo "# File $1_sub.sh" >> $1_sub.sh -echo "# Generated by MTT on `date`." >> $1_sub.sh -echo >> $1_sub.sh - -# Get a list of all components for the _cmp file -gawk '/comp_type = / {print substr($3,2,length($3)-3)}' $1_cmp.m |\ -sort -u > mtt_tmp1 - -# Remove all components starting with 0 or 1 -grep -v '^[01]' < mtt_tmp1 > mtt_tmp4 - -# Get a list of all standard simple components -ls $MTT_LIB/comp/simple |\ - gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2 - -# Get a list of all standard compound components -#ls $MTTPATH/comp/compound |\ -# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2 - -# Sorted combined list -cat mtt_tmp2 | \ - sed 's/^zero$/0/' |\ - sed 's/^one$/1/' |\ - sort -u >mtt_tmp3 - -# Print the non-standard components -comm mtt_tmp4 mtt_tmp3 |\ - gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \ - >>$1_sub.sh - -# Clean up mtt_tmp files -#rm -f mtt_tmp? - - - - - - - - DELETED mttroot/mtt/bin/trans/cmp2sub_m2txt Index: mttroot/mtt/bin/trans/cmp2sub_m2txt ================================================================== --- mttroot/mtt/bin/trans/cmp2sub_m2txt +++ mttroot/mtt/bin/trans/cmp2sub_m2txt @@ -1,49 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: makecr - -# Copyright (c) P.J.Gawthrop 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 1996/09/12 19:28:55 peter -## Added rcs header. -## -## Revision 1.4 1996/09/12 12:06:38 peter -## Removed reducndant lines. -## -## Revision 1.3 1996/09/12 12:05:01 peter -## Removed default crs. -## -## Revision 1.2 1996/09/10 16:18:37 peter -## Uses default constitutive relationship mtt/cr/r -## -## Revision 1.1 1996/08/24 14:53:06 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_cr.r - -echo % Default CR file > $1_cr.r -echo % File $1_cr.r >> $1_cr.r -echo % Generated by MTT on `date`. >> $1_cr.r -echo >> $1_cr.r -cat $MTTPATH/trans/m/rcs_header.txt >> $1_cr.r -echo 'END;' >> $1_cr.r - - - - - - - - DELETED mttroot/mtt/bin/trans/cmp2sub_txt2sh Index: mttroot/mtt/bin/trans/cmp2sub_txt2sh ================================================================== --- mttroot/mtt/bin/trans/cmp2sub_txt2sh +++ mttroot/mtt/bin/trans/cmp2sub_txt2sh @@ -1,89 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cmp2sub_txt2sh - -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2002/12/06 12:26:34 gawthrop -## Strips comments from cmp.txt file -## -## Revision 1.1 2002/12/03 23:26:08 geraint -## Convert _cmp.txt to _sub.sh. -## Slightly edited copy of (obsolete) abg2sub_m2sh. -## -## Revision 1.4 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.3 2000/10/03 11:34:53 peterg -## Correct $MTT_LIB -## -## Revision 1.2 2000/03/17 09:53:10 peterg -## Removed irritating echo Using "$1_sub.sh" -## -## Revision 1.1 2000/03/15 21:23:20 peterg -## Initial revision -## -############################################################### - - -if [ -f "$1_sub.sh" ]; then - #echo Using "$1_sub.sh" - exit -else - #Inform user - echo Creating $1_sub.sh -fi - - -echo '# Commands to generate subsystem representations'> $1_sub.sh -echo "# File $1_sub.sh" >> $1_sub.sh -echo "# Generated by MTT on `date`." >> $1_sub.sh -echo >> $1_sub.sh - -# Get a list of all components for the _abg file -strip_comments < $1_cmp.txt | gawk -F\: '{print $1}' |\ -sort -u > mtt_tmp1 - -# Remove all components starting with 0 or 1 -grep -v '^[01]' < mtt_tmp1 > mtt_tmp4 - -# Get a list of all standard simple components -# echo ls $MTT_LIB/comp/simple -ls $MTT_LIB/comp/simple |\ - gawk '/_cause.m/{split($1,a,"_");print(a[1])}' >mtt_tmp2 - -# Get a list of all standard compound components -#ls $MTTPATH/comp/compound |\ -# gawk '/_abg.m/{split($1,a,"_");print(a[1])}' >> mtt_tmp2 - -# Sorted combined list -cat mtt_tmp2 | \ - sed 's/^zero$/0/' |\ - sed 's/^one$/1/' |\ - sort -u >mtt_tmp3 - -# Print the non-standard components -comm mtt_tmp4 mtt_tmp3 |\ - gawk 'BEGIN{FS="\t"}{if (length($1)>0) print "$1" $1 "$2"}' \ - >>$1_sub.sh - -# Clean up mtt_tmp files -#rm -f mtt_tmp? - - - - - - - - DELETED mttroot/mtt/bin/trans/contents.tex Index: mttroot/mtt/bin/trans/contents.tex ================================================================== --- mttroot/mtt/bin/trans/contents.tex +++ mttroot/mtt/bin/trans/contents.tex @@ -1,17 +0,0 @@ -% Contents etc for MTT documents - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/12/07 11:52:30 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - \tableofcontents - \newpage - \listoffigures - \newpage DELETED mttroot/mtt/bin/trans/convert_simpar.sh Index: mttroot/mtt/bin/trans/convert_simpar.sh ================================================================== --- mttroot/mtt/bin/trans/convert_simpar.sh +++ mttroot/mtt/bin/trans/convert_simpar.sh @@ -1,10 +0,0 @@ -#!/bin/sh - -## Gets rid of redundant METHOD lines. -echo Converting $1 -## backup -cp $1 $1_old -sed 's/METHOD/## METHOD/'< $1_old > $1 - - - DELETED mttroot/mtt/bin/trans/cr_txt2r Index: mttroot/mtt/bin/trans/cr_txt2r ================================================================== --- mttroot/mtt/bin/trans/cr_txt2r +++ mttroot/mtt/bin/trans/cr_txt2r @@ -1,146 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - -# Bourne shell script: cr_txt2r - -# Label file to constitutive relationship conversion -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.14 2002/05/09 15:52:09 gawthrop -## Now uses current cr file is its newer than abg.m -## -## Revision 1.13 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.12 2002/04/08 17:04:21 geraint -## Removed spurious "\n" from output. -## -## Revision 1.11 2000/08/01 07:34:33 peterg -## Replaced printf by echo -## -## Revision 1.10 2000/02/25 09:10:12 peterg -## Changed -e to -f in if [ -f "$crf" ]; then -## -- cuased probs on SUN -## -## Revision 1.9 2000/02/16 15:58:17 peterg -## Set level='' not $2 -## -## Revision 1.8 1998/11/20 09:48:31 peterg -## Remove the _lower stuff -- see idf this works now. -## -## Revision 1.7 1998/04/14 17:46:28 peterg -## To avoid clashes when creating for more thsan one top level file, adds -## _lower attribute to lower lecel constitutive relationship files. -## .constitutive relationship files only in top level _constitutive -## relationship files. -## -## Revision 1.6 1998/04/14 13:54:15 peterg -## Uses the _sub.sh rep to recursively generate and include sub systems. -## -## Revision 1.5 1998/03/09 13:36:00 peterg -## Cosmetic change -## -## Revision 1.4 1998/03/06 15:54:41 peterg -## Put message bcak in in simpler form -## -## Revision 1.3 1998/03/06 15:51:06 peterg -## Zapped the irritating error message -## -## Revision 1.2 1998/03/04 15:32:53 peterg -## Major revision. -## Now just includes cr files using in""; -## Two sorts of CR: -## generic (.cr) -## tied to a system (_cr.r) -## -## Revision 1.1 1998/03/04 15:31:14 peterg -## Initial revision -## -# Revision 1.3 1997/04/09 12:59:43 peterg -# Looks for .cr file in current directory - copies from library if they -# don't already exist. -# -# Revision 1.2 1997/04/09 09:25:55 peterg -# Now copies .cr files from linrary to here (if they don't exist -# already). -# -# Revision 1.1 1997/04/09 09:08:12 peterg -# Initial revision -# -############################################################### - -# The level of the recursion null at top level; _lower at lower levels. - -level='' ## Used to be $2 - now set to null. - -abgfile=$1_abg.m -crfile=$1_cr.r -CRFILE=$1_cr.r - -if [ -f "$crfile" ]; then - echo "Using $crfile" -else - # Inform user - echo "Creating $crfile" - - echo "% Constitutive relation file for $1 ($crfile)" > $crfile - echo "% Generated by MTT at `date`" >> $crfile - - echo >> $crfile - - # Recursively create subsystem CR files -- at lower level - sh $1_sub.sh 'cr_txt2r ' ' _lower' - - # Include subsystem CR files - sh $1_sub.sh 'echo ' "_cr.r" |\ - gawk '{ - print "in \"" $1 "\";" - }' >> $crfile - -## if [ -z "$level" ]; then - - # Copy .cr files - gawk '{ - if (NF>0) { - print "mtt -q -u crcopy " $1; - } - }' $1_cr.txt | sh - - # Include the .cr files -# gawk '{ -# if (NF>0) { -# print "in \"" $1 ".cr\";" -# } -# }' $1_cr.txt >> $crfile - - ## list of the crs - crs=`cat $1_cr.txt` - for cr in $crs; do - crf=$cr'_cr.r' - if [ -f "$crf" ]; then -## printf "\045 (%s exists)\n" $crf >> $crfile - echo "% ($crf exists)" >> $crfile - else -## printf 'in "%s.cr";\n' $cr >> $crfile - echo 'in "'$cr.cr'";' >> $crfile - fi - done -## fi -echo 'END;' >> $crfile - -fi -# Now invoke the standard error handling. -#mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/cse2csm_r Index: mttroot/mtt/bin/trans/cse2csm_r ================================================================== --- mttroot/mtt/bin/trans/cse2csm_r +++ mttroot/mtt/bin/trans/cse2csm_r @@ -1,193 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cse2csm_r -# Constrained-state equation to linear constrained-state matrices conversion -# P.J.Gawthrop 6th September 1991, May 1994 -# Copyright (c) P.J.Gawthrop, 1991, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 2000/04/07 19:11:59 peterg -## reduce --> $SYMBOLIC -## -## Revision 1.6 2000/04/06 11:27:56 peterg -## Removed the in _cr.r -## -## Revision 1.5 1999/12/08 02:04:46 peterg -## Removed bug - uj := MTTU(j,1); not commented out -## -## Revision 1.4 1999/11/22 23:49:50 peterg -## Writes out the new MTTNx and MTTNy -## -## Revision 1.3 1999/11/22 23:38:51 peterg -## Now does scse 2 scsm as well. -## Uses mkid. -## -## Revision 1.2 1998/07/13 09:56:31 peterg -## Back under RCS for major revision -## -# Revision 1.1 1996/08/25 10:13:37 peter -# Initial revision -# -############################################################### - -# Inform user -echo Creating $1_$2.r - -case $2 in - csm) - rep=cse; - ;; - scsm) - rep=scse; - ;; - *) - echo Representation must be csm or scsm; - exit -esac -# Remove the old log file -rm -f cse2csm_r.log - -# Use reduce to accomplish the transformation -$SYMBOLIC >cse2csm_r.log << EOF - -in "$1_def.r"; -in "$1_$rep.r"; -%%in "$1_cr.r"; -%%in "$1_sympar.r"; - -OFF Echo; -OFF Nat; - -% Get rid of the old mttx and u - now use mkid instead -clear MTTx, MTTu; - -IF (MTTNx>0) THEN -BEGIN -% Find MTTA : the A matrix -matrix MTTA(MTTNx,MTTNx); - - FOR j := 1:MTTNx DO - BEGIN - %xj := MTTX(j,1); - xj := mkid(MTTx,j); - FOR i := 1:MTTNx DO - MTTA(i,j) := df(MTTEdx(i,1), xj, 1); - END; -END; - -IF (MTTNx>0) AND (MTTNu>0) THEN -BEGIN -% Find MTTB : the B matrix -matrix MTTB(MTTNx,MTTNu); - - FOR j := 1:MTTNu DO - BEGIN - %uj := MTTU(j,1); - uj := mkid(MTTu,j); - FOR i := 1:MTTNx DO - MTTB(i,j) := df(MTTEdx(i,1), uj, 1); - END; -END; - -IF (MTTNx>0) AND (MTTNy>0) THEN -BEGIN -% Find MTTC : the C matrix -matrix MTTC(MTTNy,MTTNx); - - FOR i := 1:MTTNy DO - FOR j := 1:MTTNx DO - BEGIN - %xj := MTTX(j,1); - xj := mkid(MTTx,j); - MTTC(i,j) := df(MTTY(i,1), xj, 1); - END; -END; - -IF (MTTNy>0) AND (MTTNu>0) THEN -BEGIN - -% Find MTTD : the D matrix -matrix MTTD(MTTNy,MTTNu); - - FOR i := 1:MTTNy DO - FOR j := 1:MTTNu DO - BEGIN - %uj := MTTU(j,1); - uj := mkid(MTTu,j); - MTTD(i,j) := df(MTTY(i,1), uj, 1); - END; -END; - -%Substitute the ss values -in "$1_sspar.r"; - -%Create the output file -OUT "$1_$2.r"; - -% Constants - -write "% New constants"; -write "MTTNx := ", MTTNx, ";"; -write "MTTNy := ", MTTNy, ";"; - - -%Write out the matrices. -IF MTTNx>0 THEN -BEGIN - write "matrix MTTE(", MTTNx, ",", MTTNx, ");"; - FOR i := 1:MTTNx DO - FOR j := 1:MTTNx DO IF MTTE(i,j) NEQ 0 THEN - write "MTTE(", i, ",", j, ") := ", MTTE(i,j); - - write "matrix MTTA(", MTTNx, ",", MTTNx, ");"; - FOR i := 1:MTTNx DO - FOR j := 1:MTTNx DO IF MTTA(i,j) NEQ 0 THEN - write "MTTA(", i, ",", j, ") := ", MTTA(i,j); -END; - -IF MTTNx>0 THEN -IF MTTNu>0 THEN -BEGIN - write "matrix MTTB(", MTTNx, ",", MTTNu, ");"; - FOR i := 1:MTTNx DO - FOR j := 1:MTTNu DO IF MTTB(i,j) NEQ 0 THEN - write "MTTB(", i, ",", j, ") := ", MTTB(i,j); -END; - -%Write it out -IF MTTNy>0 THEN -IF MTTNx>0 THEN -BEGIN - write "matrix MTTC(", MTTNy, ",", MTTNx, ");"; - FOR i := 1:MTTNy DO - FOR j := 1:MTTNx DO IF MTTC(i,j) NEQ 0 THEN - write "MTTC(", i, ",", j, ") := ", MTTC(i,j); -END; - -IF MTTNy>0 THEN IF MTTNu>0 THEN -BEGIN - write "matrix MTTD(", MTTNy, ",", MTTNu, ");"; - FOR i := 1:MTTNy DO - FOR j := 1:MTTNu DO IF MTTD(i,j) NEQ 0 THEN - write "MTTD(", i, ",", j, ") := ", MTTD(i,j); -END; - -write "END;"; - -SHUT "$1_$2.r"; - -EOF - -# Now invoke the standard error handling. -mtt_error_r cse2csm_r.log - - - DELETED mttroot/mtt/bin/trans/cse2ode_r Index: mttroot/mtt/bin/trans/cse2ode_r ================================================================== --- mttroot/mtt/bin/trans/cse2ode_r +++ mttroot/mtt/bin/trans/cse2ode_r @@ -1,155 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cse2ode_r -# Reduce constrained-state equations to ode. -# P.J.Gawthrop 10th May 199, 8th August 1991, April 1994, Dec 1994 -# Copyright (c) P.J.Gawthrop, 1991, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3.4.2 2002/09/10 23:24:19 geraint -## Rationalised local and global optimisations. -## Fixes presentation of locally optimised code (ode view). -## Much more elegant :-) -## -## Revision 1.3.4.1 2002/09/03 23:44:43 geraint -## adding global optimisation (-optg). -## -## Revision 1.3 2001/07/27 23:29:10 geraint -## Optimises only when requested (-opt). -## -## Revision 1.2 2001/07/13 04:54:04 geraint -## Branch merge: numerical-algebraic-solution back to main. -## -## Revision 1.1.4.1 2001/05/04 04:07:24 geraint -## Numerical solution of algebraic equations. -## sys_ae.cc written for unsolved inputs. -## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). -## -## Revision 1.1 2000/12/28 12:21:31 peterg -## Put under RCS -## -## Revision 1.2 1997/01/06 21:17:10 peterg -## Removed: OFF Exp; OFF GCD; -## -## Revision 1.1 1996/08/25 10:05:45 peter -## Initial revision -## -############################################################### - -optimise=''; optimise_msg='' -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -optimise_global ) - optimise='-optimise_global' - optimise_msg=' with global optimisation' ;; - -optimise_local ) - optimise='-optimise_local' - optimise_msg=' with local optimisation' ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -# Create the reduce output code -def2write_r $1 ode -def2write_r $1 odeo - -#Inform user -echo Creating $1_ode.r $optimise_msg -echo Creating $1_odeo.r $optimise_msg - -# Remove the old log file -rm -f cse2ode_r.log - -# Use reduce to accomplish the transformation -$SYMBOLIC >cse2ode_r.log << EOF - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - -%Read the definitions file -in "$1_def.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the constrained-state equations file -in "$1_cse.r"; - -%Read the algebraic equations file -in "$1_ae.r"; - -IF MTTNx>0 THEN - IF MTTNz>0 THEN - MTTdXX := MTTE^(-1)*MTTEdX - ELSE - MTTdXX := MTTEdX; - -%Remove all dX terms from y - a rather nasty method, sorry! - MTTdX1 := 0; - MTTdX2 := 0; - MTTdX3 := 0; - MTTdX4 := 0; - MTTdX5 := 0; - MTTdX6 := 0; - MTTdX7 := 0; - MTTdX8 := 0; - MTTdX9 := 0; - MTTdX10 := 0; - MTTdX11 := 0; - MTTdX12 := 0; - MTTdX13 := 0; - MTTdX14 := 0; - MTTdX15 := 0; - MTTdX16 := 0; - MTTdX17 := 0; - MTTdX18 := 0; - MTTdX19 := 0; - MTTdX20 := 0; - -%Substitute dX into y; -IF MTTNz>0 THEN - IF MTTNx>0 THEN - MTTY := MTTY + MTTEyx*MTTdX; - -OFF Echo; -OFF Nat; - -MTTdX := MTTdXX; - -%Write out the ordinary differential equations. -OUT "$1_ode.r"; -write "%File: $1_ode.r"; -in ("$1_ode_write.r"); -write "in ""$1_odeo.r"";"; -write "END;"; -SHUT "$1_ode.r"; - -%Write out the output equations -OUT "$1_odeo.r"; -write "%File: $1_odeo.r"; -in ("$1_odeo_write.r"); -write "END;"; -SHUT "$1_odeo.r"; -quit; -EOF - -if [ ${optimise:-""} = "-optimise_global" ]; then - mtt_optimise global $1 ode - mtt_optimise global $1 odeo -elif [ ${optimise:-""} = "-optimise_local" ]; then - mtt_optimise local $1 ode - mtt_optimise local $1 odeo -fi - -# Now invoke the standard error handling. -mtt_error_r cse2ode_r.log DELETED mttroot/mtt/bin/trans/cse2rfe_r Index: mttroot/mtt/bin/trans/cse2rfe_r ================================================================== --- mttroot/mtt/bin/trans/cse2rfe_r +++ mttroot/mtt/bin/trans/cse2rfe_r @@ -1,181 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cse2rfe_r -# Reduce constrained-state equations to robot matrices -# Experimental version! -# State vector should have momenta in odd rows,angles in even; -# the last row should have the gravity velocity term. -# There should be one output (only) for each joint velocity. -# P.J.Gawthrop, Nov 92, Dec 93, May 1994 -# Copyright (c) P.J.Gawthrop, 1992, May 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1996/12/05 12:10:00 peterg -## Version history added. -## -############################################################### - -# Inform user -echo Creating $1_rfe.r - -# Remove the old log file -rm -f cse2rfe_r.log - -# Use reduce to accomplish the transformation -reduce >cse2rfe_r.log << EOF - -IN "$1_def.r"; -IN "$1_sympar.r"; -IN "$1_csm.r"; -IN "$1_cse.r"; - -MTTN2 := MTTNy; - - -%Find E11 and E12 matrices -MATRIX MTTE11(MTTN2,MTTN2), MTTE12(MTTN2,MTTN2); -FOR i := 1:MTTN2 DO - FOR j := 1:MTTN2 DO - BEGIN - MTTE11(i,j) := MTTE(2*i-1,2*j-1); - MTTE12(i,j) := MTTE(2*i-1,2*j); - END; - -%Find inertia matrix -MATRIX MTTImi(MTTN2,MTTN2); -FOR i := 1:MTTN2 DO - BEGIN - MTTImi(i,i) := MTTC(i,2*i-1); - END; - -MTTIm := MTTImi^-1; - -%Find gravity matrix if there is an extra gravity state -MATRIX MTTG(MTTN2,1); -MTTNy2 := 2*MTTNy; -IF ( (MTTNx-1)/MTTNy2 = 1) THEN -FOR i := 1:MTTN2 DO - BEGIN - MTTG(i,1) := MTTE(2*i-1,MTTNx); - END; - - - -%Find V matrix from RHS of equation -MTTu1 := 0; -MTTu2 := 0; -MTTu3 := 0; -MTTu4 := 0; -MTTu5 := 0; -MTTu6 := 0; - -MTTx2 := theta_1; -MTTx4 := theta_2; -MTTx6 := theta_3; -MTTx8 := theta_4; -MTTx10 := theta_5; -MTTx12 := theta_6; - -MTTx1 := dot_theta_1*MTTIm(1,1); -MTTx3 := dot_theta_2*MTTIm(2,2); -MTTx5 := dot_theta_3*MTTIm(2,3); - -MATRIX MTTdt(6,1); -MTTdt(1,1) := dot_theta_1; -MTTdt(2,1) := dot_theta_2; -MTTdt(3,1) := dot_theta_3; -MTTdt(4,1) := dot_theta_4; -MTTdt(5,1) := dot_theta_5; -MTTdt(6,1) := dot_theta_6; - -MATRIX dtheta(MTTN2,1); -FOR i := 1:MTTN2 DO - BEGIN - dtheta(i,1) := MTTdt(i,1); - END; - -MATRIX MTTVrhs(MTTN2,1); -MATRIX MTTV(MTTN2,1); -FOR i := 1:MTTN2 DO - BEGIN - MTTVrhs(i,1) := MTTEdX(2*i-1,1); - END; - -%Find V matrix -MTTV := MTTE12*dtheta - MTTVrhs; - -%Find C matrix -MATRIX MTTC(MTTN2,MTTN2); -k := 0; -FOR i := 1:MTTN2 DO - FOR j := 1:MTTN2 DO - BEGIN - coeffs := coeff(MTTV(i,1),MTTdt(j,1)); - IF length(coeffs)>2 THEN co := part(coeffs,3) ELSE co := 0; - MTTC(i,j) := co; - END; - -%Find B matrix -MTTN3 := MTTN2*(MTTN2-1)/2; - -IF MTTN3>0 THEN -BEGIN -MATRIX MTTB(MTTN2,MTTN3); -FOR i := 1:MTTN2 DO -BEGIN - counter := 0; - FOR j := 1:MTTN2-1 DO - BEGIN - coeffs := coeff(MTTV(i,1),MTTdt(j,1)); - IF length(coeffs)>1 THEN co := part(coeffs,2) ELSE co := 0; - FOR k := j+1:MTTN2 DO - BEGIN - counter := counter+1; - coeffs2 := coeff(co,MTTdt(k,1)); - IF length(coeffs2)>1 THEN co2 := part(coeffs2,2) ELSE co2 := 0; - MTTB(i,counter) := co2; - END; - END; -END; -END; - -OFF Echo; -OFF Nat; -ON NERO; - -OUT "$1_rfe.r"; - -%% M -write "MATRIX MTTM(", MTTN2, ",", MTTN2, ")"; -MTTM := MTTE11*MTTIm; - -%% V -write "MATRIX MTTRV(", MTTN2, ",1)"; -MTTRV := MTTV; - -%% - -write "MATRIX MTTRC(", MTTN2, ",", MTTN2, ")"; -MTTRC := MTTC; - -IF MTTN3>0 THEN - BEGIN - write "MATRIX MTTRB(", MTTN2, ",", MTTN3, ")"; - MTTRB := MTTRB; -END; - -write "MATRIX MTTRG(", MTTN2, ", 1)"; -MTTRG := MTTG; - -write ";END;"$ -SHUT "$1_rfe.r"; -quit; -EOF DELETED mttroot/mtt/bin/trans/cse2scse_r Index: mttroot/mtt/bin/trans/cse2scse_r ================================================================== --- mttroot/mtt/bin/trans/cse2scse_r +++ mttroot/mtt/bin/trans/cse2scse_r @@ -1,258 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cse2scse_r -# Reduce constrained-state equations to sensitivity version -# P.J.Gawthrop 10th May 199, 8th August 1991, April 1994, Dec 1994 -# Copyright (c) P.J.Gawthrop, 1999 - -# $Id$ - -# Arguments -system=$1; -system_def=$1_def.r -system_cse=$1_cse.r -system_scse=$1_scse.r - -# Parameters -n=`echo $2 | sed 's/,/ /g' |wc -w` ## Number of parameters - -## Parameter information for reduce. -parameters=`echo $2 | sed 's/,/ /g' |\ - gawk '{ - for (i=1; i<=NF; i++) { - printf("mttpar(%i,1) := %s;\n", i, $i); - printf("mttcoef(%i,1) := %ss;\n", i, $i); - } - }'` - -## Update sympar list. -echo Recreating $1_sympar.txt -# Zap any sensitivity coeficients -mv $1_sympar.txt mtt_junk -grep -v MTT_Sensitivity_Coefficients mtt_junk > $1_sympar.txt - -# Create the new sens coeffs at end of list. -echo $2 | sed 's/,/ /g' |\ -gawk '{ - for (i=1; i<=NF; i++) { - printf("%ss\tMTT_Sensitivity_Coefficients\n",$i); - } - }' >> $1_sympar.txt - -touch $1_sympar.txt - -matrix="matrix mttpar("$n",1); matrix mttcoef("$n",1);" - -# Number of states -Nx=`grep "MTTNx " <$system_def | gawk '{print $3}' | sed 's/;//'` - -#Inform user -echo Creating $system_scse "(for parameters $2, $Nx states)" - -# Remove the old log file -rm -f cse2scse_r.log - -# Use reduce to accomplish the transformation -$SYMBOLIC << EOF >cse2scse_r.log - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - -%Read the definitions file -in "$system_def"; - -%Read the constrained-state equations file -in "$system_cse"; - -% Declare the parameter matrix and fill it -$matrix -$parameters -mtt_n_par := $n; - -MTTNx2 := 2*MTTNx; -MTTNy2 := 2*MTTNy; - -% Compute the sensitivity E matrix -matrix MTTssE(MTTNx,MTTNx); -clear MTTx; % Dont use - mkid is better - -FOR ii := 1:MTTNx DO - FOR jj := 1:MTTNx DO - IF MTTE(ii,jj) NEQ 0 THEN IF MTTE(ii,jj) NEQ 1 THEN - BEGIN - % First with respect to theta... - FOR kk := 1:mtt_n_par DO - BEGIN - mttpar_k := mttpar(kk,1); - mttcoef_k := mttcoef(kk,1); - MTTssE(ii,jj) := MTTssE(ii,jj) + df(MTTE(ii,jj), mttpar_k)*mttcoef_k; - END; - % then with respect to x - FOR i := 1:MTTNx DO - BEGIN - xi := mkid(MTTx,i); - sxi := mkid(MTTsx,i); - MTTssE(ii,jj) := MTTssE(ii,jj) + df(MTTE(ii,jj), xi)*sxi; - END; - END; - -% Compute the sensitivity of the RHS of the cse -matrix MTTssEdx(MTTNx,1); -FOR ii := 1:MTTNx DO -BEGIN - % First with respect to theta - FOR kk := 1:mtt_n_par DO - BEGIN - mttpar_k := mttpar(kk,1); - mttcoef_k := mttcoef(kk,1); - MTTssEdx(ii,1) := MTTssEdx(ii,1) + df(MTTEdx(ii,1), mttpar_k)*mttcoef_k; - END; -% Then with respect to x - FOR i := 1:MTTNx DO - BEGIN - xi := mkid(MTTx,i); - sxi := mkid(MTTsx,i); - MTTssEdx(ii,1) := MTTssEdx(ii,1) + df(MTTEdx(ii,1), xi)*sxi; - END; -END; - -% Sensitivity output function -matrix MTTssY(MTTNy,1); -FOR ii := 1:MTTNy DO -BEGIN - % First with respect to theta - FOR kk := 1:mtt_n_par DO - BEGIN - mttpar_k := mttpar(kk,1); - mttcoef_k := mttcoef(kk,1); - MTTssY(ii,1) := MTTssY(ii,1) + df(MTTY(ii,1), mttpar_k)*mttcoef_k; - END; -% Then with respect to x - FOR i := 1:MTTNx DO - BEGIN - xi := mkid(MTTx,i); - sxi := mkid(MTTsx,i); - MTTssY(ii,1) := MTTssY(ii,1) + df(MTTY(ii,1), xi)*sxi; - END; -END; - - -% Now reorganise everything into composite system -% - odd rows are the system -% - even rows are the sensitivity system -% NB at this stage, the states are numbered incorrectly - sorted out below. - -%E matrix -matrix MTTsE(MTTNx2,MTTNx2); -FOR i := 1:MTTNx DO - FOR j := 1:MTTNx DO - BEGIN - MTTsE(2*i-1,2*j-1) := MTTE(i,j); % System - MTTsE(2*i,2*j) := MTTE(i,j); % Sensitivity system - MTTsE(2*i,2*j-1) := MTTssE(i,j); % Sensitivity system - END; - -%dX matrix -matrix MTTsEdX(MTTNx2,1); - -FOR i := 1:MTTNx DO -BEGIN - MTTsEdX(2*i-1,1) := MTTEdx(i,1); - MTTsEdX(2*i,1) := MTTssEdx(i,1); -END; - -%Y matrix -matrix MTTsY(MTTNy2,1);%dX matrix -matrix MTTsEdX(MTTNx2,1); - -FOR i := 1:MTTNx DO -BEGIN - MTTsEdX(2*i-1,1) := MTTEdx(i,1); - MTTsEdX(2*i,1) := MTTssEdx(i,1); -END; - - -FOR i := 1:MTTNy DO -BEGIN - MTTsY(2*i-1,1) := MTTY(i,1); - MTTsY(2*i,1) := MTTssY(i,1); -END; - - - - -OFF nat; - -OUT "$system_scse"; - -write "%File: $system_scse"; - -% Constants - -write "% New constants"; -write "MTTNx := ", MTTNx2, ";"; -write "MTTNy := ", MTTNy2, ";"; - -% E matrix -MTT_Matrix := MTTsE$ -MTT_Matrix_name := "MTTE"$ -MTT_Matrix_n := MTTNx2$ -MTT_Matrix_m := MTTNx2$ -Reduce_Matrix()$ - -% State derivative -MTT_Matrix := MTTsEdX$ -MTT_Matrix_name := "MTTEdX"$ -MTT_Matrix_n := MTTNx2$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Output -MTT_Matrix := MTTsY$ -MTT_Matrix_name := "MTTY"$ -MTT_Matrix_n := MTTNy2$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -write "END;"; - -SHUT "$system_scse"; -quit; -EOF - -# Now invoke the standard error handling. -mtt_error_r cse2scse_r.log - - -## Now reorganise the states -mv -f $system_scse mtt_junk - - -##echo "Nx = $Nx" -gawk '{ - ## Make sure all MTTn variables are followed by a space - gsub(/mttx[0-9]*/, "& "); - - for (i=Nx;i>0;i--) { - - state = sprintf("mttx%i ",i); - newstate = sprintf("mttx%i ",2*i-1); - sstate = sprintf("mttsx%i",i); - newsstate = sprintf("mttx%i",2*i); - - gsub(state,newstate); - gsub(sstate,newsstate); - - } - print $0 -}' Nx=$Nx $system_scse - - - - - - DELETED mttroot/mtt/bin/trans/cse2smx_lang Index: mttroot/mtt/bin/trans/cse2smx_lang ================================================================== --- mttroot/mtt/bin/trans/cse2smx_lang +++ mttroot/mtt/bin/trans/cse2smx_lang @@ -1,232 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cse2smx_lang -# Constrained-state equation to state matrices with x vector -# Used for implicit integration -# Copyright (C) 2000 by Peter J. Gawthrop -## Modified from eailier version - - -# Args -## Now default to matrix form -matrix='yes' -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -noglobals) - noglobals='-noglobals'; - ;; - -parameters) - parameters='-parameters'; - ;; - -matrix) - matrix='yes'; - ;; - -optimise_global | -optimise_local ) - optimise='LOAD SCOPE; ON GENTRANOPT;'; - iname='INAME mtt_o;'; - ;; - -fixcc ) - fix_mtt_pow='FOR ALL x,y LET x^y = mtt_pow(x,y);' - operator='OPERATOR mtt_pow;' - blurb2='fixing c and cc code'; - unfix_mtt_pow='FOR ALL x,y CLEAR x^y;' - unfix_pow='FOR ALL x,y LET pow(x,y) = x^y;'; - ;; - *) - echo $1 is an unknown option - exit;; - esac - shift -done - -## Representation -if [ -z $1 ]; then - echo 'usage [options] cse2smx_lang system [smx|smxa|smxax]' - exit -fi - - -# Language -if [ -n "$3" ]; then - lang=$3 -else - lang="m" -fi - -## Representation -if [ -z $2 ]; then - rep=smx; -else - rep=$2 -fi - -case $rep in - smx) - nrep=0; - out='[mtta,mttax]'; - nmatrix=1; - ;; - smxa) - nrep=1; - if [ -n "$matrix" ]; then - blurb="in matrix form"; - nmatrix=1; - else - blurb="in vector form"; - nmatrix=0; - fi - out='mtta'; - ;; - smxax) - nrep=2 - out='mttax'; - nmatrix=0; - ;; - *) echo Representation $2 not recognised; - exit;; -esac - - -# Inform user -if [ -n "$optimise" ]; then - blurbopt=' using code optimisation' -fi - -echo Creating $1_$rep.$lang $blurb $blurbopt $blurb2 -#echo Creating $1_smxx.$lang -#echo Creating $1_smxtx.$lang - -# Remove the old log file -rm -f cse2smx_r.log -rm -f $1_smx.$lang -rm -f $1_smxx.$lang -rm -f $1_smxtx.$lang -rm -f $1_$rep.body - -# Use reduce to accomplish the transformation -$SYMBOLIC << EOF >cse2smx_lang.log - -${operator} %% Define mtt_pow if needed -lang := $lang; - -in "$1_subs.r"; -in "$1_def.r"; -in "$1_cse.r"; -in "$1_cr.r"; - - -clear mttx; % Dont need this now - use mkid instead - -OFF Echo; - -% Load the general translator package -LOAD GENTRAN; -GENTRANLANG!* := 'Pascal; -ON GENTRANSEG; % Segmentation - -OFF GENDECS; % No declarations -MAXEXPPRINTLEN!* := 80; -TEMPVARNUM!* := 1; -TEMPVARNAME!* := 'mtt_tmp; -%% ' -% Optimise -$optimise - - -ON GETDECS; % Create decrarations automatically -DEFTYPE!* := 'REAL; % and default to real - -%%% The following is a bug fix from ZIB to fix -%%% segmentation violation problem -symbolic procedure maxtype type; -% ------------------------------------------------------------------- ; -% A type may be a pair (l u) wher l is the minimum type for a variable; -% and u is the maximum type. This procedure returns the maximum type.; -% ------------------------------------------------------------------- ; - if atom type - then type - else if pairp cdr type then cadr type else car type; - -% This fix handles the case that the type is a list with ONE entry. -% Should never happen ?? W.N. -%%%%%% End of bug fix - -%Set up output according to the language. - OFF NAT; - GENTRANOUT "$1_$rep.body"; - -% Set up output according to the language. - IF (lang = r) THEN - BEGIN - write "matrix mtta(", mttnx, ",", mttnx, ");"; - write "matrix mttb(", mttnx, ",", mttnu, ");"; - write "matrix mttc(", mttny, ",", mttnx, ");"; - write "matrix mttd(", mttny, ",", mttnu, ");"; - END; - - ${unfix_pow} %% set pow(x,y) to x^y - -% find MTTA : the A matrix - FOR i := 1:MTTNx DO - BEGIN - mttAAx_i := 0; - FOR j := 1:MTTNx DO - BEGIN - ${unfix_mtt_pow} %% Revert to x^y form - ij := i + MTTNx*(j-1); - xj := mkid(mttx,j); - a_ij := df(MTTEdx(i,1), xj, 1); - aa_ij := MTTE(i,j) - mttt*a_ij; - ${fix_mtt_pow} %% set x^y to mtt_pow(x,y) - IF (aa_ij NEQ 0) THEN - IF ($nmatrix EQ 1) THEN - BEGIN - %% Write a with full indexing - $iname - GENTRAN mtta(i,j) ::=: aa_ij; - END; - IF (($nmatrix EQ 0) AND ($nrep EQ 1)) THEN - BEGIN - %% Write a with vector indexing - $iname - GENTRAN mtta(ij) ::=: aa_ij; - END; - mttAAx_i := mttAAx_i + aa_ij*xj; - END; - IF (mttAAx_i NEQ 0) THEN - IF (($nrep EQ 0) OR ($nrep EQ 2)) THEN - BEGIN - $iname - GENTRAN mttax(i) ::=: mttAAx_i; - END; - - - END; - - -%Shut the output according to the language. - GENTRANSHUT "$1_$rep.body"; -EOF - -fix_broken_numbers ( ) { - sed -e "/[0-9.]$/ N" -e "s/\([0-9.]\)[\n\t\ ]*\([0-9]\)/\1\2/g" -} - -refix_pow() { - sed 's/mtt_pow/pow/g' -} - -if [ "$lang" = "m" ]; then -# lang_header $noglobals $parameters $1 $rep m 'mttx,mttu,mttt,mttpar' $out > $1_$rep.m - mtt_header $1 $rep m > $1_$rep.m - cat $1_$rep.body | fix_broken_numbers | refix_pow | mtt_p2m >> $1_$rep.m - echo "## END Code" >> $1_$rep.m - echo "endfunction" >> $1_$rep.m -fi - -# Now invoke the standard error handling. -mtt_error_r cse2smx_lang.log DELETED mttroot/mtt/bin/trans/cse_r2m Index: mttroot/mtt/bin/trans/cse_r2m ================================================================== --- mttroot/mtt/bin/trans/cse_r2m +++ mttroot/mtt/bin/trans/cse_r2m @@ -1,109 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cse_r2m -# Reduce constrained-state to simulab constrained-state equations -# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994. -# Copyright (c) P.J.Gawthrop 1991, 1994. - -# Output must be filtered by matlab_tidy. - -#Inform user -echo Creating $1_cse.m - -# Remove the old log file -rm -f cse_r2m.log - -# Use reduce to accomplish the transformation -reduce >cse_r2m.log << EOF - -%Read the reduce definitions file -in "$1_def.r"; - -%Read the reduce constrained-state equations file -in "$1_cse.r"; - -%Read the reduce substitution file -in "$1_subs.r"; - -%Set up the number of argument variables to zero in case the user has forgotten -MTTNVar := 0; - -%Read the parameter file -%%in "$1_sympar.r"; - - -ON BigFloat, NumVal; -PRECISION 16; %Compatible with Matlab -OFF Nat; - -ON NERO; % Suppress zero elements - -OUT "$1_cse.m"; - -%Headings - Simulab style -%(Note. The ;; are deleted by for2mat) - -write "function [sys,x0] = $1_cse(t,x,u,flag,xInitial);"; - -IF MTTNvar>0 THEN -BEGIN - write "% Read in the parameters"; - write "global ...;;"; - FOR i := 1:MTTNvar DO - BEGIN - IF i0 THEN -FOR i := 1:MTTNu DO -BEGIN - write "MTTu", i, " = u(", i, ");"; -END; -write "end;"; - -%Fortran switches - one line expressions -OFF echo; -ON fort$ -cardno!* := 1$ -fortwidth!* := 100$ -OFF period$ - -write "if abs(flag) == 1 %State derivative"; - -write "MTTE = zeros(", MTTNx, ",", MTTNx, ");"; -MTTE := MTTE; -MTTEdx := MTTEdx; -write "sys = MTTE\MTTEdx;"; - -write "elseif abs(flag) == 3 %Outputs"; -MTTy := MTTy; -write "sys = MTTy;"; - -write "elseif abs(flag) == 0 %Structure"; -write " sys = [", MTTNx, ",0,", MTTNy, ",", MTTNu, ",0,0]"; -write " if nargin<5; xInitial = zeros(", MTTNx, ",1); end;"; -write " x0 = xInitial;"; -write "end;"; -SHUT "$1_cse.m"; - DELETED mttroot/mtt/bin/trans/cse_r2tex Index: mttroot/mtt/bin/trans/cse_r2tex ================================================================== --- mttroot/mtt/bin/trans/cse_r2tex +++ mttroot/mtt/bin/trans/cse_r2tex @@ -1,132 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: cse_r2tex -# Reduce constrained-state to LaTex constrained-state equations. -# P.J.Gawthrop 10th May 199, 8th August 1991, April 1994, Jan 1995 -# Copyright (c) P.J.Gawthrop, 1991, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2000/08/24 11:48:55 peterg -## Include _subs file -## -## Revision 1.5 1999/11/22 23:44:47 peterg -## Now does scse as well -## -## Revision 1.4 1999/11/22 23:04:08 peterg -## *** empty log message *** -## -# Revision 1.3 1996/11/12 09:53:59 peterg -# Reads in the params.r file now. -# -# Revision 1.2 1996/11/12 09:11:20 peterg -# Removed all the hoorrible name changes -# -# Revision 1.1 1996/11/05 09:19:28 peterg -# Initial revision -# -############################################################### - -#Inform user -echo Creating $1_$2.tex - -# Remove the old log file -rm -f cse_r2tex.log - -# Use reduce to accomplish the transformation -reduce >cse_r2tex.log << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the parameter file -%%in "$1_params.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the constrained-state equations file -in "$1_$2.r"; - -OFF Echo; -OFF Nat; - -OUT "$1_$2.tex"; - -%Write out the constrained-state equations. - -write "%File: $1_$2.tex"; - -write "%constrained-state equations"; - IF MTTNx>0 THEN - FOR Row := 1:MTTNx DO - BEGIN - write"\begin{equation}"; - write "\dot MTTEX", Row, " = "; - write "{"; - write MTTEdX(Row,1); - write "}"; - write"\end{equation}"; - END; - - - - IF MTTNy>0 THEN - FOR Row := 1:MTTNy DO - BEGIN - write"\begin{equation}"; - write "MTTy", Row, " = "; - write "{"; - write MTTy(Row,1); - write "}"; - write"\end{equation}"; - END; - - -IF MTTNx NEQ 0 THEN -BEGIN -write "% - E matrix"; -write "\begin{equation}"; -write "MTTE = \begin{pmatrix}"; - FOR Row := 1:MTTNx DO - BEGIN - FOR Col := 1:MTTNx DO - BEGIN - Write "{", MTTE(Row,Col), "}"; - IF Colcsm2sm_r.log << EOF - -in "$1_def.r"; -in "$1_$rep.r"; -in "$1_cr.r"; -%%in "$1_sympar.r"; - -OFF Echo; -OFF Nat; - -% Find MTTA and MTTB : the A and B matrices - -MTTinvE := MTTE^(-1); -MTTA := MTTinvE*MTTA; -MTTB := MTTinvE*MTTB; - -% Create the matrix declarations -OUT "$1_$2.r1"; -write "MATRIX MTTA(", MTTNx, ",", MTTNx, ")$"; -write "MATRIX MTTB(", MTTNx, ",", MTTNu, ")$"; -write "MATRIX MTTC(", MTTNy, ",", MTTNx, ")$"; -write "MATRIX MTTD(", MTTNy, ",", MTTNu, ")$"; -SHUT "$1_$2.r1"; - -%Create the output file -OUT "$1_$2.r2"; -write "%File: $1_ode.r"; - -write "% New constants"; -write "MTTNx := ", MTTNx, ";"; -write "MTTNy := ", MTTNy, ";"; - -in ("$1_sm_write.r"); - -%Write out the matrices. -% IF MTTNx>0 THEN -% BEGIN -% write "matrix MTTA(", MTTNx, ",", MTTNx, ");"; -% FOR i := 1:MTTNx DO -% FOR j := 1:MTTNx DO IF MTTA(i,j) NEQ 0 THEN -% write "MTTA(", i, ",", j, ") := ", MTTA(i,j); -% END; - -% IF MTTNx>0 THEN -% IF MTTNu>0 THEN -% BEGIN -% write "matrix MTTB(", MTTNx, ",", MTTNu, ");"; -% FOR i := 1:MTTNx DO -% FOR j := 1:MTTNu DO IF MTTB(i,j) NEQ 0 THEN -% write "MTTB(", i, ",", j, ") := ", MTTB(i,j); -% END; - -% %Write it out -% IF MTTNy>0 THEN -% IF MTTNx>0 THEN -% BEGIN -% write "matrix MTTC(", MTTNy, ",", MTTNx, ");"; -% FOR i := 1:MTTNy DO -% FOR j := 1:MTTNx DO IF MTTC(i,j) NEQ 0 THEN -% write "MTTC(", i, ",", j, ") := ", MTTC(i,j); -% END; - -% IF MTTNy>0 THEN IF MTTNu>0 THEN -% BEGIN -% write "matrix MTTD(", MTTNy, ",", MTTNu, ");"; -% FOR i := 1:MTTNy DO -% FOR j := 1:MTTNu DO IF MTTD(i,j) NEQ 0 THEN -% write "MTTD(", i, ",", j, ") := ", MTTD(i,j); -% END; - -write "END;"; - -SHUT "$1_$2.r2"; -quit; - -EOF - -cat $1_$2.r1 $1_$2.r2 > $1_$2.r - -if [ ${optimise:-""} = "-optimise_global" ]; then - mtt_optimise global $1 $2 -elif [ ${optimise:-""} = "-optimise_local" ]; then - mtt_optimise local $1 $2 -fi - -# Now invoke the standard error handling. -mtt_error_r csm2sm_r.log DELETED mttroot/mtt/bin/trans/csm_r2m Index: mttroot/mtt/bin/trans/csm_r2m ================================================================== --- mttroot/mtt/bin/trans/csm_r2m +++ mttroot/mtt/bin/trans/csm_r2m @@ -1,114 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: csm_r2m -# Reduce constained state-space A,B,C,D and E matrices to Matlab -# P.J.Gawthrop July 1990, Feb 1991, May 1991, Sep 91, Dec 93, Jan 94, May 94. -# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1996/08/19 18:40:02 peter -## read in the nuim_par function etc. -## -## Revision 1.1 1996/08/19 16:27:04 peter -## Initial revision -## -############################################################### - -# Inform user -echo Creating $1_$2.m - -# Remove the old log file -rm -f csm_r2m.log - -# Use reduce to accomplish the transformation -reduce >csm_r2m.log << EOF - -%Read in the definitions file -in "$1_def.r"; - -%Read the reduce state-space A,B,C and D matrices file -in "$1_$2.r"; - -%Set up the number of argument variables to zero in case the user has forgotten -MTTNVar := 0; - -%Read in the parameter file -%%in "$1_sympar.r"; - - -OUT "$1_$2.m"; - -%Headings - Matlab style -%(Note. The ;; are deleted by for2mat) - -IF MTTNvar>0 THEN -BEGIN - write "function [MTTA,MTTB,MTTC,MTTD,MTTE] = $1_$2(..."; - FOR i := 1:MTTNvar DO - BEGIN - IF i0 THEN -BEGIN - write "%function [MTTA,MTTB,MTTC,MTTD,MTTE] = $1_$2(..."; - FOR i := 1:MTTNvar DO - BEGIN - IF i0 THEN -BEGIN - write "% Read in the parameters"; - write "[ ...;;"; - FOR i := 1:MTTNvar DO - BEGIN - IF icsm_r2tex.log << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the constrained-state matrices file -in "$1_$2.r"; - -%Read the symbolic parameters file -%%in "$1_sympar.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; - -OUT "$1_$2.tex"; - -%Write out the constrained-state matrices. -write "%constrained-state matrices $1"; -write "%File: $1_$2.tex"; -write""; - -write "%constrained-state matrices"; - -MTT_Matrix := MTTA$ -MTT_Matrix_name := "MTTA"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTB$ -MTT_Matrix_name := "MTTB"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTC$ -MTT_Matrix_name := "MTTC"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTD$ -MTT_Matrix_name := "MTTD"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTE$ -MTT_Matrix_name := "MTTE"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -SHUT "$1_$2.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/ctf_r2tex Index: mttroot/mtt/bin/trans/ctf_r2tex ================================================================== --- mttroot/mtt/bin/trans/ctf_r2tex +++ mttroot/mtt/bin/trans/ctf_r2tex @@ -1,67 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ctf_r2tex -# Reduce constrained-state matrices to LaTex constrained-state matrices. -# P.J.Gawthrop January 8th 1997 -# Copyright (c) P.J.Gawthrop, 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -# Inform user -echo Creating $1_ctf.tex - -# Remove the old log file -rm -f ctf_r2tex.log - -# Use reduce to accomplish the transformation -reduce >ctf_r2tex.log<< EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the smconical-form matrices file -in "$1_ctf.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; -OFF EXP; -%ON Rounded; -%Precision 5; - - -OUT "$1_ctf.tex"; - -%Write out the canonical matrices -write "%Controler TF $1"; -write "%File: $1_ctf.tex"; -write""; - -MTT_Matrix := MTTcTF$ -MTT_Matrix_name := "MTTcTF"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := MTTNy$ -Latex_Matrix()$ - - -SHUT "$1_ctf.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/dae2cse_r Index: mttroot/mtt/bin/trans/dae2cse_r ================================================================== --- mttroot/mtt/bin/trans/dae2cse_r +++ mttroot/mtt/bin/trans/dae2cse_r @@ -1,542 +0,0 @@ -#! /bin/sh - - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dae2cse_r -# Differential-algebraic equations to constrained-state equations -# P.J.Gawthrop 14 June 1991, 8 Aug 1991, 2 April 1992, 14 April 1994, 28 Dec 94 -# Copyright (c) P.J.Gawthrop 1991, 1992, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.28 2005/09/07 17:04:12 geraint -## Fixes chi for cse representation. -## -## Revision 1.27 2005/03/21 11:50:39 gawthrop -## Don't write an empty cseo file -## -## Revision 1.26 2002/10/28 23:31:21 gawthrop -## Added additional term to MTTEdx to account for zdot terms on -## Right-Hand Side state equations -## -## Revision 1.25 2002/09/18 19:46:48 geraint -## Refined test to reduce shell loop overhead for unnecessary E matrix. -## Removed unnecessary attempt to optimise cse. -## Fixes sm representation. -## -## Revision 1.24 2002/09/16 08:08:00 geraint -## Merged changes from global-optimisation branch. -## -## Revision 1.23.2.3 2002/09/12 18:50:50 geraint -## Uncommented cse optimisations - they seem to work ok. -## -## Revision 1.23.2.2 2002/09/10 23:24:19 geraint -## Rationalised local and global optimisations. -## Fixes presentation of locally optimised code (ode view). -## Much more elegant :-) -## -## Revision 1.23.2.1 2002/09/03 23:44:43 geraint -## adding global optimisation (-optg). -## -## Revision 1.23 2002/07/10 17:43:05 geraint -## Added feature [ 562453 ] Optimisation of algebraic equations. -## -## Revision 1.22 2002/06/28 15:35:47 geraint -## Commented out aej.r generation (not used yet). -## -## Revision 1.21 2002/06/28 10:13:40 geraint -## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. -## -## Revision 1.20.2.1 2002/06/05 11:14:50 geraint -## ae.r now generated using def2write_r like cse?.r -## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r. -## -## Revision 1.20 2002/04/28 18:41:26 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.19 2001/10/26 01:01:49 geraint -## fixcc when rdae_is_dae (-cr). -## -## Revision 1.18 2001/10/05 23:37:32 geraint -## Fixed assignment statement in ae.r when RHS=0. -## -## Revision 1.17 2001/07/27 23:29:10 geraint -## Optimises only when requested (-opt). -## -## Revision 1.16 2001/07/13 04:54:04 geraint -## Branch merge: numerical-algebraic-solution back to main. -## -## Revision 1.15.2.4 2001/06/26 00:55:48 geraint -## Writes algebraic equation Jacobian _aej.r (not used yet). -## -## Revision 1.15.2.3 2001/05/09 00:19:22 geraint -## Fixed EOF error when MTTNYZ=0. -## -## Revision 1.15.2.2 2001/05/05 20:50:16 geraint -## Fixed errors when MTTNx=0. -## -## Revision 1.15.2.1 2001/05/04 04:07:24 geraint -## Numerical solution of algebraic equations. -## sys_ae.cc written for unsolved inputs. -## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). -## -## Revision 1.15 2001/03/19 02:28:52 geraint -## Branch merge: merging-ode2odes-exe back to MAIN. -## -## Revision 1.14.2.1 2001/03/19 00:29:08 geraint -## Parse switches (-A) before calling def2write_r. -## Update $1_def.* instead of removing. -## -## Revision 1.14 2000/12/28 12:24:35 peterg -## *** empty log message *** -## -## Revision 1.13 2000/10/11 08:52:46 peterg -## Creates csex (cse with dxe only) rep. -## -## Revision 1.12 2000/10/10 21:00:58 peterg -## New code genration -## -## Revision 1.11 1998/11/26 09:18:55 peterg -## Incluse subs.r -## -## Revision 1.10 1998/11/18 13:50:29 peterg -## Removed writeing of EYz matrix -## -## Revision 1.9 1998/11/18 10:53:38 peterg -## Put in some more "IF MTTNx>0 THEN" to avoid error messages when no -## states. -## -## Revision 1.8 1998/11/10 08:54:34 peterg -## Put in "IF MTTNx>0 THEN" to prevent probs when Nx=0 -## -- still a couple of apparent error messages - but answers now -## correct -## -## Revision 1.7 1998/10/05 10:46:15 peterg -## Commented out redundant MTTY := MTTY + MTTEyx*MTTEdX; -## -## Revision 1.6 1998/07/19 12:44:35 peterg -## Set MTTYz := 0 if the array is empty - avoids irritating error -## message. -## -## Revision 1.5 1998/05/20 15:23:26 peterg -## Put MTTYz := MTTYz outsise the BEGIN/END -## -## Revision 1.4 1998/05/20 15:13:09 peterg -## Writes out algebraic equations (if any). -## -## Revision 1.3 1998/03/03 09:02:46 peterg -## Replaced MTTEyx*MTTEdX + MTTEyu*MTTdu; term -## -## Revision 1.2 1997/08/26 08:22:36 peterg -## Changed -## MTTY := MTTY + MTTEyx*MTTdX + MTTEyu*MTTdu; -## to -## MTTY := MTTY + MTTEyx*MTTEdX + MTTEyu*MTTdu; -## -## This sorts out the problem when dz appears in the output equation. -## -## Revision 1.1 1997/08/26 08:20:18 peterg -## Initial revision -## -## Revision 1.2 1996/08/25 09:57:30 peter -## Sorted out bug when MTTNz=0 -## -## Revision 1.1 1996/08/15 16:47:02 peter -## Initial revision -## -############################################################### - -#Explicit solution option and optimise option -solve=0; solve_msg='' -optimise=''; optimise_msg='' -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -A ) - solve=1 - solve_msg=' with explicit solution of algebraic equations' ;; - -fixcc ) - fixcc='-fixcc' - include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` - fix_msg='fixing c and cc code'; - ;; - -optimise_global ) - optimise='-optimise_global' - optimise_msg=' with global optimisation' ;; - -optimise_local ) - optimise='-optimise_local' - optimise_msg=' with local optimisation' ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -# Create the reduce output code -def2write_r $fixcc $1 ae -def2write_r $fixcc $1 cse -def2write_r $fixcc $1 csex # Version without E matrix -def2write_r $fixcc $1 cseo - -echo "Creating $1_ae.r $optimise_msg" -echo "Creating $1_cse.r $solve_msg $optimise_msg $fix_msg" -echo "Creating $1_csex.r $optimise_msg" -echo "Creating $1_cseo.r $optimise_msg" - -# Remove the old log file -rm -f dae2cse_r.log - -# Remove some files -rm -f $1_ae.r? $1_cse.r? $1_cseo.r? - -# Use reduce to accomplish the transformation -$SYMBOLIC >dae2cse_r.log << EOF - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - -OFF Echo; -OFF Nat; -ON NERO; - -%Fix c code if required -$include - -in "$1_def.r"; -MTTdxs := MTTdX; %Save the symbolic form of dX - -in "$1_subs.r"; -in "$1_dae.r"; - - -%Create F_x, F_y matrices - assumming equations are -% linear in dZ -IF MTTNz>0 THEN -BEGIN - -IF MTTNx>0 THEN -BEGIN - -% Find MTTFx; -write "% Find MTTFx;"; - -matrix MTTFx(MTTNx,MTTNz); -FOR j := 1:MTTNz DO - BEGIN - dzj := MTTdZ(j,1); - FOR i := 1:MTTNx DO - MTTFx(i,j) := df(MTTdX(i,1), dzj, 1); - END; - -END; - -% Find MTTFy; -write "% Find MTTFy;"; - -matrix MTTFy(MTTNy,MTTNz); -FOR j := 1:MTTNz DO - BEGIN - dzj := MTTdZ(j,1); - FOR i := 1:MTTNy DO - MTTFy(i,j) := df(MTTy(i,1), dzj, 1); - END; - -%Create G_x, G_u matrices -write "%Create G_x, G_u matrices "; - - -% Find MTTGx; -IF MTTNx>0 THEN -BEGIN -write "% Find MTTGx;"; - -matrix MTTGx(MTTNz,MTTNx); -FOR j := 1:MTTNx DO - BEGIN - xj := MTTX(j,1); - FOR i := 1:MTTNz DO - MTTGx(i,j) := df(MTTZ(i,1), xj, 1); - END; -END; - -% Find MTTGu; -write "% Find MTTGu;"; - -matrix MTTGu(MTTNz,MTTNu); -FOR j := 1:MTTNu DO - BEGIN - uj := MTTu(j,1); - FOR i := 1:MTTNz DO - MTTGu(i,j) := df(MTTZ(i,1), uj, 1); - END; - -%Create E matrices -write "%Create E matrices"; - -IF MTTNx>0 THEN -BEGIN -matrix MTTExx(MTTNx,MTTNx); MTTExx := MTTFx*MTTGx; -matrix MTTExu(MTTNx,MTTNu); MTTExu := MTTFx*MTTGu; -matrix MTTEyx(MTTNy,MTTNx); MTTEyx := MTTFy*MTTGx; -matrix MTTE(MTTNx,MTTNx); MTTE := MTTI - MTTExx; -END; -matrix MTTEyu(MTTNy,MTTNu); MTTEyu := MTTFy*MTTGu; - - - - - %% The following gets rid of the dZs; there must be a better way. - MTTdZ1 := 0; - MTTdZ2 := 0; - MTTdZ3 := 0; - MTTdZ4 := 0; - MTTdZ5 := 0; - MTTdZ6 := 0; - MTTdZ7 := 0; - MTTdZ8 := 0; - MTTdZ9 := 0; - MTTdZ10 := 0; - MTTdZ11 := 0; - MTTdZ12 := 0; - MTTdZ13 := 0; - MTTdZ14 := 0; - MTTdZ15 := 0; - MTTdZ16 := 0; - MTTdZ17 := 0; - MTTdZ18 := 0; - MTTdZ19 := 0; - -IF MTTNx>0 THEN -BEGIN -MTTEdX := MTTdX; %Ie MTTEdX is MTTdX with the dz terms deleted ie EdX. -MTTdX := MTTdXs; %Restore the symbolic dX - -%% Add on input derivative terms -MTTEdX := MTTEdX + MTTExu*MTTdu; -%% Add on output derivative terms -MTTEdx := MTTEdX + MTTEyx*(MTTE^(-1))*MTTEdX; -END; - - -%%%%%MTTY := MTTY + MTTEyx*MTTEdX; -%%% This causes the matrix mismatch -%%% MTTdXs and MTTdu need setting in _def.r file -MTTY := MTTY + MTTEyu*MTTdu; - -IF MTTNx>0 THEN - MTTY := MTTY + MTTEyx*(MTTE^(-1))*MTTEdX; - - -END; %%of MTTNz>0 - -IF MTTNz=0 THEN -BEGIN - MTTEdX := MTTdX; - MTTE := MTTI; -END; - -IF (MTTNyz>0) AND ($solve>0) THEN -BEGIN - %%%% Try and solve algebraic loops!! - - %Create list of the relevant equations - MTT_eqns := {}; - FOR i := 1:MTTNyz DO - MTT_eqns := append(MTT_eqns,{MTTyz(i,1)}); - - %Create list of the relevant unknowns - MTT_unknowns := {}; - FOR i := 1:MTTNyz DO - MTT_unknowns := append(MTT_unknowns,{MTTUi(i,1)}); - - %Solve the algebraic equations symbolically - MTT_sol := solve(MTT_eqns,MTT_unknowns); - %The result seems to be in an extra list - I dont know why - % So remove the outer list with first. - % But only if more than one list element! - - if MTTNyz>1 THEN - MTT_sol := first(MTT_sol); - - %Substitute back into the equations - FOR i := 1:MTTNyz DO - BEGIN - MTT_sol_i := first(MTT_sol); MTT_sol := rest(MTT_sol); - set(lhs(MTT_sol_i),rhs(MTT_sol_i)); - END; - - % No algebraic variables left! - MTTNYz := 0; -END; % IF MTTNyz>0 and $solve - -%OUT "$1_aej.r"; -%IF (MTTNyz>0) THEN % as above -%BEGIN -% WRITE "MATRIX MTTyzj(",MTTNyz,",",MTTNyz,")"; -% WRITE "%File: $1_aej.r"; -% FOR i := 1:MTTNyz DO -% FOR j := 1:MTTNyz DO -% BEGIN -% didj := df(MTTyz(i,1),mkid('mttui,j)); -% IF (didj NEQ 0) THEN -% WRITE "MTTyzj(",i,",",j,") := ",didj," +0"; -% END; -%END; -%WRITE ";END;"; -%SHUT "$1_aej.r"; - -IF MTTNyz>0 THEN % not $solve or solution failed -BEGIN -OUT "$1_ae.r1"; -write "MATRIX MTTYZ(", MTTNyz, ",", 1, ")$"; -SHUT "$1_ae.r1"; -END; -OUT "$1_ae.r2"; -write "%File: $1_ae.r"; -in ("$1_ae_write.r"); -write "END;"; -SHUT "$1_ae.r2"; - -% Create the matrix declarations -OUT "$1_cse.r1"; -write "%"; -IF (MTTNx > 0) THEN -BEGIN - write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$"; - write "MATRIX MTTE(", MTTNx, ",", MTTNx, ")$"; -END; -SHUT "$1_cse.r1"; - -OUT "$1_csex.r1"; -write "%File:$1_csex.r1"; -IF (MTTNx > 0) THEN - write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$"; -SHUT "$1_csex.r1"; - -IF MTTNy>0 THEN -BEGIN - OUT "$1_cseo.r1"; - write "MATRIX MTTY(", MTTNy, ",", 1, ")$"; - SHUT "$1_cseo.r1"; -END; - -%%Create the _cse.r file -OUT "$1_cse.r2"; -write "%File: $1_cse.r"; -in ("$1_cse_write.r"); -write "in ""$1_cseo.r"";"; -write "END;"; - -% % State derivative -% MTT_Matrix := MTTEdX$ -% MTT_Matrix_name := "MTTEdX"$ -% MTT_Matrix_n := MTTNx$ -% MTT_Matrix_m := 1$ -% Reduce_Matrix()$ - -% % Output -% MTT_Matrix := MTTY$ -% MTT_Matrix_name := "MTTY"$ -% MTT_Matrix_n := MTTNy$ -% MTT_Matrix_m := 1$ -% Reduce_Matrix()$ - -% % Inputs -% MTT_Matrix := MTTU$ -% MTT_Matrix_name := "MTTU"$ -% MTT_Matrix_n := MTTNu$ -% MTT_Matrix_m := 1$ -% Reduce_Matrix()$ -% MTT_Matrix := MTTdU$ -% MTT_Matrix_name := "MTTdU"$ -% MTT_Matrix_n := MTTNu$ -% MTT_Matrix_m := 1$ -% Reduce_Matrix()$ - -% % E matrix -% MTT_Matrix := MTTE$ -% MTT_Matrix_name := "MTTE"$ -% MTT_Matrix_n := MTTNx$ -% MTT_Matrix_m := MTTNx$ -% Reduce_Matrix()$ - -% % Eyx matrix -% MTT_Matrix := MTTEyx$ -% MTT_Matrix_name := "MTTEyx"$ -% MTT_Matrix_n := MTTNy$ -% MTT_Matrix_m := MTTNx$ -% %Reduce_Matrix()$ - -% % Yz -% MTT_Matrix := MTTYz$ -% MTT_Matrix_name := "MTTYz"$ -% MTT_Matrix_n := MTTNyz$ -% MTT_Matrix_m := 1$ -% Reduce_Matrix()$ - -write ";END;"; - -SHUT "$1_cse.r2"; - -OUT "$1_csex.r2"; -write "%File: $1_cse.r"; -in ("$1_csex_write.r"); -write "END;"; -SHUT "$1_csex.r2"; - -%Write out the output equations -OUT "$1_cseo.r2"; -write "%File: $1_cseo.r"; -IF MTTNy>0 THEN - in ("$1_cseo_write.r"); -write "END;"; -SHUT "$1_cseo.r2"; -quit; -EOF - -touch $1_ae.r1 $1_ae.r2 -touch $1_cseo.r1 -touch $1_cseo.r2 -cat $1_ae.r1 $1_ae.r2 > $1_ae.r -cat $1_cse.r1 $1_cse.r2 > $1_cse.r -cat $1_csex.r1 $1_csex.r2 > $1_csex.r -cat $1_cseo.r1 $1_cseo.r2 > $1_cseo.r - -if [ ${optimise:-""} = "-optimise_global" ]; then - mtt_optimise global $1 ae - mtt_optimise global $1 cseo - mtt_optimise global $1 csex -elif [ ${optimise:-""} = "-optimise_local" ]; then - mtt_optimise local $1 ae - mtt_optimise local $1 cseo - mtt_optimise local $1 csex -fi - -if [ "$solve" = "1" ]; then - echo "Setting MTTNyz=0 in $1_def.r and updating other $1_def files" - gawk '{ - if ($1=="MTTNyz") - print "MTTNyz := 0;" - else print $0 - }' $1_def.r > mtt_junk - # Make sure it preserves the time stamp!! - # and remove dependent reps - touch -r $1_def.r mtt_junk - mv mtt_junk $1_def.r - for file in `ls $1_def.*`; do - if [ $file != $1_def.r ]; then - ext=`echo $file|gawk -F\. '{print $2}'` - mtt -q $1 def $ext - fi - done -fi - - -# Now invoke the standard error handling. -mtt_error_r dae2cse_r.log DELETED mttroot/mtt/bin/trans/dae2daes_m Index: mttroot/mtt/bin/trans/dae2daes_m ================================================================== --- mttroot/mtt/bin/trans/dae2daes_m +++ mttroot/mtt/bin/trans/dae2daes_m @@ -1,116 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dae2daesol_m - -# Transforms descriptor matrix rep to step response - -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 1998/05/14 08:14:28 peterg -## Now reads in data from the simpar file. -## -## Revision 1.5 1998/05/13 16:42:03 peterg -## Fixed various bugs etc. -## -# Revision 1.4 1996/08/24 14:27:59 peter -# Global parameters. -# Error handling. -# -## Revision 1.3 1996/08/18 12:00:19 peter -## Unified format of responses. -## -## Revision 1.2 1996/08/16 13:17:57 peter -## Changed default args to include nx+nz -## Fixed bug with vector outputs. -## -## Revision 1.1 1996/08/15 16:24:55 peter -## Initial revision -## -############################################################### - - -echo Creating $1_daes.m -echo Creating $1_daeso.m -rm -f dae2daes_m.log -rm -f $1_daes.m -rm -f $1_daeso.m - - -$MATRIX << EOF > dae2daes_m.log 2>mtt_error.txt - - %System structure - [nx,ny,nu,nz,nyz] = $1_def; - - % Number of descriptor "states" - NX = nx+2*nz+nyz; - - %Read in parameters - $1_numpar; - - %Read in state (needs redoing for descriptor xevtor - %x = $1_state; - - - %Read in simulation parameters - $1_simpar; - T = [0:DT:LAST]; - - t=0; %Just in case its in the parameter list - - %Defaults - if exist('T')==0 - T=[0:0.1:10] - end; - - if exist('x0')==0 - x0 = zeros(NX,1); - end; - - if exist('dx0')==0 - dx0 = zeros(NX,1); - end; - - [n,m]=size(T); - if m>n - T=T'; - end; - -if NX>0 - x = dassl("$1_dae", x0, dx0, T); - write_matrix([T,x], '$1_daes'); -else - x = zeros(size(T)); -end; - -if ny>0 - i=0; - Y = []; - for tt=T' - i=i+1; - y = $1_daeo(x(i,:),tt); - Y = [Y; y']; - end; - write_matrix([T,Y], '$1_daeso'); -end; - -EOF - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - - - - - - - DELETED mttroot/mtt/bin/trans/dae2daes_m Index: mttroot/mtt/bin/trans/dae2daes_m ================================================================== --- mttroot/mtt/bin/trans/dae2daes_m +++ mttroot/mtt/bin/trans/dae2daes_m @@ -1,116 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dae2daesol_m - -# Transforms descriptor matrix rep to step response - -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 1998/05/14 08:14:28 peterg -## Now reads in data from the simpar file. -## -## Revision 1.5 1998/05/13 16:42:03 peterg -## Fixed various bugs etc. -## -# Revision 1.4 1996/08/24 14:27:59 peter -# Global parameters. -# Error handling. -# -## Revision 1.3 1996/08/18 12:00:19 peter -## Unified format of responses. -## -## Revision 1.2 1996/08/16 13:17:57 peter -## Changed default args to include nx+nz -## Fixed bug with vector outputs. -## -## Revision 1.1 1996/08/15 16:24:55 peter -## Initial revision -## -############################################################### - - -echo Creating $1_daes.m -echo Creating $1_daeso.m -rm -f dae2daes_m.log -rm -f $1_daes.m -rm -f $1_daeso.m - - -$MATRIX << EOF > dae2daes_m.log 2>mtt_error.txt - - %System structure - [nx,ny,nu,nz,nyz] = $1_def; - - % Number of descriptor "states" - NX = nx+2*nz+nyz; - - %Read in parameters - $1_numpar; - - %Read in state (needs redoing for descriptor xevtor - %x = $1_state; - - - %Read in simulation parameters - $1_simpar; - T = [0:DT:LAST]; - - t=0; %Just in case its in the parameter list - - %Defaults - if exist('T')==0 - T=[0:0.1:10] - end; - - if exist('x0')==0 - x0 = zeros(NX,1); - end; - - if exist('dx0')==0 - dx0 = zeros(NX,1); - end; - - [n,m]=size(T); - if m>n - T=T'; - end; - -if NX>0 - x = dassl("$1_dae", x0, dx0, T); - write_matrix([T,x], '$1_daes'); -else - x = zeros(size(T)); -end; - -if ny>0 - i=0; - Y = []; - for tt=T' - i=i+1; - y = $1_daeo(x(i,:),tt)'; - Y = [Y; y']; - end; - write_matrix([T,Y], '$1_daeso'); -end; - -EOF - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - - - - - - - DELETED mttroot/mtt/bin/trans/dae2dm_r Index: mttroot/mtt/bin/trans/dae2dm_r ================================================================== --- mttroot/mtt/bin/trans/dae2dm_r +++ mttroot/mtt/bin/trans/dae2dm_r @@ -1,333 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dae2dm_r -# Differential-algebraic equation to linear descriptor matrices conversion -# P.J.Gawthrop 8th May 1991, 7 June 1991, April 1994. -# Copyright (c) P.J.Gawthrop, 1991, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 2005/03/21 11:44:06 gawthrop -## Avoid error messages when no inputs or no outputs or no states -## -## Revision 1.3 1998/07/27 20:25:36 peterg -## *** empty log message *** -## -# Revision 1.2 1996/08/25 09:53:35 peter -# Error handling added. -# -## Revision 1.1 1996/08/18 20:03:51 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_dm.r - -# Remove the old log file -rm -f dae2dm_r.log - -# Use reduce to accomplish the transformation -reduce >dae2dm_r.log << EOF - -in "$1_def.r"; -in "$1_dae.r"; -in "$1_cr.r"; -%%in "$1_sympar.r"; - -OFF Echo; -OFF Nat; - - -%Total number of descriptor variables -MTTN := MTTNx + 2*MTTNz + MTTNyz; - -IF MTTN>0 THEN -BEGIN -% Find MTTE : the E matrix -matrix MTTE(MTTN,MTTN); - -% First row partition -IF MTTNx>0 THEN - FOR j := 1:MTTNx DO - MTTE(j,j) := 1; - -% Second row partition - IF MTTNz>0 THEN - FOR j := 1:MTTNz DO - MTTE(j+MTTNx, j+MTTNx) := 1; - -% Find MTTA : the A matrix - -% First row partition: x -IF MTTN>0 THEN - BEGIN - matrix MTTA(MTTN,MTTN); - FOR j := 1:MTTNx DO - BEGIN - xj := MTTX(j,1); - FOR i := 1:MTTNx DO - MTTA(i,j) := df(MTTdX(i,1), xj, 1); - END; - - IF MTTNz>0 THEN - FOR j := 1:MTTNz DO - BEGIN - dzj := MTTdz(j,1); - FOR i := 1:MTTNx DO - MTTA(i, j + MTTNx + MTTNz) := df(MTTdX(i,1), dzj, 1); - END; - - IF MTTNyz>0 THEN - FOR j := 1:MTTNyz DO - BEGIN - uij := MTTUi(j,1); - FOR i := 1:MTTNx DO - MTTA(i, j + MTTNx + 2*MTTNz) := df(MTTdX(i,1), uij, 1); - END; - END; - -% Second row partition: z -IF MTTNz>0 THEN - FOR j := 1:MTTNz DO - MTTA(j + MTTNx, j + MTTNx + MTTNz) := 1; - -% Third row partition -IF MTTNz>0 THEN - BEGIN - IF MTTNx>0 THEN - FOR j := 1:MTTNx DO - BEGIN - xj := MTTX(j,1); - FOR i := 1:MTTNz DO - MTTA(i + MTTNx + MTTNz,j) := df(MTTZ(i,1), xj, 1); - END; - - FOR j := 1:MTTNz DO - MTTA(j + MTTNx + MTTNz, j + MTTNx) := -1; - - FOR j := 1:MTTNz DO - BEGIN - dzj := MTTdz(j,1); - FOR i := 1:MTTNz DO - MTTA(i + MTTNx + MTTNz, j + MTTNx + MTTNz) := df(MTTZ(i,1), dzj, 1); - END; - - IF MTTNyz>0 THEN - FOR j := 1:MTTNyz DO - BEGIN - uij := MTTUi(j,1); - FOR i := 1:MTTNz DO - MTTA(i+MTTNx+MTTNz, j+MTTNx+2*MTTNz) := df(MTTZ(i,1), uij, 1); - END; - END; - - -% Fourth row partition -IF MTTNyz>0 THEN - BEGIN - IF MTTNx>0 THEN - FOR j := 1:MTTNx DO - BEGIN - xj := MTTX(j,1); - FOR i := 1:MTTNyz DO - MTTA(i + MTTNx + 2*MTTNz,j) := df(MTTYz(i,1), xj, 1); - END; - - IF MTTNz>0 THEN - FOR j := 1:MTTNz DO - BEGIN - dzj := MTTdz(j,1); - FOR i := 1:MTTNyz DO - MTTA(i + MTTNx + 2*MTTNz, j + MTTNx + MTTNz) := df(MTTYz(i,1), dzj, 1); - END; - - IF MTTNyz>0 THEN - FOR j := 1:MTTNyz DO - BEGIN - uij := MTTUi(j,1); - FOR i := 1:MTTNyz DO - MTTA(i+MTTNx+2*MTTNz, j+MTTNx+2*MTTNz) := df(MTTYz(i,1), uij, 1); - END; - END; - -% Find MTTB : the B matrix - -IF MTTNu>0 THEN -BEGIN -matrix MTTB(MTTN,MTTNu); - -% First row partition -IF MTTNx>0 THEN - BEGIN - FOR j := 1:MTTNu DO - BEGIN - uj := MTTU(j,1); - FOR i := 1:MTTNx DO - MTTB(i,j) := df(MTTdX(i,1), uj, 1); - END; - END; - -% Third row partition -IF MTTNz>0 THEN - BEGIN - FOR j := 1:MTTNu DO - BEGIN - uj := MTTU(j,1); - FOR i := 1:MTTNz DO - MTTB(i + MTTNx + MTTNz ,j) := df(MTTZ(i,1), uj, 1); - END; - END; - -% Fourth row partition -IF MTTNyz>0 THEN - BEGIN - FOR j := 1:MTTNu DO - BEGIN - uj := MTTU(j,1); - FOR i := 1:MTTNyz DO - MTTB(i + MTTNx + 2*MTTNz,j) := df(MTTYz(i,1), uj, 1); - END; - END; - -END; - -% Find MTTC : the C matrix -IF MTTNy>0 THEN -BEGIN -matrix MTTC(MTTNy,MTTN); - -% First column partition -IF MTTNx>0 THEN - BEGIN - FOR i := 1:MTTNy DO - FOR j := 1:MTTNx DO - BEGIN - xj := MTTX(j,1); - MTTC(i,j) := df(MTTY(i,1), xj, 1); - END; - END; - -% Third column partition -IF MTTNz>0 THEN - BEGIN - FOR i := 1:MTTNy DO - FOR j := 1:MTTNz DO - BEGIN - dzj := MTTdZ(j,1); - MTTC(i, j + MTTNx + MTTNz) := df(MTTY(i,1), dzj, 1); - END; - END; - -% Fourth column partition -IF MTTNyz>0 THEN - BEGIN - FOR i := 1:MTTNy DO - FOR j := 1:MTTNyz DO - BEGIN - uij := MTTUi(j,1); - MTTC(i, j + MTTNx + 2*MTTNz) := df(MTTY(i,1), uij, 1); - END; - END; - -END; -END; %of MTTN>0 - -% Find MTTD : the D matrix -IF MTTNy>0 THEN -IF MTTNu>0 THEN -BEGIN - matrix MTTD(MTTNy,MTTNu); - FOR i := 1:MTTNy DO - FOR j := 1:MTTNu DO - BEGIN - uj := MTTU(j,1); - MTTD(i,j) := df(MTTY(i,1), uj, 1); - END; -END; - -%Zap the dz terms (not a nice way) -MTTdz1 := 0; -MTTdz2 := 0; -MTTdz3 := 0; -MTTdz4 := 0; -MTTdz5 := 0; -MTTdz6 := 0; -MTTdz7 := 0; -MTTdz8 := 0; -MTTdz9 := 0; -MTTdz10 := 0; -MTTdz11 := 0; -MTTdz12 := 0; -MTTdz13 := 0; -MTTdz14 := 0; -MTTdz15 := 0; -MTTdz16 := 0; -MTTdz17 := 0; -MTTdz18 := 0; -MTTdz19 := 0; - - -%Substitute the ss values -in "$1_sspar.r"; - -%Create the output file -OUT "$1_dm.r"; - -%Write out the matrices. -IF MTTN>0 THEN -BEGIN - write "matrix MTTE(", MTTN, ",", MTTN, ");"; - FOR i := 1:MTTN DO - FOR j := 1:MTTN DO IF MTTE(i,j) NEQ 0 THEN - write "MTTE(", i, ",", j, ") := ", MTTE(i,j); - - write "matrix MTTA(", MTTN, ",", MTTN, ");"; - FOR i := 1:MTTN DO - FOR j := 1:MTTN DO IF MTTA(i,j) NEQ 0 THEN - write "MTTA(", i, ",", j, ") := ", MTTA(i,j); -END; - -IF MTTN>0 THEN -IF MTTNu>0 THEN -BEGIN - write "matrix MTTB(", MTTN, ",", MTTNu, ");"; - FOR i := 1:MTTN DO - FOR j := 1:MTTNu DO IF MTTB(i,j) NEQ 0 THEN - write "MTTB(", i, ",", j, ") := ", MTTB(i,j); -END; - -%Write it out -IF MTTNy>0 THEN -IF MTTN>0 THEN -BEGIN - write "matrix MTTC(", MTTNy, ",", MTTN, ");"; - FOR i := 1:MTTNy DO - FOR j := 1:MTTN DO IF MTTC(i,j) NEQ 0 THEN - write "MTTC(", i, ",", j, ") := ", MTTC(i,j); -END; - -IF MTTNy>0 THEN IF MTTNu>0 THEN -BEGIN - write "matrix MTTD(", MTTNy, ",", MTTNu, ");"; - FOR i := 1:MTTNy DO - FOR j := 1:MTTNu DO IF MTTD(i,j) NEQ 0 THEN - write "MTTD(", i, ",", j, ") := ", MTTD(i,j); -END; - -write "END;"; - -SHUT "$1_dm.r"; -quit; - -EOF - -# Now invoke the standard error handling. -mtt_error_r dae2dm_r.log DELETED mttroot/mtt/bin/trans/dae2ker_r Index: mttroot/mtt/bin/trans/dae2ker_r ================================================================== --- mttroot/mtt/bin/trans/dae2ker_r +++ mttroot/mtt/bin/trans/dae2ker_r @@ -1,89 +0,0 @@ -#!/bin/sh -## Shell script dae2ker_r -## Converts dae to behavioral kernal rep. - - -echo Creating $1_ker.r - -$SYMBOLIC > dae2ker.log <MTTNu THEN - v_list := append({w_i},v_list) - ELSE - v_list := append({u_i},v_list); -END; - -eq_list; v_list; -sol := solve(eq_list,v_list); -sol := first(sol); - -% Pluck out the manifest variable solutions -behaviour_list:={}; -FOR i:=1:(MTTNy-MTTNu) DO -BEGIN - soli := first(sol); - sol := rest(sol); - behaviour := DEN(RHS(soli))*LHS(soli) - NUM(RHS(soli)) = 0; - behaviour_list := append(behaviour_list, {behaviour}); -END; -behaviour_list := behaviour_list; - -MATRIX MTTR(MTTNy-MTTNu,MTTNy); -FOR i:=1:(MTTNy-MTTNu) DO -BEGIN - FOR j:=1:MTTNy DO - BEGIN - w_j := mkid(mttw,j); - coeffs := coeff(lhs(first(behaviour_list)),w_j); - IF length(coeffs)>1 THEN - MTTR(i,j) := second(coeff(lhs(first(behaviour_list)),w_j)); - END; - behaviour_list := rest(behaviour_list); -END; - -%% Now do coefficient matrices - -OFF NAT; -OUT "$1_ker.r"; -write "MATRIX MTTR(", MTTNy-MTTNu, ",", MTTNy, ");"; -MTTR := MTTR; -SHUT "$1_ker.r"; - - -EOF DELETED mttroot/mtt/bin/trans/dae2lde_r Index: mttroot/mtt/bin/trans/dae2lde_r ================================================================== --- mttroot/mtt/bin/trans/dae2lde_r +++ mttroot/mtt/bin/trans/dae2lde_r @@ -1,153 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lde2ode.r -# Reduce differential-algebraic equations to Lagranges equations -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2.4.3 2002/09/13 10:10:42 geraint -## Commented out optimisation. -## -## Revision 1.2.4.2 2002/09/10 23:24:19 geraint -## Rationalised local and global optimisations. -## Fixes presentation of locally optimised code (ode view). -## Much more elegant :-) -## -## Revision 1.2.4.1 2002/09/03 23:44:43 geraint -## adding global optimisation (-optg). -## -## Revision 1.2 2001/07/27 23:29:10 geraint -## Optimises only when requested (-opt). -## -## Revision 1.1 2000/12/28 12:25:13 peterg -## Initial revision -## -############################################################### - -optimise=''; optimise_msg='' -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -optimise_global ) -# optimise='-optimise_global' -# optimise_msg=' with global optimisation' ;; - optimise='' - optimise_msg='' ;; - -optimise_local ) -# optimise='-optimise_local' -# optimise_msg=' with local optimisation' ;; - optimise='' - optimise_msg='' ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -# Create the reduce output code -def2write_r $1 lde -def2write_r $1 ldeo - -#Inform user -echo Creating $1_lde.r $optimise_msg -echo Creating $1_ldeo.r $optimise_msg - -# Remove the old log file -rm -f cse2lde_r.log - -# Use reduce to accomplish the transformation -$SYMBOLIC << EOF >cse2lde_r.log - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - -%Read the definitions file -in "$1_def.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the dae file -in "$1_dae.r"; - -% Zap bits we dont need -clear mttui, mttu, mttdu, mttx, mttdz; - -%% The lagrangian eqns are those set to zero. -MTTL := mttyz; - -% Create the second derivative of z -MATRIX mttddz(MTTNz,1); -FOR i := 1:MTTNz DO -BEGIN - mttuii := mkid(mttui,i); - mttdduii := mkid(mttddui,i); - mttddz(i,1) := sub(mttuii=mttdduii,mttz(i,1)); -END; -mttddz; - -% Create Lagranges Equations -FOR j := 1:MTTNyz DO -BEGIN - %% Create derivative of the equations by substituting: - %du for u - mttuj := mkid(mttu,j); - mttduj := mkid(mttdu,j); - MTTL := sub(mttuj=mttduj,MTTL); - - % dv for v - mttuij := mkid(mttui,j); - mttduij := mkid(mttdui,j); - MTTL := sub(mttuij=mttduij,MTTL); - - % dx for x - mttxj := mkid(mttx,j); - MTTL := sub(mttxj=mttdx(j,1),MTTL); - - % ddz for dz - mttdzj := mkid(mttdz,j); - MTTL := sub(mttdzj=mttddz(j,1),MTTL); - -END; - -L = MTTL; - -OFF Echo; -OFF Nat; - - -%Write out the ordinary differential equations. -OUT "$1_lde.r"; -write "%File: $1_lde.r"; -in ("$1_lde_write.r"); -write "in ""$1_ldeo.r"";"; -write "END;"; -SHUT "$1_lde.r"; - -%Write out the output equations -OUT "$1_ldeo.r"; -write "%File: $1_ldeo.r"; -in ("$1_ldeo_write.r"); -write "END;"; -SHUT "$1_ldeo.r"; -quit; -EOF - -# TODO: edit mtt_optimise to accept lde and ldeo -# if [ ${optimise:-""} = "-optimise_global" ]; then -# mtt_optimise global $1 lde -# mtt_optimise global $1 ldeo -# elif [ ${optimise:-""} = "-optimise_local" ]; then -# mtt_optimise local $1 lde -# mtt_optimise local $1 ldeo -# fi - -# Now invoke the standard error handling. -mtt_error_r cse2lde_r.log DELETED mttroot/mtt/bin/trans/dae_r2m Index: mttroot/mtt/bin/trans/dae_r2m ================================================================== --- mttroot/mtt/bin/trans/dae_r2m +++ mttroot/mtt/bin/trans/dae_r2m @@ -1,309 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dae_r2m -# Reduce DAE to OCTAVE (DASSL) DAE -# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994, Jan 95, Aug 97. -# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 1998/05/13 16:43:03 peterg -## Now uses matlab_matrix to write the matrices -## Various bug fixes -## New global generation method -## -# Revision 1.6 1997/08/28 14:07:16 peterg -# Changed MTTDx to MTTDeriv -# -# Revision 1.5 1996/08/24 14:27:29 peter -# Global parameters. -# -## Revision 1.4 1996/08/18 20:02:21 peter -## Include zero outputs. -## -## Revision 1.3 1996/08/16 13:10:53 peter -## Fixed bug Ny changed to Nx in redidual loop. -## -## Revision 1.2 1996/08/16 08:57:34 peter -## Reads $1_input. -## -## Revision 1.1 1996/08/15 16:46:06 peter -## Initial revision -## -############################################################### - - -# WARNING this is experimental!! -# It asumes that the output y is NOT dependent on derivatives of -# z or u. - - -#Inform user -echo Creating $1_dae.m -echo Creating $1_daeo.m - - -# Remove the old log file -rm -f dae_r2m.log - -# Remove temp. files -rm -f $1_dae.m? -rm -f $1_daeo.m? - -# Use reduce to accomplish the transformation -$SYMBOLIC >dae_r2m.log << EOF - -%Read the reduce definitions file -in "$1_def.r"; - -%Read the reduce DAE file -in "$1_dae.r"; - -% Matrix output function -in"$MTTPATH/trans/matlab_matrix.r"; - -%Set up the number of argument variables to zero in case the user has forgotten -MTTNVar := 0; - -%Read the parameter file -%%in "$1_sympar.r"; - - -%% ON NERO; % Suppress zero elements - -%Define the common part of the functions. - -PROCEDURE common; -BEGIN - - write "% Read in the input"; - write "u = $1_input(x,t)"; - - % write "% Read in the arguments"; - % write "$1_args"; - - write "% Set up the State variables"; - FOR i := 1:MTTNx DO - BEGIN - write "mttx", i, " = mttx(", i, ");"; - END; - - write "% Set up the non-state variables"; - FOR i := 1:MTTNz DO - BEGIN - write "mttz", i, " = mttx(", MTTNx+ i, ");"; - END; - write "% Set up the non-state derivatives"; - FOR i := 1:MTTNz DO - BEGIN - write "mttdz", i, " = mttx(", MTTNx+MTTNz+ i, ");"; - END; - - write "% Set up the internal inputs"; - FOR i := 1:MTTNyz DO - BEGIN - write "mttui", i, " = mttx(", MTTNx+2*MTTNz+i, ");"; - END; - - write "% Set up the Input variables"; - IF MTTNu>0 THEN - FOR i := 1:MTTNu DO - BEGIN - write "mttu", i, " = u(", i, ");"; - END; -END; - -% Firstly do the residual = f(dx,x,t) function. - -% MTTGx and u are the derivatives of z wrt x and u respectively - -% Find MTTGx; -if MTTNz>0 THEN -BEGIN -matrix MTTGx(MTTNz,MTTNx); -FOR j := 1:MTTNx DO - BEGIN - xj := MTTX(j,1); - FOR i := 1:MTTNz DO - MTTGx(i,j) := df(MTTZ(i,1), xj, 1); - END; - -% Find MTTGu; -matrix MTTGu(MTTNz,MTTNu); -FOR j := 1:MTTNu DO - BEGIN - uj := MTTu(j,1); - FOR i := 1:MTTNz DO - MTTGu(i,j) := df(MTTZ(i,1), uj, 1); - END; -END; - -IF MTTNz=0 THEN -BEGIN - MTTGx := 0; - MTTGu := 0; - MTTz := 0; -END; - -OUT "$1_dae.m1"; -write "function residual = $1_dae(mttx,deriv0,t);"; -write "% residuals = $1_dae(dx,x,t);"; -write "%DAE in DASSL $1;;"; -write "%File $1_dae.m;;"; -write "%Generated by MTT;;"; - - -common(); -SHUT "$1_dae.m1"; - -GENTRANOUT "$1_dae.m3"; -write "% State derivative"; -IF MTTNX>0 THEN -BEGIN - MTT_Matrix := MTTdX$ - MTT_Matrix_name := "deriv"$ - MTT_Matrix_n := MTTNx$ - MTT_Matrix_m := 1$ - matlab_Matrix()$ - GENTRAN deriv := mtt_matrix$ -END; - -IF MTTNYz>0 THEN -BEGIN - MTT_Matrix := MTTYz$ - MTT_Matrix_name := "MTTYz"$ - MTT_Matrix_n := MTTNYz$ - MTT_Matrix_m := 1$ - matlab_Matrix()$ - GENTRAN MTTYz := mtt_matrix$ -END; - -if MTTNz>0 THEN -BEGIN - MTT_Matrix := MTTz$ - MTT_Matrix_name := "MTTz"$ - MTT_Matrix_n := MTTNz$ - MTT_Matrix_m := 1$ - matlab_Matrix()$ - GENTRAN MTTz := mtt_matrix$ - - MTT_Matrix := MTTGu$ - MTT_Matrix_name := "MTTGu"$ - MTT_Matrix_n := MTTNz$ - MTT_Matrix_m := 1$ - matlab_Matrix()$ - GENTRAN MTTGu := mtt_matrix$ - - MTT_Matrix := MTTGu$ - MTT_Matrix_name := "MTTGx"$ - MTT_Matrix_n := MTTNz$ - MTT_Matrix_m := 1$ - matlab_Matrix()$ - GENTRAN MTTGx := mtt_matrix$ - -END; - - -SHUT "$1_dae.m3"; - -OUT "$1_dae.m4"; -% write "% Set up the non-state derivatives"; -% FOR i := 1:MTTNz DO -% write "mttdz", i, " = mttderiv0(", MTTNx+ i, ");"; -% END; - -write "j = 0;"; - -%Residual has 3 parts as follows: -%Part 1: dx/dt - dx_0/dt -if MTTNx>0 THEN -BEGIN - write "for i=1:", MTTNx, ";;"; - write " j = j+1"; - write " residual(j) = deriv(i)-deriv0(j);"; - write "end;"; -END; - -%Part 2: dz/dt - dz_0/dt -IF MTTNz>0 THEN -BEGIN - if MTTNx>0 THEN - write "mttdzx = mttgx*mttdx" - ELSE - write "mttdzx = zeros(", MTTNz, ",1);"; - - - if MTTNu>0 THEN - write "mttdzu = mttgu*mttdu" - ELSE - write "mttdzu = zeros(", MTTNz, ",1);"; - - write "mttdz = mttdzx + mttdzu"; - - write "for i=1:", MTTNz, ";;"; - write " j = j+1"; - write " residual(j) = mttdz(i)-mttderiv0(j);"; - write "end;"; -END; - -%Part 3: v=0 (the algebraic bits) -IF MTTNyz>0 THEN -BEGIN - write "for i=1:", MTTNyz, ";;"; - write " j = j+1"; - write " residual(j) = mttyz(i)"; - write "end;"; -END; - -SHUT "$1_dae.m4"; - - -% Now do the y = g(x,t) function. -OUT "$1_daeo.m1"; - -write "function mtty = $1_daeo(mttx,t);"; -write "% mtty = $1_daeo(mttx,t);"; -write "%DAE in Simulab form for system $1;;"; -write "%File $1_daeo.m;;"; -write "%Generated by MTT;;"; - -SHUT "$1_daeo.m1"; - -OUT "$1_daeo.m3"; -common(); - - -%Fortran switches - one line expressions -OFF echo; -ON fort$ -cardno!* := 1$ -fortwidth!* := 500$ -OFF period$ - -MTTy := MTTy; - -SHUT "$1_daeo.m3"; - -EOF - -# Create the globals -sympar2global_txt2m $1> $1_dae.m2 -sympar2global_txt2m $1> $1_daeo.m2 - -# Put together the pieces -cat $1_dae.m?>$1_dae.m -cat $1_daeo.m?>$1_daeo.m - - - - - - - DELETED mttroot/mtt/bin/trans/dae_r2tex Index: mttroot/mtt/bin/trans/dae_r2tex ================================================================== --- mttroot/mtt/bin/trans/dae_r2tex +++ mttroot/mtt/bin/trans/dae_r2tex @@ -1,193 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dae_r2tex -# Reduce differential-algebraic to LaTex differential-algebraic equations. -# P.J.Gawthrop 10th May 1991, April 1994 -# Copyright (c) P.J.Gawthrop, 1991, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 1998/01/23 16:08:09 peterg -## changed eqnarray to equation + aligned -## -## Revision 1.3 1997/06/13 13:30:43 peterg -## Removed eqn labels. -## -# Revision 1.2 1996/12/19 10:25:15 peterg -# Now writes out mtti instead of mtt_{i} -- lets latex_tidy do the -# conversion. -# -# Revision 1.1 1996/10/21 08:50:15 peterg -# Initial revision -# -############################################################### - - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I ) - info=info;; - -partition ) - partition=yes; - blurb='with partitioning'; - ;; - *) - echo "$1 is an invalid argument - ignoring"; - exit ;; - esac - shift -done - -# Inform user -echo Creating $1_dae.tex $blurb - -logname=dae_r2tex.log - -# Remove the old log file -rm -f dae_r2tex.log - -# Use reduce to accomplish the transformation -$SYMBOLIC >$logname << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the differential-algebraic equations file -in "$1_dae.r"; - -%Read the symbolic parameter file -%%in "$1_sympar.r"; - - -OFF Echo; -OFF Nat; - - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplifying expressions file -IN "$1_simp.r"; - -% Read the formating function -in "$MTTPATH/trans/latex_equations.r"; - -OUT "$1_dae.tex"; - -%Write out the differential-algebraic equations. - -write "%File: $1_dae.tex"; - -write "%differential-algebraic equations"; -%ON Rounded; -%Precision 5; - -latex_equations(); - -SHUT "$1_dae.tex"; -quit; -EOF - -if [ -n "$partition" ]; then - rm -f mtt_junk - # Now for the subsystems - # Find subsystems - subsystems=`mtt_get_subsystems $1` - - for subsystem in $subsystems; do - echo Doing $subsystem - ucname="MTT_"$subsystem"_uc" - subsystem_dae=$subsystem"_dae" - #subname=`echo $subsystem | mtt_remove_underscore` - - Nu=`mtt_getsize -internal $subsystem"_1" u` - echo Nu $Nu - - # Use symbolic algebra to accomplish the transformation - $SYMBOLIC >$logname << EOF - - - %Read the definitions file - in "$1_def.r"; - - - %Read the symbolic parameter file - %%in "$1_sympar.r"; - - - % Read the formating function - in "$MTTPATH/trans/latex_equations.r"; - - OFF Echo; - OFF Nat; - - - %Read the substitution file - in "$1_subs.r"; - - %Read the simplifying expressions file - IN "$1_simp.r"; - - %Read the differential-algebraic equations file - in "$1_dae.r"; - - %Create the output file - OUT "mtt_junk_1"; - - % Connecting inputs - IF $Nu>0 THEN - BEGIN - write "\section{Subsystem $subsystem}"; - - write "\subsection{Connections}"; - write"\begin{itemize}"; - FOR Row := 1:$Nu DO - BEGIN - write "\item Input ", Row, " is connected to "; - write $ucname(Row,1); - END; - write"\end{itemize}"; - END; - SHUT "mtt_junk_1"; - - %Read the differential-algebraic equations file - in "$subsystem_dae.r"; - - %Create the output file - OUT "mtt_junk_2"; - write "\subsection{Dynamics}"; - latex_equations(); - SHUT "mtt_junk_2"; - -EOF - echo >> $1_dae.tex - echo %Connections for subsystem $subsystem >> $1_dae.tex - - # Sort out underscores and remove mtt to avoide post processor - cat mtt_junk_1 | mtt_remove_underscore | sed 's/mtt//g'>> $1_dae.tex - cat mtt_junk_2 >> $1_dae.tex - rm -rf mtt_junk_? - done -fi - - -# Now invoke the standard error handling. -mtt_error_r dae_r2tex.log - - - - - - - - - - - DELETED mttroot/mtt/bin/trans/dat22dat Index: mttroot/mtt/bin/trans/dat22dat ================================================================== --- mttroot/mtt/bin/trans/dat22dat +++ mttroot/mtt/bin/trans/dat22dat @@ -1,72 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dat22dat -# Splits the data file into output and state bits - -# Copyright (c) P.J.Gawthrop 1999 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.10 2000/10/17 12:24:02 peterg -## Three argument generic version -## -## Revision 1.9 2000/09/27 16:12:50 peterg -## Use expr to evaluate arithmetic - compatible with sh (as opposed to -## bash) -## -## Revision 1.8 2000/09/21 10:07:06 peterg -## Now correctely writes out the state into _odes.dat rep. -## -## Revision 1.7 2000/04/06 09:02:46 peterg -## Removed bash let commands as unsupported by sh -## Do arithmetic within awk - yuk -## -## Revision 1.6 2000/04/06 08:36:15 peterg -## *** empty log message *** -## -## Revision 1.5 1999/03/15 22:42:52 peterg -## Strip comments (put in by Octave save function) -## -## Revision 1.4 1999/03/15 21:55:36 peterg -## Does away with the # symbol in the file - uses _de to get Nx Ny -## instead -## -############################################################### -if [ -z "$1" ]; then - echo "Usage: dat22dat system ode|odes so|s" - exit -fi - -# Find Nx and Ny -Nx=`mtt_getsize $1 x` # States -Ny=`mtt_getsize $1 y` # Outputs - -case $3 in - so) - First=1; Last=`expr $First + $Ny` - ;; - s) - First=`expr $Ny + 2`; Last=`expr $First + $Nx` - ;; - *) - First=1; Last=`expr $Ny + 1` - ;; -esac - -echo Creating $1_$2$3.dat - -gawk '{ - ## Extract the data - if (index($1,"#") != 1){ - for (i=First;i<=Last;i++) - printf("%s ", $i); - printf("\n"); - } -}' First=$First Last=$Last <$1_$2s.dat2 > $1_$2$3.dat DELETED mttroot/mtt/bin/trans/dat22sg.sh Index: mttroot/mtt/bin/trans/dat22sg.sh ================================================================== --- mttroot/mtt/bin/trans/dat22sg.sh +++ mttroot/mtt/bin/trans/dat22sg.sh @@ -1,147 +0,0 @@ -#! /bin/sh - -# Convert simulation data to SciGraphica (v 0.61) Project file ($sys_odes.sg) - -sys=$1 - -write_project_header () -{ - cat < - - - - - application - scigraphica - - - author - MTT:${USER} - - - -EOF -} - -write_project_footer () -{ - echo '' - echo '' -} - -write_worksheet_header () -{ - name=$1 ; ncol=$2 ; nrow=$3 - cat < - - - application - scigraphica - - - author - MTT:${USER} - - - - ${name} - ${ncol} - ${nrow} - -1 - -1 -EOF -} - -write_worksheet_footer () -{ - echo '' - echo '' -} - -write_column_headings () -{ - gawk '{ printf (" \n \n", NR-1,$0) }' -} - -write_output_headings () -{ - sys=$1 - ${MATRIX} -q <\n", row,col); - printf (" %f\n", val); - printf (" %f\n", val); - printf (" \n"); -endfunction - - [u_names,y_names,x_names] = ${sys}_struc; - ncol = size(${vec}_names)(1); - - load ("${sys}_odes.dat2"); - nrow = size(mtt_data)(1); - - # write Time - for r = 1:nrow - write_cell (r-1,0,mtt_data(r,1)); - endfor - - if ("${vec}" == "y") - offset = 1; - elseif ("${vec}" == "x") - offset = size(y_names)(1); - endif - - for r = 1:nrow - for c = 1:ncol - write_cell (r-1,c,mtt_data(r,c+offset)); - endfor - endfor -EOF -} - -file=${sys}_odes.sg - -NX=`mtt_getsize ${sys} x` -NY=`mtt_getsize ${sys} y` -NTMP=`wc -l ${sys}_odes.dat2 | gawk '{print $1}'` -NROW=`expr ${NTMP} - 4` # 4 comment lines in mtt_data - -{ - write_project_header - # states - write_worksheet_header "X_${sys}" ${NX} ${NROW} - write_state_headings ${sys} - write_cell_values ${sys} x - write_worksheet_footer - # outputs - write_worksheet_header "Y_${sys}" ${NY} ${NROW} - write_output_headings ${sys} - write_cell_values ${sys} y - write_worksheet_footer - write_project_footer -} > ${file} - DELETED mttroot/mtt/bin/trans/dat2gdat Index: mttroot/mtt/bin/trans/dat2gdat ================================================================== --- mttroot/mtt/bin/trans/dat2gdat +++ mttroot/mtt/bin/trans/dat2gdat @@ -1,135 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dat2gdat - -# Converts a data file in data format to gplot data format - -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2002/04/16 11:36:03 gawthrop -## These were flagged with M on cvs update -## -## Revision 1.1 2000/12/28 12:26:15 peterg -## Put under RCS -## -## Revision 1.8 1998/09/29 20:01:27 peterg -## 4th argument for nyquist style files - ie differnt x for each y -## -## Revision 1.7 1997/12/04 22:10:32 peterg -## Handles argument list - variable names. -## -## Revision 1.6 1997/05/22 10:34:05 peterg -## Changed argument structure. -## -## Revision 1.5 1997/05/22 10:11:19 peterg -## Fixed parametetr bug -## -# Revision 1.4 1997/05/16 13:03:10 peterg -# Now selects variables to display. -# -# Revision 1.3 1996/08/26 13:02:58 peterg -# Cahged awk to awk. -# -# Revision 1.2 1996/08/15 11:49:11 peter -# Puts a blank line at the end of the file: -# this allows user to cat files for use in gnuplot. -# -## Revision 1.1 1996/08/14 09:13:52 peter -## Initial revision -## -############################################################### - -echo Creating $1_$2.gdat -rm -f $1_$2.gdat - -DifferentX=$4; - -# Convert multi-columns into gnuplot format - -# ie stack two columns vertically separated by blank lines - -#Get the desired data index -which=`name2index $1 "$3"` -echo $1 $3 $which - -if [ -z "$DifferentX" ]; then -gawk ' -BEGIN{ - row=0; col=0; -} -{ - if (row==0) { - N=split(which,Which,","); - } - row++; - j=1; - if (Which[1]==0) { - x[row] = $1; - for (i=1; i $1_$2.gdat - -else -gawk ' -BEGIN{ - row=0; col=0; -} -{ - row++; cols=NF/2 - for (i=1; i<=cols; i++) { - ycol=2*i; - xcol=ycol-1; - x[row,i] = $xcol - y[row,i] = $ycol; - } -} -END { - rows = row; - for (col = 1; col <= cols; col++) { - for (row = 1; row <= rows; row++) { - print x[row,col], y[row,col] - }; - if (col<=cols) { - printf("\n") - } - } -}' <$1_$2.dat > $1_$2.gdat - -fi - - - - - - DELETED mttroot/mtt/bin/trans/dat2sdat Index: mttroot/mtt/bin/trans/dat2sdat ================================================================== --- mttroot/mtt/bin/trans/dat2sdat +++ mttroot/mtt/bin/trans/dat2sdat @@ -1,51 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dat2sdat - -# Structure file - dat to sdat conversion -# P.J.Gawthrop April 1997 -# Copyright (c) P.J.Gawthrop, 1997, 1999 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1.4.1 2001/06/26 00:57:21 geraint -## Prints more useful name. -## -## Revision 1.1 2000/12/28 12:26:34 peterg -## Put under RCS -## -## Revision 1.1 1999/03/28 21:29:40 peterg -## Initial revision -## -############################################################### - -if [ "$2" = "odes" ]; then - which="state" -else - which="output" -fi - -awk ' -BEGIN{ -printf("Time"); -} -{ - if ($1==which) - printf(" %s(%s)", $4, $5); -} -END{ -printf("\n"); -} -' SYSTEM=$1 which=$which < $1_struc.txt - -cat $1_$2.dat - - - DELETED mttroot/mtt/bin/trans/dat2siag Index: mttroot/mtt/bin/trans/dat2siag ================================================================== --- mttroot/mtt/bin/trans/dat2siag +++ mttroot/mtt/bin/trans/dat2siag @@ -1,47 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dat2siag -# Converts data to siag (scheme in a grid) format - ie columns become rows. - -# Data file dat to sdat conversion -# P.J.Gawthrop February 1998 -# Copyright (c) P.J.Gawthrop, 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2001/04/16 22:22:06 geraint -## *** empty log message *** -## -## Revision 1.1 1999/03/29 03:35:13 peterg -## Initial revision -## -############################################################### - - - - -# This is the main transformation using awk -gawk '{ - i++ - for (j=1;j<=NF;j++) - data[i,j]=$j; - Cols=NF; - Rows++; -} -END{ - for (j=1;j<=Cols;j++) { - for (i=1;i<=Rows;i++){ - printf("%s ", data[i,j]); - } - printf("\n"); - } -}' - - DELETED mttroot/mtt/bin/trans/def2write_r Index: mttroot/mtt/bin/trans/def2write_r ================================================================== --- mttroot/mtt/bin/trans/def2write_r +++ mttroot/mtt/bin/trans/def2write_r @@ -1,215 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: def2write.r -# Generates r code to write matrices -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.17 2002/09/16 08:08:00 geraint -## Merged changes from global-optimisation branch. -## -## Revision 1.16.2.3 2002/09/10 23:24:19 geraint -## Rationalised local and global optimisations. -## Fixes presentation of locally optimised code (ode view). -## Much more elegant :-) -## -## Revision 1.16.2.2 2002/09/10 22:09:14 geraint -## Fixed presentation of globally optimised equations (ode view). -## -## Revision 1.16.2.1 2002/09/03 23:44:43 geraint -## adding global optimisation (-optg). -## -## Revision 1.16 2002/09/03 19:34:15 geraint -## Write EdX regardless - csex is needed to create ode when not optimised. -## -## Revision 1.15 2002/08/29 15:45:20 geraint -## Tests for existence of matrix before entering shell loop. -## Tests for existence of expression before attempting to write or optimise. -## -## Revision 1.14 2002/08/09 14:34:45 geraint -## Fix to prevent numbers being formed with a decimal point in the exponent, Reduce cannot handle these. -## -## Revision 1.13 2002/07/10 17:43:05 geraint -## Added feature [ 562453 ] Optimisation of algebraic equations. -## -## Revision 1.12 2002/06/28 10:13:40 geraint -## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. -## -## Revision 1.11.2.1 2002/06/05 11:14:51 geraint -## ae.r now generated using def2write_r like cse?.r -## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r. -## -## Revision 1.11 2002/05/17 09:14:58 geraint -## Optimises each line in a separate session. Allows larger models to be built. -## -## Revision 1.10 2002/04/28 18:41:27 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.9 2001/07/27 23:29:10 geraint -## Optimises only when requested (-opt). -## -## Revision 1.8 2001/07/13 04:54:04 geraint -## Branch merge: numerical-algebraic-solution back to main. -## -## Revision 1.7.2.1 2001/05/04 04:07:24 geraint -## Numerical solution of algebraic equations. -## sys_ae.cc written for unsolved inputs. -## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). -## -## Revision 1.7 2001/04/11 09:44:26 gawthrop -## Fixed cc and c problems to do with pow(x,y) and integers -## mtt/lib/reduce/fix_c.r is included in rdae2dae and cse2smx_lang for -## -c, -cc and -oct options -## -## Revision 1.6 2000/11/29 20:48:53 peterg -## Zapped unnecessary Npar creation -## -## Revision 1.5 2000/11/09 10:12:24 peterg -## Removed debugging line -## -## Revision 1.4 2000/10/14 16:19:54 peterg -## Just optimize one line at a time ... -## -## Revision 1.3 2000/10/11 09:07:17 peterg -## Added csex rep (cse without E) -## -## Revision 1.2 2000/10/10 21:02:17 peterg -## Added cse reps -## -## Revision 1.1 2000/10/10 09:07:32 peterg -## Initial revision -## -############################################################### - -optimise='' -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -fixcc ) - include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -sys=$1 # System name -rep=$2 # System representation - -# Inform User -echo Creating $1_$2_write.r - -# Find system constants -Nx=`mtt_getsize $sys x` # States -Nxx=`mtt_getsize $sys xx` # States x States -Nu=`mtt_getsize $sys u` # Inputs -Ny=`mtt_getsize $sys y` # Outputs -Nyz=`mtt_getsize $sys yz` # Zero outputs -#Npar=`wc -l $sys\_sympar.txt | gawk '{print $1}'` - -# Set up representation-specific stuff -case $rep in - ae) - matrices='Yz' - ns="$Nyz" - ms="1" - ;; - cse) - matrices='EdX E' - ns="$Nx $Nx" - ms="1 $Nx" - ;; - csex) - matrices='EdX' - ns="$Nx" - ms="1" - ;; - cseo) - matrices='Y' - ns="$Ny" - ms="1" - ;; - lde) - matrices='L' - ns="$Nyz" - ms="1" - ;; - ldeo) - matrices='Y Yz' - ns="$Ny $Nyz" - ms="1 1" - ;; - ode) - matrices='dX' - ns="$Nx" - ms="1" - ;; - odeo) - matrices='Y' - ns="$Ny" - ms="1 1" - ;; - sm) - matrices='A B C D' - ns="$Nx $Nx $Ny $Ny" - ms="$Nx $Nu $Nx $Nu" - ;; - *) - echo def2write_r: representation $rep not recognised - exit -esac - -# Remove log files -rm -f def2write_r1.log def2write_r2.log - -# Write out the code -echo "" > $1_$2_write.r - -echo 'off echo$' >> $1_$2_write.r -echo 'load gentran$' >> $1_$2_write.r - -for matrix in $matrices; do - ignore_matrix="no" - if [ "$matrix" = "E" ]; then - matrix_exists=`grep -i MTTE ${sys}_dae.r | wc -l | gawk '{print $1}'` - if [ ! $matrix_exists -gt 0 ]; then - ignore_matrix="yes" - n=`first "$ns"`; ns=`rest "$ns"` - m=`first "$ms"`; ms=`rest "$ms"` - is=`n2m 1 $n`; - echo "write \"% Begin Matrix MTTE\"$" >> $1_$2_write.r - for i in $is; do - echo 'write' - name=`echo MTTE'('$i','$i')'` - echo ' '$comma$name ':=' $name '$' - done >> $1_$2_write.r - echo "write \"% End Matrix MTTE\"$" >> $1_$2_write.r - fi - fi - if [ ! "$ignore_matrix" = "yes" ]; then - n=`first "$ns"`; ns=`rest "$ns"` - m=`first "$ms"`; ms=`rest "$ms"` - is=`n2m 1 $n`; - js=`n2m 1 $m`; - echo "write \"% Begin Matrix MTT${matrix}\"$" >> $1_$2_write.r - if [ $n -ge 1 ]; then - for i in $is; do - for j in $js; do - echo 'write' - name=`echo MTT$matrix'('$i','$j')'` - echo ' '$comma$name ':=' $name '$' - done - done - fi >> $1_$2_write.r - echo "write \"% End Matrix MTT${matrix}\"$" >> $1_$2_write.r - fi -done -echo ';END;' >>$1_$2_write.r DELETED mttroot/mtt/bin/trans/def_r2m Index: mttroot/mtt/bin/trans/def_r2m ================================================================== --- mttroot/mtt/bin/trans/def_r2m +++ mttroot/mtt/bin/trans/def_r2m @@ -1,55 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: def_r2m -# transforms definitions from reduce to m file. -# Copyright (c) P.J.Gawthrop 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/07/25 10:21:37 peterg -## Entirely rewritten -## -## Revision 1.1 1998/07/25 07:10:41 peterg -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_def.m - -# Remove the old log file -rm -f def_r2m.log - - -# Header -cat < $1_def.m -function [nx,ny,nu,nz,nyz] = $1_def; -% function [nx,ny,nu,nz,nyz] = $1_def; -% System $1, representation def, language m -% File $1_def.m; -% Generated by MTT on `date`; -% -EOF - -# Constants -Nx=`grep "MTTNx " <$1_def.r | gawk '{print $3}' | sed 's/;//'` -Ny=`grep "MTTNy " <$1_def.r | gawk '{print $3}' | sed 's/;//'` -Nu=`grep "MTTNu " <$1_def.r | gawk '{print $3}' | sed 's/;//'` -Nz=`grep "MTTNz " <$1_def.r | gawk '{print $3}' | sed 's/;//'` -Nyz=`grep "MTTNyz " <$1_def.r | gawk '{print $3}' | sed 's/;//'` - - -cat<> $1_def.m - nx = $Nx; - ny = $Ny; - nu = $Nu; - nz = $Nz; - nyz = $Nyz; -EOF DELETED mttroot/mtt/bin/trans/dia2abg.pl Index: mttroot/mtt/bin/trans/dia2abg.pl ================================================================== --- mttroot/mtt/bin/trans/dia2abg.pl +++ mttroot/mtt/bin/trans/dia2abg.pl @@ -1,571 +0,0 @@ -#!/usr/bin/perl -w - -#---------------------------------------------------------------------------- -# dia2abg.pl -# Copyright (C) 2002; David Hoover. -# Modified 2004 Geraint Bevan. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# The GNU General Public License should be found in the file license.txt. -# For more information about free software, visit http://www.fsf.org/ -#---------------------------------------------------------------------------- - -############################################################################# -# Given a DIA diagram, the script has functions that perform the following -# MTT (model transformation tools) functions: -# 1. Write a _cmp.txt file containing component types:names -# 2. Write a _ibg.m file containing an acausal bond graph suitable for -# processing by MTT. -# 3. Modify a diagram by changing causality as desired. -############################################################################# - -#---------------------------------------------------------------------------- -# Dia uses a unique id for each object. -# get_component_data and get_bond_data read the xml file and collect -# important information about component and bond id's, component -# names, and bond connectivity. These data structures are described here: - -# The %component_id_tag hash provides component names and types: -# -# key=component_id -# value=component type:name - -# 'start' ALWAYS refers to dia's interpretation of start. This means, -# when you draw a line or an arrow, 'start' is the point where you -# initally press down the mouse button. 'end' is the point where you -# release the mouse button. 'start' and 'end' have nothing to do with -# a bond's direction. A half arrow could be on a dia 'start' or 'end' -# point. - -# The %bond_id_start_id and %bond_id_end_id hashes provides -# connectivity info for line start points and end points: -# -# key=bond_id -# value=component_id - -# The %bond_id_arrow_on_start hash is a boolean that indicates whether -# the power arrow (half head) is on the dia line start point. -# -# key=bond_id -# value=boolean arrow_on_start - -# The %bond_id_effort_causality hash is a boolean that provides the -# effort arrow-oriented causality. -# -# key=bond_id -# value=arrow-oriented effort causality. - -# The %bond_id_flow_causality hash is a boolean that provides the -# flow arrow-oriented causality. -# -# key=bond_id -# value=arrow-oriented flow causality. - -# %mtt_bond_id_index provides a unique positive integer index for each -# Dia bond ID. The index is written to the ibg.m file for mtt. - -# The %component_id_type, %component_id_name, %component_id_reps hashes -# store the information from _cmp.m for each component -# -# key=component_id -# value=component type, name or number of repetitions - -#---------------------------------------------------------------------------- - -#----------------------------MAIN PROGRAM------------------------------------ -use strict; -use Getopt::Long; -use XML::DOM; - -my (%component_id_tag, %bond_id_start_id, %bond_id_end_id, - $objects, %mtt_bond_id_index, - %bond_id_arrow_on_start, %bond_id_flow_causality, %bond_id_effort_causality, - %bond_id_start_label,%bond_id_end_label); - -my (%component_id_type, %component_id_name, %component_id_reps); - -# Parse user options: -my $diagram_name = ''; -my $dia_input_file = ''; -my $dia_output_file = ''; -my $component_list_file = ''; -my $debug = 0; -my $create_component_list = 0; -my $create_ibg = 0; -my $ibg_file = ''; -my $change_flow_causality = ''; -my $change_effort_causality = ''; -GetOptions ('diagram_name=s' => \$diagram_name, - 'dia_input_file=s' => \$dia_input_file, - 'dia_output_file=s' => \$dia_output_file, - 'component_list_file=s' => \$component_list_file, - 'debug' => \$debug, - 'create_component_list' => \$create_component_list, - 'create_ibg' => \$create_ibg, - 'ibg_file=s' => \$ibg_file, - 'change_flow_causality=s' => \$change_flow_causality, - 'change_effort_causality=s' => \$change_effort_causality, - ); - -die usage() if $diagram_name eq ''; - -# Use defaults if necessary: -$dia_input_file = $diagram_name . "_abg.dia" if ($dia_input_file eq ''); -$dia_output_file = $diagram_name . "_cbg.dia" if ($dia_output_file eq ''); -$ibg_file = $diagram_name . "_ibg.m" if ($ibg_file eq ''); -$component_list_file = $diagram_name . "_cmp.txt" if ($component_list_file eq ''); - -# Start Parsing XML, and creating files: -my $dom = new XML::DOM::Parser; -my ($doc); - -$doc = $dom->parsefile($dia_input_file); -$objects = get_objects_node($doc,"Bond Graph"); - -get_component_data($objects); -parse_component_data(); - -get_bond_data($objects); - -create_component_list() if ($create_component_list); - -if ($create_ibg) { - open (OUT,">$ibg_file") || - die "Cannot open $ibg_file for writing.\n"; - output_ibg(); - -} - -if ($change_flow_causality ne '' || $change_effort_causality ne '') { - open (DIA_OUT,">$dia_output_file") || - die "Cannot open $dia_output_file for writing.\n"; - print DIA_OUT $doc->toString; - close DIA_OUT; -} - -exit 0; - - -#----------------------------SUBROUTINES------------------------------------- -sub create_component_list { - my ($type, $name); - - print_debug("CREATING unique_raw_list...\n"); - open (RAW,">$component_list_file") || - die "Cannot open $component_list_file for writing.\n"; - - my (%reverse_component_id_tag) = reverse (%component_id_tag); - foreach my $val (sort values(%component_id_tag)) { - my ($id, $type); - $id = $reverse_component_id_tag{$val}; - $type = $component_id_type{$id}; - $_ = $val; - id_cleaner(); - $val = $_; - print RAW $val . "\n"; - } - close(RAW); -} - -sub get_objects_node { - my ( $doc_node, $layer_name )= @_; - my ($root,$layer_node,$objects); - - $root = get_first_element_subnode($doc_node); - die "could not find top-level element dia_diagram.\n" - unless $root->getTagName eq 'dia:diagram'; - - $layer_node = get_first_subnode_by_nodename_attribute(0,$root,"dia:layer","name",$layer_name); - die "I found no dia:layer named $layer_name. Are you sure the diagram has one?\n" unless - $layer_node->getTagName eq 'dia:layer' && - $layer_node->getAttributeNode("name")->getValue eq $layer_name; - - $objects = $layer_node->getElementsByTagName('dia:object'); - - return $objects; -} - -sub output_ibg_header { - my ($date); - $date = `date`; chomp($date); - - print OUT <<"EOF"; -## -*-octave-*- put Emacs into Octave mode - -function [${diagram_name}] = ${diagram_name}_ibg - - ## Intermediate bond graph representation of $diagram_name - ## Generated by MTT on $date - - ## head refers to the harpoon end of a bond - ## tail refers to the other end of a bond - ## causality.? is the end at which ? is imposed - - -EOF -} - -sub output_ibg_footer { - print OUT <<"EOF"; -endfunction -EOF -} - -sub output_ibg { - my ($key,$component,$type,$name, - %reverse_mtt_bond_id_index,$mtt_bond_id,$dia_bond_id, - @bonds, - $bond_id,$start,$end,$id, - $head,$head_component,$head_type,$head_name, - $tail,$tail_component,$tail_type,$tail_name, - $start_label,$end_label, - $head_label,$tail_label, - $effort_causality,$flow_causality); - - output_ibg_header(); - - %reverse_mtt_bond_id_index = reverse (%mtt_bond_id_index); - - @bonds = (sort keys (%reverse_mtt_bond_id_index)); - foreach $mtt_bond_id (@bonds) { - - $dia_bond_id = $reverse_mtt_bond_id_index{$mtt_bond_id}; - - $start = $bond_id_start_id{$dia_bond_id}; - $end = $bond_id_end_id {$dia_bond_id}; - - if ($bond_id_arrow_on_start{$dia_bond_id}) { - $head = $end; - $tail = $start; - } else { - $head = $start; - $tail = $end; - } - - $start_label = $bond_id_start_label{$dia_bond_id}; - $end_label = $bond_id_end_label {$dia_bond_id}; - - # treat label as a comment if not enclosed by [ ] - if ($start_label !~ /\[.*\]/) { - $start_label = "[]"; - } - if ($end_label !~ /\[.*\]/) { - $end_label = "[]"; - } - - if ($bond_id_arrow_on_start{$dia_bond_id}) { - $head_label = $end_label; - $tail_label = $start_label; - } else { - $head_label = $start_label; - $tail_label = $end_label; - } - - $head_component = "$component_id_type{$head}:$component_id_name{$head}"; - $tail_component = "$component_id_type{$tail}:$component_id_name{$tail}"; - - $effort_causality = $bond_id_effort_causality{$dia_bond_id}; - $flow_causality = $bond_id_flow_causality {$dia_bond_id}; - - for ($effort_causality) { - if (/-1/) { $effort_causality = "tail";} - if (/0/) { $effort_causality = "none";} - if (/1/) { $effort_causality = "head";} - } - for ($flow_causality) { - if (/-1/) { $flow_causality = "head";} - if (/0/) { $flow_causality = "none";} - if (/1/) { $flow_causality = "tail";} - } - - print OUT - " ## bond $mtt_bond_id \n" . - " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . - "head.component = \"${head_component}\";\n" . - " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . - "tail.component = \"${tail_component}\";\n"; - - print OUT - " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . - "head.ports = \"$head_label\";\n" . - " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . - "tail.ports = \"$tail_label\";\n"; - - print OUT - " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . - "causality.effort = \"$effort_causality\";\n" . - " ${diagram_name}.bonds.bond${mtt_bond_id_index{$dia_bond_id}}." . - "causality.flow = \"$flow_causality\";\n\n"; - } - - output_ibg_footer(); -} - -sub get_component_data { - my ( $objects_node )= @_; - my($obj,$id,$attr,$comp,$strattr,$str_elem,$string); - - print_debug("READING COMPONENTS FROM $dia_input_file...\n"); - for my $i (0..$objects_node->getLength-1) { - $obj = $objects_node->item($i); - next if ($obj->getAttributeNode("type")->getValue ne "BondGraph - MTT port"); - - $id = $obj->getAttributeNode("id")->getValue; - print_debug($id . "\n"); - - $attr = get_first_subnode_by_nodename_attribute(0,$obj,"dia:attribute","name","text"); - $comp = get_first_subnode_by_nodename_attribute(0,$attr,"dia:composite","type","text"); - $strattr = get_first_subnode_by_nodename_attribute(0,$comp,"dia:attribute","name","string"); - $str_elem = get_first_element_subnode($strattr); - $string = get_first_text_subnode($str_elem); - $component_id_tag{$id} = $string->getData; - } - die "There are no components!\n" unless keys(%component_id_tag) > 0; -} - -sub parse_component_data { - my (%anon_index, $id, $component); - - while (($id, $component) = each (%component_id_tag)) { - $_ = $component; - id_cleaner(); - $component = $_; - my ($type_name, $repetitions) = split (/\*/, $component); - if (! $repetitions) { - $type_name = $component; - $repetitions = 1; - } - my ($type, $name) = split (/:/, $type_name); - if (! $name) { - $type = $type_name; - if (! defined ($anon_index{$type})) { - $anon_index{$type} = 1; - $name = "mtt${type}"; - } else { - my $num = ++$anon_index{$type}; - $name = "mtt${type}_${num}"; - } - } - $component_id_type{$id} = $type; - $component_id_name{$id} = $name; - $component_id_reps{$id} = $repetitions; - } -} - -# Dia stores its attributes in a strange way, not using typical xml attributes. -sub get_dia_attribute_value { - my ($type, $attribute_node )= @_; - my ($subnode); - $subnode = get_first_subnode_by_nodename_attribute(0,$attribute_node,$type); - - return $subnode->getAttributeNode("val")->getValue; -} - -# Dia stores its attributes in a strange way, not using typical xml attributes. -sub set_dia_attribute_value { - my ($type, $attribute_node, $new_value )= @_; - my ($subnode); - $subnode = get_first_subnode_by_nodename_attribute(0,$attribute_node,$type); - - $subnode->setAttribute(val => $new_value); -# return $subnode->getAttributeNode("val")->getValue; -} - -sub get_dia_attribute_string { - my ($attribute) = @_; - my ($str_elem, $string); - $str_elem = get_first_element_subnode($attribute); - $string = get_first_text_subnode($str_elem)->getData; - $string =~ s/\#//g; - return $string; -} - -sub get_arrow_info { - my ( $object_node, $id, $id_index )= @_; - my($attribute,$attributes); - - $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "arrow_on_start"); - $bond_id_arrow_on_start{$id} = defined($attribute) ? get_dia_attribute_value("dia:boolean",$attribute) : 0; - - $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "effort_causality"); - change_causality($id_index, $attribute, $change_effort_causality); - $bond_id_effort_causality{$id} = defined($attribute) ? get_dia_attribute_value("dia:enum",$attribute)-1 : 1; - - $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "flow_causality"); - change_causality($id_index, $attribute, $change_flow_causality); - $bond_id_flow_causality{$id} = defined($attribute) ? get_dia_attribute_value("dia:enum",$attribute)-1 : 1; - - $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "start_label"); - $bond_id_start_label{$id} = defined($attribute) ? get_dia_attribute_string($attribute) : "[]"; - - $attribute = get_first_subnode_by_nodename_attribute(1,$object_node, "dia:attribute", "name", "end_label"); - $bond_id_end_label{$id} = defined($attribute) ? get_dia_attribute_string($attribute) : "[]"; -} - -sub change_causality() { - my ($id_index, $attribute_node, $causality_change_string)=@_; - my ($mtt_id, $arrow_oriented_causality); - - foreach my $id_causality (split(/;/,$causality_change_string)) { - ($mtt_id, $arrow_oriented_causality) = split(/:/,$id_causality); - if ($mtt_id eq "all" || $id_index == $mtt_id) { - set_dia_attribute_value("dia:enum",$attribute_node,$arrow_oriented_causality + 1); - } - } -} - -sub get_bond_data { - my ( $objects_node )= @_; - my ($id_index, $obj, $id, $connections, $connection, $to, $handle, - $connections_att); - - print_debug("READING BONDS FROM $dia_input_file...\n"); - $id_index = 0; - for my $i (0..$objects_node->getLength-1) { - $obj = $objects_node->item($i); - next if ($obj->getAttributeNode("type")->getValue ne "BondGraph - MTT bond"); - - $id = $obj->getAttributeNode("id")->getValue; - - print_debug("Bond " . $id . ":\n"); - $mtt_bond_id_index{$id} = ++$id_index; - - get_arrow_info($obj,$id,$id_index); - print_debug("Flow causality ($id):" . $bond_id_flow_causality{$id} . "\n"); - print_debug("Effort causality ($id):" . $bond_id_effort_causality{$id} . "\n"); - print_debug("Arrow on start ($id):" . $bond_id_arrow_on_start{$id} . "\n"); - - # get connection info - $connections_att = $obj->getElementsByTagName('dia:connections'); - die "A bond without connections exists!\n" - unless $connections_att->getLength > 0; - - $connections = $connections_att->item(0)->getElementsByTagName('dia:connection'); - die "Bond $id does not have two connections!\n" unless - $connections->getLength == 2; - - for my $j (0..$connections->getLength-1) { - - $connection = $connections->item($j); - $handle = $connection->getAttributeNode("handle")->getValue; - $to = $connection->getAttributeNode("to")->getValue; - - print_debug("handle " . $handle . "\n"); - print_debug("to " . $to . "\n"); - - if ($handle eq "0") { - $bond_id_start_id{$id} = $to; - } else { - $bond_id_end_id{$id} = $to; - } - } - } - die "There are no bonds!\n" unless keys(%mtt_bond_id_index) > 0; -} - -# if($relax), then this routine will return 'undef' instead of dying, if valid node not found. -sub get_first_subnode_by_nodename_attribute { - my ( $relax, $node, $nodename, $key, $value)= @_; - my ($subnodes,$subnode); - - $subnodes = $node->getChildNodes; - - for my $k (0..$subnodes->getLength-1) { - next if ($subnodes->item($k)->getNodeType != ELEMENT_NODE); - next if ($subnodes->item($k)->getNodeName ne $nodename); - $subnode = $subnodes->item($k); - next if defined($value) && defined($key) && - ($subnode->getAttributeNode($key)->getValue ne $value); - - return $subnode; - } - if($relax) { - return undef; - } else { - die "I found no subnode of " . $node->getNodeName . - " named $nodename with key/value pair: ($key,$value).\n" unless - $subnode->getTagName eq $nodename && - $subnode->getAttributeNode($key)->getValue eq $value; - } -} - -sub get_first_element_subnode { - my ( $node )= @_; - my ($subnodes,$subnode); - - $subnodes = $node->getChildNodes; - - for my $k (0..$subnodes->getLength-1) { - next if ($subnodes->item($k)->getNodeType != ELEMENT_NODE); - $subnode = $subnodes->item($k); - - return $subnode; - } - die " I found no element subnode of " . $node->getNodeName . "." unless - $subnode->getNodeType == ELEMENT_NODE; -} - -sub get_first_text_subnode { - my ( $node )= @_; - my ($subnodes,$subnode); - - $subnodes = $node->getChildNodes; - - for my $k (0..$subnodes->getLength-1) { - next if ($subnodes->item($k)->getNodeType != TEXT_NODE); - $subnode = $subnodes->item($k); - - return $subnode; - } - die " I found no text subnode of " . $node->getNodeName . "." unless - $subnode->getNodeType == TEXT_NODE; -} - -sub id_cleaner { - s/#?([^#]*)#?/$1/; -} - -sub print_debug { - print STDERR $_[0] if ($debug); -} - -sub usage { - return - "\n" . - "Usage: dia2abg.pl --diagram_name [options]\n" . - "Options:\n" . - "\t--dia_input_file \n" . - "\t--dia_output_file \n" . - "\t--component_list_file\n" . - "\t--create_component_list\n" . - "\t--create_ibg\n" . - "\t--debug\n" . - "\t--ibg_file \n" . - "\t--change_flow_causality \n" . - "\t--change_effort_causality \n" . - "\n" . - "\t\tBond causality spec:\n" . - "\t\t 'bond:causality;bond:causality;...'\n" . - "\t\tbond:\n" . - "\t\t [mtt_bond_id|all]\n" . - "\t\tcausality:\n" . - "\t\t [-1|0|1]\n" . - "\n" . - "\t\tCausality is arrow-oriented-causality.\n" . - "\t\tAny causality changes are made BEFORE further processing.\n" . - "\n" -} - DELETED mttroot/mtt/bin/trans/dir2paths Index: mttroot/mtt/bin/trans/dir2paths ================================================================== --- mttroot/mtt/bin/trans/dir2paths +++ mttroot/mtt/bin/trans/dir2paths @@ -1,41 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dir2paths -# Finds paths of all valid MTT examples - -# P.J.Gawthrop Mar 98 -# Copyright (c) P.J.Gawthrop, 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/11/10 17:12:15 peterg -## Removed sorting -## -## Revision 1.1 1998/03/11 10:32:35 peterg -## Initial revision -## -############################################################### - - -dotdot=$2 # Set to ../ if we are in MTT_work - - -# Create paths for all valid examples - ie dir name is system name -find $dotdot$1 -name '*_abg.fig' -print |\ - gawk '{ - N=split($1,name,"/"); - printf("%s", name[1]); - for (i=2;i $1_rep.txt -echo "% Generated by MTT on" `date`. >> $1_rep.txt - -# Create paths for all valid examples - ie dir name is system name -dir2paths $1 $2 | sed 's/Introduction/AAAAA/g' | sort | sed 's/AAAAA/Introduction/g' | \ -gawk '{ - print "mtt -t -d " $1,$2 " rep tex"; - }' >> $1_rep.txt DELETED mttroot/mtt/bin/trans/dm2fr_m Index: mttroot/mtt/bin/trans/dm2fr_m ================================================================== --- mttroot/mtt/bin/trans/dm2fr_m +++ mttroot/mtt/bin/trans/dm2fr_m @@ -1,169 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dm2fr_m - -# Transformation: descriptor matrix to frequency response - -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.15 2003/05/08 18:46:45 gawthrop -## Fixed range bug by using isfield in place of exists -## -## Revision 1.14 2000/05/20 15:35:18 peterg -## Parameterised version -## -## Revision 1.13 1998/09/03 09:12:32 peterg -## Removed debugging lines -## -## Revision 1.12 1998/09/02 12:02:14 peterg -## Added mttinput paramater -## -## Revision 1.11 1998/08/11 13:32:42 peterg -## Lowercase mttLAST etc -## -## Revision 1.10 1998/07/27 20:27:25 peterg -## Now get parameters for simpar file. -## -## Revision 1.9 1998/02/26 15:12:26 peterg -## Removed parameter stuff -## -# Revision 1.8 1996/08/30 14:54:36 peter -# Took back lock. -# -## Revision 1.7 1996/08/24 14:23:00 peter -## Global parameter passing. -## Proper error handling. -# -## Revision 1.6 1996/08/16 14:26:07 peter -## Fixed multi-output bug. -## Made sure that u0 is ok. -## -## Revision 1.5 1996/08/15 16:23:02 peter -## Now uses W in place of w for consistancy with time responses. -## -## Revision 1.4 1996/08/15 11:52:42 peter -## Now creats a number of versions: -## fr complex frequency response -## lmfr log magnitude of fr -## lpfr phase of fr -## nyfr real and imag parts - Nyquist style -## nifr Nichols style. -## -## Revision 1.3 1996/08/11 19:08:08 peter -## Parameter passing now enabled. -## -## Revision 1.2 1996/08/11 09:32:12 peter -## Now takes the numpar parameters correctly -## -## Revision 1.1 1996/08/10 14:11:11 peter -## Initial revision -## -############################################################### - -echo Creating $1_fr.m -echo Creating $1_lmfr.m -echo Creating $1_lpfr.m -echo Creating $1_nyfr.m -echo Creating $1_nifr.m - -#if [ "$2" = "" ]; -#then -# PARAMS='W=logspace(-1,2,100); u0=zeros(nu,1); u0(1)=1;' -# echo Using default parameter $PARAMS -#else -# PARAMS=$2; -#fi - -$MATRIX << EOF > dm2fr_m.log 2>mtt_error.txt - -# Data - mttpar=$1_numpar; - -# Simulation parameters - simpar=$1_simpar; - - [nx,ny,nu,nz,nyz] = $1_def; - - %Defaults - - if (isfield(simpar,"wmin")==0) - simpar.wmin = -1; - end; - - if (isfield(simpar,"wmax")==0) - simpar.wmax = 2 - end; - - if (isfield(simpar,"wsteps")==0) - simpar.wsteps = 100; - end; - - W = logspace(simpar.wmin,simpar.wmax,simpar.wsteps)'; - if (isfield(simpar,"mttinput")==0) - mttinput = 1; - end; - mttu0 = zeros(nu,1); - mttu0(mttinput) = 1; - - [n,m]=size(W); - if m>n - W=W'; - end; - - [n,m]=size(mttu0); - if m>n - mttu0=mttu0'; - end; - - [A,B,C,D,E] = $1_dm(mttpar); - fr = dm2fr(A,B,C,D,E,W,mttu0); - lw = log10(W); - lmfr = log10(abs(fr)); - pfr = angle(fr)*180/pi; - -% Complex frequency response - write_matrix([W fr], "$1_fr"); - -% Log magnitude v log frequency - write_matrix([lw lmfr], "$1_lmfr"); - -% Angle v log frequency - write_matrix([lw pfr], "$1_lpfr"); - -% Nyquist style - re = real(fr); - im = imag(fr); - nyq = [re(:,1) im(:,1)]; - for i = 2:ny - nyq = [nyq re(:,i) im(:,i)]; - end; - write_matrix(nyq, "$1_nyfr"); - -% Nichols style - re = lmfr; - im = pfr; - nic = [im(:,1) re(:,1)]; - for i = 2:ny - nic = [nic im(:,i) re(:,i)]; - end; - write_matrix(nic, "$1_nifr"); - -EOF - -# Now invoke the standard error handling," -mtt_error mtt_error.txt - - - - - - DELETED mttroot/mtt/bin/trans/dm2ir_m2dat Index: mttroot/mtt/bin/trans/dm2ir_m2dat ================================================================== --- mttroot/mtt/bin/trans/dm2ir_m2dat +++ mttroot/mtt/bin/trans/dm2ir_m2dat @@ -1,62 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dat2ps - -# Tramsforms descriptor matrix rep to frequency response dat. - - -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1996/08/11 19:48:29 peter -## Parameter passing added. -## -## Revision 1.2 1996/08/11 10:40:00 peter -## Now handles e and NaN numbers. -## -## Revision 1.1 1996/08/10 14:15:03 peter -## Initial revision -## -############################################################### - -echo Creating $1_ir.dat - -if [ "$2" = "" ]; -then - PARAMS='t=[0:0.1:10]' - echo Using default parameter $PARAMS -else - PARAMS=$2; -fi - - -$MATRIX << EOF | gawk '$1 !~ /[A-MO-Zb-cf-z]/ && NF>0 {print} ' >$1_ir.dat - - $PARAMS; - [n,m]=size(t); - if m>n - t=t'; - end; - - [A,B,C,D,E] = $1_dm($1_numpar); - y = dm2ir(A,B,C,D,E,t); - - [Ny,Nu]=size(D); - NN = Ny*Nu; - - xy = [t y(:,1)]; - for i=2:NN - xy = [xy t y(:,i)]; - end; -xy - -EOF - DELETED mttroot/mtt/bin/trans/dm2tf_r Index: mttroot/mtt/bin/trans/dm2tf_r ================================================================== --- mttroot/mtt/bin/trans/dm2tf_r +++ mttroot/mtt/bin/trans/dm2tf_r @@ -1,89 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dm2tf_r -# Reduce descriptor matrices to transfer function -# P.J.Gawthrop 8th May 1991, Dec 1993, April 1994. -# Copyright (c) P.J.Gawthrop, 1991, 1993, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/03/27 15:00:23 peterg -## reduce ---> symbolic -## -## Revision 1.1 1996/08/25 10:09:55 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_tf.r - -# Remove the old log file -rm -f dm2tf_r.log - -# Use reduce to accomplish the transformation -$SYMBOLIC >dm2tf_r.log << EOF - -%ON FLOAT; - -IN "$1_def.r"; -IN "$1_dm.r"; -IN "$1_subs.r"; - -OFF Echo; -OFF Nat; - -%create sE-A -%MTT_SEA := s*MTTE-MTTA; - -%Find the denominator of the TF - det(sE-A); -%comden := det(MTT_SEA); - -%Find the Adjoint transpose. -%matrix AdjT(MTTNx,MTTNx); -%FOR i := 1:MTTNx DO -% BEGIN -% FOR j := 1:MTTNx DO -% AdjT(i,j) := cofactor(MTT_SEA,i,j); -% END; - -%Adj := TP(AdjT); - -%Find the numerator matrix -%Num := MTTC*Adj*MTTB + MTTD*comden; - - -%Create the transfer function matrix -MTTTF := MTTD; -IF MTTNy>0 THEN MTTTF := MTTTF + (MTTC * ((s*MTTE-MTTA)^-1) * MTTB); - -%MTTTF := Num/comden; - - -OUT "$1_tf.r"; - -%Declare the transfer function matrix -write "matrix MTTTF(", MTTNy, ",", MTTNu, ")$"$ - -%And write it. -%MTTTF := MTTTF; -FOR i := 1:MTTNy DO - BEGIN - FOR j := 1:MTTNu DO - IF MTTTF(i,j) NEQ 0 THEN write "MTTTF(", i, ",", j, ") := ", MTTTF(i,j)$ - END; - -write ";END;"$ -SHUT "$1_tf.r"; - -EOF - -# Now invoke the standard error handling. -mtt_error_r dm2tf_r.log DELETED mttroot/mtt/bin/trans/dm_r2m Index: mttroot/mtt/bin/trans/dm_r2m ================================================================== --- mttroot/mtt/bin/trans/dm_r2m +++ mttroot/mtt/bin/trans/dm_r2m @@ -1,131 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dm_r2m -# Reduce descriptor state-space A,B,C,D and E matrices to Matlab -# P.J.Gawthrop 29th July 1990, 6th Feb 1991, 28 May 1991, Dec 1993, Jan 94 -# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993,1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 1998/04/13 11:01:55 peterg -## Now uses generic header : matlab_header -## -# Revision 1.6 1997/04/16 13:43:29 peterg -# Added matrix dimenensions -# -# Revision 1.5 1997/02/24 14:44:28 peterg -# Ignores numerical parameters in global list. -# -## Revision 1.4 1996/08/24 14:16:25 peter -## Global parameter passing. -## -## Revision 1.3 1996/08/18 12:02:46 peter -## Fixed bug when some matrices are empty. -## -## Revision 1.2 1996/08/12 20:22:20 peter -## Paramaters passed via an internal call to _numpar. -## _args script can overide these parameters - sneaky. -## -## Revision 1.1 1996/08/12 19:09:13 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_dm.m - -# Remove the old log file -rm -f dm_r2m.log - -# Use reduce to accomplish the transformation -reduce >dm_r2m.log << EOF - -ON BigFloat, NumVal; -PRECISION 16; %Compatible with Matlab - -%Read in the definitions file -in "$1_def.r"; - -%Set up the number of argument variables to zero in case the user has forgotten -MTTNVar := 0; - -%Read in the parameter file -%%in "$1_sympar.r"; - -%Read the reduce state-space A,B,C and D matrices file -in "$1_dm.r"; - -IF MTTNvar>0 THEN -BEGIN - write "% Set the parameters"; - write "global ...;;"; - FOR i := 1:MTTNvar DO - BEGIN - IF numberp(MTTVar(i,1)) - THEN - BEGIN - % Do nowt - END - ELSE - BEGIN - write MTTVar(i,1), " ..."; - END; - END; - write " "; -END; - - -%Fortran switches - one line expressions -OFF echo; -ON fort$ -cardno!* := 1$ -fortwidth!* := 100$ -OFF period$ - -MTTN := MTTNx + 2*MTTNz + MTTNyz; -write "MTTA = zeros(", MTTN, ",", MTTN, ");"; -write "MTTB = zeros(", MTTN, ",", MTTNu, ");"; -write "MTTC = zeros(", MTTNy, ",", MTTN, ");"; -write "MTTD = zeros(", MTTNy, ",", MTTNu, ");"; -write "MTTE = zeros(", MTTN, ",", MTTN, ");"; - -OUT "$1_dm.1"; - -ON NERO; % Suppress zero elements. -MTTA := MTTA; -MTTB := MTTB; -MTTC := MTTC; -MTTD := MTTD; -MTTE := MTTE; - -SHUT "$1_dm.1"; - - -EOF - -# Header -matlab_header $1 dm 'A,B,C,D,E'> $1_dm.m - -#Define array sizes. -grep -v 'function' $1_def.m | grep -v '%' >> $1_dm.m -echo 'mtta = zeros(nx+nyz+2*nz,nx+nyz+2*nz);' >> $1_dm.m -echo 'mttb = zeros(nx+nyz+2*nz,nu);' >> $1_dm.m -echo 'mttc = zeros(ny,nx+nyz+2*nz);' >> $1_dm.m -echo 'mttd = zeros(ny,nu);' >> $1_dm.m -echo 'mtte = zeros(nx+nyz+2*nz,nx+nyz+2*nz);' >> $1_dm.m - - -#Code -cat $1_dm.1 >> $1_dm.m - - -rm -f $1_dm.1 - - DELETED mttroot/mtt/bin/trans/dm_r2tex Index: mttroot/mtt/bin/trans/dm_r2tex ================================================================== --- mttroot/mtt/bin/trans/dm_r2tex +++ mttroot/mtt/bin/trans/dm_r2tex @@ -1,163 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: dm_r2tex -# Reduce descriptor matrices to LaTex descriptor matrices. -# P.J.Gawthrop 9 June 1990, 8th July 1990, 14 Feb 1991, 10th May 1991, 4th June 1991 -# Copyright (c) P.J.Gawthrop, 1990, 1991. - -#Inform user -echo Creating $1_dm.tex - -# Remove the old log file -rm -f dm_r2tex.log - -# Use reduce to accomplish the transformation -reduce >dm_r2tex.log << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the symbolic parameters file -%%in "$1_sympar.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Number of descriptor variables -MTTN := MTTNx + 2*MTTNz + MTTNyz; - -%Read the descriptor matrices file -in "$1_dm.r"; - -OFF Echo; -OFF Nat; - -OUT "$1_dm.tex"; - -%Write out the descriptor matrices. -write "%Descriptor matrices $1"; -write "%File: $1_dm.tex"; -write""; - -write "%Descriptor matrices"; - -%IF (MTTNz+MTTNyz) NEQ 0 THEN -%BEGIN -% write "% - E matrix"; -% write "\begin{equation}"; -% write "MTTE = MTTI_0(", MTTNx+MTTNz, ",", MTTNz+MTTNyz, ")"; -% write "\end{equation}"; -%END; - - -IF MTTN NEQ 0 THEN -IF (MTTNz+MTTNyz) > 0 THEN -BEGIN -write "% - E matrix"; -write "\begin{equation}"; -write "MTTE = \begin{pmatrix}"; - FOR Row := 1:MTTN DO - BEGIN - FOR Col := 1:MTTN DO - BEGIN - Write "{", MTTE(Row,Col), "}"; - IF Col doc2dvi.log -bibtex $system >> doc2dvi.log -latex $system.doc >> doc2dvi.log -latex $system.doc >> doc2dvi.log - -if [ "$documenttype" = "book" ]; then - makeindex $system >> doc2dvi.log -else - touch $system.ind -fi - -latex $system.doc >> doc2dvi.log -latex $system.doc >> doc2dvi.log - -# Make sure transformation succeeeds -exit 0 DELETED mttroot/mtt/bin/trans/doc2pdf Index: mttroot/mtt/bin/trans/doc2pdf ================================================================== --- mttroot/mtt/bin/trans/doc2pdf +++ mttroot/mtt/bin/trans/doc2pdf @@ -1,43 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: doc2pdf -# Converts doc file to pdf file - -# Copyright (c) P.J.Gawthrop 1998 - - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## -############################################################### - -system=$1 -documenttype=$2 - -# Inform user -echo "Creating $system.pdf" - -#Run pdflatex , bibtex and makeindex -pdflatex $system.doc > doc2pdf.log -bibtex $system >> doc2pdf.log -pdflatex $system.doc >> doc2pdf.log -pdflatex $system.doc >> doc2pdf.log - -if [ "$documenttype" = "book" ]; then - makeindex $system >> doc2pdf.log -else - touch $system.ind -fi - -pdflatex $system.doc >> doc2pdf.log -pdflatex $system.doc >> doc2pdf.log - -# Make sure transformation succeeeds -exit 0 DELETED mttroot/mtt/bin/trans/doc2ps Index: mttroot/mtt/bin/trans/doc2ps ================================================================== --- mttroot/mtt/bin/trans/doc2ps +++ mttroot/mtt/bin/trans/doc2ps @@ -1,43 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: doc2dvi -# Converts doc file to dvi file - -# Copyright (c) P.J.Gawthrop 1998 - - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 1999/11/02 07:56:46 peterg -## Removed documenttype in blurb -## -## Revision 1.3 1998/11/24 12:03:27 peterg -## Indexing of book docs. -## -## Revision 1.2 1998/04/15 18:40:43 peterg -## Run LateX three times -## -## Revision 1.1 1998/03/03 08:35:50 peterg -## Initial revision -## -############################################################### - -system=$1 -documenttype=$2 - -# Inform user -echo "Creating $system.ps" - -doc2dvi $system $documenttype - -dvips -o $system.ps $1 - -# Make sure transformation succeeeds -exit 0 DELETED mttroot/mtt/bin/trans/ese2rdae_r Index: mttroot/mtt/bin/trans/ese2rdae_r ================================================================== --- mttroot/mtt/bin/trans/ese2rdae_r +++ mttroot/mtt/bin/trans/ese2rdae_r @@ -1,294 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ese2rdae_r -# Reduce equations to raw differential-algebraic equation conversion -# P.J.Gawthrop 8th May 1991, May 1994, June 1996 -# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.14 2002/08/30 15:39:04 geraint -## Read fix_c.r before ese.r and explicitly overload ** operator with pow(). -## These changes are required for the Codemist version of Reduce. -## -## Revision 1.13 2002/06/28 10:13:40 geraint -## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. -## -## Revision 1.12.2.2 2002/06/05 17:28:00 geraint -## Cosmetic change. -## -## Revision 1.12.2.1 2002/06/05 11:14:51 geraint -## ae.r now generated using def2write_r like cse?.r -## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r. -## -## These changes produce the desired result (optimised algebraic equations) but -## have highlighted a problem; when optimisation fails, Reduce does not write -## a result. For complicated systems, this can lead to missing assignments in -## the resultant code. -## -## Revision 1.12 2001/07/23 23:31:17 gawthrop -## Added -cr option to load CRs first - avoids alg. loops with R -## implementation of mutiports. -## -## Revision 1.11 2001/07/06 00:46:50 gawthrop -## Added -cr option -- forces cr to be loaded before the ese.r file -## This avoids causality problems when using multi-port Rs to represent -## arbitary equations -## -## Revision 1.10 2000/11/30 15:23:16 peterg -## Taken out all subsystem stuff - now done in mtt using -## mtt_make_subsystems -## -## Revision 1.9 2000/09/07 12:18:31 peterg -## Prettified layout of this file -## -## Revision 1.8 2000/09/07 12:07:26 peterg -## *** empty log message *** -## -## Revision 1.7 2000/09/01 13:34:15 peterg -## Exit on option error -## -## Revision 1.6 2000/09/01 13:30:32 peterg -## Added -partition switch -## -## Revision 1.5 2000/09/01 12:14:57 peterg -## Added connecti9ng inputs -## -## Revision 1.4 1998/04/07 15:06:46 peterg -## Correct log file name -## -## Revision 1.3 1998/03/07 12:57:19 peterg -## Fixed logname bug -## -## Revision 1.2 1998/03/07 12:51:20 peterg -## This is the new version of ese2dae - it does not do the CRs at this -## stage to give reduce an easier time. -## -## rese2ese_r does the constitutive relationship bit -## -## Revision 1.1 1998/03/07 12:49:31 peterg -## Initial revision -## -## Revision 1.12 1998/01/31 16:22:59 peterg -## Added IF MTTNx>0 THEN and IF MTTNy>0 THEN before the relevant -## assignements of MTTdX and MTTY to themselves. -## -## Revision 1.11 1997/09/18 09:45:08 peterg -## Canged the comment about linux reduce -- reduce reads this for some -## reason. -## -## Revision 1.10 1997/09/15 14:21:18 peterg -## Reads ese file twice to avoid a bug in Linux reduce !!!??? -## -## Revision 1.9 1997/08/30 09:59:31 peterg -## Changed mehtod of writing out mtty to avoid a strange segmentation violation. -## Now uses MTTY := MTTY; approach. -## -## Revision 1.8 1997/04/23 09:31:20 peterg -## Now reads in the (top level) def file in the generated reduce code. -## -# Revision 1.7 1997/04/23 09:23:15 peterg -# Two argument version in preparation for heirarchical version -# -# Revision 1.6 1996/11/21 15:47:48 peterg -# Now inputs _params.r not _sympar.r -# -## Revision 1.5 1996/11/02 10:17:35 peterg -## Removed default constitutive relationship input. -## -# Revision 1.4 1996/09/12 12:10:05 peter -# Now reads the default constitutive relationship file. -# -## Revision 1.3 1996/08/25 09:43:26 peter -## General error handling. -## -## Revision 1.2 1996/08/25 08:31:28 peter -## Error handling added. -## -############################################################### - - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I ) - info=info;; - -cr ) - load_cr=yes; - blurb2=' using cr and subs first'; - ;; - -fixcc ) - include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` - blurb3='fixing c and cc code'; - ;; - -partition ) - partition=yes; - blurb='with partitioning'; - ;; - -sort ) - sort=sort; - blurb1='using sorted equations'; - ;; - *) - echo "$1 is an invalid argument - ignoring"; - exit ;; - esac - shift -done - -#Create the top-level system name -topname=$1 - -#Create the system names -if [ -z "$2" ]; - then - sysname=$topname; - else - sysname=$1_$2; -fi - -defname=$topname"_def.r" -crname=$topname"_cr.r" -subsname=$topname"_subs.r" -paramname=$topname"_params.r" -daename=$sysname"_rdae.r" - -if [ -n "$sort" ]; then - esename=$sysname"_sese.r" -else - esename=$sysname"_ese.r" -fi - -logname=ese2rdae.log - -if [ -n "${load_cr}" ]; then - load_cr_comm="in \"${crname}\";" - load_subs_comm="in \"${subsname}\";" -fi - -# Inform user -echo Creating $daename $blurb $blurb1 $blurb2 $blurb3 - -# Remove the old log file -rm -f $logname - -# Use symbolic algebra to accomplish the transformation -$SYMBOLIC >$logname << EOF - -%Read in the cr and sub when -cr is set -$load_cr_comm -$load_subs_comm - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - -% Definitions -in "$defname"; - -% Fix c code if required -$include - -% Elementary system equations -in "$esename"; - -OFF Echo; -OFF Nat; - -%Create the output file -OUT "$daename"; - -write "in ""$defname"""; - -% State -MTT_Matrix := MTTdX$ -MTT_Matrix_name := "MTTdX"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Nonstate -MTT_Matrix := MTTZ$ -MTT_Matrix_name := "MTTZ"$ -MTT_Matrix_n := MTTNz$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Output -MTT_Matrix := MTTy$ -MTT_Matrix_name := "MTTy"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Zero outputs -MTT_Matrix := MTTYz$ -MTT_Matrix_name := "MTTYz"$ -MTT_Matrix_n := MTTNyz$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - - -SHUT "$daename"; -quit; - -EOF - -#if [ -n "$partition" ]; then -# rm -f mtt_junk -# # Now for the subsystems -# # Find subsystems -# subsystems=`mtt_get_subsystems $1` -# -# for subsystem in $subsystems; do -# echo Doing $subsystem -# ucname="MTT_"$subsystem"_uc" -# -# Nu=`mtt_getsize -internal $subsystem u` -# echo Nu $Nu -# -# # Use symbolic algebra to accomplish the transformation -# $SYMBOLIC >$logname << EOF -# -# %Read the formatting function -# in "$MTTPATH/trans/reduce_matrix.r"; -# -# % Definitions -# in "$defname"; -# -# % Elementary system equations -# in "$esename"; -# -# OFF Echo; -# OFF Nat; -# -# %Create the output file -# OUT "mtt_junk"; -# % Connecting inputs -# MTT_Matrix := $ucname $ -# MTT_Matrix_name := "$ucname" $ -# MTT_Matrix_n := $Nu $ -# MTT_Matrix_m := 1$ -# Reduce_Matrix()$ -# -# shut "mtt_junk"; -#EOF -# echo >> $1_rdae.r -# echo %Connections for subsystem $subsystem >> $1_rdae.r -# echo >> $1_rdae.r -# -# cat mtt_junk >> $1_rdae.r -# rm -rf mtt_junk -# done -#fi - -echo "END;" >> $1_rdae.r - -# Now invoke the standard error handling. -mtt_error_r $logname - DELETED mttroot/mtt/bin/trans/ese_r2txt.pl Index: mttroot/mtt/bin/trans/ese_r2txt.pl ================================================================== --- mttroot/mtt/bin/trans/ese_r2txt.pl +++ mttroot/mtt/bin/trans/ese_r2txt.pl @@ -1,13 +0,0 @@ -#! /usr/bin/perl -w - -use strict; - -$/ = ';'; # statements are terminated by ; -while () { - chomp; - s/%.*\n//g; # strip comments (% to end of line) - s/(\s)*//g; # strip whitespace - s/^END$//; # strip junk - next if /^(\s)*$/; # skip blank lines - printf ("%s\n", $_); # print what remains -} DELETED mttroot/mtt/bin/trans/ese_tidy Index: mttroot/mtt/bin/trans/ese_tidy ================================================================== --- mttroot/mtt/bin/trans/ese_tidy +++ mttroot/mtt/bin/trans/ese_tidy @@ -1,29 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -# Bourne shell script: ese_tidy -# Tidies up Matlab format files -# P.J.Gawthrop May 1998 -# Copyright (c) P.J.Gawthrop, 1990, 1994, 1995. - -#Puts the state & output equations at the end of the file - -grep -v '^MTT' $1_ese.r>junk1 -grep '^MTT' $1_ese.r>junk2 -echo 'END;' >junk3 -cat junk1 junk2 junk3> $1_ese.r - - - - DELETED mttroot/mtt/bin/trans/ese_txt2make.pl Index: mttroot/mtt/bin/trans/ese_txt2make.pl ================================================================== --- mttroot/mtt/bin/trans/ese_txt2make.pl +++ mttroot/mtt/bin/trans/ese_txt2make.pl @@ -1,205 +0,0 @@ -#! /usr/bin/perl -w -# -# ese_txt2make.pl - sorts equations using Make -# Copyright (C) 2004 Geraint Paul Bevan -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -------------------------- -# Model Transformation Tools -# -------------------------- -# -# Creates a makefile from the elementary system equations -# Executing the makefile causes make to sort the equations -# -#------------------------------------------------------------------------------- - -use strict; -use Getopt::Long; - -my %dependencies; # left-values right-dependencies -my %expressions; # left-values right-expression - -my $sys = ''; -my $debug = 0; -my $infile = ''; -my $outfile = ''; - -GetOptions ('sys=s' => \$sys, - 'debug' => \$debug, - 'infile=s' => \$infile, - 'outfile=s' => \$outfile); - -# default file names -$infile = "${sys}_ese.txt" if ($infile eq ''); -$outfile = "${sys}_ese.make" if ($outfile eq ''); - -#------------------------------------------------------------------------------- -# main -#------------------------------------------------------------------------------- - -if ($debug) { - my $logfile = "ese_txt2make_${sys}.log"; - open (LOG, ">$logfile") or die ("MTT: ese_txt2make, cannot open $logfile"); -} - -# First the elementary system equations are read -# and placed in the "expressions" hash. -read_ese_txt (); - -# Then the occurence of any lvalue in the expression -# of any other is sought. -get_dependencies (); - -# Finally the expressions are written to a makefile -# where the targets are the left hand values and the -# pre-requisites are the dependencies -write_make ($sys); - -close (LOG) if ($debug); - -#------------------------------------------------------------------------------- -# subroutines -#------------------------------------------------------------------------------- -sub read_ese_txt { - - open (ESE, $infile) - or die ("MTT Error:\nese_txt2make, cannot open $infile\n"); - - while () { - - chomp; - - # separate the left and right side of equations - # and assign them to the expressions hash - my ($lvar,$expr) = split (/:=/); - $expressions{$lvar} = $expr; - - print LOG "$lvar\t= $expressions{$lvar}\n" if $debug; - } - - close (ESE); -} -#------------------------------------------------------------------------------- -sub get_dependencies { - - # compare the pattern to each expression - foreach my $lvar (keys %expressions) { - $dependencies{$lvar} = ""; - $_ = $expressions{$lvar}; - for my $lvar2 (keys %expressions) { - if ($expressions{$lvar} =~ /$lvar2/) { - # a left value has been found in the expression - # add it to the dependencies for this lvar - $dependencies{$lvar} = "$dependencies{$lvar} $lvar2"; - } - } - print LOG "$lvar:\t$dependencies{$lvar}\n" if $debug; - } -} -#------------------------------------------------------------------------------- -sub write_make { - - # create lists of rates, states and tmpvars so that - # separate rules can be created in the makefile - my @list_of_rates; - my @list_of_outputs; - my @list_of_unknown; - my @list_of_nonstates; - my @list_of_tmpvars; - - for my $lvar (sort (keys %expressions)) { - if ($lvar =~ /^MTTdX\(/) { - @list_of_rates = (@list_of_rates, $lvar) ; - } elsif ($lvar =~ /^MTTy\(/) { - @list_of_outputs = (@list_of_outputs, $lvar); - } elsif ($lvar =~ /^MTTyz/) { - @list_of_unknown = (@list_of_unknown, $lvar); - } elsif ($lvar =~ /^MTTz/) { - @list_of_nonstates = (@list_of_nonstates, $lvar); - } elsif ($lvar =~ /^${sys}_/) { - @list_of_tmpvars = (@list_of_tmpvars, $lvar); - } else { - die "MTT Error:\nese_txt2make, unclassified variable: $lvar\n"; - } - } - my @sorted_rates = sort (@list_of_rates); - my @sorted_outputs = sort (@list_of_outputs); - my @sorted_unknown = sort (@list_of_unknown); - my @sorted_nonstates = sort (@list_of_nonstates); - my @sorted_tmpvars = sort (@list_of_tmpvars); - - - # write the header - open (ESE, ">$outfile") or - die ("MTT Error:\nese_txt2make, cannot open $outfile\n"); - - my $date = localtime; - - print ESE - "# $outfile\t-*-makefile-*-\n" . - "#\n"; - - print ESE - "#\t\t--------------------------\n" . - "#\t\tModel Transformation Tools\n" . - "#\t\t--------------------------\n" . - "#\n" . - "# Created by MTT: $date\n\n"; - - # write the rules that external programs use - print ESE - "all: declare_tmpvars MTTdX MTTy\n\n" . - "MTTdX: @sorted_rates\n\n" . - "MTTy: @sorted_outputs\n\n" . - "MTTyz: @sorted_unknown\n\n" . - "MTTz: @sorted_nonstates\n\n"; - - # set the default output format: - # double tmpvar; - # lvalue := expression; - print ESE - "# default output format\n" . - "ifeq (\"\$(assignment)\",\"\")\n" . - "assignment=:=\n" . - "endif\n\n" . - "ifeq (\"\$(declaration)\",\"\")\n" . - "declaration=double\n" . - "endif\n\n" . - "ifeq (\"\$(terminator)\",\"\")\n" . - "terminator=;\n" . - "endif\n\n"; - - # write a rule to declare the temporary variables - print ESE - "# declare temporary variables\n" . - "declare_tmpvars:\n"; - for my $var (@sorted_tmpvars) { - print ESE "\t\@echo \"\$(declaration) $var \$(terminator)\"\n"; - } - print ESE "\n"; - - # write the equations - print ESE "# the equations\n"; - for my $lvar (sort (keys %expressions)) { - print ESE "$lvar: $dependencies{$lvar}\n"; - print ESE "\t\@echo \"$lvar \$(assignment) " . - "$expressions{$lvar} \$(terminator)\"\n\n"; - } - print ESE "\n"; - - close (ESE); -} -#------------------------------------------------------------------------------- DELETED mttroot/mtt/bin/trans/examples_txt2tk Index: mttroot/mtt/bin/trans/examples_txt2tk ================================================================== --- mttroot/mtt/bin/trans/examples_txt2tk +++ mttroot/mtt/bin/trans/examples_txt2tk @@ -1,45 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: examples_txt2tk -# Creates tk/tcl file for xmtt. -# Copyright (c) P.J.Gawthrop, 1998,1999 - - -# Examples menu -gawk 'BEGIN{ - basemenu=".exam.exam" - oldmenu=basemenu - OLDPATH=""; - } - { - if (NF>1){ - PATH=$1; - N=split(PATH,path,"/"); # Find current example path - oldN=split(OLDPATH,oldpath,"/"); # Find last example path - same=1; menu=basemenu; - while ((path[same]==oldpath[same])&&(same<=N)){ - menu=menu"."tolower(path[same]) - same++ - } - oldmenu=menu - for (i=same;i> $1.fig < ${log} 2> ${err} </dev/null - if [ $? = "0" ]; then - grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\ - gawk '{ - printf("mtt_units.sh %s %s %s %s %s\n", sys, $2, $3, $4, $5) - }' sys=${sys} | sh | grep ERROR - if [ $? = "0" ]; then - echo " " *MTT_ERROR: domains and units are not OK - exiting - exit 1 - else - echo " " domains and units are OK - fi - else - echo " no domains or units declared" - fi -} - -check_ports_exist() -{ - declared_ports=`grep '^[\s]*[#|%]UNITS' < ${lbl_file} | gawk '{print $2}'` - for declared_port in $declared_ports; do - grep "${sys}\.ports\.${declared_port}\.type" ${abg_file} >/dev/null - if [ $? = "1" ]; then - echo "*MTT_ERROR: Units declared for non-existent port ${declared_port}" - exit 1 - fi - done -} - -set_units() -{ - grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\ - gawk '{ - printf(" %s.ports.%s.domain = \"%s\";\n", sys, $2, $3); - printf(" %s.ports.%s.units.effort = \"%s\";\n", sys, $2, $4); - printf(" %s.ports.%s.units.flow = \"%s\";\n", sys, $2, $5); - }' sys=${sys} -} - -if [ -z "$units" ]; then - echo Checking port domains and units - check_ports_exist; - test_units; - echo "## Port domain and units" >> ${abg_file} - set_units >> ${abg_file} -fi - -# Append any VAR declarations -if [ -f "$1_lbl.txt" ]; then - echo "## Explicit variable declarations" >> ${abg_file} - grep '^[\s]*[%|#][V|P]AR' $1_lbl.txt | tr '%' '#' >> ${abg_file} - grep '^[\s]*[%|#]NOT[V|P]AR' $1_lbl.txt | tr '%' '#' >> ${abg_file} -fi - -# Close off the function -echo "endfunction" >> ${abg_file} - -# Errors and info -if [ "$info" = "info" ]; then - cat mtt_info.txt -fi - -if mtt_error mtt_error.txt; then - exit 0 -else - exit 1 -fi DELETED mttroot/mtt/bin/trans/icd2ICD_txt22txt.sh Index: mttroot/mtt/bin/trans/icd2ICD_txt22txt.sh ================================================================== --- mttroot/mtt/bin/trans/icd2ICD_txt22txt.sh +++ mttroot/mtt/bin/trans/icd2ICD_txt22txt.sh @@ -1,31 +0,0 @@ -#! /bin/sh - -sys=$1 -icd=${sys}_*_icd.txt2 -ICD=${sys}_ICD.txt - -echo Creating ${ICD} - -# lbl.txt ICD Format: -# [#|%]ICD PortName EffortName,EffortUnit;FlowName,FlowUnit -# $1 $2 $3 -# Comma / Semi-colon distinction unenforced - -# icd.txt Format -# PortName EffortName,EffortUnit;FlowName,FlowUnit input|output,input|output -# $1 $2 $3 $4 $5 $6 $7 - -cat < ${ICD} -## Interface Control Definition for System ${sys} -## ${ICD}: Generated by MTT `date` - -EOF - -cat ${icd} |\ - sed 's/[\,\;]/\ /g' |\ - gawk ' - ($2 != "null" && $6 == "input") { printf ("Input: %-30s %-30s Causality: Effort Units: %s\n", $2, $1, $3) } - ($4 != "null" && $7 == "input") { printf ("Input: %-30s %-30s Causality: Flow Units: %s\n", $4, $1, $5) } - ($2 != "null" && $6 == "output") { printf ("Output: %-30s %-30s Causality: Effort Units: %s\n", $2, $1, $3) } - ($4 != "null" && $7 == "output") { printf ("Output: %-30s %-30s Causality: Flow Units: %s\n", $4, $1, $5) } - ' | sort >> ${ICD} DELETED mttroot/mtt/bin/trans/icd_txt2m.sh Index: mttroot/mtt/bin/trans/icd_txt2m.sh ================================================================== --- mttroot/mtt/bin/trans/icd_txt2m.sh +++ mttroot/mtt/bin/trans/icd_txt2m.sh @@ -1,18 +0,0 @@ -#! /bin/sh - -# Inform user -echo Creating $1_icd.m - -#Create the component ICD file complete with headers. -echo "function icd = $1_icd" > $1_icd.m -echo "%% Component icd file ($1_icd.m)" >> $1_icd.m -echo "%% Generated by MTT at `date`" >> $1_icd.m - -#Write out the variables -gawk '{ - if (NF==2) {i++; print "icd."$1 "\t = \""$2"\";"} - - } - END{ - if (i==0) print "icd = 0;" - }' $1_icd.txt >> $1_icd.m DELETED mttroot/mtt/bin/trans/ker_r2tex Index: mttroot/mtt/bin/trans/ker_r2tex ================================================================== --- mttroot/mtt/bin/trans/ker_r2tex +++ mttroot/mtt/bin/trans/ker_r2tex @@ -1,61 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ker_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. -# Copyright (C) 2001 by Peter J. Gawthrop - - -# Inform user -echo Creating $1_ker.tex - -# Remove the old log file -rm -f ker_r2tex.log - -# Use reduce to accomplish the transformation -reduce >ker_r2tex.log << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the constrained-state matrices file -in "$1_ker.r"; - -%Read the symbolic parameters file -%%in "$1_sympar.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; - -MATRIX MTT_Matrix(MTTNy-MTTNu,MTTNy); - -OUT "$1_ker.tex"; - -%Write out the kernel matrix -write "%Kernel matrices $1"; -write "%File: $1_ker.tex"; -write""; - -MTT_Matrix := MTTR$ -MTT_Matrix_name := "MTTR"$ -MTT_Matrix_n := MTTNy-MTTNu$ -MTT_Matrix_m := MTTNy$ -LaTeX_Matrix()$ - -SHUT "$1_ker.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/labg_fig2ps Index: mttroot/mtt/bin/trans/labg_fig2ps ================================================================== --- mttroot/mtt/bin/trans/labg_fig2ps +++ mttroot/mtt/bin/trans/labg_fig2ps @@ -1,12 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: labg_fig2ps - -# Eps figures from labg rep. -echo Creating $1.ps -fig2ps --nogv --forcespecial --add=$MTT_LIB/latex/bg $1.fig >/dev/null - DELETED mttroot/mtt/bin/trans/landscape2portrait.sh Index: mttroot/mtt/bin/trans/landscape2portrait.sh ================================================================== --- mttroot/mtt/bin/trans/landscape2portrait.sh +++ mttroot/mtt/bin/trans/landscape2portrait.sh @@ -1,28 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: landscape2portrait.sh -# Converts one or more figure files from landscape mode to portrait mode - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ############################################################### - -# Copyright (C) 2001 by Peter J. Gawthrop - -figfiles=$* - -for figfile in $figfiles; do - count=`grep -c Landscape $figfile` - if [ "$count" = "1" ]; then - echo Converting $figfile - mv $figfile ${figfile}.bak - sed 's/Landscape/Portrait/'< ${figfile}.bak > $figfile - fi -done DELETED mttroot/mtt/bin/trans/lang_header Index: mttroot/mtt/bin/trans/lang_header ================================================================== --- mttroot/mtt/bin/trans/lang_header +++ mttroot/mtt/bin/trans/lang_header @@ -1,243 +0,0 @@ -#!/bin/sh - -# Generates function header for a computer language -# PJ Gawthrop May 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.11 2000/05/11 08:03:02 peterg -## Remove the mtt no global stuff -## -## Revision 1.10 2000/04/18 11:14:32 peterg -## - parameters option -## -## Revision 1.9 2000/04/08 10:23:38 peterg -## Added -noglobal option -## -## Revision 1.8 1999/02/16 04:14:53 peterg -## Small change to modeline generation -## -## Revision 1.7 1999/01/20 22:19:21 peterg -## Puts emacs mode line at top of .m files -## -## Revision 1.6 1998/07/27 20:30:39 peterg -## Mods for dm rep - no globals ... -## -## Revision 1.5 1998/07/25 20:42:30 peterg -## No assignements for switch either -## -## Revision 1.4 1998/07/25 10:43:10 peterg -## No assignments of x or u if sm rep. -## -## Revision 1.3 1998/07/19 15:52:15 peterg -## Don't call the _input function - make it external from now on ... -## -## Revision 1.2 1998/05/24 12:47:39 peterg -## This still needs worjk doing for c generation!! -## -## Revision 1.1 1998/05/23 16:17:40 peterg -## Initial revision -## -############################################################### - -# Args -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -noglobals) - noglobals=noglobals; - ;; - -parameters) - parameters=parameters; - ;; - *) - echo $1 is an unknown option - exit;; - esac - shift -done - -# Set up the language specific stuff -system=$1 -rep=$2 -language=$3 -args=$4 -output=$5 -extras=$6 - -case $language in - m) - modeline='% -*-octave-*- Put Emacs into octave-mode%'; - ext='m'; - Lc='#'; - Rc='#'; - Lb='('; - Rb=')'; - ;; - p) - modeline='% -*-octave-*- Put Emacs into octave-mode%'; - ext='m'; - Lc='#'; - Rc='#'; - Lb='['; - Rb=']'; - ;; - c) - ext='c'; - Lc='/*'; - Rc='*/'; - Lb='['; - Rb=']'; - ;; - java) - ext='java'; - Lc='/*'; - Rc='*/'; - Lb='['; - Rb=']'; - ;; - *) - echo Language $language not supported - sorry; exit 1 -esac - - -######### Octave (matlab) code -if [ "$language" = m ]; then -cat <1 THEN -% BEGIN -% FOR col := 1:MTT_Matrix_m DO -% BEGIN -% IF (row EQ 1) AND (col EQ 1) THEN DELAYOPTS; -% INAME(mtt_o); % Set temp name -% %SETLENGTH(2); % Adjust optimisation -% gentran declare mtt_matrix_element:REAL; -% gentran declare mtt_matrix:REAL; -% mtt_matrix_element := mtt_matrix(row,col); -% GENTRAN mtt_matrix(row,col) ::=: mtt_matrix_element; -% IF (row EQ MTT_matrix_n) AND (col EQ MTT_Matrix_m) THEN MAKEOPTS; -% END; -% END -% ELSE -% BEGIN -% IF (row EQ 1) THEN DELAYOPTS; -% INAME(mtt_o); % Set temp name -% GENTRAN mtt_matrix(row) ::=: mtt_matrix(row,1); -% IF (row EQ MTT_matrix_n) THEN MAKEOPTS; -% END; -% END -END; - -END;; - - DELETED mttroot/mtt/bin/trans/latex_equations.r Index: mttroot/mtt/bin/trans/latex_equations.r ================================================================== --- mttroot/mtt/bin/trans/latex_equations.r +++ mttroot/mtt/bin/trans/latex_equations.r @@ -1,75 +0,0 @@ -% Reduce file to generate equations -% Copyright (C) 2000 by Peter J. Gawthrop - -PROCEDURE latex_equations; -BEGIN -IF MTTNx>0 THEN -BEGIN - write"\begin{equation}"$ - write"\begin{aligned}"$ - FOR Row := 1:MTTNx DO - BEGIN - write "\dot MTTX", Row, " &= "$ - write "{"$ - write MTTdx(Row,1)$ - write "}"$ - IF Row0 THEN -BEGIN - write"\begin{equation}"$ - write"\begin{aligned}"$ -FOR Row := 1:MTTNz DO - BEGIN - write "MTTz", Row, " &= "$ - write "{"$ - write MTTz(Row,1)$ - write "}"$ - IF Row0 THEN -BEGIN - write"\begin{equation}"$ - write"\begin{aligned}"$ -FOR Row := 1:MTTNyz DO - BEGIN - write "0 &= "$ - write "{"$ - write MTTyz(Row,1)$ - write "}"$ - IF Row0 THEN -BEGIN - write"\begin{equation}"$ - write"\begin{aligned}"$ -FOR Row := 1:MTTNy DO - BEGIN - write "MTTy", Row, " &= "$ - write "{"$ - write MTTy(Row,1)$ - write "}"$ - IF Row0 THEN - IF MTT_Matrix_m>0 THEN - BEGIN - write "\begin{equation}"; - write MTT_Matrix_name, " = \begin{pmatrix}"; - FOR Row := 1:MTT_Matrix_n DO - BEGIN - FOR Col := 1:MTT_Matrix_m DO - BEGIN - write "{", MTT_Matrix(Row,Col), "}"; - IF Col0 THEN - IF MTT_Matrix_m>0 THEN - BEGIN - FOR Row := 1:MTT_Matrix_n DO - BEGIN - FOR Col := 1:MTT_Matrix_m DO - BEGIN - MTT_element := MTT_Matrix(Row,Col); - IF MTT_element NEQ 0 THEN - BEGIN - write "\begin{equation}"; - write MTT_Matrix_name, "_", Row, Col, " = {", MTT_element, "}\cr"; - write "\end{equation}"; - END; - END; - END; - END; -END; -END; - -END;; DELETED mttroot/mtt/bin/trans/latex_matrix_no.r Index: mttroot/mtt/bin/trans/latex_matrix_no.r ================================================================== --- mttroot/mtt/bin/trans/latex_matrix_no.r +++ mttroot/mtt/bin/trans/latex_matrix_no.r @@ -1,83 +0,0 @@ - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%% Model Transformation Tools %%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Reduce function to write matrices in latex form -% P.J.Gawthrop January 22 1998 -% Copyright (c) P.J.Gawthrop, 1998 - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Version control history -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% $Id$ -%% $Log$ -%% Revision 1.7 2000/11/02 14:28:08 peterg -%% and up to 10 ... -%% -%% Revision 1.6 2000/10/10 21:02:42 peterg -%% *** empty log message *** -%% -%% Revision 1.5 2000/08/09 10:41:39 peterg -%% Changed criterion form 3 to 5 -%% -%% Revision 1.4 1998/11/10 14:15:36 peterg -%% Now does matrix style for m<3 -%% -%% Revision 1.3 1998/03/14 11:07:09 peterg -%% Removed comma from array subscript -%% -%% Revision 1.2 1998/02/25 22:11:28 peterg -%% Added big matrix version -%% -%% Revision 1.1 1998/01/22 09:59:36 peterg -%% Initial revision -%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -PROCEDURE Latex_Matrix; -BEGIN -IF MTT_Matrix_m<10 THEN %% Do matrix style version -BEGIN - IF MTT_Matrix_n>0 THEN - IF MTT_Matrix_m>0 THEN - BEGIN - write "\begin{equation}"; - write MTT_Matrix_name, " = \begin{matrix}"; - FOR Row := 1:MTT_Matrix_n DO - BEGIN - FOR Col := 1:MTT_Matrix_m DO - BEGIN - write "{", MTT_Matrix(Row,Col), "}"; - IF Col0 THEN - IF MTT_Matrix_m>0 THEN - BEGIN - FOR Row := 1:MTT_Matrix_n DO - BEGIN - FOR Col := 1:MTT_Matrix_m DO - BEGIN - MTT_element := MTT_Matrix(Row,Col); - IF MTT_element NEQ 0 THEN - BEGIN - write "\begin{equation}"; - write MTT_Matrix_name, "_", Row, Col, " = {", MTT_element, "}\cr"; - write "\end{equation}"; - END; - END; - END; - END; -END; -END; - -END;; DELETED mttroot/mtt/bin/trans/latex_tidy Index: mttroot/mtt/bin/trans/latex_tidy ================================================================== --- mttroot/mtt/bin/trans/latex_tidy +++ mttroot/mtt/bin/trans/latex_tidy @@ -1,186 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: latex_tidy -# Tidies up LaTex format files -# P.J.Gawthrop 12 June 1990, Dec 1994 -# Copyright (c) P.J.Gawthrop, 1990, 1994 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.24 2003/08/17 11:35:45 gawthrop -## Zapped ^ to uparrow conversion. -## -## Revision 1.23 2003/08/17 11:35:07 gawthrop -## Fixed problem with parentheses -## -## Revision 1.22 2002/09/26 08:33:54 geraint -## Removed comma from pattern so that braces are places around each argument -## of a function call. Added greek letter nu as a special variable. -## -## Revision 1.21 2002/08/21 18:11:15 geraint -## Replaced |x| with |{x}|. LaTeX now renders abs(fractions) correctly. -## -## Revision 1.20 2002/08/20 19:33:21 geraint -## Minor bug fixes and enhancements (I hope): -## -## Delimited expressions within function calls to prevent denominators from continuing beyond commas. -## Allow latex to adjust size of parentheses according to expression within. -## Replaced ^ with \uparrow (less misleading - latex maths doesn't understand operator precedence or words). -## Replaced abs(x) with |x| when x does not contain brackets. -## -## Revision 1.19 2002/08/19 14:37:05 geraint -## Fixed eta, beta, theta, Theta and zeta. -## -## Revision 1.18 2001/06/11 19:43:50 gawthrop -## MTT is now much more sophisticated in generating lbl files -## Labels can contain maths -## Repetative components are now broken -## -## Revision 1.17 2000/12/28 12:31:15 peterg -## *** empty log message *** -## -## Revision 1.16 2000/10/10 21:03:20 peterg -## *** empty log message *** -## -## Revision 1.15 1998/04/07 08:44:11 peterg -## zapped eta - it messes up theta -## -## Revision 1.14 1998/02/25 22:12:07 peterg -## Added , to regexp for subscripts -## -## Revision 1.13 1998/02/18 09:06:07 peterg -## Added dX0 -## -## Revision 1.12 1998/02/09 14:11:08 peterg -## Added ctf --> D(s) -## -## Revision 1.11 1998/01/30 15:15:14 peterg -## Sorted out superscript problem -## -# Revision 1.10 1997/08/19 10:38:26 peterg -# Added pi to the list -# -## Revision 1.9 1997/02/24 13:02:17 peterg -## Added gamma and delta transformations -## -## Revision 1.8 1996/12/31 16:14:53 peterg -## Now handles multi-character subscripts. -## -## Revision 1.7 1996/12/19 10:24:29 peterg -## Uniform conversion of mttxi --> x_{i} for x,u,y and z -## Convert ???mttx to mtt x for x,u,y and z -## -## Revision 1.6 1996/12/12 16:03:19 peterg -## Removed global argument stuff for y - its already done in the -## translation. -## -## Revision 1.5 1996/12/12 15:59:06 peterg -## Generic handling of subscript for y,u,ui -## -## Revision 1.4 1996/12/12 15:54:20 peterg -## Saved it. -## -## Revision 1.3 1996/08/30 14:36:46 peter -## Added some more subscripts. -## -- its high time this was rewritten in awk or perl!!! -## -## Revision 1.2 1996/08/19 14:35:51 peter -## Prettyfied z dot. -## -## Revision 1.1 1996/08/18 20:03:12 peter -## Initial revision -## -############################################################### - -cat $1 | \ -tr "[A-Z]" "[a-z]" | \ -sed \ - -e "s/_\([a-z0-9]*\)/_{\1}/g" \ - -e "s/\// \\\over /g" \ - -e "s/[0-9a-z_]*mtty/mtty/g" \ - -e "s/[0-9a-z_]*mttu/mttu/g" \ - -e "s/mttx\([0-9]*\)/x_{\1}/g" \ - -e "s/mttex\([0-9]*\)/\\\chi_{\1}/g" \ - -e "s/mttddui\([0-9]*\)/\\\ddot{v}_{\1}/g" \ - -e "s/mttdui\([0-9]*\)/\\\dot{v}_{\1}/g" \ - -e "s/mttui\([0-9]*\)/v_{\1}/g" \ - -e "s/mttu\([0-9]*\)/u_{\1}/g" \ - -e "s/mtty\([0-9]*\)/y_{\1}/g" \ - -e "s/mttz\([0-9]*\)/z_{\1}/g" \ - -e "s/mttdx0/\\\dot x_0/g" \ - -e "s/mttdx/\\\dot x/g" \ - -e "s/mttdz/\\\dot z_/g" \ - -e "s/mttdu/\\\dot u_/g" \ - -e "s/dot_/ \\\dot /g" \ - -e "s/mtttf/G(s)/g" \ - -e "s/mttctf/D(s)/g" \ - -e "s/mtta/A/g" \ - -e "s/mttb/B/g" \ - -e "s/mttc/C/g" \ - -e "s/mttd/D/g" \ - -e "s/mtte/E/g" \ - -e "s/mttg/G/g" \ - -e "s/mtti/I/g" \ - -e "s/mttk/K/g" \ - -e "s/mttl/L/g" \ - -e "s/mttm/M/g" \ - -e "s/mtttheta/\\\Theta/g" \ - -e "s/mtto/O/g" \ - -e "s/mttv/V/g" \ - -e "s/mtty0/y_0/g" \ - -e "s/mttu0/u_0/g" \ - -e "s/mttx/x/g" \ - -e "s/mttz/z/g" \ - -e "s/mttyy/Y/g" \ - -e "s/mttw/w/g" \ - -e "s/mttt/T/g" \ - -e "s/mttpar//g" \ - -e "s/!/\\\/g" \ - -e "s/\\$//g" \ - -e "s/f\{0,1\}abs(\([^()]*\))/|{ \1 }|/g" \ - -e "s/(\([^(),]*\),/( { \1 } ,/g" \ - -e "s/,\([^(),]*\),/, { \1 } ,/g" \ - -e "s/,\([^(),]*\))/, { \1 } )/g" \ - -e "s/(/{\\\\left (/g" \ - -e "s/\*\*/^/g" \ - -e "s/\*/ /g" \ - -e "s/)/\\\right )}/g" \ - -e "s/sqrt/\\\sqrt/g" \ - -e "s/theta/\\\theta/g" \ - -e "s/tau/\\\tau/g" \ - -e "s/alpha/\\\alpha/g" \ - -e "s/beta/\\\beta/g" \ - -e "s/gamma/\\\gamma/g" \ - -e "s/delta/\\\delta/g" \ - -e "s/epsilon/\\\epsilon/g" \ - -e "s/\([^b(Th)(th)z]\)eta/\1\\\eta/g" \ - -e "s/^eta/\\\eta/g" \ - -e "s/kappa/\\\kappa/g" \ - -e "s/lambd/\\lambda/g" \ - -e "s/lambda/\\\lambda/g" \ - -e "s/mu/\\\mu/g" \ - -e "s/nu/\\\nu/g" \ - -e "s/phi/\\\phi/g" \ - -e "s/pi/\\\pi/g" \ - -e "s/rho/\\\rho/g" \ - -e "s/sigma/\\\sigma/g" \ - -e "s/omega/\\\omega/g" \ - -e "s/zeta/\\\zeta/g" \ - -e "s/infty/\\\infty/g" \ - -e "s/sin/\\\sin/g" \ - -e "s/cos/\\\cos/g" \ - -e "s/23/{23}/g" \ - -e "s/+-/ -/g" \ - | cat -s | \ -sed -e "s/ $//g" | \ -tr -s '\012' '\012' \ ->junk - -mv junk $1 DELETED mttroot/mtt/bin/trans/lbl2alias_txt Index: mttroot/mtt/bin/trans/lbl2alias_txt ================================================================== --- mttroot/mtt/bin/trans/lbl2alias_txt +++ mttroot/mtt/bin/trans/lbl2alias_txt @@ -1,43 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl2alias_txt2txt -# Creates the component aliases in text form - -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/07/02 08:34:00 peterg -## Renamed to lbl2alias_txt2txt -## -## Revision 1.1 1998/07/02 08:14:07 peterg -## Initial revision -## -############################################################### - -# Inform user -echo Creating $1_alias.txt - -#Create the alias file complete with headers. -echo "# Alias file ($1_alias.txt)" > $1_alias.txt -echo "# Generated by MTT at `date`" >> $1_alias.txt - -#Write out the variables -grep '[%|#]ALIAS' $1_lbl.txt |\ -gawk '{print $2,$3}' >> $1_alias.txt - - - - - - - - - DELETED mttroot/mtt/bin/trans/lbl2alias_txt2txt Index: mttroot/mtt/bin/trans/lbl2alias_txt2txt ================================================================== --- mttroot/mtt/bin/trans/lbl2alias_txt2txt +++ mttroot/mtt/bin/trans/lbl2alias_txt2txt @@ -1,77 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl2alias_txt2txt -# Creates the component aliases in text form - -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 1998/07/17 19:46:56 peterg -## No change -## -## Revision 1.5 1998/07/17 16:31:37 peterg -## Ignore component aliases (with /) -## -## Revision 1.4 1998/07/03 15:21:26 peterg -## Replace sub by gsub -- need to replace ALL , -## -## Revision 1.3 1998/07/03 13:49:03 peterg -## Flips the order of alias and name when $ is involved. -## -## Revision 1.2 1998/07/03 07:54:39 peterg -## Tidied -## -## Revision 1.1 1998/07/02 09:22:10 peterg -## Initial revision -## -## Revision 1.2 1998/07/02 08:34:00 peterg -## Renamed to lbl2alias_txt2txt -## -## Revision 1.1 1998/07/02 08:14:07 peterg -## Initial revision -## -############################################################### - -# Inform user -echo Creating $1_alias.txt - -#Create the alias file complete with headers. -echo "# Alias file ($1_alias.txt)" > $1_alias.txt -echo "# Generated by MTT at `date`" >> $1_alias.txt - -#Write out the variables - grep '[%|#]ALIAS' $1_lbl.txt |\ - gawk '{ - if (match($3,"/")==0){ - if (match($2,"\\$")==0){ - alias=$2; name =$3 - } - else{ - alias=$3; name =$2 - } - gsub(",","__",alias); #Replace , - n=split(alias,a,"|"); - for (i=1; i<=n; i++) - print a[i] "\t" name; - } - } - END{ - print "###_END_OF_ALIAS_###" - }' >> $1_alias.txt - - - - - - - - - DELETED mttroot/mtt/bin/trans/lbl2args_txt2out Index: mttroot/mtt/bin/trans/lbl2args_txt2out ================================================================== --- mttroot/mtt/bin/trans/lbl2args_txt2out +++ mttroot/mtt/bin/trans/lbl2args_txt2out @@ -1,46 +0,0 @@ -#!/bin/sh -# Writes argument list to standard output ready for use in calling lbl file - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:08 gawthrop - ## Fixed problems with argument passing for CRs - ## - ## Revision 1.1 2001/06/11 15:06:58 gawthrop - ## Now handles user-defined components - ## - ############################################################### - -# Copyright (C) 2001 by Peter J. Gawthrop - -if [ -f "$1_lbl.txt" ]; then -grep '[#%]ALIAS' $1_lbl.txt |\ - -gawk '{ - if (match($2,"\\$[0-9]")==1) ## Test if its a argument alias - { - i = substr($2,2); - arg[i] = $3 - N++ - } -} -END{ - for (j=1;j<=N;j++){ - if (length(arg[j])==0) - arg[j] = "??"; - } - for (j=1;j \$sys, - 'debug' => \$debug); - -die usage() if ($sys eq ''); - -if ($debug) { - my $logfile = "lbl2cmp_txt2m_${sys}.log"; - open (LOG, ">$logfile") or die ("MTT: lbl2cmp_txt2m, cannot open $logfile"); -} - -$cmp = "${sys}_cmp.txt"; -$lbl = "${sys}_lbl.txt"; -$out = "${sys}_cmp.m"; - -read_cmp_file(); -read_lbl_file(); -sort_components(); -write_header(); -write_body(); - -close (LOG) if ($debug); - -sub usage() { - return "Usage: lbl2cmp_txt2m --sys=\n"; -} - -sub read_cmp_file() { - my ($line, $name, $type, $class, $rep, $i); - - open (CMP, $cmp) or die ("MTT: lbl2cmp_txt2m, cannot open $cmp"); - - $i = 0; - while () { - - chomp; - # skip blank lines - next if (/^(\s)*$/); - # skip comments - next if (/^(\s)*[%\#]/); - # remove leading and trailing whitespace - s/^\s*(\S.*\S)\s*$/$1/; - - $line = $_; - print LOG "read_cmp_file: line='${line}'\n" if ($debug); - - # cmp provides type, name and repetition information - # class is inferred from type and name - # (cr and args are placeholders) - - ($type, $name, $rep) = read_cmp_line($line); - $name = name_anonymous_component($type) if ($name eq ''); - $class = port_or_component_or_junction ($type, $name); - - $component_name [$i++] = $name; - $component_type {$name} = $type; - $component_rep {$name} = $rep; - $component_cr {$name} = ''; - $component_arg {$name} = ''; - $component_class {$name} = $class; - } - close (CMP); -} - -sub read_cmp_line() { - my $line = $_; - my ($type, $name, $rep, $misc); - - ($type, $misc) = split (/:/, $line); - $type = $line unless defined ($type); - - if (defined ($misc)) { - ($name, $rep) = split (/\*/, $misc); - $name = $misc unless defined ($name); - } - - $name = '' unless defined $name; - $rep = 1 unless defined $rep; - - print LOG "read_cmp_line: type='$type', name='$name', rep='$rep'\n" if ($debug); - return ($type, $name, $rep); -} - -sub name_anonymous_component() { - my $type = $_; - my ($name, $num); - if (defined ($anonymous_component_type_index{$type})) { - $num = ++$anonymous_component_type_index{$type}; - $name = "mtt${type}_${num}"; - } else { - $anonymous_component_type_index{$type} = 1; - $name = "mtt${type}"; - } - print LOG "name_anonymous_component: type='${type}', name='${name}'\n" if ($debug); - return ($name); -} - -sub port_or_component_or_junction() { - - # ports are internal SS components (SS:[...]) - # junctions are '0' and '1' types - # everything else is a component, including external SS types. - - my ($type, $name) = @_; - my $retval; - if ($type eq "SS") { - $_ = $name; - if (/\[.+\]/) { - $retval = "port"; - } else { - $retval = "component"; - } - } elsif ($type eq "0") { - $retval = "0junction"; - } elsif ($type eq "1") { - $retval = "1junction"; - } else { - $retval = "component"; - } - print LOG "port_or_component_or_junction: type='$type', name='$name' class='$retval'\n" if ($debug); - return ($retval); -} - -sub read_lbl_file() { - my (@line, $name, $type, $cr, $arg, $i); - - open (LBL, $lbl) or die ("MTT: lbl2cmp_txt2m, cannot open $lbl"); - - $i = 0; - while () { - - chomp; - # skip blank lines - next if (/^(\s)*$/); - # skip comments - next if (/^(\s)*[%\#]/); - # remove leading and trailing whitespace - s/^\s*(\S.*\S)\s*$/$1/; - - # lbl provides name, cr and arg information - - ($name, $cr, $arg) = read_lbl_line (@line); - - $component_cr{$name} = $cr; - $component_arg{$name} = $arg; - } - - close (LBL); -} - -sub read_lbl_line() { - my @line = @_; - my ($name, $cr, $arg); - - @line = split (/\s+/); - $name = shift (@line); - - # strip repetitions (if any) - $name =~ s/([^\*]*)\*.*/$1/; - - $cr = shift (@line); - $arg = shift (@line); - - $cr = '' unless defined ($cr); - $arg = '' unless defined ($arg); - - print LOG "read_lbl_line: name='$name' cr='$cr' arg='$arg'\n" if ($debug); - return ($name, $cr, $arg); -} - -sub write_header() { - my $date = `date`; - chomp ($date); - - open (OUT, ">$out") or - die "MTT: cannot open $out for writing.\n"; - - print OUT << "EOF"; -## $out -*-octave-*- -## Generated by MTT on $date - -function [comp_type, name, cr, arg, repetitions] = ${sys}_cmp(i) - -EOF - - close (OUT); -} - -sub sort_components () -{ - # sorts components into alphabetical order (type:name) - # within the classes: ports, components then junctions. - - my ($name, $class, $i, $j, $target); - - $i = 0; - foreach $target ("port", "component", "0junction", "1junction") { - my @sorted_list = sort (sort_rule @component_name); - for $name (@sorted_list) { - $class = $component_class{$name}; - if ($class eq $target) { - if (! defined ($sorted_component_list{$name})) { - $sorted_component_list{$name} = $i++; - print LOG "sorted: '$name' '$i'\n" if ($debug); - } - } - } - } -} - -sub sort_rule () -{ - my ($type1, $name1, $string1, - $type2, $name2, $string2); - - $name1 = $a; - $name2 = $b; - - $type1 = $component_type{$name1}; - $type2 = $component_type{$name2}; - - $string1 = sprintf ("%s:%s", $type1, $name1); - $string2 = sprintf ("%s:%s", $type2, $name2); - - return ($string1 cmp $string2); -} - - -sub write_body() { - my (%reverse_sorted_component_list, $name); - - %reverse_sorted_component_list = reverse (%sorted_component_list); - for (my $key = 0; $key < scalar @component_name; $key++) { - $name = $reverse_sorted_component_list{$key}; - write_component ($name); - } -} - -sub write_component() { - my ($name) = @_; - - my $i = $sorted_component_list{$name}+1; - - open (OUT, ">>$out") or - die "MTT: cannot open $out for writing.\n"; - - print OUT - "if (i == $i)\n" . - "\tcomp_type = '$component_type{$name}';\n" . - "\tname = '$name';\n" . - "\tcr = '$component_cr{$name}';\n" . - "\targ = '$component_arg{$name}';\n" . - "\trepetitions = $component_rep{$name} ;\n" . - "end\n"; - - close (OUT); -} DELETED mttroot/mtt/bin/trans/lbl2component Index: mttroot/mtt/bin/trans/lbl2component ================================================================== --- mttroot/mtt/bin/trans/lbl2component +++ mttroot/mtt/bin/trans/lbl2component @@ -1,48 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl2component -# Creates the commands to pull down components from libraries - -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 2003/08/09 00:29:52 geraint -## Fixed grep error when lbl file doesn't exist. -## -## Revision 1.4 2002/04/28 18:41:27 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.3 1998/07/28 11:23:31 peterg -## Put / explicitly in awk. -## -## Revision 1.2 1998/07/27 08:38:11 peterg -## Just look for / in the relevant field. -## -## Revision 1.1 1998/07/17 17:04:50 peterg -## Initial revision -## -############################################################### - -if [ -f "$1_lbl.txt" ]; then - ## Regexp for an alias - alias='^[#%]ALIAS' - grep $alias $1_lbl.txt | gawk '{if (match($3,"/")>0) print "mtt -q compcopy " $3}' -fi - - - - - - - - - DELETED mttroot/mtt/bin/trans/lbl2cr_txt2r Index: mttroot/mtt/bin/trans/lbl2cr_txt2r ================================================================== --- mttroot/mtt/bin/trans/lbl2cr_txt2r +++ mttroot/mtt/bin/trans/lbl2cr_txt2r @@ -1,46 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl2cr_txt2r - -# Label file to constitutive relationship conversion -# P.J.GawthropNovemebr 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 2000/12/28 12:32:06 peterg -## Put under RCS -## -# Revision 1.3 1996/11/03 21:11:44 peterg -# Removed END; statement -# -## Revision 1.2 1996/11/02 10:20:53 peterg -## Created from lbl2sympar -## -############################################################### - - -# Inform user -echo "Creating $1_cr.r" - -rm -f mtt_error - -#Write some file headers -echo "%% constitutive relationship file ($1_cr.r)" > $1_cr.r -echo "%% Generated by MTT at `date`" >> $1_cr.r - -# This is the main transformation using awk -gawk -f $MTTPATH/trans/awk/lbl2cr.awk <$1_lbl.txt 2>mtt_error.txt | \ - sh >> $1_cr.r - -# Now invoke the standard error handling. -#mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/lbl2icd_txt2txt.sh Index: mttroot/mtt/bin/trans/lbl2icd_txt2txt.sh ================================================================== --- mttroot/mtt/bin/trans/lbl2icd_txt2txt.sh +++ mttroot/mtt/bin/trans/lbl2icd_txt2txt.sh @@ -1,40 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl2icd_txt2txt -# Creates the component ICDs in text form - -# Adapted from lbl2alias_txt2txt - -sys=$1 -icd=${sys}_icd.txt -lbl=${sys}_lbl.txt - -# Inform user -echo Creating ${icd} - -#Create the ICD file complete with headers. -echo "# Component ICD file ($1_icd.txt)" > ${icd} -echo "# Generated by MTT at `date`" >> ${icd} - -#Write out the variables - grep '[%|#]ICD' ${lbl} |\ - gawk '{ - if (match($3,"/")==0){ - if (match($2,"\\$")==0){ - icd=$2; name =$3 - } - else{ - icd=$3; name =$2 - } - n=split(icd,a,"|"); - for (i=1; i<=n; i++) - print a[i] "\t" name; - } - } - END{ - print "###_END_OF_ICD_###" - }' >> ${icd} DELETED mttroot/mtt/bin/trans/lbl2modpar_txt Index: mttroot/mtt/bin/trans/lbl2modpar_txt ================================================================== --- mttroot/mtt/bin/trans/lbl2modpar_txt +++ mttroot/mtt/bin/trans/lbl2modpar_txt @@ -1,41 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl2modpar_txt2txt -# Creates the component modpares in text form - -# Copyright (C) 2001 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $$Id$ -## $Log$ -## Revision 1.1 2001/03/29 19:24:14 gawthrop -## Can now use c representations of crs when using -c option -## -############################################################### - -# Inform user -echo Creating $1_modpar.txt - -#Create the modpar file complete with headers. -echo "# Modpar file ($1_modpar.txt)" > $1_modpar.txt -echo "# Generated by MTT at `date`" >> $1_modpar.txt - -#Write out the variables -grep '[%|#]MODPAR' $1_lbl.txt |\ -gawk '{printf("%s\t%s\n", $2,$3)}' >> $1_modpar.txt - -echo "# End of $1_modpar.txt" >> $1_modpar.txt - - - - - - - - DELETED mttroot/mtt/bin/trans/lbl2sympar_txt2r Index: mttroot/mtt/bin/trans/lbl2sympar_txt2r ================================================================== --- mttroot/mtt/bin/trans/lbl2sympar_txt2r +++ mttroot/mtt/bin/trans/lbl2sympar_txt2r @@ -1,58 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl2sympar_txt2r - -# Label file to symbolic parameters conversion -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 2000/12/28 12:32:06 peterg -## Put under RCS -## -# Revision 1.6 1996/12/07 19:39:51 peterg -# Minor debugging. -# -## Revision 1.5 1996/09/12 17:18:44 peter -## Don't add an RCS header .. -## -## Revision 1.4 1996/08/30 19:01:21 peter -## Added headers to sympar file. -## -## Revision 1.3 1996/08/30 10:18:33 peter -## New path for awk script. -## -## Revision 1.2 1996/08/30 10:04:20 peter -## Included `;' in demimiter list. -## -# Revision 1.1 1996/08/24 13:34:09 peter -# Initial revision -# -############################################################### - - -# Inform user -echo "Creating $1_sympar.r" - -rm -f mtt_error - -#Write some file headers -echo "%% Symbolic parameter file ($1_sympar.r)" > $1_sympar.r -echo "%% Generated by MTT at `date`" >> $1_sympar.r - -# This is the main transformation using awk -tr ';' ',' < $1_lbl.txt | \ -gawk -f $MTTPATH/trans/awk/lbl2sympar.awk | sort >> $1_sympar.r 2>mtt_error.txt - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/lbl_txt2tex Index: mttroot/mtt/bin/trans/lbl_txt2tex ================================================================== --- mttroot/mtt/bin/trans/lbl_txt2tex +++ mttroot/mtt/bin/trans/lbl_txt2tex @@ -1,156 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl_txt2tex -# Latex summary of the lbl file - -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.12 2002/04/28 18:41:27 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.11 2002/04/19 08:39:45 gawthrop -## Changed \# to # and \% to # to avoid warning in latest gawk version -## -## Revision 1.10 2000/12/28 12:32:06 peterg -## Put under RCS -## -## Revision 1.9 2000/11/16 13:11:06 peterg -## Included PAR and UNITS declarations -## -## Revision 1.8 1999/02/17 21:42:19 peterg -## Replaced print by printf to avoid extra nl in paragraph command. -## -## Revision 1.7 1998/07/27 12:56:26 peterg -## Splits up | separated expressions. -## -## Revision 1.6 1998/07/27 10:56:31 peterg -## Cosmetics. -## -## Revision 1.5 1998/07/27 08:29:44 peterg -## Include a comment field in the aliases -## -## Revision 1.4 1998/07/17 19:46:44 peterg -## Included component alias. -## -## Revision 1.3 1998/07/16 20:39:52 peterg -## More cosmetic changes -## -## Revision 1.2 1998/07/16 16:34:09 peterg -## Cosmetic changes -## -## Revision 1.1 1998/07/16 16:31:47 peterg -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_lbl.tex - -#Create the alias file complete with headers. -echo "% Label summary file ($1_lbl.tex)" > $1_lbl.tex -echo "% Generated by MTT at `date`" >> $1_lbl.tex - -#Write out the Description - grep '[%|#]SUMMARY' $1_lbl.txt | sed 's/_/\\_/g' |\ - gawk '{ - printf("\\paragraph{System %s:",$2); - for (i=3;i<=NF;i++) printf("%s ",$i); print "" - print "}" - }' >> $1_lbl.tex -# grep '[%|#]DESCRIPTION' $1_lbl.txt | sed 's/_/\\_/g' |\ -# gawk '{ -# for (i=2;i<=NF;i++) printf("%s ",$i); print "" -# }' >> $1_lbl.tex - -#Write out the aliases -cat <> $1_lbl.tex -\paragraph{Interface information:} -\begin{description} -EOF - grep '[%|#]ALIAS' $1_lbl.txt | sed 's/_/\\_/g' |\ - gawk '{ - N=split($2,a,"|"); - for (i=1;i<=N;i++){ - if (match(a[i],"\\$")>0){ - printf("\\item [Parameter \\%s] represents actual parameter ",a[i]) - } - else if (match($3,"/")>0){ - printf("\\item [Component %s] is in library ",a[i]) - } - else{ - printf("\\item [Port %s] represents actual port ",a[i]) - } - printf("\\textbf{%s}",$3) - if (match($4,"[#%]")==1) printf(" -- "); - for (j=5;j<=NF;j++) printf(" %s", $j) - printf("\n"); - } - } - END{if (NR==0) print "\\item This component has no ALIAS declarations" -}' | sort >> $1_lbl.tex -cat <> $1_lbl.tex -\end{description} -EOF - -#Write out the VARS -cat <> $1_lbl.tex -\paragraph{Variable declarations:} -\begin{description} -EOF - grep '[%|#][V|P]AR' $1_lbl.txt | sed 's/_/\\_/g' |\ - gawk '{ - printf("\\item %s\n",$2) - } - END{if (NR==0) print "\\item This component has no PAR declarations" -}' | sort >> $1_lbl.tex -cat <> $1_lbl.tex -\end{description} -EOF - - -#Write out the UNITS -cat <> $1_lbl.tex -\paragraph{Units declarations:} -\begin{description} -EOF - grep '[%|#]UNITS' $1_lbl.txt | sed 's/_/\\_/g' |\ - gawk '{ - printf("\\item [Port %s] has domain %s\n",$2, $3) - printf("\\begin{description}\n") - printf("\\item [Effort units] %s\n",$4) - printf("\\item [Flow units] %s\n",$5) - printf("\\end{description}\n") - } - END{if (NR==0) print "\\item This component has no UNITs declarations" -}' >> $1_lbl.tex -cat <> $1_lbl.tex -\end{description} -EOF - -# Write the actual lbl file -cat >> $1_lbl.tex <> $1_lbl.tex -cat >> $1_lbl.tex <lde_r2tex.log << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the differential-algebraic equations file -in "$1_lde.r"; - -%Read the symbolic parameter file -%%in "$1_sympar.r"; - - - -OFF Echo; -OFF Nat; - -%Read the substitution file -IN "$1_subs.r"; - -%Read the simplifying expressions file -IN "$1_simp.r"; - -OUT "$1_lde.tex"; - -%Write out the differential-algebraic equations. - -write "%File: $1_lde.tex"; - -write "%ordinary differential equations"; -write "% Generated by MTT"; - -IF MTTNyz>0 THEN -BEGIN - write"\begin{equation} \label{eq_$1_lde_x}"; - write"\begin{aligned}"; - FOR Row := 1:MTTNx DO - BEGIN - write "{"; - write MTTl(Row,1); - write "}"; - write " &= 0"; - IF Row0 THEN -BEGIN - write"\begin{equation} \label{eq_$1_lde_y}"; - write"\begin{aligned}"; - FOR Row := 1:MTTNy DO - BEGIN - write "MTTy", Row, " &= "; - write "{"; - write MTTy(Row,1); - write "}"; - IF Row isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char - ## ## - ## ## Revision 1.52 2004/09/07 18:22:53 geraint - ## ## Issues a more helpful error message than the cryptic Octave stuff - ## ## if there are unconnected ports. - ## ## - ## ## Revision 1.51 2004/02/20 20:42:40 geraint - ## ## Initialize Flipped.cons with [] instead of "". - ## ## - ## ## Revision 1.50 2003/03/13 15:18:39 gawthrop - ## ## Now uses __ to delimit subsystems in names. - ## ## - ## ## Revision 1.49 2001/07/26 05:02:53 geraint - ## ## Now writes cbg.fig when under-causal (again). - ## ## - ## ## Revision 1.48 2001/07/23 23:20:27 gawthrop - ## ## Now only writes to type.sh and cbg.m when causality is completed. - ## ## - ## ## Revision 1.47 2000/03/20 16:45:26 peterg - ## ## *** empty log message *** - ## ## - ## ## Revision 1.46 2000/02/17 16:14:49 peterg - ## ## *** empty log message *** - ## ## - ## ## Revision 1.45 1999/11/01 03:17:45 peterg - ## ## Added extra info - current subsystem - ## ## - ## ## Revision 1.44 1999/03/11 23:54:11 peterg - ## ## Include possibility of vector SS when finding port_bond_index - ## ## - ## ## Revision 1.43 1998/12/14 15:19:36 peterg - ## ## Added missing "derivative_causality," argument to recursive call of - ## ## this function - ## ## - ## ## Revision 1.42 1998/12/03 14:55:40 peterg - ## ## Now uses number of components with complete causality to measure - ## ## progress of algorithm -- Done. - ## ## This replaces bond count -- done. - ## ## - ## ## Revision 1.41 1998/11/20 10:52:28 peterg - ## ## Copies port bonds if the port bonds ARE set - ## ## -- replaces Copies port bonds if the component bonds are NOT set - ## ## - ## ## Revision 1.40 1998/09/02 11:47:09 peterg - ## ## Now uses explicit ordered list of ports instead of port.index. - ## ## Note that subsystems are still treated in arbitrary order. - ## ## - ## ## Revision 1.39 1998/08/25 20:06:16 peterg - ## ## Writes flipped port info - ## ## - ## ## Revision 1.38 1998/08/25 09:15:28 peterg - ## ## Fixed couple of problems with using two copies of the one data - ## ## stucture: - ## ## - ## ## ABG_field and ABG.field - ## ## - ## ## Maybe this is conceptually wrong? - ## ## - ## ## Revision 1.37 1998/08/25 08:33:29 peterg - ## ## Now does ports as well - fixed string prob by using deblank - ## ## - ## ## Revision 1.36 1998/08/25 06:44:40 peterg - ## ## Furhter revisions - ## ## - ## ## Revision 1.35 1998/08/24 10:16:32 peterg - ## ## Coverted to new structure - still needs status sorting. - ## ## - ## ## Revision 1.34 1998/08/24 07:35:03 peterg - ## ## About to go to new abg format. - ## ## - ## ## Revision 1.33 1998/07/29 13:36:37 peterg - ## ## Don't set port status if there aren't any ports. - ## ## - ## ## Revision 1.32 1998/07/28 19:06:11 peterg - ## ## *** empty log message *** - ## ## - ## ## Revision 1.31 1998/07/28 13:15:10 peterg - ## ## Vector SS ports included. - ## ## - ## ## Revision 1.30 1998/07/27 20:29:49 peterg - ## ## Had another go at causality .... - ## ## 1. Impose external causality onto all port bonds - ## ## 2. Set C_cause.m so that it DOESN'T set causality - ## ## -- I_cause is already ok ! - ## ## - ## ## Revision 1.29 1998/07/10 09:01:42 peterg - ## ## Added error + info file in new form - ## ## - ## ## Revision 1.28 1998/07/08 09:23:42 peterg - ## ## Undid the previous change -- needs more thought. - ## ## - ## ## Revision 1.27 1998/07/03 19:03:31 peterg - ## ## Always override the causality of port bonds! - ## ## - ## ## Revision 1.26 1998/06/27 13:24:04 peterg - ## ## Causality now set correctly for: - ## ## multi-port C and I - ## ## C and I with arrows pointing in - ## ## - ## ## Revision 1.25 1998/06/25 18:53:30 peterg - ## ## Actually, the previous comment was optimistic. - ## ## The port causalities on a compound are now forced to be the same as - ## ## that specified by a a _cuase.m file (if it exists) - ## ## - ## ## Revision 1.24 1998/06/25 17:45:03 peterg - ## ## No change -- but checked that explicit causality works! - ## ## - ## ## Revision 1.23 1998/04/04 10:46:37 peterg - ## ## Coerces port bonds to have smae direction as the imposing bonds - ## ## _cbg now generates the (coerced) components as welll as the (coerced) - ## ## causality. - ## ## - ## ## Revision 1.22 1997/08/19 10:21:09 peterg - ## ## Only copy port cuaslity info if not already set within the - ## ## subsystem. I thought I'd done this already .... - ## ## - ## ## Revision 1.21 1997/08/18 16:25:25 peterg - ## ## Minor bug fixes - ## ## - ## ## Revision 1.20 1997/08/18 12:45:24 peterg - ## ## Replaced: comp_bonds = bonds(bond_list,:) - ## ## by: for kk = 1:n_comp - ## ## comp_bonds(kk,:) = bonds(comp(kk),:); - ## ## end; - ## ## - ## ## to avoid an octave bug in 1.92. - ## ## - ## ## Revision 1.19 1997/08/18 11:23:59 peterg - ## ## Main component loop now misses out the ports (SS:[]) -- the causality - ## ## is merely passed through these components. - ## ## - ## ## Revision 1.18 1997/08/08 08:11:04 peterg - ## ## Suppress compoment trace. - ## ## - ## ## Revision 1.17 1997/08/07 16:10:13 peterg - ## ## Move the if status .. to the beginning of the main loop. - ## ## - ## ## Revision 1.16 1997/08/04 13:11:19 peterg - ## ## Only change to component-orientated causality for simple components - ## ## NOT for compound components. - ## ## - ## ## Revision 1.15 1997/01/05 12:25:59 peterg - ## ## More informative message about port bonds incompatible with ports - ## ## - ## ## Revision 1.14 1996/12/31 16:20:42 peterg - ## ## Just write causality information at top level -- it gets a bit - ## ## voluminous if written at deeper levels. - ## ## - ## ## Revision 1.13 1996/12/31 11:49:09 peterg - ## ## Don't copy port bond causality if already set -- allows subsystem - ## ## causality to be preset directely on named SS. - ## ## - ## ## Revision 1.12 1996/12/31 11:42:36 peterg - ## ## *** empty log message *** - ## ## - ## ## Revision 1.11 1996/12/07 17:10:48 peterg - ## ## Allows port SS at top level - ie takes it to be an ardianry SS at top - ## ## level. - ## ## - ## ## Revision 1.10 1996/12/04 21:48:55 peterg - ## ## Compares full-name with empty string (instead of testing for zero - ## ## length. - ## ## - ## ## Revision 1.9 1996/08/30 12:55:40 peter - ## ## More heirachical stuff added. - ## ## - ## ## Revision 1.8 1996/08/26 10:04:25 peterg - ## ## Fixed error due to a line wrap. - ## ## - ## ##Revision 1.7 1996/08/16 12:58:58 peter - ## ## Now does preferred causality of I and C. - ## ## Revision 1.6 1996/08/09 08:27:29 peter - ## ## Added a few deguging lines - ## ## - ## ## Revision 1.5 1996/08/08 18:06:18 peter - ## ## Unified file naming scheme - ## ## - ## ## Revision 1.4 1996/08/08 08:30:06 peter - ## ## The cbg filename contains the system name - this makes things easier - ## ## when setting up the m to fig translation and m to ese translation - ## ## - ## ## Revision 1.3 1996/08/05 18:53:21 peter - ## ## Fixed bug passing causality from subsystems. - ## ## - ## ## Revision 1.2 1996/08/05 15:41:41 peter - ## ## Now recursively does causality on subsystems. - ## ## - ## ## Revision 1.1 1996/08/04 17:55:55 peter - ## ## Initial revision - ## ## - ## ############################################################### - - - mtt_info(sprintf("Completing causality for subsystem %s", system_name), infofile); - - pc = '%'; - sub_delim = "__"; # Subsystem delimiter - - if nargin<1 - system_name = 'no_name'; - end; - - if nargin<4 - port_bonds = []; - end; - - if nargin<5 - infofile = 'stdout'; - end; - - ## Are we at the top level of the heirarchy? - at_top_level = strcmp(full_name, ''); - - ## Create a file to contain shell commands which map subsystem types - ## onto components -# if at_top_level # Then at top level -# fprintf(typefile, "# Commands to map types onto subsystems\n"); -# fprintf(typefile, "# File %s_type.sh\n", system_name); -# fprintf(typefile, "# Generated by MTT at %s\n\n", ctime(time)); -# end; - - ## Create the (full) system name - if at_top_level - full_name = system_name; - system_type = system_name; - else - full_name = [full_name, sub_delim, system_name]; - end; - - fun_name = [system_type, "_abg"]; - - disp("===================================="); - disp(["BEGIN: ", full_name, " (", fun_name, ")"]); - disp("===================================="); - - ## If no such function - then there is nothing to be done. - if exist(fun_name)~=2 - mtt_error(["m-file ", fun_name, " does not exist"], errorfile); - bonds = []; - status = []; - return - end; - - ## Evaluate the system function to get the bonds and number of ports - ##eval(["[bonds,components,n_ports,N_ports]=", fun_name, ";"]); - eval(["[ABG]=", fun_name, ";"]); - !isfield(ABG,"subsystems") - if !isfield(ABG,"subsystems")# Are there any subsystems? - return; # Nothing to do - else - [n_subsystems,junk] = size(fieldnames(ABG.subsystems)) - endif - - if isfield(ABG,"portlist")# Are there any ports? - [n_ports,junk] = size(ABG.portlist); - ## port_bond_index=zeros(n_ports,1); - i_port = 0; - for i=1:n_ports # Find indices of the internal ports - name = deblank(ABG.portlist(i,:)); # Name of this port - eval(["port = ABG.ports.",name,";"]); # Extract port info - for j=1:length(port.connections) # Maybe vector SS - port_bond_index(++i_port) = abs(port.connections(j)); - endfor; - endfor - else - n_ports = 0; - endif - - - [n_bonds,columns] = size(ABG.bonds);# Find number of bonds - if (columns ~= 2)&(n_bonds>0) - error("Incorrect bonds matrix: must have 2 columns"); - end; - - - ## Find number of components - ## [n_components,m_components] = size(components); - ## if n_components==0 # there is nothing to be done - ## return - ## end; - - - - ## Coerce the port (SS:[]) component bonds to have the same direction as - ## of the bonds in the encapsulating system -- but not at top level - Flipped.ports="";Flipped.subs="";Flipped.cons=[]; - - if (n_ports>0)&&(!at_top_level) # Coerce directions - for i=1:n_ports - name = deblank(ABG.portlist(i,:)); # Name of this port - eval(["port = ABG.ports.",name,";"]); # Extract port info - disp ("----"); - i - name - port - port_bond_direction - port.connections - - if (i > max (size (port_bond_direction))) - the_system = sprintf ("\"%s:%s\"", system_type, system_name); - mtt_error (sprintf ("Please check that %s has no disconnected ports.", the_system)); - mtt_error (sprintf ("abg2cbg: port_bond_direction(%d) does not exist.", i)); - exit(1); - end - if (sign(port.connections)!=port_bond_direction(i)) # Direction different? - eval(["ABG.ports.",name,".connections = - port.connections;"]); # Flip direction at port - Flipped.ports=[Flipped.ports;name]; # Remember which port has been flipped - bond_index=abs(port.connections); # Index of bond on port - mtt_info(sprintf("Flip port %s on %s" ... - ,name,full_name),infofile); # And report - for [subsystem,name] = ABG.subsystems # and at the other end - for k=1:length(subsystem.connections) - if (abs(subsystem.connections(k))==bond_index) # Then flip the connection - eval(["ABG.subsystems.",name,".connections(k) = -subsystem.connections(k);"]); - Flipped.subs=[Flipped.subs;name]; # Remember which subsystem has been flipped - Flipped.cons=[Flipped.cons;k]; # Remember which connection has been flipped - mtt_info(sprintf("Flip subsystem %s on %s" ... - ,name,full_name),infofile); # And report - endif - endfor - endfor # subsystem = ABG.subsystems - - ABG.bonds(bond_index,:) = -ABG.bonds(bond_index,:); # Flip the bond causalities - ##(these are arrow-orientated) - endif # Is the direction different? - endfor # port = ABG.ports - endif # (n_ports>0)&&(!at_top_level) - - ## If not at top level, then copy the port bonds. - if !at_top_level # Find number of port bonds - - for j=1:n_ports - jj = port_bond_index(j); # The index of the bond - for k = 1:2 - ## if ABG.bonds(jj,k)==0 # only copy if not already set - ## ABG.bonds(jj,k) = port_bonds(j,k); - ## endif - if port_bonds(j,k)!=0 # only copy if port bonds are set - ABG.bonds(jj,k) = port_bonds(j,k); - endif - endfor - endfor - else - n_port_bonds=0; - endif - - ## Causality indicator - total = 2*n_bonds; - done = sum(sum(abs(ABG.bonds)))/total*100; - - fields=["ports";"subsystems"]; # Do for both ports and subsystems - - ## ports first - for i=1:2 - field=deblank(fields(i,:)); - if isfield(ABG,field); - eval(["ABG_field = ABG.",field, ";"]); - field,ABG_field - - sum_ok = 0; n_comp = 0; - for [subsystem,name] = ABG_field# Find % status = 0 (causally complete) - eval(["ok = (ABG_field.",name,".status==0);"]); - sum_ok = sum_ok + ok; n_comp ++; - endfor; - Done = sum_ok/n_comp*100 - - ## Outer while loop sets preferred causality - ci_index=1; - - ## for [subsystem,name] = ABG_field# Set new status field to -1 - ## eval(["ABG_field.",name,".status=-1;"]); - ## endfor; - - while( ci_index>0) - old_done = inf; - old_Done = inf; - - while Done!=old_Done # Inner loop propagates causality - old_Done = Done; - for [subsystem,name] = ABG_field - name,subsystem - if subsystem.status != 0 # only do this if causality not yet complete - comp = subsystem.connections; # Get the bonds on this component - bond_list = abs(comp); - direction = sign(comp)'*[1 1]; - n_bonds = length(bond_list); - - if strcmp(subsystem.type,"0") # Change names - subsystem.type = "zero"; - end; - if strcmp(subsystem.type,"1") - subsystem.type = "one"; - end; - - cause_name = [subsystem.type, "_cause"];# Component causality procedure name - eqn_name = [subsystem.type, "_eqn"]; #Component equation procedure name - - comp_bonds=[]; # Bonds on this component (arrow-orientated) -- these become the - for kk = 1:n_bonds # port bonds on the ith component of this subsystem. - comp_bonds(kk,:) = ABG.bonds(bond_list(kk),:); - end; - - if exist(eqn_name)!=2 # Try a compound component - ## Port status depends on whether the corresponding bonds are - ## fully causal at this stage. - one = ones(n_bonds,1); - port_status = (sum(abs(comp_bonds'))'==2*one) - one; - - port_bond_direction = -sign(subsystem.connections)'; # Direction of bonds - - if exist(cause_name)==2 # If there is a predefined causality function; use it - comp_bonds = comp_bonds.*(port_bond_direction*[1 1]); # Convert from arrow orientated to component orientated causality - eval([ "[comp_bonds] = ", cause_name, "(comp_bonds);" ]); # Evaluate the built-in causality procedure - - comp_bonds = comp_bonds.*(port_bond_direction*[1 1]); # and convert from component orientated to arrow orientated causality - end; - - port_bond_direction,comp_bonds - [comp_bonds,subsystem.status] = abg2cbg(name, subsystem.type, full_name, - comp_bonds, port_bond_direction, port_status, ... - derivative_causality, ... - typefile, infofile, errorfile); - - - else # its a simple component -- or explicit causality defined - mtt_info(sprintf("Completing causality for component %s (%s)", - name, subsystem.type), infofile); - disp(["---", name, " (", cause_name, ") ---"]); - comp_bonds_in = comp_bonds - - ## Convert from arrow orientated to component orientated causality - comp_bonds = comp_bonds.*direction; - - ## Evaluate the built-in causality procedure - ##eval([ "[comp_bonds,status(i)] = ", cause_name, "(comp_bonds);" ]); - eval([ "[comp_bonds,subsystem.status] = ", cause_name, "(comp_bonds)" ]); - ## and convert from component orientated to arrow orientated causality - comp_bonds = comp_bonds.*direction; - - comp_bonds_out = comp_bonds - end; - - ABG.bonds(bond_list,:) = comp_bonds;# Update the full bonds list - eval(["ABG_field.",name,".status = subsystem.status;"]); - end; - end; - - sum_ok = 0; n_comp = 0; - for [subsystem,name] = ABG_field# Find % status = 0 (causally complete) - eval(["ok = (ABG_field.",name,".status==0);"]); - sum_ok = sum_ok + ok; n_comp ++; - endfor; - - Done = sum_ok/n_comp*100 - done = sum(sum(abs(ABG.bonds)))/total*100 - ##disp(sprintf("Causality is #3.0f#s complete.", done, pc), infofile)); - - endwhile # done!=old_done - - [name,prefered] = getdynamic(ABG_field) # Set causality of a C or I which is not already set - if prefered==0 - ci_index=0; - else - disp("Set causality of a C or I which is not already set") - eval(["ci_bond_index = ABG.",field,".",name,".connections;"]); # Get bonds - ci_direction = sign(ci_bond_index); - ci_bond_index = abs(ci_bond_index); - if derivative_causality - prefered = -prefered; - end; - ABG.bonds(ci_bond_index,1:2) = prefered*ci_direction'*[1 1] - eval(["ABG.subsystems.",name,".status=0"]); #set status of the C or I - endif - endwhile # ( ci_index>0) - eval(["ABG.",field," = ABG_field;"]); # Copy back to actual structure - endif # isfield(CBG,field(i,:)); - endfor - ## if n_ports>0 - ## status(1:n_ports) = zeros(n_ports,1); # Port status not relevant - ## endif; - - ## Print final causality - ## final_done = (sum(status==zeros(n_components,1))/n_components)*100; - - if at_top_level - mtt_info(sprintf("Final causality of %s is %3.0f%s complete.", ... - full_name, Done, pc), infofile); - - if Done<100 - mtt_error(sprintf("Unable to complete causality"),errorfile); - end; - endif # at_top_level - - - - - ## Return the port bonds - arrow orientated causality - and the direction - status=0; - if !at_top_level # Not at top level - port_bonds = ABG.bonds(port_bond_index,:); # Return port bonds - endif; # at top level - - for [subsystem,name] = ABG.subsystems - if subsystem.status==-1 # Under causal - status=-1; - mtt_info(sprintf("Component %s (%s) is undercausal", name, subsystem.type), ... - infofile); - elseif subsystem.status==1; # Over causal - status=-1; - mtt_info(sprintf("Component %s (%s) is overcausal", name, subsystem.type), ... - infofile); - endif; - endfor; # [subsystem,name] = ABG.subsystems - - ## write out the component .cbg file - disp(["Writing ", full_name]); - write_cbg(full_name,system_type,ABG,Flipped); - fprintf(typefile, "$1%s$2%s$3\n", system_type, full_name); - - - - status, port_bonds - disp("===================================="); - disp(["END: ", full_name, " (", fun_name, ")"]); - disp("===================================="); - - -endfunction; DELETED mttroot/mtt/bin/trans/m/abg2connections.m Index: mttroot/mtt/bin/trans/m/abg2connections.m ================================================================== --- mttroot/mtt/bin/trans/m/abg2connections.m +++ mttroot/mtt/bin/trans/m/abg2connections.m @@ -1,38 +0,0 @@ -## -*-octave-*- put Emacs into Octave mode -## -## ###################################### -## ##### Model Transformation Tools ##### -## ###################################### -## -## abg2connections_m -## -## Creates a cell array recording the name of the -## component at each end of every bond. -## -## This data may differ from ibg.m because of the -## expansion of vector bonds that takes place -## during the generation of abg.m - -function connections = abg2connections (abg) - - substructures = {"ports", "subsystems"}; - - for i = [1,2] - substruct = substructures{i}; - - if (isfield (abg, substruct)) - for [val, key] = eval (sprintf ("abg.%s", substruct)) - for bond_id = val.connections - if (bond_id > 0) - connections.head {+bond_id} = key - else - connections.tail {-bond_id} = key - endif - endfor - endfor - endif - - endfor - -endfunction - DELETED mttroot/mtt/bin/trans/m/add_bond.m Index: mttroot/mtt/bin/trans/m/add_bond.m ================================================================== --- mttroot/mtt/bin/trans/m/add_bond.m +++ mttroot/mtt/bin/trans/m/add_bond.m @@ -1,36 +0,0 @@ -function comp_list = add_bond(comp_list,bond_number,comp_number); - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Adds a new bond entry to a list of components -- pads the list appropriately. - -[N,M] = size(comp_list); -if M==0 - M=1; -end; - -if comp_number>N % Pad with zeros - comp_list = [comp_list;zeros(comp_number-N,M)]; -end; - -this_comp = [nozeros(comp_list(comp_number,:)), bond_number]; - -L = length(this_comp); - -[N,M] = size(comp_list); - -if LM %pad matrix with zeros and insert new row - comp_list = [comp_list zeros(N,L-M)]; - comp_list(comp_number,:) = this_comp; -else %Sizes match so just insert - comp_list(comp_number,:) = this_comp; -end; DELETED mttroot/mtt/bin/trans/m/add_row.m Index: mttroot/mtt/bin/trans/m/add_row.m ================================================================== --- mttroot/mtt/bin/trans/m/add_row.m +++ mttroot/mtt/bin/trans/m/add_row.m @@ -1,16 +0,0 @@ -function New=add_row(Old,Row); # Adds a row to end of matrix - - [N,M]=size(Old); - [n,m] = size(Row); - - if m>M - Old = [Old, zeros(N,m-M)]; # Pad with zeros - elseif M>m - Row = [Row, zeros(n,M-m)]; - endif - - New = [Old;Row]; - -endfunction - - DELETED mttroot/mtt/bin/trans/m/adjbond.m Index: mttroot/mtt/bin/trans/m/adjbond.m ================================================================== --- mttroot/mtt/bin/trans/m/adjbond.m +++ mttroot/mtt/bin/trans/m/adjbond.m @@ -1,27 +0,0 @@ -function [index,distance] = adjbond(point,arrow_end,other_end); -% adjbond: Determines the bond closest to the point -% [index,distance] = adjbond(point,arrow_end,other_end); - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -[n,m] = size(other_end); -one = ones(n,1); -arrow_distance = length2d(one*point - arrow_end); -min_arrow_distance = min(arrow_distance); - -other_distance = length2d(one*point - other_end); -min_other_distance = min(other_distance); - -min_distance = min([arrow_distance; other_distance]); - -adjacent = [arrow_distance, other_distance] == min_distance*[one one]; -[index,n] = getindex(adjacent,1); -distance = min_distance; - DELETED mttroot/mtt/bin/trans/m/adjcomp.m Index: mttroot/mtt/bin/trans/m/adjcomp.m ================================================================== --- mttroot/mtt/bin/trans/m/adjcomp.m +++ mttroot/mtt/bin/trans/m/adjcomp.m @@ -1,33 +0,0 @@ -function indices = adjcomp(arrow_end,other_end,components); -% adjcomp: Determines the two components at each end of the bond - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -[n,m] = size(components); -one = ones(n,1); - -arrow_distance = length2d(one*arrow_end - components(:,1:2)); -min_arrow_distance = min(arrow_distance); - -other_distance = length2d(one*other_end - components(:,1:2)); -min_other_distance = min(other_distance); - -arrow_adjacent = arrow_distance==min_arrow_distance*one; -other_adjacent = other_distance==min_other_distance*one; -[index,n] = getindex([arrow_adjacent,other_adjacent],1); - -if index(1,2)==1 - indices = index(1:2,1)'; -else - indices = index(2:-1:1,1)'; -end; - - DELETED mttroot/mtt/bin/trans/m/alias_args.m Index: mttroot/mtt/bin/trans/m/alias_args.m ================================================================== --- mttroot/mtt/bin/trans/m/alias_args.m +++ mttroot/mtt/bin/trans/m/alias_args.m @@ -1,82 +0,0 @@ -function args = alias_args(args,alias,delim,message,FileID,sys_name) - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.10 2012/10/15 19:16:03 geraint -## split is obsolete in Octave, replaced with strsplit -## -## Revision 1.9 2009/11/02 16:54:03 geraint -## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char -## -## Revision 1.8 2001/06/13 16:07:15 gawthrop -## Fixed bug with three separators in a row eg )/( -## -## Revision 1.7 2001/06/13 14:50:15 gawthrop -## Operator ^ now ok in args in abg and/or lbl -## -## Revision 1.6 2001/04/23 16:23:30 gawthrop -## Now stips ; from bottlom level argument list - allows aliasing of -## parts of a,b,c (eg a,b by using a,b;c -## -## Revision 1.5 2000/10/12 19:27:20 peterg -## Now writes out the aliased args ... -## -## Revision 1.4 2000/09/14 13:35:43 peterg -## appended '(' and ')' to SEPS -## -- otherwise first argument after '(' doesn't get substituted -## (Fixed by Geraint) -## -## Revision 1.3 1998/08/11 14:09:05 peterg -## Replaced incorrect length(args>0) with !isempty(args) -## -## Revision 1.2 1998/07/27 10:24:20 peterg -## Included , in the the list of seperators (SEPS) -## This makes it substitute for bits of args separated by commas. -## -## Revision 1.1 1998/07/03 18:29:40 peterg -## Initial revision -## -############################################################### - - if isstruct(alias) - if !isempty(args) - Args = char(strsplit(args,delim)); args=""; - [N,M]= size(Args); - for i=1:N - arg = deblank(Args(i,:)); - arg_ = strrep(arg,",","__"); - if isfield(alias,arg_) - eval(["new_arg = alias.", arg_,";"]); - mtt_info(["Replacing ", arg, "\t by ", ... - new_arg, message],FileID); - mtt_save_alias(arg,sys_name); -## printf("%s --> %s\n",arg,new_arg); - arg = new_arg; -## else -## mtt_info(["NOT replacing ", arg, message],FileID); - end - SEPS = ",+-*/()^"; - for j = 1:length(SEPS) - if (length(arg)>1)&&(length(findstr(arg,SEPS(j)))>0) - arg = alias_args(arg,alias,SEPS(j),message,FileID,sys_name); - end - end; - args = sprintf("%s%s%s", args, delim, arg); - end - if (length(args)>1) - if (substr(args,1,1)==delim) - args = substr(args,2); # loose leading delimiter - endif - endif - - end - end; -endfunction; - - - - - DELETED mttroot/mtt/bin/trans/m/args2arg.m Index: mttroot/mtt/bin/trans/m/args2arg.m ================================================================== --- mttroot/mtt/bin/trans/m/args2arg.m +++ mttroot/mtt/bin/trans/m/args2arg.m @@ -1,31 +0,0 @@ -function arg = args2arg(args,n,FS) -% args2arg - pulls the nth argument from a FS-separated list. -% FS defaults to `;'. -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function args2arg.m -% arg = args2arg(args,n,FS) -% Copyright (c) P.J. Gawthrop, 1996. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/08/30 09:58:55 peter -% %% Uses str2ch to exteact a char from a string. -% %% -% %% Revision 1.1 1996/08/27 12:50:43 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Field separator -if nargin<3 - FS = ';'; -end; - DELETED mttroot/mtt/bin/trans/m/cause2index.m Index: mttroot/mtt/bin/trans/m/cause2index.m ================================================================== --- mttroot/mtt/bin/trans/m/cause2index.m +++ mttroot/mtt/bin/trans/m/cause2index.m @@ -1,28 +0,0 @@ -function index = cause2index (causality) - - ## usage: index = cause2index (causality) - ## - ## - - if isstr(causality) - if strcmp(causality,"effort") - index = 1; - elseif strcmp(causality,"flow") - index = 2; - elseif strcmp(causality,"state") - index = 3 - else - error(sprintf("Causality ""%s"" not recognised",causality)); - endif - - else - if causality==1 - index = 1; - elseif causality==-1 - index = 2; - else - error(sprintf("Causality ""%i"" not recognised",causality)); - endif - endif - -endfunction DELETED mttroot/mtt/bin/trans/m/cause2name.m Index: mttroot/mtt/bin/trans/m/cause2name.m ================================================================== --- mttroot/mtt/bin/trans/m/cause2name.m +++ mttroot/mtt/bin/trans/m/cause2name.m @@ -1,27 +0,0 @@ -function name = cause2name(causality) -% cause2name - converts causality to a string -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function cause2name -% name = cause2name(causality) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -if causality==1 - name = 'effort'; -elseif causality ==-1 - name = 'flow'; -else - name = 'state'; -end; DELETED mttroot/mtt/bin/trans/m/cause2num.m Index: mttroot/mtt/bin/trans/m/cause2num.m ================================================================== --- mttroot/mtt/bin/trans/m/cause2num.m +++ mttroot/mtt/bin/trans/m/cause2num.m @@ -1,27 +0,0 @@ -function num = cause2num(causality) -% cause2num - converts causality to a string -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function cause2num -% num = cause2num(causality) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -if causality==1 - num = 1; -elseif causality ==-1 - num = 2; -else - num = 3; -end; DELETED mttroot/mtt/bin/trans/m/cbg2ese.m Index: mttroot/mtt/bin/trans/m/cbg2ese.m ================================================================== --- mttroot/mtt/bin/trans/m/cbg2ese.m +++ mttroot/mtt/bin/trans/m/cbg2ese.m @@ -1,614 +0,0 @@ -function structure = cbg2ese(system_name, system_type, system_cr, ... - system_args, full_name, full_name_repetition, ... - repetition,... - structure, structure_file,infofilenum) - ## Set up globals to count the component inputs and outputs. This relies on - ## the named SS (the ports) being in the correct order. Using globals here - ## avoids changing the common argument list for all _eqn files for something - ## which is only used for named SS components. - global local_u_index - global local_y_index - global at_top_level - ## - ## ###################################### - ## ##### Model Transformation Tools ##### - ## ###################################### - ## - ## Matlab function cbg2ese.m - ## Acausal bond graph to causal bond graph: mfile format - ## Structure matrix [states,nonstates,inputs,outputs,zero_outputs] - - ## ############################################################### - ## ## Version control history - ## ############################################################### - ## ## $Id$ - ## ## $Log$ - ## ## Revision 1.54 2009/11/02 16:54:03 geraint - ## ## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char - ## ## - ## ## Revision 1.53 2005/03/21 11:09:47 gawthrop - ## ## Now handles bicausal SS component - - ## ## ie source-source or sensor-sensor - ## ## - ## ## Revision 1.52 2004/09/12 22:27:27 geraint - ## ## Appended 't' to fopen mode string to open in text mode. - ## ## - ## ## Revision 1.51 2003/05/16 11:16:28 gawthrop - ## ## Fixed bug with multiports - ## ## - ## ## Revision 1.50 2003/05/08 18:47:50 gawthrop - ## ## Fixed __ bug when using * representations - ## ## - ## ## Revision 1.49 2003/03/13 15:19:04 gawthrop - ## ## Now uses __ to delimit subsystems in names. - ## ## - ## ## Revision 1.48 2003/03/13 15:10:26 gawthrop - ## ## Removed redundant final column - ## ## - ## ## Revision 1.47 2003/02/28 09:12:17 gawthrop - ## ## Two more columns in _stuc.txt: causality and subsystem name - ## ## - ## ## Revision 1.46 2002/08/20 15:51:17 gawthrop - ## ## Update to work with ident DIY rep - ## ## - ## ## Revision 1.45 2002/05/22 09:15:03 gawthrop - ## ## Non-repetitive components no longer use _1 in names - ## ## - ## ## Revision 1.44 2001/11/11 18:12:30 geraint - ## ## Moved fflush(structure_file) out of loop. - ## ## - ## ## Revision 1.43 2001/11/11 08:32:00 geraint - ## ## fflush (structure_file). - ## ## - ## ## Revision 1.42 2001/04/23 16:23:30 gawthrop - ## ## Now stips ; from bottlom level argument list - allows aliasing of - ## ## parts of a,b,c (eg a,b by using a,b;c - ## ## - ## ## Revision 1.41 2001/04/15 21:15:41 geraint - ## ## Added interface definition rep: _ICD.(txt|c|cc|m). - ## ## - ## ## Revision 1.40 2001/02/05 01:50:29 geraint - ## ## No unit type comparison at ports if either is "none". - ## ## - ## ## Revision 1.40 2000/12/16 08:10:55 geraint - ## ## No unit type comparison at ports if either is "none". - ## ## - ## ## Revision 1.39 2000/11/16 12:54:14 peterg - ## ## Added checking of unit consistency at ports - ## ## - ## ## Revision 1.38 2000/11/16 10:00:57 peterg - ## ## *** empty log message *** - ## ## - ## ## Revision 1.37 2000/11/12 16:45:57 peterg - ## ## Close ese file before recursive call of cbg2ese -- reopen when - ## ## finished. - ## ## THis prevents a new file being opened for each subsystem which fails - ## ## when > 1K files opened - ## ## - ## ## Revision 1.36 2000/10/13 10:54:47 peterg - ## ## Now writes out a unique name for each state etc - ## ## - ## ## Revision 1.35 2000/10/12 19:27:47 peterg - ## ## Now writes the aliased args - ## ## - ## ## Revision 1.34 2000/09/01 08:42:44 peterg - ## ## Cahged somes ends to end for etc for clarity - ## ## - ## ## Revision 1.33 2000/09/01 08:05:32 peterg - ## ## Reformatted with out changing function - ## ## - ## ## Revision 1.32 1998/11/16 13:01:19 peterg - ## ## Fixed problem with repetitions>1 due to new data structures -- now - ## ## computes initial next_bond correctly - ## ## - ## ## Revision 1.31 1998/09/24 12:57:44 peterg - ## ## Now ignores aliasing if no arguments given. - ## ## - ## ## Revision 1.30 1998/09/02 11:14:23 peterg - ## ## Revised to use ordered lists of subsystems and ports - ## ## - ## ## Revision 1.29 1998/08/25 09:22:34 peterg - ## ## Correctely recognises port SSs its now easy -- they are in there own - ## ## field - ## ## - ## ## Revision 1.28 1998/08/25 08:31:42 peterg - ## ## Fixed bug - didn't find the ports - use deblank - ## ## - ## ## Revision 1.27 1998/08/25 07:16:49 peterg - ## ## Modified to data struture representation - ## ## - ## ## Revision 1.26 1998/08/24 14:53:55 peterg - ## ## Uses new _cbg structure. - ## ## - ## ## Revision 1.25 1998/07/28 19:05:12 peterg - ## ## Sttill has vector SS port bug? - ## ## - ## ## Revision 1.24 1998/07/27 10:26:02 peterg - ## ## No change - but fixed bug in alias_args - ## ## - ## ## Revision 1.23 1998/07/08 12:33:51 peterg - ## ## Reinstated the infofilenum parameter. - ## ## - ## ## Revision 1.22 1998/07/04 07:10:27 peterg - ## ## Don't evaluate alias if no constitutive relationship or args and write - ## ## message. - ## ## - ## ## Revision 1.21 1998/07/03 18:58:58 peterg - ## ## Put arg alias stuff within function alias_args - ## ## Called recursively to handle arithmetic expressions - ## ## - ## ## Revision 1.20 1998/07/03 14:39:09 peterg - ## ## Added info messages a bit busy now! - ## ## - ## ## Revision 1.19 1998/04/12 11:58:19 peterg - ## ## Rename port components by changing name_r to [name_r - ## ## - ## ## Revision 1.18 1998/04/11 18:59:16 peterg - ## ## at_top_level now global - passed to SS components - ## ## - ## ## Revision 1.17 1998/04/04 10:47:31 peterg - ## ## Uses (coerced) components from _cbg file - _abg not now used here. - ## ## - ## ## Revision 1.16 1998/03/06 09:38:58 peterg - ## ## Now writes correct structure file for multiport C & I - ## ## - ## ## Revision 1.15 1997/12/16 18:24:33 peterg - ## ## Added unknown_input to structure list - ## ## - ## ## Revision 1.14 1997/08/26 07:51:10 peterg - ## ## Now counts the local input and outputs by order of appearence rather - ## ## than by port number - it therfore handles ports with bicausality correctely. - ## ## - ## ## Revision 1.13 1997/05/19 16:45:56 peterg - ## ## Fixed ISW bug -- deleted spurious ISW_eqn.m file - ## ## - ## ## Revision 1.12 1997/04/15 09:17:26 peterg - ## ## Added the structure file - contains details of states etc. - ## ## - ## ## Revision 1.11 1996/12/07 18:20:11 peterg - ## ## Replaces null argument by a default and tells user. - ## ## - ## ## Revision 1.10 1996/12/07 17:37:07 peterg - ## ## Now handles numbered SS ports appearing at top level. - ## ## - ## ## Revision 1.9 1996/12/04 21:49:47 peterg - ## ## Compares full-name with empty string (instead of testing for zero - ## ## length) - ## ## - ## ## Revision 1.8 1996/08/30 16:36:08 peter - ## ## More info written to ese files. - ## ## - ## ## Revision 1.7 1996/08/30 11:23:13 peter - ## ## Argument substitution implemented. - ## ## - ## ## Revision 1.6 1996/08/27 08:04:52 peterg - ## ## Handles complex components and repetative components. - ## ## - ## ## Revision 1.5 1996/08/24 15:02:23 peter - ## ## Writes `END;' to keep reduce happy. - ## ## - ## ## Revision 1.4 1996/08/19 09:03:41 peter - ## ## Handles repeating components. - ## ## - ## ## Revision 1.3 1996/08/18 20:08:02 peter - ## ## Included additional structure: structure(5) = zero_outputs. - ## ## - ## ## Revision 1.2 1996/08/08 18:08:11 peter - ## ## Sorted out file naming sceme - ## ## - ## ## Revision 1.1 1996/08/08 15:53:23 peter - ## ## Initial revision - ## ## - ## ############################################################# - - ## disp("cbg2ese"); - ## system_name, system_type, full_name, repetition - - pc = "%"; - sub_delim = "__"; # Subsystem delimiter - - - unit_error = "Component %s connects inconsistent ports with units %s and %s"; - unit_info = "Component %s connects ports with units %s and %s"; - - ## Set up the names corresponding to the structure matrix. - structure_name = [ - "state ", - "nonstate ", - "input ", - "output ", - "zero_output ", - "unknown_input"]; - - - ## Are we at the top level of the heirarchy? - at_top_level = strcmp(full_name, ""); - - ## Create the (full) system name - if at_top_level - full_name = system_name; - full_name_repetition = system_name; - system_type = system_name; - else - full_name = [full_name, sub_delim, system_name]; - - if (repetition>1) - full_name_repetition = [full_name_repetition, ... - sub_delim, system_name, sub_delim, ... - num2str(repetition)]; - else - full_name_repetition = [full_name_repetition, ... - sub_delim, system_name]; - endif - - end; - - - - cbg_name = [full_name, "_cbg"]; - if exist(cbg_name)~=2 # Return if cbg file doesn't exist - disp([cbg_name, " does not exist"]); - return - end; - - ## Setup files - ese_name = [full_name_repetition, "_ese.r"]; - ese_file = fopen(ese_name, "wt") # open file (first time) - icd_file = fopen([full_name_repetition,"_icd.txt2"],"wt") - - fprintf(ese_file, "\n%s%s Equation file for system %s (file %s)\n", ... - pc, pc, full_name_repetition, ese_name); - fprintf(ese_file, "%s%s Generated by MTT\n\n", pc, pc); - - ## Evaluate the system function to get the bonds - eval(["CBG = ", cbg_name, ";"]); - ##eval(["[bonds,status,system_type,components] = ", cbg_name, ";"]); - ## abg_name = [system_type, "_abg"]; - ## cmp_name = [system_type, "_cmp"]; - ## alias_name = [system_type, "_alias"]; - - ## No longer needed - cbg now has components: - ## eval(["[junk,components]=", abg_name, ";"]); - - ## Find number of bonds - [n_bonds,columns] = size(CBG.bonds); - if (columns ~= 2)&(n_bonds>0) - error("Incorrect bonds matrix: must have 2 columns"); - endif; - - ## Set up initial bond units - for i=1:n_bonds - bond_effort_unit(i,:)="null"; - bond_flow_unit(i,:)="null"; - endfor - - ## ## Find number of components - ## [n_components,columns] = size(components); - ## n_components = n_components - - ## Set up the first dummy bond number - needed for repetative components - ## next_bond = max(max(abs(components)))+1; - next_bond = n_bonds+1; - - ## Set up the counters for the labelled SS. These are, by definition, - ## encountered first and so the counters will not be messed up by subsystems. - local_u_index = 0; - local_y_index = 0; - - if (length(system_args)==0) - mtt_info(sprintf("No arguments given so no argument aliasing done for system %s(%s)", ... - system_name,system_type), infofilenum); - AliasingArguments=0; - else - AliasingArguments=1; - endif; - - if (length(system_cr)==0) - mtt_info(sprintf("No cr given so no cr aliasing done for system %s(%s)", ... - system_name,system_type), infofilenum); - AliasingCRs=0; - else - AliasingCRs=1; endif; - - - fields=["ports";"subsystems"]; # Do for both ports and subsystems - - ## ports first - lists=["portlist";"subsystemlist"]; - for i=1:2 - field=deblank(fields(i,:)); - list=deblank(lists(i,:)); - if isfield(CBG,list); - eval(["namelist=CBG.",list,";"]); # List of ports/subsystems - [N,M]=size(namelist); # Number of ports/subsystems - for j=1:N - comp_name = deblank(namelist(j,:)); # Name of this component - eval(["subsystem=CBG.",field,".",comp_name,";"]); # Pluck out the details - comp = subsystem.connections; # Connections - bond_list = abs(comp); - direction = sign(comp)'*[1 1]; - # Convert from arrow orientated to component orientated causality - comp_bonds = CBG.bonds(bond_list,:).*direction; - - ## disp(["---- ", field, " ---"]); - - if AliasingArguments # Alias the args list if appropriate - message = sprintf("\tfor component %s (%s) within %s", ... - comp_name,subsystem.type,full_name); - if isfield(CBG,"alias") - subsystem.arg = alias_args(subsystem.arg,CBG.alias,";",message,infofilenum,full_name); - endif; - endif; - - if AliasingCRs # Alias the CR list if appropriate - message = sprintf("\tfor component %s (%s) within %s", ... - comp_name,subsystem.type,full_name); - if isfield(CBG,"alias") - subsystem.cr = alias_args(subsystem.cr,CBG.alias,";",message,infofilenum,full_name); - endif; - endif; - - ## Substitute positional ($1 etc) arguments - subsystem.cr = subs_arg(subsystem.cr,system_cr, ... - "lin",full_name,subsystem.type,comp_name,infofilenum); - subsystem.arg = subs_arg(subsystem.arg,system_args, ... - "1",full_name,subsystem.type,comp_name,infofilenum); - - ## change name of 0 and 1 components -- matlab doesn't like numbers here - if strcmp(subsystem.type,"0") - subsystem.type = "zero"; - endif; - if strcmp(subsystem.type,"1") - subsystem.type = "one"; - endif; - - ports = length(bond_list); - - if subsystem.repetitions>1 - port_pairs = ports/2; - if round(port_pairs)~=port_pairs; - mtt_info(["Repeated component ", comp_name, ... - " has an odd number of ports - ignoring repetitions"], infofilenum); - subsystem.repetitions = 1; - endif; - endif; - - if subsystem.repetitions>1 - odd_bonds = bond_list(1:2:ports-1); - even_bonds = bond_list(2:2:ports); - endif; - - for k = 1:subsystem.repetitions - - if subsystem.repetitions>1 - - if k==1 - bond_list(1:2:ports-1) = odd_bonds; - else - bond_list(1:2:ports-1) = bond_list(2:2:ports); - endif; - - if k==subsystem.repetitions - bond_list(2:2:ports) = even_bonds; - else - new_bonds = [next_bond:next_bond+port_pairs-1]; - next_bond = next_bond+port_pairs; - bond_list(2:2:ports) = new_bonds; - endif; - - endif; - - ## Invoke the appropriate equation-generating procedure - name_r = full_name_repetition; - eqn_name = [subsystem.type, "_eqn"]; - - if exist(eqn_name)~=2 ## Try a compound component - fclose(ese_file); # Close but reopen later - - disp("---PUSH---"); bond_list, comp_name, subsystem.type - structure = cbg2ese(comp_name, subsystem.type, subsystem.cr, subsystem.arg, ... - full_name, full_name_repetition, ... - k, structure, structure_file, infofilenum); - - disp("---POP---"); - ese_file = fopen(ese_name, "at") # open file (again) - - eval(["subABG = ",subsystem.type , "_abg;"]); # Get the information - - ## Link up the bonds for this compound component - fprintf(ese_file, ... - "\n\t%s Equations linking up subsystem %s (%s)\n\n", ... - pc, comp_name, subsystem.type); - - if (k>1) - name_comp_name = sprintf("%s%s%s%s%d", ... - full_name_repetition, sub_delim, ... - comp_name, sub_delim, k); - else - name_comp_name = sprintf("%s%s%s", ... - full_name_repetition, sub_delim, ... - comp_name); - endif - - - printf("\n\t%s Equations linking up subsystem %s (%s)\n\n", ... - pc, comp_name, subsystem.type); - - u_index = 0; y_index = 0; ## Count the inputs and outputs - for port_number=1:length(bond_list) - repetition,port_number - port_bond_number = bond_list(port_number) -# this_bond_effort_unit = ... -# deblank(bond_effort_unit(port_bond_number,:)) -# this_bond_flow_unit = ... -# deblank(bond_flow_unit(port_bond_number,:)); - -# ## Extract the unit/domain stuff -# this_port_name = subABG.portlist(port_number,:); - -# eval(sprintf("this_port = subABG.ports.%s;", ... -# this_port_name)); -# if isfield(this_port,"units") -# eval(["effort_unit = ... -# subABG.ports.",this_port_name,".units.effort;"]); -# eval(["flow_unit = ... -# subABG.ports.",this_port_name,".units.flow;"]); -# else -# effort_unit = "none"; -# flow_unit = "none"; -# endif - -# ## and check consistency -# ## Efforts -# if strcmp(this_bond_effort_unit,"null") # set -# bond_effort_unit = ... -# [bond_effort_unit(1:port_bond_number-1,:) -# effort_unit -# bond_effort_unit(port_bond_number+1:n_bonds,:) -# ] -# elseif (!strcmp(this_bond_effort_unit,"none") && !strcmp(effort_unit,"none")) # check -# mtt_info(sprintf(unit_info,full_name, effort_unit, ... -# this_bond_effort_unit), infofilenum); -# if !strcmp(this_bond_effort_unit,effort_unit) -# error_string = sprintf(unit_error, full_name, ... -# effort_unit, ... -# this_bond_effort_unit); -# mtt_error(error_string); -# endif -# endif -# ## Flows -# if strcmp(this_bond_flow_unit,"null") # set -# bond_flow_unit = ... -# [bond_flow_unit(1:port_bond_number-1,:) -# flow_unit -# bond_flow_unit(port_bond_number+1:n_bonds,:) -# ] -# elseif (!strcmp(this_bond_flow_unit,"none") && !strcmp(flow_unit,"none")) # check -# mtt_info(sprintf(unit_info,full_name, flow_unit, ... -# this_bond_flow_unit), infofilenum); -# if !strcmp(this_bond_flow_unit,flow_unit) -# error_string = sprintf(unit_error, full_name, ... -# flow_unit, ... -# this_bond_flow_unit); -# mtt_error(error_string); -# endif -# endif - - - ## Effort - if comp_bonds(port_number,1)==1 # Source - u_index = u_index + 1; - fprintf(ese_file, "%s_MTTu%d := %s;\n", ... - name_comp_name, u_index, varname(name_r, ... - bond_list(port_number),1)); - else # Sensor - y_index = y_index + 1; - fprintf(ese_file, "%s := %s_MTTy%d;\n", ... - varname(name_r, ... - bond_list(port_number),1), name_comp_name, y_index); - end; - ## Flow - if comp_bonds(port_number,2)==-1 # Source - u_index = u_index + 1; - fprintf(ese_file, "%s_MTTu%d := %s;\n", ... - name_comp_name, u_index, varname(name_r, ... - bond_list(port_number),-1)); - else # Sensor - y_index = y_index + 1; - fprintf(ese_file, "%s := %s_MTTy%d;\n", ... - varname(name_r, ... - bond_list(port_number),-1), name_comp_name, y_index); - end; - end; - - else # its a simple component - fprintf(ese_file, "\n\t%s Equations for component %s (%s), repetition %d\n\n", ... - pc, comp_name, subsystem.type,k); - - - ## # Is it a named port? (Name begins with [) - ## Named_Port = (comp_name(1)=="["); - - if strcmp(field,"ports") #Add [ to start of name - name_r = ["[" name_r]; - endif; - - ## Save the current structure - old_structure = structure; - - ## Generate the simple component equations - ## .. firstly replacing ; by , in argument list - subsystem_arg = strrep(subsystem.arg,";",","); - - eval(["structure = ", ... - eqn_name, ... - "(name_r,bond_list,comp_bonds, ... - direction,subsystem.cr,subsystem_arg,structure,ese_file);" ]); - - ## If structure has changed, write info to structure file. - structure_change = structure-old_structure; - - ## The following line is to avoid probs with multiport C or I - ## it needs changing to handle multi ports correctly - structure_changes = sum(structure_change); - - structure_change = structure_change>zeros(size(structure_change)); - if structure_changes>0 - which_indices = getindex(structure_change,1); - which_indices = which_indices(:,2)'; - for which_index=which_indices - value = structure(which_index); - value_change=value-old_structure(which_index); - for k=1:value_change - if strcmp(subsystem.type,"SS") # One port, may be bicausal - cause_name = cause2name(-comp_bonds(1,k)); - else # Maybe multiport - but unicausal - cause_name = cause2name(-comp_bonds(k,1)); - endif - fprintf(structure_file, ... - "%s\t%i\t%s\t%s%s%s\t%i\t%s\n", ... - structure_name(which_index,:), value-k+1, ... - comp_name, full_name_repetition, sub_delim, comp_name, ... - repetition, cause_name); - endfor; - endfor; - endif; - endif - endfor - fflush (structure_file); - - ## component interface definition - if isfield(CBG,"icd") - if isfield(CBG.icd,comp_name) - if AliasingArguments - subsystem.icd = alias_args(eval(["CBG.icd.",comp_name]),CBG.alias,";",message,infofilenum,full_name); - endif - endif - if (isfield(subsystem,"icd")) - subsystem.icd = subs_arg(subsystem.icd,system_args, ... - "null",full_name,subsystem.type,comp_name,infofilenum); - - fprintf(icd_file,"%s_%s\t%s\t",full_name_repetition,comp_name,subsystem.icd); - if (comp_bonds(1) == 1) - fprintf(icd_file,"output,"); - elseif (comp_bonds(1) == -1) - fprintf(icd_file,"input,"); - endif - if (comp_bonds(2) == 1) - fprintf(icd_file,"input\n"); - elseif (comp_bonds(2) == -1) - fprintf(icd_file,"output\n"); - endif - endif - endif # End of component interface definition - - endfor # [subsystem,comp_name] = CBG_field - endif # isfield(CBG,field) - endfor # i=1:2 - - fclose(icd_file); - fclose(ese_file); # Close - -endfunction - - - DELETED mttroot/mtt/bin/trans/m/cbg2fig.m Index: mttroot/mtt/bin/trans/m/cbg2fig.m ================================================================== --- mttroot/mtt/bin/trans/m/cbg2fig.m +++ mttroot/mtt/bin/trans/m/cbg2fig.m @@ -1,318 +0,0 @@ -function cbg2fig(system_name, system_type, full_name, ... - stroke_length, stroke_thickness, stroke_colour, ... - comp_font, comp_colour_u, comp_colour_o) - - ## cbg2fig - converts causal bg to figure - ## - ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% Model - ## Transformation Tools %%%%% - ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ## - ## Matlab function cbg_m2fig Causal bond graph: mfile format to fig - ## file format The resultant fig file is the original _abg.fig with - ## additional causal strokes superimposed. cbg2fig(system_name, ... - ## system_type, full_name, ... stroke_length, stroke_thickness, - ## stroke_colour, ... comp_font, comp_colour_u, comp_colour_o) - ## Note this uses geometric info from _rbg.fig - so don't use with - ## -abg switch. - - ## P.J.Gawthrop May 1996 - ## Copyright (c) P.J.Gawthrop, 1996. - - ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ## %% Version control history - ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ## %% $Id$ - ## %% $Log$ - ## %% Revision 1.17 2004/09/12 22:27:27 geraint - ## %% Appended 't' to fopen mode string to open in text mode. - ## %% - ## %% Revision 1.16 2001/03/23 14:58:16 gawthrop - ## %% Fixed cosmetic bugs -- component display - ## %% - ## %% Revision 1.15 2001/03/23 11:20:20 gawthrop - ## %% Fixed bug with vector components --NB takes geometric info from _rbg.fig - ## %% - ## %% Revision 1.14 2000/09/14 12:07:15 peterg - ## %% Fixed overwriting of ports. - ## %% - ## %% Revision 1.13 2000/09/14 09:12:19 peterg - ## %% Fixed stroke orientation bug with bent bonds - ## %% Uses new info from the _rbg.m file - 4 new cols in rbonds - ## %% - ## %% Revision 1.12 2000/09/14 08:07:00 peterg - ## %% Reformated as an Octave function - ## %% - ## %% Revision 1.11 2000/01/18 14:52:02 peterg - ## %% Removed recursion --- maybe put back via a flag later - ## %% - ## %% Revision 1.10 1998/12/14 15:27:32 peterg - ## %% Added separate handling of ports ( poss zero) - ## %% - ## %% Revision 1.9 1998/08/25 06:43:02 peterg - ## %% Revised (partially) for data strucures - needs to include graphic info - ## %% in abg file. - ## %% - ## %% Revision 1.8 1998/04/04 10:45:01 peterg - ## %% Don't do strokes on port bonds - ## %% - ## %% Revision 1.7 1997/08/19 09:49:19 peterg - ## %% Modified to take account of the expanded vector bonds. Only displays - ## %% causality corresponding to the bond connecting the first element of - ## %% the vector ports. - ## %% - ## %% Revision 1.6 1997/08/19 09:41:47 peterg - ## %% Some debugging lines added. - ## %% - ## %% Revision 1.5 1997/05/16 07:33:45 peterg - ## %% Now checks to see if sub system is a simple component before - ## %% recursion. - ## %% 0 --> zero - ## %% 1 --> one - ## %% - ## %% Revision 1.4 1996/12/07 21:34:52 peterg - ## %% Tests for null string with strcmp - ## %% - ## %% Revision 1.3 1996/08/08 15:52:28 peter - ## %% Recursive version. - ## %% Fails due to octave bug - reported. - ## %% - ## %% Revision 1.2 1996/08/05 20:15:39 peter - ## %% Prepared for recursive version. - ## %% - ## %% Revision 1.1 1996/08/05 18:12:25 peter - ## %% Initial revision - ## %% - ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - if nargin<4 - stroke_length = 20; - end; - - if nargin<5 - stroke_thickness = 2; - end; - - if nargin<6 - stroke_colour = 1; %Blue - end; - - if nargin<7 - comp_font = 18; %Helvetica bold - end; - - if nargin<8 - comp_colour_u = 12; %Green - end; - - if nargin<9 - comp_colour_o = 4; %Red - end; - - ## Create a back slash '\' character. - bs = char(92); - - ## Create the (full) system name - if strcmp(full_name,'') - full_name = system_name; - else - full_name = [full_name, '_', system_name]; - end; - - full_name_type = [full_name, '_', system_type]; - ## $$$ fig_name = [full_name_type, '_cbg.fig']; - fig_name = [full_name, '_cbg.fig'] - - ## Return if initial fig file doesn't exist - if exist(fig_name)~=2 - return - end; - - ## Setup file - append to the fig file - filenum = fopen(fig_name, 'at'); - - ## Get the raw and the processed bonds - eval(['[rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = ', system_type, '_rbg;']); - eval(["ABG = ", system_type, "_abg;"]); - bonds=ABG.bonds; - - ## Original number of bonds - [n_bonds,junk] = size(rbonds); - - ## Get the causal bonds - #eval(['[cbonds,status]=', full_name, '_cbg;']); - eval(["CBG = ", full_name, "_cbg;"]); - cbonds=CBG.bonds; - - ## Check sizes - [Rows,Columns] = size(rcomponents); - if (Columns ~= 13) - error('Incorrect rcomponents matrix: must have 13 columns'); - end; - M_components = Columns; - N_rcomponents = Rows; # Number of raw components - - [N_rports,junk] = size(port_list); - [N_components, Columns] = size(CBG.subsystemlist); # Number of derived - # components - - if isfield(CBG,'portlist') - [N_ports, Columns] = size(CBG.portlist); - else - N_ports = 0; - end - - - ## Rotation matrix - rot = [0 -1; 1 0]; - - - ## Determine coordinates of the arrow end of the bond and the other end - ## and other geometry - other_end_1 = rbonds(:,1:2); - arrow_end = rbonds(:,3:4); - other_end_2 = rbonds(:,5:6); - - distance_1 = length2d(other_end_1 - arrow_end); - distance_2 = length2d(other_end_2 - arrow_end); - which_end = (distance_1>distance_2)*[1 1]; - one = ones(size(which_end)); - other_end = which_end.*other_end_1 + (one-which_end).*other_end_2; - arrow_barb = which_end.*other_end_2 + (one-which_end).*other_end_1; - arrow_vector = arrow_barb-arrow_end; - unit_arrow_vector = arrow_vector./(length2d(arrow_vector)*[1 1]); - - ## Extract directional information - arrow_end_direction = [rbonds(:,7), rbonds(:,8)]; - other_end_direction = [rbonds(:,9), rbonds(:,10)]; - - - ## Get indices of bonds with changed causality -- but ignore the extra bonds - ## due to vector bond expansion - changed_e = bonds(1:n_bonds,1)~=cbonds(1:n_bonds,1); - changed_f = bonds(1:n_bonds,2)~=cbonds(1:n_bonds,2); - changed = changed_e|changed_f; - - index_e = getindex(changed_e,1)'; - index_f = getindex(changed_f,1)'; - index_ef = getindex(changed,1)'; - - ## Print the new strokes in fig format - if index_ef(1,1)>0 - for i = index_e # Do the effort stroke - opp. side to arrow - if cbonds(i,1)==1 # Stroke at arrow end - bond_vector = arrow_end_direction(i,:); # Directional vector - stroke_end_1 = arrow_end(i,:); - else - bond_vector = other_end_direction(i,:); # Directional vector - stroke_end_1 = other_end(i,:); - end; - - ## Work out the direction for the stroke (right angles to bond) - unit_bond_vector = bond_vector./(length2d(bond_vector)*[1 1]); - unit_stroke_vector = (rot*unit_bond_vector')'; - - sig = sign(unit_arrow_vector(i,:)*unit_stroke_vector'); - stroke_end_2 = stroke_end_1 - stroke_length*sig*unit_stroke_vector; - - - ## print the fig3 format firstline spec. - polyline = 2; - firstline = fig3(polyline,stroke_thickness,stroke_colour); - fprintf(filenum, '%s\n', firstline); - - fprintf(filenum, ' %4.0f %4.0f %4.0f %4.0f \n', ... - stroke_end_1(1), stroke_end_1(2), ... - stroke_end_2(1), stroke_end_2(2) ); - end; - - for i = index_f # Do the flow stroke - same side as arrow - if cbonds(i,2)==1 # Stroke at arrow end - bond_vector = arrow_end_direction(i,:); # Directional vector - stroke_end_1 = arrow_end(i,:); - else - bond_vector = other_end_direction(i,:); # Directional vector - stroke_end_1 = other_end(i,:); - end; - - ## Work out the direction for the stroke (right angles to bond) - unit_bond_vector = bond_vector./(length2d(bond_vector)*[1 1]); - unit_stroke_vector = (rot*unit_bond_vector')'; - - sig = sign(unit_arrow_vector(i,:)*unit_stroke_vector'); - stroke_end_2 = stroke_end_1 + stroke_length*sig*unit_stroke_vector; - - ## print the fig3 format firstline spec. - polyline = 2; - firstline = fig3(polyline,stroke_thickness,stroke_colour); - fprintf(filenum, '%s\n', firstline); - - fprintf(filenum, ' %4.0f %4.0f %4.0f %4.0f \n', ... - stroke_end_1(1), stroke_end_1(2), ... - stroke_end_2(1), stroke_end_2(2) ); - end; - end; - - ## Print all the components - coloured acording to causality. - ## Miss out the ports - - for i = N_rports+1:N_rcomponents - eval(['[comp_type,comp_name] = ', system_type, '_cmp(i);']); - eval(["comp_status = CBG.subsystems.", comp_name, ".status;"]); - -# if i>N_rports # Subsystem -# comp_name = CBG.subsystemlist(i-N_rports,:); -# eval(["comp_status = CBG.subsystems.", comp_name, ".status;"]); -# else -# comp_name = CBG.portlist(i,:); -# eval(["comp_status = CBG.ports.", comp_name, ".status;"]); -# end - - - fig_params = rcomponents(i,3:M_components); - coords = rcomponents(i,1:2); - - if comp_status==-1 # Then under causal - fig_params(3) = comp_colour_u; - fig_params(6) = comp_font; - end; - - if comp_status==1 # Then over causal - fig_params(3) = comp_colour_o; - fig_params(6) = comp_font; - end; - - - ## Now print the component in fig format - - if index(comp_name,"mtt")==1 # Its a dummy name - typename = comp_type; # just show type - else - typename = [comp_type,":",comp_name]; - endif; - - Terminator = [bs, '001']; - real_index = 8; - for j = 1:length(fig_params) - if j==real_index - fprintf(filenum, '%2.4f ', fig_params(j)); - else - fprintf(filenum, '%i ', fig_params(j)); - endif - - - endfor - - - - fprintf(filenum, '%1.0f %1.0f ', coords(1), coords(2)); - fprintf(filenum, '%s%s\n', typename, Terminator); - - endfor - - ## Close the file - fclose(filenum); - return - -endfunction DELETED mttroot/mtt/bin/trans/m/cr2name.m Index: mttroot/mtt/bin/trans/m/cr2name.m ================================================================== --- mttroot/mtt/bin/trans/m/cr2name.m +++ mttroot/mtt/bin/trans/m/cr2name.m @@ -1,67 +0,0 @@ -function crname = cr2name(name,RHS_number,LHS_cause,RHS_cause,cr,args,port); -% cr2name - Constructs a string for the cr of a component. -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function cr2name -% cr2name(name,RHS_number,LHS_cause,RHS_cause,cr,args); - -% Copyright (c) P.J. Gawthrop, 1996. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/08/22 18:31:06 peter -% %% Fixed comment bug. -% %% -% %% Revision 1.1 1996/08/22 13:14:39 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -if nargin<7 - port=0 -end; - - -if length(args)==0 - a_comma = ''; -else - a_comma = ','; -end; - -if length(cr)==0 - cause_name = ''; - lp = ''; - rp = ''; - c_comma = ''; -else - cause_name = cause2name(LHS_cause); - lp = '('; - rp = ')'; - c_comma = ','; -end - -if port == 0 - port_name = ''; - p_comma = ''; -else - port_name = sprintf('%1.0f',port); - p_comma = ','; -end; - -crname = sprintf('%s%s%s%s%s%s%s%s%s\t%s', ... - cr,lp, args, a_comma, port_name, p_comma, cause_name, c_comma, ... - varname(name, RHS_number,RHS_cause),rp); - - - - - - - DELETED mttroot/mtt/bin/trans/m/csm2sm.m Index: mttroot/mtt/bin/trans/m/csm2sm.m ================================================================== --- mttroot/mtt/bin/trans/m/csm2sm.m +++ mttroot/mtt/bin/trans/m/csm2sm.m @@ -1,15 +0,0 @@ -function [A,B,C,D] = csm2sm(A,B,C,D,E); -% [A,B,C,D] = csm2sm(A,B,C,D,E); -% Converts constrained-state matrices to state matrices. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -A = E\A; -B = E\B; - DELETED mttroot/mtt/bin/trans/m/dm2fr.m Index: mttroot/mtt/bin/trans/m/dm2fr.m ================================================================== --- mttroot/mtt/bin/trans/m/dm2fr.m +++ mttroot/mtt/bin/trans/m/dm2fr.m @@ -1,89 +0,0 @@ -function fr = dm2fr(A,B,C,D,E,W,u0) -# fr = dm2fr(A,B,C,D,E,W,u0) -# Descriptor matrix to frequency response. -# A,B,C,D,E - descriptor matrices -# W vector of frequency points -# u0 input gain vector: u = u0*unit phasor - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.8 1997/06/13 13:05:38 peterg -# ## Replaced 'C*( (E*j*w - A) \ B*u0 ' by C*( inv(E*j*w - A)*B*u0 ). \ -# ## seems to have a bug for complex nos (??) -# ## -# ## Revision 1.7 1996/11/06 16:40:38 peterg -# ## Explicit definition of j -# ## -# ## Revision 1.6 1996/08/24 14:22:23 peter -# ## Put in a ; to avoid excessive log output. -# ## -# ## Revision 1.5 1996/08/16 14:26:37 peter -# ## Check and fix size of u0. -# ## -# ## Revision 1.4 1996/08/15 12:50:51 peter -# ## Put in a conj to undo effect of transpose. -# ## -# ## Revision 1.3 1996/08/15 11:53:44 peter -# ## Now has u0 input vector -# ## -# ## Revision 1.2 1996/08/15 10:24:28 peter -# ## Includes u0 argument. -# ## -# ## Revision 1.1 1996/08/10 14:11:28 peter -# ## Initial revision -# ## -# ############################################################### - -[Ny,Nu] = size(D); -[Ny,Nx] = size(C); -N = length(W); - -if nargin<7 - U0 = zeros(Nu,1); - U0(1) = 1; -else - for i=1:Nu - U0(i) = u0(i); - end; -end; - -u0 = U0; - -[n,m]=size(W); -if m>n - W=W'; -end; - -[n,m]=size(u0); -if m>n - u0=u0'; -end; - -j = sqrt(-1); -fr = zeros(N,Ny); -i = 0; -for w = W' - i = i+1; - ## EjA = E*j*w - A; - ## iEjA = conj(EjA)*inv(conj(EjA)*EjA); - ## FR = C*iEjA*B*u0 + D*u0; - FR = C*( (E*j*w - A) \ B*u0 ) + D*u0; - ## FR = C*( inv(E*j*w - A)*B*u0 ) + D*u0; - fr(i,:) = conj(FR'); -end; - - - - - - - - - - - - - DELETED mttroot/mtt/bin/trans/m/dm2ir.m Index: mttroot/mtt/bin/trans/m/dm2ir.m ================================================================== --- mttroot/mtt/bin/trans/m/dm2ir.m +++ mttroot/mtt/bin/trans/m/dm2ir.m @@ -1,40 +0,0 @@ -function ir = dm2ir(A,B,C,D,E,T); -% ir = dm2ir(A,B,C,D,E,T); -% Descriptor matrix to impulse response. -% NB At the moment - this assumes that E is unity ..... -% A,B,C,D,E - descriptor matrices -% T vector of time points - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1996/08/10 14:16:04 peter -% %% Now has T vector input - it was tmax & tstep -% %% -% %% Revision 1.2 1996/08/10 11:49:39 peter -% %% Fixed multi-input/output problem -% %% -% %% Revision 1.1 1996/08/10 10:26:00 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -[N,M] = size(T); -if M>N - T = T'; - N = M; -end; - -[Ny,Nu] = size(D); -NN=Ny*Nu; - -ir = zeros(N,NN); -i = 0; -for t = T' - i=i+1; - ir(i,:) = reshape(C*expm(A*t)*B, 1,NN); -end; - DELETED mttroot/mtt/bin/trans/m/dm2sr.m Index: mttroot/mtt/bin/trans/m/dm2sr.m ================================================================== --- mttroot/mtt/bin/trans/m/dm2sr.m +++ mttroot/mtt/bin/trans/m/dm2sr.m @@ -1,66 +0,0 @@ -function [Y,X] = dm2sr(A,B,C,D,E,T,u0,x0); -% [Y,X] = dm2sr(A,B,C,D,E,T,u0,x0); -% Descriptor matrix to impulse response. -% NB At the moment - this assumes that E is unity ..... -% A,B,C,D,E - descriptor matrices -% T vector of time points -% u0 input gain vector: u = u0*unit step. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 1996/08/15 08:34:08 peter -% %% Added step gain (u0) and initial condition (x0) -% %% -% %% Revision 1.3 1996/08/11 19:33:24 peter -% %% Replaced exp by expm - whoops! -% %% -% %% Revision 1.2 1996/08/11 10:37:40 peter -% %% Corrected mistake in step-response calculation. -% %% -% %% Revision 1.1 1996/08/11 09:42:40 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -[Ny,Nu] = size(D); -[Ny,Nx] = size(C); - -if nargin<7 - u0 = zeros(Nu,1); - u0(1) = 1; -end; - -if nargin<8 - x0 = zeros(Nx,1); -end; - -[N,M] = size(T); -if M>N - T = T'; - N = M; -end; - -one = eye(Nx); - -Y = zeros(N,Ny); -X = zeros(N,Nx); -i = 0; -for t = T' - i=i+1; - if Nx>0 - expAt = expm(A*t); - x = ( A\(expAt-one) )*B*u0 + expAt*x0; - X(i,:) = x'; - if Ny>0 - y = C*x + D*u0; - Y(i,:) = y'; - end; - elseif Ny>0 - y = D*u0; - Y(i,:) = y'; - end; -end; - DELETED mttroot/mtt/bin/trans/m/equation.m Index: mttroot/mtt/bin/trans/m/equation.m ================================================================== --- mttroot/mtt/bin/trans/m/equation.m +++ mttroot/mtt/bin/trans/m/equation.m @@ -1,103 +0,0 @@ -function eqn = equation(comp_type, name,cr,args,outbond,outcause,outport, ... - inbonds,incauses,inports) - ## eqn is a string containing the equation - ## - ## - ## ###################################### - ## ##### Model Transformation Tools ##### - ## ###################################### - ## - ## Matlab function equations.m - ## eqn = equation(name,cr,args,outbond,outcause,outport, ... - ## inbonds,incauses,inports) - - - ## ############################################################### ## Version - ## control history - ## ############################################################### ## $Id: - ## equation.m,v 1.6 2000/12/27 16:06:00 peterg Exp $ ## $Log: - ## equation.m,v $ ## Revision 1.6 2000/12/27 16:06:00 peterg ## *** - ## empty log message *** ## ## Revision 1.5 1996/12/05 11:26:51 - ## peterg ## Null strings now detected with strcmp not length. ## ## - ## Revision 1.4 1996/09/12 16:42:01 peter ## Default now out side - ## this function - need to be none for each ## component. ## ## - ## Revision 1.3 1996/09/12 12:03:58 peter ## Added some error - ## checking. ## If no constitutive relationship, only add diagonal - ## elementts to ## default unity output. ## ## Revision 1.2 - ## 1996/09/10 11:29:47 peter ## Removed causality & port info when no - ## constitutive relationship. ## ## Revision 1.1 1996/09/10 11:11:11peter - ## ## Initial revision ## - ## ############################################################### - - - ## Find the number of inports - nports = length(inbonds); - - ## Check some arguments - if length(incauses) ~= nports - error("equation.m: incauses inconsistent with inbonds"); - endif - - - if length(inports) ~= nports - error("equation.m: inports inconsistent with inbonds"); - endif - - - ## Set up LHS - LHS = varname(name, outbond, outcause); - - ## Set up various strings to get correct syntax if some strings are empty - if strcmp(cr,"") - cause_name = ""; - port_name = ""; - lp = ""; - rp = ""; - c_comma = ""; - else - cause_name = cause2name(outcause); - port_name = sprintf("%i", outport'); - lp = sprintf("(%s, ", comp_type); - rp = ")"; - c_comma = ","; - end - - if strcmp(args,"") - a_comma = ""; - else - a_comma = ","; - endif - - - ## Set up first line of RHS - RHS1 = sprintf("%s%s%s%s%s%s%s%s", ... - cr, lp, args, a_comma, cause_name, c_comma, port_name, c_comma); - - - ## Set up rest of RHS - the input variables, causality and ports. - RHS2 = ""; - for i=1:nports - RHS2 = sprintf("%s\t%s", ... - RHS2, varname(name, inbonds(i), incauses(i))); - - if strcmp(cr,"")==0 # add the causality & port info - RHS2 = sprintf("%s,%s,%i", ... - RHS2, cause2name(incauses(i)), inports(i)); - - endif - - if (i1 # Do a file in another langueage - sleep(1); - psfilename = sprintf("%s.%s",filename,language); - convert = sprintf("fig2dev -L%s %s > %s", language, figfilename, psfilename); - system(convert); - endif - - gset key # Put it back -endfunction DELETED mttroot/mtt/bin/trans/m/getdynamic.m Index: mttroot/mtt/bin/trans/m/getdynamic.m ================================================================== --- mttroot/mtt/bin/trans/m/getdynamic.m +++ mttroot/mtt/bin/trans/m/getdynamic.m @@ -1,36 +0,0 @@ -function [name,prefered] = getdynamic(subsystems); -# Get the index of a dynamic components which is not set. - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.2 1996/08/16 12:51:22 peter -# ## Removed debugging lines. -# ## -# ## Revision 1.1 1996/08/16 12:50:41 peter -# ## Initial revision -# ## -# ############################################################### - - prefered = 0; # No prefered causality to start with - for [subsystem,name] = subsystems - if subsystem.status==-1 # Undercausal - if strcmp(subsystem.type,'C') - prefered=-1; - break; - endif; - if strcmp(subsystem.type,'I') - prefered=1; - break; - endif; - endif; - endfor; - - if prefered==0 - name = ""; - end; - -endfunction - DELETED mttroot/mtt/bin/trans/m/getindex.m Index: mttroot/mtt/bin/trans/m/getindex.m ================================================================== --- mttroot/mtt/bin/trans/m/getindex.m +++ mttroot/mtt/bin/trans/m/getindex.m @@ -1,46 +0,0 @@ -function [index, n, otherindex, m] = getindex(array,value); -% Finds the n indices of the elements of array equal to value -% otherindex contains indeces of the the m other elements. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -[N,M] = size(array); -n=0; m=0; -for i=1:N - for j = 1:M - if array(i,j)==value - n=n+1; - index(n,:) = [i j]; - else - m=m+1; - otherindex(m,:) = [i j]; - end; - end; -end; - - -if (M==1)&(n>0) - index = index(:,1); -end; - -if (M==1)&(m>0) - otherindex = otherindex(:,1); -end; - -% Octave doesn't like empty matrices -if n==0 - index=0; -end; - -if m==0 - otherindex=0; -end; - - - DELETED mttroot/mtt/bin/trans/m/ibg2abg.m Index: mttroot/mtt/bin/trans/m/ibg2abg.m ================================================================== --- mttroot/mtt/bin/trans/m/ibg2abg.m +++ mttroot/mtt/bin/trans/m/ibg2abg.m @@ -1,635 +0,0 @@ -## -*-octave-*- - -function [bonds,components,n_vector_bonds] = ... - ibg2abg(name,bonds,infofile,errorfile) - - ## write useful quantity of data to log - struct_levels_to_print(6); - - ################################ - ## create component structure ## - ################################ - - ## loop over each bond in ibg.m file - for [bond, bond_name] = bonds - ## get the bond number - bond_name - i = str2num(strtok(bond_name, "bond")) - - ## populate "head" and "tail" structures - ## then copy the contents to an overall structure - - ## track (signed) vector bond number within each component - head.index = +i - tail.index = -i - - ## extract type of component at each end - head_type = deblank(char(strsplit(bond.head.component, ":"))(1,:)) - tail_type = deblank(char(strsplit(bond.tail.component, ":"))(1,:)) - - ## extract name of component at each end - head_name = deblank(char(strsplit(bond.head.component, ":"))(2,:)) - tail_name = deblank(char(strsplit(bond.tail.component, ":"))(2,:)) - - ## extract port label data - head.label = bond.head.ports - tail.label = bond.tail.ports - - disp("--checking head and tail for components or ports --") - ## determine whether internal port or subsystem - ## and fix names of ports - if (strcmp(head_type, "SS") & (index(head_name, "[") == 1)) - head_comp_or_port = "port" - head_name = mtt_strip_name(head_name); - else - head_comp_or_port = "comp" - endif - if (strcmp(tail_type, "SS") & (index(tail_name, "[") == 1)) - tail_comp_or_port = "port" - tail_name = mtt_strip_name(tail_name); - else - tail_comp_or_port = "comp" - endif - - ## copy data to object structure (objects) - cmd = sprintf("objects.%s.%s.type = '%s';", - head_comp_or_port, head_name, head_type) - eval(cmd) - cmd = sprintf("objects.%s.%s.type = '%s';", - tail_comp_or_port, tail_name, tail_type) - eval(cmd) - - cmd = sprintf("objects.%s.%s.bond%i = head;", - head_comp_or_port, head_name, i) - eval(cmd) - cmd = sprintf("objects.%s.%s.bond%i = tail;", - tail_comp_or_port, tail_name, i) - eval(cmd) - endfor - - disp("--finished extracting data from ibg.m --") - objects - - ## object structure: - ## - ## objects - ## comp - ## %s (name) - ## type - ## bond%i - ## label - ## port - ## %s (name) - ## type - ## bond%i - ## label - ## - ## "comp" contains components, subsystems and external SS - ## "port" contains internal SS:[...] - - #################################################### - ## count number of vector bonds on each component ## - #################################################### - - if (isfield(objects, "comp")) - for [comp, comp_name] = objects.comp - n = size(fieldnames(comp))(1) - 1; - eval(sprintf("objects.comp.%s.n_bonds = %i;", - comp_name, n)); - endfor - endif - - if (isfield(objects, "port")) - for [port, port_name] = objects.port - n = size(fieldnames(port))(1) - 1; - eval(sprintf("objects.port.%s.n_bonds = %i;", - port_name, n)); - endfor - endif - - disp("-- finished counting number of bonds on components --") - objects - - ## objects - ## comp - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - ## port - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - - ######################################################## - ## ensure labels exist on all ports of each component ## - ######################################################## - - if (isfield(objects, "comp")) - for [comp, comp_name] = objects.comp - if (strcmp(comp.type, "0") | strcmp(comp.type, "1")) - - ## convert type - if (strcmp(comp.type, "0")) - comp.type = "zero"; - elseif (strcmp(comp.type, "1")) - comp.type = "one"; - endif - - ## component is a junction - n_named_ports = 0; - - ## get labelled ports - for [bond, bond_name] = comp - if (index(bond_name, "bond") == 1) - if (! isfield (bond, "label")) - bond.label = "[]" - endif - if (! strcmp(bond.label, "[]")) - n_named_ports += 1; - port_label = bond.label; - endif - endif - eval(sprintf("comp.%s = bond;", bond_name)); - endfor - - ## attach labels to unlabelled ports - if (n_named_ports == 0) - mtt_info(sprintf("Defaulting all ports on junction %s to 'in'", ... - comp_name), infofile); - for [bond, bond_name] = comp - if (index(bond_name, "bond") == 1) - bond.label = "in"; - endif - eval(sprintf("comp.%s = bond;", bond_name)); - endfor - elseif (n_named_ports == 1) - mtt_info(sprintf("Defaulting all ports on junction %s to %s", ... - comp_name, port_label), infofile); - for [bond, bond_name] = comp - if (index(bond_name, "bond") == 1) - bond.label = port_label; - endif - eval(sprintf("comp.%s = bond;", bond_name)); - endfor - elseif (n_named_ports != comp.n_bonds) - mtt_error(sprintf("Junction must have 0,1 or %i port labels", ... - comp.n_bonds), errorfile); - endif - - else - ## component is not a junction - for [bond, bond_name] = comp - if (index(bond_name, "bond") == 1) - if (strcmp(bond.label, "[]")) - if (bond.index > 0) - bond.label = "in"; - else - bond.label = "out"; - endif - else - bond.label = mtt_strip_name(bond.label); - endif - endif - eval(sprintf("comp.%s = bond;", bond_name)); - endfor - endif - - eval(sprintf("objects.comp.%s = comp;", comp_name)); - endfor - endif - - #################### - ## expand aliases ## - #################### - - if (isfield(objects, "comp")) - for [comp, comp_name] = objects.comp - if ((! strcmp(comp.type, "zero")) & (! strcmp(comp.type, "one"))) - alias = eval(sprintf("%s_alias", comp.type)); - if (isstruct(alias)) - for [bond, bond_name] = comp; - if (isstruct(bond)) - if (isfield(alias, bond.label)) - old_name = bond.label; - new_name = eval(sprintf("alias.%s", old_name)); - bond.label = new_name; - mtt_info(sprintf("Aliasing [%s] on %s (%s) to [%s]", - old_name, comp_name, comp.type, new_name), - infofile); - endif - endif - eval(sprintf("comp.%s = bond;", bond_name)); - endfor - endif - eval(sprintf("objects.comp.%s = comp;", comp_name)); - endif - endfor - endif - - disp("-- finished expanding aliases --") - objects - - ## objects - ## comp - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - ## port - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - - ########################################## - ## create sub-bonds according to labels ## - ########################################## - - if (isfield(objects, "comp")) - for [comp, comp_name] = objects.comp - for [bond, bond_name] = comp - if (index(bond_name, "bond") == 1) - [sub_bonds, n_sub_bonds] = split_port(bond.label); - for i = 1:n_sub_bonds - eval(sprintf("bond.subbond%i.label = '%s';", - i, deblank(sub_bonds(i,:)))) - endfor - endif - eval(sprintf("comp.%s = bond;", bond_name)); - endfor - eval(sprintf("objects.comp.%s = comp;", comp_name)); - endfor - endif - - if (isfield(objects, "port")) - for [port, port_name] = objects.port - for [bond, bond_name] = port - if (index(bond_name, "bond") == 1) - [sub_bonds, n_sub_bonds] = split_port(bond.label); - for i = 1:n_sub_bonds - eval(sprintf("bond.subbond%i.label = '%s';", - i, deblank(sub_bonds(i,:)))); - endfor - endif - eval(sprintf("port.%s = bond;", bond_name)); - endfor - eval(sprintf("objects.port.%s = port;", port_name)); - endfor - endif - - disp("-- finished creating sub-bonds --") - objects - - ## objects - ## comp - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - ## subbond%i - ## port - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - ## subbond%i - - ######################################### - ## assign a unique number to each bond ## - ######################################### - - unique_bond_number = 0; - - for [bond, bond_name] = bonds - i = str2num(strtok(bond_name, "bond")); - - ## extract type of component at each end - head.type = deblank(char(strsplit(bond.head.component, ":"))(1,:)); - tail.type = deblank(char(strsplit(bond.tail.component, ":"))(1,:)); - - ## extract name of component at each end - head_name = deblank(char(strsplit(bond.head.component, ":"))(2,:)); - tail_name = deblank(char(strsplit(bond.tail.component, ":"))(2,:)); - - ## determine whether internal port or subsystem - ## and fix names of ports - if (strcmp(head.type, "SS") & (index(head_name, "[") == 1)) - head_comp_or_port = "port"; - head_name = mtt_strip_name(head_name); - else - head_comp_or_port = "comp"; - endif - if (strcmp(tail.type, "SS") & (index(tail_name, "[") == 1)) - tail_comp_or_port = "port"; - tail_name = mtt_strip_name(tail_name); - else - tail_comp_or_port = "comp"; - endif - - ## create strings to reference each component - head_str = sprintf("objects.%s.%s.bond%i", - head_comp_or_port, head_name, i) - tail_str = sprintf("objects.%s.%s.bond%i", - tail_comp_or_port, tail_name, i) - - head_bond = eval(head_str); - tail_bond = eval(tail_str); - - ## check compatible sizes - head.n_subs = size(fieldnames(head_bond))(1) - 2; - tail.n_subs = size(fieldnames(tail_bond))(1) - 2; - if (head.n_subs != tail.n_subs) - mtt_error(sprintf("Vector ports '%s' (%s:%s) and '%s' (%s:%s) are not compatible", - head_bond.label, head.type, head_name, - tail_bond.label, tail.type, tail_name), - errorfile); - elseif (head.n_subs > 1) - mtt_info(sprintf("Vector port '%s'(%s:%s) matches '%s' (%s:%s)", - head_bond.label, head.type, head_name, - tail_bond.label, tail.type, tail_type), - infofile); - endif - - ## write type at other end - eval(sprintf("%s.other_end_type = '%s';", - head_str, tail.type)); - eval(sprintf("%s.other_end_type = '%s';", - tail_str, head.type)); - - ## assign bond number - for i = 1:head.n_subs - ++unique_bond_number; - eval(sprintf("%s.subbond%i.index = +%i;", - head_str, i, unique_bond_number)); - eval(sprintf("%s.subbond%i.index = -%i;", - tail_str, i, unique_bond_number)); - - ## write causality for bond - if (strcmp(bond.causality.effort, "head")) - eval(sprintf("causality(%i,1) = +1;", unique_bond_number)); - elseif (strcmp(bond.causality.effort, "tail")) - eval(sprintf("causality(%i,1) = -1;", unique_bond_number)); - else - eval(sprintf("causality(%i,1) = 0;", unique_bond_number)); - endif - - if (strcmp(bond.causality.flow, "head")) - eval(sprintf("causality(%i,2) = -1;", unique_bond_number)); - elseif (strcmp(bond.causality.flow, "tail")) - eval(sprintf("causality(%i,2) = +1;", unique_bond_number)); - else - eval(sprintf("causality(%i,2) = 0;", unique_bond_number)); - endif - - endfor - endfor - - disp("-- finished assigning unique numbers to bonds --") - objects - - ## objects - ## comp - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - ## subbond%i - ## index - ## port - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - ## subbond%i - ## index - - ## causality matrix is called "bonds" - bonds = causality - disp("-- finished writing bonds matrix --") - - ################################# - ## map component data to cmp.m ## - ################################# - - ## count number of components - if (isfield(objects, "comp")) - n_comps = size(fieldnames(objects.comp), 1) - else - n_comps = 0; - endif - - ## count number of internal ports - if (isfield(objects, "port")) - n_ports = size(fieldnames(objects.port), 1) - else - n_ports = 0; - endif - - ## read data from _cmp.m - for cmp = 1:(n_comps + n_ports) - [this_type, this_name] = eval(sprintf("%s_cmp(%i)", name, cmp)); - ## determine if internal port (and fix name) or subsystem - if (strcmp(this_type, "SS") & (index(this_name, "[") == 1)) - comp_or_port = "port"; - this_name = mtt_strip_name(this_name) - else - comp_or_port = "comp"; - endif - eval(sprintf("objects.%s.%s.index = cmp;", comp_or_port, this_name)); - endfor - - disp("-- finished getting component indices from cmp.m --") - objects - - ## objects - ## comp - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - ## subbond%i - ## index - ## index - ## port - ## %s (name) - ## type - ## n_bonds - ## bond%i - ## label - ## subbond%i - ## index - ## index - - ########################## - ## write n_vector_bonds ## - ########################## - - if (isfield(objects, "comp")) - for [comp, comp_name] = objects.comp - n_vector_bonds(comp.index,1) = comp.n_bonds; - endfor - endif - - disp("-- finished writing n_vector_bonds --") - n_vector_bonds - - ########################################### - ## Write connections matrix (components) ## - ########################################### - - if (isfield(objects, "comp")) - n_comps = size(fieldnames(objects.comp))(1); - else - n_comps = 0; - endif - - components = zeros(n_comps+n_ports, max(n_vector_bonds)); - - if (isfield(objects, "comp")) - for [comp, comp_name] = objects.comp - ## get portlist for component - if exist([comp.type, '_cause']) == 0 - eval(sprintf("ABG = %s_abg;", comp.type)); - if isfield(ABG, "portlist") - port_list = ABG.portlist; - else - error(sprintf("Component %s has no ports", comp.type)); - endif - else - ## must be a simple component: - ## lib/comp/simple/comp_ports.m assigns port numbers - port_list = comp_ports(comp.type, comp.n_bonds) - endif - ## but do what with it? - - counter = 0; - - n_ports = size(port_list,1) - if (strcmp(comp.type, "zero")) | (strcmp(comp.type, "one")) - for port = 1 : n_ports - component_type = comp.type - the_port_list = port_list - the_port = port - label = port_list(port,:) - if (index (label, "[") == 1) - label = mtt_strip_name(label) - endif - label = deblank(label) - - for [bond, bond_name] = comp - if (index(bond_name, "bond") == 1) - for [sub_bond, sub_bond_name] = bond - - if (index(sub_bond_name, "subbond") == 1) - sub_bond_label = sub_bond.label - if (index (sub_bond_label, "[") == 1) - sub_bond_label = mtt_strip_name(sub_bond_label) - endif - sub_bond_label = deblank(sub_bond_label) - - if (strcmp(sub_bond_label, label) | strcmp (sub_bond_label,"in")) - components(comp.index, ++counter) = sub_bond.index - endif - - endif - endfor - endif - endfor - endfor - - elseif (n_ports == 1) - ## no ordering necessary - for [bond, bond_name] = comp - if (index(bond_name, "bond") == 1) - for [sub_bond, sub_bond_name] = bond - if (index(sub_bond_name, "subbond") == 1) - components(comp.index, ++counter) = sub_bond.index - endif - endfor - endif - endfor - - else - ## multiple ports, need to order them - for port = 1 : n_ports - component_type = comp.type - the_port_list = port_list - the_port = port - label = port_list(port,:) - if (index (label, "[") == 1) - label = mtt_strip_name(label) - endif - label = deblank(label) - - for [bond, bond_name] = comp - if (index(bond_name, "bond") == 1) - for [sub_bond, sub_bond_name] = bond - - if (index(sub_bond_name, "subbond") == 1) - sub_bond_label = sub_bond.label - if (index (sub_bond_label, "[") == 1) - sub_bond_label = mtt_strip_name(sub_bond_label) - endif - sub_bond_label = deblank(sub_bond_label) - - ## unalias sub_bond label - if exist([comp.type, '_alias']) - eval(sprintf("alias = %s_alias", comp.type)) - if isstruct(alias) - while_counter = 0; - while isfield(alias, sub_bond_label) - old_sub_bond_label = sub_bond_label; - sub_bond_label = eval(sprintf("alias.%s", sub_bond_label)) - if strcmp(old_sub_bond_label, sub_bond_label) - break; - endif - endwhile - endif - endif - - if (strcmp(sub_bond_label, label)) - components(comp.index, ++counter) = sub_bond.index - endif - - endif - endfor - endif - endfor - endfor - - endif - endfor - endif - disp("-- finished getting port_list --") - port_list - - if (isfield(objects, "port")) - for [port, port_name] = objects.port - counter = 0; - for [bond, bond_name] = port - if (index(bond_name, "bond") == 1) - for [sub_bond, sub_bond_name] = bond - if (index(sub_bond_name, "subbond") == 1) - components(port.index, ++counter) = sub_bond.index; - endif - endfor - endif - endfor - endfor - endif - - disp("-- finished writing components matrix --") - components - -endfunction DELETED mttroot/mtt/bin/trans/m/length2d.m Index: mttroot/mtt/bin/trans/m/length2d.m ================================================================== --- mttroot/mtt/bin/trans/m/length2d.m +++ mttroot/mtt/bin/trans/m/length2d.m @@ -1,24 +0,0 @@ -function len = length2d(vector_array) -% length2d - Finds (geometric) length of row vectors stacked -% into a column vector -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function length2d -% len = length2d(vector_array) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -% - -len = sqrt(sum(vector_array'.^2)'); DELETED mttroot/mtt/bin/trans/m/makedef.m Index: mttroot/mtt/bin/trans/m/makedef.m ================================================================== --- mttroot/mtt/bin/trans/m/makedef.m +++ mttroot/mtt/bin/trans/m/makedef.m @@ -1,131 +0,0 @@ -function makedef(structure,deffilenum); - - ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ## %% Version control history - ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ## %% $Id$ - ## %% $Log$ - ## %% Revision 1.8 2000/10/20 13:26:41 peterg - ## %% Made sure that mttui not declared twice - ## %% - ## %% Revision 1.7 2000/10/20 13:16:29 peterg - ## %% Reformated - ## %% - ## %% Revision 1.6 1996/12/07 18:21:57 peterg - ## %% Now uses fopen + file number - ## %% - ## %% Revision 1.5 1996/11/09 21:05:44 peterg - ## %% Only generates MTTIm when at least 2 states! - ## %% - ## %% Revision 1.4 1996/08/30 19:42:36 peter - ## %% Added newline at end of file. - ## %% - ## %% Revision 1.3 1996/08/24 15:06:22 peter - ## %% Write `END;' at end to please reduce. - ## %% - ## %% Revision 1.2 1996/08/18 20:05:20 peter - ## %% Put unded version control - ## %% - ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - states = structure(1); - nonstates=structure(2); - inputs=structure(3); - outputs=structure(4); - zero_outputs = structure(5); - internal_inputs = structure(6); - connecting_inputs = structure(7); - - pc = '%'; - ## Declare reduce constants; - fprintf(deffilenum, 'MTTNx := %1.0f;\n', states); - fprintf(deffilenum, 'MTTNz := %1.0f;\n', nonstates); - fprintf(deffilenum, 'MTTNu := %1.0f;\n', inputs); - fprintf(deffilenum, 'MTTNy := %1.0f;\n', outputs); - fprintf(deffilenum, 'MTTNyz := %1.0f;\n', zero_outputs); - fprintf(deffilenum, 'MTTNui := %1.0f;\n', internal_inputs); - fprintf(deffilenum, 'MTTNuc := %1.0f;\n', connecting_inputs); - - ## Declare reduce matrices - fprintf(deffilenum, '%s Declare reduce matrices\n', pc); - if states>0 - fprintf(deffilenum, 'matrix MTTx(%1.0f,1);\n', states); - fprintf(deffilenum, 'matrix MTTdx(%1.0f,1);\n', states); - endif - - if nonstates>0 - fprintf(deffilenum, 'matrix MTTz(%1.0f,1);\n', nonstates); - fprintf(deffilenum, 'matrix MTTdz(%1.0f,1);\n', nonstates); - endif - - if inputs>0 - fprintf(deffilenum, 'matrix MTTu(%1.0f,1);\n', inputs); - fprintf(deffilenum, 'matrix MTTdu(%1.0f,1);\n', inputs); - endif - - if outputs>0 - fprintf(deffilenum, 'matrix MTTy(%1.0f,1);\n', outputs); - endif - - if zero_outputs>0 - fprintf(deffilenum, 'matrix MTTyz(%1.0f,1);\n', zero_outputs); - fprintf(deffilenum, 'matrix MTTui(%1.0f,1);\n', zero_outputs); - elseif internal_inputs>0 - fprintf(deffilenum, 'matrix MTTui(%1.0f,1);\n', inputs); - endif - - if connecting_inputs>0 - fprintf(deffilenum, 'matrix MTTuc(%1.0f,1);\n', connecting_inputs); - endif - - - ## Make an Nx x Nx unit matrix - if states>0 - fprintf(deffilenum, 'matrix MTTI(%1.0f,%1.0f);\n', states,states); - for i = 1:states - fprintf(deffilenum, 'MTTI(%1.0f,%1.0f) := 1;\n', i, i); - end - endif - - - ## Make an Nx/2 x Nx/2 unit matrix - if states>1 - fprintf(deffilenum, 'matrix MTTIm(%1.0f,%1.0f);\n', states/2,states/2); - for i = 1:states/2 - fprintf(deffilenum, 'MTTIM(%1.0f,%1.0f) := 1;\n', i, i); - end - endif - - - ## Set the y, yz, du, u, x and dx matrices - fprintf(deffilenum, '%s Set the y, yz, u and x matrices\n', pc); - for i=1:outputs - fprintf(deffilenum, 'MTTy(%1.0f,1) := MTTy%1.0f;\n', i, i); - endfor - - for i=1:zero_outputs - fprintf(deffilenum, 'MTTyz(%1.0f,1) := MTTyz%1.0f;\n', i, i); - fprintf(deffilenum, 'MTTui(%1.0f,1) := MTTui%1.0f;\n', i, i); - endfor - - for i=1:inputs - fprintf(deffilenum, 'MTTu(%1.0f,1) := MTTu%1.0f;\n', i, i); - endfor - - for i=1:inputs - fprintf(deffilenum, 'MTTdu(%1.0f,1) := MTTdu%1.0f;\n', i, i); - endfor - - for i=1:states - fprintf(deffilenum, 'MTTx(%1.0f,1) := MTTx%1.0f;\n', i, i); - endfor - - for i=1:nonstates - fprintf(deffilenum, 'MTTdz(%1.0f,1) := MTTdz%1.0f;\n', i, i); - endfor - - fflush (deffilenum); - -endfunction DELETED mttroot/mtt/bin/trans/m/mat2mfile.m Index: mttroot/mtt/bin/trans/m/mat2mfile.m ================================================================== --- mttroot/mtt/bin/trans/m/mat2mfile.m +++ mttroot/mtt/bin/trans/m/mat2mfile.m @@ -1,45 +0,0 @@ -function mat2mfile(matrix, matrix_name, filenum); -% mat2mfile - writes a matrix as part of an m-file -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function mat2mfile -% mat2mfile(matrix, matrix_name, filenum) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/12/04 21:53:00 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -%Writes out a matrix as a matlab m-file - -[N, M] = size(matrix); - -empty = (N==1)&(M==1)&(matrix(1,1)==0); - -%Write out the matrix -fprintf(filenum, '%s = [\n', matrix_name); - -if ~empty - for i = 1:N, - for j = 1:M - fprintf(filenum, '%1.0f ', matrix(i,j)); - end; - fprintf(filenum, '\n'); - end; -else - fprintf(filenum,'0'); -end; -fprintf(filenum, '];\n'); -fprintf(filenum, '\n'); - DELETED mttroot/mtt/bin/trans/m/mat2tex.m Index: mttroot/mtt/bin/trans/m/mat2tex.m ================================================================== --- mttroot/mtt/bin/trans/m/mat2tex.m +++ mttroot/mtt/bin/trans/m/mat2tex.m @@ -1,35 +0,0 @@ -function tex = mat2tex(mat) - ## mat2tex: converts matrix into LaTeX form. - ## tex = mat2tex(mat) - - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.1 1999/03/25 01:33:51 peterg - ## Initial revision - ## - ############################################################### - - [n,m]=size(mat); - - for i=1:n - for j=1:m - if mat(i,j) == 0 - printf("0 "); - else - printf("%5.2f", mat(i,j)); - endif - if j0 - cbg = mtt_cbg(Name); # Structure for this subsystem - if isfield (cbg, "ports") - ## Combine ports with the other subsystems - for [component_structure, component] = cbg.ports - eval(sprintf("cbg.subsystems.%s=cbg.ports.%s;",component,component)); - endfor - endif - endif - - - if length(name)>0 # Alias - ##Alias arguments - eval(sprintf("ARG=cbg.subsystems.%s.arg;", name)); # Arguments - ARG = mtt_alias (Name,ARG,arg_default); # Alias them - eval(sprintf("cbg.subsystems.%s.arg=ARG;", name)); # and copy - ## Alias CRs - eval(sprintf("CR=cbg.subsystems.%s.cr;", name)); # CRs - CR = mtt_alias (Name,CR,cr_default); # Alias them - eval(sprintf("cbg.subsystems.%s.cr=CR;", name)); # and copy - else # Call to a subsystem (represented by name="") - if !isfield(cbg,"portlist") - N_ports = 0; - else - [N_ports,M_ports] = size(cbg.portlist); - endif - - if port>N_ports - error(sprintf("port (%i) > N_ports (%i)", port, N_ports)); - else # Get name and find equation - name = deblank(cbg.portlist(port,:)); - if DEBUG - disp("----> lower-level system") - endif - known = mtt_component_eqn (mtt_fullname(Name,name), 1, ... - causality, known, cbg); - return - endif - endif - - - ## Other causality representations - if strcmp(causality,"effort") - i_cause = 1; - othercausality = "flow"; - index_cause = 1; - cause = "e"; - elseif strcmp(causality,"flow") - i_cause = -1; - othercausality = "effort"; - index_cause = 2; - cause = "f"; - else - error(sprintf("mtt_component_eqn: causality %s invalid", causality)); - endif - - ## A useful composite name - name_port_cause = sprintf("%s_%i_%s",name, port, cause); - full_name_port_cause = mtt_fullname(Name,name_port_cause); - - ## If value is known, don't do anything. - if findstr(sprintf(" %s ", full_name_port_cause), known)>0 - eqn = sprintf("%s The %s signal on port %i of %s is known already", ... - CD, causality, port, name); - return - else # Add to list - known = sprintf("%s %s", known, full_name_port_cause); - endif - - - - ## Component type - comp_type = eval(sprintf("cbg.subsystems.%s.type;", name)); - if DEBUG - comp_type - endif - - ## Component cr - cr = eval(sprintf("cbg.subsystems.%s.cr;", name)); - - ## Component arg - arg = eval(sprintf("cbg.subsystems.%s.arg;", name)); - - ## To which bond(s) is the component connected? - connections = eval(sprintf("cbg.subsystems.%s.connections;", name)); - bond_list = abs(connections); # Unsigned list - out_bond_number = bond_list(port); # The bond at the output of this component - direction = sign(connections); # Bond directions - directions = direction'*[1 1]; - - ## List of system bonds - bonds = cbg.bonds; - - ## List of component bond causality (component-orientated causality) - comp_bonds = bonds(bond_list,:).*directions; # Component bonds - - ## What components are at the other ends of the in bonds? - ## Effort - [in_e_bonds,in_e_components,in_e_ports,N_e] = mtt_component_inputs ... - (name,comp_type,causality,"effort",comp_bonds,connections,cbg); - ## Flow - [in_f_bonds,in_f_components,in_f_ports,N_f] = mtt_component_inputs ... - (name,comp_type,causality,"flow",comp_bonds,connections,cbg); - - - ##Composite values - N_ef = N_e + N_f; - in_ef_bonds = [in_e_bonds; in_f_bonds]; - in_ef_components = [in_e_components; in_f_components]; - in_ef_ports = [in_e_ports; in_f_ports]; - in_causality = [ones(N_e,1); -ones(N_f,1)]; - - ## Lists of signals relevant to this component - outsig = [out_bond_number i_cause port]; - insigs = [in_ef_bonds in_causality in_ef_ports]; - innames = in_ef_components; - - if DEBUG - outsig - insigs - innames - endif - - ## Is the signal the output of a port? - is_port_output = 0; # Default - if isfield (cbg, "ports") - if isfield (cbg.ports,name) - is_port_output = (outsig(2)!=insigs(1,2)); - endif - endif - - if is_port_output - ## Which port (number) is it? - [N_ports,M_ports] = size(cbg.portlist); - for i=1:N_ports - if strcmp(deblank(cbg.portlist(i,:)), name) - port_index = i; - break; - endif - endfor - - ## File containing data structure - NAME = mtt_subname(Name); - CBG = mtt_cbg(NAME); - - ## And to which component (at higher level) is it connected? - [new_Name,new_name] = mtt_subname(Name); - port_bond = eval(sprintf("CBG.subsystems.%s.connections(%i);", new_name, port_index)); - [in_name, in_port, in_bond] = mtt_other_end (new_name,port_bond,CBG); - - ## Find its equation - if DEBUG - disp("----> higher level system") - endif - - - known = mtt_component_eqn (mtt_fullname(new_Name,in_name), ... - in_port, causality, known, cbg); - - LHS = Source_seqn ("external",Name); - RHS = varname(NAME, abs(in_bond), i_cause); - eqn = sprintf("%s%s%s := %s;", LHS, SD, name, RHS); - - if !DEBUG - comment = sprintf("%s PORT", CD); - disp(sprintf("%s\n%s",comment, eqn)); - endif - - endif - - - ## Handle special components - if strcmp(comp_type,"0")||strcmp(comp_type,"1") # Junctions - [eqn,insigs,innames] = junction_seqn (comp_type,Name, outsig, ... - insigs, innames); - else # Everything else - if exist(sprintf("%s_cause", comp_type)) # Simple component - ## Do the equations - [eqn,insigs,innames] = eval(sprintf("%s_seqn (Name, name, cr, ... - arg, outsig, ... - insigs, ... - innames, is_port_output);", ... - comp_type)); - ## Resolve CR - eqn = mtt_resolve_cr(eqn); - - else # Compound component - new_NAME = Name; - new_Name = mtt_fullname(Name,name); - new_name = ""; - - ## Get relevant data structure - Cbg = mtt_cbg(new_Name); - port_name = Cbg.portlist(port,:); - - LHS = varname(Name, outsig(1,1), outsig(1,2)); - RHS = Sensor_seqn ("external",new_Name); - eqn = sprintf("%s := %s%s%s;", LHS, RHS, SD, port_name); - - if DEBUG - disp("----> same-level subsystem") - endif - - [known] = mtt_component_eqn ... - (mtt_fullname(new_Name,new_name), port, causality, known, cbg); - - endif - endif - - comment = ... - sprintf("%s Equation for %s signal on port %i of %s (%s), subsystem %s.", ... - CD, causality, port, name, comp_type, Name); - - if DEBUG - disp(sprintf("%s\n%s",comment, eqn)); - endif - - is_external = mtt_is_external(comp_type,outsig, insigs, is_port_output); - - if !is_external - ## Find the corresponding input equations - [N_other,M_other] = size(insigs); - for i = 1:N_other - if insigs(i,2)==1 - other_causality = "effort"; - else - other_causality = "flow"; - endif - - other_port = insigs(i,3); - other_name = deblank(innames(i,:)); - if DEBUG - disp("----> same-level component") - endif - - - [known] = mtt_component_eqn ... - (mtt_fullname(Name,other_name), other_port, other_causality, ... - known, cbg); - endfor - endif - - ## Write this signal - ##comment_2 = sprintf("Connected to:%s", in_component_list); - if !DEBUG - disp(sprintf("%s\n%s",comment, eqn)); - endif - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_component_inputs.m Index: mttroot/mtt/bin/trans/m/mtt_component_inputs.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_component_inputs.m +++ mttroot/mtt/bin/trans/m/mtt_component_inputs.m @@ -1,30 +0,0 @@ -function [in_bonds,in_components,in_ports,N] = mtt_component_inputs ... - (name,comp_type, out_causality, causality,comp_bonds,bond_list,cbg) - - ## usage: [in_bonds,in_components,in_ports,N] = mtt_component_inputs - ## (name,comp_type, out_causality, causality,comp_bonds,bond_list,cbg) - ## - ## - - - ## Other causality representations if strcmp(causality,"effort") - if strcmp(causality,"effort") - i_cause = 1; - othercausality = "flow"; - index_cause = 1; - elseif strcmp(causality,"flow") - i_cause = -1; - othercausality = "effort"; - index_cause = 2; - else - error(sprintf("mtt_component_eqn: causality %s invalid", causality)); - endif - - in_index = find(comp_bonds(:,index_cause)==i_cause); - all_in_bonds = bond_list(in_index); - N_all = length(all_in_bonds); - - ## What components are at the other ends of the in bonds? - [in_components,in_ports,in_bonds] = mtt_other_end (name,all_in_bonds,cbg); - N = length(in_bonds); -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_error.m Index: mttroot/mtt/bin/trans/m/mtt_error.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_error.m +++ mttroot/mtt/bin/trans/m/mtt_error.m @@ -1,34 +0,0 @@ -function mtt_error(message, errorfile); -% mtt_error(message, errorfile); - -% function [bonds, status] = abg2cbg(bonds,components,system_name,filename) -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/12/03 16:21:27 peterg -% %% Initial revision -% %% -% %% Revision 1.2 1997/02/11 10:06:42 peterg -% %% Removed a debugging line. -% %% -% %% Revision 1.1 1996/08/18 20:06:57 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Set default file if it isn't there already -if nargin<2 - errorfile = fopen('mtt_error.txt','at'); -end; - -fprintf(errorfile, '*MTT ERROR : %s\n', message); - -#error('MTT exiting this transformation on error'); - DELETED mttroot/mtt/bin/trans/m/mtt_euler.m Index: mttroot/mtt/bin/trans/m/mtt_euler.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_euler.m +++ mttroot/mtt/bin/trans/m/mtt_euler.m @@ -1,7 +0,0 @@ -function [x] = mtt_euler(x,dx,dt,Nx,open) # Euler update - I_open = nozeros(open.*[1:Nx]'); # Indices of open switches - x(I_open) = 0.0; # Open switches have zero state - I = nozeros(!open.*[1:Nx]'); # Indices of states to update - x(I) = x(I) + dx(I)*dt; # Update states except open switches. -endfunction; - DELETED mttroot/mtt/bin/trans/m/mtt_fullname.m Index: mttroot/mtt/bin/trans/m/mtt_fullname.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_fullname.m +++ mttroot/mtt/bin/trans/m/mtt_fullname.m @@ -1,10 +0,0 @@ -function fullname = mtt_fullname (subname,compname) - - ## usage: fullname = mtt_fullname (subname,compname) - ## - ## Finds the standard mtt name of the component - - delim = "__"; - fullname = sprintf("%s%s%s", subname, delim, compname); - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_identify.m Index: mttroot/mtt/bin/trans/m/mtt_identify.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_identify.m +++ mttroot/mtt/bin/trans/m/mtt_identify.m @@ -1,38 +0,0 @@ -function [theta,Theta,Error,Y] = mtt_identify (system_name,y_s,theta_0,criterion,max_iterations) - - ## usage: [theta,Theta,Error] = mtt_identify (system_name,theta_0,criterion,max_iterations) - ## y_s actual system output - ## theta_0 initial parameter estimate - ## criterion convergence criterion - ## max_iterations limit to number of iterations - - if nargin<4 - criterion = 1e-5; - endif - - if nargin <5 - max_iterations = 20; - endif - - alpha = 1.0; - e_last = 1e20; - error=1e10; - theta = theta_0; - Theta = []; - Error = []; - Y = []; - iterations = 0; - while abs(e_last-error)>criterion - theta - iterations = iterations + 1; - e_last = error; - [t,y,y_theta] = mtt_ssimulate(system_name,theta); # Simulate system - Theta = [Theta theta]; # Save parameters - Y = [Y y]; # Save output - E = (y - y_s); # Error(t) - error = (E'*E); # Sum the error - Error = [Error error]; - theta = theta - alpha*((y_theta'*y_theta)\(y_theta'*E)); - endwhile - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_implicit.m Index: mttroot/mtt/bin/trans/m/mtt_implicit.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_implicit.m +++ mttroot/mtt/bin/trans/m/mtt_implicit.m @@ -1,28 +0,0 @@ -function [x] = mtt_implicit(x,dx,AA,AAx,dt,Nx,open); - ## x = mtt_implicit(x,dx,AA,AAx,dt,Nx,open); - ## Implicit integration update - - ## ############################################################### - ## ## Version control history - ## ############################################################### - ## ## $Id$ - ## ## $Log$ - ## ## Revision 1.3 1999/04/20 06:14:53 peterg - ## ## Reorder to make equivalent to .p version - ## ## - ## ## Revision 1.2 1999/04/20 00:58:22 peterg - ## ## Set open-switch states to zero - ## ## - ## ## Revision 1.1 1999/04/02 06:23:20 peterg - ## ## Initial revision - ## ## - ## ############################################################### - - ## Copyright (C) 1999 by P.J. Gawthrop - - I = nozeros(!open.*[1:Nx]'); # Indices of states to update - x(I) = AA(I,I)\(AAx(I) + dx(I)*dt); # Implicit update (except open switches); - I_open = nozeros(open.*[1:Nx]'); # Indices of open switches - x(I_open) = 0.0; # Open switches have zero state - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_info.m Index: mttroot/mtt/bin/trans/m/mtt_info.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_info.m +++ mttroot/mtt/bin/trans/m/mtt_info.m @@ -1,55 +0,0 @@ -function mtt_info(info, infofile); - ## mtt_info(info, infofile); - - ## function [bonds, status] = abg2cbg(bonds,components,system_name,filename) - ## - ## ###################################### - ## ##### Model Transformation Tools ##### - ## ###################################### - - ## ############################################################### - ## ## Version control history - ## ############################################################### - ## ## $Id$ - ## ## $Log$ - ## ## Revision 1.4 2003/03/24 12:18:00 gawthrop - ## ## Default file when no second argument - ## ## - ## ## Revision 1.3 2000/11/12 17:10:51 peterg - ## ## Close file if it is opened - ## ## Reformated octave style - ## ## - ## ## Revision 1.2 1997/02/11 10:06:42 peterg - ## ## Removed a debugging line. - ## ## - ## ## Revision 1.1 1996/08/18 20:06:57 peter - ## ## Initial revision - ## ## - ## ############################################################### - - ## Set default file if it isn't there already - - if nargin<2 - nofile = 1; - elseif infofile<0 - nofile = 1; - else - nofile = 0; - endif - - if nofile - infofile = fopen("mtt_info.txt","at"); - end; - - fprintf(infofile, "INFORMATION: %s\n", info); - - if nofile - fclose(infofile); - end; - -endfunction - - - - - DELETED mttroot/mtt/bin/trans/m/mtt_is_external.m Index: mttroot/mtt/bin/trans/m/mtt_is_external.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_is_external.m +++ mttroot/mtt/bin/trans/m/mtt_is_external.m @@ -1,25 +0,0 @@ -function is_external = mtt_is_external (comp_type,outsig, insigs, is_port) - - ## usage: is_external = mtt_is_external (comp_type,outsig, insigs, is_port) - ## - ## This is to determine if mtt_component_equation should look for - ## another equation. If is_external, the varable is available as a - ## system input and therfore requires no further equation. - ## I suspect that it needs more work. - - - if nargin<4 - is_port = 0; - endif - - is_external = 0; # Default - - if is_port - is_external = 0; - elseif strcmp(comp_type,"SS"); - is_external = insigs(1,2)!=outsig(2); - else - is_external = 0; - endif - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_isunique.m Index: mttroot/mtt/bin/trans/m/mtt_isunique.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_isunique.m +++ mttroot/mtt/bin/trans/m/mtt_isunique.m @@ -1,35 +0,0 @@ -function u = mtt_isunique(x); -% if all the elements of x are different, returns 1 else returns 0 - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/09/18 19:38:58 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -n = length(x); -u=1 - -disp("--checking uniqueness --") -x -for i=1:n - for j = 1:i-1 - if iscell(x) - if x{i}==x{j} - u = 0 - break; - end; - else - if x(i)==x(j) - u = 0 - break; - end; - end - end; -end; - DELETED mttroot/mtt/bin/trans/m/mtt_name2names.m Index: mttroot/mtt/bin/trans/m/mtt_name2names.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_name2names.m +++ mttroot/mtt/bin/trans/m/mtt_name2names.m @@ -1,12 +0,0 @@ -function names = mtt_name2names (name) - - ## usage: names = mtt_name2names (name) - ## - ## Converts standard mtt name to an array of subsystem names - - ## Copyright (C) 2003 by Peter J. Gawthrop - - delim ="__"; # MTT delimiter - names = char(strsplit(name,delim)); - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_names2name.m Index: mttroot/mtt/bin/trans/m/mtt_names2name.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_names2name.m +++ mttroot/mtt/bin/trans/m/mtt_names2name.m @@ -1,16 +0,0 @@ -function name = mtt_names2name (names) - - ## usage: name = names2name (names) - ## - ## Converts array of subsystem names to a standard mtt name - - delim ="__"; # MTT delimiter - - [n,m] = size(names); - name = deblank(names(1,:)); - - for i = 2:n - name = sprintf("%s%s%s", name, delim, deblank(names(i,:))); - endfor - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_optimise.m Index: mttroot/mtt/bin/trans/m/mtt_optimise.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_optimise.m +++ mttroot/mtt/bin/trans/m/mtt_optimise.m @@ -1,112 +0,0 @@ -function [theta,Theta,Error,Y,iterations] = mtt_optimise (system_name,y_s,theta_0,method,free,weight,criterion,max_iterations,alpha,View) - ## Usage: [theta,Theta,Error,Y,iterations] = mtt_optimise (system_name,y_s,theta_0,method,free,weight,criterion,max_iterations,alpha) - ## system_name String containg system name - ## y_s actual system output - ## theta_0 initial parameter estimate - ## free Indices of the free parameters within theta_0 - ## weight Weighting function - same dimension as y_s - ## method "time" or "freq" - ## criterion convergence criterion - ## max_iterations limit to number of iterations - ## alpha Optimisation gain parameter - - ## Copyright (C) 1999 by Peter J. Gawthrop - - if nargin<4 - method="time"; - endif - - N = length(theta_0); - if nargin<5 - free = [1:N]; - endif - - if nargin<6 - weight = ones(size(y_s)); - endif - - if nargin<7 - criterion = 1e-7; - endif - - if nargin <8 - max_iterations = 25; - endif - - if nargin<9 - alpha = 0.1; - endif - - if nargin<10 - View = 0; - endif - - if (!strcmp(method,"time"))&&(!strcmp(method,"freq")) - error("method must be either time or freq") - endif - - [n_data,n_y] = size(y_s); - - n_th = length(free); - error_old = inf; - error=1e50; - theta = theta_0; - Theta = []; - Error = []; - Y = []; - iterations = 0; - while (abs(error_old-error)>criterion)&&(abs(error)>criterion)&&(iterationscriterion)&&(abs(error)>criterion)&&(iterations(error_old+criterion) # Reduce step size and try again - factor = 10; - disp(sprintf("%2.2f*step",alpha)); - error = error_old; # Go back to previous error value - error_old = inf; # Don't let it think its converged - theta(free) = theta(free) + step; # Reverse step - step = alpha*step; # new stepsize - else # Recompute step size - tol = 1e-5; - step = pinv(JJ,tol)*J; # Step size - #step = pinv(JJ)*J; # Step size (built in tol) - endif - theta(free) = theta(free) - step; # Increment parameters - endif - ## theta - endwhile -endfunction - - DELETED mttroot/mtt/bin/trans/m/mtt_other_causality.m Index: mttroot/mtt/bin/trans/m/mtt_other_causality.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_other_causality.m +++ mttroot/mtt/bin/trans/m/mtt_other_causality.m @@ -1,21 +0,0 @@ -function other = mtt_other_causality (causality) - - ## usage: other = mtt_other_causality (causality) - ## - ## - - causality = deblank(causality); - if strcmp(causality,"effort"); - other = "flow"; - elseif strcmp(causality,"flow"); - other = "effort"; - elseif strcmp(causality,"e"); - other = "f"; - elseif strcmp(causality,"f"); - other = "e"; - else - error(sprintf("Causality \"%s\" not recognised",causality)); - endif - - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_other_end.m Index: mttroot/mtt/bin/trans/m/mtt_other_end.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_other_end.m +++ mttroot/mtt/bin/trans/m/mtt_other_end.m @@ -1,27 +0,0 @@ -function [in_components,in_ports,in_bonds] = mtt_other_end (name,all_in_bonds,cbg); - - ## usage: [in_components,in_ports,in_bonds] = mtt_other_end (name,all_in_bonds,cbg); - ## - ## - - ## What components are at the other ends of the in bonds? - in_components = ""; - in_ports = []; - in_bonds = []; - in_direction = []; - for i = 1:length(all_in_bonds); - for [component_structure, component] = cbg.subsystems - if !strcmp(name,component) - other_connections = component_structure.connections; - one = ones(size(other_connections)); - port = find(abs(all_in_bonds(i))*one==abs(other_connections)); - if (length(port)==1) - in_components = [in_components; component]; - in_bonds = [in_bonds; all_in_bonds(i)]; - in_ports = [in_ports; port]; - endif - endif - endfor - endfor - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_resolve_cr.m Index: mttroot/mtt/bin/trans/m/mtt_resolve_cr.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_resolve_cr.m +++ mttroot/mtt/bin/trans/m/mtt_resolve_cr.m @@ -1,57 +0,0 @@ -function eqn = mtt_resolve_cr (eqn) - ## usage: eqn = mtt_resolve_cr (eqn) - - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2003/03/24 12:20:28 gawthrop - ## *** empty log message *** - ## - ## Revision 1.1 2003/03/24 10:19:42 gawthrop - ## Documentation added - ## - ############################################################### - - ## Temporary version to resolve lin only! - - ## How many equations here? - N = length(findstr(eqn,"=")); - EQNS = char(strsplit(eqn,";")); - - eqn = ""; - for i = 1:N - - ## Split equation - EQN = char(strsplit(EQNS(i,:),":=")); - LHS = deblank(EQN(1,:)); - RHS = deblank(EQN(2,:)); - - if index(RHS,"lin(")>0 # lin cr is here - - RHS = sprintf("%s;", RHS); # Put back ; - - ## Make function into a list - RHS = strrep(RHS,"lin(","{lin,"); - RHS = strrep(RHS,");","}"); - - ## Convert "R" to R etc - RHS = strrep(RHS,"\"",""); - - - RHS = g_subs(RHS, "{{lin,$6,$3,$1,$5,1,$2,$3,1}}", "{$2*$1}"); - RHS = g_subs(RHS, "{{lin,$6,$3,$1,$5,1,$2,$4,1}}", "{$2/$1}"); - endif - - eqn_i = sprintf("%s := %s;", LHS, RHS); - eqn = sprintf("%s %s", eqn, eqn_i); - endfor - -endfunction - DELETED mttroot/mtt/bin/trans/m/mtt_save_alias.m Index: mttroot/mtt/bin/trans/m/mtt_save_alias.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_save_alias.m +++ mttroot/mtt/bin/trans/m/mtt_save_alias.m @@ -1,21 +0,0 @@ -function mtt_save_alias (arg,system_name) - - ## usage: mtt_save_alias (arg,system_name,FileID) - ## - ## - ## ###################################### - ## #### Model Transformation Tools ##### - ## ###################################### - - ## ############################################################### - ## Version - ## control history - ## ############################################################### ## $Id: - ## mtt_info.m,v 1.2 1997/02/11 10:06:42 peterg Exp peterg $ ## $Log: - ## mtt_info.m,v $ ## Revision 1.2 1997/02/11 10:06:42 peterg ## - ## ############################################################### - - fileid = fopen('mtt_aliased.txt','at'); - fprintf(fileid, "%s\t%s\n", arg,system_name); - fclose(fileid); -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_sfreq.m Index: mttroot/mtt/bin/trans/m/mtt_sfreq.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_sfreq.m +++ mttroot/mtt/bin/trans/m/mtt_sfreq.m @@ -1,61 +0,0 @@ -function [w,y,y_theta] = mtt_sfreq(system_name,theta,free); - ## usage: [w,y,y_theta] = mtt_sfreq(system_name,theta,free); - ## - ## Frequency response with name system_name and parameter vector theta - ## The order of components in theta is determined in system_numpar.txt: - ## y_theta contains the corresponding sensitivity functions - ## Assumes system generated by the sBG approach - ## Copyright (C) 1999 by Peter J. Gawthrop - - ## $Id$ - - ## Assumes SISO system - - global mtt_n_parameters mtt_parameters # Global "argc argv" - global mtt_w # Frequencies (if not specified in simpar file - N = length(theta); - - eval(sprintf("[nx,ny,nu,nz,nyz] = %s_def;", system_name)); - if nargin<3 - free = 1; - endif - - y_theta = []; - - if length(free)==0 - free=1; # Make the loop happen once to get y and X - endif - - [n,m] = size(free); - if m==1 - free = free'; - endif - - - eval(sprintf("%s_simpar;", system_name)); # Read the "simulation" - # parameters - if exist("mttwmin") # Compute frequency range - w = logspace(mttwmin,mttwmax,mttwsteps)'; # Frequency range - else # use global mtt_w - w = mtt_w; - endif - - y_theta = []; - mtt_n_parameters = 1+N; - mtt_parameters(2:1+N) = theta; # The actual parameters - for i = free - mtt_parameters(1) = i; # Select wich sens. function - eval(sprintf("%s_numpar;", system_name)); # Read the parameters - eval(sprintf("[A,B,C,D,E] = %s_dm;", system_name)); # Evaluate the - # descriptor matrices - fr = dm2fr(A,B,C,D,E,w); - y_theta = [y_theta fr(:,2)]; # Sensitivity frequency response - endfor - - y = fr(:,1); # Actual frequency response - - -endfunction - - - DELETED mttroot/mtt/bin/trans/m/mtt_simulate.m Index: mttroot/mtt/bin/trans/m/mtt_simulate.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_simulate.m +++ mttroot/mtt/bin/trans/m/mtt_simulate.m @@ -1,32 +0,0 @@ -function [t,y,y_theta] = mtt_simulate(system_name,theta); - ## usage: [t,y,y_theta] = mtt_simulate(r); - ## - ## Simulate system with name system and parameter vector theta - ## The order of components in theta is determined in system_numpar.txt: - ## Copyright (C) 1999 by Peter J. Gawthrop - - ## $Id$ - - ## Simulate using mtt-generated function - y_theta = []; - for i=1:length(theta) - args=""; - for j=1:length(theta) - i_sensitivity=(j==i); - args = sprintf("%s%i %g ",args, i_sensitivity, theta(j)); - endfor - - command = sprintf("./%s_ode2odes.out %s > mtt_data.dat\n", system_name, args); - system(command); - - ## Retrieve data - load -force mtt_data.dat - t = mtt_data(:,1); - y = mtt_data(:,2); - y_theta = [y_theta mtt_data(:,3)]; - endfor - -endfunction - - - DELETED mttroot/mtt/bin/trans/m/mtt_ssimulate.m Index: mttroot/mtt/bin/trans/m/mtt_ssimulate.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_ssimulate.m +++ mttroot/mtt/bin/trans/m/mtt_ssimulate.m @@ -1,34 +0,0 @@ -function [t,y,y_theta] = mtt_ssimulate(system_name,theta); - ## usage: [t,y,y_theta] = mtt_ssimulate(system_name,theta); - ## - ## Simulate system with name system_name and parameter vector theta - ## The order of components in theta is determined in system_numpar.txt: - ## y_theta contains the corresponding sensitivity functions - ## Assumes system generated by the sBG approach - ## Copyright (C) 1999 by Peter J. Gawthrop - - ## $Id$ - - ## Simulate using mtt-generated function - y_theta = []; - for i=1:length(theta) - args=""; - for j=1:length(theta) - i_sensitivity=(j==i); - args = sprintf("%s%i %g ",args, i_sensitivity, theta(j)); - endfor - - command = sprintf("./%s_ode2odes.out %s > mtt_data.dat\n", system_name, args); - system(command); - - ## Retrieve data - load -force mtt_data.dat - t = mtt_data(:,1); - y = mtt_data(:,2); - y_theta = [y_theta mtt_data(:,3)]; - endfor - -endfunction - - - DELETED mttroot/mtt/bin/trans/m/mtt_stime.m Index: mttroot/mtt/bin/trans/m/mtt_stime.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_stime.m +++ mttroot/mtt/bin/trans/m/mtt_stime.m @@ -1,64 +0,0 @@ -function [t,y,y_theta,x,x_last] = mtt_stime(system_name,theta,free); - ## usage: [t,y,y_theta,x,x_last] = mtt_stime(system_name,theta); - ## - ## Simulate system with name system_name and parameter vector theta - ## The order of components in theta is determined in system_numpar.txt: - ## y_theta contains the corresponding sensitivity functions - ## Assumes system generated by the sBG approach - ## Copyright (C) 1999 by Peter J. Gawthrop - - ## $Id$ - - ## Simulate using mtt-generated function - - N = length(theta); - - eval(sprintf("[nx,ny,nu,nz,nyz] = %s_def;", system_name)); - if nargin<3 - free = 1; - endif - - y_theta = []; - - if length(free)==0 - free=1; # Make the loop happen once to get y and X - endif - - [n,m] = size(free); - if m==1 - free = free'; - endif - - for i=free - args=sprintf("%i",i); - for j=1:length(theta) - args = sprintf("%s %g",args, theta(j)); - endfor - - ## Run system and replace NaN by 1e30 -- easier to handle - file_name = sprintf("%s_input.dat", system_name); - if exist(file_name)==2 # Then use data from this file ... - command = sprintf("./%s_ode2odes.out %s < %s | sed \'s/NAN/Inf/g\' >mtt_out_data.dat\n", ... - system_name, args, file_name); - else - command = sprintf("./%s_ode2odes.out %s | sed \'s/NAN/Inf/g\' >mtt_out_data.dat\n", ... - system_name, args); - endif - - system(command); - - ## Retrieve out_data - load -force mtt_out_data.dat - y_theta = [y_theta mtt_out_data(:,3:2:1+ny)]; - endfor - - ## System out_data - [n,m]=size(mtt_out_data); - t = mtt_out_data(:,1); - y = mtt_out_data(:,2:2:ny); - x = mtt_out_data(:,3+ny:m); - x_last = mtt_out_data(n,3+ny:m); -endfunction - - - DELETED mttroot/mtt/bin/trans/m/mtt_strip_name.m Index: mttroot/mtt/bin/trans/m/mtt_strip_name.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_strip_name.m +++ mttroot/mtt/bin/trans/m/mtt_strip_name.m @@ -1,22 +0,0 @@ -function stripped_name = mtt_strip_name (name) - - ## usage: stripped_name = mtt_strip_name (name) - ## - ## Removes blanks and [] from a port name - - if (length(name)==0) - error("Zero length port name found"); - endif - - - [N,M] = size(name) - if N>1 - error("Cannot resolve port names: redraw abg.fig"); - endif - - - stripped_name = deblank(name); # remove blanks - stripped_name = stripped_name(2:length(stripped_name)-1); - stripped_name = deblank(stripped_name); # remove blanks - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_subname.m Index: mttroot/mtt/bin/trans/m/mtt_subname.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_subname.m +++ mttroot/mtt/bin/trans/m/mtt_subname.m @@ -1,20 +0,0 @@ -function [subname, compname] = mtt_subname (name) - - ## usage: subname = mtt_subname (name) - ## - ## Finds the subsystem name from the component name - ## Copyright (C) 2003 by Peter J. Gawthrop - - - names = mtt_name2names(name); - [n,m] = size(names); - - if n<2 # Simple name - subname = ""; - compname = name; - else # Compound name - subname = mtt_names2name(names(1:n-1,:)); - compname = deblank(names(n,:)); - endif - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_type_name.m Index: mttroot/mtt/bin/trans/m/mtt_type_name.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_type_name.m +++ mttroot/mtt/bin/trans/m/mtt_type_name.m @@ -1,15 +0,0 @@ -function NewType = mtt_type_name (OldType) - - ## usage: NewType = mtt_type_name (OldType) - ## - ## - - if OldType=="0"; - NewType = "Zero"; - elseif OldType=="1"; - NewType = "One"; - else - NewType = OldType; - endif - -endfunction DELETED mttroot/mtt/bin/trans/m/mtt_update.m Index: mttroot/mtt/bin/trans/m/mtt_update.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_update.m +++ mttroot/mtt/bin/trans/m/mtt_update.m @@ -1,13 +0,0 @@ -function [x] = mtt_update(dx,x,dt,STEPFACTOR,METHOD,name); - - if (METHOD==1) #Euler - ddt = dt/STEPFACTOR; - x = x + dx*ddt; - elseif (METHOD==2) #Linear implicit or Implicit - eval("[AA,AAx] = ",name,"_smx;"); - x = AA\(AAx + dx*dt); - else - error("Method %i is not defined", METHOD); - endif; - -endfunction; DELETED mttroot/mtt/bin/trans/m/mtt_write.m Index: mttroot/mtt/bin/trans/m/mtt_write.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_write.m +++ mttroot/mtt/bin/trans/m/mtt_write.m @@ -1,33 +0,0 @@ -function mtt_write(t,x,y,nx,ny,first); - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2002/05/13 08:52:23 gawthrop -## FIRST parameter of simpar now specifies first printed point - -## simulation still starts at zero -## -## Revision 1.5 2001/03/30 15:13:58 gawthrop -## Rationalised simulation modes to each return mtt_data -## -## Revision 1.4 1999/03/15 23:05:29 peterg -## A complete rewrite - now puts into a Global matrix MTT_data -## -## Revision 1.3 1999/03/15 21:57:00 peterg -## Removed the # symbol -## -############################################################### - -global MTT_data - if (t==0.0) - MTT_data=[]; - endif - - if (t>= first) - MTT_data = [MTT_data; t,y(:)',t,x(:)']; - endif - -endfunction - DELETED mttroot/mtt/bin/trans/m/mtt_zeroswitches.m Index: mttroot/mtt/bin/trans/m/mtt_zeroswitches.m ================================================================== --- mttroot/mtt/bin/trans/m/mtt_zeroswitches.m +++ mttroot/mtt/bin/trans/m/mtt_zeroswitches.m @@ -1,4 +0,0 @@ -function [x] = mtt_zeroswitches(x,Nx,open) - I_open = nozeros(open.*[1:Nx]'); # Indices of open switches - x(I_open) = 0.0; # Open switches have zero states -endfunction; DELETED mttroot/mtt/bin/trans/m/name_in_list.m Index: mttroot/mtt/bin/trans/m/name_in_list.m ================================================================== --- mttroot/mtt/bin/trans/m/name_in_list.m +++ mttroot/mtt/bin/trans/m/name_in_list.m @@ -1,42 +0,0 @@ -function index = name_in_list(name,list) - -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function name_in_list.m -% Finds name in list and returns index -- zero if not found - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/23 09:22:05 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -[N,M] = size(list); -if N<1 - error('list must have at least one element'); -end; - -index = 0; - -for i = 1:N - j = findstr(name,list(i,:)); - if (length(j)==1) - if j(1)==1 - if index==0 - index = i; - else - index = [index i]; - end - end - end; -end; - DELETED mttroot/mtt/bin/trans/m/nozeros.m Index: mttroot/mtt/bin/trans/m/nozeros.m ================================================================== --- mttroot/mtt/bin/trans/m/nozeros.m +++ mttroot/mtt/bin/trans/m/nozeros.m @@ -1,24 +0,0 @@ -function v = nozeros (v0,tol) - - ## usage: v = nozeros (v0,tol) - ## - ## Zaps the zeros in a vector with tolerance tol (defaults to zero) - - ## Copyright (C) 2000 by Peter J. Gawthrop - - if nargin<2 - tol=eps; - endif - - - v = []; - j=0; - for i = 1:length(v0) - if abs(v0(i))>tol - j=j+1; - v(1,j) = v0(i); - end; - end; - - -endfunction DELETED mttroot/mtt/bin/trans/m/pol2root2tex.m Index: mttroot/mtt/bin/trans/m/pol2root2tex.m ================================================================== --- mttroot/mtt/bin/trans/m/pol2root2tex.m +++ mttroot/mtt/bin/trans/m/pol2root2tex.m @@ -1,73 +0,0 @@ -function tex = pol2root2tex(pol,name,f) - ## pol2tex: converts polynomial into LaTeX form as (s-z_1)..(s-z_n) - ## tex = pol2root2tex(pol,[name,f]) - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/05/10 19:08:35 gawthrop - ## Cosmetic improvements - ## - ## Revision 1.1 2001/05/10 11:44:40 gawthrop - ## Useful conversion functions - ## - ## Revision 1.1 1999/05/24 22:05:53 peterg - ## Initial revision - ## - ############################################################### - - if nargin<2 - name = "s" - endif - - if nargin<3 - f = "%2.2f"; - endif - - n = length(pol)-1; - - if n>0 - r = sort(roots(pol)); - endif - - gain = pol(1); - - complex=0; - if ((gain==1)&&(n>0)) - tex=""; - else - tex = sprintf("%g", gain); - endif - - for i=1:n - if real(r(i))<0 - r_plusminus = '+'; - else - r_plusminus = '-'; - endif - if imag(r(i))<0 - i_plusminus = '+'; - else - i_plusminus = '-'; - endif - - if complex - complex=0; - else - if abs(imag(r(i)))<1e-5 - ff = sprintf("%%s (%s %%s %s)",name, f); - tex = sprintf(ff, tex, r_plusminus, abs(r(i))); - else - ff = sprintf("%%s (%s %%s %s \\pm j %s)", name, f, f); - tex = sprintf(ff, tex, r_plusminus, abs(real(r(i))), imag(r(i))); - complex=1; - endif - endif - endfor - -endfunction - - - DELETED mttroot/mtt/bin/trans/m/pol2tex.m Index: mttroot/mtt/bin/trans/m/pol2tex.m ================================================================== --- mttroot/mtt/bin/trans/m/pol2tex.m +++ mttroot/mtt/bin/trans/m/pol2tex.m @@ -1,80 +0,0 @@ -function tex = pol2tex(pol,name,f) - ## pol2tex: converts polynomial into LaTeX form. - ## tex = pol2tex(pol,[name,f]) - - ## pol polynomial (row vector) - ## name name of the variable (eg s or z) - ## f format of the coefficients (eg %2.4f) - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.3 2001/07/11 03:58:41 gawthrop - ## removed {} - ## - ## Revision 1.2 2001/05/10 19:08:35 gawthrop - ## Cosmetic improvements - ## - ## Revision 1.1 2001/05/10 11:44:40 gawthrop - ## Useful conversion functions - ## - ## Revision 1.1 1999/03/25 01:33:51 peterg - ## Initial revision - ## - ############################################################### - - if nargin<2 - name = "s"; - endif - - if nargin<3 - f = "%2.2f"; - endif - - n = length(pol); - if n<1 - tex = "--"; - return - endif - - if pol(1) == 1 - if n>1 - tex = ''; - else - tex = '1'; - endif - else - ff = sprintf(" %s",f); - tex = sprintf(ff, pol(1)); - endif - - if n>2 - tex = sprintf("%s%s^%i", tex, name, n-1); - elseif n==2 - tex = sprintf("%s%s", tex, name); - else - tex = sprintf("%s", tex); - endif - - for i=2:n - if pol(i)<0 - plusminus = '-'; - else - plusminus = '+'; - endif - ff = sprintf("%%s %%s %s",f); - tex = sprintf(ff, tex, plusminus, abs(pol(i))); - if i1 # Multi ports - port no. is first arg of CR - fprintf(eqnfile, "#1.0f,", outport); - endif - fprintf(eqnfile, "%s", args); # Print the arguments - for port = 1:ports # Print the input causalities and values - fprintf(eqnfile, "\n\t\t,%s,%s", cause2name(RHS_cause(port)), ... - varname(name,bond_number(port), RHS_cause(port))); - endif - fprintf(eqnfile, "\n\t\t);\n"); - endif -endfunction - - DELETED mttroot/mtt/bin/trans/m/psfig.m Index: mttroot/mtt/bin/trans/m/psfig.m ================================================================== --- mttroot/mtt/bin/trans/m/psfig.m +++ mttroot/mtt/bin/trans/m/psfig.m @@ -1,43 +0,0 @@ -function psfig(filename) - ## Usage: psfig(filename) - ## Puts figure into ps file - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.1 1999/11/30 23:26:21 peterg - ## Initial revision - ## - ## Revision 1.3 1999/09/04 02:23:30 peterg - ## Removed mv stuff - now uses gset on actual file - ## - ## Revision 1.2 1999/06/15 02:05:44 peterg - ## Now adds a .ps if not there already - ## - ## Revision 1.1 1999/03/25 01:35:00 peterg - ## Initial revision - ## - ############################################################### - - ## Add .ps if not there already - if !index(filename,".") # Is there a . - filename = sprintf("%s.ps",filename); - endif - - eval(sprintf("gset output \"%s\" ",filename)); - gset linestyle 1 lw 4 # Thicker lines - gset linestyle 2 lw 4 # Thicker lines - gset linestyle 3 lw 4 # Thicker lines - gset linestyle 4 lw 4 # Thicker lines - gset linestyle 5 lw 4 # Thicker lines - - - gset term postscript eps - replot; - gset term x11 - gset output - replot; - -endfunction DELETED mttroot/mtt/bin/trans/m/rbg2abg.m Index: mttroot/mtt/bin/trans/m/rbg2abg.m ================================================================== --- mttroot/mtt/bin/trans/m/rbg2abg.m +++ mttroot/mtt/bin/trans/m/rbg2abg.m @@ -1,692 +0,0 @@ -function [bonds,components,n_vector_bonds] = rbg2abg(name,rbonds,rstrokes,rcomponents, ... - port_coord,port_name, ... - infofile,errorfile) - - ## ############################################################### - ## ## Version control history - ## ############################################################### - ## ## $Id$ - ## ## $Log$ - ## ## Revision 1.51 2012/10/15 19:22:44 geraint - ## ## mtt_isunique replaces unique which masks a built-in function. - ## ## - ## ## Revision 1.50 2009/11/02 16:54:03 geraint - ## ## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char - ## ## - ## ## Revision 1.49 2004/07/22 13:18:02 geraint - ## ## Minor typo in error message. - ## ## - ## ## Revision 1.48 2004/02/19 18:27:47 geraint - ## ## [ 852694 ] octave 2.1.52 breaks rbg2abg - ## ## - ## ## Octave now prefers row vectors to column vectors. - ## ## - ## ## Revision 1.47 2002/08/27 16:09:01 geraint - ## ## Added port_name to error message when multiple bonds are near a port. - ## ## - ## ## Revision 1.46 2000/09/11 08:22:02 peterg - ## ## Checks for absent port list in subsystem abg file. - ## ## - ## ## Revision 1.45 1999/10/19 02:13:31 peterg - ## ## Now assigns correct bonds to the new junction port names - ## ## - ## ## Revision 1.44 1999/10/19 00:05:44 peterg - ## ## Now defaults junction ports when only one specified (for vector junctions) - ## ## - ## ## Revision 1.43 1999/10/18 04:08:46 peterg - ## ## Now computes n_vector_bonds -- number apparent (maybe vector) bonds per component. - ## ## Neeeded to vectorise junctions. - ## ## - ## ## Revision 1.42 1999/08/25 21:45:03 peterg - ## ## Spurious start to vector 0 and 1 - ## ## - ## ## Revision 1.41 1999/08/19 21:12:33 peterg - ## ## Tidied and started implementaation of vector junctions - ## ## - ## ## Revision 1.40 1999/08/19 05:39:55 peterg - ## ## Put into octave format - ## ## - ## ## Revision 1.39 1999/08/19 05:22:16 peterg - ## ## To RCS prior to inplementing vector junctions - ## ## - ## ## Revision 1.38 1999/03/12 00:58:06 peterg - ## ## Now gets portlist from the _abg.m file NOT the _rbg.m file - ## ## - this allows expansion of vector SS ports. - ## ## - ## ## Revision 1.37 1998/07/28 19:06:43 peterg - ## ## Still some bugs (vector SS ports)?? - ## ## - ## ## Revision 1.36 1998/07/28 10:30:50 peterg - ## ## Implemented vector SS ports. - ## ## - ## ## Revision 1.35 1998/07/08 15:35:15 peterg - ## ## Added errorfile argument - ## ## - ## ## Revision 1.34 1998/07/02 19:41:29 peterg - ## ## Fixed empty port string bug - set to null string. - ## ## - ## ## Revision 1.33 1998/07/02 17:16:06 peterg - ## ## Commented out redundent code -- obsolete due to new default mechanism - ## ## - ## ## Revision 1.32 1998/07/02 15:12:05 peterg - ## ## Added hard error reporting - ## ## Added error when two unlabled bonds point in. - ## ## - ## ## Revision 1.31 1998/07/02 14:30:50 peterg - ## ## Corrected various bugs - including resettting n_ports to correct value - ## ## - ## ## Revision 1.30 1998/07/02 13:40:50 peterg - ## ## Added extra ports names (due to defaults) to relevant lists: - ## ## port_name - ## ## port_bond - ## ## - ## ## Revision 1.29 1998/07/02 13:28:31 peterg - ## ## Added defaults in new form BEFORE alias expansion - ## ## - ## ## Revision 1.28 1998/07/02 12:36:05 peterg - ## ## Removed debugging lines - ## ## - ## ## Revision 1.27 1998/07/02 12:24:02 peterg - ## ## Expand port aliases - ## ## - ## ## Revision 1.26 1998/04/16 14:07:51 peterg - ## ## Sorted out [] problem with vector ports -- new octave function - ## ## split_port - ## ## - ## ## Revision 1.25 1998/04/12 15:01:04 peterg - ## ## Converted to uniform port notation - always use [] - ## ## - ## ## Revision 1.24 1998/02/19 08:57:16 peterg - ## ## Fixed mtt-info bug -- confused filename with number - ## ## - ## ## Revision 1.23 1997/12/04 14:24:22 peterg - ## ## Removed error message about through-pointing arrows - ## ## - ## ## Revision 1.22 1997/09/18 19:49:37 peterg - ## ## Added test for uniquness of bonds on a component -- if non-unique - ## ## implies same component at both ends of a bond. - ## ## - ## ## Revision 1.21 1997/09/16 15:14:14 peterg - ## ## Added warning if a component has no bonds. - ## ## - ## ## Revision 1.20 1997/08/18 19:39:48 peterg - ## ## Now generates (exampaded) port_bond list correctely - ## ## - ## ## Revision 1.19 1997/08/14 11:59:47 peterg - ## ## Vector ports added!! - ## ## - ## ## Revision 1.18 1997/08/14 11:01:42 peterg - ## ## Reordered algorithms as follows: - ## ## bond end coordinates - ## ## associate port labels with bonds (port_bond) - ## ## associate bonds with components - ## ## unsorted list of bonds on each component (components) - ## ## interpret strokes and setup the causality of the bonds (bonds) - ## ## expand vector ports & add new bonds and connections - ## ## sort bonds on each component according to the labels -- two ports - ## ## default included here. - ## ## - ## ## Revision 1.17 1997/08/09 11:31:16 peterg - ## ## Default two port list is [in;out] (or [out;in]) - ## ## Dont do global default if no ports labels. - ## ## - ## ## Revision 1.16 1997/08/07 16:12:36 peterg - ## ## Fixed sorting bug: now puts the jth component from the unsorted list - ## ## into the kth component of the sorted list .. not vice versa! - ## ## - ## ## Revision 1.15 1997/08/06 21:43:19 peterg - ## ## Corrected error in creating component list: the kth component of the - ## ## list is given by the jth component of the original list NOT vice - ## ## versa. - ## ## - ## ## Revision 1.14 1997/08/04 14:18:55 peterg - ## ## If no ports labels at all, just use the default component list. - ## ## - ## ## Revision 1.13 1997/08/04 12:50:39 peterg - ## ## Many bug fixes to the named port version + tied up the logic and - ## ## supporting comments. - ## ## - ## ## Revision 1.12 1997/08/02 19:37:53 peterg - ## ## Now uses named ports. - ## ## - ## ## Revision 1.11 1997/04/29 09:12:37 peterg - ## ## Added error message if port label near to >1 bond. - ## ## - ## ## Revision 1.10 1997/03/17 13:45:42 peterg - ## ## Added more error info. - ## ## - ## ## Revision 1.9 1996/12/31 11:25:57 peterg - ## ## Clearer error messages for incorrect ports. - ## ## - ## ## Revision 1.8 1996/12/04 21:52:39 peterg - ## ## Now uses fopen. - ## ## - ## ## Revision 1.7 1996/11/01 18:01:57 peterg - ## ## Rationalised port ordering. - ## ## Fixed port bug. - ## ## - ## ## Revision 1.6 1996/08/25 08:27:14 peter - ## ## Now checks ports correctely - I hope. - ## ## - ## ## Revision 1.5 1996/08/24 19:21:26 peter - ## ## More specific error messages. - ## ## - ## ## Revision 1.4 1996/08/24 18:00:33 peter - ## ## Fixed bug with finding ports. - ## ## - ## ## Revision 1.3 1996/08/09 08:26:35 peter - ## ## Cosmetic tidy up. - ## ## - ## ## Revision 1.2 1996/08/04 18:37:57 peter - ## ## Fixed no causal strokes bug. - ## ## - ## ## Revision 1.1 1996/08/04 18:30:14 peter - ## ## Initial revision - ## ## - ## ############################################################### - - - ##Default to no components - components = [0]; - - ## Xfig scaling factor - scale = 1200.0/2.54546; - - ## Rotation matrix - rot = [0 -1; 1 0]; - - ## Find number of strokes - [n_strokes,columns] = size(rstrokes); - if (columns ~= 4)&(n_strokes>0) - error('Incorrect rstrokes matrix: must have 4 columns'); - endif - - - ## Find number of bonds - [n_bonds,columns] = size(rbonds); - if (columns ~= 6)&(n_bonds>0) - error('Incorrect rbonds matrix: must have 6 columns'); - endif - - - ## Find number of components - [n_components,columns] = size(rcomponents); - - ## Find the number of ports refered to within the component - [n_ports,columns] = size(port_coord) - - ## If port_name is empty, make it a empty string - if (length(port_name)==0) - port_name=""; - endif - - - ## Determine coordinates of the arrow end of the bond and the other end - other_end_1 = rbonds(:,1:2); - arrow_end = rbonds(:,3:4); - other_end_2 = rbonds(:,5:6); - - distance_1 = length2d(other_end_1 - arrow_end); - distance_2 = length2d(other_end_2 - arrow_end); - which_end = (distance_1>distance_2)*[1 1]; - one = ones(size(which_end)); - other_end = which_end.*other_end_1 + (one-which_end).*other_end_2; - arrow_vector = ( which_end.*other_end_2 + (one-which_end).*other_end_1 ) - ... - arrow_end; - - ## Locate the bond end nearest to each port - ## col 1 of port_near_bond contains a signed bond number (+ for arrow end) - ## col 2 of port_near_bond contains the corresponding port index - port_bond = []; - for i = 1:n_ports - near_bond = adjbond(port_coord(i,1:2),arrow_end,other_end); - [rows,cols]=size(near_bond); - if rows>1 - error(sprintf ... - ("A port is near to more than one bond at coordinates %g,%g %s\n", ... - port_coord(i,1)/scale, port_coord(i,2)/scale, deblank(port_name(i,:)))); - endif - - - ##The (signed) bond corresponding to the ith port label - port_bond(i,1) = near_bond(1)*sign(1.5-near_bond(2)); - endfor - - port_bond - ##We now have the (signed) bond (port_bond(i)) correponding to the - ## ith port label within the component - - ## Locate the components at the ends of each bond - ## col 1 of comp_near_bond contain the component nearest to the arrow end - ## col 2 of comp_near_bond contain the component nearest to the other end - for i = 1:n_bonds - comp_near_bond(i,:) = adjcomp(arrow_end(i,:),other_end(i,:),rcomponents); - endfor - - comp_near_bond - ## We now have a list (comp_near_bond) of the component(s) at each end - ## of each bond - - ## Now do a list of the bonds on each component - unsorted at this stage. - ## Also expand aliases using the alias list for each component - components = []; - i_vector=0; # Counter for vector components - for i = 1:n_components - ##Get component type - eval(['[comp_type, comp_name] = ', name, '_cmp(i)']); - - - ## There are n_comp_bonds bonds on this component with corresponding index - [index,n_comp_bonds] = getindex(comp_near_bond,i); - - if index(1,1)==0 - mtt_error(sprintf("Component %s (%s) has no bonds", comp_name, - comp_type),errorfile); - endif - - - ## Create the signed list of bonds on this component - one = ones(n_comp_bonds,1); - bond_list = index(:,1); % bond at component - - ## Check that all bonds are unique -- error if not - if mtt_isunique(bond_list)==0 - mtt_error(sprintf("Component %s (%s) is at both ends of a bond", comp_name, - comp_type),errorfile); - endif - - - - ## which end of bond at component? - bond_end = index(:,2); - direction = -sign(bond_end-1.5*one); - signed_bond_list = bond_list.*direction; - components = add_bond(components,signed_bond_list',i); - - ## Unalias and/or default all the ports on this componen - unlabelled_ports = 0; - in_bonds = 0; - out_bonds = 0; - if ((comp_type=="0")||(comp_type=="1")) # A junction - disp("---- default junctions ---- "); - junction_names = 0; - for j=1:n_comp_bonds - port_name_index = getindex(port_bond,signed_bond_list(j)); - if port_name_index>0 - junction_port_name = port_name(port_name_index,:); - named_bond_index = j; - junction_names++; - endif - endfor - if junction_names==1 # one named port - mtt_info(sprintf("Defaulting all ports on junction %s to %s", comp_name, junction_port_name)); - ## Make the other n-1 names the same. - junction_port_name = mtt_strip_name(junction_port_name); - for j=1:n_comp_bonds; - if j!=named_bond_index - port_name = [port_name; ["[" junction_port_name "]"]]; # add to list - [port_name_index,junk] = size(port_name); # the corresponding index - port_bond(port_name_index,:) = signed_bond_list(j); # add to port bond - endif - endfor - elseif (junction_names!=0)&&(junction_names!=n_comp_bonds) # not allowed - mtt_error(sprintf("Junction %s must have 0, 1 or %i port labels", comp_name,n_comp_bonds),errorfile); - endif - port_name = port_name - else # Not a junction - for j=1:n_comp_bonds - signed_bond = signed_bond_list(j); - port_name_index = getindex(port_bond,signed_bond); - port_direction = sign(signed_bond); - - if port_name_index==0 # There is no port on this bond - so try - # to default - unlabelled_ports++; - if(unlabelled_ports==1) - if port_direction>0 - in_bonds++; - port_name_i = "in"; - else - out_bonds++; - port_name_i = "out"; - endif - - elseif (unlabelled_ports==2) - if port_direction>0 - if (++in_bonds>1) - mtt_error(["More than one unlabelled INport on component " ... - comp_name " (" comp_type ")"],errorfile); - else - port_name_i = "in"; - end - else - if (++out_bonds>1) - mtt_error(["More than one unlabelled OUTport on component " ... - comp_name " (" comp_type ")"],errorfile); - else - port_name_i = "out"; - end - endif - - else - mtt_error(["More than two unlabelled ports on component " ... - comp_name " (" comp_type ")"],errorfile); - endif - - mtt_info(["Defaulting port name [" port_name_i "]\t on component " ... - comp_name " (" comp_type ")" ],infofile); - port_name = [port_name; ["[" port_name_i "]"]]; # add to list - [port_name_index,junk] = size(port_name); # the corresponding - # index - port_bond(port_name_index,:) = signed_bond; # add to port bond - else - port_name_i = mtt_strip_name(port_name(port_name_index,:)) - ## port_name_i = deblank(port_name(port_name_index,:)); - ## port_name_i = port_name_i(2:length(port_name_i)-1) # strip [] - endif - - - ## Replace by alias -- if any - eval( ["alias = ", comp_type, '_alias';]); # Get aliases - if isstruct(alias) # are there any aliases - if isfield(alias,port_name_i) # Is this an alias? - eval(["new_port_name_i = alias.",port_name_i]); - mtt_info(["Aliasing name [" port_name_i "]\t on component " ... - comp_name " (" comp_type ")\t to [" new_port_name_i "]"],infofile); - port_name = replace_name(port_name, ... - ["[",new_port_name_i,"]"], ... - port_name_index); - endif - - endif - - endfor - - endif - - endfor - - ## At this point, every port should be labeled (port_name) and ... - ## associated with a bond (port_bond). - disp("--- Completed portnames and the corresponding bonds ---") - port_name, port_bond - - - ## Deduce causality from the strokes (if any) and create the list of bonds - causality = zeros(n_bonds,2); - if n_strokes>0 - ## Find out location of centre and ends of stroke. - stroke_end_1 = [rstrokes(:,1) rstrokes(:,2)]; - stroke_end_2 = [rstrokes(:,3) rstrokes(:,4)]; - - stroke_centre = (stroke_end_1 + stroke_end_2)/2; - stroke_vector = (stroke_end_1 - stroke_end_2); - stroke_length = length2d(stroke_vector); - - ## Deduce bond causality from the strokes - for i = 1:n_strokes - stroke = [stroke_centre(i,:) - stroke_end_1(i,:) - stroke_end_2(i,:)]; - - - ## Find the nearest bond end. - [index,distance] = adjbond(stroke(1,:),arrow_end,other_end); - if (distance>2*stroke_length(i)) - info = sprintf('Stroke at (%4.3f,%4.3f) is %4.3f away from the nearest bond\n', ... - stroke(1,1)/scale, stroke(1,2)/scale, distance/scale); - endif - - - ## Bond end coordinates - j = index(1,1); - which_end = index(1,2)==1; - bond_end = arrow_end(j,:)*which_end + other_end(j,:)*(1-which_end); - - ## Now decide which bit of the stroke is nearest - stroke_index = adjbond(bond_end,stroke,zeros(size(stroke))); - - if stroke_index(1)==1 ## uni-causal stroke - causality(j,1:2) = (2*which_end-1)*[1 1]; - else ## bicausal stroke - ## Find out whether stroke is on flow side of bond - stroke_direction = stroke(1,:) - stroke(stroke_index(1),:); - flow_side = stroke_direction*arrow_vector(j,:)'>0; - causality(j,1+flow_side) = 2*which_end-1; - endif - - endfor - - endif - - - bonds = causality; - - - ## Find number of bonds on each component BEFORE vectorisation - for i=1:n_components - n_vector_bonds(i,1) = length(nozeros(components(i,:))) - endfor - - ## Now expand vector ports - disp("Expanding vector ports"); - [n_bonds,junk] = size(bonds); - n_ports = length(port_bond); - n_exp_ports=n_ports; - exp_port_name=""; - exp_port_bond = []; - ##exp_comps = []; - for i=1:n_ports - port_name_i = port_name(i,:) - [subport,n_subports] = split_port(port_name_i, ','); ## Find the components of the vector port - - if n_subports==1 ## an ordinary port - exp_port_name = [exp_port_name; subport(1,:)]; ## Write out the only port - exp_port_bond = [exp_port_bond; port_bond(i)]; ## and the port_bond - else ## its a vector port - ## Check that there is a corresponding vector port at the other end of the - ## bond - signed_bond_index = port_bond(i); - [other_bond_index,n_other] = getindex(port_bond,-signed_bond_index); - if n_other == 1 - other_port_name = port_name(other_bond_index,:); - [other_subport,n_other_subports] = split_port(other_port_name, ','); - if n_other_subports~=n_subports - mtt_error(['Vector ports ', port_name_i, ' and ', other_port_name, 'are not compatible'],errorfile); - end - else # No explicit matching vector port - mtt_error(['Vector port ', port_name_i, ' has no matching port'], errorfile); - endif - - - if other_bond_index>i ##then its not been done yet - mtt_info(["Vector port: ", port_name_i],infofile); - mtt_info(["matching: ", other_port_name],infofile); - ## Remove sign info. - bond_index = abs(signed_bond_index); - sig = sign(signed_bond_index); - - ## Put the first element of each port list in the expanded list - exp_port_name = [exp_port_name; subport(1,:)]; - exp_port_name = [exp_port_name; other_subport(1,:)]; - - ## Add to the expanded port_bond list - exp_port_bond = [exp_port_bond; signed_bond_index; ... - -signed_bond_index]; - - ## Add the other names to the expanded list and augment the bonds, - ## components and port_bond lists. - for j=2:n_subports - ## Add a new name (for each end) to give a non-vector list - exp_port_name = [exp_port_name; subport(j,:)]; - exp_port_name = [exp_port_name; other_subport(j,:)]; - - ## Add one more bond to the list - bonds = [bonds; bonds(bond_index,:)]; - n_bonds = n_bonds + 1; - - ## Add bond to the expanded port_bond list (ports at both ends) - exp_port_bond = [exp_port_bond; sig*n_bonds; -sig*n_bonds]; - - - ## Add the new bond to the component at both ends (taking note - ## of the direction). - arrow_index = comp_near_bond(bond_index,1); - components = add_bond(components, n_bonds, arrow_index); - other_index = comp_near_bond(bond_index,2); - components = add_bond(components, -n_bonds, other_index); - endfor - - endif - - endif - - endfor - - - - ##Replace old list by new - port_name = exp_port_name - port_bond = exp_port_bond - - ## Resize the lists - [n_ports,junk] = size(port_name); - - port_name, components - ## Produce a list of bonds on each component (within this component) - ## - sorted if explicit port numbers - for i = 1:n_components - disp('-----------------'); - ##Get component type - eval(['[comp_type, comp_name] = ', name, '_cmp(i)']); - - - ##Convert junction names - if comp_type(1)=='0' # Zero junction - comp_type = 'zero'; - isa_junction = 1; - elseif comp_type(1)=='1' # One junction - comp_type = 'one'; - isa_junction = 1; - else - isa_junction = 0; - endif - - ## Find the (unsorted) bond list on this component - signed_bond_list = nozeros(components(i,:)); - n_comp_bonds = length(signed_bond_list); - direction = sign(signed_bond_list); - - ##Find the port list for this component - if exist([comp_type, '_cause'])==0 - eval(["ABG = ",comp_type, "_abg;"]); - if isfield (ABG, "portlist") - port_list = ABG.portlist; - else - error(sprintf("Component %s has no ports", comp_type)); - port_list = []; - endif - else - port_list=comp_ports(comp_type,n_comp_bonds) - endif - - - [n_comp_ports,m_comp_ports] = size(port_list); - subport_list=""; - for p=1:n_comp_ports # Expand any vector ports - [subport,n_sub] = split_port(port_list(p,:), ','); # Find the components - # of the vector port - if n_sub>1 - mtt_info(sprintf("Expanding vector port %s of component type %s", ... - port_list(p,:), comp_type, infofile)); - endif - - subport_list = [subport_list; subport]; - endfor - - port_list = subport_list; # Set the expanded port list. - - - ## Check that number of bonds on the component is the same as the number of - ## ports - [n_comp_ports,m_comp_ports] = size(port_list); - if (n_comp_ports~=n_comp_bonds) & ... - ~(strcmp(comp_type,'zero')|strcmp(comp_type,'one')) - message=sprintf('Component %s (%s) has %1.0f impinging bonds but has %1.0f ports', ... - comp_name,comp_type,n_comp_bonds,n_comp_ports); - mtt_error(message, errorfile); - endif - - - unsorted_port_list=""; - if n_ports>0 ## then there are some named ports - ## so find those associated with the bonds on this component. - k=0; - for j = 1:n_comp_bonds - b = signed_bond_list(j); - ## Find the port label on component end of bond (if any) - [port_index,m] = getindex(port_bond,b); - if m==1 - k=k+1; - unsorted_port_list(k,:) = port_name(port_index,:); - endif - - endfor - - else - k=0; - endif - - %Compute the number of labeled ports - [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list); - if m_unsorted_ports==0 - n_unsorted_ports = 0; - endif - - ## Junctions (order of ports unimportant) - if strcmp(comp_type,'zero')|strcmp(comp_type,'one') - for j = 1:n_comp_bonds - components(i,j) = signed_bond_list(j); - endfor - - else ##Order of ports is important - unsorted_port_list, port_list - if n_unsorted_ports==0 - mtt_error(['Component ', comp_name, ' (', comp_type, ') has no labeled ports'], errorfile); - endif - - ##Write out the signed bond list in the correct order - unsorted_port_list - [n_list,m_list] = size(unsorted_port_list); - if n_list!=n_comp_bonds - error(sprintf("Component %s (%s) has %i bonds but %i port labels", ... - comp_name, comp_type, n_comp_bonds, n_list)) - endif - - for j = 1:n_comp_bonds - j - name_k = unsorted_port_list(j,:) - k = name_in_list(name_k, port_list); - ## Check that it only appears once in port list - if length(k)>1 - mtt_error(['Component ', comp_name, ' (', comp_type, ') has ports with the same name: ', name_k], errorfile); - endif - - - ##Check that it only appears one in the label list - kk = name_in_list(name_k,unsorted_port_list); - if length(kk)>1 - mtt_error(['Component ', comp_name, ' (', comp_type, ') has multiple port labels: ', name_k], errorfile); - endif - - - if k==0 - mtt_error(['Component ', comp_name, ' (', comp_type, ') has an unrecognised port: ', name_k], errorfile); - else - components(i,k) = signed_bond_list(j); - endif - endfor - endif - endfor - -endfunction DELETED mttroot/mtt/bin/trans/m/rbg2ibg.m Index: mttroot/mtt/bin/trans/m/rbg2ibg.m ================================================================== --- mttroot/mtt/bin/trans/m/rbg2ibg.m +++ mttroot/mtt/bin/trans/m/rbg2ibg.m @@ -1,183 +0,0 @@ -## -*-octave-*- - -function [bonds] = ... - rbg2ibg(name,rbonds,rstrokes,rcomponents,port_coord,port_name, ... - infofile, errorfile) - - rbonds - rstrokes - rcomponents - port_coord - port_name - - ## Default to no components - components = [0]; - - ## Xfig scaling factor - scale = 1200.0/2.54546; - - ## Rotation matrix - rot = [0, -1; 1, 0]; - - ## Find number of strokes - [n_strokes,columns] = size(rstrokes); - if ((columns ~= 4) & (n_strokes > 0)) - error('Incorrect rstrokes matrix: must have 4 columns'); - endif - - ## Find number of bonds - [n_bonds,columns] = size(rbonds); - if ((columns ~= 6) & (n_bonds > 0)) - error('Incorrect rbonds matrix: must have 6 columns'); - endif - - ## Find number of components - [n_components,columns] = size(rcomponents); - - ## Find number of ports referred to - [n_ports,columns] = size(port_coord); - - ## If port_name empty, make it empty string - if (length(port_name) == 0) - port_name=""; - endif - - ## Determine coordinates of arrow end of bond and other end - other_end_1 = rbonds(:,1:2); - arrow_end = rbonds(:,3:4); - other_end_2 = rbonds(:,5:6); - - distance_1 = length2d(other_end_1 - arrow_end); - distance_2 = length2d(other_end_2 - arrow_end); - which_end = (distance_1 > distance_2) * [1, 1]; - one = ones(size(which_end)); - other_end = which_end .* other_end_1 + (one - which_end) .* ... - other_end_2; - arrow_vector = (which_end .* other_end_2 + (one - which_end) .* ... - other_end_1) - arrow_end; - - ## Locate bond end nearest each port - ## col 1 of port_near_bond contains a signed bond number (+ for arrow - ## end) - ## col 2 of port_near_bond contains the corresponding port index - port_bond = []; - for i = 1:n_ports - near_bond = adjbond(port_coord(i,1:2), arrow_end, other_end); - [rows,cols] = size(near_bond); - if (rows > 1) - error(sprintf ... - ("A port is near to more than one bond at coordinates ... - %g,%g %s\n", ... - port_coord(i,1)/scale, port_coord(i,2)/scale, ... - deblank(port_name(i,:)))); - endif - - ## The (signed) bond corresponding to the ith port label - port_bond(i,1) = near_bond(1) * sign(1.5 - near_bond(2)); - endfor - port_bond - - ## Now have (signed) bond (port_bond(i)) corresponding to the ith port - ## Create inverse mapping - for i = 1:n_bonds - eval(sprintf('bond_port_head%i = "[]"', i)) - eval(sprintf('bond_port_tail%i = "[]"', i)) - endfor - for i = 1:n_ports - if (port_bond(i) > 0) - eval(sprintf('bond_port_head%i = "%s"', port_bond(i), ... - deblank(port_name(i,:)))) - else - eval(sprintf('bond_port_tail%i = "%s"', -port_bond(i), ... - deblank(port_name(i,:)))) - endif - endfor - - ## Locate the components at the ends of each bond - ## col 1 of comp_near_bond contains component nearest to the arrow end - ## col 2 of comp_near_bond contains component nearest other end - for i = 1:n_bonds - comp_near_bond(i,:) = adjcomp(arrow_end(i,:), other_end(i,:), ... - rcomponents); - endfor - comp_near_bond - - ## Deduce causality from the strokes (if any) - causality = zeros(n_bonds,2); - if (n_strokes > 0) - ## Find location of centre and ends of stroke - stroke_end_1 = [rstrokes(:,1), rstrokes(:,2)]; - stroke_end_2 = [rstrokes(:,3), rstrokes(:,4)]; - - stroke_centre = (stroke_end_1 + stroke_end_2)/2; - stroke_vector = (stroke_end_1 - stroke_end_2); - stroke_length = length2d(stroke_vector); - - for i = 1:n_strokes - stroke = [stroke_centre(i,:) - stroke_end_1(i,:) - stroke_end_2(i,:)]; - - - ## Find the nearest bond end - [index,distance] = adjbond(stroke(1,:),arrow_end,other_end); - if (distance > (2 * stroke_length(i))) - info = sprintf('Stroke at (%4.3f,%4.3f) is %4.3f away from the nearest bond\n', ... - stroke(1,1)/scale, stroke(1,2)/scale, ... - distance/scale); - endif - - ## Bond end coordinates - j = index(1,1); - which_end = (index(1,2) == 1); - bond_end = arrow_end(j,:) * which_end + other_end(j,:) * (1 - ... - which_end); - - ## Now decide which bit of the stroke is nearest - stroke_index = adjbond(bond_end, stroke, zeros(size(stroke))); - - if (stroke_index(1) == 1) # uni-causal stroke - causality(j,1:2) = (2 * which_end - 1) * [1, 1]; - else # bi-causal stroke - stroke_direction = stroke(1,:) - stroke(stroke_index(1),:); - flow_side = stroke_direction * arrow_vector(j,:)' > 0; - causality(j,1+flow_side) = 2 * which_end - 1; - endif - endfor - endif - causality - - ## Write data - for i = 1:n_bonds - [hc_type, hc_name] = eval([name, '_cmp(comp_near_bond(i,1))']); - [tc_type, tc_name] = eval([name, '_cmp(comp_near_bond(i,2))']); - ## components - eval(sprintf("bonds.bond%i.head.component\t= '%s:%s'", i, hc_type, ... - hc_name)); - eval(sprintf("bonds.bond%i.tail.component\t= '%s:%s'", i, tc_type, ... - tc_name)); - ## ports - eval(sprintf("bonds.bond%i.head.ports\t= bond_port_head%i", i, i)); - eval(sprintf("bonds.bond%i.tail.ports\t= bond_port_tail%i", i, i)); - ## causality - if (causality(i,1) == 1) - effort_causality = "head" - elseif (causality(i,1) == -1) - effort_causality = "tail" - else - effort_causality = "none" - endif - - if (causality(i,2) == 1) - flow_causality = "tail" - elseif (causality(i,2) == -1) - flow_causality = "head" - else - flow_causality = "none" - endif - - eval(sprintf("bonds.bond%i.causality.effort\t= '%s'", i, effort_causality)); - eval(sprintf("bonds.bond%i.causality.flow\t= '%s'", i, flow_causality)); - endfor - -endfunction DELETED mttroot/mtt/bin/trans/m/rc_sim.m Index: mttroot/mtt/bin/trans/m/rc_sim.m ================================================================== --- mttroot/mtt/bin/trans/m/rc_sim.m +++ mttroot/mtt/bin/trans/m/rc_sim.m @@ -1,33 +0,0 @@ -function [y,x] = rc_sim(mttx_0,mttU,mttT,MTTpar); - - ## Initialise - [MTTu] = zero_input(1); # Zero the input - - [MTTx] = mttx_0; # Read in initial state - - N = length(mttT); - Nx = length(mttx_0); - - y = zeros(1,N); - x = zeros(Nx,N); - - mttdt = mttT(2)-mttT(1); - for i = 1:N - MTTt = mttT(i); - MTTu = mttU(i); - [MTTy] = rc_cseo(MTTx,MTTu,MTTt,MTTpar); # Output - y(1,i) = MTTy; - x(:,i) = MTTx; - if 1>0 # Dont if no states - [MTTdx] = rc_cse(MTTx,MTTu,MTTt,MTTpar); # State derivative - [mttAA] = rc_smxa(MTTx,MTTu,mttdt,MTTpar); # (I-Adt) - [mttAA] = reshape(mttAA,Nx,Nx); - [mttAAx] = rc_smxax(MTTx,MTTu,mttdt,MTTpar); # (I-Adt)x - [MTTopen] = rc_switchopen(MTTx); # Open switches - [MTTx] = mtt_implicit(MTTx,MTTdx,mttAA,mttAAx,mttdt,1,MTTopen); # Implicit update - else - endif; # 1>0 - - endfor; # Integration loop - -endfunction DELETED mttroot/mtt/bin/trans/m/rcs_header.txt Index: mttroot/mtt/bin/trans/m/rcs_header.txt ================================================================== --- mttroot/mtt/bin/trans/m/rcs_header.txt +++ mttroot/mtt/bin/trans/m/rcs_header.txt @@ -1,8 +0,0 @@ - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - DELETED mttroot/mtt/bin/trans/m/replace_name.m Index: mttroot/mtt/bin/trans/m/replace_name.m ================================================================== --- mttroot/mtt/bin/trans/m/replace_name.m +++ mttroot/mtt/bin/trans/m/replace_name.m @@ -1,37 +0,0 @@ -function string_array = replace_name(string_array, new, index); -% Replaces a row of a string vector with a string of arbitary length. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/07/02 12:36:39 peterg -## Initial revision -## -############################################################### - -string_array,new,index - [N,M]=size(string_array); - L = length(new); - - if index>N - error(["String array has less than ", num2str(index), " rows"]); - end; - - if LN - T = T'; - N = M; -end; - - - -one = eye(Nx); - -Y = zeros(N,Ny); -X = zeros(N,Nx); - -dt = T(2)-T(1);% Assumes fixed interval -##expAdt = expm(A*dt); % Compute matrix exponential -##expAt = one; -i = 0; -x = (B*u0+x0); -for t = T' - i=i+1; - if Nx>0 - ##expAt = expm(A*t); - ##x = expAdt*x; - x = expm(A*t)*(B*u0+x0); - X(i,:) = x'; - if Ny>0 - y = C*x; - Y(i,:) = y'; - end; - end; -end; - - - - - - DELETED mttroot/mtt/bin/trans/m/sm2sr.m Index: mttroot/mtt/bin/trans/m/sm2sr.m ================================================================== --- mttroot/mtt/bin/trans/m/sm2sr.m +++ mttroot/mtt/bin/trans/m/sm2sr.m @@ -1,95 +0,0 @@ -function [Y,X] = sm2sr(A,B,C,D,T,u0,x0); -% sm2sr - Constrained-state matrix to step response. -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function sm2sr -% [Y,X] = sm2sr(A,B,C,D,T,u0,x0); -% A,B,C,D,E - (constrained) state matrices -% T vector of time points -% u0 input gain vector: u = u0*unit step. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 1996/12/05 10:18:52 peterg -% %% Saved (quite old) version which integrates IR to give SR -% %% -% %% Revision 1.3 1996/10/27 10:39:04 peterg -% %% Only compute matrix exponential once. -% %% -% %% Revision 1.2 1996/09/10 16:48:21 peter -% %% Changed ar counts in default settings. -% %% -% %% Revision 1.1 1996/08/19 15:34:29 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -[Ny,Nu] = size(D); -[Ny,Nx] = size(C); - -if nargin<6 - u0 = zeros(Nu,1); - u0(1) = 1; -end; - -if nargin<7 - x0 = zeros(Nx,1); -end; - -[N,M] = size(T); -if M>N - T = T'; - N = M; -end; - - - -one = eye(Nx); - -Y = zeros(N,Ny); -X = zeros(N,Nx); - -dt = T(2)-T(1);% Assumes fixed interval -expAdt = expm(A*dt); % Compute matrix exponential -i = 0; -expAt = one; - -for t = T' - i=i+1; - if Nx>0 - x = ( A\(expAt-one) )*B*u0 + expAt*x0; - expAt = expAt*expAdt; - X(i,:) = x'; - if Ny>0 - y = C*x + D*u0; - Y(i,:) = y'; - end; - elseif Ny>0 - y = D*u0; - Y(i,:) = y'; - end; -end; - -% $$$ % Compute the impulse response -% $$$ [Y,X] = sm2ir(A,B,C,D,T,u0,x0); -% $$$ -% $$$ % Assume fixed sample interval -% $$$ dT = T(2)-T(1); -% $$$ -% $$$ % Do an Euler integration on it -% $$$ Y = mtt_euler(Y,dT); -% $$$ -% $$$ if nargout>1 -% $$$ X = mtt_euler(X,dT); -% $$$ end; -% $$$ - - - DELETED mttroot/mtt/bin/trans/m/split_port.m Index: mttroot/mtt/bin/trans/m/split_port.m ================================================================== --- mttroot/mtt/bin/trans/m/split_port.m +++ mttroot/mtt/bin/trans/m/split_port.m @@ -1,45 +0,0 @@ -function [subport,n]=split_port(port_name); - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 1998/04/16 14:08:00 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - subport = ""; - raw_subport = char(strsplit(port_name, ',')); # Find the components of the vector - # port - [n,m] = size(raw_subport); # Number of ports - - for i = 1:n - s = deblank(raw_subport(i,:)); - l = length(s); - - if s(1)=="[" # Remove leading [ (if any) - l = l-1; - s = substr(s,2,l); - end - - if s(l)=="]" # Remove trailing ] (if any) - l = l-1; - s = substr(s,1,l); - end - - s = ["[",s,"]"]; # Surround by [] - - subport = [subport ;s]; # Return to the array - end; - -endfunction; - - - - - DELETED mttroot/mtt/bin/trans/m/str2ch.m Index: mttroot/mtt/bin/trans/m/str2ch.m ================================================================== --- mttroot/mtt/bin/trans/m/str2ch.m +++ mttroot/mtt/bin/trans/m/str2ch.m @@ -1,47 +0,0 @@ -function ch = str2ch(str,n) -% str2ch - pulls the nth char from a string -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function str2ch.m -% ch = str2ch(str,n) -% Copyright (c) P.J. Gawthrop, 1996. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1996/12/04 21:39:55 peterg -% %% Changed to handle null string (octave returns lenghth of 1) -% %% -% %% Revision 1.1 1996/08/30 09:54:44 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -implicit_str_to_num_ok = 1; - -astr = abs(str); -if (n>0) & (n<=length(str)) & (strcmp(str,'')==0) - ch = char(astr(n)); -else - ch = ''; -end; - - - - - - - - - - - - - - - DELETED mttroot/mtt/bin/trans/m/subs_arg.m Index: mttroot/mtt/bin/trans/m/subs_arg.m ================================================================== --- mttroot/mtt/bin/trans/m/subs_arg.m +++ mttroot/mtt/bin/trans/m/subs_arg.m @@ -1,93 +0,0 @@ -function args_out = subs_arg(args,Args, ... - default,full_name,comp_type,comp_name,fileID) -% subs_arg - substitutes arguments into args from Args -% FS defaults to `;'. -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function subs_arg.m -% args_out = subs_arg(args,Args,default,comp_type,comp_name,infofile) -% Copyright (c) P.J. Gawthrop, 1996. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.7 2001/07/03 22:59:10 gawthrop -% %% Fixed problems with argument passing for CRs -% %% -% %% Revision 1.6 1998/07/27 09:53:44 peterg -% %% No change -% %% -% %% Revision 1.5 1998/07/21 16:43:26 peterg -% %% Now writes to an explicit fileID - otherwise we may run out of IDs. -% %% -% %% Revision 1.4 1996/12/10 16:04:11 peterg -% %% Changed file handling on mtt_info. -% %% -% %% Revision 1.3 1996/12/07 18:19:39 peterg -% %% Replaces null argument by a default and tells user. -% %% -% %% Revision 1.2 1996/12/04 21:47:41 peterg -% %% Skips main loop when arg is null. -% %% -% %% Revision 1.1 1996/12/04 21:46:52 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Symbolic argument sign -S = '$'; - -args_out = ''; -if strcmp(args,'')==0 - L = length(args); - args_count = 1; - num_count=0; - while args_count <= L - ch = str2ch(args,args_count); - if ch~=S % copy character - args_out = [args_out, ch]; - args_count = args_count+1; - else % find argument number - args_count = args_count+1; - - ch = str2ch(args,args_count); - ## Modification for $p1 $a1 etc - if !((ch>='0') & (ch<='9')) # It's not numerical - so loose it - args_count = args_count+1; - ch = str2ch(args,args_count); - endif - - i=0; - while (ch>='0') & (ch<='9') - i = 10*i + abs(ch)-abs('0'); - if args_count==L - args_count = args_count+1; - break - end; - args_count = args_count+1; - ch = str2ch(args,args_count); - end; - arg_out = args2arg(Args,i); - - - % Test for empty argument -- replace by default and tell user - message = 'Argument %1.0f of component %s(%s) of system %s is undefined - \n replacing by %s'; - if strcmp(arg_out,'') - info = sprintf(message, ... - i, comp_name, comp_type, full_name, default); - arg_out = default; - else - info = sprintf("Replacing $%i \t by %s for component %s (%s) ... - within %s", i, arg_out, comp_name, comp_type, full_name); - end; - mtt_info(info,fileID); - args_out = [args_out, arg_out]; - end; - end; -end; DELETED mttroot/mtt/bin/trans/m/varname.m Index: mttroot/mtt/bin/trans/m/varname.m ================================================================== --- mttroot/mtt/bin/trans/m/varname.m +++ mttroot/mtt/bin/trans/m/varname.m @@ -1,42 +0,0 @@ -function name = varname(name,index,causality); - ## varname - Creates name of bond graph variable - ## Usage: name = varname(name,index,causality); - -## ###################################### -## ##### Model Transformation Tools ##### -## ###################################### -## -## Matlab function varname.m -## Copyright (C) 1994-2003 by Peter J. Gawthrop - - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.4 2003/03/24 09:09:52 gawthrop -# ## Reformated to octave standard -# ## Now writes variables in non-matrix form -# ## -# ## Revision 1.3 2003/03/13 14:22:34 gawthrop -# ## No negative bond numbers -# ## -# ## Revision 1.2 2000/12/27 16:06:15 peterg -# ## *** empty log message *** -# ## -# ## Revision 1.1 1996/08/27 08:08:44 peterg -# ## Initial revision -# ## -# ############################################################### - - -# # bond_name = [name,'_bond']; -# # name =sprintf('%s%1.0f_%s', bond_name, index, cause2name(causality)); - -# # bond_name = [name,'(']; -# # name =sprintf('%s(%1.0f,%1.0f)', name, abs(index), cause2num(causality)); - - name =sprintf('%s_%i_%s', name, abs(index), cause2name(causality)); - -endfunction DELETED mttroot/mtt/bin/trans/m/write_abg.m Index: mttroot/mtt/bin/trans/m/write_abg.m ================================================================== --- mttroot/mtt/bin/trans/m/write_abg.m +++ mttroot/mtt/bin/trans/m/write_abg.m @@ -1,200 +0,0 @@ -function write_abg(system_name,bonds,connections,n_vector_bonds); - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.11 2004/09/12 22:27:27 geraint -## Appended 't' to fopen mode string to open in text mode. -## -## Revision 1.10 2004/08/09 14:47:28 gawthrop -## Changed arg to args to avoid strange octave bug -## -## Revision 1.9 2001/04/15 21:15:41 geraint -## Added interface definition rep: _ICD.(txt|c|cc|m). -## -## Revision 1.8 1999/10/18 22:41:41 peterg -## Corrected vector junction expansion -## -## Revision 1.7 1999/10/18 05:16:51 peterg -## Now vectorises 0 and 1 junctions !! -## -## Revision 1.6 1998/09/02 11:35:20 peterg -## Removed port.index field -## -## Revision 1.5 1998/09/02 10:30:30 peterg -## Now writes out list of ports ans list of subsystems. -## These ordereded lists determine the order of processing of ports ans -## subsystems. -## -## Revision 1.4 1998/08/26 12:45:38 peterg -## Just prefix ports (comps can't start with numeral) -## Prefix with mttp -## -## Revision 1.3 1998/08/26 12:31:07 peterg -## numerical names prefixed by mtt -## -## Revision 1.2 1998/08/26 11:59:20 peterg -## Don't use strrep to remove[] -## -## Revision 1.1 1998/08/25 06:22:02 peterg -## Initial revision -## -############################################################### - - - fid=fopen([system_name,"_abg.m"], "wt"); - [N,M]=size(connections); - Sformat = " %s.subsystems.%s.%s = \"%s\";\n"; - PSformat = " %s.ports.%s.%s = \"%s\";\n"; - Iformat = " %s.subsystems.%s.%s = %i;\n"; - PIformat = " %s.ports.%s.%s = %i;\n"; - Cformat = " %s.subsystems.%s.connections = ["; - PCformat = " %s.ports.%s.connections = ["; - Bformat = " %s.bonds = [\n"; - - fprintf(fid,"function [%s] = %s_abg\n", system_name, system_name); - fprintf(fid,"# This function is the acausal bond graph representation of %s\n",system_name); - fprintf(fid,"# Generated by MTT on %s",ctime(time)); - fprintf(fid,"# The file is in Octave format\n"); - - fprintf(fid,"\n# Subsystems and Ports\n"); - i_port=0; SubsystemList = ""; PortList =""; - for i=1:N - eval(["[comp_type, name, cr, args, repetitions] = ", system_name, "_cmp(i);"]); - c = nozeros(connections(i,:));# Connections to this component - m = length(c); # Number of connections - - ## Vectorise junctions? - n_bonds = n_vector_bonds(i); - if strcmp(comp_type,"0")||strcmp(comp_type,"1") - n_vector = m/n_bonds; - m_vector = n_bonds; - else - n_vector = 1; - m_vector = m; - endif - - if index(name,"[")==0 # Not a port - for i_vector = 1:n_vector; - - if i_vector>1 # Extras - new_name = sprintf("%sv%i", name,i_vector); - else - new_name = name; - endif - - SubsystemList = [SubsystemList; new_name]; - fprintf(fid,"\n# Component %s\n", new_name); - fprintf(fid,Sformat,system_name,new_name,"type",comp_type); - fprintf(fid,Sformat,system_name,new_name,"cr",cr); - fprintf(fid,Sformat,system_name,new_name,"arg",args); - fprintf(fid,Iformat,system_name,new_name,"repetitions",repetitions); - fprintf(fid,Iformat,system_name,new_name,"status",-1); - - ##Connections - fprintf(fid,Cformat,system_name,new_name); - ## Each vector junction has n*m bonds - ## n - dimension of vector - ## m - number of bonds - - ## The first m bonds (in c) correspond to the first vector element - if i_vector==1 - for j=1:m_vector - fprintf(fid,"%i ", c(j) ); - endfor - ## The next block of n-1 bonds are the first bonds on vector elements 2,3 ... - ## followed by a block of n-1 bonds being the second bonds on vector elements 2,3 ... - ## etc - else - k = m_vector+i_vector-1; # index of first bond at level i_vector - for j=1:m_vector - fprintf(fid,"%i ", c(k) ); - k = k + n_vector-1; - endfor - endif - - fprintf(fid,"];\n"); - endfor - else # Its a port - name=name(2:length(name)-1); # Strip [] - ch=name(1); # First char of name - if (ch>="0")&&(ch<="9") # Its a numeral - name=["mttp",name]; # prefix by mttp - endif; - - for i_port=1:m - if m>1 # Index the port name - name_i = sprintf("%s_%i",name,i_port); - else - name_i = name; # Leave it alone - endif; - - PortList = [PortList; name_i]; # Update port list - - fprintf(fid,"\n# Port %s\n", name_i); - fprintf(fid,PSformat,system_name,name_i,"type",comp_type); - fprintf(fid,PSformat,system_name,name_i,"cr",cr); - fprintf(fid,PSformat,system_name,name_i,"arg",args); - fprintf(fid,PIformat,system_name,name_i,"repetitions",repetitions); - fprintf(fid,PIformat,system_name,name_i,"status",-1); - - fprintf(fid,PCformat,system_name,name_i); - fprintf(fid,"%i ", c(i_port)); - fprintf(fid,"];\n"); - - endfor; - endif; - endfor; - - [N,M]=size(PortList); - if N>0 # Put name in list - fprintf(fid,"\n# Ordered list of Port names\n"); - for i=1:N - fprintf(fid," %s.portlist(%i,:) = \"%s\";\n", system_name, i, PortList(i,:)); - endfor; - endif; - - [N,M]=size(SubsystemList); - if N>0 # Put name in list - fprintf(fid,"\n# Ordered list of subsystem names\n"); - for i=1:N - fprintf(fid," %s.subsystemlist(%i,:) = \"%s\";\n", system_name, i, SubsystemList(i,:)); - endfor; - endif; - - - fprintf(fid,"\n# Bonds \n"); - [N,M]=size(bonds); # Bonds - fprintf(fid,Bformat,system_name); - for i=1:N - fprintf(fid," "); - for j=1:M - fprintf(fid,"%i ", bonds(i,j)); - endfor; - fprintf(fid,"\n"); - endfor; - fprintf(fid," ];\n"); - - fprintf(fid,"\n# Aliases \n"); - fprintf(fid,"# A double underscore __ represents a comma \n"); - eval(["alias = ", system_name, "_alias;"]); - if isstruct(alias) - for [val,key] = alias - fprintf(fid,"%s.alias.%s = \"%s\";\n", system_name,key,val); - endfor - endif - - fprintf(fid,"\n# Interface Definition\n"); - eval(["icd = ",system_name, "_icd;"]); - if isstruct(icd) - for [val,key] = icd - fprintf(fid,"%s.icd.%s = \"%s\";\n",system_name,key,val); - endfor - endif - - - fclose(fid); - - DELETED mttroot/mtt/bin/trans/m/write_cbg.m Index: mttroot/mtt/bin/trans/m/write_cbg.m ================================================================== --- mttroot/mtt/bin/trans/m/write_cbg.m +++ mttroot/mtt/bin/trans/m/write_cbg.m @@ -1,87 +0,0 @@ -function write_cbg(system_name,system_type,system,Flipped) - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 2004/09/12 22:27:27 geraint -## Appended 't' to fopen mode string to open in text mode. -## -## Revision 1.4 1998/08/26 12:26:17 peterg -## Replaced if N>0 by if (N>0)&&(M>0) # Flipped ports exist -## -## Revision 1.3 1998/08/25 20:05:33 peterg -## Write flipped port info -## -## Revision 1.2 1998/08/25 06:21:19 peterg -## Just writes additional information; basic info from the abg structure. -## -## Revision 1.1 1998/08/25 05:55:10 peterg -## Initial revision -## -############################################################### - - - fid=fopen([system_name,"_cbg.m"], "wt");# Open file - - StatusFormat = " %s.%s.%s.status = %i;\n"; - Bformat = " %s.bonds = [\n"; - Iformat = " %s.%s.%s.connections(%i) = %i;\n"; - - - fprintf(fid,"function [%s] = %s_cbg\n", system_name, system_name); - fprintf(fid,"# This function is the causal bond graph representation of %s\n",system_name); - fprintf(fid,"# Generated by MTT on %s",ctime(time)); - fprintf(fid,"# The file is in Octave format\n"); - - fprintf(fid,"\n# Acausal bond graph structure\n"); - fprintf(fid," [%s] = %s_abg;\n", system_name, system_type); - - fprintf(fid,"\n# Status information\n"); -# if isfield(system,"ports") -# for [port,name]=system.ports -# fprintf(fid,StatusFormat,system_name,"ports",name,port.status); -# endfor; -# endif - if isfield(system,"subsystems") - for [subsystem,name]=system.subsystems - fprintf(fid,StatusFormat,system_name,"subsystems",name,subsystem.status); - endfor; - endif - - [N,M]=size(system.bonds); # Bonds - fprintf(fid,"\n# Causal bond information\n"); - fprintf(fid,Bformat,system_name); - for i=1:N - fprintf(fid," "); - for j=1:M - fprintf(fid,"%i ", system.bonds(i,j)); - endfor; - fprintf(fid,"\n"); - endfor; - fprintf(fid," ];\n"); - - [N,M]=size(Flipped.ports); - if (N>0)&&(M>0) # Flipped ports exist - fprintf(fid,"\n# Flipped port information\n"); - for i=1:N - name=deblank(Flipped.ports(i,:)); - eval(["con = system.ports.",name,".connections;"]); - fprintf(fid,Iformat,system_name,"ports",name,1,con); - endfor; - endif; - - [N,M]=size(Flipped.subs); - if (N>0)&&(M>0) # Flipped subs exist - for i=1:N - name=deblank(Flipped.subs(i,:)); - k=Flipped.cons(i); - eval(["con = system.subsystems.",name,".connections(",num2str(k),");"]); - fprintf(fid,Iformat,system_name,"subsystems",name,k,con); - endfor; - endif; - - fclose(fid); - - DELETED mttroot/mtt/bin/trans/m/write_ibg.m Index: mttroot/mtt/bin/trans/m/write_ibg.m ================================================================== --- mttroot/mtt/bin/trans/m/write_ibg.m +++ mttroot/mtt/bin/trans/m/write_ibg.m @@ -1,43 +0,0 @@ -## -*-octave-*- - -function write_ibg(system_name,bonds); - - fid = fopen([system_name,"_ibg.m"], "wt"); - [nbonds, junk] = size(fieldnames(bonds)); - format_hc = " %s.bonds.bond%i.head.component\t= \"%s\";\n"; - format_tc = " %s.bonds.bond%i.tail.component\t= \"%s\";\n"; - format_hp = " %s.bonds.bond%i.head.ports\t= \"%s\";\n"; - format_tp = " %s.bonds.bond%i.tail.ports\t= \"%s\";\n"; - format_ce = " %s.bonds.bond%i.causality.effort\t= \"%s\";\n"; - format_cf = " %s.bonds.bond%i.causality.flow\t= \"%s\";\n"; - - fprintf(fid, "## -*-octave-*-\n\n"); - fprintf(fid, "function [%s] = %s_ibg\n\n", system_name, system_name); - fprintf(fid, " ## Intermediate bond graph representation of %s\n", ... - system_name); - - fprintf(fid, " ## Generated by MTT on %s\n", ctime(time)); - fprintf(fid, " ## head refers to the harpoon end of a bond\n"); - fprintf(fid, " ## tail refers to the other end of a bond\n"); - fprintf(fid, " ## causality.? is the end at which ? is imposed\n\n"); - - for i=1:nbonds - fprintf(fid, "\n ## bond %i\n", i); - fprintf(fid, format_hc, system_name, i, ... - eval(sprintf("bonds.bond%i.head.component", i))); - fprintf(fid, format_tc, system_name, i, ... - eval(sprintf("bonds.bond%i.tail.component", i))); - fprintf(fid, format_hp, system_name, i, ... - eval(sprintf("bonds.bond%i.head.ports", i))); - fprintf(fid, format_tp, system_name, i, ... - eval(sprintf("bonds.bond%i.tail.ports", i))); - fprintf(fid, format_ce, system_name, i, ... - eval(sprintf("bonds.bond%i.causality.effort", i))); - fprintf(fid, format_cf, system_name, i, ... - eval(sprintf("bonds.bond%i.causality.flow", i))); - endfor; - - fprintf(fid, "\nendfunction\n"); - fclose(fid); - -endfunction; DELETED mttroot/mtt/bin/trans/m/write_matrix.m Index: mttroot/mtt/bin/trans/m/write_matrix.m ================================================================== --- mttroot/mtt/bin/trans/m/write_matrix.m +++ mttroot/mtt/bin/trans/m/write_matrix.m @@ -1,75 +0,0 @@ -function write_matrix(matrix,name,extn); - -% Writes the matrix function file - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.9 2006/09/27 13:55:08 geraint -% %% Write complex numbers in polar form instead of real and imaginary parts. -% %% -% %% Revision 1.8 2004/09/12 22:27:27 geraint -% %% Appended 't' to fopen mode string to open in text mode. -% %% -% %% Revision 1.7 2002/05/15 16:37:30 gawthrop -% %% Added third argument (file extension) -% %% -% %% Revision 1.6 2000/12/27 16:06:17 peterg -% %% *** empty log message *** -% %% -% %% Revision 1.5 1998/02/03 08:40:39 peterg -% %% Fixed a horrible bug -- changed filename -> filenum -% %% -% %% Revision 1.4 1996/08/15 11:56:11 peter -% %% Does complex matrices. -% %% -% %% Revision 1.3 1996/08/14 19:20:41 peter -% %% Fixed output naming bug. -% %% -% %% Revision 1.2 1996/08/14 08:36:52 peter -% %% Puts a tab between columns. -% %% -% %% Revision 1.1 1996/08/14 08:21:27 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -if nargin<3 - extn="m"; -endif - -filename = sprintf("%s.%s", name, extn); -filenum = fopen(filename,'wt'); - -% Write the function m-file for the causal bond graph -pc = '%'; -fprintf(filenum, 'function data = %s\n', name); -fprintf(filenum, '%s data = %s\n\n', pc, name); - -fprintf(filenum, 'data = [\n'); - -[N,M] = size(matrix); -for row = 1:N - for col = 1:M - value = matrix(row,col); - if iscomplex(value) - fprintf(filenum, '%g*e^(%g*i)', abs(value),angle(value)); - else - fprintf(filenum, '%g', value); - end - if col0 {print} ' <$1.m >$1.dat - DELETED mttroot/mtt/bin/trans/make_ode2odes Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -1,1429 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.90 2005/04/26 23:43:34 geraint -## Reset open switches after update to eliminate overshoots. -## -## Revision 1.89 2004/08/29 16:04:44 geraint -## Fixed ae for non-sorted code. -## -## Revision 1.88 2004/08/29 13:15:28 geraint -## Uses sys_sae instead of sys_ae if sorted equations are being used. -## -## Revision 1.87 2004/08/29 01:46:56 geraint -## Added rules to create ode2odes for sorted system: sesx and sesy. -## -## Revision 1.86 2004/08/29 00:19:49 geraint -## Defaults to noAlgebraicSolver. -## -## Revision 1.85 2003/06/25 12:46:06 gawthrop -## Input only changed one per print interval -## No effect if stepfactor=1 -## Fixes bug when _input.m is compiled using -stdin option -## and stepfactor>1 -## -## Revision 1.84 2003/04/17 20:57:29 geraint -## Added -sort option to allow direct generation of ode2odes.m using sese.m -## instead of ode/csex. -## -## "mtt -sort rc odeso view" works without Reduce installed!!! -## -## Revision 1.83 2002/08/07 14:27:14 geraint -## Changes to make "-i dassl" work again. -## -## Revision 1.82 2002/07/24 14:00:12 geraint -## Corrected arguments passed to mtt_write when dumping data (sigint). -## -## Revision 1.81 2002/07/11 13:00:23 geraint -## Declared more function arguments to be "const" - improves compiler optimisation. -## -## Revision 1.80 2002/05/22 09:35:49 geraint -## Added insertor variable to stop sh-mode font-lock from getting hopelessly confused by embedded C++. -## -## Revision 1.79 2002/05/20 13:42:31 gawthrop -## Uses simpar.first for first printed output -## -## Revision 1.78 2002/05/11 01:14:17 geraint -## Fix for [ 553218 ] simpar.oct and simpar.m different. -## Translation added between ColumnVector in base .cc and Octave_map in .oct. -## -## Revision 1.77 2002/05/08 16:03:32 geraint -## Added mex support for ode2odes: mtt sys ode2odes mexglx. -## This mex stuff seems to require octave2.1-headers. -## -## Revision 1.76 2002/05/08 14:14:55 geraint -## Tidied up ode2odes code - reduced interweaving of STANDALONE/OCTAVEDLD sections -## -## Revision 1.75 2002/05/07 13:48:42 geraint -## Improved clarity of code generated for -cc and -oct (except ode2odes). -## Octave DEFUN_DLDs now call (rather than replace) their .cc equivalents. -## -## Revision 1.74 2002/05/01 17:30:56 geraint -## Improved pre-processor directives to better accommodate future alternatives (matlab) -## if necessary. -## -## Revision 1.73 2002/05/01 12:24:41 geraint -## Removed unnecessary inclusion of load-save.h. -## -## Revision 1.72 2002/05/01 12:21:29 geraint -## No longer uses save_ascii_data_for_plotting function to write data -## - eliminates dependence on liboctinterp (and libncurses) for .cc. -## -## Revision 1.71 2002/04/30 23:27:00 geraint -## Replaced octave_map with columnvector in simpar.cc. Not quite as descriptive but -## standardises the interfaces somewhat and reduces the dependency on liboctinterp -## (and thus libreadline, libkpathsea, libncurses, etc). -## -## Revision 1.70 2002/04/28 18:41:27 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.69 2002/04/17 13:46:58 geraint -## #include for -oct as well as -cc. -## -## Revision 1.68 2002/04/15 10:54:31 geraint -## Statically declare outputs and initialise to zero. -## This is necessary to prevent spurious values from being output when no assignments are made (i.e. when "y(i) := 0 for all u" (Reduce:see NERO)). -## -## Revision 1.67 2002/04/09 12:04:21 geraint -## Replaced ios:: with std::ios:: for g++-3.0 compatability. -## -## Revision 1.66 2002/03/26 11:58:58 geraint -## Added cputime monitoring. -## -## Revision 1.65 2001/11/15 06:24:11 geraint -## Updated (-i dassl) residual function to use new DAEFunc (octave-2.1.35). -## YZ residual dependency on Ui still requires some work. -## -## Revision 1.64 2001/08/08 02:15:00 geraint -## Rationalisation of solver code, beginning with algebraic solvers. -## -## Revision 1.63 2001/08/07 04:39:24 geraint -## Consolidated dassl and residual functions. -## -## Revision 1.62 2001/08/01 22:14:32 geraint -## Bug fix for dassl. -## -## Revision 1.61 2001/08/01 04:06:07 geraint -## Added -i dassl for -cc and -oct. -## -## Revision 1.60 2001/07/16 22:23:00 geraint -## Fixed misleading variable name in .cc rep. -## -## Revision 1.59 2001/07/13 04:54:04 geraint -## Branch merge: numerical-algebraic-solution back to main. -## -## Revision 1.58 2001/07/13 00:51:39 geraint -## Fixed generation of odes.sg from .m and .oct simulations. -## .cc, .m and .oct simulations now all write mtt_data (lower case). -## -## Revision 1.57.2.5 2001/07/13 04:02:31 geraint -## Implemented numerical algebraic solution for _ode2odes.oct. -## -## Revision 1.57.2.4 2001/07/02 00:34:56 geraint -## gcc-3.0 compatibility. -## -## Revision 1.57.2.3 2001/06/25 23:28:29 geraint -## Generic mtt_rate and mtt_output - allows method independent calls. -## -## Revision 1.57.2.2 2001/06/05 03:20:40 geraint -## added -ae option to select algebraic equation solution method. -## -## Revision 1.57.2.1 2001/05/04 04:07:24 geraint -## Numerical solution of algebraic equations. -## sys_ae.cc written for unsolved inputs. -## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). -## -## Revision 1.57 2001/04/01 03:38:54 geraint -## Reset row to zero after write to file, ready for subsequent runs. -## Eliminates SIGSEGV in Octave when _ode2odes called multiple times. -## -## Revision 1.56 2001/03/30 15:13:58 gawthrop -## Rationalised simulation modes to each return mtt_data -## -## Revision 1.55 2001/03/27 13:21:59 geraint -## Octave version compatibility for save_ascii_data(_for_plotting). -## -## Revision 1.54 2001/03/27 01:14:27 geraint -## Improved determination of Octave version. -## -## Revision 1.53 2001/03/21 03:24:59 geraint -## Calculate inputs before outputs (.cc). -## -## Revision 1.52 2001/03/19 02:28:52 geraint -## Branch merge: merging-ode2odes-exe back to MAIN. -## -## Revision 1.51.2.7 2001/03/17 09:51:07 geraint -## Implemented Runge-Kutta IV fixed-step method (-i rk4). -## -## Revision 1.51.2.6 2001/03/16 03:56:13 geraint -## Removed psignal/siginfo.h - problematic and unnecessary. -## -## Revision 1.51.2.5 2001/03/12 23:16:37 geraint -## Minor improvements to signal handling (.exe). -## -## Revision 1.51.2.4 2001/03/12 03:59:30 geraint -## SIGINT (C-c C-c) now causes simulation data to be dumped to MTT.core. -## SIGQUIT (C-c C-\) as for SIGINT, then raises default SIGQUIT. -## SIGFPE as for SIGINT, then raises default SIGABRT. -## -## Revision 1.51.2.3 2001/03/07 04:06:55 geraint -## Irix: catch SIGFPE and write data before aborting (.exe). -## GNU/Linux: nada. -## -## Revision 1.51.2.2 2001/03/02 00:45:21 geraint -## Separated Euler and Implicit methods in .cc code and dependencies. -## -## Revision 1.51.2.1 2001/03/01 05:05:53 geraint -## Minor revisions. -## -## Revision 1.51 2001/02/19 06:33:19 geraint -## Removed operation form loop. -## -## Revision 1.50 2001/02/18 09:18:49 geraint -## Removed temporary Matrices from mtt_implicit.cc -## -## Revision 1.49 2001/02/14 06:06:34 geraint -## Removed octave_value_list wrappers from standalone.exe - speed improvements -## -## Revision 1.48 2001/02/11 07:08:59 geraint -## Static declarations of octave_value_lists: small .exe speed improvement -## -## Revision 1.47 2001/02/11 05:25:52 geraint -## Reduced number of matrix operations during .oct simulation data write -## -## Revision 1.46 2001/02/05 08:32:31 geraint -## typo -## -## Revision 1.45 2001/02/05 04:32:35 geraint -## Octave version 2.1.x compatability and #ifdef statements for standalone rep -## -## Revision 1.46 2001/01/08 06:21:59 geraint -## #ifdef STANDALONE stuff -## -## Revision 1.45 2001/01/07 01:25:49 geraint -## Compatibility with Octave 2.1.33 -## -## Revision 1.44 2000/12/05 12:11:45 peterg -## Changed function name to name() -## -## Revision 1.43 2000/12/04 10:59:40 peterg -## *** empty log message *** -## -## Revision 1.42 2000/11/10 14:19:50 peterg -## Corrected the csex and cseo functions -## -## Revision 1.41 2000/11/09 17:06:39 peterg -## Now does euler for cc -## -## Revision 1.40 2000/10/17 09:55:00 peterg -## Replaced switchopen by logic -## -## Revision 1.39 2000/10/14 08:04:40 peterg -## Changed arguments to _inout for consistency -## -## Revision 1.38 2000/10/11 09:08:08 peterg -## cse --> csex -## -## Revision 1.37 2000/08/01 12:25:06 peterg -## Now includes euler -## -## Revision 1.36 2000/05/19 17:48:16 peterg -## Argument to state -## -## Revision 1.35 2000/05/18 18:59:40 peterg -## Removed the First time stuff -## -## Revision 1.34 2000/05/16 18:56:14 peterg -## *** empty log message *** -## -## Revision 1.33 2000/05/11 19:33:18 peterg -## Uniform version for _sim.m -## -## Revision 1.32 2000/05/11 08:30:00 peterg - -## -## Revision 1.31 2000/05/10 18:33:25 peterg -## Use smxa and smxax in place of smx -## -## Revision 1.30 2000/04/18 11:24:19 peterg -## Removed _numpar. -## -## Revision 1.29 2000/04/07 19:10:57 peterg -## *** empty log message *** -## -## Revision 1.28 1999/12/08 05:56:52 peterg -## Reordered the writing of the input and output. -## Note that last value now discarded. -## -## Revision 1.27 1999/11/15 22:47:53 peterg -## Generates method-specific code. -## -## Revision 1.26 1999/10/20 01:31:43 peterg -## *** empty log message *** -## -## Revision 1.25 1999/08/29 06:55:26 peterg -## Removed [MTTu] = zero_input($Nu); # Zero the input -## to avoide the p2c bug ???? -## -## Revision 1.24 1999/08/27 06:02:16 peterg -## removed zero_input to avoid p2c bug -## -## Revision 1.23 1999/08/02 13:39:19 peterg -## Replaced zero_vector by zero_input -## -## Revision 1.22 1999/04/20 06:16:07 peterg -## Removed initialisation of AA and AAx -## Remove _switch calls -- uses _switchopen exclusively -## -## Revision 1.21 1999/04/02 06:29:25 peterg -## New implicit method - solves numerical prob with ISW -## -## Revision 1.20 1999/04/02 02:13:58 peterg -## Back to RCS -## -## Revision 1.19 1999/03/30 21:39:25 peterg -## In implicit approach, set derivatives to zero (when switch is off) -## before update. This seems to stop numerical leakage though non-return -## switches. -## -## Revision 1.18 1999/03/15 01:17:07 peterg -## Removed some spurious debugging code -## -## Revision 1.17 1999/03/15 01:09:15 peterg -## Fixed bugs when Nx=0 (no state) -## -## Revision 1.16 1999/03/06 02:28:38 peterg -## Rearranged evaluation to: state - input - output - write -## -## Revision 1.15 1999/03/06 02:19:43 peterg -## Changed args to _input -## -## Revision 1.14 1998/10/01 16:02:01 peterg -## Integration with switches handled separately fro Euler and Implicit. -## -## Revision 1.13 1998/09/30 17:41:24 peterg -## Implicit method now allows for switches via _switchA -## -## Revision 1.12 1998/08/27 08:55:18 peterg -## Mods to integration methods -## -## Revision 1.11 1998/08/25 12:28:31 peterg -## Move initila switch to after initial input -## -## Revision 1.10 1998/08/25 12:22:45 peterg -## Put _switch after update and also at initilisation -## -## Revision 1.9 1998/08/15 13:46:59 peterg -## New versions of integration routines -## -## Revision 1.8 1998/08/11 13:28:03 peterg -## Lowercase mttLAST etc -## -## Revision 1.7 1998/07/30 11:29:54 peterg -## Added implicit integration stuff -## -## Revision 1.6 1998/07/30 10:44:37 peterg -## INcluded othe integration methods. -## -## Revision 1.5 1998/07/26 11:02:20 peterg -## Put mtt or MTT in front of variable names to avoid clashes with -## globals -## -## Revision 1.4 1998/07/25 20:14:00 peterg -## update code added for flexibility and octave efficiency -## -############################################################### - - -# Bourne shell script: make_ode2odes - -# Copyright (c) P.J.Gawthrop July 1998. - -# Tell user -sys=$1 -lang=$2 -filename=${sys}_ode2odes.${lang} - -if [ -n "$3" ]; then - method=$3 -else - method=implicit -fi - -if [ -n "$4" ]; then - algebraic_solver=$4 -else - algebraic_solver="noAlgebraicSolver" -fi - -if [ -n "$5" ]; then - sorted_equations=$5 -else - sorted_equations="no" -fi - -insertor=\<\< # help emacs sh-mode handle C++ lines - -echo Creating $filename with $method integration method - -# Find system constants -Nx=`mtt_getsize $sys x` # States -Nu=`mtt_getsize $sys u` # Inputs -Ny=`mtt_getsize $sys y` # Outputs - -case "$method" in - "implicit") - ae=ae - ode=csex - odeo=cseo - algorithm="mtt_implicit(x,dx,AA,AAx,ddt,$Nx,open_switches)" - ;; - "dassl") - case "$sorted_equations" in - "make") # used by sese generated by make - ae=sae - ode=sesx - odeo=sesy - ;; - "seqn") # shouldn't be here unless mtt has changed - ae=ae - ode=sese - odeo=sese - ;; - "no" | *) - ae=ae - ode=ode - odeo=odeo - ;; - esac - algorithm="mtt_dassl(x,u,t,par,dx,ddt,MTTNX,MTTNYZ,open_switches)" - ;; - "sorted_euler") # used by sese generated from seqn - algorithm="mtt_euler(x,dx,ddt,$Nx,open_switches)" - ;; - "euler" | "rk4" | *) - case "$sorted_equations" in - "make") # used by sese generated by make - ae=sae - ode=sesx - odeo=sesy - ;; - "seqn") # shouldn't be here unless mtt has changed - ae=ae - ode=sese - odeo=sese - ;; - "no" | *) - ae=ae - ode=ode - odeo=odeo - ;; - esac - algorithm="mtt_euler(x,dx,ddt,$Nx,open_switches)" - ;; -esac - -make_m() -{ -#lang_header $1 ode2odes m 'x,par,simpar' '[Y,X,t]' > $filename -mtt_header ${sys} ode2odes m > $filename -cat <> $filename -global MTT_data - - if nargin<3 - simpar = ${sys}_simpar(); - [simpar.dt] = mtt_simpar_update; - endif - if nargin<2 - par = ${sys}_numpar(); - [par] = mtt_numpar_update(par); - endif - if nargin<1 - [x0] = ${sys}_state(par); - [x0] = mtt_state_update(x); - endif - - ## Initialise - t = 0.0; - ddt = simpar.dt/simpar.stepfactor; - ilast = round(simpar.last/ddt)+1; # Total number of steps - x = x0; - -## Following removed due to p2c bug -## [u] = zero_input($Nu); # Zero the input - for MTTi=1:$Ny - y(MTTi) = 0; - endfor; - - mttj = 0; - for it = 1:ilast #Integration loop -EOF - -cat <> $filename - if mttj==0 - [u] = ${sys}_input(x,y,t,par); # Input -EOF - -if [ "$method" = "sorted_euler" ]; then -cat <> $filename - [dx,y] = ${sys}_sese(x,u,t,par); # Output -EOF -else -cat <> $filename - [y] = ${sys}_$odeo(x,u,t,par); # Output -EOF -fi - -cat <> $filename - mtt_write(t,x,y,$Nx,$Ny,simpar.first); # Write it out - endif -EOF - -if [ "$method" = "rk4" ]; then -cat << EOF >> $filename - [k1] = ddt * ${sys}_${ode}(x,u,t,par); - [k2] = ddt * ${sys}_${ode}(x+k1/2,u,t+ddt/2,par); - [k3] = ddt * ${sys}_${ode}(x+k2/2,u,t+ddt/2,par); - [k4] = ddt * ${sys}_${ode}(x+k3,u,t+ddt,par); - [dx] = [k1 + 2.0 * [k2 + k3] + k4] / (6.0 * ddt); -EOF -elif [ "$method" = "sorted_euler" ]; then -cat <> $filename - [dx,y] = ${sys}_sese(x,u,t,par); # State derivative and Output -EOF -else -cat << EOF >> $filename - [dx] = ${sys}_$ode(x,u,t,par); # State derivative -EOF -fi - -if [ "$method" = "implicit" ]; then -cat<< EOF >> $filename - - [AA] = ${sys}_smxa(x,u,ddt,par); # (I-Adt) and (I-Adt)x - [AAx] = ${sys}_smxax(x,u,ddt,par); # (I-Adt) and (I-Adt)x - -EOF -fi - -cat <> $filename - [open_switches] = ${sys}_logic(x,u,t,par); # Switch logic - [x] = $algorithm; # Integration update - [open_switches] = ${sys}_logic(x,u,t,par); # Switch logic - [x] = mtt_zeroswitches(x,$Nx,open_switches); - t = t + ddt; # Time update - mttj = mttj+1; # Increment counter - if mttj==simpar.stepfactor - mttj = 0; # Reset counter - endif - - endfor; # Integration loop - -## Create the output data - mtt_data = MTT_data; -endfunction - -EOF -} # make_m - -make_cc() -{ -# get octave version -case `$MATRIX --version | gawk -F\. '{print $2}'` in - 0) # stable - vector_value=vector_value - feval_header=toplev.h - ;; - 1) # development - vector_value=column_vector_value - feval_header=parse.h - ;; - *) - vector_value=column_vector_value - feval_header=parse.h - ;; -esac - -cat < $filename - -// Code generation directives -#define STANDALONE 0 -#define OCTAVEDLD 1 -#define MATLABMEX 2 -#define RTXI 3 -#if (! defined (CODEGENTARGET)) -#define CODEGENTARGET STANDALONE -#endif // (! defined (CODEGENTARGET)) - -#include -#include -#include - -#if (CODEGENTARGET == OCTAVEDLD) -#include -#endif // (CODEGENTARGET == OCTAVEDLD) - -#include "${sys}_def.h" -#include "${sys}_sympar.h" - -#include "mtt_${algebraic_solver}.hh" - -#include -#if (CODEGENTARGET != OCTAVEDLD) - -extern ColumnVector ${sys}_${ae} ( - const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - -extern ColumnVector ${sys}_input ( - const ColumnVector &x, - const ColumnVector &y, - const double &t, - const ColumnVector &par); - -extern ColumnVector ${sys}_logic ( - const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - -extern ColumnVector ${sys}_numpar ( - void); - -extern ColumnVector ${sys}_simpar ( - void); - -extern ColumnVector ${sys}_state ( - const ColumnVector &par); - -extern ColumnVector ${sys}_${ode} ( - const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - -extern ColumnVector ${sys}_${odeo} ( - const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - -EOF -case "$method" in - "implicit") - cat <> $filename -extern ColumnVector Fmtt_implicit ( - ColumnVector &x, - ColumnVector &dx, - Matrix &AA, - ColumnVector &AAx, - const double &ddt, - const int &nx, - const ColumnVector &open_switches); - -extern Matrix ${sys}_smxa ( - const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - -extern ColumnVector ${sys}_smxax ( - const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - -EOF - ;; - "dassl") - cat <> $filename -extern ColumnVector Fmtt_dassl ( - ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par, - const ColumnVector &dx, - const double &ddt, - const int nx, - const int nyz, - const ColumnVector &open_switches); - -EOF - ;; - "euler" | "rk4" | *) - cat <> $filename -extern ColumnVector Fmtt_euler ( - ColumnVector &x, - const ColumnVector &dx, - const double &ddt, - const int &nx, - const ColumnVector &open_switches); - -EOF - ;; -esac -cat <> $filename - -#endif // (CODEGENTARGET != OCTAVEDLD) - -ColumnVector -mtt_ae (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_${ae}(x,u,t,par); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (u); - args (2) = octave_value (t); - args (3) = octave_value (par); - f = feval ("${sys}_${ae}", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline ColumnVector -mtt_input (const ColumnVector &x, - const ColumnVector &y, - const double &t, - const ColumnVector &par) -{ - static MTT::${algebraic_solver} ae(MTTNPAR,MTTNU,MTTNX,MTTNY,MTTNYZ); - static ColumnVector u (MTTNU); - -#if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) - u = ${sys}_input (x, y, t, par); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (y); - args (2) = octave_value (t); - args (3) = octave_value (par); - f = feval ("${sys}_input", args, 1); - u = f(0).${vector_value} (); -#endif // ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) - if (MTTNYZ == 0) - { - return u; - } - else - { - return ae.solve(x,u,t,par); - } -} - -inline ColumnVector -mtt_logic (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_logic (x, u, t, par); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (u); - args (2) = octave_value (t); - args (3) = octave_value (par); - f = feval ("${sys}_logic", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline ColumnVector -mtt_numpar (void) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_numpar (); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - f = feval ("${sys}_numpar", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline ColumnVector -mtt_simpar (void) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_simpar (); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - f = feval ("${sys}_simpar", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline ColumnVector -mtt_state (const ColumnVector &par) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_state (par); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (par); - f = feval ("${sys}_state", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline ColumnVector -mtt_rate (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_${ode} (x, u, t, par); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (u); - args (2) = octave_value (t); - args (3) = octave_value (par); - f = feval ("${sys}_${ode}", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline ColumnVector -mtt_output (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_${odeo} (x, u, t, par); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (u); - args (2) = octave_value (t); - args (3) = octave_value (par); - f = feval ("${sys}_${odeo}", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline ColumnVector -mtt_zeroswitches (ColumnVector &x, - const int Nx, - const ColumnVector &openx) -{ - for (register int i = 0; i < Nx; i++) { - if (0 != openx (i)) { - x(i) = 0.0; - } - } - return x; -} - - -EOF -case "$method" in - "implicit") - cat <> $filename -inline ColumnVector -mtt_implicit (ColumnVector &x, - ColumnVector &dx, - Matrix &AA, - ColumnVector &AAx, - const double &ddt, - const int &nx, - const ColumnVector &open_switches) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return Fmtt_implicit (x, dx, AA, AAx, ddt, nx, open_switches); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (dx); - args (2) = octave_value (AA); - args (3) = octave_value (AAx); - args (4) = octave_value (ddt); - args (5) = octave_value ((double)nx); - args (6) = octave_value (open_switches); - f = feval ("mtt_implicit", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline Matrix -mtt_smxa (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_smxa (x, u, t, par); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (u); - args (2) = octave_value (t); - args (3) = octave_value (par); - f = feval ("${sys}_smxa", args, 1); - return f(0).matrix_value (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -inline ColumnVector -mtt_smxax (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return ${sys}_smxax (x, u, t, par); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (u); - args (2) = octave_value (t); - args (3) = octave_value (par); - f = feval ("${sys}_smxax", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -EOF - ;; - "dassl") -cat <> $filename -inline ColumnVector -mtt_dassl (ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par, - const ColumnVector &dx, - const double &ddt, - const int &nx, - const int &nyz, - const ColumnVector &open_switches) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return Fmtt_dassl (x, u, t, par, dx, ddt, nx, nyz, open_switches); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (u); - args (2) = octave_value (t); - args (3) = octave_value (par); - args (4) = octave_value (dx); - args (5) = octave_value (ddt); - args (6) = octave_value (static_cast (nx)); - args (7) = octave_value (static_cast (nyz)); - args (8) = octave_value (open_switches); - f = feval ("mtt_dassl", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -#if (CODEGENTARGET != OCTAVEDLD) -ColumnVector -Fmtt_residual (const ColumnVector &X, - const ColumnVector &DX, - double t, - int &ires) -{ -#elif (CODEGENTARGET == OCTAVEDLD) -DEFUN_DLD (mtt_residual, args, , "mtt_residual") -{ - static ColumnVector X (MTTNX+MTTNYZ); - static ColumnVector DX (MTTNX+MTTNYZ); - static double t; - static int ires; - - X = args(0).${vector_value} (); - DX = args(1).${vector_value} (); - t = args(2).double_value (); - ires = static_cast(args(3).double_value ()); -#endif // (CODEGENTARGET != OCTAVEDLD) - - static ColumnVector residual (MTTNX+MTTNYZ); - static ColumnVector U (MTTNU+MTTNYZ); - static ColumnVector u (MTTNU); - static ColumnVector y (MTTNY,0.0); - static ColumnVector par (MTTNPAR); - static ColumnVector dx(MTTNX); - static ColumnVector yz(MTTNYZ); - - static ColumnVector x (MTTNX); - static ColumnVector ui (MTTNYZ); - - static octave_value_list new_args; - - x = X.extract (0,MTTNX-1); - if (MTTNYZ > 0) - ui = X.extract (MTTNX,MTTNX+MTTNYZ-1); - -#if (CODEGENTARGET != OCTAVEDLD) - par = ${sys}_numpar(); - u = ${sys}_input(x,y,t,par); -#elif (CODEGENTARGET == OCTAVEDLD) - par = feval ("${sys}_numpar", new_args, 1)(0).${vector_value} (); - new_args(0) = octave_value (x); - new_args(1) = octave_value (u); - new_args(2) = octave_value (t); - new_args(3) = octave_value (par); - u = feval ("${sys}_input", new_args, 1)(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) - - U.insert (u,0); - if (MTTNYZ > 0) - U.insert (ui,MTTNU); - -#if (CODEGENTARGET != OCTAVEDLD) - dx = ${sys}_${ode} (x,U,t,par); - yz = ${sys}_${ae} (x,U,t,par); -#elif (CODEGENTARGET == OCTAVEDLD) - new_args(1) = octave_value (U); - dx = feval ("${sys}_${ode}", new_args, 1)(0).${vector_value} (); - yz = feval ("${sys}_${ae}", new_args, 1)(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) - - for (register int i = 0; i < MTTNX; i++) - residual (i) = dx(i) - DX(i); - - if (MTTNYZ > 0) - { - residual.insert (yz,MTTNX); - - // XXX: - // DASSL needs residual to be dependent on Ui and Uidot - // mtt_dassl always sets the initial Ui to zero, so - // Ui - h*Uidot should equal zero BUT, we don't know h - static double t_old; - double step; - if (t != t_old) - { - step = t - t_old; - t = t_old; - } - else - step = t; - for (register int i = MTTNX; i < MTTNX+MTTNYZ; i++) - residual(i) += X(i) - DX(i)*step; - } - -#if (CODEGENTARGET != OCTAVEDLD) - return residual; -#elif (CODEGENTARGET == OCTAVEDLD) - return octave_value (residual); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -EOF - ;; - "euler" | "rk4" | *) -cat <> $filename -inline ColumnVector -mtt_euler (ColumnVector &x, - const ColumnVector &dx, - const double &ddt, - const int &nx, - const ColumnVector &open_switches) -{ -#if (CODEGENTARGET != OCTAVEDLD) - return Fmtt_euler (x, dx, ddt, nx, open_switches); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args (0) = octave_value (x); - args (1) = octave_value (dx); - args (2) = octave_value (ddt); - args (3) = octave_value ((double)nx); - args (4) = octave_value (open_switches); - f = feval ("mtt_euler", args, 1); - return f(0).${vector_value} (); -#endif // (CODEGENTARGET != OCTAVEDLD) -} - -EOF - ;; -esac -cat <> $filename - -inline void -mtt_write (const double &t, - const ColumnVector &x, - const ColumnVector &y, - const double &first, - const int &nrows, - const bool dump_data = false, - std::ostream &file = std::cout) -{ - static Matrix data; - static int row; - - if (dump_data) - { - if (row > 0) - { - Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1); - file $insertor "# name: mtt_dump" $insertor std::endl - $insertor "# type: matrix" $insertor std::endl - $insertor "# rows: " $insertor written_data.rows () $insertor std::endl - $insertor "# columns: " $insertor written_data.columns () $insertor std::endl - $insertor written_data; - file.flush (); - } - return; - } - - const int nx = x.length (), ny = y.length (); - register int col = 0; - - if (0 == row) - data = Matrix (nrows, 1+ny+1+nx, 0.0); - - if (t >= first) { - data.elem (row, col) = t; - for (register int i = 0; i < ny; i++) - data.elem (row, ++col) = y.elem (i); - data.elem (row, ++col) = t; - for (register int i = 0; i < nx; i++) - data.elem (row, ++col) = x.elem (i); - - row++; - }; - - static std::fstream fcputime ("MTT.cputime", std::ios::out | std::ios::trunc | std::ios::app); - static clock_t cputime0 = clock(); - static clock_t cputime1 = cputime0; - clock_t cputime = clock(); - fcputime $insertor t $insertor '\t' - $insertor static_cast (cputime - cputime0) / CLOCKS_PER_SEC $insertor '\t' - $insertor static_cast (cputime - cputime1) / CLOCKS_PER_SEC $insertor std::endl; - cputime1 = cputime; - - if (nrows == row) - { -#if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == RTXI)) - file $insertor "# name: mtt_dump" $insertor std::endl - $insertor "# type: matrix" $insertor std::endl - $insertor "# rows: " $insertor data.rows () $insertor std::endl - $insertor "# columns: " $insertor data.columns () $insertor std::endl - $insertor data; - file.flush (); -#elif ((CODEGENTARGET == OCTAVEDLD) || (CODEGENTARGET == MATLABMEX)) - set_global_value ("MTT_data", data); -#endif // ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == RTXI)) - row = 0; - fcputime.close(); - } -} - -#if (CODEGENTARGET == RTXI) -#include "${sys}_rtxi.h" -void -${sys}::execute(void) -{ - static ColumnVector simpar (8), par (MTTNPAR), state0 (MTTNX); - - simpar = mtt_simpar (); - par = mtt_numpar (); - state0 = mtt_state (par); - -#else - -void -${sys}_ode2odes (const ColumnVector &state0, - const ColumnVector &par, - const ColumnVector &simpar) -{ -#endif // (CODEGENTARGET == RTXI) - static double first, dt, last, stepfactor; - first = simpar (0); - last = simpar (1); - dt = simpar (2); - stepfactor = simpar (3); - - static ColumnVector dx (MTTNX, 0.0); - static ColumnVector x (MTTNX, 0.0); - static ColumnVector u (MTTNU, 0.0); - static ColumnVector y (MTTNY, 0.0); - - static Matrix AA (MTTNX, MTTNX, 0.0); - static ColumnVector AAx (MTTNX, 0.0); - - static ColumnVector open_switches (MTTNX, 0.0); - - register double t = 0.0; - - const double ddt = dt / stepfactor; - const int ilast = static_cast (round ( last / ddt)) + 1; - const int nrows = static_cast (round ((last - first) / dt)) + 1; - - for (register int i = 0; i < MTTNY; i++) - { - y (i) = 0.0; -#if (CODEGENTARGET == RTXI) - output(i) = y(i); -#endif // (CODEGENTARGET == RTXI) - } - - for (register int i = 0; i < MTTNX; i++) - { - x (i) = state0 (i); - } - - for (register int j = 0, i = 1; i <= ilast; i++) - { -#if (CODEGENTARGET != RTXI) - u = mtt_input (x, y, t, par); -#else - for (register int i = 0; i < MTTNU; i++) { - u(i) = input(i); - } -#endif // (CODEGENTARGET != RTXI) - y = mtt_output (x, u, t, par); - if (0 == j) - { -#if (CODEGENTARGET != RTXI) - mtt_write (t, x, y, first, nrows); -#else - for (register int i = 0; i < MTTNU; i++) { - output(i) = y(i); - } -#endif // (CODEGENTARGET != RTXI) - } -EOF -case "$method" in - "rk4") - cat << EOF >> $filename - { - static ColumnVector - k1 (MTTNX,0.0), - k2 (MTTNX,0.0), - k3 (MTTNX,0.0), - k4 (MTTNX,0.0); - - const double - t1 = t + ddt/2.0, - t2 = t + ddt; - - ColumnVector - x1 (x), - x2 (x), - x3 (x); - - k1 = ddt * mtt_rate (x , u, t , par); x1 += k1 * 0.5; - k2 = ddt * mtt_rate (x1, u, t1, par); x2 += k2 * 0.5; - k3 = ddt * mtt_rate (x2, u, t1, par); x3 += k3; - k4 = ddt * mtt_rate (x3, u, t2, par); - dx = (k1 + 2.0 * (k2 + k3) + k4) / (6.0 * ddt); - } -EOF - ;; - "dassl") - ;; - "implicit") - cat << EOF >> $filename - dx = mtt_rate (x, u, t, par); - AA = mtt_smxa (x, u, ddt, par); - AAx = mtt_smxax (x, u, ddt, par); -EOF - ;; - "euler" | *) - cat << EOF >> $filename - dx = mtt_rate (x, u, t, par); -EOF - ;; -esac - -## Common stuff -cat <> $filename - open_switches = mtt_logic (x, u, t, par); - x = $algorithm; - open_switches = mtt_logic (x, u, t, par); - x = mtt_zeroswitches (x, $Nx, open_switches); - t += ddt; - j++; - j = (j == static_cast (stepfactor)) ? 0 : j; - } - -} - -#if (CODEGENTARGET == STANDALONE) -#include - -void set_signal_handlers (void); - -void dump_data (std::ostream &file) -{ - ColumnVector null (0); - mtt_write (0.0, null, null, 0, 0, true, file); -} - -void handle_signal (int signum) -{ - // handle some signals to ensure data is written. - std::cerr $insertor "# Writing data to MTT.core (signal " $insertor signum $insertor ")" $insertor std::endl; - std::ofstream corefile ("MTT.core"); - dump_data (corefile); - switch (signum) - { - case SIGFPE: - // Intel chips do not raise SIGFPE for DIVZERO :-( - // raise (SIGABRT); - break; - case SIGINT: - break; - case SIGQUIT: - signal (SIGQUIT, SIG_DFL); - raise (SIGQUIT); - break; - default: - std::cerr $insertor "# Warning: make_ode2odes needs updating!" $insertor std::endl; - signal (signum, SIG_DFL); - raise (signum); - break; - } - corefile.close (); - set_signal_handlers (); -} - -void set_signal_handlers (void) -{ - signal (SIGFPE, handle_signal); - signal (SIGINT, handle_signal); - signal (SIGQUIT, handle_signal); -} - -int -main (void) -{ - set_signal_handlers (); - - static ColumnVector simpar (8), numpar (MTTNPAR), state0 (MTTNX); - - simpar = mtt_simpar (); - numpar = mtt_numpar (); - state0 = mtt_state (numpar); - - ${sys}_ode2odes (state0, numpar, simpar); - - return 0; -} -#elif (CODEGENTARGET == OCTAVEDLD) -#include - -DEFUN_DLD (${sys}_ode2odes, args, , -"Octave ode2odes representation of system with $method integration method\nUsage: mtt_data = ${sys}_ode2odes (state0, numpar, simpar)\n") -{ - static octave_value_list retval; - - static ColumnVector state0 (MTTNX); - static ColumnVector numpar (MTTNPAR); - static ColumnVector simpar (8); - - int nargin = args.length (); - switch (nargin) - { - case 3: - simpar = mtt_simpar (args(2).map_value ()); - numpar = args(1).${vector_value} (); - state0 = args(0).${vector_value} (); - break; - case 2: - simpar = mtt_simpar (); - numpar = args(1).${vector_value} (); - state0 = args(0).${vector_value} (); - break; - case 1: - simpar = mtt_simpar (); - numpar = mtt_numpar (); - state0 = args(0).${vector_value} (); - break; - case 0: - simpar = mtt_simpar (); - numpar = mtt_numpar (); - state0 = mtt_state (numpar); - break; - default: - usage("${sys}_ode2odes (x par simpar)", nargin); - error("aborting."); - } - - ${sys}_ode2odes (state0, numpar, simpar); - - retval = octave_value (get_global_value ("MTT_data")); - return (retval); -} -#elif (CODEGENTARGET == MATLABMEX) -#include - -extern "C" { - void - mexFunction (int nlhs, mxArray *plhs[], - int nrhs, const mxArray *prhs[]) - { - static ColumnVector state0 (MTTNX); - static ColumnVector numpar (MTTNPAR); - static ColumnVector simpar (8); - - initialize_symbol_tables (); - - switch (nrhs) - { - case 3: - simpar = mtt_ColumnVector (prhs[2]); - numpar = mtt_ColumnVector (prhs[1]); - state0 = mtt_ColumnVector (prhs[0]); - break; - case 2: - simpar = mtt_simpar (); - numpar = mtt_ColumnVector (prhs[1]); - state0 = mtt_ColumnVector (prhs[0]); - break; - case 1: - simpar = mtt_simpar (); - numpar = mtt_numpar (); - state0 = mtt_ColumnVector (prhs[0]); - break; - case 0: - simpar = mtt_simpar (); - numpar = mtt_numpar (); - state0 = mtt_state (numpar); - break; - default: - std::cerr $insertor "usage: ${sys}_ode2odes (x par simpar)" $insertor std::endl; - return; - } - - ${sys}_ode2odes (state0, numpar, simpar); - - plhs[0] = mtt_mxArray (get_global_value ("MTT_data").matrix_value ()); - } -} - -#endif // (CODEGENTARGET == STANDALONE) - -EOF -} - -case ${lang} in - m) - make_m - ;; - cc) - make_cc - ;; - *) - echo Language ${lang} is not supported -esac DELETED mttroot/mtt/bin/trans/make_sim Index: mttroot/mtt/bin/trans/make_sim ================================================================== --- mttroot/mtt/bin/trans/make_sim +++ mttroot/mtt/bin/trans/make_sim @@ -1,48 +0,0 @@ -#!/bin/sh - -## Makes the sensitivity simulation -## Copyright (C) 2001 by Peter J. Gawthrop - -sys=$1 -lang=$2 - -outfile=${sys}_sim.${lang} - -echo Creating $outfile - -make_m() { -mtt_header ${sys} sim m > ${outfile} -cat >> ${outfile} <2 - ## Create time vector - [N,M] = size(y); - t = mtt_data(:,1); - endif; - -endfunction -EOF - -} - -case ${lang} in - m) - make_m - ;; - *) - echo Language ${lang} not supported - sorry -esac DELETED mttroot/mtt/bin/trans/make_ssim Index: mttroot/mtt/bin/trans/make_ssim ================================================================== --- mttroot/mtt/bin/trans/make_ssim +++ mttroot/mtt/bin/trans/make_ssim @@ -1,68 +0,0 @@ -#!/bin/sh - -## Makes the sensitivity simulation -## Copyright (C) 2001 by Peter J. Gawthrop - -sys=$1 -lang=$2 - -outfile=${sys}_ssim.${lang} - -echo Creating $outfile -make_m() { -mtt_header ${sys} ssim m > ${outfile} -cat >> ${outfile} <4 - [n,m] = size(index); - if (n>m) # Make sure its a row vector - index = index'; - endif - endif - - [nx2,ny2] = ${sys}_def; - y_par = []; - MTT_input = u; - [MTT_input_last,m] = size(u); - - if nargin<5 # No index given - MTT_input_index = 0; - [mtt_data] = ${sys}_ode2odes(x0,par,simpar); - y = mtt_data(:,2:2:1+ny2); - x = mtt_data(:,3+ny2:2:2+ny2+nx2); - ypar = []; - else # Compute sensitivities as well - for i=index - MTT_input_index = 0; - p = par; # Reset parameters - p(i) = 1; # Set sensitivity index to 1 - [mtt_data] = ${sys}_ode2odes(x0,p,simpar); - if (i==index(1)) - y = mtt_data(:,2:2:1+ny2); - endif - y_par = [y_par, mtt_data(:,3:2:2+ny2)]; - x = mtt_data(:,3+ny2:2+ny2+nx2); - endfor - endif - - if nargout>3 - ## Create time vector - [N,M] = size(y); - t = mtt_data(:,1); - endif; - -endfunction -EOF - -} - -case ${lang} in - m) - make_m - ;; - *) - echo Language ${lang} not supported - sorry -esac DELETED mttroot/mtt/bin/trans/make_stdin Index: mttroot/mtt/bin/trans/make_stdin ================================================================== --- mttroot/mtt/bin/trans/make_stdin +++ mttroot/mtt/bin/trans/make_stdin @@ -1,174 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## $Id$ - -# Copyright (C) 1999,2000 by Peter J. Gawthrop - -# Tell user -Sys=$1 -lang=$2 -date=`date` -outfile=$1_input.$2 - -Nu=`mtt_getsize ${Sys} u` # Inputs -echo "Creating $outfile for standard input" - -## Pascal code -make_p() -{ -cat < $outfile -PROCEDURE ${Sys}_input(VAR mttu : InputVector; - mttx : StateVector; - mtty : OutputVector; - mttt : REAL; - par : ParameterVector); - -{Created by MTT on $date for standard input to simulation} - -VAR t : REAL; Start:BOOLEAN; - -BEGIN{${Sys}_input} - {Zap comments} - IF (input^ = chr("#")) THEN - BEGIN - readln; - WHILE (input^ = chr("#")) DO readln; - END; - - read(t); { Read, and discard, first column (time) } - FOR mtti:=1 TO $Nu DO {Read the inputs} - read(mttu[mtti]); - readln; {Next line} - - -END{${Sys}_input}; -EOF -} - -make_m() { -mtt_header ${Sys} input m stdin > $outfile -cat >> $outfile < $outfile < -#include "${Sys}_def.h" - -void strip_comments (istream &str) -{ - char c; - c = str.peek (); - while (c == '#') - { - str.unsetf(ios::skipws); - while (c != '\n') - { - str >> c; - } - str.setf(ios::skipws); - c = str.peek (); - } -} - -ColumnVector ${Sys}_input ( - ColumnVector &mttx, - ColumnVector &mtty, - const double &mttt, - ColumnVector &mttpar -) -{ -#elif (CODEGENTARGET == OCTAVEDLD) -#include -#include -#include "${Sys}_def.h" - -DEFUN_DLD (${Sys}_input, args, , -"Usage: [mttu] = ${Sys}_input()\n\ -Octave input (-stdin) representation of system ${Sys}\n\ -Generated by MTT on `date`") -{ - - octave_value_list retval; -#endif // (CODEGENTARGET == STANDALONE) - - ColumnVector mttu (MTTNU); - - // Set up the mttu vector -#if (CODEGENTARGET == OCTAVEDLD) - int MTT_input_index = static_cast(get_global_value ("MTT_input_index").double_value ()); - int MTT_input_last = static_cast(get_global_value ("MTT_input_last").double_value ()); - Matrix MTT_input = get_global_value ("MTT_input").matrix_value(); - - mttu = MTT_input.row (MTT_input_index); - - if (MTT_input_index < (MTT_input_last - 1)) - { - set_global_value ("MTT_input_index", static_cast(++MTT_input_index)); - } - -#elif (CODEGENTARGET == STANDALONE) - double t, u; - strip_comments (cin); - cin >> t; - for (register int i = 0; i < MTTNU; i++) - { - cin >> u; - mttu(i) = u; - } -#endif // (CODEGENTARGET == OCTAVEDLD) - - -#if (CODEGENTARGET == OCTAVEDLD) - retval (0) = octave_value (mttu); - return (retval); -} -#elif (CODEGENTARGET == STANDALONE) - return mttu; -} -#endif // (CODEGENTARGET == OCTAVEDLD) -EOF -} - -case $lang in - p) - make_p - ;; - m) - make_m - ;; - cc) - make_cc - ;; - *) - echo language $lang not supported - sorry -esac DELETED mttroot/mtt/bin/trans/makecr Index: mttroot/mtt/bin/trans/makecr ================================================================== --- mttroot/mtt/bin/trans/makecr +++ mttroot/mtt/bin/trans/makecr @@ -1,46 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: makecr - -# Copyright (c) P.J.Gawthrop 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 1996/09/12 12:06:38 peter -## Removed reducndant lines. -## -## Revision 1.3 1996/09/12 12:05:01 peter -## Removed default crs. -## -## Revision 1.2 1996/09/10 16:18:37 peter -## Uses default constitutive relationship mtt/cr/r -## -## Revision 1.1 1996/08/24 14:53:06 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_cr.r - -echo % Default CR file > $1_cr.r -echo % File $1_cr.r >> $1_cr.r -echo % Generated by MTT on `date`. >> $1_cr.r -echo >> $1_cr.r -cat $MTTPATH/trans/m/rcs_header.txt >> $1_cr.r -echo 'END;' >> $1_cr.r - - - - - - - - DELETED mttroot/mtt/bin/trans/makedesc Index: mttroot/mtt/bin/trans/makedesc ================================================================== --- mttroot/mtt/bin/trans/makedesc +++ mttroot/mtt/bin/trans/makedesc @@ -1,55 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: maketex -# Makes template for (TeX) system description. - -# P.J.Gawthrop August 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 1999/03/03 01:07:27 peterg -## Label the figure correctely, -## -## Revision 1.3 1998/07/22 08:58:51 peterg -## Corrected spelling. -## -## Revision 1.2 1997/05/21 10:00:51 peterg -## Tidied up. -## -## Revision 1.1 1997/05/21 09:19:27 peterg -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_desc.tex - -echo '% -*-latex-*- Put EMACS into LaTeX-mode' > $1_desc.tex -echo "% Verbal description for system $1 ($1_desc.tex)" >> $1_desc.tex -echo "% Generated by MTT on" `date`. >> $1_desc.tex -cat $MTTPATH/trans/m/rcs_header.txt >> $1_desc.tex - -cat<> $1_desc.tex -The acausal bond graph of system \textbf{$1} is -displayed in Figure \Ref{fig:$1_abg.ps} -EOF - -if [ -e "$1_pic.fig" ]; then -cat<> $1_desc.tex -and the schematic diagram in Figure \Ref{fig:$1_pic.ps} -EOF -fi - -cat<> $1_desc.tex -. -The label file is listed in Section \Ref{sec:$1_lbl} and the -subsystems are listed in Section \Ref{sec:$1_sub}. -EOF DELETED mttroot/mtt/bin/trans/makedoc Index: mttroot/mtt/bin/trans/makedoc ================================================================== --- mttroot/mtt/bin/trans/makedoc +++ mttroot/mtt/bin/trans/makedoc @@ -1,127 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: makedoc -# Encapsulates a tex file in a document. - -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/27 15:53:42 peterg -## Initial revision -## -## Revision 1.1 1997/05/17 13:55:42 peterg -## Initial revision -## -# Revision 1.2 1997/04/23 10:06:51 peterg -# Put output in the correct file! -# -# Revision 1.1 1997/04/23 10:03:41 peterg -# Initial revision -# -############################################################### - -date=`date` -switches=$1 -system=$2 -representation=$3 -lang=$4 -args=$5 -documenttype=$6 -ps=$7 - -if [ "$documenttype" = "book" ]; then - document=book -else - document=article -fi - -if [ "$documenttype" = "book" ]||[ "$documenttype" = "article" ]; then - title="\title{Report on $system}" -else - title="\title{System $system, representation $representation}" -fi - -filename=$2_$3.doc -texname=$2_$3.tex -indexname=$2_$3.ind - -# Inform user -echo "Creating $filename" -# Make arguments acceptable to LateX -Args=`echo $args | sed 's/_/\\\_/g'` - -cat< $filename -\nonstopmode -\documentclass[12pt,a4paper]{$document} - $title - \author{Generated by MTT using :\\\\ - (mtt $switches $system $representation $lang $Args)} - \date{$date} -EOF - -if [ "$documenttype" = "book" ]; then - cat <> $filename - \makeindex -EOF -fi - - -##cp -v $MTTPATH/trans/*.sty . -##cat >> $filename <> $filename - -cat <> $filename -\begin{document} - \maketitle -EOF - -if [ "$documenttype" = "book" ]||[ "$documenttype" = "article" ]; then - cat $MTTPATH/trans/contents.tex >> $filename -fi - -cat <> $filename -%Fancy headings - \pagestyle{fancy} - \renewcommand{\sectionmark}[1]{\markboth{#1}{}} - \lhead{Report \textbf{$system}} - \rhead{Representation \textbf{$representation}} - \rfoot{Page \thepage.}\cfoot{} - \lfoot{\emph{$date}} - - \input{$texname} -EOF - -if [ "$documenttype" = "book" ]; then - cat <> $filename - \input{$indexname} -EOF -fi - -cat<> $filename -\end{document} -EOF - - - - - - - - - - - - DELETED mttroot/mtt/bin/trans/makerep_txt Index: mttroot/mtt/bin/trans/makerep_txt ================================================================== --- mttroot/mtt/bin/trans/makerep_txt +++ mttroot/mtt/bin/trans/makerep_txt @@ -1,74 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: makerep_tex -# Makes template for (TeX) system description. - -# P.J.Gawthrop July 1998 -# Copyright (c) P.J.Gawthrop, 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2000/11/15 10:56:45 peterg -## Added state tex -## -## Revision 1.5 2000/11/04 12:32:43 peterg -## Added more reps + more default reps -## -## Revision 1.4 1999/03/02 22:02:16 peterg -## Octave-mode style -## -## Revision 1.3 1998/11/18 10:47:39 peterg -## Added transfer function rep -## -## Revision 1.2 1998/11/10 09:16:41 peterg -## Added structure rep -## -## Revision 1.1 1998/07/22 09:14:42 peterg -## Initial revision -## -############################################################### - - -#Inform user -echo Creating $1_rep.txt - -cat < $1_rep.txt -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system $1 ($1_rep.txt) -## Generated by MTT on" `date`. - -EOF - -cat $MTTPATH/trans/rcs_header.sh >> $1_rep.txt - -cat <> $1_rep.txt -mtt $1 abg tex # The system description -mtt $1 cbg ps # The causal bond graph -mtt $1 struc tex # The system structure -mtt $1 sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt $1 dae tex # The system dae -## mtt $1 ode tex # The system ode -## mtt $1 sspar tex # Steady-state parameters -## mtt $1 ss tex # Steady state -## mtt $1 dm tex # Descriptor matrices (of linearised system) -## mtt $1 sm tex # State matrices (of linearised system) -## mtt $1 tf tex # Transfer function (of linearised system) -## mtt $1 lmfr ps # log modulus of frequency response (of linearised system) -## mtt $1 simpar txt # Simulation parameters -## mtt $1 numpar txt # Numerical simulation parameters -## mtt $1 state txt # Simulation initial state -## mtt $1 input txt # Simulation input -## mtt $1 logic txt # Logic control -## mtt $1 odeso ps # Simulation output - -## mtt $1 rep txt # This file -EOF - DELETED mttroot/mtt/bin/trans/makesspar Index: mttroot/mtt/bin/trans/makesspar ================================================================== --- mttroot/mtt/bin/trans/makesspar +++ mttroot/mtt/bin/trans/makesspar @@ -1,56 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: makesspar -# Makes default sspar file: all states zero. - -# P.J.Gawthrop February 1998 -# Copyright (c) P.J.Gawthrop, 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1998/02/09 14:13:39 peterg -## Put octave stuff to /dev/null -## -## Revision 1.2 1998/02/09 08:39:27 peterg -## Set inputs to zero as well. -## -## Revision 1.1 1998/02/06 15:53:49 peterg -## Initial revision -## -############################################################### - - -#Inform user -echo Creating $1_sspar.r - -echo "% Steady-state parameters for system $1 ($1_sspar.r)"> $1_sspar.r -echo "% Generated by MTT on" `date`. >> $1_sspar.r -cat $MTTPATH/trans/m/rcs_header.txt >> $1_sspar.r -echo "% Set all states and inputs to zero" >> $1_sspar.r - -$MATRIX <> /dev/null - -fnum=fopen("$1_sspar.r","at"); - -[nx,ny,nu,nz,nyz] = $1_def; - -for i = 1:nx - fprintf(fnum,"MTTX%i := 0;\n", i); -end; -fprintf(fnum,"\n"); -for i = 1:nu - fprintf(fnum,"MTTU%i := 0;\n", i); -end; - - -EOF - - -echo "END;;" >> $1_sspar.r DELETED mttroot/mtt/bin/trans/makesubs Index: mttroot/mtt/bin/trans/makesubs ================================================================== --- mttroot/mtt/bin/trans/makesubs +++ mttroot/mtt/bin/trans/makesubs @@ -1,81 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: makesubs -# Makes the default substitution file - -# Copyright (C) 2000 by Peter J. Gawthrop - - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2001/05/08 15:18:10 gawthrop -## Added trig and hyperbolic functions to argument exclusion list -## -## Revision 1.1 2000/12/28 09:09:52 peterg -## Initial revision -## -## -############################################################### - -#Inform user -echo Creating $1_subs.r - -cat > $1_subs.r <> $1_subs.r - -cat >> $1_subs.r <> $1_subs.r <> $1_subs.r - -# Then states -Nx=`mtt_getsize $1 x` # States - -gawk 'END{ - for (k=1;k> $1_subs.r - -cat >> $1_subs.r <junk -mv junk $1 - - - - DELETED mttroot/mtt/bin/trans/modpar_txt2r Index: mttroot/mtt/bin/trans/modpar_txt2r ================================================================== --- mttroot/mtt/bin/trans/modpar_txt2r +++ mttroot/mtt/bin/trans/modpar_txt2r @@ -1,47 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: modpar_txt2r -# Creates the reduce code for modulated parameters - -# Copyright (C) 2001 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $$Id$ -## $Log$ -## Revision 1.2 2002/04/16 11:36:03 gawthrop -## These were flagged with M on cvs update -## -## Revision 1.1 2001/04/02 08:19:18 gawthrop -## Translates modulated parameters into reduce -## -############################################################### - -# Inform user -echo Creating $1_modpar.r - -#Create the modpar file complete with headers. -echo "% Modpar file ($1_modpar.r)" > $1_modpar.r -echo "% Generated by MTT at `date`" >> $1_modpar.r - -parameters=`strip_comments < $1_modpar.txt | cut -f1` -inputs=`strip_comments < $1_modpar.txt | cut -f2` - - -for parameter in $parameters; do - grep $1_${parameter}_ $1_struc.txt |\ - gawk 'BEGIN{ - name["input"] = "u"; - name["output"] = "y"; - name["state"] = "x"; - name["nonstate"] = "z"; - } - { - printf("%s := mtt%s(%i,1);\n", parameter, name[$1], $2) - }' parameter=$parameter >> $1_modpar.r -done DELETED mttroot/mtt/bin/trans/mtt.sty Index: mttroot/mtt/bin/trans/mtt.sty ================================================================== --- mttroot/mtt/bin/trans/mtt.sty +++ mttroot/mtt/bin/trans/mtt.sty @@ -1,91 +0,0 @@ -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% mtt.sty -- LaTeX style file for MTT -% P.J.Gawthrop May 1997 -% Copyright (c) P.J.Gawthrop, 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.11 2009/06/26 01:09:50 geraint -% %% fancyheadings is deprecated, replaced by fancyhdr -% %% -% %% Revision 1.10 2005/03/15 13:36:17 gawthrop -% %% Pretty abg figure in reports. -% %% -% %% Revision 1.9 2003/05/08 18:43:02 gawthrop -% %% Generate pdf from ps (using hyperref package for links etc) -% %% -% %% Revision 1.8 2000/12/01 14:15:16 peterg -% %% Removed hyperref stuff to mtt_pdf.sty -% %% -% %% Revision 1.7 2000/11/28 18:28:29 peterg -% %% Removed fancy box - messes up TOC -% %% -% %% Revision 1.6 2000/11/28 18:09:06 peterg -% %% Tidied up: -% %% added hyperef -% %% put fig stuff into mtt_ps.sty and mtt_pdf.sty -% %% -% %% Revision 1.5 1998/11/23 10:45:49 peterg -% %% Reinstated supertabular -% %% -% %% Revision 1.4 1998/07/01 17:34:43 peterg -% %% No change -% %% -% %% Revision 1.3 1997/12/06 16:22:10 peterg -% %% Added another argument - the label. -% %% -% %% Revision 1.2 1997/12/06 15:51:06 peterg -% %% Cahged order of fig args to put file first. -% %% -% %% Revision 1.1 1997/05/19 16:48:10 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Font -\usepackage{times} -%%\usepackage{mathptm} - -%Verbatim file input -\usepackage{verbatim} -\usepackage{moreverb} - -%Long tables -\usepackage{supertabular} - -%AMS maths - \usepackage{amsmath} - -%Fancy headings - %%\usepackage{fancyheadings} - \usepackage{fancyhdr} - -%Fancy boxes -%\usepackage{fancybox} - - -% Read in a verbatim file -\newcommand{\txt}[2]{ - \subsubsection*{#1} - \verbatimtabinput{#2} -} - -% Read in a LaTeX file -\newcommand{\Input}[1]{ - \input{#1} -} - - -% Page refs as well. -\newcommand{\Ref}[1]{\ref{#1} (on page \pageref{#1})} - -%% Latex in figures etc -\newcommand{\B}[1]{\text{\sffamily\textbf{#1}}} -\newcommand{\BB}[2]{$\B{#1}$:$\mathbf{#2}$} DELETED mttroot/mtt/bin/trans/mtt2reps_txt Index: mttroot/mtt/bin/trans/mtt2reps_txt ================================================================== --- mttroot/mtt/bin/trans/mtt2reps_txt +++ mttroot/mtt/bin/trans/mtt2reps_txt @@ -1,85 +0,0 @@ -#! /bin/sh - -# mtt2reps_txt: Gives a tabular listing of representations and languages -# P J Gawthrop July 1998, October 1998 -# Copyright (c) P.J.Gawthrop, 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.12 2001/07/24 04:18:32 gawthrop -## Fixed problem with shell expanding * (used as important rep marker) -## -## Revision 1.11 2001/04/28 03:38:36 geraint -## Refined selection of matching patterns - checks for exact match. -## -## Revision 1.10 2000/09/14 07:54:13 peterg -## Removed -e option in echo -## -## Revision 1.9 2000/04/05 08:34:30 peterg -## removed output tab -## -## Revision 1.8 2000/04/05 08:04:01 peterg -## Minor reorganisation -## -## Revision 1.7 2000/04/04 16:15:14 peterg -## Fixed awk prob - must be the same sep. for each field (?) -## So tr tab to space -## -## Revision 1.6 2000/04/04 13:09:51 peterg -## *** empty log message *** -## -## Revision 1.5 2000/01/19 17:26:12 peterg -## Now includes the representation title. -## -## Revision 1.4 1999/03/09 00:03:06 peterg -## Revisions for xmtt -## -## Revision 1.3 1999/03/08 21:24:43 peterg -## Handles * representations: -## -## rep* is special -## rep shows all possible languages -## -## Revision 1.2 1999/03/08 06:34:07 peterg -## Removed mtt help - replaced by grep #SUMMARY - quicker -## -## Revision 1.1 1998/10/20 08:15:08 peterg -## Initial revision -## -############################################################### - -sep='|'; # Separates the languages from the rest. - -## List of all representations (deleting the *) -representations=`grep '#SUMMARY' $MTTPATH/mtt | gawk '{sub("\*","+"); print $2'} | sort -u ` - - -for rep in $representations ; do - Rep=`echo $rep | tr '+' '*'` - ## Title should be same for all languages -- but extract the first non-empty version - title=`grep '#SUMMARY' $MTTPATH/mtt | tr '\t' ' ' | grep "[ *]$Rep[ *]" | \ - gawk '{if (NF>2) {for (i=3;imtt_error.txt - -# Now invoke the standard error handling. -mtt_error mtt_error.txt DELETED mttroot/mtt/bin/trans/mtt_fix_integers Index: mttroot/mtt/bin/trans/mtt_fix_integers ================================================================== --- mttroot/mtt/bin/trans/mtt_fix_integers +++ mttroot/mtt/bin/trans/mtt_fix_integers @@ -1,12 +0,0 @@ -#! /bin/sh - -mttmatrix='\(mtt[A-Za-z][A-Za-z]*\)' -integer='\([0-9][0-9]*\)' - -mtt_join_lines | gawk -v RS=${1:-"$"} -v ORS=${2:-"$\n"} ' { -str = $0; -str1 = gensub ( /([^A-Za-z_0-9\.\+])([0-9]+)([^\.0-9])/ , "\\1\\2.0\\3" , "g", str ); -str2 = gensub ( /([^e]\+)([0-9]+)([^\.0-9])/ , "\\1\\2.0\\3" , "g", str1 ); -str3 = gensub ( /([^A-Za-z_0-9\.\+])([0-9]+)e([0-9]+).0([^\.0-9])/ , "\\1\\2\\3\\4" , "g" , str2) -printf "%s$\n", str3 ; -}' | sed -e "s/$mttmatrix($integer\.0,/\1(\2,/g" DELETED mttroot/mtt/bin/trans/mtt_get_subsystems Index: mttroot/mtt/bin/trans/mtt_get_subsystems ================================================================== --- mttroot/mtt/bin/trans/mtt_get_subsystems +++ mttroot/mtt/bin/trans/mtt_get_subsystems @@ -1,37 +0,0 @@ -#!/bin/sh -# Gets the subsystems - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -strip ) - strip=yes; - ;; - *) - echo "$1 is an invalid argument - ignoring"; - exit ;; - esac - shift -done - -subsystems=`sh $1_sub.sh "echo grep " " $1_abg.m" |\ - sh | gawk -F '.' '{print $3}'` - -if [ -n "$strip" ]; then - echo $subsystems - else - for subsystem in $subsystems; do - # echo -n $1_$subsystem' ' - echo $1_$subsystem #| gawk '{printf("%s ",$1)}' - done - echo -fi - - - - - - - - - - DELETED mttroot/mtt/bin/trans/mtt_getsize Index: mttroot/mtt/bin/trans/mtt_getsize ================================================================== --- mttroot/mtt/bin/trans/mtt_getsize +++ mttroot/mtt/bin/trans/mtt_getsize @@ -1,50 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_getsize - -# Gets array sizes for the def.r file -# P.J.Gawthrop Feb 2000 -# Copyright (C) 2000 by Peter J. Gawthrop - - #$Id$ - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -internal ) - internal=yes; - ;; - -external ) - external=yes; - ;; - *) - echo "$1 is an invalid argument - ignoring"; - exit ;; - esac - shift -done - -if [ -n "$internal" ]; then - name=MTT$2"[0-9]"; # echo $name - grep -i "$name" $1_ese.r | wc -l - exit -fi - -if [ -n "$external" ]; then - name="^MTT"$2"("; #echo $name - grep -i "$name" $1_ese.r | wc -l - exit -fi - -## The original version for external sizes. -if [ "$2" = "xx" ]; then - n=`mtt_getsize $1 x` - N=`echo "$n * $n" | bc` -else - N=`grep "MTTN$2 " <$1_def.r | gawk '{print $3}' | sed 's/;//'` -fi - -echo $N DELETED mttroot/mtt/bin/trans/mtt_header Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -1,1148 +0,0 @@ -#!/bin/sh - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_header -# Headings for functions -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.67 2005/11/16 00:43:15 geraint -## rtxi -## -## Revision 1.66 2005/02/17 18:54:23 geraint -## Fixed a bash-sim: replaced let with $(( )) -## -## Revision 1.65 2004/08/29 13:14:29 geraint -## Added rule to make header for sae (sorted algebraic equations). -## -## Revision 1.64 2004/08/29 01:48:46 geraint -## Added rules to create headers for sorted systems: sesx and sesy. -## -## Revision 1.63 2004/08/28 22:08:41 geraint -## Fixed zeromatrices statements: spaces instead of commas -## -## Revision 1.62 2004/07/19 22:22:25 geraint -## Fixed initialisation of ColumnVectors for -oct. -## -## Revision 1.61 2004/06/21 16:30:41 gawthrop -## Don't zero for cc code -## -## Revision 1.60 2004/06/21 16:05:58 gawthrop -## Zapped comment that causes -## -## Revision 1.59 2004/06/20 13:53:06 gawthrop -## Initialise for numpar as well -## -## Revision 1.58 2004/06/20 13:34:11 gawthrop -## Create vectors using zeros(N,1) - avoids new octave -## default to row vector - more reps now included -## -## Revision 1.57 2004/06/20 10:18:00 gawthrop -## Explicitly size vectors - avoid default row vector bug -## -## Revision 1.56 2003/04/17 20:07:33 geraint -## Added rule to create _sese.m -## -## Revision 1.55 2002/10/30 01:15:20 gawthrop -## Now gives correct-size matrices for dm rep. -## -## Revision 1.54 2002/07/11 13:00:23 geraint -## Declared more function arguments to be "const" - improves compiler optimisation. -## -## Revision 1.53 2002/06/10 23:22:16 geraint -## Fixed problem with Matlab fsolve failing because of "user function returned Inf or Nan" (fsolve.m, line 245). -## -## Revision 1.52 2002/05/27 14:52:15 geraint -## Parameters in sfun reps are now declared using sympar.h at the top of the -## sfun*.c file instead of in individual functions. This causes the optimisation -## variables (mtt_tmp*) to be declared correctly without causing conflicts in the -## scope of parameter declarations. -## -## Revision 1.51 2002/05/19 13:01:21 geraint -## Numerical solution of algebraic equations implemented for S-function target. -## -## Equation solving requires the Matlab Optimization Toolbox to be installed. -## -## Code has been changed from C++ to C to allow mex files to be built with LCC, -## the compiler bundled with Matlab. -## -## Parameters are now obtained from numpar.c instead of a dialogue box. -## -## `mtt sfun zip` creates all necessary files for building the model mex files. -## -## Revision 1.50 2002/05/15 14:22:25 geraint -## Code for Simulink S-function target written direct to sfun.cc instead of -## calling .mexglx files. This eliminates the sfun dependency on Octave -## ColumnVectors. sys_sfun.cc should build directly on a MS Windows machine -## (can't test this yet). -## -## added sfun.zip target to create source code to export. -## -## Revision 1.49 2002/05/11 01:14:17 geraint -## Fix for [ 553218 ] simpar.oct and simpar.m different. -## Translation added between ColumnVector in base .cc and Octave_map in .oct. -## -## Revision 1.48 2002/05/08 14:51:03 geraint -## Moved matlab/octave data type conversion functions to a separate file. -## -## Revision 1.47 2002/05/07 23:50:34 geraint -## Preliminary support for Matlab dynamically linked shared objects: -## invoke with: mtt -cc sys rep mexglx -## ode2odes support is not yet included. -## -## Revision 1.46 2002/05/07 13:48:43 geraint -## Improved clarity of code generated for -cc and -oct (except ode2odes). -## Octave DEFUN_DLDs now call (rather than replace) their .cc equivalents. -## -## Revision 1.45 2002/05/02 09:30:22 gawthrop -## _ssim.m now returns t as 4th arg -## -## Revision 1.44 2002/05/01 17:30:56 geraint -## Improved pre-processor directives to better accommodate future alternatives (matlab) -## if necessary. -## -## Revision 1.43 2002/04/30 23:27:00 geraint -## Replaced octave_map with columnvector in simpar.cc. Not quite as descriptive but -## standardises the interfaces somewhat and reduces the dependency on liboctinterp -## (and thus libreadline, libkpathsea, libncurses, etc). -## -## Revision 1.42 2002/04/28 18:41:27 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.41 2002/04/23 17:46:05 gawthrop -## _sim.m now returns time as third argument -## -## Revision 1.40 2002/04/17 16:23:59 geraint -## Partial fix for [ 545113 ] zeros missing in c++. -## Fixes -oct by removing duplicate initialisation (-c is still outstanding). -## -## Revision 1.39 2002/04/15 10:54:31 geraint -## Statically declare outputs and initialise to zero. -## This is necessary to prevent spurious values from being output when no assignments are made (i.e. when "y(i) := 0 for all u" (Reduce:see NERO)). -## -## Revision 1.38 2001/07/23 23:43:15 gawthrop -## header only version does not need to compute sizes from _def.r -## -## Revision 1.37 2001/07/13 04:54:04 geraint -## Branch merge: numerical-algebraic-solution back to main. -## -## Revision 1.36 2001/07/12 04:00:51 gawthrop -## Now zeros y correctly - ie Ny NOT Nx elements -## -## Revision 1.35 2001/06/13 10:39:51 gawthrop -## Zeros output matices in csex and cseo just in case some elements are -## actually zero and not set in code. Works for m and oct. -## -## Revision 1.34 2001/05/26 18:36:43 gawthrop -## Further modifications. Now works on rcPPP -## -- next jobs: -## add identification to ppp_nlin_sim -## create real-time ppp_nlin_run -## -## Revision 1.33 2001/05/26 15:46:38 gawthrop -## Updated to account for new nonlinear ppp -## -## Revision 1.32 2001/05/24 07:42:12 gawthrop -## Included and updated the missing tf_r2m -## -## Revision 1.31.2.2 2001/07/02 00:34:56 geraint -## gcc-3.0 compatibility. -## -## Revision 1.31.2.1 2001/05/04 04:07:24 geraint -## Numerical solution of algebraic equations. -## sys_ae.cc written for unsolved inputs. -## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). -## -## Revision 1.31 2001/04/03 14:49:42 gawthrop -## Revised to incorporate new ssim (sensitivity simulation) -## representation (m only just now). -## -## Revision 1.30 2001/03/30 15:13:58 gawthrop -## Rationalised simulation modes to each return mtt_data -## -## Revision 1.29 2001/03/27 13:10:23 geraint -## Improved determination of Octave version. -## -## Revision 1.28 2001/02/17 03:48:17 geraint -## Use assignment LHS to gather tmp variable names. -## Prevents collection of long expressions, eg: tmp34*(tmp75 -## -## Revision 1.27 2001/02/14 06:06:34 geraint -## Removed octave_value_list wrappers from standalone.exe - speed improvements -## -## Revision 1.26 2001/02/05 08:50:58 geraint -## Octave 2.1.x compatability. -## -## Revision 1.28 2001/01/17 21:16:15 geraint -## uncomment parameter assignments in .m reps -## -## Revision 1.27 2001/01/14 23:51:26 geraint -## declare parameters as variables instead of constants -## -## Revision 1.26 2001/01/07 21:22:47 geraint -## Compatibility with Octave 2.1.x -## vector_value ---> column_vector_value -## -## Revision 1.25 2000/12/05 12:05:26 peterg -## Changed to () form -## -## Revision 1.24 2000/12/05 10:04:52 peterg -## Fixed dummy variable bug -## -## Revision 1.23 2000/12/05 09:47:50 peterg -## Include crs as c files -## -## Revision 1.22 2000/12/04 12:19:12 peterg -## Changed $() to `` and $() to expr for sh compatibility -- geraint -## -## Revision 1.21 2000/12/04 08:52:40 peterg -## Zapped () in functions for sh compatibility -## -## Revision 1.20 2000/12/04 08:19:27 peterg -## Added switch declarations - in logic.cc -## -## Revision 1.19 2000/12/03 16:11:43 peterg -## Corrected bug in logic declatations -## -## Revision 1.18 2000/12/03 16:06:22 peterg -## Fixed bug in generating dummies -## Added logic declarations -## -## Revision 1.17 2000/12/01 20:55:01 peterg -## Added Geraint's fix for zeroing matrices -## -## Revision 1.16 2000/12/01 17:56:30 peterg -## Removed spurious echo '## Set matrices to zero' - thanks Geraint -## -## Revision 1.15 2000/11/29 21:06:16 peterg -## Removed Npar creation - not needed?? -## -## Revision 1.14 2000/11/27 11:51:43 peterg -## Added zero matrices in matlab code -## -## Revision 1.13 2000/11/09 17:19:52 peterg -## Geraint's pow() mods -## -## Revision 1.12 2000/11/09 16:09:46 peterg -## Declare dummy variables (mtt_s1 etc) -## -## Revision 1.11 2000/11/09 15:29:35 peterg -## lower-case declarations -## -## Revision 1.10 2000/11/07 17:20:51 peterg -## useful-functions.hh now included locally -## -## Revision 1.9 2000/11/07 16:56:24 peterg -## Version from Geraint -## -## Revision 1.2 2000/11/03 00:55:42 geraint -## typo: missed out 'd' in mttedx -## todo: need to accommodate mttsimpar -## -## Revision 1.1 2000/11/02 04:28:39 geraint -## Initial revision -## -## Revision 1.8 2000/10/17 16:35:03 peterg -## No parameter,state or input conversion in txt files -## -## Revision 1.7 2000/10/17 09:53:20 peterg -## Fixed logic rep -## -## Revision 1.6 2000/10/17 08:37:23 peterg -## Included logic rep -## -## Revision 1.5 2000/10/14 09:12:14 peterg -## No dies arguments and output itself -## -## Revision 1.4 2000/10/14 06:49:31 peterg -## Make parameter listing representation dependent -## -## Revision 1.3 2000/10/11 08:59:15 peterg -## Added csex rep -## -## Revision 1.2 2000/10/11 08:01:42 peterg -## Added noglobal fudge - ## -## Revision 1.1 2000/10/10 21:02:27 peterg -## Initial revision -## -############################################################### - -# Arguments -system=$1 -rep=$2 -language=$3 -fun_name=${1}_${2} - -other=$4 # Anything else eg stdin - -insertor=\<\< # help emacs sh-mode with C++ lines - - -if [ -z "$system" ]; then - echo 'Usage: mtt_header sys rep lang [stdin]' - exit -fi - - -# get octave version -octave_development=`octave --version | gawk '{print $4}' | gawk -F\. '{print $2}'` -case `$MATRIX --version | gawk -F\. '{print $2}'` in - 0) # stable - vector_value=vector_value - ;; - 1) # development - vector_value=column_vector_value - ;; - *) - vector_value=column_vector_value - ;; -esac - - -# Representation-specific stuff - -eqnargs='mttx,mttu,mttt,mttpar' -inputeqnargs='mttx,mtty,mttt,mttpar' -case $rep in - ae) - states=yes; - inputs=yes; - parameters=yes; - output=mttyz; - args=$eqnargs; - ;; - cse) - states=yes; - inputs=yes; - parameters=yes; - output='mttdx,mtte' - args=$eqnargs - zeromatrices='dx e' - ;; - csex) - states=yes; - inputs=yes; - parameters=yes; - output=mttedx - args=$eqnargs - zeromatrices='edx'; - ;; - cseo) - states=yes; - inputs=yes; - parameters=yes; - output=mtty - args=$eqnargs - zeromatrices='y'; - ;; - dm) - states=no; - inputs=no; - parameters=yes; - output='mtta,mttb,mttc,mttd,mtte' - args=mttpar - zeromatrices='a b c d e'; - ;; - input) - inputs=no; - output=mttu - args=$inputeqnargs - if [ "$other" = "stdin" ]; then - states=no; - parameters=no; - declareinputs=no; - else - states=yes; - parameters=yes; - declareinputs=yes - declarestates=yes - zeromatrices='u' - fi - ;; - logic) - states=no; - inputs=no; - parameters=yes; - output=mttopen - args=$eqnargs - declareinputs=yes - declarestates=yes - declareswitches=yes - zeromatrices='open'; - ;; - numpar) - states=no; - inputs=no; - parameters=no; - output='mttpar' - zeromatrices='par' - ;; - ode) - states=yes; - inputs=yes; - parameters=yes; - output='mttdx,mtty' - args=$eqnargs - zeromatrices='dx y' - ;; - odeo) - states=yes; - inputs=yes; - parameters=yes; - output='mtty' - args=$eqnargs - zeromatrices='y' - ;; - ode2odes) - states=no; - inputs=no; - parameters=no; - output='mtt_data' - args='x0,par,simpar' - ;; - simpar) - states=no; - inputs=no; - parameters=no; - output='mttsimpar' - oct_rep_include="#include " - oct_return_type="mtt_simpar" - ;; - sae) - states=yes; - inputs=yes; - parameters=yes; - output=mttyz; - args=$eqnargs; - ;; - sese) - states=yes; - inputs=yes; - parameters=yes; - output="mttdx,mtty"; - args=$eqnargs; - zeromatrices="dx y"; - ;; - sesx) - states=yes; - inputs=yes; - parameters=yes; - output='mttdx' - args=$eqnargs - zeromatrices='dx' - ;; - sesy) - states=yes; - inputs=yes; - parameters=yes; - output='mtty' - args=$eqnargs - zeromatrices='y' - ;; - sm) - states=no; - inputs=no; - parameters=yes; - output='mtta,mttb,mttc,mttd' - args=mttpar; - zeromatrices='a b c d'; - ;; - smxa) - states=no; - inputs=no; - parameters=yes; - output='mtta' - args=$eqnargs - zeromatrices='a'; - ;; - smxax) - states=no; - inputs=no; - parameters=yes; - output='mttax' - args=$eqnargs - zeromatrices='ax'; - ;; - state) - states=no; - inputs=no; - parameters=yes; - output=mttx - args=mttpar - declarestates=yes - zeromatrices='x' - ;; - sim) - states=no; - inputs=no; - parameters=no; - output='y,x,t' - args='x0,par,simpar,u' - ;; - ssim) - states=no; - inputs=no; - parameters=no; - output='y,y_par,x,t' - args='x0,par,simpar,u,index' - ;; - tf) - states=no; - inputs=no; - parameters=yes; - output='mttnum,mttden' - args=mttpar; - ;; - type) - states=no; - inputs=no; - parameters=no; - header_only=yes; - ;; - - *) - echo Representation $rep not supported - sorry; exit 1 -esac - -## Sort out parentheses -if [ -n "$args" ]; then - Args='('$args')' -fi -if [ -n "$output" ]; then - Output="[$output] = " -fi - - -# Lanuage specific stuff -case $language in - m) - Lc='##'; - Rc=''; - Lb='('; - Rb=')'; - function="function" - declaration="$Output$1_$rep$Args;" - if [ "$other" != "stdin" ]; then - noglobals=true; # Fudge to make mtt_m2p work - fi - start='## BEGIN Code' - finish='## END Code' - var_declaration= - declarestates=no - declareinputs=no - declareswitches=no - ;; - sh) - modeline='## -*-shell-script-*- Put Emacs into shell-script-mode ##'; - Lc='##'; - Rc=''; - Lb='('; - Rb=')'; - function="" - declaration="" - start='' - parameters=no - states=no - inputs=no - declarestates=no - declareinputs=no - declareswitches=no - ;; - txt) - modeline='## -*-octave-*- Put Emacs into octave-mode ##'; - Lc='##'; - Rc=''; - Lb='('; - Rb=')'; - function="" - declaration="" - start='' - parameters=no - states=no - inputs=no - declarestates=no - declareinputs=no - declareswitches=no - ;; - oct) - modeline="// -*-c++-*- Put Emacs into c++-mode"; - Lc='//'; - Lb='('; - Rb=')'; - oct_header=yes; - constant_declaration="const double " - var_declaration="double " - minusone="-1" - map="_map" - declaredummies=yes - ;; - c) - modeline="/* -*-c-*- Put Emacs into c-mode */"; - Lc='/*' - Rc='*/' - Lb='[' - Rb=']' - constant_declaration="const double " - var_declaration="double " - minusone="-1" - ;; - *) - echo Language $language not supported - sorry; exit 1 -esac - -if [ "$rep" = "simpar" ]; then - output=${output}${map} # Output is simpar_map in this case -fi - -get_sizes() - { - Nx=`mtt_getsize $system x` # States - Nz=`mtt_getsize $system z` # Non-states - Nxx=`mtt_getsize $system xx` # States x States - Nu=`mtt_getsize $system u` # Inputs - Ny=`mtt_getsize $system y` # Outputs - Nyz=`mtt_getsize $system yz` # Zero outputs - - case ${rep} in - dm) - Nx=$(( $Nx + 2 * $Nz + $Nyz )) # Matrices not usual size - ;; - *) - - esac - Npar=`wc -l $system\_sympar.txt | gawk '{print $1}'` - } - -zero_matrices() -{ -## Set matrices to zero -echo -for name in $zeromatrices; do - case $name in - a) - N=$Nx; M=$Nx - ;; - b) - N=$Nx; M=$Nu - ;; - c) - N=$Ny; M=$Nx - ;; - d) - N=$Ny; M=$Nu - ;; - e) - N=$Nx; M=$Nx - ;; - x) - N=$Nx; M=0 - ;; - dx) - N=$Nx; M=0 - ;; - edx) - N=$Nx; M=0 - ;; - y) - N=$Ny; M=0 - ;; - u) - N=$Nu; M=0 - ;; - open) - N=$Nx; M=0 - ;; - ax) - N=$Nx; M=0 - ;; - par) - N=$Npar; M=0 - ;; - *) - - esac - - case ${language} in - m) - if [ "$M" = "0" ]; then - M=1; - fi - echo " mtt$name = zeros($N,$M);" - ;; - oct) - if [ "$M" = "0" ]; then - echo " mtt$name = zeros($N);" - else - echo " mtt$name = zeros($N,$M);" - fi - ;; - *) - esac -done -} - -declare_dummies() -{ -# Get the dummies -dummies="mtt_tmp" -rm -f mtt_dummies -for dummy in $dummies; do - grep "${dummy}[0-9]*[ \t\n]*=" < ${fun_name}.m |\ - gawk '{ - if (match($1,dummy)==1) - print $1 - }' dummy=$dummy >> mtt_dummies -done - -dummy_list=`sort -u mtt_dummies` - -# Comments -cat < -#include "useful-functions.hh" -#include "${system}_cr.h" -#include "${system}_def.h" -#include "${system}_sympar.h" - -// Code generation directives -#define STANDALONE 0 -#define OCTAVEDLD 1 -#define MATLABMEX 2 -#define RTXI 3 -#ifndef CODEGENTARGET -#define CODEGENTARGET STANDALONE -#endif // CODEGENTARGET - -${arg_type} ${system}_${rep} ( -EOF - if [ -z ${args:-""} ]; then - printf "\tvoid" - else - c=`get_field ${args:-""} 0` - i=0 - while [ ${i} -lt ${c} ]; do - i=`expr ${i} + 1` - if [ ${i} -lt ${c} ]; then - comma="," - else - comma="" - fi - w=`get_field ${args} ${i}` - get_arg_specific_stuff ${w} - printf "\tconst ${arg_type}\t&${w}${comma}\n" - done - fi - cat <"} - args=${2:-""} - cat <"} - args=${2:-""} - cat < - -extern "C" -{ - void mexFunction (int nlhs, mxArray *plhs[], - int nrhs, const mxArray *prhs[]) - { -EOF - map_mex_cc_inputs ${args} -cat < mttpar -## mtt_n_parameters ---> mttnpar -## -## Revision 1.41 2000/04/18 10:13:43 peterg -## Getargs now after numpar file -## -## Revision 1.40 2000/04/07 19:09:04 peterg -## New smxa and smxax reps -## -## Revision 1.39 2000/04/07 13:38:13 peterg -## New mtt_getsize to replace bc -## -## Revision 1.38 2000/04/07 13:24:41 peterg -## Modified for smxa and smxax -## -## Revision 1.37 2000/04/07 08:17:37 peterg -## Added mttpar to the arg list of cse and cseo -## -## Revision 1.36 1999/11/29 06:49:26 peterg -## Upped number of mtt_tnn -## -## Revision 1.35 1999/11/15 22:47:17 peterg -## Generates method-specific code for the ode2odeso rep. -## -## Revision 1.34 1999/10/28 05:08:48 peterg -## Added elseif -## -## Revision 1.33 1999/09/17 04:25:01 peterg -## END --> END; in translation -## -## Revision 1.32 1999/08/29 06:54:42 peterg -## Added code (mtt_parameters, get args etc) to allow arguments to the -## a.out file -## -## Revision 1.31 1999/08/02 13:40:03 peterg -## Added zero-state and zero_input to include list -## Removed zero_matrix -## -## Revision 1.30 1999/04/20 06:16:46 peterg -## Removed calls to _switch.m -## -## Revision 1.29 1999/04/02 06:27:55 peterg -## Modified for new implicit method with swoitches -## -## Revision 1.28 1999/02/17 02:59:54 peterg -## Added -q switch to mtt -## -## Revision 1.27 1999/02/16 21:56:52 peterg -## Now gets standard include files directly from source, -## -## Revision 1.26 1999/02/16 21:43:54 peterg -## Revises smx generation. -## -## Revision 1.25 1999/02/16 04:38:09 peterg -## Now forces creation of _smx file if METHOD=IMPLICIT in simpar.txt -## -## Revision 1.24 1998/11/18 16:56:15 peterg -## Now handles comments after IFS -## -## Revision 1.23 1998/11/18 14:38:01 peterg -## Now convert ALL globals to VAR .. the last one isn't repeated now -## -## Revision 1.22 1998/11/17 17:39:45 peterg -## Put _smx include at end of list (?????) -## -## Revision 1.21 1998/11/17 17:26:11 peterg -## Put sign.p first -## -## Revision 1.20 1998/10/01 16:01:09 peterg -## Now does implicit integration with switches -## -## Revision 1.19 1998/09/29 15:37:18 peterg -## Declare mttINPUT -## -## Revision 1.18 1998/08/27 08:55:40 peterg -## Mods to integration methods -## -## Revision 1.17 1998/08/27 07:38:40 peterg -## About to change to new integration (Euler/Implicit only) -## -## Revision 1.16 1998/08/19 08:46:00 peterg -## Now translates ; % to # -## -## Revision 1.15 1998/08/15 13:46:01 peterg -## Included new sparse update routines -## -## Revision 1.14 1998/08/12 15:21:12 peterg -## Added type definition for the SVD procedures -## -## Revision 1.13 1998/08/11 09:32:07 peterg -## Added comments at procedure begin and end. -## -## Revision 1.12 1998/07/30 11:30:42 peterg -## Included zeros function -## -## Revision 1.11 1998/07/29 14:18:34 peterg -## Reorganised rep dependednt output -## -## Revision 1.10 1998/07/27 20:26:15 peterg -## Added new VARs mttWSTEPS, MTTWMIN,mttWMAX -## -## Revision 1.9 1998/07/27 17:20:42 peterg -## Allow , between () -## -## Revision 1.8 1998/07/26 19:38:17 peterg -## Replaced t0..t9 by mtt_temp0.. -## -## Revision 1.7 1998/07/25 20:06:23 peterg -## Does the mtt_update function -## -## Revision 1.6 1998/07/25 16:59:40 peterg -## Give other procedures local i,j vars. -## -## Revision 1.5 1998/07/25 15:06:17 peterg -## Added DDT VAR -## -## Revision 1.4 1998/07/25 15:05:54 peterg -## DD -## -## Revision 1.3 1998/07/25 14:03:30 peterg -## Added () to [] conversion when the variable is i j k or an integer or -## combination -## -## Revision 1.2 1998/07/25 12:39:57 peterg -## begin on same line as for and if -## -## Revision 1.1 1998/07/25 09:42:52 peterg -## Initial revision -## -############################################################### - - - -# Set up variables -args=`echo $1 | sed 's/_/ /' | sed 's/\./ /'` -Sys=`echo $args | gawk '{print $1}'` -sys=`echo $Sys | gawk '{print tolower($1)}'` -rep=`echo $args | gawk '{print $2}'` -Sys_rep="$Sys""_""$rep" -Sys_smx="$Sys""_smx" -Sys_smxp="$Sys""_smx.p" -Filename="$Sys""_""$rep.p" -filename="$sys""_""$rep.p" - -Method=$2; # The integration method -Stdin=$3; # Using standard input - -if [ -n "$Method" ]; then - MethodBlurb=" with $Method integration method" -fi - -if [ -n "$Stdin" ]; then - StdinBlurb=" using standard input" -fi - -# Inform user - echo Creating $Filename $MethodBlurb $StdinBlurb - -# Find system constants -Nx=`mtt_getsize $Sys x` # States -Nxx=`mtt_getsize $Sys xx` # States x States -Nu=`mtt_getsize $Sys u` # Inputs -Ny=`mtt_getsize $Sys y` # Inputs -Npar=`wc -l $Sys\_sympar.txt | gawk '{print $1}'` - - -#if [ "$rep" = "simpar" ]; then -# mtt -q $Sys smx p -#fi - -# Heading -(case $rep in - state) - echo "PROCEDURE $Sys_rep(VAR mttx : StateVector; - mttpar : ParameterVector);" - ;; - numpar) - echo "PROCEDURE $Sys_rep(VAR mttpar : ParameterVector);" - ;; - simpar) - echo "PROCEDURE $Sys_rep(VAR mttsimpar : SimulationParameters);" - ;; - input) - echo "PROCEDURE $Sys_rep(VAR mttu : InputVector;" - echo " mttx : StateVector;" - echo " mtty : OutputVector;" - echo " mttt : REAL;" - echo " mttpar : ParameterVector);" - ;; - logic) - echo "PROCEDURE $Sys_rep(VAR mttopen : StateVector;" - echo " mttx : StateVector;" - echo " mttu : InputVector;" - echo " mttt : REAL;" - echo " mttpar : ParameterVector);" - ;; - ode) - echo "PROCEDURE $Sys_rep(VAR mttdx: StateVector;" - echo " mttx : StateVector;" - echo " mttu : InputVector;" - echo " mttt : REAL;" - echo " mttpar : ParameterVector);" - ;; - odeo) - echo "PROCEDURE $Sys_rep(VAR mtty : OutputVector;" - echo " mttx : StateVector;" - echo " mttu : InputVector;" - echo " mttt : REAL;" - echo " mttpar : ParameterVector);" - ;; - csex) - echo "PROCEDURE $Sys_rep(VAR mttedx: StateVector;" - echo " mttx : StateVector;" - echo " mttu : InputVector;" - echo " mttt : REAL;" - echo " mttpar : ParameterVector);" - ;; - cseo) - echo "PROCEDURE $Sys_rep(VAR mtty : OutputVector;" - echo " mttx : StateVector;" - echo " mttu : InputVector;" - echo " mttt : REAL;" - echo " mttpar : ParameterVector);" - - ;; - smx ) - echo "PROCEDURE $Sys_rep(VAR mtta : StateMatrix;" - echo " VAR mttax : StateVector;" - echo " mttx : StateVector;" - echo " mttu : InputVector;" - echo " mttdt : REAL;" - echo " mttpar : ParameterVector);" - ;; - smxa ) - echo "PROCEDURE $Sys_rep(VAR mtta : StateMatrix;" - echo " mttx : StateVector;" - echo " mttu : InputVector;" - echo " mttt : REAL;" - echo " mttpar : ParameterVector);" - ;; - smxax ) - echo "PROCEDURE $Sys_rep(VAR mttax : StateVector;" - echo " mttx : StateVector;" - echo " mttu : InputVector;" - echo " mttt : REAL;" - echo " mttpar : ParameterVector);" - ;; - ode2odes) - echo "PROGRAM $Sys_rep;" - echo "" - echo "CONST" - echo " MTT_MaxParameters = 100;" - echo " MTT_Npar = $Npar;" - echo " MTT_Nx = $Nx;" - echo "" - echo "TYPE" - echo " StateVector = ARRAY[1..$Nx] OF REAL;" - echo " InputVector = ARRAY[1..$Nu] OF REAL;" - echo " OutputVector = ARRAY[1..$Ny] OF REAL;" - echo " ParameterVector = ARRAY[1..$Npar] OF REAL;" - echo " SimulationParameters = RECORD" - echo " dt, first, input, last, stepfactor, wmax, wmin, wsteps: REAL" - echo " END;" - echo " StateMatrix = ARRAY[1..$Nx,1..$Nx] OF REAL;" - echo " StateMatrixVector = ARRAY[1..$Nxx] OF REAL;" - echo " glnparray = StateVector;" - echo " glmparray = StateVector;" - echo " glnarray = StateVector;" - echo " glnpbynp = StateMatrix;" - echo " glmpbynp = StateMatrix;" - ## echo " IntegrationMethod = 1..4;" - echo "" - echo "VAR" - echo " simpar : SimulationParameters;" - echo " t,ddt : REAL;" - echo " x,x0,dx,AAx : StateVector;" - echo " mttx,mttdx,mttAAx,mttedx : StateVector;" - echo " u,mttu : InputVector;" - echo " y,mtty : OutputVector;" - echo " par : ParameterVector;" - echo " mttpar : ParameterVector;" - echo " mttnpar : INTEGER;" - echo " AA,mtte : StateMatrix;" - echo " MTTi,MTTj,it,iLast: INTEGER;" - ##echo " mttSTEPFACTOR,mttWSTEPS,mttSTEPS,mttINPUT : INTEGER;" - ## echo " mttMETHOD : IntegrationMethod;" - echo " open_switches : StateVector;" - echo " numparfile, statefile, simparfile : TEXT;" - strip_comments <${Sys}_switch.txt |\ - gawk '{printf("%s_logic : REAL;\n", tolower($1))}' - echo "" - mtt_txt2declare $Sys sympar p - mtt_txt2declare $Sys struc p - ;; -# switchopen) -# echo "PROCEDURE $Sys_rep(VAR open : StateVector; mttx : StateVector);" -# echo "VAR" -# echo " MTTi,MTTj : INTEGER;" -# ;; - *) echo "PROCEDURE $Sys_rep;" - echo "VAR" - echo " MTTi,MTTj : INTEGER;" - ;; -esac) > $Filename - -cat<> $Filename - -{*** System $Sys, rep $rep, language Pascal, file $Filename ***} -{*** Translated by MTT from $Sys_rep.m on `date` ***} - -EOF - -# Regexps - name="[a-zA-Z0-9_]*" - fun_name="$Sys\_$name" - mttfun_name=$name - tab=' ' - space="[ $tab]*" - spaces="[ $tab][ $tab]*" - non_space="[^ ]*" - args='[a-zA-Z0-9,._"]*' - -# Body -fix_operators () -{ - m_neq="(\!\=)|(\~\=)" - m_not="\!" - m__eq="\=\=" - - p_neq="\<\>" - p_not="NOT\ " - p__eq="\=" - - sed "s/$m_neq/$p_neq/g" |\ - sed "s/$m_not/$p_not/g" |\ - sed "s/$m__eq/$p__eq/g" -} - -cat $Sys_rep.m |\ -grep -v 'Remove in mtt_m2p' |\ -grep -v '^[ ]*function' |\ -grep -v '^[ ]*endfunction' |\ -grep -v 'MTT_data' |\ -sed "s/^$space%/#/" | sed "s/\([;)]$space\)%/\1#/" |\ -gawk -F# '{printf("%s",$1) - if (NF>1) printf("{* %s *}", $2) - printf("\n") - }' |\ -sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\ -sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)(\($args\))/\2(\1,\3)/" |\ -sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)/\2(\1)/" |\ -sed "s/$space\($non_space\)$spaces=${spaces}zeros(\([0-9]*\),1)/zero_state(\1,\2)/" |\ -sed "s/$space\($non_space\)$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\ -sed "s/,)/)/" |\ -fix_operators |\ -gawk ' -function printvar(Name,N) { - if (N<1) return; - width = 10; - kk = 0; - for (k=1;k<=N;k++) { - printf("mtt%s%i", Name, k); - if (k==N) - printf(" : REAL;\n") - else - printf(", "); - kk++; - if (kk==width){printf("\n"); kk=0} - } -} -BEGIN{ - comment_regexp = "{" - doing_header = 0 - doing_globals = 0 - N_tmp = 100; - inc ="$I" -} -{ - if ($1=="global") - doing_globals = 1 - else{ - if (doing_globals==1){ - global[++i]=$1; - if (match($0,";")==0){ - } - else{ - doing_globals = 0 - doing_header = 1 - } - } - else - { - if (doing_header==1){ - if (rep=="ode2odes"){ - printf("\n{%s $MTTPATH/trans/p/mtt_write.p}\n",inc) - printf("{%s $MTTPATH/trans/p/mtt_par_update.p}\n",inc) - printf("{%s $MTTPATH/trans/p/sign.p}\n",inc) - printf("{%s $MTTPATH/trans/p/mtt_euler.p}\n",inc) - #printf("{%s $MTTPATH/trans/p/mtt_solve.p}\n",inc) - printf("{%s $MTTPATH/trans/p/mtt_implicit.p}\n",inc) - #printf("{%s $MTTPATH/trans/p/zero_matrix.p}\n",inc) - printf("{%s $MTTPATH/trans/p/zero_input.p}\n",inc) - printf("{%s $MTTPATH/trans/p/zero_state.p}\n",inc) - printf("{%s %s_simpar.p}\n",inc,Sys) - printf("{%s %s_numpar.p}\n",inc,Sys) - # printf("{%s $MTTPATH/trans/p/mtt_getargs.p}\n",inc) - printf("{%s %s_state.p}\n",inc,Sys) - printf("{%s %s_input.p}\n",inc,Sys) - - if (Method=="euler") { - printf("{%s %s_ode.p}\n",inc,Sys) - printf("{%s %s_odeo.p}\n",inc,Sys) - } - if (Method=="implicit") { - printf("{%s %s_csex.p}\n",inc,Sys) - printf("{%s %s_cseo.p}\n",inc,Sys) - printf("\n{%s %s_smxa.p}\n",inc,Sys); - printf("\n{%s %s_smxax.p}\n",inc,Sys); - } - printf("{%s %s_logic.p}\n\n",inc,Sys) - - for (k=1;k<=j;k++) printf("%s\n", comment[k]) - printf("\n") - printf("\nBEGIN{%s}\n", Sys_rep) - printf(" open(statefile,\"%s_state.dat\");\n", Sys) - printf(" open(simparfile,\"%s_simpar.dat\");\n", Sys) - printf(" open(numparfile,\"%s_numpar.dat\");\n", Sys) - } - else{ - for (k=1;k<=j;k++) printf("%s\n", comment[k]) - printf("\n") - printf("VAR \n"); - for (k=1;k0){ - if (doing_header==1) - comment[++j] = $0 - else - printf("%s\n", $0) - } - else { - if ($1=="if") { - sub(/==/, "=", $0) - gsub(/&&/," AND ",$0) - gsub(/\|\|/," OR ",$0) - printf("%s THEN BEGIN\n", $0) - } - else { - #if ((match($1,"mtt_write")>0)&&(length(Stdin)>0)) { - # sub(/mtt_write/, "if NOT eof THEN mtt_write"); - #} - if ($1=="for"){ - if (($2=="it")&&(length(Stdin)>0)){ - printf("WHILE NOT eof DO BEGIN {Integration loop}\n") - } - else { - sub(/:/," TO ",$0) - sub(/=/,":=",$0) - printf("%s DO BEGIN\n", $0) - } - } - else{ - sub(/=/,":=",$0) - sub(/endif/,"END;{IF}",$0) - sub(/endfor/,"END;{FOR}",$0) - sub(/elseif/,"END ELSEIF BEGIN",$0) - sub(/else/,"END ELSE BEGIN",$0) - gsub(/\^/,"**",$0) - gsub(/&&/," AND ",$0) - gsub(/\|\|/," OR ",$0) - printf("%s\n",$0) - } - } - } - } - } -} -END{ - if (rep=="def"){ - printf("EULER = 1,\n") - printf("IMPLICITL = 2;\n") - printf("IMPLICIT = 3;\n") - } - else - if (rep=="ode2odes") - printf("END{%s}.\n", Sys_rep) - else - printf("END{%s};\n", Sys_rep) -}' Sys=$Sys sys=$sys Sys_rep=$Sys_rep rep=$rep \ - Nx=$Nx Nu=$Nu Ny=$Ny Method=$Method Stdin=$Stdin |\ -sed 's/\\$//' |\ -sed 's/(\([ijk0-9,]*\))/\[\1\]/g' |\ -sed 's/(\(MTT[ijk0-9],[0-9]*\))/\[\1\]/g' |\ -sed 's/(\([0-9]*,MTT[ijk0-9]\))/\[\1\]/g' |\ -sed 's/(\(MTT[ijk0-9],MTT[ijk0-9]\))/\[\1\]/g' |\ -sed 's/(\(MTT[ijk0-9,]*\))/\[\1\]/g' |\ -sed 's/switcha(mttAA,/switcha(/g' |\ -sed 's/switch(MTTx,/switch(/g' |\ -sed 's/if nargin<[1-9] THEN//' |\ -sed 's/if nargin>[0-9] THEN//' \ ->> $Filename - -# p2c doesn't like mixed case filenames! -#if [ "$Filename" != "$filename" ]; then -# echo Creating $filename -# cp -f $Filename $filename -#fi - -if [ "$rep" = "ode2odes" ]; then - # Explicitly include files - mtt_pinclude $Filename>junk.p - mv junk.p $Filename -fi - - - DELETED mttroot/mtt/bin/trans/mtt_make_menu Index: mttroot/mtt/bin/trans/mtt_make_menu ================================================================== --- mttroot/mtt/bin/trans/mtt_make_menu +++ mttroot/mtt/bin/trans/mtt_make_menu @@ -1,108 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_make_menu -# Creates tk/tcl menus for xmtt. -# Copyright (c) P.J.Gawthrop, 1998,1999 - -## Paths for its files -dotfile="$HOME/.mtt" -xdotfile="${dotfile}/xmtt" - -repfile="${xdotfile}/reps" -exfile="${xdotfile}/examples" - -#MTT blurb -title=`mtt --version` - -#Collect all systems (inc dir name) -pwd=`pwd`; -dirname=`basename $pwd` -systems=`echo *_abg.fig | sed 's/\([a-zA-Z0-9]*\)_abg.fig/\1/g'` -dirname_in_systems=`echo $systems | grep -c $dirname` -if [ "$dirname_in_systems" = "0" ]; then - systems="$systems $dirname" -fi - -# Default system -system=$dirname - -cat<1. Could be made faster by not generating y when -## y_sim >1 -## -## Revision 1.5 2000/05/17 16:01:42 peterg -## Fixed bug for n_y>1 -## -## Revision 1.4 2000/05/16 18:57:15 peterg -## Still debugging -## -## Revision 1.3 2000/05/16 11:59:34 peterg -## Stard new version with data files not argv. -## -## Revision 1.2 2000/05/11 19:32:29 peterg -## Put in c version + sensitivity computation -## -## Revision 1.1 2000/04/08 10:43:26 peterg -## Initial revision -## -############################################################### - -# Tell user -Sys=$1 -method=$2 -computation=$3 - -if [ -z "$method" ]; then - method=implicit -fi - -if [ -n "$computation" ]; then - blurb="for language $computation" -fi - -echo "Creating $1_sim.m with $method integration method $blurb" - -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 -Npar=`wc -l $Sys\_sympar.txt | gawk '{print $1}'` - -# Header -lang_header -noglobals $1 sim m 'x0,u,t,par,sensitivities' '[y,ys]' > $1_sim.m - -cat >> $1_sim.m <0); - if doing_sensitivities - n_y = $Ny/2; - doing_state=0; - ys = []; - else - n_y = $Ny; - doing_state=(nargout>1); - endif; - - - - ## Initialise - ui = zeros(n_u,1); # Initial control - [xi] = x0; # Read in initial state - - ## Timing parameters - first = t(1); - dt = t(2) - t(1); - n_t = length(t); - last = t(n_t); -EOF - -if [ "$computation" = "c" ]; then -cat >> $1_sim.m <1 - if doing_sensitivities - ys = [ys; yy(2:n_y:2*n_y,:)]; - endif; - endif - - endfor; - ##RealTime = [S T] -endfunction - -EOF - -else - -cat >> $1_sim.m < ${sys}_${subsystem}_struc.txt -done DELETED mttroot/mtt/bin/trans/mtt_make_subsystems Index: mttroot/mtt/bin/trans/mtt_make_subsystems ================================================================== --- mttroot/mtt/bin/trans/mtt_make_subsystems +++ mttroot/mtt/bin/trans/mtt_make_subsystems @@ -1,19 +0,0 @@ -#!/bin/sh - -# Makes subsystems for partitioning -# Copyright (C) 2000 by Peter J. Gawthrop - -sys=$1 -rep=$2 -lang=$3 - -echo Creating subsystem representations for ${sys}_${rep}.${lang} -# Get subsystems - subsystems=`mtt_get_subsystems -strip ${sys}`; - -for subsystem in $subsystems; do - -mtt $options -u -q -sub $subsystem ${sys} ${rep} ${lang} - ## Repeating systems need sorting out !!!! - #cp $1_$subsystem"_"$2.$3 $1_$subsystem"_1_"$2.$3 -done DELETED mttroot/mtt/bin/trans/mtt_make_sympar Index: mttroot/mtt/bin/trans/mtt_make_sympar ================================================================== --- mttroot/mtt/bin/trans/mtt_make_sympar +++ mttroot/mtt/bin/trans/mtt_make_sympar @@ -1,139 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_make_sympar -# Makes the sympar.txt file -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.12 2004/09/02 22:06:09 geraint -## Does not issue warnings about Reduce reserved words if the -## second argument (use_reduce) is "no". -## -## Revision 1.11 2002/04/28 18:41:27 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.10 2001/07/28 21:10:18 geraint -## Generate warning instead of error if reserved word used. -## -## Revision 1.9 2001/07/23 05:16:39 geraint -## Simple filter for Reduce reserved words in sympar. -## -## Revision 1.8 2001/07/04 06:00:12 gawthrop -## Fixed a funny with tr - changed SEPS and REPS - something to do with ^ -## -## Revision 1.7 2001/04/13 07:14:12 geraint -## Implemented lower level lbl.txt recognition of #NOT[V|P]AR -## -## Revision 1.6 2001/04/10 12:54:50 gawthrop -## Minor fixes for sensitivity versions -## -## Revision 1.5 2000/11/03 14:57:06 peterg -## Corrected regexp notvar -## -## Revision 1.4 2000/11/02 18:53:46 peterg -## Added NOPAR words to unwanted list. -## -## Revision 1.3 2000/10/16 09:41:29 peterg -## Fixed bug with printing a blank line. -## -## Revision 1.2 2000/10/16 09:10:08 peterg -## Now strips out "unwanted" bits frome the _aliased.txt file -## -## Revision 1.1 2000/10/12 19:24:28 peterg -## Initial revision -## -## -############################################################### - - -sys=$1 # System name -filename=$1_sympar.txt - -use_reduce=$2 - -# Inform user -echo Creating $filename - -# Create list of all sympars including those that are aliased -sh $1_type.sh 'echo ' ' ' ' ' |\ -gawk '{printf("abg2sympar_m2txt %s %s\n ", $1, $2)}' |\ -sh | sort -u > mtt_all_sympar.txt - -# Sort the aliased list -mtt_strip_args < $1_aliased.txt | sort -u > mtt_aliased_sort.txt - -# Create list of unwanted stuff -cat mtt_aliased_sort.txt> mtt_unwanted.txt - -notvar="[%|#]NOT[V|P]AR"; -sh $1_type.sh 'strip_notvars.sh ' ' ' ' mtt_unwanted.txt' - -sort -u mtt_unwanted.txt > mtt_unwanted_sort.txt - -# Compare it with the aliased list and show the differences -diff mtt_all_sympar.txt mtt_unwanted_sort.txt |\ -gawk '{if ($1=="<") printf("%s\t%s\n", $2,$3)}' > mtt_sympar.txt - -# Assume same name in different system is the same -gawk '{ - if ($1==name){ - sysname[i++]=$2 - } - - if ($1!=name){ - if (length(name)>0){ - printf("%s\t",name) - comma=""; - for (j=1;j<=i;j++){ - printf("%s%s", comma, sysname[j]); - comma=","; - } - printf("\n") - } - i=1; - sysname[1]=$2; - } - name = $1 -} -END{ - printf("%s\t",name) - comma=""; - for (j=1;j<=i;j++){ - printf("%s%s", comma, sysname[j]); - comma=","; - } - printf("\n") - -}' < mtt_sympar.txt >$filename - -if [ ! "${use_reduce}" = "no" ]; then - reserved_words=`\ - cat ${MTT_LIB}/reduce/reserved_words.txt |\ - gawk '{printf "%s ", $0}' |\ - tr [a-z] [A-Z]` - sympar_words=`\ - cat ${filename} |\ - cut -f1 |\ - gawk '{printf "%s ", $0}' |\ - tr [a-z] [A-Z]` - flag=0 - for reserved_word in ${reserved_words}; do - for sympar_word in ${sympar_words}; do - if [ ${sympar_word} = ${reserved_word} ]; then - echo "" - echo "*** MTT Warning:" - echo " ${sympar_word} is reserved (Reduce)" - echo "" - fi - done - done -fi DELETED mttroot/mtt/bin/trans/mtt_mend_lines Index: mttroot/mtt/bin/trans/mtt_mend_lines ================================================================== --- mttroot/mtt/bin/trans/mtt_mend_lines +++ mttroot/mtt/bin/trans/mtt_mend_lines @@ -1,18 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2000 by Peter J. Gawthrop - -# Fixes broken lines from reduce. - -#sed 's/[^#]\(.*\)[^;]$/\1\\/' - -gawk '{ - if ((match($1,"#")==0)&&(match($1,"global")==0)&&(match($1,"endfunction")==0)) { - if(match($0,";")!=length($0)) - printf("%s \\\n",$0) - else - print $0 - } - else print $0 - -}' DELETED mttroot/mtt/bin/trans/mtt_multi Index: mttroot/mtt/bin/trans/mtt_multi ================================================================== --- mttroot/mtt/bin/trans/mtt_multi +++ mttroot/mtt/bin/trans/mtt_multi @@ -1,22 +0,0 @@ -#!/bin/sh - -# Does mutiple commands down the hierarchy - -command=$1 -system=$2 -rep=$3 -lang=$4 -relative_level=$5 - -current_level=`echo $system | gawk '{N=split($1,foo,"_"); print N-1}'` - -if [ -z "$relative_level" ]; then - relative_level=0; -fi - -mtt_xargs.sh "ls" "$2*_$3.$4" |\ -gawk '{ - level=split($1,foo,"_")-2; - maxlevel = current_level + relative_level; - if (level<=maxlevel) print command, $0, "&"; -'} command=$command relative_level=$relative_level current_level=$current_level DELETED mttroot/mtt/bin/trans/mtt_name2array Index: mttroot/mtt/bin/trans/mtt_name2array ================================================================== --- mttroot/mtt/bin/trans/mtt_name2array +++ mttroot/mtt/bin/trans/mtt_name2array @@ -1,55 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_name2array - -# Generates array elements from names -# Copyright (C) 2000 by Peter J. Gawthrop - - -case $2 in - numpar) - name=mttpar - cat $1_sympar.txt>mtt_infile - ;; - state) - name=mttx - gawk '{if ($1==rep) printf("%s\n", $4)}' rep=$2 \ - <$1_struc.txt >mtt_infile - ;; - input) - name=mttu - gawk '{if ($1==rep) printf("%s\n", $4)}' rep=$2 \ - <$1_struc.txt >mtt_infile - ;; - *) - echo Repesentation $2 not supported -esac - -case $3 in - zero) - strip_comments $logfile 2>&1 -off nat; -in "${system}_def.r"; -in "$outfile"; -load scope; -out "$tmpfile"; -$command; -shut "$tmpfile"; -$end; -EOF - -cp $outfile $outfile.unoptimised -cp $tmpfile $outfile.tmp - -find_code $outfile head > $tmpfile.head -cat $tmpfile | mtt_fix_integers > $tmpfile.body -find_code $outfile foot > $tmpfile.foot -cat $tmpfile.head $tmpfile.body $tmpfile.foot > $outfile -echo ";end;" >> $outfile - -mtt_error_r $logfile DELETED mttroot/mtt/bin/trans/mtt_p2C Index: mttroot/mtt/bin/trans/mtt_p2C ================================================================== --- mttroot/mtt/bin/trans/mtt_p2C +++ mttroot/mtt/bin/trans/mtt_p2C @@ -1,99 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: p2C - -# Pascal to a c program - intermediate step for mtt_p2oct -# P.J.Gawthrop Feb 2000 -# Copyright (C) 2000 by Peter J. Gawthrop - - #$Id$ - - -sys_rep="$1_$2" -begin="BEGIN{$sys_rep}" - -# Inform user -# echo "Creating $1_$2.pas" - -# Find system constants -Nx=`mtt_getsize $1 x` -Nxx=`mtt_getsize $1 xx` -Nu=`mtt_getsize $1 u` -Ny=`mtt_getsize $1 y` - -Npar=`wc -l $1_sympar.txt | gawk '{print $1}'` - - -echo "PROCEDURE $1_$2;" > $1_$2.pas -echo "TYPE" >>$1_$2.pas -echo " StateVector = ARRAY[1..$Nx] OF REAL;" >>$1_$2.pas -echo " StateMatrix = ARRAY[1..$Nx,1..$Nx] OF REAL;" >>$1_$2.pas -echo " StateMatrixVector = ARRAY[1..$Nxx] OF REAL;" >>$1_$2.pas -echo " InputVector = ARRAY[1..$Nu] OF REAL;" >>$1_$2.pas -echo " OutputVector = ARRAY[1..$Ny] OF REAL;" >>$1_$2.pas -echo " ParameterVector = ARRAY[1..$Npar] OF REAL;" >>$1_$2.pas - - -# Create the predefined vars -echo "VAR" >>$1_$2.pas -gawk '{ - printf("%s,", $1) - } - END{print "JUNK : REAL;"}'< $1_sympar.txt >>$1_$2.pas - -if [ "$2" = "ode2odes" ]; then - first='PROCEDURE' - gawk ' - { - if (writing) print $0; - if (i++==0) writing=1 - if (match($1,"PROCEDURE")==1) writing=0; - }' < $1_$2.p >>$1_$2.pas -else - first='BEGIN' - - # Convert VAR format in the headings - gawk 'BEGIN{writing=1} - { - if (match($1,"BEGIN")==1) writing=0; - if (writing) print $0; - }' < $1_$2.p | \ - sed \ - -e 's/PROCEDURE [a-zA-Z_0-9]*(VAR/VAR/' \ - -e 's/PROCEDURE [a-zA-Z_0-9]*;//' \ - -e 's/REAL);/REAL;/' \ - -e 's/OutputVector);/OutputVector;/' \ - -e 's/ParameterVector);/ParameterVector;/' \ - >>$1_$2.pas -fi - -# Write out the actual code until the begining of the procedure -gawk 'BEGIN{writing=0} -{ - if (match($1,first)==1) writing=1; - if (writing) print $0; - if (match($1,begin)==1) writing=0; - -}' begin=$begin first=$first < $1_$2.p >>$1_$2.pas - -# Write out the parameters -echo {Parameters} >>$1_$2.pas -gawk '{ - printf(" %s \t:= mttpar[%i];\n", $1, ++i); - }'< $1_sympar.txt >>$1_$2.pas - -# Write out the actual code from the end of the procedure -gawk 'BEGIN{writing=0} -{ - if (writing) print $0; - if (match($1,begin)==1) writing=1; -}' begin=$begin < $1_$2.p >>$1_$2.pas - -#echo "Creating $1_$2.C" -p2c -o $1_$2.C $1_$2.pas > mtt_p2C.log 2>> mtt_p2C.log - - DELETED mttroot/mtt/bin/trans/mtt_p2c Index: mttroot/mtt/bin/trans/mtt_p2c ================================================================== --- mttroot/mtt/bin/trans/mtt_p2c +++ mttroot/mtt/bin/trans/mtt_p2c @@ -1,127 +0,0 @@ -#! /bin/sh - - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_p2c -# Pascal to c converter for MTT -# Uses the wonderful GNU p2c by Dave Gillespie, daveg@csvax.cs.caltech.edu. -# P.J.Gawthrop July 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.12 2001/04/11 07:36:10 gawthrop -## Now uses system_cr.h in place of system.h in .c rep - -## compatible with older code -## -## Revision 1.11 2001/03/29 19:24:14 gawthrop -## Can now use c representations of crs when using -c option -## -## Revision 1.10 2000/09/15 09:01:41 peterg -## Updated internal comments -## -## Revision 1.9 2000/05/16 18:56:58 peterg -## Now realised that libp2c.a avoids many probs - so simplified it. -## -## Revision 1.8 2000/05/11 19:34:50 peterg -## *** empty log message *** -## -## Revision 1.7 1999/08/29 06:14:27 peterg -## No longer remove "PASCAL_MAIN" -## -## Revision 1.6 1999/04/20 06:17:15 peterg -## Fudge to avoid a bizzare bug (?) in p2c which corrupts "zero_matrix" -## -## Revision 1.5 1998/08/12 14:14:18 peterg -## Added pretty heading and explicitly include p2c header. -## -## Revision 1.4 1998/07/29 13:56:34 peterg -## Replces p2c include by local include. -## -## Revision 1.3 1998/07/27 20:32:51 peterg -## Now gives immediate warnings -## -## Revision 1.2 1998/07/25 16:35:43 peterg -## Sorted out log files etc -## -## Revision 1.1 1998/07/25 16:28:38 peterg -## Initial revision -## -############################################################### - - -# Options -info='' -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I ) - info=info; - ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -## Create p2crc with various configs. -cat > p2crc < mtt_p2c.log 2>> mtt_p2c.log -cat $1_$2.log >> mtt_p2c.log -mv $1_$2.c mtt_junk.c - -# Change p2c.h include. -#mv $1_$2.c mtt_junk1# -#cat mtt_junk1 | grep -v 'p2c/p2c.h'> mtt_junk2 - -# pretty heading -DATE=`date` - -cat <$1_$2.c -/* C program $1_$2.c */ -/* Generated by MTT on $DATE */ - -/* Compile with gcc -lm -lp2c $1_$2.c -o $1_$2.out */ -/* Note that p2c must be correctly installed so that p2c.h and libp2c.a are accessible */ - -/* Header file for user-defined crs (implemented in c) */ -#include "$1_cr.h" -EOF - -#cat<>$1_$2.c -#/* The following is the header file included here for completeness */ -#EOF - -#cat $MTTPATH/trans/c/p2c.h >> $1_$2.c - -#cat <> $1_$2.c -#/* End of the header file. */ -# -# -#EOF - -## The sed item is to avoid a bizzare bug (?) in p2c which corrupts "zero_matrix" -###cat mtt_junk2 | sed 's/zero_matrix/mttmat/g'>> $1_$2.c - -## Sort out the pascal EOF, PASCAL_MAIN etc -cat mtt_junk.c |\ - grep -v PASCAL_MAIN >> $1_$2.c - -if [ -n "$info" ]; then - cat mtt_p2c.log -fi - -# Remove the garbage -rm -f mtt_junk.c DELETED mttroot/mtt/bin/trans/mtt_p2cc Index: mttroot/mtt/bin/trans/mtt_p2cc ================================================================== --- mttroot/mtt/bin/trans/mtt_p2cc +++ mttroot/mtt/bin/trans/mtt_p2cc @@ -1,119 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_p2cc - -# Pascal to .cc (for octave .oct files). -# P.J.Gawthrop Feb 2000 -# Copyright (C) 2000 by Peter J. Gawthrop - - #$Id$ - -## Extract the system and rep names. -sys=`mtt_sysname $1` -rep=`mtt_repname $1` -sys_rep=$sys"_"$rep - -# Find system constants -Nx=`mtt_getsize $sys x` # States -Nu=`mtt_getsize $sys u` # Inputs -Ny=`mtt_getsize $sys y` # Inputs - -# Create the representation code -mtt_p2C $sys $rep - -# Inform user -echo Creating $sys_rep.cc - -# Create the c++ code -# Heading -date=`date` - -cat > $sys_rep.cc < - -DEFUN_DLD ($sys_rep, args, , - "Usage: $sys_rep(x,u,t,par)\n$sys_rep was generated by MTT on $date") -{ - ColumnVector mttx = args(0).vector_value (); - ColumnVector mttu = args(1).vector_value (); - double mttt = args(2).double_value (); - ColumnVector mttpar = args(3).vector_value (); - -EOF - -case "$rep" in - ode) - echo " ColumnVector mttdx ($Nx);" >> $sys_rep.cc - ;; - odeo) - echo " ColumnVector mtty ($Ny);" >> $sys_rep.cc - ;; - cse) - echo " ColumnVector mttdx ($Nx);" >> $sys_rep.cc - ;; - cseo) - echo " ColumnVector mtty ($Ny);" >> $sys_rep.cc - ;; - smx | smxa | smxax) - Nxx=`echo "$Nx*$Nx" | bc` - echo " Matrix mtta ($Nx,$Nx);" >> $sys_rep.cc - echo " ColumnVector mttax ($Nx);" >> $sys_rep.cc - ;; - *) - -esac - -#Extract Type info -echo '/* Types */' >> $sys_rep.cc -grep typedef $sys_rep.C >> $sys_rep.cc - -#Extract the rep code converting [] to () and deleting mtt variables etc -#The awk part detects the begin and end of the relevant code. -echo "/* Representation $rep information */" >> $sys_rep.cc -gawk '{ - if ( (match($1,"}")==1)&&(NF>1)) writing=0; - if ( (writing) && !(match($2,"mtt[a-z]")==1) ) print $0; - if (match($1,"{")==1) writing=1; -}' <$sys_rep.C |\ -sed 's/\[\([a-z0-9_]*\)\]\[\([a-z0-9_]*\)\]/(\1,\2)/g' |\ -sed 's/\[\([a-z_0-9]*\)\]/(\1)/g' >> $sys_rep.cc - -# Tail -cat >> $sys_rep.cc <> $sys_rep.cc; - ;; - odeo) - echo "return octave_value (mtty); " >> $sys_rep.cc; - ;; - cse) - echo "return octave_value (mttdx);" >> $sys_rep.cc; - ;; - cseo) - echo "return octave_value (mtty); " >> $sys_rep.cc; - ;; - smxa) - echo "return octave_value (mtta); " >> $sys_rep.cc; - ;; - smxax) - echo "return octave_value (mttax); " >> $sys_rep.cc; - ;; - *) - -esac - -# Terminating } -echo "}" >> $sys_rep.cc; - -# Convert to octave loadable code -#echo Creating $sys_rep.oct -#mkoctfile $sys_rep.cc - DELETED mttroot/mtt/bin/trans/mtt_p2m Index: mttroot/mtt/bin/trans/mtt_p2m ================================================================== --- mttroot/mtt/bin/trans/mtt_p2m +++ mttroot/mtt/bin/trans/mtt_p2m @@ -1,25 +0,0 @@ -#! /bin/sh -## Chages the Pascal output from gentran to octave form -# Copyright (C) 2000 by Peter J. Gawthrop - -sed 's/begin$//' |\ -sed 's/end$//' |\ -sed 's/end;$/;/' |\ -sed 's/\[\([0-9,]*\)\]/(\1)/g' |\ -sed 's/:=/ = /' |\ -sed 's/\*\*/\^/g' |\ -sed 's/mtt\([a-z]\)\([a-z]*\)\([0-9]\)\([0-9]*\)/mtt\1\2(\3\4)/g' |\ -gawk '{ - sub(/^[\ ]*/, "", $0) - sub(/\$$/, ";", $0) - - if (match($NF,"[;#.%]$")==0){ - Previous[++i] = $0 - } - else { - for (j=1;j<=i;j++) printf("%s", Previous[j]); - printf("%s\n", $0) - i=0; - } -}' |\ -sed 's/#/%/g' DELETED mttroot/mtt/bin/trans/mtt_pdf.sty Index: mttroot/mtt/bin/trans/mtt_pdf.sty ================================================================== --- mttroot/mtt/bin/trans/mtt_pdf.sty +++ mttroot/mtt/bin/trans/mtt_pdf.sty @@ -1,25 +0,0 @@ -%% Style file for postscript document - -\usepackage{mtt} % Common stuff - -% Figure definition -\newcommand{\fig}[4]{ - \begin{figure}[htbp] - \begin{center} - \fbox{ - \pdfimage width #3\linewidth {#1.pdf} - %\includegraphics[width=#3\linewidth]{#1.ps} - } - \caption{#4} - \label{fig:#2} - \end{center} - \end{figure} - } - -% Hyper stuff -\usepackage[implicit=true, - bookmarks=true, - pdfauthor={MTT}, - pdftitle={MTT report}, - pdfsubject={MTT}, - pdfkeywords={MTT, bond graphs}]{hyperref} DELETED mttroot/mtt/bin/trans/mtt_pinclude Index: mttroot/mtt/bin/trans/mtt_pinclude ================================================================== --- mttroot/mtt/bin/trans/mtt_pinclude +++ mttroot/mtt/bin/trans/mtt_pinclude @@ -1,27 +0,0 @@ -#!/bin/sh -# pinclude - explicitly includes Pascal files - p2c has probs. doing this - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:56:46 peterg -## Put under RCS -## -############################################################### - - - -gawk ' { - if ( (match($1,"{\\$I")>0) || (match($1,"\\*\\$I")>0) ) { - sub(/}/,"",$2); - command=sprintf("mtt_pinclude %s",$2); - system(command) - } - else{ - print $0 - } - - -}' <$1 DELETED mttroot/mtt/bin/trans/mtt_prepend.sh Index: mttroot/mtt/bin/trans/mtt_prepend.sh ================================================================== --- mttroot/mtt/bin/trans/mtt_prepend.sh +++ mttroot/mtt/bin/trans/mtt_prepend.sh @@ -1,60 +0,0 @@ -#! /bin/sh - -usage () -{ -cat < $tmp - -if [ ${preserve:=""} = "-p" ]; then - touch -r $time $tmp - rm $time -fi - -cp $preserve $tmp $file2 -rm $tmp - DELETED mttroot/mtt/bin/trans/mtt_ps.sty Index: mttroot/mtt/bin/trans/mtt_ps.sty ================================================================== --- mttroot/mtt/bin/trans/mtt_ps.sty +++ mttroot/mtt/bin/trans/mtt_ps.sty @@ -1,40 +0,0 @@ -%% Style file for postscript document - -%%\usepackage{mtt} % Common stuff (Needs to be explicit now) - -%Postscript figures -\usepackage{graphicx,color} - -% Figure definition -\newcommand{\fig}[4]{ - \begin{figure}[htbp] - \begin{center} - \fbox{ - \includegraphics[width=#3\linewidth,height=18cm,keepaspectratio]{#1.ps} - } - \caption{#4} - \label{fig:#2} - \end{center} - \end{figure} - } - - \newcommand{\tfig}[4]{ - \begin{figure}[htbp] - \begin{center} - \fbox{ - \resizebox{#3\linewidth}{!}{\input{#1}} - } - \caption{#4} - \label{fig:#2} - \end{center} - \end{figure} - } - - -% Hyper stuff -\usepackage[implicit=true, - bookmarks=true, - pdfauthor={MTT}, - pdftitle={MTT report}, - pdfsubject={MTT}, - pdfkeywords={MTT, bond graphs}]{hyperref} DELETED mttroot/mtt/bin/trans/mtt_r2m Index: mttroot/mtt/bin/trans/mtt_r2m ================================================================== --- mttroot/mtt/bin/trans/mtt_r2m +++ mttroot/mtt/bin/trans/mtt_r2m @@ -1,208 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_r2m -# Reduce to octave conversion -# Based on obsolete ode_r2m and ode_r2lang -# Based on obsolete mtt_r2m_old -# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994, Jan 95, May 1998 -# July 1998 -# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996, 1998 -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.33 2004/08/29 03:17:02 geraint -## Vectorise sesx and sesy. -## -## Revision 1.32 2003/04/17 20:07:33 geraint -## Added rule to create _sese.m -## -## Revision 1.31 2002/09/16 08:08:00 geraint -## Merged changes from global-optimisation branch. -## -## Revision 1.30.4.1 2002/09/03 23:44:43 geraint -## adding global optimisation (-optg). -## -## Revision 1.30 2002/03/26 11:59:54 geraint -## Added dummy -optimise switch to prevent falling over for -cc generation. -## -## Revision 1.29 2001/09/07 00:25:56 geraint -## Partial fix for insidious bug which eliminates lines of code when parameter -## names of the form (in* or off*) start continuation lines. -## -## Revision 1.28 2001/07/13 04:54:04 geraint -## Branch merge: numerical-algebraic-solution back to main. -## -## Revision 1.27.4.1 2001/05/04 04:07:24 geraint -## Numerical solution of algebraic equations. -## sys_ae.cc written for unsolved inputs. -## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). -## -## Revision 1.27 2001/02/08 00:39:56 geraint -## Removed clear from code generated by: mtt -c -i euler -o -## -## Revision 1.26 2000/11/27 11:52:10 peterg -## Changed some greps to be case insensitive -## -## Revision 1.25 2000/10/14 08:50:07 peterg -## Use new mtt_header -## -## Revision 1.24 2000/10/11 09:07:53 peterg -## Vectorisation -## csex rep. -## -## Revision 1.23 2000/10/10 21:00:43 peterg -## More reps added -## -## Revision 1.22 2000/09/15 08:27:07 peterg -## Removed debugging lines -## -## Revision 1.21 2000/08/30 11:43:40 peterg -## -optimise switch added -## -## Revision 1.20 2000/08/30 10:43:17 peterg -## Simplified version using GENTRAN matrix :=: matrix -## lang_matrix is no longer used at all -## -## Revision 1.19 2000/08/28 20:17:59 peterg -## Put in Winfried Neun's bug fix -## -- prevents segmentation violation using optimised gentran when matrix -## comtains a number -## -## Revision 1.18 2000/08/24 17:11:40 peterg -## Now optimises as well as segmenting - uses the SCOPE package -## -## Revision 1.17 2000/05/20 15:23:56 peterg -## Paramererised version of sm etc etc (using -parameter switch) -## -## Revision 1.16 2000/04/18 11:14:18 peterg -## Put in the -parameters option -## -## Revision 1.15 2000/02/10 14:58:57 peterg -## *** empty log message *** -## -## Revision 1.14 1999/12/08 02:06:00 peterg -## Now incudes csm rep. -## -## Revision 1.13 1999/11/23 00:59:14 peterg -## Now does ssm.m -## -## Revision 1.12 1999/11/15 22:57:20 peterg -## Removed a debugging line -## -## Revision 1.11 1999/11/01 21:20:14 peterg -## Removed the E matrix from the cse file. -## -## Revision 1.10 1999/10/27 07:38:30 peterg -## Now does cse version -- but not needed now exept for Euler integration -## -## Revision 1.9 1999/10/26 23:47:58 peterg -## Now does cse.m file -## -## Revision 1.8 1999/07/26 06:07:19 peterg -## Reinstated removal of the odeo.p file -## -## Revision 1.7 1999/03/16 00:38:06 peterg -## Done some more tidying up -## -## Revision 1.6 1999/03/15 07:29:25 peterg -## Fixed various obscure reduce bugs -## THIS NEEDS A MAJOR REWRITE!!!! -## -## Revision 1.5 1998/08/13 16:25:07 peterg -## Removed some documentation form odeo.m -## -## Revision 1.4 1998/08/13 15:10:47 peterg -## Change temp var name to mtt_t1 etc -## -## Revision 1.3 1998/08/13 12:43:19 peterg -## Cahnged tmp variable to mtt_1 etc -## -## Revision 1.2 1998/07/27 20:26:44 peterg -## Put in correct N and M values for dm rep -## -## Revision 1.1 1998/07/27 16:30:26 peterg -## Initial revision -## -############################################################### - - -# Args -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -noglobals) - noglobals='-noglobals'; - ;; - -parameters) - parameters='-parameters'; - par='mttpar' - ;; - -optimise_local | -optimise_global ) - ;; - *) - echo $1 is an unknown option - exit;; - esac - shift -done - -# Set up some strings -rep=$2 -ext=m -out=$1"_"$rep.$ext - -#Inform user -echo Creating $out - -# Remove the old log file -rm -f mtt_r2m.log - -#Header -case $rep in - ae|csex|cseo|ode|odeo|sae|sese|sesx|sesy) - vectorise=yes - ;; - *) -esac - - mtt_header $1 $rep $ext > mtt_junk - -#Convert from the (optimised) r file -echo >> mtt_junk -echo '## Code' >> mtt_junk -strip_comments<$1_$2.r |\ -tr [A-Z] [a-z] |\ -grep -vi 'MATRIX ' |\ -grep -vi 'END;' |\ -grep -vi 'clear mtt' |\ -grep -v '^off .*\$' |\ -grep -v '^in .*\$' |\ -sed \ - -e "s/^mtt/ mtt/" \ - -e "s/:=/=/" \ - -e "s/\\$/;/" \ - >> mtt_junk -echo '## END Code' >> mtt_junk -echo endfunction >> mtt_junk - -# Mend broken lines -mtt_mend_lines < mtt_junk > mtt_junk_mended -# Vectorise (n,1) arrays when appropriate -if [ -n "$vectorise" ]; then - mtt_vectorise $out -else - mv mtt_junk_mended $out -fi - -# Now invoke the standard error handling. -#mtt_error_r mtt_r2m.log - - - DELETED mttroot/mtt/bin/trans/mtt_remove_underscore Index: mttroot/mtt/bin/trans/mtt_remove_underscore ================================================================== --- mttroot/mtt/bin/trans/mtt_remove_underscore +++ mttroot/mtt/bin/trans/mtt_remove_underscore @@ -1,3 +0,0 @@ -#!/bin/sh - -sed 's/_/\\_/g' DELETED mttroot/mtt/bin/trans/mtt_repname Index: mttroot/mtt/bin/trans/mtt_repname ================================================================== --- mttroot/mtt/bin/trans/mtt_repname +++ mttroot/mtt/bin/trans/mtt_repname @@ -1,14 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_repname - -# Returns the representation name from System_rep.lang - -# P.J.Gawthrop Feb 2000 -# Copyright (C) 2000 by Peter J. Gawthrop - -echo $1 | tr '.' '_' | gawk -F '_' '{print $2}' DELETED mttroot/mtt/bin/trans/mtt_strip_args Index: mttroot/mtt/bin/trans/mtt_strip_args ================================================================== --- mttroot/mtt/bin/trans/mtt_strip_args +++ mttroot/mtt/bin/trans/mtt_strip_args @@ -1,81 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: strip args -# Strips unwanted bits from a list of arguments -# Label file to symbolic parameters conversion -# Copyright (C) 2000 by Peter J. Gawthrop - -## $Id$ ## -## $Log$ -## Revision 1.6 2001/07/04 06:00:12 gawthrop -## Fixed a funny with tr - changed SEPS and REPS - something to do with ^ -## -## Revision 1.5 2001/06/13 14:50:13 gawthrop -## Operator ^ now ok in args in abg and/or lbl -## -## Revision 1.4 2001/05/08 15:18:10 gawthrop -## Added trig and hyperbolic functions to argument exclusion list -## -## Revision 1.3 2000/10/17 12:33:13 peterg -## Added mtt_mod to the zapped list -## -## Revision 1.2 2000/10/16 09:06:26 peterg -## Write out the system as a second columns as well -## -## Revision 1.1 2000/10/16 09:04:04 peterg -## Initial revision -## ## -# Inform user -#echo "Creating $1_sympar.txt" - -# Separation characters -SEPS='^=*;+/()-' -# Replace by , -REPS='[,*]' - - -# This is the main transformation using gawk -tr $SEPS $REPS | \ -gawk ' -function exact_match(name1, name2) { - return ((match(name1,name2)>0)&&(length(name1)==length(name2))) -} - -function matches(names, name) { - n_matches = split(names,match_name); - matched = 0; - for (i_matches = 1; i_matches <= n_matches; i_matches++) { - if ( exact_match(name,match_name[i_matches]) ) { - matched = 1; - break; - } - } - return matched; -} - -BEGIN { - not_an_arg = "effort flow state internal external zero unknown\ - mtt_e mtt_f\ - sqrt exp log sign sin asin cos acos tan atan \ - sin asin cos acos tan atan \ - sinh asinh cosh acosh tanh atanh \ - none abs"; -} -{ - args=$1 - sys=$2 - N=split(args, arg, ","); - for (i=1;i<=N;i++){ - if ( (length(arg[i])>0)&&(matches(not_an_arg,arg[i])==0)&&(match(arg[i],"^[0-9]+[.]*")==0) ){ - printf("%s\t%s\n", arg[i], sys); - } - } -}' |\ -grep -v '^\$' - - - DELETED mttroot/mtt/bin/trans/mtt_sysname Index: mttroot/mtt/bin/trans/mtt_sysname ================================================================== --- mttroot/mtt/bin/trans/mtt_sysname +++ mttroot/mtt/bin/trans/mtt_sysname @@ -1,14 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_sysname - -# Returns the system name from System_rep.lang - -# P.J.Gawthrop Feb 2000 -# Copyright (C) 2000 by Peter J. Gawthrop - -echo $1 | gawk -F '_' '{print $1}' DELETED mttroot/mtt/bin/trans/mtt_txt2declare Index: mttroot/mtt/bin/trans/mtt_txt2declare ================================================================== --- mttroot/mtt/bin/trans/mtt_txt2declare +++ mttroot/mtt/bin/trans/mtt_txt2declare @@ -1,78 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar_txt2declare - -# Symbolic parameters to variable declaration -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2000/10/14 09:32:50 peterg -## struc version only does state and input -## -## Revision 1.1 2000/10/14 09:26:48 peterg -## Initial revision -## -## Revision 1.1 2000/10/11 09:08:20 peterg -## Initial revision -## - -############################################################### - -sys=$1 -what=$2 -language=$3 - -case $language in - p) - first="VAR"; - delim=", "; - last=': REAL;'; - ;; - *) - echo Language $language not supported - sorry; exit 1 -esac - -case $what in - struc) - strip_comments < $sys"_"$what".txt" | gawk '{if (($1=="state")||($1=="input")) - print $4; - }' >mtt_names - ;; - sympar) - strip_comments < $sys"_"$what".txt" | gawk '{print $1}' >mtt_names - ;; - *) - echo Argument 2 must be struc or sympar -esac - -# Start -cat<4){ - printf("\n"); j=0; - } - } - printf("%s%s\n",var[n], last); - -}' "delim=$delim" "last=$last" mtt_names - - DELETED mttroot/mtt/bin/trans/mtt_txt2m Index: mttroot/mtt/bin/trans/mtt_txt2m ================================================================== --- mttroot/mtt/bin/trans/mtt_txt2m +++ mttroot/mtt/bin/trans/mtt_txt2m @@ -1,292 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_txt2m -# Converts txt file to matlab file (for numpar and state) - -# Copyright (c) P.J.Gawthrop 1998 - - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.17 2002/04/28 18:41:27 geraint -# %% Fixed [ 549658 ] awk should be gawk. -# %% Replaced calls to awk with call to gawk. -# %% -# %% Revision 1.16 2002/04/18 17:51:11 gawthrop -# %% Put default values in _simpar.m in case of missing values in txt file -# %% -# %% Revision 1.15 2002/03/26 12:00:37 geraint -# %% Escaped characters to eliminate awk warnings. -# %% -# %% Revision 1.14 2001/07/13 04:54:04 geraint -# %% Branch merge: numerical-algebraic-solution back to main. -# %% -# %% Revision 1.13.4.2 2001/07/09 00:24:58 geraint -# %% input rep: Removed input name mapping, left state name mapping. -# %% -# %% Revision 1.13.4.1 2001/06/26 01:01:28 geraint -# %% Makes input and state names available for input rep. -# %% -# %% Revision 1.13 2001/02/05 03:33:18 geraint -# %% Convert user-defined txt to lower-case in translation. -# %% Required by logic.m (Octave is case sensitive). -# %% -# %% Revision 1.12 2000/11/08 11:20:49 peterg -# %% removed the empty matrix stuff -# %% -# %% Revision 1.11 2000/10/17 09:55:21 peterg -# %% Added logic rep -# %% -# %% Revision 1.10 2000/10/15 09:51:50 peterg -# %% Set array code in input rep -# %% -# %% Revision 1.9 2000/10/13 11:07:33 peterg -# %% Started conversion to new style state, input ext -# %% -# %% Revision 1.8 2000/09/30 13:53:07 peterg -# %% Default to empty matix in numpar.m -- avoids probs for parameter-free systems -# %% -# %% Revision 1.7 2000/05/19 17:46:17 peterg -# %% Give argument to state -# %% -# %% Revision 1.6 2000/05/19 14:59:03 peterg -# %% MTT --> mtt in fun output -# %% -# %% Revision 1.5 2000/05/19 14:05:10 peterg -# %% Zero parameters in the numpar.m file -# %% -# %% Revision 1.4 2000/05/18 12:05:42 peterg -# %% Replaced sympar by sympars in numpar rep -# %% -# %% Revision 1.3 2000/05/11 16:09:24 peterg -# %% Put in simpar.first parameter -# %% -# %% Revision 1.2 2000/05/11 12:16:46 peterg -# %% New version of simpar - with record -# %% -# %% Revision 1.1 2000/05/11 10:55:57 peterg -# %% Initial revision -# %% -# %% Revision 1.19 2000/02/11 13:35:16 peterg -# %% Added the new MTTpar generation -# %% -# %% Revision 1.18 1999/11/14 22:22:17 peterg -# %% Removed checks for implicit - now done at command-line level. -# %% -# %% Revision 1.17 1999/11/04 04:54:24 peterg -# %% Removed recreation of smx file. -# %% -# %% Revision 1.16 1999/03/06 02:18:10 peterg -# %% Changed argument list. -# %% -# %% Revision 1.15 1999/02/16 21:44:38 peterg -# %% Revised smx generation -# %% -# %% Revision 1.14 1999/02/16 04:38:22 peterg -# %% Now forces creation of _smx file if METHOD=IMPLICIT in simpar.txt -# %% -# %% Revision 1.13 1998/08/31 11:43:37 peterg -# %% Now lower cases globals in numpar files -# %% -# %% Revision 1.12 1998/08/14 10:47:31 peterg -# %% Put ImplicitS sub before Implicit!! -# %% -# %% Revision 1.11 1998/08/14 10:43:44 peterg -# %% Added ImplicitS - sparse integration -# %% -# %% Revision 1.10 1998/08/11 13:27:51 peterg -# %% Lowercase mttLAST etc -# %% -# %% Revision 1.9 1998/07/30 15:07:17 peterg -# %% Added _ to the disallowed chars around t -# %% -# %% Revision 1.8 1998/07/30 12:52:38 peterg -# %% Adds ; to end of statements -# %% Translates ' to " before removal -# %% -# %% Revision 1.7 1998/07/30 09:32:33 peterg -# %% Replaces: -# %% euler by 1 -# %% implicitl by 1 -# %% implicit by 3 -# %% -# %% Revision 1.6 1998/07/27 18:59:11 peterg -# %% Added WMIN etc -# %% -# %% Revision 1.5 1998/07/26 11:54:20 peterg -# %% Added mtt to variables -# %% -# %% Revision 1.4 1998/07/26 09:50:12 peterg -# %% More forgiving of txt sytax. -# %% -# %% -- can use () or () -# %% -- can use mttx() or x() -# %% -- can use mttu() or u() -# %% -# %% Revision 1.3 1998/07/25 20:40:35 peterg -# %% All vars in lower case now -# %% -# %% Revision 1.2 1998/07/25 09:48:31 peterg -# %% Tidied up for Pascal version -# %% -# %% Revision 1.1 1998/02/25 22:10:25 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -system=$1 -representation=$2 -outfile=$1_$2.m - -tolower () { tr [A-Z] [a-z] ;} - -# Inform user -echo Creating $outfile - -#Create the rep file complete with headers. -case $representation in - input) - name=mttu - arraycode=$representation - ;; - logic) - name=mttx - ;; - numpar) - name=mttpar - arraycode=$representation - ;; - simpar) - ;; - state) - name=mttx - arraycode=$representation - ;; - *) - echo Representation $representation not supported - exit - #echo "function $name = $1_$2$arg" > $outfile - #echo "%% $2 file ($1_$2.m)" >> $outfile - #echo "%% Generated by MTT at `date`" >> $outfile - #echo "% Global variable list" >> $outfile - #sympar2global_txt2m $1 >> $outfile - ;; -esac - -# Generate the header -mtt_header $system $representation m > $outfile - -## Special for logic rep -if [ "$representation" = "logic" ]; then - echo >> $outfile - echo "## Inputs" >> $outfile - mtt_name2array $system input >> $outfile # Set up input by name - echo >> $outfile - echo "## States" >>$outfile - mtt_name2array $system state >> $outfile # Set up state by name -fi - -## Special for input rep -if [ "$representation" = "input" ]; then - echo >> $outfile - echo "## States" >>$outfile - mtt_name2array $system state >> $outfile # Set up state by name -fi - -## Special for simpar rep -if [ "$representation" = "simpar" ]; then - cat >> $outfile<> $outfile -echo "## User defined code from $1_$2.txt" >> $outfile -cat $1_$2.txt | strip_comments | grep -v METHOD |\ -gawk -F# 'BEGIN{ -quote = "\047"; -doublequote = "\042"; -} -{ - N=split($1,a,"="); - if (N==2) { - LHS = a[1]; - RHS = a[2]; - gsub(quote, doublequote, RHS); - sub(/^[ ]*FIRST/, "MTTsimpar.FIRST", LHS); - sub(/^[ ]*DT/, "MTTsimpar.DT", LHS); - sub(/^[ ]*LAST/, "MTTsimpar.LAST", LHS); - sub(/^[ ]*STEPFACTOR/, "MTTsimpar.STEPFACTOR", LHS); - sub(/^[ ]*METHOD/, "MTTsimpar.METHOD", LHS); - sub(/^[ ]*WMIN/, "MTTsimpar.WMIN", LHS); - sub(/^[ ]*WMAX/, "MTTsimpar.WMAX", LHS); - sub(/^[ ]*WSTEPS/, "MTTsimpar.WSTEPS", LHS); - sub(/^[ ]*INPUT/, "MTTsimpar.input", LHS); - LHS = tolower(LHS); - RHS = tolower(RHS); - sub(/["]*euler["]*/, 1, RHS); - sub(/["]*implicit["]*/, 2, RHS); - statement = sprintf("%s= %s",LHS,RHS); - if ( (match(statement,";")==0)&&\ - ((match(statement,"if ")==0))&&\ - ((match(statement,"for ")==0)) ) - statement = sprintf("%s;", statement); - } - else if (match($1,"global")==1) { - statement = tolower($1); # Lower case globals as well - } - else - statement = $1; - - if (NF<2) print " " statement - if (NF>1) print statement " # " $2 -}' | sed\ - -e 's/\[\([0-9]*\)\]/(\1)/g' \ - -e 's/\([^a-zA-Z_0-9]\)t\([^a-zA-Z_0-9]\)/\1mttt\2/g' \ - -e 's/\([^a-zA-Z_0-9]\)x(/\1mttx(/g' \ - -e 's/\([^a-zA-Z_0-9]\)u(/\1mttu(/g' \ - -e 's/mttmtt/mtt/g' \ -| tolower >> $outfile - -if [ -n "$arraycode" ]; then - new_style=`strip_comments < $1_$2.txt| grep "$name(">/dev/null; echo $?` - - if [ "$new_style" = "1" ]; then - echo >> $outfile - echo " ## Set up the $name vector" >> $outfile - ## echo " $name = []; # Default to empty matrix (Remove in mtt_m2p)" >> $outfile - mtt_name2array $1 $arraycode set >> $outfile - else - echo "Old-style file detected: not creating array translations" - fi -fi - -## Special for logic rep -if [ "$representation" = "logic" ]; then - echo >> $outfile - echo "## Open switches" >> $outfile - switch_txt2m $system | tolower >> $outfile -fi - -# End of the function -echo '## END Code' >> $outfile -echo 'endfunction' >> $outfile - DELETED mttroot/mtt/bin/trans/mtt_uncompress.sh Index: mttroot/mtt/bin/trans/mtt_uncompress.sh ================================================================== --- mttroot/mtt/bin/trans/mtt_uncompress.sh +++ mttroot/mtt/bin/trans/mtt_uncompress.sh @@ -1,12 +0,0 @@ -#! /bin/sh - -file=$1 - -gzip --test --quiet $file 2> /dev/null ; file_is_uncompressed=$? - -if [ $file_is_uncompressed -eq 0 ]; then - gz=`mktemp $file.gz.tmpXXXXXX` - mv $file $gz - zcat $gz > $file -fi - DELETED mttroot/mtt/bin/trans/mtt_units.sh Index: mttroot/mtt/bin/trans/mtt_units.sh ================================================================== --- mttroot/mtt/bin/trans/mtt_units.sh +++ mttroot/mtt/bin/trans/mtt_units.sh @@ -1,58 +0,0 @@ -#!/bin/sh - -## MTT units script - wrapper for the units program. - -# Copyright (C) 2000 by Peter J. Gawthrop - -# Arguments -sys=$1 -port=$2 -domain=$3 -effort=$4 -flow=$5 - -case ${domain} in - electrical) - base_effort=volt - base_flow=amp - ;; - translational) - base_effort='newton' - base_flow='m/s' - ;; - rotational) - base_effort='newton*m' - base_flow='radian/s' - ;; - fluid) - base_effort='Pa' - base_flow='m^3/s' - ;; - thermal) - base_effort='degK' - base_flow='watt/degK' - - ;; - *) - echo ${sys} ${port} DOMAIN_ERROR invalid domain ${domain} - exit 1 -esac - -get_unit() -{ - if [ "$2" == "none" ]; then - echo 1 - else - factor=`units $2 $3 | head -1 | sed 's/\*//'` - if [ `echo $factor | wc -w` = "1" ]; then - echo $factor - else - echo $1_UNIT_ERROR unit $2 not compatible with domain ${domain} - fi - fi -} -## Check effort and flow for comptability + find factor -effort_factor=`get_unit EFFORT $effort $base_effort` -flow_factor=`get_unit FLOW $flow $base_flow` - -echo ${sys} ${port} ${effort_factor} ${flow_factor} DELETED mttroot/mtt/bin/trans/mtt_update Index: mttroot/mtt/bin/trans/mtt_update ================================================================== --- mttroot/mtt/bin/trans/mtt_update +++ mttroot/mtt/bin/trans/mtt_update @@ -1,309 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: mtt_update -# Generates Updates core representations -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.23 2005/02/17 18:54:23 geraint -## Fixed a bash-sim: replaced let with $(( )) -## -## Revision 1.22 2003/08/19 13:08:44 gawthrop -## Ingnore if/endif -## -## Revision 1.21 2003/08/14 10:33:46 gawthrop -## Ignore if and endif -## -## Revision 1.20 2003/08/13 15:49:39 gawthrop -## Don't sort the states when defaulting - leave in implied order -## -## Revision 1.19 2003/08/05 15:29:36 gawthrop -## Now handles ss.r files with implicit zero values -## -## Revision 1.18 2003/08/04 09:10:30 gawthrop -## Now handles steady-state computation for _state.txt. -## -## Revision 1.17 2002/04/28 18:41:27 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.16 2000/10/17 13:45:18 peterg -## split up state and input - different defaults -## -## Revision 1.15 2000/10/17 09:53:05 peterg -## More on logic rep -## -## Revision 1.14 2000/10/17 08:36:56 peterg -## Included logic rep. -## -## Revision 1.13 2000/10/15 09:27:13 peterg -## Better way of generating $infofile -## -## Revision 1.12 2000/10/14 16:11:00 peterg -## Made all variables, states etc lower case -## -## Revision 1.11 2000/10/13 11:07:00 peterg -## Added initialisation for state and input -## -## Revision 1.10 2000/10/13 10:56:07 peterg -## Now uses the full name from the struc file - no need to recreate. -## -## Revision 1.9 2000/10/13 09:55:09 peterg -## Changed state/input name to $4_$3 -## -## Revision 1.8 2000/10/13 09:28:16 peterg -## Changed regexp to /\(.*$old.*=\)/ -## -## Revision 1.7 2000/10/13 08:56:51 peterg -## Output variables as column, not row. -## -## Revision 1.6 2000/10/13 08:07:24 peterg -## Added state and input - it checks against sympar as well so that -## defined variables may be used here. -## -## Revision 1.5 2000/10/12 19:24:55 peterg -## Corrected output message -## -## Revision 1.4 2000/10/12 17:57:34 peterg -## Fixed header typos -## -## Revision 1.3 2000/10/12 15:11:30 peterg -## Added the update switch -## -## Revision 1.2 2000/10/12 13:45:13 peterg -## Put in the no-file version -## -## Revision 1.1 2000/10/12 12:32:23 peterg -## Initial revision -## -## -############################################################### - - -sys=$1 # System name -rep=$2 # System representation -update=$3 # Update or not -date=`date` - -if [ -z "$2" ]; then - echo Usage mtt_update system representation [update] - exit -fi - -## Extract initial value from steady-state information -initial_value() { - i=$1 - default=$2 - ssfile=${sys}_ss.r - if [ "${rep}" = "state" ]; then - if [ -f "${ssfile}" ]; then - count=`grep -c "^MTTx($i" ${ssfile}`; # See if its there - if [ $count = "1" ]; then - value=`grep "^MTTx($i" ${ssfile}| sed 's/ //g' | gawk -F '=' '{print substr($2,1,length($2)-2)}'` - else - value="0.0" - fi - else - value=${default} - fi - else - value=${default} - fi -} - -## Remove if, end and endif from list -remove_if() { - file=$1 - if [ -f ${file} ]; then - tmpfile="$1_tmp" - - mv ${file} ${tmpfile} - grep -v 'if[ (]\|endif;' <${tmpfile} > ${file} - - ## Delete empty file - size=`ls -s ${file} | awk '{print $1}'` - if [ "${size}" = "0" ]; then - rm $file - fi - fi - } - rm -f mtt_empty - touch mtt_empty - - case $rep in - numpar) - lang=txt - textfile=$1_$2.$lang - infofile=$1_sympar.$lang - moreinfofile=$infofile - default='1.0' - ;; - input) - lang=txt - textfile=$1_$2.$lang - infofile=mtt_list.$lang - moreinfofile=mtt_list_numpar.$lang - gawk '{if ($1==rep) printf("%s\n", $4)}' rep=$2 \ - <$1_struc.txt >$infofile - cat $infofile $1_sympar.$lang> $moreinfofile - default='1.0' - ;; - state) - lang=txt - textfile=$1_$2.$lang - infofile=mtt_list.$lang - moreinfofile=mtt_list_numpar.$lang - gawk '{if ($1==rep) printf("%s\n", $4)}' rep=$2 \ - <$1_struc.txt >$infofile - cat $infofile $1_sympar.$lang> $moreinfofile - default='0.0' - ;; - logic) - lang=txt - textfile=$1_$2.$lang - infofile=mtt_list.$lang - moreinfofile=mtt_list_numpar.$lang - gawk '{if ($3=="MTT_SWITCH") printf("%s_logic\n", $4)}' rep=$2 \ - <$1_struc.txt >$infofile - cat $infofile $1_sympar.$lang> $moreinfofile - default='1.0' - ;; - *) - echo Representation $rep not implemented - exit - esac - - # Create a string containing the variables - if [ -f "$textfile" ]; then - # Inform User - echo Checking $textfile - else - echo Creating $textfile - mtt_header $sys $rep $lang > $textfile - if [ "${rep}" = "state" ]; then - info=`cut -f1 $infofile` # No sort - else - info=`cut -f1 $infofile | sort` # Sort - fi - i=0; - for new in $info; do - i=$(( $i + 1 )); - initial_value $i ${default} - echo $new $value |\ - gawk '{printf("%s\t= %s; # Default\n",$1,$2)}' >> $textfile - done - exit - fi - - # Remove tmp files - rm -f mtt_in_text mtt_in_info - - # Strip files - strip_comments <$textfile | tr 'A-Z' 'a-z' >mtt_text - strip_comments <$infofile | tr 'A-Z' 'a-z' >mtt_info - strip_comments <$moreinfofile | tr 'A-Z' 'a-z' >mtt_moreinfo - - # Use awk to check file - gawk '{ - if (FILENAME=="mtt_text") { - gsub("[\t ]" ,""); # Remove whitespace - split($0,a,"="); - text[a[1]] = a[2]; - } - if (FILENAME=="mtt_info"){ - info[$1] = Default; - } - if (FILENAME=="mtt_moreinfo"){ - moreinfo[$1] = Default; - } - } - END{ - # for (iname in info) print iname - for (tname in text) { - if (!(tname in moreinfo)) print tname >> "mtt_in_text" - } - for (iname in info) { - if (!(iname in text)) print iname >> "mtt_in_info" - } - }' Default=$default mtt_text mtt_info mtt_moreinfo - - ## Remove if, end and endif from list - remove_if mtt_in_text - -if [ -z "$update" ]; then - if [ -f "mtt_in_text" ]; then - echo "The following variables are defined in $textfile, but do not exist:" - sort mtt_in_text | gawk '{printf("\t%s\n",$1)}' - echo Use mtt $sys $rep $lang to update - fi - if [ -f "mtt_in_info" ]; then - echo "The following variables exist, but are not defined in $textfile:" - sort mtt_in_info | gawk '{printf("\t%s\n",$1)}' - echo Use mtt $sys $rep $lang to update - fi - exit -fi -answered='' -if [ -f "mtt_in_text" ]; then - in_text=`sort mtt_in_text` - echo "The following variables are defined in $textfile, but do not exist:" - sort mtt_in_text | gawk '{printf("\t%s\n",$1)}' - - - while [ -z "$answered" ]; do - echo "Update $textfile (y/n)?" - read answer < /dev/tty - case $answer in - y) - answered=yes - for old in $in_text; do - echo Commenting out $old - sed "s/\(.*$old.*=\)/## Removed by MTT on $date: \1/I"\ - <$textfile > mtt_tmp - mv mtt_tmp $textfile - changed=yes - done - ;; - n) - answered=yes - ;; - *) - esac - done -fi - -answered='' -if [ -f "mtt_in_info" ]; then - echo "The following variables exist, but are not defined in $textfile:" - sort mtt_in_info | gawk '{printf("\t%s\n",$1)}' - - while [ -z "$answered" ]; do - echo "Update $textfile (y/n)?" - read answer < /dev/tty - case $answer in - y) - answered=yes - in_info=`sort mtt_in_info` - for new in $in_info; do - echo Adding $new - echo $new $default |\ - gawk '{printf("%s\t= %s; # Added by MTT on %s\n",$1,$2,strftime())}'\ - >> $textfile - changed=yes - done - ;; - n) - answered=yes - ;; - *) - esac - done -fi DELETED mttroot/mtt/bin/trans/mtt_vectorise Index: mttroot/mtt/bin/trans/mtt_vectorise ================================================================== --- mttroot/mtt/bin/trans/mtt_vectorise +++ mttroot/mtt/bin/trans/mtt_vectorise @@ -1,7 +0,0 @@ -#!/bin/sh -# Vectorises the matrix output of reduce ie converts (n,1) to (n) -# Copyright (C) 2000 by Peter J. Gawthrop - -sed 's/mtt\([a-z]*\)(\([0-9]*\),1)/mtt\1(\2)/g' - - DELETED mttroot/mtt/bin/trans/multi_command Index: mttroot/mtt/bin/trans/multi_command ================================================================== --- mttroot/mtt/bin/trans/multi_command +++ mttroot/mtt/bin/trans/multi_command @@ -1,32 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: multi_command - -# Copyright (c) P.J.Gawthrop 1996. - -# creates a list of commands - one for each file matching $2_*_$3 -# Each command is of the form $1 $2_*_$3 & - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2.4.1 2001/06/28 22:58:27 geraint -## Using mtt_xargs.sh to prevent Arg list too long error. -## -## Revision 1.2 1996/11/09 21:16:06 peterg -## *** empty log message *** -## -# Revision 1.1 1996/10/21 12:31:40 peterg -# Initial revision -# -############################################################### - - -(mtt_xargs.sh "ls" "$2*_$3" \ -| sed "s/\(.*_*\)$3/$1 \1$3 \&/") DELETED mttroot/mtt/bin/trans/n2m Index: mttroot/mtt/bin/trans/n2m ================================================================== --- mttroot/mtt/bin/trans/n2m +++ mttroot/mtt/bin/trans/n2m @@ -1,23 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: n2m -# Gives sting of integers from n to m (n<=m) -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -i=`expr $1 - 1` - -while [ "$i" != "$2" ]; do - i=`expr $i + 1` - echo $i -done DELETED mttroot/mtt/bin/trans/name2index Index: mttroot/mtt/bin/trans/name2index ================================================================== --- mttroot/mtt/bin/trans/name2index +++ mttroot/mtt/bin/trans/name2index @@ -1,59 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: name2index - -# Converts names to array index - -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 2000/11/27 18:06:33 peterg -## *** empty log message *** -## -## Revision 1.4 1997/12/04 22:10:18 peterg -## Handles argument list - variable names. -## -## Revision 1.3 1997/05/22 09:42:48 peterg -## Returns 0 if no names. -## -## Revision 1.2 1997/05/22 09:28:22 peterg -## Removed trailing , in output. -## -## Revision 1.1 1997/05/22 08:48:21 peterg -## Initial revision -## -############################################################### - -gawk ' -{ - name_index[$4]=$2; -} -END{ - M=split(names,xynames,":"); - if (M==0) - printf("0\n") - else - { - if (M==1) - printf("1,"); - else { - printf("%i,",name_index[xynames[1]]+1); - names=xynames[2] - } - - N=split(names,Names,","); - for (i=1; i ${outfile}_1 -%% File ${outfile} generated on `date` from ${infile} -%% All parameters replaced by numbers except for: -%% ${pars} - -EOF - -sed 's/#/%/g' < ${infile} | sed 's/=/:=/' >> ${outfile}_1 - -cat >> ${outfile}_1 < ${outfile} - -rm ${outfile}_1 - DELETED mttroot/mtt/bin/trans/numpar_txt2c Index: mttroot/mtt/bin/trans/numpar_txt2c ================================================================== --- mttroot/mtt/bin/trans/numpar_txt2c +++ mttroot/mtt/bin/trans/numpar_txt2c @@ -1,68 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: numpar_txt2c - -# Numerical parameters to c format -# P.J.Gawthrop May 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2000/12/28 12:52:13 peterg -## *** empty log message *** -## -## 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 |\ -gawk -F# '{ - if (NF<2) print $1 - if (NF>1) print $1 "/* " $2 " */" -}' | sed 's/(\([0-9]*\))/[\1]/' >> $1_numpar.c - -echo '}' >> $1_numpar.c - - DELETED mttroot/mtt/bin/trans/numpar_txt2m Index: mttroot/mtt/bin/trans/numpar_txt2m ================================================================== --- mttroot/mtt/bin/trans/numpar_txt2m +++ mttroot/mtt/bin/trans/numpar_txt2m @@ -1,49 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: numpar_txt2m -# Creates the deafault numerical parameters file for the system (txt) - -# Copyright (c) P.J.Gawthrop 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 2000/12/28 12:52:22 peterg -## *** empty log message *** -## -## 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. -gawk -F# '{ - if (NF==1) print $1 - if (NF==2) print $1 "# " $2 -}' $1_numpar.txt |\ -sed 's/double/global/' >> $1_numpar.m - - DELETED mttroot/mtt/bin/trans/obs_r2m Index: mttroot/mtt/bin/trans/obs_r2m ================================================================== --- mttroot/mtt/bin/trans/obs_r2m +++ mttroot/mtt/bin/trans/obs_r2m @@ -1,136 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: obs_r2m -# Reduce GPC obs function to matlab -# P.J.Gawthrop 18 May 1991, 12 Jan 1994, April 1994, Dec 1994, July 1995 -# Copyright (c) P.J.Gawthrop 1991, 1994. - -# Inform user -echo Creating $1_obs.m - -# Remove the old log file -rm -f obs_r2m.log -rm -f $1_obs.m? -rm -f $1_obsa.m - -# Is the system affine (look in the _obs.r file -affine=`grep 'affine :=' $1_obs.r | gawk '{print $3}' | sed 's/;//'` - - -# Use reduce to accomplish the transformation -$SYMBOLIC >obs_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; - -%Set default values - reset by obspar file. -MTTGPCNy := 2; -MTTGPCNu := 0; - -%Read the parameters file -in "$1_obspar.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the reduce state-space equations file -in "$1_obs.r"; - - -ON BigFloat, NumVal; -PRECISION 16; %Compatible with Matlab -OFF Nat; - -ON NERO; % Suppress zero elements - -% Matrix output function -in"$MTTPATH/trans/matlab_matrix.r"; - -OUT "$1_obs.m2"; - -write "% Set up the State variables"; -FOR i := 1:MTTNx DO -BEGIN - write "mttx", i, " = x(", i, ");"; -END; - -IF affine=0 THEN -BEGIN -write "%"; -write "% Set up the inputs and input derivatives"; -FOR i := 1:MTTNu DO - BEGIN - write "mttu", i, " = u(", i, ",1);"; - FOR j := 1:MTTGPCNu DO - BEGIN - write "mttu", i,j, " = u(", i, ",", j+1, ");"; - END; - END; - -%write "%"; -%write "% Set up the Y matrix"; -%write "Y = zeros(", mtt_matrix_n, ",1);"; -END; - - -SHUT "$1_obs.m2"; - -IF affine=1 THEN -BEGIN - GENTRANOUT "$1_obs.m3"; - MTT_Matrix := MTTObs_o$ - MTT_Matrix_name := "MTTO_o"$ - MTT_Matrix_n := (MTTGPCNY+1)*MTTNy$ - MTT_Matrix_m := 1$ - matlab_Matrix()$ - GENTRAN O_o := mtt_matrix; - - MTT_Matrix := MTTObs_h$ - MTT_Matrix_name := "MTTO_h"$ - MTT_Matrix_n := (MTTGPCNy+1)*MTTNy$ - MTT_Matrix_m := (MTTGPCNu+1)*MTTNu$ - matlab_Matrix()$ - GENTRAN O_h := mtt_matrix; - - GENTRANSHUT "$1_obs.m3"; -END -ELSE -BEGIN - GENTRANOUT "$1_obs.m3"; - mtt_matrix := MTTYY$ - mtt_matrix_n := MTTNY*(MTTGPCNy+1)$ - mtt_matrix_m := 1$ - mtt_matrix_name := Y$ - matlab_matrix(); - GENTRAN YY := mtt_matrix; - GENTRANSHUT "$1_obs.m3"; -END; - -EOF - -if [ "$affine" = "1" ]; then - lang_header $1 obs m x [o_o,o_h] > $1_obs.m1 -else - lang_header $1 obs m x,u yy > $1_obs.m1 -fi - -# Put together the pieces -matlab_tidy $1_obs.m2 -matlab_tidy $1_obs.m3 -cat $1_obs.m? >$1_obs.m - -rm -f $1_obs.m? - - - - - - - DELETED mttroot/mtt/bin/trans/obs_r2tex Index: mttroot/mtt/bin/trans/obs_r2tex ================================================================== --- mttroot/mtt/bin/trans/obs_r2tex +++ mttroot/mtt/bin/trans/obs_r2tex @@ -1,92 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: obs_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.1 1998/04/07 08:30:20 peterg -## Initial revision -## -# 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_obs.tex - -# Remove the old log file -rm -f obs_r2tex.log - -# Use reduce to accomplish the transformation -reduce >obs_r2tex.log << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the obs file -in "$1_obs.r"; - -%Read the Obs function parameters -in "$1_obspar.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification parameters -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; -OFF EXP; - -OUT "$1_obs.tex"; - -% Write the affine form -IF affine=1 THEN -BEGIN - MTT_Matrix := MTTObs_o$ - MTT_Matrix_name := "MTTO_o"$ - MTT_Matrix_n := (MTTGPCNY+1)*MTTNy$ - MTT_Matrix_m := 1$ - LaTeX_Matrix()$ - - MTT_Matrix := MTTObs_h$ - MTT_Matrix_name := "MTTO_h"$ - MTT_Matrix_n := (MTTGPCNy+1)*MTTNy$ - MTT_Matrix_m := (MTTGPCNu+1)*MTTNu$ - LaTeX_Matrix()$ -END -ELSE -BEGIN -% Write the obs vector (YY) - MTT_Matrix := MTTYY$ - MTT_Matrix_name := "MTTO"$ - MTT_Matrix_n := (MTTGPCNY+1)*MTTNy$ - MTT_Matrix_m := 1$ - LaTeX_Matrix()$ -END; - -SHUT "$1_obs.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/octave_ode2odes Index: mttroot/mtt/bin/trans/octave_ode2odes ================================================================== --- mttroot/mtt/bin/trans/octave_ode2odes +++ mttroot/mtt/bin/trans/octave_ode2odes @@ -1,51 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: octave_ode2odes -# Runs the Octave script $1_ode2odeso.m -# Copyright (c) P.J.Gawthrop 1999 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2005/04/26 22:52:26 geraint -## The Octave load/save -ascii option is deprecated in favour of -text -## -## Revision 1.5 2002/05/07 10:13:48 gawthrop -## Files marked by update as out of sync -## -## Revision 1.4 2001/03/30 15:13:58 gawthrop -## Rationalised simulation modes to each return mtt_data -## -## Revision 1.3 2000/05/19 17:47:56 peterg -## Agument to state -## -## Revision 1.2 2000/05/11 13:43:14 peterg -## No change -## -## Revision 1.1 1999/03/15 23:27:16 peterg -## Initial revision -## -############################################################### - - -echo Creating $1_odes.dat2 -$MATRIX <octave_ode2odes.log 2>mtt_error.txt - ## Set up the simulation parameters - par = $1_numpar; - x_0 = $1_state(par); - simpar = $1_simpar - mtt_data = $1_ode2odes(x_0,par,simpar); - if iscomplex(mtt_data) - mtt_error("octave_ode2odes: Simulated data is complex - something is wrong!"); - mtt_data = real(mtt_data); - endif; - save -text $1_odes.dat2 mtt_data -EOF - -mtt_error mtt_error.txt DELETED mttroot/mtt/bin/trans/ode2obs_r Index: mttroot/mtt/bin/trans/ode2obs_r ================================================================== --- mttroot/mtt/bin/trans/ode2obs_r +++ mttroot/mtt/bin/trans/ode2obs_r @@ -1,253 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode2obs_r -# Odrinary differential equations to observer function equations -# P.J.Gawthrop 14 June 1991, 8 Aug 1991, 2 April 1992, 14 April 1994, 28 Dec 94, -# 12th July 1995, April 1996 -# Copyright (c) P.J.Gawthrop 1991, 1992, 1994, 1995, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 1998/04/07 08:12:12 peterg -## Added affine form. -## -## Revision 1.4 1998/04/07 05:45:12 peterg -## Reverted to an older version due to untraceable bug in new version -## -## Revision 1.3 1996/08/25 10:07:05 peter -## Remove a du state ment causaing touble -## - but needs more work. -## -## Revision 1.2 1996/08/25 08:38:14 peter -## Error handling added. -## -## Revision 1.1 1996/08/25 08:37:44 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_obs.r - -# Remove the old log file -rm -f ode2obs_r.log - -# Use reduce to accomplish the transformation -reduce >ode2obs_r.log << EOF - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - - -OFF Echo; -OFF Nat; -ON NERO; - -in "$1_def.r"; -MTTdxs := MTTdX; %Save the symbolic form of dX - -%Set default values - reset by obspar file. -MTTGPCNy := 2; -MTTGPCNu := 0; - -%%in "$1_sympar.r"; -in "$1_ode.r"; -%%in "$1_simp.r"; - -% Read the obs form parameters. -in "$1_obspar.r"; - -%Create the U vector of input derivatives. -MTTNuu := (MTTGPCNu+1)*MTTNu; -MTTNuu1 := MTTGPCNu*MTTNu; - - -%FOR i := 1:MTTNu DO -% MTTUU(i,1) := MTTU(i,1); -%END; -% -%IF MTTGPCNu>0 THEN -%BEGIN -% FOR i := 1:MTTNu DO -% MTTUU(i+MTTNu,1) := MTTdU(i,1); -% END; -%END; - -MTTU := MTTU; -MTTdU := MTTdU; % ---- removed temporarily, needs def file change? - -%Create the Y vector of output derivatives. -MTTNyy := (MTTGPCNy+1)*MTTNy; -Matrix MTTYY(MTTNyy,1); - -FOR i := 1:MTTNy DO - MTTYY(i,1) := MTTY(i,1); -END; - -l := MTTNy; -FOR i := 1:MTTGPCNy DO - FOR j := 1:MTTNy DO - BEGIN - l := l+1; - MTTYY(l,1) := 0; - FOR k := 1:MTTNx DO %Derivatives wrt x - BEGIN - xk := MTTX(k,1); - MTTYY(l,1) := MTTYY(l,1) + df(MTTYY(l-MTTNy,1), xk, 1)*MTTdX(k,1); - END; - IF MTTGPCNu>0 THEN - FOR k := 1:MTTGPCNu DO %Non-zero derivatives of u - BEGIN - FOR kk := 1:MTTNu DO - BEGIN - uk := MTTUU(kk,k); - MTTYY(l,1) := MTTYY(l,1) + df(MTTYY(l,1), uk, 1)*MTTUU(1,k+1); - END; - END; - END; -END; - -%%Create O_x - derivative of YY wrt x -%Matrix MTTO_x(MTTNyy,MTTNx); -%FOR j := 1:MTTNx DO -% BEGIN -% xj := MTTX(j,1); -% FOR i := 1:MTTNyy DO -% BEGIN -% MTTO_x(i,j) := df(MTTYY(i,1), xj); -% END; -% END; - -%%Create O_u - derivative of YY wrt u (Assumes GPC Nu = 0) -%MTTNNu := (MTTGPCNu+1)*MTTNu; -%Matrix MTTO_u(MTTNyy,MTTNNu); -%FOR j := 1:MTTNNu DO -% BEGIN -% uj := MTTu(j,1); -% FOR i := 1:MTTNyy DO -% BEGIN -% MTTO_u(i,j) := df(MTTYY(i,1), uj); -% END; -% END; - - -%%Create O_uu - derivative of O_u wrt u (Assumes GPC Nu = 0) -%%This is a multi-dimensional matrix kth elements stacked sideways. -%Matrix MTTO_uu(MTTNyy,MTTNNu*MTTNNu); -%FOR k := 1:MTTNNu DO -% BEGIN -% uk := MTTu(k,1); -% FOR j := 1:MTTNNu DO -% BEGIN -% FOR i := 1:MTTNyy DO -% BEGIN -% jk := j+(k-1)*MTTNu; -% MTTO_uu(i,jk) := df(MTTO_u(i,j), uk); -% END; -% END; -% END; - -%%Create O_ux - derivative of O_u wrt x -%%This is a multi-dimensional matrix kth elements stacked sideways. -%Matrix MTTO_ux(MTTNyy,MTTNu*MTTNx); -%FOR k := 1:MTTNx DO -% BEGIN -% xk := MTTx(k,1); -% FOR j := 1:MTTNu DO -% BEGIN -% FOR i := 1:MTTNyy DO -% BEGIN -% jk := j+(k-1)*MTTNu; -% MTTO_ux(i,jk) := df(MTTO_u(i,j), xk); -% END; -% END; -% END; - - -% Try and split the obs function into affine form (O(x,u) = o(x) + h(x)u) -affine := 1; -MTTNuu := (MTTGPCNu+1)*MTTNu; -write "1 affine := ", affine, ";"; - -%IF (affine=1) THEN -%BEGIN - MATRIX MTTObs_o(MTTNyy,1); - MATRIX MTTObs_h(MTTNyy,MTTNuu); -write "2 affine := ", affine, ";"; - FOR i := 1:MTTNyy DO - BEGIN -write "3 affine := ", affine, ";"; - MTTObs_o(i,1) := MTTYY(i,1); - k := 0; - FOR j := 1:MTTNu DO - FOR jj := 0:MTTGPCNu DO - BEGIN - k := k+1; - %Expand as polynomial in u_j^[jj] - coeffs := coeff(MTTObs_o(i,1), MTTUU(j,jj+1)); - MTTObs_o(i,1) := first(coeffs); - IF length(coeffs)>1 THEN - MTTObs_h(i,k) := second(coeffs); - IF length(coeffs)>2 THEN - affine := -1; - END; - END; -%END; - - -%%Create the _obs.r file -OUT "$1_obs.r"; - -IF affine=1 THEN - write "affine := 1; % The O function is affine in u" -ELSE - write "affine := 0; % The O function is not affine in u"; - - -write "% The matrix sizes"; -write "MTTNyy := ", MTTNyy, ";"; -write "MTTNuu := ", MTTNuu, ";"; - -mtt_matrix := MTTYY$ -mtt_matrix_n := MTTNyy$ -mtt_matrix_m := 1$ -mtt_matrix_name := "MTTYY"$ -reduce_matrix(); - -IF affine=1 THEN -BEGIN - mtt_matrix := MTTObs_o$ - mtt_matrix_n := MTTNyy$ - mtt_matrix_m := 1$ - mtt_matrix_name := "MTTObs_o"$ - reduce_matrix(); - - mtt_matrix := MTTObs_h$ - mtt_matrix_n := MTTNyy$ - mtt_matrix_m := MTTNuu$ - mtt_matrix_name := "MTTObs_h"$ - reduce_matrix(); -END; - -%MTTO_x := MTTO_x; -%MTTO_u := MTTO_u; -%MTTO_uu := MTTO_uu; -%MTTO_ux := MTTO_ux; - -write ";END;"; - -SHUT "$1_obs.r"; -quit; - -EOF - -# Now invoke the standard error handling. -mtt_error_r ode2obs_r.log - DELETED mttroot/mtt/bin/trans/ode2odes_m Index: mttroot/mtt/bin/trans/ode2odes_m ================================================================== --- mttroot/mtt/bin/trans/ode2odes_m +++ mttroot/mtt/bin/trans/ode2odes_m @@ -1,229 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode2odes_m - -# Transforms descriptor matrix rep to step response - -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.17 1998/06/27 14:49:16 peterg -## No change -## -## Revision 1.16 1998/06/25 08:47:23 peterg -## Put correct arguments for _input -- (x,t) -## -## Revision 1.15 1998/05/21 16:20:27 peterg -## Modified to include explicit algebraic loop solution -## -## Revision 1.14 1998/05/19 19:48:02 peterg -## Read the simpar file now. -## -## Revision 1.13 1998/05/14 08:05:10 peterg -## Put back under RCS -## -## Revision 1.12 1998/02/25 18:02:39 peterg -## Removed the argument passing stuff . -## Replaced by the simpar.m method. -## -## Revision 1.11 1997/08/29 07:56:54 peterg -## Minor updates -## -# Revision 1.10 1997/01/07 09:16:03 peterg -# Added step_factor parameter - gives that number of integration steps -# per sample. -# -## Revision 1.9 1997/01/06 21:36:44 peterg -## Fixed bug mtt_error --> mtt_error.txt -## Replaced lsode by Euler integration. -## -## Revision 1.8 1996/09/13 17:54:08 peter -## Now writes default $PARAMS to $1_args.m - $1_ode may use it. -## -## Revision 1.7 1996/09/12 18:41:48 peter -## Standard error handling added. -## -## Revision 1.6 1996/08/24 14:11:04 peter -## Global parameter passing. -## -## Revision 1.5 1996/08/18 12:01:26 peter -## Unified format of time responses. -## -## Revision 1.4 1996/08/16 13:04:46 peter -## Fixed problem with more than one output (y vector). -## -## Revision 1.3 1996/08/16 06:36:03 peter -## Removed u from default arg list. -## -## Revision 1.2 1996/08/15 16:24:43 peter -## Uses T in place of t to avoid name clash within function. -## -## Revision 1.1 1996/08/15 11:56:38 peter -## Initial revision -## -############################################################### - -echo Creating $1_odes.m -echo Creating $1_odeso.m - -rm -f ode2odes_m.log -rm -f mtt_error.txt - -#if [ "$2" = "" ]; -#then -# PARAMS='T=[0:0.1:10]; x0=zeros(nx,1);' -# echo Using default parameter $PARAMS -# echo $PARAMS>$1_args.m -#else -# PARAMS=$2; -#fi - -# PARAMS="$PARAMS ;" - - -$MATRIX --verbose << EOF > ode2odes_m.log 2>mtt_error.txt - - %System structure - [nx,ny,nu,nz,nyz] = $1_def; - - %Read in parameters - $1_numpar; - - %Read in state - x = $1_state; - - %Set the initial output - %if ny>0 - % y = $1_odeo(x,0); - %end; - - %Read in simulation parameters - $1_simpar; - T = [0:DT:LAST]; - - t=0; %Just in case it appears in the parameter list. - - - %Defaults - if exist('T')==0 - T=[0:1:100] - end; - - if exist('METHOD')==0 - METHOD = 'Euler' - end; - - if exist('x')==0 - x = zeros(nx,1); - end; - - % xx is the composite vector containing x and the internal inputs. - xx = [x; zeros(nyz,1)]; - - [n,m]=size(T); - if m>n - T=T'; - end; - -method = tolower(METHOD) - -if nx>0 - if strcmp(method,'lsode') - X = lsode('$1_ode', x, T); - elseif strcmp(method,'euler') - %Euler integration - disp("Euler") - X=[]; - dt = (T(2)-T(1))/STEPFACTOR; - for t=T' - X = [X; xx']; - ts = t; - for i=1:STEPFACTOR - x = xx(1:nx); - u = $1_input(xx,ts); - xx = $1_ode(xx,u,ts); - ts = ts + dt; - dx = xx(1:nx); - x = x + dx*dt; - xx(1:nx) = x; - end; - end; - elseif strcmp(method,'implicitl') - %Euler integration - X=[]; - dt = (T(2)-T(1))/STEPFACTOR; - u = $1_input(x,u,t); - A = $1_smx(x,u); - inverse = inv(eye(nx) - dt*A); - for t=T' - X = [X; xx']; - ts = t; - u = $1_input(x,t); - for i=1:STEPFACTOR - x = xx(1:nx); - xx = $1_ode(xx,u,ts); - ts = ts + dt; - dx = xx(1:nx); - x = inverse*(x + dt*(dx - A*x)); - xx(1:nx) = x; - end; - end; - elseif strcmp(method,'implicit') - %Euler integration - X=[]; - dt = (T(2)-T(1))/STEPFACTOR; - One = eye(nx); - for t=T' - X = [X; xx']; - ts = t; - for i=1:STEPFACTOR - x = xx(1:nx); - u = $1_input(x,t); - A = $1_smx(x,u); - xx = $1_ode(xx,u,ts); - ts = ts + dt; - dx = xx(1:nx); - x = (One-A*dt)\(x + dt*(dx - A*x)); - xx(1:nx) = x; - end; - end; - else - error('Method %s not available here', METHOD); - return; - end; - write_matrix([T,X], '$1_odes'); -else - X = zeros(size(T)); -end; - -if ny>0 % compute y and print it - i = 0; Y=[]; - for t=T' - i = i+1; X(i,:); - u = $1_input(x,t); - y = $1_odeo(X(i,:)',u,t); - Y = [Y; y']; - end; - write_matrix([T,Y], '$1_odeso'); -end; - - -EOF - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - - - - - - DELETED mttroot/mtt/bin/trans/ode2odes_r2c Index: mttroot/mtt/bin/trans/ode2odes_r2c ================================================================== --- mttroot/mtt/bin/trans/ode2odes_r2c +++ mttroot/mtt/bin/trans/ode2odes_r2c @@ -1,269 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode2odes_r2c -# Reduce ordinary differential equations to differential-algebraic -# equations solution in the form of a c program. - -# Euler integration of the state is included. - -# NB Arrays should are defined to be one larger than expected -# - the 0 element is not used. - -# Copyright (c) P.J.Gawthrop 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.17 1998/05/15 07:47:23 peterg -## Includes sign.c by default -## -## Revision 1.16 1998/05/14 08:25:52 peterg -## Corrected time skew. -## -## Revision 1.15 1998/05/14 08:20:29 peterg -## Start time at DT - the result at time zero is computed outside the -## loop -## -## Revision 1.14 1998/05/13 08:57:27 peterg -## Now uses simpar.h in place of odes.h -## -## Revision 1.13 1998/02/24 13:34:45 peterg -## Back under RCS -## -# Revision 1.12 1997/05/15 08:39:56 peterg -# Don't initialise states - now done in numpar file. -# -# Revision 1.11 1997/05/12 16:00:54 peterg -# Removed itime again., -# -# Revision 1.10 1997/05/10 10:05:15 peterg -# Put _input in inner loop in front of call to _ode -# -## Revision 1.9 1997/05/10 09:54:34 peterg -## Moved _input call to after the inner integration loop. -## -## Revision 1.8 1997/05/10 08:12:23 peterg -## Put second argument into _input. -## -## Revision 1.7 1997/05/10 07:01:15 peterg -## _input called in outer loop only. -## time updated in outer loop only. -## Integer time (itime) introduced and updated in outer loop - maybe -## useful for discrete events. -## Integer time (itime) passed to _input. -## -## Revision 1.6 1997/05/06 13:53:32 peterg -## Now uses the preprocessor to declare sizes -- MTTNX etc -## -# Revision 1.5 1997/05/01 13:50:11 peterg -# Replaced float by double. -# -# Revision 1.4 1997/05/01 13:43:44 peterg -# Changed double to float. -# -# Revision 1.3 1997/05/01 11:15:33 peterg -# Back under RCS -# -# Revision 1.2 1997/03/20 14:36:56 peterg -# Includes the sympar.h file -# -## Revision 1.1 1997/01/21 22:54:54 peterg -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_odes.c - -# Remove the old log file -rm -f ode_r2c.log - -# Use reduce to accomplish the transformation -reduce >ode2odes_r2c.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 symbolic parameters file -%%in "$1_sympar.r"; - -ON BigFloat, NumVal; -PRECISION 16; %Compatible with Matlab -%OFF Nat; - -ON NERO; % Suppress zero elements - -%Generate the Header part -OUT "$1_odes.c"; - -write "/*"$ -write "Program to solve ode for system $1"$ -write "NB Arrays are defined to be one larger than expected"$ -write " - the 0 element is not used."$ - -write "File $1_odes.c"$ -write "Generated by MTT"$ -write "*/"$ -write " "$ - - -%Program heading -write "#define MTTNX ", MTTNx $ -write "#define MTTNY ", MTTNy $ -write "#define MTTNU ", MTTNu $ -write "#define MTTNX1 ", MTTNx+1 $ -write "#define MTTNY1 ", MTTNy+1 $ -write "#define MTTNU1 ", MTTNu+1 $ -write "#define MTTNX2 ", MTTNx+2 $ -write "#define MTTNY2 ", MTTNy+2 $ -write "#define MTTNU2 ", MTTNu+2 $ - -write "#include "$ -write "#include "$ -write "#include ""sign.c"" "$ -write "#include ""$1_simpar.h"" "$ -write "#include ""$1_ode.c"" "$ -write "#include ""$1_input.c"" "$ -write "#include ""$1_numpar.c"" "$ -write "#include ""$1_state.c"" "$ - -%External (global) variable list -write "#include ""$1_sympar.h"" "$ - - -write "/* Declare standard arrays */"$ -write "double y[MTTNY1]; /* $1_ode output */"$ -write "double dx[MTTNX1]; /* $1_ode state derivative */"$ -write "double x[MTTNX1]; /* $1_ode state */"$ -write "double u[MTTNU1]; /* $1_ode input */"$ - - -write "/* Files */ "$ -write " FILE *fopen(), *fps, *fpso;"$ - -write "main()"$ -write " "$ -write "{"$ - - - -write "/* Counters etc*/ "$ -write " double time;"$ -write " double dt;"$ -write " int i;"$ -write " int k;"$ - -write "/*functions */ "$ -write " extern $1_numpar();"$ - -%Open the output files -write "/* %Open the output file */"$ -write "fps = fopen(""$1_odes.m"", ""w""); "$ -write "fpso = fopen(""$1_odeso.m"", ""w""); "$ - -%Set up user-defined constants -write "/* Set up user-defined constants */"$ -write " $1_numpar();"$ - -%Set up initial state -write "/* Set up initial state */"$ -write " $1_state();"$ - -%Initialise main (Euler) integration loop -write "/* Initialise main (Euler) integration loop */"$ -write " time = 0;"$ -write " dt = DT/STEPFACTOR;"$ -%% write " for (i=1; i<=MTTNX; i++)"$ -%% write " x[i] = 0.0;"$ - -%Set up system inputs -write "/* Set up system inputs */"$ -write " for (i=1; i<=", MTTNu, "; i++)"$ -write " u[i] = 1.0;"$ - -write " $1_input(0.0);"$ - -write " fprintf(fps, ""function data = ", "$1_odes \n"");"$ -write " fprintf(fps, ""data = [\n"");"$ -write " fprintf(fpso, ""function data = ", "$1_odeso \n"");"$ -write " fprintf(fpso, ""data = [\n"");"$ - -% Compute the first output -write "/* Compute the first output */"$ -write " $1_ode(y,dx,x,u);"$ - -%Main (Euler) integration loop -write "/* Main (Euler) integration loop */"$ - -write " while (time<(LAST-DT))"$ -write " {"$ - -%Write to output to file -write "/* Write to output file */"$ -write " fprintf(fpso, ""%5.4g "",time);"$ -write " for (i=1; i<=MTTNY; i++)"$ -write " fprintf(fpso, ""%5.4g "", y[i]);"$ -write " fprintf(fpso, ""\n"");"$ - -%Write to state to file -write "/* Write to state file */"$ -write " fprintf(fps, ""%5.4g "",time);"$ -write " for (i=1; i<=MTTNX; i++)"$ -write " fprintf(fps, ""%5.4g "", x[i]);"$ -write " fprintf(fps, ""\n"");"$ - -write " time = time + DT;"$ - -write "/* Inner integration loop */"$ -write " for (k=1; k<=STEPFACTOR; k++)"$ -write " {"$ -write " for (i=1; i<=MTTNX; i++)"$ -write " x[i] = x[i] + dx[i]*dt;"$ - -write " /* Set up system inputs */"$ -write " $1_input(time);"$ -write " $1_ode();"$ -write " }"$ - -write " }"$ - -%Write to files -%Write to output to file -write "/* Write to output file */"$ -write " fprintf(fpso, ""%5.4g "",time);"$ -write " for (i=1; i<=MTTNY; i++)"$ -write " fprintf(fpso, ""%5.4g "", y[i]);"$ -write " fprintf(fpso, ""\n"");"$ - -%Write to state to file -write "/* Write to state file */"$ -write " fprintf(fps, ""%5.4g "",time);"$ -write " for (i=1; i<=MTTNX; i++)"$ -write " fprintf(fps, ""%5.4g "", x[i]);"$ -write " fprintf(fps, ""\n"");"$ - - -write " fprintf(fps, ""];\n"");"$ -write " fprintf(fpso, ""];\n"");"$ - -write " return 0;"$ -write "}"$ - - -SHUT "$1_odes.c"; - - -EOF - - - DELETED mttroot/mtt/bin/trans/ode2odess_m Index: mttroot/mtt/bin/trans/ode2odess_m ================================================================== --- mttroot/mtt/bin/trans/ode2odess_m +++ mttroot/mtt/bin/trans/ode2odess_m @@ -1,111 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode2odess_m - -# Transforms descriptor matrix rep to step response - -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 2000/10/17 11:07:59 peterg -## *** empty log message *** -## -## Revision 1.3 1998/05/19 19:27:04 peterg -## Zapped all the parameter stuff -## -## Revision 1.2 1996/09/13 19:40:51 peter -## Fixed problem with default paramaters. -## -## Revision 1.1 1996/09/12 19:26:57 peter -## Initial revision -## -## Revision 1.4 1996/08/16 13:04:46 peter -## Fixed problem with more than one output (y vector). -## -## Revision 1.3 1996/08/16 06:36:03 peter -## Removed u from default arg list. -## -## Revision 1.2 1996/08/15 16:24:43 peter -## Uses T in place of t to avoid name clash within function. -## -## Revision 1.1 1996/08/15 11:56:38 peter -## Initial revision -## -############################################################### - -echo Creating $1_odess.m -rm -f ode2odess_m.log - -Nx=`mtt_getsize $1 x` # States -Nxx=`mtt_getsize $1 xx` # States x States -Nu=`mtt_getsize $1 u` # Inputs -Ny=`mtt_getsize $1 y` # Inputs - -$MATRIX << EOF > ode2odess_m.log 2>mtt_error.txt - - %Read in parameters - par = $1_numpar; - - %Read in simulation parameters - simpar=$1_simpar; - T = [0:simpar.dt:simpar.last]; - - t=0; %Just in case it appears in the parameter list. - - - %Defaults - if exist('T')==0 - T=[0:0.1:1] - end; - - if exist('x0')==0 - x0 = zeros($Nx,1); - end; - - [n,m]=size(T); - if m>n - T=T'; - end; - -global t; -function dx=f(x) - global t - par = $1_numpar; - u = $1_input(x,zeros($Ny,1),t,par); - dx = $1_ode(x,u,t,par);; -endfunction; - -i=0; -x = x0; -for t=T' - u = $1_input(x,zeros($Ny,1),t,par); - y(i) = $1_odeo(x,u,t,par)'; - mtt_write(t,x,y,$Nx,$Ny); # Write it out - x = fsolve('f',x)'; -end; - -i=0; -for t=T' - i=i+1; -end; - -write_matrix([T,x], '$1_odess'); -write_matrix([T,y], '$1_odesso'); - -EOF - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - - - - DELETED mttroot/mtt/bin/trans/ode2odess_m2dat2 Index: mttroot/mtt/bin/trans/ode2odess_m2dat2 ================================================================== --- mttroot/mtt/bin/trans/ode2odess_m2dat2 +++ mttroot/mtt/bin/trans/ode2odess_m2dat2 @@ -1,108 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode2odess_m - -# Transforms descriptor matrix rep to step response - -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/10/17 12:55:29 peterg -## Initial revision -## -## Revision 1.4 2000/10/17 11:07:59 peterg -## *** empty log message *** -## -## Revision 1.3 1998/05/19 19:27:04 peterg -## Zapped all the parameter stuff -## -## Revision 1.2 1996/09/13 19:40:51 peter -## Fixed problem with default paramaters. -## -## Revision 1.1 1996/09/12 19:26:57 peter -## Initial revision -## -## Revision 1.4 1996/08/16 13:04:46 peter -## Fixed problem with more than one output (y vector). -## -## Revision 1.3 1996/08/16 06:36:03 peter -## Removed u from default arg list. -## -## Revision 1.2 1996/08/15 16:24:43 peter -## Uses T in place of t to avoid name clash within function. -## -## Revision 1.1 1996/08/15 11:56:38 peter -## Initial revision -## -############################################################### - -echo Creating $1_odess.dat2 -rm -f ode2odess_m.log - -Nx=`mtt_getsize $1 x` # States -Nxx=`mtt_getsize $1 xx` # States x States -Nu=`mtt_getsize $1 u` # Inputs -Ny=`mtt_getsize $1 y` # Inputs - -$MATRIX << EOF >ode2odess_m2dat2.log 2>mtt_error.txt - - global MTT_data # Where mtt_write puts its stuff - %Read in parameters - par = $1_numpar; - - %Read in simulation parameters - simpar=$1_simpar; - T = [0:simpar.dt:simpar.last]; - - t=0; %Just in case it appears in the parameter list. - - - %Defaults - if exist('T')==0 - T=[0:0.1:1] - end; - - if exist('x0')==0 - x0 = zeros($Nx,1); - end; - - [n,m]=size(T); - if m>n - T=T'; - end; - -global t; -function dx=f(x) - global t - par = $1_numpar; - u = $1_input(x,zeros($Ny,1),t,par); - dx = $1_ode(x,u,t,par);; -endfunction; - -x = x0; -for t=T' - u = $1_input(x,zeros($Ny,1),t,par); - x = fsolve('f',x); - y = $1_odeo(x,u,t,par); - mtt_write(t,x,y,$Nx,$Ny); # Write it out -end; - -save -text $1_odess.dat2 MTT_data - -EOF - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - - - - DELETED mttroot/mtt/bin/trans/ode2smx_lang Index: mttroot/mtt/bin/trans/ode2smx_lang ================================================================== --- mttroot/mtt/bin/trans/ode2smx_lang +++ mttroot/mtt/bin/trans/ode2smx_lang @@ -1,218 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode2smx_lang -# ODE to state matrix (with explicit state values) conversion -# P.J.Gawthrop 6th September 1991, May 1994, July 1998 -# Copyright (c) P.J.Gawthrop, 1991, 1994, 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.11 1998/11/26 10:32:34 peterg -## Include subs.r -## -## Revision 1.10 1998/11/17 17:10:22 peterg -## Read in the constitutive relationship file as well -## -## Revision 1.9 1998/08/27 07:06:25 peterg -## Just genrate xj once. -## -## Revision 1.8 1998/08/27 07:04:44 peterg -## Cleared out mttx array ans use mkid instead. -## -## Revision 1.7 1998/08/27 06:48:20 peterg -## Changed mttxx to mttx - in implicit integration smx is called once -## with x in the linearisation the same as x in the current state -## -## Revision 1.6 1998/08/26 18:25:45 peterg -## SMX now generates both A and Ax -## -## Revision 1.5 1998/08/15 13:51:56 peterg -## smx is now I-Adt NOT A -## -## Revision 1.4 1998/08/13 09:03:35 peterg -## *** empty log message *** -## -## Revision 1.3 1998/07/30 10:49:55 peterg -## Removed zeroing. -## -## Revision 1.2 1998/07/30 10:49:02 peterg -## Put [] round output of zeros. -## -## Revision 1.1 1998/07/19 16:59:56 peterg -## Initial revision -## -############################################################### - -# Language -if [ -n "$2" ]; then - lang=$2 -else - lang="r" -fi - - -# Inform user -echo Creating $1_smx.$lang -#echo Creating $1_smxx.$lang -#echo Creating $1_smxtx.$lang - -# Remove the old log file -rm -f ode2smx_r.log - -rm -f $1_smx.$lang -rm -f $1_smxx.$lang -rm -f $1_smxtx.$lang - -# Use reduce to accomplish the transformation -reduce << EOF >ode2smx_lang.log - -lang := $lang; - -in "$1_subs.r"; -in "$1_def.r"; -in "$1_ode.r"; -in "$1_cr.r"; - -clear mttx; % Dont need this now - use mkid instead - -OFF Echo; - -% Load the general translator package -LOAD GENTRAN; -GENTRANLANG!* := 'Pascal; -ON GENTRANSEG; -MAXEXPPRINTLEN!* := 80; -TEMPVARNUM!* := 1; -TEMPVARNAME!* := 'mtt_t; - -% Matrix output function -in"$MTTPATH/trans/lang_matrix.r"; - - -%Set up output according to the language. - OFF NAT; - GENTRANOUT "$1_smx.$lang"; - -% Set up output according to the language. - IF (lang = r) THEN - BEGIN - write "matrix mtta(", mttnx, ",", mttnx, ");"; - write "matrix mttb(", mttnx, ",", mttnu, ");"; - write "matrix mttc(", mttny, ",", mttnx, ");"; - write "matrix mttd(", mttny, ",", mttnu, ");"; - END; - -% find MTTA : the A matrix - FOR i := 1:MTTNx DO - BEGIN - mttAAx_i := 0; -%% xi := mkid(mttx,i); - FOR j := 1:MTTNx DO - BEGIN - xj := mkid(mttx,j); - a_ij := df(MTTdx(i,1), xj, 1); -%% a_ji := df(MTTdx(j,1), xi, 1); - IF i=j THEN - BEGIN - aa_ij := 1 - mttdt*a_ij; -%% aa_ji := aa_ij; - END - ELSE - BEGIN - aa_ij := -mttdt*a_ij; -%% aa_ji := -mttdt*a_ji; - END; - IF (aa_ij NEQ 0) THEN - GENTRAN mtta(i,j) ::=: aa_ij; - mttAAx_i := mttAAx_i + aa_ij*xj; - %%%mttAAtx(i,1) := mttAAtx(i,1) + aa_ji*mkid(mttx,j); - END; - IF (mttAAx_i NEQ 0) THEN - GENTRAN mttax(i) ::=: mttAAx_i; - END; - - - -%% Find MTTB : the B matrix -% FOR j := 1:MTTNu DO -% BEGIN -% uj := MTTU(j,1); -% FOR i := 1:MTTNx DO -% WriteElement("mttb",i,j,df(MTTdx(i,1), uj, 1)); -% END; -% -%% Find MTTC : the C matrix -% FOR i := 1:MTTNy DO -% FOR j := 1:MTTNx DO -% BEGIN -% xj := MTTX(j,1); -% WriteElement("mttc",i,j,df(MTTY(i,1), xj, 1)); -% END; -% -%% Find MTTD : the D matrix -% FOR i := 1:MTTNy DO -% FOR j := 1:MTTNu DO -% BEGIN -% xj := MTTU(j,1); -% WriteElement("mttd",i,j,df(MTTY(i,1), xj, 1)); -% END; - -%Shut the output according to the language. - GENTRANSHUT "$1_smx.$lang"; - - -%% The AAx matrix; -%GENTRANOUT "$1_smxx.$lang"; -%FOR i := 1:MTTNx DO -%BEGIN -% ax_i := mttAAx(i,1); -% IF (ax_i NEQ 0) THEN -% GENTRAN mttax(i) ::=: ax_i; -%END -%GENTRANSHUT "$1_smxx.$lang"; -% -%% The AAtx matrix; -%GENTRANOUT "$1_smxtx.$lang"; -%FOR i := 1:MTTNx DO -%BEGIN -% atx_i := mttAAtx(i,1); -% IF (atx_i NEQ 0) THEN -% GENTRAN mttax(i) ::=: atx_i; -%END -%GENTRANSHUT "$1_smxtx.$lang"; - -EOF - -if [ "$lang" = "m" ]; then - mv $1_smx.$lang mtt_junk -# lang_header $1 smx m 'mttx,mttu,mttdt' '[mtta,mttax]' > $1_smx.m - mtt_header $1 $2 m - cat mtt_junk | mtt_p2m >> $1_smx.m - rm -f mtt_junk - -# mv $1_smxx.$lang mtt_junk -# lang_header $1 smxx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxx.m -# cat mtt_junk | mtt_p2m >> $1_smxx.m -# rm -f mtt_junk -# -# mv $1_smxtx.$lang mtt_junk -# lang_header $1 smxtx m 'mttx,mttu,mttxx,mttdt' '[mttax]' > $1_smxtx.m -# cat mtt_junk | mtt_p2m >> $1_smxtx.m -# rm -f mtt_junk -# -# -fi - -# Now invoke the standard error handling. -mtt_error_r ode2smx_lang.log - - - - DELETED mttroot/mtt/bin/trans/ode_r2c Index: mttroot/mtt/bin/trans/ode_r2c ================================================================== --- mttroot/mtt/bin/trans/ode_r2c +++ mttroot/mtt/bin/trans/ode_r2c @@ -1,189 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode_r2c -# Reduce ordinary differential equations to c differential-algebraic -# equations - -# Euler integration of the state is included. - -# NB Arrays should be defined to be one larger than expected -# - the 0 element is not used. - -# 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 -# Various bug fixes. -# -## Revision 1.1 1997/01/21 10:52:23 peterg -## Initial revision -## -############################################################### - -# Inform user -echo Creating $1_ode.c - -# Remove the old files -rm -f $1_ode.c1 $1_ode.c2 $1_ode.c - -# Remove the old log file -rm -f ode_r2c.log - -# Use reduce to accomplish the transformation -reduce >ode_r2c.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 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 -%OFF Nat; - -ON NERO; % Suppress zero elements - - -%Generate the Header part -OUT "$1_ode.c1"; - -write "/*"$ -write "Differential algebraic eqns in c form for system $1"$ -write "NB Arrays should be defined to be one larger than expected"$ -write " - the 0 element is not used."$ - -write "File $1_ode.c"$ -write "Generated by MTT"$ -write "*/"$ -write " "$ - - -%Function heading - c style - -write "void $1_ode()"$ - -write " "$ -write "{"$ - -write "/* Declare standard arrays */"$ -write " extern double y[", MTTNy+1, "]; /* $1_ode output */"$ -write " extern double dx[", MTTNx+1, "]; /* $1_ode state derivative */"$ -write " extern double x[", MTTNx+1, "]; /* $1_ode state */"$ -write " extern double u[", MTTNu+1, "]; /* $1_ode input */"$ - -%Declare the dummy variables t0--t9 -write "/* Dummy variable list */ "$ -write " double t0;"$ -FOR i := 1:9 DO -BEGIN - write " double t", i, ";"$ -END$ - -%Declarations$ -write "/* State variable list */ "$ -FOR i := 1:MTTNx DO -BEGIN - write " double mttx", i, ";"$ -END$ - -write "/* Input variable list */ "$ -FOR i := 1:MTTNu DO -BEGIN - write " double mttu", i, ";"$ -END$ - -write "/* Counter */ "$ -write " int i;"$ - -write "/* Parameter list */ "$ -write "#include ", """$1_sympar.c"""$ - -write " "$ -write " /*====== Set up the state variables ======*/"$ -FOR i := 1:MTTNx DO -BEGIN - write " mttx", i, " = x[", i, "];"$ -END$ - -write " "$ -write " /*====== Set up the input variables ======*/"$ -IF MTTNu>0 THEN -BEGIN - FOR i := 1:MTTNu DO - BEGIN - write " mttu", i, " = u[", i, "];"$ - END$ -END$ - - -write " "$ -write " /*====== Compute the state derivative and output ======*/"$ - -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 - BEGIN - GENTRAN dx(i) ::=: mttdx(i,1)$ - END -END$ - -%Output -IF MTTNy>0 THEN -BEGIN - FOR i := 1:MTTNy DO - BEGIN - GENTRAN y(i) ::=: mtty(i,1)$ - END -END$ - - -GENTRANSHUT "$1_ode.c2"; - -EOF - -echo '}' > $1_ode.c3 -cat $1_ode.c1 $1_ode.c2 $1_ode.c3> $1_ode.c - - DELETED mttroot/mtt/bin/trans/ode_r2lang Index: mttroot/mtt/bin/trans/ode_r2lang ================================================================== --- mttroot/mtt/bin/trans/ode_r2lang +++ mttroot/mtt/bin/trans/ode_r2lang @@ -1,245 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode_r2lang -# Reduce ODE to general language ODE -# Based on obsolete ode_r2m -# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994, Jan 95, May 1998 -# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996, 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1998/07/19 16:22:29 peterg -## Changed header to inculde mttu -## -## Revision 1.2 1998/06/21 10:40:58 peterg -## Added fsolve error message. -## -## Revision 1.1 1998/05/23 16:17:14 peterg -## Initial revision -## -############################################################### - -# Set up the language specific stuff -language=$2 - -case $language in - m) - ext='m'; - codegenerator='PASCAL' - Lc='#'; - Rc='#'; - Lb='('; - Rb=')'; - ;; - c) - ext='c'; - codegenerator='C' - Lc='/*'; - Rc='*/'; - Lb='['; - Rb=']'; - ;; - java) - ext='java'; - codegenerator='C' - Lc='/*'; - Rc='*/'; - Lb='['; - Rb=']'; - ;; - *) - echo Language $2 not supported - sorry; exit 1 -esac - -#Inform user -echo Creating $1_ode.$ext -echo Creating $1_odea.$ext -echo Creating $1_odeo.$ext - - -# Remove the old log file -rm -f ode_r2lang.log - -#Remove the temporary files -rm -f $1_ode.$ext.1 -rm -f $1_odea.$ext.1 -rm -f $1_odeo.$ext.1 - -# Use reduce to accomplish the transformation -$SYMBOLIC << EOF #>ode_r2lang.log - -%Read the reduce definitions file -in "$1_def.r"; - -%Read the reduce ODE file -in "$1_ode.r"; - - -% Set up the code generator -% Load the general translator package -LOAD GENTRAN; -GENTRANLANG!* := '$codegenerator; -ON GENTRANSEG; -MAXEXPPRINTLEN!* := 80; -TEMPVARNUM!* := 1; -TEMPVARNAME!* := 'mtt_temp; - -% Matrix output function -in"$MTTPATH/trans/lang_matrix.r"; - -%Set up the number of argument variables to zero in case the user has forgotten -MTTNVar := 0; - -%Read the parameter file -in "$1_sympar.r"; - -% The body of the ode function - GENTRANOUT "$1_ode.$ext.1"; - mtt_matrix := MTTdX$ - mtt_matrix_n := MTTNx$ - mtt_matrix_m := 1$ - mtt_matrix_name := 'MTTdX$ - lang_matrix()$ - GENTRANSHUT "$1_ode.$ext.1"; - -% The algebraic equations (if any) - GENTRANOUT "$1_odea.$ext.1"; - mtt_matrix := MTTYz$ - mtt_matrix_n := MTTNYz$ - mtt_matrix_m := 1$ - mtt_matrix_name := MTTYz$ - lang_matrix()$ - GENTRANSHUT "$1_odea.$ext.1"; - - -% Now do the y = g(x,t) function. -% The body of the odeo function - GENTRANOUT "$1_odeo.$ext.1"; - mtt_matrix := MTTy$ - mtt_matrix_n := MTTNy$ - mtt_matrix_m := 1$ - mtt_matrix_name := MTTy$ - lang_matrix()$ - GENTRANSHUT "$1_odeo.$ext.1"; - -EOF - -# Create the ode.$ext function -lang_header $1 ode $ext 'mttx,mttu,t' mttdx > $1_ode.$ext - -# Algebraic bits -$MATRIX -q <> $1_ode.$ext - %System structure - [nx,ny,nu,nz,nyz] = $1_def; -if nyz>0 - printf("global mttxx mttt;\n"); - printf("mttxx = mttx; mttt=t;\n"); - - printf("$Lc====== Extract the internal input variables ======$Rc\n"); - for i = 1:nyz - printf(" mttui$Lb%i$Rb = mttx$Lb%i$Rb;\n",i,i+nx); - end; - printf("\n"); - - printf("[mttui,info] = fsolve('$1_odea',mttui);\n"); - printf("if (info!=1)\n"); - printf(" error('fsolve has not converged')\n"); - printf("end\n"); - printf("\n"); - - printf("$Lc====== Set up the internal input variables ======$Rc\n"); - for i = 1:nyz - printf(" mttui%i = mttui$Lb%i$Rb;\n",i,i); - end; - printf("\n"); - - printf("$Lc====== Put internal input variables at end of state derivative ======$Rc\n"); - for i = 1:nyz - printf(" mttdx$Lb%i$Rb = mttui%i;\n",i+nx,i); - end; - printf("\n"); -end; - -EOF - -cat <> $1_ode.$ext - -$Lc The differential equations $Rc -EOF - -sed 's/mtt_matrix/mttdx/' $1_ode.$ext.1 >> $1_ode.$ext - -# Java terminating } -if [ "$language" = "java" ]; then -cat <> $1_ode.$ext -} -EOF -fi - - -# Create the odea.$ext function -lang_header $1 odea $ext 'mttui' mttyz 'global mttxx mttt; mttx = mttxx; t=mttt;' > $1_odea.$ext - -$MATRIX -q <> $1_odea.$ext - %System structure - [nx,ny,nu,nz,nyz] = $1_def; -if nyz>0 - printf("$Lc====== Set up the internal input variables ======$Rc\n"); - for i = 1:nyz - printf(" mttui%i = mttui$Lb%i$Rb;\n",i,i); - end; - printf("\n"); -end; -EOF - -cat <> $1_odea.$ext - -% The algebraic equations -EOF -sed 's/mtt_matrix/mttyz/' $1_odea.$ext.1 >> $1_odea.$ext - - -# Create the odeo.$ext function -lang_header $1 odeo $ext 'mttx,mttu,t' mtty > $1_odeo.$ext - -$MATRIX -q <> $1_odeo.$ext - %System structure - [nx,ny,nu,nz,nyz] = $1_def; -if nyz>0 - printf("$Lc====== Extract the internal input variables ======$Rc\n"); - for i = 1:nyz - printf(" mttui$Lb%i$Rb = mttx$Lb%i$Rb;\n",i,i+nx); - end; - printf("\n"); - - printf("$Lc====== Set up the internal input variables ======$Rc\n"); - for i = 1:nyz - printf(" mttui%i = mttui$Lb%i$Rb;\n",i,i); - end; - printf("\n"); -end; - -EOF - - -cat <> $1_odeo.$ext - -% The output equations -EOF -sed 's/mtt_matrix/mtty/' $1_odeo.$ext.1 >> $1_odeo.$ext - -# Convert from Pascal syntax to Octave syntax -mv $1_ode.m mtt_junk; mtt_p2m $1_ode.m -mv $1_odeo.m mtt_junk; mtt_p2m $1_odeo.m -mv $1_odea.m mtt_junk; mtt_p2m $1_odea.m - - - - DELETED mttroot/mtt/bin/trans/ode_r2m Index: mttroot/mtt/bin/trans/ode_r2m ================================================================== --- mttroot/mtt/bin/trans/ode_r2m +++ mttroot/mtt/bin/trans/ode_r2m @@ -1,314 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode_r2m -# Reduce ODE to matlab ODE -# P.J.Gawthrop 14 June 1991, 12 Jan 1994, April 1994, Jan 95. -# Copyright (c) P.J.Gawthrop 1991, 1994, 1995, 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.13 1998/05/21 16:19:54 peterg -## Modified to include explicit algebraic loop solution -## -## Revision 1.12 1998/05/21 12:55:48 peterg -## Put in algebraic equation stuff -## -## Revision 1.11 1998/05/21 08:05:23 peterg -## Back under RCS -## -## Revision 1.10 1998/04/14 07:25:02 peterg -## _input now has arguments (x,t) -## -## Revision 1.9 1998/03/30 14:18:07 peterg -## Removed NERO command -## -## Revision 1.8 1998/02/25 18:03:49 peterg -## Removed the argument reading bits. -## -## Revision 1.7 1997/08/29 07:58:17 peterg -## Changed MTT to mtt in the .m files. -## -# Revision 1.6 1997/01/05 19:34:35 peterg -# Don't write globals which are already assigned to a number. -# -## Revision 1.5 1996/09/13 19:41:39 peter -## *** empty log message *** -## -## Revision 1.4 1996/09/12 18:33:32 peter -## Put back under rcs -## -## Revision 1.3 1996/08/30 11:04:28 peter -## Changed line length to 500. -## -## Revision 1.2 1996/08/24 14:09:41 peter -## Global parameter passing. -## -## Revision 1.1 1996/08/18 12:03:49 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_ode.m -echo Creating $1_odea.m -echo Creating $1_odeo.m - - -# Remove the old log file -rm -f ode_r2m.log - -#Remove the temporary files -rm -f $1_ode.mc -rm -f $1_ode.m1 -rm -f $1_ode.m2 -rm -f $1_ode.m3 -rm -f $1_ode.m4 -rm -f $1_odea.m1; -rm -f $1_odeo.m1; - -# Use reduce to accomplish the transformation -reduce >ode_r2m.log << EOF - -%Read the reduce definitions file -in "$1_def.r"; - -%Read the reduce ODE file -in "$1_ode.r"; - -% Matrix output function -in"$MTTPATH/trans/matlab_matrix.r"; - - -%Set up the number of argument variables to zero in case the user has forgotten -MTTNVar := 0; - -%Read the parameter file -in "$1_sympar.r"; - -%ON NERO; % Suppress zero elements - -%Define the common part of the functions. - -PROCEDURE common; -BEGIN - write "% Read in the input"; - write "u = $1_input(x,t)"; - - write "% Read in the definitions"; - write "[nx,ny,nu,nz,nyz] = $1_def"; - -% write "% Read in the arguments"; -% write "$1_args"; - - write "% Set up the State variables"; - FOR i := 1:MTTNx DO - BEGIN - write "mttx", i, " = x(", i, ");"; - END; - - write "% Set up the Input variables"; - IF MTTNu>0 THEN - FOR i := 1:MTTNu DO - BEGIN - write "mttu", i, " = u(", i, ");"; - END; - -END; - -% The common part -OUT "$1_ode.mc"; -common(); -SHUT "$1_ode.mc"; - -% Set up internal inputs (if any) -OUT "$1_ode.m3"; - write "% Set up the Internal Input variables"; - IF MTTNyz>0 THEN - FOR i := 1:MTTNyz DO - BEGIN - write "mttui", i, " = mttui(", i, ");"; - END; -SHUT "$1_ode.m3"; - -OUT "$1_ode.m4"; - write "% Set up the Internal Input variables (saved in the state vector)"; - IF MTTNyz>0 THEN - FOR i := 1:MTTNyz DO - BEGIN - write "mttui(", i, ") = x(", i+MTTNx, ");"; - END; -SHUT "$1_ode.m4"; - -% The body of the ode function - GENTRANOUT "$1_ode.m1"; - mtt_matrix := MTTdX$ - mtt_matrix_n := MTTNx$ - mtt_matrix_m := 1$ - mtt_matrix_name := MTTdX$ - matlab_matrix(); - GENTRAN MTTdx := mtt_matrix; - GENTRANSHUT "$1_ode.m1"; - -% The algebraic equations (if any) - GENTRANOUT "$1_odea.m1"; - mtt_matrix := MTTYz$ - mtt_matrix_n := MTTNYz$ - mtt_matrix_m := 1$ - mtt_matrix_name := MTTYz$ - matlab_matrix(); - GENTRAN MTTYz := mtt_matrix; - GENTRANSHUT "$1_odea.m1"; - - -%Fortran switches - one line expressions -OFF echo; -ON fort$ -cardno!* := 1$ -fortwidth!* := 10000$ -OFF period$ - -MTTdx := MTTdx; - - -SHUT "$1_ode.m"; - -OUT "$1_odea.m"; -write "function zero = $1_odea(x,t);"; -write "% zero = $1_odea(x,t);"; -write "%Algebraic equations in octave form for system $1;;"; -write "%File $1_odea.m;;"; -write "%Generated by MTT;;"; - -%Write algebraic equations if any ... -zero := MTTYz; -SHUT "$1_odea.m"; - -% Now do the y = g(x,t) function. -% The body of the odeo function - GENTRANOUT "$1_odeo.m1"; - mtt_matrix := MTTy$ - mtt_matrix_n := MTTNy$ - mtt_matrix_m := 1$ - mtt_matrix_name := MTTy$ - matlab_matrix(); - GENTRAN MTTy := mtt_matrix; - GENTRANSHUT "$1_odeo.m1"; - - -EOF - -# Create the ode.m function -cat < $1_ode.m -function mttdx = $1_ode(x,t); -% mttdx = $1_ode(x,t); -%ODE in Octave form for system $1; -%File $1_ode.m; -%Generated by MTT on `date`; -EOF - -# Create the globals -sympar2global_txt2m $1 >> $1_ode.m - -#Common bit -cat $1_ode.mc >> $1_ode.m - -#Extract internal input from state vector -cat $1_ode.m4 >> $1_ode.m - -cat <> $1_ode.m -% Solve the algebraic equations (if any) -if nyz>0 - global xx tt; - xx = x; tt=t; - MTTui = fsolve('$1_odea',mttui); -else - mttui = []; -end -EOF - -cat $1_ode.m3 >> $1_ode.m - -cat <> $1_ode.m - -% The differential equations -EOF -cat $1_ode.m1 >> $1_ode.m - -cat <> $1_ode.m - -% Append the internal inputs to the state derivative -mttdx = [mttdx; mttui]; -EOF - - -# Create the odea.m function -cat < $1_odea.m -function mttyz = $1_odea(mttui); -% mttyz = $1_odea(mttui); -%Algebraic equations in Octave form for system $1; -%File $1_odea.m; -%Generated by mtt on `date`; -EOF - -# Create the globals -sympar2global_txt2m $1 >> $1_odea.m - -cat <> $1_odea.m - -global xx tt; -x = xx; t=tt; -EOF - -#Common bit -cat $1_ode.mc >> $1_odea.m - -# Internal inputs -cat $1_ode.m3 >> $1_odea.m - -cat <> $1_odea.m - -% The algebraic equations -EOF -cat $1_odea.m1 >> $1_odea.m - -# Create the odeo.m function -cat < $1_odeo.m -function mtty = $1_odeo(x,t); -% mtty = $1_odeo(x,t); -%Algebraic equations in Octave form for system $1; -%File $1_odeo.m; -%Generated by MTT on `date`; -EOF - -# Create the globals -sympar2global_txt2m $1 >> $1_odeo.m - - -#Common bit -cat $1_ode.mc >> $1_odeo.m - -#Extract internal input from state vector -cat $1_ode.m4 >> $1_odeo.m - -# Internal inputs -cat $1_ode.m3 >> $1_odeo.m - -cat <> $1_odeo.m - -% The output equations -EOF -cat $1_odeo.m1 >> $1_odeo.m - - - - - - - DELETED mttroot/mtt/bin/trans/ode_r2tex Index: mttroot/mtt/bin/trans/ode_r2tex ================================================================== --- mttroot/mtt/bin/trans/ode_r2tex +++ mttroot/mtt/bin/trans/ode_r2tex @@ -1,121 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ode_r2tex -# Reduce differential-algebraic to LaTex differential-algebraic equations. -# P.J.Gawthrop 10th May 1991, April 1994 -# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1998/01/23 15:51:01 peterg -## Repleace eqnarray by equation + aligned -- this works with Latex2html -## -## Revision 1.2 1996/12/20 08:59:10 peterg -## Now writes out mtti instead of mtt_{i} -- lets latex_tidy do the -## conversion. -## -## Revision 1.1 1996/12/20 08:53:57 peterg -## Initial revision -## -############################################################### - -# Inform user -echo Creating $1_ode.tex - -# Remove the old log file -rm -f ode_r2tex.log - -# Use reduce to accomplish the transformation -reduce >ode_r2tex.log << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the differential-algebraic equations file -in "$1_ode.r"; - -%Read the symbolic parameter file -%%in "$1_sympar.r"; - - - -OFF Echo; -OFF Nat; - -%Read the substitution file -IN "$1_subs.r"; - -%Read the simplifying expressions file -IN "$1_simp.r"; - -OUT "$1_ode.tex"; - -%Write out the differential-algebraic equations. - -write "%File: $1_ode.tex"; - -write "%ordinary differential equations"; -write "% Generated by MTT"; - -IF MTTNx>0 THEN -BEGIN - write"\begin{equation} \label{eq_$1_ode_x}"; - write"\begin{aligned}"; - FOR Row := 1:MTTNx DO - BEGIN - write "\dot MTTX", Row, " &= "; - write "{"; - write MTTdx(Row,1); - write "}"; - IF Row0 THEN -BEGIN - write"\begin{equation}"; - write"\begin{aligned}"; -FOR Row := 1:MTTNyz DO - BEGIN - write "0 &= "; - write "{"; - write MTTyz(Row,1); - write "}"; - IF Row0 THEN -BEGIN - write"\begin{equation} \label{eq_$1_ode_y}"; - write"\begin{aligned}"; - FOR Row := 1:MTTNy DO - BEGIN - write "MTTy", Row, " &= "; - write "{"; - write MTTy(Row,1); - write "}"; - IF Row $1_odes.sdat - DELETED mttroot/mtt/bin/trans/odeso_dat2sdat Index: mttroot/mtt/bin/trans/odeso_dat2sdat ================================================================== --- mttroot/mtt/bin/trans/odeso_dat2sdat +++ mttroot/mtt/bin/trans/odeso_dat2sdat @@ -1,29 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: odeso_dat2sdat - -# Structure file - dat to sdat conversion -# P.J.Gawthrop April 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1999/03/28 21:29:40 peterg -## Initial revision -## -############################################################### - - - -# Inform user -echo "Creating $1_odeso.sdat" - -dat2sdat $1 odeso | dat2siag > $1_odeso.sdat - DELETED mttroot/mtt/bin/trans/p/README Index: mttroot/mtt/bin/trans/p/README ================================================================== --- mttroot/mtt/bin/trans/p/README +++ mttroot/mtt/bin/trans/p/README @@ -1,113 +0,0 @@ -Some of the files in this directory are derived from the NUMERICAL -RECIPES PASCAL SHAREWARE DISKETTE. Please note that any use of these -filse may be subject to the following notice: - - - NUMERICAL RECIPES PASCAL SHAREWARE DISKETTE - -The entire contents of this diskette are -Copyright (C) 1986 by Numerical Recipes Software. - -HERE ARE ANSWERS TO YOUR IMMEDIATE QUESTIONS: - -** What is this diskette? ** This NUMERICAL RECIPES PASCAL SHAREWARE -DISKETTE contains Pascal procedures originally published as the Pascal -Appendix to the FORTRAN book NUMERICAL RECIPES: THE ART OF SCIENTIFIC -COMPUTING (Cambridge University Press, 1986), and test driver programs -originally published as the NUMERICAL RECIPES EXAMPLE BOOK (PASCAL) -(Cambridge University Press, 1986). - -** What kinds of procedures are these Numerical Recipes? ** They are -practically a complete library for scientific computation. Numbering -more than 200, their scope includes integration, linear algebra, -differential equations, Fourier methods, data analysis, statistics, -lots of special functions, random numbers, sorting, root finding, -optimization, and much more. - -** Do I really get this whole library for FREE? ** Yes, providing that -you follow these simple rules: (1) You must read and accept the -disclaimer of warranty at the end of this document. (2) You must not -expect any user support from Numerical Recipes Software, Cambridge -University Press, or the authors of the Numerical Recipes books. (3) -You must not copy or redistribute any of the programs or procedures -for commercial purposes. You CAN make copies of the programs for your -friends and colleagues, providing that you include this file -(especially its copyright notice and disclaimer of warranty) with any -copy that you make. - -** What's the catch, then? ** None at all. Many thousands of -satisfied users paid more than $20 to purchase exactly the programs on -this disk, which were sold by Cambridge University Press (C.U.P.) -between 1986 and 1989. C.U.P. now sells a revised version of the -Numerical Recipes program library, whose Pascal style is much -improved, but whose basic algorithmic workings are identical to this -disk. Rather than let the older version go to waste, its authors -decided to make it available to the shareware community of users. - -** How can I figure out what the procedures do? ** One way is to read -the brief descriptions of all the programs in the file NRINFO.DOC. A -better way is to look at the book Numerical Recipes: The Art of -Scientific Computing in any one of its three editions (FORTRAN, -Pascal, or C). If you don't want to buy this book from Cambridge -University Press (see the file NRINFO.DOC), you can find it in -libraries. Or, take a pencil and a small piece of paper into a -bookstore that carries the book and take notes on which programs you -might find interesting. - -** How do I figure out how to use the procedures? ** Again, you have -several options. All the procedures (named *.PAS) come with -demonstration programs (named *.DEM). These demonstration programs -are included on this shareware diskette. (When sold, they are sold as -a separate diskette.) Usually you can figure out how to use a -procedure by figuring out its .DEM program. Another way is to look at -the Numerical Recipes book in a library or bookstore. - -** Aren't you just trying to get me to buy the book? ** Think of it -this way: Most shareware comes with the requirement that if you use it -more than casually, you are required to become a registered user and -pay a fee. We are not requiring any fee at all. We think that you -will be able to use MOST of the procedures on this diskette without -the Numerical Recipes book. If you become a more-than-casual user, or -if you look at the book in a bookstore, we are betting that you will -WANT to buy it, and perhaps then want to purchase the revised and -improved versions of the programs, also. But it is completely up to -you. - -** OK, what if I do want to get the book? ** Call Cambridge University -Press at their toll-free number, 800-872-7423. (In New York call -800-227-0247 or 914-937-9600.) Ask for "Numerical Recipes in Pascal", -ISBN number 0-521-37516-9. We think you'll like it. (Over 100,000 -copies of the book are in print, in FORTRAN, Pascal, and C.) - -** What are the files on this diskette? ** All the procedures, in -Pascal source code, are in the ZIP file NRPAS13.ZIP. You use -PKUNZIP.EXE to decompress them. (For info just execute PKUNZIP with -no command line arguments.) All the demonstration programs are -similarly in NRPEX10.ZIP (PEX means Pascal EXamples). Some data files -used by the procedures and demonstrations programs are in NRPDATA.ZIP. -The files NRPAS13.LST and NRPEX10.LST each list the names of the files -in their corresponding ZIP file. The short file MODFILE.PAS is used -by many of the procedures to customize to your particular variety of -Pascal compiler; feel free to modify it, if you need to. The file -NRINFO.DOC tells about the book Numerical Recipes in Pascal and gives -a brief description of all the procedures. The file you are now -reading is NRREADME.DOC. - -Good luck, and happy number-crunching! - - DISCLAIMER OF WARRANTY - ---------- -- -------- -THE PROGRAMS AND PROCEDURES ON THIS DISKETTE ARE PROVIDED "AS IS" -WITHOUT WARRANTY OF ANY KIND. WE MAKE NO WARRANTIES, EXPRESS OR -IMPLIED, THAT THE PROGRAMS AND PROCEDURES ARE FREE OF ERROR, OR ARE -CONSISTENT WITH ANY PARTICULAR STANDARD OF MERCHANTABILITY, OR THAT -THEY WILL MEET YOUR REQUIREMENTS FOR ANY PARTICULAR APPLICATION. THEY -SHOULD NOT BE RELIED ON FOR SOLVING A PROBLEM WHOSE INCORRECT SOLUTION -COULD RESULT IN INJURY TO A PERSON OR LOSS OF PROPERTY. IF YOU DO USE -THE PROGRAMS OR PROCEDURES IN SUCH A MANNER, IT IS AT YOUR OWN RISK. -THE AUTHORS AND PUBLISHER DISCLAIM ALL LIABILITY FOR DIRECT, -INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM YOUR USE OF THE -PROGRAMS OR PROCEDURES ON THIS DISKETTE. ANY LIABILITY OF THE PERSON -OR PERSONS FROM WHOM YOU DIRECTLY OR INDIRECTLY OBTAINED THIS DISKETTE -WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OF DISKETTES WITH -MANUFACTURING DEFECTS. DELETED mttroot/mtt/bin/trans/p/mtt_euler.p Index: mttroot/mtt/bin/trans/p/mtt_euler.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_euler.p +++ mttroot/mtt/bin/trans/p/mtt_euler.p @@ -1,16 +0,0 @@ -PROCEDURE mtt_euler(VAR x_out, x,dx : StateVector; - dt : REAL; - Nx : INTEGER; - Open : StateVector); - -VAR i : INTEGER; - -BEGIN{mtt_euler} - FOR i := 1 TO Nx DO - BEGIN - IF Open[i]>0.5 THEN{Open switch} - x_out[i] := 0.0 - ELSE - x_out[i] := x[i] + dx[i]*dt; - END; -END;{mtt_euler} DELETED mttroot/mtt/bin/trans/p/mtt_getargs.p Index: mttroot/mtt/bin/trans/p/mtt_getargs.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_getargs.p +++ mttroot/mtt/bin/trans/p/mtt_getargs.p @@ -1,26 +0,0 @@ -{ Substitute for p2c PASCAL_MAIN - Copies pogramme arguments in to mtt_parameters array - This c code is embedded in a pascal routine in a p2c compatible way -} - -{EMBED -Static Void PASCAL_MAIN(argc, argv) -int argc; -char *argv[]; - -\[ - int i; - mttnpar = argc-1; - if (mttnpar>0) \[ - for (i=0;i 0) THEN BEGIN - FOR j := ii TO i-1 DO BEGIN - sum := sum-a[i,j]*b[j] - END - END ELSE IF (sum <> 0.0) THEN BEGIN - ii := i - END; - b[i] := sum - END; - FOR i := n DOWNTO 1 DO BEGIN - sum := b[i]; - IF (i < n) THEN BEGIN - FOR j := i+1 TO n DO BEGIN - sum := sum-a[i,j]*b[j] - END - END; - b[i] := sum/a[i,i] - END -END; DELETED mttroot/mtt/bin/trans/p/mtt_ludcmp.p Index: mttroot/mtt/bin/trans/p/mtt_ludcmp.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_ludcmp.p +++ mttroot/mtt/bin/trans/p/mtt_ludcmp.p @@ -1,84 +0,0 @@ -PROCEDURE mtt_ludcmp(VAR a: StateMatrix; n: integer; - VAR indx: StateVector; VAR d: real); - -{ This file is derived from the NUMERICAL RECIPES PASCAL SHAREWARE DISKETTE. - Please read the README file in $MTTPATH/trans/p - } - -{ -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/08/14 07:58:13 peterg -## Initial revision -## -############################################################### -} - -(* Programs using LUDCMP must define the types -TYPE - glnpbynp = ARRAY [1..np,1..np] OF real; - glnarray = ARRAY [1..n] OF real; - glindx = ARRAY [1..n] OF integer; -in the main routine. *) - -CONST - tiny=1.0e-20; - -VAR - k,j,imax,i: integer; - sum,dum,big: real; - vv: glnarray; - -BEGIN - d := 1.0; - FOR i := 1 TO n DO BEGIN - big := 0.0; - FOR j := 1 TO n DO IF (abs(a[i,j]) > big) THEN big := abs(a[i,j]); - IF (big = 0.0) THEN BEGIN - writeln('pause in LUDCMP - singular matrix'); readln - END; - vv[i] := 1.0/big - END; - FOR j := 1 TO n DO BEGIN - FOR i := 1 TO j-1 DO BEGIN - sum := a[i,j]; - FOR k := 1 TO i-1 DO BEGIN - sum := sum-a[i,k]*a[k,j] - END; - a[i,j] := sum - END; - big := 0.0; - FOR i := j TO n DO BEGIN - sum := a[i,j]; - FOR k := 1 TO j-1 DO BEGIN - sum := sum-a[i,k]*a[k,j] - END; - a[i,j] := sum; - dum := vv[i]*abs(sum); - IF (dum > big) THEN BEGIN - big := dum; - imax := i - END - END; - IF (j <> imax) THEN BEGIN - FOR k := 1 TO n DO BEGIN - dum := a[imax,k]; - a[imax,k] := a[j,k]; - a[j,k] := dum - END; - d := -d; - vv[imax] := vv[j] - END; - indx[j] := imax; - IF (a[j,j] = 0.0) THEN a[j,j] := tiny; - IF (j <> n) THEN BEGIN - dum := 1.0/a[j,j]; - FOR i := j+1 TO n DO BEGIN - a[i,j] := a[i,j]*dum - END - END - END; -END; DELETED mttroot/mtt/bin/trans/p/mtt_par_update.p Index: mttroot/mtt/bin/trans/p/mtt_par_update.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_par_update.p +++ mttroot/mtt/bin/trans/p/mtt_par_update.p @@ -1,49 +0,0 @@ -PROCEDURE mtt_numpar_update(VAR new_numpar : ParameterVector; - old_numpar : ParameterVector); -VAR i : INTEGER; - -BEGIN {mtt_numpar_update} - - for i:=1 TO MTT_Npar DO {copy values} - new_numpar[i] := old_numpar[i]; - - WHILE NOT eof(numparfile) DO {read and update values} - IF NOT (numparfile^ = chr("#")) THEN - BEGIN - read(numparfile,i); read(numparfile,new_numpar[i]); - END - ELSE - readln(numparfile); - -END {mtt_numpar_update}; - -PROCEDURE mtt_state_update(VAR new_state : StateVector; - old_state : StateVector); - -VAR i : INTEGER; - -BEGIN {mtt_state_update} - - for i:=1 TO MTT_Nx DO {copy values} - new_state[i] := old_state[i]; - - WHILE NOT eof(statefile) DO {read and update values} - IF NOT (statefile^ = chr("#")) THEN - BEGIN - read(statefile,i); read(statefile,new_state[i]); - END - ELSE - readln(statefile); - -END {mtt_state_update}; - -PROCEDURE mtt_simpar_update(VAR dt : REAL); -BEGIN {mtt_simpar_update} - - WHILE NOT eof(simparfile) DO {read and update values} - BEGIN - IF NOT (simparfile^ = chr("#")) THEN - read(simparfile,dt); - readln(simparfile); - END -END {mtt_simpar_update}; DELETED mttroot/mtt/bin/trans/p/mtt_solve.p Index: mttroot/mtt/bin/trans/p/mtt_solve.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_solve.p +++ mttroot/mtt/bin/trans/p/mtt_solve.p @@ -1,38 +0,0 @@ -PROCEDURE mtt_solve(VAR x : StateVector; - A : StateMatrix; - B : StateVector; - n : integer); - -{ - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.3 1999/10/26 23:44:36 peterg -% % Now packages up mtt_solve_lud OR mtt_solve_svd -% % -% % Revision 1.2 1998/08/14 12:09:13 peterg -% % A passed by value - its destroyed by SVDcm -% % -% % Revision 1.1 1998/08/13 08:51:57 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - } - -VAR - i : integer; - wmax,wmin : real; - w : StateVector ; - v : StateMatrix; - - -(*$I $MTTPATH/trans/p/mtt_solve_lud.p *) -(* I $MTTPATH/trans/p/mtt_solve_svd.p *) - -BEGIN{mtt_solve} - mtt_solve_lud(x,A,B,N); - (*** mtt_solve_svd(x,A,B,N); ***) -END{mtt_solve}; DELETED mttroot/mtt/bin/trans/p/mtt_solve_lu.p Index: mttroot/mtt/bin/trans/p/mtt_solve_lu.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_solve_lu.p +++ mttroot/mtt/bin/trans/p/mtt_solve_lu.p @@ -1,54 +0,0 @@ -PROCEDURE mtt_solve_lu.p(VAR x : StateVector; - A : StateMatrix; - VAR B : StateVector; - n : integer; - Small : real); - -{ -Linear equation solution via LU factorisation} - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.2 1998/08/14 12:09:13 peterg -% % A passed by value - its destroyed by SVDcm -% % -% % Revision 1.1 1998/08/13 08:51:57 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - } - -VAR - i : integer; - wmax,wmin : real; - w : StateVector ; - v : StateMatrix; - -(*$I svdcmp.p *) -(*$I svbksb.p *) - -BEGIN{mtt_solve} -(* decompose matrix A using SVD *) - svdcmp(A,n,n,w,v); - -(* find maximum singular value *) - wmax := 0.0; - FOR i := 1 to n DO BEGIN - IF (w[i] > wmax) THEN wmax := w[i] - END; - -(* define "small" *) - wmin := wmax*Small; - -(* zero the "small" singular values *) - FOR i := 1 to n DO BEGIN - IF (w[i] < wmin) THEN w[i] := 0.0 - END; - -(* backsubstitute for B *) - svbksb(A,w,v,n,n,B,x); - -END{mtt_solve}; DELETED mttroot/mtt/bin/trans/p/mtt_solve_lud.p Index: mttroot/mtt/bin/trans/p/mtt_solve_lud.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_solve_lud.p +++ mttroot/mtt/bin/trans/p/mtt_solve_lud.p @@ -1,61 +0,0 @@ -PROCEDURE mtt_solve_lud(VAR x : StateVector; - A : StateMatrix; - B : StateVector; - n : integer); - -{ -Linear equation solution via LU factorisation - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.3 1999/10/26 23:37:20 peterg -% % Put include files here. -% % -% % Revision 1.2 1998/08/17 15:56:10 peterg -% % Uses LU decomposition - much faster than SVD when N>100 -% % -% % Revision 1.1 1998/08/17 12:52:16 peterg -% % Initial revision -% % -% % Revision 1.1 1998/08/17 12:41:37 peterg -% % Initial revision -% % -% % Revision 1.2 1998/08/14 12:09:13 peterg -% % A passed by value - its destroyed by SVDcm -% % -% % Revision 1.1 1998/08/13 08:51:57 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - } - -VAR - i : integer; - d : real; - Index : StateVector; - - -(*$I $MTTPATH/trans/p/mtt_ludcmp.p *) -(*$I $MTTPATH/trans/p/mtt_lubksb.p *) - -BEGIN{mtt_solve_lud} - (* decompose matrix A using LU decomposition *) - mtt_ludcmp(A,n,Index,d); - - (* backsubstitute for B *) - mtt_lubksb(A,n,Index,B); - - (* x now lives in B *) - FOR i := 1 TO n DO - x[i] := B[i]; - -END{mtt_solve_lud}; - - - - - - DELETED mttroot/mtt/bin/trans/p/mtt_solve_svd.p Index: mttroot/mtt/bin/trans/p/mtt_solve_svd.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_solve_svd.p +++ mttroot/mtt/bin/trans/p/mtt_solve_svd.p @@ -1,63 +0,0 @@ -PROCEDURE mtt_solve_svd(VAR x : StateVector; - A : StateMatrix; - VAR B : StateVector; - n : integer); - -{Solve linear equation via svd} - -{ - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.2 1998/08/17 12:40:25 peterg -% % Renamed mtt_solve to mtt_solve_svd -% % -- now also have mtt_solve_lu -% % -% % Revision 1.1 1998/08/17 12:38:52 peterg -% % Initial revision -% % -% % Revision 1.2 1998/08/14 12:09:13 peterg -% % A passed by value - its destroyed by SVDcm -% % -% % Revision 1.1 1998/08/13 08:51:57 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - } - -CONST - Small = 1e-6; (* Criteroion for small svd *) -VAR - i : integer; - wmax,wmin : real; - w : StateVector ; - v : StateMatrix; - -(*$I svdcmp.p *) -(*$I svbksb.p *) - -BEGIN{mtt_solve} -(* decompose matrix A using SVD *) - svdcmp(A,n,n,w,v); - -(* find maximum singular value *) - wmax := 0.0; - FOR i := 1 to n DO BEGIN - IF (w[i] > wmax) THEN wmax := w[i] - END; - -(* define "small" *) - wmin := wmax*Small; - -(* zero the "small" singular values *) - FOR i := 1 to n DO BEGIN - IF (w[i] < wmin) THEN w[i] := 0.0 - END; - -(* backsubstitute for B *) - svbksb(A,w,v,n,n,B,x); - -END{mtt_solve}; DELETED mttroot/mtt/bin/trans/p/mtt_sparse.p Index: mttroot/mtt/bin/trans/p/mtt_sparse.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_sparse.p +++ mttroot/mtt/bin/trans/p/mtt_sparse.p @@ -1,92 +0,0 @@ -PROCEDURE mtt_sparse( b : glnarray; - n,iters : INTEGER; - VAR x : glnarray); - -{ This file is derived from the NUMERICAL RECIPES PASCAL SHAREWARE DISKETTE. - Please read the README file in $MTTPATH/trans/p - } -{* -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 1998/08/15 13:49:19 peterg -## iters now passed as an argument. -## -## Revision 1.4 1998/08/15 09:33:25 peterg -## Deleted the commented out stuff -## -## Revision 1.3 1998/08/15 09:30:05 peterg -## Commented out the cariabel iteration stuff -## -## Revision 1.2 1998/08/15 08:26:30 peterg -## This is variable interations version - now going on to fixed -## iterations -## -## Revision 1.1 1998/08/13 14:58:35 peterg -## Initial revision -## -## Revision 1.1 1998/08/13 08:40:40 peterg -## Initial revision -## -############################################################### -*} - -(* Programs using routine SPARSE must define the type -TYPE - glnarray = ARRAY [1..n] OF real; -in the main routine. They must also provide two routines, -PROCEDURE asub(x: glnarray; VAR y: glnarray; n: integer); -and -PROCEDURE atsub(x: glnarray; VAR z: glnarray; n: integer); -which calculate A*x and (A transpose)*x *) - -VAR - j,iter,irst: integer; - rp,gg,gam,eps2,dgg,bsq,anum,aden: real; - g,h,xi,xj: glnarray; - -BEGIN {mtt_sparse} - mtt_asub(x,xi,n); - rp := 0.0; - bsq := 0.0; - FOR j := 1 TO n DO BEGIN - xi[j] := xi[j]-b[j]; - END; - mtt_atsub(xi,g,n); - FOR j := 1 TO n DO BEGIN - g[j] := -g[j]; - h[j] := g[j] - END; - FOR iter := 1 TO iters DO BEGIN - mtt_asub(h,xi,n); - anum := 0.0; - aden := 0.0; - FOR j := 1 TO n DO BEGIN - anum := anum+g[j]*h[j]; - aden := aden+sqr(xi[j]) - END; - anum := anum/aden; - FOR j := 1 TO n DO BEGIN - xi[j] := x[j]; - x[j] := x[j]+anum*h[j] - END; - mtt_asub(x,xj,n); - FOR j := 1 TO n DO BEGIN - xj[j] := xj[j]-b[j]; - END; - mtt_atsub(xj,xi,n); - gg := 0.0; - dgg := 0.0; - FOR j := 1 TO n DO BEGIN - gg := gg+sqr(g[j]); - dgg := dgg+(xi[j]+g[j])*xi[j] - END; - gam := dgg/gg; - FOR j := 1 TO n DO BEGIN - g[j] := -xi[j]; - h[j] := g[j]+gam*h[j] - END - END; -END {mtt_sparse}; DELETED mttroot/mtt/bin/trans/p/mtt_update.p Index: mttroot/mtt/bin/trans/p/mtt_update.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_update.p +++ mttroot/mtt/bin/trans/p/mtt_update.p @@ -1,62 +0,0 @@ -PROCEDURE mtt_update(VAR xnew : StateVector; - dx,x,AAx : StateVector; - VAR AA : StateMatrix; - DT : REAL; - STEPFACTOR : INTEGER; - Nx : INTEGER; - METHOD : IntegrationMethod); - -{ - ############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 1998/08/15 13:48:35 peterg -## New update methods -## -## Revision 1.4 1998/08/14 10:54:58 peterg -## Use sparse computation where possible -## -############################################################### -} - -CONST - Small = 0.000001; - -VAR - i,j : INTEGER; - BB : StateVector; - DDT : REAL; - -(*$I mtt_solve_lud.p *) -(*$I mtt_sparse.p *) - -BEGIN{mtt_update} - - IF Method=1 THEN {Euler} - BEGIN{Euler} - DDT := DT/STEPFACTOR; - FOR i := 1 TO Nx DO - xnew[i] := xnew[i] + dx[i]*DDT; - END {Euler} - ELSE IF (Method=2) OR (METHOD=3) OR (METHOD=4) THEN {Implicit} - BEGIN {Implicit methods} - - FOR i := 1 TO Nx DO {BB is (1-A*dt)*x +dx*dt} - BB[i] := AAx[i] + DT*dx[i]; - - {Solve the equation AAx = B} - IF (Method=2) OR (METHOD=3) THEN {Use SVD} - mtt_solve_lud(xnew,AA,BB,Nx) - ELSE {Sparse CG solution} - mtt_sparse(BB,Nx,STEPFACTOR,xnew); - END{Implicit methods} - ELSE - Writeln("Method >4 is not defined"); - -END{mtt_update}; - - - - DELETED mttroot/mtt/bin/trans/p/mtt_write.p Index: mttroot/mtt/bin/trans/p/mtt_write.p ================================================================== --- mttroot/mtt/bin/trans/p/mtt_write.p +++ mttroot/mtt/bin/trans/p/mtt_write.p @@ -1,54 +0,0 @@ -PROCEDURE mtt_write(t : REAL; - x : StateVector; - y : OutputVector; - nx,ny : INTEGER); - -{* -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% - Pascal function mtt_write - P.J. Gawthrop July 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 1999/03/15 21:57:38 peterg -## Removed the # symbol -## -## Revision 1.4 1998/11/26 13:31:30 peterg -## Put missing space after 2nd t -## -## Revision 1.3 1998/07/25 20:41:38 peterg -## Spaces between numbers -## -## Revision 1.2 1998/07/25 14:04:14 peterg -## Changed format -## -## Revision 1.1 1998/07/25 09:47:25 peterg -## Initial revision -## -############################################################### - - -*} - -CONST TAB=9; - -VAR - i : INTEGER; - -BEGIN - write(t,chr(TAB)); - FOR i := 1 TO ny DO - write(y[i],chr(TAB)); - - write(t,chr(TAB)); - FOR i := 1 TO nx DO - write(x[i],chr(TAB)); - writeln; -END; - DELETED mttroot/mtt/bin/trans/p/sign.p Index: mttroot/mtt/bin/trans/p/sign.p ================================================================== --- mttroot/mtt/bin/trans/p/sign.p +++ mttroot/mtt/bin/trans/p/sign.p @@ -1,10 +0,0 @@ -FUNCTION sign(x : REAL) : REAL; -{ This useful function is missing from Pascal } - -BEGIN - IF X>=0 THEN - sign := 1 - ELSE - sign := -1; -END; { sign } - DELETED mttroot/mtt/bin/trans/p/sparse.p Index: mttroot/mtt/bin/trans/p/sparse.p ================================================================== --- mttroot/mtt/bin/trans/p/sparse.p +++ mttroot/mtt/bin/trans/p/sparse.p @@ -1,91 +0,0 @@ -PROCEDURE sparse(b: glnarray; n: integer; VAR x: glnarray; VAR rsq: real); -{* -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### -*} - -(* Programs using routine SPARSE must define the type -TYPE - glnarray = ARRAY [1..n] OF real; -in the main routine. They must also provide two routines, -PROCEDURE asub(x: glnarray; VAR y: glnarray; n: integer); -and -PROCEDURE atsub(x: glnarray; VAR z: glnarray; n: integer); -which calculate A*x and (A transpose)*x *) -LABEL 1,99; -CONST - eps=1.0e-6; -VAR - j,iter,irst: integer; - rp,gg,gam,eps2,dgg,bsq,anum,aden: real; - g,h,xi,xj: glnarray; -BEGIN - eps2 := n*sqr(eps); - irst := 0; -1: irst := irst+1; - asub(x,xi,n); - rp := 0.0; - bsq := 0.0; - FOR j := 1 TO n DO BEGIN - bsq := bsq+sqr(b[j]); - xi[j] := xi[j]-b[j]; - rp := rp+sqr(xi[j]) - END; - atsub(xi,g,n); - FOR j := 1 TO n DO BEGIN - g[j] := -g[j]; - h[j] := g[j] - END; - FOR iter := 1 TO 10*n DO BEGIN - asub(h,xi,n); - anum := 0.0; - aden := 0.0; - FOR j := 1 TO n DO BEGIN - anum := anum+g[j]*h[j]; - aden := aden+sqr(xi[j]) - END; - IF (aden = 0.0) THEN BEGIN - writeln('pause in routine SPARSE'); - writeln('very singular matrix'); readln - END; - anum := anum/aden; - FOR j := 1 TO n DO BEGIN - xi[j] := x[j]; - x[j] := x[j]+anum*h[j] - END; - asub(x,xj,n); - rsq := 0.0; - FOR j := 1 TO n DO BEGIN - xj[j] := xj[j]-b[j]; - rsq := rsq+sqr(xj[j]) - END; - IF ((rsq = rp) OR (rsq <= bsq*eps2)) THEN GOTO 99; - IF (rsq > rp) THEN BEGIN - FOR j := 1 TO n DO BEGIN - x[j] := xi[j] - END; - IF (irst >= 3) THEN GOTO 99; - GOTO 1 - END; - rp := rsq; - atsub(xj,xi,n); - gg := 0.0; - dgg := 0.0; - FOR j := 1 TO n DO BEGIN - gg := gg+sqr(g[j]); - dgg := dgg+(xi[j]+g[j])*xi[j] - END; - IF (gg = 0.0) THEN GOTO 99; - gam := dgg/gg; - FOR j := 1 TO n DO BEGIN - g[j] := -xi[j]; - h[j] := g[j]+gam*h[j] - END - END; - writeln('pause in routine SPARSE'); - writeln('too many iterations'); readln; -99: END; DELETED mttroot/mtt/bin/trans/p/svbksb.p Index: mttroot/mtt/bin/trans/p/svbksb.p ================================================================== --- mttroot/mtt/bin/trans/p/svbksb.p +++ mttroot/mtt/bin/trans/p/svbksb.p @@ -1,51 +0,0 @@ -PROCEDURE svbksb(u: glmpbynp; w: glnparray; v: glnpbynp; - m,n: integer; b: glmparray; VAR x: glnparray); -{ - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.2 1998/08/12 11:09:54 peterg -% % Taken from NR share library nrpas13 as SVBKSB.PAS -% % and renamed svbksb.p -% % -% % Revision 1.1 1998/08/12 11:09:02 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - } - - -(* Programs using SVBKSB must define the types -TYPE - glnparray = ARRAY [1..np] OF real; - glmparray = ARRAY [1..mp] OF real; - glnpbynp = ARRAY [1..np,1..np] OF real; - glmpbynp = ARRAY [1..mp,1..np] OF real; -in the main routine. *) -VAR - jj,j,i: integer; - s: real; - tmp: glnparray; -BEGIN - FOR j := 1 TO n DO BEGIN - s := 0.0; - IF (w[j] <> 0.0) THEN BEGIN - FOR i := 1 TO m DO BEGIN - s := s+u[i,j]*b[i] - END; - s := s/w[j] - END; - tmp[j] := s - END; - FOR j := 1 TO n DO BEGIN - s := 0.0; - FOR jj := 1 TO n DO BEGIN - s := s+v[j,jj]*tmp[jj]; - END; - x[j] := s - END -END; - DELETED mttroot/mtt/bin/trans/p/svdcmp.p Index: mttroot/mtt/bin/trans/p/svdcmp.p ================================================================== --- mttroot/mtt/bin/trans/p/svdcmp.p +++ mttroot/mtt/bin/trans/p/svdcmp.p @@ -1,312 +0,0 @@ -PROCEDURE svdcmp(VAR a: glmpbynp; m,n: integer; - VAR w: glnparray; VAR v: glnpbynp); - -{ This file is derived from the NUMERICAL RECIPES PASCAL SHAREWARE DISKETTE. - Please read the README file in $MTTPATH/trans/p - } - -{ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.4 1998/08/12 11:26:39 peterg -% % Zapped unnecessary np and mp arguments -% % -% % Revision 1.3 1998/08/12 11:08:03 peterg -% % Put in pythag routine to compute z = sqrt(y^2 + z^2) (as in book) -% % Save loop index l as ll when jumping from loop - using l itself is -% % undefined -% % -% % Revision 1.2 1998/08/12 11:05:33 peterg -% % Taken from NR share library nrpas13 as SVDCMP.PAS -% % and renamed svdcmp.p -% % -% % Revision 1.1 1998/08/12 11:03:57 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -} - - -(* Programs using routine SVDCMP must define the types -TYPE - glnparray = ARRAY [1..np] OF real; - glmpbynp = ARRAY [1..mp,1..np] OF real; - glnpbynp = ARRAY [1..np,1..np] OF real; -in the main routine. *) -LABEL 1,2,3; -CONST - nmax=100; -VAR - nm,l,k,j,jj,its,i,ll : integer; - z,y,x,scale,s,h,g,f,c,anorm : real; - rv1 : ARRAY [1..nmax] OF real; - -FUNCTION pythag(a,b : real): real; -VAR p,at,bt : REAL; -BEGIN - at:=abs(a); - bt:=abs(b); - IF at>bt THEN - p:= at*sqrt(1.0+sqr(bt/at)) - ELSE - IF bt=0.0 THEN - p := 0.0 - ELSE - p := bt*sqrt(1.0+sqr(at/bt)); - pythag := p; -END{pythag}; - - -FUNCTION sign(a,b : real): real; - BEGIN - IF (b >= 0.0) THEN sign := abs(a) ELSE sign := -abs(a) - END; -FUNCTION max(a,b: real): real; - BEGIN - IF (a > b) THEN max := a ELSE max := b - END; -BEGIN - g := 0.0; - scale := 0.0; - anorm := 0.0; - FOR i := 1 TO n DO BEGIN - l := i+1; - rv1[i] := scale*g; - g := 0.0; - s := 0.0; - scale := 0.0; - IF (i <= m) THEN BEGIN - FOR k := i TO m DO BEGIN - scale := scale+abs(a[k,i]) - END; - IF (scale <> 0.0) THEN BEGIN - FOR k := i TO m DO BEGIN - a[k,i] := a[k,i]/scale; - s := s+a[k,i]*a[k,i] - END; - f := a[i,i]; - g := -sign(sqrt(s),f); - h := f*g-s; - a[i,i] := f-g; - IF (i <> n) THEN BEGIN - FOR j := l TO n DO BEGIN - s := 0.0; - FOR k := i TO m DO BEGIN - s := s+a[k,i]*a[k,j] - END; - f := s/h; - FOR k := i TO m DO BEGIN - a[k,j] := a[k,j]+ - f*a[k,i] - END - END - END; - FOR k := i TO m DO BEGIN - a[k,i] := scale*a[k,i] - END - END - END; - w[i] := scale*g; - g := 0.0; - s := 0.0; - scale := 0.0; - IF ((i <= m) AND (i <> n)) THEN BEGIN - FOR k := l TO n DO BEGIN - scale := scale+abs(a[i,k]) - END; - IF (scale <> 0.0) THEN BEGIN - FOR k := l TO n DO BEGIN - a[i,k] := a[i,k]/scale; - s := s+a[i,k]*a[i,k] - END; - f := a[i,l]; - g := -sign(sqrt(s),f); - h := f*g-s; - a[i,l] := f-g; - FOR k := l TO n DO BEGIN - rv1[k] := a[i,k]/h - END; - IF (i <> m) THEN BEGIN - FOR j := l TO m DO BEGIN - s := 0.0; - FOR k := l TO n DO BEGIN - s := s+a[j,k]*a[i,k] - END; - FOR k := l TO n DO BEGIN - a[j,k] := a[j,k] - +s*rv1[k] - END - END - END; - FOR k := l TO n DO BEGIN - a[i,k] := scale*a[i,k] - END - END - END; - anorm := max(anorm,(abs(w[i])+abs(rv1[i]))); - END; - FOR i := n DOWNTO 1 DO BEGIN - IF (i < n) THEN BEGIN - IF (g <> 0.0) THEN BEGIN - FOR j := l TO n DO BEGIN - v[j,i] := (a[i,j]/a[i,l])/g; - END; - FOR j := l TO n DO BEGIN - s := 0.0; - FOR k := l TO n DO BEGIN - s := s+a[i,k]*v[k,j] - END; - FOR k := l TO n DO BEGIN - v[k,j] := v[k,j]+s*v[k,i] - END - END - END; - FOR j := l TO n DO BEGIN - v[i,j] := 0.0; - v[j,i] := 0.0 - END - END; - v[i,i] := 1.0; - g := rv1[i]; - l := i - END; - FOR i := n DOWNTO 1 DO BEGIN - l := i+1; - g := w[i]; - IF (i < n) THEN BEGIN - FOR j := l TO n DO BEGIN - a[i,j] := 0.0 - END - END; - IF (g <> 0.0) THEN BEGIN - g := 1.0/g; - IF (i <> n) THEN BEGIN - FOR j := l TO n DO BEGIN - s := 0.0; - FOR k := l TO m DO BEGIN - s := s+a[k,i]*a[k,j] - END; - f := (s/a[i,i])*g; - FOR k := i TO m DO BEGIN - a[k,j] := a[k,j]+f*a[k,i] - END - END - END; - FOR j := i TO m DO BEGIN - a[j,i] := a[j,i]*g - END - END ELSE BEGIN - FOR j := i TO m DO BEGIN - a[j,i] := 0.0 - END - END; - a[i,i] := a[i,i]+1.0 - END; - FOR k := n DOWNTO 1 DO BEGIN - FOR its := 1 TO 30 DO BEGIN - FOR l := k DOWNTO 1 DO BEGIN - nm := l-1; - IF ((abs(rv1[l])+anorm) = anorm) THEN - BEGIN - ll:=l; - GOTO 2; - END; - IF nm>0 THEN {* Put in by me - see book *} - IF ((abs(w[nm])+anorm) = anorm) THEN - BEGIN - ll:=l; - GOTO 1 - END; - END; -1: c := 0.0; - s := 1.0; - FOR i := ll TO k DO BEGIN - f := s*rv1[i]; - IF ((abs(f)+anorm) <> anorm) THEN BEGIN - g := w[i]; - {**h := sqrt(f*f+g*g);**} - h := pythag(f,g); - w[i] := h; - h := 1.0/h; - c := (g*h); - s := -(f*h); - FOR j := 1 TO m DO BEGIN - y := a[j,nm]; - z := a[j,i]; - a[j,nm] := (y*c)+(z*s); - a[j,i] := -(y*s)+(z*c) - END - END - END; -2: z := w[k]; - IF (ll = k) THEN BEGIN - IF (z < 0.0) THEN BEGIN - w[k] := -z; - FOR j := 1 TO n DO BEGIN - v[j,k] := -v[j,k] - END - END; - GOTO 3 - END; - IF (its = 30) THEN BEGIN - writeln ('no convergence in 30 SVDCMP iterations'); readln - END; - x := w[l]; - nm := k-1; - y := w[nm]; - g := rv1[nm]; - h := rv1[k]; - f := ((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y); - {***g := sqrt(f*f+1.0); writeln(g);***} - g := pythag(f,1.0); - f := ((x-z)*(x+z)+h*((y/(f+sign(g,f)))-h))/x; - c := 1.0; - s := 1.0; - FOR j := ll TO nm DO BEGIN - i := j+1; - g := rv1[i]; - y := w[i]; - h := s*g; - g := c*g; - {**z := sqrt(f*f+h*h);**} - z := pythag(f,h); - rv1[j] := z; - c := f/z; - s := h/z; - f := (x*c)+(g*s); - g := -(x*s)+(g*c); - h := y*s; - y := y*c; - FOR jj := 1 TO n DO BEGIN - x := v[jj,j]; - z := v[jj,i]; - v[jj,j] := (x*c)+(z*s); - v[jj,i] := -(x*s)+(z*c) - END; - {**z := sqrt(f*f+h*h);**} - z := pythag(f,h); - w[j] := z; - IF (z <> 0.0) THEN BEGIN - z := 1.0/z; - c := f*z; - s := h*z - END; - f := (c*g)+(s*y); - x := -(s*g)+(c*y); - FOR jj := 1 TO m DO BEGIN - y := a[jj,j]; - z := a[jj,i]; - a[jj,j] := (y*c)+(z*s); - a[jj,i] := -(y*s)+(z*c) - END - END; - rv1[l] := 0.0; - rv1[k] := f; - w[k] := x - END; -3: END -END; - DELETED mttroot/mtt/bin/trans/p/zero_input.p Index: mttroot/mtt/bin/trans/p/zero_input.p ================================================================== --- mttroot/mtt/bin/trans/p/zero_input.p +++ mttroot/mtt/bin/trans/p/zero_input.p @@ -1,10 +0,0 @@ -PROCEDURE zero_input(VAR x : InputVector; - N : INTEGER); -VAR i : INTEGER; - -BEGIN - FOR i:=1 TO N DO - x[i] := 0.0; -END; - - DELETED mttroot/mtt/bin/trans/p/zero_matrix.p Index: mttroot/mtt/bin/trans/p/zero_matrix.p ================================================================== --- mttroot/mtt/bin/trans/p/zero_matrix.p +++ mttroot/mtt/bin/trans/p/zero_matrix.p @@ -1,11 +0,0 @@ -PROCEDURE zero_matrix(VAR A : StateMatrix; - N : INTEGER); -VAR i,j : INTEGER; - -BEGIN - FOR i:=1 TO N DO - FOR j:=1 TO N DO - A[i,j] := 0.0; -END; - - DELETED mttroot/mtt/bin/trans/p/zero_state.p Index: mttroot/mtt/bin/trans/p/zero_state.p ================================================================== --- mttroot/mtt/bin/trans/p/zero_state.p +++ mttroot/mtt/bin/trans/p/zero_state.p @@ -1,10 +0,0 @@ -PROCEDURE zero_state(VAR x : StateVector; - N : INTEGER); -VAR i : INTEGER; - -BEGIN - FOR i:=1 TO N DO - x[i] := 0.0; -END; - - DELETED mttroot/mtt/bin/trans/p/zero_vector.p Index: mttroot/mtt/bin/trans/p/zero_vector.p ================================================================== --- mttroot/mtt/bin/trans/p/zero_vector.p +++ mttroot/mtt/bin/trans/p/zero_vector.p @@ -1,10 +0,0 @@ -PROCEDURE zero_vector(VAR x : StateVector; - N : INTEGER); -VAR i : INTEGER; - -BEGIN - FOR i:=1 TO N DO - x[i] := 0.0; -END; - - DELETED mttroot/mtt/bin/trans/p/zeros.p Index: mttroot/mtt/bin/trans/p/zeros.p ================================================================== --- mttroot/mtt/bin/trans/p/zeros.p +++ mttroot/mtt/bin/trans/p/zeros.p @@ -1,11 +0,0 @@ -PROCEDURE zeros(VAR A : StateMatrix; - N : INTEGER); -VAR i,j : INTEGER; - -BEGIN - FOR i:=1 TO N DO - FOR j:=1 TO N DO - A[i,j] = 0.0; -END; - - DELETED mttroot/mtt/bin/trans/p2oct Index: mttroot/mtt/bin/trans/p2oct ================================================================== --- mttroot/mtt/bin/trans/p2oct +++ mttroot/mtt/bin/trans/p2oct @@ -1,49 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: lbl2cr_txt2txt - -# Label file to constitutive relationship conversion -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/02/07 15:48:33 peterg -## Initial revision -## -## Revision 1.3 1998/07/29 11:09:39 peterg -## Now matches ^$1$ not $1! -## -## Revision 1.2 1998/03/08 21:02:55 peterg -## Now does multiple crs. -## -# Revision 1.1 1997/03/20 12:23:21 peterg -# Initial revision -# -############################################################### - - - -# Inform user -echo "Creating $1_cr.txt" - -rm -f mtt_error - - -# This is the main transformation using gawk -# And remove crs with same name as system -gawk -f $MTTPATH/trans/awk/lbl2cr.awk $1_lbl.txt 2>mtt_error.txt |\ -grep -v "^$1$" \ -> $1_cr.txt - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/rbg2abg_m Index: mttroot/mtt/bin/trans/rbg2abg_m ================================================================== --- mttroot/mtt/bin/trans/rbg2abg_m +++ mttroot/mtt/bin/trans/rbg2abg_m @@ -1,246 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: rbg2abg_m -# -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.21 2004/09/12 22:27:27 geraint -## Appended 't' to fopen mode string to open in text mode. -## -## Revision 1.20 2004/02/19 12:05:49 gawthrop -## Fix prob. when no bonds -## -## Revision 1.19 2002/04/28 18:55:03 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.18 2001/03/30 15:13:58 gawthrop -## Rationalised simulation modes to each return mtt_data -## -## Revision 1.17 2000/12/05 12:04:03 peterg -## Changed function name to name() -## -## Revision 1.16 2000/12/05 09:04:08 peterg -## Fixed function () compatibility problem. -## -## Revision 1.15 2000/11/03 14:53:33 peterg -## Copy NOTPAR as well -## -## Revision 1.14 2000/09/14 08:41:35 peterg -## Strip off the additional direction info from rbonds -## -## Revision 1.13 2000/03/16 12:53:26 peterg -## Added copy of the %VAR declarations -## Put in the endfunction statement -## -## Revision 1.12 1998/07/28 19:07:48 peterg -## Writes out N_ports as well as n_ports -## -## Revision 1.11 1998/07/25 16:14:44 peterg -## *** empty log message *** -## -## Revision 1.10 1998/07/08 15:34:56 peterg -## Sorted out error exit status -## -## Revision 1.9 1998/07/08 08:24:26 peterg -## Added -I option -- if set prints out the indormation messages -## -## Revision 1.8 1998/02/19 08:57:02 peterg -## Fixed mtt-info bug -- confused filename with number -## -## Revision 1.7 1997/08/05 08:38:23 peterg -## Added n-ports to the argument list in the comment. -## -## Revision 1.6 1996/12/04 21:52:01 peterg -## Uses filenum and fopen instead of filename. -## -## Revision 1.5 1996/08/25 09:20:32 peter -## General error handling. -## -## Revision 1.4 1996/08/24 17:57:41 peter -## Removed `touch mtt_info.txt' -## -## Revision 1.3 1996/08/24 14:58:56 peter -## Fixed missprint - mtt_err --> mtt_error -## -## Revision 1.2 1996/08/24 14:33:07 peter -## Error handling included. -## -## Revision 1.1 1996/08/05 12:22:16 peter -## Initial revision -## -############################################################### - -# Raw bond graph to structured acausal bond graph: mfile format -# The structured BG is described by four matrices: -# junctions: describes the junctions - -# Column 1 Index of component (see components) -# Column 2.. Indices of bonds on junction (see jbonds) -# rows may be padded with zeros -# -# jbonds: describes the true bonds - -# Column 1 Index of component (see components) -# Column 2 Direction -# 1 away from junction -# -1 towards junction -# Column 3 Causality -# 1 stroke at arrow end -# -1 stroke at other end -# 0 no stroke (ie acausal) -# Columns 4:5 x,y coordinates of non-arrow end (in Fig) -# Columns 6:7 x,y coordinates of arrow end (in Fig) -# -# mbonds: describes the modulation bonds - -# Column 1 Index of component at non-arrow end -# Column 2 Index of component at arrow end -# Columns 4:5 x,y coordinates of non-arrow end (in Fig) -# Columns 6:7 x,y coordinates of arrow end (in Fig) -# -# components: describes the comonents - -# Column 1 Type of component -# 0 0-junction -# 1 1-junction -# 2 R component -# 3 C component -# 4 I component -# 11 TF component -# 12 GY component -# 13 A component -# Column 2 Flag for explicit junction -# 4 Explicit component (4 means text type) -# 0 Implicit component -# Column 3-14 fig file information (see fig documentation) -# -# P.J.Gawthrop May 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I ) - info=info;; - -nounits ) - units=no;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -## Set up some vars -sys=$1 -lbl_file=${sys}_lbl.txt -abg_file=${sys}_abg.m - -# Remove the old log file -rm -f rbg2abg_m.log -rm -f ${abg_file} - -#Inform user -echo Creating ${abg_file} - -# Use matrix manipulation to accomplish the transformation -$MATRIX > rbg2abg_m.log 2>mtt_error.txt << EOF - name = '$1' - infofile = fopen('mtt_info.txt', 'wt'); - errorfile = fopen('mtt_error.txt', 'wt'); - - %Convert from the fig version of the bonds to a structured version - [rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = $1_rbg - [n_ports, junk] = size(port_list) - - N_ports = 0; - for i=1:n_ports # Count the true number of ports. - [subport,n_sub] = split_port(port_list(i,:), ','); - N_ports = N_ports+n_sub; - end; - - [n_bonds,m_bonds] = size(rbonds); - if n_bonds>0 - rbonds = rbonds(:,1:6); # Strip the directional information - endif - - [bonds,components,n_vector_bonds] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name, ... - infofile,errorfile); - - %Write the function m-file for the causal bond graph - write_abg(name,bonds,components,n_vector_bonds); -EOF - -## Sets the units for the abg file -test_units() -{ - grep '^[\s]*[#|%]UNITS' < ${lbl_file} >/dev/null - if [ $? = "0" ]; then - grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\ - gawk '{ - printf("mtt_units.sh %s %s %s %s %s\n", sys, $2, $3, $4, $5) - }' sys=${sys} | sh | grep ERROR - if [ $? = "0" ]; then - echo " " *MTT_ERRROR: domains and units are not OK - exiting - exit 1 - else - echo " " domains and units are OK - fi - else - echo " no domains or units declared" - fi -} - -check_ports_exist() -{ - declared_ports=`grep '^[\s]*[#|%]UNITS' < ${lbl_file} | gawk '{print $2}'` - for declared_port in $declared_ports; do - grep "${sys}\.ports\.${declared_port}\.type" ${abg_file} >/dev/null - if [ $? = "1" ]; then - echo "*MTT_ERRROR: Units declared for non-existent port ${declared_port}" - exit 1 - fi - done -} - -set_units() -{ - grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\ - gawk '{ - printf(" %s.ports.%s.domain = \"%s\";\n", sys, $2, $3); - printf(" %s.ports.%s.units.effort = \"%s\";\n", sys, $2, $4); - printf(" %s.ports.%s.units.flow = \"%s\";\n", sys, $2, $5); - }' sys=${sys} -} - -if [ -z "$units" ]; then - echo Checking port domains and units - check_ports_exist; - test_units; - echo "## Port domain and units" >> ${abg_file} - set_units >> ${abg_file} -fi - -# Append any VAR declarations -if [ -f "$1_lbl.txt" ]; then - echo "## Explicit variable declarations" >> ${abg_file} - grep '^[\s]*[%|#][V|P]AR' $1_lbl.txt | tr '%' '#' >> ${abg_file} - grep '^[\s]*[%|#]NOT[V|P]AR' $1_lbl.txt | tr '%' '#' >> ${abg_file} -fi - -## Close off the function -echo "endfunction" >> ${abg_file} - -## Errors and info -if [ "$info" = "info" ]; then - cat mtt_info.txt -fi - -if mtt_error mtt_error.txt -then - exit 0 -else - exit 1 -fi DELETED mttroot/mtt/bin/trans/rbg2ibg_m Index: mttroot/mtt/bin/trans/rbg2ibg_m ================================================================== --- mttroot/mtt/bin/trans/rbg2ibg_m +++ mttroot/mtt/bin/trans/rbg2ibg_m @@ -1,64 +0,0 @@ -#! /bin/sh - - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: rbg2ibg_m -# Based on rbg2abg_m - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I) - info=info;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -# Set up some vars -sys=$1 -ibg=${sys}_ibg.m -err=mtt_error.txt -log=rbg2ibg_m.log - -# Remove the old log file -rm -f ${ibg} -rm -f ${log} - -# Inform user -echo Creating ${ibg} - -# Use matrix manipulation to accomplish the transformation -${MATRIX} > ${log} 2> ${err} < \_) - if(index(C[M],"[")==1){ - for (i=1;i0)&&(index(C[i],"$")==0) ) - C[i] = sprintf("$%s$", C[i]); - printf(" %s",C[i]); - } - - printf("\\001\n"); - - } - }' -} - - -# Inform user -echo "Creating $1_rbg.m" -echo "Creating $1_cmp.m" -echo "Creating $1_head.fig" -echo "Creating $1_fig.fig" -echo "Creating $1_cmp.fig" -echo "Creating $1_port.fig" -echo "Creating $1_sabg.fig" -echo "Creating $1_art.fig" -echo "Creating $1_labg.fig" - - -# Remove some files that I'm going to append to. -rm -f $1_fig.fig -rm -f $1_head.fig -rm -f $1_cmp.fig -rm -f $1_port.fig -rm -f $1_bnd.fig -rm -f $1_art.fig - -# Create blank files -touch $1_fig.fig -touch $1_head.fig -touch $1_cmp.fig -touch $1_port.fig -touch $1_bnd.fig -touch $1_art.fig - -# Deletes trailing white space in component names -# and break compound objects -sed 's/[ ]*\\001/\\001/' < $1_abg.fig |\ -grep -v "^6 [0-9 ]*" | grep -v "^-6$" >$1_abg.mtt1 - -# Replace [1:5] with [1,2,3,4,5] -gawk '{ - if (match($14, /\[1:[0-9]*\]/)){ - range = substr($14,2,length($14)-6); - split(range,a,":"); - str = "1"; - for (i=2;i<=a[2];i++) str = sprintf("%s,%i", str, i); - sub(/1:[0-9]*/, str, $14); - } - print $0 -}' < $1_abg.mtt1 > $1_abg.mtt2 - - -# The following horrible sed thing is to replace tab by ---- -# this is because I can't get sed to recognise tabs even if FS=" ". -echo "" > $1_abg.mtt3 -sed 's/ /---- /'<$1_abg.mtt2 >> $1_abg.mtt3 - -# This is the main transformation using awk -cat $1_lbl.txt $1_abg.mtt3 | gawk -f $MTTPATH/trans/awk/rbg_fig2m.awk $1 no_alpha_sort=$2 - -rm -f $1_abg.mtt - -#Create the stripped abg file -cat $1_head.fig $1_bnd.fig $1_cmp.fig> $1_sabg.fig - -#Create the latexed abg file -##latex_tidy $1_art.fig -art2latex< $1_art.fig >$1_lart.fig -cmp2latex<$1_cmp.fig >$1_lcmp.fig -cat $1_head.fig $1_bnd.fig $1_lcmp.fig | sed 's/---- / /' > $1_labg.fig -strip_comments < $1_lart.fig | sed 's/---- / /' >> $1_labg.fig - - - - - - DELETED mttroot/mtt/bin/trans/rcs_header.m Index: mttroot/mtt/bin/trans/rcs_header.m ================================================================== --- mttroot/mtt/bin/trans/rcs_header.m +++ mttroot/mtt/bin/trans/rcs_header.m @@ -1,9 +0,0 @@ - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - DELETED mttroot/mtt/bin/trans/rcs_header.sh Index: mttroot/mtt/bin/trans/rcs_header.sh ================================================================== --- mttroot/mtt/bin/trans/rcs_header.sh +++ mttroot/mtt/bin/trans/rcs_header.sh @@ -1,7 +0,0 @@ -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - DELETED mttroot/mtt/bin/trans/rdae2dae_r Index: mttroot/mtt/bin/trans/rdae2dae_r ================================================================== --- mttroot/mtt/bin/trans/rdae2dae_r +++ mttroot/mtt/bin/trans/rdae2dae_r @@ -1,251 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: rdae2dae_r -# Reduce equations to raw differential-algebraic equation conversion -# P.J.Gawthrop 8th May 1991, May 1994, June 1996 -# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 2001/04/11 09:44:26 gawthrop -## Fixed cc and c problems to do with pow(x,y) and integers -## mtt/lib/reduce/fix_c.r is included in rdae2dae and cse2smx_lang for -## -c, -cc and -oct options -## -## Revision 1.6 2001/02/03 13:40:45 gawthrop -## Added explicit MTTNu -## -## Revision 1.5 2000/12/28 12:39:02 peterg -## Put under RCS -## -## Revision 1.4 2000/09/04 08:42:53 peterg -## Put in extra echo to space output -## -## Revision 1.3 2000/09/02 15:55:11 peterg -## Now doesn't include def files in da files -## -## Revision 1.2 2000/09/01 13:36:15 peterg -## Added -partition option -## -## Revision 1.1 2000/09/01 12:14:44 peterg -## Initial revision -## -## Revision 1.3 1998/03/07 12:57:19 peterg -## Fixed logname bug -## -## Revision 1.2 1998/03/07 12:51:20 peterg -## This is the new version of ese2dae - it does not do the CRs at this -## stage to give reduce an easier time. -## -## rese2ese_r does the constitutive relationship bit -## -## Revision 1.1 1998/03/07 12:49:31 peterg -## Initial revision -## -## Revision 1.12 1998/01/31 16:22:59 peterg -## Added IF MTTNx>0 THEN and IF MTTNy>0 THEN before the relevant -## assignements of MTTdX and MTTY to themselves. -## -## Revision 1.11 1997/09/18 09:45:08 peterg -## Canged the comment about linux reduce -- reduce reads this for some -## reason. -## -## Revision 1.10 1997/09/15 14:21:18 peterg -## Reads ese file twice to avoid a bug in Linux reduce !!!??? -## -## Revision 1.9 1997/08/30 09:59:31 peterg -## Changed mehtod of writing out mtty to avoid a strange segmentation violation. -## Now uses MTTY := MTTY; approach. -## -## Revision 1.8 1997/04/23 09:31:20 peterg -## Now reads in the (top level) def file in the generated reduce code. -## -# Revision 1.7 1997/04/23 09:23:15 peterg -# Two argument version in preparation for heirarchical version -# -# Revision 1.6 1996/11/21 15:47:48 peterg -# Now inputs _params.r not _sympar.r -# -## Revision 1.5 1996/11/02 10:17:35 peterg -## Removed default constitutive relationship input. -## -# Revision 1.4 1996/09/12 12:10:05 peter -# Now reads the default constitutive relationship file. -# -## Revision 1.3 1996/08/25 09:43:26 peter -## General error handling. -## -## Revision 1.2 1996/08/25 08:31:28 peter -## Error handling added. -## -############################################################### - - -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - -I ) - info=info;; - -partition ) - partition=yes; - blurb='with partitioning'; - ;; - -fixcc ) - include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` - blurb2='fixing c and cc code'; - ;; - *) - echo "$1 is an invalid argument - ignoring"; - exit ;; - esac - shift -done - -#Create the top-level system name -topname=$1 - -#Create the system names -if [ -z "$2" ]; - then - sysname=$topname; - else - sysname=$1_$2; -fi - -defname=$topname"_def.r" -crname=$topname"_cr.r" -subsname=$topname"_subs.r" -rdaename=$sysname"_rdae.r" -daename=$sysname"_dae.r" -logname="rdae2dae.log" - -# Inform user -echo Creating $daename $blurb $blurb2 - -# Remove the old log file -rm -f $logname - -# Use symbolic algebra to accomplish the transformation -$SYMBOLIC >$logname << EOF - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - -% CRs -in "$crname"; - -% Raw dae -in "$rdaename"; - -% Substitution -in "$subsname"; - -% Fix c code if required -$include - - -OFF Echo; -OFF Nat; - -%Create the output file -OUT "$daename"; - -%write "in ""$defname"""; - -write "MTTNu := ", MTTNu; -write "MTTNx := ", MTTNx; -write "MTTNz := ", MTTNz; -write "MTTNy := ", MTTNy; -write "MTTNyz := ", MTTNyz; - -% State -MTT_Matrix := MTTdX$ -MTT_Matrix_name := "MTTdX"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Nonstate -MTT_Matrix := MTTZ$ -MTT_Matrix_name := "MTTZ"$ -MTT_Matrix_n := MTTNz$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Output -MTT_Matrix := MTTy$ -MTT_Matrix_name := "MTTy"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Zero outputs -MTT_Matrix := MTTYz$ -MTT_Matrix_name := "MTTYz"$ -MTT_Matrix_n := MTTNyz$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ -SHUT "$daename"; -quit; - -EOF - -#if [ -n "$partition" ]; then -# rm -f mtt_junk -# # Now for the subsystems -# # Find subsystems -# subsystems=`mtt_get_subsystems $1` -# -# for subsystem in $subsystems; do -# echo Doing $subsystem -# ucname="MTT_"$subsystem"_uc" -# -# Nu=`mtt_getsize -internal $subsystem u` -# echo Nu $Nu -# -# # Use symbolic algebra to accomplish the transformation -# $SYMBOLIC >$logname << EOF -# -# %Read the formatting function -# in "$MTTPATH/trans/reduce_matrix.r"; -# -# % Definitions -# in "$defname"; -# -# % Elementary system equations -# in "$rdaename"; -# -# OFF Echo; -# OFF Nat; -# -# %Create the output file -# OUT "mtt_junk"; -# % Connecting inputs -# MTT_Matrix := $ucname $ -# MTT_Matrix_name := "$ucname" $ -# MTT_Matrix_n := $Nu $ -# MTT_Matrix_m := 1$ -# Reduce_Matrix()$ -# -# shut "mtt_junk"; -#EOF -# echo >> $1_dae.r -# echo %Connections for subsystem $subsystem >> $1_dae.r -# echo >> $1_dae.r -# -# cat mtt_junk >> $1_dae.r -# rm -rf mtt_junk -# done -#fi - -echo "END;" >> $1_dae.r - -# Now invoke the standard error handling. -mtt_error_r $logname - DELETED mttroot/mtt/bin/trans/reduce_matrix.r Index: mttroot/mtt/bin/trans/reduce_matrix.r ================================================================== --- mttroot/mtt/bin/trans/reduce_matrix.r +++ mttroot/mtt/bin/trans/reduce_matrix.r @@ -1,39 +0,0 @@ - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%% Model Transformation Tools %%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Reduce function to write matrices in reduce form -% P.J.Gawthrop January 22 1998 -% Copyright (c) P.J.Gawthrop, 1998 - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 1998/01/22 10:39:01 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - -PROCEDURE Reduce_Matrix; -BEGIN - IF MTT_Matrix_n>0 THEN - IF MTT_Matrix_m>0 THEN - BEGIN - write "clear ", MTT_Matrix_name, ";"; - write "MATRIX ", MTT_Matrix_name, "(", MTT_Matrix_n, ",", - MTT_Matrix_m, ");"; - - FOR i := 1:MTT_Matrix_n DO - FOR j := 1:MTT_Matrix_m DO IF MTT_Matrix(i,j) NEQ 0 THEN - write MTT_Matrix_name, "(", i, ",", j, ") := ", - MTT_Matrix(i,j), ";"; - END; -END; - -END;; DELETED mttroot/mtt/bin/trans/rep_txt2sh Index: mttroot/mtt/bin/trans/rep_txt2sh ================================================================== --- mttroot/mtt/bin/trans/rep_txt2sh +++ mttroot/mtt/bin/trans/rep_txt2sh @@ -1,145 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: rep_txt2sh -# Executes shell commands for report. - -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 2002/05/01 14:07:44 gawthrop -## Added -dr foo (reads files from foo) dir. -## -## Revision 1.6 2002/04/28 18:55:03 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.5 2000/11/27 10:13:25 peterg -## Now passes though options as second argument -## -## Revision 1.4 1998/04/14 18:17:15 peterg -## More messages about Makefile -## -## Revision 1.3 1998/04/14 18:01:04 peterg -## Now executes a Makefile (if it exists) -## -# Revision 1.2 1997/12/06 14:27:53 peterg -# No changes. -# -## Revision 1.1 1997/08/26 09:06:11 peterg -## Initial revision -## -############################################################### - -# Execute a make if Makefile exists -if [ -f Makefile ]; then - echo Executing the Makefile - make - echo Done executing the Makefile - echo -fi - -## Get switches (if any) -mtt_switches=$2 - -# Inform user -echo "Creating representations for $1_rep.tex" - -# Check for old (2 arg) version and update if necessary -mtt_count=`strip_comments < $1_rep.txt | grep -c 'mtt '` -if [ "$mtt_count" = "0" ]; then - echo 'Hmm .. seems to be an old format. creating new file' - echo "Old version saved as $1_rep.txt.SAVE" - mv $1_rep.txt $1_rep.txt.SAVE - strip_comments < $1_rep.txt.SAVE |\ - gawk '{print "mtt", sys, $1, $2}' sys="$1" >$1_rep.txt -fi - - -# Execute the commands - quietly and untidily! -# But use switches -# | sed "s/mtt /mtt -q -u $mtt_switches /" #| tee -a JUNK | sh - -strip_comments< $1_rep.txt | gawk ' -{ - ## Add in the external switches - sub("mtt", sprintf("mtt %s", mtt_switches)); - - ## Count the switches (noting that -i -dr -dw and -de have an argument) - ## and make up a string (switches) containing them - Switches=0; switches = ""; - for (i=2;i<=NF;i++) { - if (match($i,"-")==1) { - Switches++; - switches=sprintf("%s%s", switches, $i); - } - if (match($i,"-i")==1) { - Switches++; - j=i+1; - switches=sprintf("%s%s", switches, $j); - } - if (match($i,"-dr")==1){ - Switches++; - j=i+1; - switches=sprintf("%s%s", switches, $j); - } - if (match($i,"-dw")==1){ - Switches++; - j=i+1; - switches=sprintf("%s%s", switches, $j); - } - if (match($i,"-de")==1){ - Switches++; - j=i+1; - switches=sprintf("%s%s", switches, $j); - } - } - System = $(Switches+2) - Representation = $(Switches+3); - Multiple = "odes odeso sms smso daes daeso"; - Language = $(Switches+4); - - args = $(Switches+5); - if ( (length(args)>0)&&(match(Language,"ps")>0)) { - __Args = sprintf("-%s", gensub(/_/, "-", "g", args) ); - } - else - { - __Args = ""; - } - - ## mtt command - printf("%s\n", $0); - - ## Add in the main mtt switches - __Args = sprintf("%s%s", switches, __Args); - - ## Zap -q -u - gsub("-[qu]","", __Args); - - ## Zap blanks - gsub(" ","", __Args); - - ## copy result to long name file - SysRepLang = sprintf("%s_%s.%s", System, Representation, Language); - if (length(__Args)==0) - __Args = "-noargs"; - SysRepArgLang = sprintf("%s_%s%s.%s", System, Representation, __Args, Language); - printf("echo Creating %s\n", SysRepArgLang); - printf("cp %s %s\n", SysRepLang, SysRepArgLang); - -}' mtt_switches="${mtt_switches}" | sh - -echo "Done creating representations for $1_rep.tex" - - - - DELETED mttroot/mtt/bin/trans/rep_txt2tex Index: mttroot/mtt/bin/trans/rep_txt2tex ================================================================== --- mttroot/mtt/bin/trans/rep_txt2tex +++ mttroot/mtt/bin/trans/rep_txt2tex @@ -1,254 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: rep_txt2tex -# Converts the text file dercribing a report to a report. -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2003/08/19 15:40:25 gawthrop -## Fix _ prob in section headers. -## -## Revision 1.5 2003/08/19 13:10:47 gawthrop -## More arg stuff -## -## Revision 1.4 2002/05/09 16:07:54 gawthrop -## Now handles multiple options whis .tex files as well -## -## Revision 1.3 2002/05/01 14:07:05 gawthrop -## Added -dr foo (reads files from foo) dir. -## -## Revision 1.2 2002/04/28 18:55:03 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.1 2000/12/27 15:57:31 peterg -## Initial revision -## -## Revision 1.15 2000/04/06 10:57:12 peterg -## Removed debug line -## -## Revision 1.14 2000/04/06 10:51:14 peterg -## replaces $PWD by `pwd` for sh compatibility -## -## Revision 1.13 1999/10/19 23:47:27 peterg -## Rewrote for the extra representations - but with .ps at the end -## Need to retrofit old desc files using multiple figures -## -## Revision 1.12 1999/10/19 03:33:01 peterg -## Temporaraly removed argument stripping -## -## Revision 1.11 1999/02/17 02:00:29 peterg -## Absolute pathname for files. -## Indirect include via \input -## -## Revision 1.10 1998/08/25 12:45:27 peterg -## Added icad to languages -## -## Revision 1.9 1998/03/09 13:26:22 peterg -## Removed `system' from part and section headers. -## -## Revision 1.8 1998/02/09 08:59:35 peterg -## Minor debugging lines removed. -## -## Revision 1.7 1998/01/29 19:32:33 peterg -## Removed a spurious X from the file -- tried to run the X server !!! -## -## Revision 1.6 1997/12/04 22:08:52 peterg -## Handles multiple odes.ps files -## -## Revision 1.5 1997/12/04 17:05:57 peterg -## Now handles multiple odeso.ps files -## -## Revision 1.4 1997/08/25 09:15:48 peterg -## Don't do sections for unrecognised languages. -## -# Revision 1.3 1997/06/27 13:28:25 peterg -# New version using explicit command line arguments in the text file -# -## Revision 1.2 1997/05/19 16:11:36 peterg -## Modified section headers. -## -# Revision 1.1 1996/08/18 20:00:38 peter -# Initial revision -# -############################################################### - -documenttype=$2; -mtt_switches=$4 - -## Remove -u and -q -mtt_switches=`echo ${mtt_switches} | sed 's/-[qu]//g'` - -if [ "$documenttype" = "book" ]; then # do book version - # Inform user - echo "Creating $1_rep.tex (directory version)" - strip_comments < $1_rep.txt|\ - gawk ' -BEGIN{ -oldpart = "" -} -{ - # Find directory name. - for (i=1;i1) - part = a[N-1]; - if (length(part)>0) - if (part!=oldpart) - printf("\\part{\\textbf{%s}}\n", part); - oldpart=part; - printf("\\chapter{\\textbf{%s}}\n", $(NF-2)); - printf("\\label{chap:%s(%s)}\n", $(NF-2), directory); - printf("\\input{%s/%s_rep}\n\n", directory, $(NF-2)); - }' > $1_rep.tex - - -else # do article and section version - -if [ -z "$3" ]; then - directory=""; -else - directory=$3/; -fi - -# Inform user -echo "Creating $1_rep.tex" - -# Create the LaTeX file -strip_comments <$1_rep.txt |\ -gawk ' -{ - ## Add in the external switches - sub("mtt", sprintf("mtt %s", mtt_switches)); - - ## Count the switches (noting that -i -dr -dw and -de have an argument) - ## and make up a string (switches) containing them - Switches=0; switches = ""; - for (i=2;i<=NF;i++) { - if (match($i,"-")==1) { - Switches++; - switches=sprintf("%s%s", switches, $i); - } - if (match($i,"-i")==1) { - Switches++; - j=i+1; - switches=sprintf("%s%s", switches, $j); - } - if (match($i,"-dr")==1){ - Switches++; - j=i+1; - switches=sprintf("%s%s", switches, $j); - } - if (match($i,"-dw")==1){ - Switches++; - j=i+1; - switches=sprintf("%s%s", switches, $j); - } - if (match($i,"-de")==1){ - Switches++; - j=i+1; - switches=sprintf("%s%s", switches, $j); - } - } - print "%%%" switches - System = $(Switches+2) - Representation = $(Switches+3); - Multiple = "odes odeso sms smso daes daeso"; - Language = $(Switches+4); - Languages = "tex txt r m c h ps icad"; - args = $(Switches+5); - quote = "\047"; - args = gensub(quote, "", "g", args); - args = gensub(/"/, "", "g", args); -# args = substr(Args,2,length(Args)-2); -# if ( (length(Args)>0)&&(match(Multiple,Representation)>0)) { - if ( (length(args)>0)&&(match(Language,"ps")>0)) { - _Args = sprintf("-%s", args); - __Args = sprintf("-%s", gensub(/_/, "_", "g", args) ); - ___Args = sprintf("-%s", gensub(/,/, "-", "g", args) ); - } - else - { - _Args = ""; - __Args = ""; - ___Args = ""; - } - - ## Add in the mtt args - __Args = sprintf("%s%s", switches, __Args); - - ## Treat no arguments as -noargs - if (length(__Args)==0){ - __Args = "-noargs"; - header_args = ""; - } - else { - header_args = __Args; - gsub("-", " -", header_args); - gsub(/_/, "\\_", header_args); - header_args = sprintf("(%s)", header_args); - } - -print "%%" __Args "%%" -# print "DEBUG", Language, args, _Args, __Args - RepLang = sprintf("%s%s.%s", Representation, __Args, Language); - SysRepLang = sprintf("%s_%s", System, RepLang); - SysRepLangArgs = sprintf("%s_%s", System, RepLang, __Args); - SysRep = sprintf("%s_%s%s", System, Representation, __Args); - filename = gensub(/,/, "-", "g", SysRep); - FileName = sprintf("%s/%s", PWD, filename); - section_head = sprintf("\\textbf{%s\\_%s.%s} \\emph{%s}", - System,Representation,Language, header_args); - -# section headings - if (match(Languages,Language)>0) { - print "\n\n\\section{" section_head "}"; - print "\\label{sec:" SysRepLangArgs "}"; - print "\\index{\\textbf{" System "} -- " Representation "}"; - - print "\n\nMTT command:"; - print "\\begin{verbatim}"; - for (i=1;i<=NF;i++) printf("%s ", $i); - print "\n\\end{verbatim}"; - } - -# tex files - if( match("tex",Language)>0) { - printf(" \\input{%s}\n", FileName); -# command = sprintf("sed s!fig{!fig{%s! < %s_%s.%s", Directory, System, Representation, Language); -# system(command); -} - -# text files - if( match("txt r m c h icad",Language)>0) { - print " \\begin{verbatim}"; - command = sprintf("cat %s.txt", filename); - system(command); - print " \\end{verbatim}"; - } -# ps files - if( match("ps",Language)>0) { - printf("This representation is given as Figure \\Ref{fig:%s}.\n", SysRepLangArgs); - Label = sprintf("%s", SysRepLangArgs); - Caption = sprintf("System \\textbf{%s}, representation %s (%s)", System, Representation, __Args); - printf("\\fig{%s}\n {%s}\n {0.9}\n {%s}\n",FileName,Label,Caption); - } -} -END { - -}' mtt_switches="${mtt_switches}" System=$1 Directory=$directory PWD=`pwd` > $1_rep.tex - -fi DELETED mttroot/mtt/bin/trans/reps_txt2tk Index: mttroot/mtt/bin/trans/reps_txt2tk ================================================================== --- mttroot/mtt/bin/trans/reps_txt2tk +++ mttroot/mtt/bin/trans/reps_txt2tk @@ -1,71 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: reps_txt2tk -# Creates tk/tcl file for xmtt. -# Copyright (c) P.J.Gawthrop, 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 2000/12/28 12:39:34 peterg -## Put under RCS -## -## Revision 1.4 2000/04/05 07:37:27 peterg -## *** empty log message *** -## -## Revision 1.3 1999/08/18 06:15:48 peterg -## Stripped down to just representations menu - see mtt_make_menu -## -## Revision 1.2 1999/03/09 00:03:19 peterg -## Revisions for xmtt -## -## Revision 1.1 1998/10/20 08:13:14 peterg -## Initial revision -## -############################################################### - -sep='|'; # Separates the languages from the rest. - -# Create reps menu -gawk --field-separator=$sep '{ - -# Find the rep and the title - split($1,REP," "); - rep=REP[1]; -# find the languages - N=split($2,LANG," "); - -# Important representation? - if (index(rep,"*")) { - # Zap * - rep=substr(rep,1,length(rep)-1); - sub(/\*/,"",$1); - printf("\n# Menus for representation %s\n", rep) - printf(".rep.rep add cascade -label \"%s\" -menu .rep.rep.%s\n", $1, rep); - printf("menu .rep.rep.%s\n", rep); - for (i=1;i<=N;i++) { - lang = LANG[i]; - printf(" set mtt {mtt_pause $args $system %s %s} \n", rep, lang); - title = sprintf("Output_log_for_representation_%s_(language_%s)", rep, lang); - printf(".rep.rep.%s add command -label \"%s\" ", rep, lang); - printf(" -command \"exec xterm -title %s -e $mtt &\" \n", title); - } - } - else { - printf("\n# Menus for representation %s\n", rep) - printf(".repall.repall add cascade -label \"%s\" -menu .repall.repall.%s\n", $1, rep); - printf("menu .repall.repall.%s\n", rep); - for (i=1;i<=N;i++) { - printf(" set mtt {mtt $args $system %s %s; mtt_pause} \n", rep, LANG[i]); - printf(".repall.repall.%s add command -label \"%s\" ", rep, LANG[i]); - printf(" -command \"exec echo $mtt &; exec $mtt &\" \n"); - } - } -}' - DELETED mttroot/mtt/bin/trans/rest Index: mttroot/mtt/bin/trans/rest ================================================================== --- mttroot/mtt/bin/trans/rest +++ mttroot/mtt/bin/trans/rest @@ -1,22 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: rest -# Gives remainder of space seperated string -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/10/10 07:44:20 peterg -## Initial revision -## -############################################################### - -echo $1 | cut -d ' ' -f 2- - DELETED mttroot/mtt/bin/trans/simpar_txt2h Index: mttroot/mtt/bin/trans/simpar_txt2h ================================================================== --- mttroot/mtt/bin/trans/simpar_txt2h +++ mttroot/mtt/bin/trans/simpar_txt2h @@ -1,50 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: simpar_txt2h - -# Numerical parameters to c format -# P.J.Gawthrop May 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/05/13 08:56:28 peterg -## Initial revision -## -############################################################### - - -system=$1 - - -# Inform user -echo "Creating $1_simpar.h" - -rm -f mtt_error - -#Write some file headers -echo '/*' > $1_simpar.h -echo "Simulation parameter file for system $1 ($1_simpar.h)" >> $1_simpar.h -echo "This file provides the system simulation parameters in c form" >> $1_simpar.h -echo "Generated by MTT at `date`" >> $1_simpar.h -echo "from $1_simpar.txt" >> $1_simpar.h -echo '*/' >> $1_simpar.h -echo >> $1_simpar.h - -# Now do the parameters - -sed 's/ //g' $1_simpar.txt |\ - gawk -F '=' '/=/ {print "#define", $1, $2}' >> $1_simpar.h - - - - - - DELETED mttroot/mtt/bin/trans/sm2can_r Index: mttroot/mtt/bin/trans/sm2can_r ================================================================== --- mttroot/mtt/bin/trans/sm2can_r +++ mttroot/mtt/bin/trans/sm2can_r @@ -1,372 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sm2can_r -# state matrices to various canonical forms. -# P.J.Gawthrop 12 Jan 1997 -# Copyright (c) P.J.Gawthrop 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -# Inform user -echo Creating $1_can.r -- NOTE this is for SISO systems only. - -# Remove the old log file -rm -f sm2can_r.log - -# Use reduce to accomplish the transformation -reduce >sm2can_r.log << EOF - -in "$1_def.r"; -in "$1_sm.r"; -in "$1_tf.r"; - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - - -OFF Echo; -OFF Nat; - -% Find the controllability and observibility matrices. -MATRIX MTTCon(MTTNx,MTTNX); -MTTAB := MTTB; -FOR j := 1:MTTNx DO - BEGIN - FOR i := 1:MTTNx DO - MTTCon(i,j) := MTTAB(i,1); - MTTAB := MTTA*MTTAB; - END; - -MATRIX MTTObs(MTTNx,MTTNX); -MTTCA := MTTC; -FOR i := 1:MTTNx DO - BEGIN - FOR j := 1:MTTNx DO - MTTObs(i,j) := MTTCA(1,j); - MTTCA := MTTCA*MTTA; - END; - -%Canonical forms: -% This statement makes Gs a scalar transfer function -Gs := MTTtf(1,1); - -% Numerator and denominator polynomials -bs := num(gs); -as := den(gs); - -% extract coeficients and divide by coeff of s^n -% reverse operator puts list with highest oder coeffs first -ai := reverse(coeff(as,s)); -a0 := first(ai); -MTTn := length(ai) - 1; - - -% Normalised coeficients; -ai := reverse(coeff(as/a0,s)); -bi := reverse(coeff(bs/a0,s)); -MTTm := length(bi)-1; - -% Zap the (unity) first element of ai list; -ai := rest(ai); - -% System in controller form -% MTTA_c matrix -matrix MTTA_c(MTTn,MTTn); - -% First row is ai coefficients -for i := 1:MTTn do - MTTA_c(1,i) := -part(ai,i); - -% (MTTn-1)x(MTTn-1) unit matrix in lower left-land corner (if n>1) -if MTTn>1 then - for i := 1:MTTn-1 do - MTTA_c(i+1,i) := 1; - -% B_c vector; -matrix MTTB_c(MTTn,1); -MTTB_c(1,1) := 1; - -% C_c vector; -matrix MTTC_c(1,MTTn); -for i := 1:MTTm+1 do - MTTC_c(1,i+MTTn-MTTm-1) := part(bi,i); - -% D_c -MTTD_c := MTTD; - -%Observable form. -MTTA_o := tp(MTTA_c); -MTTB_o := tp(MTTC_c); -MTTC_o := tp(MTTB_c); -MTTD_o := MTTD; - -%Controllability matrix of controllable form -MATRIX MTTCon_c(MTTNx,MTTNX); -MTTAB := MTTB_c; -FOR j := 1:MTTNx DO - BEGIN - FOR i := 1:MTTNx DO - MTTCon_c(i,j) := MTTAB(i,1); - MTTAB := MTTA_c*MTTAB; - END; - -% Transformation matrix; -MTTT_c := MTTCon_c*MTTCon^(-1); - -%Observability matrix of observer form -MATRIX MTTObs_o(MTTNx,MTTNX); -MTTCA := MTTC_o; -FOR i := 1:MTTNx DO - BEGIN - FOR j := 1:MTTNx DO - MTTObs_o(i,j) := MTTCA(1,j); - MTTCA := MTTCA*MTTA_o; - END; - -% Transformation matrix; -MTTT_o := MTTObs^(-1)*MTTObs_o; - -%%%% Controller design %%%%% - -% gain in controller form: -matrix MTTk_c(1,mttn); -matrix alpha_c(9,1); -alpha_c(1,1) := alpha_c1; -alpha_c(2,1) := alpha_c2; -alpha_c(3,1) := alpha_c3; -alpha_c(4,1) := alpha_c4; -alpha_c(5,1) := alpha_c5; -alpha_c(6,1) := alpha_c6; -alpha_c(7,1) := alpha_c7; -alpha_c(8,1) := alpha_c8; -alpha_c(9,1) := alpha_c9; - - -for i := 1:MTTNx do - MTTk_c(1,i) := alpha_c(i,1) - part(ai,i); - -% Gain in physical form -MTTk := MTTk_c*MTTT_c; - -%%%% Observer design %%%%% -% gain in Observer form: -matrix MTTl_o(MTTn,1); -matrix alpha_o(9,1); -alpha_o(1,1) := alpha_o1; -alpha_o(2,1) := alpha_o2; -alpha_o(3,1) := alpha_o3; -alpha_o(4,1) := alpha_o4; -alpha_o(5,1) := alpha_o5; -alpha_o(6,1) := alpha_o6; -alpha_o(7,1) := alpha_o7; -alpha_o(8,1) := alpha_o8; -alpha_o(9,1) := alpha_o9; - -for i := 1:MTTNx DO - MTTL_o(i,1) := alpha_o(i,1) - part(ai,i); - -% Gain in physical form -MTTL := MTTT_o*MTTL_o; - -% Steady-state stuff -% Create the matrix [A B; C D]; -matrix ABCD(MTTn+1,MTTn+1); -for i := 1:MTTNx do - for j := 1:MTTNx do - ABCD(i,j) := MTTA(i,j); - -for i :=1:MTTNx do - ABCD(i,MTTNx+1) := MTTB(i,1); - -for j := 1:MTTNx do - ABCD(MTTNx+1,j) := MTTC(1,j); - -ABCD(MTTNx+1,MTTNx+1) := MTTD(1,1); - -matrix zero_one(MTTNx+1,1); -zero_one(MTTNx+1,1) := 1; - -%Find N vector -Nxu := ABCD^(-1)*zero_one; - -%Extract the parts -MATRIX MTTX_r(MTTNx,1); -FOR i := 1:MTTNx DO - MTTX_r(i,1) := Nxu(i,1); - -MTTu_r := Nxu(MTTNx+1,1); - - -% Compensator - -matrix zero(MTTNx,1); -%State matrices -MTTA_comp := MTTA - MTTL*MTTC - MTTB*MTTK; -MTTB_comp := -MTTL; -MTTC_comp := -MTTK; - -%Transfer function -%Ds := C_d*((s*MTTI - A_d)^(-1))*B_d; -%MTTTFC := Ds; - -%Create the output file -OUT "$1_can.r"; - -%Write out the matrices. - -% Controllable form -MTT_Matrix := MTTA_c$ -MTT_Matrix_name := "MTTA_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -MTT_Matrix := MTTB_c$ -MTT_Matrix_name := "MTTB_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -Reduce_Matrix()$ - -MTT_Matrix := MTTC_c$ -MTT_Matrix_name := "MTTC_c"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - - -% Observable form -MTT_Matrix := MTTA_o$ -MTT_Matrix_name := "MTTA_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -MTT_Matrix := MTTB_o$ -MTT_Matrix_name := "MTTB_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -Reduce_Matrix()$ - -MTT_Matrix := MTTC_o$ -MTT_Matrix_name := "MTTC_o"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Controllability matrix"; -MTT_Matrix := MTTCon$ -MTT_Matrix_name := "MTTCon"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% -Observability matrix"; -MTT_Matrix := MTTObs$ -MTT_Matrix_name := "MTTObs"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% -Controllability matrix - controller form"; -MTT_Matrix := MTTCon_c$ -MTT_Matrix_name := "MTTCon_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Transformation matrix - controller form"; -MTT_Matrix := MTTT_c$ -MTT_Matrix_name := "MTTT_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Gain matrix - controller form"; -MTT_Matrix := MTTK_c$ -MTT_Matrix_name := "MTTK_c"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Gain matrix - physical form"; -MTT_Matrix := MTTK$ -MTT_Matrix_name := "MTTK"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - - -write "% -Observability matrix - Observer form"; -MTT_Matrix := MTTObs_o$ -MTT_Matrix_name := "MTTObs_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Transformation matrix - Observer form"; -MTT_Matrix := MTTT_o$ -MTT_Matrix_name := "MTTT_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Observer Gain matrix - observer form"; -MTT_Matrix := MTTL_o$ -MTT_Matrix_name := "MTTL_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNy$ -Reduce_Matrix()$ - -write "% - Gain matrix - physical form"; -MTT_Matrix := MTTL$ -MTT_Matrix_name := "MTTL"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNy$ -Reduce_Matrix()$ - - -% Controllable form -MTT_Matrix := MTTA_comp$ -MTT_Matrix_name := "MTTA_comp"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -MTT_Matrix := MTTB_comp$ -MTT_Matrix_name := "MTTB_comp"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -Reduce_Matrix()$ - -MTT_Matrix := MTTC_comp$ -MTT_Matrix_name := "MTTC_comp"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - - -KX := MTTK*MTTX_r; -MTTu_r := MTTu_r + KX(1,1); - - - -MTTu_r := MTTu_r; -write "END;"; - -SHUT "$1_can.r"; -quit; - -EOF - -# Now invoke the standard error handling. -mtt_error_r sm2can_r.log DELETED mttroot/mtt/bin/trans/sm2ir_m Index: mttroot/mtt/bin/trans/sm2ir_m ================================================================== --- mttroot/mtt/bin/trans/sm2ir_m +++ mttroot/mtt/bin/trans/sm2ir_m @@ -1,80 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sm2ir_m - -# Transforms descriptor matrix rep to step response - - -# Copyright (c) P.J.Gawthrop, 1996. - - -echo Creating $1_ir.m -echo Creating $1_iro.m -rm -f sm2ir_m.log -rm -f $1_ir.m -rm -f $1_iro.m -rm -f mtt_error - -# if [ "$2" = "" ]; -# then -# PARAMS='T=[0:0.1:10];u0=ones(nu,1);x0=zeros(nx,1);' -# echo Using default parameter $PARAMS -# else -# PARAMS=$2; -# fi - -# PARAMS="$PARAMS ;" - -$MATRIX << EOF > sm2ir_m.log 2>mtt_error.txt - - % Read in the numeric system parameters - mttpar = $1_numpar; - - % Read in the simulation parameters - simpar = $1_simpar; - - [nx,ny,nu,nz,nyz] = $1_def; - t=0; %Just in case it appears in the parameter list. - - - %Defaults - T=[0:simpar.dt:simpar.last]'; - - if exist('u0')==0 - u0 = ones(nu,1); - end; - - if exist('x0')==0 - x0 = zeros(nx,1); - end; - - - [n,m]=size(T); - if m>n - T=T'; - end; - - [A,B,C,D] = $1_sm(mttpar); - [y,x] = sm2ir(A,B,C,D,T,u0,x0); - - if nx>0 - write_matrix([T x], '$1_ir'); - end; - if ny>0 - write_matrix([T y], '$1_iro'); - end; - -EOF - -# Write info -touch mtt_info.txt -cat mtt_info.txt - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/sm2smc_r Index: mttroot/mtt/bin/trans/sm2smc_r ================================================================== --- mttroot/mtt/bin/trans/sm2smc_r +++ mttroot/mtt/bin/trans/sm2smc_r @@ -1,195 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sm2smc_r -# state matrices to controller canonical form + related matrices -# P.J.Gawthrop 12 Jan 1997 -# Copyright (c) P.J.Gawthrop 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/01/22 13:17:37 peterg -## Initial revision -## -############################################################### -Nu=`mtt_getsize $1 u` -Ny=`mtt_getsize $1 y` - -if [ "$Nu" = "1" ]; then - if [ "$Ny" = "1" ]; then - blurb=' for this siso system' - else - blurb=" using first output of $Ny" - fi -else - if [ "$Ny" = "1" ]; then - blurb=" using first input of $Nu" - else - blurb=" using first input of $Nu and using first output of $Ny" - fi -fi - - -# Inform user -echo Creating $1_smc.r $blurb - -# Remove the old log file -rm -f sm2smc_r.log - -# Use reduce to accomplish the transformation -reduce >sm2smc_r.log << EOF - -in "$1_def.r"; -in "$1_sm.r"; -in "$1_tf.r"; - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - - -OFF Echo; -OFF Nat; - -% Find the controllability matrix -MATRIX MTTCon(MTTNx,MTTNX); -MTTAB := MTTB; -FOR j := 1:MTTNx DO - BEGIN - FOR i := 1:MTTNx DO - MTTCon(i,j) := MTTAB(i,1); - MTTAB := MTTA*MTTAB; - END; - - -%Canonical forms: -% This statement makes Gs a scalar transfer function -Gs := MTTtf(1,1); - -% Numerator and denominator polynomials -bs := num(gs); -as := den(gs); - -% extract coeficients and divide by coeff of s^n -% reverse operator puts list with highest oder coeffs first -ai := reverse(coeff(as,s)); -a0 := first(ai); -MTTn := length(ai) - 1; - - -% Normalised coeficients; -ai := reverse(coeff(as/a0,s)); -bi := reverse(coeff(bs/a0,s)); -MTTm := length(bi)-1; - -% Zap the (unity) first element of ai list; -ai := rest(ai); - -% System in controller form -% MTTA_c matrix -matrix MTTA_c(MTTn,MTTn); - -% First row is ai coefficients -for i := 1:MTTn do - MTTA_c(1,i) := -part(ai,i); - -% (MTTn-1)x(MTTn-1) unit matrix in lower left-land corner (if n>1) -if MTTn>1 then - for i := 1:MTTn-1 do - MTTA_c(i+1,i) := 1; - -% B_c vector; -matrix MTTB_c(MTTn,1); -MTTB_c(1,1) := 1; - -% C_c vector; -matrix MTTC_c(1,MTTn); -for i := 1:MTTm+1 do - MTTC_c(1,i+MTTn-MTTm-1) := part(bi,i); - -% D_c -MTTD_c := MTTD; - -%Controllability matrix of controllable form -MATRIX MTTCon_c(MTTNx,MTTNX); -MTTAB := MTTB_c; -FOR j := 1:MTTNx DO - BEGIN - FOR i := 1:MTTNx DO - MTTCon_c(i,j) := MTTAB(i,1); - MTTAB := MTTA_c*MTTAB; - END; - -% Transformation matrix; -MTTT_c := MTTCon_c*MTTCon^(-1); - - - -%Create the output file -OUT "$1_smc.r"; - -%Write out the matrices. - -% Controllable form -write "% - Controller form"; -MTT_Matrix := MTTA_c$ -MTT_Matrix_name := "MTTA_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -MTT_Matrix := MTTB_c$ -MTT_Matrix_name := "MTTB_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -MTT_Matrix := MTTC_c$ -MTT_Matrix_name := "MTTC_c"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -MTT_Matrix := MTTD_c$ -MTT_Matrix_name := "MTTD_c"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - - -write "% - Controllability matrix"; -MTT_Matrix := MTTCon$ -MTT_Matrix_name := "MTTCon"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - - -write "% -Controllability matrix - controller form"; -MTT_Matrix := MTTCon_c$ -MTT_Matrix_name := "MTTCon_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Transformation matrix - controller form"; -MTT_Matrix := MTTT_c$ -MTT_Matrix_name := "MTTT_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "END;"; - -SHUT "$1_smc.r"; -quit; - -EOF - -# Now invoke the standard error handling. -mtt_error_r sm2smc_r.log DELETED mttroot/mtt/bin/trans/sm2smo_r Index: mttroot/mtt/bin/trans/sm2smo_r ================================================================== --- mttroot/mtt/bin/trans/sm2smo_r +++ mttroot/mtt/bin/trans/sm2smo_r @@ -1,196 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sm2smo_r -# state matrices to cobserver form -# P.J.Gawthrop 12 Jan 1997 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2000/09/11 10:53:54 peterg -## Uses 1st io of mimo to create siso -## -## Revision 1.2 1998/01/22 13:25:22 peterg -## Added END;; to output file. -## -## Revision 1.1 1998/01/22 13:16:43 peterg -## Initial revision -## -############################################################### - -Nu=`mtt_getsize $1 u` -Ny=`mtt_getsize $1 y` - -if [ "$Nu" = "1" ]; then - if [ "$Ny" = "1" ]; then - blurb=' for this siso system' - else - blurb=" using first output of $Ny" - fi -else - if [ "$Ny" = "1" ]; then - blurb=" using first input of $Nu" - else - blurb=" using first input of $Nu and using first output of $Ny" - fi -fi -# Inform user -echo Creating $1_smo.r $blurb - -# Remove the old log file -rm -f sm2smo_r.log - -# Use reduce to accomplish the transformation -reduce >sm2smo_r.log << EOF - -in "$1_def.r"; -in "$1_sm.r"; -in "$1_tf.r"; - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - - -OFF Echo; -OFF Nat; - -% Find observibility matrix. -MATRIX MTTObs(MTTNx,MTTNX); -MTTCA := MTTC; -FOR i := 1:MTTNx DO - BEGIN - FOR j := 1:MTTNx DO - MTTObs(i,j) := MTTCA(1,j); - MTTCA := MTTCA*MTTA; - END; - -%Canonical forms: -% This statement makes Gs a scalar transfer function -Gs := MTTtf(1,1); - -% Numerator and denominator polynomials -bs := num(gs); -as := den(gs); - -% extract coeficients and divide by coeff of s^n -% reverse operator puts list with highest oder coeffs first -ai := reverse(coeff(as,s)); -a0 := first(ai); -MTTn := length(ai) - 1; - - -% Normalised coeficients; -ai := reverse(coeff(as/a0,s)); -bi := reverse(coeff(bs/a0,s)); -MTTm := length(bi)-1; - -% Zap the (unity) first element of ai list; -ai := rest(ai); - -% System in observer form -% MTTA_o matrix -matrix MTTA_o(MTTNx,MTTNx); - -% First column is ai coefficients -for i := 1:MTTNx do - MTTA_o(i,1) := -part(ai,i); - -% (MTTNx-1)x(MTTNx-1) unit matrix in upper right-hand corner (if n>1) -if MTTNx>1 then - for i := 1:MTTNx-1 do - MTTA_o(i,i+1) := 1; - -% C_o vector; -matrix MTTC_o(1,MTTNx); - MTTC_o(1,1) := 1; -MTTC_o; -% B_o vector; -matrix MTTB_o(MTTNx,1); -for i := 1:MTTm+1 do - MTTB_o(i+MTTNx-MTTm-1,1) := part(bi,i); - -% D_o -MTTD_o := MTTD; - -%Observability matrix of observer form -MATRIX MTTObs_o(MTTNx,MTTNX); -MTTCA := MTTC_o; -FOR i := 1:MTTNx DO - BEGIN - FOR j := 1:MTTNx DO - MTTObs_o(i,j) := MTTCA(1,j); - MTTCA := MTTCA*MTTA_o; - END; - -% Transformation matrix; -MTTT_o := MTTObs^(-1)*MTTObs_o; - - -%Create the output file -OUT "$1_smo.r"; - -%Write out the matrices. - -% Observable form -MTT_Matrix := MTTA_o$ -MTT_Matrix_name := "MTTA_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -MTT_Matrix := MTTB_o$ -MTT_Matrix_name := "MTTB_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -MTT_Matrix := MTTC_o$ -MTT_Matrix_name := "MTTC_o"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -MTT_Matrix := MTTD_o$ -MTT_Matrix_name := "MTTD_o"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -write "% -Observability matrix"; -MTT_Matrix := MTTObs$ -MTT_Matrix_name := "MTTObs"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - - -write "% -Observability matrix - Observer form"; -MTT_Matrix := MTTObs_o$ -MTT_Matrix_name := "MTTObs_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Transformation matrix - Observer form"; -MTT_Matrix := MTTT_o$ -MTT_Matrix_name := "MTTT_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - - -write "END;;"; -SHUT "$1_smo.r"; -quit; - -EOF - -# Now invoke the standard error handling. -mtt_error_r sm2smo_r.log DELETED mttroot/mtt/bin/trans/sm2sr_m Index: mttroot/mtt/bin/trans/sm2sr_m ================================================================== --- mttroot/mtt/bin/trans/sm2sr_m +++ mttroot/mtt/bin/trans/sm2sr_m @@ -1,122 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sm2sr_m - -# Transforms descriptor matrix rep to step response - - -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.16 1998/08/11 13:31:05 peterg -## Lowercase mttLAST etc -## -## Revision 1.15 1998/07/27 20:31:40 peterg -## New simpar version -## -## Revision 1.14 1998/07/25 10:00:48 peterg -## *** empty log message *** -## -## Revision 1.13 1997/06/13 12:52:18 peterg -## Removed extra ; from $PARAMS -## -# Revision 1.12 1996/09/12 18:45:31 peter -# Back to rcs. -# -# Revision 1.11 1996/08/24 14:02:39 peter -# Included glabal parameter passing. -# Proper error handling. -# -## Revision 1.10 1996/08/19 15:34:14 peter -## Now based on state - not descriptor matrices. -## -## Revision 1.9 1996/08/18 12:01:45 peter -## Unified format of time responses. -## -## Revision 1.8 1996/08/15 16:23:39 peter -## Uses T in place of t to avoid name clash within function. -## -## Revision 1.7 1996/08/15 11:54:32 peter -## Now has optional initial condition. -## -## Revision 1.6 1996/08/14 09:15:02 peter -## Now encapsulates the data into an m file -## Name changed -## -## Revision 1.5 1996/08/12 20:19:06 peter -## Fiddled about with parameter passing - still not right -## -## Revision 1.4 1996/08/11 19:48:04 peter -## Parameter passing added. -## -## Revision 1.3 1996/08/11 10:38:30 peter -## Minor debugging changes. -## -## Revision 1.2 1996/08/11 10:06:50 peter -## Now allows e format and NaN numbers. -## -## Revision 1.1 1996/08/11 09:45:46 peter -## Initial revision -## -############################################################### - -echo Creating $1_sr.m -echo Creating $1_sro.m -rm -f sm2sr_m.log -rm -f $1_sr.m -rm -f $1_sro.m -rm -f mtt_error - - -# PARAMS="$PARAMS ;" - -$MATRIX << EOF > sm2sr_m.log 2>mtt_error.txt - - % Read in the numeric system parameters - mttpar = $1_numpar; - - % Read in the simulation parameters - simpar = $1_simpar; - - [nx,ny,nu,nz,nyz] = $1_def; - t=0; %Just in case it appears in the parameter list. - - T=[0:simpar.dt:simpar.last]' - - if exist('u0')==0 - u0 = ones(nu,1); - end; - - if exist('x0')==0 - x0 = zeros(nx,1); - end; - - - [n,m]=size(T); - if m>n - T=T'; - end; - - [A,B,C,D] = $1_sm(mttpar); - [y,x] = sm2sr(A,B,C,D,T,u0,x0); - - if nx>0 - write_matrix([T x], '$1_sr'); - end; - if ny>0 - write_matrix([T y], '$1_sro'); - end; - -EOF - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - DELETED mttroot/mtt/bin/trans/sm_r2m Index: mttroot/mtt/bin/trans/sm_r2m ================================================================== --- mttroot/mtt/bin/trans/sm_r2m +++ mttroot/mtt/bin/trans/sm_r2m @@ -1,89 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sm_r2m -# Reduce constained state-space A,B,C,D and E matrices to Matlab -# P.J.Gawthrop July 1990, Feb 1991, May 1991, Sep 91, Dec 93, Jan 94, May 94. -# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.7 1998/06/23 19:18:33 peterg -## Added optional state argument. -## -# Revision 1.6 1997/02/24 14:43:21 peterg -# Now ignores parameters that are numerical. -# -## Revision 1.5 1996/09/12 18:34:44 peter -## Back under rcs. -## -# Revision 1.4 1996/08/24 14:12:26 peter -# Global parameter passing. -# -## Revision 1.3 1996/08/19 18:38:43 peter -## Read in the numerical params etc ... -## -## Revision 1.2 1996/08/19 16:25:18 peter -## Fixed bug when Nx=0. -## -## Revision 1.1 1996/08/19 15:14:51 peter -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_sm.m - -# Remove the old log file -rm -f sm_r2m.log - -#Header -lang_header $1 sm m '' '[mtta,mttb,mttc,mttd]' >$1_sm.m - -# Use reduce to accomplish the transformation -$SYMBOLIC >sm_r2m.log << EOF - -%Read in the definitions file -IN "$1_def.r"; - -%Read the reduce state-space A,B,C and D matrices file -IN "$1_sm.r"; - -%Read in the parameter file -IN "$1_sympar.r"; - -OUT "$1_sm.m1"; - -%Fortran switches - one line expressions -OFF echo; -ON fort$ -cardno!* := 1$ -fortwidth!* := 100$ -OFF period$ - -write "mtta = zeros(", MTTNx, ",", MTTNx, ");"; -write "mttb = zeros(", MTTNx, ",", MTTNu, ");"; -write "mttc = zeros(", MTTNy, ",", MTTNx, ");"; -write "mttd = zeros(", MTTNy, ",", MTTNu, ");"; - -ON NERO; % Suppress zero elements. -mtta := mtta; -mttb := mttb; -mttc := mttc; -mttd := mttd; - -OFF FORT; -write ""; - -SHUT "$1_sm.m1"; -EOF - -cat $1_sm.m1 >> $1_sm.m -#rm -f $1_sm.m1 DELETED mttroot/mtt/bin/trans/sm_r2tex Index: mttroot/mtt/bin/trans/sm_r2tex ================================================================== --- mttroot/mtt/bin/trans/sm_r2tex +++ mttroot/mtt/bin/trans/sm_r2tex @@ -1,100 +0,0 @@ -#! /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.1 2000/12/27 16:01:35 peterg -## Initial revision -## -## Revision 1.4 1998/02/18 08:25:36 peterg -## Now uses latex_matrix for formatting -## -## 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_$2.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_$2.r"; - -%Read the symbolic parameters file -%%in "$1_sympar.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; - -MATRIX MTT_Matrix(MTTNx,MTTNx); - -OUT "$1_$2.tex"; - -%Write out the state matrices. -write "%state matrices $1"; -write "%File: $1_$2.tex"; -write""; - -MTT_Matrix := MTTA$ -MTT_Matrix_name := "MTTA"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTB$ -MTT_Matrix_name := "MTTB"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTC$ -MTT_Matrix_name := "MTTC"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTD $ -MTT_Matrix_name := "MTTD"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -SHUT "$1_$2.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/smc2ssk_r Index: mttroot/mtt/bin/trans/smc2ssk_r ================================================================== --- mttroot/mtt/bin/trans/smc2ssk_r +++ mttroot/mtt/bin/trans/smc2ssk_r @@ -1,117 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: smc2ssk_r -# controller-form state matrices to controller gain k -# P.J.Gawthrop Jan 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1998/02/09 14:16:52 peterg -## Writes end statement to the o/p file -## -## Revision 1.2 1998/01/23 09:30:36 peterg -## Fixed a sign error - the coeficients of a(s) appear with - signs in -## the A_c matrix! -## -## Revision 1.1 1998/01/22 13:16:16 peterg -## Initial revision -## -############################################################### - -Nu=`mtt_getsize $1 u` -Ny=`mtt_getsize $1 y` - -if [ "$Nu" = "1" ]; then - if [ "$Ny" = "1" ]; then - blurb=' for this siso system' - else - blurb=" using first output of $Ny" - fi -else - if [ "$Ny" = "1" ]; then - blurb=" using first input of $Nu" - else - blurb=" using first input of $Nu and using first output of $Ny" - fi -fi - -# Inform user -echo Creating $1_ssk.r $blurb - -# Remove the old log file -rm -f smc2ssk_r.log - -# Use reduce to accomplish the transformation -reduce >smc2ssk_r.log << EOF - -in "$1_def.r"; -in "$1_smc.r"; - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - - -OFF Echo; -OFF Nat; - - -%%%% Controller design %%%%% - -% gain in controller form: -matrix MTTk_c(1,MTTNx); - -matrix alpha_c(9,1); -alpha_c(1,1) := alpha_c1; -alpha_c(2,1) := alpha_c2; -alpha_c(3,1) := alpha_c3; -alpha_c(4,1) := alpha_c4; -alpha_c(5,1) := alpha_c5; -alpha_c(6,1) := alpha_c6; -alpha_c(7,1) := alpha_c7; -alpha_c(8,1) := alpha_c8; -alpha_c(9,1) := alpha_c9; - - -for i := 1:MTTNx do - MTTk_c(1,i) := alpha_c(i,1) + MTTA_c(1,i); - -% Gain in physical form -MTTk := MTTk_c*MTTT_c; - - -%Create the output file -OUT "$1_ssk.r"; - -%Write out the matrices. - -write "% - Gain matrix - controller form"; -MTT_Matrix := MTTK_c$ -MTT_Matrix_name := "MTTK_c"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "% - Gain matrix - physical form"; -MTT_Matrix := MTTK$ -MTT_Matrix_name := "MTTK"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := MTTNx$ -Reduce_Matrix()$ - -write "END;"; - -SHUT "$1_ssk.r"; -quit; - -EOF - -# Now invoke the standard error handling. -mtt_error_r smc2ssk_r.log DELETED mttroot/mtt/bin/trans/smc_r2tex Index: mttroot/mtt/bin/trans/smc_r2tex ================================================================== --- mttroot/mtt/bin/trans/smc_r2tex +++ mttroot/mtt/bin/trans/smc_r2tex @@ -1,114 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: smc_r2tex -# Reduce constrained-state matrices to LaTex constrained-state matrices. -# P.J.Gawthrop January 8th 1997 -# Copyright (c) P.J.Gawthrop, 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2000/08/24 11:43:42 peterg -## Include subs file -## -## Revision 1.1 1998/01/22 13:25:55 peterg -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_smc.tex - -# Remove the old log file -rm -f smc_r2tex.log - -# Use reduce to accomplish the transformation -$SYMBOLIC >smc_r2tex.log<< EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the smconical-form matrices file -in "$1_smc.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; -OFF EXP; -%ON Rounded; -%Precision 5; - - -OUT "$1_smc.tex"; - -%Write out the canonical matrices -write "%Canonical-form matrices $1"; -write "%File: $1_smc.tex"; -write""; - - -% Controllable form -MTT_Matrix := MTTA_c$ -MTT_Matrix_name := "MTTA_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTB_c$ -MTT_Matrix_name := "MTTB_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTC_c$ -MTT_Matrix_name := "MTTC_c"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTD_c$ -MTT_Matrix_name := "MTTD_c"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := 1$ -LaTeX_Matrix()$ - -write "% - Controllability matrix"; -MTT_Matrix := MTTCon$ -MTT_Matrix_name := "MTTCon"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% -Controllability matrix - controller form"; -MTT_Matrix := MTTCon_c$ -MTT_Matrix_name := "MTTCon_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% - Transformation matrix - controller form"; -MTT_Matrix := MTTT_c$ -MTT_Matrix_name := "MTTT_c"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - - -SHUT "$1_smc.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/smo2ssl_r Index: mttroot/mtt/bin/trans/smo2ssl_r ================================================================== --- mttroot/mtt/bin/trans/smo2ssl_r +++ mttroot/mtt/bin/trans/smo2ssl_r @@ -1,107 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: smo2ssl_r -# observer-form state matrices to Kobserver gain -# P.J.Gawthrop Jan 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/01/23 09:31:03 peterg -## Initial revision -## -############################################################### - -Nu=`mtt_getsize $1 u` -Ny=`mtt_getsize $1 y` - -if [ "$Nu" = "1" ]; then - if [ "$Ny" = "1" ]; then - blurb=' for this siso system' - else - blurb=" using first output of $Ny" - fi -else - if [ "$Ny" = "1" ]; then - blurb=" using first input of $Nu" - else - blurb=" using first input of $Nu and using first output of $Ny" - fi -fi - - -# Inform user -echo Creating $1_ssl.r $blurb - -# Remove the old log file -rm -f smo2ssl_r.log - -# Use reduce to accomplish the transformation -reduce >smo2ssl_r.log << EOF - -in "$1_def.r"; -in "$1_smo.r"; - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - -OFF Echo; -OFF Nat; - - -%%%% Observer design %%%%% -% gain in Observer form: -matrix MTTl_o(MTTNx,1); -matrix alpha_o(9,1); -alpha_o(1,1) := alpha_o1; -alpha_o(2,1) := alpha_o2; -alpha_o(3,1) := alpha_o3; -alpha_o(4,1) := alpha_o4; -alpha_o(5,1) := alpha_o5; -alpha_o(6,1) := alpha_o6; -alpha_o(7,1) := alpha_o7; -alpha_o(8,1) := alpha_o8; -alpha_o(9,1) := alpha_o9; - -for i := 1:MTTNx DO - MTTL_o(i,1) := alpha_o(i,1) + MTTA_o(i,1); - -% Gain in physical form -MTTL := MTTT_o*MTTL_o; - -%Create the output file -OUT "$1_ssl.r"; - -%Write out the matrices. - - -write "% - Observer Gain matrix - observer form"; -MTT_Matrix := MTTL_o$ -MTT_Matrix_name := "MTTL_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNy$ -Reduce_Matrix()$ - -write "% - Gain matrix - physical form"; -MTT_Matrix := MTTL$ -MTT_Matrix_name := "MTTL"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNy$ -Reduce_Matrix()$ - -write "END;"; - -SHUT "$1_ssl.r"; -quit; - -EOF - -# Now invoke the standard error handling. -mtt_error_r smo2ssl_r.log DELETED mttroot/mtt/bin/trans/smo_r2tex Index: mttroot/mtt/bin/trans/smo_r2tex ================================================================== --- mttroot/mtt/bin/trans/smo_r2tex +++ mttroot/mtt/bin/trans/smo_r2tex @@ -1,112 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: smo_r2tex -# Reduce constrained-state matrices to LaTex constrained-state matrices. -# P.J.Gawthrop January 8th 1997 -# Copyright (c) P.J.Gawthrop, 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/01/22 13:17:14 peterg -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_smo.tex - -# Remove the old log file -rm -f smo_r2tex.log - -# Use reduce to accomplish the transformation -reduce >smo_r2tex.log<< EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the observer-form matrices file -in "$1_smo.r"; - - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; -OFF EXP; -%ON Rounded; -%Precision 5; - - -OUT "$1_smo.tex"; - -%Write out the canonical matrices -write "%Canonical-form matrices $1"; -write "%File: $1_smo.tex"; -write""; - - -% Observable form -MTT_Matrix := MTTA_o$ -MTT_Matrix_name := "MTTA_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTB_o$ -MTT_Matrix_name := "MTTB_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTC_o$ -MTT_Matrix_name := "MTTC_o"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -MTT_Matrix := MTTD_o$ -MTT_Matrix_name := "MTTD_o"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -write "% - Observability matrix"; -MTT_Matrix := MTTObs$ -MTT_Matrix_name := "MTTObs"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% -Observability matrix - Observer form"; -MTT_Matrix := MTTObs_o$ -MTT_Matrix_name := "MTTObs_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - -write "% - Transformation matrix - Observer form"; -MTT_Matrix := MTTT_o$ -MTT_Matrix_name := "MTTT_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := MTTNx$ -LaTeX_Matrix()$ - - -SHUT "$1_smo.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/sort_sympar Index: mttroot/mtt/bin/trans/sort_sympar ================================================================== --- mttroot/mtt/bin/trans/sort_sympar +++ mttroot/mtt/bin/trans/sort_sympar @@ -1,40 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sort_sympar -# Sorts the symbolic parameters in a nice way. -# P.J.Gawthrop March 1998 -# Copyright (c) P.J.Gawthrop, 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/03/07 15:15:53 peterg -## Initial revision -## -############################################################### - - -# Step 1: sort by variable name -# Step 2: put all varables with same name on same line - - -sort -k 1,1 | \ -gawk '{ - var = $1; sys = $2; - if (var==oldvar) { - oldsys=sprintf("%s,%s",oldsys,sys) - } - else{ - if (length(oldvar)>0) print oldvar "\t" oldsys; - oldvar=var; oldsys=sys - } -} -END{ - print oldvar "\t" oldsys; -}' DELETED mttroot/mtt/bin/trans/ss_r2m Index: mttroot/mtt/bin/trans/ss_r2m ================================================================== --- mttroot/mtt/bin/trans/ss_r2m +++ mttroot/mtt/bin/trans/ss_r2m @@ -1,94 +0,0 @@ -#! /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 iss_r2tex.log << EOF - - -%Read the definitions file -in "$1_def.r"; - -%Read the parameter file -%%in "$1_sympar.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplifiy file -in "$1_simp.r"; - -%Read the CR file -in "$1_cr.r"; - -%Read the steady-state file -in "$1_ss.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; -%ON Rounded; -%Precision 5; - -OUT "$1_ss.tex"; -write "% - X0"; -MTT_Matrix := MTTX$ -MTT_Matrix_name := "MTTX"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -LaTeX_Matrix()$ - -write "% - U"; -MTT_Matrix := MTTU$ -MTT_Matrix_name := "MTTU"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := 1$ -LaTeX_Matrix()$ - - -write "% - Y"; -MTT_Matrix := MTTY$ -MTT_Matrix_name := "MTTY"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := 1$ -LaTeX_Matrix()$ - -write "% - dX"; -MTT_Matrix := MTTdX$ -MTT_Matrix_name := "MTTdX"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -LaTeX_Matrix()$ - -SHUT "$1_ss.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/ssk2ctf_r Index: mttroot/mtt/bin/trans/ssk2ctf_r ================================================================== --- mttroot/mtt/bin/trans/ssk2ctf_r +++ mttroot/mtt/bin/trans/ssk2ctf_r @@ -1,75 +0,0 @@ -#! /bin/sh - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ssk2ctf_r -# Controller gain k and observer gain l to controller TF -# P.J.Gawthrop Feb 1998 -# Copyright (c) P.J.Gawthrop 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/02/09 14:04:00 peterg -## Renamed matrix to cTF; -## -## Revision 1.1 1998/02/09 13:54:34 peterg -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_ctf.r - -# Remove the old log file -rm -f ssk2ctf_r.log - -# Use reduce to accomplish the transformation -reduce >ssk2ctf_r.log << EOF - -in "$1_def.r"; -in "$1_ssk.r"; -in "$1_ssl.r"; -in "$1_sm.r"; - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - - -OFF Echo; -OFF Nat; - - - -%State matrices of the compensator -A_d := MTTA - MTTL*MTTC - MTTB*MTTK; -B_d := -MTTL; -C_d := -MTTK; -D_d := 0; - -%Transfer function -MTTcTF := C_d*((s*MTTI - A_d)^(-1))*B_d; - -%Create the output file -OUT "$1_ctf.r"; -%Write out the matrices. - -write "% - Compensator TF"; -MTT_Matrix := MTTcTF$ -MTT_Matrix_name := "MTTcTF"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := MTTNy$ -Reduce_Matrix()$ - - -SHUT "$1_ctf.r"; -quit; - -EOF - -# Now invoke the standard error handling. -mtt_error_r ssk2ctf_r.log DELETED mttroot/mtt/bin/trans/ssk_r2tex Index: mttroot/mtt/bin/trans/ssk_r2tex ================================================================== --- mttroot/mtt/bin/trans/ssk_r2tex +++ mttroot/mtt/bin/trans/ssk_r2tex @@ -1,82 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ssk_r2tex -# Reduce constrained-state matrices to LaTex constrained-state matrices. -# P.J.Gawthrop January 8th 1997 -# Copyright (c) P.J.Gawthrop, 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2000/08/24 11:42:46 peterg -## Read subs file -## -## Revision 1.1 1998/01/22 13:16:30 peterg -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_ssk.tex - -# Remove the old log file -rm -f ssk_r2tex.log - -# Use reduce to accomplish the transformation -reduce >ssk_r2tex.log<< EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the smconical-form matrices file -in "$1_ssk.r"; - - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; -OFF EXP; -%ON Rounded; -%Precision 5; - - -OUT "$1_ssk.tex"; - -%Write out the canonical matrices -write "%Canonical-form matrices $1"; -write "%File: $1_ssk.tex"; -write""; - - -write "% - Gain matrix - controller form"; -MTT_Matrix := MTTK_c$ -MTT_Matrix_name := "MTTK_c"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := MTTNx$ -Latex_Matrix()$ - -write "% - Gain matrix - physical form"; -MTT_Matrix := MTTK$ -MTT_Matrix_name := "MTTK"$ -MTT_Matrix_n := 1$ -MTT_Matrix_m := MTTNx$ -Latex_Matrix()$ - -SHUT "$1_ssk.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/ssl_r2tex Index: mttroot/mtt/bin/trans/ssl_r2tex ================================================================== --- mttroot/mtt/bin/trans/ssl_r2tex +++ mttroot/mtt/bin/trans/ssl_r2tex @@ -1,78 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: ssl_r2tex -# Reduce constrained-state matrices to LaTex constrained-state matrices. -# P.J.Gawthrop January 8th 1997 -# Copyright (c) P.J.Gawthrop, 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/01/22 13:16:30 peterg -## Initial revision -## -############################################################### - - -# Inform user -echo Creating $1_ssl.tex - -# Remove the old log file -rm -f ssl_r2tex.log - -# Use reduce to accomplish the transformation -reduce >ssl_r2tex.log<< EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the obsever gains file -in "$1_ssl.r"; - -%Read the substitution file -in "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -%Read the formatting function -in "$MTTPATH/trans/latex_matrix.r"; - -OFF Echo; -OFF Nat; -OFF EXP; -%ON Rounded; -%Precision 5; - - -OUT "$1_ssl.tex"; - -%Write out the canonical matrices -write "%Canonical-form matrices $1"; -write "%File: $1_ssl.tex"; -write""; - - -write "% - Gain matrix - controller form"; -MTT_Matrix := MTTL_o$ -MTT_Matrix_name := "MTTL_o"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -Latex_Matrix()$ - -write "% - Gain matrix - physical form"; -MTT_Matrix := MTTL$ -MTT_Matrix_name := "MTTL"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -Latex_Matrix()$ - -SHUT "$1_ssl.tex"; -quit; -EOF DELETED mttroot/mtt/bin/trans/sspar2ss_r Index: mttroot/mtt/bin/trans/sspar2ss_r ================================================================== --- mttroot/mtt/bin/trans/sspar2ss_r +++ mttroot/mtt/bin/trans/sspar2ss_r @@ -1,144 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sspar2ss_r -# Reduce steady steady-state parameter file to reduce steady-state: -# X0, and Y0 and U0; -# P.J.Gawthrop 10 July 1990, 22 April 1991, Dec 1993, April 1994 -# Copyright (c) P.J.Gawthrop, 1990, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1998/11/18 11:42:55 peterg -## Added "IF MTTNx>0 THEN" to avoid error message when no states -## -## Revision 1.2 1998/07/22 15:47:28 peterg -## Now operates on ordinary differential equation file. -## -## Revision 1.1 1996/08/25 09:52:20 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_ss.r - -# Remove the old log file -rm -f sspar2ss_r.log - -# Use reduce to accomplish the transformation -$SYMBOLIC >sspar2ss_r.log << EOF - -%Read the definition file -in "$1_def.r"; - -%Read the constitutive relationships (May be used in rss file). -%in "$1_cr.r"; - -%Read the steady-state values -in "$1_sspar.r"; - -%Read in the constrained-state equation -%in "$1_cse.r"; - -%Read in the ode -in "$1_ode.r"; - -%Read the formatting function -in "$MTTPATH/trans/reduce_matrix.r"; - -OFF Echo; -OFF Nat; -OUT "$1_ss.r"; - -IF MTTNx>0 THEN - MTTdx:= MTTdx; - -%Write out the steady-state values (if any) -write "%Steady-state values"; - - -% State -MTT_Matrix := MTTX$ -MTT_Matrix_name := "MTTx"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% State derivative -MTT_Matrix := MTTdX$ -MTT_Matrix_name := "MTTdX"$ -MTT_Matrix_n := MTTNx$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Nonstate -MTT_Matrix := MTTZ$ -MTT_Matrix_name := "MTTZ"$ -MTT_Matrix_n := MTTNz$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Output -MTT_Matrix := MTTy$ -MTT_Matrix_name := "MTTy"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Zero outputs -MTT_Matrix := MTTYz$ -MTT_Matrix_name := "MTTYz"$ -MTT_Matrix_n := MTTNyz$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - -% Input -MTT_Matrix := MTTu$ -MTT_Matrix_name := "MTTu"$ -MTT_Matrix_n := MTTNu$ -MTT_Matrix_m := 1$ -Reduce_Matrix()$ - - -%Write them out by component - but only if values have been set -%(This assumes that if element 1 not set then the rest aren't either) -%ON Rounded; %Make numbers have dec. points-- nice for c -% -%clear MTTx1; -%IF MTTNx>0 THEN -%IF MTTX0(1,1) NEQ MTTX1 THEN -%FOR i := 1:MTTNx DO -%BEGIN -% write "MTTx", i, " := ", MTTX0(i,1); -%END; -% -%clear MTTu1; -%IF MTTNu>0 THEN -%IF MTTu0(1,1) NEQ MTTu1 THEN -%FOR i := 1:MTTNu DO -%BEGIN -% write "MTTu", i, " := ", MTTu0(i,1); -%END; -% -%%Derivatives are zero in the steady-state -%IF MTTNz>0 THEN -%FOR i := 1:MTTNz DO -%BEGIN -% write "MTTdz", i, " := 0"; -%END; - -write "END;"; - -SHUT "$1_ss.r"; -quit; -EOF - -# Now invoke the standard error handling. -mtt_error_r sspar2ss_r.log DELETED mttroot/mtt/bin/trans/strip_comments Index: mttroot/mtt/bin/trans/strip_comments ================================================================== --- mttroot/mtt/bin/trans/strip_comments +++ mttroot/mtt/bin/trans/strip_comments @@ -1,27 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - -# Bourne shell script: strip_comments -# Strips comments from mtt text files -# P.J.Gawthrop July 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/11/18 11:30:19 peterg -## Now strips blank lines as well -## -############################################################### - - -sed 's/%/#/' |\ -gawk --field-separator '#' '{if (length($1)>0) print $1}' |\ -gawk '{if (NF>0) print $0}' - DELETED mttroot/mtt/bin/trans/strip_notvars.sh Index: mttroot/mtt/bin/trans/strip_notvars.sh ================================================================== --- mttroot/mtt/bin/trans/strip_notvars.sh +++ mttroot/mtt/bin/trans/strip_notvars.sh @@ -1,14 +0,0 @@ -#! /bin/sh - -type=$1 -name=$2 -file=$3 - -notvar="[%|#]NOT[V|P]AR" -grep ${notvar} ${type}_lbl.txt |\ - gawk '{ printf ("%s\t%s\n", $2, name) }' name=${name} \ - >> ${file} - -grep -i pi ${type}_lbl.txt |\ - gawk '{ printf ("pi\t%s\n", name) }' name=${name} \ - >> ${file} DELETED mttroot/mtt/bin/trans/strip_pars.sh Index: mttroot/mtt/bin/trans/strip_pars.sh ================================================================== --- mttroot/mtt/bin/trans/strip_pars.sh +++ mttroot/mtt/bin/trans/strip_pars.sh @@ -1,10 +0,0 @@ -#! /bin/sh -infile=$1 -name=$2 - - - -var="[%|#][V|P]AR" -grep ${var} ${infile} |\ - gawk '{ printf ("%s\t%s\n", $2, name) }' name=${name} \ - DELETED mttroot/mtt/bin/trans/struc2gnuplot_txt2wish Index: mttroot/mtt/bin/trans/struc2gnuplot_txt2wish ================================================================== --- mttroot/mtt/bin/trans/struc2gnuplot_txt2wish +++ mttroot/mtt/bin/trans/struc2gnuplot_txt2wish @@ -1,585 +0,0 @@ -#! /bin/sh -# -*-tcl-*- - -sys=$1 - -out=${sys}_gnuplot.wish - -struc=${sys}_struc.txt -dat2=${sys}_odes.dat2 - -Nx=`mtt_getsize ${sys} x` -Ny=`mtt_getsize ${sys} y` - -## write header -cat < ${out} -#!/bin/sh -# -*-tcl-*- Next line replaces shell with wish\\ -exec wish "\$0" "\$@" - -## main window -wm title . "MTT: ${sys}" - -# menu bar -canvas .menubar - -menubutton .menubar.file -text "File" -underline 0 -menu .menubar.file.menu -menu .menubar.file.menu -.menubar.file.menu add command -label "Open (Gnuplot template)" -underline 0 -command open_plotfile -.menubar.file.menu add command -label "Save (Gnuplot template)" -underline 0 -command save_plotfile -.menubar.file.menu add separator -.menubar.file.menu add command -label "Print (PostScript)" -underline 0 -command print_postscript -.menubar.file.menu add separator -.menubar.file.menu add command -label "Quit" -underline 0 -command exit - -menubutton .menubar.edit -text "Edit" -underline 0 -menu .menubar.edit.menu -menu .menubar.edit.menu -.menubar.edit.menu add cascade -label "Axes" -underline 0 -menu .menubar.edit.menu.axes -.menubar.edit.menu add cascade -label "Contour (3D)" -underline 0 -menu .menubar.edit.menu.contour -.menubar.edit.menu add cascade -label "Data style" -underline 0 -menu .menubar.edit.menu.datastyle -.menubar.edit.menu add cascade -label "Grid" -underline 0 -menu .menubar.edit.menu.grid -.menubar.edit.menu add cascade -label "Key" -underline 0 -menu .menubar.edit.menu.key -.menubar.edit.menu add cascade -label "Timestamp" -underline 0 -menu .menubar.edit.menu.time - -menu .menubar.edit.menu.axes -.menubar.edit.menu.axes add command -label "Cartesian" -underline 0 -command { do_cmd "set nopolar ; replot" } -.menubar.edit.menu.axes add command -label "Polar" -underline 0 -command { do_cmd "set polar ; replot" } -.menubar.edit.menu.axes add cascade -label "Ranges" -underline 0 -menu .menubar.edit.menu.axes.range - -menu .menubar.edit.menu.axes.range -.menubar.edit.menu.axes.range add command -label "Set X" -underline 4 -command { do_cmd "set xrange \[[get_value "X axis range? min:max" "*:*"]\] ; replot" } -.menubar.edit.menu.axes.range add command -label "Set Y" -underline 4 -command { do_cmd "set yrange \[[get_value "Y axis range? min:max" "*:*"]\] ; replot" } -.menubar.edit.menu.axes.range add command -label "Set Z" -underline 4 -command { do_cmd "set zrange \[[get_value "Z axis range? min:max" "*:*"]\] ; replot" } - -menu .menubar.edit.menu.contour -.menubar.edit.menu.contour add command -label "Show Contour" -underline 0 -command { do_cmd "set dgrid3d ; set contour ; replot" } -.menubar.edit.menu.contour add command -label "Hide Contour" -underline 0 -command { do_cmd "set nodgrid3d ; set nocontour ; replot" } -.menubar.edit.menu.contour add cascade -label "Surface" -underline 0 -menu .menubar.edit.menu.contour.surface - -menu .menubar.edit.menu.contour.surface -.menubar.edit.menu.contour.surface add command -label "Show Surface" -underline 0 -command { do_cmd "set surface ; replot" } -.menubar.edit.menu.contour.surface add command -label "Hide Surface" -underline 0 -command { do_cmd "set nosurface ; replot" } - -menu .menubar.edit.menu.datastyle -.menubar.edit.menu.datastyle add command -label "Dots" -underline 0 -command { do_cmd "set data style dots ; replot" } -.menubar.edit.menu.datastyle add command -label "Lines" -underline 0 -command { do_cmd "set data style lines ; replot" } -.menubar.edit.menu.datastyle add command -label "Points" -underline 0 -command { do_cmd "set data style points ; replot" } - -menu .menubar.edit.menu.grid -.menubar.edit.menu.grid add cascade -label "Show Grid" -underline 0 -menu .menubar.edit.menu.grid.show -.menubar.edit.menu.grid add cascade -label "Hide Grid" -underline 0 -menu .menubar.edit.menu.grid.hide - -menu .menubar.edit.menu.grid.show -.menubar.edit.menu.grid.show add command -label "Show all ticks" -underline 5 -command { do_cmd "set grid xtics ytics ztics ; replot" } -.menubar.edit.menu.grid.show add command -label "Show X ticks" -underline 5 -command { do_cmd "set grid xtics ; replot" } -.menubar.edit.menu.grid.show add command -label "Show Y ticks" -underline 5 -command { do_cmd "set grid ytics ; replot" } -.menubar.edit.menu.grid.show add command -label "Show Z ticks" -underline 5 -command { do_cmd "set grid ztics ; replot" } - -menu .menubar.edit.menu.grid.hide -.menubar.edit.menu.grid.hide add command -label "Hide all ticks" -underline 5 -command { do_cmd "set grid noxtics noytics noztics ; replot" } -.menubar.edit.menu.grid.hide add command -label "Hide X ticks" -underline 5 -command { do_cmd "set grid noxtics ; replot" } -.menubar.edit.menu.grid.hide add command -label "Hode Y ticks" -underline 5 -command { do_cmd "set grid noytics ; replot" } -.menubar.edit.menu.grid.hide add command -label "Hide Z ticks" -underline 5 -command { do_cmd "set grid noztics ; replot" } - -menu .menubar.edit.menu.key -.menubar.edit.menu.key add command -label "Show Key" -underline 0 -command { do_cmd "set key ; replot" } -.menubar.edit.menu.key add command -label "Hide Key" -underline 0 -command { do_cmd "set nokey ; replot" } -.menubar.edit.menu.key add cascade -label "Position" -underline 0 -menu .menubar.edit.menu.key.posn - -menu .menubar.edit.menu.key.posn -.menubar.edit.menu.key.posn add command -label "Left" -underline 0 -command { do_cmd "set key left ; replot" } -.menubar.edit.menu.key.posn add command -label "Right" -underline 0 -command { do_cmd "set key right ; replot" } -.menubar.edit.menu.key.posn add command -label "Top" -underline 0 -command { do_cmd "set key top ; replot" } -.menubar.edit.menu.key.posn add command -label "Bottom" -underline 0 -command { do_cmd "set key bottom ; replot" } -.menubar.edit.menu.key.posn add command -label "Outside" -underline 0 -command { do_cmd "set key outside ; replot" } -.menubar.edit.menu.key.posn add command -label "Below" -underline 3 -command { do_cmd "set key below ; replot" } - -menu .menubar.edit.menu.time -.menubar.edit.menu.time add command -label "Show Timestamp" -underline 0 -command { do_cmd "set timestamp ; replot" } -.menubar.edit.menu.time add command -label "Hide Timestamp" -underline 0 -command { do_cmd "set notimestamp ; replot" } - -menubutton .menubar.tool -text "Tools" -underline 0 -menu .menubar.tool.menu -menu .menubar.tool.menu -.menubar.tool.menu add cascade -label "gnuplot command" -underline 0 -menu .menubar.tool.menu.gcmd -.menubar.tool.menu add cascade -label "Sort List" -underline 0 -menu .menubar.tool.menu.sort -.menubar.tool.menu add command -label "X-MTT" -underline 0 -command { exec xmtt & } - -menu .menubar.tool.menu.gcmd -.menubar.tool.menu.gcmd add command -label "Show Command" -underline 0 -command show_gnuplot_prompt -.menubar.tool.menu.gcmd add command -label "Hide Command" -underline 0 -command hide_gnuplot_prompt - -menu .menubar.tool.menu.sort -.menubar.tool.menu.sort add command -label "Left to Right" -underline 0 -command { - set sortorder "normal" - set xl [sort_list \$xl \$sortorder ] - set yl [sort_list \$yl \$sortorder ] -} -.menubar.tool.menu.sort add command -label "Right to Left" -underline 0 -command { - set sortorder "reverse" - set xl [sort_list \$xl \$sortorder] - set yl [sort_list \$yl \$sortorder] -} - -button .menubar.quit -text "Quit" -relief flat -command exit - -pack .menubar.file -expand false -fill x -side left -pack .menubar.edit -expand false -fill x -side left -pack .menubar.tool -expand false -fill x -side left -pack .menubar.quit -expand false -fill x -side right - -# list bar -canvas .listbar - -radiobutton .listbar.states -text "States" -value states -variable view -command { .parameters.list configure -listvar xl } -radiobutton .listbar.outputs -text "Outputs" -value outputs -variable view -command { .parameters.list configure -listvar yl } - -checkbutton .listbar.sort -text "Toggle Sort" -relief flat -indicatoron false -onvalue "reverse" -offvalue "normal" -variable sortorder -command { - set xl [sort_list \$xl \$sortorder ] - set yl [sort_list \$yl \$sortorder ] -} - -pack .listbar.states -expand false -fill x -side left -pack .listbar.outputs -expand false -fill x -side left -pack .listbar.sort -expand false -fill x -side right - -# side bar -canvas .plotbar - -tk_optionMenu .plotbar.select select "Select X" "Select Y" "Select Z" - -tk_optionMenu .plotbar.dim dimension "2D" "3D" - -tk_optionMenu .plotbar.plot plottype "Single" "Multi" - -pack .plotbar.dim -expand true -fill x -side right -pack .plotbar.plot -expand true -fill x -side right -pack .plotbar.select -expand true -fill x -side right - -# button bar -canvas .buttonbar - -button .buttonbar.replot -text "Refresh" -relief raised -command { do_cmd "replot" } - -button .buttonbar.newwin -text "New Plot" -relief raised -command { - set windownum [expr 1 + \$windownum] - do_cmd "set term x11 \$windownum" -} - -pack .buttonbar.newwin -expand true -side right -fill x -pack .buttonbar.replot -expand true -side right -fill x - -# rotation bar -canvas .rotationbar -scale .rotationbar.xrot -label "Rotate X" -orient h -from "0" -to "180" -command { do_rotate_3d "xrot" } -scale .rotationbar.zrot -label "Rotate Z" -orient h -from "0" -to "360" -command { do_rotate_3d "zrot" } -pack .rotationbar.xrot -side left -fill x -expand true -pack .rotationbar.zrot -side left -fill x -expand true -.rotationbar.xrot set 30 -.rotationbar.zrot set 60 - - -proc "enable_rotationbar" "" { -} -proc "disable_rotationbar" "" { -} - -## parameter list canvas -canvas .parameters -listbox .parameters.list -background oldlace -foreground black -scrollbar .parameters.yscrollbar -orient v - -## configure scrollbars -.parameters.yscrollbar configure -command ".parameters.list yview" -.parameters.list configure -yscrollcommand ".parameters.yscrollbar set" - -## bind lists -bind .parameters.list <> { - set parameter [ .parameters.list get anchor ] - plot \$parameter - set select "Select Y" -} - -proc "reverse_name" "name" { - set delim "_" - set split_name [split \$name \$delim] - set reversed_name [lindex \$split_name 0] - for {set i 1} {\$i<[llength \$split_name]} {incr i} { - set reversed_name [lindex \$split_name \$i]\$delim\$reversed_name - } - return \$reversed_name -} - -proc "reverse_sort" "list" { - set temp_list {} - set delim " " - foreach name [split \$list \$delim] { - set temp_list \$temp_list\$delim[reverse_name \$name] - } - set temp_list [lsort -ascii \$temp_list] - set list {} - foreach name [split \$temp_list \$delim] { - set list \$list\$delim[reverse_name \$name] - } - return \$list -} - -proc "sort_list" "list sortorder" { - switch -- \$sortorder { - normal { return [lsort -ascii \$list] } - reverse { return [reverse_sort \$list] } - } -} - -EOF - -## create states and outputs lists -gawk ' -($1 == "state") { - name=sys"__"; - label=$4; - sub (name, "", label); - printf "lappend xl %s\n", label -} -($1 == "output") { - name=sys"__"; - label=$4; - sub (name, "", label); - printf "lappend yl %s\n", label -}' sys=${sys} ${struc} >> ${out} - -cat <> ${out} -lappend xl Time -lappend yl Time -.parameters.list configure -listvar yl - -pack .menubar -expand false -fill x -side top -pack .listbar -expand false -fill x -side top -pack .rotationbar -expand false -fill x -side bottom -pack .plotbar -expand false -fill x -side bottom -pack .buttonbar -expand false -fill x -side bottom -pack .parameters.yscrollbar -expand false -fill y -side right -pack .parameters.list -expand true -fill both -side left -pack .parameters -expand true -fill both - -## map names to column numbers -proc "get_state_column" "title" { - switch -- \$title { -EOF - - gawk '($1 == "state") { - name=sys"__"; - label=$4; - sub (name, "", label); - printf "\t\t%s\t{ return %d }\n", label, $2+2+Ny; - } - ' Ny=${Ny} sys=${sys} ${struc} >> ${out} - -cat <> ${out} - } -} - -proc "get_output_column" "title" { - switch -- \$title { -EOF - - gawk '($1 == "output") { - name=sys"__"; - label=$4; - sub (name, "", label); - printf "\t\t%s\t{ return %d }\n", label, $2+1; - } - ' Ny=${Ny} sys=${sys} ${struc} >> ${out} - -cat <> ${out} - } -} - -proc "plot" "title" { - global dimension - global select - global view - global xcolumn - global ycolumn - global zcolumn - global xtitle - global ytitle - global ztitle - if {"\$title" == "Time"} { - set column 1 - } else { - switch -- \$view { - states { set column [get_state_column \$title] } - outputs { set column [get_output_column \$title] } - } - } - switch -- \$select { - "Select X" { - set xcolumn \$column - set xtitle \$title - } - "Select Y" { - set ycolumn \$column - set ytitle \$title - } - "Select Z" { - set zcolumn \$column - set ztitle \$title - set dimension "3D" - } - } - plot_var -} - -## call gnuplot -proc "plot_var" "" { - global xcolumn - global ycolumn - global zcolumn - global xtitle - global ytitle - global ztitle - global dimension - global plottype - global lastplot - switch -- \$dimension { - 2D { - disable_rotationbar - switch -- \$plottype { - Single { - do_cmd "set xlabel '\$xtitle'" - do_cmd "set ylabel '\$ytitle'" - do_cmd "set nokey" - do_cmd "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle x:\$xtitle' " - } - Multi { - do_cmd "set xlabel ''" - do_cmd "set ylabel ''" - do_cmd "set key" - if {"\$lastplot" != "2D"} { - do_cmd "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle x:\$xtitle' " - } else { - do_cmd "replot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle x:\$xtitle' " - } - } - } - } - 3D { - enable_rotationbar - switch -- \$plottype { - Single { - do_cmd "set xlabel '\$xtitle'" - do_cmd "set ylabel '\$ytitle'" - do_cmd "set zlabel '\$ztitle'" - do_cmd "set nokey" - do_cmd "splot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle y:\$ytitle x:\$xtitle' " - } - Multi { - do_cmd "set xlabel ''" - do_cmd "set ylabel ''" - do_cmd "set zlabel ''" - do_cmd "set key" - if {"\$lastplot" != "3D"} { - do_cmd "splot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle y:\$ytitle x:\$xtitle' " - } else { - do_cmd "replot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle y:\$ytitle x:\$xtitle' " - } - } - } - } - } - set lastplot \$dimension -} -## open gnuplot plot file -proc "open_plotfile" "" { - global parameter - if {"\$parameter"==""} { - set name "${sys}.plt" - } else { - set name "\$parameter.plt" - } - set filename [tk_getOpenFile\ - -initialdir ".."\ - -initialfile "\$name"\ - -defaultextension ".plt"\ - -filetypes { - {{Gnuplot} {.plt}} - {{All files} {*}} - } - ] - do_cmd "load '\$filename'" -} - -## save gnuplot plot file -proc "save_plotfile" "" { - global parameter - if {"\$parameter"==""} { - set name "${sys}.plt" - } else { - set name "\$parameter.plt" - } - set filename [tk_getSaveFile\ - -initialdir ".."\ - -initialfile "\$name"\ - -defaultextension ".plt"\ - -filetypes { - {{Gnuplot} {.plt}} - {{All files} {*}} - } - ] - do_cmd "save '\$filename'" -} - -## print output to postscript -proc "print_postscript" "" { - global parameter - global windownum - set filename [tk_getSaveFile\ - -initialdir ".."\ - -initialfile "\$parameter.ps"\ - -defaultextension ".ps"\ - -filetypes { - {{Postscript} {.ps}} - {{All files} {*}} - } - ] - if {\$filename != ""} { - do_cmd "set term postscript" - do_cmd "set output '\$filename'" - do_cmd "replot" - do_cmd "set term x11 \$windownum" - tk_dialog ".printed" "Graph Printed!" "PostScript saved as \$filename" "" "0" "Close" - } -} - -proc "get_value" "string initial" { - frame .f - frame .f.buttons - global get_value_retval - global get_value_status - set get_value_retval "" - set get_value_status "" - - button .f.buttons.ok -text "ok" -command { - set get_value_status "ok" - set get_value_retval [.f.entry get ] - destroy .f - } - button .f.buttons.cancel -text "Cancel" -command { - set get_value_status "cancel" - destroy .f - } - entry .f.entry - label .f.label -text "\$string" - - .f.entry insert 0 "\$initial" - bind .f.entry <> { - set get_value_status "ok" - set get_value_retval [.f.entry get ] - destroy .f - } - - pack .f.buttons.ok -side left -expand false - pack .f.buttons.cancel -side left -expand false - pack .f.label -side top -expand false - pack .f.entry -side top -expand false - pack .f.buttons -side top -expand false - place .f -in .parameters -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside - tkwait variable get_value_retval - if {"\$get_value_status" == "ok"} { - return "\$get_value_retval" - } else { - return "" - } -} - -proc "get_scale" "string min max" { - frame .f - frame .f.buttons - global get_scale_retval - global get_scale_status - set get_scale_retval "" - set get_scale_status "" - - button .f.buttons.ok -text "ok" -command { - set get_scale_status "ok" - set get_scale_retval [.f.scale get ] - destroy .f - } - button .f.buttons.cancel -text "Cancel" -command { - set get_scale_status "cancel" - destroy .f - } - scale .f.scale -orient h -label "\$string" -from "\$min" -to "\$max" - - pack .f.buttons.ok -side left -expand false - pack .f.buttons.cancel -side left -expand false - pack .f.scale -side top -expand false - pack .f.buttons -side top -expand false - place .f -in .parameters -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside - tkwait variable get_value_retval - if {"\$get_scale_status" == "ok"} { - return "\$get_scale_retval" - } else { - return "" - } -} - -proc "do_rotate_3d" "var val" { - switch -- \$var { - xrot { - do_cmd "set view \$val,,, ; replot" - } - zrot { - do_cmd "set view ,\$val,, ; replot" - } - } -} - -proc "show_gnuplot_prompt" "" { - global gnuplot_command - destroy .gcmd - canvas .gcmd - label .gcmd.l -text ">" - entry .gcmd.e -textvariable gnuplot_command - button .gcmd.b -text "<-" -relief flat -command { set gnuplot_command "" } - pack .gcmd.b -side right - pack .gcmd.l -side left - pack .gcmd.e -side top -fill x -expand true - pack .gcmd -expand false -fill x -side bottom -before .rotationbar - focus .gcmd.e - bind .gcmd.e <> { - do_cmd "[.gcmd.e get]" - } -} -proc "hide_gnuplot_prompt" "" { - destroy .gcmd -} - -proc "do_cmd" "string" { - global gnuplot_command - set gnuplot_command "\$string" - puts "\$string" -} - -event add <> - -# Defaults -set parameter "" -set windownum 0 -set view outputs -set lastplot "" -set select "Select Y" -set xcolumn 1 ; set xtitle "Time" -set ycolumn 1 ; set ytitle "Time" -set zcolumn 1 ; set ztitle "Time" - -do_cmd "set mouse" -do_cmd "set timestamp" -do_cmd "set grid" -do_cmd "set nopolar" -do_cmd "set term X11 0" -do_cmd "set key" -do_cmd "set data style lines" - -EOF -chmod +x ${out} DELETED mttroot/mtt/bin/trans/struc2input_txt2txt Index: mttroot/mtt/bin/trans/struc2input_txt2txt ================================================================== --- mttroot/mtt/bin/trans/struc2input_txt2txt +++ mttroot/mtt/bin/trans/struc2input_txt2txt @@ -1,130 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: struc2input_txt2txt -# Creates the deafault numerical parameters file for the system (txt) - -# Copyright (c) P.J.Gawthrop 1997 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.15 2000/12/28 12:44:31 peterg -## *** empty log message *** -## -## 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 -## Added -ss option -## -## Revision 1.10 1998/07/27 11:10:38 peterg -## Put in octave-mode line for Emacs -## -## Revision 1.9 1998/07/25 20:10:37 peterg -## lower case mttu -## -## Revision 1.8 1998/07/25 09:42:09 peterg -## Just sets finrst input to 1 - rest to zero -## -## Revision 1.7 1998/07/25 08:05:41 peterg -## Reverted to original default - not using SS mechanism -## -## Revision 1.6 1998/02/24 10:14:56 peterg -## Now defaults to the steady-state values -## -## Revision 1.5 1998/02/04 12:26:47 peterg -## Simplified output format -## -## Revision 1.4 1998/02/04 11:45:05 peterg -## Less verbose comments. -## -## Revision 1.3 1998/01/29 17:06:21 peterg -## Better annotation of each input -## -## Revision 1.2 1997/05/15 09:44:12 peterg -## Put switches into the input file. -## -# Revision 1.1 1997/05/03 14:55:17 peterg -# Initial revision -# -############################################################### - -#Look for a command line argument -# By default, don't look for BG switches - -while [ -n "`echo $1 | grep '-'`" ]; do - case $1 in - -ss ) - steadystate_computation=yes ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -# Default input -default='1.0' - -#Create the input file complete with headers. -echo '# -*-octave-*- Put Emacs into octave-mode' > $1_input.txt -echo "# Input specification ($1_input.txt)" >> $1_input.txt -echo "# Generated by MTT at `date`" >> $1_input.txt -cat $MTTPATH/trans/rcs_header.sh >> $1_input.txt -echo "# Set the inputs" >> $1_input.txt - -if [ -n "$steadystate_computation" ]; then -# Compute inputs from ss.r file -# Inform user -echo Creating $1_input.txt - compute from steady-state information - -cat $1_ss.r $1_struc.txt | sed 's/\$//' |\ -gawk '{ - if(match($1,"MTTu")>0) { - j++ - split($0,a,"="); - u[j]=a[2]; - } - - if($1=="input") { - i++; - 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 - -gawk '{ - 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 |\ -# gawk '{if (length($1)>0) print tolower($1) "= (t>=0);"}' >> $1_input.txt - - - DELETED mttroot/mtt/bin/trans/struc2sspar_txt2r Index: mttroot/mtt/bin/trans/struc2sspar_txt2r ================================================================== --- mttroot/mtt/bin/trans/struc2sspar_txt2r +++ mttroot/mtt/bin/trans/struc2sspar_txt2r @@ -1,43 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: struc2sspar_txt2txt -# Creates the deafault numerical parameters file for the system (txt) - -# Copyright (c) P.J.Gawthrop 1998 - - -# Inform user -echo Creating $1_sspar.r - - -#Write out the default ss values (0) -#Create the sspar file complete with headers. -echo "% Steady-state parameter file ($1_sspar.r)" > $1_sspar.r -echo "% Generated by MTT at `date`" >> $1_sspar.r -cat $MTTPATH/trans/rcs_header.m >> $1_sspar.r - -echo >> $1_sspar.r - -echo "% Steady-state states" >> $1_sspar.r -gawk '{ - if ($1=="state") - print "MTTX" $2 " := \t0; % " $4 " (" $3 ")" -}' \ - $1_struc.txt >> $1_sspar.r - - -echo "% Steady-state inputs" >> $1_sspar.r -gawk '{ - if ($1=="input") - print "MTTU" $2 " := \t0; % " $4 " (" $3 ")" -}' \ - $1_struc.txt >> $1_sspar.r - - -echo ";;END;" >> $1_sspar.r - - DELETED mttroot/mtt/bin/trans/struc2state_txt2txt Index: mttroot/mtt/bin/trans/struc2state_txt2txt ================================================================== --- mttroot/mtt/bin/trans/struc2state_txt2txt +++ mttroot/mtt/bin/trans/struc2state_txt2txt @@ -1,104 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: struc2state_txt2txt -# Creates the default state file for the system (txt) - -# Copyright (c) P.J.Gawthrop 1998 - - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.10 2000/10/16 08:20:23 peterg -# %% New version with direct naming. -# %% Note ss version is broken - ss.r file in wrong format -# %% -# %% Revision 1.9 2000/10/10 21:03:06 peterg -# %% *** empty log message *** -# %% -# %% Revision 1.8 1998/08/10 13:57:33 peterg -# %% Removed debugging lines -# %% -# %% Revision 1.7 1998/08/10 13:55:11 peterg -# %% Added option of computing from ss values -# %% -# %% Revision 1.6 1998/07/27 20:32:11 peterg -# %% Octave mode forced -# %% -# %% Revision 1.5 1998/07/25 20:10:01 peterg -# %% Lower case mttx -# %% -# %% Revision 1.4 1998/07/25 09:42:37 peterg -# %% Now writes out an array -# %% -# %% Revision 1.3 1998/07/25 08:11:35 peterg -# %% No longer used the SS method - just sets zero states -# %% -# %% Revision 1.2 1998/07/21 16:54:15 peterg -# %% Changed erroneous header -# %% -# %% Revision 1.1 1998/06/27 15:06:40 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -while [ -n "`echo $1 | grep '-'`" ]; do - case $1 in - -ss ) - steadystate_computation=yes ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -# Default state -default='0.0' - -#Create the state file complete with headers. -echo '# -*-octave-*- Put Emacs into octave-mode' > $1_state.txt -echo "# Initial state file ($1_state.txt)" >> $1_state.txt -echo "# Generated by MTT at `date`" >> $1_state.txt -cat $MTTPATH/trans/rcs_header.sh >> $1_state.txt - -#Write out the defaults -- states to steady-state values -echo "# Set the states" >> $1_state.txt - -if [ -n "$steadystate_computation" ]; then -# Compute state from ss.r file -# Inform user -echo Creating $1_state.txt - compute from steady-state information - -cat $1_ss.r $1_struc.txt | sed 's/\$//' |\ -gawk '{ - if(match($1,"MTTx")>0) { - j++ - split($0,a,"="); - x[j]=a[2]; - } - - if($1=="state") { - i++; - # print "x(" i ") =\t", x[i], " \# " $4 " (" $3 ")" - printf("%s =\t%s; # MTT initial value\n", $4, x[i]); - } -}' >> $1_state.txt -else -# Set states to zero -# Inform user -echo Creating $1_state.txt - default states to $default - -gawk '{ - if ($1=="state") printf("%s \t= %s; # MTT initial value\n", $4, default) -}' default=$default <$1_struc.txt >> $1_state.txt - -fi - - DELETED mttroot/mtt/bin/trans/struc2switch_txt Index: mttroot/mtt/bin/trans/struc2switch_txt ================================================================== --- mttroot/mtt/bin/trans/struc2switch_txt +++ mttroot/mtt/bin/trans/struc2switch_txt @@ -1,66 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: struc2switch_txt - -# Structure file - generate a file for switching on states -# P.J.Gawthrop May 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2001/08/02 03:01:08 geraint -## Stopped initialisation of mttopen from over-writing logic.txt contents. -## - comment removed from "sort" input (which put it last) because -## initialisation is inserted in place of the comment by switch_txt2m. -## -## Revision 1.5 2000/10/17 09:20:00 peterg -## *** empty log message *** -## -## Revision 1.4 1998/07/26 10:28:30 peterg -## Added a header line to avoid empty file and to trigger -## switch_txt2m to write initial stuff. -## -## Revision 1.3 1998/07/25 18:50:53 peterg -## Lower case names -## -## Revision 1.2 1997/06/03 15:17:09 peterg -## Changed label to MTT_SWITCH -## -# Revision 1.1 1997/05/13 16:58:59 peterg -# Initial revision -# -############################################################### - - - - -echo Creating $1_switch.txt - -rm -f $1_switch.txt -echo "# These are the switches deduced from ISW and CSW components"\ - > $1_switch.txt - -# This is the main transformation using awk -gawk '{ - if ($1=="state") {i++; if ($3=="MTT_SWITCH") print tolower($4) "\t" i}; -} -END{ -} -' < $1_struc.txt| sort >> $1_switch.txt - -strip_comments < $1_switch.txt | wc -l | gawk '{print $1 " switches found"}' - - - - - - - - DELETED mttroot/mtt/bin/trans/struc_txt2m Index: mttroot/mtt/bin/trans/struc_txt2m ================================================================== --- mttroot/mtt/bin/trans/struc_txt2m +++ mttroot/mtt/bin/trans/struc_txt2m @@ -1,86 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: struc_txt2m - -# Structure file - txt to m conversion -# P.J.Gawthrop April 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 2002/04/28 18:55:03 geraint -## Fixed [ 549658 ] awk should be gawk. -## Replaced calls to awk with call to gawk. -## -## Revision 1.3 2001/10/15 14:20:27 gawthrop -## Now handles the cases where ny or nx or nu are zero -## -## Revision 1.2 2001/03/19 02:28:52 geraint -## Branch merge: merging-ode2odes-exe back to MAIN. -## -## Revision 1.1.2.1 2001/03/06 03:52:15 geraint -## Put back struc_txt2m - required by mtt2sys. -## -############################################################### - - - -# Inform user -echo "Creating $1_struc.m" - -rm -f mtt_error - -#Write some file headers -echo "function [input_name,output_name,state_name] = $1_struc" > $1_struc.m -echo "%% Usage: [input_name,output_name,state_name] = $1_struc" >> $1_struc.m -echo "%% Structure file ($1_struc.m)" >> $1_struc.m -echo "%% Generated by MTT at `date`" >> $1_struc.m - -cat >> $1_struc.m <> $1_struc.m 2>mtt_error.txt - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/struc_txt2mstruc Index: mttroot/mtt/bin/trans/struc_txt2mstruc ================================================================== --- mttroot/mtt/bin/trans/struc_txt2mstruc +++ mttroot/mtt/bin/trans/struc_txt2mstruc @@ -1,67 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: struc_txt2m - -# Structure file - txt to m-structure conversion -# Copyright (C) 2003 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -sys=$1 -infile=${sys}_struc.txt -fun=${sys}_mstruc -outfile=${fun}.m - -#Inform user -echo Creating ${outfile} - -create_header() { - cat <${outfile} -create_structure >>${outfile} -create_footer >>${outfile} - DELETED mttroot/mtt/bin/trans/struc_txt2tex Index: mttroot/mtt/bin/trans/struc_txt2tex ================================================================== --- mttroot/mtt/bin/trans/struc_txt2tex +++ mttroot/mtt/bin/trans/struc_txt2tex @@ -1,97 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: struc_txt2tex - -# Structure file - text to TeX table conversion -# P.J.Gawthrop April 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 2000/12/28 12:46:59 peterg -## Put under RCS -## -# Revision 1.3 1997/12/06 19:10:41 peterg -# Reverted to tabular --- from supertabular -# -# Revision 1.2 1997/04/15 11:17:58 peterg -# Uses supertabular for long tables. -# -# Revision 1.1 1997/04/15 09:49:04 peterg -# Initial revision -# -############################################################### - - -# Inform user -echo "Creating $1_struc.tex" - -rm -f mtt_error - -#Write some file headers -echo "%% Structure file ($1_struc.txt)" > $1_struc.tex -echo "%% Generated by MTT at `date`" >> $1_struc.tex - -# This is the main transformation using awk -sed 's/_/\\_/g' < $1_struc.txt | gawk ' -function header(what){ - print " \\centering"; - print " \\tablefirsthead{\\hline %"; - print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM "} \\\\"; - print " \\hline"; - print " & Component & System & Repetition \\\\"; - print " \\hline}"; - - print " \\tablehead{\\hline %"; - print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM " (continued)} \\\\"; - print " \\hline"; - print " & Component & System & Repetition \\\\"; - print " \\hline}"; - - print " \\tabletail{\\hline}"; - print " \\begin{supertabular}{|l|l|l|l|}"; -} -#function header(what){ -# print "\\begin{table}[htbp]"; -# print " \\centering"; -# print " \\begin{tabular}{|l|l|l|l|}"; print " \\hline"; -# print " & Component & System & Repetition \\\\"; -# print " \\hline"; -#} -function footer(what){ - print " \\hline"; - print " \\end{supertabular}"; -# print " \\end{tabular}"; -# print " \\caption{" what "}"; -# print "\\end{table}"; - print " \\bigskip"; - print " \\bigskip"; -} - -BEGIN{ -Which="" -} -{ - if ($1!=Which) { - if (Which!="") footer(Which); - header($1); - } - print $2, "&", $3,"&", $4, "&", $5, "\\\\"; - Which = $1; -} -END{ - footer(Which) -} -' SYSTEM=$1 >> $1_struc.tex 2>mtt_error.txt - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/sub2subs Index: mttroot/mtt/bin/trans/sub2subs ================================================================== --- mttroot/mtt/bin/trans/sub2subs +++ mttroot/mtt/bin/trans/sub2subs @@ -1,29 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sub2subs -# Generates a list of all subsystems associated with system $1 - -# P.J.Gawthrop May 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -# echo the name of the subsystems one level down -sh $1\_sub.sh "echo " - -# Create the corresponding subsystems -- quietly! -#(sh $1\_sub.sh "mtt -q " " sub sh") #>/dev/null -(sh $1\_sub.sh " cmp2sub_m2sh " " ") >/dev/null - - -# Recursively execute the subsystem files -sh $1\_sub.sh "sub2subs " - - - - - - - DELETED mttroot/mtt/bin/trans/sub_sh2tex Index: mttroot/mtt/bin/trans/sub_sh2tex ================================================================== --- mttroot/mtt/bin/trans/sub_sh2tex +++ mttroot/mtt/bin/trans/sub_sh2tex @@ -1,161 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sub_sh2tex -# Converts _sub_sh files to a latex itemized list. -# P.J.Gawthrop May 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 2004/08/26 16:15:40 geraint -## Counts abg.m instead of fig files so that dia models are also included. -## -## Revision 1.5 2004/02/10 16:11:01 gawthrop -## Removed debug -## -## Revision 1.4 2004/02/10 10:22:10 gawthrop -## Do proper arithmetic via let -## Three levels of output -## enumerate, not itemize -## -## Revision 1.3 2004/02/10 10:13:05 gawthrop -## Handles #SUMMARY correctely -## Refined count of subsystems within fig file (avoilds ports with same -## name as system -## -## Revision 1.2 2004/02/10 09:51:07 gawthrop -## Updated obsolete path name. -## -## Revision 1.1 2000/12/27 16:04:08 peterg -## Initial revision -## -## Revision 1.7 1998/02/04 10:59:37 peterg -## Tidied up. -## -# Revision 1.6 1997/09/08 19:42:37 peterg -# Replaced copy by compcopy -# -## Revision 1.5 1997/08/15 11:20:13 peterg -## Explicitly copies compound components (if not already there) -## -# Revision 1.4 1997/06/24 08:28:26 peterg -# Now takes %SUMMARY description from the label file -# Appends count of number of subsystems at that level -# -## Revision 1.3 1997/05/21 10:07:36 peterg -## Fixed \ probs for GNU sh/echo -## -## Revision 1.2 1997/05/19 16:46:17 peterg -## *** empty log message *** -## -# Revision 1.1 1997/05/19 11:29:44 peterg -# Initial revision -# -############################################################### - - -#Useful strings -quote="'"; -listtype="enumerate" - -# Maximum list depth -# Just go to 3 levels -maxlevel=3; - -#Look for a command line argument -labels=''; arg=''; -while [ -n "`echo $1 | grep '-'`" ]; do - case $1 in - -l ) - labels='yes'; arg='-l' ;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - - -system=$1 -filename=$2 - - -if [ -z "$3" ]; then - level=0; -else - level=$4; -fi -echo "level: $level" -#Top-level commands -if [ -z "$2" ]; then - filename="$1_sub.tex" - - # Inform user - echo "Creating $filename" - - #Write some file headers - echo "% Subsystem file for system $system ($filename)" > $filename - echo "% Generated by MTT at `date`" >> $filename - echo >> $filename -fi - -# Write list item if not at the top level. -if [ -n "$2" ]; then - #Set up some names - filename=$2 - abgfile=$3_abg.m - lblfile=$1_lbl.txt - summary='[%|#]SUMMARY' - - #Get the system description, copying where necesary - mtt -q -u compcopy $system $MTT_LIB/comp/compound - # mtt -q -u $system lbl txt - desc=`grep $summary $lblfile | sed "s/$summary//"` - - #Count the number of subsystems - subs=`grep -c " $system" $abgfile` - - if [ "$labels" = "yes" ]; then - echo ' \item '$desc ' ('$subs') Section \Ref{sec:'$system'}' >> $filename - else - echo ' \item' $desc ' ('$subs')' >> $filename - fi -fi - -# Create the subsystem sh files (if not too deep) -if [ "$level" != "$maxlevel" ]; then - mtt -q -u -l 1 $system sub sh - - # Write the list of subsystems (if they exist). - n_subsystems=`grep -c '$1' $1_sub.sh` - - if [ "$n_subsystems" != "0" ]; then - cat <> $filename - \begin{$listtype} -EOF - # Recursively generate the subsystems - level1=$(( $level + 1 )) - sh $system\_sub.sh "sub_sh2tex $arg " " $filename $system $level1" - cat <> $filename - \end{$listtype} -EOF -#else -# cat <> $filename -# No subsystems. -#EOF -fi -fi - - - - - - - - DELETED mttroot/mtt/bin/trans/switch_txt2m Index: mttroot/mtt/bin/trans/switch_txt2m ================================================================== --- mttroot/mtt/bin/trans/switch_txt2m +++ mttroot/mtt/bin/trans/switch_txt2m @@ -1,155 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: switch_txt2m - -# Convert switch file from txt to m -# P.J.Gawthrop May 1997 -# Copyright (c) P.J.Gawthrop, 1997. - - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.15 2000/12/04 08:23:25 peterg -## Put logic in-line - avoids the if statements -## -## Revision 1.14 2000/11/09 10:29:21 peterg -## open --> mtt_open -## -## Revision 1.13 2000/11/09 10:19:12 peterg -## Explicitly write out the open switches .... -## -## Revision 1.12 2000/11/09 09:52:07 peterg -## Removed [] from zero_state output -## -## Revision 1.11 2000/10/17 09:55:55 peterg -## Now writes to standard output -## Write the name, not the array -## -## Revision 1.10 2000/10/17 09:04:12 peterg -## *** empty log message *** -## -## Revision 1.9 1999/08/02 12:44:21 peterg -## zero_vector --> zero_state. -## -## Revision 1.8 1999/04/20 00:55:40 peterg -## Changed <= to < in switchopen.m -## Removed switch.m generation - redundant -## -## Revision 1.7 1999/04/02 06:30:37 peterg -## New _switchopen -## Removed switcha -## -## Revision 1.6 1998/10/01 18:20:50 peterg -## Split up the three if conditions on the switch and state value into -## three separate ifs. This is because p2c seems to generate incorrect -## code id just the one if is used (???). -## -## Revision 1.5 1998/10/01 16:05:34 peterg -## Separate switch.m file for euler and implicit integration -## -############################################################### - - -# Find system constants -Nx=`mtt_getsize $1 x` # States - -#Write some file headers -#lang_header $1 switch m 'mttx' '[mttx]' > $1_switch.m - -#echo Creating $1_switch.m -# Set states to zero -# gawk '{ -# if ($1=="#"){ -# printf("#== Switches set element of state vector to zero ==#\n") -# } -# else{ -# printf("\n#== Switch: %s ==#\n",$1) -# printf("if (%s==0.0) \n", $1); -# printf(" mttx(%s)=0.0;\n", $2); -# printf("end;\n"); -# printf("if (%s<0.0)\n",$1); -# printf(" if (mttx(%s)<=0.0)\n",$2); -# printf(" mttx(%s)=0.0;\n", $2); -# printf(" end;\n"); -# printf("end;\n"); - -# } -# }' Nx=$Nx < $1_switch.txt >> $1_switch.m - -## Set index version -#echo Creating $1_switchopen.m - -#Write some file headers -#lang_header $1 switchopen m 'mttx' '[open]' > $1_switchopen.m - -## Add the switching logic -#cat >> $1_switchopen.m <> $1_switchopen.m - -# Set states to zero -gawk '{ - if ($1=="#"){ - printf("#== mttopen - boolean vector of open switches ==#\n") - for (i=1;i<=Nx;i++) - printf("mttopen(%i) = 0; # Default to not open\n", i); - } - else{ - printf("\n#== Switch: %s ==#\n",$1) - printf("mttopen(%s) = (abs(%s_logic)<0.5)||((%s_logic<0.0)&&(%s<0.0));\n", $2, $1, $1, $1); -# printf("if (%s_logic==0.0) \n", $1); -# printf(" mttopen(%s) = 1;\n", $2); -# printf("end;\n"); -# printf("if (%s_logic<0.0)\n",$1); -# printf(" if (%s<0.0)\n",$1); -# printf(" mttopen(%s) = 1;\n", $2); -# printf(" end;\n"); -# printf("end;\n"); - - } -}' Nx=$Nx < $1_switch.txt #>> $1_switchopen.m - -#echo Creating $1_switcha.m - -# Implicit integration version -#Write some file headers -# lang_header $1 switcha m 'mttAA,mttx' '[mttAA]' > $1_switcha.m -# gawk '{ -# if ($1=="#"){ -# printf("#== Switches set row and column of A matrix to zero ==#\n") -# } -# else{ -# printf("#== Switch: %s ==#\n",$1) -# printf("if (%s==0.0) \n", $1); -# printf(" for MTTi=1:%s\n",Nx) -# printf(" mttAA(MTTi,%s)=0.0;\n", $2) -# printf(" mttAA(%s,MTTi)=0.0;\n", $2) -# printf(" end;\n"); -# printf(" mttAA(%s,%s) = 1.0;\n", $2,$2); -# printf("end;\n\n") -# -# printf("if (%s<0.0)\n",$1); -# printf(" if (mttx(%s)<=0.0)\n",$2); -# printf(" for MTTi=1:%s\n",Nx) -# printf(" mttAA(MTTi,%s)=0.0;\n", $2) -# printf(" mttAA(%s,MTTi)=0.0;\n", $2) -# printf(" end;\n"); -# printf(" mttAA(%s,%s) = 1.0;\n", $2,$2); -# printf(" end;\n"); -# printf("end;\n"); -# -# } -# }' Nx=$Nx < $1_switch.txt >> $1_switcha.m - - - DELETED mttroot/mtt/bin/trans/sympar2global_txt2lang Index: mttroot/mtt/bin/trans/sympar2global_txt2lang ================================================================== --- mttroot/mtt/bin/trans/sympar2global_txt2lang +++ mttroot/mtt/bin/trans/sympar2global_txt2lang @@ -1,94 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar2global_txt2lang - -# Symbolic parameters to default paramers in computer language -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997. - - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 1998/11/18 11:55:51 peterg -## Now uses sympar2global_txt2m for the m bit -## -## Revision 1.5 1998/07/26 11:00:18 peterg -## Put in exits-- this all needs a good clean -## -## Revision 1.4 1998/07/26 10:50:30 peterg -## Corrected bug. -## -## Revision 1.3 1998/07/26 10:48:18 peterg -## Now strips comments -## -## Revision 1.2 1998/07/25 18:49:00 peterg -## Now uses extended sympars -- sympar + switches -## -## Revision 1.1 1998/06/15 15:24:33 peterg -## Initial revision -## -############################################################### - -# Set up language stuff. -language=$2 - -case $language in - m) - Lc='#'; - Rc='#'; - ;; - c) - Lc='/*'; - Rc='*/'; - ;; - java) - Lc='/*'; - Rc='*/'; - ;; - *) - echo Language $2 not supported - sorry; exit 1 -esac - -cat <0)) { - printf ("global"); - globals_exist=1 - } - if (NF>0) - printf (" ...\n %s", tolower($1)); -} -END{ - if (globals_exist) - print " ;" -}' - -# Now invoke the standard error handling. -# mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/sympar2numpar_r2c Index: mttroot/mtt/bin/trans/sympar2numpar_r2c ================================================================== --- mttroot/mtt/bin/trans/sympar2numpar_r2c +++ mttroot/mtt/bin/trans/sympar2numpar_r2c @@ -1,97 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar2numpar_r2m -# Creates the deafault numerical parameters file for the system - -# Copyright (c) P.J.Gawthrop 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1997/01/21 11:36:26 peterg -## Initial revision -## -############################################################### - -# Inform user -echo Creating $1_numpar.c - -# Remove the old log file -rm -f sympar2numpar_r2c.log - -# Use reduce to accomplish the transformation -reduce >sympar2numpar_r2c.log 2>mtt_error.txt << EOF - -%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"; - -OUT "$1_numpar1.c"; - -IF MTTNvar>0 THEN -BEGIN - FOR i := 1:MTTNvar DO - IF numberp(MTTVar(i,1)) - THEN - BEGIN - % Do nowt - END - ELSE - BEGIN - write "extern float ", MTTVar(i,1)$ - END; -END; - - -IF MTTNvar>0 THEN -BEGIN - FOR i := 1:MTTNvar DO - IF numberp(MTTVar(i,1)) - THEN - BEGIN - write "/* Variable ", i, " has already been set to ", MTTVar(i,1), "*/"; - END - ELSE - BEGIN - write MTTVar(i,1), " = 1; /* Default value */"; - END; -END; - - -SHUT "$1_numpar1.c"; - -EOF - -matlab_tidy $1_numpar1.c - -#Create the numpar file complete with headers. -echo "/*" > $1_numpar.c -echo "%% Numerical parameter file ($1_numpar.c)" >> $1_numpar.c -echo "%% Generated by MTT at `date`" >> $1_numpar.c -echo "*/" >> $1_numpar.c - -echo "$1_numpar()" >> $1_numpar.c -echo "{" >> $1_numpar.c -echo " extern $1_params();" >> $1_numpar.c - -cat $1_numpar1.c >> $1_numpar.c - -echo "/*" >> $1_numpar.c -echo '%% Input the user-defined parameters' >> $1_numpar.c -echo "*/" >> $1_numpar.c - -echo "$1_params;" >> $1_numpar.c -echo "};" >> $1_numpar.c - -rm $1_numpar1.c - -# Now invoke the standard error handling. -mtt_error_r sympar2numpar_r2c.log DELETED mttroot/mtt/bin/trans/sympar2numpar_r2m Index: mttroot/mtt/bin/trans/sympar2numpar_r2m ================================================================== --- mttroot/mtt/bin/trans/sympar2numpar_r2m +++ mttroot/mtt/bin/trans/sympar2numpar_r2m @@ -1,137 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar2numpar_r2m -# Creates the deafault numerical parameters file for the system - -# Copyright (c) P.J.Gawthrop 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.9 1996/09/12 19:26:05 peter -## Input _params file. -## -## Revision 1.8 1996/08/30 19:37:43 peter -## Moved headers in shell script. -## -## Revision 1.7 1996/08/24 14:11:56 peter -## Global parameter passing. -## -## Revision 1.6 1996/08/20 08:21:24 peter -## *** empty log message *** -## -## Revision 1.5 1996/08/16 14:27:25 peter -## Make a dummy function when no parameters (MTTNVar=0). -## -## Revision 1.4 1996/08/15 12:46:59 peter -## Removed a spuriuos echo. -## -## Revision 1.3 1996/08/12 20:20:59 peter -## Explicit parameters via out put list. -## Parameter conversion stuff deleted. -## -## Revision 1.2 1996/08/11 10:41:52 peter -## Fixed various bugs. -## -## Revision 1.1 1996/08/11 08:48:07 peter -## Initial revision -## -############################################################### - -# Inform user -echo Creating $1_numpar.m - -# Remove the old log file -rm -f sympar2numpar_r2m.log - -# Use reduce to accomplish the transformation -reduce >sympar2numpar_r2m.log << EOF - -%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"; - -OUT "$1_numpar1.m"; - -IF MTTNvar>0 THEN -BEGIN - write "global ...;;"; - FOR i := 1:MTTNvar DO - IF numberp(MTTVar(i,1)) - THEN - BEGIN - % Do nowt - END - ELSE - BEGIN - IF i0 THEN -BEGIN - FOR i := 1:MTTNvar DO - IF numberp(MTTVar(i,1)) - THEN - BEGIN - write "% Variable ", i, " has already been set to ", MTTVar(i,1); - END - ELSE - BEGIN - write MTTVar(i,1), " = 1; % Default value"; - END; -END; - -if MTTNVar=0 THEN - write "foo=0"; - -SHUT "$1_numpar1.m"; - -EOF - -matlab_tidy $1_numpar1.m - -#Create the numpar file complete with headers. -echo "%% Numerical parameter file ($1_numpar.m)" > $1_numpar.m -echo "%% Generated by MTT at `date`" >> $1_numpar.m -cat $MTTPATH/trans/m/rcs_header.txt >> $1_numpar.m -cat $1_numpar1.m >> $1_numpar.m - -echo '%% Input the user-defined parameters' >> $1_numpar.m -echo "$1_params;" >> $1_numpar.m - - -rm $1_numpar1.m - - -# Now invoke the standard error handling. -mtt_error_r sympar2numpar_r2m.log - - - - - - - - - - - - - - - - - - - DELETED mttroot/mtt/bin/trans/sympar2numpar_txt2txt Index: mttroot/mtt/bin/trans/sympar2numpar_txt2txt ================================================================== --- mttroot/mtt/bin/trans/sympar2numpar_txt2txt +++ mttroot/mtt/bin/trans/sympar2numpar_txt2txt @@ -1,88 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar2numpar_txt2txt -# Creates the deafault numerical parameters file for the system (txt) - -# Copyright (c) P.J.Gawthrop 1996 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.13 2000/10/16 08:09:25 peterg -## Tidied up. -## -## Revision 1.12 1999/03/02 22:01:21 peterg -## *** empty log message *** -## -## Revision 1.11 1998/06/15 15:14:46 peterg -## Don't print if blank line -## -## Revision 1.10 1998/03/07 15:27:20 peterg -## Don't do initial states. -## -## Revision 1.9 1998/02/04 12:24:35 peterg -## Simplified output format -## -## Revision 1.8 1998/01/29 17:06:36 peterg -## Better annotation -## -## Revision 1.7 1997/09/18 17:10:18 peterg -## Changed comments pertaining to the parameters to use the new column 2 -## of the sympar file (the system type). -## Added blank line to separate parmeters from states. -## (Done in the Chester Court Hotel). -## -## Revision 1.6 1997/06/13 09:34:39 peterg -## changed [] to () -## -# Revision 1.5 1997/05/15 08:30:14 peterg -# Now write default states (using _struc file). -# -# Revision 1.4 1997/05/15 07:19:19 peterg -# Put back "tolower" -# -# Revision 1.3 1997/05/15 07:13:31 peterg -# Removed "tolower" function. -# -# Revision 1.2 1997/05/01 08:19:04 peterg -# # is now used as the comment symbol -# -# Revision 1.1 1997/05/01 07:35:48 peterg -# Initial revision -# -############################################################### - -# Inform user -echo Creating $1_numpar.txt - -#Create the numpar file complete with headers. -echo '# -*-octave-*- Put Emacs into octave-mode' > $1_numpar.txt -echo "# Numerical parameter file ($1_numpar.txt)" >> $1_numpar.txt -echo "# Generated by MTT at `date`" >> $1_numpar.txt -cat $MTTPATH/trans/rcs_header.txt >> $1_numpar.txt - -#Write out the variables -echo "# Parameters" >> $1_numpar.txt -strip_comments <$1_sympar.txt |\ -gawk '{i++; if (NF>0) print tolower($1) " = \t1.0; \# " $2}'\ - >> $1_numpar.txt - -#Write out the initial states -#echo >> $1_numpar.txt -#echo "# Initial states" >> $1_numpar.txt -#gawk '{ -# if ($1=="state") -# print "x(" $2 ") = \t0.0; \# " $4 " (" $3 ")" -#}' \ -# $1_struc.txt >> $1_numpar.txt - - - - - DELETED mttroot/mtt/bin/trans/sympar2par_txt2m Index: mttroot/mtt/bin/trans/sympar2par_txt2m ================================================================== --- mttroot/mtt/bin/trans/sympar2par_txt2m +++ mttroot/mtt/bin/trans/sympar2par_txt2m @@ -1,39 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar2par_txt2m - -# Symbolic parameters parameter conversion -# Used in lang_header -# Copyright (C) 2000 by Peter J. Gawthrop - -Lb=${5:-'('} -Rb=${6:-')'} - -case $2 in - zero) - strip_comments <$1_sympar.txt |\ - gawk '{ - i++; printf(" %s %s = 0.0;\n", tolower($1)); - }' - ;; - set) - strip_comments <$1_sympar.txt |\ - gawk '{ - i++; printf(" %s mttpar(%i) \t= %s;\n", i, tolower($1)); - }' - ;; - *) - strip_comments <$1_sympar.txt |\ - gawk '{ - i++; printf(" %s %s \t= mttpar%c%i%s%c;\n", decl, tolower($1), Lb, i, minusone, Rb); - }' decl="$3" minusone="$4" Lb=$Lb Rb=$Rb - ;; -esac - - - - DELETED mttroot/mtt/bin/trans/sympar2params_txt2c Index: mttroot/mtt/bin/trans/sympar2params_txt2c ================================================================== --- mttroot/mtt/bin/trans/sympar2params_txt2c +++ mttroot/mtt/bin/trans/sympar2params_txt2c @@ -1,58 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar2params_txt2c - -# Symbolic parameters to default paramers (c) -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1997/03/20 15:17:45 peterg -## All variables are in lower case. -## -# Revision 1.1 1997/03/20 10:25:55 peterg -# Initial revision -# -############################################################### - - - -# Inform user -echo "Creating $1_params.c" - -rm -f mtt_error - -#Write some file headers -echo '/*' > $1_params.c -echo "Parameter file for system $1 ($1_params.c)" >> $1_params.c -echo "This file provides the system params for simulation:" >> $1_params.c -echo "Generated by MTT at `date`" >> $1_params.c -echo "These default parameters should be changed by the user" >> $1_params.c -echo '*/' >> $1_params.c -echo >> $1_params.c - - -cat $MTTPATH/trans/rcs_header.c >> $1_params.c -echo >> $1_params.c - - -echo "#include \"$1_sympar.c\"" >> $1_params.c -echo "$1_params()" >> $1_params.c -echo '{' >> $1_params.c - -#Write out the variables in c format. -gawk '{i++; print tolower($1) " = \t1.0;"}' $1_sympar.txt >> $1_params.c -echo '}' >> $1_params.c - -# Now invoke the standard error handling. -# mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/sympar2params_txt2m Index: mttroot/mtt/bin/trans/sympar2params_txt2m ================================================================== --- mttroot/mtt/bin/trans/sympar2params_txt2m +++ mttroot/mtt/bin/trans/sympar2params_txt2m @@ -1,57 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar2params_txt2m - -# Symbolic parameters to default paramers (m) -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1997/04/17 11:18:34 peterg -## Write out the RCS header first! -## -# Revision 1.2 1997/04/16 11:40:31 peterg -# Added global variables. -# -# Revision 1.1 1997/04/16 11:31:41 peterg -# Initial revision -# -############################################################### - - - -# Inform user -echo "Creating $1_params.m" - -rm -f mtt_error - -#Write some file headers -echo "% Parameter file for system $1 ($1_params.m)" > $1_params.m -echo "% This file provides the system params for simulation:" >> $1_params.m -echo "% Generated by MTT at `date`" >> $1_params.m -echo "% These default parameters should be changed by the user" >> $1_params.m -echo >> $1_params.m - -cat $MTTPATH/trans/rcs_header.m >> $1_params.m -echo >> $1_params.m - - -#Write out the global variables -sympar2global_txt2m $1 >> $1_params.m - - -#Write out the variables in c format. -gawk '{i++; print tolower($1) " = \t1.0;"}' $1_sympar.txt >> $1_params.m - -# Now invoke the standard error handling. -# mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/sympar2rtxi_txt2cc Index: mttroot/mtt/bin/trans/sympar2rtxi_txt2cc ================================================================== --- mttroot/mtt/bin/trans/sympar2rtxi_txt2cc +++ mttroot/mtt/bin/trans/sympar2rtxi_txt2cc @@ -1,125 +0,0 @@ -#! /bin/sh - -sys=$1 -struc=${sys}_struc.txt -sympar=${sys}_sympar.txt -RTXI_H="${sys}_rtxi.h" -RTXI_CC="${sys}_rtxi.cc" -program=$(basename $0) -date=$(date) - -cat < ${RTXI_CC} -// -*-c++-*- Put Emacs into c++-mode - -// Generated from $sympar and $struc by MTT -// using $program -// at $date - -#include <${RTXI_H}> - -extern "C" Plugin::Object *createRTXIPlugin(void) { - return new ${sys}(); -} - -static DefaultGUIModel::variable_t vars[] = { -EOF - -gawk ' - ($1=="input") { - printf(" {\n"); - printf(" \"%s\",\n", $3); - printf(" \"%s\",\n", $6); - printf(" DefaultGUIModel::INPUT,\n"); - printf(" },\n"); - } - ($1=="output") { - printf(" {\n"); - printf(" \"%s\",\n", $3); - printf(" \"%s\",\n", $6); - printf(" DefaultGUIModel::OUTPUT,\n"); - printf(" },\n"); - } -' ${struc} >> ${RTXI_CC} - -gawk ' - { - printf(" {\n"); - printf(" \"%s\",\n", $1); - printf(" \"\",\n"); - printf(" DefaultGUIModel::PARAMETER |"); - printf(" DefaultGUIModel::DOUBLE,\n"); - printf(" },\n"); - } -' $sympar >> ${RTXI_CC} - -cat <> ${RTXI_CC} -}; - -static size_t num_vars = sizeof(vars)/sizeof(DefaultGUIModel::variable_t); -// TODO: initialise from numpar -static double -EOF - -gawk ' - { printf(" %s=0.0,", $1); } - END { printf ";" } -' $sympar |\ - sed -e 's/,;/;\n/' |\ - sed -e 's/,/,\n/' >> ${RTXI_CC} - -cat <> ${RTXI_CC} -static long i_count = 0; - -${sys}::${sys}(void) - : DefaultGUIModel("${sys}",::vars,::num_vars), -EOF - -gawk ' - { printf(" %s(0.0),", $1); } - END { printf ";" } -' $sympar |\ - sed -e 's/,;/\n/' |\ - sed -e 's/,/,\n/' >> ${RTXI_CC} - - -cat <> ${RTXI_CC} -{ - doUpdate(INIT); - refresh(); -} - -${sys}::~${sys}(void) {} - -// ${sys}::execute(void) is defined in ${sys}_ode2odes.cc - -void ${sys}::update(DefaultGUIModel::update_flags_t flag) { - setCaption("${sys}"); - switch(flag) { - case INIT: -EOF - -gawk ' - { - printf(" setParameter(\"%s\",QString::number(%s));\n", - $1, $1); - } -' $sympar >> ${RTXI_CC} - -cat <> ${RTXI_CC} - break; - case MODIFY: -EOF - -gawk ' - { - printf(" getParameter(\"%s\").toDouble();\n", $1); - } -' $sympar >> ${RTXI_CC} - -cat <> ${RTXI_CC} - break; - default: - break; - } -} -EOF DELETED mttroot/mtt/bin/trans/sympar2rtxi_txt2h Index: mttroot/mtt/bin/trans/sympar2rtxi_txt2h ================================================================== --- mttroot/mtt/bin/trans/sympar2rtxi_txt2h +++ mttroot/mtt/bin/trans/sympar2rtxi_txt2h @@ -1,43 +0,0 @@ -#! /bin/sh - -sys=$1 -sympar=${sys}_sympar.txt -RTXI_H="${sys}_rtxi.h" -program=$(basename $0) -date=$(date) - -cat < ${RTXI_H} -// -*-c++-*- Put Emacs into c++-mode - -// Generated from $sympar by MTT -// using $program -// at $date - -#include -#include - -class $sys : public DefaultGUIModel -{ - -public: - - $sys(void); - virtual ~$sys(void); - - virtual void execute(void); - -protected: - - virtual void update(DefaultGUIModel::update_flags_t); - -private: - -EOF - -gawk ' - { printf(" double %s;\n", $1); } -' $sympar >> ${RTXI_H} - -cat <> ${RTXI_H} -}; -EOF DELETED mttroot/mtt/bin/trans/sympar_r2c Index: mttroot/mtt/bin/trans/sympar_r2c ================================================================== --- mttroot/mtt/bin/trans/sympar_r2c +++ mttroot/mtt/bin/trans/sympar_r2c @@ -1,60 +0,0 @@ -#! /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 - DELETED mttroot/mtt/bin/trans/sympar_txt2c Index: mttroot/mtt/bin/trans/sympar_txt2c ================================================================== --- mttroot/mtt/bin/trans/sympar_txt2c +++ mttroot/mtt/bin/trans/sympar_txt2c @@ -1,57 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar_txt2c - -# Label file to symbolic parameters conversion -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1997/05/15 07:19:56 peterg -## Put back "tolower" -## -# Revision 1.2 1997/05/15 07:10:56 peterg -# removed "tolower" function -# -# Revision 1.1 1997/05/15 07:10:09 peterg -# Initial revision -# -# Revision 1.3 1997/03/19 16:39:12 peterg -# Put in the correct date. -# -# Revision 1.2 1997/03/18 17:56:35 peterg -# Cosmetic changes. -# -############################################################### - - -# Inform user -echo "Creating $1_sympar.c" - -rm -f mtt_error - -#Write some file headers -echo '/*' > $1_sympar.c -echo "Symbolic parameter file ($1_sympar.c)" >> $1_sympar.c -echo "Generated by MTT at `date`" >> $1_sympar.c -echo '*/' >> $1_sympar.c -echo >> $1_sympar.c - - -#Write out the variables in c format. -gawk '{i++; print "extern double", tolower($1) ";"}' $1_sympar.txt \ - >> $1_sympar.c - - -# Now invoke the standard error handling. -# mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/sympar_txt2declare Index: mttroot/mtt/bin/trans/sympar_txt2declare ================================================================== --- mttroot/mtt/bin/trans/sympar_txt2declare +++ mttroot/mtt/bin/trans/sympar_txt2declare @@ -1,59 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar_txt2declare - -# Symbolic parameters to variable declaration -# Copyright (C) 2000 by Peter J. Gawthrop - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/10/11 09:08:20 peterg -## Initial revision -## - -############################################################### - -sys=$1 -language=$2 - -case $language in - p) - first="VAR"; - delim=", "; - last=': REAL;'; - ;; - *) - echo Language $language not supported - sorry; exit 1 -esac - -# Start -cat<10){ - printf("\n"); j=0; - } - } - printf("%s%s\n",var[n], last); - -}' "delim=$delim" "last=$last" - - DELETED mttroot/mtt/bin/trans/sympar_txt2m Index: mttroot/mtt/bin/trans/sympar_txt2m ================================================================== --- mttroot/mtt/bin/trans/sympar_txt2m +++ mttroot/mtt/bin/trans/sympar_txt2m @@ -1,18 +0,0 @@ -#!/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 - -gawk '{ - printf(" sympar.%s \t= %i; # %s\n", $1, ++i, $2); -}' < $1_sympar.txt >> $1_sympar.m DELETED mttroot/mtt/bin/trans/sympar_txt2r Index: mttroot/mtt/bin/trans/sympar_txt2r ================================================================== --- mttroot/mtt/bin/trans/sympar_txt2r +++ mttroot/mtt/bin/trans/sympar_txt2r @@ -1,64 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar_txt2r - -# Label file to symbolic parameters conversion -# P.J.Gawthrop March 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.6 1998/02/17 17:03:54 peterg -## Fixed bug in writing out matrix declaration -## -## Revision 1.5 1998/02/16 12:14:21 peterg -## Corrected writing out of MTTVAR matrix - now does this id non-zero -## number of variables - not vv! -## -## Revision 1.4 1997/05/09 14:20:49 peterg -## Dont declare MTTVAR array when there are no variables. -## -# Revision 1.3 1997/03/19 16:39:12 peterg -# Put in the correct date. -# -# Revision 1.2 1997/03/18 17:56:35 peterg -# Cosmetic changes. -# -############################################################### - - -# Inform user -echo "Creating $1_sympar.r" - -rm -f mtt_error - -#Write some file headers -echo "%% Symbolic parameter file ($1_sympar.r)" > $1_sympar.r -echo "%% Generated by MTT at `date`" >> $1_sympar.r -echo >> $1_sympar.r - -#Count the lines in the file -lines=`grep -c '.' $1_sympar.txt` - -if [ "$lines" != "0" ]; then - echo "MATRIX MTTVAR($lines,1);" >> $1_sympar.r -fi -echo "MTTNVAR := $lines;" >> $1_sympar.r -echo >> $1_sympar.r - -#Write out the variables in reduce format. -gawk '{i++; print "MTTVAR(" i ",1) := " $1 ";"}' $1_sympar.txt >> $1_sympar.r - -echo 'END;' >> $1_sympar.r - -# Now invoke the standard error handling. -# mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/sympar_txt2tex Index: mttroot/mtt/bin/trans/sympar_txt2tex ================================================================== --- mttroot/mtt/bin/trans/sympar_txt2tex +++ mttroot/mtt/bin/trans/sympar_txt2tex @@ -1,96 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: sympar_txt2tex - -# Sympar file - text to TeX table conversion -# P.J.Gawthrop April 1997 -# Copyright (c) P.J.Gawthrop, 1997. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/27 16:04:46 peterg -## Initial revision -## -## Revision 1.2 1998/01/19 14:17:26 peterg -## Modified struc_txt2tex to make this. -## -## Revision 1.1 1998/01/19 14:16:39 peterg -## Initial revision -## -# Revision 1.3 1997/12/06 19:10:41 peterg -# Reverted to tabular --- from supertabular -# -# Revision 1.2 1997/04/15 11:17:58 peterg -# Uses supertabular for long tables. -# -# Revision 1.1 1997/04/15 09:49:04 peterg -# Initial revision -# -############################################################### - - -# Inform user -echo "Creating $1_sympar.tex" - -rm -f mtt_error - -#Write some file headers -echo "%% Parameter file ($1_sympar.txt)" > $1_sympar.tex -echo "%% Generated by MTT at `date`" >> $1_sympar.tex - -# This is the main transformation using awk -sed 's/_/\\_/g' < $1_sympar.txt | gawk ' -#function header(what){ -# print " \\centering"; -# print " \\tablefirsthead{\\hline %"; -# print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM "} \\\\"; -# print " \\hline"; -# print " & Component & System & Repetition \\\\"; -# print " \\hline}"; -# -# print " \\tablehead{\\hline %"; -# print " \\multicolumn{4}{|c|}{\\bf List of " what "s for system " SYSTEM " (continued)} \\\\"; -# print " \\hline"; -# print " & Component & System & Repetition \\\\"; -# print " \\hline}"; -# -# print " \\tabletail{\\hline}"; -# print " \\begin{supertabular}{|l|l|l|l|}"; -#} -function header(what){ - print "\\begin{table}[htbp]"; - print " \\centering"; - print " \\begin{tabular}{|l|l|}"; print " \\hline"; - print " Parameter & System\\\\"; - print " \\hline"; -} -function footer(what){ - print " \\hline"; - print " \\end{tabular}"; - print " \\caption{" what "}"; - print "\\end{table}"; - print " \\bigskip"; - print " \\bigskip"; -} -BEGIN{ - header($1); -} -{ - print $1, "&", $2, "\\\\"; -} -END{ - footer("Parameters") -} -' SYSTEM=$1 >> $1_sympar.tex 2>mtt_error.txt - -# Now invoke the standard error handling. -mtt_error mtt_error.txt - - DELETED mttroot/mtt/bin/trans/tex2doc Index: mttroot/mtt/bin/trans/tex2doc ================================================================== --- mttroot/mtt/bin/trans/tex2doc +++ mttroot/mtt/bin/trans/tex2doc @@ -1,35 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: tex2doc -# Encapsulates a tex file in a document. - -# P.J.Gawthrop August 1996 -# Copyright (c) P.J.Gawthrop, 1996. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2000/12/28 12:48:53 peterg -## Put under RCS -## -# Revision 1.2 1996/08/30 10:19:11 peter -# New path for awk script. -# -## Revision 1.1 1996/08/18 20:00:20 peter -## Initial revision -## -############################################################### - -# Inform user -echo "Creating $1_$2.doc" - -# This is the main transformation using awk -gawk -f $MTTPATH/trans/awk/tex2doc.awk \ -system_name=$1 representation=$2 > $1_$2.doc - DELETED mttroot/mtt/bin/trans/tf_r2m Index: mttroot/mtt/bin/trans/tf_r2m ================================================================== --- mttroot/mtt/bin/trans/tf_r2m +++ mttroot/mtt/bin/trans/tf_r2m @@ -1,152 +0,0 @@ -#!/bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: tf_r2m -# Reduce transfer-function matrices to Matlab MV toolbox matrices. -# P.J.Gawthrop 9 June 1990, 8 July 1990, Dec 993 -# Copyright (c) P.J.Gawthrop, 1990, 1993. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2001/05/24 07:42:12 gawthrop -## Included and updated the missing tf_r2m -## -## Revision 1.1 1996/09/18 14:05:31 peter -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_tf.m - -# Remove the old log file -rm -f tf_r2m.log - -# Use reduce to accomplish the transformation -reduce >tf_r2m.log << EOF - -%Read the 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 parameter file -%%in "$1_sympar.r"; - -%Read the transfer-function matrices file -OFF Exp; ON GCD; -in "$1_tf.r"; - -OFF Echo; -%OFF Nat; -OFF factor; - -%Find the largest degree numerator polynomial -NnMax := 0; - FOR Row := 1:MTTNy DO - BEGIN - FOR Col := 1:MTTNu DO - BEGIN - Nn := length(coeff(num(MTTtf(Row,Col)),s)); - IF Nn>NnMax THEN NnMax := Nn; - END; - END; - -NnMax; - -%Find the largest degree denominator polynomial, and corresp indices -NdMax := 0; - FOR Row := 1:MTTNy DO - BEGIN - FOR Col := 1:MTTNu DO - BEGIN - Nd := length(coeff(den(MTTtf(Row,Col)),s)); - IF Nd>NdMax THEN - BEGIN - NdMax := Nd; MaxRow := Row; MaxCol := Col; - END - END; - END; - -NdMax; MaxRow; MaxCol; - -IF NnMax>NdMax THEN NMax := NnMax ELSE NMax := NdMax; -Nmax; - -%Use any denominator with maximum degree as the common denominator -MTTden := den(MTTtf(MaxRow,MaxCol)); - -%Find the corresponding numerator -matrix MTTnum(MTTNy,MTTNu); - FOR Row := 1:MTTNy DO - BEGIN - FOR Col := 1:MTTNu DO - MTTnum(Row,Col) := num(MTTtf(Row,Col))*(MTTden/den(MTTtf(Row,Col))); - END; -MTTnum := MTTnum; - -%Put coefficients into matrices -matrix MTTdenco(1,Nmax); -MTTCoeff := Coeff(MTTden,s); -FOR i := 1:Nmax DO -BEGIN - j := Nmax-i+1; - IF j>length(MTTCoeff) THEN MTTdenco(1,i) := 0 - ELSE MTTdenco(1,i) := part(MTTCoeff,j); -END; -MTTdenco := MTTdenco; - -matrix MTTnumco(MTTNy,MTTNu*Nmax); -FOR MTTRow := 1:MTTNy DO -BEGIN - FOR MTTCol := 1:MTTNu DO - BEGIN - MTTCoeff := Coeff(MTTnum(MTTRow,MTTCol),s); - FOR MTTi := 1:Nmax DO - BEGIN - MTTj := Nmax-MTTi+1; - MTTk := MTTi + (MTTCol-1)*Nmax; - IF MTTj>length(MTTCoeff) THEN MTTnumco(MTTRow, MTTk) := 0 - ELSE MTTnumco(MTTRow, MTTk) := part(MTTCoeff,MTTj); - END; - END; -END; - - - -OUT "$1_tf.m1"; - -write "mttden = zeros(1,", Nmax, ");"; -write "mttnum = zeros(", MTTNy, ",", Nmax*MTTNu, ");"; - -%Suppress zeros -ON NERO; - -%Fortran switches - one line expressions -ON fort; -cardno!* := 1\$ -fortwidth!* := 100\$ -OFF period; - -%Write out the matlab code -mttden := MTTdenco; -mttnum := MTTnumco; -SHUT "$1_tf.m1"; -quit; -EOF - -#Headers -mtt_header $1 tf m > $1_tf.m - -#Body -cat $1_tf.m1 >> $1_tf.m -echo '## END Code' >> $1_tf.m -rm -f $1_tf.m1 - DELETED mttroot/mtt/bin/trans/tf_r2tex Index: mttroot/mtt/bin/trans/tf_r2tex ================================================================== --- mttroot/mtt/bin/trans/tf_r2tex +++ mttroot/mtt/bin/trans/tf_r2tex @@ -1,139 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: tf_r2tex -# Reduce transfer-function matrices to LaTex transfer-function matrices. -# P.J.Gawthrop 9 June 1990, 8 July 1990, April 1994. -# Copyright (c) P.J.Gawthrop, 1990, 1994. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2014/04/18 00:36:40 gawthrop -## No parentheses. -## -## Revision 1.1 2000/12/27 16:05:29 peterg -## Initial revision -## -## Revision 1.2 1996/12/20 08:59:40 peterg -## Now writes out mtti instead of mtt_{i} -- lets latex_tidy do the -## conversion. -## -## Revision 1.1 1996/11/05 11:01:51 peterg -## Initial revision -## -############################################################### - -#Inform user -echo Creating $1_tf.tex - -# Remove the old log file -rm -f tf_r2tex.log - -# Use reduce to accomplish the transformation -reduce >tf_r2tex.log << EOF - -%Read the definitions file -in "$1_def.r"; - -%Read the parameter file -%%in "$1_sympar.r"; - -%Read the formatting function -IF MTTNy=1 AND MTTNu=1 - THEN - in "$MTTPATH/trans/latex_matrix_no.r" - ELSE - in "$MTTPATH/trans/latex_matrix.r"; - -%Read the transfer-function matrices file -in "$1_tf.r"; - -%Read the substitution file -IN "$1_subs.r"; - -%Read the simplification file -in "$1_simp.r"; - -OFF Echo; -OFF Nat; - -OUT "$1_tf.tex"; -MTT_Matrix := MTTTF$ -MTT_Matrix_name := "MTTG"$ -MTT_Matrix_n := MTTNy$ -MTT_Matrix_m := MTTNu$ -LaTeX_Matrix()$ - -%% FOR Row := 1:MTTNy DO -%% BEGIN -%% FOR Col := 1:MTTNu DO -%% BEGIN -%% numerator := num(MTTtf(Row,Col)); -%% denominator := den(MTTtf(Row,Col)); -%% cnumerator := coeff(numerator, s); -%% cdenominator := coeff(denominator, s); -%% write "!begin{equation} !label{eq_$1_tf", Row, Col, "}"; -%% IF MTTNy=1 AND MTTNu=1 -%% THEN -%% write "MTTTF(s) = {" -%% ELSE -%% write "MTTTF", Row, Col, "(s) = {"; -%% IF numerator = 0 -%% THEN write "0" -%% ELSE -%% BEGIN -%% FOR i := 1:Length(cnumerator) DO -%% BEGIN -%% cof := part(cnumerator,i); -%% IF cof NEQ 0 THEN -%% BEGIN -%% IF i>1 THEN write " + "; -%% IF cof NEQ 1 THEN -%% BEGIN -%% IF Terms(cof)>1 THEN write "(", cof, ")" -%% ELSE write cof; -%% END -%% ELSE IF i=1 THEN Write "1"; -%% -%% IF i=2 THEN write "s"; -%% IF i>2 THEN write "s^", i-1; -%% END; -%% END; -%% END; -%% -%% IF denominator NEQ 1 THEN -%% BEGIN -%% Write "!over"; -%% FOR i := 1:Length(cdenominator) DO -%% BEGIN -%% cof := part(cdenominator,i); -%% IF cof NEQ 0 THEN -%% BEGIN -%% IF i>1 THEN write " + "; -%% IF cof NEQ 1 THEN -%% BEGIN -%% IF Terms(cof)>1 THEN write "(", cof, ")" -%% ELSE write cof; -%% END -%% ELSE IF i=1 THEN Write "1"; -%% -%% IF i=2 THEN write "s"; -%% IF i>2 THEN write "s^", i-1; -%% END; -%% END; -%% END; -%% write "}"; -%% write "!end{equation}"; -%% END; -%% END; -%% -SHUT "$1_tf.tex"; -quit; -EOF - DELETED mttroot/mtt/bin/trans/tidy Index: mttroot/mtt/bin/trans/tidy ================================================================== --- mttroot/mtt/bin/trans/tidy +++ mttroot/mtt/bin/trans/tidy @@ -1,18 +0,0 @@ -mv $1 $1.old - -cat $1.old | -#Clear out all (and extraneous) new lines -tr -d '\012' |\ - -#Squash blanks -tr -s '\040' '\040' |\ - -#Put in new lines to replace $ -tr '\044' '\012' |\ - -#Remove blanks after E -sed "s/E /E/g" |\ - -#Put in $ at end of each line -sed "s/$/\$/" >$1 - DELETED mttroot/mtt/bin/trans/txt2m Index: mttroot/mtt/bin/trans/txt2m ================================================================== --- mttroot/mtt/bin/trans/txt2m +++ mttroot/mtt/bin/trans/txt2m @@ -1,186 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: txt2m -# Converts txt file to matlab file (for numpar and state) - -# Copyright (c) P.J.Gawthrop 1998 - - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.19 2000/02/11 13:35:16 peterg -# %% Added the new MTTpar generation -# %% -# %% Revision 1.18 1999/11/14 22:22:17 peterg -# %% Removed checks for implicit - now done at command-line level. -# %% -# %% Revision 1.17 1999/11/04 04:54:24 peterg -# %% Removed recreation of smx file. -# %% -# %% Revision 1.16 1999/03/06 02:18:10 peterg -# %% Changed argument list. -# %% -# %% Revision 1.15 1999/02/16 21:44:38 peterg -# %% Revised smx generation -# %% -# %% Revision 1.14 1999/02/16 04:38:22 peterg -# %% Now forces creation of _smx file if METHOD=IMPLICIT in simpar.txt -# %% -# %% Revision 1.13 1998/08/31 11:43:37 peterg -# %% Now lower cases globals in numpar files -# %% -# %% Revision 1.12 1998/08/14 10:47:31 peterg -# %% Put ImplicitS sub before Implicit!! -# %% -# %% Revision 1.11 1998/08/14 10:43:44 peterg -# %% Added ImplicitS - sparse integration -# %% -# %% Revision 1.10 1998/08/11 13:27:51 peterg -# %% Lowercase mttLAST etc -# %% -# %% Revision 1.9 1998/07/30 15:07:17 peterg -# %% Added _ to the disallowed chars around t -# %% -# %% Revision 1.8 1998/07/30 12:52:38 peterg -# %% Adds ; to end of statements -# %% Translates ' to " before removal -# %% -# %% Revision 1.7 1998/07/30 09:32:33 peterg -# %% Replaces: -# %% euler by 1 -# %% implicitl by 1 -# %% implicit by 3 -# %% -# %% Revision 1.6 1998/07/27 18:59:11 peterg -# %% Added WMIN etc -# %% -# %% Revision 1.5 1998/07/26 11:54:20 peterg -# %% Added mtt to variables -# %% -# %% Revision 1.4 1998/07/26 09:50:12 peterg -# %% More forgiving of txt sytax. -# %% -# %% -- can use () or () -# %% -- can use mttx() or x() -# %% -- can use mttu() or u() -# %% -# %% Revision 1.3 1998/07/25 20:40:35 peterg -# %% All vars in lower case now -# %% -# %% Revision 1.2 1998/07/25 09:48:31 peterg -# %% Tidied up for Pascal version -# %% -# %% Revision 1.1 1998/02/25 22:10:25 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -system=$1 -representation=$2 - -if [ "$representation" = "state" ]; then - name='mttx'; - arg=''; -fi -if [ "$representation" = "input" ]; then - name='mttu'; - arg='(mttt,mttx,mtty)' -fi - -# Inform user -echo Creating $1_$2.m - -#Create the $2 file complete with headers. -case $representation in - simpar) - echo "% Script file $1_$2.m" > $1_$2.m - echo "%% $2 file ($1_$2.m)" >> $1_$2.m - echo "%% Generated by MTT at `date`" >> $1_$2.m - echo '% Dummy globals' >> $1_$2.m - echo 'global ...' >> $1_$2.m - echo 'mtt_dummy_global;' >> $1_$2.m - ;; - numpar) - echo "% Script file $1_$2.m" > $1_$2.m - echo "%% $2 file ($1_$2.m)" >> $1_$2.m - echo "%% Generated by MTT at `date`" >> $1_$2.m - echo "% Global variable list" >> $1_$2.m - sympar2global_txt2m $1 >> $1_$2.m - ;; - *) - echo "function $name = $1_$2$arg" > $1_$2.m - echo "%% $2 file ($1_$2.m)" >> $1_$2.m - echo "%% Generated by MTT at `date`" >> $1_$2.m - echo "% Global variable list" >> $1_$2.m - sympar2global_txt2m $1 >> $1_$2.m - ;; -esac - -#Write out the variables in m format. -cat $1_$2.txt | grep -v METHOD |\ -gawk -F# 'BEGIN{ -quote = "\047"; -doublequote = "\042"; -} -{ - N=split($1,a,"="); - if (N==2) { - LHS = a[1]; - RHS = a[2]; - gsub(quote, doublequote, RHS); - sub(/^[ ]*LAST/, "mttLAST", LHS); - sub(/^[ ]*DT/, "mttDT", LHS); - sub(/^[ ]*STEPFACTOR/, "mttSTEPFACTOR", LHS); - sub(/^[ ]*METHOD/, "mttMETHOD", LHS); - sub(/^[ ]*WMIN/, "mttWMIN", LHS); - sub(/^[ ]*WMAX/, "mttWMAX", LHS); - sub(/^[ ]*WSTEPS/, "mttWSTEPS", LHS); - sub(/^[ ]*INPUT/, "mttinput", LHS); - LHS = tolower(LHS); - RHS = tolower(RHS); - sub(/["]*euler["]*/, 1, RHS); - sub(/["]*implicit["]*/, 2, RHS); - statement = sprintf("%s= %s",LHS,RHS); - if ( (match(statement,";")==0)&&\ - ((match(statement,"if ")==0))&&\ - ((match(statement,"for ")==0)) ) - statement = sprintf("%s;", statement); - } - else if (match($1,"global")==1) { - statement = tolower($1); # Lower case globals as well - } - else - statement = $1; - - if (NF<2) print statement - if (NF>1) print statement " # " $2 -}' | sed\ - -e 's/\[\([0-9]*\)\]/(\1)/g' \ - -e 's/\([^a-zA-Z_]\)t\([^a-zA-Z_]\)/\1mttt\2/g' \ - -e 's/x(/mttx(/g' \ - -e 's/u(/mttu(/g' \ - -e 's/mttmtt/mtt/g' \ - -e 's/#/%/g' \ ->> $1_$2.m - - -if [ "$2" = "numpar" ]; then - gawk '{ - printf(" MTTpar(%i) \t= %s;\n",++i, tolower($1)); - }'< $1_sympar.txt >>$1_numpar.m -fi - - - - - - - - DELETED mttroot/mtt/bin/trans/txt2tex Index: mttroot/mtt/bin/trans/txt2tex ================================================================== --- mttroot/mtt/bin/trans/txt2tex +++ mttroot/mtt/bin/trans/txt2tex @@ -1,44 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: txt2tex - -# Generic textual inclusion as verbatim tex. - -# P.J.Gawthrop March 1998 -# Copyright (c) P.J.Gawthrop, 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -if [ -z "$3" ]; then - echo Usage: txt2tex system representation language - exit 1 -fi -# Inform user -echo "Creating $1_$2.tex" - -rm -f mtt_error - -#Write some file headers -echo "%% Tex file ($1_$2.txt)" > $1_$2.tex -echo "%% Generated by MTT at `date`" >> $1_$2.tex - -cat <> $1_$2.tex -\begin{verbatim} -EOF -cat $1_$2.$3 >> $1_$2.tex -cat<> $1_$2.tex -\end{verbatim} -EOF - - - - DELETED mttroot/mtt/bin/trans/txt_matrix.r Index: mttroot/mtt/bin/trans/txt_matrix.r ================================================================== --- mttroot/mtt/bin/trans/txt_matrix.r +++ mttroot/mtt/bin/trans/txt_matrix.r @@ -1,36 +0,0 @@ - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%% Model Transformation Tools %%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Reduce function to write matrices in text form -% P.J.Gawthrop Febrauary 1998 -% Copyright (c) P.J.Gawthrop, 1998 - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -PROCEDURE txt_Matrix; -BEGIN - IF MTT_Matrix_n>0 THEN - IF MTT_Matrix_m>0 THEN - BEGIN - FOR i := 1:MTT_Matrix_n DO - IF MTT_Matrix_m>1 THEN - BEGIN - FOR j := 1:MTT_Matrix_m DO - write MTT_Matrix_name, "(", i, ",", j, ") = ", - MTT_Matrix(i,j), ";"; - END - ELSE - write MTT_Matrix_name, "(", i, ") = ", - MTT_Matrix(i,1), ";"; - END; -END; - -END;; DELETED mttroot/mtt/bin/xmtt Index: mttroot/mtt/bin/xmtt ================================================================== --- mttroot/mtt/bin/xmtt +++ mttroot/mtt/bin/xmtt @@ -1,94 +0,0 @@ -#! /bin/sh - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -# Bourne shell script: xmtt -# -# x-window version of MTT - -# Copyright (c) P.J.Gawthrop, 1998 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 2000/09/14 07:50:08 peterg -## *** empty log message *** -## -## Revision 1.4 1999/10/19 00:34:10 peterg -## *** empty log message *** -## -## Revision 1.3 1999/08/18 06:17:55 peterg -## Modular form -## -## Revision 1.2 1999/03/09 00:03:55 peterg -## Major revisions for release 3.5 -## -## Revision 1.1 1998/10/20 08:15:17 peterg -## Initial revision -## -############################################################### - -#Basic paths -dotfile="$HOME/.mtt" -xdotfile="${dotfile}/xmtt" - -repfile="${xdotfile}/reps" -exfile="${xdotfile}/examples" -menufile=".xmtt_menu" - -#Look for a command line argument -while [ -n "`echo $1 | grep '^-'`" ]; do - case $1 in - --help|-h ) echo "usage:" - echo " xmtt" - echo " xmtt --update" - echo " xmtt --example example_name" - echo " xmtt --help" - exit;; - - --update|-u ) echo Creating representation list for mtt; - mtt2reps_txt> ${repfile}; - echo Creating examples list for mtt; - mtt -q help examples> ${exfile}; - exit;; - - --example|-e ) shift; example=$1;; - *) - echo "$1 is an invalid argument - ignoring" ;; - esac - shift -done - -if [ -n "${example}" ]; then - mtt -q copy ${example}; - cd ${example}; - xmtt - exit -fi - -## Make sure files exist -if [ -e "${xdotfile}" ]; then - echo ${xdotfile} exists >/dev/null -else - echo Creating ${xdotfile} - mkdir --parents ${xdotfile} -fi - -if [ -e "${repfile}" ]; then - echo ${repfile} exists >/dev/null -else - echo Creating ${repfile} and ${exfile} - xmtt --update - echo done. -fi - -## Create the menu -mtt_make_menu > ${menufile} - -## Use tk shell (wish) -name=`basename $PWD` -wish ${menufile} -name $name DELETED mttroot/mtt/cc/Makefile Index: mttroot/mtt/cc/Makefile ================================================================== --- mttroot/mtt/cc/Makefile +++ mttroot/mtt/cc/Makefile @@ -1,12 +0,0 @@ - -CXX ?= g++ - -build: parse_m2cc.exe - -.PHONY: FORCE -clean: FORCE - @-rm -f parse_m2cc.exe - -parse_m2cc.exe: parse_m2cc.cc - @$(CXX) $< $(CFLAGS) -o $@ -I./include - @strip $@ DELETED mttroot/mtt/cc/def_m2h.sh Index: mttroot/mtt/cc/def_m2h.sh ================================================================== --- mttroot/mtt/cc/def_m2h.sh +++ mttroot/mtt/cc/def_m2h.sh @@ -1,60 +0,0 @@ -#! /bin/sh -# $Id$ -# $Log$ -# Revision 1.3 2002/05/15 14:22:25 geraint -# Code for Simulink S-function target written direct to sfun.cc instead of -# calling .mexglx files. This eliminates the sfun dependency on Octave -# ColumnVectors. sys_sfun.cc should build directly on a MS Windows machine -# (can't test this yet). -# -# added sfun.zip target to create source code to export. -# -# Revision 1.2 2002/04/28 18:58:06 geraint -# Fixed [ 549658 ] awk should be gawk. -# Replaced calls to awk with call to gawk. -# -# Revision 1.1 2000/12/28 09:46:05 peterg -# put under RCS -# -# Revision 1.3 2000/12/05 12:13:52 peterg -# Changed function name to name() -# -# Revision 1.2 2000/12/04 12:04:46 peterg -# Changed $() to `` for sh compatibility -- geraint -# -# Revision 1.1 2000/12/04 12:02:23 peterg -# Initial revision -# -# Revision 1.1 2000/10/31 04:32:28 geraint -# Initial revision -# - -SYS=$1 -IN=${SYS}_def.m -SYM=${SYS}_sympar.txt -OUT=${SYS}_def.h - -get_array_size () -{ -vec=$1 -gawk -v vec=${vec} '($1 == vec && $2 == "=") { print $3 }' | sed s/\;// -} - - echo "/* ${SYS}_def.h, generated by MTT on `date` */" > ${OUT} - echo "" >> ${OUT} - echo "#ifndef HAVE_${SYS}_DEF_H" >> ${OUT} - echo "#define HAVE_${SYS}_DEF_H" >> ${OUT} - echo "" >> ${OUT} - echo "const int MTTNU = `cat ${IN} | get_array_size nu`;" >> ${OUT} - echo "const int MTTNX = `cat ${IN} | get_array_size nx`;" >> ${OUT} - echo "const int MTTNY = `cat ${IN} | get_array_size ny`;" >> ${OUT} - echo "const int MTTNZ = `cat ${IN} | get_array_size nz`;" >> ${OUT} - echo "const int MTTNYZ = `cat ${IN} | get_array_size nyz`;" >> ${OUT} - echo "const int MTTNPAR = `wc -l ${SYM} | gawk '{ print $1 }'`;" >> ${OUT} - echo "" >> ${OUT} - echo "static int mttnu, mttnx, mttny, mttnyz, mttnz;" >> ${OUT} - echo "" >> ${OUT} - echo "#endif" >> ${OUT} - - - DELETED mttroot/mtt/cc/include/Bracket.hh Index: mttroot/mtt/cc/include/Bracket.hh ================================================================== --- mttroot/mtt/cc/include/Bracket.hh +++ mttroot/mtt/cc/include/Bracket.hh @@ -1,222 +0,0 @@ -/* $Id$ - * $Log$ - * Revision 1.1.4.1 2001/06/30 03:26:20 geraint - * gcc-3.0 compatibility. - * - * Revision 1.1 2000/12/28 09:47:29 peterg - * put under RCS - * - * Revision 1.1 2000/10/31 04:29:11 geraint - * Initial revision - * - */ - - - -#include -#include - - -using namespace std; - -class Bracket -{ -public: - friend ostream &operator<< (ostream &str, Bracket *b); - friend string &operator<< (string &str, Bracket *b); - friend string &operator+= (string &str, Bracket *b); - friend string operator+ (string &str, Bracket *b); - virtual int get_nesting_depth (void) = 0; - -protected: - Bracket (char left, char right) { _l = left; _r = right; } - ostream &open (ostream &str) { this->increment_nesting (); return str << this->_l; } - string &open (string &str) { this->increment_nesting (); return str += this->_l; } - ostream &close (ostream &str) { this->decrement_nesting (); return str << this->_r; } - string &close (string &str) { this->decrement_nesting (); return str += this->_r; } - -protected: - virtual int increment_nesting (void) = 0; - virtual int decrement_nesting (void) = 0; - virtual ostream &display (ostream &str) = 0; - virtual string &display (string &str) = 0; - -private: - char _l, _r; -}; - - - -class Brace : public Bracket -{ -public: - int get_nesting_depth (void) { return (this->nesting_depth);} - string indentation (int n = nesting_depth) - { - string s = ""; - int i; - for (i = 0; i < n; i++) - s += " "; - return s; - } - -protected: - Brace () : Bracket ('{', '}') { ; } - int increment_nesting (void) { return ++(this->nesting_depth); } - int decrement_nesting (void) { return --(this->nesting_depth); } - ostream &open (ostream &str) - { - str << endl << this->indentation (); - this->Bracket::open (str); - str << endl << this->indentation (); - return str; - } - string &open (string &str) - { - str += '\n' + this->indentation (); - this->Bracket::open (str); - str += '\n' + this->indentation (); - return str; - } - ostream &close (ostream &str) - { - str << endl << this->indentation (nesting_depth - 1); - this->Bracket::close (str); - str << endl << this->indentation (); - return str; - } - string &close (string &str) - { - str += '\n' + this->indentation (nesting_depth - 1); - this->Bracket::close (str); - str += '\n' + this->indentation (); - return str; - } - -private: - static int nesting_depth; -}; -int Brace::nesting_depth; - - - -class Paren : public Bracket -{ -public: - int get_nesting_depth (void) { return (this->nesting_depth);} - -protected: - Paren () : Bracket ('(', ')') { ; } - int increment_nesting (void) { return ++(this->nesting_depth); } - int decrement_nesting (void) { return --(this->nesting_depth); } - -private: - static int nesting_depth; -}; -int Paren::nesting_depth; - - - -class SquareBracket : public Bracket -{ -public: - int get_nesting_depth (void) { return (this->nesting_depth);} - -protected: - SquareBracket () : Bracket ('[', ']') { ; } - int increment_nesting (void) { return ++(this->nesting_depth); } - int decrement_nesting (void) { return --(this->nesting_depth); } - -private: - static int nesting_depth; -}; -int SquareBracket::nesting_depth; - - - -class LeftBrace : public Brace -{ -public: - ostream &display (ostream &str) { return this->open (str); } - string &display (string &str) { return this->open (str); } -}; - - - -class RightBrace : public Brace -{ -public: - ostream &display (ostream &str) { return this->close (str); } - string &display (string &str) { return this->close (str); } -}; - - - -class LeftParen : public Paren -{ -public: - ostream &display (ostream &str) { return this->open (str); } - string &display (string &str) { return this->open (str); } -}; - - - -class RightParen : public Paren -{ -public: - ostream &display (ostream &str) { return this->close (str); } - string &display (string &str) { return this->close (str); } -}; - - - -class LeftSquareBracket : public SquareBracket -{ -public: - ostream &display (ostream &str) { return this->open (str); } - string &display (string &str) { return this->open (str); } -}; - - - -class Rightbrace : public SquareBracket -{ -public: - ostream &display (ostream &str) { return this->close (str); } - string &display (string &str) { return this->close (str); } -}; - - - -ostream &operator<< (ostream &str, Bracket *b) -{ - b->display (str); - return str; -} - - - -string &operator<< (string &str, Bracket *b) -{ - string s; - b->display (s); - str += s; - return str; -} - - - -string &operator+= (string &str, Bracket *b) -{ - b->display (str); - return str; -} - - - -string operator+ (string &str, Bracket *b) -{ - string s; - b->display (s); - return (str + s); -} DELETED mttroot/mtt/cc/include/useful-functions.hh Index: mttroot/mtt/cc/include/useful-functions.hh ================================================================== --- mttroot/mtt/cc/include/useful-functions.hh +++ mttroot/mtt/cc/include/useful-functions.hh @@ -1,112 +0,0 @@ - -#ifndef HAVE_USEFUL_FUNCTIONS_HH -#define HAVE_USEFUL_FUNCTIONS_HH - -/* Code generation directives */ -#define STANDALONE 0 -#define OCTAVEDLD 1 -#define MATLABMEX 2 -#if (! defined (CODEGENTARGET)) -#define CODEGENTARGET -1 -#endif /* (! defined (CODEGENTARGET)) */ - -#ifndef __cplusplus -#define inline /* strip */ -#define cast_to_double (double) -/* -typedef unsigned int bool; -const bool true = 1; -const bool false = 0; -*/ -#else -#include -#define cast_to_double static_cast -using std::pow; -#endif /* ! __cplusplus */ - -#ifdef M_PI -static double pi = M_PI; -static double Pi = M_PI; -static double PI = M_PI; -#else -static double pi = 3.1416; -static double Pi = pi; -static double PI = pi; -#endif - -static inline double -max (const double x1, const double x2) -{ - return cast_to_double ((x1 >= x2) ? x1 : (x1 < x2) ? x2 : 0); -} - -static inline double -min (const double x1, const double x2) -{ - return cast_to_double ((x1 <= x2) ? x1 : (x1 > x2) ? x2 : 0); -} - -static inline double -nonsingular (const double x) -{ - return cast_to_double ((x == 0) ? 1.0e-30 : x); -} - -static inline double -sign (const double x) -{ - return cast_to_double ((x > 0) ? +1 : (x < 0) ? -1 : 0); -} - - -/* Octave functions */ -#if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == OCTAVEDLD)) -#ifdef __cplusplus -static Matrix -ones (const int r = 1, const int c = 1) -{ - Matrix m (r, c, 1.0); - return m; -} - -static ColumnVector -nozeros (const ColumnVector v0, const double tol = 0.0) -{ - ColumnVector v (v0.length ()); - register int i, j; - for (i = j = 0; i < v.length (); i++) - if (tol < std::abs (v0 (i))) - { - v (j) = v0 (i); - j++; - } - if (0 == j) - { - return *new ColumnVector (); - } - else - { - return (v.extract (0, --j)); - } -} - -static ColumnVector -zeros (const int r) -{ - ColumnVector v (r, 0.0); - return v; -} - -static Matrix -zeros (const int r, const int c) -{ - Matrix m (r, c, 0.0); - return m; -} -#endif /* __cplusplus */ -#endif /* ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == OCTAVEDLD)) */ - - - -#endif /* HAVE_USEFUL_FUNCTIONS_HH */ - DELETED mttroot/mtt/cc/mtt_m2cc.sh Index: mttroot/mtt/cc/mtt_m2cc.sh ================================================================== --- mttroot/mtt/cc/mtt_m2cc.sh +++ mttroot/mtt/cc/mtt_m2cc.sh @@ -1,213 +0,0 @@ -#! /bin/sh - -SYS=$1 -REP=$2 -TARGET=${3:-cc} -PARSER=${4:-indent} - -IN=${SYS}_${REP}.m -OUT=${SYS}_${REP}.${TARGET} -TMP=${SYS}_${REP}_m2cc.tmp - -rep_declarations () -{ -(case ${REP} in - simpar) - cat < ${TMP} - find_code ${TMP} head > ${OUT} - find_code ${IN} body |\ - decrement_indices |\ - fix_comment_delimiter c |\ - fix_pow |\ - strip_junk |\ - ${PARSER} >> ${OUT} - find_code ${TMP} foot >> ${OUT} - rm ${TMP} - ;; - cc | *) - mtt_header ${SYS} ${REP} "oct" > ${TMP} - find_code ${TMP} head > ${OUT} - rep_declarations >> ${OUT} - find_code ${IN} body |\ - decrement_indices |\ - c_to_fortran_paren |\ - fix_comment_delimiter cc |\ - fix_pow |\ - strip_junk |\ - ${PARSER} >> ${OUT} - rep_footer >> ${OUT} - find_code ${TMP} foot >> ${OUT} - rm ${TMP} - ;; -esac - - DELETED mttroot/mtt/cc/parse_m2cc.cc Index: mttroot/mtt/cc/parse_m2cc.cc ================================================================== --- mttroot/mtt/cc/parse_m2cc.cc +++ mttroot/mtt/cc/parse_m2cc.cc @@ -1,392 +0,0 @@ -/* $Id$ - * $Log$ - * Revision 1.4 2002/05/01 12:54:55 geraint - * Now recognises keywords terminated with ; as well as ws. - * Now recognises # as a comment when not terminated by ws. - * i.e. CarnotCycle_input.txt now gets translated correctly! - * - * Revision 1.3 2001/07/13 04:54:04 geraint - * Branch merge: numerical-algebraic-solution back to main. - * - * Revision 1.2.2.1 2001/06/30 03:26:17 geraint - * gcc-3.0 compatibility. - * - * Revision 1.2 2001/03/19 02:28:53 geraint - * Branch merge: merging-ode2odes-exe back to MAIN. - * - * Revision 1.1.2.2 2001/03/09 04:01:20 geraint - * \ escapes newline. - * - * Revision 1.1.2.1 2001/03/09 02:59:26 geraint - * got_comment: (char)c no longer compared to (int)EOF. - * - * Revision 1.1 2000/12/28 09:46:05 peterg - * put under RCS - * - * Revision 1.1 2000/10/31 04:29:50 geraint - * Initial revision - * - */ - - -#include -#include -#include -#include -#include -#include - - - -/* - * Bracket.hh deals with nesting levels of parenthesis - * just add Bracket pointer to string / stream - */ -#include "Bracket.hh" - - - -using namespace std; - -/* - * use lbrace, etc. in expressions to automate nesting calculations - */ -LeftBrace *lbrace = new LeftBrace; -RightBrace *rbrace = new RightBrace; - -LeftParen *lparen = new LeftParen; -RightParen *rparen = new RightParen; - - - -/* - * use brace nesting depth to determine indentation - */ -string indent (void) { return lbrace->indentation (); } - - - -/* - * map contains keyword to look for and function to call when found - */ -map keyword; - - - - -/* - * stack records current nest type - * so that "end" can be handled correctly - */ -enum nest_type -{ - null, - if_statement, - switch_statement, - while_statement -}; - -stack current_nest; - - - -/* - * assuming cin has '(' as next character - * find the matching ')' and return the string contained within - */ -string get_test (void) -{ - const int entry_nesting = lparen->get_nesting_depth (); - char c; - string buf = ""; - cin.setf (ios::skipws); - cin >> c; - if ('(' != c) - { - cerr << "Sorry, test must be enclosed in ( )" << endl; - cerr << "current character is " << c << endl; - /* - * replace this with a call to get_expression maybe? - */ - exit (-1); - } - else - { - buf += lparen; - } - cin.unsetf (ios::skipws); - while (entry_nesting != lparen->get_nesting_depth ()) { - cin >> c; - switch (c) - { - case '(': - buf += lparen; - break; - case ')': - buf += rparen; - break; - case EOF: - cerr << "Oops! EOF reached" << endl; - exit (-1); - default: - buf += c; - break; - } - } - return buf; -} - - - -/* - * functions to be called upon detection of keyword - */ -void got_if (void) -{ - current_nest.push (if_statement); - cout << "if "; - cout << get_test (); - cout << lbrace; -} - -void got_else (void) -{ - cout << rbrace; - cout << "else"; - cout << lbrace; -} - -void got_elseif (void) -{ - cout << rbrace; - got_if (); -} - -void got_switch (void) -{ - current_nest.push (switch_statement); - cout << "switch "; - cout << get_test (); - cout << lbrace; - /* - * open a second brace so that each "case" can be enclosed - */ - cout << lbrace; -} - -void got_case (void) -{ - cout << rbrace; - cout << "case "; - cout << get_test (); - cout << ':'; - cout << lbrace; -} - -void got_otherwise (void) -{ - cout << rbrace; - cout << "default:"; - cout << lbrace; -} - -void got_while (void) -{ - current_nest.push (while_statement); - cout << "while "; - cout << get_test (); - cout << lbrace; -} - -void got_end (void) -{ - enum nest_type n = current_nest.top (); - switch (n) - { - case if_statement: - case while_statement: - cout << rbrace; - break; - case switch_statement: - cout << rbrace - << rbrace; - break; - default: - cerr << "Oops! Unmatched end ... aborting" << endl; - exit (-1); - break; - } - current_nest.pop (); -} - -void got_comment (void) -{ - /* - * get remainder of line in case there are any commented keywords - */ - char c; - cout << " // "; - cin >> c; - do { - cout << c; - } while (c != '\n' && cin >> c); - cout << endl - << indent () << ';' << endl - << indent (); -} - - - -/* - * map contains keyword to look for and functions to call when found - * functions must be of the form "void f (void) {...;}" - * new structures should also be added to enum nest_type - */ -void set_keyword (void) -{ - // if - keyword ["if"] = got_if; - keyword ["else"] = got_else; - keyword ["elseif"] = got_elseif; - keyword ["endif"] = got_end; - - // switch - keyword ["switch"] = got_switch; - keyword ["case"] = got_case; - keyword ["otherwise"] = got_otherwise; - keyword ["endswitch"] = got_end; - - // while - keyword ["while"] = got_while; - keyword ["endwhile"] = got_end; - - // general - keyword ["end"] = got_end; - - /* - * this won't work inside a string - * or if there is no space around the delimiter - */ - keyword ["#"] = got_comment; - keyword ["//"] = got_comment; - -/* - * unimplemented keywords - * - keyword ["for"] = got_for; - keyword ["endfor"] = got_end; - keyword ["break"] = got_break; - keyword ["continue"] = got_continue; -*/ -} - - - -/* read in one character at a time looking for tokens (delimited by whitespace) - * if the token is a keyword, call the appropriate function - */ -int main (void) -{ - set_keyword (); - string buf = ""; - char c; - cin.unsetf (ios::skipws); - while (cin >> c) - { - switch (c) - { - case EOF: - return 0; - case ' ': - case '\t': - if (keyword [buf]) - { - keyword [buf](); - } - else - { - if (! lbrace->get_nesting_depth ()) - { - buf += c; - } - cout << buf; - } - buf = ""; - break; - case ';': - case '\n': - if (keyword [buf]) - { - /* - * keyword found, call function - */ - keyword [buf] (); - } - else - { - cout << buf - /* - * keep newline in case this line has an EOL-comment - */ - << endl - /* - * EOL is end-of-statement in Octave, add ; - */ - << indent () << ';' << endl - << indent (); - } - buf = ""; - break; - case '#': - if (keyword [buf]) - { - /* - * keyword found, call function - */ - keyword [buf] (); - } - else - { - cout << buf - /* - * keep newline in case this line has an EOL-comment - */ - << endl - /* - * EOL is end-of-statement in Octave, add ; - */ - << indent () << ';' << endl - << indent (); - } - keyword ["#"] (); - buf = ""; - break; - - case '\\': - cin >> c; - if ('\n' == c) - { - buf += '\n'; - } - else - { - buf += '\\'; - buf += c; - } - break; - default: - buf += c; - } - if (lbrace->get_nesting_depth ()) - { - cout.setf (ios::skipws); - } - else - { - cout.unsetf (ios::skipws); - } - } - return 0; -} - - DELETED mttroot/mtt/cc/sympar_txt2h.sh Index: mttroot/mtt/cc/sympar_txt2h.sh ================================================================== --- mttroot/mtt/cc/sympar_txt2h.sh +++ mttroot/mtt/cc/sympar_txt2h.sh @@ -1,1128 +0,0 @@ -#! /bin/sh -# $Id$ -# $Log$ -# Revision 1.9 2004/08/29 03:18:11 geraint -# Do not write temporary variables if NUM_OF_TMP_VAR = 0. -# -# Revision 1.8 2002/09/16 08:08:01 geraint -# Merged changes from global-optimisation branch. -# -# Revision 1.7.2.1 2002/09/04 10:44:59 geraint -# Added option to specify number of tmp variables declared (-ntmpvar ). -# -# Revision 1.7 2002/07/10 11:53:32 geraint -# Replaced shell loop with template expansion - perceptibly quicker generation of sympar.h. -# -# Revision 1.6 2002/05/19 13:01:22 geraint -# Numerical solution of algebraic equations implemented for S-function target. -# -# Equation solving requires the Matlab Optimization Toolbox to be installed. -# -# Code has been changed from C++ to C to allow mex files to be built with LCC, -# the compiler bundled with Matlab. -# -# Parameters are now obtained from numpar.c instead of a dialogue box. -# -# `mtt sfun zip` creates all necessary files for building the model mex files. -# -# Revision 1.5 2002/04/28 18:58:06 geraint -# Fixed [ 549658 ] awk should be gawk. -# Replaced calls to awk with call to gawk. -# -# Revision 1.4 2001/08/24 21:41:04 geraint -# Fixed problem with declaration when there are no numerical parameters. -# -# Revision 1.3 2001/03/19 02:28:53 geraint -# Branch merge: merging-ode2odes-exe back to MAIN. -# -# Revision 1.2.2.1 2001/03/16 03:56:54 geraint -# Convert variable names to lower case. -# -# Revision 1.2 2001/02/05 13:03:19 geraint -# Restrict scope of variables to file (static). -# Warn GCC that variables may be unused. -# -# Revision 1.7 2001/01/09 15:43:50 geraint -# Warn gcc that variables may be unused. -# -# Revision 1.6 2001/01/08 05:47:56 geraint -# Restrict scope of variables to file (static) -# -# Revision 1.5 2000/12/05 12:44:55 peterg -# Changed $() to `` -# -# Revision 1.4 2000/12/05 12:16:02 peterg -# Changed function name to name() -# -# Revision 1.3 2000/12/04 11:05:01 peterg -# Removed () -- geraint -# -# Revision 1.2 2000/11/07 17:29:27 peterg -# Changed echo -# -# Revision 1.1 2000/11/07 17:28:53 peterg -# Initial revision -# -# Revision 1.1 2000/10/31 04:32:02 geraint -# Initial revision -# - -SYS=$1 - -if [ $# -gt 1 ] -then - NUM_OF_TMP_VAR=$2; - shift; shift; -else - NUM_OF_TMP_VAR=500 - shift; -fi -TMP_VAR_NAMES="mtt_tmp mtt_o $*" - -IN=${SYS}_sympar.txt -OUT=${SYS}_sympar.h - -declare_sys_param () -{ -cat ${IN} | gawk '(NF>0){printf ("static double %s MTT_UNUSED;\t/* %s\t*/\n", tolower($1), $2)}' -} - -declare_temp_vars () -{ -for name in ${TMP_VAR_NAMES} -do - echo "" - - cat < ${OUT} -#ifndef MTT_UNUSED -#ifdef __GNUC__ -#define MTT_UNUSED __attribute__ ((__unused__)) -#else -#define MTT_UNUSED -#endif -#endif - -EOF - -declare_sys_param >> ${OUT} -if [ ${NUM_OF_TMP_VAR} -gt 0 ]; then - declare_temp_vars >> ${OUT} -fi - - DELETED mttroot/mtt/debian/README.Debian Index: mttroot/mtt/debian/README.Debian ================================================================== --- mttroot/mtt/debian/README.Debian +++ mttroot/mtt/debian/README.Debian @@ -1,7 +0,0 @@ -mtt for Debian --------------- - -Model Transformation Tools is hosted on Sourceforge -http://sourceforge.net/projects/mtt - - -- Geraint , Sun, 28 Apr 2002 00:11:29 +0000 DELETED mttroot/mtt/debian/changelog Index: mttroot/mtt/debian/changelog ================================================================== --- mttroot/mtt/debian/changelog +++ mttroot/mtt/debian/changelog @@ -1,6 +0,0 @@ -mtt (4.9+2002.04.27-1) unstable; urgency=low - - * Initial Release. - - -- Geraint Sun, 28 Apr 2002 00:11:29 +0000 - DELETED mttroot/mtt/debian/compat Index: mttroot/mtt/debian/compat ================================================================== --- mttroot/mtt/debian/compat +++ mttroot/mtt/debian/compat @@ -1,1 +0,0 @@ -7 DELETED mttroot/mtt/debian/conffiles Index: mttroot/mtt/debian/conffiles ================================================================== --- mttroot/mtt/debian/conffiles +++ mttroot/mtt/debian/conffiles @@ -1,1 +0,0 @@ -/etc/mtt.conf DELETED mttroot/mtt/debian/conffiles.ex Index: mttroot/mtt/debian/conffiles.ex ================================================================== --- mttroot/mtt/debian/conffiles.ex +++ mttroot/mtt/debian/conffiles.ex @@ -1,7 +0,0 @@ -# -# If you want to use this conffile, remove all comments and put files that -# you want dpkg to process here using their absolute pathnames. -# See the policy manual -# -# for example: -# /etc/mtt/mtt.conf DELETED mttroot/mtt/debian/control Index: mttroot/mtt/debian/control ================================================================== --- mttroot/mtt/debian/control +++ mttroot/mtt/debian/control @@ -1,19 +0,0 @@ -Source: mtt -Section: contrib/math -Priority: optional -Maintainer: Geraint -Build-Depends: debhelper (>> 3.0.0) -Standards-Version: 3.5.2 - -Package: mtt -Architecture: all -Depends: gawk, octave, units, xfig, perl -Recommends: mtt-examples, blas-dev, fftw-dev, c-compiler, dia, g++, gnuplot, info-browser, lapack-dev, latex2html, libkpathsea-dev, libncurses5-dev, libreadline4-dev, libxml-dom-perl, pdf-viewer, postscript-viewer, octave-pkg-dev, octave-info, texlive, texlive-latex-extra, transfig, xterm, www-browser, wish -Suggests: scigraphica, zip -Description: Model Transformation Tools. - A set of tools for modelling dynamic physical systems using the bond-graph methodology and transforming these models into representations suitable for analysis, control and simulation. These tools use, and generate m files for, GNU Octave. - . - The MTT homepage is located at http://mtt.sourceforge.net. An on-line manual is available at http://mtt.sourceforge.net/doc. - . - MTT uses the non-free symbolic algebra tool Reduce to perform some transformations and it is highly recommended that this software is installed. Details of Reduce can be found at http://www.reduce-algebra.com - . DELETED mttroot/mtt/debian/copyright Index: mttroot/mtt/debian/copyright ================================================================== --- mttroot/mtt/debian/copyright +++ mttroot/mtt/debian/copyright @@ -1,16 +0,0 @@ -This package was debianized by Geraint on -Sun, 28 Apr 2002 00:11:29 +0000. - -It was downloaded from http://sourceforge.net/projects/mtt - -Upstream Author(s): Peter Gawthrop - -Copyright: - -mtt is copyright (c) 1989-2004 by Peter J. Gawthrop. - -You are free to distribute this software under the terms of the -GNU General Public License (GPL). - -On Debian systems, the complete text of the GNU General Public License -can be found in /usr/share/common-licenses/GPL. DELETED mttroot/mtt/debian/cron.d.ex Index: mttroot/mtt/debian/cron.d.ex ================================================================== --- mttroot/mtt/debian/cron.d.ex +++ mttroot/mtt/debian/cron.d.ex @@ -1,4 +0,0 @@ -# -# Regular cron jobs for the mtt package -# -0 4 * * * root mtt_maintenance DELETED mttroot/mtt/debian/dirs Index: mttroot/mtt/debian/dirs ================================================================== --- mttroot/mtt/debian/dirs +++ mttroot/mtt/debian/dirs @@ -1,2 +0,0 @@ -usr/bin - DELETED mttroot/mtt/debian/docs Index: mttroot/mtt/debian/docs ================================================================== --- mttroot/mtt/debian/docs +++ mttroot/mtt/debian/docs DELETED mttroot/mtt/debian/emacsen-install.ex Index: mttroot/mtt/debian/emacsen-install.ex ================================================================== --- mttroot/mtt/debian/emacsen-install.ex +++ mttroot/mtt/debian/emacsen-install.ex @@ -1,45 +0,0 @@ -#! /bin/sh -e -# /usr/lib/emacsen-common/packages/install/mtt - -# Written by Jim Van Zandt , borrowing heavily -# from the install scripts for gettext by Santiago Vila -# and octave by Dirk Eddelbuettel . - -FLAVOR=$1 -PACKAGE=mtt - -if [ ${FLAVOR} = emacs ]; then exit 0; fi - -echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} - -#FLAVORTEST=`echo $FLAVOR | cut -c-6` -#if [ ${FLAVORTEST} = xemacs ] ; then -# SITEFLAG="-no-site-file" -#else -# SITEFLAG="--no-site-file" -#fi -FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" - -ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} -ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} - -# Install-info-altdir does not actually exist. -# Maybe somebody will write it. -if test -x /usr/sbin/install-info-altdir; then - echo install/${PACKAGE}: install Info links for ${FLAVOR} - install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz -fi - -install -m 755 -d ${ELCDIR} -cd ${ELDIR} -FILES=`echo *.el` -cp ${FILES} ${ELCDIR} -cd ${ELCDIR} - -cat << EOF > path.el -(setq load-path (cons "." load-path) byte-compile-warnings nil) -EOF -${FLAVOR} ${FLAGS} ${FILES} -rm -f *.el path.el - -exit 0 DELETED mttroot/mtt/debian/emacsen-remove.ex Index: mttroot/mtt/debian/emacsen-remove.ex ================================================================== --- mttroot/mtt/debian/emacsen-remove.ex +++ mttroot/mtt/debian/emacsen-remove.ex @@ -1,15 +0,0 @@ -#!/bin/sh -e -# /usr/lib/emacsen-common/packages/remove/mtt - -FLAVOR=$1 -PACKAGE=mtt - -if [ ${FLAVOR} != emacs ]; then - if test -x /usr/sbin/install-info-altdir; then - echo remove/${PACKAGE}: removing Info links for ${FLAVOR} - install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/mtt.info.gz - fi - - echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} - rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} -fi DELETED mttroot/mtt/debian/emacsen-startup.ex Index: mttroot/mtt/debian/emacsen-startup.ex ================================================================== --- mttroot/mtt/debian/emacsen-startup.ex +++ mttroot/mtt/debian/emacsen-startup.ex @@ -1,18 +0,0 @@ -;; -*-emacs-lisp-*- -;; -;; Emacs startup file for the Debian GNU/Linux mtt package -;; -;; Originally contributed by Nils Naumann -;; Modified by Dirk Eddelbuettel -;; Adapted for dh-make by Jim Van Zandt - -;; The mtt package follows the Debian/GNU Linux 'emacsen' policy and -;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, -;; xemacs19, emacs20, xemacs20...). The compiled code is then -;; installed in a subdirectory of the respective site-lisp directory. -;; We have to add this to the load-path: -(setq load-path (cons (concat "/usr/share/" - (symbol-name flavor) - "/site-lisp/mtt") load-path)) - - DELETED mttroot/mtt/debian/ex.package.doc-base Index: mttroot/mtt/debian/ex.package.doc-base ================================================================== --- mttroot/mtt/debian/ex.package.doc-base +++ mttroot/mtt/debian/ex.package.doc-base @@ -1,22 +0,0 @@ -Document: mtt -Title: Debian mtt Manual -Author: -Abstract: This manual describes what mtt is - and how it can be used to - manage online manuals on Debian systems. -Section: unknown - -Format: debiandoc-sgml -Files: /usr/share/doc/mtt/mtt.sgml.gz - -Format: postscript -Files: /usr/share/doc/mtt/mtt.ps.gz - -Format: text -Files: /usr/share/doc/mtt/mtt.text.gz - -Format: HTML -Index: /usr/share/doc/mtt/html/index.html -Files: /usr/share/doc/mtt/html/*.html - - DELETED mttroot/mtt/debian/init.d.ex Index: mttroot/mtt/debian/init.d.ex ================================================================== --- mttroot/mtt/debian/init.d.ex +++ mttroot/mtt/debian/init.d.ex @@ -1,70 +0,0 @@ -#! /bin/sh -# -# skeleton example file to build /etc/init.d/ scripts. -# This file should be used to construct scripts for /etc/init.d. -# -# Written by Miquel van Smoorenburg . -# Modified for Debian GNU/Linux -# by Ian Murdock . -# -# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl -# -# This file was automatically customized by dh-make on Sun, 28 Apr 2002 00:11:29 +0000 - -PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/mtt -NAME=mtt -DESC=mtt - -test -f $DAEMON || exit 0 - -set -e - -case "$1" in - start) - echo -n "Starting $DESC: " - start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON - echo "$NAME." - ;; - #reload) - # - # If the daemon can reload its config files on the fly - # for example by sending it SIGHUP, do it here. - # - # If the daemon responds to changes in its config file - # directly anyway, make this a do-nothing entry. - # - # echo "Reloading $DESC configuration files." - # start-stop-daemon --stop --signal 1 --quiet --pidfile \ - # /var/run/$NAME.pid --exec $DAEMON - #;; - restart|force-reload) - # - # If the "reload" option is implemented, move the "force-reload" - # option to the "reload" entry above. If not, "force-reload" is - # just the same as "restart". - # - echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON - sleep 1 - start-stop-daemon --start --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON - echo "$NAME." - ;; - *) - N=/etc/init.d/$NAME - # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 DELETED mttroot/mtt/debian/manpage.1.ex Index: mttroot/mtt/debian/manpage.1.ex ================================================================== --- mttroot/mtt/debian/manpage.1.ex +++ mttroot/mtt/debian/manpage.1.ex @@ -1,60 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH MTT SECTION "April 28, 2002" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -mtt \- program to do something -.SH SYNOPSIS -.B mtt -.RI [ options ] " files" ... -.br -.B bar -.RI [ options ] " files" ... -.SH DESCRIPTION -This manual page documents briefly the -.B mtt -and -.B bar -commands. -This manual page was written for the Debian distribution -because the original program does not have a manual page. -Instead, it has documentation in the GNU Info format; see below. -.PP -.\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, -.\" respectively. -\fBmtt\fP is a program that... -.SH OPTIONS -These programs follow the usual GNU command line syntax, with long -options starting with two dashes (`-'). -A summary of options is included below. -For a complete description, see the Info files. -.TP -.B \-h, \-\-help -Show summary of options. -.TP -.B \-v, \-\-version -Show version of program. -.SH SEE ALSO -.BR bar (1), -.BR baz (1). -.br -The programs are documented fully by -.IR "The Rise and Fall of a Fooish Bar" , -available via the Info system. -.SH AUTHOR -This manual page was written by Geraint , -for the Debian GNU/Linux system (but may be used by others). DELETED mttroot/mtt/debian/manpage.sgml.ex Index: mttroot/mtt/debian/manpage.sgml.ex ================================================================== --- mttroot/mtt/debian/manpage.sgml.ex +++ mttroot/mtt/debian/manpage.sgml.ex @@ -1,152 +0,0 @@ - manpage.1'. You may view - the manual page with: `docbook-to-man manpage.sgml | nroff -man | - less'. A typical entry in a Makefile or Makefile.am is: - -manpage.1: manpage.sgml - docbook-to-man $< > $@ - - - The docbook-to-man binary is found in the docbook-to-man package. - Please remember that if you create the nroff version in one of the - debian/rules file targets (such as build), you will need to include - docbook-to-man in your Build-Depends control field. - - --> - - - FIRSTNAME"> - SURNAME"> - - April 28, 2002"> - - SECTION"> - geraint@users.sf.net"> - - MTT"> - - - Debian"> - GNU"> -]> - - - -
    - &dhemail; -
    - - &dhfirstname; - &dhsurname; - - - 2001 - &dhusername; - - &dhdate; -
    - - &dhucpackage; - - &dhsection; - - - &dhpackage; - - program to do something - - - - &dhpackage; - - - - - - - - DESCRIPTION - - This manual page documents briefly the - &dhpackage; and bar - commands. - - This manual page was written for the &debian; distribution - because the original program does not have a manual page. - Instead, it has documentation in the &gnu; - Info format; see below. - - &dhpackage; is a program that... - - - - OPTIONS - - These programs follow the usual GNU command line syntax, - with long options starting with two dashes (`-'). A summary of - options is included below. For a complete description, see the - Info files. - - - - - - - - Show summary of options. - - - - - - - - Show version of program. - - - - - - SEE ALSO - - bar (1), baz (1). - - The programs are documented fully by The Rise and - Fall of a Fooish Bar available via the - Info system. - - - AUTHOR - - This manual page was written by &dhusername; &dhemail; for - the &debian; system (but may be used by others). Permission is - granted to copy, distribute and/or modify this document under - the terms of the GNU Free Documentation - License, Version 1.1 or any later version published by the Free - Software Foundation; with no Invariant Sections, no Front-Cover - Texts and no Back-Cover Texts. - - -
    - - - - DELETED mttroot/mtt/debian/menu Index: mttroot/mtt/debian/menu ================================================================== --- mttroot/mtt/debian/menu +++ mttroot/mtt/debian/menu @@ -1,6 +0,0 @@ -?package(mtt):needs="X11"\ - section="Apps/Math"\ - title="Xmtt"\ - longtitle="Model Transformation Tools for X"\ - hint="Model Transformation Tools for X"\ - command="x-terminal-emulator -e /usr/bin/xmtt" DELETED mttroot/mtt/debian/menu.ex Index: mttroot/mtt/debian/menu.ex ================================================================== --- mttroot/mtt/debian/menu.ex +++ mttroot/mtt/debian/menu.ex @@ -1,4 +0,0 @@ -?package(mtt):needs=X11|text|vc|wm section=Apps/see-menu-manual\ - title="mtt" command="/usr/bin/mtt" -?package(mtt):needs=X11|text|vc|wm section=Apps/see-menu-manual\ - title="xmtt" command="/usr/bin/xmtt" DELETED mttroot/mtt/debian/mtt.1 Index: mttroot/mtt/debian/mtt.1 ================================================================== --- mttroot/mtt/debian/mtt.1 +++ mttroot/mtt/debian/mtt.1 @@ -1,147 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH MTT 1 "April 27, 2002" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -mtt \- Model Transformation Tools -.SH SYNOPSIS -.B mtt -.RI [ options ] " system representation language" -.br -.B xmtt -.RI [ --update ] -.SH DESCRIPTION -This manual page documents briefly the -.B mtt -and -.B xmtt -commands. -Detailed documentation is available in info or html format by issuing -the command -.B mtt info -for info format or -.B mtt hinfo -for html. -.PP -.\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, -.\" respectively. -\fBmtt\fP is a set of tools for modelling dynamic physical systems using the bond-graph methodology and transforming these models into representations suitable for analysis, control and simulation. These tools use, and generate m files for, GNU Octave. -.SH OPTIONS -A summary of options is included below. -For a complete description, see the Info files. -.TP -.B \-q -quiet mode -- suppress MTT banner -.TP -.B \-A -solve algebraic equations symbolically -.TP -.B \-D -debug -- leave log files etc -.TP -.B \-I -prints more information -.TP -.B \-abg -start at abg.m representation -.TP -.B \-c -c-code generation -.TP -.B \-cc -C++ code generation -.TP -.B \-cr -Use cr before resolving equations -.TP -.B \-d -use directory -.TP -.B \-dc -Maximise derivative (not integral) causality -.TP -.B \-dc -Maximise derivative (not integral) causality -.TP -.B \-i -Use implicit, euler, rk4 or dassl integration -.TP -.B \-ae -Solve algebraic equations with specified solver -.TP -.B \-o -ode is same as dae -.TP -.B \-oct -use oct files in place of m files where appropriate -.TP -.B \-opt -optimise code generation -.TP -.B \-p -print environment variables -.TP -.B \-partition - partition hierachical system -.TP -.B \-pdf -generate pdf in place of ps -.TP -.B \-r -reset time stamp on representation -.TP -.B \-s -generate sensitivity BG (use mtt -s sSys rep lang) -.TP -.B \-ss -use steady-state info to initialise simulations -.TP -.B \-stdin -read input data from standard input for simulations -.TP -.B \-sub -operate on this subsystem -.TP -.B \-t -tidy mode (default) -.TP -.B \-trace -Just indicate what mtt will do - but do not do it -.TP -.B \-u -untidy mode (leaves files in current dir) -.TP -.B \-v -verbose mode (multiple uses of -v increase the verbosity level) -.TP -.B \-viewlevel -View N levels of hierachy -.TP -.B \-\-version -print version and exit -.TP -.B \-\-versions -print version of mtt and components and exit - -The programs are documented fully by -.IR "mtt: Model Transformation Tools" , -available via the Info system. -.SH FILES -/etc/mtt.conf -.SH AUTHOR -This manual page was written by Geraint , -for the Debian GNU/Linux system (but may be used by others). DELETED mttroot/mtt/debian/mtt.doc-base Index: mttroot/mtt/debian/mtt.doc-base ================================================================== --- mttroot/mtt/debian/mtt.doc-base +++ mttroot/mtt/debian/mtt.doc-base @@ -1,21 +0,0 @@ -Document: mtt -Title: Model Transformation Tools (MTT) Manual -Author: Peter Gawthrop, Geraint Bevan -Abstract: This manual describes Model Transformation Tools (MTT), - a set of tools for modelling dynamic physical systems using the bond-graph - methodology and transforming these models into representations suitable for - analysis, control and simulation. - These tools use, and generate m files for, GNU Octave. -Section: Apps/Math - -Format: postscript -Files: /usr/share/doc/mtt/mtt.ps.gz - -Format: PDF -Files: /usr/share/doc/mtt/mtt.pdf.gz - -Format: HTML -Index: /usr/share/doc/mtt/mtt.html -Files: /usr/share/doc/mtt/*.html - - DELETED mttroot/mtt/debian/package.doc-base Index: mttroot/mtt/debian/package.doc-base ================================================================== --- mttroot/mtt/debian/package.doc-base +++ mttroot/mtt/debian/package.doc-base @@ -1,19 +0,0 @@ -Document: mtt -Title: Debian mtt Manual -Author: Peter Gawthrop -Abstract: This manual describes mtt, - a set of tools for modelling dynamic physical systems - using the bond-graph methodology and transforming these - models into representations suitable for analysis, control - and simulation. These tools use, and generate m files for, - GNU Octave. -Section: math - -Format: postscript -Files: /usr/share/doc/mtt/mtt.ps.gz - -Format: HTML -Index: /usr/share/doc/mtt/html/mtt.html -Files: /usr/share/doc/mtt/html/*.html - - DELETED mttroot/mtt/debian/postinst Index: mttroot/mtt/debian/postinst ================================================================== --- mttroot/mtt/debian/postinst +++ mttroot/mtt/debian/postinst @@ -1,51 +0,0 @@ -#! /bin/sh -# postinst script for mtt -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package -# -# quoting from the policy: -# Any necessary prompting should almost always be confined to the -# post-installation script, and should be protected with a conditional -# so that unnecessary prompting doesn't happen if a package's -# installation fails and the `postinst' is called with `abort-upgrade', -# `abort-remove' or `abort-deconfigure'. - -case "$1" in - configure) - install-info --menuentry=MTT \ - --description="Model Transformation Tools" \ - --section "[Mm]ath" Mathematics \ - /usr/share/info/mtt.info.gz - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - DELETED mttroot/mtt/debian/postinst.ex Index: mttroot/mtt/debian/postinst.ex ================================================================== --- mttroot/mtt/debian/postinst.ex +++ mttroot/mtt/debian/postinst.ex @@ -1,48 +0,0 @@ -#! /bin/sh -# postinst script for mtt -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package -# -# quoting from the policy: -# Any necessary prompting should almost always be confined to the -# post-installation script, and should be protected with a conditional -# so that unnecessary prompting doesn't happen if a package's -# installation fails and the `postinst' is called with `abort-upgrade', -# `abort-remove' or `abort-deconfigure'. - -case "$1" in - configure) - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - DELETED mttroot/mtt/debian/postrm.ex Index: mttroot/mtt/debian/postrm.ex ================================================================== --- mttroot/mtt/debian/postrm.ex +++ mttroot/mtt/debian/postrm.ex @@ -1,38 +0,0 @@ -#! /bin/sh -# postrm script for mtt -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' overwrit>r> -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - - - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 DELETED mttroot/mtt/debian/preinst.ex Index: mttroot/mtt/debian/preinst.ex ================================================================== --- mttroot/mtt/debian/preinst.ex +++ mttroot/mtt/debian/preinst.ex @@ -1,44 +0,0 @@ -#! /bin/sh -# preinst script for mtt -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - install|upgrade) -# if [ "$1" = "upgrade" ] -# then -# start-stop-daemon --stop --quiet --oknodo \ -# --pidfile /var/run/mtt.pid \ -# --exec /usr/sbin/mtt 2>/dev/null || true -# fi - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - DELETED mttroot/mtt/debian/prerm Index: mttroot/mtt/debian/prerm ================================================================== --- mttroot/mtt/debian/prerm +++ mttroot/mtt/debian/prerm @@ -1,39 +0,0 @@ -#! /bin/sh -# prerm script for mtt -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `upgrade' -# * `failed-upgrade' -# * `remove' `in-favour' -# * `deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - remove|upgrade|deconfigure) - install-info --quiet --remove /usr/share/info/mtt.info.gz - ;; - failed-upgrade) - ;; - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - DELETED mttroot/mtt/debian/prerm.ex Index: mttroot/mtt/debian/prerm.ex ================================================================== --- mttroot/mtt/debian/prerm.ex +++ mttroot/mtt/debian/prerm.ex @@ -1,39 +0,0 @@ -#! /bin/sh -# prerm script for mtt -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `upgrade' -# * `failed-upgrade' -# * `remove' `in-favour' -# * `deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - remove|upgrade|deconfigure) -# install-info --quiet --remove /usr/info/mtt.info.gz - ;; - failed-upgrade) - ;; - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - DELETED mttroot/mtt/debian/rules Index: mttroot/mtt/debian/rules ================================================================== --- mttroot/mtt/debian/rules +++ mttroot/mtt/debian/rules @@ -1,94 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# This is the debhelper compatibility version to use. -export DH_COMPAT=3 - - - -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - $(MAKE) build build-doc - #/usr/bin/docbook-to-man debian/mtt.sgml > mtt.1 - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) distclean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/mtt. - $(MAKE) install install-doc install-xfig DESTDIR=$(CURDIR)/debian/mtt - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - dh_testdir - dh_testroot -# dh_installdebconf - dh_installdocs - dh_installexamples - dh_installmenu -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit - dh_installcron - dh_installman debian/mtt.1 - dh_installinfo -# dh_undocumented - dh_installchangelogs - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_makeshlibs - dh_installdeb -# dh_perl - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -# Build architecture-dependent files here. -binary-arch: build install - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure DELETED mttroot/mtt/debian/watch.ex Index: mttroot/mtt/debian/watch.ex ================================================================== --- mttroot/mtt/debian/watch.ex +++ mttroot/mtt/debian/watch.ex @@ -1,5 +0,0 @@ -# Example watch control file for uscan -# Rename this file to "watch" and then you can run the "uscan" command -# to check for upstream updates and more. -# Site Directory Pattern Version Script -sunsite.unc.edu /pub/Linux/Incoming mtt-(.*)\.tar\.gz debian uupdate DELETED mttroot/mtt/doc/Makefile Index: mttroot/mtt/doc/Makefile ================================================================== --- mttroot/mtt/doc/Makefile +++ mttroot/mtt/doc/Makefile @@ -1,97 +0,0 @@ -#Makefile for MTT documentation - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2002/04/26 17:17:20 geraint -## Allow variables to be set outside Makefile. -## -## Revision 1.1 2001/06/04 08:18:52 gawthrop -## Putting documentation under CVS -## -## Revision 1.2 1998/07/02 18:40:07 peterg -## More on install option -## -## Revision 1.1 1998/05/14 09:19:52 peterg -## Initial revision -## -############################################################### - - -#MTTPATH = /home/peterg/mtt_new/mtt -#DOCPATH = /home/peterg/web-docs/software/MTT/doc -#INFOPATH = /usr/info - -MTTPATH ?= /home/peterg/mtt_new/mtt -MTT_COMPONENTS ?= /home/eng4/peterg/mtt_new/mtt/lib/comp -MTT_EXAMPLES ?= /home/eng4/peterg/mtt_new/mtt/lib/examples -DOCPATH ?= /home/peterg/web-docs/software/MTT/doc -#INFOPATH = $(DOCPATH) -INFOPATH ?= /usr/info - -all: mtt.info mtt.html mtt.pdf mtt.ps.gz - -mtt.info: mtt.texi - echo "Making info manual. Please wait ..."; makeinfo mtt.texi - -mtt.dvi: mtt.texi - echo "Making dvi manual. Please wait ..."; tex mtt.texi; tex mtt.texi - -mtt.html: mtt.texi - echo "Making html manual. Please wait ..."; texi2html -glossary mtt.texi - -mtt.ps.gz: mtt.dvi - echo "Making ps manual. Please wait ..."; dvips -o mtt.ps mtt; gzip -f mtt.ps - -mtt.pdf: mtt.texi - echo "Making pdf manual. Please wait ..."; texi2pdf mtt.texi - -Compound-Components_rep.ps: - (cd $(MTT_COMPONENTS); mtt Compound-Components rep ps) - mv $(MTT_COMPONENTS)/Compound-Components_rep.ps . - -Compound-Components_rep: - (cd $(MTT_COMPONENTS); mtt Compound-Components rep html) - mv $(MTT_COMPONENTS)/Compound-Components_rep . - -Examples_rep.ps: - (cd $(MTT_EXAMPLES); mtt Examples rep ps) - mv $(MTT_EXAMPLES)/Examples_rep.ps . - -Examples_rep: - (cd $(MTT_EXAMPLES); mtt Examples rep html) - mv $(MTT_EXAMPLES)/Examples_rep . - -clean: - rm -f mtt.aux mtt.fns mtt.pg mtt.tp - rm -f mtt.cp mtt.pgs mtt.vr mtt.ps - rm -f mtt.cps mtt.vrs mtt.dvi mtt.ps.gz - rm -f mtt.ky mtt.fn mtt.log mtt.toc - rm -f mtt.ps mtt.info-* mtt.pdf - rm -f mtt.html mtt_toc.html mtt.info - rm -f mtt.log mtt.ky mtt.toc - -tidy: - rm -f mtt.aux mtt.fns mtt.pg mtt.tp - rm -f mtt.cp mtt.pgs mtt.vr - rm -f mtt.cps mtt.vrs mtt.dvi - rm -f mtt.log mtt.ky mtt.toc - - -install-doc: mtt.html mtt.ps.gz mtt.info - cp mtt.info* $(INFOPATH) - cp mtt*.html mtt.ps.gz $(DOCPATH) - chmod -R a+r $(DOCPATH) - chmod a+x $(DOCPATH) - -install-components: Compound-Components_rep.ps Compound-Components_rep - mv Compound-Components_rep.ps $(DOCPATH)/../components - mv Compound-Components_rep $(DOCPATH)/../components - chmod -R a+r $(DOCPATH)/../components - chmod -R a+x $(DOCPATH)/../components/Compound-Components_re - - - - DELETED mttroot/mtt/doc/mtt.texi Index: mttroot/mtt/doc/mtt.texi ================================================================== --- mttroot/mtt/doc/mtt.texi +++ mttroot/mtt/doc/mtt.texi @@ -1,7991 +0,0 @@ -\input texinfo -@c %**start of header -@setfilename mtt.info -@settitle MTT: Model Transformation Tools -@c %**end of header - -@finalout - -@c Here is what I use in the Info `dir' file: -@c * Mtt: (mtt). Model transformation tools. - - - -@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@comment Version control history -@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@comment $Id$ -@comment $Log$ -@comment Revision 1.32 2014/07/12 19:56:27 geraint -@comment Fixed style of NO WARRANTY from @heading to @strong because texi2html complained about having a heading in an enumerate environment -@comment -@comment Revision 1.31 2014/07/10 23:13:27 geraint -@comment Fixed mtt.texi missing arguments and subsection level -@comment -@comment Revision 1.30 2005/03/15 12:04:15 gawthrop -@comment New labg.fig rep - pretty LaTeX figures. -@comment -@comment Revision 1.29 2005/01/19 09:45:15 geraint -@comment Fixed whitespace. -@comment -@comment Revision 1.28 2005/01/06 16:03:55 geraint -@comment Updated options list. -@comment -@comment Revision 1.27 2005/01/06 14:42:33 geraint -@comment Fixed explicit/implicit descriptions of forward/backward Euler. -@comment Replaced -c examples with -cc. -@comment -@comment Revision 1.26 2005/01/06 12:28:36 geraint -@comment Minor typos. -@comment -@comment Revision 1.25 2004/08/27 20:12:34 geraint -@comment Added note about "none" as an option for units. -@comment -@comment Revision 1.24 2004/08/13 01:39:24 geraint -@comment Fixed variable names in diy makefile example (again) -@comment -@comment Revision 1.23 2004/08/11 08:24:28 geraint -@comment Replaced "gnuplot view" with "odeso gnuplot" in examples. -@comment -@comment Revision 1.21 2004/07/23 11:05:26 geraint -@comment Updated Reduce URL: http://www.reduce-algebra.com -@comment -@comment Revision 1.20 2003/10/23 18:14:43 geraint -@comment Added subsection with script for model-specific options. -@comment Fixed typo in url to mtt.sf.net. -@comment -@comment Revision 1.19 2003/10/10 22:22:18 geraint -@comment typo. -@comment -@comment Revision 1.18 2003/09/07 20:41:19 geraint -@comment *** empty log message *** -@comment -@comment Revision 1.17 2003/08/19 14:20:38 gawthrop -@comment Version 5.0 of MTT -@comment Remove xref errors (spurious spaces) -@comment -@comment Revision 1.16 2003/08/19 14:11:23 gawthrop -@comment Links to legal stuff -@comment -@comment Revision 1.15 2003/08/19 14:01:45 gawthrop -@comment Added legal appendices -@comment -@comment Revision 1.14 2003/08/06 14:50:56 gawthrop -@comment Describe the alias mechanism for invoking mtt options -@comment -@comment Revision 1.13 2002/12/13 10:07:07 gawthrop -@comment Added example in sh section of DIY reps -@comment -@comment Revision 1.12 2002/09/19 08:09:31 gawthrop -@comment Updated documentation documentation -@comment -@comment Revision 1.11 2002/08/20 15:51:17 gawthrop -@comment Update to work with ident DIY rep -@comment -@comment Revision 1.10 2002/07/22 10:45:22 geraint -@comment Fixed gnuplot rep so that it correctly re-runs the simulation if input files have changed. -@comment -@comment Revision 1.9 2002/07/05 13:29:34 geraint -@comment Added notes about generating dynamically linked functions for Octave and Matlab. -@comment -@comment Revision 1.8 2002/07/04 21:34:12 geraint -@comment Updated gnuplot view description to describe Tcl/Tk interface instead of obsolete txt method. -@comment -@comment Revision 1.7 2002/04/23 09:51:54 gawthrop -@comment Changed incorrect statement about searching for components. -@comment -@comment Revision 1.6 2001/10/15 14:29:50 gawthrop -@comment Added documentaton on [1:N] style port labels -@comment -@comment Revision 1.5 2001/07/23 03:35:29 geraint -@comment Updated file structure (mtt/bin). -@comment -@comment Revision 1.4 2001/07/23 03:25:02 geraint -@comment Added notes on -ae hybrd, rk4, ode2odes.cc, .oct dependencies. -@comment -@comment Revision 1.3 2001/07/13 03:02:38 geraint -@comment Added notes on #ICD, gnuplot.txt and odes.sg rep. -@comment -@comment Revision 1.2 2001/07/03 22:59:10 gawthrop -@comment Fixed problems with argument passing for CRs -@comment -@comment Revision 1.1 2001/06/04 08:18:52 gawthrop -@comment Putting documentation under CVS -@comment -@comment Revision 1.66 2000/12/05 14:20:55 peterg -@comment Added the c++ anf m CR info. -@comment -@comment Revision 1.65 2000/11/27 15:36:15 peterg -@comment NOPAR --> NOTPAR -@comment -@comment Revision 1.64 2000/11/16 14:22:48 peterg -@comment added UNITS declaration -@comment -@comment Revision 1.63 2000/11/03 14:41:08 peterg -@comment Added PAR and NOPAR stuff -@comment -@comment Revision 1.62 2000/10/17 17:53:34 peterg -@comment Added some simulation details -@comment -@comment Revision 1.61 2000/09/14 17:13:06 peterg -@comment New options table -@comment -@comment Revision 1.60 2000/09/14 17:09:20 peterg -@comment Tidied up valid name sections -@comment Tidied up defining represnetations table -@comment Verion 4.6 -@comment -@comment Revision 1.59 2000/08/30 13:09:00 peterg -@comment Updated option table -@comment -@comment Revision 1.58 2000/08/01 13:30:19 peterg -@comment Version 4.4 -@comment updated STEPFACTOR info -@comment describes octave and OCST interfaces -@comment -@comment Revision 1.57 2000/07/20 07:55:44 peterg -@comment Version 4.3 -@comment -@comment Revision 1.56 2000/05/19 17:49:17 peterg -@comment Extended the user defined representation section -- new nppp rep. -@comment -@comment Revision 1.55 2000/03/16 13:53:31 peterg -@comment Correct date -@comment -@comment Revision 1.54 2000/03/15 21:22:57 peterg -@comment Updated to 4.1 -- old style SS no longer supported -@comment -@comment Revision 1.53 1999/12/22 05:33:10 peterg -@comment Updated for 4.0 -@comment -@comment Revision 1.52 1999/11/23 00:25:11 peterg -@comment Added the sensitivity reps -@comment -@comment Revision 1.51 1999/11/16 04:43:47 peterg -@comment Added start of sensitivity section -@comment -@comment Revision 1.50 1999/11/16 00:30:35 peterg -@comment Updated simulation section -@comment Added vector components -@comment -@comment Revision 1.49 1999/07/20 23:44:58 peterg -@comment V 3.8 -@comment -@comment Revision 1.48 1999/07/19 03:08:33 peterg -@comment Added documentation for (new) SS lbl fields -@comment -@comment Revision 1.47 1999/03/09 01:42:22 peterg -@comment Rearranged the User interface section -@comment -@comment Revision 1.46 1999/03/09 01:18:01 peterg -@comment Updated for 3.5 including xmtt -@comment -@comment Revision 1.45 1999/03/03 02:39:26 peterg -@comment Minor updates -@comment -@comment Revision 1.44 1999/02/17 06:52:14 peterg -@comment New level formula dor artwork -@comment -@comment Revision 1.43 1998/11/25 16:49:24 peterg -@comment Put in subs.r documentation (was called params.r) -@comment -@comment Revision 1.42 1998/11/24 12:24:59 peterg -@comment Added section on simulation output -@comment Version 3.4 -@comment -@comment Revision 1.41 1998/09/02 12:04:15 peterg -@comment Version 3.2 -@comment -@comment Revision 1.40 1998/08/27 08:36:39 peterg -@comment Removed in. methods except Euler anf implicit -@comment -@comment Revision 1.39 1998/08/18 10:44:28 peterg -@comment Typo -@comment -@comment Revision 1.38 1998/08/18 09:16:38 peterg -@comment Version 3.1 -@comment -@comment Revision 1.37 1998/08/17 16:14:30 peterg -@comment Version 3.1 - includes documentation on METHOD=IMPLICIT -@comment -@comment Revision 1.36 1998/07/30 17:33:15 peterg -@comment VERSION 3.0 -@comment -@comment Revision 1.35 1998/07/22 11:00:53 peterg -@comment Correct date! -@comment -@comment Revision 1.34 1998/07/22 11:00:13 peterg -@comment Version to BAe -@comment -@comment Revision 1.33 1998/07/17 19:32:19 peterg -@comment Added more about aliases -@comment -@comment Revision 1.32 1998/07/05 14:21:56 peterg -@comment Further additions (Carlisle-Glasgow) -@comment -@comment Revision 1.31 1998/07/04 11:35:57 peterg -@comment Strarted new lbl description -@comment -@comment Revision 1.30 1998/07/02 18:39:20 peterg -@comment Started 3.0 -@comment Added alias and default sections. -@comment -@comment Revision 1.29 1998/05/19 19:46:58 peterg -@comment Added the odess description -@comment -@comment Revision 1.28 1998/05/14 09:17:22 peterg -@comment Added METHOD variable to the simpar file -@comment -@comment Revision 1.27 1998/05/13 10:03:09 peterg -@comment Added unknown/zero SS label documentation. -@comment -@comment Revision 1.26 1998/04/29 15:12:46 peterg -@comment Version 2.9. -@comment -@comment Revision 1.25 1998/04/12 17:00:26 peterg -@comment Added new port features: coerced direction and top-level behaviour. -@comment -@comment Revision 1.24 1998/04/05 18:27:20 peterg -@comment This was the 2.6 version -@comment -@comment Revision 1.23 1997/08/24 11:17:51 peterg -@comment This is the released version 2.5 -@comment -@comment Revision 1.22 1997/08/23 19:38:53 peterg -@comment Added simulation chapter. -@comment -@comment Revision 1.21 1997/08/23 16:50:10 peterg -@comment Added desc section. -@comment Included named and vector ports -@comment Completed list of representations. -@comment -@comment Revision 1.20 1997/06/16 15:39:24 peterg -@comment THis is the released 2.4 document. -@comment -@comment Revision 1.19 1997/06/16 09:48:23 peterg -@comment Back under revision control (elm) -@comment -@comment Revision 1.18 1997/06/14 20:27:41 peterg -@comment Added complex example section. -@comment -@comment Revision 1.18 1997/06/13 14:51:07 peterg -@comment Added report section -@comment -@comment Revision 1.17 1997/05/09 15:06:02 peterg -@comment Changed to version 2.4. -@comment -@comment Revision 1.16 1996/12/05 10:06:25 peterg -@comment Modified .octaverc : 'true' --> 1 -@comment -@comment Revision 1.15 1996/11/20 19:02:28 peterg -@comment Added some system admin stuff. -@comment Added section on simple models. -@comment -@comment Revision 1.14 1996/11/12 13:19:04 peterg -@comment Put paths as section, not subsection. -@comment -@comment Revision 1.13 1996/11/11 16:53:14 peterg -@comment Added params documentation -@comment Sorted out table bug. -@comment -@comment Revision 1.12 1996/11/10 20:29:31 peterg -@comment Added section on help -- needs more -@comment -@comment Revision 1.11 1996/11/09 21:15:28 peterg -@comment Rewrite of quick start. -@comment Update of file structure. -@comment -@comment Revision 1.10 1996/11/09 20:25:54 peterg -@comment Final v2.0. -@comment -@comment Revision 1.9 1996/10/01 10:33:02 peter -@comment Cleaned up cross references. -@comment -@comment Revision 1.8 1996/10/01 09:31:00 peter -@comment Added sections written in Hong Kong. -@comment -@comment Revision 1.7 1996/09/16 09:49:47 peter -@comment Added ese section -@comment -@comment Revision 1.6 1996/09/16 08:33:53 peter -@comment Added constitutive relationship section etc. -@comment -@comment Revision 1.5 1996/09/15 20:20:56 peter -@comment Added abg and rbg stuff -@comment -@comment Revision 1.4 1996/08/30 19:07:40 peter -@comment Added some admin stuff. -@comment -@comment Revision 1.3 1996/08/30 07:50:16 peter -@comment Added file structure section. -@comment -@comment Revision 1.2 1996/08/22 14:28:50 peter -@comment Added stuff about labels. -@comment -@comment Revision 1.1 1996/08/22 11:52:59 peter -@comment Initial revision -@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -@ifinfo -This file documents MTT, a set of Model Transformation Tools. - - -Copyright (C) Peter J. Gawthrop 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003 - -Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). -@end ignore - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided also that the -section entitled ``GNU General Public License'' is included exactly as -in the original, and provided that the entire resulting derived work is -distributed under the terms of a permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that the section entitled ``GNU General Public License'' may be -included in a translation approved by the author instead of in the -original English. -@end ifinfo - - -@titlepage -@title MTT: Model Transformation Tools -@subtitle August 2003 -@subtitle For version 5.0. -@author Peter Gawthrop, Geraint Bevan -@page -@vskip 0pt plus 1filll -Copyright @copyright{} 1996,1997,1998,1999,2000,2001,2002,2003 Peter J. Gawthrop - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 - or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover - Texts. A copy of the license is included in the section entitled "GNU - Free Documentation License". - -General information about MTT is available at URL www.sf.net. MTT is distributed -under the GNU GENERAL PUBLIC LICENSE (@pxref{Copying}). This manual is -distributed under the GNU Free Documentation License (@pxref{GNU Free -Documentation License}). - -@example -http://mtt.sourceforge.net -@end example -@ifhtml - here. -@end ifhtml - -@end titlepage - - -@ifinfo -@node Top, Introduction, (dir), (dir) -@top MTT -@strong{MTT} is a set of Model Transformation Tools based on bond graphs. -@strong{MTT} implements the theory to be found in the book ``Metamodelling: Bond -Graphs and Dynamic Systems'' by Peter Gawthrop and Lorcan Smith -published by Prentice Hall in 1996 (ISBN 0-13-489824-9). - -It implements two features not discussed in that book: -@itemize @bullet -@item -bicausal bond graphs and -@item -hierarchical bond graphs. -@end itemize - - - -@contents - -@end ifinfo - - -@c @include intro.texi -@c Copyright (C) 1996 Peter J. Gawthrop -@c This is part of the MTT manual. -@c For copying conditions, see the file MTT.texi. - -@menu -* Introduction:: -* User interface:: -* Creating Models:: -* Simulation:: -* Sensitivity models:: -* Representations:: -* Extending MTT:: -* Documentation:: -* Languages:: -* Language tools:: -* Administration:: -* Glossary:: -* Index:: - -@detailmenu - --- The Detailed Node Listing --- - -Introduction - -* What is a Representation?:: -* What is a Transformation?:: -* Bond graphs:: What is a bond graph? -* Variables:: -* Bonds:: -* Components:: -* Algebraic loops:: -* Switched systems:: - -Components - -* Ports:: -* Constitutive relationship:: -* Symbolic parameters:: -* Numeric parameters:: - -User interface - -* Menu-driven interface:: -* Command line interface:: -* Options:: -* Utilities:: - -Options - -* Available options:: -* Model-specific options:: - -Available options - -* Experimental options:: -* Deprecated options:: - -Utilities - -* Help:: -* Copy:: -* Clean:: -* Version control:: - -Help - -* help representations:: -* help components:: -* help examples:: -* help crs:: -* help :: - -Creating Models - -* Quick start:: -* Creating simple models:: -* Creating complex models:: - -Creating complex models - -* Top level:: - -Simulation - -* Steady-state solutions:: -* Simulation parameters:: -* Simulation input:: -* Simulation logic:: -* Simulation initial state:: -* Simulation code:: -* Simulation output:: - -Steady-state solutions - -* Steady-state solutions - numerical(odess):: -* Steady-state solutions - symbolic (ss):: - -Simulation parameters - -* Euler integration:: -* Implicit integration:: -* Runge Kutta IV integration:: -* Hybrd algebraic solver:: - -Simulation code - -* Dynamically linked functions:: - -Simulation output - -* Viewing results with gnuplot:: -* Exporting results to SciGraphica:: - -Representations - -* Representation summary:: -* Defining representations:: -* Verbal description (desc):: -* Acausal bond graph (abg):: -* Acausal bond graph - LaTeX ready (labg):: -* Stripped acausal bond graph (sabg):: -* Labels (lbl):: -* Structure (struc):: -* Constitutive Relationship (cr):: -* Parameters:: -* Causal bond graph (cbg):: -* Elementary system equations:: -* Differential-Algebraic Equations:: -* Constrained-state Equations:: -* Ordinary Differential Equations:: -* Descriptor matrices:: -* Report:: - -Acausal bond graph (abg) - -* Language fig (abg.fig):: -* Language m (rbg.m):: -* Language m (abg.m):: -* Language tex (abg.tex):: - -Acausal bond graph - LaTeX ready (labg) - -* Language fig (abg.fig):: -* Language m (rbg.m):: -* Language m (abg.m):: -* Language tex (abg.tex):: - -Language fig (abg.fig) - -* icon library:: -* bonds:: -* strokes:: -* components:: -* Simple components:: -* SS components:: -* Simple components - implementation:: -* Compound components:: -* Named SS components:: -* Coerced bond direction:: -* Port labels:: -* Vector port labels:: -* Port label defaults:: -* Vector components:: -* artwork:: -* Valid names:: - -Simple components - -* SS components:: -* Simple components - implementation:: - -Compound components - -* Named SS components:: - -Language m (rbg.m) - -* Transformation abg2rbg_fig2m:: - -Language m (abg.m) - -* Arrow-orientated causality:: -* Component-orientated causality:: -* Transformation rbg2abg_m:: - -Stripped acausal bond graph (sabg) - -* Language fig (sabg.fig):: -* Stripped acausal bond graph (view):: - -Labels (lbl) - -* SS component labels:: -* Other component labels:: -* Component names:: -* Component constitutive relationship:: -* Component arguments:: -* Parameter declarations:: -* Units declarations:: -* Interface Control Definition:: -* Aliases:: -* Parameter passing:: -* Old-style labels (lbl):: -* Language tex (desc.tex):: - -Other component labels - -* Component names:: -* Component constitutive relationship:: -* Component arguments:: -* Aliases:: -* Parameter passing:: -* Old-style labels (lbl):: - -Aliases - -* Port aliases:: -* Parameter aliases:: -* CR aliases:: -* Component aliases:: - -Old-style labels (lbl) - -* SS component labels (old-style):: -* Other component labels (old-style):: -* Parameter passing (old-style):: - -Parameter passing (old-style) - -* Language tex (desc.tex):: - -Structure (struc) - -* Language txt (struc.txt):: -* Language tex (struc.tex):: -* Structure (view):: - -Constitutive relationship (cr) - -* Predefined constitutive relationships:: -* DIY constitutive relationships:: -* Unresolved constitutive relationships:: -* Unresolved constitutive relationships - Octave:: -* Unresolved constitutive relationships - c++:: - -Predefined constitutive relationships - -* lin:: -* exotherm:: - -Parameters - -* Symbolic parameters (subs.r):: -* Symbolic parameters for simplification (simp.r):: -* Numeric parameters (numpar):: - -Numeric parameters (numpar) - -* Text form (numpar.txt):: - -Causal bond graph (cbg) - -* Language fig (cbg.fig):: -* Language m (cbg.m):: - -Language m (cbg.m) - -* Transformation abg2cbg_m:: - -Elementary system equations (ese) - -* Transformation cbg2ese_m2r:: - -Differential-Algebraic Equations (dae) - -* Differential-Algebraic Equations (reduce):: -* Differential-Algebraic Equations (m):: - -Language reduce (dae.r) - -* Transformation ese2dae_r:: - -Language m (dae.m) - -* Transformation dae_r2m:: - -Constrained-state Equations (cse) - -* Constrained-state Equations (reduce):: -* Constrained-state Equations (view):: - -Language reduce (cse.r) - -* Transformation dae2cse_r:: - -Ordinary Differential Equations - -* Ordinary Differential Equations (reduce):: -* Ordinary Differential Equations (m):: -* Ordinary Differential Equations (view):: - -Language reduce (ode.r) - -* Transformation cse2ode_r:: - -Language m (ode.m) - -* Transformation ode_r2m:: - -Descriptor matrices (dm) - -* Descriptor matrices (reduce):: -* Descriptor matrices (m):: - -Report (rep) - -* Report (text):: -* Report (view):: - -Extending MTT - -* Makefiles:: -* New (DIY) representations:: -* Component library:: - -New (DIY) representations - -* Makefile (DIY representations):: -* Shell-script (DIY representations):: -* Documentation (DIY representations):: - -Documentation - -* Manual (Documentation):: -* On-line documentation:: - -On-line documentation - -* Brief:: -* Detailed:: - -Languages - -* Fig:: r -* m:: -* Reduce:: -* c:: - -Language tools - -* Views:: -* Xfig:: -* Text editors:: -* Octave:: -* LaTeX:: - -Octave - -* Octave control system toolbox (OCST):: -* Creating GNU Octave .oct files:: -* Creating Matlab .mex files:: -* Embedding MTT models in Simulink:: - -Administration - -* Software components:: -* REDUCE setup:: -* Octave setup:: -* Paths:: -* File structure:: -* GNU Free Documentation License:: -* Copying:: - -Octave setup - -* .octaverc:: -* .oct file dependencies:: - -Paths - -* $MTTPATH:: -* $MTT_COMPONENTS:: -* $MTT_CRS:: -* $MTT_EXAMPLES:: -* $OCTAVE_PATH:: - -@end detailmenu -@end menu - -@node Introduction, User interface, Top, Top -@chapter Introduction - -@cindex MTT, purpose of - -@pindex MTT - -@strong{MTT} is a set of Model Transformation Tools based on bond -graphs. @strong{MTT} implements the theory to be found in the book -``Metamodelling: Bond Graphs and Dynamic Systems'' by Peter Gawthrop and -Lorcan Smith published by Prentice Hall in 1996 (ISBN 0-13-489824-9). - -It implements two features not discussed in that book: -@itemize @bullet -@item -bicausal bond graphs and -@item -hierarchical bond graphs. -@end itemize - -In the context of software, it has been said that one good tool is worth many -packages. UNIX is a good example of this philosophy: the user can put together -applications from a range of ready made tools. -This manual describes the application of this philosophy to dynamic -system modeling embodied in @strong{MTT} - a set of Model Transformation Tools -each of which implements a single transformation between system -representations. - - -System representations have two attributes. -@itemize @bullet -@item - A Form: e.g. acausal bond graph, differential algebraic, linear - state-space etc. -@item -A Language: e.g. Fig, Matlab, LaTeX, Reduce, postscript etc. -@end itemize - -Transformations in @strong{MTT} are accomplished using appropriate software (e.g. -Octave/Matlab, Reduce) encapsulated in UNIX Bourne shell scripts. The -relationships between the tools are encoded in a Make File; thus the -user can specify a final representation and all the necessary -intermediate transformations are automatically generated. - -@menu -* What is a Representation?:: -* What is a Transformation?:: -* Bond graphs:: What is a bond graph? -* Variables:: -* Bonds:: -* Components:: -* Algebraic loops:: -* Switched systems:: -@end menu - - -@node What is a Representation?, What is a Transformation?, Introduction, Introduction -@section What is a representation? - -@cindex Representations, what are they? - -@pindex Representations - -Physical systems have many representations. These include -@itemize @bullet -@item -a schematic diagram, -@item -a block diagram, -@item -a bunch of equations, -@item -a single differential(-algebraic) equation, -@item -simulation code, -@item -linearised state-space (or descriptor) equations, -@item -transfer function (of the linearised system), -@item -frequency response (of the linearised system), -@item -etc... -@end itemize - -Each of these representations is related to other representations by an -appropriate transformation (@pxref{What is a Transformation?}. In many cases, a -modeler is presented with a physical system and needs to make a -model. In particular, a model, in this context, is a representation of -the system appropriate to a particular use, for example: -@itemize @bullet -@item -simulation, -@item -control system design, -@item -optimisation -@item -etc. -@end itemize - -Indeed, for a given physical system, the modeler would need to derive -a number of models. This process can be viewed as a series of steps; -each involving a transformation between representations (@pxref{What is a Transformation?}. - - -In this context, the following considerations are relevant. -@itemize @bullet -@item -There is a unique `core' representation of any system. -There are many routes from this core representation, each leading to -an appropriate model. -There are many possible routes to this core representation -from the physical system: the route chosen is a matter of convenience. -@item -Because the core representation is unique, it is easy to expand the -tool-box to include additional transformations from the physical system -to the core representation and additional transformations from the core -representation to the mode. -@item -Transformation_1 probably cannot, and certainly should not, be -completely automated. Engineering insight, knowledge and experience is -essential to capture the essence (with respect to the particular use) of -the physical system whilst discarding irrelevant form. -@item -Representation_1 should be `close' in some sense to the Physical system. -@item -The core representation, and hence the representations leading to it, -must contain enough information to generate all of the required models. -@item -Representations must be easily extensible: it must be possible to add -extra components or attributes without restructuring the representation. -@end itemize - -I happen to believe that Bond graphs (@pxref{Bond graphs}) provide the -most convenient and powerful basis for the core representation. - -@node What is a Transformation?, Bond graphs, What is a Representation?, Introduction -@comment node-name, next, previous, up -@section What is a transformation? -@cindex Transformations - - -Each system representation (@pxref{What is a Representation?} is related to other representations by an -appropriate transformation as follows: -@itemize @bullet -@item - Physical system -@item - Transformation_1 ---> Representation_1 -@item - Transformation_2 ---> Representation_2 -@item - ... -@item - Transformation_N ---> Core representation -@item - Transformation_N+1 ---> Representation_N+1 -@item - Transformation_N+2 ---> Representation_N+2 -@item - ... -@item - Transformation_N+M ---> Model -@end itemize -Thus modeling is seen as a sequence of transformations between -representations. - - - -@node Bond graphs, Variables, What is a Transformation?, Introduction -@section What is a bond graph? - -@cindex Bond graphs, what are they? - -@pindex Bond graphs - -Bond graphs provide a graphical high-level language for describing -dynamic systems in a precise and unambiguous fashion. -They make a clear distinction between structure (how components are -connected together), and behavior (the particular constitutive -relationships, or physical laws, describing each component. - -They can describe a range of physical systems including: -@itemize @bullet -@item -Electrical systems -@item -Mechanical systems -@item -Hydraulic systems -@item -Chemical process systems -@end itemize - -More importantly, they can describe systems which contain subsystems -drawn from all of these domains in a uniform manner. - -Bond graphs are made up of components (@pxref{Components}) connected by -bonds (@pxref{Bonds}) which define the relationship between -variables (@pxref{Variables}). - -@node Variables, Bonds, Bond graphs, Introduction -@comment node-name, next, previous, up -@section Variables -@cindex Variables -In bond graph terminology there are four sorts of variables: -@itemize @bullet -@item @emph{effort} variables -@item @emph{flow} variables -@item @emph{integrated effort} variables -@item @emph{integrated flow} variables -@end itemize - -Examples of @emph{effort} variables are -@itemize @bullet -@item -voltage -@item -pressure -@item -force -@item -torque -@item -temperature -@end itemize - -Examples of @emph{flow} variables are -@itemize @bullet -@item -current -@item -volumetric flow rate -@item -velocity -@item -angular velocity -@item -heat flow -@end itemize - - - -Examples of integrated @emph{flow} variables are -@itemize @bullet -@item -charge -@item -volume -@item -momentum -@item -angular momentum -@item -heat -@end itemize - - - -@node Bonds, Components, Variables, Introduction -@comment node-name, next, previous, up -@section Bonds -@cindex Bonds -Bonds connect components (@pxref{Components}) together. Each bond -carries two variables: -@itemize @bullet -@item an effort (@pxref{Variables}) variable and -@item a flow (@pxref{Variables}) variable. -@end itemize -Each bond has three notations associated with it: -@itemize @bullet -@item a half-arrow, -@item a causal stroke and -@item a causal half-stroke. -@end itemize - -The half-arrow indicates two things: -@itemize @bullet -@item the direction of power (or pseudo power) flow and -@item the side of the bond associated with the flow variable. -@end itemize - -The causal stroke indicates two things: -@itemize @bullet -@item the effort variable is imposed at the same end as the stroke and -@item the flow variable is imposed at the opposite end to the stroke. -@end itemize - -The causal half-stoke indicates one thing: -@itemize @bullet -@item if it is on the effort side of the bond, the effort variable is -imposed at the same end as the stroke or -@item if it is on the flow side of the bond, the flow variable is -imposed at the opposite end to the stroke. -@end itemize - - - -@node Components, Algebraic loops, Bonds, Introduction -@comment node-name, next, previous, up -@section Components -@cindex Components - -Components provide the building blocks of a dynamic system when -connected by bonds (@pxref{bonds}). -Components have the following attributes: -@vtable @code -@item ports - provide the connections to other components (@pxref{Ports}) -@item constitutive relationships - define how the port-variables are related (@pxref{Constitutive -relationship}) -@end vtable - - -@menu -* Ports:: -* Constitutive relationship:: -* Symbolic parameters:: -* Numeric parameters:: -@end menu - -@node Ports, Constitutive relationship, Components, Components -@comment node-name, next, previous, up -@subsection Ports -@cindex ports -Components have one or more ports. Each port carries two variables, -and effort and a flow variable (@pxref{Variables}). Any pair of ports -can be connected by a bond (@pxref{Bonds}); this connection is -equivalent to saying that the effort variables at each port are -identical and that the flow variables at each port are -identical. - -Ports are implemented in @strong{MTT} using named SS components. -(@pxref{Named SS components}). - -The direction of the named SS components. -(@pxref{Named SS components}) -is coerced (@pxref{Coerced bond direction}) to have the same direction -as the bons connected to the corresponding port. Thus the direction of -the direction of the named SS components has no significance unless the -component is at the top level. - -@node Constitutive relationship, Symbolic parameters, Ports, Components -@comment node-name, next, previous, up -@subsection Constitutive relationship -@cindex Constitutive Relationship - -The constitutive relationship of a component defines how the port -variables are related. This relationship may be linear -or non-linear. This typically contains symbolic parameters -(@pxref{Symbolic parameters}) which may be replaced, for the purposes -of numerical analysis by numeric parameters -(@pxref{Numeric parameters}). - -@node Symbolic parameters, Numeric parameters, Constitutive relationship, Components -@comment node-name, next, previous, up -@subsection Symbolic parameters -@cindex Symbolic parameters -The constitutive relationship of a system component (@pxref{Components}) -typically contains symbolic parameters. For example a resistor may have -a symbolic resistance r. It is convenient to leave such parameters as -symbols when viewing equations or when performing symbolic analysis such -as differentiation. - -However, @strong{MTT} allows replacement of symbolic parameters by -numeric parameters (@pxref{Numeric parameters}) when appropriate. - -@node Numeric parameters, , Symbolic parameters, Components -@comment node-name, next, previous, up -@subsection Numeric parameters -@cindex Numeric parameters -Numerical parameters are needed to give specific values to symbolic -parameters (@pxref{Symbolic parameters}) for the purposes of numeric -analysis; -for example: simulation, graph plotting or use within a numerical -package such as Octave (@pxref{Octave}). - - -@node Algebraic loops, Switched systems, Components, Introduction -@section Algebraic loops -@cindex Algebraic loops -Following Chapter 3 of the book, algebraic loops appear as under-causal -components in the bond graph. It is up to the modeler to indicate how these loops -are to be resolved by adding appropriate SS elements. - -In particular if zero junction is undercausal an SS:loop component (with -effort output indicated by a causal stroke) with the following label -file entry: -@example - loop SS unknown,zero -@end example - -For more information, refer to: -``Metamodelling: Bond Graphs and Dynamic Systems'' by Peter Gawthrop and -Lorcan Smith published by Prentice Hall in 1996 (ISBN 0-13-489824-9). - -@node Switched systems, , Algebraic loops, Introduction -@comment node-name, next, previous, up -@section Switched systems -@cindex Switched systems -@cindex Hybrid systems -@cindex logic - -Some systems contain switch-like components. For example an electrical -system may contain on-off switches and diodes and a hydraulic system may -shut-off valves and non-return valves. - -Such systems are sometimes called hybrid systems. The modelling an -simulation of such systems is the subject of current research. -@strong{MTT} implements a simple pragmatic approach to the modelling and -simulation of such systems via two new Bond Graph components: -@vtable @code -@item ISW - a switched @code{I} component -@item CSW - a switched @code{C} component -@end vtable - -These switches are user controlled through the logic representation -(@pxref{Simulation logic}). - -@node User interface, Creating Models, Introduction, Top -@comment node-name, next, previous, up -@chapter User interface -@cindex User interface -@pindex User interface -There are two user interfaces to @strong{MTT}: a command line interface -(@pxref{Command line interface}) and a menu-driven interface -(@pxref{Menu-driven interface}). - -@menu -* Menu-driven interface:: -* Command line interface:: -* Options:: -* Utilities:: -@end menu - -@node Menu-driven interface, Command line interface, User interface, User interface -@comment node-name, next, previous, up -@section Menu-driven interface -@cindex Menu-driven interface -@pindex Menu-driven interface -The Menu-driven interface for @strong{MTT} is invoked as: -@example -xmtt -@end example -This will bring up a menu which should be self explanatory :-). -Various messages will be echoed in the window from whence @strong{xMTT} -was invoked. - -@node Command line interface, Options, Menu-driven interface, User interface -@comment node-name, next, previous, up -@section Command line interface -@cindex Command line interface -@pindex Command line interface -The command line interface for @strong{MTT} is of the form: -@example -mtt [options] -@end example -@vtable @code -@item [options] - the (optional) option switches (@pxref{Options}) -@item - the name of the system being transformed -@item - the mnemonic for the system representation (@pxref{Representation summary}) -@item - the mnemonic for language for the representation (@pxref{Languages}) -@end vtable -for example -@example -mtt rc rep view -@end example -creates a view of the report describing system rc and -@example -mtt rc sm m -@end example -creates an m file (suitlable for Octave or Matlab) containing state -matrices describing the system rc. -@node Options, Utilities, Command line interface, User interface -@comment node-name, next, previous, up -@section Options -@cindex options -@cindex alias options - -@strong{MTT} has a number of optional switches to control its -operation. These are invoked immediately after `mtt' on the command -line; for example: -@example -mtt -o -ss -cc syst cbg view -@end example -invokes the @code{-o}, @code{-ss}, and @code{-cc} options. - -If you wish to use an option all the time, use the -alias function appropriate to the shell you are using. For example, -using bash: -@example -alias mtt='mtt -o -ss -cc' -@end example -Means that the previous example can be executed using -@example -mtt syst cbg view -@end example - -@menu -* Available options:: -* Model-specific options:: -@end menu - -@node Available options, Model-specific options, Options, Options -@comment node-name, next, previous, upThe available options are: -@subsection Available options -@vtable @code -@item -A - solve algebraic equations symbolically -@item -abg - start at abg.m representation -@item -ae - algebraic equation solver: reduce|hybrd|dassl|hooke -@item -cc - C++ code generation -@item -cr - use cr before resolving equations -@item -D - debug -- leave log files etc -@item -d - use directory -@item -dc - maximise derivative (not integral) causality -@item -dr - use files contained in -@item -I - prints more information -@item -i - integration method: implicit|euler|rk4|dassl -@item -o - ode is same as dae -@item -oct - use oct files in place of m files where appropriate -@item -opt - optimise code generation (equivalent to -optl) -@item -optl - locally optimise code generation (line-by-line) -@item -ntmpvar - declare temporary variables (default=$num_tmp_var) -@item -p - print environment variables -@item -partition - partition hierachical system -@item -pdf - generate pdf in place of ps -@item -q - quiet mode -- suppress MTT banner -@item -r - reset time stamp on representation -@item -s - generate sensitivity BG (use mtt -s sSys rep lang) -@item -ss - use steady-state info to initialise simulations -@item -stdin - read input data from standard input for simulations -@item -sub - operate on subsystem -@item -t - tidy mode (default) -@item -trace - just indicate what mtt will do - but do not do it -@item -u - untidy mode (leaves files in current dir) -@item -v - verbose mode (multiple uses increment the verbosity) -@item --version - print version and exit -@item --versions - print version of mtt and components and exit -@item -viewlevel - view levels of hierachy -@end vtable - -@menu -* Experimental options:: -* Deprecated options:: -@end menu - -@node Experimental options, Deprecated options, Available options, Available options -@comment node-name, next, previous, up -@subsubsection Experimental options -There are some experimental options. These have not yet been heavily tested and should be used with caution. -@vtable @code -@item -optg - globally optimise code generation (full vector) -@item -make-sort - use sorted equations (sese, generated by make) -@item -no-reduce - try not to use symbolic algebra -@item -sort - use sorted equations (sese, generated by seqn) -@end vtable - -@node Deprecated options, , Experimental options, Available options -@comment node-name, next, previous, up -@subsubsection Deprecated options -C code generation is now deprecated in favour of C++ generation -@vtable @code -@item -c - c-code generation -@end vtable - -@node Model-specific options, , Available options, Options -@subsection Model specific options -@cindex Model-specific options -It is often desirable to keep the options used to build a model associated with the directory in which the model is contained, along with information about compiler options or paths to component libraries. In these cases, it is convenient to create an executable shell script, say @code{call_mtt} which sets environment variables and options before calling mtt proper, for example: -@example -@verbatim -#! /bin/sh -# call_mtt: sets model specific environment and options - -## Processor flags - -# use 32 bit Reduce -export SYMBOLIC="reduce" - -# set compiler debug and optimization options -export MTT_CXXFLAGS="${MTT_CXXFLAGS}\ - -Wall-Wno-unused -Wuninitialized\ - -O1 -march=pentiumpro -save-temps" - -## Model flags - -# use directory ../.. as base directory -export DIR=${DIR:-${PWD}/../..} - -# additional components are in directory ../comp -export MTT_COMPONENTS="${MTT_COMPONENTS}:${DIR}/comp" - -# additional constitutive relationships are in ../cr -export MTT_CRS="${MTT_CRS}:${DIR}/cr" - -# C header files in ../cr/h -export MTT_CXXINCS="${MTT_CXXINCS} -I${DIR}/cr/h" - -# call mtt with model specific options -exec ${MTTPATH}/mtt -cc -cr -i euler -D -optl -ntmpvar 1200 $* -@end verbatim -@end example - -which may then be used in place of mtt on the command line, - -@example -./call_mtt sys odeso gnuplot -@end example - -@node Utilities, , Options, User interface -@comment node-name, next, previous, up -@section Utilities -@cindex Utilities -@pindex Utilities -@strong{MTT} provides some utilities to help you keep track of model -building and to keep things clean and tidy. The commands, and there -purpose are: -@ftable @code -@item mtt help - Lists the help/browser commands -@item mtt copy - Copies the system (ie directory and enclosed files) to the -current working directory. -@item mtt rename - Renames all of the defining representations (@pxref{Defining -representations}) and textually changes each file appropriately. -@item mtt clean - Remove all files generated by @strong{MTT} associated with -system `system'. -@item mtt clean - Remove all files generated by @strong{MTT} associated with -all systems within the current directory. -@item mtt system representation vc - Apply version control to representation `representation' of -system `system'. -@item mtt system vc - Apply version control to all representations (under version control) -system `system'. -@end ftable -These are described in more detail in the following sections. - -@menu -* Help:: -* Copy:: -* Clean:: -* Version control:: -@end menu - -@node Help, Copy, Utilities, Utilities -@comment node-name, next, previous, up -@subsection Help -@cindex Help -@cindex browser -@strong{MTT} implements a browser to keep track of all the systems, -subsystems and constitutive relationships that you, and others may -write. It is invoked in the following ways: -@example - mtt help representations - mtt help components - mtt help examples - mtt help crs - mtt help representations - mtt help components - mtt help examples - mtt help crs - mtt help -@end example - -@menu -* help representations:: -* help components:: -* help examples:: -* help crs:: -* help :: -@end menu - -@node help representations, help components, Help, Help -@comment node-name, next, previous, up -@subsubsection help representations -@cindex help -@cindex representations - -The command -@example -mtt help representations -@end example -lists all of the representations (@pxref{Representations}) available in -@strong{MTT}. These may change as the version number of @strong{MTT} -increases. - -The command -@example -mtt help representations -@end example -lists those representation which contain the string @code{match_string}. -This string can be any regular expression (see standard Linux -documentation under @code{awk}). -For example -@example -mtt help representations descriptor -@end example -gives all representations containing the word @code{descriptor}. - -@node help components, help examples, help representations, Help -@comment node-name, next, previous, up -@subsubsection help components -@cindex help -@cindex components - -The command -@example -mtt help components -@end example -lists all of the components (@pxref{Components}) available in -@strong{MTT}. These may change as the version number of @strong{MTT} -increases. - -The command -@example -mtt help components -@end example -lists those component which contain the string @code{match_string}. -This string can be any regular expression (see standard Linux -documentation under @code{awk}). -For example -@example -mtt help components source -@end example -gives all components containing the word @code{component}. - -@node help examples, help crs, help components, Help -@comment node-name, next, previous, up -@subsubsection help examples -@cindex help -@cindex examples - -This command provides a good way to get started in @strong{MTT}. having -found an interesting example, copy it to your working directory using -@example -mtt copy -@end example -(@pxref{Copy}) - -@example -mtt help examples -@end example -lists all of the examples available in -@strong{MTT}. -This list will change as more examples are added. - -The command -@example -mtt help examples -@end example -lists those component which contain the string @code{match_string}. -This string can be any regular expression (see standard Linux -documentation under @code{awk}). -For example -@example -mtt help examples pharmokinetic -@end example -gives all examples containing the word @code{pharmokinetic}. - -@node help crs, help , help examples, Help -@comment node-name, next, previous, up -@subsubsection help crs -@cindex help -@cindex crs - -The command -@example -mtt help crs -@end example -lists all of the constitutive relationships (@pxref{Constitutive -relationship}) available in -@strong{MTT}. These may change as the version number of @strong{MTT} -increases. - -The command -@example -mtt help crs -@end example -lists those constitutive relationships which contain the string @code{match_string}. -This string can be any regular expression (see standard Linux -documentation under @code{awk}). -For example -@example -mtt help crs sin -@end example -gives all crs containing the word @code{sin}. - -@node help , , help crs, Help -@comment node-name, next, previous, up -@subsubsection help -@cindex help -@cindex - -The command -@example -mtt help -@end example -gives a detailed description of the entity called @code{name}. - -@node Copy, Clean, Help, Utilities -@comment node-name, next, previous, up -@subsection Copy -@cindex Copy - -@strong{MTT} provides a way of copying examples to your working directory: -@example -mtt copy -@end example - -Use the command -@example -mtt help examples -@end example -(@pxref{help examples}) to find something of interest. - -Note that components and constitutive relationships are automatically -copied when required. - -@node Clean, Version control, Copy, Utilities -@comment node-name, next, previous, up -@subsection Clean -@cindex Clean -@strong{MTT} generates a lot of representations in a number of -languages. -Some of these you will edit yourself; others can always be recreated by -@strong{MTT}. It makes sense, therefore to have a utility that removes -all of these other files when you have finished actively working with a -particular system. These are two versions: -@enumerate -@item -@code{mtt system clean} -@item -@code{mtt clean} -@end enumerate -The first removes all files that can be regenerated with @strong{MTT} -associated with system `system'; the second removes all such files -associated with all systems in the current working directory. - -The files which remain after such a clean are the Defining -representations (@pxref{Defining representations}). - -@node Version control, , Clean, Utilities -@comment node-name, next, previous, up -@subsection Version control -@cindex Version control - -When you are working on a modeling project, it is easy to forget what -changes you made to a system and why you made them. Sometimes, you may -regret some changes and wish to revert to an earlier version: even if -you use .old files this may be difficult to achieve safely. - -These are very similar problems to those faced by software developers -and can be solved in the same way: using version control.@strong{MTT} -provides version control using the standard GNU Revision Control System -(RCS). This is hidden from the user, but is fully complementary to -direct use of RCS (e.g. via emacs vc commands) to the more experienced -user who wishes to do so. - -The only files that you should ever change (i.e. the ones never -overwritten by @strong{MTT}) are the Defining representations -(@pxref{Defining representations}). - -All of the files, with the exception of @code{system_abg.fig}, -are initially created by @strong{MTT} and contain the RCS header for -version control. - - -The @strong{MTT} version control will automatically expand this part of -the text to include all change comments that you give it -- so will -direct use of RCS (e.g. via emacs vc commands) - -The @strong{MTT} version commands are as follows: -@ftable @code -@item mtt system representation vc - Apply version control to representation `representation' of -system `system'. -@item mtt system vc - Apply version control to all representations (under version control) -system `system'. -@end ftable - -The first is appropriate after you have made a revision to a single -file. It will prompt you for a change comment; this will be -automatically included in the file header. In addition, enough -information will be saved to enable any version to be retrieved via -RCS. - -The second is appropriate to record the state of the entire model. This -assumes that all relevant files have been recorded by the first version -of the command. Once again, old versions of the entire model can be -retrieved using the relevant RCS commands. - -A subdirectory `RCS' is created to hold this information. You need not -bother about the contents, except that you must not delete any files -within `RCS'. - -@node Creating Models, Simulation, User interface, Top -@comment node-name, next, previous, up -@chapter Creating Models -@cindex Creating Models - -@strong{MTT} helps you to analyse and transform system models -- -ultimately the process of capturing the real world in a model is up to -you. This chapter discusses the @strong{MTT} aspects of creating a -model. For convenience, this is divided into creating simple models and -creating complex models. - -@menu -* Quick start:: -* Creating simple models:: -* Creating complex models:: -@end menu - -@node Quick start, Creating simple models, Creating Models, Creating Models -@section Quick start -@cindex Quick start -@pindex Quick start - -It is probably worth a quick skim though @strong{MTT} to get a flavour of -what it can do before plunging into the detail of the rest of this -document. Here is a series of commands to do this. - -Copy an initial set of files describing the bond graph. -@example -mtt copy rc -@end example -@noindent -Move to it. -@example -cd rc -@end example -@noindent -@noindent -View the acausal bond graph (the system is called ``rc''). -@example -mtt rc abg view -@end example -@noindent -View the causal bond graph of the system. -@example -mtt rc cbg view -@end example -@noindent -View the corresponding ordinary differential equations (ode). -@example -mtt rc ode view -@end example -@noindent -View the system (output) step response -@example -mtt rc sro view -@end example - -@noindent -An alternative (but more general) way of achieving the same result is -@example -mtt -cc rc odeso view -@end example - -@noindent -View the system transfer function -@example -mtt rc tf view -@end example -@noindent -View the log modulus frequency response of the system. -@example -mtt rc lmfr view -@end example - -@noindent -View the log modulus frequency response of the system for 100 -logarithmically spaced frequencies in the range 0.1 to 10 -radians per second. -@example -mtt rc lmfr view 'W=logspace(-1,1,100);' -@end example - -@strong{MTT} has a report generation ((@pxref{Report}) facility which -can generate a hypertext description of the system. -@example -mtt rc rep hview -@end example - -The report contents are specified by the rep representation -(@pxref{Report}), in this case the corresponding file is: -@example -% %% Outline report file for system rc (rc_rep.txt) - -mtt rc abg tex -mtt rc struc tex -mtt rc cbg ps -mtt rc ode tex -mtt rc ode dvi -mtt rc sm tex -mtt rc tf tex -mtt rc tf dvi -mtt rc sro ps -mtt rc lmfr ps -mtt rc odes h -mtt rc numpar txt -mtt rc input txt -mtt -cc rc odeso ps -mtt rc rep txt -@end example -A non-hypertext version can be viewed using: -@example -mtt rc rep view -@end example - -Now have a go at modifying the bond graph. -@example -mtt rc abg fig -@end example -This brings up the bond graph in Xfig (@pxref{Xfig}). Try creating a -system with two rs and 2 cs. - -More examples can be found using -@example -mtt help examples -@end example -Details of an example can be found using -@example -mtt help -@end example -and copied using -@example -mtt copy -@end example - -Lots of examples are available. -@example -mtt help examples -@end example -lists them and -@example -mtt copy -@end example -gets you an example. - -@ifhtml -A number of examples are to be found - here. -@end ifhtml - -@node Creating simple models, Creating complex models, Quick start, Creating Models -@comment node-name, next, previous, up -@section Creating simple models -@cindex Creating simple models - -For then purposes of this section, simple models are those which are -built up from bond graphs involving predefined components. In contrast, -more complex systems (@pxref{Creating complex models}) need to be built -up hierarchically. - -The recommended sequence of steps to create a simple model is: -@enumerate -@item Decide on a name for the system; let us call it `syst' for the - purposes of this discussion. -@item Invoke the Bond Graph editor to draw the acausal Bond Graph. -@example - mtt syst abg fig -@end example -@item Draw the Bond Graph (@pxref{Language fig (abg.fig)}), including - the bonds (@pxref{Bonds}), the components (@pxref{Components}) and any - artwork (@pxref{artwork}) to make the Bond Graph more readable. The - graphical editor xfig is (@pxref{Xfig}) is self-explanatory. - The icon library is helpful here (see @pxref{icon library}). -@item Add causal strokes (@pxref{strokes}) where needed to define - causality. As a general rule, use the minimum number of strokes needed - to define the problem; this will often be only on the @code{SS} components. - (@pxref{SS components}). - - Save the bond graph. - -@item View the corresponding causal bond graph. -@example - mtt syst cbg view -@end example -@enumerate -@item - At this stage, @strong{MTT} will warn you that the labeled components do - not appear in the label file - this can safely be ignored. -@item - @strong{MTT} will indicate the percentage of components which are - causally complete -- ideally this will be 100%. Components which are - not causally complete will be listed. -@item - A view of the causal bond graph will be created. The added causal - strokes are indicated in blue, undercausal components in green and - overcausal components in red. -@item - If the bond graph is causally complete, proceed to the next step, - otherwise think hard and return to the first step. -@end enumerate - -@item -At this stage, no constitutive relationships have been -defined. Nevertheless, @strong{MTT} will proceed in a semi-qualitative -fashion by assuming that all constitutive relationships are unity (and -therefore linear). It may be useful at this stage to view various -derived representations to check the overall model properties before -proceeding further. For example: -@enumerate -@item -View the system Differential-algebraic equations -@example -mtt syst dae view -@end example -@item -View the system state matrices -@example -mtt syst sm view -@end example -@item -View the system transfer function -@example -mtt syst tf view -@end example -@item -View the system step response -@example -mtt syst sro view -@end example -@end enumerate - -@item -As well as creating the causal bond graph, @strong{MTT} has also -generated templates for other text files -(@pxref{Defining representations}) -used to further specify the -system. -These can now be edited using your favorite text editor (@pxref{Text -editors}). - -@item @strong{MTT} will now generate the representations -(@pxref{Representation summary})that you desire. -For example the system can be simulated by -@example -mtt syst odeso view -@end example -@strong{MTT} will complain if a component is named in the bond graph but -not in the label file and vice versa. This mainly to catch typing errors. - -@end enumerate - -@node Creating complex models, , Creating simple models, Creating Models -@comment node-name, next, previous, up -@section Creating complex models -@cindex Creating complex models - -Complex models -- in distinction to simple models (@pxref{Creating -simple models}) -- have a hierarchical structure. In particular, bond -graph components can be created by specifying their bond -graph. Typically, such components will have more than one port -(@pxref{Ports}); within each component, ports are represented by -named SS components (@pxref{Named SS components}); outwith -each component, ports are unambiguously identified by -labels (@pxref{Port labels}) and vector labels (@pxref{Vector port labels}). - -Complex models are thus created by conceptually decomposing the system -into simple subsystems, and then creating the corresponding bond graphs. -The procedure for simple systems (@pxref{Creating simple models}) is -then followed using the top level system (@pxref{Top level}); @strong{MTT} then recursively -operates on the lower level systems. - -The report representation (@pxref{Report}) provides a convenient way of -viewing a complex system. - -An example of such a system can be created as follows: -@example -mtt copy twolink -mtt twolink rep hview -@end example - -@ifhtml -The result is here. -@end ifhtml - -@menu -* Top level:: -@end menu - -@node Top level, , Creating complex models, Creating complex models -@comment node-name, next, previous, up -@subsection Top level -@cindex Top level -The top level of a complex model contains subsystems but is not, itself, -contained by other systems. -It has the following special features: -@itemize @bullet -@item -its name is used in the mtt command as the system name. -@item -all named SS componenents (@pxref{Named SS components}) are treated as -ordinary SS components (@pxref{SS components}). -@end itemize - - - -@c node next prev up -@node Simulation, Sensitivity models, Creating Models, Top -@chapter Simulation -@cindex Simulation -@pindex Simulation -One purpose of modelling is to simulate the modeled dynamic -system. Although this is just another transformation (@pxref{What is a -Transformation?}) and therefore is covered in the appropriate chapter -(@pxref{Representations}), it is important enough to be given its own -chapter. - -Simulation is typically performed using an appropriate simulation -language (which is often inappropriately conflated with modelling -tools). @strong{MTT} provides a number of alternative routes to -simulation based on the following representations (@pxref{Representations}): -@ftable @code -@item cse - constrained-state differential equation form -@item ode - ordinary differential (or state-space) equations -@c @item dae -@c differential-algebraic (or generalised state-space) equations -- -@c these may be linear or nonlinear. -@end ftable -in each case these equations may be -linear or nonlinear. - -Special cases of numerical simulation, appropriate to @emph{linear} -systems, are: -@ftable @code -@item ir - impulse response - state -@item iro - impulse response - output -@item sr - impulse response - state -@item sro - impulse response - output -@end ftable - -There are a number of languages (@pxref{Languages}) which can be used to describe these -representations for the purposes of numerical simulation: -@ftable @code -@item m - @code{octave} a high-level interactive language for numerical - computation. -@item c - @code{gcc} a c compiler. -@item cc - @code{g++} a C++ front-end to gcc. -@end ftable - -There are a number solution algorithms available: -@itemize @bullet -@item -explicit solution via the matrix exponential -@item -backward Euler integration (implicit) -@item -forward Euler integration (explicit) -@item -Runge Kutta IV integration (explicit, fixed step) -@item -Hybrd algebraic solver (MINPACK, Octave fsolve) -@c @item -@c LSODE (Hindmarsh's ODE solver as implemented in Octave) -@c @item -@c DASSL (Petzold's DAE solver as implemented in Octave) (Unavailable just now) -@end itemize - - However, all combinations of representation, language and solution -method are not supported by @strong{MTT} at the moment. Given a system -`system', some recommended commands are: -@ftable @code -@item mtt system iro view - creates the impulse response of a @emph{linear} system via the -system_sm.m representation using explicit solution via the matrix exponential. -@item mtt system sro view - creates the step response of a @emph{linear} system via the system_sm.m -representation using explicit solution via the matrix exponential. -@c @item mtt system odeso view -@c creates the step response of a @emph{nonlinear} system via the -@c system_ode.m representation using either METHOD=Euler or -@c METHOD=LSODE in the parameter file (@pxref{Simulation parameters}). -@item mtt -cc system odeso view - creates the response of a @emph{nonlinear} system via the -system_ode.cc representation using implicit integration. -@item mtt -cc -i euler system odeso view - creates the response of a @emph{nonlinear} system via the -system_ode.cc representation using euler integration. -@end ftable - -Simulation parameters are described in the system_simpar.txt file -(@pxref{Simulation parameters}). - -The steady-state solution of a system can also be -``simulated''(@pxref{Steady-state solutions}). -@menu -* Steady-state solutions:: -* Simulation parameters:: -* Simulation input:: -* Simulation logic:: -* Simulation initial state:: -* Simulation code:: -* Simulation output:: -@end menu - -@node Steady-state solutions, Simulation parameters, Simulation, Simulation -@comment node-name, next, previous, up -@section Steady-state solutions -@cindex Steady-state solutions - -@menu -* Steady-state solutions - numerical(odess):: -* Steady-state solutions - symbolic (ss):: -@end menu - -@node Steady-state solutions - numerical(odess), Steady-state solutions - symbolic (ss), Steady-state solutions, Steady-state solutions -@comment node-name, next, previous, up -@subsection Steady-state solutions (odess) -@cindex Steady-state solutions - numerical - -@strong{MTT} can compute the steady-state solutions of an ordinary -differential equation; this used the octave function `fsolve'. The -solution is computed as a function of time using the input specified in -the input file. The simulation parameter file (@pxref{Simulation -parameters}) is used to provide the time scales. - -For example -@example -mtt copy rc -cd rc -mtt rc odess view -@end example - -@node Steady-state solutions - symbolic (ss), , Steady-state solutions - numerical(odess), Steady-state solutions -@comment node-name, next, previous, up -@subsection Steady-state solutions (ss) -@cindex Steady-state solutions - symbolic -A rudimentary form of steady-state solution exists in mtt. -The steady states and inouts are supplied by the user in the file -system_simpar.r and the corresponding output and sate derivative -computed by @strong{MTT} using -@example -mtt system ss view -@end example - -For example -@example -mtt copy rc -cd rc -mtt rc sspar view -mtt rc ss view -@end example - - -@node Simulation parameters, Simulation input, Steady-state solutions, Simulation -@comment node-name, next, previous, up -@section Simulation parameters -@cindex Simulation parameters - -Simulation parameters are set in the system_simpar.txt file. At the -moment this sets the following variables: -@itemize @bullet -@item LAST - the last simulation time -@item DT - the incremental time (for plotting) -@item STEPFACTOR - the number of integration steps per DT -- thus the integration - interval is DT/STEPFACTOR -@c ; for sparse implicit integration (@pxref{Sparse -@c implicit integration}) the number of conjugate-gradient minimisation -@c steps. -@c @item METHOD -@c The integration methods available appear in the following table -@item WMIN - Minimum frequency = 10^WMIN -@item WMAX - Maximum frequency = 10^WMAX -@item WSTEPS - Number of Frequency steps. -@item INPUT - The input index for frequency response -@end itemize - -There are a number of solution algorithms -@itemize @bullet -@item Euler - basic Euler integration (@pxref{Euler integration}). This method -is simple, but not recommended for stiff systems. -@item Implicit - semi-implicit integration (@pxref{Implicit integration}) - uses the smx representation to give - stability. -@item Runge Kutta IV - fixed step Runge Kutta fourth order integration (@pxref{Runge Kutta IV integration}). -@item Hybrd - numerical algebraic equation solver - - -@c @item ImplicitS -@c Sparse semi-implicit integration (@pxref{Sparse implicit integration}) -@c -- takes advantage of the sparsity of the A matrix. -@c @item LSODE -@c the variable step-size method that comes with Octave (@pxref{Octave}). -@end itemize - -@menu -* Euler integration:: -* Implicit integration:: -* Runge Kutta IV integration:: -* Hybrd algebraic solver:: -@end menu - -@node Euler integration, Implicit integration, Simulation parameters, Simulation parameters -@comment node-name, next, previous, up -@subsection Euler integration -@cindex Euler integration -Euler integration approximates the solution of the Ordinary Differential Equation -@example -dx/dt = f(x,u) -@end example -by -@example -x := x + f(x,u)*DDT -@end example -where -@example -DDT = DT/STEPFACTOR -@end example -If the system is linear, stability is ensured if the integer STEPFACTOR -is chosen to be greater than the real number -@example -(maximum eigenvalue of -A)*DT/2 -@end example -where A is the nxn matrix appearing in -@example -f(x,u) = Ax + Bu -@end example -If the system is non linear, the linearised system matrix A should act -as a guide to the choice of STEPFACTOR. - -@node Implicit integration, Runge Kutta IV integration, Euler integration, Simulation parameters -@comment node-name, next, previous, up -@subsection Implicit integration -@cindex Implicit integration -Implicit integration approximates the solution of the Ordinary Differential Equation -@example -dx/dt = f(x,u) -@end example -by -@example -(I-A*DT)x := (I-A*DT)x + f(x,u)DT -@end example -where A is the linearised system matrix. This implies the solution of N -(=number of states) linear equations at each sample interval. The OCTAVE -version used the `\' operator to solve the set of linear equations, the -C version uses LU decomposition. - -If the system is linear, stability is ensured unconditionaly. If the -system is non-linear, then the method still works well. - -This method is nice in that choice of DT trades of accuracy against -computation time without compromising stability. In addition, the -correct stready-state values are achieved. - -This approach can also be used for constrained state equations of the -form: -@example -E(x) dx/dt = f(x,u) -@end example -where E(x) is a state-dependent matrix. The approximate solution is then -given by: -@example -(E(x)-A*DT)x := (E(x)-A*DT)x + f(x,u)DT -@end example -which reduces to the ordinary differential equation case when E(x)=I. - -The _smx representation includes the E matrix. - -@node Runge Kutta IV integration, Hybrd algebraic solver, Implicit integration, Simulation parameters -@comment node-name, next, previous, up -@subsection Runge Kutta IV integration -Runge Kutta IV approximates the solution of the Ordinary Differential Equation - -@example -dx/dt = f(x,t) -@end example - -by - -@example -x := x + (DT/6)*(k1 + 2*k2 + 2*k3 + k4) -@end example - -where - -@example -k1 := f(x,t) -k2 := f(x+(1/2)*k1,t+(1/2)*DT) -k3 := f(x+(1/2)*k2,t+(1/2)*DT) -k4 := f(x+k3,t+DT) -@end example - -The @strong{MTT} implementation of Runge-Kutta integration -is a fourth order, fixed-step, explicit integration method. - -For some systems of equations, the increased accuracy of using a fourth order -method can allow larger step-lengths to be used than would allowed by the - lower order Euler integration method. - -It should be noted that during the interemediate calculations (k1...k4), - the input vector @code{u} is not advanced w.r.t. time; the system inputs are -assumed to be constant over the period of the integration step-length. - -@node Hybrd algebraic solver, , Runge Kutta IV integration, Simulation parameters -@comment node-name, next, previous, up -@subsection Hybrd algebraic solver - -The hybrd algebraic solver of @uref{http://www.netlib.org/minpack/hybrd.f,MINPACK}, -which is used by Octave in the @code{fsolve} routine, may be used in conjunction -with one of the other integration methods to solve semi-explicit, index 1, differential -algebraic equations; these may be generated in @strong{MTT} models by use of -@code{unknown} SS Components @pxref{SS component labels}. - -This method requires that compiled simulation code is used; either -cc or -oct. -To perform a simulation based on a model @code{sys}, - -@example -mtt -cc -ae hybrd -i euler sys odeso view -@c XXX: should be daeso view? -@end example - -@strong{MTT} will attempt to minimise the residual error at each integration time-step -using the hybrd routine. - -This method of simulation is particularly well suited to stiff systems where very fast -dynamics are of little interest. Care must be taken to ensure that an acceptable level -of convergence is achieved by the solver for the system under investigation. -@c XXX: tolerance option - -@c @node Sparse implicit integration, , Implicit integration, Simulation parameters -@c @comment node-name, next, previous, up -@c @subsection Sparse implicit integration -@c @cindex Sparse implicit integration -@c This is an experimental approach for large (N>50) systems. - -@c Implicit integration (@pxref{Implicit integration}) requires the -@c solution of N linear equations at each step. This is an O(N^3) operation -@c which can be time consuming for large (N>50) systems. However, the A -@c matrix (and hence the (I-A*DT) matrix) is often sparse - most elements -@c are zero. - -@c This method uses a conjugate-gradient optimisation method to solve the -@c linear equations -@c @example -@c (I-A*DT)x := (I-A*DT)x + f(x,u)DT -@c @end example -@c by recasting them as the minimisation of the quadratic function -@c @example -@c [(I-A*DT)x_new - (I-A*DT)x_old + f(x,u)DT]^2 -@c @end example -@c with respect to x_new. This is solved by the conjugate gradient method. -@c MTT generates two representations _smxx.m and _smxtx to compute -@c (I-A*DT)x and (I-A*DT)'x respectively making full use of the sparsity of -@c the (I-A*DT) matrices to speed up the minimisation procedure. - -@c A fixed number of iterations (STEPFACTOR) are used in each optimisation -@c to give a fixed simulation time. This must be chosen by the user, but -@c between 5N and 10N seems ok. Note that the initial value of the -@c optimisation is x_old. - -@node Simulation input, Simulation logic, Simulation parameters, Simulation -@comment node-name, next, previous, up -@section Simulation input -@cindex Simulation input -This is defined in the system_input.txt file. A default file is created -automatically by @strong{MTT}. This is done explicitly by -@example -mtt system input txt -@end example -If the file already exists, the same command checks that all inputs are -defined and that all defined inputs exist in the system and promts the -user to correct discrepancies. - -Inputs are defined by the full system name appearing in the structure -file (@pxref{Structure (struc)}). They can depend on states (again defined by -name), time (defined by t) and parameters - -For example: -@example -system_pump_l_1_u = 4e5*atm; -system_pump_r_1_u = 4e5*(t<10)*atm; -system_ss_i = 0*kg; -system_ss_o = 3e-3*kg; -system_v_1_u = (t>10); -system_v_ll_1_u = 1; -system_v_lr_1_u = (t<10); -system_v_ul_1_u = 0; -system_v_ur_1_u = (t>10); -@end example - -@node Simulation logic, Simulation initial state, Simulation input, Simulation -@comment node-name, next, previous, up -@section Simulation logic -@cindex Simulation logic -This is defined in the system_logic.txt file. A default file is created -automatically by @strong{MTT}. This is done explicitly by -@example -mtt system logic txt -@end example -If the file already exists, the same command checks that the logic -corresponding to all switch states (@pxref{Switched systems}) are -defined and that all defined logic exists in the system and promts the -user to correct discrepancies. - -Logical inputs are defined by the full system name corresponding to -MTT_switch components appearing in the structure file (@pxref{Structure -(struc)}) @emph{with `_logic' appended}. They can depend on states (again defined by name), time -(defined by t) and parameters - -For example: -@example -bounce_ground_1_mtt_switch_logic = bounce_intf_1_mtt3<0; -@end example - -@node Simulation initial state, Simulation code, Simulation logic, Simulation -@comment node-name, next, previous, up -@section Simulation initial state -@cindex Simulation initial state -This is defined in the system_state.txt file. A default file is created -automatically by @strong{MTT}. This is done explicitly by -@example -mtt system state txt -@end example -If the file already exists, the same command checks that all states are -defined and that all defined states exist in the system and prompts the -user to correct discrepancies. - -States are defined by the full system name appearing in the structure -file (@pxref{Structure (struc)}). They can depend on parameters. -For example -@example -system_c_l = (1e4/k_l)/kg; -system_c_ll = (1e4/k_s)/kg; -system_c_lr = (1e4/k_s)/kg; -system_c_u = (1e4/k_l)/kg; -@end example - - -@c The initial state of a simulation of is set in the @code{state} -@c representation with the language @code{txt}. - -@c As usual, @strong{MTT} defaults this for you. There are two -@c possibilities -@c @itemize @bullet -@c @item -@c The -ss switch is not present: the states default to zero -@c @item -@c The -ss switch is present: the states default to those set in the -@c sspar.r file. -@c @end itemize - -@node Simulation code, Simulation output, Simulation initial state, Simulation -@comment node-name, next, previous, up -@section Simulation code -simulation code can be generated by @strong{MTT} in the form -of the @code{ode2odes} transformation. This can be produced in a number -of languages, including .m, .oct, C and C++ @pxref{Languages}. - -To generate simulation code in C (deprecated): -@example -mtt -c [options] sys ode2odes c -@end example - -Similarly, to generate C++ code: -@example -mtt -cc [options] sys ode2odes cc -@end example - -To generate an executable based on the C++ representation: -@example -mtt -cc [options] sys ode2odes exe -@end example - -@menu -* Dynamically linked functions:: -@end menu - -@node Dynamically linked functions, , Simulation code, Simulation code -@comment node-name, next, previous, up -@subsection Dynamically linked functions -@cindex Compiling C++ files -@cindex mex files -@cindex oct files -Some model representations can be compiled into dynamically loaded -code (shared objects) which are compiled prior to use in other -modelling and simulation environments; in particular, .oct files can -be generated for use in GNU Octave (@pxref{Creating GNU Octave .oct -files}) and .mex files can be generated for use in Matlab -(@pxref{Creating Matlab .mex files}) or Simulink (@pxref{Embedding MTT -models in Simulink}). The use of compiled (and possibly -compiler-optimised) code can offer significant processing speed -advantages over equivalent interpreted functions (e.g. .m files) for -computationally intensive procedures. - -The C++ code generated by @strong{MTT} allows the same code to be -generated as standalone code, Octave .oct files or Matlab .mexglx -files. Although @strong{MTT} usually takes care of the compilation -options, if it is necessary to compile the code on a machine on which -@strong{MTT} is not installed, the appropriate flag should be passed -to the compiler pre-processor: -@itemize @bullet -@item -@code{-DCODEGENTARGET=STANDALONE} -@item -@code{-DCODEGENTARGET=OCTAVEDLD} -@item -@code{-DCODEGENTARGET=MATLABMEX} -@end itemize - -@node Simulation output, , Simulation code, Simulation -@comment node-name, next, previous, up -@section Simulation output -@cindex Simulation output -The view (@pxref{Views}) representation provides a graphical -representation of the results of a simulation; the postscript language -provides the same thing in a form that can be included in a document. - -These are two simulation output representations -@ftable @code -@item odes - ordinary differential equation solution (states) -@item odeso - ordinary differential equation solution (output) -@end ftable - -Particular output variables can be selected by adding a fourth argument -in one of 2 forms -@ftable @code -@item 'name1;name2;..;namen' - plot the variables with names na1 .. namen against time -@item 'name1:name2' - plot the variable with name2 against that with name 1 -@end ftable - -An example of plotting a single variable against time is: -@example -mtt -o -cc -ss OttoCycle odeso ps 'OttoCycle_cycle_V' -@end example -An example of plotting one variable against another is: -@example -mtt -o -cc -ss OttoCycle odeso ps 'OttoCycle_cycle_V:OttoCycle_cycle_P' -@end example - -@menu -* Viewing results with gnuplot:: -* Exporting results to SciGraphica:: -@end menu - -@node Viewing results with gnuplot, Exporting results to SciGraphica, Simulation output, Simulation output -@comment node-name, next, previous, up@subsection -@subsection Viewing results with gnuplot -@cindex gnuplot - -Simulation plots may be conveniently selected, viewed with -@uref{http://www.gnuplot.org,gnuplot} -and saved to file (in PostScript format) using the command - -@example -mtt [options] rc odeso gnuplot -@end example - -This will cause a menu to be displayed, from which states and outputs may be selected for viewing. Clicking on a @emph{parameter name} will, by default, cause the time history of the selected parameter to be displayed. - -As with @strong{xMTT} (@pxref{Menu-driven interface}), the Wish Tcl/Tk interpreter must be installed to make use of this feature. - -@node Exporting results to SciGraphica, , Viewing results with gnuplot, Simulation output -@comment node-name, next, previous, up -@subsection Exporting results to SciGraphica -@cindex SciGraphica - -Simulation results can be converted into an XML-format -@uref{http://scigraphica.sourceforge.net,SciGraphica} (version 0.61) -@emph{.sg} file with the command - -@example -mtt [options] sys odes sg -@end example - -The SciGraphica file will contain two worksheets, X_sys and Y_sys, containing -the state and output time-histories from the simulation. - -@c node next prev up -@node Sensitivity models, Representations, Simulation, Top -@chapter Sensitivity models -@cindex Sensitivity models -@pindex Sensitivity models - -The sensitivity model of a system is a set of equations giving the -sensitivity of the system outputs with respect to system parameters. -@strong{MTT} has built in methods for assisting with the development of -such models. - -This feature is experimental at the moment, but the following example -gives an idea of what can be achieved. -@example -mtt copy rc -cd rc -mtt -s src ode view -mtt -s src odeso view -@end example -The sensitivity system src is automatically created from the system rc -using the predefined sR and sC components together with vector junctions -(@pxref{Vector components}). The four outputs are the two system -outputs plus the two sensitivity functions. - -An alternative route is to create the sensitivity functions by symbolic -differentiation. -The following sensitivity representations are available: -@ftable @code -@item scse - sensitivity constrained-state equations -@item sm - sensitivity state matrices -@item scsm - sensitivity constrained-state matrices -@end ftable - - - -@c node next prev up -@node Representations, Extending MTT, Sensitivity models, Top -@chapter Representations -@cindex Representations -@pindex Representations -@cindex Defining representations -@cindex Representations, defining - -As discussed in @ref{What is a Representation?}, a system has many -representations. The purpose of @strong{MTT} is to provide an easy way to -generate such representation by applying the appropriate sequence of -transformations. The representations supported by @strong{MTT} are -summarised in @ref{Representation summary}. - -There is a two-fold division of representations into those with which the user -defines the system and its various attributes, and those which are -derived from these. The @emph{defining representations} are listed in -@ref{Defining representations}. - -Each representation is implemented in one or more languages depending on -its use. These languages are discussed in @ref{Languages} and are -associated with appropriate tools for modifying or viewing the -representations. - -@menu -* Representation summary:: -* Defining representations:: -* Verbal description (desc):: -* Acausal bond graph (abg):: -* Acausal bond graph - LaTeX ready (labg):: -* Stripped acausal bond graph (sabg):: -* Labels (lbl):: -* Structure (struc):: -* Constitutive Relationship (cr):: -* Parameters:: -* Causal bond graph (cbg):: -* Elementary system equations:: -* Differential-Algebraic Equations:: -* Constrained-state Equations:: -* Ordinary Differential Equations:: -* Descriptor matrices:: -* Report:: -@end menu - -@node Representation summary, Defining representations, Representations, Representations -@comment node-name, next, previous, up -@section Representation summary -@cindex Representation summary - -Some of the the representations -available in @strong{MTT} are (in alphabetical order): -@ftable @code -@item abg - acausal bond graph -@item cbg - causal bond graph -@item cr - constitutive relationship for each subsystem -@item cse - constrained-state equations -@item csm - constrained-state matrices -@item dae - differential-algebraic equations -@item daes - dae solution - state -@item daeso - dae solution - output -@item def - definitions - system orders etc. -@item desc - Verbal description of system -@item dm - descriptor matrices -@item ese - elementary system equations -@item fr - frequency response -@item input - numerical input declaration -@item ir - impulse response - state -@item iro - impulse response - output -@item lbl - label file -@item lmfr - loglog modulus frequency response -@item lpfr - semilog phase frequency response -@item nifr - Nichols style frequency response -@item numpar - numerical parameter declaration -@item nyfr - Nyquist style frequency response -@item obs - observer equations for CGPC -@item ode - ordinary differential equations -@item odes - ode solution - state -@item odes - ODE simulation header file -@item odeso - ode solution - output -@item odess - ode numerical steady-states - states -@item odesso - ode numerical steady-states - outputs -@item rbg - raw bond graph -@item rep - report -@item rfe - robot-form equations -@item sabg - stripped acausal bond graph -@item simp - simplification information -@item sm - state matrices -@item smx - state matrices containing explicit states and inputs -@item sms - ode -@item smss - SM simulation header file -@item sr - step response - state -@item sro - step response - output -@item ss - steady-state equations -@item sspar - steady-state definition -@item struc - structure - list of inputs, outputs and states -@item sub - Executable subsystem list -@item sub - LaTeX subsystem list -@item sympar - symbolic parameters -@item tf - transfer function -@end ftable -A complete list can be found via the @code{help representations} command -(@pxref{help representations}). - -Many of these representations have more than one language (@pxref{Representations}) associated -with them. - -Some of these representations define the system (@pxref{Defining -representations}). - -@node Defining representations, Verbal description (desc), Representation summary, Representations -@comment node-name, next, previous, up -@section Defining representations -@cindex Defining representations - -The following representations define the system and therefore must, -ultimately, be defined by the user. However, all of these are assigned -default values by @strong{MTT} and may then be subsequently edited -(@pxref{Text editors}) viewed or operated on by the appropriate tools -(@pxref{Language tools}). -@vtable @code -@item system_abg.fig - the acausal bond graph (@pxref{Acausal bond graph (abg)}) -@item system_lbl.txt - the label file (@pxref{Labels (lbl)}) -@item system_desc.tex - the description file (@pxref{Detailed}) -@item system_simp.r - algebraic simplifications to make output more readable - (@pxref{Symbolic parameters for simplification (simp.r)}) -@item system_subs.r - algebraic substitutions to resolve, eq trig. identities - (@pxref{Symbolic parameters (subs.r)}) -@item system_simpar.txt - simulation parameters (@pxref{Simulation parameters}) -@item system_numpar.txt - numerical parameters (@pxref{Numeric parameters (numpar)}) -@item system_input.txt - the system input for simulations (@pxref{Simulation input}) -@item system_logic.txt - the switching logic for simulations (@pxref{Simulation logic}) -@item system_sspar.r - defines the system steady-state (@pxref{Steady-state solutions - symbolic (ss)}) -@end vtable - -@node Verbal description (desc), Acausal bond graph (abg), Defining representations, Representations -@comment node-name, next, previous, up -@section Verbal description (desc) -@cindex Verbal description (desc) - -Systems can be documented in LaTeX using the _desc.tex file. This file -is included in the report (@pxref{Report}) if the abg tex option -is included in the rep.txt file. As usual, @strong{MTT} provides a -default text file to be edited by the user (@pxref{Text editors}). - - -@c node next prev up -@node Acausal bond graph (abg), Acausal bond graph - LaTeX ready (labg), Verbal description (desc), Representations -@section Acausal bond graph (abg) -@cindex Acausal bond graph (abg) -@pindex Acausal bond graph (abg) - -The acausal bond graph is the main input to @strong{MTT}. It is up to you, as a -system modeler, to distill the essential aspects of the system that you -wish to model and capture this information in the form of a bond graph. - -The inexperienced modeler may wish to look in one of the standard -textbooks and copy some bond graphs of systems to get going. - - -To create the acausal bond graph of system `sys' in language fig type: -@example -mtt sys abg fig -@end example -To create the acausal bond graph of system `sys' in language m type: -@example -mtt sys abg m -@end example -To view the acausal bond graph of system `sys' type: -@example -mtt sys abg view -@end example - -@menu -* Language fig (abg.fig):: -* Language m (rbg.m):: -* Language m (abg.m):: -* Language tex (abg.tex):: -@end menu - -@node Acausal bond graph - LaTeX ready (labg), Stripped acausal bond graph (sabg), Acausal bond graph (abg), Representations -@section Acausal bond graph - LaTeX ready (labg) -@cindex Acausal bond graph - LaTeX ready (labg) -@pindex Acausal bond graph - LaTeX ready (labg) -This representation exists in the fig (@pxref{Language fig (abg.fig)}) -only. It is used for high-quality figures generated using fig2dev with -the -Lpstex option. - -@menu -* Language fig (abg.fig):: -* Language m (rbg.m):: -* Language m (abg.m):: -* Language tex (abg.tex):: -@end menu - -@node Language fig (abg.fig), Language m (rbg.m), Acausal bond graph - LaTeX ready (labg), Acausal bond graph - LaTeX ready (labg) -@subsection Language fig (abg.fig) -@cindex Language fig (abg.fig) -@pindex Language fig (abg.fig) - -A bond graph is made up of: -@ftable @code -@item bonds - To connect components together. -@item strokes - To indicate causality. -@item components - Either simple or compound. -@item artwork - Irrelevant to the system but useful to the user. -@end ftable - -An icon library of bonds, components and other symbols is available -within xfig (@pxref{icon library}). - - - - -@menu -* icon library:: -* bonds:: -* strokes:: -* components:: -* Simple components:: -* SS components:: -* Simple components - implementation:: -* Compound components:: -* Named SS components:: -* Coerced bond direction:: -* Port labels:: -* Vector port labels:: -* Port label defaults:: -* Vector components:: -* artwork:: -* Valid names:: -@end menu - -@node icon library, bonds, Language fig (abg.fig), Language fig (abg.fig) -@subsubsection Icon library -@cindex Icon -@cindex library -A number of predefined iconic symbols are available within xfig. -@example -Click onto the library icon -Click onto the library pull-down menu and select BondGraph -Select iconic symbols from the presented list -@end example - -@node bonds, strokes, icon library, Language fig (abg.fig) -@subsubsection Bonds -@cindex bonds -@pindex bonds - -Bonds are represented by polylines with two segments. They must be the -default style (i.e. plain not dashed or dotted). The shortest segment is -taken to be the half-arrow. its positioning is significant because: -@itemize @bullet -@item -It points in the direction of power flow; thus a bond normally points -towards C, I and R components. -@item -the corresponding side of the bond indicates flow causality; the other -side represents effort causality. This is significant when using causal -half-strokes (@pxref{strokes}). Please adopt the convention of having -the half-arrows below horizontal bonds and to the right of vertical bonds. -@end itemize - - - -@c node next prev up -@node strokes, components, bonds, Language fig (abg.fig) -@subsubsection Strokes -@cindex strokes -@pindex strokes - -Causal strokes are represented by single-segment polylines. -There are two sorts of strokes: -@itemize @bullet -@item -@emph{Full} strokes: these are the usual bond-graph strokes and determine -both the effort and flow causality in the usual way. The @emph{centre} of the -stroke should be at about one end of the bond and be at right angles to -it. -@item -@emph{Half} strokes: these are an innovation in @strong{MTT} and allow you to -specify the effort and flow causality independently. The @emph{end} of the -stroke should be at about one end of the bond and be at right angles to -it. If the causal half-stroke is on the @emph{same} side as the half-arrow -(@pxref{bonds}) then it determines @emph{flow} causality; if, on the other -hand, it is on the @emph{opposite} side to the half-arrow -(@pxref{bonds}) then it determines @emph{effort} causality. -Two half strokes on the @emph{same}, but on @emph{opposite} sides of the -bond are equivalent to a a full stroke at the same end of the bond. -@end itemize - -@strong{MTT} is reasonably forgiving; but a neat diagram will be less ambiguous to -you as well as to @strong{MTT}. - -Causality is indicated as follows: -@itemize @bullet -@item -@emph{Effort} is imposed at the @emph{same} end as the stroke. -@item -@emph{Flow} is imposed at the @emph{opposite} end as the stroke. -@end itemize - - - -@c node next prev up -@node components, Simple components, strokes, Language fig (abg.fig) -@subsubsection Components -@cindex components -@pindex components - -Components are represented by a text string in fig. The recommended -style is: 20pt, Times-Roman and centre justified. - -The component text string can be of the following forms: -@ftable @code -@item type -Just the type of the component is indicated. Components may be either -Simple components (@pxref{Simple components}) or Compound components -(@pxref{Compound components}). For example: -@example -R -@end example -@item type:label -Both the type and the label of the component are given. The type must be -a valid name (@pxref{Valid names}.The name provides a link to more -information to be found in @xref{Labels (lbl)}. For example: -@example -R:r -@end example -@item type:label:cr -Not only are the type and the label of the component given, but also the -component cr argument. The type must be -a valid name (@pxref{Valid names}.The name provides a link to more -information to be found in @xref{Labels (lbl)}. For example: -@example -R:r:flow,r -@end example -@item type:label:expression -Expression is a mathematical expression relating the effort (called -mtt_e) to the flow (called mtt_f). -For example the following three forms are equivalent -@example -R:r:mtt_e=r*mtt_f -R:r:mtt_e-r*mtt_f=0 -R:r:mtt_f=mtt_e/r -@end example -A non-linear example is: -@example -R:r:mtt_e = sin(mtt_f) -@end example - -@item type*n -The name, together with the number @samp{n} of repetitions of the -component, are given. This repetition only makes sense if the component -has an even number of ports (@pxref{Port labels}); n copies of the component -are concatenated with odd Named ports (@pxref{Port labels}) of the -component being connected to the even Named ports of the previous -component in the chain in numerical order. This feature is particularly -useful if the component is compound and can be used for, example to give -a lumped approximation of a distributed system. For example: -@example -MySystem*25 -@end example -@item type:label*n -This complete form and is a combination of the simpler forms. For -example: -@example -MySystem:MyLabel*25 -@end example - -@end ftable - -@node Simple components, SS components, components, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection Simple components -@cindex Simple components - -The following simple components are defined in MTT. - -@ftable @code -@item R - Standard one-port R -@item C - Standard one-port C -@item I - Standard one-port I -@item SS - Source-sensor -@item TF - Transformer -@item GY - Gyrator -@item AE - Effort amplifier -@item AF - Flow amplifier -@item CSW - Switched one-port C -@item ISW - Switched one-port I -@end ftable - -@menu -* SS components:: -* Simple components - implementation:: -@end menu - -@node SS components, Simple components - implementation, Simple components, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection SS components -@cindex SS components - -@iftex -$$ - -@end iftex - - -@code{SS} components provide input and output variables for a system; -Named SS components (@pxref{Named SS components}) provide this for -subsystems. - -@node Simple components - implementation, Compound components, SS components, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection Simple components - implementation -@cindex Simple components - implementation - -Each simple component, with name NAME, is defined by two m files: -@ftable @code -@item NAME_cause.m - defines the possible causal patterns for the component -@item NAME_eqn.m - defines the equations generated -@end ftable -Only the experienced user would normally define simple components - -Compound components (@pxref{Compound components}) are recommended for -DIY components. - -@node Compound components, Named SS components, Simple components - implementation, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection Compound components -@cindex Compound components -@cindex Named SS -Compound components are systems described by bond graphs and implemented -by MTT. They have special SS components, Named SS components -(@pxref{Named SS components}), to indicate connections to the -encapsulating system. - -Like any other system, they are described by a graphical Bond Graph description -(@pxref{Language fig (abg.fig)}), and a label file (@pxref{Labels (lbl)}). - -By convention, all of the files describing a component live in a -directory with the same name as the component. - -@menu -* Named SS components:: -@end menu - -@node Named SS components, Coerced bond direction, Compound components, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection Named SS components -@cindex Named SS components - -Named SS components provide the link from the system which @emph{defines} -compound component to the system which @emph{uses} a compound -component @pxref{Compound components}. -A named SS components is of the form -@code{SS:[name]}; - -Where `name' is a name consisting of alphanumeric characters and -underscore; for example: -@example -SS:[Mechanical_1] -@end example -Each such named SS provides one of the ports -(@pxref{Ports}). -The direction of the named SS components. -(@pxref{Named SS components}) -is coerced (@pxref{Coerced bond direction}) to have the same direction -as the bond connected to the corresponding port. Thus the direction of -the direction of the named SS components has no significance unless the -component is at the top level of a system. - -If a named SS component exists at the top level (@pxref{Top level}) -and is treated as an -ordinary SS component with the given direction and with the attributes -specified in the label file (@pxref{Labels (lbl)}). - -@node Coerced bond direction, Port labels, Named SS components, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection Coerced bond direction -@cindex Coerced bond direction -@pindex Coerced bond direction -Named SS components (@pxref{Named SS components}) provide the mechanism -for declaring the ports (@pxref{Ports}) of a component. The -corresponding bond has a direction. However, under some circumstances, -it may be useful to reverse this direction. @strong{MTT} provides a -coercion mechanism for this: the the direction of the bond attached to -the named SS component (@pxref{Named SS components}) is replaced by the -direction of the bond attached to the component port. - -@node Port labels, Vector port labels, Coerced bond direction, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection Port labels -@cindex ports -@pindex ports -Most multi-port components have ports -@pxref{Ports})which display different -behaviors; the exception to this is the junction (@code{0} and @code{1}) -components. For this reason, @strong{MTT} provides a method for unambiguously -identifying the ports of a multi-port component by port labels. - -A port label is indicated by a name within parentheses of the form -@code{[name]}, where `name' is a name consisting of alphanumeric -characters and underscore; for example: -@example -[Mechanical_1] -@end example -This provides a label for corresponding to the component to which the -nearest bond-end is attached. - -The following rules must be be obeyed: -@itemize @bullet -@item -If a component has any port labels at all, there must be one for each -port of the component. -@c @item -@c If a component is to be used repetitively (see @ref{components}), it -@c must have an even number of ports and the odd ports are connected to the -@c even points within the chain of components. -@end itemize - -Port labels may be grouped into vector port labels (@pxref{Vector port -labels}). Components with compatible (ie containing the same number of ports) -vector ports may be connected by a @emph{single} bond -(@pxref{Bonds}); such a bond implies the corresponding number of bonds -(one for each element of the vector port label). All such bonds inherit -the same direction and any @emph{explicit} causal strokes (@pxref{strokes}) - -@node Vector port labels, Port label defaults, Port labels, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection Vector port labels -@cindex vector port labels -@cindex port labels -Port labels (@pxref{Port labels}) may be grouped into vector port -labels of the form @code{[name1,name2,name3]}. -@example -[Mechanical_1,Electrical,Hydraulic_5] -@end example - -@node Port label defaults, Vector components, Vector port labels, Language fig (abg.fig) -@comment node-name, next, previous, up -@subsubsection Port label defaults -@cindex Port label defaults -@pindex Port label defaults -Whether impicitly or explicity, all ports of components (with the -exception of 0 and 1 junctions) must have labels (@pxref{Port -labels}). However, these can be omitted from the bond graph in the -following circumstances and default labels are supplied by @strong{MTT}. -@enumerate -@item A single unlabled inport defaults to [in] -@item A single unlabled outport defaults to [out] -@end enumerate - -These defaults may, in turn be aliases (@pxref{Aliases}) for port labels -(@pxref{Port labels}) or vector port labels (@pxref{Vector port -labels}). Combining the default and alias mechanism is a powerful tool -for creating uncluttered, yet complex, bond graph models. - -@node Vector components, artwork, Port label defaults, Language fig (abg.fig) -@subsubsection Vector Components -@cindex Vector components -@pindex Vector components -Vectors of components can be created in four cases: -@code{0} junctions, -@code{1} junctions, -@code{SS} components and -@code{SS} port components. - - -In each case, the presence of a vector component is indicated by a -single port label (@pxref{Port labels}) of one of two forms: -@enumerate -@item containing numerals from 1 to -the order of the vector. Thus a vector of 3 components is indicated by a -port label of the form [1,2,3]. -@item 1: followed by -the order of the vector. Thus a vector of 3 components is indicated by a -port label of the form [1:3]. -@end enumerate - - -Within the corresponding label file (@pxref{Labels (lbl)}), the -components of a vector port can be accessed using _i where i is the -corresponding index. Thus a port SS:[Electrical] appearing near the port -label [1,2,3] could contain the port alias (@pxref{Port aliases}) -@example -%ALIAS in Electrical_1,Electrical_2,Electrical_3 -@end example - -@node artwork, Valid names, Vector components, Language fig (abg.fig) -@subsubsection Artwork -@cindex artwork -@pindex artwork -You are encouraged to annotate your bond graphs extensively - this makes -them an immediately readable document whilst retaining the precise and -unambiguous expressive power of the bond graph. - -You may add any Fig (@pxref{Fig}) object to the bond graph as long as it -will not be interpreted as part of the bond graph. -The reccommended way to acheive this is to put the Bond Graph at depth -0,10,20 etc (ie depth modulo 10 is zero) and artwork at any other depth. -@c The recommended way to do this is to @emph{put all artwork at or below -@c Depth 1} in the figure. @strong{MTT} ignores all objects not at depth 0. - - -For compatibility with earlier versions of @strong{MTT}, the following -objects are ignored even at level 0. However, their use is strongly -discouraged. -@itemize @bullet -@item -Adding text is OK as long as it cannot be confused with components -(@pxref{components}). In particular, you can include invalid component -characters such as white space, @code{"}, @code{'}, @code{!} etc. -@item -Adding boxes, arcs etc is always OK. -@item -Adding dotted or dashes lines is always OK. -@end itemize - -The stripped abg file (sabg) (@pxref{Stripped acausal bond graph -(sabg)}) -shows only those parts of the diagram recognised by @strong{MTT} and is -therefore useful for distinguishing artwork. - -@node Valid names, , artwork, Language fig (abg.fig) -@subsubsection Valid Names -@cindex valid name -@pindex valid name -A valid name is a text string containing alphanumeric characters. It -must @strong{NOT} contain underscore @samp{_}, hyphen @samp{-}, @samp{:} -or @samp{*}. - -The following names should be avoided -@example -if endif -@end example - - -The following reserved words in reduce should also be avoided (with any case) -@example -Commands ALGEBRAIC ANTISYMMETRIC ARRAY BYE CLEAR CLEARRULES COMMENT -CONT DECOMPOSE DEFINE DEPEND DISPLAY ED EDITDEF END EVEN FACTOR FOR -FORALL FOREACH GO GOTO IF IN INDEX INFIX INPUT INTEGER KORDER LET -LINEAR LISP LISTARGP LOAD LOAD PACKAGE MASS MATCH MATRIX MSHELL -NODEPEND NONCOM NONZERO NOSPUR ODD OFF ON OPERATOR ORDER OUT PAUSE -PRECEDENCE PRINT PRECISION PROCEDURE QUIT REAL REMFAC REMIND RETRY -RETURN SAVEAS SCALAR SETMOD SHARE SHOWTIME SHUT SPUR SYMBOLIC -SYMMETRIC VECDIM VECTOR WEIGHT WRITE WTLEVEL - -Boolean Operators EVENP FIXP FREEOF NUMBERP ORDP PRIMEP - -Infix Operators := = >= > <= < => + * / ^ ** . WHERE SETQ OR AND -MEMBER MEMQ EQUAL NEQ EQ GEQ GREATERP LEQ LESSP PLUS DIFFERENCE MINUS -TIMES QUOTIENT EXPT CONS Numerical Operators ABS ACOS ACOSH ACOT ACOTH -ACSC ACSCH ASEC ASECH ASIN ASINH ATAN ATANH ATAN2 COS COSH COT COTH -CSC CSCH EXP FACTORIAL FIX FLOOR HYPOT LN LOG LOGB LOG10 NEXTPRIME -ROUND SEC SECH SIN SINH SQRT TAN TANH - -Prefix Operators APPEND ARGLENGTH CEILING COEFF COEFFN COFACTOR CONJ -DEG DEN DET DF DILOG EI EPS ERF FACTORIZE FIRST GCD G IMPART INT -INTERPOL LCM LCOF LENGTH LHS LINELENGTH LTERM MAINVAR MAT MATEIGEN MAX -MIN MKID NULLSPACE NUM PART PF PRECISION RANDOM RANDOM NEW SEED RANK -REDERR REDUCT REMAINDER REPART REST RESULTANT REVERSE RHS SECOND SET -SHOWRULES SIGN SOLVE STRUCTR SUB SUM THIRD TP TRACE VARNAME - -Reserved Variables CARD NO E EVAL MODE FORT WIDTH HIGH POW I INFINITY -K!* LOW POW NIL PI ROOT MULTIPLICITY T - -Switches ADJPREC ALGINT ALLBRANCH ALLFAC BFSPACE COMBINEEXPT -COMBINELOGS COMP COMPLEX CRAMER CREF DEFN DEMO DIV ECHO ERRCONT -EVALLHSEQP EXP EXPANDLOGS EZGCD FACTOR FORT FULLROOTS GCD IFACTOR INT -INTSTR LCM LIST LISTARGS MCD MODULAR MSG MULTIPLICITIES NAT NERO -NOSPLIT OUTPUT PERIOD PRECISE PRET PRI RAT RATARG RATIONAL RATIONALIZE -RATPRI REVPRI RLISP88 ROUNDALL ROUNDBF ROUNDED SAVESTRUCTR -SOLVESINGULAR TIME TRA TRFAC TRIGFORM TRINT - -Other Reserved Ids BEGIN DO EXPR FEXPR INPUT LAMBDA LISP MACRO PRODUCT -REPEAT SMACRO SUM UNTIL WHEN WHILE WS - - -@end example - - - -@node Language m (rbg.m), Language m (abg.m), Language fig (abg.fig), Acausal bond graph - LaTeX ready (labg) -@comment node-name, next, previous, up -@subsection Language m (rbg.m) -The raw bond graph of system `sys' is represented as - an m file with heading: -@example -function [rbonds, rstrokes,rcomponents,rports,n_ports] = sys_rbg -@end example -This representation is a half-way house between the fig -(@pxref{Language fig (abg.fig)}) and m -(@pxref{Language m (abg.m)}) representations. It contains the -geometric information from the fig file in a form digestible by Octave -(@pxref{Octave}). - -The five outputs of this function are: -@itemize @bullet -@item -rbonds -@item -rstrokes -@item -rcomponents -@item -rports -@item -n_ports -@end itemize - -@emph{rbonds} is a matrix with -@itemize @bullet -@item -one row for each bond (@pxref{bonds}) -@item -columns 1 and 2 containing the x,y coordinates for one end of the bond -@item -columns 3 and 4 containing the x,y coordinates for the corner of the bond -@item -columns 5 and 6 containing the x,y coordinates for the other end of the bond -@end itemize - -@emph{rstrokes} is a matrix with (@pxref{strokes}) -@itemize @bullet -@item -one row for each stroke or half-stroke -@item -columns 1 and 2 containing the x,y coordinates for one end of the stroke -@item -columns 3 and 4 containing the x,y coordinates for the other end of the stroke -@end itemize - -@emph{rcomponents} is a matrix with (@pxref{components}) -@itemize @bullet -@item -one row for each component -@item -columns 1 and 2 containing the x,y coordinates of the component -@item -the remaining columns containing fig file information -@end itemize - -@emph{rports} is a matrix with (@pxref{Port labels}) -@itemize @bullet -@item -one row for each component port that is explicitly labeled -@item -columns 1 and 2 containing the x,y coordinates of the port label -@item -column 3 contains the port number. -@end itemize - -@emph{n_ports} is the number of ports associated with the system -- i.e. the -number of Named SS components (@pxref{Named SS components}). - -@menu -* Transformation abg2rbg_fig2m:: -@end menu - -@node Transformation abg2rbg_fig2m, , Language m (rbg.m), Language m (rbg.m) -@comment node-name, next, previous, up -@subsubsection Transformation abg2rbg_fig2m -@cindex Transformation abg2rbg_fig2m - -This transformation takes the acausal bond graph as a fig file -(@pxref{Language fig (abg.fig)}) and transforms it into a raw bond graph in -m-file format (@pxref{Language m (rbg.m)}). - -This transformation is implemented in GNU awk (gawk). -It scans both the fig file (@pxref{Language fig (abg.fig)}) -and the label file (@pxref{Labels (lbl)}) and generates the rbg - (@pxref{Language m (rbg.m)}) with components sorted according to the -label file. -It also generates a file sys_fig.fig containing details of the bond -graph with the components removed. - - -@node Language m (abg.m), Language tex (abg.tex), Language m (rbg.m), Acausal bond graph - LaTeX ready (labg) -@comment node-name, next, previous, up -@subsection Language m (abg.m) -@cindex Language m (abg.m) -@cindex bonds -@cindex components -@cindex n_ports - -The acausal bond graph of system `sys' is represented as - an m file with heading: -@example -function [bonds,components,n_ports] = sys_abg -@end example -The three outputs of this function are: -@itemize @bullet -@item -bonds -@item -components -@item -n_ports -@end itemize - -@emph{bonds} is a matrix with -@itemize @bullet -@item -one row for each bond -@item -the first column contains the arrow-orientated -(@pxref{Arrow-orientated causality}) -causality of the @emph{effort} variable. -@item -the second column contains the arrow-orientated -(@pxref{Arrow-orientated causality}) -causality of the @emph{flow} variable. -@end itemize - -@emph{components} is a matrix with -@itemize @bullet -@item -one row for each component -@item -one column for each bond impinging on the component. The -@emph{magnitude} of each entry corresponds to the bond number (the -appropriate row index of` bonds'); the sign is positive if the bond -arrow points into the component and negative otherwise. -@end itemize - -@emph{n_ports} is the number of ports associated with the system -- i.e. the -number of Named SS components (@pxref{Named SS components}). - -@menu -* Arrow-orientated causality:: -* Component-orientated causality:: -* Transformation rbg2abg_m:: -@end menu - -@node Arrow-orientated causality, Component-orientated causality, Language m (abg.m), Language m (abg.m) -@comment node-name, next, previous, up -@subsubsection Arrow-orientated causality -@cindex Arrow-orientated causality - -The arrow-orientated causality convention assigns -1, 0 or 1 -to both the effort and flow (@pxref{Variables}) sides of a bond -to represent the causal stroke (@pxref{strokes}) -as follows: -@vtable @code -@item 0 - if there is no causality set. -@item 1 - if the causal stroke is at the arrow end of the bond. -@item -1 - if the causal stroke is at the other end of the bond. -@end vtable -@pxref{Component-orientated causality}. - -@node Component-orientated causality, Transformation rbg2abg_m, Arrow-orientated causality, Language m (abg.m) -@comment node-name, next, previous, up -@subsubsection Component-orientated causality -@cindex Component-orientated causality - -The component-orientated causality convention assigns -1, 0 or 1 -to both the effort and flow (@pxref{Variables}) sides of a bond -to represent the causal stroke (@pxref{strokes}) -as follows: -@vtable @code -@item 0 - if there is no causality set. -@item 1 - if the causal stroke is at the component end of the bond. -@item -1 - if the causal stroke is at the other end of the bond. - -@end vtable -@pxref{Arrow-orientated causality}. - -@node Transformation rbg2abg_m, , Component-orientated causality, Language m (abg.m) -@comment node-name, next, previous, up -@subsubsection Transformation rbg2abg_m -@cindex Transformation rbg2abg_m -This transformation takes the raw bond graph and, by doing some -geometrical computation, determines the topology of the bond graph -- ie -what is close to what. - -@node Language tex (abg.tex), , Language m (abg.m), Acausal bond graph - LaTeX ready (labg) -@comment node-name, next, previous, up -@subsection Language tex (abg.tex) -@cindex Language tex (abg.tex) - -For the purpose of producing a report (@pxref{Report}), @strong{MTT} -generates a LaTeX (@pxref{LaTeX}) file describing the bond graph and its -subsystems. Additional information may be supplied using the description -representation (@pxref{Detailed}). - -@c node next prev up -@node Stripped acausal bond graph (sabg), Labels (lbl), Acausal bond graph - LaTeX ready (labg), Representations -@section Stripped acausal bond graph (sabg) -@cindex Stripped acausal bond graph (sabg) -@pindex Stripped acausal bond graph (sabg) -The stripped acausal bond graph is the acausal bond graph representation -(@pxref{Acausal bond graph (abg)}) without the artwork -(@pxref{artwork}). It is useful to check for mistakes by showing -precisely what is recognised by @strong{MTT}. - -@menu -* Language fig (sabg.fig):: -* Stripped acausal bond graph (view):: -@end menu - -@node Language fig (sabg.fig), Stripped acausal bond graph (view), Stripped acausal bond graph (sabg), Stripped acausal bond graph (sabg) -@subsection Language fig (sabg.fig) -@cindex Language fig (sabg.fig) -@pindex Language fig (sabg.fig) -The stripped acausal bond graph can be generated as a fig (@pxref{Fig}) -file using -@example -mtt syst sabg fig -@end example - -@node Stripped acausal bond graph (view), , Language fig (sabg.fig), Stripped acausal bond graph (sabg) -@subsection Stripped acausal bond graph (view) -@cindex Language m (view) -@cindex view Constrained-state Equations -This representation has the standard text view -(@pxref{Views}). - - -@node Labels (lbl), Structure (struc), Stripped acausal bond graph (sabg), Representations -@comment node-name, next, previous, up -@section Labels (lbl) -@cindex Labels -@cindex lbl -Bond graph components have optional labels. These provide pointers to -further information relating to the component; this avoids clutter on -the bond graph. - -The label file contains the following non-blank lines (blank lines are ignored) -@itemize @bullet -@item Summary - lines beginning with #SUMMARY -@item Description - lines beginning with #DESCRIPTION -@item Alias - lines beginning with #ALIAS -@item Comments - lines beginning with # -@item Labels - other non-blank lines -@end itemize - -Note, for compatability with old versions, % may be used in place of -#; but the use of % is deprecated. -Each label contains three fields (in the following order) separated by -white space and on one line: -@enumerate -@item The component name @pxref{Component names}. This must be a valid -name (@pxref{Valid names}. -@item The component constitutive relationship @pxref{Component constitutive relationship} -@item The component arguments @pxref{Component arguments} -@end enumerate - -Not each component @pxref{components} needs a label, only those which are explicitly -labeled on the Bond Graph @pxref{Acausal bond graph (abg)}. -@strong{MTT} checks whether all components labelled on the bond graph -have labels and vice versa. - -If no lbl file exists, @strong{MTT} will create a valid one for you; -including a default set of arguments and crs for both simplae and -compound components. - -If wish to create one to edit yourself, type -@example -mtt system_name lbl txt -@end example -An example lbl file (for the RC system is): -@example -%% Label file for system RC (RC_lbl.txt) -%SUMMARY RC -%DESCRIPTION -% Port aliases -%ALIAS in in -%ALIAS out out - -% Argument aliases -%ALIAS $1 c -%ALIAS $2 r - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - c lin effort,c - -% Component type R - r lin flow,r - -% Component type SS - [in] SS external,external - [out] SS external,external - -@end example - - -The old-style lbl files (@pxref{Old-style labels (lbl)}) are NO LONGER -supported -- you are encouraged to convert them ASAP. - -@menu -* SS component labels:: -* Other component labels:: -* Component names:: -* Component constitutive relationship:: -* Component arguments:: -* Parameter declarations:: -* Units declarations:: -* Interface Control Definition:: -* Aliases:: -* Parameter passing:: -* Old-style labels (lbl):: -* Language tex (desc.tex):: -@end menu - -@node SS component labels, Other component labels, Labels (lbl), Labels (lbl) -@comment node-name, next, previous, up -@subsection SS component labels -@cindex SS component labels -In addition to the label there are two information fields, @pxref{Labels -(lbl)}. The first must be `SS', the second contains two information -fields of the form info_field_1,info_field_2. - -These two information -fields correspond to the effort and flow variables of the of the SS components as follows -@vtable @code -@item info_field_1 - effort -@item info_field_2 - flow -@end vtable -Each of these two fields contains one of the following @emph{attributes}: -@vtable @code -@item external - indicates that the corresponding variable is a system input or -output -@item internal - indicates that the variable does not appear as a system output; - it is an error to label an input in this way. -@item a number - the value of the input; or the value of the (imposed) output -@item a symbol - the symbolic value of the input; or the value of the (imposed) output -@item unknown - used for the SS method of solving algebraic loops. This - indicates that the corresponding system input (SS output) is to - be chosen to set the corresponding system output (SS input) to zero. -@item zero - used for the SS method of solving algebraic loops. This - indicates that the corresponding system output (SS input) is to - be set to zero using the variable indicted by the corresponding - `unknown' label. -@end vtable - -Some examples are: -@example -%% ss1 is both a source and sensor -ss1 SS external,external -%% ss1 acts as a flow sensor - it imposes zero effort. -ss2 SS 0,external -@end example - - -@node Other component labels, Component names, SS component labels, Labels (lbl) -@comment node-name, next, previous, up -@subsection Other component labels -@cindex Other component labels - -In addition to the label there are two information fields, -@pxref{Labels (lbl)}. -They correspond to the constitutive relationship -(see @pxref{Constitutive relationship} and arguments of the -component as follows -@vtable @code -@item info_field_1 - constitutive relationship -@item info_field_2 - parameters -@end vtable - -Some examples are: -@example -%Armature resistance -r_a lin effort,r_a - -%Gearbox ratio -n lin effort,n -@end example - -@strong{MTT} supports parameter-passing to (@pxref{Parameter passing}) -subsystems. - -@menu -* Component names:: -* Component constitutive relationship:: -* Component arguments:: -* Aliases:: -* Parameter passing:: -* Old-style labels (lbl):: -@end menu - -@node Component names, Component constitutive relationship, Other component labels, Labels (lbl) -@comment node-name, next, previous, up -@subsection Component names -@cindex Component names -The component name field must contain a valid name (@pxref{Valid names} corresponding to the -name (the bit after the :) of each named component (@pxref{components}) -on the bond graph (@pxref{Acausal bond graph (abg)}). - -@node Component constitutive relationship, Component arguments, Component names, Labels (lbl) -@comment node-name, next, previous, up -@subsection Component constitutive relationship -@cindex Component constitutive relationship -The constitutive relationship field contains the name of a constitutive -relationship for the component. There are three sorts of constitutive -relationship recognised by @strong{MTT}: -@enumerate -@item A generic constitutive relationship such as @var{lin} (the generic -linear constitutive relationship. -@item A local constitutive relationship with the same name as the -component type -@item The @var{SS} constitutive relationship reserved for @var{SS} -components. -All labels for @var{SS} components must contain SS in this field. -@end enumerate - - -@node Component arguments, Parameter declarations, Component constitutive relationship, Labels (lbl) -@comment node-name, next, previous, up -@subsection Component arguments -@cindex Component arguments - -@node Parameter declarations, Units declarations, Component arguments, Labels (lbl) -@comment node-name, next, previous, up -@subsection Parameter declarations -@cindex parameter declarations -@pindex parameter declarations -@pindex PAR -@pindex NOTPAR -@pindex VAR -@pindex NOTVAR - -It is sometimes useful to use parameters (in addition to those implied by -the Component arguments @pxref{Component arguments}) to compute values -in, for example the numpar file. These can be declared in the label -file; -for examples , the two parameters par1 and par 2 can be declared as: -@example -#PAR par1 -#PAR par2 -@end example - -On the other hand, some CR arguments (eg foo and bar) may not correspond to -parameters. These can be excluded from the sympar list using -the NOTPAR declaration -@example -#NOTPAR foo -#NOTPAR bar -@end example - -For comapability with old code, VAR may be used in place of PAR, but -this usage is deprecated. - -@node Units declarations, Interface Control Definition, Parameter declarations, Labels (lbl) -@comment node-name, next, previous, up -@subsection Units declarations -@cindex units declarations -@pindex units declarations -@pindex UNITS -The units and domains of ports (@pxref{Ports}) are declared as: -@example -#UNITS Port_name domain effort_units flow_units -@end example -where "Port_name" is the name of the port, domain is one of: -@vtable @code -@item electrical - the electrical domain -@item translational - the translational mechanical domain -@item rotational - the rotational mechanical domain -@item fluid - the fluid domain -@item thermal - the thermal domain -@end vtable -and effort_units and flow_units are corresponding units for the effort -and the flow. - -Allowed units are those defined in the @strong{units} package. - - - -@strong{MTT} checks that units are -@itemize @bullet -@item defined consistently with the domain -@item the same for connected ports when both ports have defined units. -@end itemize -No checks are done if one or both ends of a bond are not connected to a -port with defined units. - -The word ``none'' can be specified in place of a unit to prevent -@strong{MTT} from checking the corresponding effort or flow while -still checking the units of the other variable, if it is specified. -This can be used to force checking of either the effort or flow on -signal bonds or in pseudo-bond graphs where the domain of the two -variables may not be identical. - - -@node Interface Control Definition, Aliases, Units declarations, Labels (lbl) -@comment node-name, next, previous, up -@subsection Interface Control Definition -@cindex ICD (label file directive) -It is sometimes useful to be able to automatically generate a set of -assignments mapping @strong{MTT} inputs and outputs to an external interface -definition. This can be achieved with use of the @emph{#ICD} directive. - -@example -#ICD PressureSensor PUMP1_PRESSURE_SENSOR,Pa;null,none -#ICD Electrical PUMP1_VOLTAGE,volt;PUMP1_CURRENT,amp - -% Component type De - PressureSensor SS external - -% Component type SS - Electrical SS external,external -@end example - - -The ICD directive consists of 3 whitespace delimited fields: - -@enumerate -@item [%|#]ICD -@item component name -@item Four comma (,) or semi-colon (;) delimited fields: - -@enumerate -@item name of effort parameter -@item unit of effort parameter -@item name of flow parameter -@item unit of flow parameter -@end enumerate -@end enumerate - -If no parameter name is required, a value of "null" should be used. -If the parameter does not have any units, a value of "none" should be used. - -ICD parameters may be aliased @pxref{Aliases} in the same way as normal -parameters, thus it is possible to define some or all of the ICD in higher -level components. - -The command - -@example -mtt sys ICD txt -@end example - -will generate a text file containing a list of mappings: - -@example -## Interface Control Definition for System sys -## sys_ICD.txt: Generated by MTT Thu Jul 12 21:21:21 CDT 2001 - -Input: PUMP1_VOLTAGE sys_P1_1_Electrical Causality: Effort Units: volt -Output: PUMP1_CURRENT sys_P1_1_Electrical Causality: Flow Units: amp -Output: PUMP1_PRESSURE_SENSOR sys_P1_1_PressureSensor Causality: Effort Units: Pa -@end example - -A set of assignments can be generated with the command -@example -mtt sys ICD m -@end example - -resulting in: - -@example -# Interface Control Definition mappings for system sys -# sys_ICD.m: Generated by MTT Thu Jul 12 21:26:56 CDT 2001 - -# Inputs - - mttu(1) = PUMP1_VOLTAGE; - -# Outputs - - PUMP1_CURRENT = mtty(1); - PUMP1_PRESSURE_SENSOR = mtty(2); -@end example - -A similar file will be generated by the command -@example -mtt sys ICD cc -@end example - - - -@node Aliases, Parameter passing, Interface Control Definition, Labels (lbl) -@comment node-name, next, previous, up -@subsection Aliases -@cindex aliases -@pindex aliases - -Aliases provide a convenient mechanism for relabelling words appearing -in the label file (@pxref{Labels (lbl)}). There are three contexts in -which the alias mechanism is used: - -@enumerate -@item renaming ports (@pxref{Port aliases}), -@item renaming parameters (@pxref{Parameter aliases}) and -@item renaming components (@pxref{Component aliases}). -@end enumerate - -All three mechanisms use the same form of statement within the label -file -@example -%ALIAS short_label real_label -@end example - -@strong{MTT} distinguishes between the three forms as follows: - -@itemize @bullet -@item Parameter aliases: `short_label' starts with a `$' -@item Component aliases: `real_label' contains the directory separator -`/' -@item Port aliases: neither of the above -@end itemize - -@menu -* Port aliases:: -* Parameter aliases:: -* CR aliases:: -* Component aliases:: -@end menu - - -@node Port aliases, Parameter aliases, Aliases, Aliases -@comment node-name, next, previous, up -@subsubsection Port aliases -@cindex port aliases -@pindex port aliases -Aliases provide a way of refering to (@pxref{Port labels}) or vector port labels (@pxref{Vector -port labels}) on the bond graph using a short-hand notation. With in a -component label file (@pxref{Labels (lbl)}) statements of the following -forms can occur - -@example -%ALIAS short_label real_label -@end example - -When the component is used within another component, the short_lable may -be used in place of the real_label. -More than one alias per label can be used, for example - -@example -%ALIAS short_label_1 real_label -%ALIAS short_label_2 real_label -%ALIAS short_label_3 real_label -@end example - -The port can then be refered to in four ways: as real_label, -short_label_1, short_label_2 or short_label_3. -An alternative notation for the ALIAS statement in this case is - -@example -%ALIAS short_label_1|short_label_2|short_label_3 real_label -@end example - -The alias feature is particularly powerful in conjunction with vector -port labels (@pxref{Vector port labels}) and the port label default -(@pxref{Port label defaults}) mechanisms. For example, a component with -5 ports appearing in the lbl file as: - -@example - [Hydraulic_in] external external - [Hydraulic_out] external external - [Power_Shaft] external external - [Thermal_in] external external - [Thermal_out] external external -@end example - -together with the following statements in the label file: - -@example -%ALIAS in Thermal_in,Hyydraulic_in -%ALIAS out Thermal_out,Hydraulic_out -%ALIAS shaft|power Power_Shaft -@end example - -can appear in the bond graph containing that component with one bond -labeled either [shaft] or [power] or [Power_Shaft], one unlabeled vector -bond pointing in and one unlabeled vector bond pointing out. - -@node Parameter aliases, CR aliases, Port aliases, Aliases -@comment node-name, next, previous, up -@subsubsection Parameter aliases -@cindex parameter aliases -@pindex parameter aliases - -Parameter aliases are of the form -@example -%ALIAS $n actual parameter -@end example -where n is an integer (unique within the label file). -For example - -@example -%ALIAS $1 c_v -%ALIAS $2 density,ideal_gas,r -%ALIAS $3 alpha -%ALIAS $4 flow,k_p -@end example - -Assigns four symbolic parameters to the corresponding strings These four -parameters (@code{$1}--@code{$4}) can then be used for parameter -passing(@pxref{Parameter passing}). - -@node CR aliases, Component aliases, Parameter aliases, Aliases -@comment node-name, next, previous, up -@subsubsection CR aliases -@cindex CR aliases -@pindex CR aliases - -CR aliases are of the form -@example -%ALIAS $an actual parameter -@end example -where n is an integer (unique within the label file). -For example -@example -%ALIAS $a1 lin -@end example -assigns the symbolic parameter to be lin. This parameter @code{$1} can -then be used for passing a diofferent cr to the -component (@pxref{Parameter passing}). - -@node Component aliases, , CR aliases, Aliases -@comment node-name, next, previous, up -@subsubsection Component aliases -@cindex component aliases -@pindex component aliases - -Component aliases are of the form -@example -%ALIAS Component_name Component_location -@end example - -An example appears in the following label file fragment -@example -... -%ALIAS wPipe CompressibleFlow/wPipe -%ALIAS Poly CompressibleFlow/Poly -.... - -@end example -The two components `wPipe' and `Poly' are both to be found within the -library `Compressible flow' and the respective subdirectories. This -follows the @strong{MTT} convention that compound components -(@pxref{Compound components}) live within a directory of the same name. - - -@node Parameter passing, Old-style labels (lbl), Aliases, Labels (lbl) -@comment node-name, next, previous, up -@subsection Parameter passing -@cindex Parameter passing -@strong{MTT} supports parameter-passing to subsystems within label files -(@pxref{Labels (lbl)}). Within a subsystem, explicit constitutive -relationships and parameters (or groups thereof) can be replaced by -postitional parameters such as @code{$1}, @code{$2} etc. Although this -can be done directly, it is recommended that this is done via the alias -mechanism (@pxref{Parameter aliases}). - -In a subsystem -@code{$i}, is replaced by the ith field of a colon @code{;} separated -field in the calling label file. This field may include commas @code{,} -and the four arithmetic operators @code{+}, @code{-}, @code{*} and -@code{/}. - -For example, consider the following example label file fragment (associated with a -component called Pump: -@example -... - -%ALIAS $1 c_v -%ALIAS $2 density,ideal_gas,r -%ALIAS $3 alpha -%ALIAS $4 flow,k_p - -%ALIAS wPipe CompressibleFlow/wPipe -%ALIAS Poly CompressibleFlow/Poly - -% Component type wPipe - pipe none c_v;density,ideal_gas,r - -% Component type Poly - poly Poly alpha - -@end example - -The 4 parameters @code{$1}, @code{$2}, @code{$3}, and @code{$4} can be -passed from a higher level component as in the following label file -fragment: - -@example -% Component type Pump - comp none c_v;rho,ideal_gas,r;alpha;effort,k_c - turb none c_v;rho,ideal_gas,r;alpha;effort,k_t -@end example - -Thus in component `comp': -@itemize @bullet -@item @code{$1} is replaced by c_v -@item @code{$2} is replaced by rho,ideal_gas -@item @code{$3} is replaced by alpha -@item @code{$4} is replaced by effort,k_c -@end itemize -whereas in component `turb' the first three parameters are the same but -@itemize @bullet -@item @code{$4} is replaced by effort,k_t -@end itemize - - - -@node Old-style labels (lbl), Language tex (desc.tex), Parameter passing, Labels (lbl) -@comment node-name, next, previous, up -@subsection Old-style labels (lbl) -@cindex Old-style labels -@cindex lbl - -Old syle labels (mtt version 2.x) are supported by mtt version -3.x. However, you are advised to use the new form (@pxref{Labels -(lbl)}). - -Each line of the @code{_label.txt} file is of one of three forms: -@enumerate -@item -Contains three fields (separated by white space) of the form -@example -label field_1 field_2 -@end example -@item -Blank -@item -Preceded by % -@end enumerate -Only the first is noticed by @strong{MTT}; the second and third are for -providing helpful commenting. - -The role of the two information fields depends on the component with the -corresponding label. In particular the classes of components are: -@itemize @bullet -@item -SS components, @pxref{SS components}. -@item -Other components, @pxref{components}. -@end itemize -Named SS component, @pxref{Named SS components} never have labels. -@menu -* SS component labels (old-style):: -* Other component labels (old-style):: -* Parameter passing (old-style):: -@end menu - - -@node SS component labels (old-style), Other component labels (old-style), Old-style labels (lbl), Old-style labels (lbl) -@comment node-name, next, previous, up -@subsubsection SS component labels (old-style) -@cindex SS component labels (old-style) -In addition to the label there are two information fields, -@pxref{Labels (lbl)}. -They correspond to the effort and flow of the components as follows -@vtable @code -@item info_field_1 - effort -@item info_field_2 - flow -@end vtable -Each of these two fields contains one of the following @emph{attributes}: -@vtable @code -@item external - indicates that the corresponding variable is a system input or -output -@item internal - indicates that the variable does not appear as a system output; - it is an error to label an input in this way. -@item a number - the value of the input; or the value of the (imposed) output -@item a symbol - the symbolic value of the input; or the value of the (imposed) output -@item unknown - used for the SS method of solving algebraic loops. This - indicates that the corresponding system input (SS output) is to - be chosen to set the corresponding system output (SS input) to zero. -@item zero - used for the SS method of solving algebraic loops. This - indicates that the corresponding system output (SS input) is to - be set to zero using the variable indicted by the corresponding - `unknown' label. -@end vtable - -Some examples are: -@example -%Label field1 field2 -ss1 external external -ss2 0 external -@end example - - -@node Other component labels (old-style), Parameter passing (old-style), SS component labels (old-style), Old-style labels (lbl) -@comment node-name, next, previous, up -@subsubsection Other component labels (old-style) -@cindex Other component labels (old-style) - -In addition to the label there are two information fields, -@pxref{Labels (lbl)}. -They correspond to the constitutive relationship -(see @pxref{Constitutive relationship} and arguments of the -component as follows -@vtable @code -@item info_field_1 - constitutive relationship -@item info_field_2 - parameters -@end vtable - -Some examples are: -@example -%Armature resistance -r_a lin effort,r_a - -%Gearbox ratio -n lin effort,n -@end example - -@strong{MTT} supports parameter-passing to (@pxref{Parameter passing (old-style)}) -subsystems. - - -@node Parameter passing (old-style), , Other component labels (old-style), Old-style labels (lbl) -@comment node-name, next, previous, up -@subsubsection Parameter passing (old-style) -@cindex Parameter passing (old-style) -@strong{MTT} supports parameter-passing to (@pxref{Parameter passing (old-style)}) -subsystems within label files (@pxref{Labels (lbl)}). Within a subsystem, -explicit constitutive relationships and parameters (or groups thereof) -can be replaced by -@code{$1}, @code{$2}, etc. - -In a subsystem -@code{$i}, is replaced by the ith field of a colon @code{;} separated -field in the calling label file. This field may include commas @code{,}. - -For example subsystem ROD contains the following lines in the label -file: -@example - -%DESCRIPTION Parameter 1: length from end 1 to mass centre -%DESCRIPTION Parameter 2: length from end 2 to mass centre -%DESCRIPTION Parameter 3: inertia about mass centre -%DESCRIPTION Parameter 4: mass -%DESCRIPTION See Section 10.2 of "Metamodelling" - - -%Inertias -J lin flow,$3 -m_x lin flow,$4 -m_y lin flow,$4 - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,$1 -s2 lsin flow,$2 -c1 lcos flow,$1 -c2 lcos flow,$2 - -@end example - -This can be used in a higher-level lbl (@pxref{Labels (lbl)}) file as: -@example -%SUMMARY Pendulum example from Section 10.3 of "Metamodelling" - -%Rod parameters -rod none l;l;j;m - -@end example - - -@menu -* Language tex (desc.tex):: -@end menu - -@node Language tex (desc.tex), , Old-style labels (lbl), Labels (lbl) -@comment node-name, next, previous, up -@subsection Language tex (desc.tex) -@cindex Language tex (desc.tex) -This file may contain any LaTeX compatible commands. Any mathematics -should conform to the AMSmath package. - -@node Structure (struc), Constitutive Relationship (cr), Labels (lbl), Representations -@comment node-name, next, previous, up -@section Structure (struc) -@cindex Structure -@cindex struc - -The causal bond graph implies a set of equations describing the -system. The Structure (struc) representation describes the structure of -these equations in terms of the input, outputs, states and non-states of -the system. - -@menu -* Language txt (struc.txt):: -* Language tex (struc.tex):: -* Structure (view):: -@end menu - -@node Language txt (struc.txt), Language tex (struc.tex), Structure (struc), Structure (struc) -@comment node-name, next, previous, up -@subsection Language txt (struc.txt) -@cindex Language txt (struc.txt) -This text tile contains a description of the system structure -(@pxref{Structure (struc)} with 5 tab-separated columns containing the -following information: -@vtable @code -@item type - input, output state or nonstate -@item index - an integer corresponding to the array index -@item component name - the name of the component corresponding to the variable -@item system name - the name of the system containing the component -@item repetition - an integer corresponding to the repetition of a repeated subsystem. -@end vtable - -An example of such a file (corresponding to rc) (@pxref{Quick start}) is: -@example -input 1 e1 rc 1 -output 1 e2 rc 1 -state 1 c rc 1 -@end example - - -@node Language tex (struc.tex), Structure (view), Language txt (struc.txt), Structure (struc) -@comment node-name, next, previous, up -@subsection Language tex (struc.tex) -@cindex Language tex (struc.tex) -This LaTeX (@pxref{LaTeX}) file contains a description of the system structure -(@pxref{Structure (struc)} in @code{longtable} format. It is a useful -item to include in a report(@pxref{Report}). - -@node Structure (view), , Language tex (struc.tex), Structure (struc) -@subsection Language tex (view) -@cindex Structure (view) -@cindex view Structure -This representation has the standard text view -(@pxref{Views}). - -@node Constitutive Relationship (cr), Parameters, Structure (struc), Representations -@comment node-name, next, previous, up -@section Constitutive relationship (cr) -@cindex Constitutive relationship - -The constitutive relationship (@pxref{Constitutive relationship}) -of a simple component (@pxref{Simple components} is -defined in the symbolic algebra language Reduce (@pxref{Reduce}). -The constitutive relationship of a compound components -(@pxref{Compound components}) -is implied by the constitutive relationships of its constituent components. - -@menu -* Predefined constitutive relationships:: -* DIY constitutive relationships:: -* Unresolved constitutive relationships:: -* Unresolved constitutive relationships - Octave:: -* Unresolved constitutive relationships - c++:: -@end menu - -@node Predefined constitutive relationships, DIY constitutive relationships, Constitutive Relationship (cr), Constitutive Relationship (cr) -@comment node-name, next, previous, up -@subsection Predefined constitutive relationships -@cindex Predefined constitutive relationships - -Some common cr's are predefined by MTT; these are: -@vtable @code -@item lin - a linear constitutive relationship -@item exotherm - an exothermic reaction -@end vtable - -@menu -* lin:: -* exotherm:: -@end menu - -@node lin, exotherm, Predefined constitutive relationships, Predefined constitutive relationships -@comment node-name, next, previous, up -@subsubsection lin -@findex lin -The constitutive relationship @code{lin} is predefined for the following -components. -@vtable @code -@item R - (one-port) R component -@item TF - transformer -@item GY - gyrator -@item MTF - modulated transformer -@item MGY - modulated gyrator -@item FMR - flow-modulated resistor -@end vtable -Lin takes two arguments in the form causality,gain -@vtable @code -@item causality - the causality (effort or flow) of the @emph{input} to the -constitutive relationship -@item gain - the gain of the component when the input causality is as -specified in the first argument. -@end vtable -For example the arguments -@example -flow,r -@end example -given to an R component corresponds to -@example -e = rf -@end example -if if the input causality is flow -or -@example -f = e/r -@end example -if if the input causality is effort. - -@node exotherm, , lin, Predefined constitutive relationships -@comment node-name, next, previous, up -@subsubsection exotherm -@findex exotherm - -@node DIY constitutive relationships, Unresolved constitutive relationships, Predefined constitutive relationships, Constitutive Relationship (cr) -@comment node-name, next, previous, up -@subsection DIY constitutive relationships -@cindex DIY constitutive relationships -You can write your own constitutive relationships using Reduce -(@pxref{Reduce}). This requires some understanding as to how -@strong{MTT} represent the elementary system equations -(@pxref{Elementary system equations}). Looking at the predefined -constitutive relationships is a good way to get started -(@pxref{File structure}). - -@node Unresolved constitutive relationships, Unresolved constitutive relationships - Octave, DIY constitutive relationships, Constitutive Relationship (cr) -@subsection Unresolved constitutive relationships -@cindex Unresolved constitutive relationships - -Consider the following CR file. -@example -FOR ALL rho,g,vol,h,topt,bott,flowin,press -LET tktf2(rho,g,vol,h,topt,bott,effort,2,press,effort,1) - = tank(rho,g,vol,h,topt,bott,press); -@end example -Assuming that `tank' is not defined in a -reduce file, MTT will leave it unresolved when generating m or c code. - -The resulting function can then be expressed as octave -(@pxref{Unresolved constitutive relationships - Octave}) or c++ code as -(@pxref{Unresolved constitutive relationships - c++}) appropriate. - -@node Unresolved constitutive relationships - Octave, Unresolved constitutive relationships - c++, Unresolved constitutive relationships, Constitutive Relationship (cr) -@subsection Unresolved constitutive relationships - Octave -@cindex Unresolved constitutive relationships - Octave -Following the example of the previous section, the unresolved CR `tank' -can be expressed as an Octave m-file. For example: -@example -function p = tank (rho,g,vol,h,topt,bott,press) - - ## usage: p = tank (vol,h,topt,bott,press) - ## - ## - - val = press; zt = topt; zb = bott; - zval = 0.5*(abs(zb+(zt-zb)*val-h)+(zb+(zt-zb)*val-h)); - - p = rho*g*zval + 0.5*(1+tanh((press-0.98)*500))*100000; - -endfunction -@end example -This will be automatically loaded into octave. - -@node Unresolved constitutive relationships - c++, , Unresolved constitutive relationships - Octave, Constitutive Relationship (cr) -@subsection Unresolved constitutive relationships - c++ -@cindex Unresolved constitutive relationships - Octave -Following the example of the previous section, the unresolved CR `tank' -can be expressed in c++ code. For example: -@example -inline double tank(const double rho, - const double g, - const double vol, - const double h, - const double topt, - const double bott, - const double press) - - - /* ## usage: p = tank (vol,h,topt,bott,press) - ## - ## - */ - double p, val, zval, zt, zb; - - val = press; - zt = topt; - zb = bott; - zval = 0.5 * (abs(zb + (zt - zb) * val - h) + zb + (zt - zb) * val - h); - - p = rho * g * zval + 0.5 * (1 + tanh((press - 0.98) * 500)) * 100000L; - - return p; - -@end example - -To make sure that this is used in system `model', the model_cr.h file -must be as follows: -@example -// CR headers for system model -#include "tank.c" -@end example - -@node Parameters, Causal bond graph (cbg), Constitutive Relationship (cr), Representations -@comment node-name, next, previous, up -@section Parameters -@cindex Parameters - -In general, lbl (@pxref{Labels (lbl)}) files contain symbolic -parameters. @strong{MTT} provides three ways of substituting for these -parameters: -@itemize @bullet -@item -symbolic substitution -@item -symbolic substitution for simplification of displayed equations -@item -numeric -@end itemize - -@menu -* Symbolic parameters (subs.r):: -* Symbolic parameters for simplification (simp.r):: -* Numeric parameters (numpar):: -@end menu - -@node Symbolic parameters (subs.r), Symbolic parameters for simplification (simp.r), Parameters, Parameters -@comment node-name, next, previous, up -@subsection Symbolic parameters (subs.r) -@cindex Symbolic parameters -@vindex subs.r -This file contains reduce statements to symbolically change the -expressions describing the system. -For example, a useful set of trig substitutions is: -@example -LET cos(~x)*cos(~y) = (cos(x+y)+cos(x-y))/2; -LET cos(~x)*sin(~y) = (sin(x+y)-sin(x-y))/2; -LET sin(~x)*sin(~y) = (cos(x-y)-cos(x+y))/2; -LET cos(~x)^2 = (1+cos(2*x))/2; -LET sin(~x)^2 = (1-cos(2*x)); -@end example - -@node Symbolic parameters for simplification (simp.r), Numeric parameters (numpar), Symbolic parameters (subs.r), Parameters -@comment node-name, next, previous, up -@subsection Symbolic parameters for simplification (simp.r) -@cindex Symbolic parameters for simplification -@vindex simp.r -This file contains reduce statements to symbolically change the -expressions describing the system. Unlike the subs.r file -(@pxref{Symbolic parameters (subs.r)}) it does not affect all system -transformations; only those converting to LaTeX form. - -@node Numeric parameters (numpar), , Symbolic parameters for simplification (simp.r), Parameters -@comment node-name, next, previous, up -@subsection Numeric parameters (numpar) -@cindex Numeric parameters - -When computing time and frequency responses; or when evaluating -functions in Octave (@pxref{Octave}); symbolic parameters need numerical -instantiations. - -The numpar representation provides the relevant @emph{numerical} -information. It comes in a number of languages: -@ftable @code -@item txt - a textual description of the parameter values -- this is the -defining representation (@pxref{Defining representations}). -@item m - readable by @code{octave} a high-level interactive language for numerical - computation -- translated by @strong{mtt} from the txt version. -@item c - readable by @code{gcc} a c compiler -- translated by @strong{mtt} from the txt version. - -@end ftable - -@menu -* Text form (numpar.txt):: -@end menu - -@node Text form (numpar.txt), , Numeric parameters (numpar), Numeric parameters (numpar) -@comment node-name, next, previous, up -@subsubsection Text form (numpar.txt) -@cindex Numeric parameters -This is the textual form of the numerical parameters representation -(@pxref{Numeric parameters (numpar)}). Lines are either -@ftable @code -@item assignment statements - variable = value -@item comments - lines beginning with # -@item commented assignment statements - variable = value # comments -@end ftable -An example file is: -@example -# Numerical parameter file (rc_numpar.txt) -# Generated by MTT at Mon Jun 16 15:10:17 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.32 2014/07/12 19:56:27 geraint -# %% Fixed style of NO WARRANTY from heading to strong because texi2html complained about having a heading in an enumerate environment -# %% -# %% Revision 1.31 2014/07/10 23:13:27 geraint -# %% Fixed mtt.texi missing arguments and subsection level -# %% -# %% Revision 1.30 2005/03/15 12:04:15 gawthrop -# %% New labg.fig rep - pretty LaTeX figures. -# %% -# %% Revision 1.29 2005/01/19 09:45:15 geraint -# %% Fixed whitespace. -# %% -# %% Revision 1.28 2005/01/06 16:03:55 geraint -# %% Updated options list. -# %% -# %% Revision 1.27 2005/01/06 14:42:33 geraint -# %% Fixed explicit/implicit descriptions of forward/backward Euler. -# %% Replaced -c examples with -cc. -# %% -# %% Revision 1.26 2005/01/06 12:28:36 geraint -# %% Minor typos. -# %% -# %% Revision 1.25 2004/08/27 20:12:34 geraint -# %% Added note about "none" as an option for units. -# %% -# %% Revision 1.24 2004/08/13 01:39:24 geraint -# %% Fixed variable names in diy makefile example (again) -# %% -# %% Revision 1.23 2004/08/11 08:24:28 geraint -# %% Replaced "gnuplot view" with "odeso gnuplot" in examples. -# %% -# %% Revision 1.21 2004/07/23 11:05:26 geraint -# %% Updated Reduce URL: http://www.reduce-algebra.com -# %% -# %% Revision 1.20 2003/10/23 18:14:43 geraint -# %% Added subsection with script for model-specific options. -# %% Fixed typo in url to mtt.sf.net. -# %% -# %% Revision 1.19 2003/10/10 22:22:18 geraint -# %% typo. -# %% -# %% Revision 1.18 2003/09/07 20:41:19 geraint -# %% *** empty log message *** -# %% -# %% Revision 1.17 2003/08/19 14:20:38 gawthrop -# %% Version 5.0 of MTT -# %% Remove xref errors (spurious spaces) -# %% -# %% Revision 1.16 2003/08/19 14:11:23 gawthrop -# %% Links to legal stuff -# %% -# %% Revision 1.15 2003/08/19 14:01:45 gawthrop -# %% Added legal appendices -# %% -# %% Revision 1.14 2003/08/06 14:50:56 gawthrop -# %% Describe the alias mechanism for invoking mtt options -# %% -# %% Revision 1.13 2002/12/13 10:07:07 gawthrop -# %% Added example in sh section of DIY reps -# %% -# %% Revision 1.12 2002/09/19 08:09:31 gawthrop -# %% Updated documentation documentation -# %% -# %% Revision 1.11 2002/08/20 15:51:17 gawthrop -# %% Update to work with ident DIY rep -# %% -# %% Revision 1.10 2002/07/22 10:45:22 geraint -# %% Fixed gnuplot rep so that it correctly re-runs the simulation if input files have changed. -# %% -# %% Revision 1.9 2002/07/05 13:29:34 geraint -# %% Added notes about generating dynamically linked functions for Octave and Matlab. -# %% -# %% Revision 1.8 2002/07/04 21:34:12 geraint -# %% Updated gnuplot view description to describe Tcl/Tk interface instead of obsolete txt method. -# %% -# %% Revision 1.7 2002/04/23 09:51:54 gawthrop -# %% Changed incorrect statement about searching for components. -# %% -# %% Revision 1.6 2001/10/15 14:29:50 gawthrop -# %% Added documentaton on [1:N] style port labels -# %% -# %% Revision 1.5 2001/07/23 03:35:29 geraint -# %% Updated file structure (mtt/bin). -# %% -# %% Revision 1.4 2001/07/23 03:25:02 geraint -# %% Added notes on -ae hybrd, rk4, ode2odes.cc, .oct dependencies. -# %% -# %% Revision 1.3 2001/07/13 03:02:38 geraint -# %% Added notes on #ICD, gnuplot.txt and odes.sg rep. -# %% -# %% Revision 1.2 2001/07/03 22:59:10 gawthrop -# %% Fixed problems with argument passing for CRs -# %% -# %% Revision 1.1 2001/06/04 08:18:52 gawthrop -# %% Putting documentation under CVS -# %% -# %% Revision 1.66 2000/12/05 14:20:55 peterg -# %% Added the c++ anf m CR info. -# %% -# %% Revision 1.65 2000/11/27 15:36:15 peterg -# %% NOPAR --> NOTPAR -# %% -# %% Revision 1.64 2000/11/16 14:22:48 peterg -# %% added UNITS declaration -# %% -# %% Revision 1.63 2000/11/03 14:41:08 peterg -# %% Added PAR and NOTPAR stuff -# %% -# %% Revision 1.62 2000/10/17 17:53:34 peterg -# %% Added some simulation details -# %% -# %% Revision 1.61 2000/09/14 17:13:06 peterg -# %% New options table -# %% -# %% Revision 1.60 2000/09/14 17:09:20 peterg -# %% Tidied up valid name sections -# %% Tidied up defining represnetations table -# %% Verion 4.6 -# %% -# %% Revision 1.59 2000/08/30 13:09:00 peterg -# %% Updated option table -# %% -# %% Revision 1.58 2000/08/01 13:30:19 peterg -# %% Version 4.4 -# %% updated STEPFACTOR info -# %% describes octave and OCST interfaces -# %% -# %% Revision 1.57 2000/07/20 07:55:44 peterg -# %% Version 4.3 -# %% -# %% Revision 1.56 2000/05/19 17:49:17 peterg -# %% Extended the user defined representation section -- new nppp rep. -# %% -# %% Revision 1.55 2000/03/16 13:53:31 peterg -# %% Correct date -# %% -# %% Revision 1.54 2000/03/15 21:22:57 peterg -# %% Updated to 4.1 -- old style SS no longer supported -# %% -# %% Revision 1.53 1999/12/22 05:33:10 peterg -# %% Updated for 4.0 -# %% -# %% Revision 1.52 1999/11/23 00:25:11 peterg -# %% Added the sensitivity reps -# %% -# %% Revision 1.51 1999/11/16 04:43:47 peterg -# %% Added start of sensitivity section -# %% -# %% Revision 1.50 1999/11/16 00:30:35 peterg -# %% Updated simulation section -# %% Added vector components -# %% -# %% Revision 1.49 1999/07/20 23:44:58 peterg -# %% V 3.8 -# %% -# %% Revision 1.48 1999/07/19 03:08:33 peterg -# %% Added documentation for (new) SS lbl fields -# %% -# %% Revision 1.47 1999/03/09 01:42:22 peterg -# %% Rearranged the User interface section -# %% -# %% Revision 1.46 1999/03/09 01:18:01 peterg -# %% Updated for 3.5 including xmtt -# %% -# %% Revision 1.45 1999/03/03 02:39:26 peterg -# %% Minor updates -# %% -# %% Revision 1.44 1999/02/17 06:52:14 peterg -# %% New level formula dor artwork -# %% -# %% Revision 1.43 1998/11/25 16:49:24 peterg -# %% Put in subs.r documentation (was called params.r) -# %% -# %% Revision 1.42 1998/11/24 12:24:59 peterg -# %% Added section on simulation output -# %% Version 3.4 -# %% -# %% Revision 1.41 1998/09/02 12:04:15 peterg -# %% Version 3.2 -# %% -# %% Revision 1.40 1998/08/27 08:36:39 peterg -# %% Removed in. methods except Euler anf implicit -# %% -# %% Revision 1.39 1998/08/18 10:44:28 peterg -# %% Typo -# %% -# %% Revision 1.38 1998/08/18 09:16:38 peterg -# %% Version 3.1 -# %% -# %% Revision 1.37 1998/08/17 16:14:30 peterg -# %% Version 3.1 - includes documentation on METHOD=IMPLICIT -# %% -# %% Revision 1.36 1998/07/30 17:33:15 peterg -# %% VERSION 3.0 -# %% -# %% Revision 1.35 1998/07/22 11:00:53 peterg -# %% Correct date! -# %% -# %% Revision 1.34 1998/07/22 11:00:13 peterg -# %% Version to BAe -# %% -# %% Revision 1.33 1998/07/17 19:32:19 peterg -# %% Added more about aliases -# %% -# %% Revision 1.32 1998/07/05 14:21:56 peterg -# %% Further additions (Carlisle-Glasgow) -# %% -# %% Revision 1.31 1998/07/04 11:35:57 peterg -# %% Strarted new lbl description -# %% -# %% Revision 1.30 1998/07/02 18:39:20 peterg -# %% Started 3.0 -# %% Added alias and default sections. -# %% -# %% Revision 1.29 1998/05/19 19:46:58 peterg -# %% Added the odess description -# %% -# %% Revision 1.28 1998/05/14 09:17:22 peterg -# %% Added METHOD variable to the simpar file -# %% -# %% Revision 1.27 1998/05/13 10:03:09 peterg -# %% Added unknown/zero SS label documentation. -# %% -# %% Revision 1.26 1998/04/29 15:12:46 peterg -# %% Version 2.9. -# %% -# %% Revision 1.25 1998/04/12 17:00:26 peterg -# %% Added new port features: coerced direction and top-level behaviour. -# %% -# %% Revision 1.24 1998/04/05 18:27:20 peterg -# %% This was the 2.6 version -# %% -# Revision 1.23 1997/08/24 11:17:51 peterg -# This is the released version 2.5 -# -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c = 1.0; # Default value -r = 1.0; # Default value -# Initial states -x(1) = 0.0; # Initial state for rc (c) -@end example -As usual, @strong{MTT} provides a default text file to be edited by the -user (@pxref{Text editors}). - -@node Causal bond graph (cbg), Elementary system equations, Parameters, Representations -@comment node-name, next, previous, up -@section Causal bond graph (cbg) -@cindex Causal bond graph (cbg) -The causal bond graph is the causally complete version of the -Acausal bond graph (@pxref{Acausal bond graph (abg)}). - -To create the causal bond graph of system `sys' in language fig type: -@example -mtt sys cbg fig -@end example -To create the causal bond graph of system `sys' in language m type: -@example -mtt sys cbg m -@end example -To view the causal bond graph of system `sys' type: -@example -mtt sys cbg view -@end example - -@menu -* Language fig (cbg.fig):: -* Language m (cbg.m):: -@end menu - -@node Language fig (cbg.fig), Language m (cbg.m), Causal bond graph (cbg), Causal bond graph (cbg) -@subsection Language fig (cbg.fig) -@cindex Language fig (cbg.fig) -@pindex Language fig (cbg.fig) -The fig file is created by @strong{MTT}. It is identical to the -corresponding acausal representation (@pxref{Language fig (abg.fig)}) -except that -@itemize @bullet -@item -the new causal strokes are added (using a double thickness line in blue) -@item -components that are undercausal are bold and green -@item -components that are overcausal are bold and red -@end itemize - -@node Language m (cbg.m), , Language fig (cbg.fig), Causal bond graph (cbg) -@comment node-name, next, previous, up -@subsection Language m (cbg.m) -@cindex Language m (cbg.m) -@cindex cbonds -@cindex status - - -The causal bond graph of system `sys' is represented as - an m file with heading: -@example -function [cbonds,status] = sys_cbg -@end example -The two outputs of this function are: -@itemize @bullet -@item -cbonds -@item -status -@end itemize - -@emph{cbonds} is a matrix with -@itemize @bullet -@item -one row for each bond -@item -the first column contains the arrow-orientated -(@pxref{Arrow-orientated causality}) -causality of the @emph{effort} variable. -@item -the second column contains the arrow-orientated -(@pxref{Arrow-orientated causality}) -causality of the @emph{flow} variable. -@end itemize - -@emph{status} is a matrix with -@itemize @bullet -@item -one row for each component -@item -the first column contains 1 if the component is overcausal; 0 if the -component is causally complete and -1 if the component is undercausal. -@end itemize -A successful model would therefore have all zeros in the status matrix. - -@menu -* Transformation abg2cbg_m:: -@end menu - -@node Transformation abg2cbg_m, , Language m (cbg.m), Language m (cbg.m) -@comment node-name, next, previous, up -@subsubsection Transformation abg2cbg_m -@cindex Transformation abg2cbg_m - -This transformation takes the acausal bond graph as an m file -(@pxref{Language m (abg.m)}) and transforms it into a causal bond graph in -m-file format (@pxref{Language m (cbg.m)}). - -It is based on the m-function abg2cbg.m which iteratively tries to -complete causality whilst recursively searching the bond graph -structure. -If causality is incomplete, it picks the first acausal dynamic (C or I) -component, asserts integral causality, and tries again. - -This is essentially the sequential causality assignment procedure of -Karnopp and Rosenberg. - -The transformation informs the user of the final status in terms of the -percentage of causally complete components; a successful model will -yield 100% here. - -@node Elementary system equations, Differential-Algebraic Equations, Causal bond graph (cbg), Representations -@comment node-name, next, previous, up -@section Elementary system equations (ese) -@cindex Elementary system equations - -The elementary system equations are a complete set of assignment statements -describing the dynamic system corresponding to the bond graph. -They are in the Reduce (@pxref{Reduce}) language. - -Because these are based on a causally complete system, these assignment -statements are directly soluble by substitution. - -Unlike early versions of @strong{MTT}, @strong{MTT} does @emph{not} sort -the equations in order of solution, but rather leaves them sorted by -component and subsystem. - -These are not supposed to be read by the user, so there is no view -facility as such. However, you may read these with your favourite text -editor and, to this end, helpful comment lines have been added. - -Wherever components have an explicit constitutive relationship, the -corresponding RHS of the equation has a standard form. - -@example -cr(arguments,out_causality,outport, - input_1, causality_1, port_1, - .... - input_i, causality_i, port_i, - .... - input_n, causality_n, port_n - ); -@end example -where the symbols have the following meaning -@vtable @code -@item arguments - the constitutive relationship arguments -@item out_causality - the causality (effort or flow) of the output variable - (@pxref{Variables}) -@item outport - the number (integer) of the output port of the system -@item input_i - the ith input to the component -@item causality_i - the causality (effort or flow) of the ith input variable - (@pxref{Variables}) -@item port_i - the number (integer) of the ith input port of the system -@end vtable - -An example for a resistor with linear constitutive relationship is: -@example -rc_1_bond4_flow := lin(flow,r,flow,1, - rc_1_bond4_effort,effort,1 - ); -@end example - -@menu -* Transformation cbg2ese_m2r:: -@end menu - -@node Transformation cbg2ese_m2r, , Elementary system equations, Elementary system equations -@comment node-name, next, previous, up -@subsection Transformation cbg2ese_m2r -@cindex Transformation cbg2ese_m2r -@cindex Structure -@cindex def.r -This transformation takes the causal bond graph as an m file -(@pxref{Language m (cbg.m)}) and transforms it into elementary system -equations -in Reduce (@pxref{Reduce}) -form. - -It is based on the m-function cbg2ese.m which iteratively traverses the -causal bond graph writing equations as it goes. - -It also writes out the system structure as the file @file{sys_def.r}. - - -@node Differential-Algebraic Equations, Constrained-state Equations, Elementary system equations, Representations -@section Differential-Algebraic Equations (dae) -@cindex Differential-Algebraic Equations -@cindex DAE - -The system differential algebraic equations describe the system dynamics together -together with any algebraic constraints. - -They are generated in language @code{lang} for system -@code{sys} by: -@example -mtt sys dae lang -@end example -Valid languages are: -@vtable @code -@item r - reduce (@pxref{Reduce}). -@item m - m (@pxref{m}). -@item view - reduce (@pxref{Views}). -@end vtable - - -There are five sets of variables describing the system: -@vtable @code -@item x - the system states (corresponding to C and I components with integral - causality. -@item z - the system nonstates (corresponding to C and I components with derivative - causality. -@item u - the system inputs (corresponding to SS components - with external attribute). -@item ui - the @emph{internal} system inputs (corresponding to SS components - with internal attribute) used to solve algebraic loops - (@pxref{Algebraic loops}). -@item y - the system outputs (corresponding to SS components - with external attribute). - @end vtable - -In general there are four sets of equations. The right-hand side of - each is a function of x, dz/dt, u and ui and the left hand sides are: -@enumerate -@item -the derivative of x (dx/dt) -@item -z -@item -w=0 (the algebraic equations) -@item -y -@end enumerate - -@menu -* Differential-Algebraic Equations (reduce):: -* Differential-Algebraic Equations (m):: -@end menu - -@node Differential-Algebraic Equations (reduce), Differential-Algebraic Equations (m), Differential-Algebraic Equations, Differential-Algebraic Equations -@subsection Language reduce (dae.r) -@cindex Differential-Algebraic Equations (reduce) -@cindex dae.r - -The system DAEs (@pxref{Differential-Algebraic Equations}) -are represented in the reduce (@pxref{Reduce}) language as -arrays containing the algebraic expressions for the -right hand sides of each set of equations. The arrays are: -@vtable @code -@item MTTx - x -- the system states (corresponding to C and I components with integral - causality. - -@item MTTz - z -- the system nonstates (corresponding to C and I components with derivative - causality. -@item MTTu - u -- the system inputs (corresponding to SS components - with external attribute). -@item mttv - ui -- the @emph{internal} system inputs (corresponding to SS components - with internal attribute) used to solve algebraic loops - (@pxref{Algebraic loops}). -@item MTTy - y -- the system outputs (corresponding to SS components - with external attribute). - @end vtable - -@menu -* Transformation ese2dae_r:: -@end menu - -@node Transformation ese2dae_r, , Differential-Algebraic Equations (reduce), Differential-Algebraic Equations (reduce) -@subsubsection Transformation ese2dae_r -@cindex Transformation ese2dae_r -@pindex ese2dae_r - -This transformation (@pxref{What is a Transformation?}) -uses Reduce (@pxref{Reduce}) to combine the elementary system -equations (@pxref{Elementary system equations}) with the -constitutive relationships (@pxref{Constitutive relationship}) -and simplify the result. - -@node Differential-Algebraic Equations (m), , Differential-Algebraic Equations (reduce), Differential-Algebraic Equations -@subsection Language m (dae.m) -@cindex Differential-Algebraic Equations (m) -@cindex dae.m -The system DAEs (@pxref{Differential-Algebraic Equations}) -are represented in the m (@pxref{m}) language as -two m-functions of the form: - -@example -function resid = sys_dae(dx,x,t) -function y = sys_dae(dx,x,t) -@end example -Where x is the dae @emph{descriptor} vector and dx its -time derivative; t is the time. -The first function is of a form suitable for solution by DASSL; -the second function can then be used to find the coresponding system -output. - -@menu -* Transformation dae_r2m:: -@end menu - -@node Transformation dae_r2m, , Differential-Algebraic Equations (m), Differential-Algebraic Equations (m) -@subsubsection Transformation dae_r2m -@cindex Transformation dae_r2m -@pindex dae_r2m - -This transformation (@pxref{What is a Transformation?}) -uses Reduce (@pxref{Reduce}) to rewrite the elementary system -equations (@pxref{Elementary system equations}) in m-file -format (@pxref{m}) . Numerical parameters are declared as global. - - -@node Constrained-state Equations, Ordinary Differential Equations, Differential-Algebraic Equations, Representations -@section Constrained-state Equations (cse) -@cindex Constrained-state Equations -@cindex ODE - -The system constrained-state equations describe the system dynamics for -a special class of systems (see the book for details). The resuting -equations are of the form: -@example -E(x) dx/dt = f(x,u) -y = g(x,u) -@end example -They typically occure where two or more states are constrained to be equal, or -proportional, to each other. For example, two capacitors in parallel or -two inertias connected by a stiff shaft. - - -They are generated in language @code{lang} for system -@code{sys} by: -@example -mtt sys cse lang -@end example -Valid languages are: -@vtable @code -@item r - reduce (@pxref{Reduce}). -@item m - m (@pxref{m}). -@item view - reduce (@pxref{Views}). -@end vtable - -There are three sets of variables describing the system: -@vtable @code -@item x - the system states (corresponding to C and I components with integral - causality. -@item u - the system inputs (corresponding to SS components - with external attribute). -@item y - the system outputs (corresponding to SS components - with external attribute). - @end vtable - -In general there are two sets of equations. The right-hand side of - each is a function of x and u and the left hand sides are: -@enumerate -@item -the derivative of x (dx/dt) -y -@end enumerate - -@menu -* Constrained-state Equations (reduce):: -* Constrained-state Equations (view):: -@end menu - -@node Constrained-state Equations (reduce), Constrained-state Equations (view), Constrained-state Equations, Constrained-state Equations -@subsection Language reduce (cse.r) -@cindex Constrained-state Equations (reduce) -@cindex cse.r - -The system CSEs (@pxref{Constrained-state Equations}) -are represented in the reduce (@pxref{Reduce}) language as -arrays containing the algebraic expressions for the -right hand sides of each set of equations. The arrays are: -@vtable @code -@item MTTx - x -- the system states (corresponding to C and I components with integral - causality. -@item MTTu - u -- the system inputs (corresponding to SS components - with external attribute). -@item MTTy - y -- the system outputs (corresponding to SS components - with external attribute). -@end vtable -together with the array containing the elements of the E matrix. -@menu -* Transformation dae2cse_r:: -@end menu - -@node Transformation dae2cse_r, , Constrained-state Equations (reduce), Constrained-state Equations (reduce) -@subsubsection Transformation dae2cse_r -@cindex Transformation dae2cse_r -@pindex dae2cse_r - -This transformation (@pxref{What is a Transformation?}) -Reduce (@pxref{Reduce}) to find various Jacobians which are combined to -find the E matrix and the -constrained-state equations (@pxref{Constrained-state Equations}). - -@node Constrained-state Equations (view), , Constrained-state Equations (reduce), Constrained-state Equations -@subsection Language m (view) -@cindex Constrained-state Equations (view) -@cindex view Constrained-state Equations -This representation has the standard text view -(@pxref{Views}). - -@node Ordinary Differential Equations, Descriptor matrices, Constrained-state Equations, Representations -@section Ordinary Differential Equations -@cindex Ordinary Differential Equations -@cindex ODE - -The system ordinary differential equations describe the system dynamics. - -They are generated in language @code{lang} for system -@code{sys} by: -@example -mtt sys ode lang -@end example -Valid languages are: -@vtable @code -@item r - reduce (@pxref{Reduce}). -@item m - m (@pxref{m}). -@item view - reduce (@pxref{Views}). -@end vtable - -There are three sets of variables describing the system: -@vtable @code -@item x - the system states (corresponding to C and I components with integral - causality. -@item u - the system inputs (corresponding to SS components - with external attribute). -@item y - the system outputs (corresponding to SS components - with external attribute). - @end vtable - -In general there are two sets of equations. The right-hand side of - each is a function of x and u and the left hand sides are: -@enumerate -@item -the derivative of x (dx/dt) -y -@end enumerate - -@menu -* Ordinary Differential Equations (reduce):: -* Ordinary Differential Equations (m):: -* Ordinary Differential Equations (view):: -@end menu - -@node Ordinary Differential Equations (reduce), Ordinary Differential Equations (m), Ordinary Differential Equations, Ordinary Differential Equations -@subsection Language reduce (ode.r) -@cindex Ordinary Differential Equations (reduce) -@cindex ode.r - -The system ODEs (@pxref{Ordinary Differential Equations}) -are represented in the reduce (@pxref{Reduce}) language as -arrays containing the algebraic expressions for the -right hand sides of each set of equations. The arrays are: -@vtable @code -@item MTTx - x -- the system states (corresponding to C and I components with integral - causality. -@item MTTu - u -- the system inputs (corresponding to SS components - with external attribute). -@item MTTy - y -- the system outputs (corresponding to SS components - with external attribute). - @end vtable - -@menu -* Transformation cse2ode_r:: -@end menu - -@node Transformation cse2ode_r, , Ordinary Differential Equations (reduce), Ordinary Differential Equations (reduce) -@subsubsection Transformation cse2ode_r -@cindex Transformation cse2ode_r -@pindex cse2ode_r - -This transformation (@pxref{What is a Transformation?}) -uses Reduce (@pxref{Reduce}) to invert the E matrix of the -constrained-state equations (@pxref{Constrained-state Equations}) -and simplify the result. - -@node Ordinary Differential Equations (m), Ordinary Differential Equations (view), Ordinary Differential Equations (reduce), Ordinary Differential Equations -@subsection Language m (ode.m) -@cindex Ordinary Differential Equations (m) -@cindex ode.m -The system ODEs (@pxref{Ordinary Differential Equations}) -are represented in the m (@pxref{m}) language as -two m-functions of the form: - -@example -function dx = sys_ODE(x,t) -function y = sys_ODE(dx,x,t) -@end example -Where x is the ODE @emph{state} vector and dx its -time derivative; t is the time. -The first function is of a form suitable for solution by odesol; -the second function can then be used to find the corresponding system -output. - -@menu -* Transformation ode_r2m:: -@end menu - -@node Transformation ode_r2m, , Ordinary Differential Equations (m), Ordinary Differential Equations (m) -@subsubsection Transformation ode_r2m -@cindex Transformation ode_r2m -@pindex ode_r2m - -This transformation (@pxref{What is a Transformation?}) -uses Reduce (@pxref{Reduce}) to rewrite the -ordinary differential equations -(@pxref{Ordinary Differential Equations}) in m-file -format (@pxref{m}) . Numerical parameters are declared as global. - -@node Ordinary Differential Equations (view), , Ordinary Differential Equations (m), Ordinary Differential Equations -@subsection Language m (view) -@cindex Ordinary Differential Equations (view) -@cindex view Ordinary Differential Equations -This representation has the standard text view -(@pxref{Views}). - -@node Descriptor matrices, Report, Ordinary Differential Equations, Representations -@section Descriptor matrices (dm) -@cindex Descriptor matrices -@cindex dm - -The system descriptor matrices A, B, C, D and E describe the -@emph{linearised} system dynamics in the form -@example -E dx/dt = Ax + Bu -y = Cx + Du -@end example - -They are generated in language @code{lang} for system -@code{sys} by: -@example -mtt sys dm lang -@end example -Valid languages are: -@vtable @code -@item r - reduce (@pxref{Reduce}). -@item m - m (@pxref{m}). -@item view - reduce (@pxref{Views}). -@end vtable - - -@menu -* Descriptor matrices (reduce):: -* Descriptor matrices (m):: -@end menu - -@node Descriptor matrices (reduce), Descriptor matrices (m), Descriptor matrices, Descriptor matrices -@subsection Language reduce (dm.r) -@cindex Descriptor matrices (reduce) -@cindex dm.r - -The system descriptor matrices (@pxref{Descriptor matrices}) -are represented in the reduce (@pxref{Reduce}) language as -arrays containing the four matrices. The arrays are: -@vtable @code -@item MTTA - A -@item MTTB - B -@item MTTA - C -@item MTTD - D -@item MTTE - E -@end vtable - -@node Descriptor matrices (m), , Descriptor matrices (reduce), Descriptor matrices -@subsection Language m (dm.m) -@cindex Descriptor matrices (m) -@cindex dm.m -The system descriptor matrices (@pxref{Descriptor matrices}) -are represented in the m (@pxref{m}) language as -an m-function of the form: - -@example -function [A,B,C,D,E] = sys_dm -@end example - -System numeric parameters (@pxref{Numeric parameters}) -are passed via global variables defined in the _numpar.m file. -@c (@pxref{numpar.m}). -Thus the system descriptor matrices are -typically generated in Octave (@pxref{Octave}) as follows: - -@example -sys_numpar -[A,B,C,D,E] = sys_dm -@end example - -Parameters can be changed from their default values by entering -their values directly into Octave (@pxref{Octave}) and then invoking -@code{sys_dm}; for example -@example -sys_numpar -par_1 = 25 -par_2 = par_1 + 3 -[A,B,C,D,E] = sys_dm -@end example - - -@node Report, , Descriptor matrices, Representations -@section Report (rep) -@cindex Report -@cindex rep - -@strong{MTT} has a report-generator feature. The user specifies the -report contents in a text file (@pxref{Report (text)}) using an -appropriate text editor (@pxref{Text editors}). - -For example, the report can be viewed by typing -@example -mtt system rep view -@end example - - -@menu -* Report (text):: -* Report (view):: -@end menu - -@node Report (text), Report (view), Report, Report -@subsection Language text (rep.txt) -@cindex Report (text) -@cindex rep.txt - -The user specifies the report contents in a text file (@pxref{Report -(text)}) using an appropriate text editor (@pxref{Text editors}). -The text file contains lines which are either comments (indicated by %) -or valid @strong{MTT} commands. The report will then contain appropriate -sections. The following languages are supported by the report generator: -@ftable @code -@item m - @code{octave} a high-level interactive language for numerical - computation. -@item r - @code{reduce} a high-level interactive language for symbolic - computation. -@item tex - @code{latex} a text processor. -@item ps - @code{ghostview} another document viewer. -@item c - @code{gcc} a c compiler. -@end ftable -For example: -@example -mtt rc abg tex -mtt rc cbg ps -mtt rc struc tex -mtt rc ode tex -mtt rc sro ps -mtt rc tf tex -mtt rc lmfr ps -@end example - -The acausal bond graph (abg) (@pxref{Acausal bond graph (abg)}) with the -tex language is handled in a special way: the acausal Bond Graph in -fig format (@pxref{Language fig (abg.fig)}), the label file (@pxref{Labels (lbl)}) -the description file (@pxref{Detailed}), together with -corresponding subsystems are included in the report. It is recommended -that the first (non-comment line) in the file should be: -@example -mtt abg tex -@end example -where @code{} is the name of the (top-level) system. - -As usual, @strong{MTT} provides a default text file to be edited by the -user (@pxref{Text editors}). - -In the special case that the first argument to mtt (normally the system) -is a directory, a default text file is provided which generates a report -for all systems to be found in that directory tree. - -@node Report (view), , Report (text), Report -@subsection Language view -@cindex Report (view) -@cindex view Report -This representation has the standard text view -(@pxref{Views}). - -@node Extending MTT, Documentation, Representations, Top -@comment node-name, next, previous, up -@chapter Extending MTT -@cindex Extending MTT -@cindex Make - -@strong{MTT} has a number of built-in mechanisms for the user to extend -its capabilities. As @strong{MTT} is based on `Make' it is unsurprising -that some of these involve the creation of `make files'. - -@menu -* Makefiles:: -* New (DIY) representations:: -* Component library:: -@end menu - -@node Makefiles, New (DIY) representations, Extending MTT, Extending MTT -@comment node-name, next, previous, up -@section Makefiles -@cindex Makefiles - -If a file called `Makefile' exists in the current directory, -@strong{MTT} executes it using make before doing anything else. This is -useful if one of the .txt files contains a reference to, for example, an -octave function of which @strong{MTT} unaware. Such a function can be -created using the makefile. An example `Makefile' is -@example -# Makefile for the Two link GMV example - -all: msdP_tf.m TwoLinkP_obs.m TwoLinkP_sm.m twolinkp_sm.m TwoLinkGMV_numpar.m - -msdP_tf.m: msdP_abg.fig - mtt -q msdP tf m - -TwoLinkP_obs.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt - mtt -q TwoLinkP obs m - -TwoLinkP_sm.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt - mtt -q TwoLinkP sm m - -twolinkp_sm.m: TwoLinkP_sm.m - cp -v TwoLinkP_sm.m twolinkp_sm.m - -TwoLinkGMV_numpar.m: TwoLinkGMV_numpar.txt - mtt -q TwoLinkGMV numpar m -@end example -All of the files in the line stating `all:' are created when -@strong{MTT} is executed (if they don't already exist). - -@node New (DIY) representations, Component library, Makefiles, Extending MTT -@comment node-name, next, previous, up -@section New (DIY) representations -@cindex New representations -@cindex DIY representations - -It may be convenient to create new representations for @strong{MTT}; in -particular, it is nice to be able to include the result of some -numerical or symbolic computations within an @strong{MTT} report -(@pxref{Report}). Therefore @strong{MTT} provides a mechanism for doing -this. - -Future extensions of @strong{MTT} will use such representations stored -in $MTT_REP. - -There are three parts to creating a DIY representation called myrep -@enumerate -@item Creating a make file in Make format called myrep_rep.make -@item Optionally creating a shell script called myrep_rep.sh -@item Optionally creating a documentation file in LaTeX format called myrep_rep.tex -@end enumerate - -@menu -* Makefile (DIY representations):: -* Shell-script (DIY representations):: -* Documentation (DIY representations):: -@end menu - -@node Makefile (DIY representations), Shell-script (DIY representations), New (DIY) representations, New (DIY) representations -@comment node-name, next, previous, up -@subsection Makefile -@cindex New representations -@cindex DIY representations -@cindex Makefile - -To create a new representation `myrep' in a language `mylang', create a -file with the name -@example -myrep_rep.make -@end example -This file must contain text in `make' syntax. It is executed by -@strong{MTT} and the two arguments `SYS' (the system name) and `LANG' -(the language) are passed to it by @strong{MTT}. Note that @strong{MTT} -cannot know of any prerequisites, but these can be explicitly included in -the makefile (which may include execution of @strong{MTT} itself. - -The following example declares the new representation `ident' which is -created in conjunction with the shell-script ident_rep.sh (@pxref{Shell-script (DIY -representations)}). - -@verbatim -# -*-makefile-*- - -#SUMMARY Identification -#DESCRIPTION Partially know system identification using -#DESCRIPTION using bond graphs - -# Makefile for representation ident -# File ident_rep.make - -#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop - -## Model targets -model_reps = ${MTT_SYS}_sympar.m ${MTT_SYS}_simpar.m ${MTT_SYS}_state.m -model_reps += ${MTT_SYS}_numpar.m ${MTT_SYS}_input.m ${MTT_SYS}_ode2odes.m -model_reps += ${MTT_SYS}_def.m - -## Prepend s to get the sensitivity targets -sensitivity_reps = ${model_reps:%=s%} - -## Model prerequisites -model_pre = ${MTT_SYS}_abg.fig ${MTT_SYS}_lbl.txt -model_pre += ${MTT_SYS}_rdae.r ${MTT_SYS}_numpar.txt - -## Prepend s to get the sensitivity targets -sensitivity_pre = ${model_pre:%=s%} - - -## Simulation targets -sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m - -## m-files needed for ident -ident_m = ${MTT_SYS}_ident.m ${MTT_SYS}_ident_numpar.m - -## Targets for the ident simulation -ident_reps = ${ident_m} ${sims} ${model_reps} ${sensitivity_reps} - -## ps output files etc -psfiles = ${MTT_SYS}_ident.ps ${MTT_SYS}_ident.comparison.ps -figfiles = ${psfiles:%.ps=%.fig} -gdatfiles = ${psfiles:%.ps=%.gdat} -datfiles = ${psfiles:%.ps=%.dat2} - -## LaTeX files etc -latexfiles = ${MTT_SYS}_ident_par.tex - -all: ${MTT_SYS}_ident.${MTT_LANG} - -echo: - echo "sims: ${sims}" - echo "model_reps: ${model_reps}" - echo "sensitivity_reps: ${sensitivity_reps}" - echo "ident_reps: ${ident_reps}" - -${MTT_SYS}_ident.view: ${psfiles} - ident_rep.sh ${MTT_SYS} view - -${psfiles}: ${figfiles} - ident_rep.sh ${MTT_SYS} ps - -${figfiles}: ${gdatfiles} - ident_rep.sh ${MTT_SYS} fig - -${gdatfiles}: ${datfiles} - ident_rep.sh ${MTT_SYS} gdat - -${datfiles} ${latexfiles}: ${ident_reps} - ident_rep.sh ${MTT_SYS} dat2 - -${MTT_SYS}_ident.m: - ident_rep.sh ${MTT_SYS} m - -${MTT_SYS}_ident_numpar.m: - ident_rep.sh ${MTT_SYS} numpar.m - -## System model reps -## Generic txt files -${MTT_SYS}_%.txt: - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt - -## Specific m files -${MTT_SYS}_ode2odes.m: ${model_pre} - mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m - -${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m - -## Numpar files -${MTT_SYS}_numpar.m: - mtt ${MTT_SYS} numpar m - -## Sympar files -${MTT_SYS}_sympar.m: - mtt ${MTT_SYS} sympar m - -## Generic txt to m -${MTT_SYS}_%.m: ${MTT_SYS}_%.txt - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m - -## r files -${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r - -${MTT_SYS}_rdae.r: - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r - -## Sensitivity model reps -## Generic txt files -s${MTT_SYS}_%.txt: - mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} $* txt - -## Specific m files -## Numpar files -s${MTT_SYS}_numpar.m: - mtt -s s${MTT_SYS} numpar m - -## Sympar files -s${MTT_SYS}_sympar.m: - mtt -s s${MTT_SYS} sympar m - -s${MTT_SYS}_ode2odes.m: ${sensitivity_pre} - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ode2odes m - -s${MTT_SYS}_ssim.m: - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ssim m - -s${MTT_SYS}_def.m: - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} def m - - -## Generic txt to m -s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt - mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m - -## r files -s${MTT_SYS}_rdae.r: - mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r - -@end verbatim - -@node Shell-script (DIY representations), Documentation (DIY representations), Makefile (DIY representations), New (DIY) representations -@comment node-name, next, previous, up -@subsection Shell-script -@cindex New representations -@cindex DIY representations -@cindex Shell-script - -For more complex DIY representations, it is convenient to define new -commands to be used by the Makefile (@pxref{Makefile (DIY -representations)}). - -The following example shows this in the context of the DIY -representation `ident' used as an example in the previous section -(@pxref{Makefile (DIY representations)}). - - -@verbatim -#! /bin/sh - -## ident_rep.sh -## DIY representation "ident" for mtt -# Copyright (C) 2002 by Peter J. Gawthrop - -ps=ps - -sys=$1 -rep=ident -lang=$2 -mtt_parameters=$3 -rep_parameters=$4 - -## Some names -target=${sys}_${rep}.${lang} -def_file=${sys}_def.r -dat2_file=${sys}_ident.dat2 -dat2s_file=${sys}_idents.dat2 -ident_numpar_file=${sys}_ident_numpar.m -option_file=${sys}_ident_mtt_options.txt - -## Get system information -if [ -f "${def_file}" ]; then - echo Using ${def_file} -else - mtt -q ${sys} def r -fi - -ny=`mtt_getsize $1 y` -nu=`mtt_getsize $1 u` - -check_new_options() { - if [ -f "${option_file}" ]; then - old_options=`cat ${option_file}` - if [ "${mtt_options}" != "${old_options}" ]; then - echo ${mtt_options} > ${option_file} - fi - else - echo ${mtt_options} > ${option_file} - fi -} - -## Make the _ident.m file -make_ident() { -filename=${sys}_${rep}.m -date=`date` -echo Creating ${filename} - -cat > ${filename} < ${sys}_ident_numpar.m <0) - par = ${sys}_numpar(); - x_0 = ${sys}_state(par); - dt = t(2)-t(1); - simpars.dt = dt; - simpars.last = t(length(t)); - y = ${sys}_sim(zeros(n_x,1), par, simpars, u); - endif - - ## Default parameter names - Put in your own here - sympar = ${sys}_sympar; # Symbolic params as structure - par_names = struct_elements (sympar); # Symbolic params as strings - [n,m] = size(par_names); # Size the string list - - ## Sort by index - for [i,name] = sympar - par_names(i,:) = sprintf("%s%s",name, blanks(m-length(name))); - endfor - - ## Output weighting vector - Q = ones(n_y,1); - - ## Extra parameters - extras.criterion = 1e-5; - extras.emulate_timing = 0; - extras.max_iterations = 10; - extras.simulate = simulate; - extras.v = 1e-2; - extras.verbose = 1; - extras.visual = 1; - -endfunction -EOF -} - -make_dat2() { - -## Inform user -echo Creating ${dat2_file} - -## Use octave to generate the data -octave -q < mtt_junk -sed -e "s/_\([a-z0-9,]*\)/_{\1}/g" < mtt_junk >${sys}_ident_par.tex -rm mtt_junk -} - -case ${lang} in - numpar.m) - ## Make the numpar stuff - make_ident_numpar; - ;; - m) - ## Make the code - make_ident; - ;; - dat2) - ## The dat2 language (output data) & fig file - make_dat2; - ;; - gdat) - cp ${dat2_file} ${dat2s_file} - dat22dat ${sys} ${rep} - dat2gdat ${sys} ${rep} - ;; - fig) - gdat2fig ${sys}_${rep} - ;; - ps) - figs=`ls ${sys}_ident*.fig | sed -e 's/\.fig//'` - for fig in ${figs}; do - fig2dev -Leps ${fig}.fig > ${fig}.ps - done - texs=`ls ${sys}_ident*.tex | sed -e 's/\.tex//'` - for tex in ${texs}; do - makedoc "" "${sys}" "ident_par" "tex" "" "" "$ps" - doc2$ps ${sys}_ident_par "$documenttype" - done - ;; - view) - pss=`ls ${sys}_ident*.ps` - echo Viewing ${pss} - for ps in ${pss}; do - gv ${ps}& - done - ;; - *) - echo Language ${lang} not supported by ${rep} representation - exit 3 -esac - - - -@end verbatim - -@node Documentation (DIY representations), , Shell-script (DIY representations), New (DIY) representations -@comment node-name, next, previous, up -@subsection Documentation -@cindex New representations -@cindex DIY representations -@cindex Documentation - - -@node Component library, , New (DIY) representations, Extending MTT -@comment node-name, next, previous, up -@section Component library -@cindex Component library -@cindex component -@cindex Component library - -If @strong{MTT} does not recognise a component (eg named MyComponent) as -a simple component (@pxref{Simple components}) or as already existing, -it searches the library search path $MTT_COMPONENTS -(@pxref{$MTT_COMPONENTS}) for a directory called MyComponent containing -MyComponent_lbl.txt. It then copies the @emph{entire} directory into the -current working directory. Thus, for example, the directory could -contain MyComponent_desc.tex MyComponent_abg.fig MyComponent_lbl.txt and MyComponent_cr.r in -addition to MyComponent_lbl.txt. - -@c node next prev up -@node Documentation, Languages, Extending MTT, Top -@chapter Documentation -@cindex Documentation - -@menu -* Manual (Documentation):: -* On-line documentation:: -@end menu - -@node Manual (Documentation), On-line documentation, Documentation, Documentation -@section Manual -@cindex Manual - -MTT is documented in this manual. The manual can be invoked in various -ways: - -@vtable @code -@item mtt manual - Brings up a pdf version of the manual -@item mtt info - Brings up an xterm containing an info version of the manual -@item mtt hinfo - Brings up an html browser containing the manual -@item emacs - type ^h^i followed by mmtt in the command window -@item browser - point browser to http://mtt.sf.net -@end vtable - -@node On-line documentation, , Manual (Documentation), Documentation -@section On-line documentation -@cindex Components -@cindex Examples -@cindex Documentation -@cindex On-line documentation - -@strong{MTT} components, constitutive relations, examples and representations in libraries -(@pxref{Component library}) are documented in two ways: - -@enumerate -@item brief -@item verbose -@end enumerate - -@menu -* Brief:: -* Detailed:: -@end menu - -@node Brief, Detailed, On-line documentation, On-line documentation -@subsection Brief on-line documentation -@cindex Brief documentation - -Documentation of DIY components, examples, constitutive relationships -and representations is provides by the programmer by inserting code of -the form - -@example -#SUMMARY One line summary -#DESCRIPTION Multi-line -#DESCRIPTION More detailed description -@end example - -within the appropriate file (usually at or near the top): -@vtable @code -@item components - _lbl.txt (@pxref{Labels (lbl)}) -@item examples - _lbl.txt (@pxref{Labels (lbl)}) -@item constitutive relations - _cr.r (@pxref{DIY constitutive relationships}) -@item representations - _rep.make (@pxref{Makefile (DIY representations)}) -@end vtable - -This documentation is accessed by the user in various ways -@vtable @code -@item mtt help name - prints basic information on the screen -@item mtt system lbl view - gives formatted information about the component or example -@item Including mtt system abg tex in the _rep.txt file - gives formatted information about the component or example - within the report -@end vtable - -@node Detailed, , Brief, On-line documentation -@subsection Detailed on-line documentation -@cindex Detailed documentation -@cindex Description -@cindex desc - -DIY components, examples, constitutive relationships can be described -textually in LaTeX (.tex) description file; this is the only language -for this representation. This representation is used by the LaTeX -language version (@pxref{Language tex (abg.tex)}) of the acausal bond -graph representation (@pxref{Acausal bond graph (abg)}). - -The file may contain any LaTeX commands -valis for the ``article'' document type but must @strong{not} contain: -@itemize @bullet -@item documentclass commands -@item document environments -@end itemize - -@c node next prev up -@node Languages, Language tools, Documentation, Top -@chapter Languages -@cindex Languages -@pindex Languages - - -@c node next prev up -@menu -* Fig:: r -* m:: -* Reduce:: -* c:: -@end menu - -These are a number of languages used by @strong{MTT} to implement the -various representations. -Each has associated Language tools (@pxref{Language tools}) to -manipulate and/or view the representation. - -@ftable @code -@item fig - @code{Fig} a graphical description language. -@item m - @code{octave} a high-level interactive language for numerical - computation. -@item r - @code{reduce} a high-level interactive language for symbolic - computation. -@item tex - @code{latex} a text processor. -@item dvi - @code{xdvi} a document viewer. -@item ps - @code{ghostview} another document viewer. -@item gdat - @code{gnuplot} a data viewer. -@item c - @code{gcc} a c compiler. -@item sg - @code{scigraphica} a plotting package. -@end ftable - -These tools are automatically invoked as appropriate by @strong{MTT}; -but for more advanced use, these tools can be used directly on files -(with the appropriate suffix) generated by @strong{MTT}. - - - -@node Fig, m, Languages, Languages -@section Fig -@cindex Fig -@pindex Fig -Please see xfig documentation. - -@node m, Reduce, Fig, Languages -@section m -@cindex m -@pindex m -Please see Octave documentation -@ifhtml -Octave documentation. -Matlab documentation. -@end ifhtml - - -@node Reduce, c, m, Languages -@section Reduce -@cindex Reduce -@pindex Reduce -Please see the reduce documentation. - -@node c, , Reduce, Languages -@comment node-name, next, previous, up -@section c -@cindex c -@pindex c -Please see the gcc documentation. -@node Language tools, Administration, Languages, Top -@comment node-name, next, previous, up -@chapter Language tools -@cindex Language tools - -@menu -* Views:: -* Xfig:: -* Text editors:: -* Octave:: -* LaTeX:: -@end menu - -@node Views, Xfig, Language tools, Language tools -@comment node-name, next, previous, up -@section Views -@cindex views - -A number of representations (@pxref{Representations}) have a language -representation which is particularly useful for viewing by the -user. These views are -invoked, where appropriate by the command: -@example -mtt sys rep view -@end example -where @code{sys} is the system name and @code{rep} a corresponding representation. - -@node Xfig, Text editors, Views, Language tools -@comment node-name, next, previous, up -@section Xfig -@cindex Xfig - -@node Text editors, Octave, Xfig, Language tools -@comment node-name, next, previous, up -@section Text editors -@cindex Text editors -All representations live in text files and thus may be edited using your -favourite text editor; however, the Fig (@pxref{Fig}) representation is -pretty meaningless in this form and so you should use Xfig -(@pxref{Xfig}) for representation in this language. - -Its up to you which text editor to use. I recommend emacs, but simpler -(and less powerful) editors such as xedit, textedit and vi are also ok. - -I usually run @strong{MTT} out of an emacs shell window and keep the -rest of the files in emacs buffers. - -@node Octave, LaTeX, Text editors, Language tools -@comment node-name, next, previous, up -@section Octave -@cindex Octave -@cindex Matlab -@cindex m-files -@cindex Octave interface -@cindex mtt.m - -Octave is a numerical matrix-based language @xref{Top, -,Octave,Octave,Octave}. It is similar to Matlab in many ways. In most -cases, m-files generated by @strong{MTT} can be understood by both -Matlab and Octave (and no doubt other Matlab lookalikes). - - @strong{MTT} provides the octave function @code{mtt}. The octave - command -@example -help mtt -@end example -gives the following information: -@example - usage: mtt (system[,representation,language]) - - Invokes mtt from octave to generate system_representation.language - Ie equivalent to "mtt system representation language" at the shell - Representation and language defualt to "sm" and "m" respectively - -@end example - -Thus for example, if octave is in the directory containing the system -rc the following session generates the state matrices of the system "rc" -with the defaut capacitance but resitance r=0.1. -@example -octave> mtt("rc"); -Creating rc_rbg.m -Creating rc_cmp.m -Creating rc_fig.fig -Creating rc_sabg.fig -Creating rc_alias.txt -Creating rc_alias.m -Creating rc_sub.sh -Creating rc_abg.m -Creating rc_cbg.m (maximise integral causality) -Creating rc_type.sh -Creating rc_ese.r -Creating rc_def.r -Creating rc_struc.txt -Creating rc_rdae.r -Creating rc_subs.r -Creating rc_cr.txt -Creating rc_cr.r -Copying CR SS to here from -Copying CR lin to here from -Creating rc_dae.r -Creating rc_sympar.txt -Creating rc_sympar.r -Creating rc_cse.r -Creating rc_sspar.r -Creating rc_csm.r -Creating rc_ode.r -Creating rc_ss.r -Creating rc_sm.r -Creating rc_switch.txt -0 switches found -Creating rc_sympars.txt -Creating rc_sm.m -Copying rc_sm.m -octave> mtt("rc","numpar"); -Creating rc_numpar.txt -Creating rc_numpar.m -Copying rc_numpar.m -octave> mtt("rc","sympar"); -Creating rc_sympar.m -Copying rc_sympar.m -octave> par = rc_numpar -par = - - 1 - 1 - -octave> sym = rc_sympar; - -octave> par(sym.r) = 0.1; -octave> [A,B,C,D] = rc_sm(par) -A = -10 - -B = 10 - -C = 1 - -D = 0 - -octave> -@end example -generates the data structure rc corresponding the the bond graph of the -system called `rc'. -The following octave commands then generate the step reponse and bode -diagram respectively: -@example -step(rc); -bode(rc); -@end example - - -@menu -* Octave control system toolbox (OCST):: -* Creating GNU Octave .oct files:: -* Creating Matlab .mex files:: -* Embedding MTT models in Simulink:: -@end menu - -@node Octave control system toolbox (OCST), Creating GNU Octave .oct files, Octave, Octave -@comment node-name, next, previous, up -@subsection Octave control system toolbox (OCST) -@cindex Octave -@cindex toolbox -@cindex OCST -@cindex control systems -@cindex mtt2sys - -@strong{MTT} provides an interface to the Octave control system toolbox -(OCST) using the mfile @code{mtt2sys}. the octave command -@example -help mtt2sys -@end example -gives the following information. -@example - usage: sys = mtt2sys (Name[,par]) - - Creates a sys structure for the Octave Control Systems Toolbox - from an MTT system with name "Name" - Optional second argument is system parameter list - Assumes that Name_sm.m, Name_struc.m and Name_numpar.m exist -@end example - -Thus for example, if octave is in the directory containing the system -rc: -@example -rc = mtt2sys("rc"); -@end example -generates the data structure rc corresponding the the bond graph of the -system called `rc'. -The following octave commands then generate the step reponse and bode -diagram respectively: -@example -step(rc); -bode(rc); -@end example - -@node Creating GNU Octave .oct files, Creating Matlab .mex files, Octave control system toolbox (OCST), Octave -@comment node-name, next, previous, up -@subsection Creating GNU Octave .oct files -@cindex Creating GNU Octave .oct files - -GNU Octave dynamically loaded functions (.oct files) can be created by -instructing @strong{MTT} to create the ``oct'' representation: - -@example - mtt [options] sys ode oct -@end example - -This will cause @strong{MTT} to create the C++ representation of the system -(sys_ode.cc) and to then compile it as a shared object suitable for -use within Octave. The resultant file may be used in an identical -manner to the equivalent, but generally slower, interpreted .m file. - -Usage information for the function may be obtained within Octave in the usual manner: - -@example - octave:1> help rc_ode - - rc_ode is the dynamically-linked function from the file - /home/mttuser/rc/rc_ode.oct - - Usage: [mttdx] = rc_ode(mttx,mttu,mttt,mttpar) - Octave ode representation of system rc - Generated by MTT on Fri Jul 5 11:23:08 BST 2002 -@end example - -Note that the first line of output from Octave identifies whether the -compiled or interpreted function is being used. - -Alternatively, standard representations may be generated using the -Octave DLDs by use of the ``-oct'' switch: - -@example - mtt -oct rc odeso view -@end example - -In order to successfully generate .oct files, Octave must be correctly -configured prior to compilation and certain headers and libraries must -be correctly installed on the system (@pxref{.oct file dependencies}). - -@node Creating Matlab .mex files, Embedding MTT models in Simulink, Creating GNU Octave .oct files, Octave -@comment node-name, next, previous, up -@subsection Creating Matlab .mex files -@cindex Creating Matlab .mex files - -On GNU/Linux systems, Matlab dynamically linked executables (.mexglx -files) can created by instructing @strong{MTT} to create the -``mexglx'' representation: - -@example - mtt [options] sys ode mexglx -@end example - -This will cause @strong{MTT} to create the C++ representation of the -system (sys_ode.cc) and to then compile it as a shared object suitable -for use within Matlab. - -If it is necessary to compile mex files for another platform, then the -usual C++ representation (generated with the -cc flag) can be created -and the resultant file compiled with the -DCODEGENTARGET=MATLABMEX -flag on the target platform. - -@example - mtt_machine: - mtt -cc rc ode cc - - matlab_machine: - matlab> mex -DCODEGENTARGET=MATLABMEX rc_ode.cc -@end example - -@node Embedding MTT models in Simulink, , Creating Matlab .mex files, Octave -@comment node-name, next, previous, up -@subsection Embedding MTT models in Simulink -@cindex Embedding MTT models in Simulink - -It is possible to embed @strong{MTT} functions or entire @strong{MTT} -models within Simulink simulations as Sfun blocks. If the zip package -is installed on the system, the command - -@example - mtt sys sfun zip -@end example - -will create a compressed archive containing sys.mdl, which may be -embedded into a larger Simulink model. Also contained within the -archive will be four sys_sfun*.c files, - -@itemize @bullet -@item -sys_sfun.c -model state and output equations -@item -sys_sfun_ae.c -model algebraic equations -@item -sys_sfun_input.c -model inputs -@item -sys_sfun_interface.c -interface between MTT model and Simulink -@end itemize - -The last of these files must be edited to correctly map the inputs and -outputs between the @strong{MTT} and Simulink models. The two sections -to edit are clearly marked with - -@example - @code{/* Start EDIT */} - @code{....} - @code{/* End EDIT */} -@end example - -These four files should then be compiled with the Matlab ``mex'' -compiler as described in the @emph{README} file in the archive. - -If it is desired to compile the .mex files directly from within -@strong{MTT} on a machine which has the Matlab header files installed, -this may be done with the command - -@example - mtt sys sfun mexglx -@end example - -which will generated the four .mex files and the .mdl file. In this -case, the user must ensure that @emph{sys_sfun_interface.c} has been -correctly edited prior to compilation. - -Note that solution of algebraic equations within Simulink is not -possible unless the @emph{Matlab Optimisation Toolbox} is installed. - -@node LaTeX, , Octave, Language tools -@comment node-name, next, previous, up -@section LaTeX -@cindex LaTeX - -LaTeX is a powerful text processor which @strong{MTT} uses to provide -visual output. - -@node Administration, Glossary, Language tools, Top -@comment node-name, next, previous, up -@chapter Administration -@cindex Administration - -@menu -* Software components:: -* REDUCE setup:: -* Octave setup:: -* Paths:: -* File structure:: -* GNU Free Documentation License:: -* Copying:: -@end menu - -@node Software components, REDUCE setup, Administration, Administration -@comment node-name, next, previous, up -@section Software components -@cindex Software components - -@strong{MTT} is built from a set of readily-available software tools. -These are: -@itemize @bullet -@item General purpose software tools. -@item Octave (@pxref{Octave setup}) -@item REDUCE (@pxref{REDUCE setup}) -@end itemize - -The General purpose tools are (these will all be available with a -standard Linux distribution): -@vtable @code -@item sh - Bourne shell -@item gmake - Gnu make -@item gawk - Gnu awk -@item sed - Gnu sed -@item grep - Gnu grep -@item comm - Gnu Compare sorted files by line -@item xfig - Figure editor, version 3 or greater. -@item fig2dev - Fig file conversion, version 3 or greater. -@item ghostview - postscript viewer -@item xdvi - dvi viewer -@item dvips - dvi to postscript conversion -@item latex - the text processor (LaTeX2e needed) -@item latex2html - converts latex to html -@item perl - needed for latex2html -@item gnuplot - a graph plotting program -@item gnuscape - or other web/html browser such as netscape, Red Baron etc. -@item gcc - GNU c compiler -@end vtable - -@ifhtml -GNU documentation. -@end ifhtml - - - -@node REDUCE setup, Octave setup, Software components, Administration -@comment node-name, next, previous, up -@section REDUCE setup -@cindex REDUCE setup - -Symbolic algebra is performed by REDUCE, which although not free -software is the the result of international collaboration. The version I -use is obtained from: -@quotation -ZIB ( http://www.zib.de ) -@end quotation -@ifhtml -REDUCE documentation. -ZIB documentation. -@end ifhtml - -@node Octave setup, Paths, REDUCE setup, Administration -@comment node-name, next, previous, up -@section Octave setup -@cindex Octave setup - -Octave is available at various web sites including: -@uref{http://www.octave.org} - -@menu -* .octaverc:: -* .oct file dependencies:: -@end menu - -@node .octaverc, .oct file dependencies, Octave setup, Octave setup -@comment node-name, next, previous, up -@subsection .octaverc -@vindex .octaverc - - -The @file{.octaverc} file should contain the following lines: -@example -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Startup file for Octave for use with MTT -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -implicit_str_to_num_ok = 1; -empty_list_elements_ok = 1; - -@end example - -@node .oct file dependencies, , .octaverc, Octave setup -@comment node-name, next, previous, up Additionally, it is necessary to -@subsection .oct file dependencies -Successful compilation of .oct code requires that Octave has been -configured to use dynamically linked libraries and that the Octave -libraries @code{liboctave}, @code{libcruft} and @code{liboctinterp} -are available on the system. - -This can be acheived by compiling Octave from the source code, configured -with the options @code{--enable-shared} and @code{--enable-dl}. - -A number of additional libraries and headers are also required to be -installed on a system. These include, -@itemize @bullet -@item -@emph{ncurses} and @emph{readline} - terminal control routines -@item -@emph{blas} or @emph{altas} - basic linear algebra subprograms, usually optimised for the specific processor -@item -@emph{fftw} - fast Fourier transform routines -@item -@emph{g2c} - GNU Fortran to C conversion routines -@item -@emph{kpathsea} - TeX path search routines -@end itemize - -Note that on many GNU/Linux distributions, the necessary headers are -contained in development packages which must be installed in addition -to the standard library package. - -Further information on configuring and installing Octave to handle dynamic -libraries (DLDs) can be found in the -@uref{http://www.octave.org/docs.html,Octave documentation}. - - -@node Paths, File structure, Octave setup, Administration -@comment node-name, next, previous, up -@section Paths -@cindex paths -@cindex mttrc - -There are a number of paths that must be set correctely for @strong{MTT} -to work. These are normally set up by sourcing the file @code{mttrc} that -lives in the @strong{MTT} home directory. - -@menu -* $MTTPATH:: -* $MTT_COMPONENTS:: -* $MTT_CRS:: -* $MTT_EXAMPLES:: -* $OCTAVE_PATH:: -@end menu - -@node $MTTPATH, $MTT_COMPONENTS, Paths, Paths -@comment node-name, next, previous, up -@subsection $MTTPATH -@vindex $MTTPATH -The environment variable $MTTPATH points to the mtt home directory. -This is usually @code{/usr/local/lib/mtt}. - -@node $MTT_COMPONENTS, $MTT_CRS, $MTTPATH, Paths -@comment node-name, next, previous, up -@subsection $MTT_COMPONENTS -@vindex $MTT_COMPONENTS -The environment variable $MTT_COMPONENTS is a colon-separated path -pointing to directories containing components and subsystems. -By default -@example -MTT_COMPONENTS=.:$MTT_LIB/lib/comp/ -@end example -but you may wish to add your own component libraries: -@example -MTT_COMPONENTS=my_library_path:$MTT_COMPONENTS -@end example - -@node $MTT_CRS, $MTT_EXAMPLES, $MTT_COMPONENTS, Paths -@comment node-name, next, previous, up -@subsection $MTT_CRS -@vindex $MTT_CRS -The environment variable $MTT_CRS is a colon-separated path -pointing to directories containing constitutive relationships. -By default -@example -MTT_CRS=$MTTPATH/lib/cr -@end example -but you may wish to add your own component libraries: -@example -MTT_CRS=my_cr_path:$MTT_CRS -@end example - -@node $MTT_EXAMPLES, $OCTAVE_PATH, $MTT_CRS, Paths -@comment node-name, next, previous, up -@subsection $MTT_EXAMPLES -@vindex $MTT_EXAMPLES -The environment variable $MTT_EXAMPLES is a colon-separated path -pointing to directories containing EXAMPLES and subsystems. -By default -@example -MTT_EXAMPLES=$MTTPATH/lib/examples -@end example -but you may wish to add your own component libraries: -@example -MTT_EXAMPLES=my_examples_path:$MTT_EXAMPLES -@end example - -@node $OCTAVE_PATH, , $MTT_EXAMPLES, Paths -@comment node-name, next, previous, up -@subsection $OCTAVE_PATH -@vindex $OCTAVE_PATH - -The @code{$OCTAVE_PATH} path must include the relevant paths for mtt to -work properly. In particular, it must include: -@example -$MTTPATH/trans/m -$MTTPATH/lib/comp/simple -$MTTPATH/lib/comp/compound -@end example - -@node File structure, GNU Free Documentation License, Paths, Administration -@comment node-name, next, previous, up -@section File structure -@cindex File structure -The recommended installation of @strong{MTT} uses the following -directory structure with corresponding contents. Normally, each of the -listed directories is a subdirectory of @file{/usr/local}. The directory -@code{mtt} is pointed to by $MTTPATH (@pxref{$MTTPATH}). - -@vtable @file -@item mtt/bin - This is the home directory for @strong{MTT}. @strong{MTT} itself lives - here along with @file{mttrc}. -@item mtt/bin/trans - The transformations executed by @strong{MTT}. -@item mtt/bin/trans/m - The @code{m-files} associated with the transformations. -@item mtt/bin/trans/awk - The @code{awk} scripts associated with the transformations. -@item mtt/lib - The place for components, examples and CRs which will be updated. -@item mtt/lib/comp/simple -@cindex simple components - The @code{m-files} defining the simple components. -@cindex compound components -@item mtt/lib/comp/compound - The @code{m-files} defining the compound components. -@item mtt/lib/cr/r - constitutive relationship definitions -@item mtt/lib/examples - Some examples. -@item mtt/examples/metamodelling - Examples from the book. -@item mtt/doc - The documentation files for @strong{MTT}. -@item mtt/doc/Examples - Examples used in the documentation. -@end vtable - -@appendix Legal stuff -@node GNU Free Documentation License, Copying, File structure, Administration -@appendixsec GNU Free Documentation License - -@cindex FDL, GNU Free Documentation License -@center Version 1.2, November 2002 - -@display -Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307, USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. -@end display - -@enumerate 0 -@item -PREAMBLE - -The purpose of this License is to make a manual, textbook, or other -functional and useful document @dfn{free} in the sense of freedom: to -assure everyone the effective freedom to copy and redistribute it, -with or without modifying it, either commercially or noncommercially. -Secondarily, this License preserves for the author and publisher a way -to get credit for their work, while not being considered responsible -for modifications made by others. - -This License is a kind of ``copyleft'', which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - -@item -APPLICABILITY AND DEFINITIONS - -This License applies to any manual or other work, in any medium, that -contains a notice placed by the copyright holder saying it can be -distributed under the terms of this License. Such a notice grants a -world-wide, royalty-free license, unlimited in duration, to use that -work under the conditions stated herein. The ``Document'', below, -refers to any such manual or work. Any member of the public is a -licensee, and is addressed as ``you''. You accept the license if you -copy, modify or distribute the work in a way requiring permission -under copyright law. - -A ``Modified Version'' of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A ``Secondary Section'' is a named appendix or a front-matter section -of the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall -subject (or to related matters) and contains nothing that could fall -directly within that overall subject. (Thus, if the Document is in -part a textbook of mathematics, a Secondary Section may not explain -any mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The ``Invariant Sections'' are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. If a -section does not fit the above definition of Secondary then it is not -allowed to be designated as Invariant. The Document may contain zero -Invariant Sections. If the Document does not identify any Invariant -Sections then there are none. - -The ``Cover Texts'' are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. A Front-Cover Text may -be at most 5 words, and a Back-Cover Text may be at most 25 words. - -A ``Transparent'' copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, that is suitable for revising the document -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup, or absence of markup, has been arranged to thwart -or discourage subsequent modification by readers is not Transparent. -An image format is not Transparent if used for any substantial amount -of text. A copy that is not ``Transparent'' is called ``Opaque''. - -Examples of suitable formats for Transparent copies include plain -@sc{ascii} without markup, Texinfo input format, La@TeX{} input -format, @acronym{SGML} or @acronym{XML} using a publicly available -@acronym{DTD}, and standard-conforming simple @acronym{HTML}, -PostScript or @acronym{PDF} designed for human modification. Examples -of transparent image formats include @acronym{PNG}, @acronym{XCF} and -@acronym{JPG}. Opaque formats include proprietary formats that can be -read and edited only by proprietary word processors, @acronym{SGML} or -@acronym{XML} for which the @acronym{DTD} and/or processing tools are -not generally available, and the machine-generated @acronym{HTML}, -PostScript or @acronym{PDF} produced by some word processors for -output purposes only. - -The ``Title Page'' means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, ``Title Page'' means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. - -A section ``Entitled XYZ'' means a named subunit of the Document whose -title either is precisely XYZ or contains XYZ in parentheses following -text that translates XYZ in another language. (Here XYZ stands for a -specific section name mentioned below, such as ``Acknowledgements'', -``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' -of such a section when you modify the Document means that it remains a -section ``Entitled XYZ'' according to this definition. - -The Document may include Warranty Disclaimers next to the notice which -states that this License applies to the Document. These Warranty -Disclaimers are considered to be included by reference in this -License, but only as regards disclaiming warranties: any other -implication that these Warranty Disclaimers may have is void and has -no effect on the meaning of this License. - -@item -VERBATIM COPYING - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no other -conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section 3. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. - -@item -COPYING IN QUANTITY - -If you publish printed copies (or copies in media that commonly have -printed covers) of the Document, numbering more than 100, and the -Document's license notice requires Cover Texts, you must enclose the -copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a computer-network location from which the general network-using -public has access to download using public-standard network protocols -a complete Transparent copy of the Document, free of added material. -If you use the latter option, you must take reasonably prudent steps, -when you begin distribution of Opaque copies in quantity, to ensure -that this Transparent copy will remain thus accessible at the stated -location until at least one year after the last time you distribute an -Opaque copy (directly or through your agents or retailers) of that -edition to the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to give -them a chance to provide you with an updated version of the Document. - -@item -MODIFICATIONS - -You may copy and distribute a Modified Version of the Document under -the conditions of sections 2 and 3 above, provided that you release -the Modified Version under precisely this License, with the Modified -Version filling the role of the Document, thus licensing distribution -and modification of the Modified Version to whoever possesses a copy -of it. In addition, you must do these things in the Modified Version: - -@enumerate A -@item -Use in the Title Page (and on the covers, if any) a title distinct -from that of the Document, and from those of previous versions -(which should, if there were any, be listed in the History section -of the Document). You may use the same title as a previous version -if the original publisher of that version gives permission. - -@item -List on the Title Page, as authors, one or more persons or entities -responsible for authorship of the modifications in the Modified -Version, together with at least five of the principal authors of the -Document (all of its principal authors, if it has fewer than five), -unless they release you from this requirement. - -@item -State on the Title page the name of the publisher of the -Modified Version, as the publisher. - -@item -Preserve all the copyright notices of the Document. - -@item -Add an appropriate copyright notice for your modifications -adjacent to the other copyright notices. - -@item -Include, immediately after the copyright notices, a license notice -giving the public permission to use the Modified Version under the -terms of this License, in the form shown in the Addendum below. - -@item -Preserve in that license notice the full lists of Invariant Sections -and required Cover Texts given in the Document's license notice. - -@item -Include an unaltered copy of this License. - -@item -Preserve the section Entitled ``History'', Preserve its Title, and add -to it an item stating at least the title, year, new authors, and -publisher of the Modified Version as given on the Title Page. If -there is no section Entitled ``History'' in the Document, create one -stating the title, year, authors, and publisher of the Document as -given on its Title Page, then add an item describing the Modified -Version as stated in the previous sentence. - -@item -Preserve the network location, if any, given in the Document for -public access to a Transparent copy of the Document, and likewise -the network locations given in the Document for previous versions -it was based on. These may be placed in the ``History'' section. -You may omit a network location for a work that was published at -least four years before the Document itself, or if the original -publisher of the version it refers to gives permission. - -@item -For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve -the Title of the section, and preserve in the section all the -substance and tone of each of the contributor acknowledgements and/or -dedications given therein. - -@item -Preserve all the Invariant Sections of the Document, -unaltered in their text and in their titles. Section numbers -or the equivalent are not considered part of the section titles. - -@item -Delete any section Entitled ``Endorsements''. Such a section -may not be included in the Modified Version. - -@item -Do not retitle any existing section to be Entitled ``Endorsements'' or -to conflict in title with any Invariant Section. - -@item -Preserve any Warranty Disclaimers. -@end enumerate - -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section Entitled ``Endorsements'', provided it contains -nothing but endorsements of your Modified Version by various -parties---for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. - -@item -COMBINING DOCUMENTS - -You may combine the Document with other documents released under this -License, under the terms defined in section 4 above for modified -versions, provided that you include in the combination all of the -Invariant Sections of all of the original documents, unmodified, and -list them all as Invariant Sections of your combined work in its -license notice, and that you preserve all their Warranty Disclaimers. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections Entitled ``History'' -in the various original documents, forming one section Entitled -``History''; likewise combine any sections Entitled ``Acknowledgements'', -and any sections Entitled ``Dedications''. You must delete all -sections Entitled ``Endorsements.'' - -@item -COLLECTIONS OF DOCUMENTS - -You may make a collection consisting of the Document and other documents -released under this License, and replace the individual copies of this -License in the various documents with a single copy that is included in -the collection, provided that you follow the rules of this License for -verbatim copying of each of the documents in all other respects. - -You may extract a single document from such a collection, and distribute -it individually under this License, provided you insert a copy of this -License into the extracted document, and follow this License in all -other respects regarding verbatim copying of that document. - -@item -AGGREGATION WITH INDEPENDENT WORKS - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, is called an ``aggregate'' if the copyright -resulting from the compilation is not used to limit the legal rights -of the compilation's users beyond what the individual works permit. -When the Document is included in an aggregate, this License does not -apply to the other works in the aggregate which are not themselves -derivative works of the Document. - -If the Cover Text requirement of section 3 is applicable to these -copies of the Document, then if the Document is less than one half of -the entire aggregate, the Document's Cover Texts may be placed on -covers that bracket the Document within the aggregate, or the -electronic equivalent of covers if the Document is in electronic form. -Otherwise they must appear on printed covers that bracket the whole -aggregate. - -@item -TRANSLATION - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section 4. -Replacing Invariant Sections with translations requires special -permission from their copyright holders, but you may include -translations of some or all Invariant Sections in addition to the -original versions of these Invariant Sections. You may include a -translation of this License, and all the license notices in the -Document, and any Warranty Disclaimers, provided that you also include -the original English version of this License and the original versions -of those notices and disclaimers. In case of a disagreement between -the translation and the original version of this License or a notice -or disclaimer, the original version will prevail. - -If a section in the Document is Entitled ``Acknowledgements'', -``Dedications'', or ``History'', the requirement (section 4) to Preserve -its Title (section 1) will typically require changing the actual -title. - -@item -TERMINATION - -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. - -@item -FUTURE REVISIONS OF THIS LICENSE - -The Free Software Foundation may publish new, revised versions -of the GNU Free Documentation License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. See -@uref{http://www.gnu.org/copyleft/}. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License ``or any later version'' applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. -@end enumerate - -@page -@appendixsubsec ADDENDUM: How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - -@smallexample -@group - Copyright (C) @var{year} @var{your name}. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 - or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover - Texts. A copy of the license is included in the section entitled ``GNU - Free Documentation License''. -@end group -@end smallexample - -If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, -replace the ``with...Texts.'' line with this: - -@smallexample -@group - with the Invariant Sections being @var{list their titles}, with - the Front-Cover Texts being @var{list}, and with the Back-Cover Texts - being @var{list}. -@end group -@end smallexample - -If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, -to permit their use in free software. - -@c Local Variables: -@c ispell-local-pdict: "ispell-dict" -@c End: - -@page -@node Copying, , GNU Free Documentation License, Administration -@appendixsec GNU GENERAL PUBLIC LICENSE -@center Version 2, June 1991 - -@c This file is intended to be included in another file. - -@display -Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. -@end display - -@page -@appendixsubsec Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software---to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - -@iftex -@appendixsubsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -@end iftex -@ifinfo -@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -@end ifinfo - -@enumerate 0 -@item -This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The ``Program'', below, -refers to any such program or work, and a ``work based on the Program'' -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term ``modification''.) Each licensee is addressed as ``you''. - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - -@item -You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - -@item -You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - -@enumerate a -@item -You must cause the modified files to carry prominent notices -stating that you changed the files and the date of any change. - -@item -You must cause any work that you distribute or publish, that in -whole or in part contains or is derived from the Program or any -part thereof, to be licensed as a whole at no charge to all third -parties under the terms of this License. - -@item -If the modified program normally reads commands interactively -when run, you must cause it, when started running for such -interactive use in the most ordinary way, to print or display an -announcement including an appropriate copyright notice and a -notice that there is no warranty (or else, saying that you provide -a warranty) and that users may redistribute the program under -these conditions, and telling the user how to view a copy of this -License. (Exception: if the Program itself is interactive but -does not normally print such an announcement, your work based on -the Program is not required to print an announcement.) -@end enumerate - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - -@item -You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - -@enumerate a -@item -Accompany it with the complete corresponding machine-readable -source code, which must be distributed under the terms of Sections -1 and 2 above on a medium customarily used for software interchange; or, - -@item -Accompany it with a written offer, valid for at least three -years, to give any third party, for a charge no more than your -cost of physically performing source distribution, a complete -machine-readable copy of the corresponding source code, to be -distributed under the terms of Sections 1 and 2 above on a medium -customarily used for software interchange; or, - -@item -Accompany it with the information you received as to the offer -to distribute corresponding source code. (This alternative is -allowed only for noncommercial distribution and only if you -received the program in object code or executable form with such -an offer, in accord with Subsection b above.) -@end enumerate - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - -@item -You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - -@item -You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - -@item -Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - -@item -If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - -@item -If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - -@item -The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and ``any -later version'', you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - -@item -If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - -@iftex -@strong{NO WARRANTY} -@end iftex -@ifinfo -@center NO WARRANTY -@end ifinfo - -@item -BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - -@item -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. -@end enumerate - -@iftex -@heading END OF TERMS AND CONDITIONS -@end iftex -@ifinfo -@center END OF TERMS AND CONDITIONS -@end ifinfo - -@page -@appendixsubsec Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the ``copyright'' line and a pointer to where the full notice is found. - -@smallexample -@var{one line to give the program's name and a brief idea of what it does.} -Copyright (C) @var{yyyy} @var{name of author} - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -@end smallexample - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - -@smallexample -Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author} -Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. -This is free software, and you are welcome to redistribute it -under certain conditions; type `show c' for details. -@end smallexample - -The hypothetical commands @samp{show w} and @samp{show c} should show -the appropriate parts of the General Public License. Of course, the -commands you use may be called something other than @samp{show w} and -@samp{show c}; they could even be mouse-clicks or menu items---whatever -suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a ``copyright disclaimer'' for the program, if -necessary. Here is a sample; alter the names: - -@example -Yoyodyne, Inc., hereby disclaims all copyright interest in the program -`Gnomovision' (which makes passes at compilers) written by James Hacker. - -@var{signature of Ty Coon}, 1 April 1989 -Ty Coon, President of Vice -@end example - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. - -@node Glossary, Index, Administration, Top -@comment node-name, next, previous, up -@unnumbered Glossary -@printindex fn - -@node Index, , Glossary, Top -@comment node-name, next, previous, up -@unnumbered Index -@printindex cp - -@contents - -@bye - - DELETED mttroot/mtt/doc/mtt_banner.sh Index: mttroot/mtt/doc/mtt_banner.sh ================================================================== --- mttroot/mtt/doc/mtt_banner.sh +++ mttroot/mtt/doc/mtt_banner.sh @@ -1,10 +0,0 @@ - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ############################################################### DELETED mttroot/mtt/doc/mtt_make_examples Index: mttroot/mtt/doc/mtt_make_examples ================================================================== --- mttroot/mtt/doc/mtt_make_examples +++ mttroot/mtt/doc/mtt_make_examples @@ -1,73 +0,0 @@ -#! /bin/sh -## This makes all of the standard examples -## It takes a few hours. -## Copyright (C) 2003 by Peter J. Gawthrop - -exampledir="$MTT_EXAMPLES" -dirname=`basename ${exampledir}` - -tmpbase="$HOME/JUNK" -tmpdir="${tmpbase}/${dirname}" - -first() { - cat< - - - MTT Examples - - - - -

    MTT Examples

    - -
    -
      -EOF -} - -entry() { - cat<$1: html, pdf. -EOF -} - -last() { - cat< -
      -Created on `date` by mtt_make_examples -
      - - -EOF -} - -## File start -first > index.html - -if [ -d "${tmpdir}" ]; then - echo "${tmpdir} exists -- using" -else - echo "${tmpdir} does not exist -- copy from ${exampledir}" - ## Create tmp dir - mkdir -pv ${tmpdir} - ## Copy to tmp - cp -r ${exampledir} ${tmpbase} -fi - -## Go to tmp and list DIRS -pushd ${tmpdir} -dirs=`ls | grep -v CVS | grep -v '\.' | grep -v _` - -echo Making examples for ${dirs} in ${tmpdir} -for dir in ${dirs}; do - echo Making examples in $dir - mtt -q $dir rep pdf - mtt -q $dir rep html - entry $dir >> index.html -done - -## File end -last>>index.html -popd DELETED mttroot/mtt/doc/reduce_reserved.tex Index: mttroot/mtt/doc/reduce_reserved.tex ================================================================== --- mttroot/mtt/doc/reduce_reserved.tex +++ mttroot/mtt/doc/reduce_reserved.tex @@ -1,94 +0,0 @@ -\documentclass[12pt,a4paper]{book} -\newcommand{\REDUCE}{REDUCE} -\begin{document} - - -\appendix -\chapter{Reserved Identifiers} - -We list here all identifiers that are normally reserved in \REDUCE{} -including names of commands, operators and switches initially in the system. -Excluded are words that are reserved in specific implementations of the -system. - -\vspace{13pt} -\begin{list}{}{\renewcommand{\makelabel}[1]{#1\hspace{\fill}}% - \settowidth{\labelwidth}{Numerical Operators}% - \setlength{\labelsep}{1em}% - \settowidth{\leftmargin}{Numerical Operators\hspace*{\labelsep}}% - \sloppy} - -\item[Commands] {\tt ALGEBRAIC} {\tt ANTISYMMETRIC} -{\tt ARRAY} {\tt BYE} {\tt CLEAR} \linebreak -{\tt CLEARRULES} {\tt COMMENT} {\tt -CONT} {\tt DECOMPOSE} {\tt DEFINE} {\tt DEPEND} {\tt DISPLAY} {\tt ED} -{\tt EDITDEF} {\tt END} {\tt EVEN} {\tt FACTOR} {\tt FOR} {\tt FORALL} -{\tt FOREACH} {\tt GO} {\tt GOTO} {\tt IF} {\tt IN} {\tt INDEX} {\tt INFIX} -{\tt INPUT} {\tt INTEGER} {\tt KORDER} {\tt LET} {\tt LINEAR} {\tt LISP} -{\tt LISTARGP} {\tt LOAD} {\tt LOAD\_PACKAGE} {\tt MASS} {\tt MATCH} {\tt -MATRIX} {\tt MSHELL} {\tt NODEPEND} {\tt NONCOM} {\tt NONZERO} {\tt NOSPUR} -{\tt ODD} {\tt OFF} -{\tt ON} {\tt OPERATOR} {\tt ORDER} {\tt OUT} {\tt PAUSE} {\tt PRECEDENCE} -{\tt PRINT\_PRECISION} {\tt PROCEDURE} {\tt QUIT} {\tt REAL} {\tt REMFAC} -{\tt REMIND} {\tt RETRY} {\tt RETURN} {\tt SAVEAS} {\tt SCALAR} {\tt -SETMOD} {\tt SHARE} {\tt SHOWTIME} {\tt SHUT} {\tt SPUR} {\tt SYMBOLIC} -{\tt SYMMETRIC} {\tt VECDIM} {\tt VECTOR} {\tt WEIGHT} {\tt WRITE} {\tt -WTLEVEL} - -\item[Boolean Operators] {\tt EVENP} {\tt FIXP} -{\tt FREEOF} {\tt NUMBERP} {\tt ORDP} {\tt PRIMEP} - -\item[Infix Operators] - \verb|:=| \verb|=| \verb|>=| \verb|>| \verb|<=| \verb|<| \verb|=>| - \verb|+| \verb|*| \verb|/| \verb|^| \verb|**| \verb|.| {\tt WHERE} -{\tt SETQ} {\tt OR} {\tt AND} {\tt MEMBER} {\tt MEMQ} {\tt -EQUAL} {\tt NEQ} {\tt EQ} {\tt GEQ} {\tt GREATERP} {\tt LEQ} {\tt LESSP} -{\tt PLUS} {\tt DIFFERENCE} {\tt MINUS} {\tt TIMES} {\tt QUOTIENT} {\tt -EXPT} {\tt CONS} - -\item[Numerical Operators] {\tt ABS} {\tt ACOS} -{\tt ACOSH} {\tt ACOT} {\tt ACOTH} {\tt ACSC} {\tt ACSCH} {\tt ASEC} {\tt -ASECH} {\tt ASIN} {\tt ASINH} {\tt ATAN} {\tt ATANH} {\tt ATAN2} {\tt COS} -{\tt COSH} {\tt COT} {\tt COTH} {\tt CSC} {\tt CSCH} {\tt EXP} {\tt -FACTORIAL} {\tt FIX} {\tt FLOOR} {\tt HYPOT} {\tt LN} {\tt LOG} {\tt LOGB} -{\tt LOG10} {\tt NEXTPRIME} {\tt ROUND} {\tt SEC} {\tt SECH} {\tt SIN} -{\tt SINH} {\tt SQRT} {\tt TAN} {\tt TANH} - -\item[Prefix Operators] {\tt APPEND} {\tt -ARGLENGTH} {\tt CEILING} {\tt COEFF} {\tt COEFFN} {\tt COFACTOR} {\tt -CONJ} {\tt DEG} {\tt DEN} {\tt DET} {\tt DF} {\tt DILOG} {\tt EI} -{\tt EPS} {\tt ERF} {\tt FACTORIZE} {\tt FIRST} {\tt GCD} {\tt G} {\tt -IMPART} {\tt INT} {\tt INTERPOL} {\tt LCM} {\tt LCOF} {\tt LENGTH} {\tt -LHS} {\tt LINELENGTH} {\tt LTERM} {\tt MAINVAR} {\tt MAT} {\tt MATEIGEN} -{\tt MAX} {\tt MIN} {\tt MKID} {\tt NULLSPACE} {\tt NUM} {\tt PART} {\tt -PF} {\tt PRECISION} {\tt RANDOM} {\tt RANDOM\_NEW\_SEED} {\tt RANK} {\tt -REDERR} {\tt REDUCT} {\tt REMAINDER} {\tt REPART} {\tt REST} {\tt -RESULTANT} {\tt REVERSE} {\tt RHS} {\tt SECOND} {\tt SET} {\tt SHOWRULES} -{\tt SIGN} {\tt SOLVE} {\tt STRUCTR} {\tt SUB} {\tt SUM} {\tt THIRD} {\tt -TP} {\tt TRACE} {\tt VARNAME} - -\item[Reserved Variables] {\tt CARD\_NO} {\tt E} {\tt EVAL\_MODE} -{\tt FORT\_WIDTH} {\tt HIGH\_POW} {\tt I} {\tt INFINITY} {\tt K!*} {\tt -LOW\_POW} {\tt NIL} {\tt PI} {\tt ROOT\_MULTIPLICITY} {\tt T} - -\item[Switches] {\tt ADJPREC} {\tt ALGINT} {\tt ALLBRANCH} {\tt ALLFAC} -{\tt BFSPACE} {\tt COMBINEEXPT} {\tt COMBINELOGS} -{\tt COMP} {\tt COMPLEX} {\tt CRAMER} {\tt CREF} {\tt DEFN} {\tt DEMO} -{\tt DIV} {\tt ECHO} {\tt ERRCONT} {\tt EVALLHSEQP} {\tt EXP} {\tt -EXPANDLOGS} {\tt EZGCD} {\tt FACTOR} {\tt FORT} {\tt FULLROOTS} {\tt GCD} -{\tt IFACTOR} {\tt INT} {\tt INTSTR} {\tt LCM} {\tt LIST} {\tt LISTARGS} -{\tt MCD} {\tt MODULAR} {\tt MSG} {\tt MULTIPLICITIES} {\tt NAT} {\tt -NERO} {\tt NOSPLIT} {\tt OUTPUT} {\tt PERIOD} {\tt PRECISE} {\tt PRET} -{\tt PRI} {\tt RAT} {\tt RATARG} {\tt RATIONAL} {\tt RATIONALIZE} {\tt -RATPRI} {\tt REVPRI} {\tt RLISP88} {\tt ROUNDALL} {\tt ROUNDBF} {\tt -ROUNDED} {\tt SAVESTRUCTR} {\tt SOLVESINGULAR} {\tt TIME} {\tt TRA} {\tt -TRFAC} {\tt TRIGFORM} {\tt TRINT} - -\item[Other Reserved Ids] {\tt BEGIN} {\tt DO} {\tt -EXPR} {\tt FEXPR} {\tt INPUT} {\tt LAMBDA} {\tt -LISP} {\tt MACRO} {\tt PRODUCT} {\tt REPEAT} {\tt SMACRO} {\tt -SUM} {\tt UNTIL} {\tt WHEN} {\tt WHILE} {\tt WS} - -\end{list} - -\end{document} DELETED mttroot/mtt/lib/cc/mtt_AlgebraicSolver.cc Index: mttroot/mtt/lib/cc/mtt_AlgebraicSolver.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_AlgebraicSolver.cc +++ mttroot/mtt/lib/cc/mtt_AlgebraicSolver.cc @@ -1,32 +0,0 @@ - -#include "mtt_AlgebraicSolver.hh" - -ColumnVector -MTT::AlgebraicSolver::solve (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ - if (_nyz > 0) - { - _x = x; - _uui.insert(u,0); - _t = t; - _par = par; - Solve(); - _uui.insert(_ui,_nu); - } - else - { - _uui = u; - } - return _uui; -} - -ColumnVector -MTT::AlgebraicSolver::eval (const ColumnVector &ui) -{ - if (_nyz > 0) - _uui.insert(ui,_nu); - return mtt_ae(_x,_uui,_t,_par); -} DELETED mttroot/mtt/lib/cc/mtt_AlgebraicSolver.hh Index: mttroot/mtt/lib/cc/mtt_AlgebraicSolver.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_AlgebraicSolver.hh +++ mttroot/mtt/lib/cc/mtt_AlgebraicSolver.hh @@ -1,49 +0,0 @@ - -#ifndef MTT_ALGEBRAICSOLVER -#define MTT_ALGEBRAICSOLVER - - -#include "mtt_Solver.hh" - - -namespace MTT -{ - class AlgebraicSolver : public MTT::Solver - { - public: - - AlgebraicSolver (const int npar, - const int nu, - const int nx, - const int ny, - const int nyz) - : MTT::Solver (npar,nu,nx,ny,nyz) - {;} - - ColumnVector - solve (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - - ColumnVector - eval (const ColumnVector &ui); - - virtual ~AlgebraicSolver (void) {}; - - protected: - - virtual void - Solve (void) = 0; - }; -} - - -extern ColumnVector -mtt_ae(const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - - -#endif // MTT_ALGEBRAICSOLVER DELETED mttroot/mtt/lib/cc/mtt_Dassl_Solver.cc Index: mttroot/mtt/lib/cc/mtt_Dassl_Solver.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_Dassl_Solver.cc +++ mttroot/mtt/lib/cc/mtt_Dassl_Solver.cc @@ -1,31 +0,0 @@ - -#include "mtt_Dassl_Solver.hh" - - -// used by "-ae dassl" NOT "-i dassl" - - -MTT::Dassl_Solver *MTT::Dassl_Solver::static_ptr; - -ColumnVector -MTT::Dassl_Solver::f_dassl (const ColumnVector &tryUi, - const ColumnVector &tryUidot, - double t, int &ires) -{ - static MTT::Dassl_Solver *p = MTT::Dassl_Solver::static_ptr; - - ColumnVector residual = p->eval(tryUi); - ColumnVector uidoterr = (tryUi - p->_ui) - tryUidot; - p->_yz = residual + uidoterr; - return p->_yz; -} - -void -MTT::Dassl_Solver::Solve (void) -{ - const double t0 = 0.0; - const double t1 = 1.0; - DAEFunc fcn(&MTT::Dassl_Solver::f_dassl); - DASSL eqn(AlgebraicSolver::_ui,t0,fcn); - AlgebraicSolver::_ui = eqn.do_integrate (t1); -} DELETED mttroot/mtt/lib/cc/mtt_Dassl_Solver.hh Index: mttroot/mtt/lib/cc/mtt_Dassl_Solver.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_Dassl_Solver.hh +++ mttroot/mtt/lib/cc/mtt_Dassl_Solver.hh @@ -1,62 +0,0 @@ - - -#ifndef MTT_DASSLSOLVER -#define MTT_DASSLSOLVER - - -#include "mtt_AlgebraicSolver.hh" -#include - - -#ifdef OCTAVE_DEV -#include -#define VECTOR_VALUE column_vector_value -#else // !OCTAVE_DEV -#include -#define VECTOR_VALUE vector_value -#endif // OCTAVE_DEV - - -// -ae dassl - - -namespace MTT -{ - class Dassl_Solver : public MTT::AlgebraicSolver { - - // used only when called because of "-ae dassl" - // this is not used when called by "-i dassl" - - public: - - Dassl_Solver (const int npar, - const int nu, - const int nx, - const int ny, - const int nyz) - : MTT::AlgebraicSolver (npar, nu, nx, ny, nyz) - { - static_ptr = this; - } - - static ColumnVector - f_dassl (const ColumnVector &tryUi, - const ColumnVector &tryUidot, - double t, int &ires); - - ~Dassl_Solver (void) {}; - - protected: - - void - Solve (void); - - public: - - static Dassl_Solver *static_ptr; - - }; -} - - -#endif // MTT_DASSLSOLVER DELETED mttroot/mtt/lib/cc/mtt_HJ_Solver.hh Index: mttroot/mtt/lib/cc/mtt_HJ_Solver.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_HJ_Solver.hh +++ mttroot/mtt/lib/cc/mtt_HJ_Solver.hh @@ -1,65 +0,0 @@ - -#ifndef MTT_HJSOLVER -#define MTT_HJSOLVER - - -#include "mtt_AlgebraicSolver.hh" - - -namespace MTT -{ - class HJ_Solver : public MTT::AlgebraicSolver - { - // http://www.netlib.org/opt/hooke.c - // Hooke and Jeeves solution - - public: - - HJ_Solver (const int npar, - const int nu, - const int nx, - const int ny, - const int nyz) - : MTT::AlgebraicSolver (npar,nu,nx,ny,nyz) - { - static_ptr = this; - VARS = nyz; - } - - static double - f (double tryUi[], int nyz); - - ~HJ_Solver (void) {}; - - protected: - - void - Solve (void); - - double - best_nearby (double delta[], - double point[], - double prevbest, - int nvars); - - int - hooke (int nvars, // MTTNYZ - double startpt[], // user's initial guess - double endpt[], // result - double rho = 0.05, // geometric shrink factor - double epsilon = 1e-3, // end value stepsize - int itermax = 5000); // max # iterations - - private: - - int VARS; - - public: - - static HJ_Solver *static_ptr; - - }; -} - - -#endif // MTT_HJSOLVER DELETED mttroot/mtt/lib/cc/mtt_Hybrd_Solver.cc Index: mttroot/mtt/lib/cc/mtt_Hybrd_Solver.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_Hybrd_Solver.cc +++ mttroot/mtt/lib/cc/mtt_Hybrd_Solver.cc @@ -1,73 +0,0 @@ - -#include "mtt_Hybrd_Solver.hh" - -// http://www.netlib.org/minpack/hybrd.f -// used by Octave's fsolve - -MTT::Hybrd_Solver *MTT::Hybrd_Solver::static_ptr; - -ColumnVector -MTT::Hybrd_Solver::f_hybrd (const ColumnVector &tryUi) -{ - MTT::Hybrd_Solver::static_ptr->_yz = MTT::Hybrd_Solver::static_ptr->eval(tryUi); - return MTT::Hybrd_Solver::static_ptr->_yz; -} - -void -MTT::Hybrd_Solver::Solve (void) -{ - static std::fstream ferr ("MTT.Hybrd_messages", std::ios::out | std::ios::trunc | std::ios::app); - int info; - static int input_errors; - static int user_errors; - static int convergences; - static int progress_errors; - static int limit_errors; - static int unknown_errors; - - NLFunc fcn(&Hybrd_Solver::f_hybrd); - NLEqn eqn(Solver::_ui,fcn); - // eqn.set_tolerance(1.0e-20); - Solver::_ui = eqn.solve(info); - - switch (info) - { - case 1: - convergences++; - break; - case -2: - input_errors++; - break; - case -1: - user_errors++; - break; - case 3: - progress_errors++; - break; - case 4: - limit_errors++; - break; - default: - unknown_errors++; - break; - } - std::clog.setf (std::ios::scientific); - if (1 != info) - { - std::clog - << "\r" - << " time " << _t << " \t" - << " converge (" << convergences << ") " - << " limit (" << limit_errors << ")" - << " progress (" << progress_errors << ")" - << " other (" << input_errors + user_errors + unknown_errors << ") " - << " (max error = " << std::abs (eval(_ui).max()) << ")" - << std::endl; - } - else - { - std::clog - << "\r time " << _t << "\t max error = " << std::abs (eval(_ui).max()); - } - ferr << info << " "; -} DELETED mttroot/mtt/lib/cc/mtt_Hybrd_Solver.hh Index: mttroot/mtt/lib/cc/mtt_Hybrd_Solver.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_Hybrd_Solver.hh +++ mttroot/mtt/lib/cc/mtt_Hybrd_Solver.hh @@ -1,47 +0,0 @@ - -#ifndef MTT_HYBRDSOLVER -#define MTT_HYBRDSOLVER - -#include - -#include -#include "mtt_AlgebraicSolver.hh" - - -namespace MTT -{ - class Hybrd_Solver : public MTT::AlgebraicSolver - { - // http://www.netlib.org/minpack/hybrd.f - // used by Octave's fsolve - - public: - - Hybrd_Solver (const int npar, - const int nu, - const int nx, - const int ny, - const int nyz) - : MTT::AlgebraicSolver (npar,nu,nx,ny,nyz) - { - static_ptr = this; - } - - static ColumnVector - f_hybrd (const ColumnVector &tryUi); - - ~Hybrd_Solver (void) {}; - - protected: - - void - Solve (void); - - public: - - static Hybrd_Solver *static_ptr; - }; -} - - -#endif // MTT_HYBRDSOLVER DELETED mttroot/mtt/lib/cc/mtt_Reduce_Solver.cc Index: mttroot/mtt/lib/cc/mtt_Reduce_Solver.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_Reduce_Solver.cc +++ mttroot/mtt/lib/cc/mtt_Reduce_Solver.cc @@ -1,17 +0,0 @@ - -#include "mtt_Reduce_Solver.hh" - -void -MTT::Reduce_Solver::Solve (void) -{ - ; -} - -ColumnVector -MTT::Reduce_Solver::solve (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ - return u; -} DELETED mttroot/mtt/lib/cc/mtt_Reduce_Solver.hh Index: mttroot/mtt/lib/cc/mtt_Reduce_Solver.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_Reduce_Solver.hh +++ mttroot/mtt/lib/cc/mtt_Reduce_Solver.hh @@ -1,41 +0,0 @@ - -#ifndef MTT_REDUCESOLVER -#define MTT_REDUCESOLVER - - -#include "mtt_AlgebraicSolver.hh" - - -namespace MTT -{ - class Reduce_Solver : public MTT::AlgebraicSolver - { - // Dummy class - // This will not be used unless the Reduce solver has failed earlier - // in the model build process - - public: - - Reduce_Solver (const int npar, - const int nu, - const int nx, - const int ny, - const int nyz) - : AlgebraicSolver (npar,nu,nx,ny,nyz) - {;} - - void - Solve (void); - - ColumnVector - solve (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - - ~Reduce_Solver (void) {}; - }; -} - - -#endif // MTT_REDUCESOLVER DELETED mttroot/mtt/lib/cc/mtt_Solver.cc Index: mttroot/mtt/lib/cc/mtt_Solver.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_Solver.cc +++ mttroot/mtt/lib/cc/mtt_Solver.cc @@ -1,17 +0,0 @@ - -#include "mtt_Solver.hh" - -MTT::Solver::Solver (const int npar, - const int nu, - const int nx, - const int ny, - const int nyz) -{ - _np = npar; - _nu = nu; - _nx = nx; - _ny = ny; - _nyz = nyz; - _ui = ColumnVector (_nyz,0.0); - _uui = ColumnVector (_nu+_nyz); -}; DELETED mttroot/mtt/lib/cc/mtt_Solver.hh Index: mttroot/mtt/lib/cc/mtt_Solver.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_Solver.hh +++ mttroot/mtt/lib/cc/mtt_Solver.hh @@ -1,47 +0,0 @@ - -#ifndef MTT_SOLVER -#define MTT_SOLVER - - -#include -#include -#include - -#include - - -namespace MTT -{ - class Solver - { - public: - - Solver (const int npar, - const int nu, - const int nx, - const int ny, - const int nyz); - - virtual ~Solver (void) {}; - - protected: - - ColumnVector _x; - ColumnVector _uui; - double _t; - ColumnVector _par; - - ColumnVector _ui; - ColumnVector _yz; - - int _nu; - int _np; - int _nx; - int _ny; - int _nyz; - }; -} - - -#endif // MTT_SOLVER - DELETED mttroot/mtt/lib/cc/mtt_dassl.cc Index: mttroot/mtt/lib/cc/mtt_dassl.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_dassl.cc +++ mttroot/mtt/lib/cc/mtt_dassl.cc @@ -1,93 +0,0 @@ - -#include -#include - - -#ifdef OCTAVE_DEV -#include -#define VECTOR_VALUE column_vector_value -#else // !OCTAVE_DEV -#include -#define VECTOR_VALUE vector_value -#endif // OCTAVE_DEV - -// Code generation directives -#define STANDALONE 0 -#define OCTAVEDLD 1 -#if (! defined (CODEGENTARGET)) -#define CODEGENTARGET STANDALONE -#endif // (! defined (CODEGENTARGET)) - -#if (CODEGENTARGET == STANDALONE) -extern ColumnVector -Fmtt_residual (const ColumnVector &X, const ColumnVector &DX, double t, int &ires); -#endif // (CODEGENTARGET == STANDALONE) - - -ColumnVector -mtt_residual (const ColumnVector &X, const ColumnVector &DX, double t, int &ires) -{ -#if (CODEGENTARGET == STANDALONE) - return Fmtt_residual (X, DX, t, ires); -#elif (CODEGENTARGET == OCTAVEDLD) - static octave_value_list args, f; - args(0) = octave_value (X); - args(1) = octave_value (DX); - args(2) = octave_value (t); - args(3) = octave_value (static_cast(ires)); - f = feval ("mtt_residual", args, 1); - return f(0).VECTOR_VALUE (); -#endif // (CODEGENTARGET == STANDALONE) -} - - -#if (CODEGENTARGET == STANDALONE) -ColumnVector -Fmtt_dassl ( ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par, - const ColumnVector &dx, - const double &ddt, - const int Nx, - const int Nyz, - const ColumnVector &openx) -{ -#elif (CODEGENTARGET == OCTAVEDLD) -DEFUN_DLD (mtt_dassl, args, , - "dassl integration method") -{ - ColumnVector x = args(0).VECTOR_VALUE(); - const ColumnVector u = args(1).VECTOR_VALUE(); - const double t = args(2).double_value(); - const ColumnVector par = args(3).VECTOR_VALUE(); - const ColumnVector dx = args(4).VECTOR_VALUE(); - const double ddt = args(5).double_value(); - const int Nx = static_cast (args(6).double_value()); - const int Nyz = static_cast (args(7).double_value()); - const ColumnVector openx = args(8).VECTOR_VALUE(); -#endif // (CODEGENTARGET == STANDALONE) - - static DAEFunc fdae(mtt_residual); - static ColumnVector XX (Nx+Nyz); - XX.insert (x,0); - - for (register int i = Nx; i < Nx+Nyz; i++) - XX(i) = 0.0; - - double tout = t + ddt; - - DASSL fdassl (XX, t, fdae); - x = fdassl.do_integrate (tout).extract (0,Nx-1); - - for (register int i = 0; i < Nx; i++) - if (openx (i) > 0.5) - x (i) = 0.0; - - -#if (CODEGENTARGET == STANDALONE) - return x; -#elif (CODEGENTARGET == OCTAVEDLD) - return octave_value (x); -#endif // (CODEGENTARGET == STANDALONE) -} DELETED mttroot/mtt/lib/cc/mtt_euler.cc Index: mttroot/mtt/lib/cc/mtt_euler.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_euler.cc +++ mttroot/mtt/lib/cc/mtt_euler.cc @@ -1,53 +0,0 @@ -#include - -#ifdef OCTAVE_DEV -#define VECTOR_VALUE column_vector_value -#else // !OCTAVE_DEV -#define VECTOR_VALUE vector_value -#endif // OCTAVE_DEV - -// Code generation directives -#define STANDALONE 0 -#define OCTAVEDLD 1 -#if (! defined (CODEGENTARGET)) -#define CODEGENTARGET STANDALONE -#endif // (! defined (CODEGENTARGET)) - -#if (CODEGENTARGET == STANDALONE) -ColumnVector Fmtt_euler ( ColumnVector &x, - const ColumnVector &dx, - const double &ddt, - const int &Nx, - const ColumnVector &openx) -{ -#elif (CODEGENTARGET == OCTAVEDLD) -DEFUN_DLD (mtt_euler, args, , - "euler integration method") -{ - ColumnVector x = args(0).VECTOR_VALUE (); - const ColumnVector dx = args(1).VECTOR_VALUE (); - const double ddt = args(2).double_value (); - const int Nx = static_cast (args(3).double_value ()); - const ColumnVector openx = args(4).VECTOR_VALUE (); -#endif // (CODEGENTARGET == STANDALONE) - - register int i, n; - - n = Nx; - for (i = 0; i < Nx; i++) - { - if (0 != openx (i)) - { - x (i) = 0.0; - } - else - { - x (i) += dx (i) * ddt; - } - } -#if (CODEGENTARGET == STANDALONE) - return x; -#elif (CODEGENTARGET == OCTAVEDLD) - return octave_value (x); -#endif // (CODEGENTARGET == STANDALONE) -} DELETED mttroot/mtt/lib/cc/mtt_implicit.cc Index: mttroot/mtt/lib/cc/mtt_implicit.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_implicit.cc +++ mttroot/mtt/lib/cc/mtt_implicit.cc @@ -1,78 +0,0 @@ -#include -#include - -#ifdef OCTAVE_DEV -#define VECTOR_VALUE column_vector_value -#else // !OCTAVE_DEV -#define VECTOR_VALUE vector_value -#endif // OCTAVE_DEV - -// Code generation directives -#define STANDALONE 0 -#define OCTAVEDLD 1 -#if (! defined (CODEGENTARGET)) -#define CODEGENTARGET STANDALONE -#endif // (! defined (CODEGENTARGET)) - -#if (CODEGENTARGET == STANDALONE) -ColumnVector Fmtt_implicit ( ColumnVector &x, - ColumnVector &dx, - Matrix &AA, - ColumnVector &AAx, - const double &t, - const int &Nx, - const ColumnVector &openx) -{ -#elif (CODEGENTARGET == OCTAVEDLD) -DEFUN_DLD (mtt_implicit, args, , - "implicit integration method") -{ - ColumnVector x = args(0).VECTOR_VALUE (); - ColumnVector dx = args(1).VECTOR_VALUE (); - Matrix AA = args(2).matrix_value (); - ColumnVector AAx = args(3).VECTOR_VALUE (); - const double t = args(4).double_value (); - const int Nx = (int) (args(5).double_value ()); - const ColumnVector openx = args(6).VECTOR_VALUE (); -#endif // (CODEGENTARGET == STANDALONE) - - register int row, col; - - for (row = 0; row < Nx; row++) - { - if (openx (row) > 0.5) - { - AAx (row) = 0.0; - dx (row) = 0.0; - for (col = 0; col < Nx; col++) - { - AA (row,col) = 0.0; - AA (col,row) = 0.0; - } - } - } - -#ifdef OCTAVE_DEV - x = xleftdiv (AA, Matrix(AAx + dx * t)).column (0); -#else // !OCTAVE_DEV - Matrix tmp = xleftdiv (AA, static_cast(static_cast(AAx + dx * t))); - for (row = 0; row < Nx; row++) - { - x (row) = tmp (row,0); - } -#endif // OCTAVE_DEV - - for (row = 0; row < Nx; row++) - { - if (openx (row) > 0.5) - { - x (row) = 0.0; - } - } - -#if (CODEGENTARGET == STANDALONE) - return x; -#elif (CODEGENTARGET == OCTAVEDLD) - return octave_value (x); -#endif // (CODEGENTARGET == STANDALONE) -} DELETED mttroot/mtt/lib/cc/mtt_kpathsea.cc Index: mttroot/mtt/lib/cc/mtt_kpathsea.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_kpathsea.cc +++ mttroot/mtt/lib/cc/mtt_kpathsea.cc @@ -1,4 +0,0 @@ - -extern "C" { - int kpse_clear_dir_cache (void) {return 0;} -} DELETED mttroot/mtt/lib/cc/mtt_matlab_octave.cc Index: mttroot/mtt/lib/cc/mtt_matlab_octave.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_matlab_octave.cc +++ mttroot/mtt/lib/cc/mtt_matlab_octave.cc @@ -1,66 +0,0 @@ - -#include -#include - - -// conversions from Matlab mxArray* to Octave data types - -Matrix -mtt_Matrix (const mxArray *m) -{ - const unsigned long int nrows = mxGetM (m); - const unsigned long int ncols = mxGetN (m); - Matrix o (nrows, ncols); - const double *p = mxGetPr (m); - for (unsigned long int row = 0; row < nrows; row++) - for (unsigned long int col = 0; col < ncols; col++) - o (row, col) = p[row + nrows*col]; - return (o); -} - -ColumnVector -mtt_ColumnVector (const mxArray *m) -{ - const unsigned long int nrows = mxGetM (m); - ColumnVector o (nrows); - const double *p = mxGetPr (m); - for (unsigned long int row = 0; row < nrows; row++) - o (row) = p[row]; - return (o); -} - -const double -mtt_double (const mxArray *m) -{ - const double *p = mxGetPr (m); - return (*p); -} - - -// conversions from Octave data types to Matlab mxArray* - -mxArray * -mtt_mxArray (const Matrix &o) -{ - const unsigned long int nrows = o.rows (); - const unsigned long int ncols = o.columns (); - mxArray *m; - m = mxCreateDoubleMatrix (nrows, ncols, mxREAL); - double *p = mxGetPr (m); - for (unsigned long int row = 0; row < nrows; row++) - for (unsigned long int col = 0; col < ncols; col++) - p [row + nrows*col] = o (row, col); - return (m); -} - -mxArray * -mtt_mxArray (const ColumnVector &o) -{ - const unsigned long int nrows = o.length (); - mxArray *m; - m = mxCreateDoubleMatrix (nrows, 1, mxREAL); - double *p = mxGetPr (m); - for (unsigned long int row = 0; row < nrows; row++) - p [row] = o (row); - return (m); -} DELETED mttroot/mtt/lib/cc/mtt_matlab_octave.hh Index: mttroot/mtt/lib/cc/mtt_matlab_octave.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_matlab_octave.hh +++ mttroot/mtt/lib/cc/mtt_matlab_octave.hh @@ -1,28 +0,0 @@ - -#ifndef MTT_MATLAB_OCTAVE_HH -#define MTT_MATLAB_OCTAVE_HH - -#include -#include - -// conversions from Matlab mxArray* to Octave data types - -extern Matrix -mtt_Matrix (const mxArray *m); - -extern ColumnVector -mtt_ColumnVector (const mxArray *m); - -extern const double -mtt_double (const mxArray *m); - - -// conversions from Octave data types to Matlab mxArray* - -extern mxArray * -mtt_mxArray (const Matrix &o); - -extern mxArray * -mtt_mxArray (const ColumnVector &o); - -#endif // MTT_MATLAB_OCTAVE_HH DELETED mttroot/mtt/lib/cc/mtt_noAlgebraicSolver.cc Index: mttroot/mtt/lib/cc/mtt_noAlgebraicSolver.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_noAlgebraicSolver.cc +++ mttroot/mtt/lib/cc/mtt_noAlgebraicSolver.cc @@ -1,17 +0,0 @@ - -#include "mtt_noAlgebraicSolver.hh" - -void -MTT::noAlgebraicSolver::Solve (void) -{ - ; -} - -ColumnVector -MTT::noAlgebraicSolver::solve (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par) -{ - return u; -} DELETED mttroot/mtt/lib/cc/mtt_noAlgebraicSolver.hh Index: mttroot/mtt/lib/cc/mtt_noAlgebraicSolver.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_noAlgebraicSolver.hh +++ mttroot/mtt/lib/cc/mtt_noAlgebraicSolver.hh @@ -1,39 +0,0 @@ - -#ifndef MTT_REDUCESOLVER -#define MTT_REDUCESOLVER - - -#include "mtt_AlgebraicSolver.hh" - - -namespace MTT -{ - class noAlgebraicSolver : public MTT::AlgebraicSolver - { - // Dummy class - - public: - - noAlgebraicSolver (const int npar, - const int nu, - const int nx, - const int ny, - const int nyz) - : AlgebraicSolver (npar,nu,nx,ny,nyz) - {;} - - void - Solve (void); - - ColumnVector - solve (const ColumnVector &x, - const ColumnVector &u, - const double &t, - const ColumnVector &par); - - ~noAlgebraicSolver (void) {}; - }; -} - - -#endif // MTT_REDUCESOLVER DELETED mttroot/mtt/lib/cc/mtt_simpar.hh Index: mttroot/mtt/lib/cc/mtt_simpar.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_simpar.hh +++ mttroot/mtt/lib/cc/mtt_simpar.hh @@ -1,37 +0,0 @@ - -#include -#include - -static ColumnVector -mtt_simpar (Octave_map simpar) -{ - static ColumnVector retval (8); - - retval (0) = simpar.contents (simpar.seek ("first" ))(0).double_value (); - retval (1) = simpar.contents (simpar.seek ("last" ))(0).double_value (); - retval (2) = simpar.contents (simpar.seek ("dt" ))(0).double_value (); - retval (3) = simpar.contents (simpar.seek ("stepfactor"))(0).double_value (); - retval (4) = simpar.contents (simpar.seek ("wmin" ))(0).double_value (); - retval (5) = simpar.contents (simpar.seek ("wmax" ))(0).double_value (); - retval (6) = simpar.contents (simpar.seek ("wsteps" ))(0).double_value (); - retval (7) = simpar.contents (simpar.seek ("input" ))(0).double_value (); - - return retval; -} - -static Octave_map -mtt_simpar (ColumnVector simpar) -{ - static Octave_map retval; - - retval.assign ("first" , simpar (0)); - retval.assign ("last" , simpar (1)); - retval.assign ("dt" , simpar (2)); - retval.assign ("stepfactor", simpar (3)); - retval.assign ("wmin" , simpar (4)); - retval.assign ("wmax" , simpar (5)); - retval.assign ("wsteps" , simpar (6)); - retval.assign ("input" , simpar (7)); - - return retval; -} DELETED mttroot/mtt/lib/comp/compound/Bicausal/B2U/B2U_abg.fig Index: mttroot/mtt/lib/comp/compound/Bicausal/B2U/B2U_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Bicausal/B2U/B2U_abg.fig +++ mttroot/mtt/lib/comp/compound/Bicausal/B2U/B2U_abg.fig @@ -1,43 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1350 6525 2700 6525 2475 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2925 6300 2925 4950 3150 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 6525 4500 6525 4275 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 6300 4725 4950 4950 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 6525 6300 6525 6075 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2925 4500 2925 3150 3150 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 4500 4725 3150 4950 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 1350 6525 1350 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2700 6300 2700 6525 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3150 6525 3150 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4500 6300 4500 6525 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4950 6525 4950 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6300 6300 6300 6525 -4 2 4 100 0 18 18 0.0000 4 270 930 1260 6615 SS:[ef]\001 -4 1 0 100 0 18 18 0.0000 4 195 150 2925 6615 0\001 -4 1 0 100 0 18 18 0.0000 4 210 405 2925 4815 AE\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4725 6615 1\001 -4 1 0 100 0 18 18 0.0000 4 210 390 4725 4815 AF\001 -4 1 0 100 0 18 18 0.0000 4 210 630 6795 6615 SS:ii\001 -4 1 4 100 0 18 18 0.0000 4 270 825 2925 3015 SS:[e]\001 -4 1 4 100 0 18 18 0.0000 4 270 765 4680 3015 SS:[f]\001 DELETED mttroot/mtt/lib/comp/compound/Bicausal/B2U/B2U_lbl.txt Index: mttroot/mtt/lib/comp/compound/Bicausal/B2U/B2U_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Bicausal/B2U/B2U_lbl.txt +++ mttroot/mtt/lib/comp/compound/Bicausal/B2U/B2U_lbl.txt @@ -1,48 +0,0 @@ -#SUMMARY B2U: undoes a bicausal bond -#DESCRIPTION Takes e and f from bicausal bond at port [ef] -#DESCRIPTION and gives corresponding unicausal bonds at ports [e] and [f] - -## System B2U, representation lbl, language txt -## File B2U_lbl.txt -## Generated by MTT on Thu Jul 8 09:59:03 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS e e -#ALIAS ef ef -#ALIAS f f - -## Argument aliases - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type AE (anonymous => default parameters) - # AE - -## Component type AF (anonymous => default parameters) - # AF - -## Component type SS - [e] SS external,0 - [f] SS 0,external - ii SS internal,internal - [ef] SS external,0 - DELETED mttroot/mtt/lib/comp/compound/Bicausal/U2B/U2B_abg.fig Index: mttroot/mtt/lib/comp/compound/Bicausal/U2B/U2B_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Bicausal/U2B/U2B_abg.fig +++ mttroot/mtt/lib/comp/compound/Bicausal/U2B/U2B_abg.fig @@ -1,57 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 1350 6975 1350 6750 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5400 2925 5400 1575 5625 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 3150 3150 3150 2925 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 3150 5175 3150 4950 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 1350 3150 1350 2925 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 1350 5175 1350 4950 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5400 4725 5400 3375 5625 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 4725 5625 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 3375 5400 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 1575 5400 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 2925 5625 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 2925 3825 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 1125 5175 1575 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 8550 5175 675 5175 675 675 8550 675 8550 5175 -4 1 0 100 0 18 18 0.0000 4 210 390 3465 3240 AF\001 -4 1 0 100 0 18 18 0.0000 4 195 150 5400 3240 0\001 -4 2 4 100 0 18 18 0.0000 4 270 765 1710 3240 SS:[f]\001 -4 1 0 100 0 18 18 0.0000 4 210 405 3465 1440 AE\001 -4 1 0 100 0 18 18 0.0000 4 195 150 5400 1440 1\001 -4 2 4 100 0 18 18 0.0000 4 270 825 1710 1440 SS:[e]\001 -4 1 0 100 0 18 18 0.0000 4 210 780 5400 5085 SS:zz\001 -4 0 4 100 0 18 18 0.0000 4 270 1095 7110 1440 SS:[ef]\001 -4 1 1 101 0 3 20 0.0000 4 165 150 4500 1125 e\001 -4 1 1 101 0 3 20 0.0000 4 165 150 6300 1125 e\001 -4 1 1 101 0 3 20 0.0000 4 165 150 2475 1125 e\001 -4 1 1 101 0 3 20 0.0000 4 315 105 2475 3510 f\001 -4 1 1 101 0 3 20 0.0000 4 315 105 4500 3510 f\001 -4 1 1 101 0 3 20 0.0000 4 315 105 6300 1710 f\001 -4 1 1 101 0 3 20 0.0000 4 315 105 5625 2385 f\001 -4 1 1 101 0 3 20 0.0000 4 225 165 2520 1665 0\001 -4 1 1 101 0 3 20 0.0000 4 225 165 2520 3015 0\001 -4 1 1 101 0 3 20 0.0000 4 225 165 5220 4140 0\001 -4 1 1 101 0 3 20 0.0000 4 225 165 5625 4140 0\001 -4 1 1 101 0 3 20 0.0000 4 225 165 5220 2385 0\001 DELETED mttroot/mtt/lib/comp/compound/Bicausal/U2B/U2B_lbl.txt Index: mttroot/mtt/lib/comp/compound/Bicausal/U2B/U2B_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Bicausal/U2B/U2B_lbl.txt +++ mttroot/mtt/lib/comp/compound/Bicausal/U2B/U2B_lbl.txt @@ -1,42 +0,0 @@ -#SUMMARY U2B: makes a bicausal bond -#DESCRIPTION Takes e and f from ports [e] and [f] and gives corresponding -#DESCRIPTION bicausal bond at port [ef]. - -## System U2B, representation lbl, language txt -## File U2B_lbl.txt -## Generated by MTT on Thu Jul 8 08:38:15 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS e e -#ALIAS f f -#ALIAS out ef - -## Argument aliases - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type SS - [e] SS external,internal - [f] SS internal,external - [ef] SS internal,external - zz SS 0,0 - DELETED mttroot/mtt/lib/comp/compound/Bicausal/VJe/VJe_abg.fig Index: mttroot/mtt/lib/comp/compound/Bicausal/VJe/VJe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Bicausal/VJe/VJe_abg.fig +++ mttroot/mtt/lib/comp/compound/Bicausal/VJe/VJe_abg.fig @@ -1,112 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3735 675 4455 990 -4 1 1 101 0 3 20 0.0000 4 105 195 4095 855 =\001 -4 1 1 101 0 3 20 0.0000 4 165 150 3847 855 e\001 -4 1 1 101 0 3 20 0.0000 4 150 150 3937 990 c\001 -4 1 1 101 0 3 20 0.0000 4 165 150 4282 855 e\001 -4 1 1 101 0 3 20 0.0000 4 150 135 4372 990 s\001 --6 -6 3915 1170 4185 1575 -4 1 1 101 0 3 20 0.0000 4 315 105 3982 1440 f\001 -4 1 1 101 0 3 20 0.0000 4 150 150 4072 1575 c\001 --6 -6 5940 1170 6210 1575 -4 1 1 101 0 3 20 0.0000 4 315 105 6007 1440 f\001 -4 1 1 101 0 3 20 0.0000 4 150 150 6097 1575 c\001 --6 -6 5715 2520 5985 2835 -4 1 1 101 0 3 20 0.0000 4 165 150 5812 2700 e\001 -4 1 1 101 0 3 20 0.0000 4 150 135 5902 2835 s\001 --6 -6 4590 1890 4860 2205 -4 1 1 101 0 3 20 0.0000 4 165 150 4687 2070 e\001 -4 1 1 101 0 3 20 0.0000 4 150 135 4777 2205 s\001 --6 -6 7110 3510 7380 3915 -4 1 1 101 0 3 20 0.0000 4 315 105 7177 3780 f\001 -4 1 1 101 0 3 20 0.0000 4 150 150 7267 3915 c\001 --6 -6 6075 3555 6795 3870 -4 1 1 101 0 3 20 0.0000 4 105 195 6435 3735 =\001 -4 1 1 101 0 3 20 0.0000 4 165 150 6187 3735 e\001 -4 1 1 101 0 3 20 0.0000 4 150 150 6277 3870 c\001 -4 1 1 101 0 3 20 0.0000 4 165 150 6622 3735 e\001 -4 1 1 101 0 3 20 0.0000 4 150 135 6712 3870 s\001 --6 -6 5715 4320 5985 4635 -4 1 1 101 0 3 20 0.0000 4 180 180 5812 4500 u\001 -4 1 1 101 0 3 20 0.0000 4 165 150 5902 4635 e\001 --6 -6 5715 4815 5985 5220 -4 1 1 101 0 3 20 0.0000 4 180 180 5812 4995 u\001 -4 1 1 101 0 3 20 0.0000 4 315 105 5902 5130 f\001 --6 -6 3240 4095 3510 4410 -4 1 1 101 0 3 20 0.0000 4 180 180 3337 4275 u\001 -4 1 1 101 0 3 20 0.0000 4 165 150 3427 4410 e\001 --6 -6 3240 4995 3510 5400 -4 1 1 101 0 3 20 0.0000 4 180 180 3337 5175 u\001 -4 1 1 101 0 3 20 0.0000 4 315 105 3427 5310 f\001 --6 -6 1755 2520 2025 2835 -4 1 1 101 0 3 20 0.0000 4 165 150 1852 2700 e\001 -4 1 1 101 0 3 20 0.0000 4 150 135 1942 2835 s\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 2925 4725 2925 4500 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5220 2925 6570 2925 6345 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 5175 1125 6975 1125 6975 2700 7200 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4500 2925 4500 3150 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4950 2925 4950 3150 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 2700 4725 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 1125 4725 1125 4500 1350 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1305 2925 2655 2925 2430 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6975 3150 6975 4500 7200 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6525 4725 5175 4725 5400 4950 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2025 4950 675 4950 900 5175 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 7425 5625 -675 5625 -675 450 7425 450 7425 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2025 4500 675 4500 900 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 2700 4950 1350 5175 1575 -4 1 0 100 0 18 18 0.0000 4 195 150 4950 3015 0\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4950 1215 1\001 -4 2 4 100 0 18 18 0.0000 4 270 1065 3285 1215 SS:[PC]\001 -4 1 0 100 0 18 18 0.0000 4 210 570 6975 3015 U2B\001 -4 1 0 100 0 18 18 0.0000 4 210 570 4725 4815 B2U\001 -4 1 4 100 0 18 14 0.0000 4 225 285 6345 2790 [e]\001 -4 1 4 100 0 18 14 0.0000 4 240 225 6795 2520 [f]\001 -4 1 4 100 0 18 14 0.0000 4 240 360 6750 3375 [ef]\001 -4 1 4 100 0 18 14 0.0000 4 225 285 4050 4365 [e]\001 -4 1 4 100 0 18 14 0.0000 4 240 225 4050 5265 [f]\001 -4 1 4 100 0 18 14 0.0000 4 240 360 5220 4545 [ef]\001 -4 1 1 101 0 3 20 0.0000 4 225 165 6075 990 0\001 -4 1 0 100 0 18 18 0.0000 4 195 540 6885 4815 tra:t\001 -4 2 4 100 0 18 14 0.0000 4 225 360 6480 4995 [in]\001 -4 2 4 100 0 18 14 0.0000 4 225 525 6840 4410 [out]\001 -4 1 0 100 0 18 18 0.0000 4 210 750 2970 3015 AE:m\001 -4 2 4 100 0 18 18 0.0000 4 270 900 1215 3015 SS:[in]\001 -4 2 4 100 0 18 18 0.0000 4 270 1080 585 5085 SS:[u_f]\001 -4 2 4 100 0 18 18 0.0000 4 270 1140 585 4590 SS:[u_e]\001 -4 1 0 100 0 18 18 0.0000 4 210 660 2430 4590 AE:e\001 -4 1 0 100 0 18 18 0.0000 4 210 585 2430 5040 AF:f\001 DELETED mttroot/mtt/lib/comp/compound/Bicausal/VJe/VJe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Bicausal/VJe/VJe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Bicausal/VJe/VJe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Bicausal/VJe/VJe_lbl.txt @@ -1,61 +0,0 @@ -#SUMMARY VJe Virtual Junction - effort input -#DESCRIPTION Virtual junction with effort input -#DESCRIPTION User must supply the transfer system tra -#DESCRIPTION tra can have up to 9 parameters passed to it -#DESCRIPTION using parameters of VJe - -## System VJe, representation lbl, language txt -## File VJe_lbl.txt -## Generated by MTT on Thu Jul 8 11:41:51 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases - -## Argument aliases -#ALIAS $1 p_1 -#ALIAS $2 p_2 -#ALIAS $3 p_3 -#ALIAS $4 p_4 -#ALIAS $5 p_5 -#ALIAS $6 p_6 -#ALIAS $7 p_7 -#ALIAS $8 p_8 -#ALIAS $9 p_9 - - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type AE/AF - e lin -1 - f lin -1 - m lin -1 - -## Component type tra - t lin p_1;p_2;p_3;p_4;p_5;p_6;p_7;p_8;p_9 - -## Component type SS - [in] SS external,internal - [u_e] SS external,0 - [u_f] SS 0,external - [PC] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Bicausal/VJf/VJf_abg.fig Index: mttroot/mtt/lib/comp/compound/Bicausal/VJf/VJf_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Bicausal/VJf/VJf_abg.fig +++ mttroot/mtt/lib/comp/compound/Bicausal/VJf/VJf_abg.fig @@ -1,106 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 7110 3510 7380 3915 -4 1 1 101 0 3 20 0.0000 4 315 105 7177 3780 f\001 -4 1 1 101 0 3 20 0.0000 4 150 150 7267 3915 c\001 --6 -6 6075 3555 6795 3870 -4 1 1 101 0 3 20 0.0000 4 105 195 6435 3735 =\001 -4 1 1 101 0 3 20 0.0000 4 165 150 6187 3735 e\001 -4 1 1 101 0 3 20 0.0000 4 150 150 6277 3870 c\001 -4 1 1 101 0 3 20 0.0000 4 165 150 6622 3735 e\001 -4 1 1 101 0 3 20 0.0000 4 150 135 6712 3870 s\001 --6 -6 5715 4320 5985 4635 -4 1 1 101 0 3 20 0.0000 4 180 180 5812 4500 u\001 -4 1 1 101 0 3 20 0.0000 4 165 150 5902 4635 e\001 --6 -6 5715 4815 5985 5220 -4 1 1 101 0 3 20 0.0000 4 180 180 5812 4995 u\001 -4 1 1 101 0 3 20 0.0000 4 315 105 5902 5130 f\001 --6 -6 3240 4095 3510 4410 -4 1 1 101 0 3 20 0.0000 4 180 180 3337 4275 u\001 -4 1 1 101 0 3 20 0.0000 4 165 150 3427 4410 e\001 --6 -6 3240 4995 3510 5400 -4 1 1 101 0 3 20 0.0000 4 180 180 3337 5175 u\001 -4 1 1 101 0 3 20 0.0000 4 315 105 3427 5310 f\001 --6 -6 2160 3015 2385 3420 -4 1 1 101 0 3 20 0.0000 4 315 105 2212 3285 f\001 -4 1 1 101 0 3 20 0.0000 4 150 135 2302 3420 s\001 --6 -6 5715 3015 5940 3420 -4 1 1 101 0 3 20 0.0000 4 315 105 5767 3285 f\001 -4 1 1 101 0 3 20 0.0000 4 150 135 5857 3420 s\001 --6 -6 5085 1845 5310 2250 -4 1 1 101 0 3 20 0.0000 4 315 105 5137 2115 f\001 -4 1 1 101 0 3 20 0.0000 4 150 135 5227 2250 s\001 --6 -6 5940 675 6255 990 -4 1 1 101 0 3 20 0.0000 4 165 150 6052 855 e\001 -4 1 1 101 0 3 20 0.0000 4 150 150 6142 990 c\001 --6 -6 3645 1305 4320 1710 -4 1 1 101 0 3 20 0.0000 4 105 195 3960 1575 =\001 -4 1 1 101 0 3 20 0.0000 4 315 105 3712 1575 f\001 -4 1 1 101 0 3 20 0.0000 4 150 150 3802 1710 c\001 -4 1 1 101 0 3 20 0.0000 4 315 105 4147 1575 f\001 -4 1 1 101 0 3 20 0.0000 4 150 135 4237 1710 s\001 --6 -6 3825 675 4140 990 -4 1 1 101 0 3 20 0.0000 4 165 150 3937 855 e\001 -4 1 1 101 0 3 20 0.0000 4 150 150 4027 990 c\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 2925 4725 2925 4500 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 2700 4950 1350 5175 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1575 2925 2925 2925 2700 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5220 2925 6570 2925 6345 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 5175 1125 6975 1125 6975 2700 7200 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6975 3150 6975 4500 7200 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6525 4725 5175 4725 5400 4950 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4500 2925 4500 3150 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4950 2925 4950 3150 5175 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 7425 5625 450 5625 450 450 7425 450 7425 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 1125 4725 1125 4500 1350 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3375 2700 3375 3150 -4 1 0 100 0 18 18 0.0000 4 195 150 4950 1215 0\001 -4 1 0 100 0 18 18 0.0000 4 210 390 3150 3015 AF\001 -4 2 4 100 0 18 18 0.0000 4 270 900 1530 3015 SS:[in]\001 -4 2 4 100 0 18 18 0.0000 4 270 1065 3285 1215 SS:[PC]\001 -4 1 0 100 0 18 18 0.0000 4 210 570 6975 3015 U2B\001 -4 1 0 100 0 18 18 0.0000 4 210 615 6975 4815 tra:t\001 -4 2 4 100 0 18 18 0.0000 4 270 1140 2790 4545 SS:[u_e]\001 -4 2 4 100 0 18 18 0.0000 4 270 1080 2790 5040 SS:[u_f]\001 -4 1 0 100 0 18 18 0.0000 4 210 570 4725 4815 B2U\001 -4 1 4 100 0 18 14 0.0000 4 240 225 6345 2790 [f]\001 -4 1 4 100 0 18 14 0.0000 4 225 285 6795 2520 [e]\001 -4 1 4 100 0 18 14 0.0000 4 240 360 6750 3375 [ef]\001 -4 1 4 100 0 18 14 0.0000 4 225 360 6300 4995 [in]\001 -4 1 4 100 0 18 14 0.0000 4 225 285 4050 4365 [e]\001 -4 1 4 100 0 18 14 0.0000 4 240 225 4050 5265 [f]\001 -4 1 4 100 0 18 14 0.0000 4 240 360 5220 4545 [ef]\001 -4 1 4 100 0 18 14 0.0000 4 225 525 6660 4365 [out]\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4950 3015 1\001 -4 1 1 101 0 3 20 0.0000 4 225 165 6075 1530 0\001 DELETED mttroot/mtt/lib/comp/compound/Bicausal/VJf/VJf_lbl.txt Index: mttroot/mtt/lib/comp/compound/Bicausal/VJf/VJf_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Bicausal/VJf/VJf_lbl.txt +++ mttroot/mtt/lib/comp/compound/Bicausal/VJf/VJf_lbl.txt @@ -1,60 +0,0 @@ -#SUMMARY VJf Virtual Junction - flow input -#DESCRIPTION Virtual junction with flow input -#DESCRIPTION User must supply the transfer system tra -#DESCRIPTION tra can have up to 9 parameters passed to it -#DESCRIPTION using parameters of VJf - - -## System VJf, representation lbl, language txt -## File VJf_lbl.txt -## Generated by MTT on Thu Jul 8 11:41:51 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS PC PC -#ALIAS in in -#ALIAS u_e u_e -#ALIAS u_f u_f - -## Argument aliases -#ALIAS $1 p_1 -#ALIAS $2 p_2 -#ALIAS $3 p_3 -#ALIAS $4 p_4 -#ALIAS $5 p_5 -#ALIAS $6 p_6 -#ALIAS $7 p_7 -#ALIAS $8 p_8 -#ALIAS $9 p_9 - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type tra - t lin p_1;p_2;p_3;p_4;p_5;p_6;p_7;p_8;p_9 - -## Component type SS - [in] SS internal,external - [u_e] SS external,0 - [u_f] SS 0,external - [PC] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Chemical/Cm/Cm_abg.fig Index: mttroot/mtt/lib/comp/compound/Chemical/Cm/Cm_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Chemical/Cm/Cm_abg.fig +++ mttroot/mtt/lib/comp/compound/Chemical/Cm/Cm_abg.fig @@ -1,32 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5b -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 6300 4500 5625 4725 5850 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 5175 4500 4500 4725 4725 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 4275 6300 4725 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 7425 4500 6750 4725 6975 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 4275 7425 4725 7425 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 4050 4500 3375 4725 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 4275 5400 4275 5175 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5850 4275 6525 4275 6300 4500 -4 1 0 100 0 18 18 0.0000 4 210 390 4500 5490 AF\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4485 4365 0\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4485 6615 1\001 -4 1 4 100 0 18 18 0.0000 4 270 900 4500 7875 SS:[in]\001 -4 1 0 100 0 18 18 0.0000 4 210 510 4500 3285 C:C\001 -4 1 0 100 0 18 18 0.0000 4 210 405 5625 4365 AE\001 -4 0 4 100 0 18 18 0.0000 4 270 1095 6750 4365 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/Chemical/Cm/Cm_lbl.txt Index: mttroot/mtt/lib/comp/compound/Chemical/Cm/Cm_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Chemical/Cm/Cm_lbl.txt +++ mttroot/mtt/lib/comp/compound/Chemical/Cm/Cm_lbl.txt @@ -1,53 +0,0 @@ -#SUMMARY Cm Integrates [in] flow to give [out] effort - -#DESCRIPTION Zero effort imposed in [in]. Use with mC - -## System Cm, representation lbl, language txt -## File Cm_lbl.txt -## Generated by MTT on Tue Aug 13 15:52:46 EST 2013 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in -#ALIAS out out - -## Argument aliases - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - # 0 - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type AF (anonymous => default parameters) - # AF - -## Component type C - C lin state,1 - -## Component type SS -[in] SS external,external -[out] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_abg.fig Index: mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_abg.fig +++ mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_abg.fig @@ -1,30 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3780 2880 5220 3195 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 2925 5175 2925 4950 3150 --6 -6 1755 2880 3195 3195 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2925 3150 2925 2925 3150 --6 -6 3105 2655 3195 3195 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3150 2700 3150 3150 --6 -6 3780 2655 3870 3195 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 2700 3825 3150 --6 -4 1 0 100 0 18 26 0.0000 4 300 525 3510 3060 R:r\001 -4 1 4 100 0 18 14 0.0000 4 210 270 3015 2655 [1]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 3960 2655 [2]\001 -4 1 4 100 0 18 18 0.0000 4 270 1275 1080 3015 SS:[conc]\001 -4 1 4 100 0 18 18 0.0000 4 270 1605 6120 3015 SS:[thermal]\001 DELETED mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_cr.r Index: mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_cr.r +++ mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_cr.r @@ -1,21 +0,0 @@ -%% CR file for rate-of reaction component RATE - -OPERATOR Rate; - -% Reaction rate -FOR ALL comp,k,q,h,n,Conc,Temp LET - Rate(comp,k,q,h,n,flow,1, - Conc,effort,1, - Temp,effort,2 - ) - = k*Conc^n*e^(-q/Temp); - -% Heat -FOR ALL comp,k,q,h,n,Conc,Temp LET - Rate(comp,k,q,h,n,flow,2, - Conc,effort,1, - Temp,effort,2 - ) - = k*Conc^n*h*e^(-q/Temp); - -END; DELETED mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_desc.tex Index: mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_desc.tex +++ mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_desc.tex @@ -1,32 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Rate (Rate_desc.tex) -% Generated by MTT on Tue Mar 14 17:54:06 GMT 2000. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Rate} is - displayed in Figure \Ref{fig:Rate_abg.ps} and its label - file is listed in Section \Ref{sec:Rate_lbl}. - The subsystems are listed in Section \Ref{sec:Rate_sub}. - - -This component represents rate of reaction equations corresponding to -the chemical reaction: -\begin{equation} - \text{nA} \rightarrow \text{B} -\end{equation} -The relevant equations are -\begin{equation} - \begin{align} - \frac{dc_a}{dt} &= k_a c_a^n e^{-\frac{q_a}{T}} \tag{Rate of reaction}\\ - Q &= h_a k_a c_a^n e^{-\frac{q_a}{T}} \tag{Heat of reaction} - \end{align} -\end{equation} -where $\frac{dc_a}{dt}$ is the rate of change of concentration of -species A and $Q$ is the corresponding heat generated. - DELETED mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_lbl.txt Index: mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_lbl.txt +++ mttroot/mtt/lib/comp/compound/Chemical/Rate/Rate_lbl.txt @@ -1,30 +0,0 @@ -%% Label file for system Rate (Rate_lbl.txt) -%SUMMARY Rate -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in conc -%ALIAS out thermal - -% Argument aliases -%ALIAS $1 k,q,h,n - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - r Rate k,q,h,n - -% Component type SS - [conc] SS external,external - [thermal] SS external,external DELETED mttroot/mtt/lib/comp/compound/Chemical/mC/mC_abg.fig Index: mttroot/mtt/lib/comp/compound/Chemical/mC/mC_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Chemical/mC/mC_abg.fig +++ mttroot/mtt/lib/comp/compound/Chemical/mC/mC_abg.fig @@ -1,43 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5b -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 6300 4500 5625 4725 5850 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 5175 4500 4500 4725 4725 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 - 5400 3600 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 4275 4050 3600 3375 3600 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 2925 3375 2250 3600 2475 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 3375 3375 3375 5175 3600 4950 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 4275 6300 4725 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 7425 4500 6750 4725 6975 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 4275 7425 4725 7425 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 4 - 4275 6525 3375 6525 3375 5625 3600 5850 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 2025 5400 2925 5400 2700 5625 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2925 5175 2925 5625 -4 1 0 100 0 18 18 0.0000 4 210 390 4500 5490 AF\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4485 4365 1\001 -4 1 0 100 0 18 18 0.0000 4 210 510 3375 2025 C:C\001 -4 1 0 100 0 18 18 0.0000 4 210 840 3375 5490 EMAE\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4485 6615 1\001 -4 1 4 100 0 18 18 0.0000 4 270 900 4500 7875 SS:[in]\001 -4 1 0 100 0 18 18 0.0000 4 195 150 3360 3240 0\001 -4 1 4 100 0 18 14 0.0000 4 225 525 3150 5850 [out]\001 -4 1 4 100 0 18 14 0.0000 4 225 660 2925 5175 [mod]\001 -4 2 4 100 0 18 18 0.0000 4 270 1275 1935 5490 SS:[mod]\001 DELETED mttroot/mtt/lib/comp/compound/Chemical/mC/mC_lbl.txt Index: mttroot/mtt/lib/comp/compound/Chemical/mC/mC_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Chemical/mC/mC_lbl.txt +++ mttroot/mtt/lib/comp/compound/Chemical/mC/mC_lbl.txt @@ -1,58 +0,0 @@ -#SUMMARY mC Modulated C component -#DESCRIPTION Effort on [mod] multiplies effort on [in]. Use with Cm - -## System mC, representation lbl, language txt -## File mC_lbl.txt -## Generated by MTT on Tue Aug 13 15:52:46 EST 2013 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in -#ALIAS mod mod - -## Argument aliases -#ALIAS $1 k_eq - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - # 0 - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type AF (anonymous => default parameters) - # AF - -## Component type C - C lin state,k_eq - -## Component type EMAE (anonymous => default parameters) - # EMAE - -## Component type SS - - -[in] SS external,external -[mod] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_abg.fig Index: mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_abg.fig +++ mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1575 3375 2925 3375 2700 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 3375 4725 3375 4500 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 3150 4950 1800 5175 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5175 3375 6525 3375 6300 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 3150 3150 1800 3375 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6525 3150 6525 3600 -2 4 0 2 31 7 51 0 -1 0.000 0 0 7 0 0 5 - 7875 4275 7875 900 450 900 450 4275 7875 4275 -4 1 0 100 0 18 18 0.0000 4 195 150 3150 3465 0\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4950 3465 1\001 -4 2 4 100 0 18 18 0.0000 4 270 870 1530 3465 SS:[in]\001 -4 0 4 100 0 18 18 0.0000 4 270 1065 6660 3465 SS:[out]\001 -4 1 0 100 0 18 18 0.0000 4 270 780 3150 1665 C:k_p\001 -4 1 0 100 0 18 18 0.0000 4 270 765 4950 1665 R:k_d\001 DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_desc.tex Index: mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_desc.tex +++ mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_desc.tex @@ -1,56 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system PDe (PDe_desc.tex) -% Generated by MTT on Tue May 1 09:26:33 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{PDe} is - displayed in Figure \Ref{fig:PDe_abg.ps} and its label - file is listed in Section \Ref{sec:PDe_lbl}. - The subsystems are listed in Section \Ref{sec:PDe_sub}. - - This is a proportional + derivative (PD) controller for a - collocated sutuation where the control signal is an effort and the - measured signal is a (collocated) flow. - - The controller can be thought of as controlling \emph{integated - flow}, and it is with respect to this that the P and D terms are defined. - - The setpoint is a \emph{flow}; and must be generated to give the - desired \emph{integrated} flow. - - Physically, the controller is a \textbf{C} and an \textbf{R} - component - for mechanical systems a mass and a spring. - - Mathematically, in integral causality, the equations are: -%file: pde_{dae}.tex -%differential-algebraic equations - \begin{equation} - \begin{aligned} - \dot x_{1} &= - { - f_d - f - } - \end{aligned} - \end{equation} - \begin{equation} - \begin{aligned} - u &= - { - - k_{d} f + k_{p} x_{1} - } - \end{aligned} - \end{equation} - - The state $x_1$ is the the integrated difference between - \emph{desired} flow $f_d$ and the actual flow $f$. Thus the control - signal $u$ is $k_p$ multiplied by the position error minus $k_d$ time - the flow. DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Control/Collocated/PDe/PDe_lbl.txt @@ -1,39 +0,0 @@ -%% Label file for system PDe (PDe_lbl.txt) -%SUMMARY PDe: Proportional + Derivative controller with effort output -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS out out - -% Argument aliases -%ALIAS $1 k_p -%ALIAS $2 k_d - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - k_p lin state,k_p - -% Component type R - k_d lin flow,k_d - -% Component type SS - [in] SS internal,external - [out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_abg.fig Index: mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_abg.fig +++ mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_abg.fig @@ -1,34 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2025 2700 3375 2700 3150 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3600 2475 3600 1125 3825 1350 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 2700 5175 2700 4950 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 900 5175 900 4950 1125 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 900 2025 900 2250 1125 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 6525 3375 900 3375 900 450 6525 450 6525 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 2475 5175 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2025 2475 2025 2925 -4 1 0 100 0 18 18 0.0000 4 195 150 3600 2790 0\001 -4 2 4 100 0 18 18 0.0000 4 270 825 1935 2790 SS:[in]\001 -4 0 4 100 0 18 18 0.0000 4 270 930 5310 2790 SS:[out]\001 -4 1 1 101 0 3 24 0.0000 4 165 195 4500 2520 u\001 -4 1 1 101 0 3 24 0.0000 4 240 165 4545 3015 y\001 -4 1 1 101 0 3 24 0.0000 4 165 240 2520 3015 w\001 -4 1 0 100 0 18 18 0.0000 4 195 150 3600 990 1\001 -4 1 0 100 0 18 18 0.0000 4 270 675 5670 990 C:k_i\001 -4 1 0 100 0 18 18 0.0000 4 270 765 1575 945 R:k_p\001 DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_desc.tex Index: mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_desc.tex +++ mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_desc.tex @@ -1,30 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system PIe (PIe_desc.tex) -% Generated by MTT on Wed May 15 10:28:28 BST 2002. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{PIe} is - displayed in Figure \Ref{fig:PIe_abg.ps} and its label - file is listed in Section \Ref{sec:PIe_lbl}. - -\textbf{PIe} implements a collocated PI controller where: -\begin{description} -\item[w] is the (flow) setpoint at port [w] -\item[y] is the (flow) system output at port [yu] -\item[u] is the (effort) system input (control signal) at port [yu] -\end{description} - -The controller transfer-function is: -\begin{equation} - u(s) = \left [ k_p + \frac{k_i}{s} \right ] e(s) -\end{equation} -where the \emph{error} $e(s) = w(s) - y(s)$. DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_lbl.txt @@ -1,50 +0,0 @@ -#SUMMARY PIe: PI controller with effort output -#DESCRIPTION Implements collocated PI controller with: -#DESCRIPTION w (flow) setpoint at in-port -#DESCRIPTION y (flow) measurement at out-port -#DESCRIPTION u (effort) control at out-port - - -## System PIe, representation lbl, language txt -## File PIe_lbl.txt -## Generated by MTT on Wed May 15 10:17:13 BST 2002 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS w in -#ALIAS yu out - -## Argument aliases -#ALIAS $1 k_i -#ALIAS $2 k_p - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type C - k_i lin state,k_i - -## Component type R - k_p lin flow,k_p - -## Component type R - [in] SS internal,external - [out] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_rep.txt Index: mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_rep.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_rep.txt +++ mttroot/mtt/lib/comp/compound/Control/Collocated/PIe/PIe_rep.txt @@ -1,35 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system PIe (PIe_rep.txt) -## Generated by MTT on" Wed May 15 10:33:29 BST 2002. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt PIe abg tex # The system description -mtt PIe cbg ps # The causal bond graph -mtt PIe struc tex # The system structure -mtt PIe sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt PIe dae tex # The system dae -mtt PIe ode tex # The system ode -## mtt PIe sspar tex # Steady-state parameters -## mtt PIe ss tex # Steady state -## mtt PIe dm tex # Descriptor matrices (of linearised system) -## mtt PIe sm tex # State matrices (of linearised system) -mtt PIe tf tex # Transfer function (of linearised system) -## mtt PIe lmfr ps # log modulus of frequency response (of linearised system) -## mtt PIe simpar txt # Simulation parameters -## mtt PIe numpar txt # Numerical simulation parameters -## mtt PIe state txt # Simulation initial state -## mtt PIe input txt # Simulation input -## mtt PIe logic txt # Logic control -## mtt PIe odeso ps # Simulation output - -mtt PIe rep txt # This file DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_abg.fig Index: mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_abg.fig +++ mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_abg.fig @@ -1,28 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2025 2700 3375 2700 3150 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3600 2475 3600 1125 3825 1350 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 2700 5175 2700 4950 2925 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 6525 3375 900 3375 900 450 6525 450 6525 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 2475 5175 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2025 2475 2025 2925 -4 1 0 100 0 18 18 0.0000 4 195 150 3600 2790 0\001 -4 2 4 100 0 18 18 0.0000 4 270 870 1935 2790 SS:[in]\001 -4 0 4 100 0 18 18 0.0000 4 270 1065 5310 2790 SS:[out]\001 -4 1 1 101 0 3 24 0.0000 4 165 195 4500 2520 u\001 -4 1 1 101 0 3 24 0.0000 4 240 165 4545 3015 y\001 -4 1 1 101 0 3 24 0.0000 4 165 240 2520 3015 w\001 -4 1 0 100 0 18 18 0.0000 4 270 765 3735 990 R:k_p\001 DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_desc.tex Index: mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_desc.tex +++ mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_desc.tex @@ -1,33 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Pe (Pe_desc.tex) -% Generated by MTT on Wed May 15 10:28:28 BST 2002. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2002/05/15 11:01:24 gawthrop -% %% New PI controller component -% %% -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Pe} is - displayed in Figure \Ref{fig:Pe_abg.ps} and its label - file is listed in Section \Ref{sec:Pe_lbl}. - -\textbf{Pe} implements a collocated P controller where: -\begin{description} -\item[w] is the (flow) setpoint at port [w] -\item[y] is the (flow) system output at port [yu] -\item[u] is the (effort) system input (control signal) at port [yu] -\end{description} - -The controller transfer-function is: -\begin{equation} - u(s) = k_p e(s) -\end{equation} -where the \emph{error} $e(s) = w(s) - y(s)$. DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_lbl.txt @@ -1,49 +0,0 @@ -#SUMMARY Pe: Proportional controller with effort output -#DESCRIPTION Implements collocated P controller with: -#DESCRIPTION w (flow) setpoint at in-port -#DESCRIPTION y (flow) measurement at out-port -#DESCRIPTION u (effort) control at out-port - - -## System Pe, representation lbl, language txt -## File Pe_lbl.txt -## Generated by MTT on Wed May 15 10:17:13 BST 2002 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.1 2002/05/15 11:01:24 gawthrop - ## New PI controller component - ## - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS w in -#ALIAS yu out - -## Argument aliases -#ALIAS $1 k_p - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type R - k_p lin flow,k_p - -## Component type R - [in] SS internal,external - [out] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_rep.txt Index: mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_rep.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_rep.txt +++ mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/Pe_rep.txt @@ -1,38 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system Pe (Pe_rep.txt) -## Generated by MTT on" Wed May 15 10:33:29 BST 2002. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2002/05/15 11:01:24 gawthrop -## New PI controller component -## -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt Pe abg tex # The system description -mtt Pe cbg ps # The causal bond graph -mtt Pe struc tex # The system structure -mtt Pe sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt Pe dae tex # The system dae -mtt Pe ode tex # The system ode -## mtt Pe sspar tex # Steady-state parameters -## mtt Pe ss tex # Steady state -## mtt Pe dm tex # Descriptor matrices (of linearised system) -## mtt Pe sm tex # State matrices (of linearised system) -mtt Pe tf tex # Transfer function (of linearised system) -## mtt Pe lmfr ps # log modulus of frequency response (of linearised system) -## mtt Pe simpar txt # Simulation parameters -## mtt Pe numpar txt # Numerical simulation parameters -## mtt Pe state txt # Simulation initial state -## mtt Pe input txt # Simulation input -## mtt Pe logic txt # Logic control -## mtt Pe odeso ps # Simulation output - -mtt Pe rep txt # This file DELETED mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/sPe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/sPe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/sPe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Control/Collocated/Pe/sPe_lbl.txt @@ -1,41 +0,0 @@ -#SUMMARY sPe Sensitivity version of Pe -#DESCRIPTION Detailed description here - -## System sPe, representation lbl, language txt -## File sPe_lbl.txt -## Generated by MTT on Wed May 15 11:55:22 BST 2002 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in_1,in_2 -#ALIAS out out_1,out_2 - -## Argument aliases - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type - [in] SS internal,external - [out] SS external,external - -## Component type sR - k_p slin flow,k_p;0 - DELETED mttroot/mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_abg.fig Index: mttroot/mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_abg.fig +++ mttroot/mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_abg.fig @@ -1,33 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 2700 6300 2700 6075 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4950 2475 4950 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6300 2700 6300 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9900 2700 11250 2700 11025 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 11250 2700 11250 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 9900 2475 9900 2700 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 12600 5175 3825 5175 3825 450 12600 450 12600 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 4275 4725 2925 4950 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 2475 4725 1125 4950 1350 -4 1 0 100 0 18 18 0.0000 4 195 150 4725 2790 1\001 -4 1 0 100 0 18 18 0.0000 4 270 1590 9045 2790 SS:amp_out\001 -4 1 0 100 0 18 18 0.0000 4 270 1395 7110 2790 SS:amp_in\001 -4 1 4 100 0 18 18 0.0000 4 270 1140 4905 990 SS:[neg]\001 -4 1 4 100 0 18 18 0.0000 4 270 1140 4725 4590 SS:[pos]\001 -4 0 4 100 0 18 18 0.0000 4 270 1065 11385 2790 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_lbl.txt Index: mttroot/mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_lbl.txt +++ mttroot/mtt/lib/comp/compound/Electrical/OpAmp/OpAmp_lbl.txt @@ -1,36 +0,0 @@ -#SUMMARY OpAmp: an ideal operational amplifier -#DESCRIPTION Uses virtual earth concept - - -## System OpAmp, representation lbl, language txt -## File OpAmp_lbl.txt -## Generated by MTT on Tue Sep 18 09:32:19 BST 2001 - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ############################################################### - -## Port aliases -#ALIAS neg neg -#ALIAS out out -#ALIAS pos pos - -## Argument aliases - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type - [neg] SS external,external - [out] SS external,external - [pos] SS external,external - amp_in SS 0,0 - amp_out SS internal,internal - DELETED mttroot/mtt/lib/comp/compound/Electrical/RC/RC_abg.fig Index: mttroot/mtt/lib/comp/compound/Electrical/RC/RC_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Electrical/RC/RC_abg.fig +++ mttroot/mtt/lib/comp/compound/Electrical/RC/RC_abg.fig @@ -1,65 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 4277 4052 4277 3827 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4502 4277 5402 4277 5177 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 4051 4276 3151 4501 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 4051 5626 3151 5851 3376 -2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 3825 585 4725 585 4725 765 3825 765 3825 585 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5400 1215 5850 1215 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3150 675 3825 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4725 675 6750 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5625 675 5625 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5625 1215 5625 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3150 1575 6750 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 4277 6752 4277 6527 4502 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9225 5625 9225 225 900 225 900 5625 9225 5625 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5400 1080 5850 1080 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4050 4050 4050 4500 -4 2 4 0 0 0 20 0.0000 4 255 2040 3105 4365 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 4277 4367 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5627 4367 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 375 4276 2926 R:r\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 5626 2926 C:c\001 -4 0 1 1 0 0 20 0.0000 4 135 105 4230 450 r\001 -4 0 1 1 0 0 20 0.0000 4 135 120 6030 1215 c\001 -4 1 1 1 0 0 20 0.0000 4 255 1350 4950 4995 Bond graph\001 -4 1 1 1 0 0 20 0.0000 4 195 1200 4950 2025 Schematic\001 -4 0 4 0 0 0 20 0.0000 4 255 2190 6887 4367 SS:[out]\001 -4 0 1 1 0 0 20 0.0000 4 135 135 3375 4005 v\001 -4 0 1 1 0 0 20 0.0000 4 195 135 3465 4140 1\001 -4 0 1 1 0 0 20 0.0000 4 195 75 3375 4590 i\001 -4 0 1 1 0 0 20 0.0000 4 195 135 3465 4725 1\001 -4 0 1 1 0 0 20 0.0000 4 195 75 6165 4590 i\001 -4 0 1 1 0 0 20 0.0000 4 195 135 6255 4725 2\001 -4 0 1 1 0 0 20 0.0000 4 135 135 6165 4005 v\001 -4 0 1 1 0 0 20 0.0000 4 195 135 6255 4140 2\001 -4 0 1 1 0 0 20 0.0000 4 135 135 6660 1170 v\001 -4 0 1 1 0 0 20 0.0000 4 195 135 6750 1305 2\001 -4 0 1 1 0 0 20 0.0000 4 195 75 6300 450 i\001 -4 0 1 1 0 0 20 0.0000 4 195 135 6390 585 2\001 -4 0 1 1 0 0 20 0.0000 4 195 75 3375 450 i\001 -4 0 1 1 0 0 20 0.0000 4 195 135 3465 585 1\001 -4 0 1 1 0 0 20 0.0000 4 135 135 3060 1170 v\001 -4 0 1 1 0 0 20 0.0000 4 195 135 3150 1305 1\001 DELETED mttroot/mtt/lib/comp/compound/Electrical/RC/RC_desc.tex Index: mttroot/mtt/lib/comp/compound/Electrical/RC/RC_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Electrical/RC/RC_desc.tex +++ mttroot/mtt/lib/comp/compound/Electrical/RC/RC_desc.tex @@ -1,17 +0,0 @@ -% Verbal description for system RC (RC_desc.tex) -% Generated by MTT on Tue Aug 26 09:43:25 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\textbf{RC} is a Simple two-port RC circuit. The two ports are [in] -and [out] and the two parameters are c and r respectively - - The acausal bond graph of system \textbf{RC} is - displayed in Figure \Ref{RC_abg} and its label - file is listed in Section \Ref{sec:RC_lbl}. - The subsystems are listed in Section \Ref{sec:RC_sub}. DELETED mttroot/mtt/lib/comp/compound/Electrical/RC/RC_lbl.txt Index: mttroot/mtt/lib/comp/compound/Electrical/RC/RC_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Electrical/RC/RC_lbl.txt +++ mttroot/mtt/lib/comp/compound/Electrical/RC/RC_lbl.txt @@ -1,45 +0,0 @@ -%% Label file for system RC (RC_lbl.txt) -%SUMMARY RC A Simple two-port RC circuit -%DESCRIPTION This simple example is used in the manual. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 2000/09/14 15:13:02 peterg -% %% Changed port CRs to give SISO system when used in isolation -% %% -% %% Revision 1.2 1998/07/27 11:09:36 peterg -% %% Commented the aliases. -% %% -% %% Revision 1.1 1998/07/16 20:16:30 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in # The left-hand port -%ALIAS out out # The right-hand port - -% Argument aliases -%ALIAS $1 c # Capacitance -%ALIAS $2 r # Resistance - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - c lin effort,c - -% Component type R - r lin flow,r - -% Component type SS - [in] SS external,internal - [out] SS external,0 DELETED mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_abg.fig Index: mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_abg.fig +++ mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_abg.fig @@ -1,79 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 2250 765 3375 765 3375 1035 2250 1035 2250 765 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4275 1575 5175 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4275 1800 5175 1800 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 2 1 2.00 120.00 240.00 - 1350 900 2250 900 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 2 1 2.00 120.00 240.00 - 4725 900 4725 1575 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 5850 765 6975 765 6975 1035 5850 1035 5850 765 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 2 1 2.00 120.00 240.00 - 3375 900 4725 900 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 2 1 2.00 120.00 240.00 - 5805 900 4725 900 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 2 1 2.00 120.00 240.00 - 8100 900 6975 900 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 - 4725 1800 4725 2475 1350 2475 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 - 4725 2475 8100 2475 8100 2430 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 6076 4501 6076 4276 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 5851 2926 4501 3151 4726 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8100 6077 6750 6077 6975 6302 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 6077 4950 6077 5175 6302 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 5852 6525 4502 6750 4727 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 4501 4951 4726 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9226 6976 226 6976 226 3826 9226 3826 9226 6976 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9225 3375 225 3375 225 225 9225 225 9225 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 6075 2700 6075 2475 6300 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 5850 2700 6300 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6750 5850 6750 6300 -4 1 1 1 0 3 20 0.0000 4 270 465 1350 1710 u_1\001 -4 1 1 1 0 3 20 0.0000 4 270 465 8145 1710 u_2\001 -4 1 1 1 0 3 20 0.0000 4 285 420 1800 675 y_1\001 -4 1 1 1 0 3 20 0.0000 4 285 420 7830 720 y_2\001 -4 1 1 1 0 3 20 0.0000 4 285 420 7695 6345 y_2\001 -4 1 1 1 0 3 20 0.0000 4 270 465 7650 5940 u_2\001 -4 1 -1 0 0 2 20 0.0000 4 210 150 4726 6166 0\001 -4 1 -1 0 0 2 20 0.0000 4 210 150 2926 6166 1\001 -4 1 -1 0 0 2 20 0.0000 4 285 720 2926 4366 R:r_1\001 -4 1 -1 0 0 2 20 0.0000 4 210 150 6525 6167 1\001 -4 1 -1 0 0 2 20 0.0000 4 285 720 6525 4367 R:r_2\001 -4 1 -1 0 0 2 20 0.0000 4 210 420 4726 4366 C:c\001 -4 1 1 1 0 3 20 0.0000 4 210 1335 4680 3060 Schematic\001 -4 1 1 1 0 3 20 0.0000 4 285 1470 4725 6705 Bond graph\001 -4 1 1 1 0 3 20 0.0000 4 270 390 2835 1350 r_1\001 -4 1 1 1 0 3 20 0.0000 4 270 390 6345 1350 r_2\001 -4 1 1 1 0 3 20 0.0000 4 135 135 3870 1800 c\001 -4 1 1 1 0 3 20 0.0000 4 270 465 1980 5940 u_1\001 -4 1 1 1 0 3 20 0.0000 4 285 420 1980 6390 y_1\001 -4 1 4 0 0 2 20 0.0000 4 285 1050 765 6165 SS:[e_1]\001 -4 1 4 0 0 2 20 0.0000 4 285 1050 8640 6165 SS:[e_2]\001 DELETED mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_desc.tex Index: mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_desc.tex +++ mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_desc.tex @@ -1,26 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Tee (Tee_desc.tex) -% Generated by MTT on Fri Mar 13 16:28:54 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Tee} is - displayed in Figure \Ref{Tee_abg} and its label - file is listed in Section \Ref{sec:Tee_lbl}. - -This simple ``tee'' RC circuit has two ports: -\begin{itemize} -\item Port [1] carrying $v_1$ and $i_1$ and -\item Port [2] carrying $v_2$ and $i_2$. -\end{itemize} - - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_lbl.txt Index: mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_lbl.txt +++ mttroot/mtt/lib/comp/compound/Electrical/Tee/Tee_lbl.txt @@ -1,43 +0,0 @@ -%SUMMARY Tee Electrical T circuit -%DESCRIPTION A two port circuit composed of 2 resistors and one -%DESCRIPTION capacitor in a T form, - -%% Label file for system Tee (Tee_lbl.txt) - -%ALIAS $1 r_1 -%ALIAS $2 r_2 -%ALIAS $3 c - -%ALIAS in e_1 -%ALIAS out e_2 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1999/12/16 22:21:09 peterg -% %% Changed port names -% %% -% %% Revision 1.1 1998/07/16 16:30:41 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c lin effort,c - -% Component type R - r_1 lin flow,r_1 - r_2 lin flow,r_2 - -% Component type SS - [e_1] SS external,external - [e_2] SS external,external DELETED mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_abg.fig Index: mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_abg.fig +++ mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_abg.fig @@ -1,37 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 4050 5175 2700 5400 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 2250 5175 900 5400 1125 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 2475 6750 2475 6525 2700 -2 2 0 3 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 7650 2025 2700 2025 2700 2925 7650 2925 7650 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 5850 5175 4500 5400 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 7680 5175 6330 5400 6555 -2 2 0 3 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 7650 5625 2700 5625 2700 6525 7650 6525 7650 5625 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6750 2250 6750 2700 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 2700 5400 2700 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 5850 5400 5850 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 8325 8325 450 2025 450 2025 8325 8325 8325 -4 1 4 0 0 0 20 0.0000 4 240 960 5175 810 SS:[out]\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5175 2565 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1485 5175 4365 C:transducer\001 -4 0 -1 0 0 0 20 0.0000 4 195 735 6840 2565 I:mass\001 -4 0 1 1 0 0 20 0.0000 4 255 885 2880 2340 Moving\001 -4 0 1 1 0 0 20 0.0000 4 195 585 2880 2670 Plate\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5175 6165 1\001 -4 1 4 0 0 0 20 0.0000 4 240 810 5175 8055 SS:[in]\001 -4 0 1 1 0 0 20 0.0000 4 195 585 2880 6315 Plate\001 -4 0 1 1 0 0 20 0.0000 4 195 630 2880 5940 Fixed\001 DELETED mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_desc.tex Index: mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_desc.tex +++ mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_desc.tex @@ -1,30 +0,0 @@ -% Verbal description for system CM (CM_desc.tex) -% Generated by MTT on Fri Sep 19 18:07:12 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{CM} is - displayed in Figure \Ref{CM_abg} and its label - file is listed in Section \Ref{sec:CM_lbl}. - The subsystems are listed in Section \Ref{sec:CM_sub}. - -{\bf CM} is an electromechanical moving-plate capacitor with linear -electrical capacitance $c$ of the form -\begin{equation} - c = c_0 \frac{x_0}{x} -\end{equation} -where $x_0$ is the plate separation corresponding to a capacitance of -$c_0$. -The corresponding electrical constitutive relationship (which gives an -energy-conserving two-port \textbf{C}) is -\begin{equation} - F = Q c_0 \frac{x_0}{x^2} -\end{equation} -where $F$ is the force between the plates and $Q$ the charge on the -capacitor. -This is implemented in the \emph{cm.cr} Constitutive Relationship. DELETED mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_lbl.txt Index: mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_lbl.txt +++ mttroot/mtt/lib/comp/compound/Electromechanical/CM/CM_lbl.txt @@ -1,30 +0,0 @@ -%SUMMARY CM: Mechanical (moving-plate) capacitor -%DESCRIPTION Parameter 1: Capacitance at plate separation of x_0 -%DESCRIPTION Parameter 2: x_0 -%DESCRIPTION Parameter 3: mass of moving-plate - -%% Label file for system CM (CM_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - transducer cm $1,$2 - -% Component type I - mass lin flow,$3 - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_abg.fig Index: mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_abg.fig +++ mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_abg.fig @@ -1,40 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 4860 4730 4860 494 2293 494 2293 4730 4860 4730 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2036 2724 3371 2724 3063 2947 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3576 2501 3576 1342 3833 1609 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3782 2724 5116 2724 4808 2947 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3576 2947 3576 4106 3833 3839 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6656 2724 7991 2724 7683 2947 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8196 2546 8196 1386 8453 1654 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8196 2947 8196 4106 8453 3839 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8453 2724 9788 2724 9480 2947 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9480 4730 9480 494 6913 494 6913 4730 9480 4730 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 12150 5175 45 5175 45 316 12150 316 12150 5175 -4 2 4 0 0 0 20 0.0000000 4 240 1815 1980 2790 SS:[Electrical]\001 -4 1 -1 0 0 0 23 0.0000000 4 240 171 3525 2858 1\001 -4 1 -1 0 0 0 23 0.0000000 4 274 1198 5938 2813 GY:k_m\001 -4 1 -1 0 0 0 23 0.0000000 4 240 171 8196 2813 1\001 -4 1 -1 0 0 0 23 0.0000000 4 274 650 3525 1252 I:l_a\001 -4 1 -1 0 0 0 23 0.0000000 4 308 770 8299 1252 I:j_m\001 -4 1 -1 0 0 0 23 0.0000000 4 274 770 3628 4463 R:r_a\001 -4 1 -1 0 0 0 23 0.0000000 4 274 941 8248 4463 R:b_m\001 -4 1 1 1 0 0 23 0.0000000 4 240 1352 3576 5043 Electrical\001 -4 1 1 1 0 0 23 0.0000000 4 240 1626 8196 5043 Mechanical\001 -4 1 1 1 0 0 23 0.0000000 4 240 736 10404 3170 Shaft\001 -4 1 1 1 0 0 23 0.0000000 4 240 1420 1472 3170 Terminals\001 -4 0 4 0 0 0 20 0.0000000 4 240 2055 9945 2835 SS:[Mechanical]\001 DELETED mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_desc.tex Index: mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_desc.tex +++ mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_desc.tex @@ -1,37 +0,0 @@ -% Verbal description for system DC (DC_desc.tex) -% Generated by MTT on Thu Sep 11 10:09:58 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{DC} is - displayed in Figure \Ref{DC_abg} and its label - file is listed in Section \Ref{sec:DC_lbl}. - The subsystems are listed in Section \Ref{sec:DC_sub}. - - \begin{table}[htbp] - \begin{center} - \leavevmode - \begin{tabular}{|l|l|} - \hline - Index & Parameter\\ - \hline - 1 & Motor gain ($k_m$) \\ - 2 & Armature inductance ($l_a$) \\ - 3 & Armature resistance ($r_a$) \\ - 4 & Inertia ($j_m$) \\ - 5 & Friction coefficient ($b_m$) \\ - \hline - \end{tabular} - \caption{DC motor parameters} - \label{tab:DC_components} - \end{center} - \end{table} -{\bf DC} is a two-port component representing a DC motor. It has the 5 -parameters listed in Table \Ref{tab:DC_components}. - - DELETED mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_lbl.txt Index: mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_lbl.txt +++ mttroot/mtt/lib/comp/compound/Electromechanical/DC/DC_lbl.txt @@ -1,69 +0,0 @@ -%SUMMARY DC: DC motor (or generator) - -%% Port Alias -%ALIAS in Electrical -%ALIAS out Mechanical - -%% Unit definition -%UNITS Electrical electrical volt amp -%UNITS Mechanical rotational N*m radians/s - -%ALIAS $1 k_m -%ALIAS $2 l_a -%ALIAS $3 r_a -%ALIAS $4 j_m -%ALIAS $5 b_m - - -%% Label file for system DC (DC_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.6 2000/11/16 09:45:51 peterg -% %% Added unit definitions -% %% -% %% Revision 1.5 1998/07/26 12:49:24 peterg -% %% Corrected some errors -% %% -% %% Revision 1.4 1998/07/26 12:45:33 peterg -% %% Added ports -% %% -% %% Revision 1.3 1998/07/22 12:01:17 peterg -% %% Aliased ports and parameters. -% %% -% %% Revision 1.2 1996/12/04 16:01:42 peterg -% %% Documantation added. -% %% -% %% Revision 1.1 1996/12/04 16:00:56 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Motor gain -k_m lin flow,k_m - -% Electrical components -%Inductance -l_a lin effort,l_a - -%Resistance -r_a lin flow,r_a - -% Mechanical components -%Inertia -j_m lin flow,j_m - -%Friction -b_m lin flow,b_m - -% Ports - [Electrical] SS external,external - [Mechanical] SS external,external DELETED mttroot/mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_abg.fig Index: mttroot/mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_abg.fig +++ mttroot/mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_abg.fig @@ -1,28 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2925 1575 4275 1575 4050 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 1575 6075 1575 5850 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7200 1575 8550 1575 8325 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9000 1575 10350 1575 10125 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 1800 4500 3150 4725 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 8775 1800 8775 3150 9000 2925 -4 1 0 100 0 18 18 0.0000 4 195 150 4500 1665 1\001 -4 1 0 100 0 18 18 0.0000 4 195 150 8775 1665 0\001 -4 2 4 100 0 18 18 0.0000 4 270 900 2835 1665 SS:[in]\001 -4 0 4 100 0 18 18 0.0000 4 270 1095 10440 1665 SS:[out]\001 -4 1 0 100 0 18 18 0.0000 4 270 780 8775 3600 C:k_p\001 -4 1 0 100 0 18 18 0.0000 4 270 795 4500 3600 C:c_p\001 -4 1 0 100 0 18 18 0.0000 4 270 945 6615 1665 TF:g_p\001 DELETED mttroot/mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_lbl.txt Index: mttroot/mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_lbl.txt +++ mttroot/mtt/lib/comp/compound/Electromechanical/Piezo/Piezo_lbl.txt @@ -1,54 +0,0 @@ -#SUMMARY Piezo: Piezo-electric transducer -#DESCRIPTION Simple Mason model in Bond Graph form - -## System Piezo, representation lbl, language txt -## File Piezo_lbl.txt -## Generated by MTT on Wed Mar 15 16:55:26 EST 2006 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in -#ALIAS out out - -## Argument aliases -#ALIAS $1 c_p -#ALIAS $2 g_p -#ALIAS $3 k_p - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type C - c_p lin effort,c_p - k_p lin state,k_p - -## Component type SS - [in] SS external,external - [out] SS external,external - -## Component type TF - g_p lin flow,g_p - DELETED mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_abg.fig Index: mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_abg.fig +++ mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_abg.fig @@ -1,53 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 2700 3600 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2025 4950 2025 4725 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2925 4950 2925 4725 3150 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9675 2250 9675 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1800 2025 3150 2025 2925 2250 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 1800 1800 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 - 7875 2250 7875 900 3375 900 3375 1800 3600 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7425 2475 6075 2475 6300 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9630 2475 8280 2475 8505 2700 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4500 3600 6525 3600 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4725 4500 4725 4500 1350 6525 1350 6525 4725 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 9315 540 8055 900 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8910 4725 8910 1800 6975 1800 6975 4725 8910 4725 -4 2 4 0 0 0 20 0.0000 4 240 1185 3510 3015 SS:[mass]\001 -4 1 4 0 0 0 20 0.0000 4 240 315 4860 1800 [1]\001 -4 1 4 0 0 0 20 0.0000 4 240 315 4860 2745 [2]\001 -4 1 -1 0 0 2 30 0.0000 4 405 885 5445 2610 C:cg\001 -4 1 -1 0 0 0 20 0.0000 4 255 645 7830 2565 PS:ps\001 -4 0 4 0 0 0 20 0.0000 4 240 1920 9855 2565 SS:[mechanical]\001 -4 1 4 0 0 0 20 0.0000 4 240 315 6120 2205 [3]\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 3375 2115 0\001 -4 2 4 0 0 0 20 0.0000 4 240 1575 1755 2115 SS:[thermal]\001 -4 1 4 0 0 0 20 0.0000 4 240 405 7245 2295 [in]\001 -4 0 4 0 0 0 20 0.0000 4 255 885 7965 2160 [power]\001 -4 0 4 0 0 0 20 0.0000 4 240 555 8325 2790 [out]\001 -4 1 1 1 0 0 20 0.0000 4 255 1050 5490 3915 Enthalpy\001 -4 1 1 1 0 0 20 0.0000 4 195 600 5490 4245 Mass\001 -4 1 1 1 0 0 20 0.0000 4 195 915 5490 4575 Volume\001 -4 1 1 1 0 0 20 0.0000 4 195 135 9405 2295 p\001 -4 1 1 1 0 0 20 0.0000 4 255 645 9270 2745 dV/dt\001 -4 1 1 1 0 0 20 0.0000 4 255 915 7380 1440 p*dV/dt\001 -4 1 1 1 0 0 20 0.0000 4 255 3885 9360 450 Joule's work-enthalpy conversion\001 -4 1 1 1 0 0 20 0.0000 4 195 1590 7920 3960 Power Sensor\001 -4 1 1 1 0 0 20 0.0000 4 255 1800 7920 4380 Work-enthalpy\001 DELETED mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r Index: mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r +++ mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r @@ -1,43 +0,0 @@ -%SUMMARY CG CR two-port C thermal pseudo Bond Graph for gas dynamics - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 1998/03/04 15:38:16 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -OPERATOR CG; - -% Port 1 : temperature -FOR ALL COMP, c_v,r,Enthalpy,Stored_Mass,Volume -LET CG(COMP, c_v,r, effort, 1, - Enthalpy,state,1, - Stored_Mass,state,2, - Volume,state,3) - = Enthalpy/(c_v*Stored_Mass); - -% Port 2 : Pressure -FOR ALL COMP, c_v,r,Enthalpy,Stored_Mass,Volume -LET CG(COMP, c_v,r, effort, 2, - Enthalpy,state,1, - Stored_Mass,state,2, - Volume,state,3) - = (R/c_v)*(Enthalpy/Volume); - -% Port 3 : (Also) Pressure -FOR ALL COMP, c_v,r,Enthalpy,Stored_Mass,Volume -LET CG(COMP, c_v,r, effort, 3, - Enthalpy,state,1, - Stored_Mass,state,2, - Volume,state,3) - = (R/c_v)*(Enthalpy/Volume); - -END;; - DELETED mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_lbl.txt Index: mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_lbl.txt +++ mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_lbl.txt @@ -1,42 +0,0 @@ -%SUMMARY CG: C component for compressible gas dynamics -%DESCRIPTION Port [Thermal]: Temperature/Enthalpy pseudo bond -%DESCRIPTION Port [Mass]: Pressure/mass-flow pseudo bond -%DESCRIPTION Port [Mechanical]: Pressure/volume flow energy bond -%DESCRIPTION -%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) -%DESCRIPTION Parameter 2: R (universal gas constant) -%DESCRIPTION Based on Karnopp, Margolis and Rosenberg: Section 12.4. - - -%% Label file for system CG (CG_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/03/04 12:06:06 peterg -% %% Renamed CR from GasAccumulator to CG -% %% -% %% Revision 1.1 1997/11/21 17:06:34 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - cg CG $1,$2 - -% Component type PS - ps lin effort,1 - -% Component type SS - [mass] SS external,external - [mechanical] SS external,external - [thermal] SS external,external DELETED mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_abg.fig Index: mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_abg.fig +++ mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_abg.fig @@ -1,36 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2925 4950 2925 4725 3150 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4500 3600 6525 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2025 4950 2025 4725 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 2925 7425 2925 7200 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 2025 7425 2025 7200 2250 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4500 4500 4500 4500 1350 6525 1350 6525 4500 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 1800 4950 2250 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 2700 4950 3150 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6075 1800 6075 2250 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6075 2700 6075 3150 -4 2 4 0 0 0 20 0.0000 4 255 1545 3510 3015 SS:[mass_in]\001 -4 1 1 1 0 0 20 0.0000 4 255 1125 5490 3915 Isentropic\001 -4 1 1 1 0 0 20 0.0000 4 195 780 5490 4245 Nozzle\001 -4 1 -1 0 0 2 30 0.0000 4 405 885 5535 2520 R:rg\001 -4 2 4 0 0 0 20 0.0000 4 255 1935 3510 2115 SS:[thermal_in]\001 -4 0 4 0 0 0 20 0.0000 4 255 2085 7515 2115 SS:[thermal_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 1695 7515 2970 SS:[mass_out]\001 -4 1 4 0 0 0 20 0.0000 4 240 315 4725 1935 [1]\001 -4 1 4 0 0 0 20 0.0000 4 240 315 4725 2835 [2]\001 -4 1 4 0 0 0 20 0.0000 4 240 315 6300 1935 [3]\001 -4 1 4 0 0 0 20 0.0000 4 240 315 6300 2835 [4]\001 DELETED mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r Index: mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r +++ mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r @@ -1,66 +0,0 @@ -%SUMMARY RG CR for 2 port gas dymanics R: isentropic nozzle - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 1998/03/04 15:37:48 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -OPERATOR RG; - -% Port 1 : Enthalpy flow -FOR ALL COMP, gamma,R,A,T_u,P_u,T_d,P_d -LET RG(COMP, gamma,R,A, flow, 1, - T_u,effort,1, - P_u,effort,2, - T_d,effort,3, - P_d,effort,4) - = A*( P_u/sqrt(T_u) ) - *sqrt( (2*gamma)/(R*(gamma-1)) ) - *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ) - *(gamma/(gamma-1))*R*T_u; - -% Port 2 : Mass flow -FOR ALL COMP, gamma,R,A,T_u,P_u,T_d,P_d -LET RG(COMP, gamma,R,A, flow, 2, - T_u,effort,1, - P_u,effort,2, - T_d,effort,3, - P_d,effort,4) - = A*( P_u/sqrt(T_u) ) - *sqrt( (2*gamma)/(R*(gamma-1)) ) - *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ); - -% Port 3 : Enthalpy flow -FOR ALL COMP, gamma,R,A,T_u,P_u,T_d,P_d -LET RG(COMP, gamma,R,A, flow, 3, - T_u,effort,1, - P_u,effort,2, - T_d,effort,3, - P_d,effort,4) - = A*( P_u/sqrt(T_u) ) - *sqrt( (2*gamma)/(R*(gamma-1)) ) - *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ) - *(gamma/(gamma-1))*R*T_u; - -% Port 4 : Mass flow -FOR ALL COMP, gamma,R,A,T_u,P_u,T_d,P_d -LET RG(COMP, gamma,R,A, flow, 4, - T_u,effort,1, - P_u,effort,2, - T_d,effort,3, - P_d,effort,4) - = A*( P_u/sqrt(T_u) ) - *sqrt( (2*gamma)/(R*(gamma-1)) ) - *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ); - - -END;; - DELETED mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_lbl.txt Index: mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_lbl.txt +++ mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_lbl.txt @@ -1,43 +0,0 @@ -%SUMMARY RG: R component for compressible gas dynamics: isentropic nozzle -%DESCRIPTION Port [Thermal_in]: Temperature/Enthalpy pseudo bond -%DESCRIPTION Port [Thermal_out]: Temperature/Enthalpy pseudo bond -%DESCRIPTION Port [Mass_in]: Pressure/mass-flow pseudo bond -%DESCRIPTION Port [Mass_out]: Pressure/mass-flow pseudo bond -%DESCRIPTION -%DESCRIPTION Parameter 1: gamma (c_p/c_v) -%DESCRIPTION Parameter 2: R (universal gas constant) -%DESCRIPTION Parameter 3: A (nozzle cross-section) -%DESCRIPTION Based on Karnopp, Margolis and Rosenberg: Section 12.4. - - - -%% Label file for system RG (RG_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/03/04 12:07:37 peterg -% %% Renamed CR from Isentropic nozzle to RG -% %% -% %% Revision 1.1 1997/11/21 19:18:28 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type RG - rg RG $1,$2,$3 - -% Component type SS - [mass_in] SS external,external - [mass_out] SS external,external - [thermal_in] SS external,external - [thermal_out] SS external,external DELETED mttroot/mtt/lib/comp/compound/General/AEf/AEf_abg.fig Index: mttroot/mtt/lib/comp/compound/General/AEf/AEf_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/AEf/AEf_abg.fig +++ mttroot/mtt/lib/comp/compound/General/AEf/AEf_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1350 2475 2475 2475 2250 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3397 2497 4522 2497 4297 2722 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5197 2475 6322 2475 6097 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2475 2250 2475 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4500 2250 4500 2745 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 2250 5175 2700 -4 1 0 100 0 18 20 0.0000 4 225 675 2880 2610 AE:a\001 -4 1 0 100 0 18 20 0.0000 4 225 435 4860 2610 GY\001 -4 1 4 100 0 18 20 0.0000 4 285 975 810 2565 SS:[in]\001 -4 1 4 100 0 18 20 0.0000 4 285 1170 6975 2610 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/General/AEf/AEf_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/AEf/AEf_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/AEf/AEf_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/AEf/AEf_lbl.txt @@ -1,46 +0,0 @@ -%% Label file for system AEf (AEf_lbl.txt) -%SUMMARY AEf Effort input amplifier with flow output -%DESCRIPTION Made from AE with GY on output - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/07/29 04:19:43 peterg -% %% Initial revision -% %% -% %% Revision 1.2 1999/03/05 08:25:11 peterg -% %% Changed default to lin. -% %% -% %% Revision 1.1 1999/03/04 06:05:46 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS out out - -% Argument aliases -%ALIAS $1 g - -% CR aliases -%ALIAS $1 lin - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AF - a lin g - -% Component type SS - [in] SS external,external - [out] SS external,external - DELETED mttroot/mtt/lib/comp/compound/General/AFe/AFe_abg.fig Index: mttroot/mtt/lib/comp/compound/General/AFe/AFe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/AFe/AFe_abg.fig +++ mttroot/mtt/lib/comp/compound/General/AFe/AFe_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1350 2475 2475 2475 2250 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3397 2497 4522 2497 4297 2722 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5197 2475 6322 2475 6097 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 1350 2250 1350 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3375 2250 3375 2745 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6300 2250 6300 2700 -4 1 0 100 0 18 20 0.0000 4 225 660 2880 2610 AF:a\001 -4 1 0 100 0 18 20 0.0000 4 225 435 4860 2610 GY\001 -4 1 4 100 0 18 20 0.0000 4 285 975 810 2565 SS:[in]\001 -4 1 4 100 0 18 20 0.0000 4 285 1170 6975 2610 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/General/AFe/AFe_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/AFe/AFe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/AFe/AFe_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/AFe/AFe_lbl.txt @@ -1,39 +0,0 @@ -%% Label file for system AFe (AFe_lbl.txt) -%SUMMARY AFe Flow input amplifier with effort output -%DESCRIPTION Made from AF with GY on output - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/03/04 06:05:46 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS out out - -% Argument aliases -%ALIAS $1 g - -% CR aliases -%ALIAS $1 lin - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AF - a lin g - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/comp/compound/General/CD/CD_abg.fig Index: mttroot/mtt/lib/comp/compound/General/CD/CD_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/CD/CD_abg.fig +++ mttroot/mtt/lib/comp/compound/General/CD/CD_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5b -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 2700 3150 2700 2250 2925 2475 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 2925 3375 3825 3375 3600 3600 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 1575 3375 2475 3375 2250 3600 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 1350 3150 1350 2250 1575 2475 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 225 3375 1125 3375 900 3600 -4 1 0 100 0 18 18 0.0000 4 210 510 1350 2115 Df:f\001 -4 1 0 100 0 18 18 0.0000 4 210 630 2700 2115 De:e\001 -4 0 0 100 0 18 18 0.0000 4 210 405 3960 3465 C:c_1\001 -4 2 4 100 0 18 18 0.0000 4 270 900 135 3465 SS:[in]\001 -4 1 0 100 0 18 18 0.0000 4 195 150 1350 3465 1\001 -4 1 0 100 0 18 18 0.0000 4 195 150 2700 3465 0\001 DELETED mttroot/mtt/lib/comp/compound/General/CD/CD_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/CD/CD_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/CD/CD_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/CD/CD_lbl.txt @@ -1,56 +0,0 @@ -#SUMMARY CD -#DESCRIPTION Detailed description here - -## System CD, representation lbl, language txt -## File CD_lbl.txt -## Generated by MTT on Thu Apr 24 10:30:13 EST 2014 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in - -## Argument aliases -#ALIAS $1 effort,c_1 - -## cr aliases -#ALIAS $a1 lin - - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type De - e SS external - -## Component type Df - f SS external - -## Component type I - c_1 lin effort,c_1 - -## Component type SS - [in] SS external,external - DELETED mttroot/mtt/lib/comp/compound/General/CDx/CDx_abg.fig Index: mttroot/mtt/lib/comp/compound/General/CDx/CDx_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/CDx/CDx_abg.fig +++ mttroot/mtt/lib/comp/compound/General/CDx/CDx_abg.fig @@ -1,24 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 3150 3150 3150 2925 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 2925 3375 1575 3600 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 3375 3375 4725 3150 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 4950 5175 4950 4950 5175 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 6750 5850 675 5850 675 900 6750 900 6750 5850 -4 1 0 100 0 18 18 0.0000 4 210 450 3375 1440 C:c\001 -4 1 0 100 0 18 18 0.0000 4 195 150 3375 3240 0\001 -4 2 4 100 0 18 18 0.0000 4 270 870 1755 3240 SS:[in]\001 -4 1 0 100 0 18 18 0.0000 4 210 615 3330 5085 AE:a\001 -4 0 4 100 0 18 18 0.0000 4 270 1065 5310 5040 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/General/CDx/CDx_desc.tex Index: mttroot/mtt/lib/comp/compound/General/CDx/CDx_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/General/CDx/CDx_desc.tex +++ mttroot/mtt/lib/comp/compound/General/CDx/CDx_desc.tex @@ -1,25 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system CDx (CDx_desc.tex) -% Generated by MTT on Thu Apr 19 10:28:34 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{CDx} is - displayed in Figure \Ref{fig:CDx_abg.ps} and its label - file is listed in Section \Ref{sec:CDx_lbl}. - - This component is a standard compliance except that: - \begin{itemize} - \item There is an additional output equal to the integrated flow - variable - \item the re is a single parameter $c$ -- the compliance. - \end{itemize} - DELETED mttroot/mtt/lib/comp/compound/General/CDx/CDx_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/CDx/CDx_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/CDx/CDx_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/CDx/CDx_lbl.txt @@ -1,38 +0,0 @@ -%% Label file for system CDx (CDx_lbl.txt) -%SUMMARY CDx: C component with state output -%DESCRIPTION Parameter 1: compliance - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS out out - -% Argument aliases -%ALIAS $1 c - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AE - a lin c - -% Component type C - c lin effort,c - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/comp/compound/General/CS/CS_abg.fig Index: mttroot/mtt/lib/comp/compound/General/CS/CS_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/CS/CS_abg.fig +++ mttroot/mtt/lib/comp/compound/General/CS/CS_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2340 3915 2610 4185 -4 1 0 100 0 18 20 0.0000 4 270 195 2475 4185 1\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 3825 2475 2475 2700 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 5625 2475 4275 2700 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4050 4050 4050 3825 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2700 3825 2700 4275 -4 1 0 100 0 18 20 0.0000 4 285 570 2475 2295 C:c\001 -4 0 0 100 0 18 20 0.0000 4 360 1185 4185 4185 Se:e_0\001 -4 1 4 100 0 18 20 0.0000 4 360 1185 2475 6030 SS:[in]\001 DELETED mttroot/mtt/lib/comp/compound/General/CS/CS_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/CS/CS_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/CS/CS_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/CS/CS_lbl.txt @@ -1,36 +0,0 @@ -%% Label file for system CS (CS_lbl.txt) -%SUMMARY CS C component with initial state - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in - -% Argument aliases -%ALIAS $1 effort,c -%ALIAS $2 e_0 - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - c lin effort,c - -% Component type SS - [in] SS external,external - -% Component type Se - e_0 SS e_0 - - DELETED mttroot/mtt/lib/comp/compound/General/CSW/CSW_abg.fig Index: mttroot/mtt/lib/comp/compound/General/CSW/CSW_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/CSW/CSW_abg.fig +++ mttroot/mtt/lib/comp/compound/General/CSW/CSW_abg.fig @@ -1,11 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 2925 2475 1575 2700 1800 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 4770 3600 4770 900 225 900 225 3600 4770 3600 -4 1 4 0 0 0 20 0.0000 4 240 810 2475 3240 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 2130 2520 1440 C:MTT_SWITCH\001 DELETED mttroot/mtt/lib/comp/compound/General/CSW/CSW_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/CSW/CSW_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/CSW/CSW_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/CSW/CSW_lbl.txt @@ -1,44 +0,0 @@ -%SUMMARY CSW: Switched C component -%DESCRIPTION CSW acts as an C component except when the -s -c option is used. -%DESCRIPTION When the -s -c option is used: -%DESCRIPTION The component label is used as a variable name (eg Name) -%DESCRIPTION In the ode simulation: -%DESCRIPTION Name = 1 implies normal C (closed switch) -%DESCRIPTION Name = 0 implies state=0 (open switch) -%DESCRIPTION Name = -1 implies state>0 (Diode) - -%ALIAS out in -%ALIAS $1 lin -%ALIAS $1 effort,c_s - -%% Label file for system CSW (CSW_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1997/09/11 09:00:52 peterg -% %% More documentation. -% %% -% %% Revision 1.1 1997/06/16 10:55:20 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1997/06/03 15:26:09 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - MTT_SWITCH lin effort,c_s - -% Component type SS - [in] SS external,external - DELETED mttroot/mtt/lib/comp/compound/General/CX/CX_abg.fig Index: mttroot/mtt/lib/comp/compound/General/CX/CX_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/CX/CX_abg.fig +++ mttroot/mtt/lib/comp/compound/General/CX/CX_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1800 2700 3150 2700 2925 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2700 4950 2700 4725 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 1125 3375 2475 3600 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 3600 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 2475 3600 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 2475 1800 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 1125 3150 1125 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6075 3600 6075 450 225 450 225 3600 6075 3600 -4 1 -1 0 0 22 20 0.0000 4 225 150 3375 2835 0\001 -4 1 -1 0 0 22 20 0.0000 4 240 435 5355 2790 C:c\001 -4 2 4 0 0 22 20 0.0000 4 315 870 1665 2790 SS:[in]\001 -4 1 4 0 0 22 20 0.0000 4 315 810 3375 990 SS:[X]\001 DELETED mttroot/mtt/lib/comp/compound/General/CX/CX_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/CX/CX_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/CX/CX_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/CX/CX_lbl.txt @@ -1,34 +0,0 @@ -#SUMMARY CX C component with state i/o -#DESCRIPTION Port [X]: state i/o -## Label file for system CX (CX_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.3 2000/08/29 15:25:33 peterg -# ## New SS format -# ## -# ## Revision 1.2 1998/04/14 17:06:44 peterg -# ## Input only to SS -# ## -# ## Revision 1.1 1998/04/12 15:21:11 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - -# Component type C - c $1 $1 - -# Component type SS - [in] SS internal,external - [X] SS internal,external - - DELETED mttroot/mtt/lib/comp/compound/General/De/De_abg.fig Index: mttroot/mtt/lib/comp/compound/General/De/De_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/De/De_abg.fig +++ mttroot/mtt/lib/comp/compound/General/De/De_abg.fig @@ -1,17 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 4 0 2 31 7 99 0 -1 0.000 0 0 7 0 0 5 - 4950 3600 4950 1800 675 1800 675 3600 4950 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3150 2475 3150 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2700 3150 2700 2925 2925 -4 0 0 100 0 18 20 0.0000 4 285 660 3285 2790 SS:y\001 -4 2 4 100 0 18 20 0.0000 4 285 975 1755 2790 SS:[in]\001 DELETED mttroot/mtt/lib/comp/compound/General/De/De_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/De/De_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/De/De_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/De/De_lbl.txt @@ -1,37 +0,0 @@ -%% Label file for system De (De_lbl.txt) -%SUMMARY De Simple effort detector -%DESCRIPTION Simple effort detector constructed from SS with fixed causality - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1999/09/07 03:32:21 peterg -% %% Fixed alias bug -% %% -% %% Revision 1.2 1999/09/07 03:21:02 peterg -% %% Aliased to out as well as in -% %% -% %% Revision 1.1 1999/03/03 22:02:04 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in|out in - -% Argument aliases -%ALIAS $1 external - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [in] SS external,external - y SS external,0 DELETED mttroot/mtt/lib/comp/compound/General/Df/Df_abg.fig Index: mttroot/mtt/lib/comp/compound/General/Df/Df_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/Df/Df_abg.fig +++ mttroot/mtt/lib/comp/compound/General/Df/Df_abg.fig @@ -1,17 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 4 0 2 31 7 99 0 -1 0.000 0 0 7 0 0 5 - 4950 3600 4950 1800 675 1800 675 3600 4950 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2700 3150 2700 2925 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 1800 2475 1800 2925 -4 0 0 100 0 18 20 0.0000 4 285 660 3285 2790 SS:y\001 -4 2 4 100 0 18 20 0.0000 4 285 975 1755 2790 SS:[port]\001 DELETED mttroot/mtt/lib/comp/compound/General/Df/Df_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/Df/Df_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/Df/Df_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/Df/Df_lbl.txt @@ -1,37 +0,0 @@ -%% Label file for system Df (Df_lbl.txt) -%SUMMARY Df Simple flow detector -%DESCRIPTION Simple flow detector constructed from SS with fixed causality - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1999/09/07 03:31:47 peterg -% %% Fixed alias bug -% %% -% %% Revision 1.2 1999/09/07 03:20:34 peterg -% %% Aliased to out as well as in -% %% -% %% Revision 1.1 1999/03/03 22:05:16 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in|out port - -% Argument aliases -%ALIAS $1 external -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [port] SS external,external - y SS 0,external DELETED mttroot/mtt/lib/comp/compound/General/EMAE/EMAE_abg.fig Index: mttroot/mtt/lib/comp/compound/General/EMAE/EMAE_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/EMAE/EMAE_abg.fig +++ mttroot/mtt/lib/comp/compound/General/EMAE/EMAE_abg.fig @@ -1,33 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5b -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3150 4995 3150 4725 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 1080 5850 2475 5580 2205 -2 4 0 2 31 7 0 0 -1 0.000 0 0 7 0 0 5 - 10125 4275 10125 225 225 225 225 4275 10125 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1530 3150 2925 3150 2655 3420 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 6075 2475 5625 2475 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2925 2925 2925 3375 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 8100 2925 8100 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6705 3150 8100 3150 7830 3420 -4 1 -1 0 0 22 20 0.0000 4 240 375 3330 3240 AE\001 -4 1 -1 0 0 22 20 0.0000 4 315 1380 5895 3240 EMTF:gain\001 -4 2 4 0 0 22 20 0.0000 4 300 870 1485 3240 SS:[in]\001 -4 0 4 0 0 22 20 0.0000 4 300 1050 8370 3240 SS:[out]\001 -4 1 4 0 0 22 20 0.0000 4 300 1200 5805 945 SS:[mod]\001 -4 1 4 0 0 22 20 0.0000 4 300 750 5850 2925 [mod]\001 -4 2 4 0 0 22 20 0.0000 4 300 420 4995 2925 [in]\001 -4 0 4 0 0 22 20 0.0000 4 300 600 6705 2925 [out]\001 DELETED mttroot/mtt/lib/comp/compound/General/EMAE/EMAE_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/EMAE/EMAE_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/EMAE/EMAE_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/EMAE/EMAE_lbl.txt @@ -1,32 +0,0 @@ -%SUMMARY EMAE Effort-modulated AE component -%DESCRIPTION Ports: [in], [out] and [mod] - - -%% Label file for system EMAE (EMAE_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/08/29 15:27:30 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type EMTF - gain lin effort - -% Component type SS - [in] SS external,external - [mod] SS external,external - [out] SS external,external - - DELETED mttroot/mtt/lib/comp/compound/General/EMAF/EMAF_abg.fig Index: mttroot/mtt/lib/comp/compound/General/EMAF/EMAF_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/EMAF/EMAF_abg.fig +++ mttroot/mtt/lib/comp/compound/General/EMAF/EMAF_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1575 3150 2970 3150 2700 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3150 4995 3150 4725 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 3150 8145 3150 7875 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 1080 5850 2475 5580 2205 -2 4 0 2 31 7 0 0 -1 0.000 0 0 7 0 0 5 - 10125 4275 10125 225 225 225 225 4275 10125 4275 -4 1 -1 0 0 22 20 0.0000 4 210 390 3330 3240 AF\001 -4 1 -1 0 0 22 20 0.0000 4 270 1455 5895 3240 EMTF:gain\001 -4 2 4 0 0 22 20 0.0000 4 270 900 1485 3240 SS:[in]\001 -4 0 4 0 0 22 20 0.0000 4 270 1095 8370 3240 SS:[out]\001 -4 1 4 0 0 22 20 0.0000 4 270 1275 5805 945 SS:[mod]\001 -4 1 4 0 0 22 20 0.0000 4 270 795 5850 2925 [mod]\001 -4 2 4 0 0 22 20 0.0000 4 270 420 4995 2925 [in]\001 -4 0 4 0 0 22 20 0.0000 4 270 615 6705 2925 [out]\001 DELETED mttroot/mtt/lib/comp/compound/General/EMAF/EMAF_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/EMAF/EMAF_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/EMAF/EMAF_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/EMAF/EMAF_lbl.txt @@ -1,29 +0,0 @@ -%SUMMARY EMAF Effort-modulated AF component -%DESCRIPTION Ports: [in], [out] and [mod] - - -%% Label file for system EMAF (EMAF_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type EMTF - gain lin flow - -% Component type SS - [in] SS external,external - [mod] SS external,external - [out] SS external,external - - DELETED mttroot/mtt/lib/comp/compound/General/EMR/EMR_abg.fig Index: mttroot/mtt/lib/comp/compound/General/EMR/EMR_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/EMR/EMR_abg.fig +++ mttroot/mtt/lib/comp/compound/General/EMR/EMR_abg.fig @@ -1,24 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5b -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2040 3030 2460 3240 -4 1 0 100 0 18 18 0.0000 4 210 420 2250 3240 GY\001 --6 -6 1800 4725 2700 5175 -4 1 0 100 0 18 18 0.0000 4 210 825 2250 5040 FMR:r\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 1575 2250 2925 2025 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 3375 2250 4725 2025 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 6525 2250 5175 2025 5400 -4 1 4 100 0 18 18 0.0000 4 270 1275 2250 1350 SS:[mod]\001 -4 1 4 100 0 18 18 0.0000 4 270 900 2250 6975 SS:[in]\001 -4 0 4 100 0 18 14 0.0000 4 225 660 2475 4725 [mod]\001 DELETED mttroot/mtt/lib/comp/compound/General/EMR/EMR_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/EMR/EMR_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/EMR/EMR_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/EMR/EMR_lbl.txt @@ -1,45 +0,0 @@ -#SUMMARY EMR Effort-modulated resistor -#DESCRIPTION Resistor CR is modulated by effort on port [mod] - -## System EMR, representation lbl, language txt -## File EMR_lbl.txt -## Generated by MTT on Wed Aug 14 09:04:10 EST 2013 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in -#ALIAS mod mod - -## Argument aliases -#ALIAS $1 effort,k - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type FMR - r lin effort,k - -## Component type GY (anonymous => default parameters) - # GY - -## Component type SS - [in] SS external,external - [mod] SS external,external - DELETED mttroot/mtt/lib/comp/compound/General/ID/ID_abg.fig Index: mttroot/mtt/lib/comp/compound/General/ID/ID_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/ID/ID_abg.fig +++ mttroot/mtt/lib/comp/compound/General/ID/ID_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5b -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 2700 3150 2700 2250 2925 2475 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 2925 3375 3825 3375 3600 3600 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 1575 3375 2475 3375 2250 3600 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 1350 3150 1350 2250 1575 2475 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 225 3375 1125 3375 900 3600 -4 1 0 100 0 18 18 0.0000 4 210 510 1350 2115 Df:f\001 -4 1 0 100 0 18 18 0.0000 4 210 630 2700 2115 De:e\001 -4 0 0 100 0 18 18 0.0000 4 210 405 3960 3465 I:i_1\001 -4 2 4 100 0 18 18 0.0000 4 270 900 135 3465 SS:[in]\001 -4 1 0 100 0 18 18 0.0000 4 195 150 1350 3465 1\001 -4 1 0 100 0 18 18 0.0000 4 195 150 2700 3465 0\001 DELETED mttroot/mtt/lib/comp/compound/General/ID/ID_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/ID/ID_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/ID/ID_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/ID/ID_lbl.txt @@ -1,56 +0,0 @@ -#SUMMARY ID -#DESCRIPTION Detailed description here - -## System ID, representation lbl, language txt -## File ID_lbl.txt -## Generated by MTT on Thu Apr 24 10:30:13 EST 2014 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in - -## Argument aliases -#ALIAS $1 flow,i_1 - -## cr aliases -#ALIAS $a1 lin - - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type De - e SS external - -## Component type Df - f SS external - -## Component type I - i_1 lin flow,i_1 - -## Component type SS - [in] SS external,external - DELETED mttroot/mtt/lib/comp/compound/General/INTF/INTF_abg.fig Index: mttroot/mtt/lib/comp/compound/General/INTF/INTF_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/INTF/INTF_abg.fig +++ mttroot/mtt/lib/comp/compound/General/INTF/INTF_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1801 3151 2701 3151 2476 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3376 3151 4276 3151 4051 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 2926 4501 2026 4726 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3151 5626 3151 5401 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6301 3150 7201 3150 6976 3375 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9900 4050 450 4050 450 1350 9900 1350 9900 4050 -4 2 4 0 0 0 20 0.0000 4 240 1170 1711 3241 SS:[Flow]\001 -4 1 -1 0 0 0 20 0.0000 4 195 375 3016 3241 AF\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 4501 3241 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 195 4501 1891 C\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 5986 3241 AE\001 -4 0 4 0 0 0 20 0.0000 4 255 2400 7336 3241 SS:[Integrated_flow]\001 DELETED mttroot/mtt/lib/comp/compound/General/INTF/INTF_desc.tex Index: mttroot/mtt/lib/comp/compound/General/INTF/INTF_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/General/INTF/INTF_desc.tex +++ mttroot/mtt/lib/comp/compound/General/INTF/INTF_desc.tex @@ -1,17 +0,0 @@ -% Verbal description for system INTF (INTF_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:16 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{INTF} is - displayed in Figure \Ref{INTF_abg} and its label - file is listed in Section \Ref{sec:INTF_lbl}. - The subsystems are listed in Section \Ref{sec:INTF_sub}. - -\textbf{INTF} is a two-port component where the effort on port [out] - is the integral of the flow on port [in]. DELETED mttroot/mtt/lib/comp/compound/General/INTF/INTF_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/INTF/INTF_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/INTF/INTF_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/INTF/INTF_lbl.txt @@ -1,30 +0,0 @@ -%% Label file for system INTF (INTF_lbl.txt) -%SUMMARY INTF: flow integrator -%DESCRIPTION Port [in]: Flow to be integrated -%DESCRIPTION Port [out]: Effort = integral of flow on port [in] - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Flow -%ALIAS out Integrated_flow - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [Flow] SS external,external - [Integrated_flow] SS external,external DELETED mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_abg.fig Index: mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_abg.fig +++ mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1801 3151 2701 3151 2476 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3376 3151 4276 3151 4051 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 2926 4501 2026 4726 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3151 5626 3151 5401 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6301 3150 7201 3150 6976 3375 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9900 4050 450 4050 450 1350 9900 1350 9900 4050 -4 2 4 0 0 0 20 0.0000 4 240 1170 1711 3241 SS:[Flow]\001 -4 1 -1 0 0 0 20 0.0000 4 195 375 3016 3241 AF\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 4501 3241 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 195 4501 1891 CS:unit\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 5986 3241 AE\001 -4 0 4 0 0 0 20 0.0000 4 255 2400 7336 3241 SS:[Integrated_flow]\001 DELETED mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_desc.tex Index: mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_desc.tex +++ mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_desc.tex @@ -1,21 +0,0 @@ -% Verbal description for system INTF (INTF_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:16 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/08/24 11:20:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{INTFS} is - displayed in Figure \Ref{INTFS_abg} and its label - file is listed in Section \Ref{sec:INTFS_lbl}. - The subsystems are listed in Section \Ref{sec:INTFS_sub}. - -\textbf{INTFS} is a two-port component where the effort on port [out] - is the integral of the flow on port [in]. The single parameter e_0 - is the initial value of the integral. DELETED mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/INTFS/INTFS_lbl.txt @@ -1,38 +0,0 @@ -%% Label file for system INTF (INTF_lbl.txt) -%SUMMARY INTFS: flow integrator with explicit initial state -%DESCRIPTION Port [in]: Flow to be integrated -%DESCRIPTION Port [out]: Effort = integral of flow on port [in] - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/07/16 07:35:10 peterg -% %% Aliased version -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Flow -%ALIAS out Integrated_flow - -% Argument aliases -%ALIAS $1 e_0 - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type CS - unit lin effort,1;e_0 - -% Component type SS - [Flow] SS external,external - [Integrated_flow] SS external,external - DELETED mttroot/mtt/lib/comp/compound/General/IS/IS_abg.fig Index: mttroot/mtt/lib/comp/compound/General/IS/IS_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/IS/IS_abg.fig +++ mttroot/mtt/lib/comp/compound/General/IS/IS_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 3825 2475 2475 2700 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 5625 2475 4275 2700 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4050 4050 4050 3825 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 3825 4050 4275 -2 4 0 2 31 7 52 0 -1 0.000 0 0 7 0 0 5 - 5625 6570 5625 1575 1350 1575 1350 6570 5625 6570 -4 1 0 100 0 18 20 0.0000 4 210 240 2475 2295 I:i\001 -4 0 0 100 0 18 20 0.0000 4 270 795 4185 4185 Sf:f_0\001 -4 1 4 100 0 18 20 0.0000 4 270 900 2475 6030 SS:[in]\001 -4 1 0 100 0 18 20 0.0000 4 195 150 2475 4185 0\001 DELETED mttroot/mtt/lib/comp/compound/General/IS/IS_abg.fig.bak Index: mttroot/mtt/lib/comp/compound/General/IS/IS_abg.fig.bak ================================================================== --- mttroot/mtt/lib/comp/compound/General/IS/IS_abg.fig.bak +++ mttroot/mtt/lib/comp/compound/General/IS/IS_abg.fig.bak @@ -1,23 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2340 3915 2610 4185 -4 1 0 100 0 18 20 0.0000 4 270 195 2475 4185 0\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 3825 2475 2475 2700 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 5625 2475 4275 2700 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4050 4050 4050 3825 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 3825 4050 4275 -4 1 0 100 0 18 20 0.0000 4 285 315 2475 2295 I:i\001 -4 0 0 100 0 18 20 0.0000 4 360 1035 4185 4185 Sf:f_0\001 -4 1 4 100 0 18 20 0.0000 4 360 1185 2475 6030 SS:[in]\001 DELETED mttroot/mtt/lib/comp/compound/General/IS/IS_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/IS/IS_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/IS/IS_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/IS/IS_lbl.txt @@ -1,39 +0,0 @@ -%% Label file for system IS (IS_lbl.txt) -%SUMMARY IS I component with initial state - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:29:11 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in - -% Argument aliases -%ALIAS $1 flow,i -%ALIAS $2 f_0 - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type I - i lin flow,i - -% Component type SS - [in] SS external,external - -% Component type Sf - f_0 SS f_0 - - DELETED mttroot/mtt/lib/comp/compound/General/ISW/ISW_abg.fig Index: mttroot/mtt/lib/comp/compound/General/ISW/ISW_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/ISW/ISW_abg.fig +++ mttroot/mtt/lib/comp/compound/General/ISW/ISW_abg.fig @@ -1,11 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 2925 2475 1575 2700 1800 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 4770 3600 4770 900 225 900 225 3600 4770 3600 -4 1 4 0 0 0 20 0.0000 4 240 810 2475 3240 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 2025 2520 1440 I:MTT_SWITCH\001 DELETED mttroot/mtt/lib/comp/compound/General/ISW/ISW_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/ISW/ISW_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/ISW/ISW_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/ISW/ISW_lbl.txt @@ -1,42 +0,0 @@ -%SUMMARY ISW: Switched I component -%DESCRIPTION ISW acts as an I component except when the -s -c option is used. -%DESCRIPTION When the -s -c option is used: -%DESCRIPTION The component label is used as a variable name (eg Name) -%DESCRIPTION In the ode simulation: -%DESCRIPTION Name = 1 implies normal I (closed switch) -%DESCRIPTION Name = 0 implies state=0 (open switch) -%DESCRIPTION Name = -1 implies state>0 (Diode) - -%ALIAS out in -%ALIAS $1 lin -%ALIAS $1 flow,i_s - - - -%% Label file for system ISW (ISW_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/07/26 12:57:00 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1997/06/03 15:26:09 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type I - MTT_SWITCH lin flow,i_s - -% Component type SS - [in] SS external,external DELETED mttroot/mtt/lib/comp/compound/General/IX/IX_abg.fig Index: mttroot/mtt/lib/comp/compound/General/IX/IX_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/IX/IX_abg.fig +++ mttroot/mtt/lib/comp/compound/General/IX/IX_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1800 2700 3150 2700 2925 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2700 4950 2700 4725 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 1125 3375 2475 3600 2250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 5850 3825 5850 450 225 450 225 3825 5850 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 2475 3150 2475 -4 1 -1 0 0 22 20 0.0000 4 225 150 3375 2835 1\001 -4 1 -1 0 0 22 20 0.0000 4 240 240 5355 2790 I:i\001 -4 2 4 0 0 22 20 0.0000 4 315 870 1665 2790 SS:[in]\001 -4 1 4 0 0 22 20 0.0000 4 315 810 3375 990 SS:[X]\001 DELETED mttroot/mtt/lib/comp/compound/General/IX/IX_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/IX/IX_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/IX/IX_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/IX/IX_lbl.txt @@ -1,34 +0,0 @@ -#SUMMARY IX I component with state i/o -#DESCRIPTION Port [X]: state i/o - -## Label file for system IX (IX_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.3 2000/08/29 15:26:38 peterg -# ## New SS format -# ## -# ## Revision 1.2 1998/04/14 17:08:50 peterg -# ## Input only on SS -# ## -# ## Revision 1.1 1998/04/12 15:20:11 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - -# Component type I - i $1 $1 - -# Component type SS - [in] SS internal,external - [X] SS internal,external DELETED mttroot/mtt/lib/comp/compound/General/Lf/Lf_abg.fig Index: mttroot/mtt/lib/comp/compound/General/Lf/Lf_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/Lf/Lf_abg.fig +++ mttroot/mtt/lib/comp/compound/General/Lf/Lf_abg.fig @@ -1,34 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 2925 5400 2925 5175 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 2925 7650 2925 7425 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7875 3150 7875 4500 8100 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 4500 3825 3150 4050 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7875 2700 7875 1350 8100 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 1350 3825 2700 4050 2475 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 8550 5175 3150 5175 3150 675 8550 675 8550 5175 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 7650 2700 8100 2700 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3600 1350 4050 1350 -4 1 4 100 0 18 18 0.0000 4 270 825 3825 4950 SS:[n]\001 -4 1 4 100 0 18 18 0.0000 4 270 840 7875 4950 SS:[p]\001 -4 1 0 100 0 18 18 0.0000 4 195 150 3825 3015 0\001 -4 1 0 100 0 18 18 0.0000 4 210 405 5850 3015 AE\001 -4 1 0 100 0 18 18 0.0000 4 195 150 7875 3015 1\001 -4 1 4 100 0 18 18 0.0000 4 270 1095 7875 1125 SS:[out]\001 -4 1 4 100 0 18 18 0.0000 4 270 900 3825 1125 SS:[in]\001 DELETED mttroot/mtt/lib/comp/compound/General/Lf/Lf_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/Lf/Lf_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/Lf/Lf_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/Lf/Lf_lbl.txt @@ -1,51 +0,0 @@ -#SUMMARY Lf: loop gain (flow) -#DESCRIPTION Loop gain transfer function is formed by breaking loop - -## System Lf, representation lbl, language txt -## File Lf_lbl.txt -## Generated by MTT on Mon Dec 5 09:38:43 EST 2005 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in -#ALIAS n n -#ALIAS out out -#ALIAS p p - -## Argument aliases - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type AE (anonymous => default parameters) - # AE - -## Component type SS - [in] SS external,external - [n] SS external,external - [out] SS external,external - [p] SS external,external - DELETED mttroot/mtt/lib/comp/compound/General/RD/RD_abg.fig Index: mttroot/mtt/lib/comp/compound/General/RD/RD_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/RD/RD_abg.fig +++ mttroot/mtt/lib/comp/compound/General/RD/RD_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5b -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 2700 3150 2700 2250 2925 2475 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 2925 3375 3825 3375 3600 3600 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 1575 3375 2475 3375 2250 3600 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 1350 3150 1350 2250 1575 2475 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 - 225 3375 1125 3375 900 3600 -4 1 0 100 0 18 18 0.0000 4 210 510 1350 2115 Df:f\001 -4 1 0 100 0 18 18 0.0000 4 210 630 2700 2115 De:e\001 -4 0 0 100 0 18 18 0.0000 4 210 405 3960 3465 R:r\001 -4 2 4 100 0 18 18 0.0000 4 270 900 135 3465 SS:[in]\001 -4 1 0 100 0 18 18 0.0000 4 195 150 1350 3465 1\001 -4 1 0 100 0 18 18 0.0000 4 195 150 2700 3465 0\001 DELETED mttroot/mtt/lib/comp/compound/General/RD/RD_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/RD/RD_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/RD/RD_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/RD/RD_lbl.txt @@ -1,56 +0,0 @@ -#SUMMARY RD -#DESCRIPTION Detailed description here - -## System RD, representation lbl, language txt -## File RD_lbl.txt -## Generated by MTT on Thu Apr 24 10:30:13 EST 2014 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in - -## Argument aliases -#ALIAS $1 flow,r - -## cr aliases -#ALIAS $a1 lin - - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type De - e SS external - -## Component type Df - f SS external - -## Component type R - r lin flow,r - -## Component type SS - [in] SS external,external - DELETED mttroot/mtt/lib/comp/compound/General/Se/Se_abg.fig Index: mttroot/mtt/lib/comp/compound/General/Se/Se_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/Se/Se_abg.fig +++ mttroot/mtt/lib/comp/compound/General/Se/Se_abg.fig @@ -1,17 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2700 3150 2700 2925 2925 -2 4 0 2 31 7 99 0 -1 0.000 0 0 7 0 0 5 - 4950 3600 4950 1800 675 1800 675 3600 4950 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3150 2475 3150 2925 -4 2 0 100 0 18 20 0.0000 4 225 675 1710 2790 SS:u\001 -4 0 4 100 0 18 20 0.0000 4 285 1170 3330 2790 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/General/Se/Se_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/Se/Se_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/Se/Se_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/Se/Se_lbl.txt @@ -1,35 +0,0 @@ -%% Label file for system Se (Se_lbl.txt) -%SUMMARY Se Simple effort source -%DESCRIPTION Simple effort source constructed from SS with fixed causality - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1999/03/12 04:04:27 peterg -% %% Single argument - the effort value e_s -% %% -% %% Revision 1.1 1999/03/03 21:55:46 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS out|in out - -% Argument aliases -%ALIAS $1 e_s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [out] SS external,external - u SS e_s,internal DELETED mttroot/mtt/lib/comp/compound/General/Sf/Sf_abg.fig Index: mttroot/mtt/lib/comp/compound/General/Sf/Sf_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/General/Sf/Sf_abg.fig +++ mttroot/mtt/lib/comp/compound/General/Sf/Sf_abg.fig @@ -1,17 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2700 3150 2700 2925 2925 -2 4 0 2 31 7 99 0 -1 0.000 0 0 7 0 0 5 - 4950 3600 4950 1800 675 1800 675 3600 4950 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 1800 2475 1800 2925 -4 2 0 100 0 18 20 0.0000 4 225 675 1710 2790 SS:u\001 -4 0 4 100 0 18 20 0.0000 4 285 1170 3330 2790 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/General/Sf/Sf_lbl.txt Index: mttroot/mtt/lib/comp/compound/General/Sf/Sf_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/General/Sf/Sf_lbl.txt +++ mttroot/mtt/lib/comp/compound/General/Sf/Sf_lbl.txt @@ -1,33 +0,0 @@ -%% Label file for system Sf (Sf_lbl.txt) -%SUMMARY Sf Simple flow source -%DESCRIPTION Simple flow source constructed from SS with fixed causality - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1999/03/12 04:03:09 peterg -% %% Single argument - the value of the flow -% %% -% %% Revision 1.1 1999/03/03 21:50:15 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS out|in out - -% Argument aliases -%ALIAS $1 f_s -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [out] SS external,external - u SS internal,f_s DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_abg.fig Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_abg.fig +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_abg.fig @@ -1,68 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 2250 3825 2250 3600 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 2250 5400 2250 5175 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5850 2250 6975 2250 6750 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 2025 4050 900 4275 1125 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6975 2025 6975 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 2475 4950 3150 5175 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4500 3825 4500 3600 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5850 4500 6975 4500 6750 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4500 5400 4500 5175 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 3600 4050 4275 4275 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 4275 3825 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6975 4275 6975 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 2025 3825 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 4725 5625 5850 5850 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5850 6075 6975 6075 6750 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5400 6075 4275 6075 4500 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 5850 5400 6300 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 675 225 675 6975 9225 6975 9225 225 675 225 -4 2 4 100 0 18 20 0.0000 4 360 1605 2655 4590 SS:[a_in]\001 -4 1 0 100 0 18 20 0.0000 4 270 195 4050 2340 1\001 -4 1 0 100 0 18 20 0.0000 4 270 195 5625 2340 0\001 -4 1 0 100 0 18 20 0.0000 4 285 750 4050 765 I:dm\001 -4 0 4 100 0 18 20 0.0000 4 360 1860 7110 2340 SS:[y_out]\001 -4 2 4 100 0 18 20 0.0000 4 360 1620 2565 2340 SS:[y_in]\001 -4 0 4 100 0 18 20 0.0000 4 360 1845 7065 4590 SS:[a_out]\001 -4 1 0 100 0 18 20 0.0000 4 270 195 4050 4590 1\001 -4 1 0 100 0 18 20 0.0000 4 270 195 5625 4590 0\001 -4 1 0 100 0 18 20 0.0000 4 285 975 4815 3510 TF:dz\001 -4 1 1 101 0 32 20 0.0000 4 255 270 4635 4095 W\001 -4 1 1 101 0 32 20 0.0000 4 255 945 6345 4950 W+DW\001 -4 1 1 101 0 32 20 0.0000 4 255 270 4680 4950 W\001 -4 1 1 101 0 32 20 0.0000 4 255 270 3150 4950 W\001 -4 1 1 101 0 18 20 0.0000 4 210 210 3150 2610 v\001 -4 1 1 101 0 18 20 0.0000 4 210 210 4725 2610 v\001 -4 1 1 101 0 18 20 0.0000 4 210 825 6255 2610 v+ v\001 -4 1 1 101 0 32 20 0.0000 4 255 225 6390 2610 D\001 -4 1 1 101 0 32 20 0.0000 4 255 225 5400 3015 D\001 -4 1 1 101 0 18 20 0.0000 4 210 210 5625 3015 v\001 -4 1 0 100 0 18 20 0.0000 4 270 195 5625 6210 1\001 -4 1 0 100 0 18 20 0.0000 4 285 810 7425 6165 C:dk\001 -4 1 0 100 0 18 20 0.0000 4 285 735 3915 6165 R:dr\001 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_desc.tex @@ -1,48 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system BernoulliEuler (BernoulliEuler_desc.tex) -% Generated by MTT on Mon Apr 19 06:43:36 BST 1999. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{BernoulliEuler} is - displayed in Figure \Ref{fig:BernoulliEuler_abg.ps} and its label - file is listed in Section \Ref{sec:BernoulliEuler_lbl}. - The subsystems are listed in Section \Ref{sec:BernoulliEuler_sub}. - -This component represents one lump of a lumped model of a uniform beam -modelled using the the Bernoulli-Euler assumptions: -\begin{enumerate} -\item The shear forces can be neglected. -\item Rotational inertia can be neglected. -\end{enumerate} - -\begin{itemize} -\item The \textbf{I} component represents the inertial properties of - the lump in the perpendicular direction. In particular the velocity - of the lump $v$ is: - \begin{equation} - \dot v = \frac{\Delta f}{\Delta m} - \end{equation} - where $\Delta m$ is the lump mass and $\Delta f$ is the net vertical - force. -\item The \textbf{C} component represents the angular stiffness of the - lump. In particular the torque acting on the lump is: - \begin{equation} - \dot \tau = \Delta k \Delta \Omega - \end{equation} - where $\Delta k$ is the lump (angular) stiffness and $\Delta \Omega$ - is the net angular velocity. -\item The \textbf{TF} component represents the relation between the - angular domains - \begin{equation} - \begin{align} - \tau &= \Delta x \Delta f \\ - \Delta v &= \Delta x \Omega - \end{align} - \end{equation} -\end{itemize} DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/BernoulliEuler/BernoulliEuler_lbl.txt @@ -1,65 +0,0 @@ -%% Label file for system BernoulliEuler (BernoulliEuler_lbl.txt) -%SUMMARY BernoulliEuler -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 1999/10/13 07:01:58 peterg -% %% Added aliases: -% %% a_in theta_in -% %% a_out theta_out -% %% -% %% Revision 1.3 1999/09/02 03:07:16 peterg -% %% r_d --> dr -% %% -% %% Revision 1.2 1999/05/17 21:27:05 peterg -% %% Added damping -% %% -% %% Revision 1.1 1999/05/16 07:12:40 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS theta_in a_in -%ALIAS theta_out a_out -%ALIAS in y_in,a_in -%ALIAS out y_out,a_out - -% Argument aliases -%ALIAS $1 dk -%ALIAS $2 dm -%ALIAS $3 dz -%ALIAS $4 dr - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type I - dm lin flow,dm - -% Component type C - dk lin state,dk - -% Component type R - dr lin flow,dr - -% Component type SS - [y_in] SS external,external - [y_out] SS external,external - [a_in] SS external,external - [a_out] SS external,external - -% Component type TF - dz lin effort,dz - - - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_abg.fig Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_abg.fig +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_abg.fig @@ -1,67 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 2250 3825 2250 3600 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 2250 5400 2250 5175 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5850 2250 6975 2250 6750 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 2025 4050 900 4275 1125 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6975 2025 6975 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 2475 4950 3150 5175 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4500 3825 4500 3600 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5850 4500 6975 4500 6750 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4500 5400 4500 5175 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 4725 5625 5850 5850 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 3600 4050 4275 4275 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 4275 3825 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6975 4275 6975 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 2025 3825 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 6075 5400 6075 5175 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5850 6075 6975 6075 6750 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 6300 5625 7425 5850 7200 -4 2 4 100 0 18 20 0.0000 4 285 1860 2655 4590 SS:[theta_in]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 4050 2340 1\001 -4 1 0 100 0 18 20 0.0000 4 210 165 5625 2340 0\001 -4 1 0 100 0 18 20 0.0000 4 225 645 4050 765 I:dm\001 -4 0 4 100 0 18 20 0.0000 4 285 1500 7110 2340 SS:[y_out]\001 -4 2 4 100 0 18 20 0.0000 4 285 1305 2565 2340 SS:[y_in]\001 -4 0 4 100 0 18 20 0.0000 4 285 2055 7065 4590 SS:[theta_out]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 4050 4590 1\001 -4 1 0 100 0 18 20 0.0000 4 210 165 5625 4590 0\001 -4 1 0 100 0 18 20 0.0000 4 225 795 4815 3510 TF:dz\001 -4 1 1 101 0 32 20 0.0000 4 210 225 4635 4095 W\001 -4 1 1 101 0 32 20 0.0000 4 210 795 6345 4950 W+DW\001 -4 1 1 101 0 32 20 0.0000 4 210 225 4680 4950 W\001 -4 1 1 101 0 32 20 0.0000 4 210 225 3150 4950 W\001 -4 1 1 101 0 18 20 0.0000 4 165 165 3150 2610 v\001 -4 1 1 101 0 18 20 0.0000 4 165 165 4725 2610 v\001 -4 1 1 101 0 18 20 0.0000 4 165 690 6255 2610 v+ v\001 -4 1 1 101 0 32 20 0.0000 4 210 180 6390 2610 D\001 -4 1 1 101 0 32 20 0.0000 4 210 180 5400 3015 D\001 -4 1 1 101 0 18 20 0.0000 4 165 165 5625 3015 v\001 -4 1 0 100 0 18 20 0.0000 4 210 165 5625 6165 1\001 -4 1 0 100 0 18 20 0.0000 4 225 660 7380 6165 C:dk\001 -4 2 4 100 0 18 20 0.0000 4 300 1500 4230 6165 SS:[patch]\001 -4 1 0 100 0 18 20 0.0000 4 285 780 5625 7785 R:dr\001 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_desc.tex @@ -1,22 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system pBernoulliEuler (pBernoulliEuler_desc.tex) -% Generated by MTT on Mon Apr 19 06:43:36 BST 1999. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{pBernoulliEuler} is - displayed in Figure \Ref{fig:pBernoulliEuler_abg.ps} and its label - file is listed in Section \Ref{sec:pBernoulliEuler_lbl}. - The subsystems are listed in Section \Ref{sec:pBernoulliEuler_sub}. - -This is identical to component \textbf{pBernoulliEuler} except that a -\emph{piezoelectric patch} is included. This provides: -\begin{enumerate} -\item an moment-generating \emph{actuator} and -\item a curvature \emph{sensor}. -\end{enumerate} DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-1D/pBernoulliEuler/pBernoulliEuler_lbl.txt @@ -1,60 +0,0 @@ -%% Label file for system pBernoulliEuler (pBernoulliEuler_lbl.txt) -%SUMMARY pBernoulliEuler -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1999/05/17 21:27:39 peterg -% %% Added damping -% %% -% %% Revision 1.2 1999/05/16 21:31:48 peterg -% %% Renamed SS to patch -% %% -% %% Revision 1.1 1999/05/16 21:08:13 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in y_in,theta_in -%ALIAS out y_out,theta_out -%ALIAS torque patch -%ALIAS curvature patch - - -% Argument aliases -%ALIAS $1 dk -%ALIAS $2 dm -%ALIAS $3 dz -%ALIAS $4 dr - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type I - dm lin flow,dm - -% Component type C - dk lin state,dk - -% Component type R - dr lin flow,dr - -% Component type SS - [y_in] SS external,external - [y_out] SS external,external - [theta_in] SS external,external - [theta_out] SS external,external - [patch] SS external,external - -% Component type TF - dz lin effort,dz - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_abg.fig Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_abg.fig +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_abg.fig @@ -1,22 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2027 2252 3377 2252 3152 2477 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3827 2252 5177 2252 4952 2477 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 2026 3601 676 3826 901 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 2250 7200 2250 6975 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3375 2025 3375 2475 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 3375 9450 45 225 45 225 3375 9450 3375 -4 1 -1 0 0 0 20 0.0000 4 195 135 3602 2387 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 90 3601 541 I\001 -4 1 -1 0 0 0 20 0.0000 4 195 375 5535 2340 AF\001 -4 1 24 0 0 0 20 0.0000 4 195 1050 1440 2340 SS:Force\001 -4 0 24 0 0 0 20 0.0000 4 240 2040 7290 2340 SS:[Acceleration]\001 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ACCEL/ACCEL_lbl.txt @@ -1,33 +0,0 @@ -%SUMMARY ACCEL: Provides a acceleration (useful for simulating gravity. -%DESCRIPTION Useful for simulating gravity as explaned in Section 10.9 -%DESCRIPTION of "Metamodelling". - -%ALIAS in|out Acceleration - -%% Label file for system ACCEL (ACCEL_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/07/27 06:50:41 peterg -% %% *** empty log message *** -% %% -% %% Revision 1.2 1998/07/27 06:49:57 peterg -% %% Added blank line at end -% %% -% %% Revision 1.1 1998/07/27 06:47:32 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -% SS components - Force SS external,internal - [Acceleration] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_abg.fig Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_abg.fig +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_abg.fig @@ -1,121 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4951 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 I:J\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTF:th\001 -4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000 4 255 1950 2971 1216 SS:[xTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 1950 2971 9361 SS:[xTip_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 1950 8372 1217 SS:[yTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 1950 8417 9362 SS:[yTip_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 2700 5671 1216 SS:[angularTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 2700 5671 9361 SS:[angularTip_b]\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_desc.tex @@ -1,17 +0,0 @@ -% Verbal description for system ROD (ROD_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ROD} is - displayed in Figure \Ref{ROD_abg} and its label - file is listed in Section \Ref{sec:ROD_lbl}. - The subsystems are listed in Section \Ref{sec:ROD_sub}. - -{\bf ROD} is essentially as described in Figure 10.2 of -``Metamodelling''. DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROD/ROD_lbl.txt @@ -1,71 +0,0 @@ -%SUMMARY ROD: rigid rod in two dimensions -%DESCRIPTION See Section 10.2 of "Metamodelling" - -%ALIAS $1 l_a # length from end a to mass centre -%ALIAS $2 l_b # length from end b to mass centre -%ALIAS $3 j_m # inertia about mass centre -%ALIAS $4 m # mass - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS x_a xTip_a # Force/velocity at tip a in x direction -%ALIAS y_a yTip_a # Force/velocity at tip a in y direction -%ALIAS alpha_a angularTip_a # Torque/angular velocity at tip a - -%ALIAS x_b xTip_b # Force/velocity at tip b in x direction -%ALIAS y_b yTip_b # Force/velocity at tip b in y direction -%ALIAS alpha_b angularTip_b # Torque/angular velocity at tip b - -%ALIAS INTF General/INTF # The flow integration component. - -%% Label file for system ROD (ROD_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 1998/07/27 10:51:20 peterg -% %% Aliased INTF as well. -% %% -% %% Revision 1.3 1998/07/27 10:49:10 peterg -% %% Major revision to include aliases etc -% %% -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,j_m -m_x lin flow,m -m_y lin flow,m - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,l_a -s2 lsin flow,l_b -c1 lcos flow,l_a -c2 lcos flow,l_b - -% Component type SS - [angularTip_a] SS external,external - [angularTip_b] SS external,external - [xTip_a] SS external,external - [xTip_b] SS external,external - [yTip_a] SS external,external - [yTip_b] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_abg.fig Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_abg.fig +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_abg.fig @@ -1,124 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4951 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 4950 1800 3375 1800 3600 -4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 I:J\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTF:th\001 -4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 2971 1216 SS:[x_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 2971 9361 SS:[x_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 8372 1217 SS:[y_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 8417 9362 SS:[y_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 1485 5671 1216 SS:[alpha_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 1485 5671 9361 SS:[alpha_b]\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 -4 1 4 0 0 0 20 0.0000 4 255 1215 1756 3286 SS:[alpha]\001 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_desc.tex @@ -1,22 +0,0 @@ -% Verbal description for system RODa (RODa_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/08/15 09:41:19 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{RODa} is - displayed in Figure \Ref{RODa_abg} and its label - file is listed in Section \Ref{sec:RODa_lbl}. - The subsystems are listed in Section \Ref{sec:RODa_sub}. - -{\bf RODa} is essentially as described in Figure 10.2 of -``Metamodelling''. It has an additional port ``[angle]'' to provide -access to the rod angle. - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/RODa/RODa_lbl.txt @@ -1,52 +0,0 @@ -%SUMMARY RODa: rigid rod in two dimensions - angle port. -%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a -%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b -%DESCRIPTION Port [x_a]: x force/velocity - end a -%DESCRIPTION Port [x_b]: x force/velocity - end b -%DESCRIPTION Port [y_a]: y force/velocity - end a -%DESCRIPTION Port [y_b]: y force/velocity - end b -%DESCRIPTION Port [alpha]: rod angle -%DESCRIPTION -%DESCRIPTION Parameter 1: length from end 1 to mass centre -%DESCRIPTION Parameter 2: length from end 2 to mass centre -%DESCRIPTION Parameter 3: inertia about mass centre -%DESCRIPTION Parameter 4: mass -%DESCRIPTION See Section 10.2 of "Metamodelling" - - -%% Label file for system RODa (RODa_lbl.txt) - - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,$3 -m_x lin flow,$4 -m_y lin flow,$4 - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,$1 -s2 lsin flow,$2 -c1 lcos flow,$1 -c2 lcos flow,$2 - - - - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_abg.fig Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_abg.fig +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_abg.fig @@ -1,86 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 4905 4500 5805 4275 5805 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3376 7379 4501 6479 4276 6479 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1801 7604 2926 7604 2701 7829 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3376 7604 4501 7604 4276 7829 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 6030 4950 4905 4950 5130 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4950 7155 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 6255 4950 7425 4950 7155 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1800 4680 2925 4680 2700 4905 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1800 6165 2925 6165 2700 6390 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 4680 4500 4680 4275 4905 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5895 4680 7020 4680 6795 4905 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 6255 7200 4905 7200 5130 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 5805 7200 7380 7200 7155 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 7605 6975 7605 6750 7830 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7425 4680 8550 4680 8325 4905 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7425 7605 8550 7605 8325 7830 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 6030 4950 6030 4815 5895 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 6255 4950 6255 4815 6390 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 2554 3028 1317 885 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 2554 3028 4698 1791 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 2566 3016 2566 541 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 2566 3016 5041 3016 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9675 8550 9675 225 225 225 225 8550 9675 8550 -4 0 1 1 0 0 20 0.0000 4 135 135 5220 3105 x\001 -4 0 1 1 0 0 20 0.0000 4 195 135 2700 585 y\001 -4 0 1 1 0 0 20 0.0000 4 195 210 1485 855 Y\001 -4 0 1 1 0 0 20 0.0000 4 195 210 4590 1710 X\001 -4 0 1 1 0 32 20 0.0000 4 195 150 3420 2880 q\001 -4 0 -1 0 0 2 20 0.0000 4 195 135 3060 4770 1\001 -4 0 -1 0 0 2 20 0.0000 4 195 135 3060 7695 1\001 -4 0 -1 0 0 2 20 0.0000 4 195 135 3015 6255 0\001 -4 1 4 0 0 2 16 0.0000 4 210 390 4635 4455 [in]\001 -4 1 4 0 0 2 16 0.0000 4 210 390 4635 7965 [in]\001 -4 0 -1 0 0 2 20 0.0000 4 195 135 7155 4770 0\001 -4 0 -1 0 0 2 20 0.0000 4 195 135 7110 7740 0\001 -4 1 -1 0 0 2 20 0.0000 4 195 1260 5175 4770 EMTF:xX\001 -4 1 -1 0 0 2 20 0.0000 4 195 1260 5175 5850 EMTF:xY\001 -4 1 -1 0 0 2 20 0.0000 4 255 1260 5220 6615 EMTF:yX\001 -4 1 -1 0 0 2 20 0.0000 4 255 1260 5175 7695 EMTF:yY\001 -4 1 4 0 0 2 16 0.0000 4 210 525 5760 4455 [out]\001 -4 1 4 0 0 2 16 0.0000 4 210 525 5760 7965 [out]\001 -4 1 4 0 0 2 16 0.0000 4 210 390 4635 6795 [in]\001 -4 1 4 0 0 2 16 0.0000 4 210 390 4545 5625 [in]\001 -4 1 4 0 0 2 16 0.0000 4 210 525 5940 5625 [out]\001 -4 1 4 0 0 2 16 0.0000 4 210 525 5985 6795 [out]\001 -4 0 4 0 0 2 16 0.0000 4 210 630 5040 7335 [mod]\001 -4 0 4 0 0 2 16 0.0000 4 210 630 5085 6075 [mod]\001 -4 0 4 0 0 2 16 0.0000 4 210 630 5085 6300 [mod]\001 -4 0 4 0 0 2 16 0.0000 4 210 630 5040 5040 [mod]\001 -4 2 4 0 0 2 20 0.0000 4 240 1215 1710 6255 SS:[theta]\001 -4 2 4 0 0 2 20 0.0000 4 240 795 1665 4770 SS:[X]\001 -4 2 4 0 0 2 20 0.0000 4 240 795 1710 7695 SS:[Y]\001 -4 0 4 0 0 2 20 0.0000 4 240 720 8640 4770 SS:[x]\001 -4 0 4 0 0 2 20 0.0000 4 255 720 8685 7695 SS:[y]\001 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_desc.tex @@ -1,20 +0,0 @@ -% Verbal description for system ROT2 (ROT2_desc.tex) -% Generated by MTT on Fri Aug 15 21:09:17 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ROT2} is - displayed in Figure \Ref{ROT2_abg} and its label - file is listed in Section \Ref{sec:ROT2_lbl}. - The subsystems are listed in Section \Ref{sec:ROT2_sub}. - -\textbf{ROT2} implements a 2D rotational {\em transformation\/} in -terms of a set of {\em transformers}. A flow expressed in the $XY$ -coordinates of Figure \Ref{ROT2_abg} is transformed by \textbf{ROT2} -into the coordinates of $xy$. The corresponding (energy conserving) -effort transformation is implied by \textbf{ROT2}. DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/ROT2/ROT2_lbl.txt @@ -1,31 +0,0 @@ -%SUMMARY ROT2: 2D rotational transformer -%DESCRIPTION {ROT2} implements a 2D rotational transformation in terms -%DESCRIPTION of a set of transformers. A flow expressed in the X-Y -%DESCRIPTION coordinates is transformed by ROT2 into the coordinates -%DESCRIPTION of x-y. The corresponding (energy conserving) effort -%DESCRIPTION transformation is implied. -%DESCRIPTION Ports X and Y correspond to the old coordinate system -%DESCRIPTION Ports x and y correspond to the new coordinate system -%DESCRIPTION Port theta is the angle of XY with respect to xy. - -%% Label file for system ROT2 (ROT2_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type EMTF - xX lcos flow,1 - xY lsin flow,1 - yX lsin flow,-1 - yY lcos flow,1 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_desc.tex @@ -1,17 +0,0 @@ -% Verbal description for system ROD (ROD_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ROD} is - displayed in Figure \Ref{ROD_abg} and its label - file is listed in Section \Ref{sec:ROD_lbl}. - The subsystems are listed in Section \Ref{sec:ROD_sub}. - -{\bf ROD} is essentially as described in Figure 10.2 of -``Metamodelling''. DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/ROD_lbl.txt @@ -1,71 +0,0 @@ -%SUMMARY ROD: rigid rod in two dimensions -%DESCRIPTION See Section 10.2 of "Metamodelling" - -%ALIAS $1 l_a # length from end a to mass centre -%ALIAS $2 l_b # length from end b to mass centre -%ALIAS $3 j_m # inertia about mass centre -%ALIAS $4 m # mass - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS x_a xTip_a # Force/velocity at tip a in x direction -%ALIAS y_a yTip_a # Force/velocity at tip a in y direction -%ALIAS alpha_a angularTip_a # Torque/angular velocity at tip a - -%ALIAS x_b xTip_b # Force/velocity at tip b in x direction -%ALIAS y_b yTip_b # Force/velocity at tip b in y direction -%ALIAS alpha_b angularTip_b # Torque/angular velocity at tip b - -%ALIAS INTF General/INTF # The flow integration component. - -%% Label file for system ROD (ROD_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 1998/07/27 10:51:20 peterg -% %% Aliased INTF as well. -% %% -% %% Revision 1.3 1998/07/27 10:49:10 peterg -% %% Major revision to include aliases etc -% %% -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,j_m -m_x lin flow,m -m_y lin flow,m - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,l_a -s2 lsin flow,l_b -c1 lcos flow,l_a -c2 lcos flow,l_b - -% Component type SS - [angularTip_a] SS external,external - [angularTip_b] SS external,external - [xTip_a] SS external,external - [xTip_b] SS external,external - [yTip_a] SS external,external - [yTip_b] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_abg.fig Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_abg.fig +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_abg.fig @@ -1,126 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4951 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8550 5400 9225 6075 8955 6075 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8685 5265 8415 5535 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 315 6933 5268 I:J\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000000 4 270 735 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000000 4 240 735 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1170 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1170 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000000 4 210 150 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 570 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000000 4 210 990 4681 5266 INTF:th\001 -4 1 1 1 0 0 20 0.0000000 4 210 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000000 4 135 195 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000000 4 210 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000000 4 195 330 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1485 2971 1216 SS:[xTip_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1500 2971 9361 SS:[xTip_b]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1485 8372 1217 SS:[yTip_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1500 8417 9362 SS:[yTip_b]\001 -4 1 4 0 0 0 20 0.0000000 4 270 2250 5671 1216 SS:[angularTip_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 2265 5671 9361 SS:[angularTip_b]\001 -4 1 1 1 0 0 20 0.0000000 4 270 630 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000000 4 240 1470 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000000 4 270 645 1350 9855 Tip b\001 -4 1 -1 0 0 0 20 0.0000000 4 270 810 9360 6345 SS:mg\001 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_desc.tex @@ -1,20 +0,0 @@ -% Verbal description for system gROD (gROD_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/08/15 09:41:19 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{gROD} is - displayed in Figure \Ref{gROD_abg} and its label - file is listed in Section \Ref{sec:gROD_lbl}. - The subsystems are listed in Section \Ref{sec:gROD_sub}. - -{\bf gROD} is essentially as described in Figure 10.2 of -``Metamodelling''. DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gROD/gROD_lbl.txt @@ -1,86 +0,0 @@ -%SUMMARY gROD: rigid rod in two dimensions - with gravity -%DESCRIPTION See Section 10.2 of "Metamodelling" -%DESCRIPTION Gravity term added at centre - -%ALIAS $1 l_a # length from end a to mass centre -%ALIAS $2 l_b # length from end b to mass centre -%ALIAS $3 j_m # inertia about mass centre -%ALIAS $4 m # mass -%ALIAS $5 g # gravity - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS x_a xTip_a # Force/velocity at tip a in x direction -%ALIAS y_a yTip_a # Force/velocity at tip a in y direction -%ALIAS alpha_a|a_a angularTip_a # Torque/angular velocity at tip a - -%ALIAS x_b xTip_b # Force/velocity at tip b in x direction -%ALIAS y_b yTip_b # Force/velocity at tip b in y direction -%ALIAS alpha_b|a_b angularTip_b # Torque/angular velocity at tip b - -%ALIAS INTF General/INTF # The flow integration component. - -%% Label file for system gROD (gROD_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/11/25 13:55:42 peterg -% %% Added missig attribute field m*g,internal -% %% -% %% Revision 1.1 1998/11/25 10:48:34 peterg -% %% Initial revision -% %% -% %% Revision 1.5 1998/07/27 12:27:27 peterg -% %% Added vector port aliases -% %% -% %% Revision 1.4 1998/07/27 10:51:20 peterg -% %% Aliased INTF as well. -% %% -% %% Revision 1.3 1998/07/27 10:49:10 peterg -% %% Major revision to include aliases etc -% %% -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,j_m -m_x lin flow,m -m_y lin flow,m - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,l_a -s2 lsin flow,l_b -c1 lcos flow,l_a -c2 lcos flow,l_b - -% Component type SS - mg SS m*g,internal - [angularTip_a] SS external,external - [angularTip_b] SS external,external - [xTip_a] SS external,external - [xTip_b] SS external,external - [yTip_a] SS external,external - [yTip_b] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_desc.tex @@ -1,17 +0,0 @@ -% Verbal description for system ROD (ROD_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ROD} is - displayed in Figure \Ref{ROD_abg} and its label - file is listed in Section \Ref{sec:ROD_lbl}. - The subsystems are listed in Section \Ref{sec:ROD_sub}. - -{\bf ROD} is essentially as described in Figure 10.2 of -``Metamodelling''. DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/ROD_lbl.txt @@ -1,71 +0,0 @@ -%SUMMARY ROD: rigid rod in two dimensions -%DESCRIPTION See Section 10.2 of "Metamodelling" - -%ALIAS $1 l_a # length from end a to mass centre -%ALIAS $2 l_b # length from end b to mass centre -%ALIAS $3 j_m # inertia about mass centre -%ALIAS $4 m # mass - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS x_a xTip_a # Force/velocity at tip a in x direction -%ALIAS y_a yTip_a # Force/velocity at tip a in y direction -%ALIAS alpha_a angularTip_a # Torque/angular velocity at tip a - -%ALIAS x_b xTip_b # Force/velocity at tip b in x direction -%ALIAS y_b yTip_b # Force/velocity at tip b in y direction -%ALIAS alpha_b angularTip_b # Torque/angular velocity at tip b - -%ALIAS INTF General/INTF # The flow integration component. - -%% Label file for system ROD (ROD_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 1998/07/27 10:51:20 peterg -% %% Aliased INTF as well. -% %% -% %% Revision 1.3 1998/07/27 10:49:10 peterg -% %% Major revision to include aliases etc -% %% -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,j_m -m_x lin flow,m -m_y lin flow,m - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,l_a -s2 lsin flow,l_b -c1 lcos flow,l_a -c2 lcos flow,l_b - -% Component type SS - [angularTip_a] SS external,external - [angularTip_b] SS external,external - [xTip_a] SS external,external - [xTip_b] SS external,external - [yTip_a] SS external,external - [yTip_b] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gROD_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gROD_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gROD_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gROD_lbl.txt @@ -1,86 +0,0 @@ -%SUMMARY gROD: rigid rod in two dimensions - with gravity -%DESCRIPTION See Section 10.2 of "Metamodelling" -%DESCRIPTION Gravity term added at centre - -%ALIAS $1 l_a # length from end a to mass centre -%ALIAS $2 l_b # length from end b to mass centre -%ALIAS $3 j_m # inertia about mass centre -%ALIAS $4 m # mass -%ALIAS $5 g # gravity - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS x_a xTip_a # Force/velocity at tip a in x direction -%ALIAS y_a yTip_a # Force/velocity at tip a in y direction -%ALIAS alpha_a|a_a angularTip_a # Torque/angular velocity at tip a - -%ALIAS x_b xTip_b # Force/velocity at tip b in x direction -%ALIAS y_b yTip_b # Force/velocity at tip b in y direction -%ALIAS alpha_b|a_b angularTip_b # Torque/angular velocity at tip b - -%ALIAS INTF General/INTF # The flow integration component. - -%% Label file for system gROD (gROD_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/11/25 13:55:42 peterg -% %% Added missig attribute field m*g,internal -% %% -% %% Revision 1.1 1998/11/25 10:48:34 peterg -% %% Initial revision -% %% -% %% Revision 1.5 1998/07/27 12:27:27 peterg -% %% Added vector port aliases -% %% -% %% Revision 1.4 1998/07/27 10:51:20 peterg -% %% Aliased INTF as well. -% %% -% %% Revision 1.3 1998/07/27 10:49:10 peterg -% %% Major revision to include aliases etc -% %% -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,j_m -m_x lin flow,m -m_y lin flow,m - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,l_a -s2 lsin flow,l_b -c1 lcos flow,l_a -c2 lcos flow,l_b - -% Component type SS - mg SS m*g,internal - [angularTip_a] SS external,external - [angularTip_b] SS external,external - [xTip_a] SS external,external - [xTip_b] SS external,external - [yTip_a] SS external,external - [yTip_b] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_abg.fig Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_abg.fig +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_abg.fig @@ -1,133 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4951 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8550 5400 9225 6075 8955 6075 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8685 5265 8415 5535 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 5175 2025 3825 2250 3825 -4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 I:J\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTF:th\001 -4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000 4 255 1380 2971 1216 SS:[xTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 1380 2971 9361 SS:[xTip_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 1380 8372 1217 SS:[yTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 1380 8417 9362 SS:[yTip_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 2130 5671 1216 SS:[angularTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 2130 5671 9361 SS:[angularTip_b]\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 -4 1 -1 0 0 0 20 0.0000 4 255 720 9360 6345 Se:mg\001 -4 2 4 0 0 0 20 0.0000 4 255 1200 1935 3735 SS:[angle]\001 DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_desc.tex Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_desc.tex +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_desc.tex @@ -1,20 +0,0 @@ -% Verbal description for system gRODa (gRODa_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/08/15 09:41:19 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{gRODa} is - displayed in Figure \Ref{gRODa_abg} and its label - file is listed in Section \Ref{sec:gRODa_lbl}. - The subsystems are listed in Section \Ref{sec:gRODa_sub}. - -{\bf gRODa} is essentially as described in Figure 10.2 of -``Metamodelling''. DELETED mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_lbl.txt Index: mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_lbl.txt +++ mttroot/mtt/lib/comp/compound/Mechanical/Mechanical-2D/gRODa/gRODa_lbl.txt @@ -1,98 +0,0 @@ -%SUMMARY gRODa: rigid rod in two dimensions - with gravity and angle port -%DESCRIPTION See Section 10.2 of "Metamodelling" -%DESCRIPTION Gravity term added at centre - -%ALIAS $1 l_a # length from end a to mass centre -%ALIAS $2 l_b # length from end b to mass centre -%ALIAS $3 j_m # inertia about mass centre -%ALIAS $4 m # mass -%ALIAS $5 g # gravity - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS x_a xTip_a # Force/velocity at tip a in x direction -%ALIAS y_a yTip_a # Force/velocity at tip a in y direction -%ALIAS alpha_a|a_a angularTip_a # Torque/angular velocity at tip a - -%ALIAS x_b xTip_b # Force/velocity at tip b in x direction -%ALIAS y_b yTip_b # Force/velocity at tip b in y direction -%ALIAS alpha_b|a_b angularTip_b # Torque/angular velocity at tip b - -%ALIAS angle|a angle # Angle port - -%ALIAS INTF General/INTF # The flow integration component. - -%% Label file for system gRODa (gRODa_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/08/05 08:04:40 peterg -% %% Initial revision -% %% -% %% Revision 1.3 1998/11/30 10:47:53 peterg -% %% Added extra a_a and a_b aliases -% %% -% %% Revision 1.2 1998/11/25 13:55:42 peterg -% %% Added missig attribute field m*g,internal -% %% -% %% Revision 1.1 1998/11/25 10:48:34 peterg -% %% Initial revision -% %% -% %% Revision 1.5 1998/07/27 12:27:27 peterg -% %% Added vector port aliases -% %% -% %% Revision 1.4 1998/07/27 10:51:20 peterg -% %% Aliased INTF as well. -% %% -% %% Revision 1.3 1998/07/27 10:49:10 peterg -% %% Major revision to include aliases etc -% %% -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,j_m -m_x lin flow,m -m_y lin flow,m - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,l_a -s2 lsin flow,l_b -c1 lcos flow,l_a -c2 lcos flow,l_b - - -% Component type Se - mg SS m*g - - - [angularTip_a] SS external,external - [angularTip_b] SS external,external - [xTip_a] SS external,external - [xTip_b] SS external,external - [yTip_a] SS external,external - [yTip_b] SS external,external - [angle] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_abg.fig Index: mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_abg.fig +++ mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_abg.fig @@ -1,57 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 1800 3825 1800 3600 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 5400 6300 5400 6075 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 9000 3825 9000 3600 9225 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 1800 6975 1800 6750 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 5625 4725 6975 4950 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 7425 4725 8775 4950 8550 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 9000 6975 9000 6750 9225 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 1575 3825 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6975 1575 6975 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4500 5175 4500 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 8775 3825 9225 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6975 8775 6975 9225 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 8550 9450 1350 9450 1350 1125 8550 1125 8550 9450 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 5175 5905 4220 5905 4539 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 3375 4725 2025 4950 2250 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 5175 4725 3825 4950 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 5400 3150 5400 3375 5625 -4 1 4 100 0 18 18 0.0000 4 270 1110 1935 1890 SS:[F_1]\001 -4 1 0 100 0 18 18 0.0000 4 270 1710 4770 1890 Muscle1:m_1\001 -4 1 0 100 0 18 18 0.0000 4 270 840 4770 3690 TF:r_1\001 -4 1 0 100 0 18 18 0.0000 4 210 390 6615 5490 I:m\001 -4 1 0 100 0 18 18 0.0000 4 270 840 4815 7290 TF:r_2\001 -4 1 0 100 0 18 18 0.0000 4 270 1710 4725 9090 Muscle1:m_2\001 -4 1 0 100 0 18 18 0.0000 4 270 840 2610 5490 Se:mg\001 -4 1 4 100 0 18 14 0.0000 4 210 285 3510 8775 [F]\001 -4 1 4 100 0 18 14 0.0000 4 210 285 3510 1530 [F]\001 -4 1 0 100 0 18 18 0.0000 4 270 900 7515 1890 De:x_1\001 -4 1 0 100 0 18 18 0.0000 4 270 900 7515 9090 De:x_2\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4725 5490 1\001 -4 1 0 100 0 18 18 0.0000 4 270 915 6075 4140 Df:v_m\001 -4 1 4 100 0 18 18 0.0000 4 270 1110 1890 9045 SS:[F_2]\001 DELETED mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_desc.tex Index: mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_desc.tex +++ mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_desc.tex @@ -1,37 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system LowerLeg1 (LowerLeg1_desc.tex) -% Generated by MTT on Thu Apr 19 10:39:20 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\fig{LowerLeg1_pic} - {LowerLeg1_pic} - {0.9} - {Simple lower-leg model} - - A schematic of a simple muscle model with skeleton appears in - Figure \Ref{fig:LowerLeg1_pic} and the acausal bond graph is - displayed in Figure \Ref{fig:LowerLeg1_abg.ps} and its label file - is listed in Section \Ref{sec:LowerLeg1_lbl.txt}. The subsystems - are listed in Section \Ref{sec:LowerLeg1_sub}. The model is a - rough approximation of the lower leg, knee joint and thigh muscles - with the lower leg horizontal. - - The components are: - \begin{description} - \item[F\_1 and F\_2] the force inputs to the upper and lower muscles - \item[m\_1 and m\_2] the upper and lower muscles - \item[r\_1 and r\_2] the transformers reflecting the geometry of the - muscle attachments - \item[m] load mass - \item[mg] force due to gravity. - \end{description} - DELETED mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_input.txt Index: mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_input.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_input.txt +++ mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_input.txt @@ -1,9 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System LowerLeg1, representation input, language txt; -## File Example2_input.txt; -## Generated by MTT on Mon Apr 30 10:08:54 BST 2001; - -example2_f_1 = 1.0*((t>2.0)&&(t<4.0)); # On for 26.0)&&(t<8.0)); # On for 6 } - imagemask } bind -] def -/PaintProc { - pop - exec fill -} def -currentdict -end -/P8 exch def - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def - /DrawEllipse { - /endangle exch def - /startangle exch def - /yrad exch def - /xrad exch def - /y exch def - /x exch def - /savematrix mtrx currentmatrix def - x y tr xrad yrad sc 0 0 1 startangle endangle arc - closepath - savematrix setmatrix - } def - -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -%%Page: 1 1 -10 setmiterlimit - 0.06299 0.06299 sc -% Polyline -15.000 slw -n 555 675 m 450 675 450 3720 105 arcto 4 {pop} repeat - 450 3825 6870 3825 105 arcto 4 {pop} repeat - 6975 3825 6975 780 105 arcto 4 {pop} repeat - 6975 675 555 675 105 arcto 4 {pop} repeat - cp gs col31 s gr -% Arc -n 1800.0 -821.0 2576.0 105.2 74.8 arcn -gs col0 s gr - -% Arc -n 1800.0 4151.0 2576.0 -105.2 -74.8 arc -gs col0 s gr - -% Arc -n 1800.0 349.0 2576.0 105.2 74.8 arcn -gs col0 s gr - -% Arc -n 1800.0 5321.0 2576.0 -105.2 -74.8 arc -gs col0 s gr - -% Ellipse -n 2700 2250 127 127 0 360 DrawEllipse gs col0 s gr - -% Polyline -n 2475 2025 m 5625 2025 l 5625 2475 l 2475 2475 l - cp gs col0 s gr -% Polyline -n 2475 1575 m 2700 1575 l 2700 2025 l 2475 2025 l - cp gs col0 s gr -% Polyline -n 2475 2475 m 2700 2475 l 2700 2925 l 2475 2925 l - cp gs col0 s gr -% Polyline -7.500 slw -n 675 1125 m 1125 1125 l 1125 3375 l 675 3375 l - cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def -15.00 15.00 sc P8 [16 0 0 -16 45.00 75.00] PATmp PATsp ef gr PATusp gs col0 s gr -% Polyline -15.000 slw -gs clippath -2731 2196 m 2646 2281 l 2801 2436 l 2717 2267 l 2886 2351 l cp -eoclip -n 2700 2250 m - 3780 3330 l gs col1 s gr gr - -% arrowhead -n 2886 2351 m 2717 2267 l 2801 2436 l 2886 2436 l 2886 2351 l - cp gs col1 1.00 shd ef gr col1 s -% Polyline -gs clippath -1746 1543 m 1831 1628 l 1986 1473 l 1817 1558 l 1901 1388 l cp -eoclip -n 1800 1575 m - 2250 1125 l gs col1 s gr gr - -% arrowhead -n 1901 1388 m 1817 1558 l 1986 1473 l 1986 1388 l 1901 1388 l - cp gs col1 1.00 shd ef gr col1 s -% Polyline -gs clippath -1746 2668 m 1831 2753 l 1986 2598 l 1817 2683 l 1901 2513 l cp -eoclip -n 1800 2700 m - 3375 1125 l gs col1 s gr gr - -% arrowhead -n 1901 2513 m 1817 2683 l 1986 2598 l 1986 2513 l 1901 2513 l - cp gs col1 1.00 shd ef gr col1 s -% Polyline -gs clippath -3996 1948 m 4081 2033 l 4236 1878 l 4067 1963 l 4151 1793 l cp -eoclip -n 4050 1980 m - 4905 1125 l gs col1 s gr gr - -% arrowhead -n 4151 1793 m 4067 1963 l 4236 1878 l 4236 1793 l 4151 1793 l - cp gs col1 1.00 shd ef gr col1 s -% Polyline -gs clippath -5818 1745 m 5903 1830 l 6058 1675 l 5889 1760 l 5973 1590 l cp -eoclip -n 5872 1777 m - 6524 1125 l gs col1 s gr gr - -% arrowhead -n 5973 1590 m 5889 1760 l 6058 1675 l 6058 1590 l 5973 1590 l - cp gs col1 1.00 shd ef gr col1 s -% Polyline -n 5625 1890 m 6345 1890 l 6345 2565 l 5625 2565 l - cp gs col0 s gr -/Times-BoldItalic ff 300.00 scf sf -3825 3645 m -gs 1 -1 sc (Pivot) dup sw pop 2 div neg 0 rm col1 sh gr -/Times-BoldItalic ff 300.00 scf sf -2250 1080 m -gs 1 -1 sc (Muscle 1) dup sw pop 2 div neg 0 rm col1 sh gr -/Times-BoldItalic ff 300.00 scf sf -3555 1080 m -gs 1 -1 sc (Muscle 2) dup sw pop 2 div neg 0 rm col1 sh gr -/Times-BoldItalic ff 300.00 scf sf -4905 1080 m -gs 1 -1 sc (Bone) dup sw pop 2 div neg 0 rm col1 sh gr -/Times-BoldItalic ff 300.00 scf sf -6480 1080 m -gs 1 -1 sc (Load) dup sw pop 2 div neg 0 rm col1 sh gr -/Times-Roman ff 375.00 scf sf -5850 2295 m -gs 1 -1 sc (m) col0 sh gr -$F2psEnd -rs -end DELETED mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_rep.txt Index: mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_rep.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_rep.txt +++ mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/LowerLeg1/LowerLeg1_rep.txt @@ -1,37 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system LowerLeg1 (Example1_rep.txt) -## Generated by MTT on" Thu Apr 19 10:26:57 BST 2001. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt LowerLeg1 abg tex # The system description -mtt LowerLeg1 cbg ps # The causal bond graph -mtt LowerLeg1 lbl txt -mtt Muscle1 lbl txt -mtt LowerLeg1 struc tex # The system structure -mtt LowerLeg1 sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt LowerLeg1 dae tex # The system dae -mtt LowerLeg1 ode tex # The system ode -## mtt LowerLeg1 sspar tex # Steady-state parameters -## mtt LowerLeg1 ss tex # Steady state -## mtt LowerLeg1 dm tex # Descriptor matrices (of linearised system) -mtt LowerLeg1 sm tex # State matrices (of linearised system) -mtt LowerLeg1 tf tex # Transfer function (of linearised system) -## mtt LowerLeg1 lmfr ps # log modulus of frequency response (of linearised system) - mtt LowerLeg1 simpar tex # Simulation parameters - mtt LowerLeg1 numpar tex # Numerical simulation parameters -## mtt LowerLeg1 state tex # Simulation initial state - mtt LowerLeg1 input tex # Simulation input -## mtt LowerLeg1 logic tex # Logic control - mtt LowerLeg1 odeso ps # Simulation output - -mtt LowerLeg1 rep txt # This file DELETED mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_abg.fig Index: mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_abg.fig +++ mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_abg.fig @@ -1,31 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 2700 4050 2700 3825 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 2700 5850 2700 5625 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 2475 4275 1125 4500 1350 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7200 2700 8550 2700 8325 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4275 4275 2925 4500 3150 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 9900 4950 1575 4950 1575 450 9900 450 9900 4950 -4 1 0 100 0 18 18 0.0000 4 195 150 4275 2790 1\001 -4 2 4 100 0 18 18 0.0000 4 270 870 2610 2790 SS:[in]\001 -4 1 0 100 0 18 18 0.0000 4 270 840 4455 945 R:d_m\001 -4 1 0 100 0 18 18 0.0000 4 270 1170 6525 2790 CDx:c_m\001 -4 0 4 100 0 18 18 0.0000 4 270 1065 8640 2790 SS:[out]\001 -4 1 1 101 0 3 20 0.0000 4 210 1170 8055 3285 Extension\001 -4 1 4 100 0 18 18 0.0000 4 270 810 4275 4545 SS:[F]\001 -4 1 1 101 0 3 20 0.0000 4 270 3150 7875 4680 Simple linear muscle model\001 -4 1 1 101 0 3 20 0.0000 4 210 1365 2340 3240 Connection\001 -4 1 1 101 0 3 20 0.0000 4 270 1335 3015 4545 Force input\001 DELETED mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_desc.tex Index: mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_desc.tex +++ mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_desc.tex @@ -1,37 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Muscle1 (Muscle1_desc.tex) -% Generated by MTT on Thu Apr 19 10:39:29 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Muscle1} is - displayed in Figure \Ref{fig:Muscle1_abg.ps} and its label - file is listed in Section \Ref{sec:Muscle1_lbl}. - The subsystems are listed in Section \Ref{sec:Muscle1_sub}. - - -This model is a highly simplified linear model of a muscle. The two -main components are: -\begin{itemize} -\item a \textbf{CDx} component representing the muscle compliance and - also providing a measurement of muscle extension and -\item an \textbf{R} component representing mechanical damping in the muscle -\end{itemize} - -The component has three ports: -\begin{description} -\item [in] representing the connection of the muscle to the outside world. The - corresponding force corresponds to the sum of the muscle force and - the reaction force of connected components. -\item[out] a measurement of the muscle extension. -\item[F] Representing the force component of the muscle model. -\end{description} - DELETED mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_lbl.txt Index: mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_lbl.txt +++ mttroot/mtt/lib/comp/compound/Physiological/Movement/Muscles/Muscle1/Muscle1_lbl.txt @@ -1,41 +0,0 @@ -%% Label file for system Muscle1 (Muscle1_lbl.txt) -%SUMMARY Muscle1 -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS F F -%ALIAS in in -%ALIAS out out - -% Argument aliases -%ALIAS $1 c_m -%ALIAS $2 d_m - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type CDx - c_m lin c_m - -% Component type R - d_m lin flow,d_m - -% Component type SS - [F] SS external,external - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Sensitivity/O/O_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/O/O_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/O/O_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/O/O_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2295 6075 3645 6075 3420 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 5760 3825 4410 4050 4635 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 6075 5400 6075 5175 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2295 3150 3645 3150 3420 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 2835 3825 1485 4050 1710 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 3150 5400 3150 5175 3375 -4 1 4 100 0 18 20 0.0000 4 285 1080 3870 4185 SS:[B2]\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 6075 6165 SS:[B3]\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 1665 6165 SS:[B1]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 3825 6165 0\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 3870 1260 SS:[A2]\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 6075 3240 SS:[A3]\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 1665 3240 SS:[A1]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 3825 3240 0\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/O/O_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/O/O_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/O/O_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/O/O_lbl.txt @@ -1,36 +0,0 @@ -%% Label file for system O (O_lbl.txt) -%SUMMARY O Three-port zero junction for 2-bond vector bonds :-) -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/07/29 04:47:49 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in A1,B1 -%ALIAS out A2,B2 -%ALIAS in_2|out_2 A3,B3 - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [A1] SS external,external - [A2] SS external,external - [A3] SS external,external - [B1] SS external,external - [B2] SS external,external - [B3] SS external,external DELETED mttroot/mtt/lib/comp/compound/Sensitivity/l/l_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/l/l_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/l/l_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/l/l_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2295 6075 3645 6075 3420 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 5760 3825 4410 4050 4635 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 6075 5400 6075 5175 6300 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2295 3150 3645 3150 3420 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 2835 3825 1485 4050 1710 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 3150 5400 3150 5175 3375 -4 1 4 100 0 18 20 0.0000 4 285 1080 3870 4185 SS:[B2]\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 6075 6165 SS:[B3]\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 1665 6165 SS:[B1]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 3825 6165 1\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 3870 1260 SS:[A2]\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 6075 3240 SS:[A3]\001 -4 1 4 100 0 18 20 0.0000 4 285 1080 1665 3240 SS:[A1]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 3825 3240 1\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/l/l_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/l/l_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/l/l_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/l/l_lbl.txt @@ -1,36 +0,0 @@ -%% Label file for system l (l_lbl.txt) -%SUMMARY l Three port 1 junction with 2-bond vector ports :-) -%DESCRIPTIlN - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/07/29 04:49:49 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in A1,B1 -%ALIAS out A2,B2 -%ALIAS in_2|out_2 A3,B3 - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [A1] SS external,external - [A2] SS external,external - [A3] SS external,external - [B1] SS external,external - [B2] SS external,external - [B3] SS external,external DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sAE/sAE_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sAE/sAE_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sAE/sAE_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sAE/sAE_abg.fig @@ -1,38 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4050 5625 4050 5400 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7650 4050 9000 4050 8775 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9450 4050 10800 4050 10575 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 450 3825 450 3600 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 450 5625 450 5400 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7650 450 9000 450 8775 675 -2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 2520 9225 3825 9225 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 675 4050 2025 4275 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5625 3825 5625 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 225 3825 675 -4 1 0 100 0 18 20 0.0000 4 210 1155 6660 4140 AE:sens\001 -4 1 0 100 0 18 20 0.0000 4 195 150 9225 4140 1\001 -4 1 0 100 0 18 20 0.0000 4 195 150 4050 540 0\001 -4 1 0 100 0 18 20 0.0000 4 270 960 4050 2340 AE:k_s\001 -4 1 0 100 0 18 20 0.0000 4 210 1320 6660 540 AE:actual\001 -4 1 4 100 0 18 20 0.0000 4 270 1740 3060 4140 SS:[Sens_in]\001 -4 1 4 100 0 18 20 0.0000 4 270 1935 12240 4140 SS:[Sens_out]\001 -4 1 4 100 0 18 20 0.0000 4 270 2115 10575 585 SS:[Actual_out]\001 -4 1 4 100 0 18 20 0.0000 4 270 1920 1170 585 SS:[Actual_in]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sAE/sAE_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sAE/sAE_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sAE/sAE_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sAE/sAE_lbl.txt @@ -1,39 +0,0 @@ -%% Label file for system sAE (sAE_lbl.txt) -%SUMMARY sAE -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Actual_in,Sens_in -%ALIAS out Actual_out,Sens_out - - -% Argument aliases -%ALIAS $1 k -%ALIAS $2 k_s - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AE - actual lin k - sens lin k - k_s lin k_s - -% Component type SS - [Actual_in] SS external,external - [Actual_out] SS external,external - [Sens_in] SS external,external - [Sens_out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sAF/sAF_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sAF/sAF_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sAF/sAF_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sAF/sAF_abg.fig @@ -1,42 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2430 180 2520 720 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2475 225 2475 675 --6 -6 4230 3780 4320 4320 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4275 3825 4275 4275 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4050 5625 4050 5400 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7650 4050 9000 4050 8775 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9450 4050 10800 4050 10575 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 450 3825 450 3600 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 450 5625 450 5400 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7650 450 9000 450 8775 675 -2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 2520 9225 3825 9225 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 675 4050 2025 4275 1800 -4 1 0 100 0 18 20 0.0000 4 285 1425 6660 4140 AF:sens\001 -4 1 0 100 0 18 20 0.0000 4 270 195 9225 4140 0\001 -4 1 0 100 0 18 20 0.0000 4 270 195 4050 540 1\001 -4 1 0 100 0 18 20 0.0000 4 360 1215 4050 2340 AF:k_s\001 -4 1 0 100 0 18 20 0.0000 4 285 1680 6660 540 AF:actual\001 -4 1 4 100 0 18 20 0.0000 4 360 2280 3060 4140 SS:[Sens_in]\001 -4 1 4 100 0 18 20 0.0000 4 360 2520 12240 4140 SS:[Sens_out]\001 -4 1 4 100 0 18 20 0.0000 4 360 2775 10575 585 SS:[Actual_out]\001 -4 1 4 100 0 18 20 0.0000 4 360 2535 1170 585 SS:[Actual_in]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sAF/sAF_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sAF/sAF_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sAF/sAF_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sAF/sAF_lbl.txt @@ -1,39 +0,0 @@ -%% Label file for system sAF (sAF_lbl.txt) -%SUMMARY sAF -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Actual_in,Sens_in -%ALIAS out Actual_out,Sens_out - - -% Argument aliases -%ALIAS $1 k -%ALIAS $2 k_s - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AF - actual lin k - sens lin k - k_s lin k_s - -% Component type SS - [Actual_in] SS external,external - [Actual_out] SS external,external - [Sens_in] SS external,external - [Sens_out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sC/sC_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sC/sC_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sC/sC_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sC/sC_abg.fig @@ -1,20 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 3375 5400 3375 5625 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 3375 4500 3375 4275 3600 -2 4 0 3 31 7 101 0 -1 0.000 0 0 11 0 0 5 - 9000 4725 1350 4725 1350 2253 9000 2253 9000 4725 -4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 -4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 -4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 -4 1 0 100 0 18 18 0.0000 4 210 450 4950 3465 C:c\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sC/sC_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sC/sC_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sC/sC_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sC/sC_lbl.txt @@ -1,40 +0,0 @@ -%% Label file for system sC (sC_lbl.txt) -%SUMMARY sC Sensitivity C component -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2001/04/05 12:00:18 gawthrop -% %% Identification example -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in actual,sensitivity - -% Argument aliases -%ALIAS $1 effort,c -%ALIAS $2 cs - -%CR alias -%ALIAS $1 slin - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- -% Component type C - c slin effort,c;cs - -% Component type SS - [actual] SS external,external - [sensitivity] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sCS/sCS_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sCS/sCS_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sCS/sCS_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sCS/sCS_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2340 3915 2610 4185 -4 1 6 100 0 18 20 0.0000 4 271 196 2476 4186 [1,2]\001 -4 1 0 100 0 18 20 0.0000 4 270 195 2476 4185 1\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 3825 2475 2475 2700 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 5625 2475 4275 2700 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4050 4050 4050 3825 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2700 3825 2700 4275 -4 1 0 100 0 18 20 0.0000 4 285 570 2475 2295 sC:c\001 -4 0 0 100 0 18 20 0.0000 4 360 1185 4185 4185 sSe:e_0\001 -4 1 6 100 0 18 20 0.0000 4 361 1186 2476 6031 [1,2]\001 -4 1 4 100 0 18 20 0.0000 4 360 1185 2476 6030 SS:[in]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sCS/sCS_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sCS/sCS_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sCS/sCS_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sCS/sCS_lbl.txt @@ -1,41 +0,0 @@ -%% Label file for system sCS (sCS_lbl.txt) -%SUMMARY sCS C component with initial state - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 10:31:35 peterg -% %% Put under RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in_1,in_2 - -% Argument aliases -%ALIAS $1 effort,c -%ALIAS $2 e_0 -%ALIAS $3 c_s -%ALIAS $4 e_0s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - c slin effort,c;c_s - -% Component type SS - [in] SS external,external - -% Component type Se - e_0 SS e_0;e_0s - - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_abg.fig @@ -1,27 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 2700 3375 2700 3150 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 2700 5625 2700 5400 2925 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 3825 6525 1575 900 1575 900 3825 6525 3825 -4 1 4 0 0 0 20 0.0000 4 240 270 3285 2475 [f]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 3105 S\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 2475 T\001 -4 1 1 1 0 3 30 0.0000 4 60 105 2520 2835 .\001 -4 2 6 0 0 0 20 0.0000 4 240 510 1981 2791 [1,2]\001 -4 2 4 0 0 0 20 0.0000 4 240 810 1981 2790 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 735 3825 2790 sFP:fp\001 -4 1 4 0 0 0 20 0.0000 4 255 315 4410 2475 [p]\001 -4 1 1 1 0 3 20 0.0000 4 240 210 4950 3105 Q\001 -4 1 1 1 0 3 20 0.0000 4 195 165 4950 2475 T\001 -4 1 1 1 0 3 30 0.0000 4 60 105 4995 2835 .\001 -4 1 -1 0 0 0 20 0.0000 4 195 495 5940 2790 sC:c\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_lbl.txt @@ -1,35 +0,0 @@ -#SUMMARY sCT Sensitivity version of Continuous-Time (thermal C) component - -## System sCT, representation lbl, language txt -## File sCT_lbl.txt -## Generated by MTT on Fri Jul 6 05:16:27 BST 2001 - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ############################################################### - -## Port aliases -#ALIAS in in_1,in_2 - -## Argument aliases -#ALIAS $1 effort,c -#ALIAS $2 cs - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type SS - [in] SS external,external - -## Component type C - c slin effort,c;cs - -## Component type FP - fp lin DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_rep.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_rep.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_rep.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sCT/sCT_rep.txt @@ -1,35 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system sCT (sCT_rep.txt) -## Generated by MTT on" Fri Jul 6 05:27:38 BST 2001. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt sCT abg tex # The system description -##mtt sCT cbg ps # The causal bond graph -mtt sCT struc tex # The system structure -mtt sCT sympar tex # The system parameters -## Uncomment the following lines or add others -mtt sCT dae tex # The system dae -## mtt sCT ode tex # The system ode -## mtt sCT sspar tex # Steady-state parameters -## mtt sCT ss tex # Steady state -## mtt sCT dm tex # Descriptor matrices (of linearised system) -## mtt sCT sm tex # State matrices (of linearised system) -## mtt sCT tf tex # Transfer function (of linearised system) -## mtt sCT lmfr ps # log modulus of frequency response (of linearised system) -## mtt sCT simpar tex # Simulation parameters -## mtt sCT numpar tex # Numerical simulation parameters -## mtt sCT state tex # Simulation initial state -## mtt sCT input tex # Simulation input -## mtt sCT logic tex # Logic control -## mtt sCT odeso ps # Simulation output - -## mtt sCT rep txt # This file DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_abg.fig @@ -1,56 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2036 2724 3371 2724 3063 2947 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3836 2700 5171 2700 4863 2923 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5421 2501 5421 1342 5678 1609 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8501 2724 9836 2724 9528 2947 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11325 4730 11325 494 8758 494 8758 4730 11325 4730 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5672 2700 7006 2700 6698 2923 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 4725 6300 494 2293 494 2293 4725 6300 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2501 3600 1342 3857 1609 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11886 2546 11886 1386 12143 1654 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12143 2724 13478 2724 13170 2947 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10041 2546 10041 1386 10298 1654 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10298 2724 11633 2724 11325 2947 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 15750 5175 45 5175 45 316 15750 316 15750 5175 -4 2 4 0 0 0 20 0.0000 4 255 1815 1980 2790 SS:[Electrical]\001 -4 1 1 1 0 0 23 0.0000 4 240 1395 1472 3170 Terminals\001 -4 1 -1 0 0 0 23 0.0000 4 240 90 5370 2858 l\001 -4 1 -1 0 0 0 23 0.0000 4 285 1365 7783 2813 sGY:k_m\001 -4 1 -1 0 0 0 23 0.0000 4 285 765 5370 1252 sI:l_a\001 -4 1 1 1 0 0 23 0.0000 4 240 1290 5421 5043 Electrical\001 -4 1 1 1 0 0 23 0.0000 4 240 1605 10041 5043 Mechanical\001 -4 1 -1 0 0 0 23 0.0000 4 240 90 3600 2835 l\001 -4 1 -1 0 0 0 23 0.0000 4 270 900 3645 1260 sR:r_a\001 -4 1 4 100 0 18 4 0.0000 4 75 270 3780 2475 [out_2]\001 -4 1 4 100 0 18 4 0.0000 4 75 270 5580 2475 [out_2]\001 -4 1 -1 0 0 0 23 0.0000 4 240 90 11880 2835 l\001 -4 1 4 100 0 18 4 0.0000 4 75 270 11745 2475 [out_2]\001 -4 1 -1 0 0 0 23 0.0000 4 300 885 10144 1252 sI:j_m\001 -4 1 -1 0 0 0 23 0.0000 4 240 90 10035 2835 l\001 -4 1 4 100 0 18 4 0.0000 4 75 270 9900 2475 [out_2]\001 -4 1 -1 0 0 0 23 0.0000 4 285 1080 11880 1260 sR:b_m\001 -4 0 4 0 0 0 20 0.0000 4 255 2055 13635 2790 SS:[Mechanical]\001 -4 1 1 1 0 0 23 0.0000 4 240 735 12645 3150 Shaft\001 -4 1 4 100 0 18 16 0.0000 4 225 480 2115 2520 [1,2]\001 -4 1 4 100 0 18 16 0.0000 4 225 480 13365 2565 [1,2]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_desc.tex Index: mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_desc.tex +++ mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_desc.tex @@ -1,38 +0,0 @@ -% Verbal description for system sDC (sDC_desc.tex) -% Generated by MTT on Thu Sep 11 10:09:58 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{sDC} is - displayed in Figure \Ref{sDC_abg} and its label - file is listed in Section \Ref{sec:sDC_lbl}. - The subsystems are listed in Section \Ref{sec:sDC_sub}. - - \begin{table}[htbp] - \begin{center} - \leavevmode - \begin{tabular}{|l|l|} - \hline - Index & Parameter\\ - \hline - 1 & Motor gain ($k_m$) \\ - 2 & Armature inductance ($l_a$) \\ - 3 & Armature resistance ($r_a$) \\ - 4 & Inertia ($j_m$) \\ - 5 & Friction coefficient ($b_m$) \\ - \hline - \end{tabular} - \caption{sDC motor parameters} - \label{tab:sDC_components} - \end{center} - \end{table} -{\bf sDC} is a two(vector)-port component representing a DC motor and its -sensitivity functions. It has the 5 -parameters listed in Table \Ref{tab:sDC_components}. - - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sDC/sDC_lbl.txt @@ -1,52 +0,0 @@ -%% Label file for system sDC (sDC_lbl.txt) -%SUMMARY sDC -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Electrical_1,Electrical_2 -%ALIAS out Mechanical_1,Mechanical_2 - -% Argument aliases -%ALIAS $1 k_m -%ALIAS $2 l_a -%ALIAS $3 r_a -%ALIAS $4 j_m -%ALIAS $5 b_m - -%ALIAS $6 k_ms -%ALIAS $7 l_as -%ALIAS $8 r_as -%ALIAS $9 j_ms -%ALIAS $10 b_ms - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [Electrical] SS external,external - [Mechanical] SS external,external - -% Component type sGY - k_m lin flow,k_m;k_ms - -% Component type sI - j_m lin flow,j_m;j_ms - l_a lin flow,l_a;l_as - -% Component type sR - b_m lin flow,b_m;b_ms - r_a lin flow,r_a;r_as - - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sDe/sDe_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sDe/sDe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sDe/sDe_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sDe/sDe_abg.fig @@ -1,17 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 2025 3600 2025 3375 2250 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 1350 3600 1350 3375 1575 -4 1 0 100 0 18 20 0.0000 4 270 1110 1485 2115 SS:ss_2\001 -4 1 0 100 0 18 20 0.0000 4 270 1110 1485 1440 SS:ss_1\001 -4 1 4 100 0 18 20 0.0000 4 270 1515 4545 1440 SS:[port_1]\001 -4 1 4 100 0 18 20 0.0000 4 270 1515 4500 2115 SS:[port_2]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sDe/sDe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sDe/sDe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sDe/sDe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sDe/sDe_lbl.txt @@ -1,33 +0,0 @@ -%% Label file for system sDe (sDe_lbl.txt) -%SUMMARY sDe Sensitivity version of Effort detector (De) -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/07/29 04:53:34 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in|out port_1,port_2 - -% Argument aliases -%ALIAS $1 external - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [port_1] SS external,external - [port_2] SS external,external - ss_1 SS external,0 - ss_2 SS external,0 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sDf/sDf_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sDf/sDf_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sDf/sDf_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sDf/sDf_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 900 1215 2070 1530 -4 1 0 100 0 18 20 0.0000 4 285 1155 1485 1440 SS:ss_1\001 --6 -6 900 1890 2070 2205 -4 1 0 100 0 18 20 0.0000 4 285 1155 1485 2115 SS:ss_2\001 --6 -6 2205 1305 3645 1620 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 1350 3600 1350 3375 1575 --6 -6 2205 1980 3645 2295 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 2025 3600 2025 3375 2250 --6 -6 3735 1215 5355 1530 -4 1 4 100 0 18 20 0.0000 4 300 1620 4545 1440 SS:[port_1]\001 --6 -6 3690 1890 5310 2205 -4 1 4 100 0 18 20 0.0000 4 300 1620 4500 2115 SS:[port_2]\001 --6 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sDf/sDf_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sDf/sDf_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sDf/sDf_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sDf/sDf_lbl.txt @@ -1,36 +0,0 @@ -%% Label file for system sDf (sDf_lbl.txt) -%SUMMARY sDf Sensitivity version of Effort detector (De) -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/09/07 05:32:17 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1999/07/29 04:53:34 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in|out port_1,port_2 - -% Argument aliases -%ALIAS $1 external - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [port_1] SS external,external - [port_2] SS external,external - ss_1 SS 0,external - ss_2 SS 0,external DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_abg.fig @@ -1,103 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2205 3555 2295 4095 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2250 3600 2250 4050 --6 -6 2205 3555 2295 4095 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2250 3600 2250 4050 --6 -6 2205 7155 2295 7695 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2250 7200 2250 7650 --6 -6 3510 4005 4050 4095 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4005 4050 3555 4050 --6 -6 3645 5850 4185 5940 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4140 5895 3690 5895 --6 -6 8730 5355 9270 5445 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 9225 5400 8775 5400 --6 -6 3600 7155 4140 7245 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4095 7200 3645 7200 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 7425 3600 7425 3375 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 7425 5400 7425 5175 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7425 7425 8775 7425 8550 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9225 7425 10575 7425 10350 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 3825 3600 3825 3375 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 3825 5400 3825 5175 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7425 3825 8775 3825 8550 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9225 3825 10575 3825 10350 4050 -2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 5895 9000 7200 9000 6975 -2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9006 5873 3831 7178 3831 6953 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 450 6300 1800 6525 1575 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 2250 6300 3600 6525 3375 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6075 1800 6525 1800 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 - 6075 2025 4275 2025 4275 5400 4500 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 4050 3825 5400 4050 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9000 4050 9000 5400 9225 5175 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6525 2250 6525 7200 6750 6975 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 - 6525 2025 8550 2025 8550 5400 8775 5175 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 - 6525 8550 9225 8550 9225 5850 9450 6075 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 - 6075 8550 3600 8550 3600 5850 3375 6075 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 10125 6300 8775 6525 9000 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6075 8775 6525 8775 -4 1 4 100 0 18 20 0.0000 4 285 2415 6210 360 SS:[Actual_mod]\001 -4 1 5 100 0 18 20 0.0000 4 210 165 6300 2115 0\001 -4 1 4 100 0 18 20 0.0000 4 285 1845 1215 7515 SS:[Sens_in]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 3825 7515 1\001 -4 1 0 100 0 18 20 0.0000 4 225 1590 6435 7515 EMTF:sens\001 -4 1 0 100 0 18 20 0.0000 4 210 165 9000 7515 0\001 -4 1 4 100 0 18 20 0.0000 4 285 2040 11790 7515 SS:[Sens_out]\001 -4 1 4 100 0 18 20 0.0000 4 285 2055 1215 3915 SS:[Actual_in]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 3825 3915 1\001 -4 1 0 100 0 18 20 0.0000 4 225 1785 6435 3915 EMTF:actual\001 -4 1 0 100 0 18 20 0.0000 4 210 165 9000 3915 0\001 -4 1 4 100 0 18 20 0.0000 4 285 2250 11790 3915 SS:[Actual_out]\001 -4 1 0 100 0 18 20 0.0000 4 225 1170 8955 5715 AE3:ae3\001 -4 1 0 100 0 18 20 0.0000 4 225 1095 3825 5715 AF3:af3\001 -4 2 4 100 0 18 14 0.0000 4 210 600 6255 3600 [mod]\001 -4 2 4 100 0 18 14 0.0000 4 210 600 6435 7155 [mod]\001 -4 1 4 100 0 18 20 0.0000 4 285 2205 6300 10395 SS:[Sens_mod]\001 -4 1 5 100 0 18 20 0.0000 4 210 165 6345 8640 0\001 -4 2 4 100 0 18 14 0.0000 4 210 720 3420 5985 [smod]\001 -4 0 4 100 0 18 14 0.0000 4 210 720 9540 5940 [smod]\001 -4 2 4 100 0 18 14 0.0000 4 210 600 8505 5355 [mod]\001 -4 0 4 100 0 18 14 0.0000 4 210 600 4455 5400 [mod]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt @@ -1,69 +0,0 @@ -%% Label file for system sEMTF (sEMTF_lbl.txt) -%SUMMARY sEMTF Effort modulated TF - sensitivity version -%DESCRIPTION It is assumed that no sensitivity parameter is associated -%DESCRIPTION with this component. -%DESCRIPTION This is a built out of EMTFs and the 4 port AE3 component -%DESCRIPTION There is one argument alias - the transformer (flow) gain -%DESCRIPTION There are two CR aliases: one for the EMTF and one for -%DESCRIPTION the AE3 -%DESCRIPTION Examples: -%DESCRIPTION lin;slin n -%DESCRIPTION lsin;slsin l -%DESCRIPTION lcos;slcos l - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2002/04/17 18:50:35 gawthrop -% %% Sensitivity EMTF components -% %% -% %% Revision 1.1 2000/12/28 17:29:10 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Actual_in,Sens_in -%ALIAS out Actual_out,Sens_out -%ALIAS mod Actual_mod,Sens_mod - - -% Argument aliases -%ALIAS $1 l - -% CR aliases -%ALIAS $1 lsin -%ALIAS $2 slsin - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type EMTF - actual lsin flow,l - sens lsin flow,l - -% Component type AE3 (????NB NEGATIVE GAIN HERE!!!!) - ae3 slsin l - -% Component type AF3 - af3 slsin l - -% Component type SS - [Actual_in] SS external,external - [Actual_out] SS external,external - [Actual_mod] SS external,internal - [Sens_in] SS external,external - [Sens_out] SS external,external - [Sens_mod] SS external,internal - - - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_abg.fig @@ -1,42 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 675 4050 675 3825 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 1350 4050 1350 3825 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 1125 4050 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 450 4050 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 675 4725 675 4950 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 1350 4725 1350 4950 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 8100 675 6750 675 6975 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 8100 1350 6750 1350 6975 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 8100 450 8100 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 8100 1125 8100 1575 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 9900 1800 1350 1800 1350 225 9900 225 9900 1800 -4 1 4 100 0 18 18 0.0000 4 270 870 2115 765 SS:[In]\001 -4 1 4 100 0 18 18 0.0000 4 270 1020 2115 1395 SS:[sIn]\001 -4 1 0 100 0 18 24 0.0000 4 285 510 4410 1125 R:r\001 -4 1 4 100 0 18 14 0.0000 4 210 270 4860 540 [3]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 4860 1215 [4]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 3870 1215 [2]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 3870 540 [1]\001 -4 1 0 100 0 18 18 0.0000 4 210 375 6390 765 AF\001 -4 1 0 100 0 18 18 0.0000 4 210 375 6390 1440 AF\001 -4 1 4 100 0 18 18 0.0000 4 270 1230 8820 765 SS:[Mod]\001 -4 1 4 100 0 18 18 0.0000 4 270 1380 8865 1440 SS:[sMod]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_cr.r Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_cr.r +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_cr.r @@ -1,68 +0,0 @@ -%% CR file for sFMR -%% Just for flow input definition of r, ie must use with flow,r;k_s -in "$MTT_CRS/r/slin.cr"; - -OPERATOR sFMR; - -% Ordinary FMR port -FOR ALL gain_cause,r,k_s,out_cause,in,sin,in_cause,modu,smodu -LET sFMR(gain_cause,r,k_s,out_cause,1, - in,in_cause,1, - sin,in_cause,2, - modu,flow,3, - smodu,flow,4 - ) - = slin(gain_cause,r*modu,k_s,out_cause,1, - in,in_cause,1, - sin,in_cause,2); - -% Sensitivity FMR port - effort input -FOR ALL r,k_s,out_cause,inp,sinp,inp_cause,modu,smodu -LET sFMR(flow,r,k_s,out_cause,2, - inp,effort,1, - sinp,effort,2, - modu,flow,3, - smodu,flow,4 - ) - = ( - slin(flow,r,k_s,out_cause,2, - inp/modu,effort,1, - sinp/modu,effort,2) - - smodu*(1/(r*(modu^2))) - ); - -% Sensitivity FMR port - flow input -FOR ALL r,k_s,out_cause,inp,sinp,inp_cause,modu,smodu -LET sFMR(flow,r,k_s,out_cause,2, - inp,flow,1, - sinp,flow,2, - modu,flow,3, - smodu,flow,4 - ) - = ( - slin(flow,r,k_s,out_cause,2, - inp*modu,flow,1, - sinp*modu,flow,2) - + r*inp*smodu - ); - -% Modulation port -FOR ALL gain_cause,r,k_s,out_cause,inp,sinp,inp_cause,modu,smodu -LET sFMR(gain_cause,r,k_s,out_cause,3, - inp,inp_cause,1, - sinp,inp_cause,2, - modu,flow,3, - smodu,flow,4 - ) - = 0; - -% Sensitivity modulation port -FOR ALL gain_cause,r,k_s,out_cause,inp,sinp,inp_cause,modu,smodu -LET sFMR(gain_cause,r,k_s,out_cause,4, - inp,inp_cause,1, - sinp,inp_cause,2, - modu,flow,3, - smodu,flow,4 - ) - = 0; -END; DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_desc.tex Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_desc.tex +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_desc.tex @@ -1,34 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system sFMR (sFMR_desc.tex) -% Generated by MTT on Thu Jul 5 23:47:35 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{sFMR} is - displayed in Figure \Ref{fig:sFMR_abg.ps} and its label - file is listed in Section \Ref{sec:sFMR_lbl}. - The subsystems are listed in Section \Ref{sec:sFMR_sub}. - - -This is the sensitivity version of the \textbf{FMR} (flow-modulated -resistor) component. - -In the linear case, the CR of the standard port is: -\begin{equation} - e = mrf -\end{equation} -where $e$ is the effort, $m$ the (flow) modulation, $r$ the -``resistance'' and $f$ the flow. - -The corresponding sensitivity CR is: -\begin{equation} - e^\prime = m^\prime rf + mr^\prime f + mrf^\prime -\end{equation} DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_lbl.txt @@ -1,38 +0,0 @@ -#SUMMARY sFMR Sensitivity version of FMR (Flow-modulated R) - -## System sFMR, representation lbl, language txt -## File sFMR_lbl.txt -## Generated by MTT on Thu Jul 5 04:45:59 BST 2001 - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ############################################################### - -## Port aliases -#ALIAS in In,sIn -#ALIAS out Mod,sMod - - -## Argument aliases -#ALIAS $1 flow,r -#ALIAS $2 k_s - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type R - r sFMR flow,r,k_s - -## Component type SS - [In] SS external,external - [sIn] SS external,external - [Mod] SS external,external - [sMod] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_rep.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_rep.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_rep.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFMR/sFMR_rep.txt @@ -1,36 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system sFMR (sFMR_rep.txt) -## Generated by MTT on" Thu Jul 5 23:56:36 BST 2001. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt sFMR abg tex # The system description -mtt sFMR cr tex # The CR -##mtt sFMR cbg ps # The causal bond graph -mtt sFMR struc tex # The system structure -mtt sFMR sympar tex # The system parameters -## Uncomment the following lines or add others -mtt sFMR dae tex # The system dae -## mtt sFMR ode tex # The system ode -## mtt sFMR sspar tex # Steady-state parameters -## mtt sFMR ss tex # Steady state -## mtt sFMR dm tex # Descriptor matrices (of linearised system) -## mtt sFMR sm tex # State matrices (of linearised system) -## mtt sFMR tf tex # Transfer function (of linearised system) -## mtt sFMR lmfr ps # log modulus of frequency response (of linearised system) -## mtt sFMR simpar tex # Simulation parameters -## mtt sFMR numpar tex # Numerical simulation parameters -## mtt sFMR state tex # Simulation initial state -## mtt sFMR input tex # Simulation input -## mtt sFMR logic tex # Logic control -## mtt sFMR odeso ps # Simulation output - -## mtt sFMR rep txt # This file DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_abg.fig @@ -1,42 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 675 4050 675 3825 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 1350 4050 1350 3825 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 675 6075 675 5850 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 1350 6075 1350 5850 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2700 1125 2700 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2700 450 2700 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 450 4725 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 1125 4725 1575 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 7875 1800 1350 1800 1350 225 7875 225 7875 1800 -4 1 4 100 0 18 18 0.0000 4 270 810 2115 765 SS:[F]\001 -4 1 4 100 0 18 18 0.0000 4 270 960 2115 1395 SS:[sF]\001 -4 1 4 100 0 18 18 0.0000 4 270 960 6885 1440 SS:[sP]\001 -4 1 0 100 0 18 24 0.0000 4 285 510 4410 1125 R:r\001 -4 1 4 100 0 18 18 0.0000 4 270 810 6840 765 SS:[P]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 4860 540 [2]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 4860 1215 [4]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 3870 1215 [3]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 3870 540 [1]\001 -4 1 1 101 0 3 20 0.0000 4 195 165 3195 945 S\001 -4 1 1 101 0 3 20 0.0000 4 240 210 5535 945 Q\001 -4 1 1 101 0 3 20 0.0000 4 195 165 3195 450 T\001 -4 1 1 101 0 3 20 0.0000 4 195 135 3330 585 1\001 -4 1 1 101 0 3 20 0.0000 4 195 165 5445 450 T\001 -4 1 1 101 0 3 20 0.0000 4 195 135 5580 585 2\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_cr.r Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_cr.r +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_cr.r @@ -1,92 +0,0 @@ -%% CR file for sFP - -OPERATOR sFP; - -% Entropy flow in - -% Ordinary FP port -% Temperature -FOR ALL Entropy,Temperature,sEntropy,sTemperature -LET sFP(effort,1, - Entropy,flow,1, - Temperature,effort,2, - sEntropy,flow,3, - sTemperature,effort,4 - ) - = Temperature; - -% Heat -FOR ALL Entropy,Temperature,sEntropy,sTemperature -LET sFP(flow,2, - Entropy,flow,1, - Temperature,effort,2, - sEntropy,flow,3, - sTemperature,effort,4 - ) - = Entropy*Temperature; - -% Temperature sensitivity -% Sensitivity FP port -FOR ALL Entropy,Temperature,sEntropy,sTemperature -LET sFP(effort,3, - Entropy,flow,1, - Temperature,effort,2, - sEntropy,flow,3, - sTemperature,effort,4 - ) - = sTemperature; - -% Heat sensitivity -FOR ALL Entropy,Temperature,sEntropy,sTemperature -LET sFP(flow,4, - Entropy,flow,1, - Temperature,effort,2, - sEntropy,flow,3, - sTemperature,effort,4 - ) - = (Entropy*sTemperature + sEntropy*Temperature); - -% Heat flow in - -% Ordinary FP port -% Temperature -FOR ALL Heat,Temperature,sHeat,sTemperature -LET sFP(effort,2, - Temperature,effort,1, - Heat,flow,2, - sTemperature,effort,3, - sHeat,flow,4 - ) - = Temperature; - -% Heat -FOR ALL Heat,Temperature,sHeat,sTemperature -LET sFP(flow,1, - Temperature,effort,1, - Heat,flow,2, - sTemperature,effort,3, - sHeat,flow,4 - ) - = Heat/Temperature; - -% Temperature sensitivity -% Sensitivity FP port -FOR ALL Heat,Temperature,sHeat,sTemperature -LET sFP(effort,4, - Temperature,effort,1, - Heat,flow,2, - sTemperature,effort,3, - sHeat,flow,4 - ) - = sTemperature; - -% Heat sensitivity -FOR ALL Heat,Temperature,sHeat,sTemperature -LET sFP(flow,3, - Temperature,effort,1, - Heat,flow,2, - sTemperature,effort,3, - sHeat,flow,4 - ) - = (sHeat*Temperature - Heat*sTemperature)/Temperature^2; -END; DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_desc.tex Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_desc.tex +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_desc.tex @@ -1,34 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system sFP (sFP_desc.tex) -% Generated by MTT on Fri Jul 6 01:55:23 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{sFP} is - displayed in Figure \Ref{fig:sFP_abg.ps} and its label - file is listed in Section \Ref{sec:sFP_lbl}. - The subsystems are listed in Section \Ref{sec:sFP_sub}. - -This is the sensitivity version of the \textbf{FP} (flow/power -real-pseuso component). - -The standard ports implement the CR: -\begin{align} - T_1 &= T_2 \\ - Q &= S*T_2 -\end{align} - -The \emph{sensitivity} ports implement the CR: -\begin{align} - T_1^\prime &= T_2^\prime \\ - Q^\prime &= S^\prime *T_2 + S*T_2^\prime -\end{align} - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_lbl.txt @@ -1,34 +0,0 @@ -#SUMMARY sFP Sensitivity version of FP - real-pseudo conversion - -## System sFP, representation lbl, language txt -## File sFP_lbl.txt -## Generated by MTT on Thu Jul 5 08:03:02 BST 2001 - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ############################################################### - -## Port aliases -#ALIAS in|f F,sF -#ALIAS out|p P,sP - - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type R - r sFP - -## Component type SS - [F] SS external,external - [P] SS external,external - [sF] SS external,external - [sP] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_rep.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_rep.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_rep.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sFP/sFP_rep.txt @@ -1,36 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system sFP (sFP_rep.txt) -## Generated by MTT on" Fri Jul 6 02:04:19 BST 2001. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt sFP abg tex # The system description -mtt sFP cr tex # The system description -##mtt sFP cbg ps # The causal bond graph -mtt sFP struc tex # The system structure -mtt sFP sympar tex # The system parameters -## Uncomment the following lines or add others -mtt sFP dae tex # The system dae -## mtt sFP ode tex # The system ode -## mtt sFP sspar tex # Steady-state parameters -## mtt sFP ss tex # Steady state -## mtt sFP dm tex # Descriptor matrices (of linearised system) -## mtt sFP sm tex # State matrices (of linearised system) -## mtt sFP tf tex # Transfer function (of linearised system) -## mtt sFP lmfr ps # log modulus of frequency response (of linearised system) -## mtt sFP simpar tex # Simulation parameters -## mtt sFP numpar tex # Numerical simulation parameters -## mtt sFP state tex # Simulation initial state -## mtt sFP input tex # Simulation input -## mtt sFP logic tex # Logic control -## mtt sFP odeso ps # Simulation output - -## mtt sFP rep txt # This file DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sGY/sGY_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sGY/sGY_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sGY/sGY_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sGY/sGY_abg.fig @@ -1,32 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 450 3825 450 3600 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 1125 3825 1125 3600 1350 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5175 450 6525 450 6300 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5175 1125 6525 1125 6300 1350 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7200 450 8550 450 8325 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7200 1125 8550 1125 8325 1350 -4 1 4 100 0 18 20 0.0000 4 270 1920 1440 540 SS:[Actual_in]\001 -4 1 0 100 0 18 20 0.0000 4 210 960 4545 855 sTF:stf\001 -4 1 4 100 0 18 20 0.0000 4 270 1740 1440 1215 SS:[Sens_in]\001 -4 1 0 100 0 18 20 0.0000 4 210 420 6840 540 GY\001 -4 1 0 100 0 18 20 0.0000 4 210 420 6840 1215 GY\001 -4 1 4 100 0 18 20 0.0000 4 270 2115 9765 540 SS:[Actual_out]\001 -4 1 4 100 0 18 20 0.0000 4 270 1935 9765 1215 SS:[Sens_out]\001 -4 1 4 100 0 18 14 0.0000 4 210 1125 3825 315 [Actual_in]\001 -4 1 4 100 0 18 14 0.0000 4 210 1275 5175 315 [Actual_out]\001 -4 1 4 100 0 18 14 0.0000 4 210 1140 5175 1575 [Sens_out]\001 -4 1 4 100 0 18 14 0.0000 4 210 990 3870 1575 [Sens_in]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sGY/sGY_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sGY/sGY_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sGY/sGY_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sGY/sGY_lbl.txt @@ -1,38 +0,0 @@ -%% Label file for system sGY (sGY_lbl.txt) -%SUMMARY sGY GY component with sensitivity ports -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Actual_in,Sens_in -%ALIAS out Actual_out,Sens_out - - -% Argument aliases -%ALIAS $1 flow,k -%ALIAS $2 k_s - -%ALIAS $1 lin - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- -% Component type sTF - stf lin flow,k;k_s - -% Component type SS - [Actual_in] SS external,external - [Actual_out] SS external,external - [Sens_in] SS external,external - [Sens_out] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sI/sI_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sI/sI_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sI/sI_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sI/sI_abg.fig @@ -1,20 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 3375 5400 3375 5625 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 3375 4500 3375 4275 3600 -2 4 0 3 31 7 101 0 -1 0.000 0 0 11 0 0 5 - 9000 4725 1350 4725 1350 2253 9000 2253 9000 4725 -4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 -4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 -4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 -4 1 0 100 0 18 18 0.0000 4 210 390 4950 3465 I:m\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sI/sI_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sI/sI_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sI/sI_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sI/sI_lbl.txt @@ -1,40 +0,0 @@ -%% Label file for system sI (sI_lbl.txt) -%SUMMARY sI Sensitivity I component -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2001/04/05 12:00:18 gawthrop -% %% Identification example -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in actual,sensitivity - -% Argument aliases -%ALIAS $1 flow,m -%ALIAS $2 ms - -%CR alias -%ALIAS $1 slin - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- -% Component type C - m slin flow,m;ms - -% Component type SS - [actual] SS external,external - [sensitivity] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2925 3150 2925 2925 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2250 3150 2250 2925 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 2925 6300 2925 6075 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 2250 6300 2250 6075 2475 -4 1 4 100 0 18 20 0.0000 4 270 1200 990 3015 SS:[in_2]\001 -4 1 4 100 0 18 20 0.0000 4 270 1200 990 2340 SS:[in_1]\001 -4 1 0 100 0 18 20 0.0000 4 270 1455 4050 3015 INTF:intf_2\001 -4 1 0 100 0 18 20 0.0000 4 270 1455 4050 2340 INTF:intf_1\001 -4 1 4 100 0 18 20 0.0000 4 270 1395 7245 3015 SS:[out_2]\001 -4 1 4 100 0 18 20 0.0000 4 270 1395 7245 2340 SS:[out_1]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sINTF/sINTF_lbl.txt @@ -1,37 +0,0 @@ -%% Label file for system sINTF (sINTF_lbl.txt) -%SUMMARY sINTF Sensitivity version of INTF -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 10:32:30 peterg -% %% Put under RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in_1,in_2 -%ALIAS out out_1,out_2 - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type INTF - intf_1 - intf_2 - -% Component type SS - [in_1] SS external,external - [in_2] SS external,external - [out_1] SS external,external - [out_2] SS external,external DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2925 3150 2925 2925 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1800 2250 3150 2250 2925 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 2925 6300 2925 6075 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 2250 6300 2250 6075 2475 -4 1 4 100 0 18 20 0.0000 4 270 1200 990 3015 SS:[in_2]\001 -4 1 4 100 0 18 20 0.0000 4 270 1200 990 2340 SS:[in_1]\001 -4 1 0 100 0 18 20 0.0000 4 270 1650 4050 3015 INTFS:intf_2\001 -4 1 4 100 0 18 20 0.0000 4 270 1395 7245 3015 SS:[out_2]\001 -4 1 4 100 0 18 20 0.0000 4 270 1395 7245 2340 SS:[out_1]\001 -4 1 0 100 0 18 20 0.0000 4 270 1650 4095 2340 INTFS:intf_1\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sINTFS/sINTFS_lbl.txt @@ -1,39 +0,0 @@ -%% Label file for system sINTFS (sINTFS_lbl.txt) -%SUMMARY sINTFS Sensitivity version of INTF with initial state -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 10:32:30 peterg -% %% Put under RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in_1,in_2 -%ALIAS out out_1,out_2 - -% Argument aliases -%ALIAS $1 e_0 -%ALIAS $2 k_s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type INTFS - intf_1 none e_0 - intf_2 none k_s - -% Component type SS - [in_1] SS external,external - [in_2] SS external,external - [out_1] SS external,external - [out_2] SS external,external DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sIS/sIS_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sIS/sIS_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sIS/sIS_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sIS/sIS_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 3825 2475 2475 2700 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 5625 2475 4275 2700 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4050 4050 4050 3825 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 3825 4050 4275 -2 4 0 2 31 7 52 0 -1 0.000 0 0 7 0 0 5 - 6075 6300 6075 1350 1125 1350 1125 6300 6075 6300 -4 1 0 100 0 18 20 0.0000 4 210 405 2475 2295 sI:i\001 -4 0 0 100 0 18 20 0.0000 4 270 960 4185 4185 sSf:f_0\001 -4 1 6 100 0 18 20 0.0000 4 270 555 2476 6031 [1,2]\001 -4 1 4 100 0 18 20 0.0000 4 270 900 2476 6030 SS:[in]\001 -4 1 6 100 0 18 20 0.0000 4 270 555 2476 4186 [1,2]\001 -4 1 0 100 0 18 20 0.0000 4 195 150 2476 4185 0\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sIS/sIS_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sIS/sIS_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sIS/sIS_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sIS/sIS_lbl.txt @@ -1,40 +0,0 @@ -%% Label file for system sIS (sIS_lbl.txt) -%SUMMARY sIS -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:29:10 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Port aliases -%ALIAS in in_1,in_2 - -% Argument aliases -%ALIAS $1 flow,i -%ALIAS $2 f_0 -%ALIAS $3 i_s -%ALIAS $4 f_0s - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [in] SS external,external - -% Component type sI - i slin flow,i;i_s - -% Component type sSf - f_0 SS f_0;f_0s DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sR/sR_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sR/sR_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sR/sR_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sR/sR_abg.fig @@ -1,20 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 3375 5400 3375 5625 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 3375 4500 3375 4275 3600 -2 4 0 3 31 7 101 0 -1 0.000 0 0 11 0 0 5 - 9000 4725 1350 4725 1350 2253 9000 2253 9000 4725 -4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 -4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 -4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 -4 1 0 100 0 18 18 0.0000 4 210 390 4950 3465 R:r\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sR/sR_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sR/sR_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sR/sR_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sR/sR_lbl.txt @@ -1,39 +0,0 @@ -%% Label file for system sR (sR_lbl.txt) -%SUMMARY sR Sensitivity R component -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2001/04/05 12:00:18 gawthrop -% %% Identification example -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in actual,sensitivity - -% Argument aliases -%ALIAS $1 flow,r -%ALIAS $2 rs - -%CR alias -%ALIAS $1 slin - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - r slin flow,r;rs - -% Component type SS - [actual] SS external,external - [sensitivity] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_abg.fig @@ -1,36 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 675 4050 675 3825 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 1350 4050 1350 3825 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 1125 4050 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 450 4050 900 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 9900 1800 1350 1800 1350 225 9900 225 9900 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 675 6075 675 5850 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 1350 6075 1350 5850 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 1125 4725 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 450 4725 900 -4 1 4 100 0 18 18 0.0000 4 270 870 2115 765 SS:[In]\001 -4 1 4 100 0 18 18 0.0000 4 270 1020 2115 1395 SS:[sIn]\001 -4 1 0 100 0 18 24 0.0000 4 285 510 4410 1125 R:r\001 -4 1 4 100 0 18 14 0.0000 4 210 270 4860 540 [2]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 4860 1215 [4]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 3870 1215 [3]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 3870 540 [1]\001 -4 1 4 100 0 18 18 0.0000 4 270 1230 6795 765 SS:[Out]\001 -4 1 4 100 0 18 18 0.0000 4 270 1380 6885 1440 SS:[sOut]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_cr.r Index: mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_cr.r +++ mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_cr.r @@ -1,68 +0,0 @@ -%% CR file for sFMR -%% Just for flow input definition of r, ie must use with flow,r;k_s - -in "$MTT_CRS/r/slin.cr"; %% make sure CR slin is there - -OPERATOR sRS; - -% Ordinary RS port -% R component -FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp -LET sRS(gain_cause,r,rs,out_cause,1, - inp,in_cause,1, - temp,effort,2, - sinp,in_cause,3, - stemp,effort,4 - ) - = lin(gain_cause,r,temp_cause,1, - inp,in_cause,1); -% Entropy flow -FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp -LET sRS(gain_cause,r,rs,out_cause,2, - inp,in_cause,1, - temp,effort,2, - sinp,in_cause,3, - stemp,effort,4 - ) - = inp*lin(gain_cause,r,temp_cause,1, - inp,in_cause,1)/temp; - -% Sensitivity ports -FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp -LET sRS(gain_cause,r,rs,out_cause,3, - inp,in_cause,1, - temp,effort,2, - sinp,in_cause,3, - stemp,effort,4 - ) - = slin(gain_cause,r,rs,temp_cause,2, - inp,in_cause,1, - sinp,in_cause,2 - ); - -%% Sensitivity entropy flow -%% - flow in -FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp -LET sRS(gain_cause,r,rs,out_cause,4, - inp,flow,1, - temp,effort,2, - sinp,flow,3, - stemp,effort,4 - ) - = 2*inp*sinp*r/temp - + (inp^2)*rs/temp - - (inp^2)*r*stemp/(temp^2); - -%% - effort in -FOR ALL gain_cause,r,rs,out_cause,inp,sinp,in_cause,temp,stemp -LET sRS(gain_cause,r,rs,out_cause,4, - inp,effort,1, - temp,effort,2, - sinp,effort,3, - stemp,effort,4 - ) - = 2*inp*sinp/(r*temp) - - (inp^2)*rs/((r^2)*temp) - - (inp^2)*stemp/(r*temp^2); - -END; DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_desc.tex Index: mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_desc.tex +++ mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_desc.tex @@ -1,37 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system sRS (sFMR_desc.tex) -% Generated by MTT on Thu Jul 5 23:47:35 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2001/07/06 01:17:14 gawthrop -% %% New sensitivity components (for extruder model) -% %% -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{sRS} is - displayed in Figure \Ref{fig:sFMR_abg.ps} and its label - file is listed in Section \Ref{sec:sFMR_lbl}. - The subsystems are listed in Section \Ref{sec:sFMR_sub}. - - -This is the sensitivity version of the \textbf{FMR} (flow-modulated -resistor) component. - -In the linear case, the CR of the standard port is: -\begin{equation} - e = mrf -\end{equation} -where $e$ is the effort, $m$ the (flow) modulation, $r$ the -``resistance'' and $f$ the flow. - -The corresponding sensitivity CR is: -\begin{equation} - e^\prime = m^\prime rf + mr^\prime f + mrf^\prime -\end{equation} DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_lbl.txt @@ -1,29 +0,0 @@ -#SUMMARY sRS Sensitivity version of RS - -## System sRS, representation lbl, language txt - -## Port aliases -#ALIAS in In,sIn -#ALIAS out Out,sOut - - -## Argument aliases -#ALIAS $1 flow,r -#ALIAS $2 rs - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type R - r sRS flow,r;rs - -## Component type SS - [In] SS external,external - [sIn] SS external,external - [Out] SS external,external - [sOut] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_rep.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_rep.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_rep.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sRS/sRS_rep.txt @@ -1,39 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system sRS (sFMR_rep.txt) -## Generated by MTT on" Thu Jul 5 23:56:36 BST 2001. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2001/07/06 01:18:24 gawthrop -## New sensitivity components - documentation -## -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt sRS abg tex # The system description -mtt sRS cr tex # The CR -##mtt sRS cbg ps # The causal bond graph -mtt sRS struc tex # The system structure -mtt sRS sympar tex # The system parameters -## Uncomment the following lines or add others -mtt sRS dae tex # The system dae -## mtt sRS ode tex # The system ode -## mtt sRS sspar tex # Steady-state parameters -## mtt sRS ss tex # Steady state -## mtt sRS dm tex # Descriptor matrices (of linearised system) -## mtt sRS sm tex # State matrices (of linearised system) -## mtt sRS tf tex # Transfer function (of linearised system) -## mtt sRS lmfr ps # log modulus of frequency response (of linearised system) -## mtt sRS simpar tex # Simulation parameters -## mtt sRS numpar tex # Numerical simulation parameters -## mtt sRS state tex # Simulation initial state -## mtt sRS input tex # Simulation input -## mtt sRS logic tex # Logic control -## mtt sRS odeso ps # Simulation output - -## mtt sRS rep txt # This file DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sRT/sRT_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sRT/sRT_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sRT/sRT_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sRT/sRT_abg.fig @@ -1,60 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 2701 5625 2701 5400 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 2701 7425 2701 7200 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 2476 5850 1126 6075 1351 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11475 3600 450 3600 450 451 11475 451 11475 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 2701 3375 2701 3150 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 2701 9675 2701 9450 2926 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3375 2520 3375 2970 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 8325 2475 8325 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5625 2475 5625 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6075 2475 6075 2925 -4 1 6 0 0 0 20 0.0000 4 240 510 5851 2792 [1,2]\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5851 2791 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 480 5850 991 sR:r\001 -4 1 4 0 0 0 20 0.0000 4 255 315 4410 2476 [p]\001 -4 1 4 0 0 0 20 0.0000 4 255 315 7290 2476 [p]\001 -4 1 1 1 0 3 20 0.0000 4 240 210 5040 3106 Q\001 -4 1 1 1 0 3 30 0.0000 4 60 105 5085 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 5040 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 240 210 6615 3106 Q\001 -4 1 1 1 0 3 30 0.0000 4 60 105 6660 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 6615 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 6795 2611 2\001 -4 1 1 1 0 3 20 0.0000 4 195 135 5220 2611 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 870 3825 2790 sFP:fp1\001 -4 2 6 0 0 0 20 0.0000 4 240 510 1981 2791 [1,2]\001 -4 2 4 0 0 0 20 0.0000 4 240 810 1981 2790 SS:[in]\001 -4 1 4 0 0 0 20 0.0000 4 240 270 3285 2476 [f]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 3106 S\001 -4 1 1 1 0 3 30 0.0000 4 60 105 2520 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2610 2611 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2610 3241 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 870 7920 2790 sFP:fp2\001 -4 1 4 0 0 0 20 0.0000 4 240 270 8505 2476 [f]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9090 3106 S\001 -4 1 1 1 0 3 30 0.0000 4 60 105 9135 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9090 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 9270 3241 2\001 -4 1 1 1 0 3 20 0.0000 4 195 135 9270 2611 2\001 -4 0 6 0 0 0 20 0.0000 4 240 510 9811 2792 [1,2]\001 -4 0 4 0 0 0 20 0.0000 4 240 960 9811 2791 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sRT/sRT_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sRT/sRT_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sRT/sRT_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sRT/sRT_lbl.txt @@ -1,39 +0,0 @@ -#SUMMARY sRT Sensitivity version of RT - -## System sRT, representation lbl, language txt -## File sRT_lbl.txt -## Generated by MTT on Fri Jul 6 05:51:50 BST 2001 - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ############################################################### - -## Port aliases -#ALIAS in in_1,in_2 -#ALIAS out out_1,out_2 - -## Argument aliases -#ALIAS $1 flow,r -#ALIAS $2 rs - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type SS - [in] SS external,external - [out] SS external,external - -## Component type FP - fp1 lin - fp2 lin - -## Component type R - r slin flow,r;rs - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_abg.fig @@ -1,17 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 2025 3600 2025 3375 2250 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 1350 3600 1350 3375 1575 -4 1 0 100 0 18 20 0.0000 4 270 1080 1485 2115 Se:se_2\001 -4 1 4 100 0 18 20 0.0000 4 270 1515 4500 2115 SS:[port_2]\001 -4 1 4 100 0 18 20 0.0000 4 270 1515 4545 1440 SS:[port_1]\001 -4 1 0 100 0 18 20 0.0000 4 270 1080 1485 1440 Se:se_1\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_lbl.txt @@ -1,38 +0,0 @@ -%% Label file for system sSe (sSe_lbl.txt) -%SUMMARY sSe Sensitivity version of effort source (Se) -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/07/29 04:54:41 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in|out port_1,port_2 - -% Argument aliases -%ALIAS $1 e_s -%ALIAS $2 k_s - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [port_1] SS external,external - [port_2] SS external,external - -% Component type Se - se_1 SS e_s - se_2 SS k_s - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_sSe_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_sSe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_sSe_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sSe/sSe_sSe_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 900 1215 2070 1530 -4 1 0 100 0 18 20 0.0000 4 285 1155 1485 1440 Sf:sf_1\001 --6 -6 900 1890 2070 2205 -4 1 0 100 0 18 20 0.0000 4 285 1155 1485 2115 Sf:sf_2\001 --6 -6 2205 1305 3645 1620 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 1350 3600 1350 3375 1575 --6 -6 2205 1980 3645 2295 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 2025 3600 2025 3375 2250 --6 -6 3735 1215 5355 1530 -4 1 4 100 0 18 20 0.0000 4 300 1620 4545 1440 SS:[port_1]\001 --6 -6 3690 1890 5310 2205 -4 1 4 100 0 18 20 0.0000 4 300 1620 4500 2115 SS:[port_2]\001 --6 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sSf/sSf_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sSf/sSf_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sSf/sSf_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sSf/sSf_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 900 1215 2070 1530 -4 1 0 100 0 18 20 0.0000 4 285 1155 1485 1440 Sf:sf_1\001 --6 -6 900 1890 2070 2205 -4 1 0 100 0 18 20 0.0000 4 285 1155 1485 2115 Sf:sf_2\001 --6 -6 2205 1305 3645 1620 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 1350 3600 1350 3375 1575 --6 -6 2205 1980 3645 2295 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 2025 3600 2025 3375 2250 --6 -6 3735 1215 5355 1530 -4 1 4 100 0 18 20 0.0000 4 300 1620 4545 1440 SS:[port_1]\001 --6 -6 3690 1890 5310 2205 -4 1 4 100 0 18 20 0.0000 4 300 1620 4500 2115 SS:[port_2]\001 --6 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sSf/sSf_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sSf/sSf_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sSf/sSf_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sSf/sSf_lbl.txt @@ -1,38 +0,0 @@ -%% Label file for system sSf (sSf_lbl.txt) -%SUMMARY sSf Sensitivity version of flow source (Sf) -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/07/29 04:54:41 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in|out port_1,port_2 - -% Argument aliases -%ALIAS $1 f_s -%ALIAS $2 k_s - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [port_1] SS external,external - [port_2] SS external,external - -% Component type Sf - sf_1 SS f_s - sf_2 SS k_s - DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sTF/sTF_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sTF/sTF_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sTF/sTF_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sTF/sTF_abg.fig @@ -1,49 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 4050 3825 4050 3600 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4050 5625 4050 5400 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7650 4050 9000 4050 8775 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9450 4050 10800 4050 10575 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 450 3825 450 3600 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 450 5625 450 5400 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7650 450 9000 450 8775 675 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9450 450 10800 450 10575 675 -2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 2520 9225 3825 9225 3600 -2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9231 2498 4056 3803 4056 3578 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 675 4050 2025 4275 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9225 675 9225 2025 9450 1800 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3825 675 4275 675 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9000 2025 9450 2025 -4 1 4 100 0 18 20 0.0000 4 270 1740 1440 4140 SS:[Sens_in]\001 -4 1 0 100 0 18 20 0.0000 4 195 150 4050 4140 1\001 -4 1 0 100 0 18 20 0.0000 4 210 1095 6660 4140 TF:sens\001 -4 1 0 100 0 18 20 0.0000 4 195 150 9225 4140 0\001 -4 1 4 100 0 18 20 0.0000 4 270 1935 12015 4140 SS:[Sens_out]\001 -4 1 4 100 0 18 20 0.0000 4 270 1920 1440 540 SS:[Actual_in]\001 -4 1 0 100 0 18 20 0.0000 4 195 150 4050 540 1\001 -4 1 0 100 0 18 20 0.0000 4 195 150 9225 540 0\001 -4 1 4 100 0 18 20 0.0000 4 270 2115 12015 540 SS:[Actual_out]\001 -4 1 0 100 0 18 20 0.0000 4 210 825 9180 2340 AE:ae\001 -4 1 0 100 0 18 20 0.0000 4 210 750 4050 2340 AF:af\001 -4 1 0 100 0 18 20 0.0000 4 210 1260 6660 540 TF:actual\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sTF/sTF_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sTF/sTF_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sTF/sTF_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sTF/sTF_lbl.txt @@ -1,52 +0,0 @@ -%% Label file for system sTF (sTF_lbl.txt) -%SUMMARY sTF TF component with sensitivity ports -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1999/08/26 01:34:59 peterg -% %% Summary line added -% %% -% %% Revision 1.2 1999/08/26 01:22:25 peterg -% %% New alias $1 flow,k -% %% -% %% Revision 1.1 1999/08/26 00:15:58 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Actual_in,Sens_in -%ALIAS out Actual_out,Sens_out - - -% Argument aliases -%ALIAS $1 flow,k -%ALIAS $2 k_s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AE - ae lin effort,-k_s - -% Component type AF - af lin flow,k_s - -% Component type SS - [Actual_in] SS external,external - [Actual_out] SS external,external - [Sens_in] SS external,external - [Sens_out] SS external,external - -% Component type TF - actual lin flow,k - sens lin flow,k DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sTF/testsTF_abg.fig Index: mttroot/mtt/lib/comp/compound/Sensitivity/sTF/testsTF_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sTF/testsTF_abg.fig +++ mttroot/mtt/lib/comp/compound/Sensitivity/sTF/testsTF_abg.fig @@ -1,20 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 2925 6075 2925 5850 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2250 2700 2250 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 2925 3600 2925 3375 3150 -4 1 0 100 0 18 18 0.0000 4 210 930 4185 3060 sTF:stf\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 1620 3015 SS:ss_1\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 6750 3015 SS:ss_2\001 -4 1 4 100 0 18 14 0.0000 4 210 450 2385 2700 [1,2]\001 -4 1 4 100 0 18 14 0.0000 4 210 450 6030 2790 [1,2]\001 DELETED mttroot/mtt/lib/comp/compound/Sensitivity/sTF/testsTF_lbl.txt Index: mttroot/mtt/lib/comp/compound/Sensitivity/sTF/testsTF_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sTF/testsTF_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sTF/testsTF_lbl.txt @@ -1,34 +0,0 @@ -#SUMMARY testsTF -#DESCRIPTION Detailed description here - -## System testsTF, representation lbl, language txt -## File testsTF_lbl.txt -## Generated by MTT on Thu Aug 9 12:38:50 BST 2001 - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ############################################################### - -## Port aliases - -## Argument aliases -#ALIAS $1 k -#ALIAS $2 k_s - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type - ss_1 SS external,external - ss_2 SS external,external - -## Component type sTF - stf slin flow,n;n_s - DELETED mttroot/mtt/lib/comp/compound/Thermal/CT/CT_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CT/CT_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CT/CT_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CT/CT_abg.fig @@ -1,26 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 2700 3375 2700 3150 2925 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 5850 3825 5850 1575 225 1575 225 3825 5850 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 2700 5625 2700 5400 2925 -4 1 4 0 0 0 20 0.0000 4 240 270 3285 2475 [f]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 3105 S\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 2475 T\001 -4 1 1 1 0 3 30 0.0000 4 60 105 2520 2835 .\001 -4 2 4 0 0 0 20 0.0000 4 240 810 1980 2790 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 630 3825 2790 FP:fp\001 -4 1 4 0 0 0 20 0.0000 4 255 315 4410 2475 [p]\001 -4 1 1 1 0 3 20 0.0000 4 240 210 4950 3105 Q\001 -4 1 1 1 0 3 20 0.0000 4 195 165 4950 2475 T\001 -4 1 1 1 0 3 30 0.0000 4 60 105 4995 2835 .\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 5940 2790 C:c\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CT/CT_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CT/CT_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CT/CT_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CT/CT_desc.tex @@ -1,7 +0,0 @@ - -Component \textbf{CT} is a two port thermal resistor with true power -bonds. Internally, it has a pseudo Bond Graph representation, and the -corresponding thermal resistance just acts as an ordinary one-port -\textbf{C} component. - - DELETED mttroot/mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt @@ -1,60 +0,0 @@ -%SUMMARY CT: One-port thermal C component with T/Sdot bond -%DESCRIPTION CR and parameters as for a one-port C component -%DESCRIPTION Internally pseudo -%DESCRIPTION Example label file entry: -%DESCRIPTION % Component type CT -%DESCRIPTION c lin effort,c - -%Port aliases -%ALIAS Thermal|out in - -%CR aliases -%ALIAS $1 effort,c_t -%ALIAS $a1 lin - -%% Label file for system CT (CT_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.7 2001/07/03 22:59:10 gawthrop -% %% Fixed problems with argument passing for CRs -% %% -% %% Revision 1.6 2001/06/13 17:10:26 gawthrop -% %% Alias for the cr (ie ALIAS $1 lin) -% %% -% %% Revision 1.5 2001/06/11 15:09:18 gawthrop -% %% Removed spurious parameter -% %% -% %% Revision 1.4 1998/07/22 11:28:15 peterg -% %% Out as port alias -% %% -% %% Revision 1.3 1998/07/22 11:27:41 peterg -% %% Changed port name -% %% -% %% Revision 1.2 1998/06/29 10:12:58 peterg -% %% Converted to FP component -% %% Removed FP label -% %% -% %% Revision 1.1 1997/09/04 09:49:19 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c lin effort,c_t - -% Component type FP - fp - -% Component type SS - [in] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2.cr Index: mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2.cr ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2.cr +++ mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2.cr @@ -1,44 +0,0 @@ -%SUMMARY CT2 Constitutive Relationship for a two port thermo C -%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) -%DESCRIPTION Parameter 2: gamma = c_p/c_v -%DESCRIPTION Parameter 3: mass of (ideal) gas within component. -%DESCRIPTION Parameter 4: t_0 -- the temperature at which internal -%DESCRIPTION energy is zero. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/12/07 20:45:21 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/02 10:21:19 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/09/12 11:18:26 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -OPERATOR CT2; -Port 1 - Thermal -FOR ALL c_v,gamma,m,t_0,InternalEnergy,Volume -LET CT2(c_v,gamma,m,t_0,effort,1, - InternalEnergy, state, 1, - Volume, state, 2) - = InternalEnergy/(m*c_v); - -Port 2 - Mechanical -FOR ALL c_v,gamma,m,t_0,InternalEnergy,Volume -LET CT2(c_v,gamma,m,t_0,effort,2, - InternalEnergy, state, 1, - Volume, state, 2) - = (gamma-1)*(InternalEnergy+c_v*m*t_0)/Volume; - -END; DELETED mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_abg.fig @@ -1,57 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2700 5400 4050 5400 3825 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 5400 4725 5400 4950 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 3825 2475 5175 2700 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 2025 2475 3375 2700 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 3825 6525 5175 6750 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 3375 6525 2025 6750 2250 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 5085 5895 5085 4950 3690 4950 3690 5895 5085 5895 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 2024 6750 3262 5512 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 5175 2700 5625 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6075 5175 6075 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 6525 5625 6525 6750 4500 6750 4725 6975 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 2475 5625 2475 6750 4050 6750 3825 6975 -4 1 4 0 0 0 20 0.0000000 4 240 345 2250 4005 [e]\001 -4 1 4 0 0 0 20 0.0000000 4 240 330 2250 3375 [s]\001 -4 0 -1 0 0 0 20 0.0000000 4 210 150 2430 5490 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 420 4410 5490 C:c\001 -4 1 -1 0 0 0 20 0.0000000 4 270 690 6525 5490 PS:ps\001 -4 0 4 0 0 0 20 0.0000000 4 270 960 6660 5850 [power]\001 -4 1 -1 0 0 0 20 0.0000000 4 210 690 2430 3690 ES:es\001 -4 1 4 0 0 0 20 0.0000000 4 240 870 2475 1845 SS:[in]\001 -4 2 4 0 0 0 20 0.0000000 4 240 600 5985 5265 [out]\001 -4 0 4 0 0 0 20 0.0000000 4 240 450 6750 5175 [in]\001 -4 0 -1 0 0 0 20 0.0000000 4 210 150 6435 3690 0\001 -4 1 4 0 0 0 20 0.0000000 4 240 1020 6480 1890 SS:[out]\001 -4 1 1 1 0 3 20 0.0000000 4 240 2340 6480 1530 Mechanical Power\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 2160 2700 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 6300 2700 P\001 -4 0 1 1 0 3 20 0.0000000 4 210 675 6660 2700 dV/dt\001 -4 1 1 1 0 3 20 0.0000000 4 240 1935 2475 1530 Thermal Power\001 -4 0 1 1 0 3 20 0.0000000 4 210 720 2610 4365 dH/dt\001 -4 1 1 1 0 3 20 0.0000000 4 255 840 1935 4365 T-T_0\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 6300 4365 P\001 -4 0 1 1 0 3 20 0.0000000 4 210 855 6705 4365 -dV/dt\001 -4 2 1 1 0 3 20 0.0000000 4 210 1755 2025 6660 dH/dt-PdV/dt\001 -4 1 1 1 0 3 20 0.0000000 4 270 1485 4365 4770 Two-port C\001 -4 1 4 0 0 0 20 0.0000000 4 240 450 4050 5265 [in]\001 -4 1 4 0 0 0 20 0.0000000 4 240 600 4770 5265 [out]\001 -4 0 1 1 0 3 20 0.0000000 4 210 855 4005 7335 PdV/dt\001 -4 0 -1 0 0 0 20 0.0000000 4 210 150 4230 6840 1\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_desc.tex @@ -1,41 +0,0 @@ -% Verbal description for system CT2 (CT2_desc.tex) -% Generated by MTT on Thu Dec 4 16:00:14 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/12/07 20:29:56 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{CT2} is - displayed in Figure \Ref{CT2_abg} and its label - file is listed in Section \Ref{sec:CT2_lbl}. - The subsystems are listed in Section \Ref{sec:CT2_sub}. - -\textbf{CT2} is a two port thermal capacitor representing an ideal -heat engine converting heat to work without energy loss. There are two -ports {\bf [in]} (with covariables Temperature (absolute) and -entropy flow) and {\bf [out]} with covariables Pressure and rate of -change of volume. - -Rather than using the corresponding (nonlinear) Constitutive -Relationship (with entropy and volume as states) directly, the -component is built up from a {\em linear\/} two-port capacitor with -internal energy and volume as states. The {\bf ES} component provides -the conversion from the pseudo Bond Graph with temperature (relative) -and enthalpy flow as covariables to the true Bond Graph with with -covariables Temperature (absolute) and entropy flow. - -The power-sensor {\bf PS} component is used to subtract the work enrgy -from the internal energy. - - - - - - - DELETED mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CT2/CT2_lbl.txt @@ -1,40 +0,0 @@ -%SUMMARY CT2: Two-port thermal C component - a heat engine. -%DESCRIPTION Port [in]: a (true) thermal bond -%DESCRIPTION Port [out]: a mechanical (P, dV/dT) bond. -%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) -%DESCRIPTION Parameter 2: gamma = c_p/c_v -%DESCRIPTION Parameter 3: mass of (ideal) gas within component. -%DESCRIPTION Parameter 4: t_0 -- the temperature at which internal -%DESCRIPTION energy is zero. - -%% Label file for system CT2 (CT2_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C c_v,gamma,m,t_0 - c CT2 $1,$2,$3,$4 - -% Component type ES - es - -% Component type PS - ps - -% Component type SS - [in] SS external,external - [out] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Thermal/CU/CU_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CU/CU_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CU/CU_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CU/CU_abg.fig @@ -1,65 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1125 3375 2250 3375 2025 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2700 3375 3825 3375 3600 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 3375 5400 3375 5175 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 5175 4725 4050 4725 4050 3600 4275 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 3375 7200 3375 6975 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7650 3375 8775 3375 8550 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9225 3375 10350 3375 10125 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10800 3375 11925 3375 11700 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 9000 3600 9000 4725 6075 4725 6300 4950 -4 1 -1 0 0 2 20 0.0000 4 195 360 2475 3465 FP\001 -4 1 -1 0 0 2 20 0.0000 4 195 135 4050 3465 0\001 -4 1 4 0 0 2 16 0.0000 4 210 270 2160 3105 [f]\001 -4 1 4 0 0 2 16 0.0000 4 225 315 2835 3105 [p]\001 -4 1 1 1 0 3 22 0.0000 4 225 195 1440 3150 T\001 -4 1 1 1 0 3 22 0.0000 4 225 195 3240 3150 T\001 -4 1 1 1 0 3 22 0.0000 4 225 195 4815 3150 T\001 -4 1 1 1 0 3 22 0.0000 4 285 720 4815 3825 Q-W\001 -4 1 1 1 0 3 22 0.0000 4 285 240 3240 3825 Q\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3285 3555 .\001 -4 1 1 1 0 3 22 0.0000 4 225 195 1440 3825 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 1485 3555 .\001 -4 1 1 1 0 3 30 0.0000 4 60 120 4590 3555 .\001 -4 1 1 1 0 3 30 0.0000 4 60 120 5040 3555 .\001 -4 1 -1 0 0 2 20 0.0000 4 195 360 7425 3465 FP\001 -4 1 -1 0 0 2 20 0.0000 4 195 360 10575 3465 FP\001 -4 1 -1 0 0 2 20 0.0000 4 195 135 9000 3465 1\001 -4 0 4 0 0 2 20 0.0000 4 240 990 12060 3465 SS:[out]\001 -4 1 4 0 0 2 16 0.0000 4 210 270 10935 3105 [f]\001 -4 1 4 0 0 2 16 0.0000 4 210 270 7110 3105 [f]\001 -4 1 4 0 0 2 16 0.0000 4 225 315 7785 3105 [p]\001 -4 1 4 0 0 2 16 0.0000 4 225 315 10260 3105 [p]\001 -4 1 1 1 0 3 22 0.0000 4 225 195 6615 3150 P\001 -4 1 1 1 0 3 22 0.0000 4 225 195 9765 3150 P\001 -4 1 1 1 0 3 22 0.0000 4 225 195 11385 3150 P\001 -4 1 1 1 0 3 22 0.0000 4 225 225 11385 3825 V\001 -4 1 1 1 0 3 30 0.0000 4 60 120 11430 3555 .\001 -4 1 1 1 0 3 22 0.0000 4 225 285 9765 3825 W\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9810 3555 .\001 -4 1 1 1 0 3 22 0.0000 4 225 225 6615 3825 V\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6660 3555 .\001 -4 1 -1 0 0 2 20 0.0000 4 195 405 5715 3465 C:c\001 -4 1 1 1 0 3 22 0.0000 4 225 195 8190 3150 P\001 -4 1 1 1 0 3 22 0.0000 4 225 285 8190 3825 W\001 -4 1 1 1 0 3 30 0.0000 4 60 120 8235 3555 .\001 -4 1 1 1 0 3 22 0.0000 4 225 195 8190 4500 P\001 -4 1 1 1 0 3 22 0.0000 4 225 285 8190 5175 W\001 -4 1 1 1 0 3 30 0.0000 4 60 120 8235 4905 .\001 -4 2 4 0 0 2 20 0.0000 4 240 825 990 3465 SS:[in]\001 -4 1 -1 0 0 2 20 0.0000 4 195 690 5625 4815 AF:af\001 -4 1 1 1 0 3 22 0.0000 4 300 1275 900 4275 Heat port\001 -4 1 1 1 0 3 22 0.0000 4 315 1305 11295 4275 Work port\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CU/CU_cr.r Index: mttroot/mtt/lib/comp/compound/Thermal/CU/CU_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CU/CU_cr.r +++ mttroot/mtt/lib/comp/compound/Thermal/CU/CU_cr.r @@ -1,79 +0,0 @@ -%SUMMARY CU Constitutive Relationship for a two port thermo C -%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) -%DESCRIPTION Parameter 2: gamma = c_p/c_v -%DESCRIPTION Parameter 3: mass of (ideal) gas within component. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 10:34:56 peterg -% %% Put under RCS -% %% -% %% Revision 1.1 1997/12/07 20:45:21 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/02 10:21:19 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/09/12 11:18:26 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -OPERATOR CU; - -%% Integral/Integral causality -Port 1 - Thermal -FOR ALL COMPONENT, c_v,gamma,m,InternalEnergy,Volume -LET CU(COMPONENT, ideal_gas,c_v,gamma,m,effort,1, - InternalEnergy, state, 1, - Volume, state, 2) - = InternalEnergy/(m*c_v); - -Port 2 - Mechanical -FOR ALL COMPONENT, c_v,gamma,m,InternalEnergy,Volume -LET CU(COMPONENT, ideal_gas,c_v,gamma,m,effort,2, - InternalEnergy, state, 1, - Volume, state, 2) - = (gamma-1)*(InternalEnergy)/Volume; - -%% Derivative/Integral causality -Port 1 - Thermal -FOR ALL COMPONENT, c_v,gamma,m,Temperature,Volume -LET CU(COMPONENT, ideal_gas,c_v,gamma,m,state,1, - Temperature, effort, 1, - Volume, state, 2) - = Temperature*(m*c_v); - -Port 2 - Mechanical -FOR ALL COMPONENT, c_v,gamma,m,Temperature,Volume -LET CU(COMPONENT, ideal_gas,c_v,gamma,m,effort,2, - Temperature, effort, 1, - Volume, state, 2) - = (gamma-1)*(m*c_v)*(Temperature)/Volume; - -%% Integral/Derivative causality -Port 1 - Thermal -FOR ALL COMPONENT, c_v,gamma,m,InternalEnergy,Pressure -LET CU(COMPONENT, ideal_gas,c_v,gamma,m,effort,1, - InternalEnergy, state, 1, - Pressure, effort, 2) - = InternalEnergy/(m*c_v); - -Port 2 - Mechanical -FOR ALL COMPONENT, c_v,gamma,m,InternalEnergy,Pressure -LET CU(COMPONENT, ideal_gas,c_v,gamma,m,state,2, - InternalEnergy, state, 1, - Pressure, effort, 2) - = (gamma-1)*(InternalEnergy)/Pressure; - - -END; DELETED mttroot/mtt/lib/comp/compound/Thermal/CU/CU_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CU/CU_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CU/CU_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CU/CU_lbl.txt @@ -1,25 +0,0 @@ -%SUMMARY CU -%DESCRIPTION -%% Label file for system CU (CU_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -% Component type AF (gain of -1) - af lin -1 - -% Component type C - c CU $1 - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_abg.fig @@ -1,62 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4953 2928 6528 2928 6303 3153 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2476 2926 4051 2926 3826 3151 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2476 4051 4051 4051 3826 4276 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 4051 6526 4051 6301 4276 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 5618 4501 4493 4726 4718 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6978 2925 8553 2925 8328 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6978 4050 8553 4050 8328 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 2693 6750 1568 6975 1793 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 4268 6750 5393 6975 5168 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6480 1575 6975 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6480 5400 6975 5400 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 6300 11025 675 225 675 225 6300 11025 6300 -4 2 4 0 0 0 20 0.0000 4 255 2085 2436 4101 SS:[Hydraulic_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1935 2438 3023 SS:[Thermal_in]\001 -4 2 4 0 0 0 12 0.0000 4 180 540 4102 3337 [Th_in]\001 -4 2 4 0 0 0 12 0.0000 4 180 570 4147 3922 [Hy_in]\001 -4 0 4 0 0 0 12 0.0000 4 180 675 5002 3922 [Hy_out]\001 -4 0 4 0 0 0 12 0.0000 4 180 645 5002 3337 [Th_out]\001 -4 1 -1 0 0 22 20 0.0000 4 270 1470 4504 3649 hPipe:pipe\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2933 3968 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2798 4238 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2798 3878 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 2798 4508 V\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2842 2752 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2977 2842 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2977 3517 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2842 3382 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2842 3112 .\001 -4 1 4 0 0 0 20 0.0000 4 240 1140 4501 5986 SS:[Heat]\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7933 4244 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7933 3884 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 7933 4514 V\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8068 3974 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7933 2713 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8068 2803 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7933 3343 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7933 3073 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8068 3478 2\001 -4 0 4 0 0 0 20 0.0000 4 255 2235 8696 4197 SS:[Hydraulic_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 2085 8651 3026 SS:[Thermal_out]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6750 3060 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6750 4140 0\001 -4 1 -1 0 0 22 20 0.0000 4 210 675 6705 5715 SS:P\001 -4 1 -1 0 0 22 20 0.0000 4 210 645 6705 1440 SS:T\001 -4 1 4 0 0 0 12 0.0000 4 180 495 4501 4366 [Heat]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_desc.tex @@ -1,27 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Comb (Comb_desc.tex) -% Generated by MTT on Tue Mar 31 15:58:34 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Comb} is - displayed in Figure \Ref{Comb_abg} and its label - file is listed in Section \Ref{sec:Comb_lbl}. - The subsystems are listed in Section \Ref{sec:Comb_sub}. - - This thermal tank model has been developed to represent an ideal - (and non-dynamic) combustion chamber for a gas turbine. The major - simplification is that the mass contained in the tank is assumed - constant -- this is consistent with using an ideal compressor and an - ideal turbine with identical mass flows. Energy conservatioin is - ensured by using true bonds and \textbf{TF} components. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Comb/Comb_lbl.txt @@ -1,73 +0,0 @@ -%SUMMARY Comb: Combustion chamber model - -%DESCRIPTION This thermal tank model has been developed to represent an ideal -%DESCRIPTION (and non-dynamic) combustion chamber for a gas turbine. The major -%DESCRIPTION simplification is that the mass contained in the tank is assumed -%DESCRIPTION constant -- this is consistent with using an ideal compressor and an -%DESCRIPTION ideal turbine with identical mass flows. Energy conservation is -%DESCRIPTION ensured by using true bonds and components. - -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -%ALIAS $1 m_c -%ALIAS $2 v_c -%ALIAS $3 r - -%ALIAS hPipe CompressibleFlow/hPipe - -%% Label file for system Comb (Comb_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.6 1998/07/04 08:24:25 peterg -% %% New-style SS -% %% -% %% Revision 1.5 1998/07/03 14:55:33 peterg -% %% Aliased parameters. -% %% Removed _c from parameters, -% %% -% %% Revision 1.4 1998/07/02 19:46:34 peterg -% %% New aliases -% %% -% %% Revision 1.3 1998/07/02 10:54:42 peterg -% %% Lower case in out -% %% -% %% Revision 1.2 1998/07/02 10:49:32 peterg -% %% Added port aliases -% %% -% %% Revision 1.1 1998/05/19 09:11:29 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type SS - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Heat] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external - P SS external,0 - T SS external,0 - -% Component type hPipe - pipe none m_c;v_c;r - - - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_abg.fig @@ -1,35 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 2476 5626 2476 5401 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 3376 5626 3376 5401 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5626 2251 5626 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5626 3151 5626 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6752 2927 7877 2927 7652 3152 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7877 2702 7877 3152 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 2475 3826 2475 3601 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 3375 3826 3375 3601 3600 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 4725 10125 1350 90 1350 90 4725 10125 4725 -4 2 4 0 0 22 20 0.0000 4 270 1890 2610 2565 SS:[Pressure]\001 -4 2 4 0 0 22 20 0.0000 4 270 2385 2655 3465 SS:[Temperature]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 5041 2251 P\001 -4 1 1 1 0 3 20 0.0000 4 195 165 4996 3241 T\001 -4 1 4 0 0 22 20 0.0000 4 270 330 5895 2520 [1]\001 -4 1 4 0 0 22 20 0.0000 4 270 330 5895 3465 [2]\001 -4 1 -1 0 0 18 30 0.0000 4 345 600 6030 3060 R:r\001 -4 1 4 0 0 22 20 0.0000 4 270 330 6570 3015 [3]\001 -4 1 1 1 0 32 30 0.0000 4 345 210 7337 2792 r\001 -4 0 4 0 0 22 20 0.0000 4 270 1695 8146 3016 SS:[Density]\001 -4 1 -1 0 0 18 20 0.0000 4 210 405 4140 2610 AE\001 -4 1 -1 0 0 18 20 0.0000 4 210 405 4140 3465 AE\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_cr.r Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_cr.r +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_cr.r @@ -1,36 +0,0 @@ -% Constitutive relation file for Density (Density_cr.r) -% Generated by MTT at Wed Mar 11 11:01:28 GMT 1998 - -OPERATOR Density; - -% Ideal gas -FOR ALL COMPONENT, R,Temperature,Pressure,Nothing -LET Density(COMPONENT, density,ideal_gas,R,effort,3, - Pressure,effort,1, - Temperature,effort,2, - Nothing,flow,3 - ) = Pressure/(R*Temperature); - -FOR ALL COMPONENT, R,Temperature,Pressure,Nothing -LET Density(COMPONENT, specific_volume,ideal_gas,R,effort,3, - Pressure,effort,1, - Temperature,effort,2, - Nothing,flow,3 - ) = (R*Temperature)/Pressure; - -% Incompressible -FOR ALL COMPONENT, rho,Temperature,Pressure,Nothing -LET Density(COMPONENT, density,incompressible,rho,effort,3, - Pressure,effort,1, - Temperature,effort,2, - Nothing,flow,3 - ) = rho; - -FOR ALL COMPONENT, rho,Temperature,Pressure,Nothing -LET Density(COMPONENT, specific_volume,incompressible,rho,effort,3, - Pressure,effort,1, - Temperature,effort,2, - Nothing,flow,3 - ) = 1/rho; - -END; DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_desc.tex @@ -1,39 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Density (Density_desc.tex) -% Generated by MTT on Thu Mar 19 13:24:59 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Density} is - displayed in Figure \Ref{Density_abg} and its label - file is listed in Section \Ref{sec:Density_lbl}. - -This three port component computes the density $\rho$ of substance in -terms of the temperature $T$ and the pressure $P$. At the moment, -there are four forms dependent on the four forms of the component parameter: -\begin{enumerate} -\item \emph{density,incompressible,rho} -\item \emph{specific\_volume,incompressible,rho} -\item \emph{density,ideal\_gas,R} -\item \emph{specific\_volume,ideal\_gas,R} -\end{enumerate} - -\begin{equation} - y = - \begin{cases} - \rho & \text{if the parameter is - \emph{density,incompressible,rho}}\\ - \frac{1}{\rho} & \text{if the parameter is - \emph{specific\_volume,incompressible,rho}}\\ - \frac{P}{RT} & \text{if the parameter is \emph{density,ideal\_gas,R}}\\ - \frac{RT}{P} & \text{if the parameter is - \emph{specific\_volume,ideal\_gas,R}} - \end{cases} -\end{equation} -where $\rho$ is the density of the incompressible fluid and $R$ the -universal gas constant of the ideal gas. DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Density/Density_lbl.txt @@ -1,41 +0,0 @@ -%SUMMARY Density - Computes P and T. - -%DESCRIPTION Parameter: density,ideal_gas,gas_constant -%DESCRIPTION OR : specific_volume,ideal_gas,gas_constant -%DESCRIPTION OR : density,incompressible,gas_constant -%DESCRIPTION OR : specific_volume,incompressible,gas_constant -%DESCRIPTION Port [P]: Pressure -%DESCRIPTION Port [T]: Temperature -%DESCRIPTION Port [rho]: Density - -%ALIAS P Pressure -%ALIAS T Temperature -%ALIAS rho|out Density - -%ALIAS $1 density,ideal_gas,r - - - -%% Label file for system Density (Density_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type R - r Density density,ideal_gas,r - -% Component type SS - [Pressure] SS external,external - [Temperature] SS external,external - [Density] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_abg.fig @@ -1,64 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4503 2928 6078 2928 5853 3153 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 2926 3601 2926 3376 3151 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 4051 3601 4051 3376 4276 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 4051 6076 4051 5851 4276 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6528 2925 8103 2925 7878 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6528 4050 8103 4050 7878 4275 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9900 6300 9900 675 225 675 225 6300 9900 6300 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 2693 6300 1568 6525 1793 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 4268 6300 5393 6525 5168 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6030 1575 6525 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6030 5400 6525 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3825 4500 4320 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 4507 4050 5632 4275 5407 -4 2 4 0 0 0 12 0.0000 4 180 540 3652 3337 [Th_in]\001 -4 2 4 0 0 0 12 0.0000 4 180 570 3697 3922 [Hy_in]\001 -4 0 4 0 0 0 12 0.0000 4 180 675 4552 3922 [Hy_out]\001 -4 0 4 0 0 0 12 0.0000 4 180 645 4552 3337 [Th_out]\001 -4 1 -1 0 0 22 20 0.0000 4 270 1470 4054 3649 hPipe:pipe\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2483 3968 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2348 4238 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2348 3878 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 2348 4508 V\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2392 2752 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2527 2842 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2527 3517 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2392 3382 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2392 3112 .\001 -4 2 4 0 0 0 20 0.0000 4 255 1290 1896 4191 SS:[Hy_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1275 1943 3023 SS:[Th_in]\001 -4 1 4 0 0 22 12 0.0000 4 180 540 4051 4366 [Heat]\001 -4 1 -1 0 0 0 20 0.0000 4 195 570 4051 5986 CT:c\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7483 4244 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7483 3884 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 7483 4514 V\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7618 3974 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7483 2713 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7618 2803 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7483 3343 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7483 3073 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7618 3478 2\001 -4 0 4 0 0 0 20 0.0000 4 255 1440 8246 4197 SS:[Hy_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 1425 8201 3026 SS:[Th_out]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6300 3060 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6300 4140 0\001 -4 1 -1 0 0 22 20 0.0000 4 210 675 6255 5715 SS:P\001 -4 1 -1 0 0 22 20 0.0000 4 210 645 6255 1440 SS:T\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_desc.tex @@ -1,27 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system ICV (ICV_desc.tex) -% Generated by MTT on Tue Mar 31 15:58:34 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ICV} is - displayed in Figure \Ref{ICV_abg} and its label - file is listed in Section \Ref{sec:ICV_lbl}. - The subsystems are listed in Section \Ref{sec:ICV_sub}. - - This thermal tank model has been developed to represent an - inter-volume component (ICV) for a gas turbine. The major - simplification is that the mass contained in the ICV is assumed - constant -- this is consistent with using an ideal compressor and an - ideal turbine with identical mass flows. Energy conservation is - ensured by using true bonds and \textbf{TF} components. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/ICV/ICV_lbl.txt @@ -1,34 +0,0 @@ -%SUMMARY ICV Inter-component volume for a gas turbine. -%DESCRIPTION Parameter 1 Thermal capacity (c) - -%% Label file for system ICV (ICV_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type CT - c lin effort,$1 - -% Component type SS - [Hy_in] external external - [Hy_out] external external - [T] external external - [Th_in] external external - [Th_out] external external - P external 0 - T external 0 - -% Component type hPipe - pipe none m_c;v_c;r - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_abg.fig @@ -1,56 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 2927 6977 2927 6752 3152 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 2926 4051 2926 3826 3151 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4051 2701 4051 3151 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1126 2925 2251 2925 2026 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 2026 4051 2026 3826 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4051 1801 4051 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1126 2025 2251 2025 2026 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 3826 4051 3826 3826 4051 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4051 3601 4051 4051 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1126 3825 2251 3825 2026 4050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 4949 4951 3824 5176 4049 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4726 3824 5176 3824 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4950 6749 4950 5624 5175 5849 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5850 2700 5850 3150 -4 1 4 0 0 22 20 0.0000 4 270 330 5670 3015 [5]\001 -4 1 1 1 0 22 20 0.0000 4 150 255 6437 2792 m\001 -4 0 4 0 0 22 20 0.0000 4 270 2055 7246 3016 SS:[MassFlow]\001 -4 1 -1 0 0 18 30 0.0000 4 345 600 5040 3060 R:r\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3466 2701 P\001 -4 1 4 0 0 22 20 0.0000 4 270 330 4320 2970 [2]\001 -4 1 -1 0 0 18 20 0.0000 4 210 405 2565 3060 AE\001 -4 2 4 0 0 22 20 0.0000 4 270 1005 1080 3015 SS:[P2]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3466 1801 P\001 -4 1 4 0 0 22 20 0.0000 4 270 330 4320 2070 [1]\001 -4 1 -1 0 0 18 20 0.0000 4 210 405 2565 2160 AE\001 -4 2 4 0 0 22 20 0.0000 4 270 1005 1080 2115 SS:[P1]\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3601 1981 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3601 2881 2\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6436 2566 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3421 3691 T\001 -4 1 4 0 0 22 20 0.0000 4 270 330 4320 3915 [3]\001 -4 1 -1 0 0 18 20 0.0000 4 210 405 2565 3915 AE\001 -4 2 4 0 0 22 20 0.0000 4 270 975 1080 3915 SS:[T1]\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3601 3781 1\001 -4 1 4 0 0 22 20 1.5708 4 270 330 5040 3555 [4]\001 -4 1 -1 0 0 18 20 1.5708 4 210 405 5040 5310 AE\001 -4 2 4 0 0 22 20 1.5708 4 270 1305 5040 6795 SS:[Area]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_cr.r Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_cr.r +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_cr.r @@ -1,27 +0,0 @@ -% Constitutive relation file for NozzleFlow (NozzleFlow_cr.r) -% Generated by PJG at Wed Apr 8 09:30 GMT 1998 - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -OPERATOR NozzleFlow; -% Ideal gas - but polytropic expansion -FOR ALL R, n, p1, p2, T1, A, Nothing -LET NozzleFlow(R,n,flow,5, - p1,effort,1, - p2,effort,2, - T1,effort,3, - A,effort,4, - Nothing,effort,5 - ) = A*p1*( (2*n/(n-1)) * (1/(R*T1)) * - ((p2/p1)^(2/n)) * (1 - (p2/p1)^(n-1/n) ) ^(1/2) - ); - -END; DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_desc.tex @@ -1,42 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system NozzleFlow (NozzleFlow_desc.tex) -% Generated by MTT on Thu Mar 19 13:24:59 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{NozzleFlow} is - displayed in Figure \Ref{NozzleFlow_abg} and its label - file is listed in Section \Ref{sec:NozzleFlow_lbl}. - -This 5 port component computes the mass flow in a polytropic -convergent nozzle from the formula: -\begin{equation} - \dot m = A p_1 \sqrt{\frac{2n}{n-1}\frac{1}{RT_1} - \left ( \frac{p_2}{p_1} \right )^\frac{2}{n} - \left [ 1- \left ( \frac{p_2}{p_1} \right )^\frac{n-1}{n} \right ] } -\end{equation} - -where: -\begin{itemize} -\item $n$ is the coefficient of polytropic expansion and -\item $R$ is the universal gas constant. -\end{itemize} - -If the expansion is isentropic -\begin{equation} - n=\gamma=\frac{c_p}{c_v} -\end{equation} -whre $c_p$ and $c_v$ are the spesicfic heats at constant pressure and volume. - -Typical values for air are -\begin{equation} - \begin{align} - R &= 287 \text{Nm}\text{kg}^{-1}{K}^{-1}\\ - \gamma &= 1.4 - \end{align} -\end{equation} DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_lbl.txt @@ -1,32 +0,0 @@ -%SUMMARY NozzleFlow Subsonic ideal gas nozzle flow with polytropic expansion -%DESCRIPTION Polytropic expansion coefficient n=gamma=c_p/c_v for isentropic expansion. - - -%ALIAS $1 R Ideal gas constant -%ALIAS $2 n Index of polytropic expansion - -%% Label file for system NozzleFlow (NozzleFlow_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type R - r NozzleFlow R,n - -% Component type SS - [Area] SS external,external - [MassFlow] SS external,external - [P1] SS external,external - [P2] SS external,external - [T1] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_rep.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_rep.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_rep.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/NozzleFlow/NozzleFlow_rep.txt @@ -1,22 +0,0 @@ -# Outline report file for system NozzleFlow (NozzleFlow_rep.txt) -# Generated by MTT on" Thursday September 24 09:49:01 BST 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt NozzleFlow abg tex # The system description - -# Uncomment the following lines or add others -mtt NozzleFlow ode tex # The system ode -# mtt NozzleFlow sspar tex # Steady-state parameters -# mtt NozzleFlow ss tex # Steady state -# mtt NozzleFlow sm tex # State matrices (of linearised system) -# mtt NozzleFlow lmfr ps # log modulus of frequency response (of linearised system) -# mtt NozzleFlow simpar tex # Simulation parameters -# mtt NozzleFlow numpar tex # Numerical simulation parameters -# mtt NozzleFlow input tex # Simulation input -# mtt NozzleFlow odeso ps # Simulation output DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_abg.fig @@ -1,49 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4727 2027 5852 2027 5627 2252 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5852 1802 5852 2252 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2026 4052 2026 3827 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4727 2702 5852 2702 5627 2927 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2701 4052 2701 3827 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4727 3377 5852 3377 5627 3602 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5852 3152 5852 3602 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 3376 4052 3376 3827 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7428 2703 8553 2703 8328 2928 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5850 2478 5850 2928 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9003 2700 10128 2700 9903 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8778 4050 8778 2925 9003 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8550 2925 8775 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8775 4050 9000 4050 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 13050 5625 135 5625 135 1125 13050 1125 13050 5625 -4 1 -1 0 0 18 20 0.0000 4 210 405 4366 2161 AE\001 -4 1 -1 0 0 18 20 0.0000 4 210 405 4366 2836 AE\001 -4 1 -1 0 0 18 20 0.0000 4 210 405 4366 3466 AE\001 -4 2 4 0 0 22 20 0.0000 4 270 2190 2881 2116 SS:[Pressure_1]\001 -4 2 4 0 0 22 20 0.0000 4 270 2190 2881 2791 SS:[Pressure_2]\001 -4 2 4 0 0 22 20 0.0000 4 270 2685 2881 3466 SS:[Temperature_1]\001 -4 1 -1 0 0 18 30 0.0000 4 345 600 6706 2836 R:r\001 -4 1 4 0 0 22 20 0.0000 4 270 330 6120 2790 [2]\001 -4 1 4 0 0 22 20 0.0000 4 270 330 6120 3465 [3]\001 -4 1 4 0 0 22 20 0.0000 4 270 330 6120 2115 [1]\001 -4 1 4 0 0 22 20 0.0000 4 270 330 7245 2790 [4]\001 -4 0 4 0 0 22 20 0.0000 4 270 2685 10260 2790 SS:[Temperature_2]\001 -4 1 -1 0 0 18 20 0.0000 4 210 1080 8775 4410 SS:zero\001 -4 1 -1 0 0 18 20 0.0000 4 195 150 8820 2790 1\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_cr.r Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_cr.r +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_cr.r @@ -1,19 +0,0 @@ -% Constitutive relation file for Poly (Poly_cr.r) -% Generated by MTT at Wed Mar 11 11:01:28 GMT 1998 - -OPERATOR Poly; - -% Ideal gas - -% Temperature output on port [T2] -FOR ALL COMPONENT, alpha,P1,P2,T1,Nothing -LET Poly(COMPONENT, alpha,effort,4, - P1,effort,1, - P2,effort,2, - T1,effort,3, - Nothing,flow,4 - ) = T1*(P2/P1)^alpha; - - - -END; DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_desc.tex @@ -1,37 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Poly (Poly_desc.tex) -% Generated by MTT on Thu Mar 19 13:24:59 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/03/31 15:05:33 peterg -% %% Spell checked -% %% -% %% Revision 1.2 1998/03/27 10:56:14 peterg -% %% Added bicausal bit -% %% -% %% Revision 1.1 1998/03/26 15:13:35 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Poly} is - displayed in Figure \Ref{Poly_abg} and its label - file is listed in Section \Ref{sec:Poly_lbl}. - -This four-port component computes the temperature following a -polytropic expansion using: -\begin{equation} - T_2 = T_1 \left ( \frac{P_2}{P_1} \right )^\alpha -\end{equation} -where $\alpha = \frac{n-1}{n}$ and $n$ is the coefficient of -polytropic expansion. This component imposes zero flow at all its -ports and therefore does not affect energy balance. - -The output is \emph{bicausal} as it imposes both $T_2$ and a zero flow. -This is implemented using the bicausal \textbf{SS} component labeled -``zero''. - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Poly/Poly_lbl.txt @@ -1,47 +0,0 @@ -%SUMMARY Poly - computes polytropic expansion temperature. -%DESCRIPTION Parameter: alpha = (n-1)/n (n = polytropic index) - -%DESCRIPTION This four-port component computes the temperature following -%DESCRIPTION a polytropic expansion using where alpha = (n-1)/n and n is -%DESCRIPTION the coefficient of polytropic expansion. This component -%DESCRIPTION imposes zero flow at all its ports and therefore does not -%DESCRIPTION affect energy balance. The output is bicausal as it -%DESCRIPTION imposes both T_2 and a zero flow. This is implemented using -%DESCRIPTION the bicausal SS component labeled ``zero''. - -%ALIAS P1 Pressure_1 -%ALIAS P2 Pressure_2 -%ALIAS T1 Temperature_1 -%ALIAS T2|out Temperature_2 - -%ALIAS $1 alpha - -%% Label file for system Poly (Poly_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/27 10:48:50 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type R - r Poly alpha - -% Component type SS - zero SS 0,0 - [Pressure_1] SS external,external - [Temperature_1] SS external,external - [Pressure_2] SS external,external - [Temperature_2] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_abg.fig @@ -1,89 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7203 2028 8778 2028 8553 2253 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 2026 6301 2026 6076 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5176 3151 6301 3151 6076 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2703 2028 4278 2028 4053 2253 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2656 3151 4683 3151 4458 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8776 3151 10803 3151 10578 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7201 3151 8326 3151 8101 3376 -2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 - 4501 1801 4501 901 6076 901 5851 1126 -2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 - 4951 2926 4951 1351 6076 1351 5851 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 7426 901 9001 901 9001 1801 9226 1576 -2 1 0 2 5 -1 0 0 -1 0.000 0 0 -1 0 0 4 - 8551 2926 8551 1351 7426 1351 7651 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6755 7969 6755 6844 6980 7069 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6754 6371 6754 5246 6979 5471 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6752 4751 6752 3626 6977 3851 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9228 2025 10803 2025 10578 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11704 2028 13279 2028 13054 2253 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9225 1800 10125 900 10125 1125 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 10013 788 10238 1013 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 15705 8550 15705 225 225 225 225 8550 15705 8550 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6525 7965 6975 7965 -4 2 4 0 0 0 20 0.0000 4 255 1935 2617 2122 SS:[Thermal_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 2085 2615 3245 SS:[Hydraulic_in]\001 -4 2 4 0 0 0 12 0.0000 4 180 540 6352 2437 [Th_in]\001 -4 2 4 0 0 0 12 0.0000 4 180 570 6397 3022 [Hy_in]\001 -4 0 4 0 0 0 12 0.0000 4 180 675 7252 3022 [Hy_out]\001 -4 0 4 0 0 0 12 0.0000 4 180 645 7252 2437 [Th_out]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 9047 2117 0\001 -4 1 1 1 0 3 30 0.0000 4 60 120 10181 3297 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 10181 2937 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 10181 3567 V\001 -4 1 1 1 0 3 20 0.0000 4 195 135 10316 3027 2\001 -4 0 4 0 0 0 20 0.0000 4 255 2235 10944 3250 SS:[Hydraulic_out]\001 -4 1 -1 0 0 22 20 0.0000 4 270 1305 6796 1261 Poly:poly\001 -4 2 4 0 0 22 12 0.0000 4 180 345 7291 856 [T2]\001 -4 2 4 0 0 22 12 0.0000 4 180 345 7336 1531 [P2]\001 -4 0 4 0 0 22 12 0.0000 4 180 345 6211 856 [T1]\001 -4 0 4 0 0 22 12 0.0000 4 180 345 6211 1531 [P1]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 8596 3286 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 4951 3286 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 4501 2161 0\001 -4 1 4 0 0 0 20 0.0000 4 240 1215 6755 8330 SS:[Shaft]\001 -4 1 1 1 0 32 30 0.0000 4 240 195 6530 7610 t\001 -4 1 1 1 0 32 30 0.0000 4 240 285 6980 7610 w\001 -4 1 4 0 0 0 12 0.0000 4 180 540 6751 3421 [Work]\001 -4 1 -1 0 0 22 20 0.0000 4 210 750 11250 2115 EBTF\001 -4 1 1 1 0 3 20 0.0000 4 195 165 12657 1767 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 12792 1857 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 12657 2397 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 12657 2127 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 12792 2532 2\001 -4 0 4 0 0 0 20 0.0000 4 255 2085 13375 2080 SS:[Thermal_out]\001 -4 1 -1 0 0 22 20 0.0000 4 270 1530 6754 2749 wPipe:pipe\001 -4 1 -1 0 0 22 20 0.0000 4 210 645 10305 765 SS:T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3157 3022 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3022 3292 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3022 2932 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 3022 3562 V\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3066 1806 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3201 1896 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3201 2571 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3066 2436 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3066 2166 .\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6755 6710 1\001 -4 1 -1 0 0 22 20 0.0000 4 270 915 6800 5090 TF:k_p\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_desc.tex @@ -1,46 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Pump (Pump_desc.tex) -% Generated by MTT on Fri Mar 20 15:53:12 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/04/01 08:09:06 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Pump} is - displayed in Figure \Ref{Pump_abg} and its label - file is listed in Section \Ref{sec:Pump_lbl}. - The subsystems are listed in Section \Ref{sec:Pump_sub}. - -\textbf{Pump} represents an ideal pumping component for compressible -or incompressible flow though a pipe, it may also be used as a turbine. - -The pump is ideal in the sense that the mass flow rate $\dot m$ -depends only on the shaft speed $\omega$: -\begin{equation} - \dot m = k_p \omega -\end{equation} - -It is implemented using three components: -\begin{itemize} -\item the ideal isentropic \textbf{wPipe} component which gives the - correct energy flows -\item the polytropic expansion \textbf{Poly} component which imposes - the correct temperature at the output of the pump. This component - imposes zero flow at all its ports and therefore does not affect - energy balance. It has a bicausal output imposing both the - temperature measured by the \textbf{SS} component ``T'' and a zero - flow. -\item the \emph{effort-bicausal transformer} \textbf{EBTF} - component. This component is an energy-conserving \textbf{TF} - component with non-standard causality. The modulus is determined by - the two imposed efforts ($T$ and $T_2$), and this modulus determines - the flows in the usual way. In particular, it makes sure that the - internal energy flowing from the pump to the following components - (imposing $T_2$) is correct. -\end{itemize} DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Pump/Pump_lbl.txt @@ -1,86 +0,0 @@ -%SUMMARY Pump Ideal pump component for compressible flow - -%DESCRIPTION Pump represents an ideal pumping component for compressible -%DESCRIPTION or incompressible flow though a pipe, it may also be used as a turbine. -%DESCRIPTION The pump is ideal in the sense that the mass flow rate -%DESCRIPTION depends only on the shaft speed. - -%DESCRIPTION Parameter 1: c_v - specific heat of fluid -%DESCRIPTION Parameter 2: Parameter passed to Density component -%DESCRIPTION Parameter 3: alpha = (n-1)/n, n coefficient of polytropic -%DESCRIPTION expansion. -%DESCRIPTION Parameter 4: k_p pump constant: mass flow = k_p*shaft speed - -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -%ALIAS Work Shaft - -%ALIAS $1 c_v -%ALIAS $2 density,ideal_gas,r -%ALIAS $3 alpha -%ALIAS $4 flow,k_p - -%ALIAS wPipe CompressibleFlow/wPipe -%ALIAS Poly CompressibleFlow/Poly - -%% Label file for system Pump (Pump_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.7 1998/07/04 08:39:58 peterg -% %% New-style SS -% %% -% %% Revision 1.6 1998/07/03 15:02:25 peterg -% %% Work alias added -% %% -% %% Revision 1.5 1998/07/03 14:43:24 peterg -% %% Added parameter aliases -% %% -% %% Revision 1.4 1998/07/02 19:46:19 peterg -% %% New aliases -% %% -% %% Revision 1.3 1998/07/02 10:55:54 peterg -% %% Lower case in out -% %% -% %% Revision 1.2 1998/07/02 10:52:33 peterg -% %% Added port aliases -% %% -% %% Revision 1.1 1998/04/07 15:23:30 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type wPipe - pipe none c_v;density,ideal_gas,r - -% Component type Poly - poly Poly alpha - -% Component type SS - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Shaft] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external - T SS external,0 - -% Component type TF - k_p lin flow,k_p - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_abg.fig @@ -1,110 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7650 3600 9680 3602 9455 3827 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9900 3825 9900 5850 10125 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1575 6300 4725 6300 4500 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6077 6301 7202 6301 6977 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7650 6299 9230 6302 9005 6527 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10575 6300 13725 6300 13500 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10125 3600 11700 3600 11475 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12150 3600 13725 3600 13500 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7425 3825 7425 4725 7650 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7425 6075 7425 5175 7650 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7425 2228 7425 3353 7650 3128 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 9675 9000 5625 9000 5625 1350 9675 1350 9675 9000 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 15525 9450 15525 675 90 675 90 9450 15525 9450 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 - 7650 6525 8775 7650 9945 7650 9945 6750 10170 6975 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 - 7200 6525 6030 7695 5400 7695 5400 6750 5625 6975 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7425 7657 7425 6532 7650 6757 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 3600 6300 3600 6075 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 3600 7200 3600 6975 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 3600 5175 3600 4950 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1575 3600 2925 3600 2700 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 3825 5400 4725 5625 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 5175 5400 5850 5625 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 4950 4275 4950 4500 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4275 4725 4275 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5175 4950 5175 5175 -4 1 1 1 0 3 20 0.0000000 4 210 150 2073 4143 1\001 -4 1 1 1 0 3 20 0.0000000 4 210 165 1938 4008 S\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 1938 3738 .\001 -4 1 -1 0 0 22 20 0.0000000 4 225 135 7426 3691 0\001 -4 1 1 1 0 3 20 0.0000000 4 210 165 13102 4012 S\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 13102 3742 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 13237 4147 2\001 -4 0 4 0 0 0 20 0.0000000 4 240 1500 13820 3695 SS:[Th_out]\001 -4 1 -1 0 0 22 20 0.0000000 4 225 135 9901 3691 0\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 2029 6169 1\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 1894 6439 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 1894 6079 P\001 -4 1 1 1 0 3 20 0.0000000 4 210 195 1894 6709 V\001 -4 2 4 0 0 0 20 0.0000000 4 270 1380 1442 6392 SS:[Hy_in]\001 -4 2 4 0 0 0 12 0.0000000 4 180 570 4680 6165 [Hy_in]\001 -4 1 -1 0 0 22 20 0.0000000 4 225 135 7427 6437 0\001 -4 2 4 0 0 0 12 0.0000000 4 180 570 9225 6165 [Hy_in]\001 -4 0 4 0 0 0 12 0.0000000 4 180 660 6076 6166 [Hy_out]\001 -4 1 -1 0 0 22 20 0.0000000 4 225 945 5401 6391 VM:v2m\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 13102 6488 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 13102 6128 P\001 -4 1 1 1 0 3 20 0.0000000 4 210 195 13102 6758 V\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 13237 6218 2\001 -4 0 4 0 0 0 20 0.0000000 4 270 1530 13865 6441 SS:[Hy_out]\001 -4 0 4 0 0 0 12 0.0000000 4 180 660 10531 6166 [Hy_out]\001 -4 1 -1 0 0 22 20 0.0000000 4 225 945 9901 6391 VM:m2v\001 -4 1 4 0 0 0 12 0.0000000 4 165 225 5402 6077 [T]\001 -4 1 4 0 0 0 12 0.0000000 4 165 225 5402 6617 [P]\001 -4 1 4 0 0 0 12 0.0000000 4 165 225 9902 6077 [T]\001 -4 1 4 0 0 0 12 0.0000000 4 165 225 9902 6617 [P]\001 -4 2 4 0 0 0 20 0.0000000 4 240 1350 1534 3694 SS:[Th_in]\001 -4 1 -1 0 0 22 20 0.0000000 4 225 330 11926 3691 ES\001 -4 1 4 0 0 0 12 0.0000000 4 165 195 11567 3332 [e]\001 -4 1 4 0 0 0 12 0.0000000 4 165 195 12242 3332 [s]\001 -4 1 -1 0 0 22 20 0.0000000 4 285 1290 7471 5041 Tankp:tank\001 -4 2 4 0 0 0 12 0.0000000 4 165 315 7200 4680 [Th]\001 -4 2 4 0 0 0 12 0.0000000 4 180 345 7245 5265 [Hy]\001 -4 1 1 1 0 3 20 0.0000000 4 270 2400 7425 8685 Pseudo bond graph\001 -4 1 4 0 0 0 20 0.0000000 4 270 1110 7426 2116 SS:[pTh]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1140 7426 7966 SS:[pHy]\001 -4 1 -1 0 0 22 20 0.0000000 4 225 330 6570 3690 AF\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 13102 3382 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 13237 3472 2\001 -4 1 4 0 0 0 12 0.0000000 4 165 195 2793 3378 [s]\001 -4 1 4 0 0 0 12 0.0000000 4 165 195 3423 3378 [e]\001 -4 1 -1 0 0 22 20 0.0000000 4 225 330 3150 3735 ES\001 -4 1 -1 0 0 22 20 0.0000000 4 225 135 5401 3691 1\001 -4 1 -1 0 0 22 20 0.0000000 4 225 135 5400 5085 0\001 -4 1 -1 0 0 22 20 0.0000000 4 225 900 3735 5040 SS:zero\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 4999 5674 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 5134 5764 1\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 1938 3378 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 2073 3468 1\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 10358 5454 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 10493 5544 2\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system Tank (Tank_desc.tex) -% Generated by MTT on Tue Jan 13 18:03:04 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Tank} is - displayed in Figure \Ref{Tank_abg} and its label - file is listed in Section \Ref{sec:Tank_lbl}. - The subsystems are listed in Section \Ref{sec:Tank_sub}. DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tank/Tank_lbl.txt @@ -1,51 +0,0 @@ -%SUMMARY Tank - thermal storage component for compressible fluids. -%DESCRIPTION Two port thermal storage component for compressible -%DESCRIPTION fluids -%DESCRIPTION Parameter 1 Passed to Tankp subcomponent -%DESCRIPTION Parameter 2 Parameter two of density component. -%DESCRIPTION Typical label file entry: -%DESCRIPTION % Component type Tank -%DESCRIPTION C1 none ideal_gas,r_g,c_p,v_t;r_g -%DESCRIPTION Port [Th_in]: Thermal flow bond (T/Sdot) -%DESCRIPTION Port [Th_out]: Thermal flow bond (T/Sdot) -%DESCRIPTION Port [Hy_in]: Hydraulic flow bond (P/Vdot) -%DESCRIPTION Port [Hy_out]: Hydraulic flow bond (P/Vdot) -%DESCRIPTION Port [pTh]: Thermal flow pseudo bond direct to tank (T/Edot) -%DESCRIPTION Port [pHy]: Hydraulic flow pseudo bond direct to tank (P/mdot) - -%% Label file for system Tank (Tank_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/26 09:00:26 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type SS - [Hy_in] external external - [Hy_out] external external - [pHy] external external - [pTh] external external - [Th_in] external external - [Th_out] external external - zero internal internal - -% Component type Tankp - tank none $1 - -% Component type VMe - v2m none density,$2 - m2v none specific_volume,$2 - - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_abg.fig @@ -1,20 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2926 3646 3376 3646 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2926 946 3376 946 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 947 3151 2072 3376 1847 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 3646 3151 2521 3376 2746 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 5850 4275 5850 225 225 225 225 4275 5850 4275 -4 1 -1 0 0 22 20 0.0000 4 210 870 3151 2431 C:tank\001 -4 1 4 0 0 0 20 0.0000 4 240 915 3150 765 SS:[Th]\001 -4 1 4 0 0 0 20 0.0000 4 255 930 3105 3960 SS:[Hy]\001 -4 1 4 0 0 0 20 0.0000 4 240 405 2836 2026 [in]\001 -4 1 4 0 0 0 20 0.0000 4 240 555 2791 2746 [out]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_cr.r Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_cr.r +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_cr.r @@ -1,35 +0,0 @@ -% Constitutive relation file for Tankp (Tankp_cr.r) -% Generated by MTT at Thu Mar 5 10:30:23 GMT 1998 - -OPERATOR Tankp; -%%%% Incompressible %%%% -%Temperature -FOR ALL c_p,c,StoredMass,StoredEnthalpy -LET Tankp(incompressible,c_p,c,effort,1, - StoredEnthalpy,state,1, - StoredMass,state,2 - ) = StoredEnthalpy/(StoredMass*c_p); - -%Pressure -FOR ALL c_p,c,StoredMass,StoredEnthalpy -LET Tankp(incompressible,c_p,c,effort,2, - StoredEnthalpy,state,1, - StoredMass,state,2 - ) = StoredMass/c; - -%%%% Ideal gas %%%% -%Temperature -FOR ALL R,c_p,Volume,StoredMass,StoredEnthalpy -LET Tankp(ideal_gas,R,c_p,Volume,effort,1, - StoredEnthalpy,state,1, - StoredMass,state,2 - ) = (StoredEnthalpy/(c_p*StoredMass)); - -%Pressure -FOR ALL R,c_p,Volume,StoredMass,StoredEnthalpy -LET Tankp(ideal_gas,R,c_p,Volume,effort,2, - StoredEnthalpy,state,1, - StoredMass,state,2 - ) = R*( ( (StoredEnthalpy/(c_p*StoredMass)))/(Volume/StoredMass) ); - -END; DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_desc.tex @@ -1,38 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Tankp (Tankp_desc.tex) -% Generated by MTT on Fri Mar 20 12:21:36 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Tankp} is - displayed in Figure \Ref{Tankp_abg} and its label - file is listed in Section \Ref{sec:Tankp_lbl}. - The subsystems are listed in Section \Ref{sec:Tankp_sub}. - -\textbf{Tankp} is a pseudo bond graph based model of a tank storing -(as the two states) -\begin{itemize} -\item enthalpy and -\item mass -\end{itemize} - -There are two versions: -\begin{itemize} -\item the incompressible version where the tank has a pressure-based - capacitance $c_t$ and -\item the ideal-gas version were the tank has a volume $v_t$ and $r$ - and $c_p$ are the universal gas constant and the specific heat respectively. -\end{itemize} - - - - - - - - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Tankp/Tankp_lbl.txt @@ -1,27 +0,0 @@ -%SUMMARY Tankp Pseudo bond graph model of a tank storing mass and enthalpy -%DESCRIPTION Parameter 1: EITHER -%DESCRIPTION incompressible,c OR -%DESCRIPTION ideal_gas,R,c_p,v_t - -%% Label file for system Tankp (Tankp_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - tank Tankp $1 - -% Component type SS - [Hy] external external - [Th] external external DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_abg.fig @@ -1,85 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6528 2028 8103 2028 7878 2253 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4051 2026 5626 2026 5401 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 3151 5626 3151 5401 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2028 2028 3603 2028 3378 2253 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1981 3151 4008 3151 3783 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8101 3151 10128 3151 9903 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6526 3151 7651 3151 7426 3376 -2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 - 3826 1801 3826 901 5401 901 5176 1126 -2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 - 4276 2926 4276 1351 5401 1351 5176 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 6751 901 8326 901 8326 1801 8551 1576 -2 1 0 2 5 -1 0 0 -1 0.000 0 0 -1 0 0 4 - 7876 2926 7876 1351 6751 1351 6976 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8553 2025 10128 2025 9903 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11029 2028 12604 2028 12379 2253 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8550 1800 9450 900 9450 1125 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9338 788 9563 1013 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 3619 6075 4744 6300 4519 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 5194 6075 6319 6300 6094 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 6994 6075 8119 6300 7894 -4 2 4 0 0 0 12 0.0000 4 180 540 5677 2437 [Th_in]\001 -4 2 4 0 0 0 12 0.0000 4 180 570 5722 3022 [Hy_in]\001 -4 0 4 0 0 0 12 0.0000 4 180 675 6577 3022 [Hy_out]\001 -4 0 4 0 0 0 12 0.0000 4 180 645 6577 2437 [Th_out]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 8372 2117 0\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9506 3297 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9506 2937 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 9506 3567 V\001 -4 1 1 1 0 3 20 0.0000 4 195 135 9641 3027 2\001 -4 0 4 0 0 0 20 0.0000 4 255 1440 10269 3250 SS:[Hydraulic_out]\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2482 3022 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2347 3292 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2347 2932 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 2347 3562 V\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2391 1806 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2526 1896 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2526 2571 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2391 2436 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2391 2166 .\001 -4 2 4 0 0 0 20 0.0000 4 255 1290 1895 3245 SS:[Hydraulic_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1275 1942 2077 SS:[Thermal_in]\001 -4 1 -1 0 0 22 20 0.0000 4 270 1305 6121 1261 Poly:poly\001 -4 2 4 0 0 22 12 0.0000 4 180 345 6616 856 [T2]\001 -4 2 4 0 0 22 12 0.0000 4 180 345 6661 1531 [P2]\001 -4 0 4 0 0 22 12 0.0000 4 180 345 5536 856 [T1]\001 -4 0 4 0 0 22 12 0.0000 4 180 345 5536 1531 [P1]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 7921 3286 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 4276 3286 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3826 2161 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6080 5090 1\001 -4 1 1 1 0 32 30 0.0000 4 240 195 5855 7610 t\001 -4 1 1 1 0 32 30 0.0000 4 240 285 6305 7610 w\001 -4 1 -1 0 0 22 20 0.0000 4 210 750 10575 2115 EBTF\001 -4 1 1 1 0 3 20 0.0000 4 195 165 11982 1767 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 12117 1857 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 11982 2397 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 11982 2127 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 12117 2532 2\001 -4 0 4 0 0 0 20 0.0000 4 255 1425 12700 2080 SS:[Thermal_out]\001 -4 1 -1 0 0 22 20 0.0000 4 270 1530 6079 2749 wPipe:pipe\001 -4 1 -1 0 0 22 20 0.0000 4 210 645 9630 765 SS:T\001 -4 1 -1 0 0 22 20 0.0000 4 270 825 6080 6755 TF:k_t\001 -4 1 4 0 0 0 20 0.0000 4 240 1215 6120 8460 SS:[Shaft]\001 -4 1 4 0 0 0 12 0.0000 4 180 495 6076 3421 [Work]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_desc.tex @@ -1,21 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Turb (Turb_desc.tex) -% Generated by MTT on Fri Mar 20 15:53:12 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Turb} is - displayed in Figure \Ref{Turb_abg} and its label - file is listed in Section \Ref{sec:Turb_lbl}. - The subsystems are listed in Section \Ref{sec:Turb_sub}. - -\textbf{Turb} represents an ideal turbine component for compressible -or incompressible flow though a pipe. - -It is identical to the \textbf{Pump} component (which has a more -complete description) exept for the direction of work flow. DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/Turb/Turb_lbl.txt @@ -1,72 +0,0 @@ -%SUMMARY Turb Ideal turbine component for compressible flow -%DESCRIPTION Parameter 1: c_p - specific heat of fluid -%DESCRIPTION Parameter 2: Parameter passed to Density component -%DESCRIPTION Parameter 3: alpha = (n-1)/n, n coefficient of polytropic -%DESCRIPTION expansion. -%DESCRIPTION Parameter 4: k_t pump constant: mass flow = k_t*shaft speed - -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -%ALIAS $1 c_p -%ALIAS $2 ideal_gas,r -%ALIAS $3 alpha -%ALIAS $4 effort,k - -%% Label file for system Turb (Turb_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.5 1998/07/03 10:12:18 peterg -% %% New aliased parameter form -% %% -% %% Revision 1.4 1998/07/02 19:48:45 peterg -% %% Changed aliases -% %% -% %% Revision 1.3 1998/07/02 10:55:24 peterg -% %% Lower case in out -% %% -% %% Revision 1.2 1998/07/02 10:51:10 peterg -% %% Added port aliases -% %% -% %% Revision 1.1 1998/04/07 15:21:02 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type Pipe - pipe none c_p;ideal_gas,r - -% Component type Poly - poly Poly alpha - -% Component type SS - [Hydraulic_in] external external - [Hydraulic_out] external external - [Shaft] external external - [Thermal_in] external external - [Thermal_out] external external - T external 0 - -% Component type TF - k_t lin effort,k - - - - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_abg.fig @@ -1,47 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5143 4050 6088 3105 6088 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 2488 1822 5210 1822 6110 2722 5840 2722 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6313 4500 6313 3150 6538 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6538 3150 7438 4050 7213 4050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2445 4052 4020 4052 3795 4277 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8564 4052 10139 4052 9914 4277 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 6538 2700 7438 1800 10138 1800 9913 2025 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 13050 4950 45 4950 45 450 13050 450 13050 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6165 3105 6435 3105 -4 1 -1 0 0 22 20 0.0000 4 195 150 6315 3017 0\001 -4 1 1 1 0 3 20 0.0000 4 195 510 5865 3872 mp v\001 -4 1 1 1 0 3 20 0.0000 4 195 330 6043 4050 1 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 5729 3691 .\001 -4 1 1 1 0 3 20 0.0000 4 195 510 6675 3872 mp v\001 -4 1 1 1 0 3 20 0.0000 4 195 330 6853 4050 2 2\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6539 3691 .\001 -4 2 4 0 0 22 20 0.0000 4 270 2355 2399 4141 SS:[Hydraulic_in]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2805 3782 P\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2941 4683 1\001 -4 1 1 1 0 3 20 0.0000 4 195 195 2806 4548 V\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2805 4277 .\001 -4 2 4 0 0 22 20 0.0000 4 270 2145 2355 1892 SS:[Thermal_in]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2894 1531 T\001 -4 0 4 0 0 22 20 0.0000 4 270 2550 10319 4187 SS:[Hydraulic_out]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9689 3783 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 9600 4458 V\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9599 4187 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 9735 4593 2\001 -4 0 4 0 0 22 20 0.0000 4 270 2340 10365 1892 SS:[Thermal_out]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9734 1532 T\001 -4 1 -1 0 0 22 20 0.0000 4 210 945 4558 4185 TF:P2T\001 -4 1 -1 0 0 22 20 0.0000 4 210 945 8068 4140 TF:T2P\001 -4 1 4 0 0 22 20 0.0000 4 270 1290 6359 4771 SS:[Heat]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_desc.tex @@ -1,31 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system hPipe (hPipe_desc.tex) -% Generated by MTT on Tue Mar 31 09:54:08 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{hPipe} is - displayed in Figure \Ref{hPipe_abg} and its label - file is listed in Section \Ref{sec:hPipe_lbl}. - The subsystems are listed in Section \Ref{sec:hPipe_sub}. - - -\textbf{hPipe} represents an ideal (energy conserving) pipe carrying a -fluid with heat transfer. To ensure energy conservation, power bonds are used and -connected by (energy conserving) \textbf{TF} components. -It is assumed that the working fluid is an ideal gas (gas constant $r$) and that a mass -$m_t$ is stored within pipe with a volume $v_t$. - -The central \textbf{0} junction carries temperature ($T$) and the two -hydraulic ports are connected to this by appropriate transformers. -The modulus of the \textbf{TF} component labeled ``P2T'' is such P and -T are related by the ideal gas law -\begin{equation} - P = \frac{Rm_t}{v_t} T -\end{equation} - DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/hPipe/hPipe_lbl.txt @@ -1,59 +0,0 @@ -%SUMMARY hPipe: Pipe for compressible fluid with heat transfer and heat storage. - -%DESCRIPTION hPipe represents an ideal (energy conserving) pipe carrying a -%DESCRIPTION fluid with heat transfer. To ensure energy conservation, power bonds are used and -%DESCRIPTION connected by (energy conserving) TF components. -%DESCRIPTION It is assumed that the working fluid is an ideal gas (gas constant r) and that a mass -%DESCRIPTION m_t is stored within pipe with a volume v_t. - -%DESCRIPTION Parameter 1: m_t (mass in pipe) -%DESCRIPTION Parameter 2: v_t (volume of pipe) -%DESCRIPTION Parameter 3: r (gas constant) -%DESCRIPTION Typical lable entry -%DESCRIPTION % Component type hPipe -%DESCRIPTION pipe none m_p;v_p;r - -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -%ALIAS $1 m -%ALIAS $2 v -%ALIAS $3 r - - - -%% Label file for system hPipe (hPipe_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/07/03 17:38:32 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type SS - [Heat] SS external,external - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external - -% Component type TF - P2T lin flow,r*m/v - T2P lin effort,r*m/v DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_abg.fig @@ -1,108 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1666 3781 3241 3781 3016 4006 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3691 3781 4591 3781 4366 4006 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3466 1756 3466 2431 3691 2206 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3466 3556 3466 2881 3691 3106 -2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 - 4366 2656 5491 2656 5491 3331 5716 3106 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6392 1532 7292 2432 7022 2432 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7742 2882 8642 3782 8372 3782 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7764 2454 8664 1554 8664 1824 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6392 3782 7292 2882 7292 3152 -2 1 0 2 5 7 0 0 -1 0.000 0 0 -1 0 0 4 - 10666 2658 9766 2658 9766 3333 9993 3106 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11566 1758 11566 2433 11791 2208 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11566 3558 11566 2883 11791 3108 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9766 1531 11341 1531 11116 1756 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1666 1531 3241 1531 3016 1756 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3691 1531 5266 1531 5041 1756 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11836 1533 13411 1533 13186 1758 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11791 3781 13366 3781 13141 4006 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10411 3781 11311 3781 11086 4006 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7515 4275 7516 3106 7741 3331 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7515 5895 7516 4726 7741 4951 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 16200 6300 45 6300 45 180 16200 180 16200 6300 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7335 5895 7695 5895 -4 2 4 0 0 22 20 0.0000 4 270 2355 2430 3915 SS:[Hydraulic_in]\001 -4 2 4 0 0 22 20 0.0000 4 270 2145 2476 1666 SS:[Thermal_in]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3466 1621 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3466 3916 0\001 -4 1 4 0 0 22 12 0.0000 4 180 405 4186 2521 [rho]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 7517 2792 1\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 11566 1623 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 11566 3918 0\001 -4 1 4 0 0 22 12 0.0000 4 180 405 10846 2523 [rho]\001 -4 1 4 0 0 22 12 0.0000 4 180 495 9766 3558 [mod]\001 -4 1 -1 0 0 22 20 0.0000 4 210 840 5851 1621 TF:t2u\001 -4 1 -1 0 0 22 20 0.0000 4 270 1515 5536 3916 EMTF:p2pv\001 -4 1 4 0 0 22 12 0.0000 4 180 495 5491 3601 [mod]\001 -4 2 4 0 0 22 12 0.0000 4 180 240 3331 3016 [P]\001 -4 2 4 0 0 22 12 0.0000 4 180 240 3331 2386 [T]\001 -4 2 4 0 0 22 12 0.0000 4 180 240 11431 2386 [T]\001 -4 2 4 0 0 22 12 0.0000 4 180 240 11431 3016 [P]\001 -4 0 4 0 0 22 20 0.0000 4 270 2340 13591 1621 SS:[Thermal_out]\001 -4 0 4 0 0 22 20 0.0000 4 270 2550 13546 3916 SS:[Hydraulic_out]\001 -4 1 4 0 0 22 12 0.0000 4 180 270 4816 3601 [in]\001 -4 1 4 0 0 22 12 0.0000 4 180 405 6301 3601 [out]\001 -4 1 4 0 0 22 12 0.0000 4 180 405 10441 3556 [out]\001 -4 1 4 0 0 22 12 0.0000 4 180 270 8911 3556 [in]\001 -4 1 -1 0 0 22 20 0.0000 4 210 840 9316 1621 TF:u2t\001 -4 1 -1 0 0 22 20 0.0000 4 270 1515 9631 3871 EMTF:pv2p\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2161 3646 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2026 3511 P\001 -4 1 1 1 0 3 20 0.0000 4 195 165 12960 1261 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 13095 1396 2\001 -4 1 1 1 0 3 20 0.0000 4 195 135 13051 3647 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 12916 3512 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 12827 4187 V\001 -4 1 1 1 0 3 30 0.0000 4 60 120 12826 3916 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 12962 4322 2\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2162 4412 1\001 -4 1 1 1 0 3 20 0.0000 4 195 195 2027 4277 V\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2026 4006 .\001 -4 1 1 1 0 3 20 0.0000 4 135 210 6841 3736 m\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6841 3511 .\001 -4 1 1 1 0 3 20 0.0000 4 135 210 8101 3691 m\001 -4 1 1 1 0 3 30 0.0000 4 60 120 8101 3466 .\001 -4 1 1 1 0 3 20 0.0000 4 135 210 6570 2295 m\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6570 2070 .\001 -4 1 1 1 0 3 20 0.0000 4 135 210 8461 2341 m\001 -4 1 1 1 0 3 30 0.0000 4 60 120 8461 2116 .\001 -4 1 1 1 0 3 20 0.0000 4 135 150 7922 1847 u\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8057 1982 2\001 -4 1 1 1 0 3 20 0.0000 4 195 300 6482 3062 p v\001 -4 1 1 1 0 3 20 0.0000 4 195 330 6570 3240 1 1\001 -4 1 1 1 0 3 20 0.0000 4 195 300 8372 3063 p v\001 -4 1 1 1 0 3 20 0.0000 4 195 330 8460 3241 2 2\001 -4 1 -1 0 0 22 20 0.0000 4 270 1725 3511 2791 Density:rho1\001 -4 1 -1 0 0 22 20 0.0000 4 270 1725 11521 2793 Density:rho2\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7246 1981 1\001 -4 1 1 1 0 3 20 0.0000 4 135 150 7111 1846 u\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2115 1260 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2250 1395 1\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 7517 4592 1\001 -4 1 4 0 0 22 20 0.0000 4 270 1380 7516 6211 SS:[Shaft]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_desc.tex @@ -1,44 +0,0 @@ -% Verbal description for system wPipe (wPipe_desc.tex) -% Generated by MTT on Mon Mar 9 09:11:22 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{wPipe} is - displayed in Figure \Ref{wPipe_abg} and its label - file is listed in Section \Ref{sec:wPipe_lbl}. - The subsystems are listed in Section \Ref{sec:wPipe_sub}. - -\textbf{wPipe} represents an ideal (energy conserving) pipe carrying a -fluid with work transfer. To ensure energy conservation, power bonds are used and -connected by (energy conserving) \textbf{TF} components. - -The central \textbf{1} junction carries mass flow ($\dot m$) and the -four ports are connected to this by appropriate transformers. In the -case of the hydraulic ports, these transformers are \emph{modulated} -by the corresponding fluid density. -The bonds impinging on this \textbf{1} junction carry the -corresponding effort variables; in particular, the thermal bonds carry -specific internal energy $u$ and the hydraulic bonds carry $Pv$ where -$P$ is the pressure and $v$ the specific volume. - -The ports ``Work\_in'' and ``Work\_out'' are convenient for attaching -(for example) the shadt work of a pump, turbine or compressor. - -The ports are -\begin{itemize} -\item [Hy\_in] Pressure/volume-flow inflow -\item [Hy\_in] Pressure/volume-flow outflow -\item [Th\_in] Temperature/Entropy-flow in flow -\item [Th\_out] Temperature/Entropy-flow out flow -\item [Shaft] Torque/angular velocity input. -\end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CompressibleFlow/wPipe/wPipe_lbl.txt @@ -1,76 +0,0 @@ -%SUMMARY wPipe Isentropic pipe with work transfer. - -%DESCRIPTION wPipe represents an ideal (energy conserving) pipe carrying a -%DESCRIPTION fluid with work transfer. To ensure energy conservation, power bonds are used and -%DESCRIPTION connected by (energy conserving) TF components. - -%DESCRIPTION Parameter 1: c_v - specific heat of fluid -%DESCRIPTION Parameter 2: Parameter passed to Density component -%DESCRIPTION Ports: - -%DESCRIPTION [Hy_in] Pressure/volume-flow inflow -%DESCRIPTION [Hy_in] Pressure/volume-flow outflow -%DESCRIPTION [Th_in] Temperature/Entropy-flow in flow -%DESCRIPTION [Th_out] Temperature/Entropy-flow out flow -%DESCRIPTION [Shaft] Torque/angular velocity input. - -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -%ALIAS Work Shaft - -%ALIAS $1 c_v -%ALIAS $2 density,ideal_gas,r - -%ALIAS Density CompressibleFlow/Density - -%% Label file for system wPipe (wPipe_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/07/04 08:33:30 peterg -% %% New-style SS -% %% -% %% Revision 1.1 1998/07/03 17:38:20 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type Density - rho1 none density,ideal_gas,r - rho2 none density,ideal_gas,r - -% Component type EMTF - p2pv lin flow - pv2p lin effort - -% Component type SS - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Shaft] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external - -% Component type TF - t2u lin effort,c_v - u2t lin flow,c_v - - - - DELETED mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_abg.fig @@ -1,64 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4051 1351 5176 1351 4951 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5401 1576 5401 2701 5626 2476 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5401 3151 5401 4276 5626 4051 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2251 4501 5176 4501 4951 4726 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 6751 1351 6526 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 1351 8551 1351 8326 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9226 1350 10351 1350 10126 1575 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 8370 2925 4275 2925 4275 630 8370 630 8370 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2206 1351 3331 1351 3106 1576 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11925 6075 11925 225 675 225 675 6075 11925 6075 -4 1 -1 0 0 22 20 0.0000 4 210 390 3736 1441 ES\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 5401 1441 1\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 5401 4636 1\001 -4 1 -1 0 0 22 20 0.0000 4 270 1215 5401 3061 FMR:c_p\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2657 4682 .\001 -4 1 1 1 0 3 20 0.0000 4 135 210 2657 4952 m\001 -4 1 4 0 0 0 20 0.0000 4 240 285 3466 1126 [s]\001 -4 1 4 0 0 0 20 0.0000 4 240 300 4006 1126 [e]\001 -4 1 1 1 0 3 20 0.0000 4 195 135 4592 1262 1\001 -4 1 1 1 0 3 20 0.0000 4 195 615 4770 1080 T - T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 5085 1260 0\001 -4 1 1 1 0 3 20 0.0000 4 195 180 4683 1803 E\001 -4 1 1 1 0 3 30 0.0000 4 60 120 4683 1533 .\001 -4 1 1 1 0 3 20 0.0000 4 195 180 6079 1804 E\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6079 1534 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 6120 1125 0\001 -4 1 -1 0 0 22 20 0.0000 4 210 390 7111 1441 AF\001 -4 1 -1 0 0 22 20 0.0000 4 210 390 8911 1441 ES\001 -4 1 1 1 0 3 20 0.0000 4 195 180 7832 1803 E\001 -4 1 4 0 0 0 20 0.0000 4 240 300 8641 1081 [e]\001 -4 1 4 0 0 0 20 0.0000 4 240 285 9136 1081 [s]\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7832 1533 .\001 -4 1 1 1 0 3 20 0.0000 4 195 615 7922 1082 T - T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8237 1262 0\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7744 1264 2\001 -4 1 1 1 0 3 20 0.0000 4 270 2340 6930 2340 Pseudo Bond Graph\001 -4 2 4 0 0 0 20 0.0000 4 240 1200 2160 4590 SS:[Mdot]\001 -4 2 4 0 0 0 20 0.0000 4 255 1275 2072 1442 SS:[Th_in]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2611 1171 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2746 1261 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2746 1936 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2611 1801 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2611 1531 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9590 1220 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 9725 1310 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9590 1850 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9590 1580 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 9725 1985 2\001 -4 0 4 0 0 0 20 0.0000 4 255 1425 10443 1443 SS:[Th_out]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_desc.tex @@ -1,47 +0,0 @@ -% Verbal description for system Conv (Conv_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:53 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/03/09 10:19:43 peterg -% %% Added note about energy consevation. -% %% -% %% Revision 1.1 1998/03/09 10:13:27 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Conv} is - displayed in Figure \Ref{Conv_abg} and its label - file is listed in Section \Ref{sec:Conv_lbl}. - The subsystems are listed in Section \Ref{sec:Conv_sub}. - -The \textbf{Conv} component represents one way isenentropic flow of -fluid though a pipe. Externally, it has true energy bonds: $P$/$\dot V$ -(Pressure/volume-flow) representing hydraulic energy and $T$/$\dot -S$(Temperature/Entropy-flow) representing convected thermal energy. - -Internally, however, the thermal part is represented by a pseudo bond -graph which computes the flow of internal energy $\dot E$ from the -upstream temperature $T_1$ and the mass flow rate $\dot m$ as: -\begin{equation} - \dot E = c_p T_1 \dot m -\end{equation} -The $AF$ component makes the $FMR$ component use $T_1$ rather than -$T_1-T_2$. - -The two \textbf{ES} components provide the conversion from true to -psuedo thermal bonds and vice versa. - -%The pipe has an resistance to flow represented by the \textbf{RS} -%component labeled `r' which can be linear or nonlinear. The hydraulic -%energy loss reappears on the thermal bond of this (energy-conserving) -%\textbf{RS} component. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/Conv/Conv_lbl.txt @@ -1,27 +0,0 @@ -%SUMMARY Conv Convection of heat through a pipe -%DESCRIPTION Parameter 1: Specific heat of fluid (c_p) - -%% Label file for system Conv (Conv_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type FMR - c_p lin effort,$1 - -% Component type SS - [Hy_in] SS external,external - [Hy_out] SS external,external - [Th_in] SS external,external - [Th_out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_abg.fig @@ -1,77 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 1800 6750 1800 6525 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 2025 5175 3375 5400 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3825 5175 5175 5400 4950 -2 2 0 3 1 7 1 0 -1 0.000 1 0 -1 0 0 5 - 6075 900 9000 900 9000 2700 6075 2700 6075 900 -2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 - 8325 900 8550 900 8550 2700 8325 2700 8325 900 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10125 3825 10125 5175 10350 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 1800 9900 1800 9675 2025 -2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 - 8550 1665 9585 1665 9585 1935 8550 1935 8550 1665 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 4725 1440 5805 1440 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 9675 1440 10755 1440 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 7785 3465 8415 2835 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 1800 4950 1800 4725 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1755 1800 3105 1800 2880 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 2025 3375 5175 3600 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3150 5175 3600 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10350 1800 11700 1800 11475 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12150 1800 13500 1800 13275 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 11700 5175 12150 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11925 2025 11925 5175 12150 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10125 2025 10125 3375 10350 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 2025 5400 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 2025 10350 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 5175 10350 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 5175 5400 5175 -4 1 -1 0 0 0 20 0.0000 4 255 855 7290 1890 CU:gas\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5175 1890 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 1590 5175 3690 INTF:entropy\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 10125 1890 1\001 -4 1 1 1 0 3 20 0.0000 4 270 1035 7200 1440 Ideal gas\001 -4 1 1 1 0 3 20 0.0000 4 210 885 4635 1305 Heat in\001 -4 1 1 1 0 3 20 0.0000 4 210 1080 10170 1305 Work out\001 -4 1 1 1 0 3 20 0.0000 4 270 1800 5130 5895 Entropy change\001 -4 1 1 1 0 3 20 0.0000 4 270 1365 7110 3690 Ideal piston\001 -4 1 -1 0 0 0 20 0.0000 4 195 1560 10125 3690 INTF:volume\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 3375 1890 0\001 -4 2 4 0 0 0 20 0.0000 4 240 1140 1575 1890 SS:[Heat]\001 -4 1 -1 0 0 0 20 0.0000 4 195 585 3375 5490 SS:T\001 -4 1 1 1 0 3 20 0.0000 4 255 1485 3240 5895 Temperature\001 -4 1 -1 0 0 0 20 0.0000 4 195 570 5130 5490 SS:S\001 -4 1 -1 0 0 0 20 0.0000 4 195 615 10125 5490 SS:V\001 -4 1 -1 0 0 0 20 0.0000 4 195 570 11880 5490 SS:P\001 -4 0 4 0 0 0 20 0.0000 4 240 1230 13680 1890 SS:[Work]\001 -4 1 1 1 0 3 20 0.0000 4 270 1815 10080 5850 Volume change\001 -4 1 1 1 0 3 20 0.0000 4 195 975 11925 5850 Pressure\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 11925 1890 0\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_desc.tex @@ -1,71 +0,0 @@ -% Verbal description for system Cycle (Cycle_desc.tex) -% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/06/30 12:46:24 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/12/08 09:37:04 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Cycle} is - displayed in Figure \Ref{Cycle_abg} and its label - file is listed in Section \Ref{sec:Cycle_lbl}. - The subsystems are listed in Section \Ref{sec:Cycle_sub}. - -The system has two heat engine ports: -\begin{enumerate} -\item \textbf{[Heat]} and -\item \textbf{[Work]} -\end{enumerate} -By convention, energy flows in to the \textbf{[Heat]} port and out of -the \textbf{[Work]} port. Both ports are true energy ports. - - -The subsystem \textbf{CU} (Section \Ref{sec:CU}) is a two-port -component describing an ideal gas. It has two energy ports which, with -integral causality correspond to -\begin{enumerate} -\item Entropy flow in; temperature out -\item Volume rate of change in; pressure out -\end{enumerate} - -Four \textbf{SS} components are set up as sensors to measure the -important quantities pertaining to the cycle: -\begin{enumerate} -\item \textbf{S} to measure the integrated entropy flow -\item \textbf{T} to measure the (absolute) temperature -\item \textbf{V} to measure the integrated volume change -\item \textbf{P} to measure the pressure -\end{enumerate} - - \begin{table}[htbp] - \begin{center} - \leavevmode - \begin{tabular}{|l|l|l|l|l|} - \hline - Cycle & Compression & Heating & Expansion & Cooling \\ - \hline - Otto & II & II & II & II \\ - Carnot & II & DI & II & DI \\ - Diesel & II & ID & II & II \\ - Joule & II & ID & II & ID \\ - \hline - \end{tabular} - \caption{Cycles and their causality} - \label{tab:cycles} - \end{center} - \end{table} - - A number of cycles can be built depending on the causality of the - two ports \textbf{[Heat]} and \textbf{[Work]} of \textbf{Cycle} - Some possible cycles listed in Tables \Ref{tab:cycles} where each - table entry gives the causality on the heat and work ports - respectively. - DELETED mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_lbl.txt @@ -1,54 +0,0 @@ -#SUMMARY Cycle: Closed cycle with ideal gas -#DESCRIPTION Uses the CU two-port thermal capacitor. - -#ALIAS in Heat -#ALIAS out Work - -#ALIAS $1 ideal_gas -#ALIAS $2 c_v -#ALIAS $3 gamma_g -#ALIAS $4 m_g - -## Label file for system Cycle (Cycle_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.2 1998/07/21 14:21:04 peterg -# ## New style file -# ## -# ## Revision 1.1 1997/12/08 20:24:43 peterg -# ## Initial revision -# ## -# ## Revision 1.1 1997/12/07 20:38:05 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - - -# Component type CU - gas CU ideal_gas,c_v,gamma_g,m_g - -# Component type INTF - entropy - volume - -# Component type SS - S SS external,0 - T SS external,0 - V SS external,0 - P SS external,0 - [Heat] SS external,external - [Work] SS external,external - - - DELETED mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_simp.r Index: mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_simp.r ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_simp.r +++ mttroot/mtt/lib/comp/compound/Thermal/Cycle/Cycle_simp.r @@ -1,10 +0,0 @@ -%% Reduce commands to simplify output for system Cycle (Cycle_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_abg.fig @@ -1,53 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 2701 5625 2701 5400 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 2701 7425 2701 7200 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 2476 5850 1126 6075 1351 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11475 3600 450 3600 450 451 11475 451 11475 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 2701 3375 2701 3150 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 2701 9675 2701 9450 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 900 5625 900 5400 1125 -4 1 -1 0 0 0 20 0.0000 4 195 150 5850 2791 1\001 -4 1 4 0 0 0 20 0.0000 4 255 360 4410 2476 [p]\001 -4 1 4 0 0 0 20 0.0000 4 255 360 7290 2476 [p]\001 -4 1 1 1 0 3 20 0.0000 4 255 225 5040 3106 Q\001 -4 1 1 1 0 3 30 0.0000 4 60 120 5085 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 180 5040 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 255 225 6615 3106 Q\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6660 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 180 6615 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 150 6795 2611 2\001 -4 1 1 1 0 3 20 0.0000 4 195 150 5220 2611 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 825 3825 2790 FP:fp1\001 -4 2 4 0 0 0 20 0.0000 4 255 870 1980 2790 SS:[in]\001 -4 1 4 0 0 0 20 0.0000 4 240 315 3285 2476 [f]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 3106 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2520 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 180 2475 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 150 2610 2611 1\001 -4 1 1 1 0 3 20 0.0000 4 195 150 2610 3241 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 825 7920 2790 FP:fp2\001 -4 1 4 0 0 0 20 0.0000 4 240 315 8505 2476 [f]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9090 3106 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9135 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 180 9090 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 150 9270 3241 2\001 -4 1 1 1 0 3 20 0.0000 4 195 150 9270 2611 2\001 -4 0 4 0 0 0 20 0.0000 4 255 1020 9810 2791 SS:[out]\001 -4 0 -1 0 0 0 20 0.0000 4 195 825 5850 990 FMR:r\001 -4 2 4 0 0 0 20 0.0000 4 255 1170 4185 990 SS:[mod]\001 -4 1 4 0 0 0 20 0.0000 4 255 750 5400 765 [mod]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_desc.tex @@ -1,11 +0,0 @@ -Component \textbf{FMRT} is a two port thermal resistor with true power -bonds. Internally, it has a pseudo Bond Graph representation, and the -corresponding thermal resistance just acts as an ordinary one-port -\textbf{R} component. - -The resistance $r$ is modulated by a flow variable $f$ on the [mod] port -so that the {\em conductance\/} $\sigma$ is: -\begin{equation} - \sigma = \frac{f}{r} -\end{equation} - DELETED mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/FMRT/FMRT_lbl.txt @@ -1,68 +0,0 @@ -#SUMMARY FMRT: Two port thermal resistance with T/Sdot bonds with flow modulation -#DESCRIPTION Port [in]: T/Sdot power in -#DESCRIPTION Port [out]: T/Sdot power out -#DESCRIPTION CR and parameters as for a one-port R component -#DESCRIPTION Internally pseudo bond graph -#DESCRIPTION Example label file entry: -#DESCRIPTION # Component type RT -#DESCRIPTION r lin flow,r - -#ALIAS ThermalIn in -#ALIAS ThermalOut out -#ALIAS Modulation mod - -#ALIAS $1 flow,r -#ALIAS $1 lin - - -## Label file for system FMRT (FMRT_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.8 2001/07/05 08:42:41 gawthrop -# ## Updated to allow auto-generation of sensitivity version -# ## -# ## Revision 1.7 2001/07/03 22:59:10 gawthrop -# ## Fixed problems with argument passing for CRs -# ## -# ## Revision 1.6 2001/06/13 17:10:26 gawthrop -# ## Alias for the cr (ie ALIAS $1 lin) -# ## -# ## Revision 1.5 2001/06/11 19:51:08 gawthrop -# ## Zapped spurious $1 alias -# ## -# ## Revision 1.4 1998/07/22 11:31:42 peterg -# ## New port names -# ## -# ## Revision 1.3 1998/07/21 16:26:05 peterg -# ## Now has aliased parameters. -# ## -# ## Revision 1.2 1998/06/29 10:08:14 peterg -# ## Converted to FP component -# ## Removed lables from FP -# ## -# ## Revision 1.1 1997/09/04 09:48:47 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - -# Component type FMR - r lin flow,r - -# Component type FP - fp1 - fp2 - -# Component type SS - [in] SS external,external - [out] SS external,external - [mod] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_abg.fig @@ -1,84 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2715 1351 3840 1351 3615 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4515 1351 5640 1351 5415 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5865 1576 5865 2701 6090 2476 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5865 3151 5865 4276 6090 4051 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2715 4501 5640 4501 5415 4726 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6090 1351 7215 1351 6990 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7890 1351 9015 1351 8790 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6090 4501 10815 4501 10590 4726 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9690 1350 10815 1350 10590 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11039 4274 11039 3149 11264 3374 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11039 2699 11039 1574 11264 1799 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11267 1353 12392 1353 12167 1578 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11267 4500 12392 4500 12167 4725 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 8834 2925 4739 2925 4739 630 8834 630 8834 2925 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 15075 6075 15075 450 450 450 450 6075 15075 6075 -4 2 4 0 0 0 20 0.0000 4 255 2085 2624 4590 SS:[Hydraulic_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1935 2581 1442 SS:[Thermal_in]\001 -4 1 -1 0 0 22 20 0.0000 4 210 390 4200 1441 ES\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 5865 1441 1\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 5865 4636 1\001 -4 1 -1 0 0 22 20 0.0000 4 210 390 7575 1441 AF\001 -4 1 -1 0 0 22 20 0.0000 4 270 1665 5865 3061 FMR:rho_cp\001 -4 1 -1 0 0 22 20 0.0000 4 210 390 9375 1441 ES\001 -4 1 1 1 0 3 20 0.0000 4 195 180 8296 1803 E\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3256 4412 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3121 4682 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3121 4322 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 3121 4952 V\001 -4 1 4 0 0 0 20 0.0000 4 240 285 3930 1126 [s]\001 -4 1 4 0 0 0 20 0.0000 4 240 300 4470 1126 [e]\001 -4 1 4 0 0 0 20 0.0000 4 240 300 9105 1081 [e]\001 -4 1 4 0 0 0 20 0.0000 4 240 285 9600 1081 [s]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3120 1171 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3255 1261 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3255 1936 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3120 1801 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3120 1531 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 5056 1262 1\001 -4 1 1 1 0 3 20 0.0000 4 195 615 5234 1080 T - T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 5549 1260 0\001 -4 1 1 1 0 3 30 0.0000 4 60 120 8296 1533 .\001 -4 1 1 1 0 3 20 0.0000 4 195 615 8386 1082 T - T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8701 1262 0\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8208 1264 2\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 11039 1440 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 11039 4590 1\001 -4 1 -1 0 0 22 20 0.0000 4 210 600 11084 3015 RS:r\001 -4 0 4 0 0 0 20 0.0000 4 255 2235 12617 4593 SS:[Hydraulic_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 2085 12572 1443 SS:[Thermal_out]\001 -4 1 1 1 0 3 30 0.0000 4 60 120 11674 4685 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 11674 4325 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 11674 4955 V\001 -4 1 1 1 0 3 20 0.0000 4 195 135 11809 4415 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 11674 1175 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 11809 1265 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 11674 1805 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 11674 1535 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 11809 1940 2\001 -4 1 1 1 0 3 20 0.0000 4 270 2340 7394 2340 Pseudo Bond Graph\001 -4 1 1 1 0 3 20 0.0000 4 195 180 5147 1803 E\001 -4 1 1 1 0 3 30 0.0000 4 60 120 5147 1533 .\001 -4 1 1 1 0 3 20 0.0000 4 195 180 6543 1804 E\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6543 1534 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 6584 1125 0\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_desc.tex @@ -1,44 +0,0 @@ -% Verbal description for system Pipe (Pipe_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:53 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/09 10:13:27 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Pipe} is - displayed in Figure \Ref{Pipe_abg} and its label - file is listed in Section \Ref{sec:Pipe_lbl}. - The subsystems are listed in Section \Ref{sec:Pipe_sub}. - -The \textbf{Pipe} component represents one way flow of incompressible -fluid though a pipe. Externally, it has true energy bonds: $P$/$\dot V$ -(Pressure/volume-flow) representing hydraulic energy and $T$/$\dot -S$(Temperature/Entropy-flow) representing convected thermal energy. - -Internally, however, the thermal part is represented by a pseudo bond -graph which computes the flow of internal energy $\dot E$ from the -upstream temperature $T_1$ and the volumetric flow rate $\dot V$ as: -\begin{equation} - \dot E = \rho c_p T_1 \dot V -\end{equation} -The $AF$ component makes the $FMR$ component use $T_1$ rather than -$T_1-T_2$. - -The two \textbf{ES} components provide the conversion from true to -psuedo thermal bonds and vice versa. - -The pipe has an resistance to flow represented by the \textbf{RS} -component labeled `r' which can be linear or nonlinear. The hydraulic -energy loss reappears on the thermal bond of this (energy-conserving) -\textbf{RS} component. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pipe/Pipe_lbl.txt @@ -1,52 +0,0 @@ -%% Label file for system Pipe (Pipe_lbl.txt) -%SUMMARY Pipe: Pipe containing hot incompressible liquid -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/11/20 11:34:17 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - - -%ALIAS $1 rho -%ALIAS $2 c_p -%ALIAS $3 flow,r - - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type FMR - rho_cp lin effort,$1*$2 - -% Component type RS - r $1 $3 - -% Component type SS - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_abg.fig @@ -1,56 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2714 2476 3839 2476 3614 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4289 2476 5414 2476 5189 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6313 2477 8297 2478 8072 2703 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2713 1351 5418 1353 5193 1578 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6313 1351 8297 1352 8072 1577 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 3825 4050 2700 4275 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 5400 4050 4275 4275 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4063 7020 4063 5895 4288 6120 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 10800 7650 10800 450 405 450 405 7650 10800 7650 -4 2 4 0 0 0 20 0.0000 4 255 2085 2669 2567 SS:[Hydraulic_in]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 4064 2612 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3166 2389 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3031 2659 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3031 2299 P\001 -4 0 4 0 0 0 20 0.0000 4 255 2235 8522 2571 SS:[Hydraulic_out]\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7579 2663 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7579 2303 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 7579 2933 V\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7714 2393 2\001 -4 0 4 0 0 0 20 0.0000 4 255 1035 6313 2341 [Hy_out]\001 -4 1 -1 0 0 22 20 0.0000 4 270 1305 5953 1936 Pipe:pipe\001 -4 2 4 0 0 0 20 0.0000 4 255 870 5459 1172 [Th_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1935 2536 1444 SS:[Thermal_in]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3075 1173 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3210 1263 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3210 1938 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3075 1803 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3075 1533 .\001 -4 0 4 0 0 0 20 0.0000 4 255 1020 6313 1171 [Th_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 2085 8477 1400 SS:[Thermal_out]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7579 1132 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7714 1222 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 7579 1762 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7579 1492 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7714 1897 2\001 -4 2 4 0 0 0 20 0.0000 4 255 885 5457 2340 [Hy_in]\001 -4 1 1 1 0 3 20 0.0000 4 195 195 3031 2929 V\001 -4 1 -1 0 0 22 20 0.0000 4 270 915 4063 4141 TF:k_p\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 4064 5717 1\001 -4 1 4 0 0 0 20 0.0000 4 240 1215 4063 7381 SS:[Shaft]\001 -4 1 1 1 0 32 30 0.0000 4 240 195 3838 6661 t\001 -4 1 1 1 0 32 30 0.0000 4 240 285 4288 6661 w\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_desc.tex @@ -1,35 +0,0 @@ -% Verbal description for system Pump (Pump_desc.tex) -% Generated by MTT on Mon Mar 9 09:11:22 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Pump} is - displayed in Figure \Ref{Pump_abg} and its label - file is listed in Section \Ref{sec:Pump_lbl}. - The subsystems are listed in Section \Ref{sec:Pump_sub}. - -\textbf{Pump} represents an ideal pump for incompressible fluid -driving fluid though a \textbf{Pipe} component. The pipe component -provides the correct thermal flow; if its resistance is set to zero, -the pump is an ideal component. - -The flow must be one way (in to out) for correct thermal properties. - -The ports are -\begin{itemize} -\item [Hy_in] Pressure/volume-flow inflow -\item [Hy_in] Pressure/volume-flow outflow -\item [Th_in] Temperature/Entropy-flow in flow -\item [Th_out] Temperature/Entropy-flow out flow -\item [Shaft] Torque/angular velocity input. -\end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Pump/Pump_lbl.txt @@ -1,53 +0,0 @@ -%SUMMARY Pump: a hydraulic pump - incompressible flow -%DESCRIPTION Typical lable: pump lin rho;c_p;flow,r;k_p - -%% Label file for system Pump (Pump_lbl.txt) - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/11/20 10:07:14 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%ALIAS Pipe IncompressibleFlow/Pipe -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -%ALIAS Work Shaft - -%ALIAS $1 rho -%ALIAS $2 c_p -%ALIAS $3 flow,r -%ALIAS $4 flow,k_p - -%ALIAS $1 lin - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - -% Component type Pipe - pipe lin rho;c_p;flow,r - -% Component type TF - k_p lin flow,k_p - -% Component type SS - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external - [Shaft] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_abg.fig @@ -1,76 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2940 2477 4065 2477 3840 2702 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4740 2477 5865 2477 5640 2702 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2940 5627 5865 5627 5640 5852 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6315 2478 7440 2478 7215 2703 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8116 2479 9241 2479 9016 2704 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6315 5626 9240 5626 9015 5851 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 7484 6571 4739 6571 4739 1801 7484 1801 7484 6571 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5864 5401 6314 5401 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5864 2701 6314 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6089 2702 6089 3827 6314 3602 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6089 5401 6089 4276 6314 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6088 1127 6088 2252 6313 2027 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11700 7200 11700 225 675 225 675 7200 11700 7200 -4 0 4 0 0 0 20 0.0000 4 255 2235 9421 5719 SS:[Hydraulic_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 2085 9376 2569 SS:[Thermal_out]\001 -4 2 4 0 0 0 20 0.0000 4 255 2085 2894 5716 SS:[Hydraulic_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1935 2806 2568 SS:[Thermal_in]\001 -4 1 -1 0 0 22 20 0.0000 4 210 390 4425 2567 ES\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3481 5538 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3346 5808 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3346 5448 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 3346 6078 V\001 -4 1 4 0 0 0 20 0.0000 4 240 285 4155 2252 [s]\001 -4 1 4 0 0 0 20 0.0000 4 240 300 4695 2252 [e]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3345 2297 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3480 2387 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 3480 3062 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 3345 2927 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 3345 2657 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 5281 2388 1\001 -4 1 1 1 0 3 20 0.0000 4 195 615 5459 2206 T - T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 5774 2386 0\001 -4 1 1 1 0 3 30 0.0000 4 60 120 5372 2659 .\001 -4 1 1 1 0 3 20 0.0000 4 195 180 5372 2929 E\001 -4 1 -1 0 0 22 20 0.0000 4 210 870 6089 4186 C:tank\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6090 2567 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6090 5762 0\001 -4 1 -1 0 0 22 20 0.0000 4 210 390 7800 2568 ES\001 -4 1 1 1 0 3 30 0.0000 4 60 120 8523 5811 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 8523 5451 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 8523 6081 V\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8658 5541 2\001 -4 1 1 1 0 3 20 0.0000 4 195 180 6721 2930 E\001 -4 1 4 0 0 0 20 0.0000 4 240 300 7530 2208 [e]\001 -4 1 4 0 0 0 20 0.0000 4 240 285 8025 2208 [s]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 8523 2301 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8658 2391 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 8523 2931 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 8523 2661 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 8658 3066 2\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6721 2660 .\001 -4 1 1 1 0 3 20 0.0000 4 195 615 6811 2209 T - T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 7126 2389 0\001 -4 1 1 1 0 3 20 0.0000 4 195 135 6633 2391 2\001 -4 1 1 1 0 3 20 0.0000 4 270 2340 6134 6346 Pseudo Bond Graph\001 -4 1 4 0 0 0 20 0.0000 4 240 555 5639 3826 [out]\001 -4 1 4 0 0 0 20 0.0000 4 240 405 5684 4501 [in]\001 -4 1 4 0 0 0 20 0.0000 4 255 1500 6088 990 SS:[Heat_in]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_cr.r Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_cr.r ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_cr.r +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_cr.r @@ -1,20 +0,0 @@ -% Constitutive relation file for Tank (Tank_cr.r) -% Generated by MTT at Thu Mar 5 10:30:23 GMT 1998 - -OPERATOR tank; - -%Pressure -FOR ALL COMPONENT, rho,c_p,c,Volume,Energy -LET tank(COMPONENT, rho,c_p,c,effort,1, - Volume,state,1, - Energy,state,2 - ) = (Volume*rho)/c; - -%Temperature -FOR ALL COMPONENT, rho,c_p,c,Volume,Energy -LET tank(COMPONENT, rho,c_p,c,effort,2, - Volume,state,1, - Energy,state,2 - ) = Energy/(Volume*rho*c_p); - -END; DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system Tank (Tank_desc.tex) -% Generated by MTT on Tue Jan 13 18:03:04 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Tank} is - displayed in Figure \Ref{Tank_abg} and its label - file is listed in Section \Ref{sec:Tank_lbl}. - The subsystems are listed in Section \Ref{sec:Tank_sub}. DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/Tank/Tank_lbl.txt @@ -1,52 +0,0 @@ -%% Label file for system Tank (Tank_lbl.txt) -%SUMMARY Tank: Tank of hot incompressible liquid -%DESCRIPTION c is the pressure constant: P=(rho*V)/c -%DESCRIPTION Typical lable: tank Tank rho;c_p;c - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/11/20 09:46:34 peterg -% %% Modernised lbl syntax -% %% -% %% Revision 1.1 1998/11/20 08:57:19 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -%ALIAS Heat Heat_in - -% Argument aliases -%ALIAS $1 rho -%ALIAS $2 c_p -%ALIAS $3 c - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - tank Tank rho,c_p,c - -% Component type SS - [Heat_in] SS external,external - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_abg.fig @@ -1,74 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6526 7426 6526 6301 6751 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 6302 6078 6302 5853 6527 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5177 6078 5177 5853 5402 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6076 2476 3601 4951 3871 4951 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6076 3601 3601 6076 3871 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6976 2701 6976 2476 9451 4951 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 3825 6975 3600 9450 6075 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6976 6301 9228 6301 9003 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6976 5176 9228 5176 9003 5401 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2253 6302 3378 6302 3153 6527 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2253 5177 3378 5177 3153 5402 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9678 5177 10803 5177 10578 5402 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9678 6302 10803 6302 10578 6527 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 9001 6525 7876 6750 8101 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 13275 9675 13275 1350 45 1350 45 9675 13275 9675 -4 2 4 0 0 0 20 0.0000 4 255 2085 2205 6390 SS:[Hydraulic_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1935 2205 5265 SS:[Thermal_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 870 6123 4998 [Th_in]\001 -4 0 4 0 0 0 20 0.0000 4 255 1020 6977 4997 [Th_out]\001 -4 1 4 0 0 0 20 0.0000 4 240 810 6572 6167 [Shaft]\001 -4 2 4 0 0 0 20 0.0000 4 255 885 5986 6166 [Hy_in]\001 -4 0 4 0 0 0 20 0.0000 4 255 1035 7112 6167 [Hy_out]\001 -4 1 -1 0 0 22 20 0.0000 4 270 1665 6527 5762 Pump:pump\001 -4 1 -1 0 0 22 20 0.0000 4 270 1260 6527 3152 Pipe:leak\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2705 6215 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2570 6125 P\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2614 4999 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2749 5089 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2749 5764 1\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2614 5629 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2614 5359 .\001 -4 1 1 1 0 3 20 0.0000 4 195 195 2570 6755 V\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2570 6485 .\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3603 6393 0\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3603 5268 0\001 -4 0 4 0 0 0 20 0.0000 4 255 2085 10941 5271 SS:[Thermal_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 2235 10941 6397 SS:[Hydraulic_out]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 10043 4958 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 10178 5048 2\001 -4 1 1 1 0 3 20 0.0000 4 195 165 10043 5588 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 10043 5318 .\001 -4 1 1 1 0 3 20 0.0000 4 195 135 10178 5723 2\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 9453 5268 0\001 -4 1 1 1 0 3 30 0.0000 4 60 120 10088 6489 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 10088 6129 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 10088 6759 V\001 -4 1 1 1 0 3 20 0.0000 4 195 135 10223 6219 2\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 9498 6438 0\001 -4 0 4 0 0 0 20 0.0000 4 255 870 7023 2343 [Th_in]\001 -4 0 4 0 0 0 20 0.0000 4 255 885 7021 3466 [Hy_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1020 6032 2342 [Th_out]\001 -4 2 4 0 0 0 20 0.0000 4 255 1035 6032 3467 [Hy_out]\001 -4 1 4 0 0 0 20 0.0000 4 240 1215 6482 9317 SS:[Shaft]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6528 7743 1\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_desc.tex @@ -1,25 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system lPump (lPump_desc.tex) -% Generated by MTT on Mon Mar 9 10:35:44 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{lPump} is - displayed in Figure \Ref{lPump_abg} and its label - file is listed in Section \Ref{sec:lPump_lbl}. - The subsystems are listed in Section \Ref{sec:lPump_sub}. - -\textbf{lPump} corrsponds to the \textbf{Pump} component but with a -backflow leakage around the ump driven by the pressure drop across -the pump. This leakage is implemented using the \textbf{Pipe} -component to give the correct thermal behaviour. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/IncompressibleFlow/lPump/lPump_lbl.txt @@ -1,52 +0,0 @@ -%% Label file for system lPump (lPump_lbl.txt) -%SUMMARY lPump: a hydraulic pump with leakage - incompressible flow - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Component aliases -%ALIAS Pipe IncompressibleFlow/Pipe -%ALIAS Pump IncompressibleFlow/Pump - -% Port aliases -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -% Argument aliases -%ALIAS $1 rho -%ALIAS $2 c_p -%ALIAS $3 flow,r -%ALIAS $4 flow,k_p -%ALIAS $5 flow,r_l - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type Pipe - leak lin $1;$2;$5 - -% Component type Pump - pump lin $1;$2;$3;$4 - -% Component type SS - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external - [Shaft] SS external,external - DELETED mttroot/mtt/lib/comp/compound/Thermal/RT/RT_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/RT/RT_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT/RT_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/RT/RT_abg.fig @@ -1,49 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 2701 5625 2701 5400 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 2701 7425 2701 7200 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 2476 5850 1126 6075 1351 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11475 3600 450 3600 450 451 11475 451 11475 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 2701 3375 2701 3150 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 2701 9675 2701 9450 2926 -4 1 -1 0 0 0 20 0.0000 4 195 135 5850 2791 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 375 5850 991 R:r\001 -4 1 4 0 0 0 20 0.0000 4 255 315 4410 2476 [p]\001 -4 1 4 0 0 0 20 0.0000 4 255 315 7290 2476 [p]\001 -4 1 1 1 0 3 20 0.0000 4 240 210 5040 3106 Q\001 -4 1 1 1 0 3 30 0.0000 4 60 105 5085 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 5040 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 240 210 6615 3106 Q\001 -4 1 1 1 0 3 30 0.0000 4 60 105 6660 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 6615 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 6795 2611 2\001 -4 1 1 1 0 3 20 0.0000 4 195 135 5220 2611 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 765 3825 2790 FP:fp1\001 -4 2 4 0 0 0 20 0.0000 4 240 810 1980 2790 SS:[in]\001 -4 1 4 0 0 0 20 0.0000 4 240 270 3285 2476 [f]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 3106 S\001 -4 1 1 1 0 3 30 0.0000 4 60 105 2520 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2475 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2610 2611 1\001 -4 1 1 1 0 3 20 0.0000 4 195 135 2610 3241 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 765 7920 2790 FP:fp2\001 -4 1 4 0 0 0 20 0.0000 4 240 270 8505 2476 [f]\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9090 3106 S\001 -4 1 1 1 0 3 30 0.0000 4 60 105 9135 2836 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 9090 2521 T\001 -4 1 1 1 0 3 20 0.0000 4 195 135 9270 3241 2\001 -4 1 1 1 0 3 20 0.0000 4 195 135 9270 2611 2\001 -4 0 4 0 0 0 20 0.0000 4 240 960 9810 2791 SS:[out]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/RT/RT_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/RT/RT_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT/RT_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/RT/RT_desc.tex @@ -1,5 +0,0 @@ -Component \textbf{RT} is a two port thermal resistor with true power -bonds. Internally, it has a pseudo Bond Graph representation, and the -corresponding thermal resistance just acts as an ordinary one-port -\textbf{R} component. - DELETED mttroot/mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt @@ -1,63 +0,0 @@ -%SUMMARY RT: Two port thermal resistance with T/Sdot bonds -%DESCRIPTION Port [in]: T/Sdot power in -%DESCRIPTION Port [out]: T/Sdot power out -%DESCRIPTION CR and parameters as for a one-port R component -%DESCRIPTION Internally pseudo bond graph -%DESCRIPTION Example label file entry: -%DESCRIPTION % Component type RT -%DESCRIPTION r lin flow,r - -%ALIAS ThermalIn in -%ALIAS ThermalOut out - -%ALIAS $1 flow,r -%ALIAS $a1 lin - - -%% Label file for system RT (RT_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.7 2001/07/03 22:59:10 gawthrop -% %% Fixed problems with argument passing for CRs -% %% -% %% Revision 1.6 2001/06/13 17:10:26 gawthrop -% %% Alias for the cr (ie ALIAS $1 lin) -% %% -% %% Revision 1.5 2001/06/11 19:51:08 gawthrop -% %% Zapped spurious $1 alias -% %% -% %% Revision 1.4 1998/07/22 11:31:42 peterg -% %% New port names -% %% -% %% Revision 1.3 1998/07/21 16:26:05 peterg -% %% Now has aliased parameters. -% %% -% %% Revision 1.2 1998/06/29 10:08:14 peterg -% %% Converted to FP component -% %% Removed lables from FP -% %% -% %% Revision 1.1 1997/09/04 09:48:47 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - -% Component type R - r lin flow,r - -% Component type FP - fp1 - fp2 - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/RT/TestRT_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/RT/TestRT_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT/TestRT_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/RT/TestRT_abg.fig @@ -1,18 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 3600 3600 3600 3375 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 3600 5850 3600 5625 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 3420 3600 3780 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4500 3420 4500 3780 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 7020 4725 1125 4725 1125 2295 7020 2295 7020 4725 -4 1 -1 0 0 2 20 0.0000 4 195 705 4050 3690 RT:rt\001 -4 1 -1 0 0 2 20 0.0000 4 255 870 1800 3690 SS:T_1\001 -4 1 -1 0 0 2 20 0.0000 4 255 870 6345 3690 SS:T_2\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/RT/TestRT_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/RT/TestRT_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT/TestRT_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/RT/TestRT_lbl.txt @@ -1,24 +0,0 @@ -%SUMMARY TestRT -%DESCRIPTION -%% Label file for system TestRT (TestRT_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type RT - rt lin flow,r;0 - -% Component type SS - T_1 external external - T_2 external external DELETED mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_abg.fig @@ -1,30 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1575 2700 2925 2700 2700 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 2700 5175 2700 4950 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 2475 5400 1125 5625 1350 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 2700 6975 2700 6750 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7876 2701 9226 2701 9001 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10081 2701 11431 2701 11206 2926 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 12600 4275 12600 450 225 450 225 4275 12600 4275 -4 1 -1 0 0 0 20 0.0000000 4 210 690 3420 2790 ES:es\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5400 2790 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 390 5400 990 R:r\001 -4 2 4 0 0 0 20 0.0000000 4 240 870 1485 2790 SS:[in]\001 -4 1 4 0 0 0 20 0.0000000 4 240 330 2835 2475 [s]\001 -4 1 4 0 0 0 20 0.0000000 4 240 345 3960 2475 [e]\001 -4 1 -1 0 0 0 20 0.0000000 4 210 705 7470 2790 AF:af\001 -4 1 -1 0 0 0 20 0.0000000 4 210 690 9676 2791 ES:se\001 -4 0 4 0 0 0 20 0.0000000 4 240 1020 11611 2791 SS:[out]\001 -4 1 4 0 0 0 20 0.0000000 4 240 345 9091 2476 [e]\001 -4 1 4 0 0 0 20 0.0000000 4 240 330 10306 2476 [s]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_desc.tex @@ -1,18 +0,0 @@ -Component \textbf{RT1} is a two port thermal resistor with true power -bonds. Internally, it has a pseudo Bond Graph representation, and the -corresponding thermal resistance just acts as an ordinary one-port -\textbf{R} component. -Unlike the {\bf RT} component, it is {\em one-sided\/} in the snese -that the paper flow depends only on the upstream temperature. It is -useful for modelling radiation via the Stefan-Boltzmann law when using -the {\bf StefanBoltzmann} CR. - - -This one-sidedness is achieved using the {\bf AF} component to isolate -the intrnal {\bf R} component from the downstream temperature. - - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/RT1/RT1_lbl.txt @@ -1,51 +0,0 @@ -%% Label file for system RT1 (RT1_lbl.txt) -%SUMMARY RT1: Two port thermal resistance with T/Sdot bonds -%DESCRIPTION Port [in]: T/Sdot power in -%DESCRIPTION Port [out]: T/Sdot power out -%DESCRIPTION CR and parameters as for a one-port R component -%DESCRIPTION One sided: flow depends on upstream temperature only -%DESCRIPTION Useful for radiation modelling -%DESCRIPTION Example label file entry: -%DESCRIPTION % Component type RT1 -%DESCRIPTION r lin flow,r - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 10:40:45 peterg -% %% Put under RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS out out - -% Argument aliases -%ALIAS $1 r -%ALIAS $1 lin - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AF - af - -% Component type ES - es - se - -% Component type R - r lin flow,r - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4515 2701 5865 2701 5640 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2715 2701 4065 2701 3840 2926 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 3600 225 3600 225 1801 8325 1801 8325 3600 -4 1 4 0 0 0 20 0.0000000 4 270 360 4650 2476 [p]\001 -4 1 -1 0 0 0 20 0.0000000 4 210 330 4290 2791 FP\001 -4 1 4 0 0 0 20 0.0000000 4 240 315 3975 2476 [f]\001 -4 1 1 1 0 3 20 0.0000000 4 210 165 3165 3106 S\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 3210 2836 .\001 -4 1 1 1 0 3 20 0.0000000 4 270 210 5280 3106 Q\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 5325 2836 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 5280 2521 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 3165 2521 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 3300 2611 1\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 3300 3241 1\001 -4 1 1 1 0 3 20 0.0000000 4 210 150 5460 2611 1\001 -4 0 4 0 0 0 20 0.0000000 4 270 2115 6000 2791 SS:[EnergyFlow]\001 -4 2 4 0 0 0 20 0.0000000 4 270 2220 2655 2790 SS:[EntropyFlow]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/ThermalConversion/ES/ES_lbl.txt @@ -1,28 +0,0 @@ -%% Label file for system ES (ES_lbl.txt) -%SUMMARY ES Identical to the FP component except for the port labels -%DESCRIPTION Converts true thermal to pseudo BGs - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS e|p EnergyFlow -%ALIAS s|f EntropyFlow - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [EnergyFlow] SS external,external - [EntropyFlow] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/VM/VM_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/VM/VM_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/VM/VM_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/VM/VM_abg.fig @@ -1,54 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 3825 3600 3825 3375 4050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 3600 4500 2925 4500 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 1980 5400 2655 5625 2430 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 2925 6975 3600 6750 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7246 3826 8371 3826 8146 4051 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5175 10125 450 225 450 225 5175 10125 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 1125 4500 1125 4275 1350 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4500 900 4500 1395 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 1800 4500 1800 4275 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4500 1575 4500 2070 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 4050 6300 4725 6525 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 4050 4500 4725 4320 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 4725 4950 4725 5175 4950 -4 2 4 0 0 0 20 0.0000 4 255 1290 2073 3918 SS:[Hy_in]\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2570 4010 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2570 3650 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 2570 4280 V\001 -4 1 4 0 0 0 20 0.0000 4 240 570 5445 1935 [rho]\001 -4 2 4 0 0 0 20 0.0000 4 240 675 5355 2700 [mod]\001 -4 1 -1 0 0 22 20 0.0000 4 210 1365 5400 3015 EMAF:rho\001 -4 1 4 0 0 0 20 0.0000 4 240 405 4860 3285 [in]\001 -4 1 4 0 0 0 20 0.0000 4 240 555 5851 3241 [out]\001 -4 1 1 1 0 3 30 0.0000 4 60 120 8018 3968 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 8018 3608 P\001 -4 1 1 1 0 3 20 0.0000 4 135 210 8018 4238 m\001 -4 0 4 0 0 0 20 0.0000 4 255 1440 8551 3916 SS:[Hy_out]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3825 3915 1\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6975 3915 0\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2613 948 T\001 -4 2 4 0 0 0 20 0.0000 4 240 345 4410 1665 [P]\001 -4 2 4 0 0 0 20 0.0000 4 240 360 4455 945 [T]\001 -4 2 4 0 0 0 20 0.0000 4 240 750 2119 1849 SS:[P]\001 -4 2 4 0 0 0 20 0.0000 4 240 765 2119 1219 SS:[T]\001 -4 1 -1 0 0 22 20 0.0000 4 270 2130 5715 1530 Density:density\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 4725 4815 0\001 -4 1 -1 0 0 22 20 0.0000 4 210 405 5985 4815 AE\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/VM/VM_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/VM/VM_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/VM/VM_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/VM/VM_desc.tex @@ -1,29 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system VM (VM_desc.tex) -% Generated by MTT on Thu Mar 19 14:37:43 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{VM} is - displayed in Figure \Ref{VM_abg} and its label - file is listed in Section \Ref{sec:VM_lbl}. - The subsystems are listed in Section \Ref{sec:VM_sub}. - -The \textbf{VM} component acts as a density-modulated transformer -converting a $P$/$\dot V$ energy bond to a $P$/$\dot m$ pseudo bond. It used -the \textbf{Density} component and therfore inherits the properties of -that component -- in particular it takes the same parameter. The four -ports are: - -\begin{itemize} -\item [Hy_in]: hydraulic in -\item [Hy_out]: hydraulic out -\item [P]: Pressure -\item [T]: Temperature -\end{itemize} - DELETED mttroot/mtt/lib/comp/compound/Thermal/VM/VM_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/VM/VM_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/VM/VM_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/VM/VM_lbl.txt @@ -1,33 +0,0 @@ -%SUMMARY VM: Volumetric to mass flow and vv - pseudo mass-flow bond -%DESCRIPTION Converts between P/Vdot energy bond to a P/mdot pseudo bond -%DESCRIPTION Parameter 1: passed to the Density subcomponent -%% Label file for system VM (VM_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/26 08:37:59 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type Density - density none $1 - -% Component type EMAF - rho - -% Component type SS - [Hy_in] SS external,external - [Hy_out] SS external,external - [P] SS external,external - [T] SS external,external DELETED mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_abg.fig Index: mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_abg.fig ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_abg.fig +++ mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_abg.fig @@ -1,40 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 3825 4950 3825 4725 4050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 1350 4500 1350 4275 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 2250 5400 3600 5625 3375 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9045 4725 9045 450 225 450 225 4725 9045 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6076 3826 7201 3826 6976 4051 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4500 1125 4500 1620 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 2025 4500 2025 4275 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4500 1800 4500 2295 -4 1 1 1 0 3 20 0.0000 4 195 165 2613 1173 T\001 -4 2 4 0 0 0 20 0.0000 4 255 1290 2073 3918 SS:[Hy_in]\001 -4 1 4 0 0 0 20 0.0000 4 240 570 5400 2115 [rho]\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2570 4010 .\001 -4 1 1 1 0 3 20 0.0000 4 195 165 2570 3650 P\001 -4 1 1 1 0 3 20 0.0000 4 195 195 2570 4280 V\001 -4 1 4 0 0 0 20 0.0000 4 240 405 4725 3690 [in]\001 -4 2 4 0 0 0 20 0.0000 4 240 675 5310 3330 [mod]\001 -4 1 -1 0 0 22 20 0.0000 4 210 1065 5535 3915 EMTF:tf\001 -4 1 4 0 0 0 20 0.0000 4 240 555 6301 3691 [out]\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6848 3968 .\001 -4 1 1 1 0 3 20 0.0000 4 195 270 6848 3608 Pv\001 -4 1 1 1 0 3 20 0.0000 4 135 210 6848 4238 m\001 -4 1 -1 0 0 22 20 0.0000 4 270 2130 5805 1665 Density:density\001 -4 2 4 0 0 0 20 0.0000 4 240 345 4410 1890 [P]\001 -4 2 4 0 0 0 20 0.0000 4 240 360 4455 1170 [T]\001 -4 2 4 0 0 0 20 0.0000 4 240 750 2119 2074 SS:[P]\001 -4 2 4 0 0 0 20 0.0000 4 240 765 2119 1444 SS:[T]\001 -4 0 4 0 0 0 20 0.0000 4 255 1440 7381 3916 SS:[Hy_out]\001 DELETED mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_desc.tex Index: mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_desc.tex ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_desc.tex +++ mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_desc.tex @@ -1,29 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system VMe (VMe_desc.tex) -% Generated by MTT on Thu Mar 19 14:37:43 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{VMe} is - displayed in Figure \Ref{VMe_abg} and its label - file is listed in Section \Ref{sec:VMe_lbl}. - The subsystems are listed in Section \Ref{sec:VMe_sub}. - -The \textbf{VMe} component acts as a density-modulated transformer -converting a $P$/$\dot V$ energy bond to a $Pv$/$\dot m$ bond. It used -the \textbf{Density} component and therfore inherits the properties of -that component -- in particular it takes the same parameter. The four -ports are: - -\begin{itemize} -\item [Hy_in]: hydraulic in -\item [Hy_out]: hydraulic out -\item [P]: Pressure -\item [T]: Temperature -\end{itemize} - DELETED mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_lbl.txt Index: mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/VMe/VMe_lbl.txt @@ -1,33 +0,0 @@ -%SUMMARY VMe: Volumetric to mass flow and vv - energy bonds -%DESCRIPTION Converts between P/Vdot energy bond to a Pv/mdot energy bond -%DESCRIPTION Parameter 1: passed to the Density subcomponent -%% Label file for system VMe (VMe_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/26 08:38:15 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type Density - density none $1 - -% Component type EMTF - tf lin flow - -% Component type SS - [Hy_in] SS external,external - [Hy_out] SS external,external - [P] SS external,external - [T] SS external,external DELETED mttroot/mtt/lib/comp/simple/AE_alias.m Index: mttroot/mtt/lib/comp/simple/AE_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/AE_alias.m +++ mttroot/mtt/lib/comp/simple/AE_alias.m @@ -1,15 +0,0 @@ -function alias = AE_alias # Port aliases for AE - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/AE_cause.m Index: mttroot/mtt/lib/comp/simple/AE_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/AE_cause.m +++ mttroot/mtt/lib/comp/simple/AE_cause.m @@ -1,79 +0,0 @@ -function [bonds,status] = AE_cause(bonds); -% AE_cause - Causality for effort amplifier component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function AE_cause -% [bonds,status] = AE_cause(bonds) - -%SUMMARY AE: effort amplifier -%DESCRIPTION Port[1]: amplifier effort input e_1 (f_1=0) -%DESCRIPTION Port[2]: amplifier effort output e_2 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/11/01 11:40:30 peterg -% %% Documentation. -% %% -% %% Revision 1.1 1996/08/30 19:05:21 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - - -status = -1; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'AE')==0 - return -end - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - -% Port 1 must impose (zero) flow and port 2 have flow imposed -if (f_1==-1)|(f_2==1) % Conflict - status = 1; - else % Do the rest of the causality - - if f_1 == 0 % Set port 1 effort - f_1 = 1; - end; - - if f_2 == 0 % Set port 2 effort - f_2 = -1; - end; - - number_set = sum(sum([e_1 e_2]~=zeros(1,2) )); - if number_set==0 % Under causal - status = -1; - elseif number_set==1 % Set the causality - if e_1 == 0 - e_1 = -e_2; - else - e_2 = -e_1; - end - status = 0; - elseif number_set==2 % Check the causality - if e_1==-e_2 - status = 0; - else - status = 1; - end - end; -end; - - bonds = [e_1 f_1 - e_2 f_2] - DELETED mttroot/mtt/lib/comp/simple/AE_eqn.m Index: mttroot/mtt/lib/comp/simple/AE_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/AE_eqn.m +++ mttroot/mtt/lib/comp/simple/AE_eqn.m @@ -1,71 +0,0 @@ -function structure = AE_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% AE_eqn. Equation generation for effort amplifier. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 1996/09/10 10:10:41 peter -% %% Now uses eqaution.m to format the equation. -% %% -% %% Revision 1.3 1996/08/30 19:03:10 peter -% %% Added argument check. -% %% Added extra name argument. -% %% -% %% Revision 1.2 1996/08/30 13:23:11 peter -% %% Added bond number check -% %% -% %% Revision 1.1 1996/08/22 13:12:34 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -if nargin<6 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'AE')==0 - return -end - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - - -% Flow on port 1 is always zero - fprintf(eqnfile, '%s := 0;\n', ... - varname(name,bond_number(1), -1)); - - -outcause = 1; -incause = 1; - -if e_2 == -1 % Unicausal: e_2 := e_1 - outbond = bond_number(2); - inbond = bond_number(1); - outport = 2; - inport = 1; -else % Bicausal: e_1 := e_2 - outbond = bond_number(1); - inbond = bond_number(2); - outport = 1; - inport = 2; -end - - -eqn = equation("AE",name,cr,args,outbond,outcause,outport, ... - inbond,incause,inport); -fprintf(eqnfile, '%s',eqn); - - - - - - - DELETED mttroot/mtt/lib/comp/simple/AE_seqn.m Index: mttroot/mtt/lib/comp/simple/AE_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/AE_seqn.m +++ mttroot/mtt/lib/comp/simple/AE_seqn.m @@ -1,8 +0,0 @@ -function [eqn,insigs,innames] = AE_seqn (Name, name, cr, arg, outsig, insigs, innames) - - ## usage: [eqn,inbonds] = AE_seqn (Name, cr, arg, outbond, inbonds) - ## - ## Implements the AE component - - [eqn,insigs,innames] = Amp_seqn ("AE",Name, name, cr, arg, outsig, insigs, innames); -endfunction DELETED mttroot/mtt/lib/comp/simple/AF_alias.m Index: mttroot/mtt/lib/comp/simple/AF_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/AF_alias.m +++ mttroot/mtt/lib/comp/simple/AF_alias.m @@ -1,15 +0,0 @@ -function alias = AF_alias # Port aliases for AF - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/AF_cause.m Index: mttroot/mtt/lib/comp/simple/AF_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/AF_cause.m +++ mttroot/mtt/lib/comp/simple/AF_cause.m @@ -1,74 +0,0 @@ -function [bonds,status] = AF_cause(bonds); -% AF_cause - Causality for Flow amplifier component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function AF_cause -% [bonds,status] = AF_cause(bonds) - -%SUMMARY AF: flow amplifier -%DESCRIPTION Port[1]: amplifier flow input f_1 (e_1=0) -%DESCRIPTION Port[2]: amplifier flow output f_2 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/08/30 19:05:32 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -status = -1; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'AF')==0 - return -end - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - -% Port 1 must impose (zero) effort and port 2 have effort imposed -if (e_1==1)|(e_2==-1) % Conflict - status = 1; - else % Do the rest of the causality - - if e_1 == 0 % Set port 1 effort - e_1 = -1; - end; - - if e_2 == 0 % Set port 2 effort - e_2 = 1; - end; - - number_set = sum(sum([f_1 f_2]~=zeros(1,2) )); - if number_set==0 % Under causal - status = -1; - elseif number_set==1 % Set the causality - if f_1 == 0 - f_1 = -f_2; - else - f_2 = -f_1; - end - status = 0; - elseif number_set==2 % Check the causality - if f_1==-f_2 - status = 0; - else - status = 1; - end - end; -end; - - bonds = [e_1 f_1 - e_2 f_2]; DELETED mttroot/mtt/lib/comp/simple/AF_eqn.m Index: mttroot/mtt/lib/comp/simple/AF_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/AF_eqn.m +++ mttroot/mtt/lib/comp/simple/AF_eqn.m @@ -1,76 +0,0 @@ -function structure = AF_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% AF_eqn - equations for flow amplifier -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function AF_eqn -% structure = AF_eqn(bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1996/09/12 19:29:35 peter -% %% Use new equation method. -% %% -% %% Revision 1.2 1996/09/11 13:35:14 peter -% %% New equation.m method used. -% %% -% %% Revision 1.1 1996/08/30 18:38:57 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -if nargin<6 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'AF')==0 - return -end - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - -% Effort on port 1 is always zero - fprintf(eqnfile, '%s := 0;\n', ... - varname(name,bond_number(1), 1)); - -outcause = -1; -incause = -1; - -if f_2 == 1 % Unicausal: f_2 := f_1 - outbond = bond_number(2); - inbond = bond_number(1); - outport = 2; - inport = 1; -else % Bicausal: f_1 := f_2 - outbond = bond_number(1); - inbond = bond_number(2); - outport = 1; - inport = 2; -end - - -eqn = equation("AF",name,cr,args,outbond,outcause,outport, ... - inbond,incause,inport); -fprintf(eqnfile, '%s',eqn); - - - - - - - DELETED mttroot/mtt/lib/comp/simple/AF_seqn.m Index: mttroot/mtt/lib/comp/simple/AF_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/AF_seqn.m +++ mttroot/mtt/lib/comp/simple/AF_seqn.m @@ -1,8 +0,0 @@ -function [eqn,insigs,innames] = AF_seqn (Name, name, cr, arg, outsig, insigs, innames) - - ## usage: [eqn,inbonds] = AF_seqn (Name, cr, arg, outbond, inbonds) - ## - ## Implements the AF component - - [eqn,insigs,innames] = Amp_seqn ("AF",Name, name, cr, arg, outsig, insigs, innames); -endfunction DELETED mttroot/mtt/lib/comp/simple/Amp_seqn.m Index: mttroot/mtt/lib/comp/simple/Amp_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/Amp_seqn.m +++ mttroot/mtt/lib/comp/simple/Amp_seqn.m @@ -1,43 +0,0 @@ -function [eqn,insigs,innames] = Amp_seqn (AmpType,Name, name, cr, arg, outsig, insigs, innames) - - ## usage: [eqn,inbonds] = AF_seqn (Name, cr, arg, outbond, inbonds) - ## - ## - - N = mtt_check_sigs (outsig,insigs); - if (N!=2) - mtt_error("Amplifier component must have exactly two ports"); - endif - - - ## On which port is the equation required? - outbond_number = outsig(1); - outport = find(abs(insigs(:,1))!=outbond_number*ones(N,1)); - - ## Some definitions - flow = -1; - effort = 1; - - if strcmp(AmpType,"AE") - causality = effort; - other_causality = flow; - elseif strcmp(AmpType,"AF") - causality = flow; - other_causality = effort; - else - mtt_error(sprintf("Amp_seqn: type %s unknown", AmpType)); - endif - - ## Standard causality - if (outport==2) - qAmpType = sprintf("""%s""", AmpType); - eqn = equation(qAmpType,Name,cr,arg,outsig(1),causality,2, ... - insigs(2,1),causality,1); - elseif (outport==1) - LHS = varname(Name,insigs(2,1),other_causality); - eqn = sprintf("%s := 0;", LHS); - else - mtt_error("AF_seqn: outport must be 1 or 2"); - endif - -endfunction DELETED mttroot/mtt/lib/comp/simple/C2_cause.m Index: mttroot/mtt/lib/comp/simple/C2_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/C2_cause.m +++ mttroot/mtt/lib/comp/simple/C2_cause.m @@ -1,35 +0,0 @@ -function [bonds,status] = C2_cause(bonds); -% C2_cause - Unicausal multiport C2 C2omponent -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function C2_cause -% [bonds,status] = C2_cause(bonds) - -%SUMMARY C2: elementary C component with two ports -%DESCRIPTION Two port dynamic component -%DESCRIPTION Preferred integral causality (flow input) -%DESCRIPTION Cannot be bicausal - - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Copyright (c) P.J. Gawthrop, 1996. - -% Unicausal multiport C component -% Same causal pattern as R component - -[bonds,status] = R_cause(bonds); - - DELETED mttroot/mtt/lib/comp/simple/CI_seqn.m Index: mttroot/mtt/lib/comp/simple/CI_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/CI_seqn.m +++ mttroot/mtt/lib/comp/simple/CI_seqn.m @@ -1,36 +0,0 @@ -function [eqn,insigs,innames] = CI_seqn (comp_type,Name, name, cr, arg, outsig, insigs ,innames) - - ## usage: [eqn,inbonds] = CI_seqn (Name, cr, arg, outbond, inbonds) - ## - ## - ## Multi port C's ?? - - delim = "__"; - N = mtt_check_sigs (outsig,insigs); - - state_index=3; - - i_cause = outsig(2); # Extract causality - - state_equation=((i_cause==1)&&strcmp(comp_type,"C")) ... - ||((i_cause==-1)&&strcmp(comp_type,"I")); - - ## Create the equation - if state_equation # output/state - LHS = varname(Name, outsig(1,1), state_index); - RHS = sprintf("MTTx_%s%s%s", Name, delim, name); - eqn_1 = sprintf("%s := %s;", LHS, RHS); - - inports = [1:N]; - comp_type_str=sprintf("""%s""", comp_type); - eqn_2 = equation(comp_type_str,Name,cr,arg,outsig(1),outsig(2),outsig(3), ... - insigs(:,1),state_index,inports); - - eqn = sprintf("%s\n%s", eqn_1, eqn_2); - else # state derivative - RHS = varname(Name, insigs(1,1), insigs(1,2)); - LHS = sprintf("MTTdx_%s%s%s", Name, delim, name); - eqn = sprintf("%s := %s;", LHS, RHS); - endif - -endfunction DELETED mttroot/mtt/lib/comp/simple/C_alias.m Index: mttroot/mtt/lib/comp/simple/C_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/C_alias.m +++ mttroot/mtt/lib/comp/simple/C_alias.m @@ -1,18 +0,0 @@ -function alias = C_alias # Port aliases for C - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/07/02 14:49:14 peterg -## Initial revision -## -############################################################### - - alias.in = '1'; - alias.out = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/C_cause.m Index: mttroot/mtt/lib/comp/simple/C_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/C_cause.m +++ mttroot/mtt/lib/comp/simple/C_cause.m @@ -1,69 +0,0 @@ -function [bonds,status] = C_cause(bonds); -% C_cause - Unicausal multiport C component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function C_cause -% [bonds,status] = C_cause(bonds) - -%SUMMARY C: elementary C component -%DESCRIPTION Single port dynamic component -%DESCRIPTION Preferred integral causality (flow input) -%DESCRIPTION Cannot be bicausal - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/11/01 12:35:36 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -% Unicausal multiport C component -% Same causal pattern as R component - -% [bonds,status] = R_cause(bonds); - -% Set causality to preferred if not already set. -% Find the number of ports -[ports,junk] = size(bonds); - -% default undercausal status -statuses = -ones(ports,1); - -% Force unicausality but DONT set if not already set -preferred = -1; -for i = 1:ports - if (bonds(i,1)~=0)&(bonds(i,2)~=0) % Both bonds set - statuses(i) = bonds(i,1)~=bonds(i,2); - elseif bonds(i,2)~=0 % Bond 1 set - bonds(i,1) = bonds(i,2); - statuses(i) = 0; - elseif bonds(i,1)~=0 % Bond 2 set - bonds(i,2) = bonds(i,1); - statuses(i) = 0; - else # Don't set -# bonds(i,1) = preferred; -# bonds(i,2) = preferred; -# statuses(i) = 0; - end; -end; - -if max(statuses)==1 - status = 1; -elseif min(statuses)==-1 - status = -1; -else - status = 0; -end; - - DELETED mttroot/mtt/lib/comp/simple/C_eqn.m Index: mttroot/mtt/lib/comp/simple/C_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/C_eqn.m +++ mttroot/mtt/lib/comp/simple/C_eqn.m @@ -1,44 +0,0 @@ -function structure = C_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% C_eqn - equation generation for C component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function C_eqn -% structure = C_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 2003/01/07 10:10:14 gawthrop -% %% Uses new version of equation.m - passes component type to cr. -% %% -% %% Revision 1.2 1997/04/09 13:00:28 peterg -% %% *** empty log message *** -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - - -if nargin<8 - eqnfile = 'stdout'; -end; - -% Unicausal version -CorI = 1; -structure = cieqn(name,bond_number,bonds,direction,cr,args, structure, ... - CorI, eqnfile); - - - - - - - DELETED mttroot/mtt/lib/comp/simple/C_seqn.m Index: mttroot/mtt/lib/comp/simple/C_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/C_seqn.m +++ mttroot/mtt/lib/comp/simple/C_seqn.m @@ -1,11 +0,0 @@ -function [eqn,insigs,innames] = C_seqn (Name, name, cr, arg, outsig, insigs ,innames) - - ## usage: [eqn,inbonds] = C_seqn (Name, cr, arg, outbond, inbonds) - ## - ## - ## Multi port C's ?? - - - [eqn,insigs,innames] = CI_seqn ("C", Name, name, cr, arg, outsig, insigs ,innames); - -endfunction DELETED mttroot/mtt/lib/comp/simple/EBTF_alias.m Index: mttroot/mtt/lib/comp/simple/EBTF_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/EBTF_alias.m +++ mttroot/mtt/lib/comp/simple/EBTF_alias.m @@ -1,15 +0,0 @@ -function alias = EBTF_alias # Port aliases for EBTF - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/EBTF_cause.m Index: mttroot/mtt/lib/comp/simple/EBTF_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/EBTF_cause.m +++ mttroot/mtt/lib/comp/simple/EBTF_cause.m @@ -1,67 +0,0 @@ -function [bonds,status] = EBTF_cause(bonds); -% EBTF_cause - causality for a EBTF component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function EBTF_cause -% [bonds,status] = EBTF_cause(bonds) - -%SUMMARY EBTF: transformer component - bicausal on effort -%DESCRIPTION Energy conserving two-port -%DESCRIPTION e_1 f_1 = e_2 f_2 and e_1 and e_2 are both imposed. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - -% Copyright (c) P.J. Gawthrop, 1998. - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'EBTF')==0 - return -end - -% Effort must be imposed by both bonds -if (bonds(1,1)==-1)|(bonds(2,1)==-1) % Overcausal - status = 1; - return -end; - -bonds(1,1) = 1; -bonds(2,1) = 1; - -% Flow bond must have through causality -if (bonds(1,2)==0)&(bonds(2,2)==0) % Undercausal - status = -1; - return -end; - -if (bonds(1,2)==bonds(2,2))&(bonds(1,2)!=0) % Overcausal - status = 1; - return -end; - -%Set flow causality -if (bonds(1,2)!=0) - bonds(2,2) = -bonds(1,2) -else - bonds(1,2) = -bonds(2,2) -end; - -status = 0; - - - - - - - DELETED mttroot/mtt/lib/comp/simple/EBTF_eqn.m Index: mttroot/mtt/lib/comp/simple/EBTF_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/EBTF_eqn.m +++ mttroot/mtt/lib/comp/simple/EBTF_eqn.m @@ -1,51 +0,0 @@ -function structure = EBTF_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); - -if nargin<8 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'EBTF')==0 - return -end - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - - -% Effort -- no equation - -% Flow -effort1_name = varname(name,bond_number(1), 1); -effort2_name = varname(name,bond_number(2), 1); -flow1_name = varname(name,bond_number(1), -1); -flow2_name = varname(name,bond_number(2), -1); - -if f_1==-1 %Write flow on port 2 - fprintf(eqnfile,'%s := (%s/%s)*%s;\n' , ... - flow2_name, ... - effort1_name, ... - effort2_name, ... - flow1_name); -else %Write flow on port 1 - fprintf(eqnfile,'%s := (%s/%s)*%s;\n' , ... - flow1_name, ... - effort2_name, ... - effort1_name, ... - flow2_name); -end; - - - - - - - - - - - DELETED mttroot/mtt/lib/comp/simple/EMTF_alias.m Index: mttroot/mtt/lib/comp/simple/EMTF_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/EMTF_alias.m +++ mttroot/mtt/lib/comp/simple/EMTF_alias.m @@ -1,16 +0,0 @@ -function alias = EMTF_alias # Port aliases for EMTF - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - alias.mod = '3'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/EMTF_cause.m Index: mttroot/mtt/lib/comp/simple/EMTF_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/EMTF_cause.m +++ mttroot/mtt/lib/comp/simple/EMTF_cause.m @@ -1,83 +0,0 @@ -function [bonds,status] = EMTF_cause(bonds); -% EMTF_cause - causality for a modulated TF component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function EMTF_cause -% [bonds,status] = EMTF_cause(bonds) -% Causality for effort-modulated EMTF -% At the moment, modulation can NOT be inverted. - -%SUMMARY EMTF: effort-modulated transformer -%DESCRIPTION Energy conserving three-port -%DESCRIPTION Ports [1] and [2] as for TF -%DESCRIPTION e_1 = f(f_2); f_1 = f(e_2) -%DESCRIPTION Effort on port[3] modulates the CR - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -status = -1; - -% Check that there are exactly three bonds. -if check_bonds(bonds,3,'EMTF')==0 - return -end - -% Extract the bond information -TF_bonds = bonds(1:2,:); -e_3 = bonds(3,1); -f_3 = bonds(3,2); - -%Causality of EMTF is same as that of a TF on ports 1 and 2 -[TF_bonds,TF_status] = TF_cause(TF_bonds); - - -% Effort is the modulation - imposed on component. -if e_3==-1 % Conflict - mod_status_e = 1; -else % Do the rest of the causality - if e_3==0 % Set to the fixed causality - e_3 = 1; - end; - mod_status_e = 0; -end; - -% Zero flow imposed by component. -if f_3==-1 % Conflict - mod_status_f = 1; -else % Do the rest of the causality - if f_3==0 % Set to the fixed causality - f_3 = 1; - end; - mod_status_f = 0; -end; - -bonds = [TF_bonds - e_3 f_3]; - -if (TF_status == 0) & (mod_status_e == 0) & (mod_status_f == 0) - status = 0; -end; - -if (TF_status == 1) | (mod_status_e == 1) | (mod_status_f == 1) - status = 1; -end; - - - - - - - - DELETED mttroot/mtt/lib/comp/simple/EMTF_eqn.m Index: mttroot/mtt/lib/comp/simple/EMTF_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/EMTF_eqn.m +++ mttroot/mtt/lib/comp/simple/EMTF_eqn.m @@ -1,81 +0,0 @@ -function structure = EMTF_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 11:45:48 peterg -% %% *** empty log message *** -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -if nargin<8 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -if check_bonds(bonds,3,'EMTF')==0 - return -end - -% There are 3 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); -e_3 = bonds(3,1); - - -% Effort -outcause = 1; -incause = [1;1]; -if e_1==1 - outbond = bond_number(2); - inbond = bond_number([1 3]); - outport = 2; - inport = [1;3]; -else - outbond = bond_number(1); - inbond = bond_number([2 3]); - outport = 1; - inport = [2;3]; -end; - -eqn = equation("EMTF",name,cr,args,outbond,outcause,outport, ... - inbond,incause,inport); -fprintf(eqnfile, '%s',eqn); - -% Flow -outcause = -1; -incause = [-1;1]; -if f_1==-1 - outbond = bond_number(2); - inbond = bond_number([1 3]); - outport = 2; - inport = [1;3]; -else - outbond = bond_number(1); - inbond = bond_number([2 3]); - outport = 1; - inport = [2;3]; -end; - -eqn = equation("EMTF",name,cr,args,outbond,outcause,outport, ... - inbond,incause,inport); -fprintf(eqnfile, '%s',eqn); - -% Modulation: flow on port 3 is always zero - fprintf(eqnfile, '%s := 0;\n', ... - varname(name,bond_number(3), -1)); - - - - - - - DELETED mttroot/mtt/lib/comp/simple/ES_alias.m Index: mttroot/mtt/lib/comp/simple/ES_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/ES_alias.m +++ mttroot/mtt/lib/comp/simple/ES_alias.m @@ -1,24 +0,0 @@ -function alias = ES_alias # Port aliases for ES - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/07/02 14:47:53 peterg -## Initial revision -## -############################################################### - - alias.in = '1'; - alias.out = '2'; - - alias.e = '1'; - alias.s = '2'; - - alias.enthalpy = '1'; - alias.entropy = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/ES_cause.m Index: mttroot/mtt/lib/comp/simple/ES_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/ES_cause.m +++ mttroot/mtt/lib/comp/simple/ES_cause.m @@ -1,30 +0,0 @@ -function [bonds,status] = ES_cause(bonds); -% Causality for ES component - -%SUMMARY ES: converts thermal pseudobond to true bond and vv -%DESCRIPTION Port [e]: temperature (T) / enthalpy flow (E) bond -%DESCRIPTION Port [s]: temperature (T) / entropy flow (S) bond - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1997. - -status = -1; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'ES')==0 - return -end - -% Same causality as TF -[bonds,status] = TF_cause(bonds); - - DELETED mttroot/mtt/lib/comp/simple/ES_eqn.m Index: mttroot/mtt/lib/comp/simple/ES_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/ES_eqn.m +++ mttroot/mtt/lib/comp/simple/ES_eqn.m @@ -1,72 +0,0 @@ -function structure = ES_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% ES_eqn - equations for ES component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function ES_eqn -% ES_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/02/25 16:59:56 peterg -% %% Corrected enthalpy-entropy conversion -- use temp on the entropy side. -% %% -% %% Revision 1.1 1998/02/25 15:03:51 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1997. - - -if nargin<6 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -ports = 2; -if check_bonds(bonds,ports,'ES')==0 - return -end - - -% There are 2 ports; extract the information -e_bond = bonds(1,:); -s_bond = bonds(2,:); - -% The efforts are the same - but the enthalpy side has relative T -if e_bond(1)==1 %effort imposed on the enthalpy bond -% fprintf(eqnfile,'%s := %s + t_0;\n' , ... - fprintf(eqnfile,'%s := %s;\n' , ... - varname(name,bond_number(2), 1), ... - varname(name,bond_number(1), 1) ); -else %effort imposed on the entropy bond -% fprintf(eqnfile,'%s := %s - t_0;\n' , ... - fprintf(eqnfile,'%s := %s;\n' , ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(2), 1) ); -end; - -% The flows need to be converted - use the absolute temp on the -% entropy side -if e_bond(2)==-1 %flow imposed on the enthalpy bond - fprintf(eqnfile,'%s := %s/%s;\n' , ... - varname(name,bond_number(2), -1), ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(2), 1) ); -else % flow imposed on the entropy bond - fprintf(eqnfile,'%s := %s*%s;\n' , ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(2), -1), ... - varname(name,bond_number(2), 1) ); -end; DELETED mttroot/mtt/lib/comp/simple/FMR_alias.m Index: mttroot/mtt/lib/comp/simple/FMR_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/FMR_alias.m +++ mttroot/mtt/lib/comp/simple/FMR_alias.m @@ -1,19 +0,0 @@ -function alias = FMR_alias # Port aliases for FMR - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/07/02 14:47:14 peterg -## Initial revision -## -############################################################### - - alias.in = '1'; - alias.out = '2'; - alias.mod = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/FMR_cause.m Index: mttroot/mtt/lib/comp/simple/FMR_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/FMR_cause.m +++ mttroot/mtt/lib/comp/simple/FMR_cause.m @@ -1,83 +0,0 @@ -function [bonds,status] = FMR_cause(bonds); - -% Causality for Flow-modulated R component - -%SUMMARY FMR: flow-modulated resistor -%DESCRIPTION Port[in]: a simple one port resistor -%DESCRIPTION Port[out]: flow provides modulation for the resistor -%DESCRIPTION Used with the lin CR, with parameters flow,r this gives -%DESCRIPTION a resistance r*f_m where f_m is the flow on port [out] -%DESCRIPTION Can be bicausal - deduces modulation from e and f on port[in] - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1996/11/01 11:53:48 peterg -% %% Documentation -% %% -% %% Revision 1.2 1996/08/30 13:29:05 peter -% %% Error check on bond numbers. -% %% -% %% Revision 1.1 1996/08/09 08:28:02 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -status = -1; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'FMR')==0 - return -end - - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - -% e_2 must be effort causality (imposes zero effort) - if e_2 == 1 % Conflict - status = 1; - else % Do the rest of the causality - if e_2==0 % Set to the fixed causality - e_2 = -1; - end; - - number_set = sum(sum([e_1 f_1 f_2]~=zeros(1,3) )); - if number_set<2 % Under causal - status = -1; - elseif number_set==2 % Set the causality - if f_2 == -1 % Unicausal - if e_1 == 0 - e_1 = f_1; - else - f_1 = e_1; - end; - elseif f_2 == 1 % Bicausal - e_1 = 1; - f_1 = -1; - elseif f_2 == 0 - if e_1==f_1 - f_2 = -1; % Unicausal - else - f_2 = 1; % Bicausal - end; - end; - status = 0; - elseif number_set==3 % Check the causality - if ( (f_2==-1)&(e_1~=f_1) )|( (f_2==1)&(e_1==f_1) ) - status = 1; - else - status = 0; - end; - end; - end; - - bonds = [e_1 f_1 - e_2 f_2]; - DELETED mttroot/mtt/lib/comp/simple/FMR_eqn.m Index: mttroot/mtt/lib/comp/simple/FMR_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/FMR_eqn.m +++ mttroot/mtt/lib/comp/simple/FMR_eqn.m @@ -1,108 +0,0 @@ -function structure = FMR_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% FMR_eqn - equations for flow-modulated resistor -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function FMR_eqn -% FMR_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1996/09/12 19:30:31 peter -% %% Updated to use new eqaution.m -% %% -% %% Revision 1.2 1996/08/30 18:35:43 peter -% %% New name argument added. -% %% -% %% Revision 1.1 1996/08/30 16:38:25 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - - -if nargin<6 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -ports = 2; -if check_bonds(bonds,ports,'FMR')==0 - return -end - - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - -if length(cr)==0 % Then do default unity CR - if f_2 == -1 % Standard with modulation - if f_1 == 1 % Flow out - op = '*'; - else % Effort out - op = '/'; - end; - - fprintf(eqnfile, '%s := %s%s%s;\n', ... - varname(name,bond_number(1), -e_1), ... - varname(name,bond_number(1), e_1), ... - op, ... - varname(name,bond_number(2), -1)); - else % Deduce modulation - - fprintf(eqnfile, '%s := %s/%s;\n', ... - varname(name,bond_number(2), -1), ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(1), 1)); - end; -else % write the full works - if f_2 == -1 % Standard with modulation - outport = 1; - outnumber = bond_number(1); - if f_1 == 1 % Flow out - outcause = -1; - else % Effort out - outcause = 1; - end; - incause = [-outcause; -1]; % Flow input on port 2 - eqn = equation("FMR",name,cr,args,outnumber,outcause,outport, ... - bond_number,incause,1:ports); - fprintf(eqnfile, '%s',eqn); - - else % Modulation is output - outport = 2; - outcause = -1; - outnumber = bond_number(2); - innumber = bond_number(1)*[1;1]; - incause = [1; -1]; % Effort and flow on port 1 - inports = [1; 1]; - eqn = equation("FMR",name,cr,args,outnumber,outcause,outport, ... - innumber,incause,inports); - fprintf(eqnfile, '%s',eqn); - end; -end; - - % Effort on port 2 is always zero - fprintf(eqnfile, '%s := 0;\n', ... - varname(name,bond_number(2), 1)); - - - - - - - - - DELETED mttroot/mtt/lib/comp/simple/FP_alias.m Index: mttroot/mtt/lib/comp/simple/FP_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/FP_alias.m +++ mttroot/mtt/lib/comp/simple/FP_alias.m @@ -1,24 +0,0 @@ -function alias = FP_alias # Port aliases for FP - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/07/07 15:01:09 peterg -## Named ports correctely f --> 1, p --> 2 -## -## Revision 1.1 1998/07/02 14:46:42 peterg -## Initial revision -## -############################################################### - - alias.f = '1'; - alias.p = '2'; - - alias.s = '1'; - alias.e = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/FP_cause.m Index: mttroot/mtt/lib/comp/simple/FP_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/FP_cause.m +++ mttroot/mtt/lib/comp/simple/FP_cause.m @@ -1,40 +0,0 @@ -function [bonds,status] = FP_cause(bonds); -% Causality for FP component - -%SUMMARY FP: converts true bond to a pseudo bond with power flow as flow -%DESCRIPTION Port [f]: True bond with a flow covariable -%DESCRIPTION Port [p]: Pseudo bond with power (ef) as flow variable - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/06/29 09:56:24 peterg -% %% Changed name to FP from ES -% %% -% %% Revision 1.1 1998/06/29 09:56:02 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1997/09/04 08:34:53 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1997. - -status = -1; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'FP')==0 - return -end - -% Same causality as TF -[bonds,status] = TF_cause(bonds); - - - DELETED mttroot/mtt/lib/comp/simple/FP_eqn.m Index: mttroot/mtt/lib/comp/simple/FP_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/FP_eqn.m +++ mttroot/mtt/lib/comp/simple/FP_eqn.m @@ -1,82 +0,0 @@ -function structure = FP_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% FP_eqn - equations for FP component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function FP_eqn -% FP_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/07/07 15:00:04 peterg -% %% Replaced e_ by f_ -% %% s_ by p_ -% %% -% %% Revision 1.2 1998/06/29 09:54:16 peterg -% %% Changed name from ES to FP -% %% -% %% Revision 1.1 1998/06/29 09:53:22 peterg -% %% Initial revision -% %% -% %% Revision 1.3 1998/03/27 10:59:43 peterg -% %% Zapped t_0 again ... -% %% -% %% Revision 1.2 1998/02/25 16:59:56 peterg -% %% Corrected enthalpy-entropy conversion -- use temp on the entropy side. -% %% -% %% Revision 1.1 1998/02/25 15:03:51 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1997. - - -if nargin<6 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -ports = 2; -if check_bonds(bonds,ports,'FP')==0 - return -end - - -% There are 2 ports; extract the information -f_bond = bonds(1,:); -p_bond = bonds(2,:); - -% The efforts are the same -if p_bond(1)==1 %effort imposed on the pseudo bond - fprintf(eqnfile,'%s := %s;\n' , ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(2), 1) ); -else %effort imposed on the true bond - fprintf(eqnfile,'%s := %s;\n' , ... - varname(name,bond_number(2), 1), ... - varname(name,bond_number(1), 1) ); -end; - -% The flows need to be converted -if p_bond(2)==-1 %flow imposed on the pseudo bond - fprintf(eqnfile,'%s := %s/%s;\n' , ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(2), -1), ... - varname(name,bond_number(1), 1) ); -else % flow imposed on the true bond - fprintf(eqnfile,'%s := %s*%s;\n' , ... - varname(name,bond_number(2), -1), ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(2), 1) ); -end; DELETED mttroot/mtt/lib/comp/simple/GY_alias.m Index: mttroot/mtt/lib/comp/simple/GY_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/GY_alias.m +++ mttroot/mtt/lib/comp/simple/GY_alias.m @@ -1,15 +0,0 @@ -function alias = GY_alias # Port aliases for GY - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/GY_cause.m Index: mttroot/mtt/lib/comp/simple/GY_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/GY_cause.m +++ mttroot/mtt/lib/comp/simple/GY_cause.m @@ -1,36 +0,0 @@ -function [bonds,status] = GY_cause(bonds); -% GY_cause - causality for GY component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function GY_cause -% [bonds,status] = GY_cause(bonds); - -%SUMMARY GY: elementary gyrator component -%DESCRIPTION Energy conserving two-port -%DESCRIPTION e_1 = f(f_2); f_1 = f(e_2) - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1997/09/12 09:42:12 peterg -% %% Fixed causality bug. -% %% -% %% Revision 1.1 1996/11/01 12:04:25 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -%Causality of GY is same as that of a TF but with flipped effort/flow -bonds(2,:) = - bonds(2,2:-1:1); -[bonds,status] = TF_cause(bonds); -bonds(2,:) = - bonds(2,2:-1:1); DELETED mttroot/mtt/lib/comp/simple/GY_eqn.m Index: mttroot/mtt/lib/comp/simple/GY_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/GY_eqn.m +++ mttroot/mtt/lib/comp/simple/GY_eqn.m @@ -1,80 +0,0 @@ -function structure = GY_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% GY_eqn - equations for GY component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function GY_eqn -% structure = GY_eqn(bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 11:51:06 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - - -if nargin<8 - eqnfile = 'stdout'; -end; - - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - - -% Effort - flow -if e_1==1 - outbond = bond_number(2); - inbond = bond_number(1); - outport = 2; - inport = 1; - outcause = -1; - incause = 1; -else - outbond = bond_number(1); - inbond = bond_number(2); - outport = 1; - inport = 2; - outcause = 1; - incause = -1; -end; - -eqn = equation("GY",name,cr,args,outbond,outcause,outport, ... - inbond,incause,inport); -fprintf(eqnfile, '%s',eqn); - -% Flow-effort -if f_1==-1 - outbond = bond_number(2); - inbond = bond_number(1); - outport = 2; - inport = 1; - outcause = 1; - incause = -1; -else - outbond = bond_number(1); - inbond = bond_number(2); - outport = 1; - inport = 2; - outcause = -1; - incause = 1; -end; - -eqn = equation("GY",name,cr,args,outbond,outcause,outport, ... - inbond,incause,inport); -fprintf(eqnfile, '%s',eqn); - DELETED mttroot/mtt/lib/comp/simple/GY_seqn.m Index: mttroot/mtt/lib/comp/simple/GY_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/GY_seqn.m +++ mttroot/mtt/lib/comp/simple/GY_seqn.m @@ -1,27 +0,0 @@ -function [eqn,insigs,innames] = GY_seqn (Name, cr, arg, outsig, insigs, innames) - - ## usage: [eqn,inbonds] = GY_seqn (Name, cr, arg, outbond, inbonds) - ## - ## - ## GYs have two ports; the input and output ports must be different - N = mtt_check_sigs (outsig,insigs); - - if N!=2 - error("A GY must have exactly two ports"); - else - if insigs(1,3)==outsig(3) # First signal is on output port - inport = 2; - else - inport = 1; - endif - endif - - insig = insigs(inport,:); - inname = innames(inport,:); - eqn = equation("""GY""",Name,cr,arg,outsig(1),outsig(2),outsig(3), ... - insig(:,1),insig(:,2),inport); - - insigs = insig; # Set the correct input signals - innames = inname; # Set the correct input names - -endfunction DELETED mttroot/mtt/lib/comp/simple/I_alias.m Index: mttroot/mtt/lib/comp/simple/I_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/I_alias.m +++ mttroot/mtt/lib/comp/simple/I_alias.m @@ -1,15 +0,0 @@ -function alias = I_alias # Port aliases for I - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '1'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/I_cause.m Index: mttroot/mtt/lib/comp/simple/I_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/I_cause.m +++ mttroot/mtt/lib/comp/simple/I_cause.m @@ -1,30 +0,0 @@ -function [bonds,status] = I_cause(bonds); -% I_cause - Unicausal multiport C component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function I_cause -% [bonds,status] = I_cause(bonds) - -%SUMMARY I: elementary I component -%DESCRIPTION Single port dynamic component -%DESCRIPTION Preferred integral causality (effort input) -%DESCRIPTION Cannot be bicausal - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -% Same causal pattern as R component -[bonds,status] = R_cause(bonds); - - DELETED mttroot/mtt/lib/comp/simple/I_eqn.m Index: mttroot/mtt/lib/comp/simple/I_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/I_eqn.m +++ mttroot/mtt/lib/comp/simple/I_eqn.m @@ -1,32 +0,0 @@ -function structure = I_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% I_eqn - equations for I component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function I_eqn -% structure = I_eqn(bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - - -if nargin<8 - eqnfile = 'stdout'; -end; - -% Unicausal version -CorI = -1; -structure = cieqn(name,bond_number,bonds,direction,cr,args, structure, ... - CorI, eqnfile); - DELETED mttroot/mtt/lib/comp/simple/I_seqn.m Index: mttroot/mtt/lib/comp/simple/I_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/I_seqn.m +++ mttroot/mtt/lib/comp/simple/I_seqn.m @@ -1,11 +0,0 @@ -function [eqn,insigs,innames] = I_seqn (Name, name, cr, arg, outsig, insigs ,innames) - - ## usage: [eqn,inbonds] = I_seqn (Name, cr, arg, outbond, inbonds) - ## - ## - ## Multi port I's ?? - - - [eqn,insigs,innames] = CI_seqn ("I", Name, name, cr, arg, outsig, insigs ,innames); - -endfunction DELETED mttroot/mtt/lib/comp/simple/PS_alias.m Index: mttroot/mtt/lib/comp/simple/PS_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/PS_alias.m +++ mttroot/mtt/lib/comp/simple/PS_alias.m @@ -1,16 +0,0 @@ -function alias = PS_alias # Port aliases for PS - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - alias.power = '3'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/PS_cause.m Index: mttroot/mtt/lib/comp/simple/PS_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/PS_cause.m +++ mttroot/mtt/lib/comp/simple/PS_cause.m @@ -1,62 +0,0 @@ -function [bonds,status] = PS_cause(bonds); -% Causality for PS component - -%SUMMARY PS: Power sensor -%DESCRIPTION Port[in]: Inflowing bond -%DESCRIPTION Port[out]: Outflowing bond e_2=e_1; f_2=f_1. -%DESCRIPTION Port[power]: f = power = e_1*f_1 = e_2*f_2 - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1997. - -status = -1; - -% Check that there are exactly three bonds. -if check_bonds(bonds,3,'PS')==0 - return -end - -% Do the [in] and [out] ports -- like a TF -inout_bonds = bonds(1:2,:); -[inout_bonds,inout_status] = TF_cause(inout_bonds); - -% Do the power port -- must have flow out and effort in -power_bonds = bonds(3,:); -for i = 1:2 - if (power_bonds(i)==1) - power_status = 0; - elseif (power_bonds(i)==0) - power_bonds(i)==1; - power_status = 0; - else - power_status = 1; - end; -end; - - - - - - -% Reconstruct the bonds -bonds = [inout_bonds; power_bonds]; - -% Generate an overall status -if (inout_status==1)|(power_status==1) - status = 1; -elseif - (inout_status==-1)|(power_status==-1) - status=-1; -else - status = 0; -end; - - DELETED mttroot/mtt/lib/comp/simple/PS_eqn.m Index: mttroot/mtt/lib/comp/simple/PS_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/PS_eqn.m +++ mttroot/mtt/lib/comp/simple/PS_eqn.m @@ -1,56 +0,0 @@ -function structure = PS_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% PS_eqn - equations for a power sensor -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function PS_eqn -% PS_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Copyright (c) P.J. Gawthrop, 1997. - - -if nargin<6 - eqnfile = 'stdout'; -end; - -% Check that there are exactly three bonds. -ports = 3; -if check_bonds(bonds,ports,'PS')==0 - return -end - - -% There are 3 ports; extract the information -inout_bonds = bonds(1:2,:); -power_bonds = bonds(3,:); - -inout_direction = direction(1:2,:); -power_direction = direction(3,:); - -% Do ports [in] and [out] - unit gain TF. -structure = TF_eqn(name,bond_number(1:2),inout_bonds,inout_direction, ... -'lin','effort,1', structure,eqnfile); - -% Do port [power] - the power bit. -% This computes f_2 = e_1*f_1 -fprintf(eqnfile,'%s := %s*%s;\n' , ... - varname(name,bond_number(3), -power_bonds(1)), ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(1), -1) ); - - - DELETED mttroot/mtt/lib/comp/simple/RST_alias.m Index: mttroot/mtt/lib/comp/simple/RST_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/RST_alias.m +++ mttroot/mtt/lib/comp/simple/RST_alias.m @@ -1,15 +0,0 @@ -function alias = RST_alias # Port aliases for RST - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/RST_cause.m Index: mttroot/mtt/lib/comp/simple/RST_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/RST_cause.m +++ mttroot/mtt/lib/comp/simple/RST_cause.m @@ -1,30 +0,0 @@ -function [bonds,status] = RST_cause(bonds); -% Causality for RST component - -%SUMMARY RST: thermal resistor with entropy generation -%DESCRIPTION Port[in]: a simple one port resistor but: -%DESCRIPTION flow is multiplied by e_out -%DESCRIPTION Port[out]: thermal power - effort is temperature, flow is entropy flow -%DESCRIPTION Not bicausal (yet) - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1997. - -status = -1; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'RST')==0 - return -end - -% Same causality as RS -[bonds,status] = RS_cause(bonds); - DELETED mttroot/mtt/lib/comp/simple/RST_eqn.m Index: mttroot/mtt/lib/comp/simple/RST_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/RST_eqn.m +++ mttroot/mtt/lib/comp/simple/RST_eqn.m @@ -1,76 +0,0 @@ -function structure = RT_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% RT_eqn - equations for flow-modulated resistor -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function RT_eqn -% RT_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% VeRTion control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/09/03 09:30:45 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Copyright (c) P.J. Gawthrop, 1997. - - -if nargin<6 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -ports = 2; -if check_bonds(bonds,ports,'RT')==0 - return -end - - -% There are 2 ports; extract the information -in_bonds = bonds(1,:); -out_bonds = bonds(2,:); -in_direction = direction(1,:); -out_direction = direction(2,:); - -% Do port [in] - a standard resistor -- except for modulation by e_2 -structure = R_eqn(name,bond_number(1),in_bonds,in_direction,cr,args, ... - structure,eqnfile); - -% Resistance is multiplied by effort e_1 + e_2 (ie effort on upsteam side of -% the 1 junction) -if in_bonds(1) == 1 % Flow output - divide by e_1+e_2 - fprintf(eqnfile,'%s := %s/(%s+%s);\n' , ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(2), 1) ); -else - % Effort output - multiply by e_1+e_2 - fprintf(eqnfile,'%s := %s*(%s+%s);\n' , ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(2), 1) ); -end; - - -% Do port [out] - the thermal bit. RT is power conserving. -% This computes f_2 = e_1*f_1/e_2 or e_2 = e_1*f_1/f_2 -fprintf(eqnfile,'%s := %s*%s/%s;\n' , ... - varname(name,bond_number(2), -out_bonds(1)), ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(2), out_bonds(1)) ); - - DELETED mttroot/mtt/lib/comp/simple/RS_alias.m Index: mttroot/mtt/lib/comp/simple/RS_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/RS_alias.m +++ mttroot/mtt/lib/comp/simple/RS_alias.m @@ -1,15 +0,0 @@ -function alias = RS_alias # Port aliases for RS - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/RS_cause.m Index: mttroot/mtt/lib/comp/simple/RS_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/RS_cause.m +++ mttroot/mtt/lib/comp/simple/RS_cause.m @@ -1,48 +0,0 @@ -function [bonds,status] = RS_cause(bonds); -% Causality for RS component - -%SUMMARY RS: resistor with entropy generation -%DESCRIPTION Port[in]: a simple one port resistor -%DESCRIPTION Port[out]: thermal power - effort is temperature, flow is entropy flow -%DESCRIPTION Not bicausal (yet) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Copyright (c) P.J. Gawthrop, 1997. - -status = -1; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'RS')==0 - return -end - -% There are 2 ports; extract the information -in_bonds = bonds(1,:); -out_bonds = bonds(2,:); - -% Port [in] is an ordinary resistor -[in_bonds,in_status] = R_cause(in_bonds); - -% Port [out] has the same causality pattern as an ordinary resistor -[out_bonds,out_status] = R_cause(out_bonds); - -% Reconstruct the bonds -bonds = [in_bonds; out_bonds]; - -% Generate an overall status -if (in_status==1)|(out_status==1) - status = 1; -elseif - (in_status==-1)|(out_status==-1) - status=-1; -else - status = 0; -end; - - DELETED mttroot/mtt/lib/comp/simple/RS_eqn.m Index: mttroot/mtt/lib/comp/simple/RS_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/RS_eqn.m +++ mttroot/mtt/lib/comp/simple/RS_eqn.m @@ -1,55 +0,0 @@ -function structure = RS_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% RS_eqn - equations for flow-modulated resistor -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function RS_eqn -% RS_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Copyright (c) P.J. Gawthrop, 1997. - - -if nargin<6 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -ports = 2; -if check_bonds(bonds,ports,'RS')==0 - return -end - - -% There are 2 ports; extract the information -in_bonds = bonds(1,:); -out_bonds = bonds(2,:); -in_direction = direction(1,:); -out_direction = direction(2,:); - -% Do port [in] - a standard resistor -structure = R_eqn(name,bond_number(1),in_bonds,in_direction,cr,args, ... - structure,eqnfile); - -% Do port [out] - the thermal bit. RS is power conserving. -% This computes f_2 = e_1*f_1/e_2 or e_2 = e_1*f_1/f_2 -fprintf(eqnfile,'%s := %s*%s/%s;\n' , ... - varname(name,bond_number(2), -out_bonds(1)), ... - varname(name,bond_number(1), 1), ... - varname(name,bond_number(1), -1), ... - varname(name,bond_number(2), out_bonds(1)) ); - - DELETED mttroot/mtt/lib/comp/simple/R_alias.m Index: mttroot/mtt/lib/comp/simple/R_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/R_alias.m +++ mttroot/mtt/lib/comp/simple/R_alias.m @@ -1,15 +0,0 @@ -function alias = R_alias # Port aliases for R - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '1'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/R_cause.m Index: mttroot/mtt/lib/comp/simple/R_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/R_cause.m +++ mttroot/mtt/lib/comp/simple/R_cause.m @@ -1,56 +0,0 @@ -function [bonds,status] = R_cause(bonds); -% R_cause - Causality function for a (multi-port) unicausal R component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function R_cause -% [bonds,status] = R_cause(bonds) - -%SUMMARY R: R component -%DESCRIPTION Multiport component with no dynamics -%DESCRIPTION Cannot be bicausal - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/08/30 19:05:08 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - - -% Find the number of ports -[ports,junk] = size(bonds); - -% default undercausal status -statuses = -ones(ports,1); - -% Force unicausality -for i = 1:ports - if (bonds(i,1)~=0)&(bonds(i,2)~=0) % Both bonds set - statuses(i) = bonds(i,1)~=bonds(i,2); - elseif bonds(i,2)~=0 % Bond 1 set - bonds(i,1) = bonds(i,2); - statuses(i) = 0; - elseif bonds(i,1)~=0 % Bond 2 set - bonds(i,2) = bonds(i,1); - statuses(i) = 0; - end; -end; - -if max(statuses)==1 - status = 1; -elseif min(statuses)==-1 - status = -1; -else - status = 0; -end; - - DELETED mttroot/mtt/lib/comp/simple/R_eqn.m Index: mttroot/mtt/lib/comp/simple/R_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/R_eqn.m +++ mttroot/mtt/lib/comp/simple/R_eqn.m @@ -1,63 +0,0 @@ -function structure = R_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% R_eqn - Equation function for a (multi-port) unicausal R component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function R_eqn -% structure = R_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 1996/09/12 19:28:11 peter -% %% Added defaults (with no constitutive relationship) -% %% -% %% Revision 1.3 1996/09/12 16:40:45 peter -% %% Now does a default (when no constitutive relationship) with a unit -% %% constitutive relationship on each port. -% %% -% %% Revision 1.2 1996/09/12 13:12:04 peter -% %% Removed an fprintf that was a mistake. -% %% -% %% Revision 1.1 1996/09/12 11:00:56 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -if nargin<8 - eqnfile = 'stdout'; -end; - - -% Find the number of ports -[ports,junk] = size(bonds); - - -for outport = 1:ports - outcause = -bonds(outport,1); - outnumber = bond_number(outport); - if length(cr)>0 - incause = bonds(:,1); - inport = 1:ports; - inbond = bond_number; - else % default if no cr: unit cr on each port - incause = bonds(outport,1); - inport = outport; - inbond = outnumber; - end; - - eqn = equation("R",name,cr,args,outnumber,outcause,outport, ... - inbond,incause,inport); - fprintf(eqnfile, '%s',eqn); -end; - - DELETED mttroot/mtt/lib/comp/simple/R_seqn.m Index: mttroot/mtt/lib/comp/simple/R_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/R_seqn.m +++ mttroot/mtt/lib/comp/simple/R_seqn.m @@ -1,18 +0,0 @@ -function [eqn,insigs,innames] = R_seqn (Name, name, cr, arg, outsig, insigs, innames) - - ## usage: [eqn,inbonds] = R_seqn (Name, cr, arg, outbond, inbonds) - ## - ## - ## Multi port R's use all potential signals - - N = mtt_check_sigs (outsig,insigs); - - inports = [1:N]; - eqn = equation("""R""",Name,cr,arg,outsig(1),outsig(2),outsig(3), ... - insigs(:,1),insigs(:,2),inports); - - ## No change - ## insigs = insigs; - ## innames = innames; - -endfunction DELETED mttroot/mtt/lib/comp/simple/SS_alias.m Index: mttroot/mtt/lib/comp/simple/SS_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/SS_alias.m +++ mttroot/mtt/lib/comp/simple/SS_alias.m @@ -1,28 +0,0 @@ -function alias = SS_alias # Port aliases for SS - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1998/07/28 19:08:22 peterg -## Some vector aliases added. -## -## Revision 1.1 1998/07/02 14:37:42 peterg -## Initial revision -## -############################################################### - - alias.in = "1"; - alias.out = "1"; - - MAX = 10; - value = "1"; - for i=1:MAX - eval(sprintf("alias.in%i = \"%s\";", i, value)); - eval(sprintf("alias.out%i = \"%s\";", i, value)); - value = sprintf("%s,%i",value,i+1); - endfor; -endfunction - - DELETED mttroot/mtt/lib/comp/simple/SS_cause.m Index: mttroot/mtt/lib/comp/simple/SS_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/SS_cause.m +++ mttroot/mtt/lib/comp/simple/SS_cause.m @@ -1,55 +0,0 @@ -function [bonds,status] = SS_cause(bonds) -% SS_cause = causality for an SS component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function SS_cause -% [bonds,status] = SS_cause(bonds) - -%SUMMARY SS: source-sensor component -%DESCRIPTION multi-port source sensor component -%DESCRIPTION when the name is [name], acts as port `name' of a system. -%DESCRIPTION may be bicausal - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/11/01 14:41:14 peterg -% %% Check correct bonds -% %% -% %% Revision 1.1 1996/11/01 12:18:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -## Check that there is exactly one bonds. -##if check_bonds(bonds,1,'SS')==0 -## return -##end - -disp("Starting SS_cause"); - -[n_bonds,junk] = size(bonds); -Status=zeros(n_bonds,1); -for i=1:n_bonds - if (bonds(i,1)==0)|(bonds(i,2)==0) % Under causal - Status(i) = -1; - else % causal - Status(i) = 0; - end; -end; -status=min(Status); - - - - - - - DELETED mttroot/mtt/lib/comp/simple/SS_eqn.m Index: mttroot/mtt/lib/comp/simple/SS_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/SS_eqn.m +++ mttroot/mtt/lib/comp/simple/SS_eqn.m @@ -1,267 +0,0 @@ -function structure = SS_eqn(name,Bond_number,Bonds,Direction,cr,args, ... - structure,filenum); - - disp("SS_eqn"); - name,Bond_number,Bonds,Direction - - ## Set up globals to count the component inputs and outputs. This relies on - ## the named SS (the ports) being in the correct order. Using globals here - ## avoids changing the common argument list for all _eqn files for something - ## which is only used for named SS components. - global local_u_index - global local_y_index - global at_top_level - - ## SS_eqn - equations for SS component - ## - ## ####################################### - ## ###### Model Transformation Tools ##### - ## ###################################### - ## - ## Matlab function SS_eqn - ## structure = SS_eqn(name,bond_number,bonds,direction,cr,args, ... - ## structure,filenum); - - - ## Copyright (c) P.J. Gawthrop, 1996. - - - ## ############################################################### - ## ### Version control history - ## ############################################################### - ## ### $Id$ - ## ### $Log$ - ## ### Revision 1.27 2005/03/21 10:34:47 gawthrop - ## ### Tidied. - ## ### - ## ### Revision 1.26 2004/08/29 13:11:21 geraint - ## ### Writes MTTyz vector in the same format as MTTx and MTTy: MTTyz($d,1) - ## ## - ## ### Revision 1.25 2003/01/07 18:09:21 geraint - ## ### More informative error message. - ## ## - ## ### Revision 1.24 1999/10/22 02:20:32 peterg - ## ### Changed error handleing of number of attributes >2 - ## ## - ## ### Revision 1.23 1998/12/03 16:46:16 peterg - ## ### Deblanked attributes so that zero attribute works. - ## ## - ## ### Revision 1.22 1998/07/28 19:05:46 peterg - ## ### Fixed a few bugs. - ## ## - ## ### Revision 1.21 1998/07/28 14:21:31 peterg - ## ### Vector SS ports. - ## ## - ## ### Revision 1.20 1998/07/08 14:42:52 peterg - ## ### Removed the annoying info message - it causes problems with big - ## ### systems - ## ## - ## ### Revision 1.19 1998/07/08 11:33:54 peterg - ## ### Replace mtt_info by mtt_error when appropriate - ## ## - ## ### Revision 1.18 1998/07/08 11:30:45 peterg - ## ### Removed second (fileID) argument from mtt_info - ## ## - ## ### Revision 1.17 1998/07/04 07:15:44 peterg - ## ### Back under RCS - ## ## - ## ### Revision 1.16 1998/04/11 19:07:16 peterg - ## ### Now do named ports as ordinary ports iff at top level. - ## ### --- not yet complete, need to pass necesssary info though to this - ## ### function - ## ## - ## ### Revision 1.15 1997/12/16 19:16:07 peterg - ## ### Added unknown input to the effort part. - ## ## - ## ### Revision 1.14 1997/12/16 18:25:19 peterg - ## ### Added unknown_input attribure to flow -- effort still needs doing - ## ## - ## ### Revision 1.13 1997/09/18 13:15:15 peterg - ## ### Fixed incorrect error message flagging inappropriate flow outputs - ## ### -- used to give the effort rather than the flow in the error message. - ## ## - ## ### Revision 1.12 1997/08/26 07:51:30 peterg - ## ### Now counts the local input and outputs by order of appearence rather - ## ### than by port number - it therfore handles ports with bicausality correctely. - ## ## - ## ### Revision 1.11 1997/05/09 08:21:07 peterg - ## ### Explicit computation of port number -- avoids str2num - ## ## - ## ### Revision 1.10 1997/03/22 17:13:03 peterg - ## ### Fixed bug for port nos. > 1 digit! - ## ## - ## ### Revision 1.9 1997/03/22 15:50:59 peterg - ## ### Changed #1.0f to %d format. - ## ## - ## ### Revision 1.8 1996/12/10 16:52:29 peterg - ## ### Detect null string using strcmp, not length. - ## ### Put filnum argument to mtt_info. - ## ## - ## ### Revision 1.7 1996/12/07 17:17:40 peterg - ## ### Added some ; - ## ## - ## ### Revision 1.6 1996/12/05 09:49:09 peterg - ## ### Explicit computation of port number from string. - ## ## - ## ### Revision 1.5 1996/12/04 21:27:53 peterg - ## ### Replaced str2num by sprintf - ## ## - ## ### Revision 1.4 1996/08/18 20:06:21 peter - ## ### Included zero outputs. - ## ## - ## ### Revision 1.3 1996/08/09 14:08:04 peter - ## ### Empty effort and flow attributes replaced by 'external'. - ## ## - ## ### Revision 1.2 1996/08/08 16:38:19 peter - ## ### Changed to filenumer type of fprintf - ## ## - ## ### Revision 1.1 1996/08/08 16:19:08 peter - ## ### Initial revision - ## ## - ## ############################################################### - - - ## The string 'cr' contains the effort attributes; - ## 'arg' contains the flow attributes. - ## external indicates an external variable - ## internal indicates an internal variable - ## anything else is the name of a constant. - ## Blank is taken to be external - ## If its a numbered port: - ## cr contains 'MTT_port' - ## arg contains port number - - if (strcmp(cr,"SS")) # Then its the standard file - a = char(strsplit(args,",")) - [N,M]=size(a); - if (N~=2) # Must have 2 arguments - mtt_error(sprintf("SS should have 2 args not %i", N)); - endif - effort_attribute = deblank(a(1,:)); - flow_attribute = deblank(a(2,:)); - else # Old style file - effort_attribute = cr; - flow_attribute = args; - endif - - ## Default attributes - if strcmp(effort_attribute,"") - effort_attribute = "external"; - endif - - if strcmp(flow_attribute,"") - flow_attribute = "external"; - endif - - inputs = structure(3); - outputs = structure(4); - zero_outputs = structure(5); - unknown_inputs = structure(6); - - n_bonds = length(Bond_number) # Multi port? - for i=1:n_bonds # Loop over all the bonds - bond_number = Bond_number(i); - bonds = Bonds(i,:); - direction = Direction(i,:); - Named_Port = name(1)=="["; - if Named_Port - sname = name(2:length(name)); #Strip the [] - else - sname = name; - endif - - if Named_Port&&~at_top_level # It's a named port - ## Effort - if bonds(1,1)==-1 # Source - local_u_index = local_u_index + 1 - fprintf(filenum, "%s := %s_MTTu%d;\n", ... - varname(sname, bond_number,1), sname, local_u_index); - else # Sensor - local_y_index = local_y_index + 1 - fprintf(filenum, "%s_MTTy%d := %s;\n", ... - sname, local_y_index, varname(sname, bond_number,1)); - endif - - ## Flow - if bonds(1,2)==1 # Source - local_u_index = local_u_index + 1 - fprintf(filenum, "%s := %s_MTTu%d;\n", ... - varname(sname, bond_number,-1), sname, local_u_index); - else # Sensor - local_y_index = local_y_index + 1 - fprintf(filenum, "%s_MTTy%d := %s;\n", ... - sname, local_y_index, varname(sname, bond_number,-1)); - endif - else # Now do SS which are not ports - ## Effort - if strcmp(effort_attribute, "external") - if bonds(1,1)==-1 # Source - inputs = inputs+1; - fprintf(filenum, "%s := MTTu(%d,1);\n", ... - varname(sname, bond_number,1),inputs); - else # Sensor - outputs = outputs+1; - fprintf(filenum, "MTTy(%d,1) := %s;\n", ... - outputs, varname(sname, bond_number,1)); - endif - elseif strcmp(effort_attribute, "unknown") # Unknown input - unknown_inputs = unknown_inputs + 1; - fprintf(filenum, "%s := MTTUi%d;\n", ... - varname(sname, bond_number,1), unknown_inputs); - elseif strcmp(effort_attribute, "internal") - ## Do nothing - else - if bonds(1,1)==-1 # Named or unknown source - fprintf(filenum, "%s := %s;\n", ... - varname(sname, bond_number,1), effort_attribute); - else # Sensor - if strcmp(effort_attribute, "zero") #Zero output - zero_outputs = zero_outputs + 1; - fprintf(filenum, "MTTyz(%d,1) := %s;\n", ... - zero_outputs, varname(sname, bond_number,1)); - else - mtt_error([effort_attribute, " not appropriate for an output (", name, ")"]); - endif - endif - endif - - ## Flow - if strcmp(flow_attribute, "external") - if bonds(1,2)==1 # Source - inputs = inputs+1 - fprintf(filenum, "%s := MTTu(%d,1);\n", varname(sname, bond_number,-1),inputs); - else # Sensor - outputs = outputs+1 - fprintf(filenum, "MTTy(%d,1) := %s;\n", outputs, ... - varname(sname, bond_number,-1)); - endif - elseif strcmp(flow_attribute, "unknown") # Unknown input - unknown_inputs = unknown_inputs + 1 - fprintf(filenum, "%s := MTTUi%d;\n", ... - varname(sname, bond_number,-1), unknown_inputs); - elseif strcmp(flow_attribute, "internal") - ## Do nothing - else # Named constant - if bonds(1,2)==1 # Source - fprintf(filenum, "%s := %s;\n", ... - varname(sname, bond_number,-1), flow_attribute); - else # Sensor - if strcmp(flow_attribute, "zero") #Zero output - zero_outputs = zero_outputs + 1 - fprintf(filenum, "MTTyz(%d,1) := %s;\n", ... - zero_outputs, varname(sname, bond_number,-1)); - else - mtt_error([flow_attribute, " not appropriate for an output (", name, ")"]); - endif - endif - endif - endif - - structure(3) = inputs; - structure(4) = outputs; - structure(5) = zero_outputs; - structure(6) = unknown_inputs; - - endfor -endfunction - DELETED mttroot/mtt/lib/comp/simple/SS_seqn.m Index: mttroot/mtt/lib/comp/simple/SS_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/SS_seqn.m +++ mttroot/mtt/lib/comp/simple/SS_seqn.m @@ -1,58 +0,0 @@ -function [eqn,insigs,innames] = SS_seqn (Name, name, cr, arg, outsig, ... - insigs,innames,is_port) - - ## usage: [eqn,inbonds] = SS_seqn (Name, cr, arg, outbond, inbonds) - ## - ## - ## Multi port SS's ?? - - delim = "__"; - N = mtt_check_sigs (outsig,insigs); - - full_name = sprintf("%s%s%s", Name,delim,name); - - ## Get the special attibutes for SS - attrib_name = char(strsplit(arg,",")); - [N_a,M_a]=size(attrib_name); - if (N_a~=2) # Must have 2 arguments - mtt_error(sprintf("SS should have 2 args not %i", N_a)); - end; - - effort_attribute = deblank(attrib_name(1,:)); - flow_attribute = deblank(attrib_name(2,:)); - - ## Default attributes - if strcmp(effort_attribute,"")||is_port - effort_attribute = "external"; - end; - - if strcmp(flow_attribute,"")||is_port - flow_attribute = "external"; - end; - - - if mtt_is_external("SS",outsig,insigs) # Source - if outsig(2)==1 # effort output. - attribute = effort_attribute; - else - attribute = flow_attribute; - endif - - ## Create the equation - LHS = varname(Name, outsig(1,1), outsig(1,2)); - RHS = Source_seqn (attribute,full_name); - eqn = sprintf("%s := %s;", LHS, RHS); - else # Sensor - if insigs(1,2)==1 # effort output. - attribute = effort_attribute; - else - attribute = flow_attribute; - endif - - ## Create the equation - LHS = Sensor_seqn (attribute,full_name); - RHS = varname(Name, insigs(1,1), insigs(1,2)); - eqn = sprintf("%s := %s;", LHS, RHS); - endif - -endfunction DELETED mttroot/mtt/lib/comp/simple/Sensor_seqn.m Index: mttroot/mtt/lib/comp/simple/Sensor_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/Sensor_seqn.m +++ mttroot/mtt/lib/comp/simple/Sensor_seqn.m @@ -1,16 +0,0 @@ -function LHS = Sensor_seqn (attribute,name) - - ## usage: LHS = Sensor_seqn (attribute,name) - ## - ## Write the LHS of a sensor equation - - - if strcmp(attribute,"external") - LHS = sprintf("MTTy_%s", name); - elseif strcmp(attribute,"internal") - LHS = sprintf("MTTy_%s", name); - else - error(sprintf("attribute ""%s"" not appropriate for a " ... - "source"), attribute); - endif -endfunction DELETED mttroot/mtt/lib/comp/simple/Source_seqn.m Index: mttroot/mtt/lib/comp/simple/Source_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/Source_seqn.m +++ mttroot/mtt/lib/comp/simple/Source_seqn.m @@ -1,16 +0,0 @@ -function RHS = Source_seqn (attribute,name) - - ## usage: RHS = Source_seqn (attribute,name) - ## - ## Write the RHS of a source equation - - if strcmp(attribute,"external") - RHS = sprintf("MTTu_%s",name); - elseif strcmp(attribute,"internal") - error(sprintf("attribute ""internal"" not appropriate for a " - "source")); - else - RHS = attribute; - endif - -endfunction DELETED mttroot/mtt/lib/comp/simple/TF_alias.m Index: mttroot/mtt/lib/comp/simple/TF_alias.m ================================================================== --- mttroot/mtt/lib/comp/simple/TF_alias.m +++ mttroot/mtt/lib/comp/simple/TF_alias.m @@ -1,15 +0,0 @@ -function alias = TF_alias # Port aliases for TF - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - alias.in = '1'; - alias.out = '2'; - -endfunction - - DELETED mttroot/mtt/lib/comp/simple/TF_cause.m Index: mttroot/mtt/lib/comp/simple/TF_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/TF_cause.m +++ mttroot/mtt/lib/comp/simple/TF_cause.m @@ -1,36 +0,0 @@ -function [bonds,status] = TF_cause(bonds); -% TF_cause - causality for a TF component -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function TF_cause -% [bonds,status] = TF_cause(bonds) - -%SUMMARY TF: elementary transformer component -%DESCRIPTION Energy conserving two-port -%DESCRIPTION e_1 = f(e_2); f_1 = f(f_2) - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/11/01 12:05:54 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'TF')==0 - return -end - - -%Causality of TF is same as that of a junction -[bonds,status] = zero_cause(bonds); DELETED mttroot/mtt/lib/comp/simple/TF_eqn.m Index: mttroot/mtt/lib/comp/simple/TF_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/TF_eqn.m +++ mttroot/mtt/lib/comp/simple/TF_eqn.m @@ -1,78 +0,0 @@ -function structure = TF_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/09/10 10:41:37 peter -% %% Now used equation.m to write the equations. -% %% -% %% Revision 1.1 1996/08/19 09:05:04 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -if nargin<8 - eqnfile = 'stdout'; -end; - -% Check that there are exactly two bonds. -if check_bonds(bonds,2,'TF')==0 - return -end - -% There are 2 ports; extract the information -e_1 = bonds(1,1); -f_1 = bonds(1,2); -e_2 = bonds(2,1); -f_2 = bonds(2,2); - - -% Effort -outcause = 1; -incause = 1; -if e_1==1 - outbond = bond_number(2); - inbond = bond_number(1); - outport = 2; - inport = 1; -else - outbond = bond_number(1); - inbond = bond_number(2); - outport = 1; - inport = 2; -end; - -eqn = equation("TF",name,cr,args,outbond,outcause,outport, ... - inbond,incause,inport); -fprintf(eqnfile, '%s',eqn); - -% Flow -outcause = -1; -incause = -1; -if f_1==-1 - outbond = bond_number(2); - inbond = bond_number(1); - outport = 2; - inport = 1; -else - outbond = bond_number(1); - inbond = bond_number(2); - outport = 1; - inport = 2; -end; - -eqn = equation("TF",name,cr,args,outbond,outcause,outport, ... - inbond,incause,inport); -fprintf(eqnfile, '%s',eqn); - - - - - - - - DELETED mttroot/mtt/lib/comp/simple/TF_seqn.m Index: mttroot/mtt/lib/comp/simple/TF_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/TF_seqn.m +++ mttroot/mtt/lib/comp/simple/TF_seqn.m @@ -1,27 +0,0 @@ -function [eqn,insigs,innames] = TF_seqn (Name, cr, arg, outsig, insigs, innames) - - ## usage: [eqn,inbonds] = TF_seqn (Name, cr, arg, outbond, inbonds) - ## - ## - ## TFs have two ports; the input and output ports must be different - N = mtt_check_sigs (outsig,insigs); - - if N!=2 - error("A TF must have exactly two ports"); - else - if insigs(1,3)==outsig(3) # First signal is on output port - inport = 2; - else - inport = 1; - endif - endif - - insig = insigs(inport,:); - inname = innames(inport,:); - eqn = equation("""TF""",Name,cr,arg,outsig(1),outsig(2),outsig(3), ... - insig(:,1),insig(:,2),inport); - - insigs = insig; # Set the correct input signals - innames = inname; # Set the correct input names - -endfunction DELETED mttroot/mtt/lib/comp/simple/check_bonds.m Index: mttroot/mtt/lib/comp/simple/check_bonds.m ================================================================== --- mttroot/mtt/lib/comp/simple/check_bonds.m +++ mttroot/mtt/lib/comp/simple/check_bonds.m @@ -1,28 +0,0 @@ -function ok = check_bonds(bonds,n,component); -% check_bonds - check to see correct number (n) of bonds. -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function check_bonds -% err = check_bonds(bonds,n); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. -% Check that there are exactly two bonds. -[n_bonds,cols] = size(bonds); -if n_bonds~=n - mtt_info(sprintf('MTT error: %s must have %1.0f (not %1.0f) bonds', ... - component, n, n_bonds)); - ok=0; -else - ok=1; -end DELETED mttroot/mtt/lib/comp/simple/cicause.m Index: mttroot/mtt/lib/comp/simple/cicause.m ================================================================== --- mttroot/mtt/lib/comp/simple/cicause.m +++ mttroot/mtt/lib/comp/simple/cicause.m @@ -1,46 +0,0 @@ -function [bonds,status] = cicause(bonds,default); -% cicause - Sets causality for C & I components -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function cicause -% [bonds,status] = cicause(bonds,default) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - - - -if (norm(bonds)>1) - if (bonds(1)==-bonds(2)) % Over causal - status = 1; - else % Causal - status = 0; - end; -elseif norm(bonds)==0 % Acausal - % bonds = default*[1 1]; %Set integral causality - % status = 0; - status = -1; -else % Set causality - % Effort - if bonds(1)==0 - status = 0; - bonds(1) = bonds(2); - end; - - % Flow - if bonds(2)==0 - status = 0; - bonds(2) = bonds(1); - end; - -end; DELETED mttroot/mtt/lib/comp/simple/cieqn.m Index: mttroot/mtt/lib/comp/simple/cieqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/cieqn.m +++ mttroot/mtt/lib/comp/simple/cieqn.m @@ -1,110 +0,0 @@ -function structure = cieqn(name, bond_number,bonds,direction,cr,args, ... - structure,CorI,eqnfile); -% cieqn - Equation function for a (multi-port) unicausal C or I component -% CorI = 1 for C, -1 for I; 0 for ISW - -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function cieqn - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/06/29 13:05:08 peterg -% %% Changed cieqn so that sign ignored. -% %% -% %% Revision 1.2 1997/12/04 13:48:00 peterg -% %% Added sign info to take account of direction of bonds. -% %% -% %% Revision 1.1 1997/04/09 10:18:26 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -if nargin<8 - eqnfile = 'stdout'; -end; - -if (CorI==1) - comp_type = "C"; -else - comp_type = "I"; -endif - -CorIorISW = CorI; -if CorIorISW==0 % ISW - CorI = -1; -end; - - -% Find the number of ports -[ports,junk] = size(bonds); - -% Right-hand side causality -RHS_cause = (bonds(:,1)==CorI*ones(ports,1))*CorI -state_cause = zeros(ports,1); % State causality - -for outport = 1:ports - -# % Sort out direction -# if direction(outport,1) == 1 -# sign = '+'; -# else -# sign = '-'; -# end; - - sign = '+'; - LHS_number = bond_number(outport); - if bonds(outport,1) == -CorI % Integral causality on this port - state = structure(1)+1; - LHS_cause = CorI; - - % Print equation of form x_i = MTTx(i) - fprintf(eqnfile, '%s := MTTx(%1.0f,1);\n', ... - varname(name,LHS_number, state_cause), state); - - % Print equation of form xdot = input - with sign - fprintf(eqnfile, 'MTTdX(%1.0f,1) := %s%s;\n', state, sign, ... - varname(name,LHS_number,-LHS_cause)); - % Print equation of form output = CR (state) - eqn = equation(comp_type,name,cr,args,LHS_number,LHS_cause,outport, ... - bond_number,state_cause,1:ports); - fprintf(eqnfile, '%s',eqn); - structure(1) = state; - else % Derivative causality - nonstate = structure(2)+1; - LHS_cause = -CorI; - - % Print equation of form zdot = MTTdz(i) -- with sign - fprintf(eqnfile, '%s := %sMTTdz(%1.0f,1);\n', ... - varname(name,LHS_number,LHS_cause), sign, ... - nonstate); - % Print equation of form MTTz(i) = z_i - fprintf(eqnfile, 'MTTz(%1.0f,1) := %s;\n', nonstate, ... - varname(name,LHS_number, state_cause)); - - % Print equation of form z_i = CR(input) - eqn = equation(comp_type,name,cr,args,LHS_number,state_cause, outport, ... - bond_number,RHS_cause,1:ports); - fprintf(eqnfile, '%s',eqn); - structure(2) = nonstate; - end; -end; - - - - - - - - - DELETED mttroot/mtt/lib/comp/simple/comp_ports.m Index: mttroot/mtt/lib/comp/simple/comp_ports.m ================================================================== --- mttroot/mtt/lib/comp/simple/comp_ports.m +++ mttroot/mtt/lib/comp/simple/comp_ports.m @@ -1,81 +0,0 @@ -function ports = comp_ports(comp_type,N) -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function comp_ports -% ports = comp_ports(comp_type) -% Returns the port list for simple components - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.8 1998/06/29 12:16:05 peterg -% %% Whoops - FP bonds are p and f (in that order) -% %% -% %% Revision 1.7 1998/06/29 12:13:36 peterg -% %% Changed FP ports to f and p -% %% -% %% Revision 1.6 1998/06/29 09:55:17 peterg -% %% Changed name to FP from ES -% %% -% %% Revision 1.5 1998/04/12 15:01:53 peterg -% %% Converted to uniform port notation - always use [] -% %% -% %% Revision 1.4 1998/03/31 08:39:31 peterg -% %% Added EBTF -% %% -% %% Revision 1.3 1997/11/21 11:32:57 peterg -% %% N ports numbered 1..N -% %% -% %% Revision 1.2 1997/08/28 08:08:24 peterg -% %% Added RS component to the two-port list -% %% -% %% Revision 1.1 1997/08/02 19:35:47 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -junctions = '-zero-one-'; -one_ports = '-SS-'; -two_ports = '-TF-GY-AE-AF-FMR-RS-EBTF-'; -N_ports = '-R-C-I-'; -comp_type = ['-', comp_type, '-']; - -#if length(findstr(comp_type,junctions))==1 -# ports = ['[undefined]']; -#elseif length(findstr(comp_type,one_ports))==1 -# ports = ['[in]']; -#elseif length(findstr(comp_type,two_ports))==1 -# ports = ['[in]';'[out]']; -#elseif length(findstr(comp_type,'[-EMTF-]'))==1 -# ports = ['[in]';'[out]';'[mod]']; -#elseif length(findstr(comp_type,'[-FP-]'))==1 -# ports = ['[p]';'[f]']; -#elseif length(findstr(comp_type,'[-PS-]'))==1 -# ports = ['[in]';'[out]';'[power]']; -#elseif length(findstr(comp_type,N_ports))==1 -# if N==1 -# ports = ['[in]']; -# elseif N==2 -# ports = ['[in]';'[out]']; -# elseif N>2 -# ports = '[1]'; -# for i=2:N -# ports = [ports; sprintf("[%i]",i)]; -# end; -# end; -#end; - -# All the above is now done in the alias files - ports = '[1]'; - for i=2:N - ports = [ports; sprintf("[%i]",i)]; - end; - -endfunction DELETED mttroot/mtt/lib/comp/simple/juncause.m Index: mttroot/mtt/lib/comp/simple/juncause.m ================================================================== --- mttroot/mtt/lib/comp/simple/juncause.m +++ mttroot/mtt/lib/comp/simple/juncause.m @@ -1,40 +0,0 @@ -function [bonds,status] = juncause(bonds,jun,cause) -% [bonds,status] = juncause(bonds,jun,cause) - -% Causality for either effort or flow on either zero or one junctions - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/08/09 08:29:04 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -j = (3-cause)/2; % j is 1 for effort, 2 for flow - -[n_bonds,junk] = size(bonds); -[causing_bond, n,other_bonds,m] = getindex(bonds(:,j),jun); -if n>1 % over causal - status = 1; -elseif n==1 %causal - status = 0; - bonds(other_bonds(:,1),j) = -jun*ones(m,1); -elseif n==0 % undercausal - try other way - [causing_bond, n,other_bonds,m] = getindex(bonds(:,j),-jun); - if n==n_bonds % over causal - status = 1; - elseif n==n_bonds-1 %causal - status = 0; - bonds(other_bonds(:,1),j) = jun*ones(m,1); - else % undercausal - status = -1; - end; -end; - - - - DELETED mttroot/mtt/lib/comp/simple/junction_seqn.m Index: mttroot/mtt/lib/comp/simple/junction_seqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/junction_seqn.m +++ mttroot/mtt/lib/comp/simple/junction_seqn.m @@ -1,58 +0,0 @@ -function [eqn,insigs,innames] = junction_seqn (jun_type,Name, outsig, ... - insigs, innames) - ## usage: [eqn,insigs] = junction_seqn (jun_type,Name, outport, outsig, ... - ## insigs) - ## - ## - ## Junctions - - ## Sanity check - N = mtt_check_sigs (outsig,insigs); - - outport = outsig(3); - - ## Setup up causality corresponding to junction - if jun_type=="0" - i_jun_type = 1; - elseif jun_type=="1" - i_jun_type = -1; - else - error("Junction type %s unknown", jun_type) - endif - - ## Is output same causality as junction? - same_type = outsig(2)==i_jun_type; - - - ## LHS - eqn = sprintf("%s :=", varname(Name, abs(outsig(1)), outsig(2))); - - ## Find the input bond of the same causality as junction - one = ones(N,1); - inport = find(insigs(:,2)==i_jun_type*one); - - ##RHS - if same_type - insig = insigs(inport,:); - inname = innames(inport,:); - eqn = sprintf("%s\n\t%s", eqn, varname(Name, abs(insigs(inport,1)),i_jun_type)); - else - insig=[]; - inname=""; - inports = []; - out_dir = sign(insigs(inport,1)); - for i=1:N - if i!=inport - in_dir = sign(insigs(i,1)); - plusminus = sign2name(-in_dir*out_dir); - eqn = sprintf("%s\n\t%s%s", eqn, plusminus, varname(Name, ... - abs(insigs(i,1)), -i_jun_type)); - insig = [insig; insigs(i,:)]; - inname = [inname; innames(i,:)]; - endif - endfor - endif - eqn = sprintf("%s;", eqn); - insigs = insig; - innames = inname; -endfunction DELETED mttroot/mtt/lib/comp/simple/juneqn.m Index: mttroot/mtt/lib/comp/simple/juneqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/juneqn.m +++ mttroot/mtt/lib/comp/simple/juneqn.m @@ -1,52 +0,0 @@ -function juneqn(name,bond_number,bonds,direction,cr,args,jun,filenumber) -% juneqn - Equations for both effort and flow on either -% zero or one junctions -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function juneqn -% juneqn(name,bond_number,bonds,direction,cr,args,jun,filenumber) - -% Copyright (c) P.J. Gawthrop, 1996. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1996/12/05 10:02:45 peterg -% %% Explicit generation of strong-causality equations -- oneequation not -% %% used now. -% %% -% %% Revision 1.2 1996/08/08 18:09:10 peter -% %% Changed to finenumber format. -% %% -% %% Revision 1.1 1996/08/08 16:38:50 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Same causality as junction -column = (3-jun)/2; -[causing_bond,n,other_bonds,m] = getindex(bonds(:,column),jun) -for i=other_bonds' - fprintf(filenumber, '%s \t:=\t%s;\n', ... - varname(name, bond_number(i),jun), ... - varname(name, bond_number(causing_bond),jun) ... - ); -end; - - -% Opposite causality to junction -column = (3+jun)/2; -[caused_bond,n,other_bonds,m] = getindex(bonds(:,column),jun) -fprintf(filenumber, '%s\t:= \n', varname(name, bond_number(caused_bond),-jun)); -for i=other_bonds' - term_sign = -direction(caused_bond,column)*direction(i,column) - fprintf(filenumber, '\t\t%s %s\n', sign2name(term_sign), ... - varname(name, bond_number(i),-jun)); -end; -fprintf(filenumber, ';\n'); DELETED mttroot/mtt/lib/comp/simple/one_cause.m Index: mttroot/mtt/lib/comp/simple/one_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/one_cause.m +++ mttroot/mtt/lib/comp/simple/one_cause.m @@ -1,34 +0,0 @@ -function [bonds,status] = one_cause(bonds); -% one_cause - causality for a one junction -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function one_cause - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Copyright (c) P.J. Gawthrop, 1996. - -%Effort -[bonds,e_status] = juncause(bonds,-1,1); - -%Flow -[bonds,f_status] = juncause(bonds,-1,-1); - -if (e_status==1)|(f_status==1) % Over causal - status = 1; -elseif (e_status==-1)|(f_status==-1) % Under causal - status = -1; -else % causal - status = 0; -end; - DELETED mttroot/mtt/lib/comp/simple/one_eqn.m Index: mttroot/mtt/lib/comp/simple/one_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/one_eqn.m +++ mttroot/mtt/lib/comp/simple/one_eqn.m @@ -1,33 +0,0 @@ -function structure = one_eqn(name,bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% one_eqn - equations for a one junction -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function one_eqn -% one_eqn(name,bond_number,bonds,direction,cr,args, ... -% structure,eqnfile); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/12/05 10:00:49 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -disp("one-eqn") -name,bond_number,bonds,direction,cr,args -if nargin<7 - eqnfile = 'stdout'; -end; - -juneqn(name,bond_number,bonds,direction,cr,args,-1,eqnfile) - - - - DELETED mttroot/mtt/lib/comp/simple/oneeqn.m Index: mttroot/mtt/lib/comp/simple/oneeqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/oneeqn.m +++ mttroot/mtt/lib/comp/simple/oneeqn.m @@ -1,28 +0,0 @@ -function oneeqn(name,LHS_number,LHS_cause,RHS_number,RHS_cause,cr,args, ... - eqnfile); -% oneeqn - prints a single equation -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function oneeqn -% oneeqn(name,LHS_number,LHS_cause,RHS_number,RHS_cause,cr,args,eqnfile) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -if nargin<7 - eqnfile = 'stdout'; -end; - - -fprintf(eqnfile, '%s := %s;\n', ... - varname(name, LHS_number,LHS_cause), ... - cr2name(name,RHS_number,LHS_cause,RHS_cause,cr,args)); DELETED mttroot/mtt/lib/comp/simple/zero_cause.m Index: mttroot/mtt/lib/comp/simple/zero_cause.m ================================================================== --- mttroot/mtt/lib/comp/simple/zero_cause.m +++ mttroot/mtt/lib/comp/simple/zero_cause.m @@ -1,32 +0,0 @@ -function [bonds,status] = zero_cause(bonds); -% zero_cause - causality for zero junctions -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function zero_cause -% [bonds,status] = zero_cause(bonds); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%Effort -[bonds,e_status] = juncause(bonds,1,1); - -%Flow -[bonds,f_status] = juncause(bonds,1,-1); - -status = 0; -if (e_status==1)|(f_status==1) % Over causal - status = 1; -endif; -if (e_status==-1)|(f_status==-1) % Under causal - status = -1; -endif; - - DELETED mttroot/mtt/lib/comp/simple/zero_eqn.m Index: mttroot/mtt/lib/comp/simple/zero_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/zero_eqn.m +++ mttroot/mtt/lib/comp/simple/zero_eqn.m @@ -1,29 +0,0 @@ -function structure = zero_eqn(name, bond_number,bonds,direction,cr,args, ... - structure,eqnfile); -% zero_eqn - equations for zero junctions -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Matlab function zero_eqn -% zero_eqn(name, bond_number,bonds,direction,cr,args, structure,eqnfile); - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -if nargin<7 - eqnfile = 'stdout'; -end; - - -juneqn(name, bond_number,bonds,direction,cr,args,1,eqnfile) - - - - DELETED mttroot/mtt/lib/control/PPP/Beam_numpar.m Index: mttroot/mtt/lib/control/PPP/Beam_numpar.m ================================================================== --- mttroot/mtt/lib/control/PPP/Beam_numpar.m +++ mttroot/mtt/lib/control/PPP/Beam_numpar.m @@ -1,45 +0,0 @@ -% Script file Beam_numpar.m -%% numpar file (Beam_numpar.m) -%% Generated by MTT at Thu Apr 22 07:00:08 BST 1999 -% Global variable list -global ... - area ... - areamoment ... - beamlength ... - beamthickness ... - beamwidth ... - density ... - ei ... - n ... - youngs ... - dk ... - dm ... - dz ... - rhoa ; - % -*-octave-*- Put Emacs into octave-mode - % Numerical parameter file (Beam_numpar.txt) - % Generated by MTT at Mon Apr 19 06:24:08 BST 1999 - - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % %% Version control history - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % %% $Id$ - % %% $Log$ - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - % Parameters -n = 7; -beamlength = 0.58; -beamwidth = 0.05; -beamthickness = 0.005; -youngs = 1e6; -density = 1e5; -area = beamwidth*beamthickness; -areamoment = (beamthickness*beamwidth^2)/12; - -ei= 58.6957 ; % from Reza -rhoa= 0.7989 ; % from Reza - -dz = beamlength/n; % BernoulliEuler -dm = rhoa*dz; % BernoulliEuler -dk = ei/dz; % BernoulliEuler DELETED mttroot/mtt/lib/control/PPP/Beam_sm.m Index: mttroot/mtt/lib/control/PPP/Beam_sm.m ================================================================== --- mttroot/mtt/lib/control/PPP/Beam_sm.m +++ mttroot/mtt/lib/control/PPP/Beam_sm.m @@ -1,69 +0,0 @@ -% -*-octave-*- Put Emacs into octave-mode% -function [mtta,mttb,mttc,mttd] = Beam_sm(); -% [mtta,mttb,mttc,mttd] = Beam_sm(); -%System Beam, representation sm, language m; -%File Beam_sm.m; -%Generated by MTT on Thu Apr 22 07:02:48 BST 1999; -% -%====== Set up the global variables ======% -global ... -area ... -areamoment ... -beamlength ... -beamthickness ... -beamwidth ... -density ... -ei ... -n ... -youngs ... -dk ... -dm ... -dz ... -rhoa ; -%a matrix% -mtta = zeros(14,14); -mtta(1,2) = -dk/dz; -mtta(2,1) = 1.0/(dm*dz); -mtta(2,3) = -2.0/(dm*dz); -mtta(2,5) = 1.0/(dm*dz); -mtta(3,2) = (2.0*dk)/dz; -mtta(3,4) = -dk/dz; -mtta(4,3) = 1.0/(dm*dz); -mtta(4,5) = -2.0/(dm*dz); -mtta(4,7) = 1.0/(dm*dz); -mtta(5,2) = -dk/dz; -mtta(5,4) = (2.0*dk)/dz; -mtta(5,6) = -dk/dz; -mtta(6,5) = 1.0/(dm*dz); -mtta(6,7) = -2.0/(dm*dz); -mtta(6,9) = 1.0/(dm*dz); -mtta(7,4) = -dk/dz; -mtta(7,6) = (2.0*dk)/dz; -mtta(7,8) = -dk/dz; -mtta(8,7) = 1.0/(dm*dz); -mtta(8,9) = -2.0/(dm*dz); -mtta(8,11) = 1.0/(dm*dz); -mtta(9,6) = -dk/dz; -mtta(9,8) = (2.0*dk)/dz; -mtta(9,10) = -dk/dz; -mtta(10,9) = 1.0/(dm*dz); -mtta(10,11) = -2.0/(dm*dz); -mtta(10,13) = 1.0/(dm*dz); -mtta(11,8) = -dk/dz; -mtta(11,10) = (2.0*dk)/dz; -mtta(11,12) = -dk/dz; -mtta(12,11) = 1.0/(dm*dz); -mtta(12,13) = -2.0/(dm*dz); -mtta(13,10) = -dk/dz; -mtta(13,12) = (2.0*dk)/dz; -mtta(13,14) = -dk/dz; -mtta(14,13) = 1.0/(dm*dz); -%b matrix% -mttb = zeros(14,1); -mttb(11) = 1.0/dz; -mttb(13) = -2.0/dz; -%c matrix% -mttc = zeros(1,14); -mttc(1,1) = 1.0/dm; -%d matrix% -mttd = zeros(1,1); DELETED mttroot/mtt/lib/control/PPP/NMPsystem.m Index: mttroot/mtt/lib/control/PPP/NMPsystem.m ================================================================== --- mttroot/mtt/lib/control/PPP/NMPsystem.m +++ mttroot/mtt/lib/control/PPP/NMPsystem.m @@ -1,21 +0,0 @@ -function [A,B,C,D] = NMPsystem () - - ## usage: [A,B,C,D] = NMPsystem () - ## - ## NMP system example (2-s)/(s-1)^3 - - A = [3 -3 1 - 1 0 0 - 0 1 0]; - - B = [1 - 0 - 0]; - - C = [0 -0.5 1]; - - D = 0; - - - -endfunction DELETED mttroot/mtt/lib/control/PPP/TwoMassSpring.m Index: mttroot/mtt/lib/control/PPP/TwoMassSpring.m ================================================================== --- mttroot/mtt/lib/control/PPP/TwoMassSpring.m +++ mttroot/mtt/lib/control/PPP/TwoMassSpring.m @@ -1,34 +0,0 @@ -function [A,B,C,D] = TwoMassSpring (k,m_1,m_2) - - ## usage: [A,B,C,D] = TwoMassSpring (k,m_1,m_2) - ## - ## Two mass-spring example from Middleton et al. EE9908 - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 1999/05/18 22:31:26 peterg - ## Fixed error in dim of D - ## - ## Revision 1.1 1999/05/18 22:28:56 peterg - ## Initial revision - ## - ############################################################### - - - A = [0 1 0 0 - -k/m_1 0 k/m_1 0 - 0 0 0 1 - k/m_2 0 -k/m_2 0]; - B = [0 - 1/m_1 - 0 - 0]; - C = [1 0 0 0 - 0 0 1 0]; - - D = zeros(2,1); - -endfunction DELETED mttroot/mtt/lib/control/PPP/airc.m Index: mttroot/mtt/lib/control/PPP/airc.m ================================================================== --- mttroot/mtt/lib/control/PPP/airc.m +++ mttroot/mtt/lib/control/PPP/airc.m @@ -1,27 +0,0 @@ -function [A,B,C,D] = airc -% System AIRC -% This system is the aircraft example from the book: -% J.M Maciejowski: Multivariable Feedback Design Addison-Wesley, 1989 -% It has 5 states, 3 inputs and 3 outputs. - -% P J Gawthrop Jan 1998 - -A = [ 0 0 1.1320 0 -1.0000 - 0 -0.0538 -0.1712 0 0.0705 - 0 0 0 1.0000 0 - 0 0.0485 0 -0.8556 -1.0130 - 0 -0.2909 0 1.0532 -0.6859]; - -B = [ 0 0 0 - -0.1200 1.0000 0 - 0 0 0 - 4.4190 0 -1.6650 - 1.5750 0 -0.0732]; - -C = [1 0 0 0 0 - 0 1 0 0 0 - 0 0 1 0 0]; - -D = zeros(3,3); - - DELETED mttroot/mtt/lib/control/PPP/autm.m Index: mttroot/mtt/lib/control/PPP/autm.m ================================================================== --- mttroot/mtt/lib/control/PPP/autm.m +++ mttroot/mtt/lib/control/PPP/autm.m @@ -1,40 +0,0 @@ -function [A,B,C,D]=autm -% System AUTM -% This system is the automotive gas turbine example from the book: -% Y.S. Hung and A.G.J. Macfarlane: "Multivariable Feedback. A -% quasi-classical approach." Springer 1982 -% It has 12 states, 2 inputs and 2 outputs. - -% P J Gawthrop Jan 1998 - -%A-matrix -A = zeros(12,12); -A(1,2) = 1; -A(2,1) = -0.202; A(2,2) = -1.150; -A(3,4) = 1; -A(4,5) = 1; -A(5,3) = -2.360; A(5,4) = -13.60; A(5,5) = -12.80; -A(6,7) = 1; -A(7,8) = 1; -A(8,6) = -1.620; A(8,7) = -9.400; A(8,8) = -9.150; -A(9,10) = 1; -A(10,11) = 1; -A(11,12) = 1; -A(12,9) = -188.0; A(12,10) = -111.6; A(12,11) = -116.4; A(12,12) = -20.8; - -%B-matrix -B = zeros(12,2); -B(2,1) = 1.0439; B(2,2) = 4.1486; -B(5,1) = -1.794; B(5,2) = 2.6775; -B(8,1) = 1.0439; B(8,2) = 4.1486; -B(12,1) = -1.794; B(12,2) = 2.6775; - -%C-matrix -C = zeros(2,12); -C(1,1) = 0.2640; C(1,2) = 0.8060; C(1,3) = -1.420; C(2,4) = -15.00; -C(2,6) = 4.9000; C(2,7) = 2.1200; C(2,8) = 1.9500; C(2,9) = 9.3500; -C(2,10) = 25.800; C(2,11) = 7.1400; - -%D-matrix -D = zeros(2,2); - DELETED mttroot/mtt/lib/control/PPP/butterworth_matrix.m Index: mttroot/mtt/lib/control/PPP/butterworth_matrix.m ================================================================== --- mttroot/mtt/lib/control/PPP/butterworth_matrix.m +++ mttroot/mtt/lib/control/PPP/butterworth_matrix.m @@ -1,16 +0,0 @@ -function A = butterworth_matrix (n,p) - - ## usage: A = butterworth (n,p) - ## - ## A-matrix for generating nth order Butterworth functions with parameter p - - ## Copyright (C) 2000 by Peter J. Gawthrop - - ## Butterworth poly - pol = ppp_butter(n,p); - - ## Create A matrix (controller form) - A = [-pol(2:n+1) - eye(n-1) zeros(n-1,1)]; - -endfunction DELETED mttroot/mtt/lib/control/PPP/damped_matrix.m Index: mttroot/mtt/lib/control/PPP/damped_matrix.m ================================================================== --- mttroot/mtt/lib/control/PPP/damped_matrix.m +++ mttroot/mtt/lib/control/PPP/damped_matrix.m @@ -1,26 +0,0 @@ -function A = damped_matrix (frequency,damping) - - ## usage: A = damped_matrix (frequency,damping) - ## - ## Gives an A matrix with eigenvalues with specified - ## frequencies and damping ratio - - N = length(frequency); - - if nargin<2 - damping = zeros(size(frequency)); - endif - - if length(damping) != N - error("Frequency and damping vectors have different lengths"); - endif - - A = zeros(2*N,2*N); - for i=1:N - j = 2*(i-1)+1; - A_i = [-2*damping(i)*frequency(i) -frequency(i)^2 - 1 0]; - A(j:j+1,j:j+1) = A_i; - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/laguerre_matrix.m Index: mttroot/mtt/lib/control/PPP/laguerre_matrix.m ================================================================== --- mttroot/mtt/lib/control/PPP/laguerre_matrix.m +++ mttroot/mtt/lib/control/PPP/laguerre_matrix.m @@ -1,18 +0,0 @@ -function A = laguerre_matrix (n,p) - - ## usage: A = laguerre_matrix (n,p) - ## - ## A-matrix for generating nth order Laguerre functions with parameter p - - ## Copyright (C) 1999 by Peter J. Gawthrop - - if n<1 # Creatre empty matrix - A = []; - else # Create A matrix - A = diag(-p*ones(n,1)); - for i=1:n-1 - A = A + diag(-2*p*ones(n-i,1),-i); - endfor - endif - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_RT.m Index: mttroot/mtt/lib/control/PPP/ppp_RT.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_RT.m +++ mttroot/mtt/lib/control/PPP/ppp_RT.m @@ -1,7 +0,0 @@ -function [y,u] = ppp_RT (U) - - ## usage: [y,u] = ppp_RT (U) - ## - ## - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_RT_sim.m Index: mttroot/mtt/lib/control/PPP/ppp_RT_sim.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_RT_sim.m +++ mttroot/mtt/lib/control/PPP/ppp_RT_sim.m @@ -1,19 +0,0 @@ -function [y,u] = ppp_RT_sim (U) - - ## usage: [y,u] = ppp_RT_sim (U) - ## - ## U PPP weight (column vector) - - global system_name_sim i_ppp_sim x_0_sim y_sim u_sim A_u_sim - - - ## Data from previous time - last point not used - if length(y_sim)>0 # Avoid initial junk - [n_t_old,junk] = size(y_sim); - y = y_sim(1:n_t_old-1,:); u = u_sim(1:n_t_old-1,:); - else - y=[]; u=[]; - endif - -endfunction - DELETED mttroot/mtt/lib/control/PPP/ppp_RT_sim_compute.m Index: mttroot/mtt/lib/control/PPP/ppp_RT_sim_compute.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_RT_sim_compute.m +++ mttroot/mtt/lib/control/PPP/ppp_RT_sim_compute.m @@ -1,26 +0,0 @@ -function ppp_RT_sim_compute (U) - - ## usage: [y,u] = ppp_RT_sim_compute (U) - ## - ## U PPP weight (column vector) - - global system_name_sim i_ppp_sim x_0_sim y_sim u_sim A_u_sim simpar_sim - - ## System details -- defines simulation within ol interval - par = eval(sprintf("%s_numpar;", system_name_sim)); - t = [0:simpar_sim.dt:simpar_sim.last]; - n_t = length(t); - [n_x,n_y,n_u] = eval(sprintf("%s_def", system_name_sim)); - [n_U,junk] = size(A_u_sim); - - ## Set up u_star - u_star = ppp_ustar(A_u_sim,1,t,0,0,n_u-n_U); - - ## Simulate - par(i_ppp_sim(:,3)) = U; # Update the simulation ppp weights - [y_sim,x] = eval(sprintf("%s_sim(x_0_sim, par, simpar_sim, u_star);", \ - system_name_sim)); - x_0_sim = x(n_t,:)'; # Extract state for next time - u_sim = u_star(:,1:n_U)*U; -endfunction - DELETED mttroot/mtt/lib/control/PPP/ppp_are.m Index: mttroot/mtt/lib/control/PPP/ppp_are.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_are.m +++ mttroot/mtt/lib/control/PPP/ppp_are.m @@ -1,49 +0,0 @@ -function [P,A_u,A_w,k] = ppp_are (A,B,C,D,Q,R,A_type) - - ## usage: [P,A_u,A_w] = ppp_are (A,B,C,D,Q,R,A_type) - ## - ## - - if nargin<1 - disp("usage: [P,A_u,A_w] = ppp_are (A,B,C,D,Q,R,A_type)"); - return - endif - - if nargin<7 - A_type = "feedback"; - endif - - [n_x,n_u,n_y] = abcddim(A,B,C,D); # Dimensions - n_q = is_square(Q); # Size of Q - if n_q==0 - error("Q must be square"); - endif - - ## Steady-state Linear Quadratic solution - ## using Algebraic Riccati equation (ARE) - if n_q==n_y # Output weight - Q_x = C'*Q*C; # Weighting on x - elseif n_q==n_x # State weight - Q_x = Q; - else - error(sprintf("Q (%ix%i) must be %ix%i or %ix%i",n_q,n_q,n_y,n_y,n_x,n_x)); - endif - - [k, P, poles] = lqr (A, B, Q_x, R); # Algebraic Riccati solution - - ## Basis functions - if strcmp(A_type,"companion") - A_u = compan(poly(poles)); - elseif strcmp(A_type,"feedback") - A_u = A-B*k; - else - error(sprintf("A_type must be %s, not %s", "companion or feedback", A_type)); - endif - - ## Avoid spurious imag parts due to rounding - A_u = real(A_u); - - ## Setpoint basis functions - A_w = 0; - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_aug.m Index: mttroot/mtt/lib/control/PPP/ppp_aug.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_aug.m +++ mttroot/mtt/lib/control/PPP/ppp_aug.m @@ -1,26 +0,0 @@ -function [A,v] = ppp_aug (A_1,A_2) - - ## usage: [A,v] = ppp_aug (A_1,A_2) - ## - ## Augments square matrix A_1 with square matrix A_2 to create A=[A_1 0; A_2 0]; - ## and generates v, a compatible column vector with unit elements - - ## Copyright (C) 1999 by Peter J. Gawthrop - - - [n_1,m_1] = size(A_1); - if n_1 != m_1 - error("A_1 must be square"); - endif - - [n_2,m_2] = size(A_2); - if n_2 != m_2 - error("A_2 must be square"); - endif - - A = [A_1 zeros(n_1,n_2) - zeros(n_2,n_1) A_2]; - - v = ones(n_1+n_2,1); - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_butter.m Index: mttroot/mtt/lib/control/PPP/ppp_butter.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_butter.m +++ mttroot/mtt/lib/control/PPP/ppp_butter.m @@ -1,23 +0,0 @@ -function pol = ppp_butter (order,radius) - - ## usage: pol = cgpc_butter (order,radius) - ## - ## Butterworth polynomial of given order and pole radius - ## Copyright (C) 1999 by P.J. Gawthrop - - ## $Id$ - - theta = pi/(2*order); # Angle with real axis - - even = (floor(order/2)==order/2); - if even - pol=1; N=order/2; - else - pol=[1 radius]; N=(order-1)/2; - endif - - for i=1:N - pol=conv(pol, [1 2*radius*cos(i*theta) radius^2]); - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_closedloop.m Index: mttroot/mtt/lib/control/PPP/ppp_closedloop.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_closedloop.m +++ mttroot/mtt/lib/control/PPP/ppp_closedloop.m @@ -1,37 +0,0 @@ -function [Ac,Bc,Cc,Dc] = ppp_closedloop (A,B,C,D,k_x,k_w,l_x,l_y) - - ## usage: [Ac,Bc,Cc,Dc] = ppp_closedloop (A,B,C,K_x,K_w,K_y,L) - ## - ## - - - ## Closed loop input is [w;v]. - ## Closed loop output is [y;u]. - ## w is reference signal - ## v is input disturbance - ## Inputs: - ## A,B,C,D MIMO linear system matrices - ## k_x,k_w,k_y Gain matrices: u = k_w*w - k_x*x - ## L Observer gain matrix - ## Outputs - ## Ac,Bc,Cc,Dc Closed-loop charecteristic polynomial - - ## Copyright (C) 1999 by Peter J. Gawthrop - - ## System dimensions - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - ## Create matrices describing closed-loop system - Ac = [ A, -B*k_x - l_x*C, (A - l_x*C - B*k_x)]; - - Bc = [B*k_w B - B*k_w zeros(n_x,n_u)]; - - Cc = [C zeros(n_y,n_x) - zeros(n_u,n_x) -k_x ]; - - Dc = [zeros(n_y,n_y) zeros(n_y,n_u) - k_w zeros(n_u,n_u)]; - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_cost.m Index: mttroot/mtt/lib/control/PPP/ppp_cost.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_cost.m +++ mttroot/mtt/lib/control/PPP/ppp_cost.m @@ -1,14 +0,0 @@ -function [J J_U] = ppp_cost (U,x,W,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww) - - ## usage: [J J_U] = ppp_cost (U,x,W,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww) - ## Computes the PPP cost function given U,x and W - ## - ## J_uu,J_ux,J_uw,J_xx,J_xw,J_ww cost derivatives from ppp_lin - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - J = U'*J_uu*U/2 + U'*(J_ux*x - J_uw*W) - x'*J_xw*W + x'*J_xx*x/2 + W'*J_ww*W'/2; - J_U = J_uu*U + (J_ux*x - J_uw*W) ; - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_error.m Index: mttroot/mtt/lib/control/PPP/ppp_error.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_error.m +++ mttroot/mtt/lib/control/PPP/ppp_error.m @@ -1,18 +0,0 @@ -function err = ppp_error(par) - - ## usage: err = error (par) - ## - ## - - global ppp_y_0 ppp_sim_command ppp_par ppp_i_par ppp_x0 ppp_sim ppp_u - - pars = ppp_par; - pars(ppp_i_par) = par; - - y = sidSimpleExtruder_ssim(ppp_x0,pars,ppp_sim,ppp_u); - - [N,n_y] = size(y); - - Err = y - ppp_y_0; - err = sum(diag(Err'*Err))/N -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ex1.m Index: mttroot/mtt/lib/control/PPP/ppp_ex1.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex1.m +++ mttroot/mtt/lib/control/PPP/ppp_ex1.m @@ -1,62 +0,0 @@ -function name = ppp_ex1 (ReturnName) - - ## usage: ppp_ex1 () - ## - ## PPP example - an unstable, nmp siso system - ## $Id$ - - - ## Example name - name = "Linear unstable non-minimum phase third order system- Laguerre inputs"; - - if nargin>0 - return - endif - - - ## System - unstable & NMP - [A,B,C,D] = NMPsystem; - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - ## Setpoint - A_w = ppp_aug(0,[]); - - ## Controller - - ##Optimisation horizon - t = [4.0:0.05:5]; - - ## A_u - A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); - - ## Design and plot - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t); - - - ## Compute exact version - poles = sort(eig(A_u)); # Desired poles - eigenvalues of A_u - poles = poles(1:n_x); # Loose the last one - due to setpoint - clp = poly(poles); # Closed-loop cp - kk = clp(2:n_x+1)+A(1,:); # Corresponding gain - A_c = A-B*kk; # Closed-loop A - K_X = ppp_open2closed (A_u,[A_c B*k_w; [0 0 0 0]],[kk -k_w]); # Exact - - ## Compute K_x using approx values - A_c_a = A-B*k_x; - K_X_comp = ppp_open2closed (A_u,[A_c_a B*k_w; [0 0 0 0]],[k_x -k_w]); # Computed Kx - - format bank - log_cond_uu = log10(cond_uu) - Exact_closed_loop_poles = poles' - Approximate_closed_loop_poles = cl_poles - Exact_k_x = kk - Approximate_k_x = k_x - Exact_K_X = K_X - Approximate_K_X = [K_x -K_w] - Computed_K_x = K_X_comp - K_xw_error = Approximate_K_X-K_X - format -endfunction - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex10.m Index: mttroot/mtt/lib/control/PPP/ppp_ex10.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex10.m +++ mttroot/mtt/lib/control/PPP/ppp_ex10.m @@ -1,34 +0,0 @@ -function name = ppp_ex10 (ReturnName) - - ## usage: name = ppp_ex10 (ReturnName) - ## - ## PPP example - shows a standard multivariable system - ## - - ## Example name - name = "Remotely-piloted vehicle example: system RPV from J.M Maciejowski: Multivariable Feedback Design"; - - if nargin>0 - return - endif - - ## System - [A,B,C,D] = rpv; - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - ## Controller - t = 1*[0.9:0.01:1]; # Time horizon - A_w = 0; # Setpoint -# TC = 0.1*[1 1]; # Time constants for each input -# A_u = []; -# for tc=TC # Input -# A_u = [A_u;ppp_aug(laguerre_matrix(2,1/tc), 0)]; -# endfor - A_u = ppp_aug(laguerre_matrix(2,5.0), A_w) - Q = [1;1]; # Output weightings - - ## Design and plot - W = [1;2] - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ex11.m Index: mttroot/mtt/lib/control/PPP/ppp_ex11.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex11.m +++ mttroot/mtt/lib/control/PPP/ppp_ex11.m @@ -1,107 +0,0 @@ -function [name,T,y,u,ys,us,J] = ppp_ex11 (ReturnName) - - ## usage: [name,T,y,u,ys,us,T1,du,dus] = ppp_ex11 (ReturnName) - ## - ## PPP example - - ## $Id$ - - - ## Example name - name = "Input constraints +-1.5 on u* at tau=0,0.5,1,1.5,2"; - - if nargin>0 - return - endif - - ## System - A = [-3 -3 -1 - 1 0 0 - 0 1 0]; - B = [1 - 0 - 0]; - C = [0 -0.5 1]; - D = 0; - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - ## Controller - t = [6:0.02:7]; # Time horizon - A_w = 0; # Setpoint - A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions - - Q = ones(n_y,1);; - - - ## Constraints - Gamma = []; - gamma = []; - - ## Constraints - u - Tau_u = [0:0.5:2]; - one = ones(size(Tau_u)); - limit = 1.5; - Min_u = -limit*one; - Max_u = limit*one; - Order_u = 0*one; - - ## Constraints - y - Tau_y = []; # No output constraints - one = ones(size(Tau_y)); - limit = 1.5; - Min_y = -limit*one; - Max_y = limit*one; - Order_y = 0*one; - - ## Simulation - W=1; - x_0 = zeros(3,1); - - ## Constrained - open-loop - disp("Designing controller"); - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); # Unconstrained design - [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); - - Gamma = Gamma_u; - gamma = gamma_u; - - ## Constrained OL simulation - disp("Computing constrained ol response"); - [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); - T = [0:t(2)-t(1):t(length(t))]; - [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); - - ## Unconstrained OL simulation - disp("Computing unconstrained ol response"); - [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); - [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); - - title("Constrained and unconstrained y*"); - xlabel("t"); - grid; - figure(1); - plot(T,ys,"-;y*: constrained;", T,ysu, "--;y*: unconstrained;") - - ## Non-linear - closed-loop - disp("Computing constrained closed-loop response"); - [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ - Tau_u,Min_u,Max_u,Order_u, \ - Tau_y,Min_y,Max_y,Order_y,W,x_0); - - title("Constrained closed-loop response"); - xlabel("t"); - grid; - figure(2); - plot(T,y,"-;y;", T,u,"--;u;"); - -# ## Compute derivatives. -# dt = t(2)-t(1); -# du = diff(u)/dt; -# dus = diff(us)/dt; -# T1 = T(1:length(T)-1); - ##plot(T1,du,T1,dus); -endfunction - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex12.m Index: mttroot/mtt/lib/control/PPP/ppp_ex12.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex12.m +++ mttroot/mtt/lib/control/PPP/ppp_ex12.m @@ -1,75 +0,0 @@ -function [name,T,y,u,ys,us,J,T1,du,dus] = ppp_ex12 (ReturnName) - - ## usage: [name,T,y,u,ys,us,T1,du,dus] = ppp_ex12 (ReturnName) - ## - ## PPP example - shows input derivative constraints - ## $Id$ - - - ## Example name - name = "Input derivative constraints +-1 on u* at tau=0,0.5,1,1.5,2"; - - if nargin>0 - return - endif - - ## System - A = [-3 -3 -1 - 1 0 0 - 0 1 0]; - B = [1 - 0 - 0]; - C = [0 -0.5 1]; - D = 0; - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - ## Controller - t = [4:0.02:5]; # Time horizon - A_w = 0; # Setpoint - A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions - Q = ones(n_y,1);; - - ## Constaints - du*/dtau - Tau = [0:0.5:2]; - one = ones(size(Tau)); - limit = 1; - Min = -limit*one; - Max = limit*one; - Order = one; - [Gamma,gamma] = ppp_input_constraint (A_u,Tau,Min,Max,Order); - - W=1; - x_0 = zeros(3,1); - - ## Constrained - open-loop - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); - [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); - T = [0:t(2)-t(1):t(length(t))]; - [ys,us] = ppp_ystar(A,B,C,D,x_0,A_u,U,T); - - ## Non-linear - closed-loop - [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ - Tau,Min,Max,Order, \ - [],[],[],[], W,x_0); - - title("y,y*,u and u*"); - xlabel("t"); - grid; - plot(T,y,"1;y;", T,u,"2;u;", T,ys,"3;y*;", T,us,"4;u*;"); - - ## Compute derivatives. - dt = t(2)-t(1); - du = diff(u)/dt; - dus = diff(us)/dt; - T1 = T(1:length(T)-1); - ##plot(T1,du,T1,dus); -endfunction - - - - - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex13.m Index: mttroot/mtt/lib/control/PPP/ppp_ex13.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex13.m +++ mttroot/mtt/lib/control/PPP/ppp_ex13.m @@ -1,49 +0,0 @@ -function name = ppp_ex13 (ReturnName) - - ## usage: ppp_ex13 () - ## - ## PPP example: Sensitivity minimisation (incomplete) - - - ## Example name - name = "Sensitivity minimisation (incomplete)"; - - if nargin>0 - return - endif - - - ## System - unstable - A = [-3 -3 -1 - 1 0 0 - 0 1 0]; - B = [1 - 0 - 0]; - C = [0 -0.5 1 - 0 1.0 0]; - D = [0;0]; - - ## Setpoint - A_w = [0;0] - - ## Controller - t =[0:0.1:5]; # Optimisation horizon - t1 =[0:0.1:1]; - t2 =[1.1:0.1:3.9]; - t3 =[4:0.1:5]; - - - A_u = ppp_aug(laguerre_matrix(3,5.0), 0); - q_s=1e3; - Q = [exp(5*t) - q_s*exp(-t)] - size(Q) - W = [1;0]; - - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W) - -endfunction - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex14m.m Index: mttroot/mtt/lib/control/PPP/ppp_ex14m.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex14m.m +++ mttroot/mtt/lib/control/PPP/ppp_ex14m.m @@ -1,102 +0,0 @@ -function [name,T,y,u,ys,us,ysu,usu,J] = ppp_ex14m (ReturnName) - - ## usage: [name,T,y,u,ys,us,ysu,usu,J] = ppp_ex14 (ReturnName) - ## - ## PPP example - shows output constraints on nonlinear system - ## $Id$ - - - ## Example name - name = "Output constraints -0.1 on y* at tau=0.1,0.5,1,2"; - - if nargin>0 - if ReturnName - return - endif - endif - - ## System - A = [-3 -3 -1 - 1 0 0 - 0 1 0]; - B = [1 - 0 - 0]; - C = [0 -0.5 1]; - D = 0; - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - ## Controller - t = [4:0.02:5]; # Time horizon - A_w = 0; # Setpoint - A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions - Q = ones(n_y,1);; - - ## Constaints - u - Tau_u = []; - one = ones(size(Tau_u)); - limit = 3; - Min_u = -limit*one; - Max_u = limit*one; - Order_u = 0*one; - - ## Constraints - y - Tau_y = [0.1 0.5 1 2] - one = ones(size(Tau_y)); - Min_y = -0.01*one; # Min_y(5) = 0.99; - Max_y = 1e5*one; # Max_y(5) = 1.01; - Order_y = 0*one; - - ## Simulation - W=1; - x_0 = zeros(3,1); - - ## Constrained - open-loop - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); # Unconstrained design - [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); - [Gamma_y,gamma_y] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau_y,Min_y,Max_y,Order_y); - - Gamma = [Gamma_u; Gamma_y]; - gamma = [gamma_u; gamma_y]; - - ## Constrained OL simulation - [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); - T = [0:t(2)-t(1):t(length(t))]; - [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); - - ## Unconstrained OL simulation - [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); - [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); - - title("Constained and unconstrained y*"); - xlabel("t"); - grid; - plot(T,ys,T,ysu) - - ## Non-linear - closed-loop - movie = 1; - if movie - hold on; - endif - - [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ - Tau_u,Min_u,Max_u,Order_u, \ - Tau_y,Min_y,Max_y,Order_y,W,x_0,movie); - - hold off; -# title("y,y*,u and u*"); -# xlabel("t"); -# grid; -# plot(T,y,T,u,T,ysu,T,usu); - - ## Compute derivatives. - dt = t(2)-t(1); - du = diff(u)/dt; - dus = diff(us)/dt; - T1 = T(1:length(T)-1); - ##plot(T1,du,T1,dus); -endfunction - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex15.m Index: mttroot/mtt/lib/control/PPP/ppp_ex15.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex15.m +++ mttroot/mtt/lib/control/PPP/ppp_ex15.m @@ -1,64 +0,0 @@ -function [name,T,y,u,ye,ue,J] = ppp_ex15 (ReturnName) - - ## usage: ppp_ex15 () - ## - ## PPP example - an unstable, nmp siso system - ## $Id$ - - ## Example name - name = "Linear unstable non-minimum phase third order system - intermittent control"; - - if nargin>0 - return - endif - - - ## System - unstable - A = [3 -3 1 - 1 0 0 - 0 1 0]; - B = [10 - 0 - 0]; - C = [0 -0.5 1]; - D = 0; - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - ## Setpoint - A_w = ppp_aug(0,[]); - - ## Controller - t =[4.0:0.01:5.0]; # Optimisation horizon - dt = t(2)-t(1); - A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); - Q = 1; # Weight - - ##Simulate - W = 1; # Setpoint - x_0 = zeros(n_x,1); # Initial state - - - ## Closed-loop intermittent solution - Delta_ol = 0.5 # Intermittent time - - disp("Intermittent control simulation"); - R=1;P=0; - [T,y,u] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q,R,P, \ - [],[],[],[], \ - [],[],[],[],W,x_0,Delta_ol); -size(T) - ## Exact closed-loop - disp("Exact closed-loop"); - [k_x,k_w] = ppp_lin (A,B,C,D,A_u,A_w,t,Q) - [ye,Xe] = ppp_sm2sr(A-B*k_x, B, C, D, T, k_w*W, x_0); # Compute Closed-loop control - - ue = k_w*ones(size(T))*W - k_x*Xe; - - - title("y and u, exact and intermittent"); - xlabel("t"); - grid; - plot(T,y,"1;y (intermittent);", T,u,"2;u (intermittent);",\ - T,ye,"3;y (exact);", T,ue,"4;u (exact);"); - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ex16.m Index: mttroot/mtt/lib/control/PPP/ppp_ex16.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex16.m +++ mttroot/mtt/lib/control/PPP/ppp_ex16.m @@ -1,103 +0,0 @@ -function [name,T,y,u,ys,us,J] = ppp_ex16 (ReturnName) - - ## usage: [name,T,y,u,ys,us,T1,du,dus] = ppp_ex16 (ReturnName) - ## - ## PPP example - - ## $Id$ - - - ## Example name - name = "Input constraints +-1.5 on u* at tau=0,0.1,0.2..,2.0 - intermittent control"; - - if nargin>0 - return - endif - - ## System - A = [-3 -3 -1 - 1 0 0 - 0 1 0]; - B = [1 - 0 - 0]; - C = [0 -0.5 1]; - D = 0; - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - ## Controller - t = [5:0.01:6]; # Time horizon - A_w = 0; # Setpoint - A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions - A_u = ppp_aug(laguerre_matrix(1,0.5), A_u); # Add some extra slow modes - Q = ones(n_y,1);; - - ## Constaints - Gamma = []; - gamma = []; - - ## Constaints - u - Tau_u = [0:0.1:2]; - one = ones(size(Tau_u)); - limit = 1.5; - Min_u = -limit*one; - Max_u = limit*one; - Order_u = 0*one; - - ## Constaints - y - Tau_y = []; - one = ones(size(Tau_y)); - limit = 1.5; - Min_y = -limit*one; - Max_y = limit*one; - Order_y = 0*one; - - ## Simulation - W=1; - x_0 = zeros(3,1); - - ## Constrained - open-loop - disp("Control design"); - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); # Unconstrained design - [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); - - Gamma = Gamma_u; - gamma = gamma_u; - - disp("Open-loop simulations"); - ## Constrained OL simulation - [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); - T = [0:t(2)-t(1):t(length(t))]; - [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); - - ## Unconstrained OL simulation - [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); - [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); - - title("Constrained and unconstrained y* and u*"); - xlabel("t"); - grid; - axis([0 6 -1 2]); - plot(T,ys,T,ysu,T,us,T,usu) - axis; - - ## Non-linear - closed-loop - disp("Closed-loop simulation"); - Delta_ol = 0.1; - [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ - Tau_u,Min_u,Max_u,Order_u, \ - Tau_y,Min_y,Max_y,Order_y,W,x_0,Delta_ol); - - title("y,y*,u and u*"); - xlabel("t"); - grid; - plot(T,y,T,u,T,ys,T,us); -endfunction - - - - - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex17.m Index: mttroot/mtt/lib/control/PPP/ppp_ex17.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex17.m +++ mttroot/mtt/lib/control/PPP/ppp_ex17.m @@ -1,94 +0,0 @@ -function [name,T,y,u,ys,us,ysu,usu,J] = ppp_ex17 (ReturnName) - - ## usage: [name,T,y,u,ys,us,ysu,usu,J] = ppp_ex17 (ReturnName) - ## - ## PPP example - shows output constraints on nonlinear system - ## $Id$ - - - ## Example name - name = "Output constraints -0.1 on y* at tau=0.1,0.5,1,2 - intermittent control"; - - if nargin>0 - if ReturnName - return - endif - endif - - ## System - A = [-3 -3 -1 - 1 0 0 - 0 1 0]; - B = [1 - 0 - 0]; - C = [0 -0.5 1]; - D = 0; - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - ## Controller - t = [9:0.02:10]; # Time horizon - A_w = 0; # Setpoint - A_u = ppp_aug(laguerre_matrix(3,2.0), A_w); # Input functions - Q = ones(n_y,1);; - - ## Constraints - u - Tau_u = []; - one = ones(size(Tau_u)); - limit = 3; - Min_u = -limit*one; - Max_u = limit*one; - Order_u = 0*one; - - ## Constraints - y - Tau_y = [0.1 0.5 1 2] - one = ones(size(Tau_y)); - Min_y = -0.01*one; # Min_y(5) = 0.99; - Max_y = 1e5*one; # Max_y(5) = 1.01; - Order_y = 0*one; - - ## Simulation - W=1; - x_0 = zeros(3,1); - - ## Constrained - open-loop - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t,Q); # Unconstrained design - [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); - [Gamma_y,gamma_y] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau_y,Min_y,Max_y,Order_y); - - Gamma = [Gamma_u; Gamma_y]; - gamma = [gamma_u; gamma_y]; - - ## Constrained OL simulation - [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); - T = [0:t(2)-t(1):t(length(t))]; - - ## OL solution - [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); - - ## Unconstrained OL simulation - [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); - [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); - - title("Constained and unconstrained y*"); - xlabel("t"); - grid; - figure(1); - plot(T,ys,"-;y* (constrained);", T,ysu,"--;y* (unconstrained);") - - ## Non-linear - closed-loop - delta_ol = 0.1; mu = 1e-4; - [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ - Tau_u,Min_u,Max_u,Order_u, \ - Tau_y,Min_y,Max_y,Order_y,W,x_0,delta_ol,mu); - - title("y and u"); - xlabel("t"); - grid; - plot(T,y,"1;y (constrained);", T,u,"2;u (constrained);"); - -endfunction - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex18.m Index: mttroot/mtt/lib/control/PPP/ppp_ex18.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex18.m +++ mttroot/mtt/lib/control/PPP/ppp_ex18.m @@ -1,40 +0,0 @@ -function name = ppp_ex18 (ReturnName) - - ## usage: ppp_ex18 () - ## - ## PPP example - an unstable, nmp siso system - ## $Id$ - - - ## Example name - name = "First order with redundant inputs"; - - if nargin>0 - return - endif - - ## System - A = 1 - B = 1 - C = 1 - D = 0; - - ## Setpoint - A_w = ppp_aug(0,[]); - - ## Controller - ##Optimisation horizon - t =[2:0.1:3]; - - ## A_u - A_u = diag([0 -2 -4 -6]) - - [ol_poles,cl_poles] = ppp_lin_plot (A,B,C,D,A_u,A_w,t) - - -endfunction - - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex19.m Index: mttroot/mtt/lib/control/PPP/ppp_ex19.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex19.m +++ mttroot/mtt/lib/control/PPP/ppp_ex19.m @@ -1,105 +0,0 @@ -function [name,T,y,u,ys,us,J] = ppp_ex19 (ReturnName,n_extra,T_extra) - - ## usage: [name,T,y,u,ys,us,T1,du,dus] = ppp_ex19 (ReturnName) - ## - ## PPP example - - ## $Id$ - - - ## Example name - name = "Input constraints with redundant U*"; - - if (nargin>0)&&(ReturnName==1) - return - endif - - - if nargin<2 - n_extra = 3 - endif - - if nargin<3 - T_extra = 2.0 - endif - - - ## System - A = 1 - B = 1 - C = 1 - D = 0; - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - ## Controller - t = [2:0.01:3]; # Time horizon - A_w = 0; - A_u = diag([0 -6]); - A_u = ppp_aug(A_u,laguerre_matrix(n_extra,1/T_extra)) - Q = 1; - ## Constraints - Gamma = []; - gamma = []; - - ## Constraints - u - Tau_u = [0 0.1 0.5 1 1.5 2]; - Tau_u = 0; - one = ones(size(Tau_u)); - limit = 1.5; - Min_u = -limit*one; - Max_u = limit*one; - Order_u = 0*one; - - ## Constraints - y - Tau_y = []; - one = ones(size(Tau_y)); - limit = 1.5; - Min_y = -limit*one; - Max_y = limit*one; - Order_y = 0*one; - - ## Simulation - W=1; - x_0 = zeros(n_x,1); - - ## Constrained - open-loop - disp("Control design"); - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t); # Unconstrained design - [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); - - Gamma = Gamma_u; - gamma = gamma_u; - - disp("Open-loop simulations"); - ## Constrained OL simulation - [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); - T = [0:t(2)-t(1):t(length(t))]; - [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); - - ## Unconstrained OL simulation - [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); - [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); - - title("Constrained and unconstrained y*"); - xlabel("t"); - grid; - plot(T,ys,"-;y* (constrained);", T,ysu,"--;y* (unconstrained);"); - - ## Non-linear - closed-loop - disp("Closed-loop simulation"); - [T1,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ - Tau_u,Min_u,Max_u,Order_u, \ - Tau_y,Min_y,Max_y,Order_y,W,x_0); - - title("y and u"); - xlabel("t"); - grid; - plot(T,y,"1;y (constrained);", T,u,"2;u (constrained);"); - -endfunction - - - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex2.m Index: mttroot/mtt/lib/control/PPP/ppp_ex2.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex2.m +++ mttroot/mtt/lib/control/PPP/ppp_ex2.m @@ -1,32 +0,0 @@ -function name = ppp_ex2 (Return_Name) - - ## usage: Name = ppp_ex2 (Return_Name) - ## - ## PPP example: Effect of slow desired closed-loop - ## $Id$ - - - ## Example name - name = "Effect of slow desired closed-loop: closed-loop is same as open loop"; - - if nargin>0 - return - endif - - ## System - A = -1; # Fast - time constant = 1 - B = 0.5; # Gain is 1/2 - C = 1; - D = 0; - - ## Controller - t =[9:0.1:10]; # Optimisation horizon - - A_u = [-0.1 0 # Slow - time constant = 10 - 1 0]; - - A_w = 0; # Constant set point - - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w] = ppp_lin_plot(A,B,C,D,A_u,A_w,t) -endfunction - DELETED mttroot/mtt/lib/control/PPP/ppp_ex20.m Index: mttroot/mtt/lib/control/PPP/ppp_ex20.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex20.m +++ mttroot/mtt/lib/control/PPP/ppp_ex20.m @@ -1,73 +0,0 @@ -function [name,T,y,u,ys,us,ysu,usu] = ppp_ex20 (ReturnName) - - ## usage: ppp_ex20 () - ## - ## PPP example - 2nd-order 2i2o system - ## $Id$ - - - ## Example name - name = "2nd-order 2i2o system with 1st-order basis" - - if nargin>0 - return - endif - - ## System - A = [-2 -1 - 1 0]; - B = [[1;0], [1;2]]; - C = [ [0,1]; [2,1]]; - D = zeros(2,2); - -# sys = ss2sys(A,B,C,D); - [n_x,n_u,n_y] = abcddim(A,B,C,D); - -# ## Display it -# for j = 1:n_u -# for i = 1:n_y -# sysout(sysprune(sys,i,j),"tf") -# step(sysprune(sys,i,j),1,5); -# endfor -# endfor - - ## Setpoint - A_w = 0; - - ## Controller - - ##Optimisation horizon - t =[4:0.01:5]; - - ## A_u - pole = [3]; - poles = 1; - A_u = ppp_aug(butterworth_matrix(poles,pole),0); - Q = ones(n_y,1);; - - ## Setpoints - W = [1:n_y]'; - - ## Design and plot - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); - - format bank - cl_poles - - A_c = A-B*k_x; # Closed-loop A - A_cw = [A_c B*k_w*W - zeros(1,n_x+1)] - - log_cond_uu = log10(cond_uu) - # K_xwe = ppp_open2closed(A_u,A_cwe,[k_xe -k_we*W]); # Exact Kx -# K_xwc = ppp_open2closed(A_u,A_cw,[k_x -k_w*W]); # Computed Kx - # Exact_K_xw = K_xwe - PPP_K_xw = [K_x -K_w*W] -# Comp_K_xw = K_xwc - -# Error = Approx_K_xw - Comp_K_xw - -endfunction - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex20.new.m Index: mttroot/mtt/lib/control/PPP/ppp_ex20.new.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex20.new.m +++ mttroot/mtt/lib/control/PPP/ppp_ex20.new.m @@ -1,92 +0,0 @@ -# function name = ppp_ex20 (ReturnName) - -# ## usage: name = ppp_ex20 (ReturnName) -# ## -# ## PPP example -- a standard multivariable example -# ## $Id$ - - - -# ## Example name -# name = "Turbogenerator example: system TGEN from J.M Maciejowski: Multivariable Feedback Design"; - -# if nargin>0 -# return -# endif - - ## System - [A,B,C,D] = airc; - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - ## Controller - t = [9:0.1:10]; # Time horizon - A_w = zeros(n_y,1); # Setpoint - TC = 2*[1 1]; # Time constants for each input - # A_u = []; -# for tc=TC # Input -# A_u = [A_u;ppp_aug(laguerre_matrix(3,1/tc), 0)]; -# endfor - A_u = ppp_aug(laguerre_matrix(5,1.0), 0); - Q = [1;1]; # Output weightings - - ## Constraints - Gamma = []; - gamma = []; - - ## Constraints - u - Tau_u = [0 0.1 0.5 1 1.5 2]; - Tau_u = 0; - one = ones(size(Tau_u)); - limit = 1.5; - Min_u = -limit*one; - Max_u = limit*one; - Order_u = 0*one; - - ## Constraints - y - Tau_y = []; - one = ones(size(Tau_y)); - limit = 1.5; - Min_y = -limit*one; - Max_y = limit*one; - Order_y = 0*one; - - ## Simulation - W=[1;2;3]; - x_0 = zeros(n_x,1); - - ## Constrained - open-loop - disp("Control design"); - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t); # Unconstrained design - [Gamma_u,gamma_u] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u); - - Gamma = Gamma_u; - gamma = gamma_u; - - disp("Open-loop simulations"); - ## Constrained OL simulation - [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); - T = [0:t(2)-t(1):t(length(t))]; - [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); - - ## Unconstrained OL simulation - [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); - [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); - - title("Constrained and unconstrained y*"); - xlabel("t"); - grid; - plot(T,ys,T,ysu) - - ## Non-linear - closed-loop - disp("Closed-loop simulation"); - [T1,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, \ - Tau_u,Min_u,Max_u,Order_u, \ - Tau_y,Min_y,Max_y,Order_y,W,x_0); - - title("y,y*,u and u*"); - xlabel("t"); - grid; - plot(T1,y,T,ys,T1,u,T,us); - - -#endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ex21.m Index: mttroot/mtt/lib/control/PPP/ppp_ex21.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex21.m +++ mttroot/mtt/lib/control/PPP/ppp_ex21.m @@ -1,76 +0,0 @@ -function [name,T,y,u,ys,us,ysu,usu] = ppp_ex21 (ReturnName) - - ## usage: ppp_ex21 () - ## - ## PPP example - 2nd-order 2i2o system system with anomalous behaviour" - ## $Id$ - - - ## Example name - name = "2nd-order 2i2o system with anomalous behaviour" - - if nargin>0 - return - endif - - ## System - A = [-2 -1 - 1 0]; - B = [[1;0], [1;2]]; - C = [ [0,1]; [2,1]]; - D = zeros(2,2); - - sys = ss2sys(A,B,C,D); - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - ## Display it - for j = 1:n_u - for i = 1:n_y - sysout(sysprune(sys,i,j),"tf") - step(sysprune(sys,i,j),1,5); - endfor - endfor - - ## Setpoint - A_w = 0; - - ## Controller - - ##Optimisation horizon - t =[4:0.1:5]; - - ## A_u - pole = [4]; - #A_u = ppp_aug(laguerre_matrix(2,pole),0); - #A_u = ppp_aug(diag([-3,-4]),0); - A_u = ppp_aug(butterworth_matrix(2,pole),0); - Q = ones(n_y,1);; - - ## Setpoints - W = [1:n_y]'; - - ## Initial condition - x_0 = [0;0.5]; - - ## Design and plot - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0); - - format short - cl_poles - - A_c = A-B*k_x; # Closed-loop A - A_cw = [A_c B*k_w*W - zeros(1,n_x+1)] - - log_cond_uu = log10(cond_uu) - # K_xwe = ppp_open2closed(A_u,A_cwe,[k_xe -k_we*W]); # Exact Kx - #AA_u = ppp_inflate([A_u;A_u]); - K_xwc = ppp_open2closed(A_u,A_cw,[k_x -k_w*W]) # Computed Kx - # Exact_K_xw = K_xwe - Approx_K_xw = [K_x -K_w*W] - format - -endfunction - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex3.m Index: mttroot/mtt/lib/control/PPP/ppp_ex3.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex3.m +++ mttroot/mtt/lib/control/PPP/ppp_ex3.m @@ -1,62 +0,0 @@ -function name = ppp_ex3 (Return_Name) - - ## usage: Name = ppp_ex3 (Return_Name) - ## - ## PPP example: Uncoupled 5x5 system - ## $Id$ - - - - - ## Example name - name = "Uncoupled NxN system - n first order systems"; - - if nargin>0 - return - endif - - ## System - N uncoupled integrators - N = 3 - A = -0.0*eye(N); - B = eye(N); - C = eye(N); - D = zeros(N,N); - - t =[4:0.1:5]; # Optimisation horizon - ## Create composite matrices - A_u = []; # Initialise - A_w = []; # Initialise - - for i=1:N - ## Setpoint - constant - a_w = ppp_aug(0,[]); - A_w = [A_w;a_w]; - - ## Controller - a_u = ppp_aug(-i,a_w); - A_u = [A_u; a_u]; - endfor - - A_u = [-diag([1:N])] - - Q = ones(N,1); # Equal output weightings - W = ones(N,1); # Setpoints are all unity - - ## Design and simulate - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u] = ppp_lin(A,B,C,D,A_u,A_w,t); - # [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = \ - # ppp_lin_plot(A,B,C,D,A_u,A_w,t,Q,W); - - Approximate_K_x = K_x#(1:2:2*N,:) - A_c = A-B*k_x; - Closed_Loop_Poles = eig(A-B*k_x) - ## Now try out the open/closed loop theory -# A_u = -diag(1:N); # Full A_u matrix -# A_c = -diag(1:N); # Ideal closed-loop -# k_x = diag(1:N); # Ideal feedback - KK = ppp_open2closed (ppp_inflate(A_u),A_c,k_x); - Exact_K_x_tilde = KK - - -endfunction - DELETED mttroot/mtt/lib/control/PPP/ppp_ex4.m Index: mttroot/mtt/lib/control/PPP/ppp_ex4.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex4.m +++ mttroot/mtt/lib/control/PPP/ppp_ex4.m @@ -1,47 +0,0 @@ -function name = ppp_ex4 (ReturnName) - - ## usage: ppp_ex4 () - ## - ## PPP example -- a 1i2o system with performance limitations - ## $Id$ - - - - ## Example name - name = "Resonant system (1i2o): illustrates performance limitations with 2 different time-constants"; - - if nargin>0 - return - endif - - - ## Mass- sping damper from Middleton et al EE9908 - - ## Set parameters to unity - m_1 = 1; - m_2 = 1; - k = 1; - - ## System - [A,B,C,D] = TwoMassSpring (k,m_1,m_2); - - for TC = [0.4 1] - disp(sprintf("\nClosed-loop time constant = %1.1f\n",TC)); - ## Controller - A_w = zeros(2,1); # Setpoint: Unit W* for each output - t =[11:0.1:12]; # Optimisation horizon - [A_u] = ppp_aug(laguerre_matrix(4,1/TC), 0); # U* - - Q = [1;0]; - - ## Design and plot - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q) - hold on; - endfor - - hold off; -endfunction - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex5.m Index: mttroot/mtt/lib/control/PPP/ppp_ex5.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex5.m +++ mttroot/mtt/lib/control/PPP/ppp_ex5.m @@ -1,58 +0,0 @@ -function name = ppp_ex5 (ReturnName) - - ## usage: ppp_ex5 (ReturnName) - ## - ## PPP example -- a 28-state vibrating beam system - ## $Id$ - - - ## Example name - name = "Vibrating beam: 14 state regulation problem with 7 beam velocities as output"; - - if nargin>0 - return - endif - - - ## System - beam - Beam_numpar; - [A,B,C,D]=Beam_sm; - - ## Redo C and D to reveal ALL velocities - c = C(1); - C = zeros(7,14); - for i = 1:7 - C(i,2*i-1) = c; - endfor - D = zeros(7,1); - - e = eig(A); # Eigenvalues - N = length(e); - frequencies = sort(imag(e)); - frequencies = frequencies(N/2+1:N); # Modal frequencies - - ## Controller - ## Controller design parameters - t = [0.4:0.01:0.5]; # Optimisation horizon - - Q = ones(7,1); - - ## Specify input basis functions - ## - damped sinusoids with same frequencies as beam - damping_ratio = 0.2; # Damping ratio of inputs - A_u = damped_matrix(frequencies,0.2*ones(size(frequencies))); - u_0 = ones(14,1); # Initial conditions - - A_w = zeros(7,1); # Setpoint - W = zeros(7,1); # Zero setpoint - - ## Set up an "typical" initial condition - x_0 = zeros(14,1); - x_0(2:2:14) = ones(1,7); # Set initial twist to 1. - - ## Simulation - [ol_poles,cl_poles] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0); - - - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ex6.m Index: mttroot/mtt/lib/control/PPP/ppp_ex6.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex6.m +++ mttroot/mtt/lib/control/PPP/ppp_ex6.m @@ -1,55 +0,0 @@ -function [name,T,y,u,J] = ppp_ex6 (ReturnName) - - ## usage: [name,T,y,u,J] = ppp_ex6 (ReturnName) - ## - ## PPP example -- PPP for redundant actuation - ## $Id$ - - - ## Example name - name = "Two input-one output system with input constraints"; - - if nargin>0 - return - endif - - ## System - A = 0; - B = [0.5 1]; - C = 1; - D = [0 0]; - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - ## Controller - t = [4:0.1:5]; # Time horizon - A_w = 0; # Setpoint - A_u = [-2;-0.5]; # Input - Q = 1; # Output weight - - ## Constrain input 1 at time tau=0 - Tau = 0; - Max = [1;inf] - Min = [-inf;-inf]; - Order = 0; - i_u = 1; - - ## Simulation - W=1; - x_0 = 0; - - ## Linear - ppp_lin_plot (A,B,C,D,A_u,A_w,t); - - ## Non-linear - movie = 0; - [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, Tau,Min,Max,Order, \ - [],[],[],[], W,x_0); - title("y,u_1,u_2"); - xlabel("t"); - grid; - plot(T,y,"-;y;", T,u(1,:),"--;u_1;", T,u(2,:),".-;u_2;"); - -endfunction - - - DELETED mttroot/mtt/lib/control/PPP/ppp_ex7.m Index: mttroot/mtt/lib/control/PPP/ppp_ex7.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex7.m +++ mttroot/mtt/lib/control/PPP/ppp_ex7.m @@ -1,37 +0,0 @@ -function name = ppp_ex7 (ReturnName) - - ## usage: name = ppp_ex7 (ReturnName) - ## - ## PPP example -- standard multivariable system - ## $Id$ - - - ## Example name - name = "Aircraft example: system AIRC from J.M Maciejowski: Multivariable Feedback Design"; - - if nargin>0 - return - endif - - ## System - [A,B,C,D] = airc; - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - ## Controller - t = [4:0.01:5]; # Time horizon - A_w = 0; # Setpoint (same for each input) - #A_u = ppp_aug(laguerre_matrix(5,1), 0) # Same for each input - A_u = laguerre_matrix(5,1); # Same for each input - Q = ones(3,1); # Output weightings - ## Design and plot - W = [1;2;3] - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); - cl_poles - - ## Try open-closed theory but using computed values: - A_c = A - B*k_x; eig(A_c) - K_x - KK = ppp_open2closed (A_u,A_c,k_x) - - 100*((KK-K_x)./KK) -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ex8.m Index: mttroot/mtt/lib/control/PPP/ppp_ex8.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex8.m +++ mttroot/mtt/lib/control/PPP/ppp_ex8.m @@ -1,29 +0,0 @@ -function name = ppp_ex8 (ReturnName) - - ## usage: name = ppp_ex8 (ReturnName) - ## - ## PPP example - standard multivariable example - ## $Id$ - - ## Example name - name = "Automotive gas turbine example: system AUTM from J.M Maciejowski: Multivariable Feedback Design"; - - if nargin>0 - return - endif - - ## System - [A,B,C,D] = autm; - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - ## Controller - t = [4:0.1:5]; # Time horizon - A_w = 0; # Setpoint - A_u = ppp_aug(laguerre_matrix(4,2.0), 0) # Input - Q = [1;1e3]; # Output weightings - - ## Design and plot - W = [1;2] - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ex9.m Index: mttroot/mtt/lib/control/PPP/ppp_ex9.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ex9.m +++ mttroot/mtt/lib/control/PPP/ppp_ex9.m @@ -1,42 +0,0 @@ -function name = ppp_ex9 (ReturnName) - - ## usage: name = ppp_ex9 (ReturnName) - ## - ## PPP example -- a standard multivariable example - ## $Id$ - - - - ## Example name - name = "Turbogenerator example: system TGEN from J.M Maciejowski: Multivariable Feedback Design"; - - if nargin>0 - return - endif - - ## System - [A,B,C,D] = tgen; - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - ## Controller - t = [1.0:0.01:2.0]; # Time horizon -# A_w = zeros(n_y,1); # Setpoint -# TC = 2*[1 1]; # Time constants for each input -# A_u = []; -# for tc=TC # Input -# A_u = [A_u;ppp_aug(laguerre_matrix(3,1/tc), 0)]; -# endfor - A_w = 0; - A_u = ppp_aug(ppp_aug(laguerre_matrix(2,1.0),laguerre_matrix(2,2.0)), A_w) - Q = [1;1]; # Output weightings - - ## Design and plot - W = [1;2] - [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W); - -# ol_poles, cl_poles -# k_x,k_w -# K_X = [K_x -K_w] -# A_c = A - B*k_x; -# K_X_comp = ppp_open2closed (A_u,[A_c B*k_w*W; zeros(1,n_x+1)],[k_x -k_w*W]) -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_examples.m Index: mttroot/mtt/lib/control/PPP/ppp_examples.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_examples.m +++ mttroot/mtt/lib/control/PPP/ppp_examples.m @@ -1,54 +0,0 @@ -function ppp_examples () - - ## usage: ppp_examples () - ## - ## Various menu-driven PPP examples - - - str="menu(""Predictive Pole-Placement (PPP) examples"",""Exit"",""All examples"; # Menu string - - used = 2; - option=used; - - while option>1 - - exists=1; - i_example=1; # Example counter - while exists - name=sprintf("ppp_ex%i",i_example); - exists=(exist(name)==2); - if exists - title = eval(sprintf("%s(1);", name)); - str = sprintf("%s"",""%s",str,title); - i_example++; - endif - endwhile - n_examples = i_example-1; - - str = sprintf("%s"" );\n",str); - - option=eval(str); # Menu - ask user - - if option>1 # Do something - else return - if option==2 # All examples - Examples=1:n_examples; - else # Just the chosen examples - Examples = option-used; - endif - for example=Examples # Do the chosen examples - eval(sprintf("Title = ppp_ex%i(1);",example)); - disp(sprintf("Evaluating example ppp_ex%i:\n\t %s\n", example, Title)); - eval(sprintf("ppp_ex%i;",example)); - endfor - endif - - - endwhile - -endfunction - - - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_extract.m Index: mttroot/mtt/lib/control/PPP/ppp_extract.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_extract.m +++ mttroot/mtt/lib/control/PPP/ppp_extract.m @@ -1,31 +0,0 @@ -function A_i = ppp_extract (A_u,input) - - ## usage: A_i = ppp_extract (A_u) - ## - ## Extracts the ith A_u matrix. - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - [n,m] = size(A_u); # Size of composite A_u matrix - square = (n==m); # Its a square matrix so same U* on each input - if square - A_i = A_u; # All a_u the same - else - N = m; # Number of U* functions per input - n_u = n/m; - if floor(n_u) != n_u # Check that n_u is an integer - error("A_u must be square or be a column of square matrices"); - endif - - if input>n_u - error("Input index too large"); - endif - - ## Extract the ith matrix - start = (input-1)*N; - range=(start+1:start+N); - A_i = A_u(range,:); - endif - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_identify.m Index: mttroot/mtt/lib/control/PPP/ppp_identify.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_identify.m +++ mttroot/mtt/lib/control/PPP/ppp_identify.m @@ -1,62 +0,0 @@ -function [par,Par,Error,Y] = ppp_identify (system_name,u,y_0,par_names,par_0,extras) - ## ppp_identify: System identification for PPP - ## usage: [par,Par,Error,Y] = ppp_identify(system_name,u,y_0,par_names,par_0,extras) - ## - ## system_name String containing system name - ## u System input (column vector, each row is u') - ## y_0 Desired model output - ## par_names Column vector of (padded) strings - the adjustable - ## parameter names - ## par_0 Initial parameter vector estimate - ## extras (opt) optimisation parameters - ## .criterion convergence criterion - ## .max_iterations limit to number of iterations - ## .v Initial Levenberg-Marquardt parameter - - - if nargin<6 - extras.criterion = 1e-5; - extras.max_iterations = 10; - extras.v = 1e-5; - extras.verbose = 0; - endif - - s_system_name = sprintf("s%s", system_name); # Name of sensitivity system - - ## Set up parameters - sim = eval([s_system_name, "_simpar;"]); # Simulation parameter - sym = eval([s_system_name, "_sympar;"]); # Parameter names - x0 = eval([s_system_name, "_state(par_0);"]); # Initial state - -# ## Set up the free parameter list -# free = []; -# [n,m] = size(par_names); -# for i = 1:n -# p_name = deblank(par_names(i,:)); -# s_name = sprintf("%ss", p_name); -# if struct_contains(sym, p_name) -# i_p = eval(sprintf("sym.%s;", p_name)); -# if struct_contains(sym, s_name) -# i_s = eval(sprintf("sym.%s;", s_name)); -# free_i = eval(sprintf("[%i,%i];", i_p, i_s)); -# free = [free; free_i]; -# else -# printf("Sensitivity parameter %s does not exist: ignoring \ -# parameter %s\n", s_name, p_name); -# endif -# else -# printf("Parameter %s does not exist: ignoring\n", p_name) -# endif -# endfor -# free - free = ppp_indices(par_names,sym); - [par,Par,Error,Y] = ppp_optimise(s_system_name,x0,par_0,sim,u,y_0,free,extras); - -endfunction - - - - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_indices.m Index: mttroot/mtt/lib/control/PPP/ppp_indices.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_indices.m +++ mttroot/mtt/lib/control/PPP/ppp_indices.m @@ -1,48 +0,0 @@ -function indices = ppp_indices (names,sympar,sympars) - - ## usage: indices = ppp_indices (names,sympar) - ## - ## names: column vector of component names - ## sympar symbolic parameter structure for system - ## sympars symbolic parameter structure for sensitivity system - - - ## Returns a matrix indices with 3 columns, one row per name - ## First col: index of ith parameter of sensitivity system - ## Second col: index of ith sensitivity parameter of sensitivity system - ## Third col : index of ith parameter of system - ## Copyright (C) 2002 by Peter J. Gawthrop - - ## Sanity check - if nargin<3 - printf("Usage: ppp_indices (names,sympar,sympars)\n"); - return - endif - - ## Set up the - indices = []; - [n,m] = size(names); - for i = 1:n - p_name = deblank(names(i,:)); - s_name = sprintf("%ss", p_name); - if struct_contains(sympars, p_name) - i_ps = eval(sprintf("sympars.%s;", p_name)); - if struct_contains(sympars, s_name) - i_s = eval(sprintf("sympars.%s;", s_name)); - if struct_contains(sympar, p_name) - i_p = eval(sprintf("sympar.%s;", p_name)); - indices_i = eval(sprintf("[%i,%i,%i];", i_ps, i_s, i_p)); - indices = [indices; indices_i]; - else - printf("Parameter %s does not exist in sympar: ignoring\n", p_name) - endif - else - printf("Sensitivity parameter %s does not exist in sympars: ignoring \ - parameter %s\n", s_name, p_name); - endif - else - printf("Parameter %s does not exist in sympars: ignoring\n", p_name) - endif - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_inflate.m Index: mttroot/mtt/lib/control/PPP/ppp_inflate.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_inflate.m +++ mttroot/mtt/lib/control/PPP/ppp_inflate.m @@ -1,27 +0,0 @@ -function A_m = ppp_inflate (A_v) - - ## usage: A_m = ppp_inflate (A_v) - ## - ## Creates the square matrix A_m with the matrix elements of the column - ## vector of square matrices A_v. - - ## Copyright (C) 2001 by Peter J. Gawthrop - - [N,M] = size(A_v); - - if N-inf - Gamma = [Gamma; -Gamma_tau]; - gamma = [gamma; -Min(i)]; - endif - - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_input_constraints.m Index: mttroot/mtt/lib/control/PPP/ppp_input_constraints.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_input_constraints.m +++ mttroot/mtt/lib/control/PPP/ppp_input_constraints.m @@ -1,42 +0,0 @@ -function [Gamma,gamma] = ppp_input_constraints (A_u,Tau,Min,Max,Order) - - ## usage: [Gamma,gamma] = ppp_input_constraints (A_u,Tau,Min,Max[,Order]) - ## - ## Derives input copnstraint matrices Gamma and gamma - ## for multi-input systems. - ## A_u Input-generating matrix - ## Tau row vector of times at which constraints occur - ## Max, Maximum and minimum values - ## Limits at inf and -inf are discarded - - ## Sanity check - [n_u,n_tau] = size(Min); - [n,m] = size(Max); - if (n!=n_u)||(m!=n_tau) - error("Max and Min must have the same dimensions"); - endif - - [n,m] = size(Tau); - if (m!=n_tau) - error("Max and Min must have same number of columns as Tau"); - endif - if (n>1) - error("Tau must be a row vector"); - endif - - ##Defaults - if nargin<5 - Order=zeros(1,n_tau); - endif - - ## Stack up constraints for each input - Gamma=[]; - gamma=[]; - for i_u=1:n_u - [Gamma_i,gamma_i] = \ - ppp_input_constraint(A_u,Tau,Min(i_u,:),Max(i_u,:),Order,i_u,n_u); - Gamma = [Gamma; Gamma_i]; - gamma = [gamma; gamma_i]; - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_int_obs.m Index: mttroot/mtt/lib/control/PPP/ppp_int_obs.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_int_obs.m +++ mttroot/mtt/lib/control/PPP/ppp_int_obs.m @@ -1,34 +0,0 @@ -function [x_p,y_p,y_new,error] = ppp_int_obs (x,y,U,A,B,C,D,A_u,delta,L) - - ## usage: x_new = ppp_int_obs (x,y,U,A,B,C,D,A_u,delta,L) - ## - ## Intermittent observer for PPP - ## - ## x,y Current estimated state and measured output - ## U PPP control weights - ## A,B,C,D System matrices - ## A_u PPP basis matrix - ## delta time step - ## L Observer gain - ## x_p, y_p predicted estimated state and output - ## y_new corrected estimated current output - ## error corresponding error - - ## Copyright (C) 2003 by Peter J. Gawthrop - - ## Sanity check - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - if nargin<10 - L = zeros(n_x,n_y); - endif - - ## Corrector (on current value of output) - error = (C*x-y); - x_new = x - L*error; - y_new = C*x_new; - - ## Predictor (predicts Delta_OL ahead) - [y_p,us,x_p] = ppp_ystar (A,B,C,D,x_new,A_u,U,delta); - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ippp.m Index: mttroot/mtt/lib/control/PPP/ppp_ippp.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ippp.m +++ mttroot/mtt/lib/control/PPP/ppp_ippp.m @@ -1,20 +0,0 @@ -function i_ppp = ppp_ippp (n_ppp,sympar,sympars) - - ## usage: i_ppp = ppp_ippp (n_ppp,sympar,sympars) - ## nppp number of ppp parameters - ## sympars symbolic parameter structure for system - ## sympar symbolic parameter structure for sensitivity system - ## Returns a matrix i_ppp with n_ppp rows and 3 columns - ## First col: index of ith ppp parameter of sensitivity system - ## Second col: index of ith ppp sensitivity parameter of sensitivity system - ## Third col : index of ith ppp parameter of system - ## Copyright (C) 2002 by Peter J. Gawthrop - - i_ppp = []; - for i=1:n_ppp - i_ppp_i = eval(sprintf("[sympars.ppp_%i, sympars.ppp_%is \ - sympar.ppp_%i];",i,i,i)); - i_ppp = [i_ppp ; i_ppp_i]; - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_lin.m Index: mttroot/mtt/lib/control/PPP/ppp_lin.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin.m +++ mttroot/mtt/lib/control/PPP/ppp_lin.m @@ -1,238 +0,0 @@ -function [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P,max_cond); - ## usage: - ## [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = - ## ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P,max_cond) - - ## - ## Linear PPP (Predictive pole-placement) computation - ## INPUTS: - ## A,B,C,D: system matrices - ## A_u: composite system matrix for U* generation - ## one square matrix (A_ui) row for each system input - ## each A_ui generates U*' for ith system input. - ## OR - ## A_u: square system matrix for U* generation - ## same square matrix for each system input. - ## A_w: composite system matrix for W* generation - ## one square matrix (A_wi) row for each system output - ## each A_wi generates W*' for ith system output. - ## tau: row vector of times for optimisation (equispaced in time) - ## Q column vector of output weights (defaults to unity) - ## OR - ## Q matrix, each row corresponds to time-varying weight compatible with t - ## max_cond: Maximum condition number of J_uu (def 1/eps) - ## OUTPUTS: - ## k_x: State feedback gain - ## k_w: setpoint gain - ## ie u(t) = k_w w(t) - k_x x(t) - ## K_x, K_w: open loop gains - ## Us0: Value of U* at tau=0 - ## J_uu, J_ux, J_uw, J_xx,J_xw,J_ww: cost derivatives - ## cond_uu : Condition number of J_uu - ## Copyright (C) 1999, 2000 by Peter J. Gawthrop - ## $Id$ - - ## Check some dimensions - [n_x,n_u,n_y] = abcddim(A,B,C,D); - if (n_x==-1) - return - endif - - ## Default Q (output weight) - if nargin<8 - Q = ones(n_y,1); - endif - - ## Default R (input weight) - if nargin<9 - R = zeros(n_u,1); - endif - - ## Default P (terminal weight) - if nargin<10 - P = zeros(n_x,n_x); - P_weighting = 0; - else - P_weighting = 1; - endif - - ## Default condittion number - if nargin<11 - max_cond = 1e20; - endif - - [n_U,m_U] = size(A_u); - if (n_U != n_u*m_U)&&(n_U != m_U) - error("A_u must be square or have N_u rows and N_u/n_u columns"); - endif - - if (n_U == m_U) # U matrix square - n_U = n_U*n_u; # So same U* on each input - endif - - - [n_W,m_W] = size(A_w); - if n_W>0 - if (n_W != n_y*m_W)&&(n_W != m_W) - error("A_w must either be square or have N_w rows and N_w/n_y columns"); - endif - square_W = (n_W== m_W); # Flag indicates W is square - if (n_W == m_W) # W matrix square - n_W = n_W*n_y; # So same W* on each output - endif - endif - - - [n_t,m_t] = size(tau); - if n_t != 1 - error("tau must be a row vector"); - endif - dt = tau(2) - tau(1); # Sample interval - - [n_Q,m_Q] = size(Q); - if ((m_Q != 1)&&(m_Q != m_t)) || (n_Q != n_y) - error("Q must be a column vector with one row per system output"); - endif - - if (m_Q == 1) # Convert to vector Q(i) - Q = Q*ones(1,m_t); # Extend to cover full range of tau - endif - - ##Set up initial states - u_0 = ones(m_U,1); - w_0 = ones(m_W,1); - - ## Find y_U - derivative of y* wrt U. - i_U = 0; - x_0 = zeros(n_x,1); # This is for x=0 - y_u = []; # Initialise - x_u_t = []; # Initialise - Us = []; # Initialise - for i=1:n_U # Do for each input function U*_i - dU = zeros(n_U,1); - dU(++i_U) = 1; # Create dU/dU_i - [ys,us,xs] = ppp_ystar (A,B,C,D,x_0,A_u,dU,tau); # Find ystar and ustar - y_u = [y_u ys']; # Save y_u (y for input u) with one row for each t. - Us = [Us us']; # Save u (input) with one row for each - # t. - x_u_t = [x_u_t xs(:,m_t)]; # x_u at terminal time - endfor - - Ws = []; # Initialise - if n_W>0 - ## Find w* - i_W = 0; - x_0 = zeros(n_x,1); # This is for x=0 - for i=1:n_W # Do for each setpoint function W*i - dW = zeros(n_W,1); - dW(++i_W) = 1; # Create dW/dW_i - [ys,ws] = ppp_ystar ([],[],[],[],[],A_w,dW,tau); # Find ystar and ustar - Ws = [Ws ws']; # Save u (input) with one row for each t. - endfor - endif - - - - ## Find y_x - derivative of y* wrt x. - y_x=[]; - for t_i=tau - y = C*expm(A*t_i); - yy = reshape(y,1,n_y*n_x); # Reshape to a row vector - y_x = [y_x; yy]; - endfor - - ## Compute the integrals to give cost function derivatives - [n_yu m] = size(y_u'); - [n_yx m] = size(y_x'); - [n_yw m] = size(Ws'); - - J_uu = zeros(n_U,n_U); - J_ux = zeros(n_U,n_x); - J_uw = zeros(n_U,n_W); - J_xx = zeros(n_x,n_x); - J_xw = zeros(n_x,n_W); - J_ww = zeros(n_W,n_W); - - ## Add up cost derivatives for each output but weighted by Q. - ## Scaled by time interval - ## y_u,y_x and Ws should really be 3D matrices, but instead are stored - ## with one row for each time and one vector (size n_y) column for - ## each element of U - - ## Scale Q - Q = Q*dt; # Scale to give correct units - ## Non-w bits - for i = 1:n_y # For each output - QQ = ones(n_U,1)*Q(i,:); # Resize Q - J_uu = J_uu + (QQ .* y_u(:,i:n_y:n_yu)') * y_u(:,i:n_y:n_yu); - J_ux = J_ux + (QQ .* y_u(:,i:n_y:n_yu)') * y_x(:,i:n_y:n_yx); - QQ = ones(n_x,1)*Q(i,:); # Resize Q - J_xx = J_xx + (QQ .* y_x(:,i:n_y:n_yx)') * y_x(:,i:n_y:n_yx); - endfor - - ## Input weighting (scalar for the moment) - if (n_u>1) - warning("Sorry, cant do n_u>1 just now: exiting"); - return - endif - - ## Scale R - R = R*dt; # Scale to give correct units - for i = 1:m_t - Ust = Us(i,:); - J_uu = J_uu + Ust'*R*Ust; - endfor - - ## w bits - if n_W>0 - for i = 1:n_y # For each output - QQ = ones(n_U,1)*Q(i,:); # Resize Q - J_uw = J_uw + (QQ .* y_u(:,i:n_y:n_yu)') * Ws (:,i:n_y:n_yw); - QQ = ones(n_x,1)*Q(i,:); # Resize Q - J_xw = J_xw + (QQ .* y_x(:,i:n_y:n_yx)') * Ws (:,i:n_y:n_yw); - QQ = ones(n_W,1)*Q(i,:); # Resize Q - J_ww = J_ww + (QQ .* Ws (:,i:n_y:n_yw)') * Ws (:,i:n_y:n_yw); - endfor - endif - - if P_weighting - ## Terminal constraint - tau_last = tau(m_t); - x_x_t = expm(A*tau_last); # deriv. of x*(tau_2) wrt x(0) - J_ux = J_ux + x_u_t'*P*x_x_t; - J_uu = J_uu + x_u_t'*P*x_u_t; - - ## Terminal constraint - w bits - ## NB SISO ONLY at the moment - C = C(1,:); # REMOVE ME - - ## deriv of x* wrt W - if (cond(A)<1e10) # Finite ss gain - x_W_t = (A\B)*inv(C*(A\B)); - else # Infinite ss gain - Y_0 = zeros(n_x,n_y); Y_0(1,:) = ones(1,n_y); - x_W_t = obsv(A,C)\Y_0; - endif - - J_uw = J_uw + x_u_t'*P*x_W_t; - endif - - ## Exit if badly conditioned - cond_uu = cond(J_uu); - if cond_uu>max_cond - error(sprintf("J_uu is badly conditioned. Condition number = \ - 10^%i",log10(cond_uu))); - endif - - ## Compute the open-loop gains - K_w = J_uu\J_uw; - K_x = J_uu\J_ux; - - ## U*(tau) at tau=0 - Us0 = ppp_ustar(A_u,n_u,0); - - ## Compute the closed-loop gains - k_x = Us0*K_x; - k_w = Us0*K_w; - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_lin_con_sol.m Index: mttroot/mtt/lib/control/PPP/ppp_lin_con_sol.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin_con_sol.m +++ mttroot/mtt/lib/control/PPP/ppp_lin_con_sol.m @@ -1,10 +0,0 @@ -function U = ppp_lin_con_sol (x,w,J_uu,J_ux,J_uw) - - ## usage: U = ppp_lin_con_sol (x,w,J_uu,J_ux,J_uw) - ## - ## - - ## Pass info to the solnp algorithm - global ppp_J_uu, ppp_J_ux, ppp_J_uw - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_lin_obs.m Index: mttroot/mtt/lib/control/PPP/ppp_lin_obs.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin_obs.m +++ mttroot/mtt/lib/control/PPP/ppp_lin_obs.m @@ -1,54 +0,0 @@ -function [l_x,l_y,L_x,L_y,J_uu,J_ux,J_uw,Us0] = ppp_lin_obs (A,B,C,D,A_u,A_y,t,Q) - - ## usage: [l_x,l_y,L_x,L_y,J_uu,J_ux,J_uw,Us0] = ppp_lin_obs (A,B,C,D,A_u,A_y,t,Q) - ## - ## Linear PPP (Predictive pole-placement) computation - ## INPUTS: - ## A,B,C,D: system matrices - ## A_u: composite system matrix for U* generation - ## one square matrix (A_ui) row for each system input - ## each A_ui generates U*' for ith system input. - ## A_y: composite system matrix for W* generation - ## one square matrix (A_yi) row for each system output - ## each A_yi generates W*' for ith system output. - ## t: row vector of times for optimisation (equispaced in time) - ## Q column vector of output weights (defaults to unity) - - ## OUTPUTS: - ## l_x: State feedback gain - ## l_y: setpoint gain - ## ie u(t) = l_y w(t) - l_x x(t) - ## L_x, L_y: open loop gains - ## J_uu, J_ux, J_uw: cost derivatives - ## Us0: Value of U* at tau=0 - - ## Check some dimensions - [n_x,n_u,n_y] = abcddim(A,B,C,D); - if (n_x==-1) - return - endif - - ## Default Q - if nargin<8 - Q = ones(n_y,1); - endif - - -# B_x = eye(n_x); # Pseudo B -# D_x = zeros(n_y,n_x); # Pseudo D - [l_x,l_y,L_x,L_y,J_uu,J_ux,J_uw,Us0] = ppp_lin(A',C',B',D',A_u',A_y',t,Q); - - l_x = l_x'; - l_y = l_y'; - L_x = L_x'; - L_y = L_y'; -endfunction - - - - - - - - - DELETED mttroot/mtt/lib/control/PPP/ppp_lin_plot.m Index: mttroot/mtt/lib/control/PPP/ppp_lin_plot.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin_plot.m +++ mttroot/mtt/lib/control/PPP/ppp_lin_plot.m @@ -1,90 +0,0 @@ -function [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0) - - ## usage: [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w,cond_uu] = ppp_lin_plot (A,B,C,D,A_u,A_w,t,Q,W,x_0) - ## - ## Linear PPP (Predictive pole-placement) computation with plotting - ## INPUTS: - ## A,B,C,D: system matrices - ## A_u: composite system matrix for U* generation - ## one square matrix (A_ui) row for each system input - ## each A_ui generates U*' for ith system input. - ## A_w: composite system matrix for W* generation - ## one square matrix (A_wi) row for each system output - ## each A_wi generates W*' for ith system output. - ## t: row vector of times for optimisation (equispaced in time) - ## Q: column vector of output weights (defaults to unity) - ## W: Constant setpoint vector (one element per output) - ## x_0: Initial state - ## OUTPUTS: - ## Various poles 'n zeros - ## k_x: State feedback gain - ## k_w: setpoint gain - ## ie u(t) = k_w w(t) - k_x x(t) - ## K_x, K_w: open loop gains - ## J_uu, J_ux, J_uw: cost derivatives - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - ## Some dimensions - [n_x,n_u,n_y] = abcddim(A,B,C,D); - [n_U,m_U]=size(A_u); - square = (n_U==m_U); # Its a square matrix so same U* on each input - [n_W,m_W]=size(A_w); - if n_W==m_W # A_w square - n_W = n_W*n_y; # Total W functions - endif - - - [n_t,m_t] = size(t); - - ## Default Q - if nargin<8 - Q = ones(n_y,1) - endif - - ## Default W - if nargin<9 - W = ones(n_W,1) - endif - - ## Default x_0 - if nargin<10 - x_0 = zeros(n_x,1); - endif - - ## Check some dimensions - [n_Q,m_Q] = size(Q); - if ((m_Q != 1)&&(m_Q != m_t)) || (n_Q != n_y) - error("Q must be a column vector with one row per system output"); - endif - - [n,m] = size(W); - if ((m != 1) || (n != n_W)) - error("W must be a column vector with one element per system output"); - endif - - [n,m] = size(x_0); - if ((m != 1) || (n != n_x)) - error("x_0 must be a column vector with one element per system state"); - endif - - ## Simulate - [y,ystar,t,k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu]\ - = ppp_lin_sim(A,B,C,D,A_u,A_w,t,Q,W,x_0); - - ## Plot - xlabel("Time"); title("y* and y"); grid; - plot(t,ystar,t,y); - - ## Compute some pole/zero info - cl_poles = eig(A-B*k_x)'; - ol_poles = eig(A)'; - - if nargout>3 - ol_zeros = tzero(A,B,C,D)'; - cl_zeros = tzero(A-B*k_x,B,C,D)'; - endif - -endfunction - DELETED mttroot/mtt/lib/control/PPP/ppp_lin_quad.m Index: mttroot/mtt/lib/control/PPP/ppp_lin_quad.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin_quad.m +++ mttroot/mtt/lib/control/PPP/ppp_lin_quad.m @@ -1,25 +0,0 @@ -function [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,A_u] = \ - ppp_lin_quad (A,B,C,D,tau,Q,R,A_e) - - ## usage:[k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,A_u] = - ## ppp_lin_quad (A,B,C,D,tau,Q,R[,A_e]) - ## - ## - - ## Steady-state Linear Quadratic solution - ## using Algebraic Riccati equation (ARE) - - if nargin<8 - A_e = []; - endif - - [P,A_u,A_w] = ppp_are (A,B,C,D,Q,R); - - A_u = ppp_aug(A_u,A_e); - - ## PPP solution - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww] = \ - ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P); - - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_lin_run.m Index: mttroot/mtt/lib/control/PPP/ppp_lin_run.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin_run.m +++ mttroot/mtt/lib/control/PPP/ppp_lin_run.m @@ -1,382 +0,0 @@ -function [t,y,u,X_est,y_c,t_e,y_e,e_e,p_c,p_o] = ppp_lin_run (Name,Simulate,ControlType,w,x_0,p_c,p_o) - - ## usage: [t,y,u,y_c,t_e,y_e,e_e,p_c,p_o] = ppp_lin_run (Name,Simulate,ControlType,w,x_0,p_c,p_o) - ## - ## - ## Linear closed-loop PPP of lego system (and simulation) - ## - ## Name: Name of system (in mtt terms) - ## Simulate = 0: real thing - ## Simulate = 1: simulate - ## Control = 0: step test - ## Control = 1: PPP open-loop - ## Control = 2: PPP closed-loop - ## w is the (constant) setpoint - ## par_control and par_observer are structures containing parameters - ## for the observer and controller - - ##Defaults - if nargin<1 # Default name to dir name - names = split(pwd,"/"); - [n_name,m_name] = size(names); - Name = deblank(names(n_name,:)); - endif - - if nargin<6 - p_c.N = 50; - endif - - if nargin<7 - p_o.sigma = 1e-1; - endif - - ## System - sys = mtt2sys(Name); # Create system - [A,B,C_0,D_0] = sys2ss(sys); # SS form - [n_x, n_u, n_y] = abcddim(A,B,C_0,D_0); - - ## Extract matrices for controlled and constrained outputs. - if !struct_contains(p_c,"I_0") # Indices for controlled outputs - p_c.I_0 = 1:n_y - endif - if !struct_contains(p_c,"I_1") # Indices for constrained outputs - p_c.I_1 = 1:n_y - endif - - C = C_0(p_c.I_0,:) - C_c = C_0(p_c.I_1,:); - D = D_0(p_c.I_0,:); - D_c = D_0(p_c.I_1,:); - [n_x, n_u, n_y] = abcddim(A,B,C,D); # Dimensions - [n_x, n_u, n_y_c] = abcddim(A,B,C_c,D_c); # Dimensions - - - if nargin<2 - Simulate = 1; - endif - - if nargin<3 - ControlType = 2; - endif - - if nargin<4 - w = ones(n_y,1);; - endif - - if nargin<5 - x_0 = zeros(n_x,1); - endif - - if !struct_contains(p_c,"delta_ol") - p_c.delta_ol = 0.5; # OL sample interval - endif - - if !struct_contains(p_c,"T") - p_c.T = 10; # Last time point. - endif - - if !struct_contains(p_c,"Iterations") - p_c.Iterations = 5; # Number of interations, total =T*Iterations - endif - - if !struct_contains(p_c,"augment") - p_c.augment = 0; # Augment basis funs with constant - endif - - if !struct_contains(p_c,"integrate") - p_c.integrate = 0; - endif - - if !struct_contains(p_c,"Tau_u") - p_c.Tau_u = []; - p_c.Min_u = []; - p_c.Max_u = []; - endif - - if !struct_contains(p_c,"Tau_y") - p_c.Tau_y = []; - p_c.Min_y = []; - p_c.Max_y = []; - endif - - - if !struct_contains(p_c,"Method") - p_c.Method = "lq"; - endif - - if struct_contains(p_c,"Method") - if strcmp(p_c.Method,"lq") - p_c.Q = eye(n_y); - p_c.n_U = n_x; - if !struct_contains(p_c,"R") - p_c.R = (0.1^2)*eye(n_u); - endif - elseif strcmp(p_c.Method,"original"); - if !struct_contains(p_c,"A_w") - p_c.A_w = 0; - endif - if !struct_contains(p_c,"A_u") - p_c.n_U = n_x; - a_u = 2.0; - p_c.A_u = laguerre_matrix(p_c.n_U,a_u); - if p_c.augment # Put in constant term - p_c.A_u = ppp_aug(0,p_c.A_u); - endif - endif - else - error(sprintf("Method %s not recognised", p_c.Method)); - endif - endif - - if !struct_contains(p_c,"tau") # Time horizon - if strcmp(p_c.Method,"lq") - p_c.tau = [0:0.1:1]*2; - elseif strcmp(p_c.Method,"original"); - p_c.tau = [10:0.1:11]; - else - error(sprintf("Method %s not recognised", p_c.Method)); - endif - endif - - if !struct_contains(p_c,"A_e") - p_c.A_e = []; # No extra modes - endif - - if !struct_contains(p_o,"x_0") - p_o.x_0 = zeros(n_x,1); - endif - - if !struct_contains(p_o,"method") - ##p_o.method = "continuous"; - ##p_o.method = "intermittent"; - p_o.method = "remote"; - endif - - ## Check w. - [n_w,m_w] = size(w); - if ( (n_w!=n_y) || (m_w!=1) ) - error(sprintf("ppp_lin_run: w must a column vector with %i elements",n_y)); - endif - - ## Initialise - x_est = p_o.x_0; - - ## Initialise simulation state - x = x_0; - y_i = C*x_0 - - if ControlType==0 # Step input - I = 1; # 1 large sample - p_c.delta_ol = p_c.T; # I - K_w = zeros(p_c.n_U,n_y); - K_w(1,1) = 1; - K_w(2,1) = -1; - K_x = zeros(p_c.n_U,n_x); - else - I = ceil(p_c.T/p_c.delta_ol) # Number of large samples - if strcmp(p_c.Method, "original") - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww] =\ - ppp_lin(A,B,C,D,p_c.A_u,p_c.A_w,p_c.tau); # Design - elseif strcmp(p_c.Method, "lq") # LQ design - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,A_u] \ - = ppp_lin_quad (A,B,C,D,p_c.tau,p_c.Q,p_c.R,p_c.A_e); - p_c.A_u = A_u; - else - error(sprintf("Control method %s not recognised", p_c.Method)); - endif - - ##Sanity check A_u - [p_c.n_U,M_u] = size(p_c.A_u); - if (p_c.n_U!=M_u) - error("A_u must be square"); - endif - - ## Checks - cl_poles = eig(A - B*k_x) - ol_poles = eig(A) - t_max = 1/min(abs(cl_poles)); - t_min = 1/max(abs(cl_poles)); - endif - - ## Initial control U - U = zeros(p_c.n_U,1) ; - - ## Short sample interval - dt = p_c.delta_ol/p_c.N; - - ## Observer design - G = eye(n_x); # State noise gain - sigma_x = eye(n_x); # State noise variance - Sigma = p_o.sigma*eye(n_y) # Measurement noise variance - - if strcmp(p_o.method, "intermittent") - Ad = expm(A*p_c.delta_ol); # Discrete-time transition matrix - if (ControlType==2) # - [L, M, P, obs_poles] = dlqe(Ad,G,C,sigma_x,Sigma); - else - L = zeros(n_x,n_y); - obs_poles = eig(Ad); - endif - elseif strcmp(p_o.method, "continuous") - Ad = expm(A*dt); # Discrete-time transition matrix - A_ud = expm(p_c.A_u*dt); # Discrete-time input transition - if (ControlType==2) # - [L, M, P, obs_poles] = dlqe(Ad,G,C,sigma_x,Sigma); - else - L = zeros(n_x,n_y); - obs_poles = eig(Ad); - endif - elseif strcmp(p_o.method, "remote") - L = zeros(n_x,n_y); - obs_poles = []; - else - error(sprintf("Observer method ""%s"" unknown", p_o.method)); - endif - - ## Display the poles - obs_poles - - ## Write the include file for the real-time function - ## Use double length to allow for overuns - overrun = 2; - Ustar = ppp_ustar (p_c.A_u, n_u, [0:dt:overrun*p_c.delta_ol], 0,0); - if p_c.integrate # Integrate Ustar - disp("Integrating Ustar"); - Ustar = cumsum(Ustar)*dt; - endif - - disp("Writing Ustar.h ..."); - ppp_ustar2h(Ustar); - disp("done."); - - - ## Control loop - y = []; - y_c = []; - u = []; - t = []; - y_e = []; - X_est = []; - t_e = []; - e_e = []; - tick = time; - i=0; - - for j=1:p_c.Iterations - for k=1:I - tim=time; # Timing - i++; - - if Simulate # Exact simulation - X = x; # Current (simulated) state - else # The real thing - if strcmp(p_o.method, "remote") - [t_i,y_i,u_i,X] = ppp_put_get_X(U); # Remote-state interface - else - [t_i,y_i,u_i] = ppp_put_get(U); # Generic interface to real-time - endif - endif - - ## Observer - if strcmp(p_o.method, "intermittent") - [x_est y_est y_new, e_est] = ppp_int_obs \ - (x_est,y_i,U,A,B,C,D,p_c.A_u,p_c.delta_ol,L); - elseif strcmp(p_o.method, "continuous") - Ui = U; # U at sub intervals - for k = 1:p_c.N - [x_est y_est y_new e_est] = ppp_int_obs \ - (x_est,yi(:,k),Ui,A,B,C,D,p_c.A_u,dt,L); - Ui = A_ud'*Ui; - y_e = [y_e; y_new']; - e_e = [e_e; e_est']; - endfor - elseif strcmp(p_o.method, "remote") - ## predict from remote state (with zero L) - if (ControlType==2) # Closed-loop - [x_est y_est y_new e_est] = ppp_int_obs \ - (X,y_i,U,A,B,C,D,p_c.A_u,p_c.delta_ol,zeros(n_x,1)); - ## x_est = X; y_est=y_i; y_new=y_i; e_est=0; - else # Open-loop - [x_est y_est y_new e_est] = ppp_int_obs \ - (x_est,y_i,U,A,B,C,D,p_c.A_u,p_c.delta_ol,zeros(n_x,1)); - endif - endif - - ## Simulation (based on U_i) - if Simulate - t_sim = [1:p_c.N]*dt; # Simulation time points - [yi,ui,xsi] = ppp_ystar(A,B,C,D,x,p_c.A_u,U,t_sim); # Simulate - x = xsi(:,p_c.N); # NEXT state - ti = [(i-1)*p_c.N:i*p_c.N-1]*dt; - y_i = yi(1); # Current output - t_i = ti(1); - endif - - ##Control - if ( length(p_c.Tau_u)==0&&length(p_c.Tau_y)==0 ) - U = K_w*w - K_x*x_est; - else - ## Input constraints - [Gamma_u, gamma_u] = \ - ppp_input_constraints(p_c.A_u,p_c.Tau_u,p_c.Min_u,p_c.Max_u); - - ## Output constraints - [Gamma_y,gamma_y] = \ - ppp_output_constraints(A,B,C_c,D_c,x_est,p_c.A_u,\ - p_c.Tau_y,p_c.Min_y,p_c.Max_y); - - ## Composite constraints - t=0 - Gamma = [Gamma_u; Gamma_y]; - gamma = [gamma_u; gamma_y]; - - [u_qp,U,n_active] = ppp_qp \ - (x_est,w,J_uu,J_ux,J_uw,Us0,Gamma,gamma,1e-6,1); - endif - - ## Allow for the delay - ##U = expm(p_c.delta_ol*p_c.A_u)*U; - - ## Save data - if Simulate - t = [t;ti']; - y = [y;yi']; - X_est = [X_est;x_est']; - y_c = [y_c;(C_c*xsi)']; - u = [u;ui']; - else - t = [t;t_i]; - y = [y;y_i']; - X_est = [X_est;x_est']; - u = [u;u_i']; - endif - - if strcmp(p_o.method, "intermittent")||strcmp(p_o.method, "remote") - y_e = [y_e; y_new']; - e_e = [e_e; e_est']; - t_e = [t_e; t_i]; - endif - if !Simulate - delta_comp = time-tim; - usleep(floor(1e6*(p_c.delta_ol-delta_comp-0.01))); - endif - - endfor # Main loop - w = -w; - endfor # Outer loop - if !Simulate - ppp_put_get(0*U); # Reset to zero - endif - - - if strcmp(p_o.method, "continuous") - t_e = t; - endif - - - average_ol_sample_interval = (time-tick)/i - - ## Put data on file (so can use for identification) - filename = sprintf("%s_ident_data.dat",Name); - eval(sprintf("save -ascii %s t y u",filename)); - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_lin_sim.m Index: mttroot/mtt/lib/control/PPP/ppp_lin_sim.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_lin_sim.m +++ mttroot/mtt/lib/control/PPP/ppp_lin_sim.m @@ -1,88 +0,0 @@ -function [y,ystar,t,k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin_sim(A,B,C,D,A_u,A_w,tau,Q,W,x_0) - - ## usage: [ol_poles,cl_poles,ol_zeros,cl_zeros,k_x,k_w,K_x,K_w] = ppp_lin_plot (A,B,C,D,A_u,A_w,tau,Q,W,x_0) - ## - ## Linear PPP (Predictive pole-placement) computation with plotting - ## INPUTS: - ## A,B,C,D: system matrices - ## A_u: composite system matrix for U* generation - ## one square matrix (A_ui) row for each system input - ## each A_ui generates U*' for ith system input. - ## A_w: composite system matrix for W* generation - ## one square matrix (A_wi) row for each system output - ## each A_wi generates W*' for ith system output. - ## tau: row vector of times for optimisation (equispaced in time) - ## Q: column vector of output weights (defaults to unity) - ## W: Constant setpoint vector (one element per output) - ## x_0: Initial state - ## OUTPUTS: - ## y : closed-loop output - ## ystar : open-loop moving-horizon output - ## t : time axis - - ## Copyright (C) 2001 by Peter J. Gawthrop - ## $id: ppp_lin_plot.m,v 1.13 2001/01/26 16:03:13 peterg Exp $ - - ## Some dimensions - [n_x,n_u,n_y] = abcddim(A,B,C,D); - [n_U,m_U]=size(A_u); - square = (n_U==m_U); # Its a square matrix so same U* on each input - [n_W,m_W]=size(A_w); - if n_W==m_W # A_w square - n_W = n_W*n_y; # Total W functions - endif - - - [n_tau,m_tau] = size(tau); - - ## Default Q - if nargin<8 - Q = ones(n_y,1); - endif - - ## Default W - if nargin<9 - W = ones(n_W,1) - endif - - ## Default x_0 - if nargin<10 - x_0 = zeros(n_x,1); - endif - - ## Check some dimensions - [n_Q,m_Q] = size(Q); - if ((m_Q != 1)&&(m_Q != m_tau)) || (n_Q != n_y) - error("Q must be a column vector with one row per system output"); - endif - - [n,m] = size(W); - if ((m != 1) || (n != n_W)) - error("W must be a column vector with one element per system output"); - endif - - [n,m] = size(x_0); - if ((m != 1) || (n != n_x)) - error("x_0 must be a column vector with one element per system state"); - endif - - ## Control design - disp("Designing controller"); - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin (A,B,C,D,A_u,A_w,tau,Q); - - ## Set up simulation times - dtau = tau(2) -tau(1); # Time increment - t = 0:dtau:tau(length(tau)); # Time starting at zero - - ## Compute the OL step response - disp("Computing OL response"); - U = K_w*W - K_x*x_0; - ystar = ppp_ystar (A,B,C,D,x_0,A_u,U,t); - - ## Compute the CL step response - disp("Computing CL response"); - y = ppp_sm2sr(A-B*k_x, B, C, D, t, k_w*W, x_0); # Compute Closed-loop control - - -endfunction - DELETED mttroot/mtt/lib/control/PPP/ppp_nlin.m Index: mttroot/mtt/lib/control/PPP/ppp_nlin.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_nlin.m +++ mttroot/mtt/lib/control/PPP/ppp_nlin.m @@ -1,37 +0,0 @@ -function [U, U_all, Error, Y, its] = ppp_nlin(system_name,x_0,par_0,sim,us,w,free, Q, extras) - - ## usage: [U, U_all, Error, Y,its ] = ppp_nlin(system_name,x_0,par_0,sim,us,w,free, Q, extras) - ## - ## - - if nargin<9 - extras.criterion = 1e-8; - extras.max_iterations = 10; - extras.v = 0.1; - extras.verbose = 1; - endif - - s_system_name = sprintf("s%s", system_name); # Name of sensitivity system - - ## Details - [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name)); - [n_tau,n_us] = size(us); - - if nargin<8 - Q = ones(n_y,1); - endif - - ## Checks - if (n_us<>n_u) - error(sprintf("Inputs (%i) differenct to system inputs (%i)", n_us, n_u)); - endif - - ##Optimise - [par,Par,Error,Y,its] = ppp_optimise(s_system_name,x_0,par_0,sim,us,w,free,Q,extras); - - U = par(free(:,1)); - U_all = Par(free(:,1),:); -endfunction - - - DELETED mttroot/mtt/lib/control/PPP/ppp_nlin_run.m Index: mttroot/mtt/lib/control/PPP/ppp_nlin_run.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_nlin_run.m +++ mttroot/mtt/lib/control/PPP/ppp_nlin_run.m @@ -1,271 +0,0 @@ -function [y,u,t,p,UU,t_open,t_ppp,t_est,its_ppp,its_est] = ppp_nlin_run(system_name,i_ppp,i_par,A_u,w_s,N_ol,Q,extras) - - - ## usage: [y,u,t,p,U,t_open,t_ppp,t_est,its_ppp,its_est] = - ## ppp_nlin_run (system_name,i_ppp,i_par,A_u,w_s,N_ol[,extras]) - ## - ## y,u,t System output, input and corresponding time p - ## Estimated parameters U PPP weight vector t_open The - ## open-loop interval t_ppp Time for each ppp optimisation t_est - ## Time for each estimation i_ppp Matrix of ppp gain indices: col. - ## 1 Gain indices in sensitivity system col. 2 Gain sensitivity - ## indices in sensitivity system col. 3 Gain indices in system - ## i_par Matrix of indices of estimated parameters col. 1 Parameter - ## indices in sensitivity system col. 2 Parameter sensitivity - ## indices in sensitivity system col. 3 Parameter indices in system - ## A_u Basis function generating matrix w_s w_star: That part - ## of the moving horizon setpoint within the optimisation horizon. - ## N_ol The number of open-loop intervals to be computed extras - ## Extra parameters in a structure: extras.alpha ?? - ## extras.criterion Optimisation convergence criterion - ## extras.emulate_timing Simulate some real-time features - ## extras.estimate Estimate parameters and states - ## extras.max_iterations Maximum optimisation iterations - ## extras.simulate 1 for simulation (not real-time) extras.vInitial Levenberg-Marquardt parameter - ## extras.verbose 1 for extra info display - ## - ## Real-time implementatipn of nonlinear PPP Copyright (C) 2001,2002 - ## by Peter J. Gawthrop - - ## Globals to pass details to simulation - global system_name_sim i_ppp_sim x_0_sim y_sim u_sim A_u_sim simpar_sim - - ## Defaults - if nargin<8 - extras.alpha = 0.1; - extras.criterion = 1e-5; - extras.emulate_timing = 0; - extras.max_iterations = 10; - extras.simulate = 1; - extras.v = 1e-5; - extras.verbose = 0; - extras.visual = 0; - endif - - ##Estimate if we have some adjustable parameters - estimating_parameters = (length(i_par)>0); - - ## Names - s_system_name = sprintf("s%s", system_name); - - ## System details -- defines simulation within ol interval - par = eval(sprintf("%s_numpar;", system_name)); - simpar = eval(sprintf("%s_simpar;", system_name)); - dt = simpar.dt; # Sample interval - simpar_est = simpar; # Initial estimation simulation params - simpar_model = simpar; # Initial internal model simulation params - simpar_pred = simpar; # Initial prediction simulation params - T_ol_0 = simpar.last; # The initial specified interval - n_t = round(simpar.last/simpar.dt); # Corresponding length - x_0 = eval(sprintf("%s_state(par);", system_name)); - x_0_model = x_0; - [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name)); - [n_par,m_par] = size(i_par); - if nargin<8 - Q = ones(n_y,1); - endif - - ## Sensitivity system details -- defines moving horizon simulation - simpars = eval(sprintf("%s_simpar;", s_system_name)); - pars = eval(sprintf("%s_numpar;", s_system_name)); - x_0s = eval(sprintf("%s_state(pars);", s_system_name)); - x_0_models = x_0s; - - p = []; # Initialise saved parameters - - ## Times - ## -- within opt horizon - n_Tau = round(simpars.last/simpars.dt); - dtau = simpars.dt; - Tau = [0:n_Tau-1]'*dtau; - [n_tau,n_w] = size(w_s); - tau = Tau(n_Tau-n_tau+1:n_Tau); - w = w_s(n_tau,:); # Final value of setpoint - - - ## Main simulation loop - y = []; - x = []; - u = []; - t = []; - - - t_last = 0; - UU_l =[]; - UU_c =[]; - - t_ppp = []; - t_est = []; - its_ppp = []; - its_est = []; - t_open = []; - x_nexts = zeros(2*n_x,1); - - ## Initial U is zero - [n_U,junk] = size(A_u); - U = zeros(n_U,1); - - ## Initialise saved U - UU = []; - - ## Create input basis functions - u_star_tau = ppp_ustar(A_u,1,Tau',0,0,n_u-n_U); - - ## Reverse time to get "previous" U - U_old = U; - - if (extras.simulate==1) - ## Set up globals for simulation - system_name_sim = system_name; - i_ppp_sim = i_ppp; - x_0_sim = x_0; - y_sim = []; # Junk - u_sim = []; # Junk - A_u_sim = A_u; - simpar_sim = simpar; - T_total = simpar.last; - endif - - for i = 0:N_ol # Main loop - printf("%i",i); - UU = [UU; U']; # Save control U - - if n_par>0 - par_est = pars(i_par(:,1)); - p = [p; par_est']; # Save up the estimated parameters - endif - - - if (extras.simulate==1) - [y_ol,u_ol] = ppp_RT_sim(U); # Simulate - else - [y_ol,u_ol] = ppp_RT(U); # Real thing - endif - - t_start = time; # Initialise time - - if (i==0) # Data is rubbish at i=0 - ignore - usleep(T_ol_0*1e6); # Hang about - else - ## Set up time information for the gathered data - n_ol = length(y_ol); # How many data points? - t_ol = [0:n_ol-1]'*dt; - T_ol = n_ol*dt; # Length of ol interval - t_open = [t_open;T_ol]; - - ## Generate input to actual system - u_star_t = ppp_ustar(A_u,1,t_ol',0,0,n_u-n_U); - - ## Tune parameters/states - if (estimating_parameters==1) - - ## Set up according to interval length - if (T_ol>T_ol_0) ## Truncate data - simpar_est.last = T_ol_0; - y_est = y_ol(1:n_t+1,:); - else - simpar_est.last = T_ol; - y_est = y_ol; - endif - - simpar_pred.last = T_ol_0; # Predicted length of next interval - pars(i_ppp(:,1)) = U_old; # Update the simulation ppp weights - - ## Optimise - tick = time; - [pars,Par,Error,Y,its] = \ - ppp_optimise(s_system_name,x_0_models,pars,simpar_est,u_star_t,y_est,i_par,Q,extras); - - if extras.visual - figure(11); - title("Parameter optimisation"); - II = [1:length(y_est)]; plot(II,y_est,"*", II,Y); - endif - - est_time = time-tick; - t_est = [t_est;est_time]; - its_est = [its_est; its-1]; - endif - - ## Update internal model - par(i_ppp(:,3)) = U_old; # Update the internal model ppp weights - - if (estimating_parameters==1) - par(i_par(:,3)) = pars(i_par(:,1)); # Update the internal model params - endif - - simpar_model.last = T_ol; - [y_model,x_model] = eval(sprintf("%s_sim(x_0_model, par, simpar_model, \ - u_star_t);",system_name)); - - x_0 = x_model(n_ol+1,:)'; # Initial state of next interval -## x_0 = x_model(n_ol-1,:)'; # Initial state of next interval - x_0_model = x_0; - x_0_models(1:2:(2*n_x)-1) = x_0_model; - - ## Compute U by optimisation - tick = time; - - ## Predict state at start of next interval - par(i_ppp(:,3)) = U; - [y_next,x_next] = eval(sprintf("%s_sim(x_0, par, simpar, \ - u_star_t);",system_name)); - x_next = x_next(n_t+1,:)'; # Initial state for next time - x_nexts(1:2:(2*n_x)-1) = x_next; # And for internal sensitivity model - - ## Optimize for next interval - U_old = U; # Save previous value - U = expm(A_u*T_ol)*U; # Initialise from continuation trajectory - pars(i_ppp(:,1)) = U; # Put initial value of U into the parameter vector - [U, U_all, Error, Y, its] = ppp_nlin(system_name,x_nexts,pars,simpars,u_star_tau,w_s,i_ppp,Q,extras); - if extras.visual - figure(12); - title("PPP optimisation"); - II = [1:length(w_s)]; plot(II,w_s,"*", II,Y); - figure(1); - endif - - ppp_time = time-tick; - t_ppp = [t_ppp;ppp_time]; - its_ppp = [its_ppp; its-1]; - - ## Total execution time - T_total = time - t_start; - if (extras.simulate==1)&&(extras.emulate_timing!=1) - printf("."); - T_diff = 0; # Always correct interval - else - T_diff = T_total - T_ol_0; # Compute difference - if T_diff<0 - printf("-"); - usleep(-T_diff*1e6); - T_total = time - t_start; - else - printf("+"); - endif - printf("%2.2f",T_total); - endif - T_total = simpar.dt*round(T_total/simpar.dt); # Whole no. of intervals - - pars(i_ppp(:,1)) = U; # Put final value of U into the parameter vector - - ## Save up data - y_ol = y_ol(1:n_ol,:); - y = [y; y_ol]; - u = [u; u_ol]; - t = [t; t_ol+t_last*ones(n_ol,1) ]; - t_last = t_last + T_ol; - - endif - - - if (extras.simulate==1) # Do the actual simulation - if (extras.emulate_timing==1) # Emulate timing - simpar_sim.last = T_total; # simulate for actual execution time - endif - ppp_RT_sim_compute (U_old); - endif - - endfor - printf("\n"); -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_nlin_sim.m Index: mttroot/mtt/lib/control/PPP/ppp_nlin_sim.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_nlin_sim.m +++ mttroot/mtt/lib/control/PPP/ppp_nlin_sim.m @@ -1,198 +0,0 @@ -function [y,x,u,t,p,UU,UU_c,UU_l,t_ppp,t_est] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N_ol,extras) - - ## usage: [y,x,u,t,p,UU,UU_c,UU_l,t_ppp,t_est] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N_ol,extras) - ## - ## - - ## Simulate nonlinear PPP - ## Copyright (C) 2000 by Peter J. Gawthrop - - ## Defaults - if nargin<7 - extras.U_initial = "zero"; - extras.U_next = "continuation"; - extras.criterion = 1e-5; - extras.max_iterations = 10; - extras.v = 0.1; - extras.verbose = 0; - extras.estimate = 1; - endif - - - - ## Names - s_system_name = sprintf("s%s", system_name); - - ## System details -- defines simulation within ol interval - par = eval(sprintf("%s_numpar;", system_name)); - simpar = eval(sprintf("%s_simpar;", system_name)); - x_0 = eval(sprintf("%s_state(par);", system_name)); - [n_x,n_y,n_u] = eval(sprintf("%s_def;", system_name)); - - ## Sensitivity system details -- defines moving horizon simulation - simpars = eval(sprintf("%s_simpar;", s_system_name)); - pars = eval(sprintf("%s_numpar;", s_system_name)); - - ## Times - ## -- within opt horizon - n_Tau = round(simpars.last/simpars.dt); - dtau = simpars.dt; - Tau = [0:n_Tau-1]'*dtau; - [n_tau,n_w] = size(w_s); - tau = Tau(n_Tau-n_tau+1:n_Tau); - w = w_s(length(w_s)); # Final value of setpoint - - ## -- within ol interval - n_t = round(simpar.last/simpar.dt); - dt = simpar.dt; - t_ol = [0:n_t-1]'*dt; - T_ol = n_t*dt; - - ## Create input basis functions - [n_U,junk] = size(A_u); - - ## For moving horizon - eA = expm(A_u*dtau); - u_star_i = ones(n_U,1); - u_star_tau = []; - for i = 1:n_Tau - u_star_tau = [u_star_tau; u_star_i']; - u_star_i = eA*u_star_i; - endfor - - ## and for actual implementation - eA = expm(A_u*dt); - u_star_i = ones(n_U,1); - u_star_t = []; - for i = 1:n_t - u_star_t = [u_star_t; u_star_i']; - u_star_i = eA*u_star_i; - endfor - - if extras.verbose - title("U*(tau)") - xlabel("tau"); - plot(Tau,u_star_tau) - title("U*(t)") - xlabel("t_ol"); - plot(t_ol,u_star_t) - endif - - - ## Check number of inputs adjust if necessary - if n_u>n_U - disp(sprintf("Augmenting inputs with %i zeros", n_u-n_U)); - u_star_tau = [u_star_tau; zeros(n_u-n_U, n_Tau)]; - u_star_t = [u_star_t; zeros(n_u-n_U, n_t)]; - endif - - if n_u0 - [U, U_all, Error, Y] = ppp_nlin(system_name,x_0s,pars,simpars,u_star_tau,w_s,i_ppp,extras); - pars(i_ppp(:,1)) = U; # Put final value of U into the parameter vector - else - Error = []; - endif - ppp_time = time-tick; - t_ppp = [t_ppp;ppp_time]; - - ## Generate control - u_ol = u_star_t*U; # Not used - just for show - - ## Simulate system over one ol interval - par(i_ppp(:,3)) = pars(i_ppp(:,1)); # Update the simulation ppp weights - [y_ol,x_ol] = eval(sprintf("%s_sim(x_0, par, simpar, u_star_t);", system_name)); - - - ## Tune parameters/states - if (extras.estimate==1) - tick = time; - par_est = pars(i_par(:,1)); - p = [p; par_est']; - pars = ppp_optimise(s_system_name,x_0s,pars,simpar,u_star_t,y_ol,i_par,extras); - est_time = time-tick; - t_est = [t_est;est_time]; - endif - - x_0 = x_ol(n_t+1,:)'; # Extract state for next time - y_ol = y_ol(1:n_t,:); # Avoid extra points due to rounding error - x_ol = x_ol(1:n_t,:); # Avoid extra points due to rounding error - - - y = [y; y_ol]; - x = [x; x_ol]; - u = [u; u_ol]; - - UU = [UU; U']; - UU_l = [UU_l; U_l']; - UU_c = [UU_c; U_c']; - - t = [t; t_ol+t_last*ones(n_t,1) ]; - t_last = t_last + T_ol; - - - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_open2closed.m Index: mttroot/mtt/lib/control/PPP/ppp_open2closed.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_open2closed.m +++ mttroot/mtt/lib/control/PPP/ppp_open2closed.m @@ -1,86 +0,0 @@ -function [K_x T] = ppp_open2closed (A_u,A_c,k_x,x_0,Us0); - - ## usage: [K_x T] = ppp_open2closed (A_u,A_c,k_x,x_0[,Us0]); - ## K_x is the open-loop matrix as in U = K_w W - K_x x - ## Note that K_x is a column vector of matrices - one matrix per input. - ## T is the transformation matrix: x = T*Ustar; A_c = T*A_u*T^-1; U = (k_x*T)' - ## A_u: The control basis-function matrix - ## Us0: The initial value of Ustar - ## A_c: closed-loop system matrix - ## k_x: closed-loop feedback gain - ## x_0: initial state - ## Us0: initial basis fun state - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - - ## Check sizes - n_o = is_square(A_u); - n_c = is_square(A_c); - - if (n_o==0)||(n_c==0)||(n_o!=n_c) - error("A_u and A_c must be square and of the same dimension"); - endif - - [n_u,n_x] = size(k_x); - - ## Defaults - if nargin<4 - x_0 = zeros(n_c,1); - endif - - if nargin<5 #Create U*(0) - ##Us0 = ppp_ustar(A_u,n_u); - Us0 = ones(1,n_o); - endif - - - ## Decompose A_u and Us0 into two bits: - if n_o==n_c - A_w = []; - u_0 = Us0(1:n_c)'; # Assume same Us0 on each input - else - A_w = A_u(n_c+1:n_o, n_c+1:n_o) - A_u = A_u(1:n_c, 1:n_c) - U_w = Us0(1,n_c+1:n_o)' - u_0 = Us0(1:n_c)' - endif - - if !is_controllable(A_u,u_0) - error("The pair [A_u, u_0] must be controllable"); - endif - - ## Controllability matrices - C_o = u_0; - C_c = x_0; - for i=1:n_c-1 - C_o = [C_o A_u^i*u_0]; - C_c = [C_c A_c^i*x_0]; - endfor - - ## Transformation matrix: x = T*Ustar; A_c = T*A_u*T^-1; U = (k_x*T)' - iC_o = C_o^-1; - T = C_c*iC_o; - - K_x = []; - for j = 1:n_u - ## K_j matrix - K_j = []; - for i=1:n_c; - ## Create T_i = dT/dx_i - T_i = zeros(n_c,1); - T_i(i) = 1; - for k=1:n_c-1; - A_k = A_c^k; - T_i = [T_i A_k(:,i)]; - endfor - T_i = T_i*iC_o; - kj = k_x(j,:); # jth row of k_x - K_ji = kj*T_i; # ith row of K_j - K_j = [K_j; K_ji]; - endfor - K_x = [K_x; K_j']; - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_optimise.m Index: mttroot/mtt/lib/control/PPP/ppp_optimise.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_optimise.m +++ mttroot/mtt/lib/control/PPP/ppp_optimise.m @@ -1,223 +0,0 @@ -function [par,Par,Error,Y,iterations,x] = \ - ppp_optimise(system_name,x_0,par_0,simpar,u,y_0,free,Q,extras); - ## Levenberg-Marquardt optimisation for PPP/MTT - ## Usage: [par,Par,Error,Y,iterations,x] = ppp_optimise(system_name,x_0,par_0,simpar,u,y_0,free[,Q,extras]); - ## system_name String containing system name - ## x_0 Initial state - ## par_0 Initial parameter vector estimate - ## simpar Simulation parameters: - ## .first first time - ## .dt time increment - ## .stepfactor Euler integration step factor - ## u System input (column vector, each row is u') - ## y_0 Desired model output - ## free one row for each adjustable parameter - ## first column parameter indices - ## second column corresponding sensitivity indices - ## Q vector of positive output weights. - ## extras (opt) optimisation parameters - ## .criterion convergence criterion - ## .max_iterations limit to number of iterations - ## .v Initial Levenberg-Marquardt parameter - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.14 2002/08/20 16:14:35 gawthrop - ## Include Q in documentation - ## - ## Revision 1.13 2002/08/20 15:43:45 gawthrop - ## Works with ident DIY rep - ## - ## Revision 1.12 2002/06/11 11:25:25 gawthrop - ## No longer delay the simulated data. - ## - ## Revision 1.11 2002/05/20 13:32:36 gawthrop - ## Sanity check on y_0 - ## - ## Revision 1.10 2002/05/13 16:01:09 gawthrop - ## Addes Q weighting matrix - ## - ## Revision 1.9 2002/05/08 10:14:21 gawthrop - ## Idetification now OK (Moved data range in ppp_optimise by one sample interval) - ## - ## Revision 1.8 2002/04/23 17:50:39 gawthrop - ## error --> err to avoid name clash with built in function - ## - ## Revision 1.7 2001/08/10 16:19:06 gawthrop - ## Tidied up the optimisation stuff - ## - ## Revision 1.6 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ## Revision 1.5 2001/06/06 07:54:38 gawthrop - ## Further fixes to make nonlinear PPP work ... - ## - ## Revision 1.4 2001/05/26 15:46:38 gawthrop - ## Updated to account for new nonlinear ppp - ## - ## Revision 1.3 2001/04/05 11:50:12 gawthrop - ## Tidied up documentation + verbose mode - ## - ## Revision 1.2 2001/04/04 08:36:25 gawthrop - ## Restuctured to be more logical. - ## Data is now in columns to be compatible with MTT. - ## - ## Revision 1.1 2000/12/28 11:58:07 peterg - ## Put under CVS - ## - ############################################################### - - - ## Copyright (C) 1999,2000,2001,2002 by Peter J. Gawthrop - - ## Simulation command - sim_command = sprintf("%s_ssim(x_0,par,simpar,u,i_s);", system_name); - - ## Extract indices - i_t = free(:,1); # Parameters - i_s = free(:,2)'; # Sensitivities - - if nargin<9 - extras.criterion = 1e-5; - extras.max_iterations = 10; - extras.v = 1e-5; - extras.verbose = 0; - endif - - - [n_data,n_y] = size(y_0); - if n_dataextras.criterion)&&\ - (abs(err)>extras.criterion)&&\ - (iterations1 # Adjust the Levenberg-Marquardt parameter - reduction = err_old-err; - predicted_reduction = 2*J'*step + step'*JJ*step; - r = predicted_reduction/reduction; - if (r<0.25)||(reduction<0) - v = 4*v; - elseif r>0.75 - v = v/2; - endif - - if reduction<0 # Its getting worse - par(i_t) = par(i_t) + step; # rewind parameter - err = err_old; # rewind error - err_old = err_old_old; # rewind old error - if extras.verbose - printf(" Rewinding ....\n"); - endif - endif - endif - - ## Compute step using pseudo inverse - JJL = JJ + v*eye(n_th); # Levenberg-Marquardt term - step = pinv(JJL)*J; # Step size - par(i_t) = par(i_t) - step; # Increment parameters - err_old_old = err_old; # Save old error - err_old = err; # Save error - - ##Some diagnostics - Error = [Error err]; # Save error - Par = [Par par]; # Save parameters - Y = [Y y]; # Save output - - if extras.verbose # Diagnostics - printf("Iteration: %i\n", iterations); - printf(" error: %g\n", err); - printf(" reduction: %g\n", reduction); - printf(" prediction: %g\n", predicted_reduction); - printf(" ratio: %g\n", r); - printf(" L-M param: %g\n", v); - printf(" parameters: "); - for i_th=1:n_th - printf("%g ", par(i_t(i_th))); - endfor - printf("\n"); - endif - - - endwhile - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_output_constraint.m Index: mttroot/mtt/lib/control/PPP/ppp_output_constraint.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_output_constraint.m +++ mttroot/mtt/lib/control/PPP/ppp_output_constraint.m @@ -1,80 +0,0 @@ -function [Gamma,gamma] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau,Min,Max,Order,i_y) - - ## usage: [Gamma,gamma] = ppp_output_constraint (A,B,C,D,x_0,A_u,Tau,Min,Max,Order) - ## - ## Derives the output constraint matrices Gamma and gamma - ## For Constraints Min and Max at times Tau - ## Initial state x_0 - ## Order=0 - output constraints - ## Order=1 - output derivative constraints - ## etc - ## NOTE You can stack up Gamma and gamma matrices for create multi-output constraints. - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - ## Sizes - [n_x,n_u,n_y] = abcddim(A,B,C,D); # System dimensions - [n_U,m_U] = size(A_u); # Number of basis functions - [n,n_tau] = size(Tau); # Number of constraint times - - if n_tau==0 # Nothing to be done - Gamma = []; - gamma = []; - return - endif - - ## Defaults - if nargin<10 - Order = zeros(1,n_tau); - endif - - if nargin<11 - i_y = 1; # First output - endif - - if n != 1 - error("Tau must be a row vector"); - endif - - n = length(Min); - m = length(Max); - o = length(Order); - - if (n != n_tau)||(m != n_tau)||(o != n_tau) - error("Tau, Min, Max and Order must be the same length"); - endif - - - ## Compute Gamma - Gamma = []; - zero_x = zeros(size(x_0)); - for i=1:n_U - U = zeros(n_U,1); U(i,1) = 1; # Set up U_i - y_i = ppp_ystar (A,B,C,D,zero_x,A_u,U,Tau); # Compute y* for ith input for each tau - y_i = y_i(i_y,:); # Pluck out output i_y - ## Gamma = [Gamma [-y_i';y_i']]; # Put in parts for Min and max - Gamma_i = []; - if (Min>-inf) - Gamma_i = [Gamma_i; -y_i']; # Min part of column - endif - if (Max-inf) - gamma = [gamma; -(Min-y_x)']; - endif - if (Max1) - error("Tau must be a row vector"); - endif - - ##Defaults - if nargin<10 - Order=zeros(n_y,n_tau); - endif - - ## Stack up constraints for each output - Gamma=[]; - gamma=[]; - for i_y=1:n_y - [Gamma_i,gamma_i] = \ - ppp_output_constraint (A,B,C,D,x_0,A_u,Tau,\ - Min(i_y,:),Max(i_y,:),Order(i_y,:),i_y); - Gamma = [Gamma; Gamma_i]; - gamma = [gamma; gamma_i]; - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_pred.m Index: mttroot/mtt/lib/control/PPP/ppp_pred.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_pred.m +++ mttroot/mtt/lib/control/PPP/ppp_pred.m @@ -1,31 +0,0 @@ -function [A_p,B_p] = ppp_pred (A,B,C,D,A_u,Ust0,T) - - ## usage: [A_p,B_p] = ppp_pred (A,B,C,D,A_u,Ust0,T) - ## - ## PPP prediction matrices: x_pred = A_p*x + B_p*U - - ## Sanity - [n_x,n_u,n_y] = abcddim(A,B,C,D); # System dimensions - if (n_x==-1) - error("A B C D not compatible"); - endif - - n_U = issquare(A_u); - if (n_U!=n_x) - error(sprintf("A_u must be %ix%i",n_x,n_x)); - endif - - [nn,mm] = size(Ust0); - if (nn!=1)||(mm!=n_x) - error(sprintf("Ust0 must be 1x%i",n_x)); - endif - - Z = zeros(n_x,n_x); - AA = [A B*Ust0 - Z A_u']; - - eAA = expm(AA*T); - A_p = eAA(1:n_x,1:n_x); - B_p = eAA(1:n_x,n_x+1:2*n_x); - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_qp.m Index: mttroot/mtt/lib/control/PPP/ppp_qp.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_qp.m +++ mttroot/mtt/lib/control/PPP/ppp_qp.m @@ -1,66 +0,0 @@ -function [u,U,n_active] = ppp_qp (x,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma,mu,test) - - ## usage: [u,U] = ppp_qp (x,W,J_uu,J_ux,J_uw,Gamma,gamma) - ## INPUTS: - ## x: system state - ## W: Setpoint vector - ## J_uu,J_ux,J_uw: Cost derivatives (see ppp_lin) - ## Us0: value of U* at tau=0 (see ppp_lin) - ## Gamma, gamma: U constrained by Gamma*U <= gamma - ## mu Parameter of qp_mu - ## Outputs: - ## u: control signal - ## U: control weight vector - ## - ## Predictive pole-placement of linear systems using quadratic programming - ## Use ppp_input_constraint and ppp_output_constraint to generate Gamma and gamma - ## Use ppp_lin to generate J_uu,J_ux,J_uw - ## Use ppp_cost to evaluate resultant cost function - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - if nargin<9 - mu = 0 - endif - - if nargin<10 - test=0; - endif - - - ## Check the sizes - n_x = length(x); - - [n_U,m_U] = size(J_uu); - if n_U != m_U - error("J_uu must be square"); - endif - - [n,m] = size(J_ux); - if (n != n_U)||(m != n_x) - error("J_ux should be %ix%i not %ix%i",n_U,n_x,n,m); - endif - - - if length(gamma)>0 # Constraints exist: do the QP algorithm - ## QP solution for weights U -## [U,iterations] = qp_mu(J_uu,(J_ux*x-J_uw*W),Gamma,gamma,mu,[],[],0,test); - [U,n_active] = qp_hild(J_uu,(J_ux*x - J_uw*W),Gamma,gamma); # -## iterations = 0; - - ##U = qp(J_uu,(J_ux*x - J_uw*W),Gamma,gamma); # QP solution for weights U - ##U = pd_lcp04(J_uu,(J_ux*x - J_uw*W),Gamma,gamma); # QP solution for weights U - u = Us0*U; # Control signal - else # Do the unconstrained solution - ## Compute the open-loop gains - n_active = 0; - K_w = J_uu\J_uw; - K_x = J_uu\J_ux; - - ## Closed-loop control - U = K_w*W - K_x*x; # Basis functions weights - U(t) - u = Us0*U; # Control u(t) - endif - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_qp_sim.m Index: mttroot/mtt/lib/control/PPP/ppp_qp_sim.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_qp_sim.m +++ mttroot/mtt/lib/control/PPP/ppp_qp_sim.m @@ -1,153 +0,0 @@ -function [T,y,u,X,Iterations] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q,R,P,\ - Tau_u,Min_u,Max_u,Order_u, \ - Tau_y,Min_y,Max_y,Order_y, \ - W,x_0,Delta_ol,mu,test,movie) - - ## usage: [T,y,u,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, Tau_u,Min_u,Max_u,Order_u, Tau_y,Min_y,Max_y,Order_y, W,x_0,movie) - ## Needs documentation - see ppp_ex11 for example of use. - ## OUTPUTS - ## T: Time vector - ## y,u,J output, input and cost - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - if nargin<21 # No intermittent control - Delta_ol = 0; - endif - - if nargin<22 # Mu - mu = 0; - endif - - if nargin<23 - test=0 - endif - - if nargin<24 # No movie - movie = 0; - endif - -test = test - ## Check some sizes - [n_x,n_u,n_y] = abcddim(A,B,C,D); - - [n_x0,m_x0] = size(x_0); - if (n_x0 != n_x)||(m_x0 != 1) - error(sprintf("Initial state x_0 must be %ix1 not %ix%i",n_x,n_x0,m_x0)); - endif - - ## Input constraints - [Gamma_u, gamma_u] = ppp_input_constraints(A_u,Tau_u,Min_u,Max_u); - - ## Output constraints - [Gamma_y,gamma_y] = ppp_output_constraints(A,B,C,D,x_0,A_u,Tau_y,Min_y,Max_y,Order_y); - - ## Composite constraints - t=0 - Gamma = [Gamma_u; Gamma_y]; - gamma = [gamma_u; gamma_y]; - - ## Design the controller - ## disp("Designing controller"); - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww] = ppp_lin (A,B,C,D,A_u,A_w,t,Q,R,P); - - ## Set up various time vectors - dt = t(2)-t(1); # Time increment - - ## Make sure Delta_ol is multiple of dt - Delta_ol = floor(Delta_ol/dt)*dt; - - if Delta_ol>0 # Intermittent control - T_ol = 0:dt:Delta_ol; # Create the open-loop time vector - else - T_ol = [0,dt]; - Delta_ol = dt; - endif - t_last = t(length(t)); - T_cl = 0:Delta_ol:2*t_last-Delta_ol; # Closed-loop time vector - T = 0:dt:2*t_last; # Overall time vector - - ## Lengths thereof - n_Tcl = length(T_cl); - n_ol = length(T_ol); - n_T = length(T); - - ## Expand W with constant last value or truncate - [n_W,m_W] = size(W); - - if m_W>n_T - W = W(:,1:n_T); - else - W = [W W(:,m_W)*ones(1,n_T-m_W+1)]; - endif - - ## Compute U* - Ustar_ol = ppp_ustar(A_u,n_u,T_ol); # U* in the open-loop interval - - [n,m] = size(Ustar_ol); - n_U = m/length(T_ol); # Determine size of each Ustar - -# ## Discrete-time system -# csys = ss2sys(A,B,C,D); -# dsys = c2d(csys,dt); -# [Ad, Bd] = sys2ss(dsys) - - x = x_0; # Initialise state - - ## Initialise the saved variable arrays - X = []; - u = []; - Iterations = []; - du = []; - J = []; - tick= time; - - ## disp("Simulating ..."); - for t=T_cl # Outer loop at Delta_ol - printf("%g\r",t); - ##disp(sprintf("Time %g", t)); - ## Output constraints - [Gamma_y,gamma_y] = ppp_output_constraints (A,B,C,D,x,A_u,Tau_y,Min_y,Max_y,Order_y); - - ## Composite constraints - Gamma = [Gamma_u; Gamma_y]; - gamma = [gamma_u; gamma_y]; - - ## Current Setpoint value - w = W(:,floor(t/dt)+1); - - ## Compute U(t) via QP optimisation - [uu, U, iterations] = ppp_qp (x,w,J_uu,J_ux,J_uw,Us0,Gamma,gamma,mu,test); # Compute U - - ## Compute the cost (not necessary but maybe interesting) -# [J_t] = ppp_cost (U,x,W,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww); # cost -# J = [J J_t]; - - ## OL Simulation (exact) - [ys,us,xs] = ppp_ystar (A,B,C,D,x,A_u,U,T_ol); - - ## Save values (discarding final ones) - X = [X xs(:,1:n_ol-1)]; # save state - u = [u us(:,1:n_ol-1)]; # save input - Iterations = [Iterations iterations*ones(1,n_ol-1)]; - - ## Final values - x = xs(:,n_ol); # Final state - ut = us(:,n_ol); # Final control - - endfor - - ## Save the last values - X = [X x]; # Save state - u = [u ut]; # Save input - Iterations = [Iterations iterations]; # Save iteration count - - tock = time; - Elapsed_Time = tock-tick; - y = C*X + D*u; # System output - - -endfunction - - - DELETED mttroot/mtt/lib/control/PPP/ppp_sim.m Index: mttroot/mtt/lib/control/PPP/ppp_sim.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_sim.m +++ mttroot/mtt/lib/control/PPP/ppp_sim.m @@ -1,54 +0,0 @@ -function [y,y_s] = ppp_sim (system_name,x_0,u,t,par,i_s,external) - - ## mtt_sim: Simulates system sensitivity functions. - ## usage: [y,y_s] = ppp_sim (system_name,x_0,u,t,par,i_s) - ## system_name string containing name of the sensitivity system - ## x_0 initial state - ## u system input (one input per row) - ## t row vector of time - ## par system parameter vector - ## i_s indices of sensitivity parameters - - - if nargin<7 - external = 0; - endif - - ## Some sizes - n_s = length(i_s); - n_t = length(t); - - - for i = 1:n_s - - ## Set sensitivity parameters - par(i_s(i)) = 1.0; - par(complement(i_s(i),i_s)) = 0; - - if external - par_string = ""; - for i_string=1:length(par) - par_string = sprintf("%s %s", par_string, num2str(par(i_string))); - endfor - data_string = system(sprintf("./%s_ode2odes.out %s | cut -f 2-%i", \ - system_name, par_string, 1+n_s)); - Y = str2num(data_string)'; - else - Y = eval(sprintf("%s_sim(x_0,u,t,par);", system_name)); - endif - - [n_Y,m_Y] = size(Y); - n_y = n_Y/2; - if i==1 - y = Y(1:2:n_Y,:); # Save up the output - y_s = zeros(n_s*n_y, n_t); # Initialise for speed - endif - - y_s((i-1)*n_y+1:i*n_y,:) = Y(2:2:n_Y,:); # Other sensitivities - - endfor - -title(""); -plot(t,y); - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_sm2sr.m Index: mttroot/mtt/lib/control/PPP/ppp_sm2sr.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_sm2sr.m +++ mttroot/mtt/lib/control/PPP/ppp_sm2sr.m @@ -1,69 +0,0 @@ -function [Y,X] = ppp_sm2sr(A,B,C,D,T,u0,x0); - ## Usage [Y,X] = ppp_sm2sr(A,B,C,D,T,u0,x0); - ## Computes a step response - ## A,B,C,D- state matrices - ## T vector of time points - ## u0 input gain vector: u = u0*unit step. - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - [Ny,Nu] = size(D); - [Ny,Nx] = size(C); - - if nargin<6 - u0 = zeros(Nu,1); - u0(1) = 1; - end; - - if nargin<7 - x0 = zeros(Nx,1); - end; - - [N,M] = size(T); - if M>N - T = T'; - N = M; - end; - - - - one = eye(Nx); - - Y = zeros(Ny,N); - X = zeros(Nx,N); - - dt = T(2)-T(1); # Assumes fixed interval - expAdt = expm(A*dt); # Compute matrix exponential - i = 0; - expAt = one; - - DoingStep = max(abs(u0))>0; # Is there a step component? - DoingInitial = max(abs(x0))>0; # Is there an initial component? - for t = T' - i=i+1; - if Nx>0 - x = zeros(Nx,1); - if DoingStep - x = x + ( A\(expAt-one) )*B*u0; - endif - if DoingInitial - x = x + expAt*x0; - endif - - expAt = expAt*expAdt; - - X(:,i) = x; - if Ny>0 - y = C*x + D*u0; - Y(:,i) = y; - endif - elseif Ny>0 - y = D*u0; - Y(:,i) = y; - endif - endfor - - -endfunction - DELETED mttroot/mtt/lib/control/PPP/ppp_ustar.m Index: mttroot/mtt/lib/control/PPP/ppp_ustar.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ustar.m +++ mttroot/mtt/lib/control/PPP/ppp_ustar.m @@ -1,74 +0,0 @@ -function Ustar = ppp_ustar (A_u,n_u,tau,order,packed,n_zero) - - ## usage: Us = ppp_ustar(A_u,n_u,tau,order,packed) - ## - ## Computes the U* matrix at time tau in terms of A_u - ## n_u : Number of system inputs - ## If tau is a vector, computes U* at each tau and puts into a row vector: - ## If packed==1 - ## Ustar = [Ustar(tau_1) Ustar(tau_2) ...] - ## else Ustar = [Ustar(tau_1); Ustar(tau_2) ...] - ## n_zero extra zero columns appended - - ## Copyright (C) 1999 by Peter J. Gawthrop - ## $Id$ - - if nargin<2 - n_u = 1; - endif - - if nargin<3 - tau = 0; - endif - - if nargin<4 - order = 0; - endif - - if nargin<5 - packed=1; - endif - - if nargin<6 - n_zero=0; - endif - - - [n,m] = size(A_u); # Size of composite A_u matrix - N = m; # Number of U* functions per input - nm = n/m; - - if (nm != n_u)&&(n!=m) # Check consistency - error("A_u must be square or be a column of square matrices"); - endif - - u_0 = ones(N,1); - - Ustar = []; - for t = tau; - ustar = []; - for i = 1:n_u - A_i = ppp_extract(A_u,i); - Ak = A_i^order; - eA = expm(A_i*t); - if (packed==1) - ustar = [ustar; zeros(1,(i-1)*N), (Ak*eA*u_0)', \ - zeros(1,(n_u-i)*N)]; - else - ustar = [ustar, (Ak*eA*u_0)']; - endif - endfor - - if (packed==1) - Ustar = [Ustar ustar]; - else - Ustar = [Ustar; ustar]; - endif - endfor - - if (n_zero>0) - [N,M] = size(Ustar); - Ustar = [Ustar zeros(N, n_zero)]; - endif - -endfunction DELETED mttroot/mtt/lib/control/PPP/ppp_ustar2h.m Index: mttroot/mtt/lib/control/PPP/ppp_ustar2h.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ustar2h.m +++ mttroot/mtt/lib/control/PPP/ppp_ustar2h.m @@ -1,61 +0,0 @@ -function ppp_ustar2h (Ustar,DT,name) - - ## usage: ppp_Ustar2h (Ustar[,name]) - ## - ## - - if nargin<2 - DT = 1; - endif - - if nargin<3 - name = "Ustar"; - endif - - [N,N_U] = size(Ustar); - - ## Open the file - filename = sprintf("%s.h", name); - fid = fopen(filename,"w"); - - ## Header - header = sprintf("/*\n File %s generated by ppp_ustar2h on %s */\n", \ - filename, ctime(time)); - - def = sprintf("#define N_U %i\n#define N_T %i\n#define DT %g\n", \ - N_U, N, DT); - def = sprintf("%sdouble U[N_U]={",def); - for j=1:N_U - if j0) - [n_x,n_u,n_y] = abcddim(A,B,C,D); # System dimensions - else - n_x = 0; - n_y = 0; - n_u = 0; - endif - - no_system = n_x==0; - - [n,m] = size(A_u); # Size of composite A_u matrix - square = (n==m); # Is A_u square? - n_U = m; # functions per input - - [n,m] = size(U); - if (m != 1) - error("U must be a column vector"); - endif - - if n_u>0 - if n_u!=length(U)/n_U - error("U must be a column vector with n_u*n_U components"); - endif - else - n_u = length(U)/n_U; # Deduce n_u from U if no system - endif - - [n_x0,m_x0] = size(x_0); - if n_x0!=n_x - error(sprintf("x_0 must be a column with length %i", n_x)); - endif - - - [n,m]=size(tau); - if (n != 1 ) - error("tau must be a row vector of times"); - endif - - if nargin<9 - Us0 = ones(1,n_U); - endif - - [n_Us0,m_Us0] = size(Us0); - if (n_Us0>1)||(n_Us0>m_Us0) - error(sprintf("Us0 must be a row vector, not %ix%i ",n_Us0,m_Us0)); - endif - - - if square # Then same A_u for each input - ## Reorganise vector U into matrix Utilde - Utilde = []; - for i=1:n_u - j = (i-1)*n_U; - range = j+1:j+n_U; - Utilde = [Utilde; U(range,1)']; - endfor - - ## Composite A matrix - if no_system - AA = A_u; - else - Z = zeros(n_U,n_x); - AA = [A B*Utilde - Z A_u]; - endif - - xx_0 = [x_0;Us0']; # Composite initial condition - else # Different A_u on each input - ## Reorganise vector U into matrix Utilde - Utilde = []; - for i=1:n_u - j = (i-1)*n_U; - k = (n_u-i)*n_U; - range = j+1:j+n_U; - Utilde = [Utilde; zeros(1,j), U(range,1)', zeros(1,k)]; - endfor - - ## Create the full A_u matrix (AA_u) with the A_i s on the diagonal -# AA_u = []; -# for i = 1:n_u -# AA_u = ppp_aug(AA_u,ppp_extract(A_u,i)); -# endfor - AA_u = ppp_inflate(A_u); - - ## Composite A matrix - if no_system - AA = AA_u; - else - Z = zeros(n_U*n_u,n_x); - AA = [A B*Utilde - Z AA_u]; - endif - xx_0 = [x_0;ones(n_U*n_u,1)]; # Composite initial condition - endif - - - ## Initialise - xs = []; # x star - xu = []; # x star - ys = []; # y star - us = []; # u star - n_xx = length(xx_0); # Length of composite state - - ## Compute the star variables - for t=tau - xxt = expm(AA*t)*xx_0; # Composite state - xst = xxt(1:n_x); # x star - xut = xxt(n_x+1:n_xx); # x star - if length(C)>0 - yst = C*xst; # y star - else - yst = []; - endif - - ust = Utilde*xut; # u star - - xs = [xs xst]; # x star - xu = [xu xut]; # x star - ys = [ys yst]; # y star - us = [us ust]; # u star - endfor - -endfunction DELETED mttroot/mtt/lib/control/PPP/rpv.m Index: mttroot/mtt/lib/control/PPP/rpv.m ================================================================== --- mttroot/mtt/lib/control/PPP/rpv.m +++ mttroot/mtt/lib/control/PPP/rpv.m @@ -1,28 +0,0 @@ -function [A,B,C,D] = rpv -% System RPV -% This system is the remotely-piloted vehicle example from the book: -% J.M Maciejowski: Multivariable Feedback Design Addison-Wesley, 1989 -% It has 6 states, 2 inputs and 2 outputs. - -% P J Gawthrop Jan 1998 - -A = [-0.0257 -36.6170 -18.8970 -32.0900 3.2509 -0.7626 - 0.0001 -1.8997 0.9831 -0.0007 -0.1780 -0.0050 - 0.0123 11.7200 -2.6316 0.0009 -31.6040 22.3960 - 0 0 1.0000 0 0 0 - 0 0 0 0 -30.0000 0 - 0 0 0 0 0 -30.0000]; - -B = [0 0 - 0 0 - 0 0 - 0 0 - 30 0 - 0 30]; - -C = [0 1 0 0 0 0 - 0 0 0 1 0 0]; - -D = zeros(2,2); - - DELETED mttroot/mtt/lib/control/PPP/tgen.m Index: mttroot/mtt/lib/control/PPP/tgen.m ================================================================== --- mttroot/mtt/lib/control/PPP/tgen.m +++ mttroot/mtt/lib/control/PPP/tgen.m @@ -1,28 +0,0 @@ -function [A,B,C,D] = tgen -% System TGEN from -% This system is the turbogenerator example from the book: -% J.M Maciejowski: Multivariable Feedback Design Addison-Wesley, 1989 -% It has 6 states, 2 inputs and 2 outputs. - -% P J Gawthrop Jan 1998 - -A = [-18.4456 4.2263 -2.2830 0.2260 0.4220 -0.0951 - -4.0977 -6.0706 5.6825 -0.6966 -1.2246 0.2873 - 1.4449 1.4336 -2.6477 0.6092 0.8979 -0.2300 - -0.0093 0.2302 -0.5002 -0.1764 -6.3152 0.1350 - -0.0464 -0.3489 0.7238 6.3117 -0.6886 0.3645 - -0.0602 -0.2361 0.2300 0.0915 -0.3214 -0.2087]; - -B = [-0.2748 3.1463 - -0.0501 -9.3737 - -0.1550 7.4296 - 0.0716 -4.9176 - -0.0814 -10.2648 - 0.0244 13.7943]; - -C = [0.5971 -0.7697 4.8850 4.8608 -9.8177 -8.8610 - 3.1013 9.3422 -5.6000 -0.7490 2.9974 10.5719]; - -D = zeros(2,2); - - DELETED mttroot/mtt/lib/control/PPP/transient.m Index: mttroot/mtt/lib/control/PPP/transient.m ================================================================== --- mttroot/mtt/lib/control/PPP/transient.m +++ mttroot/mtt/lib/control/PPP/transient.m @@ -1,27 +0,0 @@ -function X = transient (t,A,x_0) - - ## usage: L = transient (t,p,order) - ## - ## Computes transient response for time t with initial condition x_0 - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.1 1999/04/27 04:46:05 peterg - ## Initial revision - ## - ## Revision 1.1 1999/04/25 23:19:40 peterg - ## Initial revision - ## - ############################################################### - - -X=[]; - for tt=t # Create the Transient up to highest order - x = expm(A*tt)*x_0; - X = [X x]; - endfor - -endfunction DELETED mttroot/mtt/lib/cr/hh/ISW.hh Index: mttroot/mtt/lib/cr/hh/ISW.hh ================================================================== --- mttroot/mtt/lib/cr/hh/ISW.hh +++ mttroot/mtt/lib/cr/hh/ISW.hh @@ -1,6 +0,0 @@ -#ifndef ISW_HH -#define ISW_HH - -// dummy file - -#endif // ISW_H DELETED mttroot/mtt/lib/cr/hh/SS.hh Index: mttroot/mtt/lib/cr/hh/SS.hh ================================================================== --- mttroot/mtt/lib/cr/hh/SS.hh +++ mttroot/mtt/lib/cr/hh/SS.hh @@ -1,6 +0,0 @@ -#ifndef SS_HH -#define SS_HH - -// dummy file - -#endif // SS_H DELETED mttroot/mtt/lib/cr/hh/causality.hh Index: mttroot/mtt/lib/cr/hh/causality.hh ================================================================== --- mttroot/mtt/lib/cr/hh/causality.hh +++ mttroot/mtt/lib/cr/hh/causality.hh @@ -1,8 +0,0 @@ -#ifndef CAUSALITY_HH -#define CAUSALITY_HH - -enum causality { effort, flow, state }; - -typedef enum causality causality_t; - -#endif DELETED mttroot/mtt/lib/cr/hh/components.hh Index: mttroot/mtt/lib/cr/hh/components.hh ================================================================== --- mttroot/mtt/lib/cr/hh/components.hh +++ mttroot/mtt/lib/cr/hh/components.hh @@ -1,14 +0,0 @@ -#ifndef COMPONENTS_HH -#define COMPONENTS_HH - -// $ cd $(echo $MTT_COMPONENTS/simple | sed 's/\.://') -// $ ls *_eqn.m | gawk -F_ '{printf ("%s, ", $1)}' -enum component { - AE, AF, C, EBTF, EMTF, ES, FMR, FP, GY, I, PS, RST, RS, R, SS, TF, - ae, af, c, ebtf, emtf, es, fmr, fp, gy, i, ps, rst, rs, r, ss, tf -}; - -typedef enum component component_t; - - -#endif DELETED mttroot/mtt/lib/cr/hh/constants.hh Index: mttroot/mtt/lib/cr/hh/constants.hh ================================================================== --- mttroot/mtt/lib/cr/hh/constants.hh +++ mttroot/mtt/lib/cr/hh/constants.hh @@ -1,12 +0,0 @@ -#ifndef CONSTANTS_HH -#define CONSTANTS_HH - -const double pi = 3.14159264; -const double pi2 = pi * pi; -const double pi4 = pi2 * pi2; - -// Reynolds number -const double ReL = 2300.0; // transition from laminar flow -const double ReT = 4000.0; // transition to turbulent flow - -#endif // CONSTANTS DELETED mttroot/mtt/lib/cr/hh/fade.hh Index: mttroot/mtt/lib/cr/hh/fade.hh ================================================================== --- mttroot/mtt/lib/cr/hh/fade.hh +++ mttroot/mtt/lib/cr/hh/fade.hh @@ -1,43 +0,0 @@ -#ifndef FADE_HH -#define FADE_HH - -#include // tanh - -#include "constants.hh" // pi - -inline double -fade(const double x, - const double x1, - const double x2, - const double y1, - const double y2) -{ - /* fades two functions together smoothly over the range x1 to x2 - * function does not check that x2 > x1 - */ - double theta; - theta = (x - x1) / (x2 - x1); // map (linear) {x1 , x2 } => {0 , +1 } - theta = (theta - 0.5) * 2.0 * pi; // map (linear) {0 , +1 } => {-Pi , +Pi} - theta = tanh(theta); // map (non-linear) {-Pi , +Pi} => {-1 , +1 } - theta = (theta + 1.0) / 2.0; // map (linear) {-1 , +1 } => {0 , +1 } - - return (theta * y1 + (1.0 - theta) * y2); -} - -inline double -chkfade(const double x, - const double x1, - const double x2, - const double y1, - const double y2) -{ - double X1 = x1, X2 = x2; - if (x1 > x2) { - std::cerr << "* Warning: chkfade; x2 > x1, swapping" << std::endl; - X1 = x2; - X2 = x1; - } - return ((x <= X1) ? y1 : (x > X2) ? y2 : fade(x, X1, X2, y1, y2)); -} - -#endif // FADE_HH DELETED mttroot/mtt/lib/cr/hh/frictionfactor.hh Index: mttroot/mtt/lib/cr/hh/frictionfactor.hh ================================================================== --- mttroot/mtt/lib/cr/hh/frictionfactor.hh +++ mttroot/mtt/lib/cr/hh/frictionfactor.hh @@ -1,33 +0,0 @@ -#ifndef FRICTIONFACTOR_HH -#define FRICTIONFACTOR_HH - -#include -#include - -#include "constants.hh" // ReL, ReT -#include "fade.hh" - -inline double -frictionfactor(const double Re, const double r) { - if (0.0 == Re) { - return 0.0; - } - else if (ReL >= Re) { // laminar flow - return 16.0 / Re; // using k = 4.f.(l/d) - } else if (ReT <= Re) { // turbulent flow - /* S.E.Haaland - * Simple and explicit formulas for the friction factor in turbulent pipe flow - * Journal of Fluids Engineering, 105 (1983) - */ - double A = 6.91 / Re; - double B = pow((r / 3.71), 1.11); - double f = pow(-3.6 * log10(A + B), -2); - return f; - } else { // transition region - double ffL = frictionfactor(ReL, r); - double ffT = frictionfactor(ReT, r); - return fade(Re, ReL, ReT, ffL, ffT); - } -} - -#endif // FRICTIONFACTOR_HH DELETED mttroot/mtt/lib/cr/hh/kinematicviscosity.hh Index: mttroot/mtt/lib/cr/hh/kinematicviscosity.hh ================================================================== --- mttroot/mtt/lib/cr/hh/kinematicviscosity.hh +++ mttroot/mtt/lib/cr/hh/kinematicviscosity.hh @@ -1,61 +0,0 @@ -#ifndef KINEMATICVISCOSITY_HH -#define KINEMATICVISCOSITY_HH - -#include // pow -#include - -inline double -kerosenekinematicviscosity(const double T) - /* - * B.S.Massey - * Mechanics of fluids - * ISBN: 0 412 34280 4 - * log-log plot of kinematic viscosity versus temperature is linear for kerosene - * L(n) = log10(n) - * - * T = 0 deg C : nu = 4.0 mm2/s - * T = 100 deg C : nu = 0.9 mm2/s - * - * deg C => K, mm2/s => m2/s - * - * T1 = 273.15 : nu1 = 4.0e-6 m2/s - * T2 = 373.15 : nu2 = 0.9e-6 m2/s - * - * L(nu) = m L(T) + c - * - * m = (L(nu2) - L(nu1)) / (L(T2) - L(T1)) - * = L(nu2/nu1) / L(T2/T1) - * = L(0.9/4.0) / L(373.15/273.15) - * = -4.781567507 - * - * c = L(nu1) - m * L(T1) - * = L(4.0e-6) - m * L(273.15) - * = 6.251876827 - * - * nu {m2/s} = 10^(m * L(T {Kelvin}) + c) - * - * = 10^(m * L(T) + c) - * = 10^c * (10^L(T))^m - * = 10^c * T^m - * - * 10^c = 1.78598097e6 - * - * nu = 1.78598097e6 * T^(-4.781567507) - */ -{ - return 1.79e6 * pow(T, -4.78); -} - -inline double -kinematicviscosity(const std::string fluid, - const double T) -{ - if ("kerosene" == fluid) { - return kerosenekinematicviscosity(T); - } else { - std::cerr << __FILE__ << ": fluid \"" << fluid << "\" unknown" << std::endl; - exit(-1); - } -} - -#endif // KINEMATICVISCOSITY_HH DELETED mttroot/mtt/lib/cr/hh/lin.hh Index: mttroot/mtt/lib/cr/hh/lin.hh ================================================================== --- mttroot/mtt/lib/cr/hh/lin.hh +++ mttroot/mtt/lib/cr/hh/lin.hh @@ -1,129 +0,0 @@ -#ifndef LIN_HH -#define LIN_HH - -#include - -#include "causality.hh" -#include "components.hh" -// translated from lin.cr - -// one 2-port, R/C/I; two 2-port, TF/GY -inline double -lin(const component_t type, - // parameters - const causality_t gain_causality, - const double gain, - // output - const causality_t out_causality, - const int out_port, - // input - const double input, - const causality_t in_causality, - const int in_port) -{ - if (out_port == in_port) { // R/C/I - if (gain_causality == in_causality) { - return input * gain; - } else { - return input / gain; - } - } else { // GY/TF - if (out_causality == in_causality) { // gyrator - if ((out_port == 1 && out_causality != gain_causality) - ||(out_port == 2 && out_causality == gain_causality)) { - return input * gain; - } else { - return input / gain; - } - } else { // transformer - if (out_causality == gain_causality) { - return input * gain; - } else { - return input / gain; - } - } - } -} - -// two 2-port, AE/AF -inline double -lin(const component_t type, - // parameters - const double gain, - // output - const causality_t out_causality, - const int out_port, - // input - const double input, - const causality_t in_causality, - const int in_port) -{ - return - (out_port == 1) ? input * gain : - input / gain; -} - - - - -// three 2-port, FMR -inline double -lin(const component_t type, - // parameters - const causality_t gain_causality, - const double gain, - // output - const causality_t out_causality, - const int out_port, - // input - const double input, - const causality_t in_causality, - const int in_port, - const double modulation, - const causality_t mod_causality, - const int mod_port) -{ - if (mod_causality == flow) { // uni-causal - if (out_port == 2) { - return 0; - } else { - double k = 1.0; - if (gain_causality == in_causality) { - k *= gain; - } else { - k /= gain; - } - if (in_causality == effort) { - k *= modulation; - } else { - k /= modulation; - } - return input * k; - } - } else { // bi-causal - if ((in_causality == effort) - &&(mod_causality == flow) - &&(gain_causality == effort) - &&(in_port == 1) - &&(mod_port == 1)) { - return (input / modulation) / gain; - } else { - - // three 2-port, EMTF - - if ((out_causality == gain_causality && out_port == 2) - ||(out_causality != gain_causality && out_port == 1)) { - return input * gain * modulation; - } else if((out_causality != gain_causality && out_port == 2) - ||(out_causality == gain_causality && out_port == 1)) { - return input / (gain * modulation); - } else { - std::cerr << "* Error: __FILE__ does not cover this case" << std::endl; - exit(-1); - } - } // EMTF - } // bi-causal -} - - -#endif // LIN_HH DELETED mttroot/mtt/lib/cr/hh/pressuredrop.hh Index: mttroot/mtt/lib/cr/hh/pressuredrop.hh ================================================================== --- mttroot/mtt/lib/cr/hh/pressuredrop.hh +++ mttroot/mtt/lib/cr/hh/pressuredrop.hh @@ -1,49 +0,0 @@ -#ifndef PRESSUREDROP_HH -#define PRESSUREDROP_HH - -#include // fabs, pow -#include - -#include "causality.hh" -#include "constants.hh" -#include "frictionfactor.hh" -#include "kinematicviscosity.hh" -#include "sign.hh" - -inline double -pressuredrop(const std::string fluid, - const double d, - const double l, - const double r, - const double rho, - const double T, - const double Q) -{ - double nu = kinematicviscosity(fluid, T); - double Re = 4.0 * fabs(Q) / (pi * d * nu); - double f = frictionfactor(Re, r); - double k = 4.0 * f * l / d; - double dP = k * 8.0 * rho * pow(Q, 2) / (pi2 * pow(d, 4)); - return (dP * sign(Q)); -} - -inline double -pressuredrop(const std::string fluid, - const double d, - const double l, - const double r, - const double rho, - const double T, - const causality_t effort_causality, const int port, - const double Q, const causality_t flow_causality, const int port_in) -{ - - /* assert(effort == causality); - * assert(flow == causality_in); - * assert(1 == port_in); - * assert(1 == port); - */ - return pressuredrop(fluid, d, l, r, rho, T, Q); -} - -#endif // PRESSUREDROP_HH DELETED mttroot/mtt/lib/cr/hh/sign.hh Index: mttroot/mtt/lib/cr/hh/sign.hh ================================================================== --- mttroot/mtt/lib/cr/hh/sign.hh +++ mttroot/mtt/lib/cr/hh/sign.hh @@ -1,13 +0,0 @@ -#ifndef SIGN_HH -#define SIGN_HH - -template -inline int -sign(T x) -{ - return ((x > 0) ? +1 : - (x < 0) ? -1 : - 0); -} - -#endif // SIGN_HH DELETED mttroot/mtt/lib/cr/hh/squarelaw.hh Index: mttroot/mtt/lib/cr/hh/squarelaw.hh ================================================================== --- mttroot/mtt/lib/cr/hh/squarelaw.hh +++ mttroot/mtt/lib/cr/hh/squarelaw.hh @@ -1,24 +0,0 @@ -#ifndef SQUARELAW_HH -#define SQUARELAW_HH - -#include // log, pow - -#include "causality.hh" -#include "constants.hh" - -inline double -staticpressure(const double beta, - const double C_d, - const double d, - const double P_ref, - const double rho, - const causality_t causality, const int port, - const double Q1, const causality_t causality1, const int port1, - const double Q2, const causality_t causality2, const int port2) -{ - static double P; - if (0.0 != Q1 && 0.0 != Q2) { - double num = pi2 * pow(d, 4) * log(Q1 / Q2); - double den = 8.0 * beta * rho * Q1 * (Q2 - Q1 + C_d * (Q1 + Q2) / 2.0); - P = P_ref + log(num / den)/beta; - } - return P; -} - -#endif // STATICPRESSUE_HH DELETED mttroot/mtt/lib/cr/perl/Density.pm Index: mttroot/mtt/lib/cr/perl/Density.pm ================================================================== --- mttroot/mtt/lib/cr/perl/Density.pm +++ mttroot/mtt/lib/cr/perl/Density.pm @@ -1,156 +0,0 @@ -#------------------------------------------------------------------------------- -# Model Transformation Tools -#------------------------------------------------------------------------------- - - -package mtt::Density; - -#------------------------------------------------------------------------------- -# linear constitutive relationship with cosine modulation -#------------------------------------------------------------------------------- - -use strict; -use warnings; - -#------------------------------------------------------------------------------- -# standard module header (see perlmod for explanation) -#------------------------------------------------------------------------------- -BEGIN { - use Exporter (); - our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - - $VERSION = 1.00; - - @ISA = qw(Exporter); - @EXPORT = qw(&Density); # CR name - %EXPORT_TAGS = ( ); -} - -#------------------------------------------------------------------------------- -# declaration of specific component implementations -#------------------------------------------------------------------------------- -sub Density_r(@); # R - -#------------------------------------------------------------------------------- -# main function: selects which subfunction to call -#------------------------------------------------------------------------------- -sub Density (@) { - - my $retval; - - $_ = $_[0]; - - s/\((.*)\)/$1/; # strip brackets - my @args = split (/,/); # split arguments - - $_ = $args[0]; # get component type - - # select rule to use - if (/^R|r$/) { $retval = Density_r (@args); } - - # if a substitution has been made ($retval) - if ($retval) - { - return $retval; # return substituted expression - } - else # return nothing - { - return; - } -} - -#------------------------------------------------------------------------------- -# R -#------------------------------------------------------------------------------- -sub Density_r (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 15-1) - { - if ($args[2] eq 'ideal_gas') - { - my ($component, - $required_output, - $law, - $R, - $out_causality, - $out_port, - $Pressure, - $P_causality, - $P_port, - $Temperature, - $T_causality, - $T_port, - $Nothing, - $N_causality, - $N_port) = @args; - - if (($P_causality eq 'effort') and - ($P_port == 1) and - ($T_causality eq 'effort') and - ($T_port == 2) and - ($N_causality eq 'flow') and - ($N_port == 3)) - { - if ($required_output eq 'density') - { - return "(($Pressure)/(($R)*($Temperature)))"; - } - elsif ($required_output eq 'specific_volume') - { - return "(($R)*($Temperature)/($Pressure))"; - } - } - } - elsif ($args[2] eq 'incompressible') - { - my ($component, - $required_output, - $law, - $rho, - $out_causality, - $out_port, - $Pressure, - $P_causality, - $P_port, - $Temperature, - $T_causality, - $T_port, - $Nothing, - $N_causality, - $N_port) = @args; - - if (($P_causality eq 'effort') and - ($P_port == 1) and - ($T_causality eq 'effort') and - ($T_port == 2) and - ($N_causality eq 'flow') and - ($N_port == 3)) - { - if ($required_output eq 'density') - { - return "($rho)"; - } - elsif ($required_output eq 'specific_volume') - { - return "(1/($rho))"; - } - } - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -1; # return true - DELETED mttroot/mtt/lib/cr/perl/Poly.pm Index: mttroot/mtt/lib/cr/perl/Poly.pm ================================================================== --- mttroot/mtt/lib/cr/perl/Poly.pm +++ mttroot/mtt/lib/cr/perl/Poly.pm @@ -1,122 +0,0 @@ -#------------------------------------------------------------------------------- -# Model Transformation Tools -#------------------------------------------------------------------------------- - - -package mtt::Poly; - -#------------------------------------------------------------------------------- -# Polytropic constitutive relationship -#------------------------------------------------------------------------------- - -use strict; -use warnings; - -#------------------------------------------------------------------------------- -# standard module header (see perlmod for explanation) -#------------------------------------------------------------------------------- -BEGIN { - use Exporter (); - our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - - $VERSION = 1.00; - - @ISA = qw(Exporter); - @EXPORT = qw(&Poly); # CR name - %EXPORT_TAGS = ( ); -} - -#------------------------------------------------------------------------------- -# declaration of specific component implementations -#------------------------------------------------------------------------------- -sub Poly_any(@); # any component - -#------------------------------------------------------------------------------- -# main function: selects which subfunction to call -#------------------------------------------------------------------------------- -sub Poly (@) { - - my $retval; - - $_ = $_[0]; - - s/\((.*)\)/$1/; # strip brackets - my @args = split (/,/); # split arguments - - $_ = $args[0]; # get component type - - # select rule to use - $retval = Poly_any (@args); - - # if a substitution has been made ($retval) - if ($retval) - { - return $retval; # return substituted expression - } - else # return nothing - { - return; - } -} - -#------------------------------------------------------------------------------- -# any component -#------------------------------------------------------------------------------- -sub Poly_any (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 16-1) - { - my ($component, - $alpha, - $out_causality, - $out_port, - $P1, - $in1_causality, - $in1_port, - $P2, - $in2_causality, - $in2_port, - $T1, - $in3_causality, - $in3_port, - $Nothing, - $in4_causality, - $in4_port) = @args; - - if (($in1_port == 1) and - ($in1_causality eq 'effort') and - ($in2_port == 2) and - ($in2_causality eq 'effort') and - ($in3_port == 3) and - ($in3_causality eq 'effort') and - ($in4_port == 4) and - ($in4_causality eq 'flow')) - { - if ($out_port != 4) - { - return "(0)"; - } - elsif ($out_causality eq 'effort') - { - # return temperature T2 - $retval = "($T1)*pow((($P2)/($P1)),($alpha))"; - } - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -1; # return true - DELETED mttroot/mtt/lib/cr/perl/apply_cr.pl Index: mttroot/mtt/lib/cr/perl/apply_cr.pl ================================================================== --- mttroot/mtt/lib/cr/perl/apply_cr.pl +++ mttroot/mtt/lib/cr/perl/apply_cr.pl @@ -1,192 +0,0 @@ -#! /usr/bin/perl -w -# -# apply_cr.pl - apply specified CRs to text on standard input -# Copyright (C) 2004 Geraint Paul Bevan -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -------------------------- -# Model Transformation Tools -# -------------------------- -# -# -#------------------------------------------------------------------------------- - -use strict; -use Getopt::Long; - -my $cr_name=''; -#------------------------------------------------------------------------------- -# arguments and options -#------------------------------------------------------------------------------- -my $crlist = ''; -my $debug = 0; -my $help = 0; - -GetOptions ('debug' => \$debug, - 'help' => \$help); - -#------------------------------------------------------------------------------- -# globals -#------------------------------------------------------------------------------- - -my @expressions; -my @prefixes; - -my $expression; -my $i = 0; - -#------------------------------------------------------------------------------- -# subroutine declarations -#------------------------------------------------------------------------------- -sub substitute_subexpressions(); -sub process_expression(); -sub display_subexpressions(); -sub reassemble_expression(); -sub usage(); - -#------------------------------------------------------------------------------- -# main -#------------------------------------------------------------------------------- - -if ($help) { - usage(); - exit 1; -} - -while () { - $expression = $_; - print STDERR "Start Expression -> $expression\n" if $debug; - - $i = 0; - @expressions = (); - @prefixes = (); - - substitute_subexpressions(); - display_subexpressions () if ($debug); - - for ($i = 0; $i <= $#expressions; $i++) { - process_expression (); - } - - display_subexpressions () if ($debug); - reassemble_expression (); - print STDOUT "$expression"; -} - -#------------------------------------------------------------------------------- -# subroutines -#------------------------------------------------------------------------------- -sub substitute_subexpressions() { - - while ($expression =~ /\(.*\)/) { - $_ = $expression; - # get a matched pair of brackets - s/ (.*) ( \({1} [^\(\)]* \){1} ) (.*) /$1 : $2 : $3/x; - - my $extracted; - my $remainder; - my $skipped; - ($skipped, $extracted, $remainder) = split (/ : /); - - $expressions[$i] = $extracted if $extracted; - - $_ = $skipped; - s/(\s)//g; # strip whitespace - s/ (.*?) (\w*)$ /$2/x; # get function name (if any) - $prefixes[$i] = $_; - $skipped =~ s/(.*)$prefixes[$i]$/$1/; - - $expression = "$skipped\{$i\}$remainder"; - - $i++; - } - $expressions[$i] = $expression; -# $prefixes[$i] = ""; -} -#------------------------------------------------------------------------------- -sub process_expression() { - - my $cr = ''; - foreach my $cr_name (@ARGV) { - if ($prefixes[$i]) { - if ($prefixes[$i] eq $cr_name) { - $cr = $cr_name; - } - } - } - if ($cr eq '') { - return; - } - - # call cr(arg1,arg2,...) User-defined CR in the model directory - if (-e "$cr.pm") { - my $expr = $expressions[$i]; - eval "require $cr"; - $cr->import (@_[1 .. $#_]); - no strict 'refs'; # allow symbolic references - my $substitution = &$cr ($expr); - use strict 'refs'; - if ($substitution) { - $prefixes[$i] = ""; - $expressions[$i] = "$substitution"; - } - } - # call cr(arg1,arg2,...) Standard CR in the mtt namespace - if (-e "mtt/$cr.pm") { - my $expr = $expressions[$i]; - my $mttcr = "mtt::$cr"; - eval "require 'mtt/$cr.pm'"; - $mttcr->import (@_[1 .. $#_]); - no strict 'refs'; # allow symbolic references - my $substitution = &$cr ($expr); - use strict 'refs'; - if ($substitution) { - $prefixes[$i] = ""; - $expressions[$i] = "$substitution"; - } - } -} -#------------------------------------------------------------------------------- -sub display_subexpressions() { - - for ($i = 0; $i <= $#expressions; $i++) { - my $prefix = " "; - $prefix = $prefixes[$i] if ($prefixes[$i]); - print STDERR "$i\t($prefix)\t$expressions[$i]\n\n"; - } -} -#------------------------------------------------------------------------------- -sub reassemble_expression () { - - $expression = $expressions[$#expressions]; - - for ($i = $#expressions; $i >= 0; $i--) { - print STDERR "{$i}: $expressions[$i]\n" if $debug; - $expression =~ s/\{$i\}/$prefixes[$i]$expressions[$i]/g; - } - print STDERR "Final expression -> $expression\n" if $debug; -} -#------------------------------------------------------------------------------- -sub usage() { - - print STDOUT - "\nUsage: $0 [options] crname1 crname2 ..\n" . - "\n" . - "\toptions:\n" . - "\t--debug\n" . - "\t--help\n" . - "\n"; -} DELETED mttroot/mtt/lib/cr/perl/lcos.pm Index: mttroot/mtt/lib/cr/perl/lcos.pm ================================================================== --- mttroot/mtt/lib/cr/perl/lcos.pm +++ mttroot/mtt/lib/cr/perl/lcos.pm @@ -1,120 +0,0 @@ -#------------------------------------------------------------------------------- -# Model Transformation Tools -#------------------------------------------------------------------------------- - - -package mtt::lcos; - -#------------------------------------------------------------------------------- -# linear constitutive relationship with cosine modulation -#------------------------------------------------------------------------------- - -use strict; -use warnings; - -#------------------------------------------------------------------------------- -# standard module header (see perlmod for explanation) -#------------------------------------------------------------------------------- -BEGIN { - use Exporter (); - our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - - $VERSION = 1.00; - - @ISA = qw(Exporter); - @EXPORT = qw(&lcos); # CR name - %EXPORT_TAGS = ( ); -} - -#------------------------------------------------------------------------------- -# declaration of specific component implementations -#------------------------------------------------------------------------------- -sub lcos_emtf(@); # EMTF - -#------------------------------------------------------------------------------- -# main function: selects which subfunction to call -#------------------------------------------------------------------------------- -sub lcos (@) { - - my $retval; - - $_ = $_[0]; - - s/\((.*)\)/$1/; # strip brackets - my @args = split (/,/); # split arguments - - $_ = $args[0]; # get component type - - # select rule to use - if (/^EMTF|emtf$/) { $retval = lcos_emtf (@args); } - - # if a substitution has been made ($retval) - if ($retval) - { - return $retval; # return substituted expression - } - else # return nothing - { - return; - } -} - -#------------------------------------------------------------------------------- -# EMTF -#------------------------------------------------------------------------------- -sub lcos_emtf (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 11-1) - { - my ($component, - $gain_causality, - $gain, - $out_causality, - $out_port, - $input, - $in_causality, - $in_port, - $mod_input, - $mod_causality, - $mod_port) = @args; - - if ((($mod_port == 3) and - ($out_causality eq $in_causality)) - and - ((($out_causality eq $gain_causality) and - ($out_port == 2)) - or - (($out_causality ne $gain_causality) and - ($out_port == 1)))) - { - $retval = "(($input)*($gain)*(cos($mod_input)))"; - } - elsif ((($mod_port == 3) and - ($out_causality eq $in_causality)) - and - ((($out_causality ne $gain_causality) and - ($out_port == 2)) - or - (($out_causality eq $gain_causality) and - ($out_port == 1)))) - { - $retval = "(($input)/(($gain)*(cos($mod_input))))"; - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -1; # return true - DELETED mttroot/mtt/lib/cr/perl/lin.pm Index: mttroot/mtt/lib/cr/perl/lin.pm ================================================================== --- mttroot/mtt/lib/cr/perl/lin.pm +++ mttroot/mtt/lib/cr/perl/lin.pm @@ -1,440 +0,0 @@ -#------------------------------------------------------------------------------- -# Model Transformation Tools -#------------------------------------------------------------------------------- - - -package mtt::lin; - -#------------------------------------------------------------------------------- -# Default linear constitutive relationship -#------------------------------------------------------------------------------- - -use strict; -use warnings; - -#------------------------------------------------------------------------------- -# standard module header (see perlmod for explanation) -#------------------------------------------------------------------------------- -BEGIN { - use Exporter (); - our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - - $VERSION = 1.00; - - @ISA = qw(Exporter); - @EXPORT = qw(&lin); # CR name - %EXPORT_TAGS = ( ); -} - -#------------------------------------------------------------------------------- -# declaration of specific component implementations -#------------------------------------------------------------------------------- -sub lin_amp (@); # AE AF -sub lin_cir (@); # C I R -sub lin_emtf(@); # EMTF -sub lin_fmr (@); # FMR -sub lin_gy (@); # GY -sub lin_tf (@); # TF - -#------------------------------------------------------------------------------- -# main function: selects which subfunction to call -#------------------------------------------------------------------------------- -sub lin (@) { - - my $retval; - - $_ = $_[0]; - - s/\((.*)\)/$1/; # strip brackets - my @args = split (/,/); # split arguments - - $_ = $args[0]; # get component type - - # select rule to use - if (/^AE|ae$/) { $retval = lin_amp (@args); } - if (/^AF|af$/) { $retval = lin_amp (@args); } - if (/^C|c$/) { $retval = lin_cir (@args); } - if (/^EMTF|emtf$/) { $retval = lin_emtf (@args); } - if (/^FMR|fmr$/) { $retval = lin_fmr (@args); } - if (/^GY|gy$/) { $retval = lin_gy (@args); } - if (/^I|i$/) { $retval = lin_cir (@args); } - if (/^R|r$/) { $retval = lin_cir (@args); } - if (/^TF|tf$/) { $retval = lin_tf (@args); } - - # if a substitution has been made ($retval) - if ($retval) - { - return $retval; # return substituted expression - } - else # return nothing - { - return; - } -} - -#------------------------------------------------------------------------------- -# AE and AF -#------------------------------------------------------------------------------- -sub lin_amp (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 8-1) { - - my ($component, - $gain_causality, - $gain, - $out_causality, - $out_port, - $input, - $in_causality, - $in_port) = @args; - - if (($out_port == 2) and - ($in_port == 1)) - { # uni-causal - $retval = "(($input)*($gain))"; - } - - elsif (($out_port == 1) and - ($in_port == 2)) - { # bi-causal - $retval = "(($input)/($gain))"; - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -# C, I and R -#------------------------------------------------------------------------------- -sub lin_cir (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 8-1) - { - my ($component, - $gain_causality, - $gain, - $out_causality, - $out_port, - $input, - $in_causality, - $in_port) = @args; - - if ( - ($out_port == 1) - and - ($in_port == 1) - ) - { # single port - if ($in_causality eq $gain_causality) - { - $retval = "(($input)*($gain))"; - } - elsif ($in_causality ne $gain_causality) - { - $retval = "(($input)/($gain))"; - } - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -# EMTF -#------------------------------------------------------------------------------- -sub lin_emtf (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 10-1) - { # modulation only - my ($component, - $gain_causality, - $out_causality, - $out_port, - $input, - $in_causality, - $in_port, - $mod_input, - $mod_causality, - $mod_port) = @args; - - if ((($mod_causality eq 'effort') and - ($mod_port == 3)) - and - ((($out_causality eq $gain_causality) and - ($out_port == 2)) - or - (($out_causality ne $gain_causality) and - ($out_port == 1)))) - { - $retval = "(($input)*($mod_input))"; - } - elsif ((($mod_causality eq 'effort') and - ($mod_port == 3)) - and - ((($out_causality ne $gain_causality) and - ($out_port == 2)) - or - (($out_causality eq $gain_causality) and - ($out_port == 1)))) - { - $retval = "(($input)/($mod_input))"; - } - } - elsif ($#args == 11-1) - { # modulation and gain - my ($component, - $gain_causality, - $gain, - $out_causality, - $out_port, - $input, - $in_causality, - $in_port, - $mod_input, - $mod_causality, - $mod_port) = @args; - - if ((($mod_causality eq 'effort') and - ($mod_port == 3)) - and - ((($out_causality eq $gain_causality) and - ($out_port == 2)) - or - (($out_causality ne $gain_causality) and - ($out_port == 1)))) - { - $retval = "(($input)*(($gain)*($mod_input)))"; - } - elsif ((($mod_causality eq 'effort') and - ($mod_port == 3)) - and - ((($out_causality ne $gain_causality) and - ($out_port == 2)) - or - (($out_causality eq $gain_causality) and - ($out_port == 1)))) - { - $retval = "(($input)/(($gain)*($mod_input)))"; - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} -#------------------------------------------------------------------------------- -# FMR -#------------------------------------------------------------------------------- -sub lin_fmr (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 7-1) - { # uni-causal - # flow modulation multiplies effort on port 1 (or divides flow) - my ($component, - $gain_causality, - $gain, - $out_causality, - $input, - $in_causality, - $mod_input) = @args; - - if (($gain_causality eq $in_causality) and - ($out_causality eq 'flow')) - { - $retval = "(($input)*($gain)*($mod_input))"; - } - elsif (($gain_causality eq $in_causality) and - ($out_causality eq 'effort')) - { - $retval = "(($input)*($gain)/($mod_input))"; - } - elsif (($gain_causality ne $in_causality) and - ($out_causality eq 'flow')) - { - $retval = "(($input)*($mod_input)/($gain))"; - } - elsif (($gain_causality ne $in_causality) and - ($out_causality eq 'effort')) - { - $retval = "(($input)/(($gain)*($mod_input)))"; - } - } - elsif ($#args == 11-1) - { # bi-causal - # deduces the flow on port 2 - my ($component, - $gain_causality, - $gain, - $out_causality, - $out_port, - $e_input, - $e_causality, - $e_port, - $f_input, - $f_causality, - $f_port) = @args; - - if (($gain_causality eq 'effort') and - ($out_causality eq 'flow') and - ($out_port == 2) and - ($e_causality eq 'effort') and - ($e_port == 1) and - ($f_causality eq 'flow') and - ($f_port == 1)) - { - $retval = "((($f_input)/($e_input))/($gain))"; - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -# GY -#------------------------------------------------------------------------------- -sub lin_gy (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 8-1) - { - my ($component, - $gain_causality, - $gain, - $out_causality, - $out_port, - $input, - $in_causality, - $in_port) = @args; - - if (($out_causality ne $in_causality) and - ($out_port != $in_port) - and - (($out_causality ne $gain_causality) and - ($out_port == 2)) - or - (($out_causality ne $gain_causality) and - ($out_port == 1))) - { - $retval = "(($input)/($gain))"; - } - - elsif (($out_causality ne $in_causality) and - ($out_port != $in_port) - and - (($out_causality eq $gain_causality) and - ($out_port == 2)) - or - (($out_causality eq $gain_causality) and - ($out_port == 1))) - { - $retval = "(($input)*($gain))"; - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -# TF -#------------------------------------------------------------------------------- -sub lin_tf (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 8-1) - { - my ($component, - $gain_causality, - $gain, - $out_causality, - $out_port, - $input, - $in_causality, - $in_port) = @args; - - if (($out_causality eq $in_causality) and - ($out_port ne $in_port) - and - (($out_causality eq $gain_causality) and - ($out_port == 2)) - or - (($out_causality ne $gain_causality) and - ($out_port == 1))) - { - $retval = "(($input)*($gain))"; - } - - elsif (($out_causality eq $in_causality) and - ($out_port ne $in_port) - and - (($out_causality ne $gain_causality) and - ($out_port == 2)) - or - (($out_causality eq $gain_causality) and - ($out_port == 1))) - { - $retval = "(($input)/($gain))"; - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} -#------------------------------------------------------------------------------- -1; # return true - DELETED mttroot/mtt/lib/cr/perl/lsin.pm Index: mttroot/mtt/lib/cr/perl/lsin.pm ================================================================== --- mttroot/mtt/lib/cr/perl/lsin.pm +++ mttroot/mtt/lib/cr/perl/lsin.pm @@ -1,120 +0,0 @@ -#------------------------------------------------------------------------------- -# Model Transformation Tools -#------------------------------------------------------------------------------- - - -package mtt::lsin; - -#------------------------------------------------------------------------------- -# linear constitutive relationship with sine modulation -#------------------------------------------------------------------------------- - -use strict; -use warnings; - -#------------------------------------------------------------------------------- -# standard module header (see perlmod for explanation) -#------------------------------------------------------------------------------- -BEGIN { - use Exporter (); - our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - - $VERSION = 1.00; - - @ISA = qw(Exporter); - @EXPORT = qw(&lsin); # CR name - %EXPORT_TAGS = ( ); -} - -#------------------------------------------------------------------------------- -# declaration of specific component implementations -#------------------------------------------------------------------------------- -sub lsin_emtf(@); # EMTF - -#------------------------------------------------------------------------------- -# main function: selects which subfunction to call -#------------------------------------------------------------------------------- -sub lsin (@) { - - my $retval; - - $_ = $_[0]; - - s/\((.*)\)/$1/; # strip brackets - my @args = split (/,/); # split arguments - - $_ = $args[0]; # get component type - - # select rule to use - if (/^EMTF|emtf$/) { $retval = lsin_emtf (@args); } - - # if a substitution has been made ($retval) - if ($retval) - { - return $retval; # return substituted expression - } - else # return nothing - { - return; - } -} - -#------------------------------------------------------------------------------- -# EMTF -#------------------------------------------------------------------------------- -sub lsin_emtf (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 11-1) - { - my ($component, - $gain_causality, - $gain, - $out_causality, - $out_port, - $input, - $in_causality, - $in_port, - $mod_input, - $mod_causality, - $mod_port) = @args; - - if ((($mod_port == 3) and - ($out_causality eq $in_causality)) - and - ((($out_causality eq $gain_causality) and - ($out_port == 2)) - or - (($out_causality ne $gain_causality) and - ($out_port == 1)))) - { - $retval = "(($input)*($gain)*(sin($mod_input)))"; - } - elsif ((($mod_port == 3) and - ($out_causality eq $in_causality)) - and - ((($out_causality ne $gain_causality) and - ($out_port == 2)) - or - (($out_causality eq $gain_causality) and - ($out_port == 1)))) - { - $retval = "(($input)/(($gain)*(sin($mod_input))))"; - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -1; # return true - DELETED mttroot/mtt/lib/cr/r/CT2.cr Index: mttroot/mtt/lib/cr/r/CT2.cr ================================================================== --- mttroot/mtt/lib/cr/r/CT2.cr +++ mttroot/mtt/lib/cr/r/CT2.cr @@ -1,43 +0,0 @@ -%SUMMARY CT2 Constitutive Relationship for a two port thermo C -%DESCRIPTION Parameter 1: c_v (specific heat at constant volume) -%DESCRIPTION Parameter 2: gamma = c_p/c_v -%DESCRIPTION Parameter 3: mass of (ideal) gas within component. -%DESCRIPTION Parameter 4: t_0 -- the temperature at which internal -%DESCRIPTION energy is zero. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/12/07 20:45:21 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/02 10:21:19 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/09/12 11:18:26 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -OPERATOR CT2; -Port 1 - Thermal -FOR ALL c_v,gamma,m,t_0,InternalEnergy,Volume -LET CT2(c_v,gamma,m,t_0,effort,1, - InternalEnergy, state, 1, - Volume, state, 2) - = InternalEnergy/(m*c_v); - -Port 2 - Mechanical -FOR ALL c_v,gamma,m,t_0,InternalEnergy,Volume -LET CT2(c_v,gamma,m,t_0,effort,2, - InternalEnergy, state, 1, - Volume, state, 2) - = (gamma-1)*(InternalEnergy+c_v*m*t_0)/Volume; - DELETED mttroot/mtt/lib/cr/r/MA.cr Index: mttroot/mtt/lib/cr/r/MA.cr ================================================================== --- mttroot/mtt/lib/cr/r/MA.cr +++ mttroot/mtt/lib/cr/r/MA.cr @@ -1,120 +0,0 @@ -%SUMMARY MA: Mass-action kinetics for Re -%DESCRIPTION Parameter 1: kappa - -OPERATOR MA; - -%%% Two port version (standard) -FOR ALL n_out, A_f, A_r, kappa -LET MA(R, flow,kappa,flow,n_out, - A_f,effort,1, - A_r,effort,2) = kappa*(exp(A_f/RT) - exp(A_r/RT)); - - -%%% Four port version (stoichiometric) with integral causality -%% Flows on ports 1 & 2 = flow on port 3. -FOR ALL A_f, A_r, v_1, v_2,kappa -LET MA(R, flow,kappa,flow,1, - A_f,effort,1, - A_r,effort,2, - v_1,flow,3, - v_2,effort,4) = v_1; - -FOR ALL A_f, A_r, v_1, v_2,kappa -LET MA(R, flow,kappa,flow,2, - A_f,effort,1, - A_r,effort,2, - v_1,flow,3, - v_2,effort,4) = v_1; - -%% Flow on port 4 is induced flow -FOR ALL A_f, A_r, v_1, v_2,kappa -LET MA(R, flow,kappa,flow,4, - A_f,effort,1, - A_r,effort,2, - v_1,flow,3, - v_2,effort,4) = kappa*(exp(A_f/RT) - exp(A_r/RT)); - -%%% Four port version (stoichiometric) with flow imposed on port 1 -%% Flow on port 2 = flow on port 1 -FOR ALL A_1,A_2,A_3,A_4, v_1,v_2,v_3,v_4, kappa -LET MA(R, flow,kappa,flow,2, - v_1,flow,1, - A_2,effort,2, - v_3,flow,3, - A_4,effort,4) = v_1; - -%% Flow on port 4 = flow on port 1 -FOR ALL A_1,A_2,A_3,A_4, v_1,v_2,v_3,v_4, kappa -LET MA(R, flow,kappa,flow,4, - v_1,flow,1, - A_2,effort,2, - v_3,flow,3, - A_4,effort,4) = v_1; - -%% Effort on port 1 -FOR ALL A_1,A_2,A_3,A_4,v_1,v_2,v_3,v_4,kappa -LET MA(R,flow,kappa,effort,1, - v_1,flow,1, - A_2,effort,2, - v_3,flow,3, - A_4,effort,4) = RT*log( (v_1/kappa) + exp(A_2/RT) ); - - -%%% Four port version (stoichiometric) with flow imposed on port 2 - -%% Flow on port 1 = flow on port 2 -FOR ALL A_1,A_2,A_3,A_4, v_1,v_2,v_3,v_4, kappa -LET MA(R, flow,kappa,flow,1, - A_1,effort,1, - v_2,flow,2, - v_3,flow,3, - A_4,effort,4) = v_2; - -%% Flow on port 4 = flow on port 2 -FOR ALL A_1,A_2,A_3,A_4, v_1,v_2,v_3,v_4, kappa -LET MA(R, flow,kappa,flow,4, - A_1,effort,1, - v_2,flow,2, - v_3,flow,3, - A_4,effort,4) = v_2; - -%% Effort on port 2 -FOR ALL A_1,A_2,A_3,A_4,v_1,v_2,v_3,v_4,kappa -LET MA(R,flow,kappa,effort,2, - A_1,effort,1, - v_2,flow,2, - v_3,flow,3, - A_4,effort,4) = RT*log( (v_2/kappa) + exp(A_1/RT) ); - -%%% Five port version (stoichiometric) with integral causality -%% Flow on port 1 = flow on port 3. -FOR ALL A_f, A_r, v_f, v_r, v, kappa -LET MA(R, flow,kappa,flow,1, - A_f,effort,1, - A_r,effort,2, - v_f,flow,3, - v_r,flow,4, - v,effort,5) = v_f; - -%% Flow on port 2 = flow on port 4. -FOR ALL A_f, A_r, v_f, v_r, v, kappa -LET MA(R, flow,kappa,flow,2, - A_f,effort,1, - A_r,effort,2, - v_f,flow,3, - v_r,flow,4, - v,effort,5) = v_r; - -%% Flow on port 5 is induced flow -FOR ALL A_f, A_r, v_f, v_r, v, kappa -LET MA(R, flow,kappa,flow,5, - A_f,effort,1, - A_r,effort,2, - v_f,flow,3, - v_r,flow,4, - v,effort,5) = kappa*(exp(A_f/RT) - exp(A_r/RT)); - - -%% AE version -FOR ALL mu -LET MA(AE, effort,2, mu, effort,1) = exp(mu/RT); DELETED mttroot/mtt/lib/cr/r/SS.cr Index: mttroot/mtt/lib/cr/r/SS.cr ================================================================== --- mttroot/mtt/lib/cr/r/SS.cr +++ mttroot/mtt/lib/cr/r/SS.cr @@ -1,3 +0,0 @@ -%% A dummy constitutive relationship file for SS - -END;; DELETED mttroot/mtt/lib/cr/r/StefanBoltzmann.cr Index: mttroot/mtt/lib/cr/r/StefanBoltzmann.cr ================================================================== --- mttroot/mtt/lib/cr/r/StefanBoltzmann.cr +++ mttroot/mtt/lib/cr/r/StefanBoltzmann.cr @@ -1,15 +0,0 @@ -%SUMMARY StefanBoltzmann: Stefan-Boltzmann radiation law. -%DESCRIPTION Parameter 1: Stefan-Boltzmann constant -%DESCRIPTION Parameter 2: Area of radiating surface - - - -OPERATOR StefanBoltzmann; - - -FOR ALL sigma,Area,input -LET StefanBoltzmann(sigma,Area,flow, 1, - input, effort, 1) - = sigma*area*input^4; - - DELETED mttroot/mtt/lib/cr/r/cm.cr Index: mttroot/mtt/lib/cr/r/cm.cr ================================================================== --- mttroot/mtt/lib/cr/r/cm.cr +++ mttroot/mtt/lib/cr/r/cm.cr @@ -1,44 +0,0 @@ -%SUMMARY cm: relation for 2-port CM component -%DESCRIPTION Parameter 1 capacitance at separation x_0 -%DESCRIPTION Parameter 2 x_0 -%DESCRIPTION parameter 3 moving-plate mass - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:18:38 peterg -% %% put under RCS -% %% -% %% Revision 1.1 1996/11/02 10:21:19 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/09/12 11:18:26 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -OPERATOR cm; -%Linear electrical bit -FOR ALL comp,c_0,x_0,elec_state,mech_state LET -cm(comp,c_0,x_0,effort,1, - elec_state,state,1, - mech_state,state,2 - ) - = elec_state/(c_0*x_0/mech_state); - -%Nonlinear mechanical bit -FOR ALL comp,c_0,x_0,elec_state,mech_state LET -cm(comp,c_0,x_0,effort,2, - elec_state,state,1, - mech_state,state,2 - ) - = -(c_0*x_0)*((elec_state/mech_state)^2)/2; - -END;; DELETED mttroot/mtt/lib/cr/r/cp.cr Index: mttroot/mtt/lib/cr/r/cp.cr ================================================================== --- mttroot/mtt/lib/cr/r/cp.cr +++ mttroot/mtt/lib/cr/r/cp.cr @@ -1,27 +0,0 @@ -%SUMMARY cp Chemical potential constitutive relationship - -% This formula gives the Gibb's free energy for a reaction component -% with given concentration. -% k_e is the corresponding equilibrium constant. - -% C version integral causality -FOR ALL concentration, k_e, RT -LET cp(C,k_e,RT, effort, 1, - concentration, state, 1) - = RT*log(k_e*concentration); - -% C version derivative causality -FOR ALL potential, k_e, RT -LET cp(C,k_e,RT, state, 1, - potential, effort, 1) - = exp(potential/RT)/k_e; - -%AE version -FOR ALL concentration, RT -LET cp(AE,RT,effort,2,concentration,effort,1) - = RT*log(concentration); - -%AE version with k_e -FOR ALL concentration, k_e, RT -LET cp(AE,k_e,RT,effort,2,concentration,effort,1) - = RT*log(k_e*concentration); DELETED mttroot/mtt/lib/cr/r/cr.cr Index: mttroot/mtt/lib/cr/r/cr.cr ================================================================== --- mttroot/mtt/lib/cr/r/cr.cr +++ mttroot/mtt/lib/cr/r/cr.cr @@ -1,121 +0,0 @@ -%SUMMARY cr generic CR -%DESCRIPTION Argument is an algebraic expression with no embeddedwhite space -%DESCRIPTION Only available for one ports just now -%DESCRIPTION effort (or integrated effort) variable must be called mtt_e -%DESCRIPTION flow (or integrated flow) variable must be called mtt_f -%DESCRIPTION For example: -%DESCRIPTION mtt_e=k*mtt_f -%DESCRIPTION mtt_f=mtt_e/r - -% $Log$ -% Revision 1.5 2003/01/09 09:57:42 gawthrop -% Added dummy first argument (comp_type) to cr -% -% Revision 1.4 2000/12/28 09:18:38 peterg -% put under RCS -% -% Revision 1.3 2000/10/05 10:13:00 peterg -% New eqn2ass function. -% Started extension to multiports -% -% Revision 1.2 2000/10/03 18:35:04 peterg -% Removed comment bug -% -% Revision 1.1 2000/10/03 18:34:00 peterg -% Initial revision -% - -%Copyright (C) 2000 by Peter J. Gawthrop - - -% Function to convert equation to assignment -OPERATOR eqn2ass; -FOR ALL comp_type, eqn,outlist,inputs -LET eqn2ass(eqn,outlist,inputs) = -BEGIN - ass := {}; mtt_ports := 0; - solutions := solve(eqn,outlist); - FOR EACH solution IN solutions DO - BEGIN - mtt_ports := mtt_ports + 1; - rh := RHS(solution); - FOR EACH input IN inputs DO - rh := sub(input,rh); - ass := APPEND(ass,{rh}); - END; - IF mtt_ports EQ 1 THEN - RETURN FIRST(ass) - ELSE - RETURN ass; - - %return sub(input,rhs(first(solve(eqn,outlist)))); - % Needs multiplicity warning -END; - - -OPERATOR cr; - -% Version for one-port components - -% We need four versions so that state does not need to be explicitly -% mentioned. -% At the moment, assume only one solution (in fact the first is -% chosen) - -%%%% This is the Equation version -% Flow input -FOR ALL comp_type, mtt_cr, input, out_cause -LET cr(comp_type,mtt_cr,out_cause, 1, input, flow, 1) - = eqn2ass(mtt_cr,mtt_e,{mtt_f=input}); - -% Effort input -FOR ALL comp_type, mtt_cr, input, out_cause -LET cr(comp_type,mtt_cr,out_cause, 1, input, effort, 1) - = eqn2ass(mtt_cr,mtt_f,{mtt_e=input}); - -% Effort output -FOR ALL comp_type, mtt_cr, input, in_cause -LET cr(comp_type,mtt_cr,effort, 1, input, in_cause, 1) - = eqn2ass(mtt_cr,mtt_e,{mtt_f=input}); - -% Flow output -FOR ALL comp_type, mtt_cr, input, in_cause -LET cr(comp_type,mtt_cr,flow, 1, input, in_cause, 1) - = eqn2ass(mtt_cr,mtt_f,{mtt_e=input}); - -%%%% This is the assignment version -% Flow input -FOR ALL comp_type, mtt_cr_e,mtt_cr_f, input, out_cause -LET cr(comp_type,mtt_cr_e,mtt_cr_f,out_cause, 1, input, flow, 1) - = sub(mtt_f=input,mtt_cr_f); - -% Effort input -FOR ALL comp_type, mtt_cr_e,mtt_cr_f, input, out_cause -LET cr(comp_type,mtt_cr_e,mtt_cr_f,out_cause, 1, input, effort, 1) - = sub(mtt_e=input,mtt_cr_e); - -% Effort output -FOR ALL comp_type, mtt_cr_e,mtt_cr_f, input, in_cause -LET cr(comp_type,mtt_cr_e,mtt_cr_f,effort, 1, input, in_cause, 1) - = sub(mtt_f=input,mtt_cr_f); - -% Flow output -FOR ALL comp_type, mtt_cr_e,mtt_cr_f, input, in_cause -LET cr(comp_type,mtt_cr_e,mtt_cr_f,flow, 1, input, in_cause, 1) - = sub(mtt_e=input,mtt_cr_e); - - -%%% Q&D FMR 2 port. -FOR ALL comp_type, mtt_cr_e,mtt_cr_f,input_1,input_2 -LET cr(comp_type,mtt_cr_e,mtt_cr_f,flow,1, - input_1,effort,1, - input_2,flow,2 - ) = sub(mtt_mod=input_2,sub(mtt_e=input_1,mtt_cr_e)); - -%% AE amplifier -FOR ALL mtt_cr, input, out_cause -LET cr(ae,mtt_cr,effort, 2, - input, effort, 1) - = eqn2ass(mtt_cr,mtt_2,{mtt_1=input}); - -END; DELETED mttroot/mtt/lib/cr/r/defaultcr.r Index: mttroot/mtt/lib/cr/r/defaultcr.r ================================================================== --- mttroot/mtt/lib/cr/r/defaultcr.r +++ mttroot/mtt/lib/cr/r/defaultcr.r @@ -1,63 +0,0 @@ -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Linear constitutive relationship. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%Linear Constitutive Relationship for single port components: R,C,I. -% e = Gain*f (if gain_causality = flow) -% f = Gain*e (if gain_causality = effort) -OPERATOR lin; -FOR ALL gain_causality, gain, causality, input, other_causality -SUCH THAT causality = gain_causality -LET lin(gain_causality, gain, other_causality, 1, input, causality, 1) - = gain*input; - -%Linear CR: e = (1/Gain)*f (if gain_causality = flow) -% f = (1/Gain)*e (if gain_causality = effort) -FOR ALL gain_causality, gain, causality, input, other_causality -SUCH THAT causality NEQ gain_causality -LET lin(gain_causality, gain, other_causality, 1, input, causality, 1) - = input/gain; - - -% Linear Constitutive Relationship for AE and AF -% Output = gain * input - -% Unicausal form -FOR ALL gain, input, causality -LET lin(gain, causality, 2, input, causality, 1) = gain*input; - -%Bicausal form -FOR ALL gain, output, causality -LET lin(gain, causality, 1, output, causality, 2) = output/gain; - -% Linear Constitutive Relationship for TF -FOR ALL gain, input, causality, gain_causality, outport, inport -SUCH THAT ( - (causality = gain_causality) AND (outport = 2) - OR - (causality NEQ gain_causality) AND (outport = 1) - ) -LET lin(gain_causality, gain, causality, outport, input, causality, inport) - = gain*input; - -FOR ALL gain, input, causality, gain_causality, outport, inport -SUCH THAT ( - (causality NEQ gain_causality) AND (outport = 2) - OR - (causality = gain_causality) AND (outport = 1) - ) -LET lin(gain_causality, gain, causality, outport, input, causality, inport) - = input/gain; - -END; - DELETED mttroot/mtt/lib/cr/r/delta_h.cr Index: mttroot/mtt/lib/cr/r/delta_h.cr ================================================================== --- mttroot/mtt/lib/cr/r/delta_h.cr +++ mttroot/mtt/lib/cr/r/delta_h.cr @@ -1,31 +0,0 @@ -%SUMMARY delta_h CR for gas turbine compressor - - -OPERATOR delta_h; - -% Port 1 - generates delta h -FOR ALL c_p,Temperature,Massflow,DeltaT -LET delta_h(c_p, flow, 1, - Temperature,effort,1, - Massflow,flow,2, - DeltaT,effort,3) - = Massflow*c_p*DeltaT; - -% Port 2 - generates zero effort -FOR ALL c_p,Temperature,Massflow,DeltaT -LET delta_h(c_p, effort, 2, - Temperature,effort,1, - Massflow,flow,2, - DeltaT,effort,3) - = 0; - -% Port 3 - generates zero effort -FOR ALL c_p,Temperature,Massflow,DeltaT -LET delta_h(c_p, flow,3, - Temperature,effort,1, - Massflow,flow,2, - DeltaT,effort,3) - = 0; - - - DELETED mttroot/mtt/lib/cr/r/lcos.cr Index: mttroot/mtt/lib/cr/r/lcos.cr ================================================================== --- mttroot/mtt/lib/cr/r/lcos.cr +++ mttroot/mtt/lib/cr/r/lcos.cr @@ -1,55 +0,0 @@ -%SUMMARY lcos linear constitutive relationship with cos modulation -%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 -%DESCRIPTION value is effort, flow or state -%DESCRIPTION Parameter 2 is the gain corresponding to the causality of -%DESCRIPTION parameter 1. -%DESCRIPTION Supported components: - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Linear constitutive relationship with cos modulation - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/03/04 17:51:02 peterg -% %% Added END -% %% -% %% Revision 1.1 1996/11/02 10:18:07 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -OPERATOR lcos; - -%DESCRIPTION three port component: EMTF -FOR ALL comp_type, gain, input, causality, gain_causality, outport, inport, - m_input, m_causality -SUCH THAT ( - (causality = gain_causality) AND (outport = 2) - OR - (causality NEQ gain_causality) AND (outport = 1) - ) -LET lcos(comp_type, gain_causality, gain, causality, outport, - input, causality, inport, - m_input, m_causality, 3) - = cos(m_input)*gain*input; - -FOR ALL comp_type, gain, input, causality, gain_causality, outport, inport, - m_input, m_causality -SUCH THAT ( - (causality NEQ gain_causality) AND (outport = 2) - OR - (causality = gain_causality) AND (outport = 1) - ) -LET lcos(comp_type, gain_causality, gain, causality, outport, - input, causality, inport, - m_input, m_causality, 3) - = input/(cos(m_input)*gain); - -END;; DELETED mttroot/mtt/lib/cr/r/lin.cr Index: mttroot/mtt/lib/cr/r/lin.cr ================================================================== --- mttroot/mtt/lib/cr/r/lin.cr +++ mttroot/mtt/lib/cr/r/lin.cr @@ -1,229 +0,0 @@ -%SUMMARY lin linear constitutive relationship -%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 -%DESCRIPTION value is effort, flow or state -%DESCRIPTION Parameter 2 is the gain corresponding to the causality of -%DESCRIPTION parameter 1. -%DESCRIPTION Supported components: - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Linear constitutive relationship. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 2000/12/28 09:19:07 peterg -% % put under RCS -% % -% % Revision 1.3 1998/07/04 10:47:04 peterg -% % back under RCS -% % -% % Revision 1.2 1998/03/04 15:38:54 peterg -% % Added END statement -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%DESCRIPTION single port components: R,C,I -%Linear Constitutive Relationship for single port components: R,C,I. -% e = Gain*f (if gain_causality = flow) -% f = Gain*e (if gain_causality = effort) -OPERATOR lin; -FOR ALL comp_type, gain_causality, gain, causality, input, other_causality -SUCH THAT causality = gain_causality -LET lin(comp_type,gain_causality, gain, other_causality, 1, input, causality, 1) - = gain*input; - -%Linear CR: e = (1/Gain)*f (if gain_causality = flow) -% f = (1/Gain)*e (if gain_causality = effort) -FOR ALL comp_type, gain_causality, gain, causality, input, other_causality -SUCH THAT causality NEQ gain_causality -LET lin(comp_type,gain_causality, gain, other_causality, 1, input, causality, 1) - = input/gain; - -%DESCRIPTION two port components: AE, AF -% Linear Constitutive Relationship for AE and AF -% Output = gain * input - -% Unicausal form -FOR ALL comp_type, gain, input, causality -LET lin(comp_type,gain, causality, 2, input, causality, 1) = gain*input; - -%Bicausal form -FOR ALL comp_type, gain, output, causality -LET lin(comp_type,gain, causality, 1, output, causality, 2) = output/gain; - -%DESCRIPTION two port component: TF -% Linear Constitutive Relationship for TF -FOR ALL comp_type, gain_causality, gain, causality, outport, input, same_causality, inport - -SUCH THAT - ( causality = same_causality ) - AND - ( inport NEQ outport ) - AND - ( - ( (causality = gain_causality) AND (outport = 2) ) - OR - ( (causality NEQ gain_causality) AND (outport = 1) ) - ) -LET lin(comp_type,gain_causality, gain, causality, outport, - input, same_causality, inport) - = gain*input; - -FOR ALL comp_type, gain_causality, gain, causality, outport, - input, same_causality, inport -SUCH THAT - ( causality = same_causality ) - AND - ( inport NEQ outport ) - AND - ( - ( (causality NEQ gain_causality) AND (outport = 2) ) - OR - ( (causality = gain_causality) AND (outport = 1) ) - ) -LET lin(comp_type,gain_causality, gain, causality, outport, - input, same_causality, inport) - = input/gain; - -%% This version in not reliable. I rellly need to pass component names -%% as cr arguments. - -%DESCRIPTION two port component: GY -% Linear Constitutive Relationship for GY - -FOR ALL comp_type, gain, input, causality, gain_causality, other_causality, - outport, inport -SUCH THAT - (causality NEQ other_causality) - AND - ( inport NEQ outport ) - AND - ( - ( (causality NEQ gain_causality) AND (outport = 2) ) - OR - ( (causality NEQ gain_causality) AND (outport = 1) ) - ) -LET lin(comp_type,gain_causality, gain, other_causality, outport, - input, causality, inport) - = input/gain; - -FOR ALL comp_type, gain, input, causality, gain_causality, other_causality, - outport, inport -SUCH THAT - (causality NEQ other_causality) - AND - ( inport NEQ outport ) - AND - ( - ( (causality = gain_causality) AND (outport = 2) ) - OR - ( (causality = gain_causality) AND (outport = 1) ) - ) -LET lin(comp_type,gain_causality, gain, other_causality, outport, - input, causality, inport) - = gain*input; - -%DESCRIPTION three port component: FMR - -% Linear Constitutive Relationship for FMR - unicausal case -% Flow modulation multiplies effort on port 1 (or divides flow) - -% The 4 possibilities follow... -FOR ALL comp_type, gain_causality, gain, out_causality, input, in_causality, - mod_input -SUCH THAT (gain_causality=in_causality) AND (out_causality=flow) -LET lin(comp_type,gain_causality, gain, out_causality, 1, - input, in_causality, 1, - mod_input, flow, 2) - = input*gain*mod_input; - -FOR ALL comp_type, gain_causality, gain, out_causality, input, in_causality, - mod_input -SUCH THAT (gain_causality=in_causality) AND (out_causality=effort) -LET lin(comp_type,gain_causality, gain, out_causality, 1, - input, in_causality, 1, - mod_input, flow, 2) - = input*gain/mod_input; - -FOR ALL comp_type, gain_causality, gain, out_causality, input, in_causality, - mod_input -SUCH THAT (gain_causality NEQ in_causality) AND (out_causality=flow) -LET lin(comp_type,gain_causality, gain, out_causality, 1, - input, in_causality, 1, - mod_input, flow, 2) - = input*mod_input/gain; - -FOR ALL comp_type, gain_causality, gain, out_causality, input, in_causality, - mod_input -SUCH THAT (gain_causality NEQ in_causality) AND (out_causality=effort) -LET lin(comp_type,gain_causality, gain, out_causality, 1, - input, in_causality, 1, - mod_input, flow, 2) - = input/(gain*mod_input); - -% Linear Constitutive Relationship for FMR - bicausal case -% Deduces the flow on port 2. - -% The 2 possibilities follow... -FOR ALL comp_type, gain, e_input, f_input -LET lin(comp_type,effort, gain, flow, 2, - e_input, effort, 1, - f_input, flow, 1) - = (f_input/e_input)/gain; - -%EMTF component - modulation only -% Linear Constitutive Relationship for EMTF -FOR ALL comp_type, gain_causality, gain, causality, outport, input, same_causality, inport -SUCH THAT - ( (causality = gain_causality) AND (outport = 2) ) - OR - ( (causality NEQ gain_causality) AND (outport = 1) ) -LET lin(comp_type,gain_causality, causality, outport, - input, same_causality, inport, - gain, effort, 3) - = gain*input; - -FOR ALL comp_type, gain_causality, gain, causality, outport, - input, same_causality, inport -SUCH THAT - ( (causality NEQ gain_causality) AND (outport = 2) ) - OR - ( (causality = gain_causality) AND (outport = 1) ) -LET lin(comp_type,gain_causality, causality, outport, - input, same_causality, inport, - gain, effort, 3) - = input/gain; - -%EMTF component - modulation and gain -% Linear Constitutive Relationship for EMTF -FOR ALL comp_type, gain_causality, gain, causality, outport, input, -same_causality, inport, modulation -SUCH THAT - ( (causality = gain_causality) AND (outport = 2) ) - OR - ( (causality NEQ gain_causality) AND (outport = 1) ) -LET lin(comp_type,gain_causality, gain, causality, outport, - input, same_causality, inport, - modulation, effort, 3) - = gain*modulation*input; - -FOR ALL comp_type, gain_causality, gain, causality, outport, - input, same_causality, inport, modulation -SUCH THAT - ( (causality NEQ gain_causality) AND (outport = 2) ) - OR - ( (causality = gain_causality) AND (outport = 1) ) -LET lin(comp_type,gain_causality, gain, causality, outport, - input, same_causality, inport, - modulation, effort, 3) - = input/(gain*modulation); - -END;; - DELETED mttroot/mtt/lib/cr/r/linx.cr Index: mttroot/mtt/lib/cr/r/linx.cr ================================================================== --- mttroot/mtt/lib/cr/r/linx.cr +++ mttroot/mtt/lib/cr/r/linx.cr @@ -1,44 +0,0 @@ -%%% linx - cr for single port I and C with an initial state x_0 - - - -%DESCRIPTION linear cr for single port I and C with an initial state x0 -%DESCRIPTION only adds x0 if in integral causality - - -OPERATOR linx; - -%% Input causality as specified -%Linear Constitutive Relationship for single port components: C,I. -% e = Gain*f (if gain_causality = flow) -% f = Gain*e (if gain_causality = effort) - -FOR ALL gain_causality, gain, causality, input, other_causality -SUCH THAT (causality = gain_causality) AND (causality = state) -LET linx(gain_causality, gain, x0, other_causality, 1, input, causality, 1) - = gain*(input + x0); - - -FOR ALL gain_causality, gain, causality, input, other_causality -SUCH THAT (causality = gain_causality) AND (causality NEQ state) -LET linx(gain_causality, gain, x0, other_causality, 1, input, causality, 1) - = gain*(input); - -%% Input causality not as specified -%Linear CR: e = (1/Gain)*f (if gain_causality = flow) -% f = (1/Gain)*e (if gain_causality = effort) - -FOR ALL gain_causality, gain, x0, causality, input, other_causality -SUCH THAT (causality NEQ gain_causality) AND (causality = state) -LET linx(gain_causality, gain, x0, other_causality, 1, input, causality, 1) - = (input+x0)/gain; - -FOR ALL gain_causality, gain, x0, causality, input, other_causality -SUCH THAT (causality NEQ gain_causality) AND (causality NEQ state) -LET linx(gain_causality, gain, x0, other_causality, 1, input, causality, 1) - = (input)/gain; - - - - -END;; DELETED mttroot/mtt/lib/cr/r/lsin.cr Index: mttroot/mtt/lib/cr/r/lsin.cr ================================================================== --- mttroot/mtt/lib/cr/r/lsin.cr +++ mttroot/mtt/lib/cr/r/lsin.cr @@ -1,55 +0,0 @@ -%SUMMARY lsin linear constitutive relationship with sin modulation -%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 -%DESCRIPTION value is effort, flow or state -%DESCRIPTION Parameter 2 is the gain corresponding to the causality of -%DESCRIPTION parameter 1. -%DESCRIPTION Supported components: - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Linear constitutive relationship with sin modulation - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/03/04 17:51:37 peterg -% %% Added END -% %% -% %% Revision 1.1 1996/11/02 10:18:25 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -OPERATOR lsin; - -%DESCRIPTION three port component: EMTF -FOR ALL comp_type, gain, input, causality, gain_causality, outport, inport, - m_input, m_causality -SUCH THAT ( - (causality = gain_causality) AND (outport = 2) - OR - (causality NEQ gain_causality) AND (outport = 1) - ) -LET lsin(comp_type, gain_causality, gain, causality, outport, - input, causality, inport, - m_input, m_causality, 3) - = sin(m_input)*gain*input; - -FOR ALL comp_type, gain, input, causality, gain_causality, outport, inport, - m_input, m_causality -SUCH THAT ( - (causality NEQ gain_causality) AND (outport = 2) - OR - (causality = gain_causality) AND (outport = 1) - ) -LET lsin(comp_type, gain_causality, gain, causality, outport, - input, causality, inport, - m_input, m_causality, 3) - = input/(sin(m_input)*gain); - -END;; DELETED mttroot/mtt/lib/cr/r/oneway.cr Index: mttroot/mtt/lib/cr/r/oneway.cr ================================================================== --- mttroot/mtt/lib/cr/r/oneway.cr +++ mttroot/mtt/lib/cr/r/oneway.cr @@ -1,26 +0,0 @@ -%SUMMARY oneway One way constitutive relationship eg Diode -%DESCRIPTION Parameter 1 is a large number being the forward gain -%DESCRIPTION -- the reciprocal is the backward gain -%DESCRIPTION The input must be an effort -%DESCRIPTION Typical use is an R component with effort input - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -OPERATOR oneway; - -%Input has flow causality -FOR ALL r, input -LET oneway(r, effort, 1, input, flow, 1) - = ((1 - sign(input))/2)*r*input; - -%Input has effort causality -FOR ALL r, input -LET oneway(r, flow, 1, input, effort, 1) - = ((1 - sign(input))/2)*(1/r)*input; - DELETED mttroot/mtt/lib/cr/r/polytrop.cr Index: mttroot/mtt/lib/cr/r/polytrop.cr ================================================================== --- mttroot/mtt/lib/cr/r/polytrop.cr +++ mttroot/mtt/lib/cr/r/polytrop.cr @@ -1,41 +0,0 @@ -%SUMMARY polytrop CR for gas turbine compressor - - -OPERATOR polytrop; - -% Port 1 generates zero flow -FOR ALL Ipressure,temperature,Fpressure,gamma,enthflow -LET polytrop(gamma, flow, 1, - Fpressure,effort,1, - enthflow,flow,2, - temperature,effort,3, - Ipressure,effort,4) - = 0; - -% Port 2 generates deltaT -FOR ALL Ipressure,temperature,Fpressure,gamma,enthflow -LET polytrop(gamma, effort, 2, - Fpressure,effort,1, - enthflow,flow,2, - temperature,effort,3, - Ipressure,effort,4) - = temperature*((Ipressure/Fpressure)^(gamma)-1); - -% Port 3 generates zero flow -FOR ALL Ipressure,temperature,Fpressure,gamma,enthflow -LET polytrop(gamma, flow, 3, - Fpressure,effort,1, - enthflow,flow,2, - temperature,effort,3, - Ipressure,effort,4) - = 0; - -% Port 4 generates zero flow -FOR ALL Ipressure,temperature,Fpressure,gamma,enthflow -LET polytrop(gamma, flow, 4, - Fpressure,effort,1, - enthflow,flow,2, - temperature,effort,3, - Ipressure,effort,4) - = 0; - DELETED mttroot/mtt/lib/cr/r/powerlaw.cr Index: mttroot/mtt/lib/cr/r/powerlaw.cr ================================================================== --- mttroot/mtt/lib/cr/r/powerlaw.cr +++ mttroot/mtt/lib/cr/r/powerlaw.cr @@ -1,26 +0,0 @@ -%SUMMARY powerlaw powerlaw constitutive relationship -%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 -%DESCRIPTION value is effort or flow -%DESCRIPTION Parameter 2 is the gain r corresponding to the causality of -%DESCRIPTION parameter 1. -%DESCRIPTION Supported components: - - -%DESCRIPTION single port components: R - -%Powerlaw Constitutive Relationship for single port components: R - - -OPERATOR powerlaw; -FOR ALL gain_causality, gain, power, causality, input, other_causality -SUCH THAT causality = gain_causality -LET powerlaw(gain_causality, gain, power, other_causality, 1, input, causality, 1) - = gain*(abs(input)^power)*sign(input); - - -FOR ALL gain_causality, gain, power, causality, input, other_causality -SUCH THAT causality NEQ gain_causality -LET powerlaw(gain_causality, gain, power, other_causality, 1, input, causality, 1) - = ( (abs(input)/gain)^(1/power) )*sign(input); - -END; DELETED mttroot/mtt/lib/cr/r/reed.cr Index: mttroot/mtt/lib/cr/r/reed.cr ================================================================== --- mttroot/mtt/lib/cr/r/reed.cr +++ mttroot/mtt/lib/cr/r/reed.cr @@ -1,40 +0,0 @@ -%SUMMARY reed Nonlinear 2-port R for musical reed component - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%% Model Transformation Tools %%%%% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Linear constitutive relationship. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/11/02 10:21:19 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/09/12 11:18:26 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Linear Constitutive Relationship for reed - unicausal case with -% pressure output. -OPERATOR reed,abs,sign; - -% Port 1 - the modulated R -FOR ALL D,q,H,airflow,displacement -LET reed(D,q,H, effort, 1, - airflow,flow,1, - displacement, effort,2) - = (D*sign(airflow)*(airflow)^q)/((H-displacement)^2); - -% Port 2 - zero flow -FOR ALL D,q,H,airflow,displacement -LET reed(D,q, flow, 2, - airflow,flow,1, - displacement, effort,2) - =0; - DELETED mttroot/mtt/lib/cr/r/sat_tank.cr Index: mttroot/mtt/lib/cr/r/sat_tank.cr ================================================================== --- mttroot/mtt/lib/cr/r/sat_tank.cr +++ mttroot/mtt/lib/cr/r/sat_tank.cr @@ -1,26 +0,0 @@ -%SUMMARY sat_tank Saturation nonlinearity with variable slopes for tank -%DESCRIPTION Parameter 1 is the slope of the "normal" linear part of the CR -%DESCRIPTION Parameter 2 is the "large" slope -%DESCRIPTION Parameter 3 is the lower bound of the state -%DESCRIPTION Parameter 4 is the upper bound of the state - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -OPERATOR sign0; -FOR ALL x - LET sign0(x) = (sign(x)+1)/2; - -OPERATOR sat_tank; -%Output has effort causality, input is state -FOR ALL k_0, k_1, x_0, x_1, x -LET sat_tank(k_0, k_1, x_0, x_1, effort, 1, - x, state, 1) - = x*k_0 + (x-x_1)*(k_1-k_0)*sign0(x-x_1) + (x-x_0)*(k_1-k_0)*sign0(x_0-x); - - DELETED mttroot/mtt/lib/cr/r/slcos.cr Index: mttroot/mtt/lib/cr/r/slcos.cr ================================================================== --- mttroot/mtt/lib/cr/r/slcos.cr +++ mttroot/mtt/lib/cr/r/slcos.cr @@ -1,29 +0,0 @@ -%SUMMARY slcos linear constitutive relationship with sin modulation - sensitivity -%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 -%DESCRIPTION value is effort, flow or state -%DESCRIPTION Parameter 2 is the gain corresponding to the causality of -%DESCRIPTION parameter 1. -%DESCRIPTION Supported components: - - -OPERATOR slcos; - -%DESCRIPTION four port component - effort i/o -FOR ALL gain, input, junk, m_input, dm_input -LET slcos(gain, effort, 2, - input, effort, 1, - junk, flow, 2, - m_input, effort, 3, - dm_input,effort, 4) - = -gain*sin(m_input)*dm_input*input; - -%DESCRIPTION four port component - flow i/o -FOR ALL gain, input, junk, m_input, dm_input -LET slcos(gain, flow, 2, - input, flow, 1, - junk, effort, 2, - m_input, effort, 3, - dm_input,effort, 4) - = -gain*sin(m_input)*dm_input*input; - -END;; DELETED mttroot/mtt/lib/cr/r/slin.cr Index: mttroot/mtt/lib/cr/r/slin.cr ================================================================== --- mttroot/mtt/lib/cr/r/slin.cr +++ mttroot/mtt/lib/cr/r/slin.cr @@ -1,71 +0,0 @@ -%DESCRIPTION Sensitivity version of lin - -in "$MTT_CRS/r/lin.cr"; - -% One port version for historical reasons -OPERATOR slin; -FOR ALL gain_causality, gain, causality, input, other_causality -LET slin(gain_causality, gain, other_causality, 1, input, causality, 1) - = lin(gain_causality, gain, other_causality, 1, input, - causality, 1); - -% Two port version for sC,sI,sR - -% Port 1 - standard -FOR ALL COMPONENT, gain_causality, gain, sgain, causality, input, sinput, other_causality -LET slin(COMPONENT,gain_causality, gain, sgain, other_causality, 1, - input, causality, 1, - sinput, causality, 2) - = lin(COMPONENT,gain_causality, gain, other_causality, 1, - input, causality, 1); - - -% Port 2 - sensitivity -FOR ALL COMPONENT, gain_causality, gain, sgain, causality, input, sinput, other_causality -SUCH THAT sgain NEQ 0 -LET slin(COMPONENT,gain_causality, gain, sgain, other_causality, 2, - input, causality, 1, - sinput, causality, 2) - = lin(COMPONENT,gain_causality, gain, other_causality, 1, - sinput, causality, 1) - + sgain*df(lin(COMPONENT,gain_causality, gain, other_causality, 1, - input, causality, 1), gain); - -%% Don't compute the derivative in this case -FOR ALL COMPONENT, gain_causality, gain, sgain, causality, input, sinput, other_causality -SUCH THAT sgain EQ 0 -LET slin(COMPONENT,gain_causality, gain, sgain, other_causality, 2, - input, causality, 1, - sinput, causality, 2) - = lin(COMPONENT,gain_causality, gain, other_causality, 1, - sinput, causality, 1); - - -%% This is the version to go with sEMTF -%% It is the CR passed to the AE3 components - -%DESCRIPTION four port component - effort i/o -FOR ALL COMPONENT, gain, input, junk, m_input, dm_input -LET slin(COMPONENT,gain, effort, 2, - input, effort, 1, - junk, flow, 2, - m_input, effort, 3, - dm_input,effort, 4) - = gain*dm_input*input; - -%DESCRIPTION four port component - flow i/o -FOR ALL COMPONENT, gain, input, junk, m_input, dm_input -LET slin(COMPONENT,gain, flow, 2, - input, flow, 1, - junk, effort, 2, - m_input, effort, 3, - dm_input,effort, 4) - = gain*dm_input*input; - -END;; - - - - - - DELETED mttroot/mtt/lib/cr/r/slsin.cr Index: mttroot/mtt/lib/cr/r/slsin.cr ================================================================== --- mttroot/mtt/lib/cr/r/slsin.cr +++ mttroot/mtt/lib/cr/r/slsin.cr @@ -1,29 +0,0 @@ -%SUMMARY slsin linear constitutive relationship with sin modulation - sensitivity -%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 -%DESCRIPTION value is effort, flow or state -%DESCRIPTION Parameter 2 is the gain corresponding to the causality of -%DESCRIPTION parameter 1. -%DESCRIPTION Supported components: - - -OPERATOR slsin; - -%DESCRIPTION four port component - effort i/o -FOR ALL gain, input, junk, m_input, dm_input -LET slsin(gain, effort, 2, - input, effort, 1, - junk, flow, 2, - m_input, effort, 3, - dm_input,effort, 4) - = gain*cos(m_input)*dm_input*input; - -%DESCRIPTION four port component - flow i/o -FOR ALL gain, input, junk, m_input, dm_input -LET slsin(gain, flow, 2, - input, flow, 1, - junk, effort, 2, - m_input, effort, 3, - dm_input,effort, 4) - = gain*cos(m_input)*dm_input*input; - -END;; DELETED mttroot/mtt/lib/cr/r/square.cr Index: mttroot/mtt/lib/cr/r/square.cr ================================================================== --- mttroot/mtt/lib/cr/r/square.cr +++ mttroot/mtt/lib/cr/r/square.cr @@ -1,31 +0,0 @@ -%SUMMARY square square-law constitutive relationship -%DESCRIPTION Parameter 1 defines input causality relating to parameter 2 -%DESCRIPTION value is effort or flow -%DESCRIPTION Parameter 2 is the gain r corresponding to the causality of -%DESCRIPTION parameter 1. -%DESCRIPTION Supported components: - - -%DESCRIPTION single port components: R - -%Square-Law Constitutive Relationship for single port components: R -% output = Gain*input^2*sign(input) {if gain_causality = causality} -% output = (1/Gain^(1/2))*input^(1/2)*sign(input) -% {if gain_causality not= causality} - - - -OPERATOR square; -FOR ALL gain_causality, gain, causality, input, other_causality -SUCH THAT causality = gain_causality -LET square(gain_causality, gain, other_causality, 1, input, causality, 1) - = gain*input^2*sign(input); - - -FOR ALL gain_causality, gain, causality, input, other_causality -SUCH THAT causality NEQ gain_causality -LET square(gain_causality, gain, other_causality, 1, input, causality, 1) - = input^(1/2)*sign(input)/(gain^(1/2)); - - -END; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Comb_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Comb_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Comb_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Comb_abg.m @@ -1,125 +0,0 @@ -function [Comb] = Comb_abg -# This function is the acausal bond graph representation of Comb -# Generated by MTT on Thu Mar 16 10:33:30 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port Hydraulic_in - Comb.ports.Hydraulic_in.type = "SS"; - Comb.ports.Hydraulic_in.cr = "SS"; - Comb.ports.Hydraulic_in.arg = "external,external"; - Comb.ports.Hydraulic_in.repetitions = 1; - Comb.ports.Hydraulic_in.status = -1; - Comb.ports.Hydraulic_in.connections = [-3 ]; - -# Port Hydraulic_out - Comb.ports.Hydraulic_out.type = "SS"; - Comb.ports.Hydraulic_out.cr = "SS"; - Comb.ports.Hydraulic_out.arg = "external,external"; - Comb.ports.Hydraulic_out.repetitions = 1; - Comb.ports.Hydraulic_out.status = -1; - Comb.ports.Hydraulic_out.connections = [7 ]; - -# Port Heat - Comb.ports.Heat.type = "SS"; - Comb.ports.Heat.cr = "SS"; - Comb.ports.Heat.arg = "external,external"; - Comb.ports.Heat.repetitions = 1; - Comb.ports.Heat.status = -1; - Comb.ports.Heat.connections = [-5 ]; - -# Port Thermal_in - Comb.ports.Thermal_in.type = "SS"; - Comb.ports.Thermal_in.cr = "SS"; - Comb.ports.Thermal_in.arg = "external,external"; - Comb.ports.Thermal_in.repetitions = 1; - Comb.ports.Thermal_in.status = -1; - Comb.ports.Thermal_in.connections = [-2 ]; - -# Port Thermal_out - Comb.ports.Thermal_out.type = "SS"; - Comb.ports.Thermal_out.cr = "SS"; - Comb.ports.Thermal_out.arg = "external,external"; - Comb.ports.Thermal_out.repetitions = 1; - Comb.ports.Thermal_out.status = -1; - Comb.ports.Thermal_out.connections = [6 ]; - -# Component P - Comb.subsystems.P.type = "SS"; - Comb.subsystems.P.cr = "SS"; - Comb.subsystems.P.arg = "external,0"; - Comb.subsystems.P.repetitions = 1; - Comb.subsystems.P.status = -1; - Comb.subsystems.P.connections = [9 ]; - -# Component T - Comb.subsystems.T.type = "SS"; - Comb.subsystems.T.cr = "SS"; - Comb.subsystems.T.arg = "external,0"; - Comb.subsystems.T.repetitions = 1; - Comb.subsystems.T.status = -1; - Comb.subsystems.T.connections = [8 ]; - -# Component pipe - Comb.subsystems.pipe.type = "hPipe"; - Comb.subsystems.pipe.cr = "none"; - Comb.subsystems.pipe.arg = "m_c;v_c;r"; - Comb.subsystems.pipe.repetitions = 1; - Comb.subsystems.pipe.status = -1; - Comb.subsystems.pipe.connections = [5 3 -4 2 -1 ]; - -# Component mtt1 - Comb.subsystems.mtt1.type = "0"; - Comb.subsystems.mtt1.cr = ""; - Comb.subsystems.mtt1.arg = ""; - Comb.subsystems.mtt1.repetitions = 1; - Comb.subsystems.mtt1.status = -1; - Comb.subsystems.mtt1.connections = [1 -6 -8 ]; - -# Component mtt2 - Comb.subsystems.mtt2.type = "0"; - Comb.subsystems.mtt2.cr = ""; - Comb.subsystems.mtt2.arg = ""; - Comb.subsystems.mtt2.repetitions = 1; - Comb.subsystems.mtt2.status = -1; - Comb.subsystems.mtt2.connections = [4 -7 -9 ]; - -# Ordered list of Port names - Comb.portlist(1,:) = "Hydraulic_in "; - Comb.portlist(2,:) = "Hydraulic_out"; - Comb.portlist(3,:) = "Heat "; - Comb.portlist(4,:) = "Thermal_in "; - Comb.portlist(5,:) = "Thermal_out "; - -# Ordered list of subsystem names - Comb.subsystemlist(1,:) = "P "; - Comb.subsystemlist(2,:) = "T "; - Comb.subsystemlist(3,:) = "pipe"; - Comb.subsystemlist(4,:) = "mtt1"; - Comb.subsystemlist(5,:) = "mtt2"; - -# Bonds - Comb.bonds = [ - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 1 1 - 1 1 - ]; - -# Aliases -# A double underscore __ represents a comma -Comb.alias.out = "Thermal_out,Hydraulic_out"; -Comb.alias.Hy_out = "Hydraulic_out"; -Comb.alias.v_c = "$2"; -Comb.alias.Th_in = "Thermal_in"; -Comb.alias.r = "$3"; -Comb.alias.Th_out = "Thermal_out"; -Comb.alias.in = "Thermal_in,Hydraulic_in"; -Comb.alias.Hy_in = "Hydraulic_in"; -Comb.alias.m_c = "$1"; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_abg.m @@ -1,81 +0,0 @@ -function [Density] = Density_abg -# This function is the acausal bond graph representation of Density -# Generated by MTT on Thu Mar 16 10:36:39 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port Pressure - Density.ports.Pressure.type = "SS"; - Density.ports.Pressure.cr = "SS"; - Density.ports.Pressure.arg = "external,external"; - Density.ports.Pressure.repetitions = 1; - Density.ports.Pressure.status = -1; - Density.ports.Pressure.connections = [-4 ]; - -# Port Temperature - Density.ports.Temperature.type = "SS"; - Density.ports.Temperature.cr = "SS"; - Density.ports.Temperature.arg = "external,external"; - Density.ports.Temperature.repetitions = 1; - Density.ports.Temperature.status = -1; - Density.ports.Temperature.connections = [-5 ]; - -# Port Density - Density.ports.Density.type = "SS"; - Density.ports.Density.cr = "SS"; - Density.ports.Density.arg = "external,external"; - Density.ports.Density.repetitions = 1; - Density.ports.Density.status = -1; - Density.ports.Density.connections = [3 ]; - -# Component r - Density.subsystems.r.type = "R"; - Density.subsystems.r.cr = "Density"; - Density.subsystems.r.arg = "density,ideal_gas,r"; - Density.subsystems.r.repetitions = 1; - Density.subsystems.r.status = -1; - Density.subsystems.r.connections = [1 2 -3 ]; - -# Component mtt1 - Density.subsystems.mtt1.type = "AE"; - Density.subsystems.mtt1.cr = ""; - Density.subsystems.mtt1.arg = ""; - Density.subsystems.mtt1.repetitions = 1; - Density.subsystems.mtt1.status = -1; - Density.subsystems.mtt1.connections = [4 -1 ]; - -# Component mtt2 - Density.subsystems.mtt2.type = "AE"; - Density.subsystems.mtt2.cr = ""; - Density.subsystems.mtt2.arg = ""; - Density.subsystems.mtt2.repetitions = 1; - Density.subsystems.mtt2.status = -1; - Density.subsystems.mtt2.connections = [5 -2 ]; - -# Ordered list of Port names - Density.portlist(1,:) = "Pressure "; - Density.portlist(2,:) = "Temperature"; - Density.portlist(3,:) = "Density "; - -# Ordered list of subsystem names - Density.subsystemlist(1,:) = "r "; - Density.subsystemlist(2,:) = "mtt1"; - Density.subsystemlist(3,:) = "mtt2"; - -# Bonds - Density.bonds = [ - 1 1 - 1 1 - 1 1 - 0 0 - 0 0 - ]; - -# Aliases -# A double underscore __ represents a comma -Density.alias.P = "Pressure"; -Density.alias.out = "Density"; -Density.alias.rho = "Density"; -Density.alias.T = "Temperature"; -Density.alias.density__ideal_gas__r = "$1"; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_cr.r Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_cr.r ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_cr.r +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Density_cr.r @@ -1,36 +0,0 @@ -% Constitutive relation file for Density (Density_cr.r) -% Generated by MTT at Wed Mar 11 11:01:28 GMT 1998 - -OPERATOR Density; - -% Ideal gas -FOR ALL R,Temperature,Pressure,Nothing -LET Density(density,ideal_gas,R,effort,3, - Pressure,effort,1, - Temperature,effort,2, - Nothing,flow,3 - ) = Pressure/(R*Temperature); - -FOR ALL R,Temperature,Pressure,Nothing -LET Density(specific_volume,ideal_gas,R,effort,3, - Pressure,effort,1, - Temperature,effort,2, - Nothing,flow,3 - ) = (R*Temperature)/Pressure; - -% Incompressible -FOR ALL rho,Temperature,Pressure,Nothing -LET Density(density,incompressible,rho,effort,3, - Pressure,effort,1, - Temperature,effort,2, - Nothing,flow,3 - ) = rho; - -FOR ALL rho,Temperature,Pressure,Nothing -LET Density(specific_volume,incompressible,rho,effort,3, - Pressure,effort,1, - Temperature,effort,2, - Nothing,flow,3 - ) = 1/rho; - -END; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/In_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/In_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/In_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/In_abg.m @@ -1,57 +0,0 @@ -function [In] = In_abg -# This function is the acausal bond graph representation of In -# Generated by MTT on Thu Mar 16 10:33:58 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port Hy_out - In.ports.Hy_out.type = "SS"; - In.ports.Hy_out.cr = "SS"; - In.ports.Hy_out.arg = "external,external"; - In.ports.Hy_out.repetitions = 1; - In.ports.Hy_out.status = -1; - In.ports.Hy_out.connections = [2 ]; - -# Port Th_out - In.ports.Th_out.type = "SS"; - In.ports.Th_out.cr = "SS"; - In.ports.Th_out.arg = "external,external"; - In.ports.Th_out.repetitions = 1; - In.ports.Th_out.status = -1; - In.ports.Th_out.connections = [1 ]; - -# Component Hy_in - In.subsystems.Hy_in.type = "SS"; - In.subsystems.Hy_in.cr = "SS"; - In.subsystems.Hy_in.arg = "p_1,internal"; - In.subsystems.Hy_in.repetitions = 1; - In.subsystems.Hy_in.status = -1; - In.subsystems.Hy_in.connections = [-2 ]; - -# Component Th_in - In.subsystems.Th_in.type = "SS"; - In.subsystems.Th_in.cr = "SS"; - In.subsystems.Th_in.arg = "t_1,internal"; - In.subsystems.Th_in.repetitions = 1; - In.subsystems.Th_in.status = -1; - In.subsystems.Th_in.connections = [-1 ]; - -# Ordered list of Port names - In.portlist(1,:) = "Hy_out"; - In.portlist(2,:) = "Th_out"; - -# Ordered list of subsystem names - In.subsystemlist(1,:) = "Hy_in"; - In.subsystemlist(2,:) = "Th_in"; - -# Bonds - In.bonds = [ - 1 1 - 1 1 - ]; - -# Aliases -# A double underscore __ represents a comma -In.alias.out = "Th_out,Hy_out"; -In.alias.in = "Th_out,Hy_out"; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/In_desc.tex Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/In_desc.tex ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/In_desc.tex +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/In_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system In (In_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:36 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{In} is - displayed in Figure \Ref{In_abg} and its label - file is listed in Section \Ref{sec:In_lbl}. - The subsystems are listed in Section \Ref{sec:In_sub}. DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Load_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Load_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Load_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Load_abg.m @@ -1,60 +0,0 @@ -function [Load] = Load_abg -# This function is the acausal bond graph representation of Load -# Generated by MTT on Thu Mar 16 10:34:27 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port in - Load.ports.in.type = "SS"; - Load.ports.in.cr = "SS"; - Load.ports.in.arg = "external,external"; - Load.ports.in.repetitions = 1; - Load.ports.in.status = -1; - Load.ports.in.connections = [-1 ]; - -# Port out - Load.ports.out.type = "SS"; - Load.ports.out.cr = "SS"; - Load.ports.out.arg = "external,external"; - Load.ports.out.repetitions = 1; - Load.ports.out.status = -1; - Load.ports.out.connections = [3 ]; - -# Component PowerSensor - Load.subsystems.PowerSensor.type = "PS"; - Load.subsystems.PowerSensor.cr = ""; - Load.subsystems.PowerSensor.arg = ""; - Load.subsystems.PowerSensor.repetitions = 1; - Load.subsystems.PowerSensor.status = -1; - Load.subsystems.PowerSensor.connections = [1 -2 -3 ]; - -# Component r_l - Load.subsystems.r_l.type = "R"; - Load.subsystems.r_l.cr = "lin"; - Load.subsystems.r_l.arg = "flow,r_l"; - Load.subsystems.r_l.repetitions = 1; - Load.subsystems.r_l.status = -1; - Load.subsystems.r_l.connections = [2 ]; - -# Ordered list of Port names - Load.portlist(1,:) = "in "; - Load.portlist(2,:) = "out"; - -# Ordered list of subsystem names - Load.subsystemlist(1,:) = "PowerSensor"; - Load.subsystemlist(2,:) = "r_l "; - -# Bonds - Load.bonds = [ - 0 0 - 0 0 - 0 0 - ]; - -# Aliases -# A double underscore __ represents a comma -Load.alias.out = "out"; -Load.alias.r_l = "$2"; -Load.alias.in = "in"; -Load.alias.PowerSensor = "$1"; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_abg.m @@ -1,56 +0,0 @@ -function [Out] = Out_abg -# This function is the acausal bond graph representation of Out -# Generated by MTT on Thu Mar 16 10:34:51 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port Hy_in - Out.ports.Hy_in.type = "SS"; - Out.ports.Hy_in.cr = "SS"; - Out.ports.Hy_in.arg = "external,external"; - Out.ports.Hy_in.repetitions = 1; - Out.ports.Hy_in.status = -1; - Out.ports.Hy_in.connections = [-1 ]; - -# Port Th_in - Out.ports.Th_in.type = "SS"; - Out.ports.Th_in.cr = "SS"; - Out.ports.Th_in.arg = "external,external"; - Out.ports.Th_in.repetitions = 1; - Out.ports.Th_in.status = -1; - Out.ports.Th_in.connections = [-2 ]; - -# Component Hy_out - Out.subsystems.Hy_out.type = "SS"; - Out.subsystems.Hy_out.cr = "SS"; - Out.subsystems.Hy_out.arg = "p_1,internal"; - Out.subsystems.Hy_out.repetitions = 1; - Out.subsystems.Hy_out.status = -1; - Out.subsystems.Hy_out.connections = [1 ]; - -# Component Th_out - Out.subsystems.Th_out.type = "SS"; - Out.subsystems.Th_out.cr = "SS"; - Out.subsystems.Th_out.arg = "t_1,internal"; - Out.subsystems.Th_out.repetitions = 1; - Out.subsystems.Th_out.status = -1; - Out.subsystems.Th_out.connections = [2 ]; - -# Ordered list of Port names - Out.portlist(1,:) = "Hy_in"; - Out.portlist(2,:) = "Th_in"; - -# Ordered list of subsystem names - Out.subsystemlist(1,:) = "Hy_out"; - Out.subsystemlist(2,:) = "Th_out"; - -# Bonds - Out.bonds = [ - -1 -1 - -1 -1 - ]; - -# Aliases -# A double underscore __ represents a comma -Out.alias.in = "Th_in,Hy_in"; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_desc.tex Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_desc.tex ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_desc.tex +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Out_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system Out (Out_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:44 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Out} is - displayed in Figure \Ref{Out_abg} and its label - file is listed in Section \Ref{sec:Out_lbl}. - The subsystems are listed in Section \Ref{sec:Out_sub}. DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_abg.m @@ -1,122 +0,0 @@ -function [Poly] = Poly_abg -# This function is the acausal bond graph representation of Poly -# Generated by MTT on Thu Mar 16 10:35:48 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port Pressure_1 - Poly.ports.Pressure_1.type = "SS"; - Poly.ports.Pressure_1.cr = "SS"; - Poly.ports.Pressure_1.arg = "external,external"; - Poly.ports.Pressure_1.repetitions = 1; - Poly.ports.Pressure_1.status = -1; - Poly.ports.Pressure_1.connections = [-2 ]; - -# Port Temperature_1 - Poly.ports.Temperature_1.type = "SS"; - Poly.ports.Temperature_1.cr = "SS"; - Poly.ports.Temperature_1.arg = "external,external"; - Poly.ports.Temperature_1.repetitions = 1; - Poly.ports.Temperature_1.status = -1; - Poly.ports.Temperature_1.connections = [-6 ]; - -# Port Pressure_2 - Poly.ports.Pressure_2.type = "SS"; - Poly.ports.Pressure_2.cr = "SS"; - Poly.ports.Pressure_2.arg = "external,external"; - Poly.ports.Pressure_2.repetitions = 1; - Poly.ports.Pressure_2.status = -1; - Poly.ports.Pressure_2.connections = [-4 ]; - -# Port Temperature_2 - Poly.ports.Temperature_2.type = "SS"; - Poly.ports.Temperature_2.cr = "SS"; - Poly.ports.Temperature_2.arg = "external,external"; - Poly.ports.Temperature_2.repetitions = 1; - Poly.ports.Temperature_2.status = -1; - Poly.ports.Temperature_2.connections = [8 ]; - -# Component r - Poly.subsystems.r.type = "R"; - Poly.subsystems.r.cr = "Poly"; - Poly.subsystems.r.arg = "alpha"; - Poly.subsystems.r.repetitions = 1; - Poly.subsystems.r.status = -1; - Poly.subsystems.r.connections = [1 3 5 -7 ]; - -# Component zero - Poly.subsystems.zero.type = "SS"; - Poly.subsystems.zero.cr = "SS"; - Poly.subsystems.zero.arg = "0,0"; - Poly.subsystems.zero.repetitions = 1; - Poly.subsystems.zero.status = -1; - Poly.subsystems.zero.connections = [-9 ]; - -# Component mtt1 - Poly.subsystems.mtt1.type = "AE"; - Poly.subsystems.mtt1.cr = ""; - Poly.subsystems.mtt1.arg = ""; - Poly.subsystems.mtt1.repetitions = 1; - Poly.subsystems.mtt1.status = -1; - Poly.subsystems.mtt1.connections = [2 -1 ]; - -# Component mtt2 - Poly.subsystems.mtt2.type = "AE"; - Poly.subsystems.mtt2.cr = ""; - Poly.subsystems.mtt2.arg = ""; - Poly.subsystems.mtt2.repetitions = 1; - Poly.subsystems.mtt2.status = -1; - Poly.subsystems.mtt2.connections = [4 -3 ]; - -# Component mtt3 - Poly.subsystems.mtt3.type = "AE"; - Poly.subsystems.mtt3.cr = ""; - Poly.subsystems.mtt3.arg = ""; - Poly.subsystems.mtt3.repetitions = 1; - Poly.subsystems.mtt3.status = -1; - Poly.subsystems.mtt3.connections = [6 -5 ]; - -# Component mtt4 - Poly.subsystems.mtt4.type = "1"; - Poly.subsystems.mtt4.cr = ""; - Poly.subsystems.mtt4.arg = ""; - Poly.subsystems.mtt4.repetitions = 1; - Poly.subsystems.mtt4.status = -1; - Poly.subsystems.mtt4.connections = [7 -8 9 ]; - -# Ordered list of Port names - Poly.portlist(1,:) = "Pressure_1 "; - Poly.portlist(2,:) = "Temperature_1"; - Poly.portlist(3,:) = "Pressure_2 "; - Poly.portlist(4,:) = "Temperature_2"; - -# Ordered list of subsystem names - Poly.subsystemlist(1,:) = "r "; - Poly.subsystemlist(2,:) = "zero"; - Poly.subsystemlist(3,:) = "mtt1"; - Poly.subsystemlist(4,:) = "mtt2"; - Poly.subsystemlist(5,:) = "mtt3"; - Poly.subsystemlist(6,:) = "mtt4"; - -# Bonds - Poly.bonds = [ - 1 1 - 0 0 - 1 1 - 0 0 - 1 1 - 0 0 - 0 0 - 0 0 - 1 -1 - ]; - -# Aliases -# A double underscore __ represents a comma -Poly.alias.out = "Temperature_2"; -Poly.alias.P1 = "Pressure_1"; -Poly.alias.P2 = "Pressure_2"; -Poly.alias.T1 = "Temperature_1"; -Poly.alias.T2 = "Temperature_2"; -Poly.alias.alpha = "$1"; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_cr.r Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_cr.r ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_cr.r +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Poly_cr.r @@ -1,19 +0,0 @@ -% Constitutive relation file for Poly (Poly_cr.r) -% Generated by MTT at Wed Mar 11 11:01:28 GMT 1998 - -OPERATOR Poly; - -% Ideal gas - -% Temperature output on port [T2] -FOR ALL alpha,P1,P2,T1,Nothing -LET Poly(alpha,effort,4, - P1,effort,1, - P2,effort,2, - T1,effort,3, - Nothing,flow,4 - ) = T1*(P2/P1)^alpha; - - - -END; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Pump_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Pump_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Pump_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/Pump_abg.m @@ -1,180 +0,0 @@ -function [Pump] = Pump_abg -# This function is the acausal bond graph representation of Pump -# Generated by MTT on Thu Mar 16 10:38:10 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port Hydraulic_in - Pump.ports.Hydraulic_in.type = "SS"; - Pump.ports.Hydraulic_in.cr = "SS"; - Pump.ports.Hydraulic_in.arg = "external,external"; - Pump.ports.Hydraulic_in.repetitions = 1; - Pump.ports.Hydraulic_in.status = -1; - Pump.ports.Hydraulic_in.connections = [-5 ]; - -# Port Hydraulic_out - Pump.ports.Hydraulic_out.type = "SS"; - Pump.ports.Hydraulic_out.cr = "SS"; - Pump.ports.Hydraulic_out.arg = "external,external"; - Pump.ports.Hydraulic_out.repetitions = 1; - Pump.ports.Hydraulic_out.status = -1; - Pump.ports.Hydraulic_out.connections = [6 ]; - -# Port Shaft - Pump.ports.Shaft.type = "SS"; - Pump.ports.Shaft.cr = "SS"; - Pump.ports.Shaft.arg = "external,external"; - Pump.ports.Shaft.repetitions = 1; - Pump.ports.Shaft.status = -1; - Pump.ports.Shaft.connections = [-12 ]; - -# Port Thermal_in - Pump.ports.Thermal_in.type = "SS"; - Pump.ports.Thermal_in.cr = "SS"; - Pump.ports.Thermal_in.arg = "external,external"; - Pump.ports.Thermal_in.repetitions = 1; - Pump.ports.Thermal_in.status = -1; - Pump.ports.Thermal_in.connections = [-4 ]; - -# Port Thermal_out - Pump.ports.Thermal_out.type = "SS"; - Pump.ports.Thermal_out.cr = "SS"; - Pump.ports.Thermal_out.arg = "external,external"; - Pump.ports.Thermal_out.repetitions = 1; - Pump.ports.Thermal_out.status = -1; - Pump.ports.Thermal_out.connections = [16 ]; - -# Component pipe - Pump.subsystems.pipe.type = "wPipe"; - Pump.subsystems.pipe.cr = "none"; - Pump.subsystems.pipe.arg = "c_v;density,ideal_gas,r"; - Pump.subsystems.pipe.repetitions = 1; - Pump.subsystems.pipe.status = -1; - Pump.subsystems.pipe.connections = [3 -7 14 2 -1 ]; - -# Component poly - Pump.subsystems.poly.type = "Poly"; - Pump.subsystems.poly.cr = "Poly"; - Pump.subsystems.poly.arg = "alpha"; - Pump.subsystems.poly.repetitions = 1; - Pump.subsystems.poly.status = -1; - Pump.subsystems.poly.connections = [9 8 11 -10 ]; - -# Component T - Pump.subsystems.T.type = "SS"; - Pump.subsystems.T.cr = "SS"; - Pump.subsystems.T.arg = "external,0"; - Pump.subsystems.T.repetitions = 1; - Pump.subsystems.T.status = -1; - Pump.subsystems.T.connections = [17 ]; - -# Component k_p - Pump.subsystems.k_p.type = "TF"; - Pump.subsystems.k_p.cr = "lin"; - Pump.subsystems.k_p.arg = "flow,k_p"; - Pump.subsystems.k_p.repetitions = 1; - Pump.subsystems.k_p.status = -1; - Pump.subsystems.k_p.connections = [13 -14 ]; - -# Component mtt1 - Pump.subsystems.mtt1.type = "0"; - Pump.subsystems.mtt1.cr = ""; - Pump.subsystems.mtt1.arg = ""; - Pump.subsystems.mtt1.repetitions = 1; - Pump.subsystems.mtt1.status = -1; - Pump.subsystems.mtt1.connections = [1 10 -15 -17 ]; - -# Component mtt2 - Pump.subsystems.mtt2.type = "0"; - Pump.subsystems.mtt2.cr = ""; - Pump.subsystems.mtt2.arg = ""; - Pump.subsystems.mtt2.repetitions = 1; - Pump.subsystems.mtt2.status = -1; - Pump.subsystems.mtt2.connections = [-6 7 -11 ]; - -# Component mtt3 - Pump.subsystems.mtt3.type = "0"; - Pump.subsystems.mtt3.cr = ""; - Pump.subsystems.mtt3.arg = ""; - Pump.subsystems.mtt3.repetitions = 1; - Pump.subsystems.mtt3.status = -1; - Pump.subsystems.mtt3.connections = [-3 5 -9 ]; - -# Component mtt4 - Pump.subsystems.mtt4.type = "0"; - Pump.subsystems.mtt4.cr = ""; - Pump.subsystems.mtt4.arg = ""; - Pump.subsystems.mtt4.repetitions = 1; - Pump.subsystems.mtt4.status = -1; - Pump.subsystems.mtt4.connections = [-2 4 -8 ]; - -# Component mtt5 - Pump.subsystems.mtt5.type = "EBTF"; - Pump.subsystems.mtt5.cr = ""; - Pump.subsystems.mtt5.arg = ""; - Pump.subsystems.mtt5.repetitions = 1; - Pump.subsystems.mtt5.status = -1; - Pump.subsystems.mtt5.connections = [15 -16 ]; - -# Component mtt6 - Pump.subsystems.mtt6.type = "1"; - Pump.subsystems.mtt6.cr = ""; - Pump.subsystems.mtt6.arg = ""; - Pump.subsystems.mtt6.repetitions = 1; - Pump.subsystems.mtt6.status = -1; - Pump.subsystems.mtt6.connections = [12 -13 ]; - -# Ordered list of Port names - Pump.portlist(1,:) = "Hydraulic_in "; - Pump.portlist(2,:) = "Hydraulic_out"; - Pump.portlist(3,:) = "Shaft "; - Pump.portlist(4,:) = "Thermal_in "; - Pump.portlist(5,:) = "Thermal_out "; - -# Ordered list of subsystem names - Pump.subsystemlist(1,:) = "pipe"; - Pump.subsystemlist(2,:) = "poly"; - Pump.subsystemlist(3,:) = "T "; - Pump.subsystemlist(4,:) = "k_p "; - Pump.subsystemlist(5,:) = "mtt1"; - Pump.subsystemlist(6,:) = "mtt2"; - Pump.subsystemlist(7,:) = "mtt3"; - Pump.subsystemlist(8,:) = "mtt4"; - Pump.subsystemlist(9,:) = "mtt5"; - Pump.subsystemlist(10,:) = "mtt6"; - -# Bonds - Pump.bonds = [ - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - -1 -1 - 0 0 - 0 0 - 0 0 - 0 0 - 1 1 - ]; - -# Aliases -# A double underscore __ represents a comma -Pump.alias.out = "Thermal_out,Hydraulic_out"; -Pump.alias.Hy_out = "Hydraulic_out"; -Pump.alias.c_v = "$1"; -Pump.alias.flow__k_p = "$4"; -Pump.alias.Th_in = "Thermal_in"; -Pump.alias.Th_out = "Thermal_out"; -Pump.alias.Work = "Shaft"; -Pump.alias.alpha = "$3"; -Pump.alias.in = "Thermal_in,Hydraulic_in"; -Pump.alias.Hy_in = "Hydraulic_in"; -Pump.alias.density__ideal_gas__r = "$2"; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_abg.m @@ -1,165 +0,0 @@ -function [SimpleGasTurbineABG] = SimpleGasTurbineABG_abg -# This function is the acausal bond graph representation of SimpleGasTurbineABG -# Generated by MTT on Thu Mar 16 12:59:12 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Component c1 - SimpleGasTurbineABG.subsystems.c1.type = "Comb"; - SimpleGasTurbineABG.subsystems.c1.cr = "none"; - SimpleGasTurbineABG.subsystems.c1.arg = "m_c;v_c;r"; - SimpleGasTurbineABG.subsystems.c1.repetitions = 1; - SimpleGasTurbineABG.subsystems.c1.status = -1; - SimpleGasTurbineABG.subsystems.c1.connections = [14 -15 7 10 -11 ]; - -# Component j_s - SimpleGasTurbineABG.subsystems.j_s.type = "I"; - SimpleGasTurbineABG.subsystems.j_s.cr = "lin"; - SimpleGasTurbineABG.subsystems.j_s.arg = "flow,j_s"; - SimpleGasTurbineABG.subsystems.j_s.repetitions = 1; - SimpleGasTurbineABG.subsystems.j_s.status = -1; - SimpleGasTurbineABG.subsystems.j_s.connections = [2 ]; - -# Component comp - SimpleGasTurbineABG.subsystems.comp.type = "Pump"; - SimpleGasTurbineABG.subsystems.comp.cr = "none"; - SimpleGasTurbineABG.subsystems.comp.arg = "c_v;density,ideal_gas,r;alpha;effort,k"; - SimpleGasTurbineABG.subsystems.comp.repetitions = 1; - SimpleGasTurbineABG.subsystems.comp.status = -1; - SimpleGasTurbineABG.subsystems.comp.connections = [16 -14 1 12 -10 ]; - -# Component turb - SimpleGasTurbineABG.subsystems.turb.type = "Pump"; - SimpleGasTurbineABG.subsystems.turb.cr = "none"; - SimpleGasTurbineABG.subsystems.turb.arg = "c_v;density,ideal_gas,r;alpha;effort,k"; - SimpleGasTurbineABG.subsystems.turb.repetitions = 1; - SimpleGasTurbineABG.subsystems.turb.status = -1; - SimpleGasTurbineABG.subsystems.turb.connections = [15 -17 -6 11 -13 ]; - -# Component Work - SimpleGasTurbineABG.subsystems.Work.type = "SS"; - SimpleGasTurbineABG.subsystems.Work.cr = "SS"; - SimpleGasTurbineABG.subsystems.Work.arg = "0,external"; - SimpleGasTurbineABG.subsystems.Work.repetitions = 1; - SimpleGasTurbineABG.subsystems.Work.status = -1; - SimpleGasTurbineABG.subsystems.Work.connections = [4 ]; - -# Component Heat - SimpleGasTurbineABG.subsystems.Heat.type = "SS"; - SimpleGasTurbineABG.subsystems.Heat.cr = "SS"; - SimpleGasTurbineABG.subsystems.Heat.arg = "0,external"; - SimpleGasTurbineABG.subsystems.Heat.repetitions = 1; - SimpleGasTurbineABG.subsystems.Heat.status = -1; - SimpleGasTurbineABG.subsystems.Heat.connections = [9 ]; - -# Component Speed - SimpleGasTurbineABG.subsystems.Speed.type = "SS"; - SimpleGasTurbineABG.subsystems.Speed.cr = "SS"; - SimpleGasTurbineABG.subsystems.Speed.arg = "0,external"; - SimpleGasTurbineABG.subsystems.Speed.repetitions = 1; - SimpleGasTurbineABG.subsystems.Speed.status = -1; - SimpleGasTurbineABG.subsystems.Speed.connections = [5 ]; - -# Component T3 - SimpleGasTurbineABG.subsystems.T3.type = "SS"; - SimpleGasTurbineABG.subsystems.T3.cr = "SS"; - SimpleGasTurbineABG.subsystems.T3.arg = "external,external"; - SimpleGasTurbineABG.subsystems.T3.repetitions = 1; - SimpleGasTurbineABG.subsystems.T3.status = -1; - SimpleGasTurbineABG.subsystems.T3.connections = [-8 ]; - -# Component in - SimpleGasTurbineABG.subsystems.in.type = "In"; - SimpleGasTurbineABG.subsystems.in.cr = ""; - SimpleGasTurbineABG.subsystems.in.arg = ""; - SimpleGasTurbineABG.subsystems.in.repetitions = 1; - SimpleGasTurbineABG.subsystems.in.status = -1; - SimpleGasTurbineABG.subsystems.in.connections = [-16 -12 ]; - -# Component out - SimpleGasTurbineABG.subsystems.out.type = "Out"; - SimpleGasTurbineABG.subsystems.out.cr = ""; - SimpleGasTurbineABG.subsystems.out.arg = ""; - SimpleGasTurbineABG.subsystems.out.repetitions = 1; - SimpleGasTurbineABG.subsystems.out.status = -1; - SimpleGasTurbineABG.subsystems.out.connections = [17 13 ]; - -# Component mtt1 - SimpleGasTurbineABG.subsystems.mtt1.type = "1"; - SimpleGasTurbineABG.subsystems.mtt1.cr = ""; - SimpleGasTurbineABG.subsystems.mtt1.arg = ""; - SimpleGasTurbineABG.subsystems.mtt1.repetitions = 1; - SimpleGasTurbineABG.subsystems.mtt1.status = -1; - SimpleGasTurbineABG.subsystems.mtt1.connections = [-1 -2 -3 -5 6 ]; - -# Component mtt2 - SimpleGasTurbineABG.subsystems.mtt2.type = "Load"; - SimpleGasTurbineABG.subsystems.mtt2.cr = ""; - SimpleGasTurbineABG.subsystems.mtt2.arg = ""; - SimpleGasTurbineABG.subsystems.mtt2.repetitions = 1; - SimpleGasTurbineABG.subsystems.mtt2.status = -1; - SimpleGasTurbineABG.subsystems.mtt2.connections = [3 -4 ]; - -# Component mtt3 - SimpleGasTurbineABG.subsystems.mtt3.type = "PS"; - SimpleGasTurbineABG.subsystems.mtt3.cr = ""; - SimpleGasTurbineABG.subsystems.mtt3.arg = ""; - SimpleGasTurbineABG.subsystems.mtt3.repetitions = 1; - SimpleGasTurbineABG.subsystems.mtt3.status = -1; - SimpleGasTurbineABG.subsystems.mtt3.connections = [8 -7 -9 ]; - -# Ordered list of subsystem names - SimpleGasTurbineABG.subsystemlist(1,:) = "c1 "; - SimpleGasTurbineABG.subsystemlist(2,:) = "j_s "; - SimpleGasTurbineABG.subsystemlist(3,:) = "comp "; - SimpleGasTurbineABG.subsystemlist(4,:) = "turb "; - SimpleGasTurbineABG.subsystemlist(5,:) = "Work "; - SimpleGasTurbineABG.subsystemlist(6,:) = "Heat "; - SimpleGasTurbineABG.subsystemlist(7,:) = "Speed"; - SimpleGasTurbineABG.subsystemlist(8,:) = "T3 "; - SimpleGasTurbineABG.subsystemlist(9,:) = "in "; - SimpleGasTurbineABG.subsystemlist(10,:) = "out "; - SimpleGasTurbineABG.subsystemlist(11,:) = "mtt1 "; - SimpleGasTurbineABG.subsystemlist(12,:) = "mtt2 "; - SimpleGasTurbineABG.subsystemlist(13,:) = "mtt3 "; - -# Bonds - SimpleGasTurbineABG.bonds = [ - 0 0 - 1 1 - 0 0 - -1 -1 - -1 -1 - 0 0 - 0 0 - 1 1 - -1 -1 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - ]; - -# Aliases -# A double underscore __ represents a comma -# Explicit variable declarations -#VAR t_2 -#VAR t_3 -#VAR t_4 -#VAR p_2 -#VAR p_3 -#VAR p_4 -#VAR mdot -#VAR gamma_0 -#VAR q_0 -#VAR w_0 -#VAR omega_0 -#VAR r_p -#VAR c_p -#VAR mom_0 -endfunction DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_desc.tex Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_desc.tex ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_desc.tex +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_desc.tex @@ -1,123 +0,0 @@ -% -*-latex-*- used to set EMACS into LaTeX-mode -% Verbal description for system SimpleGasTurbineABG (SimpleGasTurbineABG_desc.tex) -% Generated by MTT on Tue Jan 13 18:01:55 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/05/18 15:45:50 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{SimpleGasTurbineABG} is - displayed in Figure \Ref{SimpleGasTurbineABG_abg} and its label - file is listed in Section \Ref{sec:SimpleGasTurbineABG_lbl}. - The subsystems are listed in Section \Ref{sec:SimpleGasTurbineABG_sub}. - - \textbf{SimpleGasTurbineABG} can be regarded as an single-spool gas - turbine (producing shaft power) with an ideal-gas working fluid. It - corresponds to the simple Joule Cycle as described in Chapter 12 of - Rogers and Mayhew and in Chapter 2 of Cohen, Rogers and - Saravanamutto. However, unlike those examples, the system is - written with dynamics in mind. - - The system is described using an energy Bond Graph- this ensures - that the first law is observed. In particular transformers are used - to explicitly convert between energy covariables. Although this is - a simple model, I believe that it provides the basis for building - complex thermodynamic systems involving gas power cycles. - - -There are five main components: -\begin{enumerate} -\item p1 -- a \textbf{Pump} component representing the compressor - stage. This converts shaft work to energy flow in the working fluid. -\item c1 -- a \textbf{Comb} component representing the combustion - chamber. This converts the heat obtained by burning fuel to energy - flow in the working fluid. -\item t1 -- a \textbf{Turb} component representing the turbine - component. This converts the energy flow in the working fluid to - shaft work -\item j\_s -- an \textbf{I} component representing the combined inertia - of the shaft and compressor and turbine rotors. -\item a \textbf{Load} component to absorb the shaft power. -\end{enumerate} -The components \textbf{In} and \textbf{Out} provide the inlet and -outlet conditions. - -Both \textbf{Pump} and \textbf{Turb} are implemented with the -\emph{polytropic} constitutive relationship with index $n$. When -$n=\gamma=\frac{c_p}{c_v}$ this corresponds to isentropic compression -and expansion and thus the \textbf{SimpleGasTurbineABG} achieves its -cycle efficiency. However, other values of $n$ can be used to account -for isentropic efficiency of less than unity. - -To obtain a very simple dynamic model (and to avoid the need for an -accurate combustion chamber model) there are no dynamics associated -with the combustion chamber, but rahter it is assumed that the -corresponding temperature is imposed on the component (that is $T_3$ -is the system input) the corresponding heat flow is then an output. - -Both heat input and work output are measured using the \textbf{PS} -(power sensor) component, that for work output is embedded in the -\textbf{Load} component. These can be monitored to give the efficiency -of the \textbf{SimpleGasTurbineABG}. - -A symbolic steady-state for the model was computed -- see Section -\ref{sec:SimpleGasTurbineABG_ss.tex}. In particular, the load -resistance was chosen to absorb all the generated work at the steady -state and the shaft inertia was chosen to give a unit time constant -for the linearised system. The mass flow and shaft speeds were taken -as unity. - -For the purposed of simulation, the numerical values given in Examples -12.1 of Chapter 12 of Rogers and Mayhew, except that the isentropic -efficiencies are 100\% ($n=\gamma$) -- see Section -\ref{sec:SimpleGasTurbineABG_numpar.tex}. - -Simulations were performed starting at the steady state and increasing -the combustion chamber temperature by 10\% at $t=1$ and reducing by -10\% at $t=5$. Graphs of the various outputs are plotted: -\begin{itemize} -\item Figure - \Ref{fig:SimpleGasTurbineABG_odeso.ps-SimpleGasTurbineABG-p1-T,SimpleGasTurbineABG-c1-T,SimpleGasTurbineABG-t1-T} - -- the temperatures at the output of the - \begin{itemize} - \item compressor, - \item combustion chamber and - \item turbine - \end{itemize} -\item Figure - \Ref{fig:SimpleGasTurbineABG_odeso.ps-SimpleGasTurbineABG-Heat,SimpleGasTurbineABG-Work} - -- the heat input and work output -\item Figure - \Ref{fig:SimpleGasTurbineABG_odeso.ps-SimpleGasTurbineABG-Speed} -- the shaft speed and -\item Figure - \Ref{fig:SimpleGasTurbineABG_odeso.ps-SimpleGasTurbineABG-p1-P,SimpleGasTurbineABG-c1-P,SimpleGasTurbineABG-t1-P} - -- the pressure at the output of the - \begin{itemize} - \item compressor, - \item combustion chamber and - \item turbine - \end{itemize} -\end{itemize} - -This model can be modified extended in various ways to yield related -dynamic systems. For example: -\begin{itemize} -\item an air cooler is obtained by changing the direction of heat and - work flows -\item additional \textbf{Turb} and \textbf{Comb} components add reheat - to the cycle -\item an isentropic nozzle can be added and the work output removed - to give a jet engine. -\end{itemize} - - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_input.txt Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_input.txt ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_input.txt +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_input.txt @@ -1,14 +0,0 @@ -# Numerical parameter file (SimpleGasTurbineABG_input.txt) -# Generated by MTT at Tue Mar 31 12:38:39 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -t_3 = 1000; - -# Set the inputs -u(1) = t_3 + 0.1*t_3*(t>1) - 0.2*t_3*(t>5); # SimpleGasTurbineABG (T3) DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt @@ -1,77 +0,0 @@ -# Numerical parameter file (SimpleGasTurbine_numpar.txt) -# Generated by MTT at Tue Mar 31 12:15:00 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 16:55:29 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -#Dummies - alpha = 1; - c_v = 1; - density = 1; - ideal_gas = 1; - j_s = 1; - k = 1; - k_p = 1; - m = 1; - m_c = 1; - p_1 = 1; - r = 1; - r_l = 1; - t_1 = 1; - v = 1; - v_c = 1; - - -# Parameters -c_p = 1005.0; -c_v = 718.0; -gamma_0 = c_p/c_v; -alpha = (gamma_0-1)/gamma_0; -k = 1.0; -p_1 = 1e5; # 1 bar -p_4 = p_1; -r = c_p-c_v; -t_1 = 288.0; # In -v_c = 1.0; - -%Set the CC pressure and temperature -t_3 = 1000.0; -r_p = 6.0; -p_3 = r_p*p_1; - -%Find stored mass to give combustion chamber pressure p_3 (at -% temperature t_3 -m_c = (p_3*v_c)/(t_3*r); - -%Equate pressures -p_4 = p_1; -p_2 = p_3; - -%Compute ss temperatures (isentropic) -t_2 = t_1*pow((p_2/p_1),alpha); -t_4 = t_3*pow((p_4/p_3),alpha); - -%Find the steady-state work output -w_0 = c_p*(t_3-t_4) - c_p*(t_2-t_1); - -%Unit mass flow -mdot = 1; - -%Corresponding shaft speed -omega_0 = mdot/k; - -%Compute the corresponding load resistance (to absorb that work) -r_l = w_0/pow((omega_0),2); - -%Compute shaft inertia to give unit time constant (j_s*r_l) -j_s = r_l; - -%Find angular momentum to give shaft speed omega_0 -mom_0 = omega_0*j_s; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_rep.txt Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_rep.txt ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_rep.txt +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_rep.txt @@ -1,35 +0,0 @@ -# Outline report file for system SimpleGasTurbineABG (SimpleGasTurbineABG_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 16:55:29 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%mtt -abg -o -ss SimpleGasTurbineABG abg tex -mtt -abg -o -ss SimpleGasTurbineABG struc tex -mtt -abg -o -ss SimpleGasTurbineABG sympar tex -mtt -abg -o -ss SimpleGasTurbineABG ode tex - -mtt -abg -o -ss SimpleGasTurbineABG sspar r -mtt -abg -o -ss SimpleGasTurbineABG ss tex -mtt -abg -o -ss SimpleGasTurbineABG sm tex - - -mtt -abg -o -ss SimpleGasTurbineABG numpar tex -mtt -abg -o -ss SimpleGasTurbineABG input tex -mtt -abg -o -ss SimpleGasTurbineABG state tex -mtt -abg -o -ss SimpleGasTurbineABG simpar tex -mtt -abg -o -ss SimpleGasTurbineABG odeso ps 'SimpleGasTurbineABG_p1_T,SimpleGasTurbineABG_c1_T,SimpleGasTurbineABG_t1_T' -mtt -abg -o -ss SimpleGasTurbineABG odeso ps 'SimpleGasTurbineABG_Heat,SimpleGasTurbineABG_Work' -mtt -abg -o -ss SimpleGasTurbineABG odeso ps 'SimpleGasTurbineABG_Speed' -mtt -abg -o -ss SimpleGasTurbineABG odeso ps 'SimpleGasTurbineABG_p1_P,SimpleGasTurbineABG_c1_P,SimpleGasTurbineABG_t1_P' - - - - - DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_simp.r Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_simp.r ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_simp.r +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_simp.r @@ -1,11 +0,0 @@ -%% Reduce commands to simplify output for system SimpleGasTurbineABG (SimpleGasTurbineABG_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LET c_v = c_p - r; -END; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_sspar.r Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_sspar.r ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_sspar.r +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_sspar.r @@ -1,49 +0,0 @@ -% Steady-state parameter file (SimpleGasTurbineABG_sspar.r) -% Generated by MTT at Thu Mar 26 16:28:59 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%Find stored mass to give combustion chamber pressure p_3 (at -% temperature t_3 -m_c := (p_3*v_c)/(t_3*r); - -%Equate pressures -p_4 := p_1; -p_2 := p_3; - -%Compute ss temperatures (isentropic) -t_2 := t_1*(p_2/p_1)^alpha; -t_4 := t_3*(p_4/p_3)^alpha; - -%Find the steady-state work output -w_0 := c_p*(t_3-t_4) - c_p*(t_2-t_1); - -%Compute the corresponding load resistance (to absorb that work) -r_l := w_0/(omega_0)^2; - -%Unit mass flow -mdot := 1; - -%Corresponding shaft speed -omega_0 := mdot/k; - -%Compute shaft inertia to give unit time constant (j_s*r_l) -j_s := r_l; - -%Find angular momentum to give shaft speed omega_0 -mom_0 := omega_0*j_s; - - -% Steady-state states -MTTX1 := mom_0; - -% Steady-state inputs - combustion temperature -MTTU1 := t_3; % SimpleGasTurbineABG (T3) - -;;END; - DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_state.txt Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_state.txt ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_state.txt +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_state.txt @@ -1,14 +0,0 @@ -# Numerical parameter file (SimpleGasTurbineABG_state.txt) -# Generated by MTT at Tue Mar 31 12:37:17 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -SimpleGasTurbineABG_numpar; - -# Set the states -x(1) = j_s/k ; # SimpleGasTurbineABG (j_s) DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/hPipe_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/hPipe_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/hPipe_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/hPipe_abg.m @@ -1,105 +0,0 @@ -function [hPipe] = hPipe_abg -# This function is the acausal bond graph representation of hPipe -# Generated by MTT on Thu Mar 16 10:33:07 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port Heat - hPipe.ports.Heat.type = "SS"; - hPipe.ports.Heat.cr = "SS"; - hPipe.ports.Heat.arg = "external,external"; - hPipe.ports.Heat.repetitions = 1; - hPipe.ports.Heat.status = -1; - hPipe.ports.Heat.connections = [-3 ]; - -# Port Hydraulic_in - hPipe.ports.Hydraulic_in.type = "SS"; - hPipe.ports.Hydraulic_in.cr = "SS"; - hPipe.ports.Hydraulic_in.arg = "external,external"; - hPipe.ports.Hydraulic_in.repetitions = 1; - hPipe.ports.Hydraulic_in.status = -1; - hPipe.ports.Hydraulic_in.connections = [-5 ]; - -# Port Hydraulic_out - hPipe.ports.Hydraulic_out.type = "SS"; - hPipe.ports.Hydraulic_out.cr = "SS"; - hPipe.ports.Hydraulic_out.arg = "external,external"; - hPipe.ports.Hydraulic_out.repetitions = 1; - hPipe.ports.Hydraulic_out.status = -1; - hPipe.ports.Hydraulic_out.connections = [6 ]; - -# Port Thermal_in - hPipe.ports.Thermal_in.type = "SS"; - hPipe.ports.Thermal_in.cr = "SS"; - hPipe.ports.Thermal_in.arg = "external,external"; - hPipe.ports.Thermal_in.repetitions = 1; - hPipe.ports.Thermal_in.status = -1; - hPipe.ports.Thermal_in.connections = [-2 ]; - -# Port Thermal_out - hPipe.ports.Thermal_out.type = "SS"; - hPipe.ports.Thermal_out.cr = "SS"; - hPipe.ports.Thermal_out.arg = "external,external"; - hPipe.ports.Thermal_out.repetitions = 1; - hPipe.ports.Thermal_out.status = -1; - hPipe.ports.Thermal_out.connections = [7 ]; - -# Component P2T - hPipe.subsystems.P2T.type = "TF"; - hPipe.subsystems.P2T.cr = "lin"; - hPipe.subsystems.P2T.arg = "flow,r*m/v"; - hPipe.subsystems.P2T.repetitions = 1; - hPipe.subsystems.P2T.status = -1; - hPipe.subsystems.P2T.connections = [5 -1 ]; - -# Component T2P - hPipe.subsystems.T2P.type = "TF"; - hPipe.subsystems.T2P.cr = "lin"; - hPipe.subsystems.T2P.arg = "effort,r*m/v"; - hPipe.subsystems.T2P.repetitions = 1; - hPipe.subsystems.T2P.status = -1; - hPipe.subsystems.T2P.connections = [4 -6 ]; - -# Component mtt1 - hPipe.subsystems.mtt1.type = "0"; - hPipe.subsystems.mtt1.cr = ""; - hPipe.subsystems.mtt1.arg = ""; - hPipe.subsystems.mtt1.repetitions = 1; - hPipe.subsystems.mtt1.status = -1; - hPipe.subsystems.mtt1.connections = [1 2 3 -4 -7 ]; - -# Ordered list of Port names - hPipe.portlist(1,:) = "Heat "; - hPipe.portlist(2,:) = "Hydraulic_in "; - hPipe.portlist(3,:) = "Hydraulic_out"; - hPipe.portlist(4,:) = "Thermal_in "; - hPipe.portlist(5,:) = "Thermal_out "; - -# Ordered list of subsystem names - hPipe.subsystemlist(1,:) = "P2T "; - hPipe.subsystemlist(2,:) = "T2P "; - hPipe.subsystemlist(3,:) = "mtt1"; - -# Bonds - hPipe.bonds = [ - 0 0 - 0 0 - 1 1 - 0 0 - 0 0 - 0 0 - 0 0 - ]; - -# Aliases -# A double underscore __ represents a comma -hPipe.alias.out = "Thermal_out,Hydraulic_out"; -hPipe.alias.Hy_out = "Hydraulic_out"; -hPipe.alias.Th_in = "Thermal_in"; -hPipe.alias.r = "$3"; -hPipe.alias.Th_out = "Thermal_out"; -hPipe.alias.m = "$1"; -hPipe.alias.v = "$2"; -hPipe.alias.in = "Thermal_in,Hydraulic_in"; -hPipe.alias.Hy_in = "Hydraulic_in"; DELETED mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/wPipe_abg.m Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/wPipe_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/wPipe_abg.m +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/wPipe_abg.m @@ -1,199 +0,0 @@ -function [wPipe] = wPipe_abg -# This function is the acausal bond graph representation of wPipe -# Generated by MTT on Thu Mar 16 10:37:39 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Port Hydraulic_in - wPipe.ports.Hydraulic_in.type = "SS"; - wPipe.ports.Hydraulic_in.cr = "SS"; - wPipe.ports.Hydraulic_in.arg = "external,external"; - wPipe.ports.Hydraulic_in.repetitions = 1; - wPipe.ports.Hydraulic_in.status = -1; - wPipe.ports.Hydraulic_in.connections = [-1 ]; - -# Port Hydraulic_out - wPipe.ports.Hydraulic_out.type = "SS"; - wPipe.ports.Hydraulic_out.cr = "SS"; - wPipe.ports.Hydraulic_out.arg = "external,external"; - wPipe.ports.Hydraulic_out.repetitions = 1; - wPipe.ports.Hydraulic_out.status = -1; - wPipe.ports.Hydraulic_out.connections = [17 ]; - -# Port Shaft - wPipe.ports.Shaft.type = "SS"; - wPipe.ports.Shaft.cr = "SS"; - wPipe.ports.Shaft.arg = "external,external"; - wPipe.ports.Shaft.repetitions = 1; - wPipe.ports.Shaft.status = -1; - wPipe.ports.Shaft.connections = [-20 ]; - -# Port Thermal_in - wPipe.ports.Thermal_in.type = "SS"; - wPipe.ports.Thermal_in.cr = "SS"; - wPipe.ports.Thermal_in.arg = "external,external"; - wPipe.ports.Thermal_in.repetitions = 1; - wPipe.ports.Thermal_in.status = -1; - wPipe.ports.Thermal_in.connections = [-14 ]; - -# Port Thermal_out - wPipe.ports.Thermal_out.type = "SS"; - wPipe.ports.Thermal_out.cr = "SS"; - wPipe.ports.Thermal_out.arg = "external,external"; - wPipe.ports.Thermal_out.repetitions = 1; - wPipe.ports.Thermal_out.status = -1; - wPipe.ports.Thermal_out.connections = [16 ]; - -# Component rho1 - wPipe.subsystems.rho1.type = "Density"; - wPipe.subsystems.rho1.cr = "none"; - wPipe.subsystems.rho1.arg = "density,ideal_gas,r"; - wPipe.subsystems.rho1.repetitions = 1; - wPipe.subsystems.rho1.status = -1; - wPipe.subsystems.rho1.connections = [4 3 -5 ]; - -# Component rho2 - wPipe.subsystems.rho2.type = "Density"; - wPipe.subsystems.rho2.cr = "none"; - wPipe.subsystems.rho2.arg = "density,ideal_gas,r"; - wPipe.subsystems.rho2.repetitions = 1; - wPipe.subsystems.rho2.status = -1; - wPipe.subsystems.rho2.connections = [12 11 -10 ]; - -# Component p2pv - wPipe.subsystems.p2pv.type = "EMTF"; - wPipe.subsystems.p2pv.cr = "lin"; - wPipe.subsystems.p2pv.arg = "flow"; - wPipe.subsystems.p2pv.repetitions = 1; - wPipe.subsystems.p2pv.status = -1; - wPipe.subsystems.p2pv.connections = [2 -9 5 ]; - -# Component pv2p - wPipe.subsystems.pv2p.type = "EMTF"; - wPipe.subsystems.pv2p.cr = "lin"; - wPipe.subsystems.pv2p.arg = "effort"; - wPipe.subsystems.pv2p.repetitions = 1; - wPipe.subsystems.pv2p.status = -1; - wPipe.subsystems.pv2p.connections = [7 -18 10 ]; - -# Component t2u - wPipe.subsystems.t2u.type = "TF"; - wPipe.subsystems.t2u.cr = "lin"; - wPipe.subsystems.t2u.arg = "effort,c_v"; - wPipe.subsystems.t2u.repetitions = 1; - wPipe.subsystems.t2u.status = -1; - wPipe.subsystems.t2u.connections = [15 -6 ]; - -# Component u2t - wPipe.subsystems.u2t.type = "TF"; - wPipe.subsystems.u2t.cr = "lin"; - wPipe.subsystems.u2t.arg = "flow,c_v"; - wPipe.subsystems.u2t.repetitions = 1; - wPipe.subsystems.u2t.status = -1; - wPipe.subsystems.u2t.connections = [8 -13 ]; - -# Component mtt1 - wPipe.subsystems.mtt1.type = "0"; - wPipe.subsystems.mtt1.cr = ""; - wPipe.subsystems.mtt1.arg = ""; - wPipe.subsystems.mtt1.repetitions = 1; - wPipe.subsystems.mtt1.status = -1; - wPipe.subsystems.mtt1.connections = [-3 14 -15 ]; - -# Component mtt2 - wPipe.subsystems.mtt2.type = "0"; - wPipe.subsystems.mtt2.cr = ""; - wPipe.subsystems.mtt2.arg = ""; - wPipe.subsystems.mtt2.repetitions = 1; - wPipe.subsystems.mtt2.status = -1; - wPipe.subsystems.mtt2.connections = [1 -2 -4 ]; - -# Component mtt3 - wPipe.subsystems.mtt3.type = "1"; - wPipe.subsystems.mtt3.cr = ""; - wPipe.subsystems.mtt3.arg = ""; - wPipe.subsystems.mtt3.repetitions = 1; - wPipe.subsystems.mtt3.status = -1; - wPipe.subsystems.mtt3.connections = [6 -7 -8 9 19 ]; - -# Component mtt4 - wPipe.subsystems.mtt4.type = "0"; - wPipe.subsystems.mtt4.cr = ""; - wPipe.subsystems.mtt4.arg = ""; - wPipe.subsystems.mtt4.repetitions = 1; - wPipe.subsystems.mtt4.status = -1; - wPipe.subsystems.mtt4.connections = [-11 13 -16 ]; - -# Component mtt5 - wPipe.subsystems.mtt5.type = "0"; - wPipe.subsystems.mtt5.cr = ""; - wPipe.subsystems.mtt5.arg = ""; - wPipe.subsystems.mtt5.repetitions = 1; - wPipe.subsystems.mtt5.status = -1; - wPipe.subsystems.mtt5.connections = [-12 -17 18 ]; - -# Component mtt6 - wPipe.subsystems.mtt6.type = "1"; - wPipe.subsystems.mtt6.cr = ""; - wPipe.subsystems.mtt6.arg = ""; - wPipe.subsystems.mtt6.repetitions = 1; - wPipe.subsystems.mtt6.status = -1; - wPipe.subsystems.mtt6.connections = [-19 20 ]; - -# Ordered list of Port names - wPipe.portlist(1,:) = "Hydraulic_in "; - wPipe.portlist(2,:) = "Hydraulic_out"; - wPipe.portlist(3,:) = "Shaft "; - wPipe.portlist(4,:) = "Thermal_in "; - wPipe.portlist(5,:) = "Thermal_out "; - -# Ordered list of subsystem names - wPipe.subsystemlist(1,:) = "rho1"; - wPipe.subsystemlist(2,:) = "rho2"; - wPipe.subsystemlist(3,:) = "p2pv"; - wPipe.subsystemlist(4,:) = "pv2p"; - wPipe.subsystemlist(5,:) = "t2u "; - wPipe.subsystemlist(6,:) = "u2t "; - wPipe.subsystemlist(7,:) = "mtt1"; - wPipe.subsystemlist(8,:) = "mtt2"; - wPipe.subsystemlist(9,:) = "mtt3"; - wPipe.subsystemlist(10,:) = "mtt4"; - wPipe.subsystemlist(11,:) = "mtt5"; - wPipe.subsystemlist(12,:) = "mtt6"; - -# Bonds - wPipe.bonds = [ - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - 0 0 - -1 -1 - ]; - -# Aliases -# A double underscore __ represents a comma -wPipe.alias.out = "Thermal_out,Hydraulic_out"; -wPipe.alias.Hy_out = "Hydraulic_out"; -wPipe.alias.c_v = "$1"; -wPipe.alias.Th_in = "Thermal_in"; -wPipe.alias.Th_out = "Thermal_out"; -wPipe.alias.Work = "Shaft"; -wPipe.alias.in = "Thermal_in,Hydraulic_in"; -wPipe.alias.Hy_in = "Hydraulic_in"; -wPipe.alias.density__ideal_gas__r = "$2"; DELETED mttroot/mtt/lib/examples/ABG/rcABG/rcABG_abg.m Index: mttroot/mtt/lib/examples/ABG/rcABG/rcABG_abg.m ================================================================== --- mttroot/mtt/lib/examples/ABG/rcABG/rcABG_abg.m +++ mttroot/mtt/lib/examples/ABG/rcABG/rcABG_abg.m @@ -1,76 +0,0 @@ -function [rc] = rc_abg -# This function is the acausal bond graph representation of rc -# Generated by MTT on Thu Mar 16 08:45:29 2000 -# The file is in Octave format - -# Subsystems and Ports - -# Component c - rc.subsystems.c.type = "C"; - rc.subsystems.c.cr = "lin"; - rc.subsystems.c.arg = "effort,c"; - rc.subsystems.c.repetitions = 1; - rc.subsystems.c.status = -1; - rc.subsystems.c.connections = [5 ]; - -# Component r - rc.subsystems.r.type = "R"; - rc.subsystems.r.cr = "lin"; - rc.subsystems.r.arg = "flow,r"; - rc.subsystems.r.repetitions = 1; - rc.subsystems.r.status = -1; - rc.subsystems.r.connections = [4 ]; - -# Component e1 - rc.subsystems.e1.type = "SS"; - rc.subsystems.e1.cr = "SS"; - rc.subsystems.e1.arg = "external,internal"; - rc.subsystems.e1.repetitions = 1; - rc.subsystems.e1.status = -1; - rc.subsystems.e1.connections = [-1 ]; - -# Component e2 - rc.subsystems.e2.type = "SS"; - rc.subsystems.e2.cr = "SS"; - rc.subsystems.e2.arg = "external,0"; - rc.subsystems.e2.repetitions = 1; - rc.subsystems.e2.status = -1; - rc.subsystems.e2.connections = [3 ]; - -# Component mtt1 - rc.subsystems.mtt1.type = "1"; - rc.subsystems.mtt1.cr = ""; - rc.subsystems.mtt1.arg = ""; - rc.subsystems.mtt1.repetitions = 1; - rc.subsystems.mtt1.status = -1; - rc.subsystems.mtt1.connections = [1 -2 -4 ]; - -# Component mtt2 - rc.subsystems.mtt2.type = "0"; - rc.subsystems.mtt2.cr = ""; - rc.subsystems.mtt2.arg = ""; - rc.subsystems.mtt2.repetitions = 1; - rc.subsystems.mtt2.status = -1; - rc.subsystems.mtt2.connections = [2 -3 -5 ]; - -# Ordered list of subsystem names - rc.subsystemlist(1,:) = "c "; - rc.subsystemlist(2,:) = "r "; - rc.subsystemlist(3,:) = "e1 "; - rc.subsystemlist(4,:) = "e2 "; - rc.subsystemlist(5,:) = "mtt1"; - rc.subsystemlist(6,:) = "mtt2"; - -# Bonds - rc.bonds = [ - 1 1 - 0 0 - 1 1 - 0 0 - 0 0 - ]; - -# Aliases -# A double underscore __ represents a comma -rc.alias.r = "$2"; -rc.alias.c = "$1"; DELETED mttroot/mtt/lib/examples/ABG/rcABG/rcABG_rep.txt Index: mttroot/mtt/lib/examples/ABG/rcABG/rcABG_rep.txt ================================================================== --- mttroot/mtt/lib/examples/ABG/rcABG/rcABG_rep.txt +++ mttroot/mtt/lib/examples/ABG/rcABG/rcABG_rep.txt @@ -1,15 +0,0 @@ -% %% Outline report file for system rcABG (rcABG_rep.txt) -mtt rcABG struc tex -mtt rcABG ode tex -mtt rcABG sm tex -mtt rcABG tf tex -mtt rcABG sro ps -mtt rcABG lmfr ps -mtt rcABG nyfr ps - -mtt rcABG numpar txt -mtt rcABG input txt -mtt rcABG odeso ps -mtt rcABG rep txt - - DELETED mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_abg.fig Index: mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_abg.fig ================================================================== --- mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_abg.fig +++ mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_abg.fig @@ -1,82 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 4680 630 6570 1620 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4725 1215 5175 1215 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4725 1080 5175 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4950 675 4950 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4950 1215 4950 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 6075 1530 6075 765 -4 0 1 1 0 0 20 0.0000 4 180 165 5355 1215 c\001 -4 0 1 1 0 0 20 0.0000 4 180 165 6300 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 255 180 6390 1305 2\001 --6 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 1800 1125 162 162 1800 1125 1890 1260 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1802 4277 2702 4277 2477 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 4277 4052 4277 3827 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4502 4277 5402 4277 5177 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 4051 2926 3151 3151 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 4051 4276 3151 4501 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 4276 2701 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5401 4051 5401 4276 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5401 4276 5401 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 4051 2701 4276 -2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 2475 585 3375 585 3375 765 2475 765 2475 585 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 675 2475 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 945 1800 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 1575 1800 1260 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 4500 2925 5400 3150 5175 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6750 6075 6750 225 675 225 675 6075 6750 6075 -2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 3600 585 4500 585 4500 765 3600 765 3600 585 -2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 2 - 3375 675 3600 675 -2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 2 - 4500 675 5850 675 -2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 2 - 1755 1575 5850 1575 -2 1 0 2 4 7 100 0 -1 0.000 0 0 -1 0 0 2 - 1935 5040 2160 5265 -2 1 0 2 4 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2070 5130 2706 4494 2706 4812 -4 1 -1 0 0 0 20 0.0000 4 255 180 2927 4367 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 4277 4367 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 825 5987 4367 SS:e2\001 -4 1 -1 0 0 0 20 0.0000 4 330 825 2926 2926 R:r_1\001 -4 1 -1 0 0 0 20 0.0000 4 255 495 4276 2926 C:c\001 -4 1 -1 0 0 0 20 0.0000 4 255 825 1395 4365 SS:e1\001 -4 0 1 1 0 0 20 0.0000 4 330 495 2880 450 r_1\001 -4 0 1 1 0 0 20 0.0000 4 180 165 1260 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 255 180 1350 1305 1\001 -4 1 1 1 0 0 20 0.0000 4 255 1545 3600 2025 Schematic\001 -4 1 1 1 0 0 20 0.0000 4 330 1725 4860 4860 Bond graph\001 -4 1 -1 0 0 0 20 0.0000 4 330 825 3015 5715 R:r_2\001 -4 0 1 1 0 0 20 0.0000 4 330 495 3870 450 r_2\001 -4 1 -1 0 0 0 20 0.0000 4 330 1110 1755 5535 SS:loop\001 DELETED mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_desc.tex Index: mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_desc.tex ================================================================== --- mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_desc.tex +++ mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_desc.tex @@ -1,35 +0,0 @@ -% Verbal description for system aRC (aRC_desc.tex) -% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:02:29 peterg -% %% To RCS -% %% -% %% Revision 1.1 1997/08/24 10:27:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{aRC} is - displayed in Figure \Ref{aRC_abg} and its label - file is listed in Section \Ref{sec:aRC_lbl}. - The subsystems are listed in Section \Ref{sec:aRC_sub}. - -The system \textbf{aRC} is the simple electrical rc circuit shown in -Figure \Ref{aRC_abg}. It can be regarded as a single-input -single-output system with input $e_1$ and output $e_2$. - -The two resistors ($r_1$ and $r_2$) are in series; this give an -undercausal system with a corresponding algebraic loop. The loop is -broken by adding the {\bf SS} component ``loop'' to localise the -algabraic equation byh choosing the corresponding flow such that the -corresponding effort is zero. This algebraic equation appears in -Section \Ref{sec:aRC_dae-noargs.tex}. - -This loop is algbraicly solved to give the ordinary differential -equation of Section \Ref{sec:aRC_ode-A.tex} and the transfer function of -Section \Ref{sec:aRC_tf-A.tex}. DELETED mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_lbl.txt Index: mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_lbl.txt +++ mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_lbl.txt @@ -1,48 +0,0 @@ -%SUMMARY aRC: Simple RC circuit example with algebraic loop - -%% Label file for system aRC (aRC_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/05/20 16:03:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1997/05/12 15:11:47 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1997/04/18 13:27:54 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1997/04/18 13:20:13 peterg -% %% Initial revision -% %% Revision 1.1 1996/09/10 11:37:14 peter -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -% Source - effort source (e1) flow ignored -e1 SS external,internal - -% Sensor - effort sensor (e2) zero flow -e2 SS external,0 - -% R component - linear with resistance r (effort = r*flow) -r_1 lin flow,r_1 -r_2 lin flow,r_2 - -% C component - linear with capacitance c (state = c*effort) -c lin effort,c - -% Algebraic loop SS -loop SS zero,unknown - - - DELETED mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_rep.txt Index: mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_rep.txt ================================================================== --- mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_rep.txt +++ mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_rep.txt @@ -1,30 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system aRC (aRC_rep.txt) -## Generated by MTT on" Fri Oct 15 14:56:13 EST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:02:29 peterg -## To RCS -## -############################################################### - -mtt aRC abg tex # The system description -mtt aRC cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt aRC struc tex # The system structure -mtt aRC dae tex # The system dae -mtt -A aRC ode tex # The system ode -## mtt aRC sspar tex # Steady-state parameters -## mtt aRC ss tex # Steady state -## mtt aRC dm tex # Descriptor matrices (of linearised system) -## mtt aRC sm tex # State matrices (of linearised system) -mtt -A aRC tf tex # Transfer function (of linearised system) -## mtt aRC lmfr ps # log modulus of frequency response (of linearised system) -## mtt aRC simpar tex # Simulation parameters -## mtt aRC numpar tex # Numerical simulation parameters -## mtt aRC input tex # Simulation input -## mtt aRC odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_sspar.r Index: mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_sspar.r ================================================================== --- mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_sspar.r +++ mttroot/mtt/lib/examples/AlgebraicLoops/aRC/aRC_sspar.r @@ -1,2 +0,0 @@ -%% Reduce steady-state parameter file for aRC (aRC_sspar.r) cat /home/peter/mtt_new/mtt/trans/m/aRCs_header.txt -END; DELETED mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_abg.fig Index: mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_abg.fig +++ mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_abg.fig @@ -1,291 +0,0 @@ -#FIG 3.1 -Portrait -Center -Inches -1200 2 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4201 7186 4201 6451 4336 6631 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4201 4801 4201 4066 4336 4246 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4276 7201 4801 6901 4651 6901 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9901 6151 10576 6151 10426 6001 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9901 5026 10576 5026 10426 4876 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4501 6226 5176 6226 5026 6076 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4501 5026 5176 5026 5026 4876 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9601 5266 9601 6001 9466 5821 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9901 3901 10576 3901 10426 3751 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4501 3901 5176 3901 5026 3751 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5401 1876 5701 1876 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5551 1201 5551 1876 5401 1726 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5926 1951 5926 2251 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 4051 3601 4351 3601 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 4501 1951 4501 2251 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 7351 1951 7351 2251 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4201 3601 6751 2326 6451 2251 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7051 2251 9526 3676 9526 3376 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5251 2101 4501 2101 4651 1951 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5926 2101 6601 2101 6451 1951 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7351 2101 8026 2101 7876 1951 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 9376 3676 9676 3676 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 8491 11341 8491 12076 8356 11896 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5491 14941 5491 15676 5356 15496 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5401 8401 5701 8401 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5371 10246 5671 10246 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5326 12076 5626 12076 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5326 13876 5626 13876 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5326 15676 5626 15676 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8326 15676 8626 15676 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8326 13876 8626 13876 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8326 12076 8626 12076 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8326 10276 8626 10276 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8326 8401 8626 8401 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 6901 14926 7201 14926 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 6901 13126 7201 13126 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 6901 11326 7201 11326 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 6901 9526 7201 9526 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 6901 7651 7201 7651 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7021 14941 7021 15676 6901 15496 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7021 13141 7021 13876 6901 13696 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7021 11341 7021 12076 6901 11896 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7021 9541 7021 10276 6901 10096 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7051 7651 7051 8386 6931 8206 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9526 7501 8851 11101 8776 10951 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9526 7501 8851 12901 8776 12751 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9526 7501 8851 14701 8776 14551 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 8476 7651 8476 8386 8341 8206 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 8491 9541 8491 10276 8356 10096 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 8491 13141 8491 13876 8356 13696 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 8491 14941 8491 15676 8356 15496 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5551 7651 5551 8386 5416 8206 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5536 9496 5536 10231 5401 10051 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5491 11341 5491 12076 5356 11896 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5491 13141 5491 13876 5356 13696 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7051 1876 7501 1501 7501 1726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7201 7501 7801 8101 7651 8101 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7201 9301 7801 9901 7651 9901 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7201 11101 7801 11701 7651 11701 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7201 12901 7801 13501 7651 13501 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7201 14701 7801 15301 7651 15301 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9601 4051 9601 4351 9526 4276 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9601 4576 9601 4876 9526 4801 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9601 6376 9601 6676 9526 6601 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9601 7051 9601 7351 9526 7276 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4201 5476 4201 5176 4276 5251 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4201 6076 4201 5776 4276 5851 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8178 9303 7878 9303 7953 9378 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7578 9303 7278 9303 7353 9378 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8177 9152 8177 9452 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8178 11103 7878 11103 7953 11178 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7578 11103 7278 11103 7353 11178 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8177 10952 8177 11252 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8178 12903 7878 12903 7953 12978 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7578 12903 7278 12903 7353 12978 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8177 12752 8177 13052 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8178 14703 7878 14703 7953 14778 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7578 14703 7278 14703 7353 14778 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 8177 14552 8177 14852 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 6676 14701 5926 14701 6076 14851 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 6676 12901 5926 12901 6076 13051 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 6676 11101 5926 11101 6076 11251 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 6676 9301 5926 9301 6076 9451 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 6676 7501 5926 7501 6076 7651 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9526 7501 8776 7501 8971 7636 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9526 7501 8851 9301 8776 9076 -2 1 0 1 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9742 7410 10267 7110 10117 7110 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8101 7501 7801 7501 7876 7576 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7501 7501 7201 7501 7276 7576 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5102 9302 4802 9302 4877 9377 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5103 11103 4803 11103 4878 11178 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5028 12903 4728 12903 4803 12978 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5028 14703 4728 14703 4803 14778 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 9301 4201 7501 4351 7801 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4051 7576 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 3976 7576 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4051 7576 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4426 11101 4051 7576 4201 7801 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4426 12901 3901 7576 3976 7726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4426 14701 3676 7501 3826 7801 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5177 7502 4877 7502 4952 7577 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4577 7502 4277 7502 4352 7577 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 8700 9000 7050 6600 7050 6600 8700 9000 8700 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 12300 9000 10650 6600 10650 6600 12300 9000 12300 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 14175 9000 12525 6600 12525 6600 14175 9000 14175 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 15975 9000 14325 6600 14325 6600 15975 9000 15975 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 10500 9000 8850 6600 8850 6600 10500 9000 10500 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 13800 16125 300 16125 300 600 13800 600 13800 16125 -4 0 0 0 0 0 12 0.0000000 4 180 495 10276 7051 C:apc2\001 -4 0 0 0 0 0 12 0.0000000 4 180 510 4876 7051 C:vpc2\001 -4 0 0 0 0 0 12 0.0000000 4 180 495 10651 5101 C:apc1\001 -4 0 0 0 0 0 12 0.0000000 4 180 480 10651 6226 R:apr2\001 -4 0 0 0 0 0 12 0.0000000 4 180 480 10651 4051 R:apr1\001 -4 0 0 0 0 0 12 0.0000000 4 180 510 5251 5101 C:vpc1\001 -4 0 0 0 0 0 12 0.0000000 4 180 495 5251 6301 R:vpr2\001 -4 1 0 0 0 0 12 0.0000000 4 180 495 5551 3976 R:vpr1\001 -4 1 0 0 0 0 12 0.0000000 4 180 390 9601 6301 1:ap3\001 -4 1 0 0 0 0 12 0.0000000 4 180 405 4201 6301 1:vp3\001 -4 1 0 0 0 0 12 0.0000000 4 180 390 9601 5101 0:ap2\001 -4 1 0 0 0 0 12 0.0000000 4 180 405 4126 5101 0:vp2\001 -4 1 0 0 0 0 12 0.0000000 4 180 390 9526 3976 1:ap1\001 -4 1 0 0 0 0 12 0.0000000 4 180 405 4126 3976 1:vp1\001 -4 0 0 0 0 0 12 0.0000000 4 180 420 7576 1576 SS:ye\001 -4 0 0 0 0 0 12 0.0000000 4 135 390 5326 1201 SS:t0\001 -4 1 0 0 0 0 12 0.0000000 4 135 270 4201 2176 R:ri\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 5551 2176 1:fi\001 -4 1 0 0 0 0 12 0.0000000 4 135 225 7051 2176 0:ti\001 -4 1 0 0 0 0 12 0.0000000 4 135 285 8401 2176 C:ci\001 -4 0 0 0 0 0 12 0.0000000 4 135 345 8251 14776 1:fsa\001 -4 0 0 0 0 0 12 0.0000000 4 135 330 8251 12976 1:ffa\001 -4 0 0 0 0 0 12 0.0000000 4 135 315 8251 11176 1:fla\001 -4 0 0 0 0 0 12 0.0000000 4 135 360 8251 9376 1:fva\001 -4 0 0 0 0 0 12 0.0000000 4 135 360 8251 7576 1:fba\001 -4 0 0 0 0 0 12 0.0000000 4 135 360 5251 14776 1:fsv\001 -4 0 0 0 0 0 12 0.0000000 4 135 345 5251 12976 1:ffv\001 -4 0 0 0 0 0 12 0.0000000 4 135 330 5251 11176 1:flv\001 -4 0 0 0 0 0 12 0.0000000 4 135 375 5251 9376 1:fvv\001 -4 0 0 0 0 0 12 0.0000000 4 180 345 9601 7576 0:tap\001 -4 1 0 0 0 0 12 0.0000000 4 135 390 5476 15901 R:rs1\001 -4 1 0 0 0 0 12 0.0000000 4 135 405 5551 10501 R:rv1\001 -4 1 0 0 0 0 12 0.0000000 4 135 405 5551 8626 R:rb1\001 -4 0 0 0 0 0 12 0.0000000 4 180 420 7501 15601 SS:ys\001 -4 0 0 0 0 0 12 0.0000000 4 180 405 7501 13801 SS:yf\001 -4 1 0 0 0 0 12 0.0000000 4 180 390 7726 12001 SS:yl\001 -4 1 0 0 0 0 12 0.0000000 4 180 435 7801 10201 SS:yv\001 -4 1 0 0 0 0 12 0.0000000 4 180 435 7801 8326 SS:yb\001 -4 1 0 0 0 0 12 0.0000000 4 135 390 8476 15901 R:rs2\001 -4 1 0 0 0 0 12 0.0000000 4 135 405 8476 10501 R:rv2\001 -4 1 0 0 0 0 12 0.0000000 4 135 405 8476 8626 R:rb2\001 -4 1 0 0 0 0 12 0.0000000 4 135 315 6976 15901 C:cs\001 -4 1 0 0 0 0 12 0.0000000 4 135 300 7051 14101 C:cf\001 -4 1 0 0 0 0 12 0.0000000 4 135 285 6976 12376 C:cl\001 -4 1 0 0 0 0 12 0.0000000 4 135 330 6976 10501 C:cv\001 -4 1 0 0 0 0 12 0.0000000 4 135 330 7051 8626 C:cb\001 -4 1 0 0 0 0 12 0.0000000 4 135 255 7051 14776 0:ts\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 7051 12976 0:tf\001 -4 1 0 0 0 0 12 0.0000000 4 135 225 7051 11176 0:tl\001 -4 1 0 0 0 0 12 0.0000000 4 135 270 7051 9376 0:tv\001 -4 1 0 0 0 0 12 0.0000000 4 135 270 7051 7576 0:tb\001 -4 1 0 0 0 0 12 0.0000000 4 135 360 8476 12376 R:rl1\001 -4 1 0 0 0 0 12 0.0000000 4 135 375 8476 14101 R:rf1\001 -4 1 0 0 0 0 12 0.0000000 4 135 360 5476 12376 R:rl2\001 -4 1 0 0 0 0 12 0.0000000 4 135 375 5476 14101 R:rf2\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 9601 4501 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 9601 6901 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 4201 5701 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 7728 9378 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 7728 11178 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 7728 12978 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 7728 14778 AF\001 -4 0 0 0 0 0 12 0.0000000 4 135 375 5251 7576 1:fbv\001 -4 2 0 0 0 0 12 0.0000000 4 180 360 4126 7501 0:tvp\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 7651 7576 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 4652 9377 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 4653 11178 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 4578 12978 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 4578 14778 AF\001 -4 1 0 0 0 0 12 0.0000000 4 135 240 4727 7577 AF\001 DELETED mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_desc.tex Index: mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_desc.tex +++ mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_desc.tex @@ -1,26 +0,0 @@ -% Verbal description for system MaplesonModelP (MaplesonModelP_desc.tex) -% Generated by MTT on Wed Dec 10 09:04:14 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{MaplesonModelP} is - displayed in Figure \Ref{MaplesonModelP_abg} and its label - file is listed in Section \Ref{sec:MaplesonModelP_lbl}. - The subsystems are listed in Section \Ref{sec:MaplesonModelP_sub}. - -This is a Bond Graph interpretation of Mapleson's model P of the -pharmokokinetics of anaesthetic drug delivery. It is discussed in -detail in Chapter 9 of ``Metamodelling''. - -It badly needs conversion to hierarchical form. - - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_input.txt Index: mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_input.txt ================================================================== --- mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_input.txt +++ mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_input.txt @@ -1,9 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System MaplesonModelP, representation input, language txt; -## File MaplesonModelP_input.txt; -## Generated by MTT on Fri Nov 10 10:45:52 GMT 2000; - - -MaplesonModelP__t0 = 0.75*760*(t<2); #75% atmospheric pressure for 2 sec. DELETED mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_lbl.txt Index: mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_lbl.txt +++ mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_lbl.txt @@ -1,167 +0,0 @@ -#SUMMARY MaplesonModelP: Pharmokinetic model from section 9.6 of"Metamodelling" -#DESCRIPTION Detailed model with pools -#DESCRIPTION -#DESCRIPTION Note that the bond graph has been redrawn to replace active bonds with -#DESCRIPTION AF components. -#DESCRIPTION This would be much neater using a heirachical model. -#DESCRIPTION -#DESCRIPTION The following commands make the figures. -#DESCRIPTION -#DESCRIPTION Fig 9.17 mtt MaplesonModelP abg view -#DESCRIPTION Figs 9.18-19 mtt MaplesonModelP odeso view 'T=[0:0.1:6]' -#DESCRIPTION Fig 9.20 mtt MaplesonModelP lmfr view 'W=logspace(-2,2,100)' -#DESCRIPTION Fig 9.21 mtt MaplesonModelP lpfr view 'W=logspace(-2,2,100)' - - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.1 1996/08/30 18:37:56 peter -# ## Initial revision -# ## -# ############################################################### - -#VAR apools -#VAR breathing_interval -#VAR heart_interval -#VAR k_ap -#VAR k_b -#VAR k_f -#VAR k_i -#VAR k_l -#VAR k_s -#VAR k_v -#VAR k_vp -#VAR kb -#VAR kf -#VAR kl -#VAR ks -#VAR kv -#VAR lambdab -#VAR lambdablood -#VAR lambdaf -#VAR lambdal -#VAR lambdalung -#VAR lambdav -#VAR stroke_volume -#VAR t_1 -#VAR t_2 -#VAR t_b -#VAR t_f -#VAR t_i -#VAR t_l -#VAR t_s -#VAR t_v -#VAR v_i -#VAR vap -#VAR varterial -#VAR vb -#VAR vbp -#VAR vf -#VAR vfp -#VAR vgas -#VAR vl -#VAR vlp -#VAR vlung -#VAR vplung -#VAR vpools -#VAR vsp -#VAR vv -#VAR vvenous -#VAR vvp - -### Common tension junctions ### -ti -tb -tv -tl -tf -ts -tap -tvp - -##Common flow junctions - inspiration ### -fi - -##Common flow junctions - arteries ### -fba -fva -fla -ffa -fsa - -##Common flow junctions - veins ### -fbv -fvv -flv -ffv -fsv - -## More junctions -ap3 -vp3 -ap2 -vp2 -ap1 -vp1 - -### Resistances ### -rb1 lin flow,r_b -rv1 lin flow,r_v -rl1 lin flow,r_l -rf1 lin flow,r_f -rs1 lin flow,r_s - -rb2 lin flow,r_b -rv2 lin flow,r_v -rl2 lin flow,r_l -rf2 lin flow,r_f -rs2 lin flow,r_s - -ri lin flow,r_i - -## Capacities ### -cb lin effort,c_b -cv lin effort,c_v -cl lin effort,c_l -cf lin effort,c_f -cs lin effort,c_s -ci lin effort,c_i - - -### Input ### -t0 SS external,internal - -### Outputs ### -yb SS external,0 -yv SS external,0 -yl SS external,0 -yf SS external,0 -ys SS external,0 -ye SS external,0 - -### Arterial pool -# ap1 apool1 -# ap2 apool2 -# ap3 apool3 - -apc1 lin effort,c_ap -apc2 lin effort,c_ap - -apr1 lin flow,r_ap -apr2 lin flow,r_ap - - -### Venous pool -# vp1 vpool1 -# vp2 vpool2 -# vp3 vpool3 - -vpc1 lin effort,c_vp -vpc2 lin effort,c_vp -vpr1 lin flow,r_vp -vpr2 lin flow,r_vp - - DELETED mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_numpar.txt Index: mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_numpar.txt +++ mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_numpar.txt @@ -1,125 +0,0 @@ -# Numerical parameter file (MaplesonModelP_numpar.txt) -# Generated by MTT at Mon Aug 11 14:45:13 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters - -# Modified 17/11/93 to correspond to Mapleson's 1973 paper. -# Like model O except that blood has its own pools distinct form the tissues. - - -Heart_interval = 1.0/60.0; -Breathing_interval = 4*Heart_interval; -Stroke_volume = 0.108; -lambdaBlood = 0.46; -vArterial = 1.4; -vVenous = 4.0; - -# %%%%%%%%%%%%%%%%%% Inspiration %%%%%%%%%%%%%%%%%%%%%%%%%%% -v_i = 0.4; -r_i = Breathing_interval/v_i; - -# %%%%%%%%%%%%%%%%%% Lung %%%%%%%%%%%%%%%%%%%%%%%%%%% -vLung = 0.6; -vPLung = 0; -vGas = 2.5; -lambdaLung = 0.46; - -c_i = lambdaLung*(vLung + vPLung) + vGas; -t_i = r_i*c_i; -# %%%%%%%%%%%%%%%%%% Brain %%%%%%%%%%%%%%%%%%%%%%%%%%% -kB = 0.000086; - -vB = 0.0007; -vBP = 0.0; - -lambdaB = 0.46; - -c_b = lambdaB*vB + lambdaBlood*vBP; -r_b = Heart_interval/(kB*lambdaBlood*Stroke_volume); -t_b = r_b*c_b; - -# %%%%%%%%%%%%%%%%%% Viscera %%%%%%%%%%%%%%%%%%%%%%%%%%% -kV = 0.63; - -vV = 6.2; -lambdaV = 0.46; -vVP = 0; - -c_v = lambdaV*vV + lambdaBlood*vVP; -r_v = Heart_interval/(kV*lambdaBlood*Stroke_volume); -t_v = r_v*c_v; - -# %%%%%%%%%%%%%%%%%% Lean %%%%%%%%%%%%%%%%%%%%%%%%%%% -kL = 0.131; - -vL = 39.2; -lambdaL = 0.46; -vLP = 0; - -c_l = lambdaL*vL + lambdaBlood*vLP; -r_l = Heart_interval/(kL*lambdaBlood*Stroke_volume); -t_l = r_l*c_l; - -# %%%%%%%%%%%%%%%%%% Fat %%%%%%%%%%%%%%%%%%%%%%%%%%% -kF = 0.04; - -vF = 12.2; -lambdaF = 1.40; -vFP = 0; - -c_f = lambdaF*vF + lambdaBlood*(vFP); -r_f = Heart_interval/(kF*lambdaBlood*Stroke_volume); -t_f = r_f*c_f; - -# %%%%%%%%%%%%%%%%%% Shunt %%%%%%%%%%%%%%%%%%%%%%%%%%% -kS = 0.199; - -vSP = 0.126*vVenous; - -c_s = lambdaBlood*(vSP); -r_s = Heart_interval/(kS*lambdaBlood*Stroke_volume); -t_s = r_s*c_s; - -# %%%%%%%%%%%%%%%%%% Time constants %%%%%%%%%%%%%%%%%%%%%%%%%%% -t_1 = t_b*t_v*t_l*t_f*t_s; -t_2 = t_1*t_i; - - -# %%%%%%%%%%%%%%%%%% Convert from rs to ks %%%%%%%%%%%%%%%%%%%% - -k_b = 1/r_b; -k_v = 1/r_v; -k_l = 1/r_l; -k_f = 1/r_f; -k_s = 1/r_s; -k_i = 1/r_i; - -# %%%%%%%%%%%%%%%%%% Arterial pools %%%%%%%%%%%%%%%%%%%%%%%%%%% -# Two pool version -aPools = 2; - -vAP = vArterial; - -c_ap = lambdaBlood*(vAP)/aPools; -r_ap = Heart_interval/(lambdaBlood*Stroke_volume); - -# %%%%%%%%%%%%%%%%%% Venous pools %%%%%%%%%%%%%%%%%%%%%%%%%%% -# Two pool version -vPools = 2; - -vVP = vVenous - vSP; - -c_vp = lambdaBlood*(vVP)/vPools; -r_vp = Heart_interval/(lambdaBlood*Stroke_volume); - -k_ap = 1/r_ap; -k_vp = 1/r_vp; - - DELETED mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_rep.txt Index: mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_rep.txt +++ mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_rep.txt @@ -1,25 +0,0 @@ -# Outline report file for system MaplesonModelP (MaplesonModelP_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1999/02/17 01:46:48 peterg -% %% Included simpar rep. -% %% -% %% Revision 1.1 1999/02/17 00:08:06 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt MaplesonModelP abg tex -mtt MaplesonModelP struc tex -mtt MaplesonModelP ode tex -mtt MaplesonModelP sm tex -mtt MaplesonModelP lmfr ps - -mtt MaplesonModelP simpar txt -mtt MaplesonModelP numpar txt -mtt MaplesonModelP input txt -mtt MaplesonModelP odeso ps DELETED mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_simpar.txt Index: mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_simpar.txt +++ mttroot/mtt/lib/examples/Anaesthesia/MaplesonModelP/MaplesonModelP_simpar.txt @@ -1,19 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system MaplesonModelP (MaplesonModelP_simpar.txt) -# Generated by MTT on Fri Nov 10 11:37:00 GMT 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -FIRST = 0.0; # First time in simulation output -DT = 0.1; # Print interval -LAST = 10.0; # Last time in simulation -STEPFACTOR = 10; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Chemical/Reactor/MakeFigure.m Index: mttroot/mtt/lib/examples/Chemical/Reactor/MakeFigure.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/MakeFigure.m +++ mttroot/mtt/lib/examples/Chemical/Reactor/MakeFigure.m @@ -1,42 +0,0 @@ - - -par = Reactor_numpar; # Parameters -sym = Reactor_sympar; # Parameter indices - -F_s= [90:10:500]; # Range of flows - -Z_a = []; Z_b = []; P = []; -for f_s=F_s - par(sym.f_s) = f_s; - [A,B,C,D] = Reactor_sm(par); # Linearised system - - p = sort(eig(A)); - P = [P p]; - - C_a = C([1 3],:); # C vector for c_a and t - D_a = D([1 3],:); # D vector for c_a and t - z_a = tzero(A,B,C_a,D_a); # Transmission zeros for c_a and t - Z_a = [Z_a z_a]; - - C_b = C(2:3,:); # C vector for c_b and t - D_b = D(2:3,:); # D vector for c_b and t - z_b = tzero(A,B,C_b,D_b); # Transmission zeros for c_b and t - Z_b = [Z_b z_b]; -endfor - -grid; xlabel("f_s"); ylabel("p1,p2"); -plot(F_s,P(1:2,:)); -psfig("Reactor_pole_1_2"); - -grid; xlabel("f_s"); ylabel("p3"); -plot(F_s,P(3,:)); -psfig("Reactor_pole_3"); - -grid; xlabel("f_s"); ylabel("z_a"); -plot(F_s,Z_a); -psfig("Reactor_zero_a"); - -grid; xlabel("f_s"); ylabel("z_b"); -plot(F_s,Z_b); -psfig("Reactor_zero_b"); - DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Makefile Index: mttroot/mtt/lib/examples/Chemical/Reactor/Makefile ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Makefile +++ mttroot/mtt/lib/examples/Chemical/Reactor/Makefile @@ -1,13 +0,0 @@ -## Makes the schematic diagram and the (trasmission) zero figure -all: Reactor_pic.ps Reactor_zero_b.ps - -Reactor_pic.ps: Reactor_pic.fig - fig2dev -Lps Reactor_pic.fig> Reactor_pic.ps - -Reactor_zero_b.ps: Reactor_abg.fig - mtt -q Reactor sm m - mtt -q Reactor numpar m; - mtt -q Reactor sympar m; - octave MakeFigure.m - - DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_abg.fig Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_abg.fig +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_abg.fig @@ -1,137 +0,0 @@ -#FIG 3.2 -Portrait -Center -Inches -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3001 8701 3001 7801 3151 7951 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1801 9001 2701 9001 2551 9151 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 8776 2701 9226 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3301 9001 4201 9001 4051 9151 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 4201 9301 3601 9901 3826 9901 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5701 9001 4801 9001 4951 9151 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1800 6000 2700 6000 2550 6150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 10350 5025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 6000 1800 5775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 6225 1800 6000 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 10200 600 10200 600 7500 11100 7500 11100 10200 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 6600 600 6600 600 5400 11100 5400 11100 6600 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5700 8775 5700 9225 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 4425 9300 3975 9300 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 4800 4500 8700 4650 8550 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6000 4800 4800 8700 5025 8625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9000 4800 5100 8700 5400 8700 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 4725 4800 4275 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 4725 4200 4275 4200 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 6225 4800 5775 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 6225 4200 5775 4200 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 4800 8775 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 4200 8775 4200 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3000 7200 3000 6300 3150 6450 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 10500 4800 3300 6000 3525 6075 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 5100 600 5100 600 3300 11100 3300 11100 5100 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4485 2395 4485 4130 4633 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 2999 2395 2999 4130 3148 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5970 2395 5970 4130 6119 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 10428 2397 10428 4132 10577 3843 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 8943 2397 8943 4132 9091 3843 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1800 2100 2700 2100 2550 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3300 2100 4200 2100 4050 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4800 2100 5700 2100 5550 2250 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 4200 1800 3600 1200 3600 1425 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 1875 2700 2325 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 8701 1801 8101 1201 8101 1426 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9301 2101 10201 2101 10051 2251 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 6300 2100 7200 2100 7050 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7800 2100 8700 2100 8550 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 1950 4350 1650 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8550 1950 8850 1650 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 300 600 300 600 2700 11100 2700 11100 300 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3000 4800 3000 5700 3150 5550 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 9301 1801 9901 1201 9901 1426 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 10050 1350 9900 1200 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 1200 9750 1050 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 4801 1801 5401 1201 5401 1426 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5550 1350 5400 1200 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5400 1200 5250 1050 -4 1 0 0 0 0 20 0.0000 4 195 1065 3075 4575 FMR:rfa\001 -4 1 0 0 0 0 20 0.0000 4 195 1065 4575 4575 Rate:AD\001 -4 1 0 0 0 0 20 0.0000 4 195 1050 6000 4575 Rate:AB\001 -4 2 0 0 0 0 20 0.0000 4 255 810 1651 9076 SS:t_0\001 -4 2 0 0 0 0 20 0.0000 4 255 690 3451 9976 C:h_r\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3000 6075 1\001 -4 2 0 0 0 0 20 0.0000 4 210 525 1725 6075 SS:f\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3001 9076 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 4501 9076 0\001 -4 1 0 0 0 0 20 0.0000 4 195 1035 9001 4576 Rate:BC\001 -4 1 0 0 0 0 20 0.0000 4 210 1080 10576 4576 FMR:rfb\001 -4 1 1 1 0 3 20 0.0000 4 195 2595 9600 7800 THERMAL MODEL\001 -4 1 1 1 0 3 20 0.0000 4 195 2865 9450 5700 HYDRAULIC MODEL\001 -4 1 0 0 0 0 20 0.0000 4 195 915 3000 7575 FMR:rt\001 -4 2 0 0 0 0 20 0.0000 4 255 855 1650 2175 SS:c_0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3000 2175 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 4500 2175 0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 6000 2175 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 9001 2176 0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 10501 2176 1\001 -4 1 0 0 0 0 20 0.0000 4 195 375 7500 2175 AF\001 -4 1 0 0 0 0 20 0.0000 4 255 825 8100 1050 C:m_b\001 -4 1 0 0 0 0 20 0.0000 4 240 810 3600 1050 C:m_a\001 -4 1 1 1 0 3 20 0.0000 4 195 3645 9075 600 CONCENTRATION MODEL\001 -4 1 0 0 0 0 20 0.0000 4 210 510 6151 9076 SS:t\001 -4 1 0 0 0 0 20 0.0000 4 255 855 9975 1050 SS:c_b\001 -4 1 0 0 0 0 20 0.0000 4 255 840 5475 1050 SS:c_a\001 -4 1 1 1 0 3 20 0.0000 4 195 2640 9675 3750 REACTION MODEL\001 DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_desc.tex Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_desc.tex +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_desc.tex @@ -1,62 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Reactor (Reactor_desc.tex) -% Generated by MTT on Fri Mar 3 12:43:33 GMT 2000. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\fig{Reactor_pic} -{Reactor_pic} {0.9} {System \textbf{Reactor}, Schematic} - -Figure \Ref{fig:Reactor_pic} is the schematic diagram od a chemical reactor. -The acausal bond graph of system \textbf{Reactor} is displayed in -Figure \Ref{fig:Reactor_abg.ps} and its label file is listed in -Section \Ref{sec:Reactor_lbl}. The subsystems are listed in Section -\Ref{sec:Reactor_sub}. - -This example of a (nonlinear) chemical reactor is due to Trickett and -Bogle\footnote{ K. J. Tricket, \emph{Quantification of Inverse - Responses for Controllability Assessment of Nonlinear Processes}, - PhD Thesis, University College London, 1994} is used in this -section. The reactor has two reaction mechanisms: $\text{A} -\rightarrow \text{B} \rightarrow \text{C}$ and $\text{2A} \rightarrow -\text{D}$. The reactor mass inflow and outflow $f_r$ are identical. -$q$ represents the heat inflow to the reactor. - -This is a two input, two-output unstable nonlinear system with unstable zero -dynamics. -The following figures illustrate the properties of the -\emph{linearised} system. - -\fig{Reactor_pole_1_2} -{Reactor_pole_1_2} {0.9} {System \textbf{Reactor}: poles 1 and 2 - v. steady-state flow $f_s$} - -\fig{Reactor_pole_3} -{Reactor_pole_3} {0.9} {System \textbf{Reactor}: pole 3 - v. steady-state flow $f_s$} - -\fig{Reactor_zero_a} -{Reactor_zero_a} {0.9} {System \textbf{Reactor}: zero of system with - $t$ and $c_a$ as output - v. steady-state flow $f_s$} - -\fig{Reactor_zero_b} -{Reactor_zero_b} {0.9} {System \textbf{Reactor}: pole 3 - v. steady-state flow $f_s$} - -\begin{itemize} -\item Figures \Ref{fig:Reactor_pole_1_2} and - \Ref{fig:Reactor_pole_3} show the three poles of the - \emph{linearised} system as the steady-state flow varies. -\item Figure \Ref{fig:Reactor_zero_a} shows the system zero (when $t$ and - $c_a$ are the two system outputs) as the - \emph{linearised} system as the steady-state flow varies. -\item Figure \Ref{fig:Reactor_zero_b} shows the system zero (when $t$ and - $c_b$ are the two system outputs) as the - \emph{linearised} system as the steady-state flow varies. -\end{itemize} DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_input.txt Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_input.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_input.txt +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_input.txt @@ -1,70 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (Reactor_input.txt) -# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2003/06/06 06:38:02 gawthrop -## Made compatible with current MTT. -## -## Revision 1.2 2000/12/28 18:52:24 peterg -## Updated for new formats -## -## Revision 1.1 2000/12/28 17:09:55 peterg -## To RCS -## -############################################################### - -## Reduce steady-state parameter file (Reactor_sspar.r) -## as siso_sspar ecxept that inputs/states have different meaning -## Steady state for constant c_a, c_b and t=t_s and f=f_s - -## Unit volume Reactor: -v_r = 1; - - -## The exponentials. -e_1 = exp(-q_1/t_s); -e_2 = exp(-q_2/t_s); -e_3 = exp(-q_3/t_s); - -## Solve for the steady-state concentrations -## Solve for ca - a quadratic. -a = k_3*e_3; #ca^2 -b = k_1*e_1 + f_s; #ca^1 -c = -c_0*f_s; - -c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); - -## solve for c_b -c_b = c_a*k_1*e_1/(f_s+k_2*e_2); - - -#States (masses) -x1 = c_a*v_r; -x2 = c_b*v_r; - -#Thermal state -x3 = c_p*t_s*v_r; - - -#Steady-state input q needed to achieve steady-state t_s -q_s = -( (t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); - -## The two inputs at steady-state -u1 = f_s; -u2 = q_s; - - -# Set the inputs -## Removed by MTT on Thu Dec 28 18:44:39 GMT 2000: mttu(1) = u1 + 0.1*u1*(t>0.01); # f (Reactor) -## Removed by MTT on Thu Dec 28 18:44:39 GMT 2000: mttu(2) = u2 + 0.1*u2*(t>0.05) ; # t (Reactor) - - - -## Removed by MTT on Thu Jun 5 12:48:41 BST 2003: reactor_f = u1 + 0.1*u1*(t>0.01); # Added by MTT on Thu Dec 28 18:44:47 GMT 2000 -## Removed by MTT on Thu Jun 5 12:48:41 BST 2003: reactor_t = u2 + 0.1*u2*(t>0.05); # Added by MTT on Thu Dec 28 18:44:47 GMT 2000 -reactor__f = u1 + 0.1*u1*(t>0.01); # f (Reactor) -reactor__t = u2 + 0.1*u2*(t>0.05) ; # t (Reactor) DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_lbl.txt Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_lbl.txt +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_lbl.txt @@ -1,76 +0,0 @@ -%% Label file for system Reactor (Reactor_lbl.txt) -%SUMMARY Reactor: Simple reactor model -%DESCRIPTION Pseudo bond graph reactor model (based on ancient version) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:09:55 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%ALIAS Rate Chemical/Rate - -% Extra variables -%VAR t_s -%VAR f_s -%VAR t_0 -%VAR c_0 -%VAR rho -%VAR v_r -%VAR e_1 -%VAR e_2 -%VAR e_3 -%VAR a -%VAR b -%VAR c -%VAR c_A -%VAR c_B -%VAR x1 -%VAR x2 -%VAR x3 -%VAR q_S -%VAR h -%VAR k -%VAR n -%VAR q - -%VAR u1 -%VAR u2 - -% Port aliases - -% Argument aliases - -%% each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- -% Component type C - m_a lin effort,1 - m_b lin effort,1 - h_r lin effort,c_p - -% Component type FMR - rfa lin effort,1 - rfb lin effort,1 - rt lin effort,c_p - -% Component type Rate - AB Rate k_1,q_1,h_1,1 - BC Rate k_2,q_2,h_2,1 - AD Rate k_3,q_3,h_3,2 - -% Component type SS - c_0 SS c_0,internal - c_a SS external,0 - c_b SS external,0 - f SS internal,external - t SS external,external - t_0 SS t_0,internal DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_numpar.txt Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_numpar.txt +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_numpar.txt @@ -1,84 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (Reactor_numpar.txt) -# Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:09:55 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Dummies -a = 0; # Dummy -b = 0; # Dummy -c = 0; # Dummy -c_0 = 0; # Dummy -c_a = 0; # Dummy -c_b = 0; # Dummy -c_p = 0; # Dummy -e_1 = 0; # Dummy -e_2 = 0; # Dummy -e_3 = 0; # Dummy -f_s = 0; # Dummy -h = 0; # Dummy -h_1 = 0; # Dummy -h_2 = 0; # Dummy -h_3 = 0; # Dummy -k = 0; # Dummy -k_1 = 0; # Dummy -k_2 = 0; # Dummy -k_3 = 0; # Dummy -n = 0; # Dummy -q = 0; # Dummy -q_1 = 0; # Dummy -q_2 = 0; # Dummy -q_3 = 0; # Dummy -q_s = 0; # Dummy -rho = 0; # Dummy -t_0 = 0; # Dummy -t_s = 0; # Dummy -v_r = 0; # Dummy -x1 = 0; # Dummy -x2 = 0; # Dummy -x3 = 0; # Dummy - -## The bulk liquid -rho = 900; # Density -c_p = 5.0; # Specific heat - -## Substance A -k_1 = 2.5e10; # Reaction rate constant -q_1 = 1e4; # Exotherm constant -h_1 = 1e4; # Heat of reaction - -## Substance B -k_2 = 2.65e12; # Reaction rate constant -q_2 = 1.2e4; # Exotherm constant -h_2 = 1.2e4; # Heat of reaction - -## Substance C -k_3 = 6e7; # Reaction rate constant -q_3 = 8e3; # Exotherm constant -h_3 = 3e4; # Heat of reaction - -## Inflow parameters -c_0 = 10; # Inflow conc -t_0 = 530; # Inflow temp - -## Steady-state values -t_s = 530; # Steady-state temp -f_s = 100; # Steady-state flow - - - - - - - - -u1 = 1.0; # Added by MTT on Thu Jun 05 12:45:35 BST 2003 -u2 = 1.0; # Added by MTT on Thu Jun 05 12:45:35 BST 2003 DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_pic.fig Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_pic.fig ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_pic.fig +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_pic.fig @@ -1,52 +0,0 @@ -#FIG 3.2 -Landscape -Center -Inches -Letter -100.00 -Single --2 -1200 2 -6 2400 3150 3225 3375 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2625 3300 2925 3300 -4 0 -1 0 0 2 20 0.0000 4 210 210 2400 3375 A\001 -4 0 -1 0 0 2 20 0.0000 4 210 225 3000 3375 D\001 --6 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 2100 2100 2100 3900 1500 3900 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 1500 4050 3900 4050 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 1500 4350 2100 4350 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2100 3600 3900 4200 3900 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 3600 4350 4200 4350 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 3900 4050 4200 4050 -2 1 1 2 -1 -1 0 0 -1 6.000 0 0 -1 0 0 2 - 2100 2400 3600 2400 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2400 2925 2700 2925 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3000 2925 3300 2925 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 2850 4800 2850 3750 -4 0 -1 0 0 2 20 0.0000 4 210 210 2175 3000 A\001 -4 0 -1 0 0 2 20 0.0000 4 210 195 2775 3000 B\001 -4 0 -1 0 0 2 20 0.0000 4 210 210 3375 3000 C\001 -4 0 -1 0 0 2 20 0.0000 4 210 150 2250 3375 2\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 1875 4950 0\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 2250 4950 0\001 -4 0 -1 0 0 3 20 0.0000 4 210 150 2775 5025 q\001 -4 0 -1 0 0 3 20 0.0000 4 285 765 1500 4800 f , c , t\001 -4 0 -1 0 0 3 20 0.0000 4 285 765 3600 4800 f , c , t\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 3975 4950 b\001 -4 0 -1 0 0 3 12 0.0000 4 90 75 4350 4950 r\001 DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_rep.txt Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_rep.txt +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_rep.txt @@ -1,36 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system Reactor (Reactor_rep.txt) -## Generated by MTT on" Fri Mar 3 12:13:34 GMT 2000. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:09:55 peterg -## To RCS -## -############################################################### - -mtt Reactor abg tex # The system description -mtt Reactor cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt Reactor struc tex # The system structure -## mtt Reactor dae tex # The system dae -mtt Reactor ode tex # The system ode -mtt Reactor sspar tex # Steady-state parameters -mtt Reactor ss tex # Steady state -## mtt Reactor dm tex # Descriptor matrices (of linearised system) -mtt Reactor sm tex # State matrices (of linearised system) -## mtt Reactor tf tex # Transfer function (of linearised system) -## mtt Reactor lmfr ps # log modulus of frequency response (of linearised system) -mtt Reactor simpar tex # Simulation parameters -mtt Reactor numpar tex # Numerical simulation parameters -mtt Reactor input tex # Simulation input -mtt Reactor state tex # Simulation initial state - -## The system outputs -mtt Reactor odeso ps 'Reactor__c_a' -mtt Reactor odeso ps 'Reactor__c_b' -mtt Reactor odeso ps 'Reactor__t' - DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_simp.r Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_simp.r ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_simp.r +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_simp.r @@ -1,21 +0,0 @@ -%% Reduce comands to simplify output (mimo_sim.r) -m_r := rho*v_r; -%mttx1 := c_a*v_r; -%mttx2 := c_b*v_r; - -% THIS MUST BE CHANGED - probs with cp and FMRs -%c_p := 1; - -%let mttx3/c_p = t; - -let e^(q_1/(mttx3/c_p)) = 1/epsilon_1; -let e^(q_2/(mttx3/c_p)) = 1/epsilon_2; -let e^(q_3/(mttx3/c_p)) = 1/epsilon_3; - -let e^(q_1/t_s) = 1/epsilon_1; -let e^(q_2/t_s) = 1/epsilon_2; -let e^(q_3/t_s) = 1/epsilon_3; - -FACTOR mttx1,mttx2; - -END; DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_simpar.txt Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_simpar.txt +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_simpar.txt @@ -1,21 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system Reactor (Reactor_simpar.txt) -# Generated by MTT on Fri Mar 3 12:11:48 GMT 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/08/24 12:32:25 peterg -## Initial revision -## -############################################################### - - -LAST = 0.1; # Last time in simulation -DT = 0.0002; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_sspar.r Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_sspar.r +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_sspar.r @@ -1,57 +0,0 @@ -%% Reduce steady-state parameter file (Reactor_sspar.r) -%% as siso_sspar ecxept that inputs/states have different meaning -%% Steady state for constant c_a, c_b and t=t_s and f=f_s - -%% Unit volume Reactor: -v_r := 1; - -%% Do the inputs first -- this avoids problems with reduce not -%% recognising that complicated expressions are zero - -%% The exponentials. -e_1 := e^(-q_1/t_s); -e_2 := e^(-q_2/t_s); -e_3 := e^(-q_3/t_s); - -%Steady-state input q needed to achieve steady-state t_s -q_s := -( - + (t_0-t_s)*c_p*f_s - + e_1*h_1*k_1*x1 - + e_2*h_2*k_2*x2 - + e_3*h_3*k_3*x1^2 - ); - -%% The two inputs at steady-state -MTTu1 := f_s; -MTTu2 := q_s; - -%States (masses) -x1 := c_a*v_r; -x2 := c_b*v_r; - -%Thermal state -x3 := c_p*t_s*v_r; - -%Load up the vectors -MTTx1 := x1; -MTTx2 := x2; -MTTx3 := x3; - -MTTy1 := c_b; -MTTy2 := t_s; - -%% Finally, solve for the steady-state concentrations -%% Solve for ca - a quadratic. -a := k_3*e_3; %ca^2 -b := k_1*e_1 + f_s; %ca^1 -c := -c_0*f_s; - -c_a := (-b + sqrt(b^2 - 4*a*c))/(2*a); - -%% solve for c_b -c_b := c_a*k_1*e_1/(f_s+k_2*e_2); - - -END; - - DELETED mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_state.txt Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_state.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_state.txt +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_state.txt @@ -1,73 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# State specification (Reactor_state.txt) -# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2003/06/06 06:38:31 gawthrop -## Made compatible with current MTT. -## -## Revision 1.2 2000/12/28 18:52:25 peterg -## Updated for new formats -## -## Revision 1.1 2000/12/28 17:09:55 peterg -## To RCS -## -############################################################### - -## Reduce steady-state parameter file (Reactor_sspar.r) -## as siso_sspar ecxept that states/states have different meaning -## Steady state for constant c_a, c_b and t=t_s and f=f_s - -## Unit volume Reactor: -v_r = 1; - - -## The exponentials. -e_1 = exp(-q_1/t_s); -e_2 = exp(-q_2/t_s); -e_3 = exp(-q_3/t_s); - -## Solve for the steady-state concentrations -## Solve for ca - a quadratic. -a = k_3*e_3; #ca^2 -b = k_1*e_1 + f_s; #ca^1 -c = -c_0*f_s; - -c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); - -## solve for c_b -c_b = c_a*k_1*e_1/(f_s+k_2*e_2); - - -#States (masses) -x1 = c_a*v_r; -x2 = c_b*v_r; - -#Thermal state -x3 = c_p*t_s*v_r; - - -#Steady-state state q needed to achieve steady-state t_s -q_s = -((t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); - -## The two inputs at steady-state -u1 = f_s; -u2 = q_s; - -## Load up the states -## Removed by MTT on Thu Dec 28 18:46:20 GMT 2000: mttx(1) = x1; -## Removed by MTT on Thu Dec 28 18:46:20 GMT 2000: mttx(2) = x2; -## Removed by MTT on Thu Dec 28 18:46:20 GMT 2000: mttx(3) = x3; - - - - -## Removed by MTT on Thu Jun 5 12:47:23 BST 2003: reactor_h_r = x3; # Added by MTT on Thu Dec 28 18:46:25 GMT 2000 -## Removed by MTT on Thu Jun 5 12:47:23 BST 2003: reactor_m_a = x1; # Added by MTT on Thu Dec 28 18:46:25 GMT 2000 -## Removed by MTT on Thu Jun 5 12:47:23 BST 2003: reactor_m_b = x2; # Added by MTT on Thu Dec 28 18:46:25 GMT 2000 -reactor__h_r = x3; -reactor__m_a = x1; -reactor__m_b = x2; DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/MakeFigure.m Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/MakeFigure.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/MakeFigure.m +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/MakeFigure.m @@ -1,22 +0,0 @@ -## Makes the figures - -par = ReactorTF_numpar; # Parameters -sym = ReactorTF_sympar; # Parameter indices - -F_s= [90:10:500]; # Range of flows - -Z = []; -for f_s=F_s - par(sym.f_s) = f_s; - z = sort(eig(ReactorTF_sm(par))); - Z = [Z z]; -endfor - - -grid; xlabel("f_s"); ylabel("z_1"); -plot(F_s,Z(1,:)); -psfig("ReactorTF_zero_1"); - -grid; xlabel("f_s"); ylabel("z_2"); -plot(F_s,Z(2,:)); -psfig("ReactorTF_zero_2"); DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/Makefile Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/Makefile ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/Makefile +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/Makefile @@ -1,14 +0,0 @@ -## Makes the schematic diagram and the zero figure -all: ReactorTF_pic.ps ReactorTF_zero_1.ps ReactorTF_zero_2.ps - -ReactorTF_pic.ps: ReactorTF_pic.fig - fig2dev -Lps ReactorTF_pic.fig> ReactorTF_pic.ps - -ReactorTF_zero_1.ps: ReactorTF_abg.fig - mtt -q ReactorTF sm m; mtt -q ReactorTF numpar m; - mtt -q ReactorTF sympar m; - octave MakeFigure.m - -ReactorTF_zero_2.ps: ReactorTF_zero_1.ps - touch ReactorTF_zero_2.ps - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_abg.fig Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_abg.fig +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_abg.fig @@ -1,130 +0,0 @@ -#FIG 3.2 -Portrait -Center -Inches -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3001 8701 3001 7801 3151 7951 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1801 9001 2701 9001 2551 9151 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 8776 2701 9226 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3301 9001 4201 9001 4051 9151 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 4201 9301 3601 9901 3826 9901 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5701 9001 4801 9001 4951 9151 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1800 6000 2700 6000 2550 6150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 10350 5025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 6000 1800 5775 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 10200 600 10200 600 7500 11100 7500 11100 10200 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 6600 600 6600 600 5400 11100 5400 11100 6600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 4800 4500 8700 4650 8550 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6000 4800 4800 8700 5025 8625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9000 4800 5100 8700 5400 8700 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 4725 4800 4275 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 4725 4200 4275 4200 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 6225 4800 5775 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 6225 4200 5775 4200 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 4800 8775 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 4200 8775 4200 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3000 7200 3000 6300 3150 6450 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 10500 4800 3300 6000 3525 6075 -2 4 1 2 1 7 1 0 -1 4.000 0 0 7 0 0 5 - 11100 5100 600 5100 600 3300 11100 3300 11100 5100 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4485 2395 4485 4130 4633 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 2999 2395 2999 4130 3148 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5970 2395 5970 4130 6119 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 10428 2397 10428 4132 10577 3843 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 8943 2397 8943 4132 9091 3843 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1800 2100 2700 2100 2550 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3300 2100 4200 2100 4050 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4800 2100 5700 2100 5550 2250 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 4200 1800 3600 1200 3600 1425 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 1875 2700 2325 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 8701 1801 8101 1201 8101 1426 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9301 2101 10201 2101 10051 2251 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 9301 1801 9901 1201 9901 1426 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 6300 2100 7200 2100 7050 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7800 2100 8700 2100 8550 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 1950 4350 1650 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 10050 1350 9900 1200 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 1200 9750 1050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8550 1950 8850 1650 -2 4 1 2 1 7 1 0 -1 4.000 0 0 7 0 0 5 - 11100 300 600 300 600 2700 11100 2700 11100 300 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3000 4800 3000 5700 3150 5550 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 4800 8775 4800 9000 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 5700 9000 5700 9225 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 6225 2700 6000 -4 1 0 0 0 0 20 0.0000 4 195 1065 3075 4575 FMR:rfa\001 -4 1 0 0 0 0 20 0.0000 4 195 1065 4575 4575 Rate:AD\001 -4 1 0 0 0 0 20 0.0000 4 195 1050 6000 4575 Rate:AB\001 -4 2 0 0 0 0 20 0.0000 4 255 810 1651 9076 SS:t_0\001 -4 2 0 0 0 0 20 0.0000 4 255 690 3451 9976 C:h_r\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3000 6075 1\001 -4 2 0 0 0 0 20 0.0000 4 210 525 1725 6075 SS:f\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3001 9076 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 4501 9076 0\001 -4 1 0 0 0 0 20 0.0000 4 195 1035 9001 4576 Rate:BC\001 -4 1 0 0 0 0 20 0.0000 4 210 1080 10576 4576 FMR:rfb\001 -4 1 1 1 0 3 20 0.0000 4 195 2595 9600 7800 THERMAL MODEL\001 -4 1 0 0 0 0 20 0.0000 4 195 915 3000 7575 FMR:rt\001 -4 1 1 1 0 3 20 0.0000 4 195 2640 9675 3750 REACTION MODEL\001 -4 2 0 0 0 0 20 0.0000 4 255 855 1650 2175 SS:c_0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3000 2175 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 4500 2175 0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 6000 2175 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 9001 2176 0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 10501 2176 1\001 -4 1 0 0 0 0 20 0.0000 4 195 375 7500 2175 AF\001 -4 1 0 0 0 0 20 0.0000 4 255 825 8100 1050 C:m_b\001 -4 1 0 0 0 0 20 0.0000 4 255 855 9975 1050 SS:c_b\001 -4 1 0 0 0 0 20 0.0000 4 240 810 3600 1050 C:m_a\001 -4 1 1 1 0 3 20 0.0000 4 195 3645 9075 600 CONCENTRATION MODEL\001 -4 1 0 0 0 0 20 0.0000 4 210 510 6151 9076 SS:t\001 -4 1 1 1 0 3 20 0.0000 4 195 2865 9450 5700 HYDRAULIC MODEL\001 DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_args.new Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_args.new ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_args.new +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_args.new @@ -1,1 +0,0 @@ - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_desc.tex Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_desc.tex +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_desc.tex @@ -1,50 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system ReactorTF (ReactorTF_desc.tex) -% Generated by MTT on Fri Mar 3 12:43:33 GMT 2000. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\fig{ReactorTF_pic} -{ReactorTF_pic} {0.9} {System \textbf{ReactorTF}, Schematic} - -Figure \Ref{fig:ReactorTF_pic} is the schematic diagram of a chemical -reactor. - -The acausal bond graph of system \textbf{ReactorTF} is displayed in -Figure \Ref{fig:ReactorTF_abg.ps} and its label file is listed in -Section \Ref{sec:ReactorTF_lbl}. The subsystems are listed in Section -\Ref{sec:ReactorTF_sub}. - -This example of a (nonlinear) chemical reactor is due to Trickett and -Bogle\footnote{ K. J. Tricket, \emph{Quantification of Inverse - Responses for Controllability Assessment of Nonlinear Processes}, - PhD Thesis, University College London, 1994} is used in this -section. The reactor has two reaction mechanisms: $\text{A} -\rightarrow \text{B} \rightarrow \text{C}$ and $\text{2A} \rightarrow -\text{D}$. The reactor mass inflow and outflow $f_r$ are identical. -$q$ represents the heat inflow to the reactor. - -The control loop $t$/$f$ has been inverted. The resulting SISO -system has two interpretations: -\begin{enumerate} -\item the \emph{dynamics} of the $c_b$/$q$ loop when the $t$/$f$ loop - is under perfect control and -\item the \emph{inverse} dynamics of the $t$/$f$ loop. -\end{enumerate} - -\fig{ReactorTF_zero_1} {ReactorTF_zero_1} {0.9} -{System\textbf{ReactorTF}: zero 1 v flow} -\fig{ReactorTF_zero_2} {ReactorTF_zero_2} {0.9} -{System\textbf{ReactorTF}: zero 2 v flow} - -Figures \Ref{fig:ReactorTF_zero_1} and \Ref{fig:ReactorTF_zero_2} -shows the poles of the linearised system as the steady-state flow -varies: these are the \emph{zeros} of the $t$/$f$ control-loop when -the $c_b$/$q$ loop is \emph{open}. - - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt @@ -1,55 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (ReactorTF_input.txt) -# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2003/06/06 06:38:44 gawthrop -## Made compatible with current MTT. -## -## Revision 1.1 2000/12/28 17:12:57 peterg -## To RCS -## -############################################################### - -## Reduce steady-state parameter file (ReactorTF_sspar.r) -## as siso_sspar ecxept that inputs/states have different meaning -## Steady state for constant c_a, c_b and t=t_s and f=f_s - -## Unit volume ReactorTF: -v_r = 1; - - -## The exponentials. -e_1 = exp(-q_1/t_s); -e_2 = exp(-q_2/t_s); -e_3 = exp(-q_3/t_s); - -## Solve for the steady-state concentrations -## Solve for ca - a quadratic. -a = k_3*e_3; #ca^2 -b = k_1*e_1 + f_s; #ca^1 -c = -c_0*f_s; - -c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); - -## solve for c_b -c_b = c_a*k_1*e_1/(f_s+k_2*e_2); - - -#States (masses) -x1 = c_a*v_r; -x2 = c_b*v_r; - -#Thermal state -#x3 = c_p*t_s*v_r; - - -#Steady-state input q needed to achieve steady-state t_s -q_s = -( (t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); - -# Set the inputs -## Removed by MTT on Thu Jun 5 14:13:24 BST 2003: mttu(1) = q_s + 0.1*q_s*(t>0.01); # q (ReactorTF) -reactortf__t = q_s + 0.1*q_s*(t>0.01); # q (ReactorTF) DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_lbl.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_lbl.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_lbl.txt @@ -1,77 +0,0 @@ -%% Label file for system ReactorTF (ReactorTF_lbl.txt) -%SUMMARY ReactorTF: Simple reactor model -- TF loop inverted -%DESCRIPTION Pseudo bond graph reactor model (based on ancient version) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:12:57 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%ALIAS Rate Chemical/Rate - -% Extra variables -%VAR t_s -%VAR f_s -%VAR t_0 -%VAR c_0 -%VAR rho -%VAR v_r -%VAR e_1 -%VAR e_2 -%VAR e_3 -%VAR a -%VAR b -%VAR c -%VAR c_A -%VAR c_B -%VAR x1 -%VAR x2 -%VAR x3 -%VAR q_S - -%VAR h -%VAR k -%VAR n -%VAR q - - -% Port aliases - -% Argument aliases - -%% each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- -% Component type C - m_a lin effort,1 - m_b lin effort,1 - h_r lin effort,c_p - -% Component type FMR - rfa lin effort,1 - rfb lin effort,1 - rt lin effort,c_p - -% Component type Rate - AB Rate k_1,q_1,h_1,1 - BC Rate k_2,q_2,h_2,1 - AD Rate k_3,q_3,h_3,2 - -% Component type SS - c_0 SS c_0,internal - c_b SS external,0 - f SS internal,internal - t SS t_s,external - t_0 SS t_0,internal - - - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.m Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.m +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.m @@ -1,186 +0,0 @@ -function mttpar = ReactorTF_numpar(); -% mttpar = ReactorTF_numpar(); -%System ReactorTF, representation numpar, language m; -%File ReactorTF_numpar.m; -%Generated by MTT on Thu Aug 24 14:28:46 BST 2000; -% - -#====== Set up the global variables ======# -global ... - a ... - b ... - c ... - c_0 ... - c_a ... - c_b ... - c_p ... - e_1 ... - e_2 ... - e_3 ... - f_s ... - h ... - h_1 ... - h_2 ... - h_3 ... - k ... - k_1 ... - k_2 ... - k_3 ... - n ... - q ... - q_1 ... - q_2 ... - q_3 ... - q_s ... - rho ... - t_0 ... - t_s ... - v_r ... - x1 ... - x2 ... - x3 ; -## Set parameters to zero - a = 0.0; - b = 0.0; - c = 0.0; - c_0 = 0.0; - c_a = 0.0; - c_b = 0.0; - c_p = 0.0; - e_1 = 0.0; - e_2 = 0.0; - e_3 = 0.0; - f_s = 0.0; - h = 0.0; - h_1 = 0.0; - h_2 = 0.0; - h_3 = 0.0; - k = 0.0; - k_1 = 0.0; - k_2 = 0.0; - k_3 = 0.0; - n = 0.0; - q = 0.0; - q_1 = 0.0; - q_2 = 0.0; - q_3 = 0.0; - q_s = 0.0; - rho = 0.0; - t_0 = 0.0; - t_s = 0.0; - v_r = 0.0; - x1 = 0.0; - x2 = 0.0; - x3 = 0.0; - % -*-octave-*- Put Emacs into octave-mode - % Numerical parameter file (ReactorTF_numpar.txt) - % Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 - - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % %% Version control history - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % %% $Id$ - % %% $Log$ - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - % -a = 0; % Dummy -b = 0; % Dummy -c = 0; % Dummy -c_0 = 0; % Dummy -c_a = 0; % Dummy -c_b = 0; % Dummy -c_p = 0; % Dummy -e_1 = 0; % Dummy -e_2 = 0; % Dummy -e_3 = 0; % Dummy -f_s = 0; % Dummy -h = 0; % Dummy -h_1 = 0; % Dummy -h_2 = 0; % Dummy -h_3 = 0; % Dummy -k = 0; % Dummy -k_1 = 0; % Dummy -k_2 = 0; % Dummy -k_3 = 0; % Dummy -n = 0; % Dummy -q = 0; % Dummy -q_1 = 0; % Dummy -q_2 = 0; % Dummy -q_3 = 0; % Dummy -q_s = 0; % Dummy -rho = 0; % Dummy -t_0 = 0; % Dummy -t_s = 0; % Dummy -v_r = 0; % Dummy -x1 = 0; % Dummy -x2 = 0; % Dummy -x3 = 0; % Dummy - - % -rho = 900; % Density -c_p = 5.0; % Specific heat - - % -k_1 = 2.5e10; % Reaction rate constant -q_1 = 1e4; % Exotherm constant -h_1 = 1e4; % Heat of reaction - - % -k_2 = 2.65e12; % Reaction rate constant -q_2 = 1.2e4; % Exotherm constant -h_2 = 1.2e4; % Heat of reaction - - % -k_3 = 6e7; % Reaction rate constant -q_3 = 8e3; % Exotherm constant -h_3 = 3e4; % Heat of reaction - - % -c_0 = 10; % Inflow conc -t_0 = 500; % Inflow temp - - % -t_s = 530; % Steady-state temp -f_s = 100; % Steady-state flow - - - - - - - - -## Set up the parameter vector - mttpar(1) = a; - mttpar(2) = b; - mttpar(3) = c; - mttpar(4) = c_0; - mttpar(5) = c_a; - mttpar(6) = c_b; - mttpar(7) = c_p; - mttpar(8) = e_1; - mttpar(9) = e_2; - mttpar(10) = e_3; - mttpar(11) = f_s; - mttpar(12) = h; - mttpar(13) = h_1; - mttpar(14) = h_2; - mttpar(15) = h_3; - mttpar(16) = k; - mttpar(17) = k_1; - mttpar(18) = k_2; - mttpar(19) = k_3; - mttpar(20) = n; - mttpar(21) = q; - mttpar(22) = q_1; - mttpar(23) = q_2; - mttpar(24) = q_3; - mttpar(25) = q_s; - mttpar(26) = rho; - mttpar(27) = t_0; - mttpar(28) = t_s; - mttpar(29) = v_r; - mttpar(30) = x1; - mttpar(31) = x2; - mttpar(32) = x3; DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_numpar.txt @@ -1,79 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (ReactorTF_numpar.txt) -# Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Dummies -a = 0; # Dummy -b = 0; # Dummy -c = 0; # Dummy -c_0 = 0; # Dummy -c_a = 0; # Dummy -c_b = 0; # Dummy -c_p = 0; # Dummy -e_1 = 0; # Dummy -e_2 = 0; # Dummy -e_3 = 0; # Dummy -f_s = 0; # Dummy -h = 0; # Dummy -h_1 = 0; # Dummy -h_2 = 0; # Dummy -h_3 = 0; # Dummy -k = 0; # Dummy -k_1 = 0; # Dummy -k_2 = 0; # Dummy -k_3 = 0; # Dummy -n = 0; # Dummy -q = 0; # Dummy -q_1 = 0; # Dummy -q_2 = 0; # Dummy -q_3 = 0; # Dummy -q_s = 0; # Dummy -rho = 0; # Dummy -t_0 = 0; # Dummy -t_s = 0; # Dummy -v_r = 0; # Dummy -x1 = 0; # Dummy -x2 = 0; # Dummy -x3 = 0; # Dummy - -## The bulk liquid -rho = 900; # Density -c_p = 5.0; # Specific heat - -## Substance A -k_1 = 2.5e10; # Reaction rate constant -q_1 = 1e4; # Exotherm constant -h_1 = 1e4; # Heat of reaction - -## Substance B -k_2 = 2.65e12; # Reaction rate constant -q_2 = 1.2e4; # Exotherm constant -h_2 = 1.2e4; # Heat of reaction - -## Substance C -k_3 = 6e7; # Reaction rate constant -q_3 = 8e3; # Exotherm constant -h_3 = 3e4; # Heat of reaction - -## Inflow parameters -c_0 = 10; # Inflow conc -t_0 = 500; # Inflow temp - -## Steady-state values -t_s = 530; # Steady-state temp -f_s = 100; # Steady-state flow - - - - - - - - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_pic.fig Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_pic.fig ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_pic.fig +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_pic.fig @@ -1,52 +0,0 @@ -#FIG 3.2 -Landscape -Center -Inches -Letter -100.00 -Single --2 -1200 2 -6 2400 3150 3225 3375 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2625 3300 2925 3300 -4 0 -1 0 0 2 20 0.0000 4 210 210 2400 3375 A\001 -4 0 -1 0 0 2 20 0.0000 4 210 225 3000 3375 D\001 --6 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 2100 2100 2100 3900 1500 3900 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 1500 4050 3900 4050 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 1500 4350 2100 4350 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2100 3600 3900 4200 3900 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 3600 4350 4200 4350 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 3900 4050 4200 4050 -2 1 1 2 -1 -1 0 0 -1 6.000 0 0 -1 0 0 2 - 2100 2400 3600 2400 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2400 2925 2700 2925 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3000 2925 3300 2925 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 2850 4800 2850 3750 -4 0 -1 0 0 2 20 0.0000 4 210 210 2175 3000 A\001 -4 0 -1 0 0 2 20 0.0000 4 210 195 2775 3000 B\001 -4 0 -1 0 0 2 20 0.0000 4 210 210 3375 3000 C\001 -4 0 -1 0 0 2 20 0.0000 4 210 150 2250 3375 2\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 1875 4950 0\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 2250 4950 0\001 -4 0 -1 0 0 3 20 0.0000 4 210 150 2775 5025 q\001 -4 0 -1 0 0 3 20 0.0000 4 285 765 1500 4800 f , c , t\001 -4 0 -1 0 0 3 20 0.0000 4 285 765 3600 4800 f , c , t\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 3975 4950 b\001 -4 0 -1 0 0 3 12 0.0000 4 90 75 4350 4950 r\001 DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.tex Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.tex ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.tex +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.tex @@ -1,152 +0,0 @@ - - -\section{\textbf{ReactorTF}: representation \textbf{abg}, language \textbf{tex}} -\label{sec:ReactorTF_abg.tex} -\index{\textbf{ReactorTF} -- abg} - - -MTT command: -\begin{verbatim} -mtt ReactorTF abg tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_abg.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{cbg}, language \textbf{ps}} -\label{sec:ReactorTF_cbg.ps} -\index{\textbf{ReactorTF} -- cbg} - - -MTT command: -\begin{verbatim} -mtt ReactorTF cbg ps -\end{verbatim} -This representation is given as Figure \Ref{fig:ReactorTF_cbg.ps}. -\fig{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_cbg} - {ReactorTF_cbg.ps} - {0.9} - {System \textbf{ReactorTF}, representation cbg} - - -\section{\textbf{ReactorTF}: representation \textbf{struc}, language \textbf{tex}} -\label{sec:ReactorTF_struc.tex} -\index{\textbf{ReactorTF} -- struc} - - -MTT command: -\begin{verbatim} -mtt ReactorTF struc tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_struc.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{ode}, language \textbf{tex}} -\label{sec:ReactorTF_ode.tex} -\index{\textbf{ReactorTF} -- ode} - - -MTT command: -\begin{verbatim} -mtt ReactorTF ode tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_ode.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{sspar}, language \textbf{tex}} -\label{sec:ReactorTF_sspar.tex} -\index{\textbf{ReactorTF} -- sspar} - - -MTT command: -\begin{verbatim} -mtt ReactorTF sspar tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_sspar.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{ss}, language \textbf{tex}} -\label{sec:ReactorTF_ss.tex} -\index{\textbf{ReactorTF} -- ss} - - -MTT command: -\begin{verbatim} -mtt ReactorTF ss tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_ss.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{sm}, language \textbf{tex}} -\label{sec:ReactorTF_sm.tex} -\index{\textbf{ReactorTF} -- sm} - - -MTT command: -\begin{verbatim} -mtt ReactorTF sm tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_sm.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{simpar}, language \textbf{tex}} -\label{sec:ReactorTF_simpar.tex} -\index{\textbf{ReactorTF} -- simpar} - - -MTT command: -\begin{verbatim} -mtt ReactorTF simpar tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_simpar.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{numpar}, language \textbf{tex}} -\label{sec:ReactorTF_numpar.tex} -\index{\textbf{ReactorTF} -- numpar} - - -MTT command: -\begin{verbatim} -mtt ReactorTF numpar tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_numpar.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{input}, language \textbf{tex}} -\label{sec:ReactorTF_input.tex} -\index{\textbf{ReactorTF} -- input} - - -MTT command: -\begin{verbatim} -mtt ReactorTF input tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_input.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{state}, language \textbf{tex}} -\label{sec:ReactorTF_state.tex} -\index{\textbf{ReactorTF} -- state} - - -MTT command: -\begin{verbatim} -mtt ReactorTF state tex -\end{verbatim} - \input{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_state.tex} - - -\section{\textbf{ReactorTF}: representation \textbf{odeso}, language \textbf{ps}} -\label{sec:ReactorTF_odeso.ps} -\index{\textbf{ReactorTF} -- odeso} - - -MTT command: -\begin{verbatim} -mtt ReactorTF odeso ps -\end{verbatim} -This representation is given as Figure \Ref{fig:ReactorTF_odeso.ps}. -\fig{/home/peterg/JUNK/Reactor/ReactorTF/MTT_work/ReactorTF_odeso} - {ReactorTF_odeso.ps} - {0.9} - {System \textbf{ReactorTF}, representation odeso} DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_rep.txt @@ -1,32 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system ReactorTF (ReactorTF_rep.txt) -## Generated by MTT on" Fri Mar 3 12:13:34 GMT 2000. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:12:57 peterg -## To RCS -## -############################################################### - -mtt ReactorTF abg tex # The system description -mtt ReactorTF cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt ReactorTF struc tex # The system structure -## mtt ReactorTF dae tex # The system dae -mtt ReactorTF ode tex # The system ode -mtt ReactorTF sspar tex # Steady-state parameters -mtt ReactorTF ss tex # Steady state -## mtt ReactorTF dm tex # Descriptor matrices (of linearised system) -mtt ReactorTF sm tex # State matrices (of linearised system) -## mtt ReactorTF tf tex # Transfer function (of linearised system) -## mtt ReactorTF lmfr ps # log modulus of frequency response (of linearised system) -mtt ReactorTF simpar tex # Simulation parameters -mtt ReactorTF numpar tex # Numerical simulation parameters -mtt ReactorTF input tex # Simulation input -mtt ReactorTF state tex # Simulation initial state -mtt ReactorTF odeso ps # Simulation - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simp.r Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simp.r ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simp.r +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simp.r @@ -1,21 +0,0 @@ -%% Reduce comands to simplify output (mimo_sim.r) -m_r := rho*v_r; -%mttx1 := c_a*v_r; -%mttx2 := c_b*v_r; - -% THIS MUST BE CHANGED - probs with cp and FMRs -%c_p := 1; - -%let mttx3/c_p = t; - -let e^(q_1/(mttx3/c_p)) = 1/epsilon_1; -let e^(q_2/(mttx3/c_p)) = 1/epsilon_2; -let e^(q_3/(mttx3/c_p)) = 1/epsilon_3; - -let e^(q_1/t_s) = 1/epsilon_1; -let e^(q_2/t_s) = 1/epsilon_2; -let e^(q_3/t_s) = 1/epsilon_3; - -FACTOR mttx1,mttx2; - -END; DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simpar.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simpar.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system ReactorTF (ReactorTF_simpar.txt) -# Generated by MTT on Fri Mar 3 12:11:48 GMT 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 0.05; # Last time in simulation -DT = 0.0002; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sm.m Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sm.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sm.m +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sm.m @@ -1,185 +0,0 @@ -function [mtta,mttb,mttc,mttd] = ReactorTF_sm(mttpar); -% [mtta,mttb,mttc,mttd] = ReactorTF_sm(mttpar); -%System ReactorTF, representation sm, language m; -%File ReactorTF_sm.m; -%Generated by MTT on Thu Aug 24 14:45:50 BST 2000; -% -%====== Set up the global variables ======% -global ... -a ... -b ... -c ... -c_0 ... -c_a ... -c_b ... -c_p ... -e_1 ... -e_2 ... -e_3 ... -f_s ... -h ... -h_1 ... -h_2 ... -h_3 ... -k ... -k_1 ... -k_2 ... -k_3 ... -n ... -q ... -q_1 ... -q_2 ... -q_3 ... -q_s ... -rho ... -t_0 ... -t_s ... -v_r ... -x1 ... -x2 ... -x3 ; -a = mttpar(1); -b = mttpar(2); -c = mttpar(3); -c_0 = mttpar(4); -c_a = mttpar(5); -c_b = mttpar(6); -c_p = mttpar(7); -e_1 = mttpar(8); -e_2 = mttpar(9); -e_3 = mttpar(10); -f_s = mttpar(11); -h = mttpar(12); -h_1 = mttpar(13); -h_2 = mttpar(14); -h_3 = mttpar(15); -k = mttpar(16); -k_1 = mttpar(17); -k_2 = mttpar(18); -k_3 = mttpar(19); -n = mttpar(20); -q = mttpar(21); -q_1 = mttpar(22); -q_2 = mttpar(23); -q_3 = mttpar(24); -q_s = mttpar(25); -rho = mttpar(26); -t_0 = mttpar(27); -t_s = mttpar(28); -v_r = mttpar(29); -x1 = mttpar(30); -x2 = mttpar(31); -x3 = mttpar(32); -%a matrix% -mtta = zeros(2,2); -mtt_t1 = exp((2.0*q_1+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s^2*h_3; -mtt_t1 = mtt_t1+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_0*f_s*h_3*k_3; -mtt_t1 = mtt_t1-(exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s*h_1*k_1); -mtt_t1 = mtt_t1+2.0*exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s*h_3*k_1; -mtt_t1 = mtt_t1-(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))^2*c_0*h_1*k_1*k_3); -mtt_t1 = mtt_t1+2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))^2*c_0*h_3*k_1*k_3; -mtt_t1 = mtt_t1-(exp(q_3/t_s)*abs(exp(q_1/t_s))^2*h_1*k_1^2); -mtt_t1 = mtt_t1+exp(q_3/t_s)*abs(exp(q_1/t_s))^2*h_3*k_1^2; -mtt_t3 = 2.0*exp((2.0*q_1+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t4 = 2.0*exp((2.0*q_1)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t4 = mtt_t4*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1-(mtt_t3*abs(exp(q_1/t_s))*f_s*h_3)-(mtt_t4*abs(exp(q_1/t_s))*c_0*h_3*k_3); -mtt_t5 = 2.0*exp((2.0*q_1)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t5 = mtt_t5*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t3 = 2.0*exp((2.0*q_1)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1-(mtt_t5*abs(exp(q_1/t_s))*c_p*k_3*t_0)+mtt_t3*abs(exp(q_1/t_s))*c_p*k_3*t_s; -mtt_t4 = exp((q_1+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t4 = mtt_t4*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t3 = 2.0*exp((q_1+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1+mtt_t4*abs(exp(q_1/t_s))*h_1*k_1-(mtt_t3*abs(exp(q_1/t_s))*h_3*k_1); -mtt_t1 = mtt_t1+exp((4.0*q_1+q_3)/t_s)*f_s^2*h_3; -mtt_t1 = mtt_t1+4.0*exp((4.0*q_1)/t_s)*c_0*f_s*h_3*k_3; -mtt_t1 = mtt_t1+2.0*exp((3.0*q_1+q_3)/t_s)*f_s*h_3*k_1; -mtt_t1 = mtt_t1+exp((2.0*q_1+q_3)/t_s)*h_3*k_1^2; -mtt_t2 = 2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_3*t_0; -mtta(1,1) = mtt_t1/(mtt_t2-(2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_3*t_s)); -mtt_t1 = -(exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*h_2*k_2); -mtt_t1 = mtt_t1-(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_0*h_2*k_2*k_3); -mtt_t3 = exp((q_1+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1-(exp(q_3/t_s)*abs(exp(q_1/t_s))*h_2*k_1*k_2)+mtt_t3*h_2*k_2; -mtt_t2 = 2.0*exp((q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*k_3*t_0; -mtta(1,2) = mtt_t1/(mtt_t2-(2.0*exp((q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*k_3*t_s)); -mtt_t1 = exp((2.0*q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s^2*h_3*k_1; -mtt_t1 = mtt_t1+2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))^2*c_p*f_s*k_1*k_3*t_0; -mtt_t1 = mtt_t1-(2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))^2*c_p*f_s*k_1*k_3*t_s); -mtt_t1 = mtt_t1+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_1*k_2*k_3*t_0; -mtt_t1 = mtt_t1-(2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_1*k_2*k_3*t_s); -mtt_t1 = mtt_t1-(exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s*h_1*k_1^2); -mtt_t1 = mtt_t1+2.0*exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*f_s*h_3*k_1^2; -mtt_t1 = mtt_t1-(exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*h_1*k_1^3); -mtt_t1 = mtt_t1+exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))^2*h_3*k_1^3; -mtt_t3 = 2.0*exp((2.0*q_1+q_2+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t4 = exp((q_1+q_2+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t4 = mtt_t4*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1-(mtt_t3*abs(exp(q_1/t_s))*f_s*h_3*k_1)+mtt_t4*abs(exp(q_1/t_s))*h_1*k_1^2; -mtt_t5 = 2.0*exp((q_1+q_2+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t5 = mtt_t5*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1-(mtt_t5*abs(exp(q_1/t_s))*h_3*k_1^2); -mtt_t1 = mtt_t1+exp((4.0*q_1+q_2+q_3)/t_s)*f_s^2*h_3*k_1; -mtt_t1 = mtt_t1+4.0*exp((4.0*q_1+q_2)/t_s)*c_0*f_s*h_3*k_1*k_3; -mtt_t1 = mtt_t1+2.0*exp((3.0*q_1+q_2+q_3)/t_s)*f_s*h_3*k_1^2; -mtt_t1 = mtt_t1+exp((2.0*q_1+q_2+q_3)/t_s)*h_3*k_1^3; -mtt_t2 = 2.0*exp((3.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))^2*c_p*f_s*k_3*t_0; -mtt_t2 = mtt_t2-(2.0*exp((3.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))^2*c_p*f_s*k_3*t_s); -mtt_t2 = mtt_t2+2.0*exp((3.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_2*k_3*t_0; -mtta(2,1) = mtt_t1/(mtt_t2-(2.0*exp((3.0*q_1)/t_s)*abs(exp(q_1/t_s))^2*c_p*k_2*k_3*t_s)); -mtt_t1 = -(2.0*exp((2.0*q_1+2.0*q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s^2*k_3*t_0); -mtt_t1 = mtt_t1+2.0*exp((2.0*q_1+2.0*q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s^2*k_3*t_s; -mtt_t1 = mtt_t1-(4.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_2*k_3*t_0); -mtt_t1 = mtt_t1+4.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_2*k_3*t_s; -mtt_t1 = mtt_t1-(2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*c_p*k_2^2*k_3*t_0); -mtt_t1 = mtt_t1+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*c_p*k_2^2*k_3*t_s; -mtt_t1 = mtt_t1-(exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*h_2*k_1*k_2); -mtt_t1 = mtt_t1-(exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))*h_2*k_1^2*k_2); -mtt_t3 = exp((q_1+q_2+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1+mtt_t3*h_2*k_1*k_2; -mtt_t2 = 2.0*exp((2.0*q_1+2.0*q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_3*t_0; -mtt_t2 = mtt_t2-(2.0*exp((2.0*q_1+2.0*q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_3*t_s); -mtt_t2 = mtt_t2+2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*k_2*k_3*t_0; -mtta(2,2) = mtt_t1/(mtt_t2-(2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*k_2*k_3*t_s)); -%b matrix% -mttb = zeros(2,1); -mtt_t1 = -(exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))*f_s); -mtt_t1 = mtt_t1-(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_0*k_3); -mtt_t1 = mtt_t1-(exp(q_3/t_s)*abs(exp(q_1/t_s))*k_1); -mtt_t3 = exp((q_1+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t1 = mtt_t1+mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t4 = 2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_p*k_3*t_0; -mttb(1) = mtt_t1/(mtt_t4-(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_p*k_3*t_s)); -mtt_t1 = -(exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*k_1); -mtt_t3 = exp((q_1+q_2+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1-(exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))*k_1^2)+mtt_t3*k_1; -mtt_t2 = 2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_3*t_0; -mtt_t2 = mtt_t2-(2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*c_p*f_s*k_3*t_s); -mtt_t2 = mtt_t2+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*c_p*k_2*k_3*t_0; -mttb(2) = mtt_t1/(mtt_t2-(2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*c_p*k_2*k_3*t_s)); -%c matrix% -mttc = zeros(1,2); -mttc(1,2) = 1.0; -%d matrix% -mttd = zeros(1,1); DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sspar.r Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sspar.r +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sspar.r @@ -1,55 +0,0 @@ -%% Reduce steady-state parameter file (ReactorTF_sspar.r) -%% as siso_sspar ecxept that inputs/states have different meaning -%% Steady state for constant c_a, c_b and t=t_s and f=f_s - -%% Unit volume ReactorTF: -v_r := 1; - -%% Do the inputs first -- this avoids problems with reduce not -%% recognising that complicated expressions are zero - -%% The exponentials. -e_1 := e^(-q_1/t_s); -e_2 := e^(-q_2/t_s); -e_3 := e^(-q_3/t_s); - -%Steady-state input q needed to achieve steady-state t_s -q_s := -( - + (t_0-t_s)*c_p*f_s - + e_1*h_1*k_1*x1 - + e_2*h_2*k_2*x2 - + e_3*h_3*k_3*x1^2 - ); - -%% The input at steady-state -MTTu1 := q_s; - -%States (masses) -x1 := c_a*v_r; -x2 := c_b*v_r; - -%Thermal state -x3 := c_p*t_s*v_r; - -%Load up the vectors -MTTx1 := x1; -MTTx2 := x2; - -MTTy1 := c_b; -%MTTy2 := t_s; - -%% Finally, solve for the steady-state concentrations -%% Solve for ca - a quadratic. -a := k_3*e_3; %ca^2 -b := k_1*e_1 + f_s; %ca^1 -c := -c_0*f_s; - -c_a := (-b + sqrt(b^2 - 4*a*c))/(2*a); - -%% solve for c_b -c_b := c_a*k_1*e_1/(f_s+k_2*e_2); - - -END; - - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt @@ -1,58 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# State specification (ReactorTF_state.txt) -# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2003/06/06 06:39:05 gawthrop -## Made compatible with current MTT. -## -## Revision 1.1 2000/12/28 17:12:57 peterg -## To RCS -## -############################################################### - -## Reduce steady-state parameter file (ReactorTF_sspar.r) -## as siso_sspar ecxept that states/states have different meaning -## Steady state for constant c_a, c_b and t=t_s and f=f_s - -## Unit volume ReactorTF: -v_r = 1; - - -## The exponentials. -e_1 = exp(-q_1/t_s); -e_2 = exp(-q_2/t_s); -e_3 = exp(-q_3/t_s); - -## Solve for the steady-state concentrations -## Solve for ca - a quadratic. -a = k_3*e_3; #ca^2 -b = k_1*e_1 + f_s; #ca^1 -c = -c_0*f_s; - -c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); - -## solve for c_b -c_b = c_a*k_1*e_1/(f_s+k_2*e_2); - - -#States (masses) -x1 = c_a*v_r; -x2 = c_b*v_r; - -#Thermal state -#x3 = c_p*t_s*v_r; - -## Load up the states -## Removed by MTT on Thu Jun 5 14:14:18 BST 2003: mttx(1) = x1; -## Removed by MTT on Thu Jun 5 14:14:18 BST 2003: mttx(2) = x2; -## Removed by MTT on Thu Jun 5 14:14:18 BST 2003: mttx(3) = x3; - - - - -reactortf__m_a = x1; -reactortf__m_b = x2; DELETED mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sympar.m Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sympar.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sympar.m +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_sympar.m @@ -1,40 +0,0 @@ -function sympar = ReactorTF_sympar(); -% sympar = ReactorTF_sympar(); -%System ReactorTF, representation sympar, language m; -%File ReactorTF_sympar.m; -%Generated by MTT on Thu Aug 24 14:45:51 BST 2000; -% -global ... -mtt_no_globals ; - sympar.a = 1; # ReactorTF - sympar.b = 2; # ReactorTF - sympar.c = 3; # ReactorTF - sympar.c_0 = 4; # ReactorTF - sympar.c_A = 5; # ReactorTF - sympar.c_B = 6; # ReactorTF - sympar.c_p = 7; # ReactorTF - sympar.e_1 = 8; # ReactorTF - sympar.e_2 = 9; # ReactorTF - sympar.e_3 = 10; # ReactorTF - sympar.f_s = 11; # ReactorTF - sympar.h = 12; # Rate - sympar.h_1 = 13; # ReactorTF - sympar.h_2 = 14; # ReactorTF - sympar.h_3 = 15; # ReactorTF - sympar.k = 16; # Rate - sympar.k_1 = 17; # ReactorTF - sympar.k_2 = 18; # ReactorTF - sympar.k_3 = 19; # ReactorTF - sympar.n = 20; # Rate - sympar.q = 21; # Rate - sympar.q_1 = 22; # ReactorTF - sympar.q_2 = 23; # ReactorTF - sympar.q_3 = 24; # ReactorTF - sympar.q_S = 25; # ReactorTF - sympar.rho = 26; # ReactorTF - sympar.t_0 = 27; # ReactorTF - sympar.t_s = 28; # ReactorTF - sympar.v_r = 29; # ReactorTF - sympar.x1 = 30; # ReactorTF - sympar.x2 = 31; # ReactorTF - sympar.x3 = 32; # ReactorTF DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/MakeFigure.m Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/MakeFigure.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/MakeFigure.m +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/MakeFigure.m @@ -1,19 +0,0 @@ -## Makes the figures - -par = ReactorTQ_numpar; # Parameters -sym = ReactorTQ_sympar; # Parameter indices - -F_s= [90:10:500]; # Range of flows - -Z = []; -for f_s=F_s - par(sym.f_s) = f_s; - z = sort(eig(ReactorTQ_sm(par))); - Z = [Z z]; -endfor - - -grid; xlabel("f_s"); ylabel("z"); -plot(F_s,Z); -psfig("ReactorTQ_zero"); - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/Makefile Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/Makefile ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/Makefile +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/Makefile @@ -1,11 +0,0 @@ -## Makes the schematic diagram and the zero figure -all: ReactorTQ_pic.ps ReactorTQ_zero.ps - -ReactorTQ_pic.ps: ReactorTQ_pic.fig - fig2dev -Lps ReactorTQ_pic.fig> ReactorTQ_pic.ps - -ReactorTQ_zero.ps: ReactorTQ_abg.fig - mtt -q ReactorTQ sm m; mtt -q ReactorTQ numpar m; - mtt -q ReactorTQ sympar m; - octave MakeFigure.m - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_abg.fig Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_abg.fig +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_abg.fig @@ -1,128 +0,0 @@ -#FIG 3.2 -Portrait -Center -Inches -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3001 8701 3001 7801 3151 7951 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1801 9001 2701 9001 2551 9151 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 8776 2701 9226 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3301 9001 4201 9001 4051 9151 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 4201 9301 3601 9901 3826 9901 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5701 9001 4801 9001 4951 9151 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1800 6000 2700 6000 2550 6150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 10350 5025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 6000 1800 5775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 6225 1800 6000 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 10200 600 10200 600 7500 11100 7500 11100 10200 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 6600 600 6600 600 5400 11100 5400 11100 6600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 4800 4500 8700 4650 8550 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6000 4800 4800 8700 5025 8625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9000 4800 5100 8700 5400 8700 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 4725 4800 4275 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 4725 4200 4275 4200 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 6225 4800 5775 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 6225 4200 5775 4200 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 4800 8775 4800 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 4200 8775 4200 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3000 7200 3000 6300 3150 6450 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 10500 4800 3300 6000 3525 6075 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 5100 600 5100 600 3300 11100 3300 11100 5100 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4485 2395 4485 4130 4633 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 2999 2395 2999 4130 3148 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 5970 2395 5970 4130 6119 3841 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 10428 2397 10428 4132 10577 3843 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 1800 2100 2700 2100 2550 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3300 2100 4200 2100 4050 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 4800 2100 5700 2100 5550 2250 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 4200 1800 3600 1200 3600 1425 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 1875 2700 2325 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 8701 1801 8101 1201 8101 1426 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 9301 2101 10201 2101 10051 2251 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 9301 1801 9901 1201 9901 1426 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 6300 2100 7200 2100 7050 2250 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 7800 2100 8700 2100 8550 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 1950 4350 1650 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 10050 1350 9900 1200 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 1200 9750 1050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8550 1950 8850 1650 -2 4 1 2 1 7 0 0 -1 4.000 0 0 7 0 0 5 - 11100 300 600 300 600 2700 11100 2700 11100 300 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 3000 4800 3000 5700 3150 5550 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 2 - 4800 8775 4800 9225 -2 1 0 2 0 0 0 0 -1 0.000 0 0 0 0 0 3 - 8943 2397 8943 4132 9091 3843 -4 1 0 0 0 0 20 0.0000 4 195 1065 3075 4575 FMR:rfa\001 -4 1 0 0 0 0 20 0.0000 4 195 1065 4575 4575 Rate:AD\001 -4 1 0 0 0 0 20 0.0000 4 195 1050 6000 4575 Rate:AB\001 -4 2 0 0 0 0 20 0.0000 4 255 810 1651 9076 SS:t_0\001 -4 2 0 0 0 0 20 0.0000 4 255 690 3451 9976 C:h_r\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3000 6075 1\001 -4 2 0 0 0 0 20 0.0000 4 210 525 1725 6075 SS:f\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3001 9076 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 4501 9076 0\001 -4 1 0 0 0 0 20 0.0000 4 195 1035 9001 4576 Rate:BC\001 -4 1 0 0 0 0 20 0.0000 4 210 1080 10576 4576 FMR:rfb\001 -4 1 1 1 0 3 20 0.0000 4 195 2595 9600 7800 THERMAL MODEL\001 -4 1 1 1 0 3 20 0.0000 4 195 2865 9450 5700 HYDRAULIC MODEL\001 -4 1 0 0 0 0 20 0.0000 4 195 915 3000 7575 FMR:rt\001 -4 1 1 1 0 3 20 0.0000 4 195 2640 9675 3750 REACTION MODEL\001 -4 2 0 0 0 0 20 0.0000 4 255 855 1650 2175 SS:c_0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 3000 2175 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 4500 2175 0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 6000 2175 1\001 -4 1 0 0 0 0 20 0.0000 4 195 150 9001 2176 0\001 -4 1 0 0 0 0 20 0.0000 4 195 150 10501 2176 1\001 -4 1 0 0 0 0 20 0.0000 4 195 375 7500 2175 AF\001 -4 1 0 0 0 0 20 0.0000 4 255 825 8100 1050 C:m_b\001 -4 1 0 0 0 0 20 0.0000 4 255 855 9975 1050 SS:c_b\001 -4 1 0 0 0 0 20 0.0000 4 240 810 3600 1050 C:m_a\001 -4 1 1 1 0 3 20 0.0000 4 195 3645 9075 600 CONCENTRATION MODEL\001 -4 1 0 0 0 0 20 0.0000 4 210 510 6151 9076 SS:t\001 DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_args.new Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_args.new ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_args.new +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_args.new @@ -1,1 +0,0 @@ - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_desc.tex Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_desc.tex +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_desc.tex @@ -1,48 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system ReactorTQ (ReactorTQ_desc.tex) -% Generated by MTT on Fri Mar 3 12:43:33 GMT 2000. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\fig{ReactorTQ_pic} -{ReactorTQ_pic} {0.9} {System \textbf{ReactorTQ}, Schematic} - -Figure \Ref{fig:ReactorTQ_pic} is the schematic diagram of a chemical -reactor. - -The acausal bond graph of system \textbf{ReactorTQ} is displayed in -Figure \Ref{fig:ReactorTQ_abg.ps} and its label file is listed in -Section \Ref{sec:ReactorTQ_lbl}. The subsystems are listed in Section -\Ref{sec:ReactorTQ_sub}. - -This example of a (nonlinear) chemical reactor is due to Trickett and -Bogle\footnote{ K. J. Tricket, \emph{Quantification of Inverse - Responses for Controllability Assessment of Nonlinear Processes}, - PhD Thesis, University College London, 1994} is used in this -section. The reactor has two reaction mechanisms: $\text{A} -\rightarrow \text{B} \rightarrow \text{C}$ and $\text{2A} \rightarrow -\text{D}$. The reactor mass inflow and outflow $f_r$ are identical. -$q$ represents the heat inflow to the reactor. - -The control loop $t$/$q$ has been inverted. The resulting SISO -system has two interpretations: -\begin{enumerate} -\item the \emph{dynamics} of the $c_b$/$f$ loop when the $t$/$q$ loop - is under perfect control and -\item the \emph{inverse} dynamics of the $t$/$q$ loop. -\end{enumerate} - -\fig{ReactorTQ_zero} {ReactorTQ_zero} {0.9} -{System\textbf{ReactorTQ}: zeros v flow} - -Figure \Ref{fig:ReactorTQ_zero} -shows the poles of the linearised system as the steady-state flow -varies: these are the \emph{zeros} of the $c_b$/$f$ control-loop when -the $t$/$q$ loop is \emph{open}. - - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt @@ -1,51 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (ReactorTQ_input.txt) -# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2003/06/06 06:39:20 gawthrop -## Made compatible with current MTT. -## -## Revision 1.1 2000/12/28 17:19:08 peterg -## To RCS -## -############################################################### - -## Reduce steady-state parameter file (ReactorTQ_sspar.r) -## as siso_sspar ecxept that inputs/states have different meaning -## Steady state for constant c_a, c_b and t=t_s and f=f_s - -## Unit volume ReactorTQ: -v_r = 1; - - -## The exponentials. -e_1 = exp(-q_1/t_s); -e_2 = exp(-q_2/t_s); -e_3 = exp(-q_3/t_s); - -## Solve for the steady-state concentrations -## Solve for ca - a quadratic. -a = k_3*e_3; #ca^2 -b = k_1*e_1 + f_s; #ca^1 -c = -c_0*f_s; - -c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); - -## solve for c_b -c_b = c_a*k_1*e_1/(f_s+k_2*e_2); - - -#States (masses) -x1 = c_a*v_r; -x2 = c_b*v_r; - -#Thermal state -x3 = c_p*t_s*v_r; - -# Set the inputs -## Removed by MTT on Thu Jun 5 14:27:42 BST 2003: mttu(1) = f_s + 0.1*f_s*(t>0.01); # f (ReactorTQ) -reactortq__f = f_s + 0.1*f_s*(t>0.01); # f (ReactorTQ) DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_lbl.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_lbl.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_lbl.txt @@ -1,77 +0,0 @@ -%% Label file for system ReactorTQ (ReactorTQ_lbl.txt) -%SUMMARY ReactorTQ: Simple reactor model - with TQ loop inverted -%DESCRIPTION Pseudo bond graph reactor model (based on ancient version) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:19:08 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%ALIAS Rate Chemical/Rate - -% Extra variables -%VAR t_s -%VAR f_s -%VAR t_0 -%VAR c_0 -%VAR rho -%VAR v_r -%VAR e_1 -%VAR e_2 -%VAR e_3 -%VAR a -%VAR b -%VAR c -%VAR c_A -%VAR c_B -%VAR x1 -%VAR x2 -%VAR x3 -%VAR q_S - -%VAR h -%VAR k -%VAR n -%VAR q - - -% Port aliases - -% Argument aliases - -%% each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- -% Component type C - m_a lin effort,1 - m_b lin effort,1 - h_r lin effort,c_p - -% Component type FMR - rfa lin effort,1 - rfb lin effort,1 - rt lin effort,c_p - -% Component type Rate - AB Rate k_1,q_1,h_1,1 - BC Rate k_2,q_2,h_2,1 - AD Rate k_3,q_3,h_3,2 - -% Component type SS - c_0 SS c_0,internal - c_b SS external,0 - f SS internal,external - t SS t_s,internal - t_0 SS t_0,internal - - - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.m Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.m +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.m @@ -1,186 +0,0 @@ -function mttpar = ReactorTQ_numpar(); -% mttpar = ReactorTQ_numpar(); -%System ReactorTQ, representation numpar, language m; -%File ReactorTQ_numpar.m; -%Generated by MTT on Thu Aug 24 14:29:20 BST 2000; -% - -#====== Set up the global variables ======# -global ... - a ... - b ... - c ... - c_0 ... - c_a ... - c_b ... - c_p ... - e_1 ... - e_2 ... - e_3 ... - f_s ... - h ... - h_1 ... - h_2 ... - h_3 ... - k ... - k_1 ... - k_2 ... - k_3 ... - n ... - q ... - q_1 ... - q_2 ... - q_3 ... - q_s ... - rho ... - t_0 ... - t_s ... - v_r ... - x1 ... - x2 ... - x3 ; -## Set parameters to zero - a = 0.0; - b = 0.0; - c = 0.0; - c_0 = 0.0; - c_a = 0.0; - c_b = 0.0; - c_p = 0.0; - e_1 = 0.0; - e_2 = 0.0; - e_3 = 0.0; - f_s = 0.0; - h = 0.0; - h_1 = 0.0; - h_2 = 0.0; - h_3 = 0.0; - k = 0.0; - k_1 = 0.0; - k_2 = 0.0; - k_3 = 0.0; - n = 0.0; - q = 0.0; - q_1 = 0.0; - q_2 = 0.0; - q_3 = 0.0; - q_s = 0.0; - rho = 0.0; - t_0 = 0.0; - t_s = 0.0; - v_r = 0.0; - x1 = 0.0; - x2 = 0.0; - x3 = 0.0; - % -*-octave-*- Put Emacs into octave-mode - % Numerical parameter file (ReactorTQ_numpar.txt) - % Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 - - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % %% Version control history - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % %% $Id$ - % %% $Log$ - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - % -a = 0; % Dummy -b = 0; % Dummy -c = 0; % Dummy -c_0 = 0; % Dummy -c_a = 0; % Dummy -c_b = 0; % Dummy -c_p = 0; % Dummy -e_1 = 0; % Dummy -e_2 = 0; % Dummy -e_3 = 0; % Dummy -f_s = 0; % Dummy -h = 0; % Dummy -h_1 = 0; % Dummy -h_2 = 0; % Dummy -h_3 = 0; % Dummy -k = 0; % Dummy -k_1 = 0; % Dummy -k_2 = 0; % Dummy -k_3 = 0; % Dummy -n = 0; % Dummy -q = 0; % Dummy -q_1 = 0; % Dummy -q_2 = 0; % Dummy -q_3 = 0; % Dummy -q_s = 0; % Dummy -rho = 0; % Dummy -t_0 = 0; % Dummy -t_s = 0; % Dummy -v_r = 0; % Dummy -x1 = 0; % Dummy -x2 = 0; % Dummy -x3 = 0; % Dummy - - % -rho = 900; % Density -c_p = 5.0; % Specific heat - - % -k_1 = 2.5e10; % Reaction rate constant -q_1 = 1e4; % Exotherm constant -h_1 = 1e4; % Heat of reaction - - % -k_2 = 2.65e12; % Reaction rate constant -q_2 = 1.2e4; % Exotherm constant -h_2 = 1.2e4; % Heat of reaction - - % -k_3 = 6e7; % Reaction rate constant -q_3 = 8e3; % Exotherm constant -h_3 = 3e4; % Heat of reaction - - % -c_0 = 10; % Inflow conc -t_0 = 530; % Inflow temp - - % -t_s = 530; % Steady-state temp -f_s = 100; % Steady-state flow - - - - - - - - -## Set up the parameter vector - mttpar(1) = a; - mttpar(2) = b; - mttpar(3) = c; - mttpar(4) = c_0; - mttpar(5) = c_a; - mttpar(6) = c_b; - mttpar(7) = c_p; - mttpar(8) = e_1; - mttpar(9) = e_2; - mttpar(10) = e_3; - mttpar(11) = f_s; - mttpar(12) = h; - mttpar(13) = h_1; - mttpar(14) = h_2; - mttpar(15) = h_3; - mttpar(16) = k; - mttpar(17) = k_1; - mttpar(18) = k_2; - mttpar(19) = k_3; - mttpar(20) = n; - mttpar(21) = q; - mttpar(22) = q_1; - mttpar(23) = q_2; - mttpar(24) = q_3; - mttpar(25) = q_s; - mttpar(26) = rho; - mttpar(27) = t_0; - mttpar(28) = t_s; - mttpar(29) = v_r; - mttpar(30) = x1; - mttpar(31) = x2; - mttpar(32) = x3; DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_numpar.txt @@ -1,79 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (ReactorTQ_numpar.txt) -# Generated by MTT at Fri Mar 3 09:22:56 GMT 2000 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Dummies -a = 0; # Dummy -b = 0; # Dummy -c = 0; # Dummy -c_0 = 0; # Dummy -c_a = 0; # Dummy -c_b = 0; # Dummy -c_p = 0; # Dummy -e_1 = 0; # Dummy -e_2 = 0; # Dummy -e_3 = 0; # Dummy -f_s = 0; # Dummy -h = 0; # Dummy -h_1 = 0; # Dummy -h_2 = 0; # Dummy -h_3 = 0; # Dummy -k = 0; # Dummy -k_1 = 0; # Dummy -k_2 = 0; # Dummy -k_3 = 0; # Dummy -n = 0; # Dummy -q = 0; # Dummy -q_1 = 0; # Dummy -q_2 = 0; # Dummy -q_3 = 0; # Dummy -q_s = 0; # Dummy -rho = 0; # Dummy -t_0 = 0; # Dummy -t_s = 0; # Dummy -v_r = 0; # Dummy -x1 = 0; # Dummy -x2 = 0; # Dummy -x3 = 0; # Dummy - -## The bulk liquid -rho = 900; # Density -c_p = 5.0; # Specific heat - -## Substance A -k_1 = 2.5e10; # Reaction rate constant -q_1 = 1e4; # Exotherm constant -h_1 = 1e4; # Heat of reaction - -## Substance B -k_2 = 2.65e12; # Reaction rate constant -q_2 = 1.2e4; # Exotherm constant -h_2 = 1.2e4; # Heat of reaction - -## Substance C -k_3 = 6e7; # Reaction rate constant -q_3 = 8e3; # Exotherm constant -h_3 = 3e4; # Heat of reaction - -## Inflow parameters -c_0 = 10; # Inflow conc -t_0 = 530; # Inflow temp - -## Steady-state values -t_s = 530; # Steady-state temp -f_s = 100; # Steady-state flow - - - - - - - - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_pic.fig Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_pic.fig ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_pic.fig +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_pic.fig @@ -1,52 +0,0 @@ -#FIG 3.2 -Landscape -Center -Inches -Letter -100.00 -Single --2 -1200 2 -6 2400 3150 3225 3375 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2625 3300 2925 3300 -4 0 -1 0 0 2 20 0.0000 4 210 210 2400 3375 A\001 -4 0 -1 0 0 2 20 0.0000 4 210 225 3000 3375 D\001 --6 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 2100 2100 2100 3900 1500 3900 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 1500 4050 3900 4050 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 1500 4350 2100 4350 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 2100 3600 3900 4200 3900 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 3600 4350 4200 4350 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 - 3900 4050 4200 4050 -2 1 1 2 -1 -1 0 0 -1 6.000 0 0 -1 0 0 2 - 2100 2400 3600 2400 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2400 2925 2700 2925 -2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3000 2925 3300 2925 -2 1 0 2 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 2850 4800 2850 3750 -4 0 -1 0 0 2 20 0.0000 4 210 210 2175 3000 A\001 -4 0 -1 0 0 2 20 0.0000 4 210 195 2775 3000 B\001 -4 0 -1 0 0 2 20 0.0000 4 210 210 3375 3000 C\001 -4 0 -1 0 0 2 20 0.0000 4 210 150 2250 3375 2\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 1875 4950 0\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 2250 4950 0\001 -4 0 -1 0 0 3 20 0.0000 4 210 150 2775 5025 q\001 -4 0 -1 0 0 3 20 0.0000 4 285 765 1500 4800 f , c , t\001 -4 0 -1 0 0 3 20 0.0000 4 285 765 3600 4800 f , c , t\001 -4 0 -1 0 0 3 12 0.0000 4 135 90 3975 4950 b\001 -4 0 -1 0 0 3 12 0.0000 4 90 75 4350 4950 r\001 DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_rep.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_rep.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_rep.txt @@ -1,32 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system ReactorTQ (ReactorTQ_rep.txt) -## Generated by MTT on" Fri Mar 3 12:13:34 GMT 2000. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:19:08 peterg -## To RCS -## -############################################################### - -mtt ReactorTQ abg tex # The system description -mtt ReactorTQ cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt ReactorTQ struc tex # The system structure -## mtt ReactorTQ dae tex # The system dae -mtt ReactorTQ ode tex # The system ode -## mtt ReactorTQ sspar tex # Steady-state parameters -## mtt ReactorTQ ss tex # Steady state -## mtt ReactorTQ dm tex # Descriptor matrices (of linearised system) -mtt ReactorTQ sm tex # State matrices (of linearised system) -## mtt ReactorTQ tf tex # Transfer function (of linearised system) -## mtt ReactorTQ lmfr ps # log modulus of frequency response (of linearised system) -mtt ReactorTQ simpar tex # Simulation parameters -mtt ReactorTQ numpar tex # Numerical simulation parameters -mtt ReactorTQ input tex # Simulation input -mtt ReactorTQ state tex # Simulation initial state - -mtt ReactorTQ odeso ps DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simp.r Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simp.r ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simp.r +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simp.r @@ -1,21 +0,0 @@ -%% Reduce comands to simplify output (mimo_sim.r) -m_r := rho*v_r; -%mttx1 := c_a*v_r; -%mttx2 := c_b*v_r; - -% THIS MUST BE CHANGED - probs with cp and FMRs -%c_p := 1; - -%let mttx3/c_p = t; - -let e^(q_1/(mttx3/c_p)) = 1/epsilon_1; -let e^(q_2/(mttx3/c_p)) = 1/epsilon_2; -let e^(q_3/(mttx3/c_p)) = 1/epsilon_3; - -let e^(q_1/t_s) = 1/epsilon_1; -let e^(q_2/t_s) = 1/epsilon_2; -let e^(q_3/t_s) = 1/epsilon_3; - -FACTOR mttx1,mttx2; - -END; DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simpar.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simpar.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system ReactorTQ (ReactorTQ_simpar.txt) -# Generated by MTT on Fri Mar 3 12:11:48 GMT 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 0.05; # Last time in simulation -DT = 0.0002; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m @@ -1,99 +0,0 @@ -function [mtta,mttb,mttc,mttd] = ReactorTQ_sm(mttpar); -% [mtta,mttb,mttc,mttd] = ReactorTQ_sm(mttpar); -%System ReactorTQ, representation sm, language m; -%File ReactorTQ_sm.m; -%Generated by MTT on Thu Aug 24 14:47:46 BST 2000; -% -%====== Set up the global variables ======% -global ... -a ... -b ... -c ... -c_0 ... -c_a ... -c_b ... -c_p ... -e_1 ... -e_2 ... -e_3 ... -f_s ... -h ... -h_1 ... -h_2 ... -h_3 ... -k ... -k_1 ... -k_2 ... -k_3 ... -n ... -q ... -q_1 ... -q_2 ... -q_3 ... -q_s ... -rho ... -t_0 ... -t_s ... -v_r ... -x1 ... -x2 ... -x3 ; -a = mttpar(1); -b = mttpar(2); -c = mttpar(3); -c_0 = mttpar(4); -c_a = mttpar(5); -c_b = mttpar(6); -c_p = mttpar(7); -e_1 = mttpar(8); -e_2 = mttpar(9); -e_3 = mttpar(10); -f_s = mttpar(11); -h = mttpar(12); -h_1 = mttpar(13); -h_2 = mttpar(14); -h_3 = mttpar(15); -k = mttpar(16); -k_1 = mttpar(17); -k_2 = mttpar(18); -k_3 = mttpar(19); -n = mttpar(20); -q = mttpar(21); -q_1 = mttpar(22); -q_2 = mttpar(23); -q_3 = mttpar(24); -q_s = mttpar(25); -rho = mttpar(26); -t_0 = mttpar(27); -t_s = mttpar(28); -v_r = mttpar(29); -x1 = mttpar(30); -x2 = mttpar(31); -x3 = mttpar(32); -%a matrix% -mtta = zeros(2,2); -mtt_t1 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t1 = -sqrt((mtt_t1+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtta(1,1) = mtt_t1/abs(exp(q_1/t_s)); -mtta(2,1) = k_1/exp(q_1/t_s); -mtta(2,2) = (-(exp(q_2/t_s)*f_s)-k_2)/exp(q_2/t_s); -%b matrix% -mttb = zeros(2,1); -mtt_t1 = exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))*f_s+2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_0*k_3; -mtt_t1 = mtt_t1+exp(q_3/t_s)*abs(exp(q_1/t_s))*k_1; -mtt_t3 = exp((q_1+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t1 = mtt_t1-(mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s))); -mttb(1) = mtt_t1/(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*k_3); -mtt_t1 = exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*k_1; -mtt_t3 = exp((q_1+q_2+q_3)/t_s); -mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3; -mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)); -mtt_t1 = mtt_t1+exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))*k_1^2-(mtt_t3*k_1); -mtt_t2 = 2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*f_s*k_3; -mttb(2) = mtt_t1/(mtt_t2+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*k_2*k_3); -%c matrix% -mttc = zeros(1,2); -mttc(1,2) = 1.0; -%d matrix% -mttd = zeros(1,1); DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sspar.r Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sspar.r +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sspar.r @@ -1,51 +0,0 @@ -%% Reduce steady-state parameter file (ReactorTQ_sspar.r) -%% as siso_sspar ecxept that inputs/states have different meaning -%% Steady state for constant c_a, c_b and t=t_s and f=f_s - -%% Unit volume ReactorTQ: -v_r := 1; - -%% Do the inputs first -- this avoids problems with reduce not -%% recognising that complicated expressions are zero - -%% The exponentials. -e_1 := e^(-q_1/t_s); -e_2 := e^(-q_2/t_s); -e_3 := e^(-q_3/t_s); - -%Steady-state input q needed to achieve steady-state t_s -q_s := -( - + (t_0-t_s)*f_s - + e_1*h_1*k_1*x1 - + e_2*h_2*k_2*x2 - + e_3*h_3*k_3*x1^2 - ); - -%% The input at steady-state -MTTu1 := f_s; - -%States (masses) -x1 := c_a*v_r; -x2 := c_b*v_r; - -%Load up the vectors -MTTx1 := x1; -MTTx2 := x2; - -MTTy1 := c_b; - -%% Finally, solve for the steady-state concentrations -%% Solve for ca - a quadratic. -a := k_3*e_3; %ca^2 -b := k_1*e_1 + f_s; %ca^1 -c := -c_0*f_s; - -c_a := (-b + sqrt(b^2 - 4*a*c))/(2*a); - -%% solve for c_b -c_b := c_a*k_1*e_1/(f_s+k_2*e_2); - - -END; - - DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt @@ -1,54 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# State specification (ReactorTQ_state.txt) -# Generated by MTT at Fri Mar 3 11:52:23 GMT 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2003/06/06 06:39:39 gawthrop -## Made compatible with current MTT. -## -## Revision 1.1 2000/12/28 17:19:08 peterg -## To RCS -## -############################################################### - -## Reduce steady-state parameter file (ReactorTQ_sspar.r) -## as siso_sspar ecxept that states/states have different meaning -## Steady state for constant c_a, c_b and t=t_s and f=f_s - -## Unit volume ReactorTQ: -v_r = 1; - - -## The exponentials. -e_1 = exp(-q_1/t_s); -e_2 = exp(-q_2/t_s); -e_3 = exp(-q_3/t_s); - -## Solve for the steady-state concentrations -## Solve for ca - a quadratic. -a = k_3*e_3; #ca^2 -b = k_1*e_1 + f_s; #ca^1 -c = -c_0*f_s; - -c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); - -## solve for c_b -c_b = c_a*k_1*e_1/(f_s+k_2*e_2); - - -#States (masses) -x1 = c_a*v_r; -x2 = c_b*v_r; - - -## The two inputs at steady-state -##mttu(1) = f_s; - -## Load up the states -## Removed by MTT on Thu Jun 5 14:25:48 BST 2003: mttx(1) = x1; -## Removed by MTT on Thu Jun 5 14:25:48 BST 2003: mttx(2) = x2; -reactortq__m_a = x1; -reactortq__m_b = x2; DELETED mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sympar.m Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sympar.m ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sympar.m +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sympar.m @@ -1,40 +0,0 @@ -function sympar = ReactorTQ_sympar(); -% sympar = ReactorTQ_sympar(); -%System ReactorTQ, representation sympar, language m; -%File ReactorTQ_sympar.m; -%Generated by MTT on Thu Aug 24 14:47:48 BST 2000; -% -global ... -mtt_no_globals ; - sympar.a = 1; # ReactorTQ - sympar.b = 2; # ReactorTQ - sympar.c = 3; # ReactorTQ - sympar.c_0 = 4; # ReactorTQ - sympar.c_A = 5; # ReactorTQ - sympar.c_B = 6; # ReactorTQ - sympar.c_p = 7; # ReactorTQ - sympar.e_1 = 8; # ReactorTQ - sympar.e_2 = 9; # ReactorTQ - sympar.e_3 = 10; # ReactorTQ - sympar.f_s = 11; # ReactorTQ - sympar.h = 12; # Rate - sympar.h_1 = 13; # ReactorTQ - sympar.h_2 = 14; # ReactorTQ - sympar.h_3 = 15; # ReactorTQ - sympar.k = 16; # Rate - sympar.k_1 = 17; # ReactorTQ - sympar.k_2 = 18; # ReactorTQ - sympar.k_3 = 19; # ReactorTQ - sympar.n = 20; # Rate - sympar.q = 21; # Rate - sympar.q_1 = 22; # ReactorTQ - sympar.q_2 = 23; # ReactorTQ - sympar.q_3 = 24; # ReactorTQ - sympar.q_S = 25; # ReactorTQ - sympar.rho = 26; # ReactorTQ - sympar.t_0 = 27; # ReactorTQ - sympar.t_s = 28; # ReactorTQ - sympar.v_r = 29; # ReactorTQ - sympar.x1 = 30; # ReactorTQ - sympar.x2 = 31; # ReactorTQ - sympar.x3 = 32; # ReactorTQ DELETED mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_abg.fig Index: mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_abg.fig +++ mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_abg.fig @@ -1,43 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 2925 4725 2925 4500 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 2700 4725 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 3600 4725 3600 4500 3825 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3375 3375 3375 3825 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 4275 4725 4275 4500 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 4950 4725 4950 4500 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 4725 4725 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 5625 4725 5625 4500 5850 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 6300 4725 6300 4500 6525 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3375 6075 3375 6525 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 5850 6750 2025 6750 2025 2475 5850 2475 5850 6750 -4 1 0 100 0 18 18 0.0000 4 270 690 5265 3015 R:r_1\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 2790 3015 SS:ss_1\001 -4 1 0 100 0 18 18 0.0000 4 270 690 5265 3690 R:r_2\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 2790 3690 SS:ss_2\001 -4 1 0 100 0 18 18 0.0000 4 270 750 5265 4365 C:c_3\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 2790 4365 SS:ss_3\001 -4 1 0 100 0 18 18 0.0000 4 270 750 5265 5040 C:c_4\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 2790 5040 SS:ss_4\001 -4 1 0 100 0 18 18 0.0000 4 270 540 5265 5715 I:i_5\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 2790 5715 SS:ss_5\001 -4 1 0 100 0 18 18 0.0000 4 270 540 5265 6390 I:i_6\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 2790 6390 SS:ss_6\001 DELETED mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_desc.tex Index: mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_desc.tex +++ mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_desc.tex @@ -1,39 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system OnePorts (OnePorts_desc.tex) -% Generated by MTT on Fri Apr 19 08:12:54 BST 2002. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2002/04/19 07:42:28 gawthrop -% %% Simple teaching examples -% %% -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{OnePorts} is - displayed in Figure \Ref{fig:OnePorts_abg.ps}; it contains the one - port components: \textbf{R}, \textbf{C} and \textbf{I} in each of - the two possible causalities. - - Note that the \textbf{R} has no prefered causality and, in this - case, a causal stroke must be provided by the user. On the other - hand, the \textbf{C} and \textbf{I} components are assigned - prefered causality by MTT in the 3rd and 5th cases where no stroke - is assigned by ther user. In the 4th and 6th cases, the user - provides a causal stroke to put the components into derivative - causality. \Ref{fig:OnePorts_cbg-noargs.ps} shows the causality - automatically completed for the 3rd and 5th cases. - - Section \Ref{sec:OnePorts_ode-noargs.tex} gives the system equations, $y_1$ to - $y_6$ are the outputs (with the given causality) of the 6 - components and $u_1$ to $u_6$ are the coresponding inputs. $x_1$ - and $x_2$ are the states of the 3rd and 5th cases (ie integrated - flow and effort respectively), $z_1$ and $z_2$ are the - corresponding quantities for the the 4th and 6th cases, the two - components in derivative causality. - DELETED mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_rep.txt Index: mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_rep.txt +++ mttroot/mtt/lib/examples/Components/OnePorts/OnePorts_rep.txt @@ -1,35 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system OnePorts (OnePorts_rep.txt) -## Generated by MTT on" Thu Apr 18 08:49:49 BST 2002. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt OnePorts abg tex # The system description -mtt OnePorts cbg ps # The causal bond graph -mtt OnePorts struc tex # The system structure -mtt OnePorts sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt OnePorts dae tex # The system dae -mtt OnePorts ode tex # The system ode -## mtt OnePorts sspar tex # Steady-state parameters -## mtt OnePorts ss tex # Steady state -## mtt OnePorts dm tex # Descriptor matrices (of linearised system) -## mtt OnePorts sm tex # State matrices (of linearised system) -## mtt OnePorts tf tex # Transfer function (of linearised system) -## mtt OnePorts lmfr ps # log modulus of frequency response (of linearised system) -## mtt OnePorts simpar tex # Simulation parameters -## mtt OnePorts numpar tex # Numerical simulation parameters -## mtt OnePorts state tex # Simulation initial state -## mtt OnePorts input tex # Simulation input -## mtt OnePorts logic tex # Logic control -## mtt OnePorts odeso ps # Simulation output - -## mtt OnePorts rep txt # This file DELETED mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_abg.fig Index: mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_abg.fig +++ mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_abg.fig @@ -1,47 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 2925 4050 2925 3825 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5175 2925 6525 2925 6300 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 2700 5175 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 3825 4050 3825 3825 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5175 3825 6525 3825 6300 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 3600 4050 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4725 4050 4725 3825 4950 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5175 4725 6525 4725 6300 4950 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 4500 5175 4950 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 5625 4050 5625 3825 5850 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5175 5625 6525 5625 6300 5850 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 5400 4050 5850 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 8100 6300 1125 6300 1125 2250 8100 2250 8100 6300 -4 1 0 100 0 18 18 0.0000 4 270 900 4635 3015 TF:n_1\001 -4 2 0 100 0 18 18 0.0000 4 270 1200 2520 3015 SS:ss_11\001 -4 0 0 100 0 18 18 0.0000 4 270 1200 6705 3015 SS:ss_12\001 -4 1 0 100 0 18 18 0.0000 4 270 900 4635 3915 TF:n_2\001 -4 2 0 100 0 18 18 0.0000 4 270 1200 2520 3915 SS:ss_21\001 -4 0 0 100 0 18 18 0.0000 4 270 1200 6705 3915 SS:ss_22\001 -4 1 0 100 0 18 18 0.0000 4 270 960 4635 4815 GY:n_3\001 -4 2 0 100 0 18 18 0.0000 4 270 1200 2520 4815 SS:ss_31\001 -4 0 0 100 0 18 18 0.0000 4 270 1200 6705 4815 SS:ss_32\001 -4 1 0 100 0 18 18 0.0000 4 270 960 4635 5715 GY:n_4\001 -4 2 0 100 0 18 18 0.0000 4 270 1200 2520 5715 SS:ss_41\001 -4 0 0 100 0 18 18 0.0000 4 270 1200 6705 5715 SS:ss_42\001 DELETED mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_desc.tex Index: mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_desc.tex +++ mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_desc.tex @@ -1,27 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system TwoPorts (TwoPorts_desc.tex) -% Generated by MTT on Fri Apr 19 08:12:54 BST 2002. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2002/04/19 07:47:45 gawthrop -% %% Simple teaching example. -% %% -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoPorts} is - displayed in Figure \Ref{fig:TwoPorts_abg.ps}; it contains the two - port components: \textbf{TF} and \textbf{GY} in each of - the two possible causalities. - - Note that the neither component has prefered causality and, in both - cases, a causal stroke must be provided by the user. - - Section \Ref{sec:TwoPorts_ode-noargs.tex} gives the system equations. - DELETED mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_rep.txt Index: mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_rep.txt +++ mttroot/mtt/lib/examples/Components/TwoPorts/TwoPorts_rep.txt @@ -1,35 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system TwoPorts (TwoPorts_rep.txt) -## Generated by MTT on" Thu Apr 18 08:45:30 BST 2002. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt TwoPorts abg tex # The system description -mtt TwoPorts cbg ps # The causal bond graph -mtt TwoPorts struc tex # The system structure -mtt TwoPorts sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt TwoPorts dae tex # The system dae - mtt TwoPorts ode tex # The system ode -## mtt TwoPorts sspar tex # Steady-state parameters -## mtt TwoPorts ss tex # Steady state -## mtt TwoPorts dm tex # Descriptor matrices (of linearised system) -## mtt TwoPorts sm tex # State matrices (of linearised system) -## mtt TwoPorts tf tex # Transfer function (of linearised system) -## mtt TwoPorts lmfr ps # log modulus of frequency response (of linearised system) -## mtt TwoPorts simpar tex # Simulation parameters -## mtt TwoPorts numpar tex # Numerical simulation parameters -## mtt TwoPorts state tex # Simulation initial state -## mtt TwoPorts input tex # Simulation input -## mtt TwoPorts logic tex # Logic control -## mtt TwoPorts odeso ps # Simulation output - -## mtt TwoPorts rep txt # This file DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_abg.fig Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_abg.fig +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_abg.fig @@ -1,20 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1801 3151 2701 3151 2476 3376 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3151 4501 3151 4276 3376 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 2926 4726 2026 4951 2251 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 3151 5851 3151 5626 3376 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6975 4050 6975 1350 450 1350 450 4050 6975 4050 -4 1 -1 0 0 0 20 0.0000 4 195 375 3151 3241 AF\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 4726 3241 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 600 4726 1891 CX:c\001 -4 1 -1 0 0 0 20 0.0000 4 240 810 1306 3241 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 240 960 6346 3241 SS:[out]\001 DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_desc.tex Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_desc.tex +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_desc.tex @@ -1,20 +0,0 @@ -% Verbal description for system INTFX (INTFX_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:16 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/08/24 11:20:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{INTFX} is - displayed in Figure \Ref{INTFX_abg} and its label - file is listed in Section \Ref{sec:INTFX_lbl}. - The subsystems are listed in Section \Ref{sec:INTFX_sub}. - -\textbf{INTFX} is a two-port component where the effort on port [out] - is the integral of the flow on port [in]. DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_lbl.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_lbl.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/INTFX_lbl.txt @@ -1,24 +0,0 @@ -%SUMMARY INTFX -%DESCRIPTION -%% Label file for system INTFX (INTFX_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type CX - c lin effort,1 - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/Makefile Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/Makefile ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/Makefile +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/Makefile @@ -1,25 +0,0 @@ -# Makefile for the Two link GMV example - -all: msdp_tf.m twolinkp_obs.m twolinkp_sm.m TwoLinkGMV_numpar.m - -msdP_tf.m: msdP_abg.fig - mtt -q msdP tf m - -msdp_tf.m: msdP_tf.m - tr [A-Z] [a-z] msdp_tf.m - -TwoLinkP_obs.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt - mtt -q TwoLinkP obs m - -twolinkp_obs.m: TwoLinkP_obs.m - tr [A-Z] [a-z] twolinkp_obs.m - -TwoLinkP_sm.m: TwoLinkP_abg.fig TwoLinkP_lbl.txt - mtt -q TwoLinkP sm m - -twolinkp_sm.m: TwoLinkP_sm.m - tr [A-Z] [a-z] twolinkp_sm.m - -TwoLinkGMV_numpar.m: TwoLinkGMV_numpar.txt - mtt -q TwoLinkGMV numpar m - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_abg.fig Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_abg.fig +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_abg.fig @@ -1,124 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4951 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 4950 1800 3375 1800 3600 -4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 IX:J\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTFX:th\001 -4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 2971 1216 SS:[x_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 2971 9361 SS:[x_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 8372 1217 SS:[y_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 8417 9362 SS:[y_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 1485 5671 1216 SS:[alpha_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 1485 5671 9361 SS:[alpha_b]\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 -4 1 4 0 0 0 20 0.0000 4 255 1215 1756 3286 SS:[alpha]\001 DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_desc.tex Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_desc.tex +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_desc.tex @@ -1,25 +0,0 @@ -% Verbal description for system RODaX (RODaX_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/04/12 15:25:35 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 09:41:19 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{RODaX} is - displayed in Figure \Ref{RODaX_abg} and its label - file is listed in Section \Ref{sec:RODaX_lbl}. - The subsystems are listed in Section \Ref{sec:RODaX_sub}. - -{\bf RODaX} is essentially as described in Figure 10.2 of -``Metamodelling''. It has an additional port ``[angle]'' to provide -access to the rod angle. - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_lbl.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_lbl.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/RODaX_lbl.txt @@ -1,55 +0,0 @@ -%SUMMARY RODaX: rigid rod in two dimensions - angle port. -%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a -%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b -%DESCRIPTION Port [x_a]: x force/velocity - end a -%DESCRIPTION Port [x_b]: x force/velocity - end b -%DESCRIPTION Port [y_a]: y force/velocity - end a -%DESCRIPTION Port [y_b]: y force/velocity - end b -%DESCRIPTION Port [alpha]: rod angle -%DESCRIPTION -%DESCRIPTION Parameter 1: length from end 1 to mass centre -%DESCRIPTION Parameter 2: length from end 2 to mass centre -%DESCRIPTION Parameter 3: inertia about mass centre -%DESCRIPTION Parameter 4: mass -%DESCRIPTION See Section 10.2 of "Metamodelling" - - -%% Label file for system RODaX (RODaX_lbl.txt) - - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 1998/04/12 15:24:06 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,$3 -m_x lin flow,$4 -m_y lin flow,$4 - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,$1 -s2 lsin flow,$2 -c1 lcos flow,$1 -c2 lcos flow,$2 - - - - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_abg.fig Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_abg.fig +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_abg.fig @@ -1,94 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 8550 9225 8550 9000 8775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 8325 9225 8775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 9450 9225 9450 9000 9675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 9225 9225 9675 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10215 2475 10215 2475 7650 11025 7650 11025 10215 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 8325 5625 8775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 9225 5625 9675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 3825 5625 3825 8550 5625 8550 5400 8775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 3375 6525 3375 9450 5625 9450 5400 9675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 5400 9225 5400 9000 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 5175 9225 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 6300 9225 6300 9000 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 6075 9225 6525 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 7065 2475 7065 2475 4500 11025 4500 11025 7065 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 5400 5625 5400 5400 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 5175 5625 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 6300 5625 6300 5400 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 6075 5625 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 5400 3600 5400 3375 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 5175 3600 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 6300 3150 6300 2925 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3150 6075 3150 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 2250 9225 2250 9000 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 2025 9225 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 3150 9225 3150 9000 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 2925 9225 3375 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 3915 2475 3915 2475 1350 11025 1350 11025 3915 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 2250 5625 2250 5400 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 2025 5625 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 3150 5625 3150 5400 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 2925 5625 3375 -4 0 -1 0 0 22 20 0.0000 4 270 1935 9315 8640 SS:Theta_1_m\001 -4 0 -1 0 0 22 20 0.0000 4 270 1935 9315 9540 SS:Theta_2_m\001 -4 1 -1 0 0 22 20 0.0000 4 210 2445 6750 9090 TwoLinkPX:model\001 -4 0 4 0 0 22 20 0.0000 4 270 1230 7920 8415 [Theta_1]\001 -4 0 4 0 0 22 20 0.0000 4 270 1230 7920 9315 [Theta_2]\001 -4 2 4 0 0 22 20 0.0000 4 270 1140 5535 8415 [Joint_1]\001 -4 2 4 0 0 22 20 0.0000 4 270 1140 5535 9315 [Joint_2]\001 -4 1 1 1 0 3 26 0.0000 4 270 1005 6750 10080 Model\001 -4 1 -1 0 0 22 20 0.0000 4 270 2415 6750 5940 TwoLinkP:system\001 -4 0 4 0 0 22 20 0.0000 4 270 1230 7920 5265 [Theta_1]\001 -4 0 4 0 0 22 20 0.0000 4 270 1230 7920 6165 [Theta_2]\001 -4 0 -1 0 0 22 20 0.0000 4 270 1530 9315 5490 SS:Theta_1\001 -4 0 -1 0 0 22 20 0.0000 4 270 1530 9315 6390 SS:Theta_2\001 -4 2 4 0 0 22 20 0.0000 4 270 1140 5535 5265 [Joint_1]\001 -4 2 4 0 0 22 20 0.0000 4 270 1140 5535 6165 [Joint_2]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3825 5490 0\001 -4 2 -1 0 0 22 20 0.0000 4 270 1275 1935 6390 SS:Tau_2\001 -4 2 -1 0 0 22 20 0.0000 4 270 1275 1980 5490 SS:Tau_1\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3375 6390 0\001 -4 1 1 1 0 3 26 0.0000 4 360 1110 6705 6885 System\001 -4 0 -1 0 0 22 20 0.0000 4 270 1785 9315 2340 SS:Theta_1_r\001 -4 0 -1 0 0 22 20 0.0000 4 270 1785 9315 3240 SS:Theta_2_r\001 -4 1 1 1 0 3 26 0.0000 4 360 2055 6705 3735 Specification\001 -4 1 -1 0 0 22 20 0.0000 4 270 1860 6795 2340 msdP:spec_1\001 -4 1 -1 0 0 22 20 0.0000 4 270 1860 6795 3195 msdP:spec_2\001 -4 2 -1 0 0 22 20 0.0000 4 270 1260 4005 2340 SS:Ref_1\001 -4 2 -1 0 0 22 20 0.0000 4 270 1260 3960 3240 SS:Ref_2\001 DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_args.new Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_args.new ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_args.new +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_args.new @@ -1,1 +0,0 @@ - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_desc.tex Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_desc.tex +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_desc.tex @@ -1,97 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system TwoLinkGMV (TwoLinkGMV_desc.tex) -% Generated by MTT on Wed Apr 15 18:15:23 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/04/15 18:41:58 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLinkGMV} is - displayed in Figure \Ref{TwoLinkGMV_abg} and its label - file is listed in Section \Ref{sec:TwoLinkGMV_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLinkGMV_sub}. - -This composite system provides an illustration of nonlinear -generalised minimum variance (GMV) control (continuous-time) operating on a -twolink manipulator. GMV can also be interpreted as: -\begin{itemize} -\item the exact linearisation (by feedback) followed by a - pole-placement design on the resulting linear system and -\item a special case of generalised predictive control (GPC) were the - prediction horizon is zero and the $P(s)$ polynomial is the same as - the system relative degree and -\item One possible instance of physical-model-based control. -\end{itemize} - -The composite system of Figure \Ref{TwoLinkGMV_abg} has three -(visible) parts: -\begin{enumerate} -\item a linear decoupled \emph{specification} system that describes the desired - closed-loop system in terms of a physical system (two decoupled - mass-spring-damper systems), -\item the system itself (a two-link manipulator) representing the - system to be controlled, more details are given in Sections - \Ref{sec:TwoLinkP_ode.tex} and \Ref{sec:TwoLinkP_rfe.tex}. -\item a model of the system with additional state inputs to be used as - a state observer. -\end{enumerate} -The invisible parts are implemented in the text file -``TwoLinkGMV\_input.txt'' (see Section \Ref{sec:TwoLinkGMV_input.txt}). -These parts are: -\begin{itemize} -\item the reference signal (joint angles) - \begin{equation} - w(t) = - \begin{cases} - \begin{pmatrix} - \pi \\ - 0 - \end{pmatrix} & 0 \ge t > 10 \\ - \begin{pmatrix} - 2\pi \\ - 0 - \end{pmatrix} & 10 \ge t > 15 \\ - \begin{pmatrix} - 2\pi \\ - \pi - \end{pmatrix} & 15 \ge t > 30 \\ - \end{cases} - \end{equation} -\item The control signal (joint torques) being the solution of - \begin{equation} - \phi^*(t) = O_o(\hat x(t)) + O_h(\hat x(t)) u(t) = w(t) - \end{equation} -where $\hat x$ is the observed state. -\item The observer feedback signal - \begin{equation} - u_x = K ( y - \hat y) - \end{equation} -where $K$ is the observer gain matrix and $y$ and $\hat y$ are the -system and model outputs respectively. -\end{itemize} -The observer gain is set up on the basis of the \emph{linearised} -system using LQ theory. This is implemented in the text file -``TwoLinkGMV\_state.txt'' (see Section \Ref{sec:TwoLinkGMV_state.txt}) -using the Octave function ``lqe'' together with the MTT-generated -linearised system ``TwoLink\_sm''. - - -The system was simulated using Octave under MTT with the results given -in Figures -\Ref{fig:TwoLinkGMV_odeso.ps-TwoLinkGMV-Theta-1,TwoLinkGMV-Theta-1-r} -and -\Ref{fig:TwoLinkGMV_odeso.ps-TwoLinkGMV-Theta-2,TwoLinkGMV-Theta-2-r} -giving the actual and specification angles for joints 1 and 2 -respectively. - -The initial \emph{system} state was zero except that the angle of the -first rod was $\frac{\pi}{4}$. The initial \emph{observer} state was -(erroneously but deliberately) set at zero. This explains the -(decaying) discrepancy between the actual and specification angles. -Simulations with zero initial state gave precise matching. DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_input.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_input.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_input.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_input.txt @@ -1,35 +0,0 @@ -# Numerical parameter file (TwoLinkGMV_input.txt) -# Generated by MTT at Mon Apr 13 11:02:37 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -global ObserverGain; - -# Reference signals -u(1) = pi + pi*(t>10) ; # TwoLinkGMV (Ref_1) -u(2) = pi*(t>15) ; # TwoLinkGMV (Ref_2) - -# Control signals -w = u(1:2); # Reference signal -x_model = x(9:12); # Observed states -[O_o, O_h] = TwoLinkP_obs(x_model) #GPC O function (affine case) -[spec_n,spec_d] = msdP_tf; # Spec transfer function -P = spec_d(3:-1:1); # P poly with ascending coeffs -PP = [eye(2)*P(1) eye(2)*P(2) eye(2)*P(3)]; -PO_o = PP*O_o; # Compute Py with u zero -PO_h = PP*O_h; # Coefficient of u -u_control = PO_h\(w - PO_o); # GMV control signal - -u(3:4) = u_control; # TwoLinkGMV (Tau_1) - -# Observer -x_system = x(5:8); # System states -error = x_system-x_model; # Error in states -ObserverInput = ObserverGain*error; -u(5:8) = ObserverInput; # Set the state-input to the observer - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_lbl.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_lbl.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_lbl.txt @@ -1,47 +0,0 @@ -%SUMMARY TwoLinkGMV - GMV control of two-link manipulator -%DESCRIPTION This composite system provides an illustration -%DESCRIPTION of nonlinear generalised minimum variance (GMV) control -%DESCRIPTION (continuous-time) operating on a twolink manipulator. - -%% Label file for system TwoLinkGMV (TwoLinkGMV_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type SS - Ref_1 SS external,internal - Ref_2 SS external,internal - Tau_1 SS external,internal - Tau_2 SS external,internal - - Theta_1 SS external,0 - Theta_2 SS external,0 - - Theta_1_m SS external,0 - Theta_2_m SS external,0 - - Theta_1_r SS external,0 - Theta_2_r SS external,0 - -% Component type msdP - spec_1 - spec_2 - -% Component type TwoLinkP - system - -% Component type TwoLinkPX - model - - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_numpar.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_numpar.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_numpar.txt @@ -1,18 +0,0 @@ -# Numerical parameter file (TwoLinkGMV_numpar.txt) -# Generated by MTT at Mon Apr 13 10:57:02 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_s = 1.0; # msdP -j_s = 1.0; # msdP -r_s = 1.414; # msdP - -j_r = 1.0; # TwoLinkP,TwoLinkPX -l_r = 1.0; # TwoLinkP,TwoLinkPX -m_r = 1.0; # TwoLinkP,TwoLinkPX DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_obspar.r Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_obspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_obspar.r +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_obspar.r @@ -1,29 +0,0 @@ -%% Reduce GPC observability function parameters for system TwoLinkGMV (TwoLinkGMV_obspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -MTTGPCNy := 2; -MTTGPCNu := 0; -Matrix MTTdU(5,1); -MTTdU(1,1) := MTTdU1; -MTTdU(2,1) := MTTdU2; -MTTdU(3,1) := MTTdU3; -MTTdU(4,1) := MTTdU4; -MTTdU(5,1) := MTTdU5; -Matrix MTTUU(2,5); -MTTUU(1,1) := MTTu1; -MTTUU(1,2) := MTTu11; -MTTUU(1,3) := MTTu12; -MTTUU(1,4) := MTTu13; -MTTUU(1,5) := MTTu14; -MTTUU(2,1) := MTTu2; -MTTUU(2,2) := MTTu21; -MTTUU(2,3) := MTTu22; -MTTUU(2,4) := MTTu23; -MTTUU(2,5) := MTTu24; -END; DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_rep.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_rep.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_rep.txt @@ -1,28 +0,0 @@ -# Outline report file for system TwoLinkGMV (TwoLinkGMV_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt TwoLinkGMV abg tex -mtt TwoLinkGMV struc tex -mtt TwoLinkGMV sympar tex - -mtt TwoLinkP struc tex -mtt TwoLinkP rfe tex -mtt TwoLinkP ode tex -mtt TwoLinkP obs tex - -mtt TwoLinkP ss tex -mtt TwoLinkP sm tex - -mtt msdP tf tex - -mtt TwoLinkGMV numpar txt -mtt TwoLinkGMV state txt -mtt TwoLinkGMV input txt -mtt TwoLinkGMV odeso ps 'TwoLinkGMV_Theta_1,TwoLinkGMV_Theta_1_r' -mtt TwoLinkGMV odeso ps 'TwoLinkGMV_Theta_2,TwoLinkGMV_Theta_2_r' DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt @@ -1,12 +0,0 @@ -%% Simulation parameters for system TwoLinkGMV (TwoLinkGMV_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=30.0 -DT=0.2 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt_old Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt_old ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt_old +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_simpar.txt_old @@ -1,12 +0,0 @@ -%% Simulation parameters for system TwoLinkGMV (TwoLinkGMV_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=30.0 -DT=0.2 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_sspar.r Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_sspar.r +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_sspar.r @@ -1,35 +0,0 @@ -% Steady-state parameter file (TwoLinkGMV_sspar.r) -% Generated by MTT at Tue Apr 14 08:47:47 BST 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Steady-state states -MTTX1 := 0; % TwoLinkGMV_spec_1 (c_s) -MTTX2 := 0; % TwoLinkGMV_spec_1 (j_s) -MTTX3 := 0; % TwoLinkGMV_spec_2 (c_s) -MTTX4 := 0; % TwoLinkGMV_spec_2 (j_s) -MTTX5 := 0; % TwoLinkGMV_system_rod1 (J) -MTTX6 := 0; % TwoLinkGMV_system_rod1_th (3) -MTTX7 := 0; % TwoLinkGMV_system_rod2 (J) -MTTX8 := 0; % TwoLinkGMV_system_rod2_th (3) -MTTX9 := 0; % TwoLinkGMV_model_rod1_J (i) -MTTX10 := 0; % TwoLinkGMV_model_rod1_th_c (c) -MTTX11 := 0; % TwoLinkGMV_model_rod2_J (i) -MTTX12 := 0; % TwoLinkGMV_model_rod2_th_c (c) -% Steady-state inputs -MTTU1 := 1; % TwoLinkGMV (Ref_1) -MTTU2 := 1; % TwoLinkGMV (Ref_2) -MTTU3 := 0; % TwoLinkGMV (Tau_1) -MTTU4 := 0; % TwoLinkGMV (Tau_2) -MTTU5 := 0; % TwoLinkGMV_model_rod1_J (X) -MTTU6 := 0; % TwoLinkGMV_model_rod1_th_c (X) -MTTU7 := 0; % TwoLinkGMV_model_rod2_J (X) -MTTU8 := 0; % TwoLinkGMV_model_rod2_th_c (X) -;;END; DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_state.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_state.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_state.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkGMV_state.txt @@ -1,31 +0,0 @@ -# Numerical parameter file (TwoLinkGMV_state.txt) -# Generated by MTT at Tue Apr 14 08:54:28 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -global ObserverGain; - -# Set the states -x(1) = 0 ; # TwoLinkGMV_spec_1 (c_s) -x(2) = 0 ; # TwoLinkGMV_spec_1 (j_s) -x(3) = 0 ; # TwoLinkGMV_spec_2 (c_s) -x(4) = 0 ; # TwoLinkGMV_spec_2 (j_s) -x(5) = 0 ; # TwoLinkGMV_system_rod1 (J) -x(6) = pi/4 ; # TwoLinkGMV_system_rod1_th (3) -x(7) = 0 ; # TwoLinkGMV_system_rod2 (J) -x(8) = 0 ; # TwoLinkGMV_system_rod2_th (3) -x(9) = 0 ; # TwoLinkGMV_model_rod1_J (i) -x(10) = 0 ; # TwoLinkGMV_model_rod1_th_c (c) -x(11) = 0 ; # TwoLinkGMV_model_rod2_J (i) -x(12) = 0 ; # TwoLinkGMV_model_rod2_th_c (c) - -# Observer design -[A,B,C] = TwoLinkP_sm; # Get the linearised system -sigma = 0.1; # Measurement noise variance (pretend) -k = lqe(A,eye(4),C,eye(4),sigma*eye(2)) -ObserverGain = k*C; # This system happens to have a linear output DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_abg.fig Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_abg.fig +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_abg.fig @@ -1,104 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3468 1128 3738 1128 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4593 2703 4863 2703 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 1128 4728 2703 4953 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4502 5492 4502 5762 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5627 4502 5627 4277 5852 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 7426 4951 7201 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3472 8647 3742 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4597 8647 4867 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5724 8649 5994 8649 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4730 8645 4730 10220 4955 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5855 8645 5855 10220 6080 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3826 3601 7426 3826 7201 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3826 5851 7426 6076 7201 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 11475 9450 225 180 225 180 11475 9450 11475 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 8622 3600 10197 3825 9972 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 7650 450 9405 450 9405 675 7650 675 7650 450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 3285 1575 3285 1800 3510 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3195 8055 1620 8055 1845 8280 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 3150 1350 2025 1575 2250 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 8325 1350 9450 1575 9225 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 7875 1350 3600 1575 3825 -4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000 4 195 1335 4729 3379 RODaX:rod1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1335 4731 8196 RODaX:rod2\001 -4 1 4 0 0 0 20 0.0000 4 255 1410 4771 946 SS:[Joint_1]\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 -4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 -4 1 -1 0 0 0 20 0.0000 4 255 810 5850 945 SS:v_y\001 -4 2 4 0 0 0 20 0.0000 4 255 1410 2882 5717 SS:[Joint_2]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 675 3510 3375 [alpha]\001 -4 1 4 0 0 0 16 0.0000 4 225 675 3555 8145 [alpha]\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 1308 8193 1\001 -4 1 4 0 0 0 20 0.0000 4 255 1530 1397 1892 SS:[Theta_1]\001 -4 1 4 0 0 0 20 0.0000 4 255 1530 1352 9767 SS:[Theta_2]\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 1263 3468 0\001 DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_desc.tex Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_desc.tex +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_desc.tex @@ -1,42 +0,0 @@ -% Verbal description for system TwoLinkPX (TwoLinkPX_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/19 14:20:07 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLinkPX} is - displayed in Figure \Ref{TwoLinkPX_abg} and its label - file is listed in Section \Ref{sec:TwoLinkPX_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLinkPX_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses the compound components: {\bf ROD}. {\bf -ROD} is essentially as described in Figure 10.2. -There is no gravity included in this model. - -This system has a number of dynamic elements (those corresponding to translation -motion) in derivative causality, thus the system is represnted as a -Differential-Algebraic Equation (Section -\Ref{sec:TwoLinkPX_dae.tex}). Hovever, this is of contrained-state form and -therfore can be written as a set of constrained-state equations (Section -\Ref{sec:TwoLinkPX_cse.tex}). The corresponding ordinary differential -equation is complicated due to the trig functions involved in -inverting the E matrix. - -As well as the standard representation the ``robot-form'' equations -appear in Section \Ref{sec:TwoLinkPX_rfe}. - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_lbl.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_lbl.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkPX_lbl.txt @@ -1,57 +0,0 @@ -%SUMMARY TwoLinkPX: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (TwoLinkPX_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/12/05 12:39:49 peterg -% %% Documentation -% %% -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - uniform rods -rod1 none l_r;l_r;j_r;m_r -rod2 none l_r;l_r;j_r;m_r - -%Zero velocity sources -v_x SS internal,0 -v_y SS internal,0 - - -%Zero force/torque sources -F_x SS 0,internal -F_a SS 0,internal -F_y SS 0,internal - -%Named ports -[Joint_1] SS external,internal -[Joint_2] SS external,internal -[Theta_1] SS external,0 -[Theta_2] SS external,0 - -%Torque/velocity at joints -%f_a1 SS external,external -%f_a2 SS external,external - - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_abg.fig Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_abg.fig +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_abg.fig @@ -1,104 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3468 1128 3738 1128 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4593 2703 4863 2703 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 1128 4728 2703 4953 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4502 5492 4502 5762 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5627 4502 5627 4277 5852 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 7426 4951 7201 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3472 8647 3742 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4597 8647 4867 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5724 8649 5994 8649 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4730 8645 4730 10220 4955 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5855 8645 5855 10220 6080 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3826 3601 7426 3826 7201 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3826 5851 7426 6076 7201 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 11475 9450 225 180 225 180 11475 9450 11475 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 8622 3600 10197 3825 9972 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 7650 450 9405 450 9405 675 7650 675 7650 450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 3285 1575 3285 1800 3510 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3195 8055 1620 8055 1845 8280 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 3150 1350 2025 1575 2250 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 8325 1350 9450 1575 9225 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 7875 1350 3600 1575 3825 -4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000 4 195 1335 4729 3379 RODa:rod1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1335 4731 8196 RODa:rod2\001 -4 1 4 0 0 0 20 0.0000 4 255 1410 4771 946 SS:[Joint_1]\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 -4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 -4 1 -1 0 0 0 20 0.0000 4 255 810 5850 945 SS:v_y\001 -4 2 4 0 0 0 20 0.0000 4 255 1410 2882 5717 SS:[Joint_2]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 675 3510 3375 [alpha]\001 -4 1 4 0 0 0 16 0.0000 4 225 675 3555 8145 [alpha]\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 1308 8193 1\001 -4 1 4 0 0 0 20 0.0000 4 255 1530 1397 1892 SS:[Theta_1]\001 -4 1 4 0 0 0 20 0.0000 4 255 1530 1352 9767 SS:[Theta_2]\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 1263 3468 0\001 DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_cr.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_cr.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_cr.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_cr.txt @@ -1,3 +0,0 @@ -lcos -lin -lsin DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_desc.tex Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_desc.tex +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_desc.tex @@ -1,42 +0,0 @@ -% Verbal description for system TwoLinkP (TwoLinkP_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/19 14:20:07 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLinkP} is - displayed in Figure \Ref{TwoLinkP_abg} and its label - file is listed in Section \Ref{sec:TwoLinkP_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLinkP_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses the compound components: {\bf ROD}. {\bf -ROD} is essentially as described in Figure 10.2. -There is no gravity included in this model. - -This system has a number of dynamic elements (those corresponding to translation -motion) in derivative causality, thus the system is represnted as a -Differential-Algebraic Equation (Section -\Ref{sec:TwoLinkP_dae.tex}). Hovever, this is of contrained-state form and -therfore can be written as a set of constrained-state equations (Section -\Ref{sec:TwoLinkP_cse.tex}). The corresponding ordinary differential -equation is complicated due to the trig functions involved in -inverting the E matrix. - -As well as the standard representation the ``robot-form'' equations -appear in Section \Ref{sec:TwoLinkP_rfe}. - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_lbl.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_lbl.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_lbl.txt @@ -1,57 +0,0 @@ -%SUMMARY TwoLinkP: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (TwoLinkP_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/12/05 12:39:49 peterg -% %% Documentation -% %% -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - uniform rods -rod1 none l_r;l_r;j_r;m_r -rod2 none l_r;l_r;j_r;m_r - -%Zero velocity sources -v_x SS internal,0 -v_y SS internal,0 - - -%Zero force/torque sources -F_x SS 0,internal -F_a SS 0,internal -F_y SS 0,internal - -%Named ports -[Joint_1] SS external,internal -[Joint_2] SS external,internal -[Theta_1] SS external,0 -[Theta_2] SS external,0 - -%Torque/velocity at joints -%f_a1 SS external,external -%f_a2 SS external,external - - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_obspar.r Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_obspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_obspar.r +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_obspar.r @@ -1,29 +0,0 @@ -%% Reduce GPC observability function parameters for system TwoLinkP (TwoLinkP_obspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -MTTGPCNy := 2; -MTTGPCNu := 0; -Matrix MTTdU(5,1); -MTTdU(1,1) := MTTdU1; -MTTdU(2,1) := MTTdU2; -MTTdU(3,1) := MTTdU3; -MTTdU(4,1) := MTTdU4; -MTTdU(5,1) := MTTdU5; -Matrix MTTUU(2,5); -MTTUU(1,1) := MTTu1; -MTTUU(1,2) := MTTu11; -MTTUU(1,3) := MTTu12; -MTTUU(1,4) := MTTu13; -MTTUU(1,5) := MTTu14; -MTTUU(2,1) := MTTu2; -MTTUU(2,2) := MTTu21; -MTTUU(2,3) := MTTu22; -MTTUU(2,4) := MTTu23; -MTTUU(2,5) := MTTu24; -END; DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_subs.r Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_subs.r ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_subs.r +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/TwoLinkP_subs.r @@ -1,24 +0,0 @@ -%% Reduce substitution statements for system TwoLinkPX (TwoLinkPX_subs.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/03/22 20:13:25 peterg -% %% Trig simplification added -% %% -% %% Revision 1.1 1998/03/22 20:12:51 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -END; - DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_abg.fig Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_abg.fig +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_abg.fig @@ -1,27 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 4050 4950 4050 4725 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 4275 3600 5400 3825 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 4050 3375 4050 3150 4275 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 6975 8325 1125 1125 1125 1125 6975 8325 6975 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 4050 6525 4050 6300 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3825 5175 2700 5400 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3825 3600 2700 3825 2925 -4 1 -1 0 0 0 20 0.0000 4 195 135 3600 4185 1\001 -4 2 4 0 0 0 20 0.0000 4 240 810 2160 4140 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 480 3600 5715 I:j_s\001 -4 1 1 1 0 0 20 0.0000 4 255 5355 4815 6345 Mass-spring-damper system (position output)\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5175 4140 0\001 -4 0 4 0 0 0 20 0.0000 4 240 960 6660 4140 SS:[out]\001 -4 1 -1 0 0 0 20 0.0000 4 255 615 3600 2565 R:r_s\001 -4 1 -1 0 0 0 20 0.0000 4 255 630 5175 2565 C:c_s\001 DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_desc.tex Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_desc.tex +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_desc.tex @@ -1,31 +0,0 @@ -% Verbal description for system msdP (msdP_desc.tex) -% Generated by MTT on Thu Nov 13 09:38:17 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{msdP} is - displayed in Figure \Ref{msdP_abg} and its label - file is listed in Section \Ref{sec:msdP_lbl}. - The subsystems are listed in Section \Ref{sec:msdP_sub}. - - - \textbf{msdP} is a simple Mass-Spring-Damper system with - force input and position output. It is set up to provide a specification system - for each link of the two-link maipulator. This is appropriate because - \begin{itemize} - \item it has compatible physical behaviour with the system itself, - \item it specifies two decoupled systems, - \item it has linear behaviour and - \item it has a simple performance interpretation in terms of system - rise-time and overshoot. - \end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_lbl.txt Index: mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_lbl.txt +++ mttroot/mtt/lib/examples/Control/GMV/TwoLinkGMV/msdP_lbl.txt @@ -1,30 +0,0 @@ -%SUMMARY msdP -%DESCRIPTION -%% Label file for system msdP (msdP_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_s lin effort,c_s - -% Component type I - j_s lin flow,j_s - -% Component type R - r_s lin flow,r_s - -% Component type SS - [in] SS external,internal - [out] SS external,0 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_abg.fig Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_abg.fig +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_abg.fig @@ -1,20 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1801 3151 2701 3151 2476 3376 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3151 4501 3151 4276 3376 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 2926 4726 2026 4951 2251 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 3151 5851 3151 5626 3376 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6975 4050 6975 1350 450 1350 450 4050 6975 4050 -4 1 -1 0 0 0 20 0.0000 4 195 375 3151 3241 AF\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 4726 3241 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 600 4726 1891 CX:c\001 -4 1 -1 0 0 0 20 0.0000 4 240 810 1306 3241 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 240 960 6346 3241 SS:[out]\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_desc.tex Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_desc.tex +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_desc.tex @@ -1,20 +0,0 @@ -% Verbal description for system INTFX (INTFX_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:16 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/08/24 11:20:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{INTFX} is - displayed in Figure \Ref{INTFX_abg} and its label - file is listed in Section \Ref{sec:INTFX_lbl}. - The subsystems are listed in Section \Ref{sec:INTFX_sub}. - -\textbf{INTFX} is a two-port component where the effort on port [out] - is the integral of the flow on port [in]. DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_lbl.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_lbl.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/INTFX_lbl.txt @@ -1,24 +0,0 @@ -%SUMMARY INTFX -%DESCRIPTION -%% Label file for system INTFX (INTFX_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type CX - c lin effort,1 - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_abg.fig Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_abg.fig +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_abg.fig @@ -1,124 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4951 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 4950 1800 3375 1800 3600 -4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 IX:J\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 585 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTFX:th\001 -4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 210 585 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000 4 210 345 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 465 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000 4 210 345 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 2971 1216 SS:[x_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 2971 9361 SS:[x_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 8372 1217 SS:[y_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 990 8417 9362 SS:[y_b]\001 -4 1 4 0 0 0 20 0.0000 4 255 1485 5671 1216 SS:[alpha_a]\001 -4 1 4 0 0 0 20 0.0000 4 255 1485 5671 9361 SS:[alpha_b]\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000 4 195 1380 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000 4 255 600 1350 9855 Tip b\001 -4 1 4 0 0 0 20 0.0000 4 255 1215 1756 3286 SS:[alpha]\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_desc.tex Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_desc.tex +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_desc.tex @@ -1,25 +0,0 @@ -% Verbal description for system RODaX (RODaX_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/04/12 15:25:35 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 09:41:19 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{RODaX} is - displayed in Figure \Ref{RODaX_abg} and its label - file is listed in Section \Ref{sec:RODaX_lbl}. - The subsystems are listed in Section \Ref{sec:RODaX_sub}. - -{\bf RODaX} is essentially as described in Figure 10.2 of -``Metamodelling''. It has an additional port ``[angle]'' to provide -access to the rod angle. - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_lbl.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_lbl.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/RODaX_lbl.txt @@ -1,51 +0,0 @@ -%SUMMARY RODaX: rigid rod in two dimensions - angle port. -%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a -%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b -%DESCRIPTION Port [x_a]: x force/velocity - end a -%DESCRIPTION Port [x_b]: x force/velocity - end b -%DESCRIPTION Port [y_a]: y force/velocity - end a -%DESCRIPTION Port [y_b]: y force/velocity - end b -%DESCRIPTION Port [alpha]: rod angle -%DESCRIPTION -%DESCRIPTION Parameter 1: length from end 1 to mass centre -%DESCRIPTION Parameter 2: length from end 2 to mass centre -%DESCRIPTION Parameter 3: inertia about mass centre -%DESCRIPTION Parameter 4: mass -%DESCRIPTION See Section 10.2 of "Metamodelling" - - -%% Label file for system RODaX (RODaX_lbl.txt) - - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 1998/04/12 15:24:06 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,$3 -m_x lin flow,$4 -m_y lin flow,$4 - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,$1 -s2 lsin flow,$2 -c1 lcos flow,$1 -c2 lcos flow,$2 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_abg.fig Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_abg.fig +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_abg.fig @@ -1,32 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 2025 3825 2025 3600 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 2025 5850 2025 5625 2250 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 3600 7875 3600 7650 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 1800 2475 2295 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6075 3375 6075 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5850 1800 5850 2295 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 3600 3825 3600 3600 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 3600 6075 3600 5850 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 3330 6300 2205 6525 2430 -4 2 4 0 0 0 20 0.0000 4 240 720 2385 2115 SS:[v]\001 -4 1 -1 0 0 0 20 0.0000 4 195 420 4140 2115 GY\001 -4 1 -1 0 0 0 20 0.0000 4 195 840 6345 2070 AE:tau\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 6300 3690 1\001 -4 2 4 0 0 0 20 0.0000 4 255 720 2475 3690 SS:[p]\001 -4 0 4 0 0 0 20 0.0000 4 240 690 8055 3645 SS:[s]\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 4050 3690 AE\001 -4 2 4 0 0 0 20 0.0000 4 240 405 5760 1755 [in]\001 -4 2 4 0 0 0 20 0.0000 4 240 555 6255 2565 [out]\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_lbl.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_lbl.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/Sensor_lbl.txt @@ -1,25 +0,0 @@ -%SUMMARY Sensor -%DESCRIPTION -%% Label file for system Sensor (Sensor_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type AE - tau lin tau - -% Component type SS - [p] SS external,external - [s] SS external,external - [v] SS external,external DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_abg.fig Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_abg.fig +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_abg.fig @@ -1,94 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 8550 9225 8550 9000 8775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 8325 9225 8775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 9450 9225 9450 9000 9675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 9225 9225 9675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 8325 5625 8775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 9225 5625 9675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 3825 5625 3825 8550 5625 8550 5400 8775 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 3375 6525 3375 9450 5625 9450 5400 9675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 5400 9225 5400 9000 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 5175 9225 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 6300 9225 6300 9000 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 6075 9225 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 5400 5625 5400 5400 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 5175 5625 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 6300 5625 6300 5400 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 6075 5625 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 5400 3600 5400 3375 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 5175 3600 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 6300 3150 6300 2925 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3150 6075 3150 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 2250 9225 2250 9000 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 2025 9225 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 3150 9225 3150 9000 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9225 2925 9225 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 2250 5625 2250 5400 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 2025 5625 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 3150 5625 3150 5400 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 2925 5625 3375 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11475 3915 2475 3915 2475 1350 11475 1350 11475 3915 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11475 7020 2475 7020 2475 4500 11475 4500 11475 7020 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11475 10215 2475 10215 2475 7650 11475 7650 11475 10215 -4 0 -1 0 0 22 20 0.0000 4 270 1935 9315 8640 SS:Theta_1_m\001 -4 0 -1 0 0 22 20 0.0000 4 270 1935 9315 9540 SS:Theta_2_m\001 -4 1 -1 0 0 22 20 0.0000 4 210 2640 6750 9090 TwoLinkPSX:model\001 -4 0 4 0 0 22 20 0.0000 4 270 1230 7920 8415 [Theta_1]\001 -4 0 4 0 0 22 20 0.0000 4 270 1230 7920 9315 [Theta_2]\001 -4 2 4 0 0 22 20 0.0000 4 270 1140 5535 8415 [Joint_1]\001 -4 2 4 0 0 22 20 0.0000 4 270 1140 5535 9315 [Joint_2]\001 -4 1 1 1 0 3 26 0.0000 4 270 1005 6750 10080 Model\001 -4 1 -1 0 0 22 20 0.0000 4 270 2610 6750 5940 TwoLinkPS:system\001 -4 0 4 0 0 22 20 0.0000 4 270 1230 7920 5265 [Theta_1]\001 -4 0 4 0 0 22 20 0.0000 4 270 1230 7920 6165 [Theta_2]\001 -4 0 -1 0 0 22 20 0.0000 4 270 1530 9315 5490 SS:Theta_1\001 -4 0 -1 0 0 22 20 0.0000 4 270 1530 9315 6390 SS:Theta_2\001 -4 2 4 0 0 22 20 0.0000 4 270 1140 5535 5265 [Joint_1]\001 -4 2 4 0 0 22 20 0.0000 4 270 1140 5535 6165 [Joint_2]\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3825 5490 0\001 -4 2 -1 0 0 22 20 0.0000 4 270 1275 1935 6390 SS:Tau_2\001 -4 2 -1 0 0 22 20 0.0000 4 270 1275 1980 5490 SS:Tau_1\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 3375 6390 0\001 -4 1 1 1 0 3 26 0.0000 4 360 1110 6705 6885 System\001 -4 0 -1 0 0 22 20 0.0000 4 270 1785 9315 2340 SS:Theta_1_r\001 -4 0 -1 0 0 22 20 0.0000 4 270 1785 9315 3240 SS:Theta_2_r\001 -4 1 1 1 0 3 26 0.0000 4 360 2055 6705 3735 Specification\001 -4 1 -1 0 0 22 20 0.0000 4 270 1860 6795 2340 msdP:spec_1\001 -4 1 -1 0 0 22 20 0.0000 4 270 1860 6795 3195 msdP:spec_2\001 -4 2 -1 0 0 22 20 0.0000 4 270 1260 4005 2340 SS:Ref_1\001 -4 2 -1 0 0 22 20 0.0000 4 270 1260 3960 3240 SS:Ref_2\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_desc.tex Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_desc.tex +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_desc.tex @@ -1,111 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system TwoLinkGPC (TwoLinkGPC_desc.tex) -% Generated by MTT on Wed Apr 15 18:15:23 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/04/15 18:41:58 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLinkGPC} is - displayed in Figure \Ref{TwoLinkGPC_abg} and its label - file is listed in Section \Ref{sec:TwoLinkGPC_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLinkGPC_sub}. - - This example provides an illustration of nonlinear generalised - predictive control (GPC) (continuous-time) operating on a twolink - manipulator with a modified sensor. The sensor is modified in a - rather contrived way to give a nonlinear system with an - \emph{unstable} inverse. The idea is that the sensor approximates a - pure delay of $\tau$ as: - \begin{equation} - e^{-s\tau} \approx 1 - s \tau - \end{equation} - - The example contrasts GPC with GMV, which can also be interpreted - as: -\begin{itemize} -\item the exact linearisation (by feedback) followed by a - pole-placement design on the resulting linear system and -\item a special case of generalised predictive control (GPC) were the - prediction horizon is zero and the $P(s)$ polynomial is the same as - the system relative degree and -\end{itemize} - - -The composite system of Figure \Ref{TwoLinkGPC_abg} has three -(visible) parts: -\begin{enumerate} -\item a linear decoupled \emph{specification} system that describes the desired - closed-loop system in terms of a physical system (two decoupled - mass-spring-damper systems), -\item the system itself (a two-link manipulator) representing the - system to be controlled, more details are given in Sections - \Ref{sec:TwoLinkP_ode.tex} and \Ref{sec:TwoLinkP_rfe.tex}. -\item a model of the system with additional state inputs to be used as - a state observer. -\end{enumerate} -The invisible parts are implemented in the text file -``TwoLinkGPC\_input.txt'' (see Section \Ref{sec:TwoLinkGPC_input.txt}). -These parts are: -\begin{itemize} -\item the reference signal (joint angles) - \begin{equation} - w(t) = - \begin{cases} - \begin{pmatrix} - \pi \\ - 0 - \end{pmatrix} & 0 \ge t > 10 \\ - \begin{pmatrix} - 2\pi \\ - 0 - \end{pmatrix} & 10 \ge t > 15 \\ - \begin{pmatrix} - 2\pi \\ - \pi - \end{pmatrix} & 15 \ge t > 30 \\ - \end{cases} - \end{equation} -\item The control signal (joint torques) being the solution of - \begin{equation} - \phi^*(t) = O_o(\hat x(t)) + O_h(\hat x(t)) u(t) = w(t) - \end{equation} -where $\hat x$ is the observed state. -\item The observer feedback signal - \begin{equation} - u_x = K ( y - \hat y) - \end{equation} -where $K$ is the observer gain matrix and $y$ and $\hat y$ are the -system and model outputs respectively. -\end{itemize} -The observer gain is set up on the basis of the \emph{linearised} -system using LQ theory. This is implemented in the text file -``TwoLinkGPC\_state.txt'' (see Section \Ref{sec:TwoLinkGPC_state.txt}) -using the Octave function ``lqe'' together with the MTT-generated -linearised system ``TwoLink\_sm''. - - -The system was simulated using Octave under MTT with the results given -in Figures -\Ref{fig:TwoLinkGPC_odeso.ps-TwoLinkGPC-Theta-1,TwoLinkGPC-Theta-1-r} -and -\Ref{fig:TwoLinkGPC_odeso.ps-TwoLinkGPC-Theta-2,TwoLinkGPC-Theta-2-r} -giving the actual and specification angles for joints 1 and 2 -respectively. - -The initial \emph{system} state was zero except that the angle of the -first rod was $\frac{\pi}{4}$. The initial \emph{observer} state was -(erroneously but deliberately) set at zero. This explains the -(decaying) discrepancy between the actual and specification angles. -Simulations with zero initial state gave precise matching. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.tex Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.tex +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.tex @@ -1,48 +0,0 @@ -%% Tex file (TwoLinkGPC_input.txt) -%% Generated by MTT at Wed Apr 29 11:21:32 BST 1998 -\begin{verbatim} -# Numerical parameter file (TwoLinkGPC_input.txt) -# Generated by MTT at Mon Apr 13 11:02:37 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -global ObserverGain; - -if t<10 - tau = 0; -elseif t<20 - tau = 0.1; -else - tau = 0.2; -end - -# Reference signals -Period = 20; -u(1) = -pi*sign(cos(2*pi*t/Period))*(t>5); # TwoLinkGPC (Ref_1) -u(2) = pi*sign(sin(2*pi*t/Period)); # TwoLinkGPC (Ref_2) -w = u(1:2); # Reference signal - -# Control signals -x_model = x(9:12); # Observed states -[O_o, O_h] = TwoLinkPS_obs(x_model) #GPC O function (affine case) -[spec_n,spec_d] = msdP_tf; # Spec transfer function -P = spec_d(3:-1:1); # P poly with ascending coeffs -PP = [eye(2)*P(1) eye(2)*P(2) eye(2)*P(3)]; # Matrix version -PO_o = PP*O_o; # Compute Py with u zero -PO_h = PP*O_h; # Coefficient of u -u_control = PO_h\(w - PO_o); # GMV control signal - -u(3:4) = u_control; # TwoLinkGPC (Tau_1) - -# Observer -x_system = x(5:8); # System states -error = x_system-x_model; # Error in states -ObserverInput = ObserverGain*error; -u(5:8) = ObserverInput; # Set the state-input to the observer - -\end{verbatim} DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_input.txt @@ -1,42 +0,0 @@ -# Numerical parameter file (TwoLinkGPC_input.txt) -# Generated by MTT at Mon Apr 13 11:02:37 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -global ObserverGain; - -if t<10 - tau = 0; -else - tau = 0.1; -end - -# Reference signals -Period = 20; -u(1) = -pi*sign(cos(2*pi*t/Period))*(t>5); # TwoLinkGPC (Ref_1) -u(2) = pi*sign(sin(2*pi*t/Period)); # TwoLinkGPC (Ref_2) -w = u(1:2); # Reference signal - -# Control signals -x_model = x(9:12); # Observed states -[O_o, O_h] = TwoLinkPS_obs(x_model) #GPC O function (affine case) -[spec_n,spec_d] = msdP_tf; # Spec transfer function -P = spec_d(3:-1:1); # P poly with ascending coeffs -PP = [eye(2)*P(1) eye(2)*P(2) eye(2)*P(3)]; # Matrix version -PO_o = PP*O_o; # Compute Py with u zero -PO_h = PP*O_h; # Coefficient of u -u_control = PO_h\(w - PO_o); # GMV control signal - -u(3:4) = u_control; # TwoLinkGPC (Tau_1) - -# Observer -x_system = x(5:8); # System states -error = x_system-x_model; # Error in states -ObserverInput = ObserverGain*error; -u(5:8) = ObserverInput; # Set the state-input to the observer - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_lbl.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_lbl.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_lbl.txt @@ -1,46 +0,0 @@ -%SUMMARY TwoLinkGPC - GPC control of two-link manipulator with delay -%DESCRIPTION This composite system provides an illustration -%DESCRIPTION of nonlinear GPC (Generalised Predictive Control) control -%DESCRIPTION (continuous-time) operating on a twolink manipulator. - -%% Label file for system TwoLinkGPC (TwoLinkGPC_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/04/29 09:01:43 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type SS - Ref_1 SS external,internal - Ref_2 SS external,internal - Tau_1 SS external,internal - Tau_2 SS external,internal - Theta_1 SS external,0 - Theta_2 SS external,0 - Theta_1_m SS external,0 - Theta_2_m SS external,0 - Theta_1_r SS external,0 - Theta_2_r SS external,0 - -% Component type msdP - spec_1 - spec_2 - -% Component type TwoLinkP - system - -% Component type TwoLinkPX - model - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_numpar.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_numpar.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_numpar.txt @@ -1,18 +0,0 @@ -# Numerical parameter file (TwoLinkGPC_numpar.txt) -# Generated by MTT at Mon Apr 13 10:57:02 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_s = 1.0; # msdP -j_s = 1.0; # msdP -r_s = 2.0; # msdP -tau = 0.1; # msdP -l_r = 0.5; # TwoLinkP,TwoLinkPX -m_r = 1.0; # TwoLinkP,TwoLinkPX -j_r = m_r*l_r*l_r/3; # TwoLinkP,TwoLinkPX DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_obspar.r Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_obspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_obspar.r +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_obspar.r @@ -1,29 +0,0 @@ -%% Reduce GPC observability function parameters for system TwoLinkGPC (TwoLinkGPC_obspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -MTTGPCNy := 2; -MTTGPCNu := 0; -Matrix MTTdU(5,1); -MTTdU(1,1) := MTTdU1; -MTTdU(2,1) := MTTdU2; -MTTdU(3,1) := MTTdU3; -MTTdU(4,1) := MTTdU4; -MTTdU(5,1) := MTTdU5; -Matrix MTTUU(2,5); -MTTUU(1,1) := MTTu1; -MTTUU(1,2) := MTTu11; -MTTUU(1,3) := MTTu12; -MTTUU(1,4) := MTTu13; -MTTUU(1,5) := MTTu14; -MTTUU(2,1) := MTTu2; -MTTUU(2,2) := MTTu21; -MTTUU(2,3) := MTTu22; -MTTUU(2,4) := MTTu23; -MTTUU(2,5) := MTTu24; -END; DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_rep.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_rep.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_rep.txt @@ -1,32 +0,0 @@ -# Outline report file for system TwoLinkGPC (TwoLinkGPC_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt TwoLinkGPC abg tex -mtt TwoLinkGPC struc tex -mtt TwoLinkGPC sympar tex - -mtt TwoLinkPS struc tex -mtt TwoLinkPS rfe tex -mtt TwoLinkPS ode tex -mtt TwoLinkPS obs tex - -mtt TwoLinkPS ss tex -mtt TwoLinkPS sm tex - -mtt msdP tf tex - -mtt TwoLinkGPC numpar txt -mtt TwoLinkGPC state txt -mtt TwoLinkGPC input txt - -mtt TwoLinkGPC odeso ps 'TwoLinkGPC_Theta_1,TwoLinkGPC_Theta_1_r' -mtt TwoLinkGPC odeso ps 'TwoLinkGPC_Theta_2,TwoLinkGPC_Theta_2_r' - - - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt @@ -1,13 +0,0 @@ -%% Simulation parameters for system TwoLinkGPC (TwoLinkGPC_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=30 -DT=0.1 -STEPFACTOR=2 - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt_old Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt_old ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt_old +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_simpar.txt_old @@ -1,13 +0,0 @@ -%% Simulation parameters for system TwoLinkGPC (TwoLinkGPC_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=30 -DT=0.1 -STEPFACTOR=2 - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_state.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_state.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_state.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkGPC_state.txt @@ -1,31 +0,0 @@ -# Numerical parameter file (TwoLinkGPC_state.txt) -# Generated by MTT at Thu Apr 23 09:10:43 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -global ObserverGain; - -# Set the states -x(1) = 0 ; # TwoLinkGPC_spec_1 (c_s) -x(2) = 0 ; # TwoLinkGPC_spec_1 (j_s) -x(3) = 0 ; # TwoLinkGPC_spec_2 (c_s) -x(4) = 0 ; # TwoLinkGPC_spec_2 (j_s) -x(5) = 0 ; # TwoLinkGPC_system_rod1 (J) -x(6) = 0 ; # TwoLinkGPC_system_rod1_th (3) -x(7) = 0 ; # TwoLinkGPC_system_rod2 (J) -x(8) = 0 ; # TwoLinkGPC_system_rod2_th (3) -x(9) = 0 ; # TwoLinkGPC_model_rod1_J (i) -x(10) = 0 ; # TwoLinkGPC_model_rod1_th_c (c) -x(11) = 0 ; # TwoLinkGPC_model_rod2_J (i) -x(12) = 0 ; # TwoLinkGPC_model_rod2_th_c (c) - -# Observer design -[A,B,C] = TwoLinkPS_sm; # Get the linearised system -sigma = 0.1; # Measurement noise variance (pretend) -k = lqe(A,eye(4),C,eye(4),sigma*eye(2)) -ObserverGain = k*C; # This system happens to have a linear output DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_abg.fig Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_abg.fig +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_abg.fig @@ -1,104 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3468 1128 3738 1128 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4593 2703 4863 2703 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 1128 4728 2703 4953 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4502 5492 4502 5762 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5627 4502 5627 4277 5852 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 7426 4951 7201 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3472 8647 3742 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4597 8647 4867 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5724 8649 5994 8649 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4730 8645 4730 10220 4955 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5855 8645 5855 10220 6080 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3826 3601 7426 3826 7201 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3826 5851 7426 6076 7201 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 11475 9450 225 180 225 180 11475 9450 11475 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 8622 3600 10197 3825 9972 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 7650 450 9405 450 9405 675 7650 675 7650 450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 3285 1575 3285 1800 3510 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3195 8055 1620 8055 1845 8280 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 3150 1350 2025 1575 2250 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 8325 1350 9450 1575 9225 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 7875 1350 3600 1575 3825 -4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000 4 195 1335 4729 3379 RODaX:rod1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1335 4731 8196 RODaX:rod2\001 -4 1 4 0 0 0 20 0.0000 4 255 1410 4771 946 SS:[Joint_1]\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 -4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 -4 1 -1 0 0 0 20 0.0000 4 255 810 5850 945 SS:v_y\001 -4 2 4 0 0 0 20 0.0000 4 255 1410 2882 5717 SS:[Joint_2]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 675 3510 3375 [alpha]\001 -4 1 4 0 0 0 16 0.0000 4 225 675 3555 8145 [alpha]\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 1308 8193 1\001 -4 1 4 0 0 0 20 0.0000 4 255 1530 1397 1892 SS:[Theta_1]\001 -4 1 4 0 0 0 20 0.0000 4 255 1530 1352 9767 SS:[Theta_2]\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 1263 3468 0\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_desc.tex Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_desc.tex +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_desc.tex @@ -1,42 +0,0 @@ -% Verbal description for system TwoLinkPSX (TwoLinkPSX_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/19 14:20:07 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLinkPSX} is - displayed in Figure \Ref{TwoLinkPSX_abg} and its label - file is listed in Section \Ref{sec:TwoLinkPSX_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLinkPSX_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses the compound components: {\bf ROD}. {\bf -ROD} is essentially as described in Figure 10.2. -There is no gravity included in this model. - -This system has a number of dynamic elements (those corresponding to translation -motion) in derivative causality, thus the system is represnted as a -Differential-Algebraic Equation (Section -\Ref{sec:TwoLinkPSX_dae.tex}). Hovever, this is of contrained-state form and -therfore can be written as a set of constrained-state equations (Section -\Ref{sec:TwoLinkPSX_cse.tex}). The corresponding ordinary differential -equation is complicated due to the trig functions involved in -inverting the E matrix. - -As well as the standard representation the ``robot-form'' equations -appear in Section \Ref{sec:TwoLinkPSX_rfe}. - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_lbl.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_lbl.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPSX_lbl.txt @@ -1,57 +0,0 @@ -%SUMMARY TwoLinkPSX: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (TwoLinkPSX_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/12/05 12:39:49 peterg -% %% Documentation -% %% -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - uniform rods -rod1 none l_r;l_r;j_r;m_r -rod2 none l_r;l_r;j_r;m_r - -%Zero velocity sources -v_x SS internal,0 -v_y SS internal,0 - - -%Zero force/torque sources -F_x SS 0,internal -F_a SS 0,internal -F_y SS 0,internal - -%Named ports -[Joint_1] SS external,internal -[Joint_2] SS external,internal -[Theta_1] SS external,0 -[Theta_2] SS external,0 - -%Torque/velocity at joints -%f_a1 SS external,external -%f_a2 SS external,external - - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_abg.fig Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_abg.fig +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_abg.fig @@ -1,126 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 11700 1800 485 485 11700 1800 11880 2250 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 11700 6300 485 485 11700 6300 12185 6785 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11745 11925 11745 450 45 450 45 11925 11745 11925 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 - 7650 900 4725 900 4725 3375 3375 3375 3600 3600 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4950 8505 4950 4230 5175 4455 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 6300 4052 6302 3827 6527 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 4275 6525 4275 8325 3150 8325 3375 8550 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 6300 7652 6300 7427 6525 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6618 1803 6888 1803 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8870 1805 9140 1805 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7743 3378 8013 3378 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7878 1125 7878 3378 8103 3153 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7652 6167 7652 6437 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7876 6526 7876 8101 8101 7876 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6622 9322 6892 9322 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7747 9322 8017 9322 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8874 9324 9144 9324 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7880 9320 7880 10895 8105 10670 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9005 9320 9005 10895 9230 10670 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6751 4501 6751 8101 6976 7876 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9001 4501 9001 8101 9226 7876 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9675 9450 9675 7875 6075 7875 6075 9450 9675 9450 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9675 7110 9675 5535 6075 5535 6075 7110 9675 7110 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9675 11925 9675 10350 6075 10350 6075 11925 9675 11925 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6753 1803 6753 3378 6978 3153 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9003 1803 9003 3378 9228 3153 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7876 4501 7876 6076 8101 5851 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9675 4725 6075 4725 6075 3150 9675 3150 9675 4725 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 9297 6750 10872 6975 10647 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11925 5850 11925 2250 11475 2250 11475 5850 11925 5850 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11925 10350 11925 6750 11475 6750 11475 10350 11925 10350 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 10800 1125 12555 1125 12555 1350 10800 1350 10800 1125 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9630 2745 9630 1170 6030 1170 6030 2745 9630 2745 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8910 900 8145 900 8370 1125 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2790 3735 2115 3735 2340 3960 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4725 3960 3330 3960 3555 4185 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 3960 5040 3960 5265 4185 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2700 8550 2025 8550 2250 8775 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 8775 3150 8775 3375 9000 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7200 8775 4905 8775 5130 9000 -4 0 -1 0 0 0 20 0.0000 4 195 135 4863 4053 0\001 -4 2 4 0 0 0 20 0.0000 4 255 1410 2702 6392 SS:[Joint_2]\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4188 6393 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 810 6753 1623 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 7833 6393 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 6758 11348 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 7883 11348 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 9053 11348 SS:F_y\001 -4 0 1 1 0 3 20 0.0000 4 210 720 9945 4050 Link 1\001 -4 0 1 1 0 3 20 0.0000 4 225 795 9900 6435 Joint 2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 9900 8865 Link 2\001 -4 0 1 1 0 3 20 0.0000 4 270 375 9900 11160 Tip\001 -4 0 1 1 0 3 20 0.0000 4 225 795 9900 1935 Joint 1\001 -4 1 4 0 0 0 16 0.0000 4 225 900 7875 3645 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 6750 4455 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 7875 4455 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 9000 4455 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 9000 3645 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 6755 8510 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 7880 8510 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 6757 9187 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 7883 9188 [alpha_b]\001 -4 1 -1 0 0 0 20 0.0000 4 255 810 9000 1620 SS:v_y\001 -4 1 4 0 0 0 16 0.0000 4 210 495 6750 3645 [x_a]\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 7788 993 1\001 -4 0 4 0 0 0 20 0.0000 4 255 1410 9046 991 SS:[Joint_1]\001 -4 2 4 0 0 0 20 0.0000 4 255 1530 1892 3827 SS:[Theta_1]\001 -4 1 4 0 0 0 16 0.0000 4 210 240 2700 3555 [s]\001 -4 1 -1 0 0 0 20 1.5708 4 195 780 3154 3731 Sensor\001 -4 1 4 0 0 0 16 0.0000 4 225 270 3420 3825 [p]\001 -4 1 4 0 0 0 16 0.0000 4 210 270 3330 3195 [v]\001 -4 1 -1 0 0 0 20 0.0000 4 195 1335 7879 4009 RODa:rod1\001 -4 1 4 0 0 0 16 0.0000 4 225 675 6885 4005 [alpha]\001 -4 1 4 0 0 0 16 0.0000 4 210 270 3375 8235 [v]\001 -4 1 4 0 0 0 16 0.0000 4 210 240 2655 8460 [s]\001 -4 1 -1 0 0 0 20 1.5708 4 195 780 3064 8546 Sensor\001 -4 2 4 0 0 0 20 0.0000 4 255 1530 1937 8642 SS:[Theta_2]\001 -4 1 4 0 0 0 16 0.0000 4 225 270 3375 8730 [p]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 8780 8510 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 8739 9189 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 675 7065 8820 [alpha]\001 -4 1 -1 0 0 0 20 0.0000 4 195 1335 8061 8826 RODa:rod2\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4593 8823 1\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_desc.tex Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_desc.tex +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_desc.tex @@ -1,42 +0,0 @@ -% Verbal description for system TwoLinkPS (TwoLinkPS_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/19 14:20:07 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLinkPS} is - displayed in Figure \Ref{TwoLinkPS_abg} and its label - file is listed in Section \Ref{sec:TwoLinkPS_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLinkPS_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses the compound components: {\bf ROD}. {\bf -ROD} is essentially as described in Figure 10.2. -There is no gravity included in this model. - -This system has a number of dynamic elements (those corresponding to translation -motion) in derivative causality, thus the system is represnted as a -Differential-Algebraic Equation (Section -\Ref{sec:TwoLinkPS_dae.tex}). Hovever, this is of contrained-state form and -therfore can be written as a set of constrained-state equations (Section -\Ref{sec:TwoLinkPS_cse.tex}). The corresponding ordinary differential -equation is complicated due to the trig functions involved in -inverting the E matrix. - -As well as the standard representation the ``robot-form'' equations -appear in Section \Ref{sec:TwoLinkPS_rfe}. - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_lbl.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_lbl.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_lbl.txt @@ -1,57 +0,0 @@ -%SUMMARY TwoLinkPS: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (TwoLinkPS_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/12/05 12:39:49 peterg -% %% Documentation -% %% -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - uniform rods -rod1 none l_r;l_r;j_r;m_r -rod2 none l_r;l_r;j_r;m_r - -%Zero velocity sources -v_x SS internal,0 -v_y SS internal,0 - - -%Zero force/torque sources -F_x SS 0,internal -F_a SS 0,internal -F_y SS 0,internal - -%Named ports -[Joint_1] SS external,internal -[Joint_2] SS external,internal -[Theta_1] SS external,0 -[Theta_2] SS external,0 - -%Torque/velocity at joints -%f_a1 SS external,external -%f_a2 SS external,external - - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_obspar.r Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_obspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_obspar.r +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_obspar.r @@ -1,29 +0,0 @@ -%% Reduce GPC observability function parameters for system TwoLinkPS (TwoLinkPS_obspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -MTTGPCNy := 2; -MTTGPCNu := 0; -Matrix MTTdU(5,1); -MTTdU(1,1) := MTTdU1; -MTTdU(2,1) := MTTdU2; -MTTdU(3,1) := MTTdU3; -MTTdU(4,1) := MTTdU4; -MTTdU(5,1) := MTTdU5; -Matrix MTTUU(2,5); -MTTUU(1,1) := MTTu1; -MTTUU(1,2) := MTTu11; -MTTUU(1,3) := MTTu12; -MTTUU(1,4) := MTTu13; -MTTUU(1,5) := MTTu14; -MTTUU(2,1) := MTTu2; -MTTUU(2,2) := MTTu21; -MTTUU(2,3) := MTTu22; -MTTUU(2,4) := MTTu23; -MTTUU(2,5) := MTTu24; -END; DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_simp.r Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_simp.r ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_simp.r +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_simp.r @@ -1,19 +0,0 @@ -%% Reduce commands to simplify output for system TwoLinkP (TwoLinkP_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LET cos(mttx2) = c_2; -LET sin(mttx2) = s_2; - -LET cos(mttx4) = c_4; -LET sin(mttx4) = s_4; - -LET cos(mttx2-mttx4) = c; -LET sin(mttx2-mttx4) = s; - -END; DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_subs.r Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_subs.r ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_subs.r +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/TwoLinkPS_subs.r @@ -1,24 +0,0 @@ -%% Reduce substitution statements for system TwoLinkPSX (TwoLinkPSX_subs.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/03/22 20:13:25 peterg -% %% Trig simplification added -% %% -% %% Revision 1.1 1998/03/22 20:12:51 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -END; - DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig @@ -1,33 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 4050 4950 4050 4725 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 4275 3600 5400 3825 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 4050 3375 4050 3150 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 4050 6525 4050 6300 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3825 5175 2700 5400 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3825 3600 2700 3825 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 4050 8100 4050 7875 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9000 4050 10125 4050 9900 4275 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11475 6975 11475 1125 1125 1125 1125 6975 11475 6975 -4 1 -1 0 0 0 20 0.0000 4 195 135 3600 4185 1\001 -4 2 4 0 0 0 20 0.0000 4 240 810 2160 4140 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 480 3600 5715 I:j_s\001 -4 1 1 1 0 0 20 0.0000 4 255 7035 4815 6345 Mass-spring-damper system (position output with extra lag)\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5175 4140 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 615 3600 2565 R:r_s\001 -4 1 -1 0 0 0 20 0.0000 4 255 630 5175 2565 C:c_s\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 6750 4140 AE\001 -4 1 -1 0 0 0 20 0.0000 4 195 690 8550 4140 RC:rc\001 -4 0 4 0 0 0 20 0.0000 4 240 960 10260 4140 SS:[out]\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig.bak Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig.bak ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig.bak +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_abg.fig.bak @@ -1,27 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 4050 4950 4050 4725 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 4275 3600 5400 3825 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 4050 3375 4050 3150 4275 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 6975 8325 1125 1125 1125 1125 6975 8325 6975 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 4050 6525 4050 6300 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3825 5175 2700 5400 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3825 3600 2700 3825 2925 -4 1 -1 0 0 0 20 0.0000 4 195 135 3600 4185 1\001 -4 2 4 0 0 0 20 0.0000 4 240 810 2160 4140 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 480 3600 5715 I:j_s\001 -4 1 1 1 0 0 20 0.0000 4 255 5355 4815 6345 Mass-spring-damper system (position output)\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5175 4140 0\001 -4 0 4 0 0 0 20 0.0000 4 240 960 6660 4140 SS:[out]\001 -4 1 -1 0 0 0 20 0.0000 4 255 615 3600 2565 R:r_s\001 -4 1 -1 0 0 0 20 0.0000 4 255 630 5175 2565 C:c_s\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_desc.tex Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_desc.tex +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_desc.tex @@ -1,31 +0,0 @@ -% Verbal description for system msdPS (msdPS_desc.tex) -% Generated by MTT on Thu Nov 13 09:38:17 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{msdPS} is - displayed in Figure \Ref{msdPS_abg} and its label - file is listed in Section \Ref{sec:msdPS_lbl}. - The subsystems are listed in Section \Ref{sec:msdPS_sub}. - - - \textbf{msdPS} is a simple Mass-Spring-Damper system with - force input and position output. It is set up to provide a specification system - for each link of the two-link maipulator. This is appropriate because - \begin{itemize} - \item it has compatible physical behaviour with the system itself, - \item it specifies two decoupled systems, - \item it has linear behaviour and - \item it has a simple performance interpretation in terms of system - rise-time and overshoot. - \end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_lbl.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_lbl.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdPS_lbl.txt @@ -1,33 +0,0 @@ -%SUMMARY msdPS -%DESCRIPTION -%% Label file for system msdPS (msdPS_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_s lin effort,c_s - -% Component type I - j_s lin flow,j_s - -% Component type R - r_s lin flow,r_s - -% Component type RC - rc none tau;1 - -% Component type SS - [in] SS external,internal - [out] SS external,0 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_abg.fig Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_abg.fig +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_abg.fig @@ -1,27 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 4050 4950 4050 4725 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 4275 3600 5400 3825 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 4050 3375 4050 3150 4275 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 6975 8325 1125 1125 1125 1125 6975 8325 6975 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 4050 6525 4050 6300 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3825 5175 2700 5400 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3825 3600 2700 3825 2925 -4 1 -1 0 0 0 20 0.0000 4 195 135 3600 4185 1\001 -4 2 4 0 0 0 20 0.0000 4 240 810 2160 4140 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 480 3600 5715 I:j_s\001 -4 1 1 1 0 0 20 0.0000 4 255 5355 4815 6345 Mass-spring-damper system (position output)\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5175 4140 0\001 -4 0 4 0 0 0 20 0.0000 4 240 960 6660 4140 SS:[out]\001 -4 1 -1 0 0 0 20 0.0000 4 255 615 3600 2565 R:r_s\001 -4 1 -1 0 0 0 20 0.0000 4 255 630 5175 2565 C:c_s\001 DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_desc.tex Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_desc.tex +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_desc.tex @@ -1,31 +0,0 @@ -% Verbal description for system msdP (msdP_desc.tex) -% Generated by MTT on Thu Nov 13 09:38:17 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{msdP} is - displayed in Figure \Ref{msdP_abg} and its label - file is listed in Section \Ref{sec:msdP_lbl}. - The subsystems are listed in Section \Ref{sec:msdP_sub}. - - - \textbf{msdP} is a simple Mass-Spring-Damper system with - force input and position output. It is set up to provide a specification system - for each link of the two-link maipulator. This is appropriate because - \begin{itemize} - \item it has compatible physical behaviour with the system itself, - \item it specifies two decoupled systems, - \item it has linear behaviour and - \item it has a simple performance interpretation in terms of system - rise-time and overshoot. - \end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_lbl.txt Index: mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_lbl.txt +++ mttroot/mtt/lib/examples/Control/GPC/TwoLinkGPC/msdP_lbl.txt @@ -1,30 +0,0 @@ -%SUMMARY msdP -%DESCRIPTION -%% Label file for system msdP (msdP_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_s lin effort,c_s - -% Component type I - j_s lin flow,j_s - -% Component type R - r_s lin flow,r_s - -% Component type SS - [in] SS external,internal - [out] SS external,0 DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_abg.fig @@ -1,21 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 1800 5400 1800 5175 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4230 2700 5355 2700 5130 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 1575 5400 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 2475 5400 2925 -4 0 0 100 0 18 20 0.0000 4 225 810 5625 1890 SS:z1\001 -4 0 0 100 0 18 20 0.0000 4 240 810 5625 2790 SS:z2\001 -4 2 4 100 0 18 20 0.0000 4 285 1305 4140 1890 SS:[y_in]\001 -4 2 4 100 0 18 20 0.0000 4 285 1860 4140 2790 SS:[theta_in]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Fixed_lbl.txt @@ -1,30 +0,0 @@ -%% Label file for system Fixed (Fixed_lbl.txt) -%SUMMARY Fixed -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in y_in,theta_in - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [theta_in] SS external,external - [y_in] SS external,external - z1 SS internal,0 - z2 SS internal,0 - DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_abg.fig @@ -1,21 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 1800 5400 1800 5175 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4230 2700 5355 2700 5130 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 1575 5400 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 2475 5400 2925 -4 2 0 100 0 18 20 0.0000 4 225 810 4140 1890 SS:z1\001 -4 2 0 100 0 18 20 0.0000 4 240 810 4140 2790 SS:z2\001 -4 0 4 100 0 18 20 0.0000 4 285 1500 5490 1890 SS:[y_out]\001 -4 0 4 100 0 18 20 0.0000 4 285 2055 5445 2790 SS:[theta_out]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Free_lbl.txt @@ -1,32 +0,0 @@ -%% Label file for system Free (Free_lbl.txt) -%SUMMARY Free -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS out y_out,theta_out - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [theta_out] SS external,external - [y_out] SS external,external - z1 SS 0,internal - z2 SS 0,internal - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Make_figures.m Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Make_figures.m ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Make_figures.m +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/Make_figures.m @@ -1,4 +0,0 @@ -#!/bin/sh -## Script file Make_figures. - -ppp_1("PPPCantileverBeam",1:2,[1 2;1 3]); # 2 inputs; modes 1 2 and 1 and 3 DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_abg.fig @@ -1,40 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1125 2700 2250 2700 2025 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 8775 2700 9900 2700 9675 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 2700 3825 2700 3600 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4230 2700 5355 2700 5130 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4095 6300 4095 4500 4320 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3870 4500 4320 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5850 2700 6975 2700 6750 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7380 2700 8505 2700 8280 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7245 6300 7245 4500 7470 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 7020 4500 7470 4500 -4 1 0 100 0 18 20 1.5708 4 225 630 1035 2700 Free\001 -4 1 0 100 0 18 20 1.5708 4 225 780 10260 2700 Fixed\001 -4 1 0 100 0 18 20 1.5708 4 285 3690 8775 2700 BernoulliEuler:Chunk_3*3\001 -4 1 0 100 0 18 20 1.5708 4 285 3690 2610 2700 BernoulliEuler:Chunk_1*3\001 -4 1 0 100 0 18 20 1.5708 4 300 3480 4140 2700 pBernoulliEuler:Patch_1\001 -4 1 4 100 0 18 16 0.0000 4 240 900 4095 4455 [torque]\001 -4 1 0 100 0 18 20 0.0000 4 285 1275 4050 6660 SS:tau_1\001 -4 1 0 100 0 18 20 1.5708 4 285 3690 5760 2700 BernoulliEuler:Chunk_2*8\001 -4 1 0 100 0 18 20 1.5708 4 300 3480 7290 2700 pBernoulliEuler:Patch_2\001 -4 1 4 100 0 18 16 0.0000 4 240 900 7245 4455 [torque]\001 -4 1 0 100 0 18 20 0.0000 4 285 1275 7200 6660 SS:tau_2\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_desc.tex Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_desc.tex +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_desc.tex @@ -1,64 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system PPPCantileverBeam (PPPCantileverBeam_desc.tex) -% Generated by MTT on Mon Apr 19 07:04:54 BST 1999. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/05/18 04:01:50 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -The acausal bond graph of system \textbf{PPPCantileverBeam} is displayed in -Figure \Ref{fig:PPPCantileverBeam_abg.ps} and its label file is listed in -Section \Ref{sec:PPPCantileverBeam_lbl}. The subsystems are listed in Section -\Ref{sec:PPPCantileverBeam_sub}. - -This example represents the dynamics of a uniform beam with one fixed -and one free end. The beam is approximated by 16 equal lumps using -the Bernoulli-Euler approximation with damping. The ouputs are taken -to be the 16 lump velocities, the two inputs are taken to be torques -applied to lumps 3 away from each end; this approximates the effect of -two piezoelectric patches. - -The system parameters are given in Section -\Ref{sec:PPPCantileverBeam_numpar.tex}. -The system has 32 states (16 modes of vibration), 2 inputs and 12 -outputs. -The first 8 modal frequencies are given in Table \ref{tab:modes}. -\begin{table}[htbp] - \begin{center} - \begin{tabular}{||c|c||c|c||} - \hline - Mode & $\omega_i$ & Mode & $\omega_i$\\ - \hline - \hline - 1 & 0.0079504 & 5 & 0.4352376\\ - 2 & 0.0498140 & 6 & 0.6338899\\ - 3 & 0.1386209 & 7 & 0.8573604\\ - 4 & 0.2682835 & 8 & 1.0976942\\ - \hline - \end{tabular} - \caption{Modal frequencies} - \label{tab:modes} - \end{center} -\end{table} - -Figure \Ref{fig:PPPCantileverBeam_lmfr.ps} shows the log modulus of the frequency -response and Figure \Ref{fig:PPPCantileverBeam_pppy0.ps} shows the system transient -reponse with no control and an initial unit twist. - -Figure \Ref{fig:PPPCantileverBeam_pppy.ps} shows closed loop reponse when -controlled by a PPP controller attempting to damp modes 1 and 2 from -input 1 and modes 1 and three from input 2. Figure -\Ref{fig:PPPCantileverBeam_pppy.ps} shows the corresponding control signals. - - - - - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_input.txt Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_input.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_input.txt +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_input.txt @@ -1,14 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (PPPCantileverBeam_input.txt) -# Generated by MTT at Thu Apr 22 00:12:54 BST 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -# Set the inputs -mttu(1) = exp(-t/0.1); # tau (PPPCantileverBeam) - -# Set the switches DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_lbl.txt @@ -1,45 +0,0 @@ -%% Label file for system PPPCantileverBeam (PPPCantileverBeam_lbl.txt) -%SUMMARY PPPCantileverBeam -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Declare some variables -%VAR Area -%VAR AreaMoment -%VAR BeamLength -%VAR BeamThickness -%VAR BeamWidth -%VAR Density -%VAR N -%VAR Youngs -%VAR EI -%VAR rhoA - -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type BenoulliEuler - Chunk_1 - Patch_1 - Chunk_2 - Patch_2 - Chunk_3 - - -% Component type SS - tau_1 SS external,external - tau_2 SS external,external DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt @@ -1,32 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (PPPCantileverBeam_numpar.txt) -# Generated by MTT at Mon Apr 19 06:24:08 BST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:27:26 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -N = 16; -BeamLength = 0.58; -BeamWidth = 0.05; -BeamThickness = 0.005; -Youngs = 1e6; -Density = 1e5; -Area = BeamWidth*BeamThickness; -AreaMoment = (BeamThickness*pow(BeamWidth,2))/12; - - -EI= 58.6957 # from Reza -rhoA= 0.7989 # from Reza - -dz = BeamLength/N; # Incremental length -dm = rhoA*dz; # Incremental mass -dk = EI/dz; # Incremental stiffness -dr = 1e-2; # Damping DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_rep.txt Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_rep.txt +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_rep.txt @@ -1,31 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system PPPCantileverBeam (PPPCantileverBeam_rep.txt) -## Generated by MTT on" Mon Apr 19 06:43:08 BST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt PPPCantileverBeam abg tex # The system description -## mtt PPPCantileverBeam cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt PPPCantileverBeam struc tex # The system structure -## mtt PPPCantileverBeam dae tex # The system dae -## mtt PPPCantileverBeam ode tex # The system ode -## mtt PPPCantileverBeam sspar tex # Steady-state parameters -## mtt PPPCantileverBeam ss tex # Steady state -## mtt PPPCantileverBeam dm tex # Descriptor matrices (of linearised system) -## mtt PPPCantileverBeam sm tex # State matrices (of linearised system) -## mtt PPPCantileverBeam tf tex # Transfer function (of linearised system) -mtt PPPCantileverBeam simpar tex # Simulation parameters -mtt PPPCantileverBeam numpar tex # Numerical simulation parameters -## mtt PPPCantileverBeam input tex # Simulation input -## mtt PPPCantileverBeam odeso ps # Simulation output -mtt PPPCantileverBeam lmfr ps # log modulus of frequency response (of linearised system) - -mtt PPPCantileverBeam pppy ps # PPP output -mtt PPPCantileverBeam pppu ps # PPP input -mtt PPPCantileverBeam pppy0 ps # PPP open-loop op DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system PPPCantileverBeam (PPPCantileverBeam_simpar.txt) -# Generated by MTT on Mon Apr 19 06:32:42 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 1.0; # Last time in simulation -DT = 0.01; # Print interval -STEPFACTOR = 10; # Integration steps per print interval -WMIN = 1; # Minimum frequency = 10^WMIN -WMAX = 4; # Maximum frequency = 10^WMAX -WSTEPS = 500; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt_old Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt_old ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt_old +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_simpar.txt_old @@ -1,19 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system PPPCantileverBeam (PPPCantileverBeam_simpar.txt) -# Generated by MTT on Mon Apr 19 06:32:42 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 1.0; # Last time in simulation -DT = 0.01; # Print interval -STEPFACTOR = 10; # Integration steps per print interval -METHOD = Implicit; # Integration method -WMIN = 1; # Minimum frequency = 10^WMIN -WMAX = 4; # Maximum frequency = 10^WMAX -WSTEPS = 500; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/ppp_1.m Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/ppp_1.m ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/ppp_1.m +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/ppp_1.m @@ -1,176 +0,0 @@ -function ppp_1(Name,Inputs,Modes); - -# Name = "CantileverBeam" -# Inputs = 1:2 -# Modes = [1 2;1 3] - - path(path,"~/Research/CGPC/PPP"); - - Name,Inputs,Modes - - ## System - system(sprintf("mtt -q %s numpar m", Name)); - system(sprintf("mtt -q %s sm m", Name)); - par = eval(sprintf("%s_numpar;",Name)); - eval(sprintf("[A,B,C,D]=%s_sm(par);",Name)); - [n_x,n_u,n_y] = abcddim(A,B,C,D) - - - ## Change B - B = B(:,Inputs); - [junk,n_u]=size(B); - n_u - - ## Redo C and D to reveal ALL velocities - n_y = n_x/2 - C = zeros(n_y,n_x); - for i = 1:n_y - C(i,2*i-1) = 1; - endfor - - ## Sort out D - D = zeros(n_y,n_u); - - e = eig(A); # Eigenvalues - N = length(e); - frequencies = sort(imag(e)); - frequencies = frequencies(N/2+1:N); # Modal frequencies - - ## Controller - ## Controller design parameters - t = [0.9:0.01:1.0]; # Optimisation horizon - - ## Specify input basis functions - ## - damped sinusoids with same frequencies as beam - damping_ratio = [0.1 0.1]; # Damping ratio of inputs - A_u=[]; -# Modes = [1 3 -# 1 2]; # Choose modes to be controlled by each input - if n_u == 1 # Put all modes on each input - Modes = [Modes; Modes]; - endif - - Modes - - for i=Inputs - A_ui = damped_matrix(frequencies(Modes(i,:)),damping_ratio(i)*ones(size(Modes(i,:)))); - A_u = [A_u;A_ui]; - u_0 = ones(n_x,1); # Initial conditions - endfor - - - A_w = 0; # Setpoint - Q = ones(n_y,1); # Output weighting - - ## Design - disp("Control design - unconstrained"); - [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw] = ppp_lin (A,B,C,D,A_u,A_w,t); # Unconstrained design - - ## Organise some plots - dt = 0.002; # Time increment -# T = 0:dt:t(length(t)); # Time starting at zero but past horizon - T = 0:dt:1.0; # Time - - ## Set up an "typical" initial condition - x_0 = zeros(n_x,1); - x_0(2:2:n_x) = ones(1,n_x/2); # Set initial twist to 1. -# disp("Computing OL response"); -# [Ys,Us] = ppp_transient (T,A_u,-(K_x*x_0)',u_0,A,B,C,D,x_0); # Compute open-loop control - - - disp("Computing OL response (no control)"); - [Y_0] = ppp_sm2sr(A, B, C, D, T, zeros(n_u,1), x_0); # Compute Closed-loop control - title("Y (no control)"); - xlabel("Time") - grid; - plot(T,Y_0); - psfig(sprintf("%s_pppy0",Name)); - - disp("Computing Unconstrained CL response"); - [y_u,X_u] = ppp_sm2sr(A-B*k_x, B, C, D, T, zeros(n_u,1), x_0); - u_u = -k_x*X_u'; - - - title("Unconstrained closed-loop control - y"); - xlabel("Time") - grid; - plot(T,y_u); - psfig(sprintf("%s_pppy",Name)); - - title("Unconstrained closed-loop control - u"); - xlabel("Time") - grid; - plot(T,u_u); - psfig(sprintf("%s_pppu",Name)); - -# ## Constrained version - -# ## Constraints - u -# Tau_u = [0:0.01:1]; -# one = ones(size(Tau_u)); -# limit = 1e10; -# Min_u = -limit*one; -# Max_u = limit*one; -# Order_u = 0*one; - -# ## Constraints - y -# Tau_y = []; -# one = ones(size(Tau_y)); -# limit = 1e5; -# Min_y = -limit*one; -# Max_y = limit*one; -# Order_y = 0*one; - -# ## Simulation - -# ## Constrained - open-loop -# Gamma = []; -# gamma = []; -# for i=1:n_u # Put same constraints on each input -# [Gamma_i,gamma_i] = ppp_input_constraint (A_u,Tau_u,Min_u,Max_u,Order_u,i,n_u); -# Gamma = [Gamma; Gamma_i]; -# gamma = [gamma; gamma_i]; -# endfor - - -# disp("Open-loop simulations..."); -# ## Constrained OL simulation -# W = zeros(n_y,1); -# [u,U] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,Gamma,gamma); -# T = [0:t(2)-t(1):t(length(t))]; -# [ys,us] = ppp_ystar (A,B,C,D,x_0,A_u,U,T); - -# title("Constrained y*"); -# xlabel("t"); -# grid; -# plot(T,ys) - -# ## Unconstrained OL simulation -# [uu,Uu] = ppp_qp (x_0,W,J_uu,J_ux,J_uw,Us0,[],[]); -# [ysu,usu] = ppp_ystar (A,B,C,D,x_0,A_u,Uu,T); - -# title("Unconstrained y*"); -# xlabel("t"); -# grid; -# plot(T,ysu) - -# ## Non-linear - closed-loop -# disp("Closed-loop simulation"); -# Tc = [0:4e-4:1.0]; -# Delta_ol = 1.0; -# [yc,uc,J] = ppp_qp_sim (A,B,C,D,A_u,A_w,t,Q, T, Tau_u,Min_u,Max_u,Order_u, Tau_y,Min_y,Max_y,Order_y,W,x_0,Delta_ol); - -# title("y,y*,u and u*"); -# xlabel("t"); -# grid; -# plot(T1,y,T,ys,T1,u,T,us); - -endfunction - - - - - - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppu_rep.make Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppu_rep.make ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppu_rep.make +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppu_rep.make @@ -1,20 +0,0 @@ -## Make file for the ppp output rep -## Symlinked to: -## pppy -## pppy0 -## pppu - -all: $(SYS)_pppy.ps $(SYS)_pppy0.ps $(SYS)_pppu.ps - -$(SYS)_pppy.ps: Make_figures.m ppp_1.m $(SYS)_sm.m $(SYS)_numpar.m - octave Make_figures.m -$(SYS)_pppy0.ps: $(SYS)_pppy.ps - touch $(SYS)_pppy0.ps -$(SYS)_pppu.ps: $(SYS)_pppy.ps - touch $(SYS)_pppu.ps - -$(SYS)_sm.m: - mtt $(SYS) sm m - -$(SYS)_numpar.m: - mtt $(SYS) numpar m DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy0_rep.make Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy0_rep.make ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy0_rep.make +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy0_rep.make @@ -1,20 +0,0 @@ -## Make file for the ppp output rep -## Symlinked to: -## pppy -## pppy0 -## pppu - -all: $(SYS)_pppy.ps $(SYS)_pppy0.ps $(SYS)_pppu.ps - -$(SYS)_pppy.ps: Make_figures.m ppp_1.m $(SYS)_sm.m $(SYS)_numpar.m - octave Make_figures.m -$(SYS)_pppy0.ps: $(SYS)_pppy.ps - touch $(SYS)_pppy0.ps -$(SYS)_pppu.ps: $(SYS)_pppy.ps - touch $(SYS)_pppu.ps - -$(SYS)_sm.m: - mtt $(SYS) sm m - -$(SYS)_numpar.m: - mtt $(SYS) numpar m DELETED mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy_rep.make Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy_rep.make ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy_rep.make +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/pppy_rep.make @@ -1,20 +0,0 @@ -## Make file for the ppp output rep -## Symlinked to: -## pppy -## pppy0 -## pppu - -all: $(SYS)_pppy.ps $(SYS)_pppy0.ps $(SYS)_pppu.ps - -$(SYS)_pppy.ps: Make_figures.m ppp_1.m $(SYS)_sm.m $(SYS)_numpar.m - octave Make_figures.m -$(SYS)_pppy0.ps: $(SYS)_pppy.ps - touch $(SYS)_pppy0.ps -$(SYS)_pppu.ps: $(SYS)_pppy.ps - touch $(SYS)_pppu.ps - -$(SYS)_sm.m: - mtt $(SYS) sm m - -$(SYS)_numpar.m: - mtt $(SYS) numpar m DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_abg.fig @@ -1,38 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4747 5175 6097 5175 5872 5400 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7447 5175 8797 5175 8572 5400 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2677 5175 4027 5175 3802 5400 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6772 3375 6772 4725 6997 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 6750 6750 5400 6975 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 8550 6750 7200 6975 7425 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 1575 6750 2925 6975 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9472 5175 10822 5175 10597 5400 -4 1 0 100 0 18 20 0.0000 4 225 405 6750 3240 AE\001 -4 1 0 100 0 18 20 0.0000 4 225 405 6750 7110 AE\001 -4 1 0 100 0 18 20 0.0000 4 225 405 4365 5265 AE\001 -4 1 4 100 0 18 20 0.0000 4 285 975 2115 5265 SS:[in]\001 -4 1 4 100 0 18 20 0.0000 4 285 1335 6795 1485 SS:[mod]\001 -4 1 4 100 0 18 20 0.0000 4 285 1500 6705 8820 SS:[smod]\001 -4 1 0 100 0 18 30 0.0000 4 330 660 6750 5265 R:r\001 -4 1 4 100 0 18 14 0.0000 4 210 270 5985 4995 [1]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 7560 4995 [2]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 6570 4590 [3]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 6570 5625 [4]\001 -4 1 0 100 0 18 20 0.0000 4 225 405 9135 5265 AE\001 -4 1 4 100 0 18 20 0.0000 4 285 1170 11475 5265 SS:[out]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AE3_lbl.txt @@ -1,44 +0,0 @@ -%% Label file for system AE3 (AE3_lbl.txt) -%SUMMARY AE3 -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS mod mod -%ALIAS out out -%ALIAS smod smod - -% Argument aliases -%ALIAS $1 l - -% CR aliases -%ALIAS $1 slsin - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type R - r slsin -1*l - -% Component type SS - [in] SS external,external - [mod] SS external,external - [out] SS external,external - [smod] SS external,external - - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_abg.fig @@ -1,38 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4747 5175 6097 5175 5872 5400 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7447 5175 8797 5175 8572 5400 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2677 5175 4027 5175 3802 5400 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6772 3375 6772 4725 6997 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 6750 6750 5400 6975 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 8550 6750 7200 6975 7425 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 1575 6750 2925 6975 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9472 5175 10822 5175 10597 5400 -4 1 0 100 0 18 20 0.0000 4 225 405 6750 3240 AE\001 -4 1 0 100 0 18 20 0.0000 4 225 405 6750 7110 AE\001 -4 1 4 100 0 18 20 0.0000 4 285 975 2115 5265 SS:[in]\001 -4 1 4 100 0 18 20 0.0000 4 285 1335 6795 1485 SS:[mod]\001 -4 1 4 100 0 18 20 0.0000 4 285 1500 6705 8820 SS:[smod]\001 -4 1 0 100 0 18 30 0.0000 4 330 660 6750 5265 R:r\001 -4 1 4 100 0 18 14 0.0000 4 210 270 5985 4995 [1]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 7560 4995 [2]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 6570 4590 [3]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 6570 5625 [4]\001 -4 1 0 100 0 18 20 0.0000 4 225 390 4365 5310 AF\001 -4 1 0 100 0 18 20 0.0000 4 225 390 9135 5265 AF\001 -4 1 4 100 0 18 20 0.0000 4 285 1170 11610 5265 SS:[out]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/AF3_lbl.txt @@ -1,40 +0,0 @@ -%% Label file for system AE3 (AE3_lbl.txt) -%SUMMARY AE3 -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS mod mod -%ALIAS out out -%ALIAS smod smod - -% Argument aliases -%ALIAS $1 l - -% CR aliases -%ALIAS $1 slsin - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type R - r slsin l - -% Component type SS - [in] SS external,external - [mod] SS external,external - [out] SS external,external - [smod] SS external,external DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_abg.fig @@ -1,53 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3600 4275 4950 4275 4725 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 5400 3600 5400 3825 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4950 5175 4950 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3015 3150 4365 3150 4140 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4815 3150 6165 3150 5940 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4590 2925 4590 1575 4815 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4815 1575 4365 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4793 2934 6153 1574 6153 1893 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4387 2947 3027 1587 3346 1587 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7650 3150 9000 3150 8775 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3600 4050 3600 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5400 5400 6750 5400 6525 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6750 5175 6750 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5400 4275 6750 4275 6525 4500 -4 2 0 100 0 18 18 0.0000 4 270 2130 3510 4365 Sf:zero_velocity\001 -4 1 1 101 0 3 18 0.0000 4 255 1125 5310 4725 y-velocity\001 -4 1 1 101 0 3 18 0.0000 4 255 1155 5265 3735 x-velocity\001 -4 1 1 101 0 3 18 0.0000 4 255 1905 5175 5940 angular-velocity\001 -4 2 0 100 0 18 18 0.0000 4 270 720 3555 5490 R:r_p\001 -4 1 0 100 0 18 18 0.0000 4 195 150 4590 3240 1\001 -4 1 4 100 0 18 18 0.0000 4 270 765 6390 1440 SS:[x]\001 -4 1 0 100 0 18 18 0.0000 4 270 870 4635 1440 IS:m_c\001 -4 1 0 100 0 18 18 0.0000 4 270 690 2880 1440 R:r_c\001 -4 1 4 100 0 18 18 0.0000 4 270 1290 2250 3240 SS:[drive]\001 -4 0 0 100 0 18 18 0.0000 4 210 1560 9090 3240 De:Position\001 -4 1 0 100 0 18 18 0.0000 4 210 1035 6975 3240 INTFS:x\001 -4 1 0 100 0 18 18 0.0000 4 195 150 5175 5490 1\001 -4 1 4 100 0 18 18 0.0000 4 270 780 7245 5490 SS:[a]\001 -4 1 0 100 0 18 18 0.0000 4 195 150 5175 4365 1\001 -4 1 4 100 0 18 18 0.0000 4 270 765 7245 4365 SS:[y]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Cart_lbl.txt @@ -1,53 +0,0 @@ -%% Label file for system Cart (Cart_lbl.txt) -%SUMMARY Cart -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in drive -%ALIAS pendulum|out x,y,a - -% Argument aliases -%ALIAS $1 m_c -%ALIAS $2 r_c -%ALIAS $3 r_p - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type IS - m_c lin flow,m_c;v_0 - -% Component type R - r_c lin flow,r_c - r_p lin flow,r_p - -% Component type INTFS - x none x_0 - -% Component type SS - [a] SS internal,0 - [drive] SS external,internal - [x] SS 0,internal - [y] SS 0,internal - -% Component type De - Position SS external - -% Component type Sf - zero_velocity SS 0 - - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_abg.fig @@ -1,68 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3330 1305 3870 1395 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3375 1350 3825 1350 --6 -6 7965 2475 8505 2565 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 8010 2520 8460 2520 --6 -6 3330 2475 3420 3015 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3375 2520 3375 2970 --6 -6 9810 2475 9900 3015 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 9855 2520 9855 2970 --6 -6 7965 2430 8055 2970 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 8010 2475 8010 2925 --6 -6 3735 2430 3825 2970 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3780 2475 3780 2925 --6 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 4860 4730 4860 494 2293 494 2293 4730 4860 4730 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2036 2724 3371 2724 3063 2947 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3576 2501 3576 1342 3833 1609 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3782 2724 5116 2724 4808 2947 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3576 2947 3576 4106 3833 3839 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6656 2724 7991 2724 7683 2947 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8196 2947 8196 4106 8453 3839 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8453 2724 9788 2724 9480 2947 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9480 4730 9480 494 6913 494 6913 4730 9480 4730 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 12150 5175 45 5175 45 316 12150 316 12150 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8190 2501 8190 1341 8447 1609 -4 2 4 0 0 0 18 0.0000 4 240 1605 1980 2790 SS:[Electrical]\001 -4 1 -1 0 0 0 18 0.0000 4 195 135 3525 2858 1\001 -4 1 -1 0 0 0 18 0.0000 4 255 945 5938 2813 GY:k_m\001 -4 1 -1 0 0 0 18 0.0000 4 195 135 8196 2813 1\001 -4 1 -1 0 0 0 18 0.0000 4 255 630 3525 1252 IS:l_a\001 -4 1 -1 0 0 0 18 0.0000 4 255 600 3628 4463 R:r_a\001 -4 1 -1 0 0 0 18 0.0000 4 255 735 8248 4463 R:b_m\001 -4 1 1 1 0 0 18 0.0000 4 195 1065 3576 5043 Electrical\001 -4 1 1 1 0 0 18 0.0000 4 195 1290 8196 5043 Mechanical\001 -4 1 1 1 0 0 18 0.0000 4 195 600 10404 3170 Shaft\001 -4 1 1 1 0 0 18 0.0000 4 195 1155 1472 3170 Terminals\001 -4 0 4 0 0 0 18 0.0000 4 240 1830 9945 2835 SS:[Mechanical]\001 -4 1 -1 0 0 0 18 0.0000 4 255 585 8235 1215 I:j_m\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DCS_lbl.txt @@ -1,39 +0,0 @@ -%SUMMARY DCS: DCS motor -%DESCRIPTION A special for the inverted pendulum system -%DESCRIPTION Derivative causality on the shaft -%DESCRIPTION No aliased parameters -%DESCRIPTION Built in causality - speeds things up -%DESCRIPTION Only the armature state and shaft resistance are variable - -%ALIAS in Electrical -%ALIAS out Mechanical - - -%% Label file for system DCS (DCS_lbl.txt) - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Motor gain -k_m lin flow,k_m - -% Electrical components -%Inductance -l_a lin flow,l_a;i_0 - -%Resistance -r_a lin flow,r_a - -% Mechanical components -%Inertia -j_m lin flow,j_m - -%Friction -b_m lin flow,b_m - -% Ports - [Electrical] SS external,external - [Mechanical] SS external,external DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_abg.fig @@ -1,35 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3555 4005 3645 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3600 4050 3600 4500 --6 -6 6255 4005 6345 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6300 4050 6300 4500 --6 -2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 - 7650 4725 5850 4725 5850 3825 7650 3825 7650 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 4275 3600 4275 3375 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 4275 6300 4275 6075 4500 -2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 - 5175 4725 3375 4725 3375 3825 5175 3825 5175 4725 -2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 - 2610 4725 585 4725 585 3825 2610 3825 2610 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7425 4275 8775 4275 8550 4500 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 10125 4950 10125 2025 225 2025 225 4950 10125 4950 -4 1 0 100 0 18 20 0.0000 4 360 1815 1620 4410 OpenLoop\001 -4 1 0 100 0 18 20 0.0000 4 285 960 4320 4410 Drive\001 -4 1 0 100 0 18 20 0.0000 4 285 765 6795 4410 Cart\001 -4 1 0 100 0 18 20 0.0000 4 285 810 9225 4410 Zero\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_input.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_input.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_input.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_input.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (DriveCart_input.txt) -# Generated by MTT at Thu Aug 5 09:17:30 BST 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -# Set the inputs -#mttu(1) = 1.0*(t<1) -1.0*((t>=1)&&(t<2)); # u (DriveCart_F) -mttu(1) = 1; -mttu(2) = 0; -mttu(3) = 0; -mttu(4) = 0; - -# Set the switches DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_lbl.txt @@ -1,30 +0,0 @@ -%% Label file for system DriveCart (DriveCart_lbl.txt) -%SUMMARY DriveCart -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%VAR l_p #Pendulum length - -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - - - - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_numpar.txt @@ -1,91 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (DriveCart_numpar.txt) -# Generated by MTT at Wed Aug 25 22:57:05 BST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -j_m = 3.87e-7; # Motor inertia -k_m = 0.00767; # Motor constant -r_a = 2.6; # Armature resistance -l_a = 0.18e-3; # Armature inductance - -k_g = 1/3.7; # Internal gear ratio -r = 0.635e-2; # Motor gear radius - -m_c = 0.455; # Cart mass - -b_m = 0.0; # Motor friction -r_c = 1.5; # Cart friction - -# l_p = 0.61; # Pendulum length -# m_p = 0.210; # Pendulum mass -# r_p = 0.0; # Pendulum friction - -# j_p = m_p*(l_p*l_p)/12; # Pendulum inertia about cm. - -# g = 9.81; # Gravity - - -## Sensitivity parameters -# m_cs = 0; # Cart mass -# b_ms = 0; # Motor friction -# r_cs = 0; # Cart friction -# r_ps = 0; # Pendulum friction - - -## Control parameters -k_1 = 1; -k_2 = 0; -k_3 = 0; - -## States -i_0 = 0; # Initial armature current -v_0 = 0; # Initial cart velocity -x_0 = 0; # Initial cart position - -# omega_0 = 0; # Initial pendulum velocity -# theta_0 = 0; # Initial pendulum angle - -## Control sensitivity parameters -# k_1s = 0; -# k_2s = 0; -# k_3s = 0; - -# ## Argument list -# if (mtt_n_parameters>1) -# r_cs= mtt_parameters(1); -# r_c = mtt_parameters(2); -# endif; - -# if (mtt_n_parameters>3) -# m_cs= mtt_parameters(3); -# m_c = mtt_parameters(4); -# endif; - -# if (mtt_n_parameters>5) -# k_1s= mtt_parameters(5); -# k_1 = mtt_parameters(6); -# endif; - -# if (mtt_n_parameters>7) -# k_2s= mtt_parameters(7); -# k_2 = mtt_parameters(8); -# endif; - -# if (mtt_n_parameters>9) -# k_3s= mtt_parameters(9); -# k_3 = mtt_parameters(10); -# endif; - - - - - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_rep.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_rep.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_rep.txt @@ -1,30 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system DriveCart (DriveCart_rep.txt) -## Generated by MTT on" Fri Oct 22 09:03:14 EST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:29:11 peterg -## To RCS -## -############################################################### - -mtt DriveCart abg tex # The system description -mtt DriveCart cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt DriveCart struc tex # The system structure -mtt DriveCart dae tex # The system dae -## mtt DriveCart ode tex # The system ode -## mtt DriveCart sspar tex # Steady-state parameters -## mtt DriveCart ss tex # Steady state -## mtt DriveCart dm tex # Descriptor matrices (of linearised system) -mtt DriveCart sm tex # State matrices (of linearised system) -## mtt DriveCart tf tex # Transfer function (of linearised system) -## mtt DriveCart lmfr ps # log modulus of frequency response (of linearised system) -mtt DriveCart simpar tex # Simulation parameters -mtt DriveCart numpar tex # Numerical simulation parameters -mtt DriveCart input tex # Simulation input -mtt DriveCart odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_simpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_simpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/DriveCart_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system DriveCart (DriveCart_simpar.txt) -# Generated by MTT on Thu Aug 5 09:17:05 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 10.0; # Last time in simulation -DT = 0.1; # Print interval -STEPFACTOR = 1000; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_abg.fig @@ -1,36 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 2475 3825 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 2700 3825 2700 3600 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5625 2700 6975 2700 6750 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 8325 2700 9675 2700 9450 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 10575 2700 11925 2700 11700 2925 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 14400 4725 14400 675 225 675 225 4725 14400 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6975 2475 6975 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 11925 2475 11925 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 9675 2475 9675 2925 -4 1 1 101 0 3 20 0.0000 4 255 1530 4590 3330 DC motor\001 -4 1 1 101 0 3 20 0.0000 4 330 2745 2205 3330 Power supply unit\001 -4 2 4 100 0 18 18 0.0000 4 270 1845 2430 2790 SS:[Electrical]\001 -4 1 0 100 0 18 18 0.0000 4 210 1470 4725 2790 DCS:motor\001 -4 1 0 100 0 18 18 0.0000 4 270 915 7695 2790 TF:k_g\001 -4 1 0 100 0 18 18 0.0000 4 210 540 10125 2790 TF:r\001 -4 0 4 100 0 18 18 0.0000 4 270 2115 12015 2790 SS:[Mechanical]\001 -4 1 1 101 0 3 20 0.0000 4 330 2010 7515 3330 Internal gear\001 -4 1 1 101 0 3 20 0.0000 4 330 1710 10080 3330 Motor gear\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Drive_lbl.txt @@ -1,34 +0,0 @@ -%% Label file for system Drive (Drive_lbl.txt) -%SUMMARY Drive -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Electrical -%ALIAS out Mechanical - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type DC - motor - -% Component type SS - [Electrical] SS external,external - [Mechanical] SS external,external - -% Component type TF - k_g lin flow,k_g - r lin flow,r - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_abg.fig @@ -1,27 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3376 3151 4276 3151 4051 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 2926 4501 2026 4726 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3151 5626 3151 5401 3376 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 10575 4950 45 4950 45 1350 10575 1350 10575 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1575 3150 2475 3150 2250 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6526 3150 7426 3150 7201 3375 -4 1 -1 0 0 0 20 0.0000 4 255 180 4501 3241 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 1110 4501 1891 CS:unit\001 -4 2 4 0 0 0 20 0.0000 4 315 1455 1530 3240 SS:[Flow]\001 -4 1 -1 0 0 0 20 0.0000 4 255 825 2925 3240 AF:af\001 -4 1 -1 0 0 0 20 0.0000 4 255 900 6075 3240 AE:ae\001 -4 0 4 0 0 0 20 0.0000 4 330 3045 7470 3240 SS:[Integrated_flow]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/INTFS_lbl.txt @@ -1,44 +0,0 @@ -%% Label file for system INTFS (INTFS_lbl.txt) -%SUMMARY INTFS: flow integrator -%DESCRIPTION Port [in]: Flow to be integrated -%DESCRIPTION Port [out]: Effort = integral of flow on port [in] - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/07/16 07:35:10 peterg -% %% Aliased version -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Flow -%ALIAS out Integrated_flow - -% Argument aliases -%ALIAS $1 x_0 - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - - -% Component type CS - unit lin effort,1;x_0 - -% Component type AE - ae lin 1 - -% Component type AF - af lin 1 - -% Component type SS - [Flow] SS external,external - [Integrated_flow] SS external,external DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2340 3915 2610 4185 -4 1 0 100 0 18 20 0.0000 4 270 195 2475 4185 0\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 3825 2475 2475 2700 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 5625 2475 4275 2700 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4050 4050 4050 3825 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 3825 4050 4275 -4 1 0 100 0 18 20 0.0000 4 285 315 2475 2295 I:i\001 -4 0 0 100 0 18 20 0.0000 4 360 1035 4185 4185 Sf:f_0\001 -4 1 4 100 0 18 20 0.0000 4 360 1185 2475 6030 SS:[in]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/IS_lbl.txt @@ -1,36 +0,0 @@ -%% Label file for system IS (IS_lbl.txt) -%SUMMARY IS I component with initial state - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in - -% Argument aliases -%ALIAS $1 flow,i -%ALIAS $2 f_0 - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type I - i lin flow,i - -% Component type SS - [in] SS external,external - -% Component type Sf - f_0 SS f_0 - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_abg.fig @@ -1,37 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3555 4005 3645 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3600 4050 3600 4500 --6 -6 6255 4005 6345 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6300 4050 6300 4500 --6 -2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 - 7650 4725 5850 4725 5850 3825 7650 3825 7650 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 4275 3600 4275 3375 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 4275 6300 4275 6075 4500 -2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 - 5175 4725 3375 4725 3375 3825 5175 3825 5175 4725 -2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 - 2610 4725 585 4725 585 3825 2610 3825 2610 4725 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 9675 4950 9675 2025 225 2025 225 4950 9675 4950 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 3825 7705 2870 7705 3189 -2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 5 - 6952 3487 8347 2092 8527 2272 7177 3622 6997 3442 -4 1 0 100 0 18 20 0.0000 4 360 1815 1620 4410 OpenLoop\001 -4 1 0 100 0 18 20 0.0000 4 285 960 4320 4410 Drive\001 -4 1 0 100 0 18 20 0.0000 4 285 3255 7830 2835 InvertedPendulum\001 -4 1 0 100 0 18 20 0.0000 4 285 765 6795 4410 Cart\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_desc.tex Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_desc.tex +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_desc.tex @@ -1,37 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system InvertedPendulumOnCart (InvertedPendulumOnCart_desc.tex) -% Generated by MTT on Thu Aug 5 10:38:16 BST 1999. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{InvertedPendulumOnCart} is - displayed in Figure \Ref{fig:InvertedPendulumOnCart_abg.ps} and its label - file is listed in Section \Ref{sec:InvertedPendulumOnCart_lbl}. - The subsystems are listed in Section \Ref{sec:InvertedPendulumOnCart_sub}. - -This is a one input, two output nonlinear system comprising an -inverted pendulum attached by a hinge to a cart constrained to move in -the horizontal direction. The input is the horizontal force acting on -the cart, and the two outputs are the horizontal position and the -pendulum angle respectively. - -The bond graph in Figure \Ref{InvertedPendulumOnCartPPP_abg} is augmented with the {\em -open-loop\/} controller comprising -\begin{itemize} -\item two effort source \textbf{Se} components ``u1'' and ``u2'' -\item two effort amplifier \textbf{AE} components ``ppp\_1'' and `ppp\_2'' -\end{itemize} - -This is a \emph{nonlinear} system and it is used to illustate -\emph{nonlinear} PPP control. Section -\Ref{sec:InvertedPendulumOnCartPPP_nppp.ps} shows the cart position -$x$ and the pendulum angle $\theta$ when the pendulum starts from the -initial condition of $\theta = \frac{\pi}{2}$ (ie the pendulum is -horizontal). - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_input.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_input.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_input.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_input.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (InvertedPendulumOnCartPPP_input.txt) -# Generated by MTT at Thu Aug 5 09:17:30 BST 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -# Set the inputs -#mttu(1) = 1.0*(t<1) -1.0*((t>=1)&&(t<2)); # u (InvertedPendulumOnCartPPP_F) -mttu(1) = 1; -mttu(2) = 0; -mttu(3) = 0; -mttu(4) = 0; - -# Set the switches DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_lbl.txt @@ -1,30 +0,0 @@ -%% Label file for system InvertedPendulumOnCartPPP (InvertedPendulumOnCartPPP_lbl.txt) -%SUMMARY InvertedPendulumOnCartPPP -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%VAR l_p #Pendulum length - -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - - - - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_nppp.m Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_nppp.m ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_nppp.m +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_nppp.m @@ -1,141 +0,0 @@ -## Figures.m -## Makes figures for the InvertedPendulumOnCart_PPP exasmple. -## $Log$ -## Revision 1.4 2000/08/17 12:34:58 peterg -## *** empty log message *** -## -## Revision 1.3 2000/08/11 16:01:27 peterg -## Fixed documentation error -## -## Revision 1.2 2000/05/21 06:39:40 peterg -## Parameterised _sm -## -## Revision 1.1 2000/05/20 11:30:41 peterg -## Initial revision -## -## Revision 1.2 2000/05/17 16:59:57 peterg -## Revised for Inverted pendulum - it works !!!! -## -## Revision 1.1 2000/05/17 14:07:53 peterg -## Initial revision -## -## Revision 1.1 2000/05/17 09:14:37 peterg -## Initial revision -## -system_name = "InvertedPendulumOnCartPPP"; - -## Uncomment the following the first time -## (Or do ./Make InvertedPendulumOnCartPPP in this directory) - -## MTT stuff for the system simulation -##system("Make InvertedPendulumOnCartPPP"); - -t_s=1.0*[0:0.1:10]; -u = [ones(4,length(t_s))]; -x_0 = InvertedPendulumOnCartPPP_state; -par = InvertedPendulumOnCartPPP_numpar; - -## Simulate the system -tick=time; -[y,x] = InvertedPendulumOnCartPPP_sim(x_0,u,t_s,par); -Elapsed = time-tick -plot(t_s,y, t_s,x); - -## Simulate the system to give just the final few points -t_s1 = 10*[9:0.1:10]; -tick=time; -[y,x] = InvertedPendulumOnCartPPP_sim(x_0,u,t_s1,par); -Elapsed = time-tick -plot(t_s1,y,t_s1,x); - -## Sensitivity system simulation parameters -x_0s = sInvertedPendulumOnCartPPP_state; -pars = sInvertedPendulumOnCartPPP_numpar; -sympars = sInvertedPendulumOnCartPPP_sympar; - -## Simulate the sensitivity system -sensitivities = [sympars.ppp_1s,sympars.ppp_2s,sympars.r_cs] -tick=time; -[y,ys] = sInvertedPendulumOnCartPPP_sim(x_0s,u,t_s,pars,sensitivities); -Elapsed = time-tick -plot(t_s,y,t_s,ys); - -### PPP parameters -A_w = [0;0]; -A_u = laguerre_matrix(4,20); # Specify basis functions: constant & - # exp(-5t) -tau = 0.5*[0.9:0.01:1]; # Optimisation interval -t_ol =0.5*[0:0.01:0.2]; # Open-loop interval -N = 20; # Number of open-loop intervals in simulation -w = [0;0]; # Setpoint - -## Linear system -## Linear system -[A,B,C,D] = InvertedPendulumOnCartPPP_sm(par); -Q = [1;1]; -ppp_lin_plot (A,B(:,1),C,D(:,1),A_u,A_w,tau,Q,w,x_0); -psfig("InvertedPendulumOnCartPPP_lin"); - -## Simulate non-linear PPP (on this nonlinear system) -extras.U_initial = "zero"; -extras.U_next = "continuation"; -extras.criterion = 1e-5; -extras.max_iterations = 10; -extras.v = 0; -extras.verbose = 0; - -# ## -- with no optimisation using linear PPP with continuation -# extras.U_initial = "linear"; -# extras.U_next = "continuation"; -# extras.criterion = 1e-5; -# extras.max_iterations = 0; -# [y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - -# ## -- with no optimisation using linear PPP at each step -# extras.U_initial = "linear"; -# extras.U_next = "linear"; -# extras.criterion = 1e-5; -# extras.max_iterations = 0; -# [y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - -## -- with optimisation using nonlinear PPP with continuation -extras.U_initial = "zero"; -extras.U_next = "continuation"; -extras.criterion = 1e-4; -extras.max_iterations = 100; -extras.v = 1e-3; -extras.verbose = 0; -[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - - -## Plots -title(""); - -## U, U_c and U_l -I = 1:N; -IU1 = [I' U(1,:)']; -IU1_c = [I' U_c(1,:)']; -IU1_l = [I' U_l(1,:)']; -gset grid; xlabel "Interval" -gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1" -psfig("InvertedPendulumOnCartPPP_U1"); - -IU2 = [I' U(2,:)']; -IU2_c = [I' U_c(2,:)']; -IU2_l = [I' U_l(2,:)']; -gset grid; xlabel "Interval " -gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2" -psfig("InvertedPendulumOnCartPPP_U2"); - -## y & u -gset grid; xlabel "Time (sec)" -tu = [t' u']; -gplot tu title "Output" -psfig("InvertedPendulumOnCartPPP_u"); - -gset grid; xlabel "Time (sec)" -ty_th = [t' y(1,:)'] ; -ty_x = [t' y(2,:)'] ; -gplot ty_th title "Theta",ty_x title "x" -psfig("InvertedPendulumOnCartPPP_nppp"); - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_numpar.txt @@ -1,68 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (sInvertedPendulumOnCart_numpar.txt) -# Generated by MTT at Tue Apr 18 18:07:52 BST 2000 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Default parameters -b_m = 0.0; # sDCS -c = 0.0; # sC,sC,sCS,sCS -e_0 = 0.0; # sCS,sCS -e_s = 0.0; # Se,Se,Se,sSe,sSe,sSe -f_0 = 0.0; # sIS,sIS,sIS -f_s = 0.0; # Sf,Sf,Sf,sSf,sSf,sSf -g = 0.0; # AFe,AFe,sInvertedPendulum,sROD -i = 0.0; # sI,sI,sI,sI,sI,sI,sIS,sIS,sIS -i_0 = 0.0; # sDCS -j_m = 0.0; # sDCS,sROD -j_p = 0.0; # sInvertedPendulum -ppp_1 = 1.0; # sOpenLoop -ppp_2 = 0.0; # sOpenLoop -ppp_3 = 0.0; # sOpenLoop -ppp_4 = 0.0; # sOpenLoop -k_g = 0.0; # sDrive -k_m = 0.0; # sDCS -l_a = 0.0; # sDCS,sROD -l_b = 0.0; # sROD -l_p = 0.0; # sInvertedPendulum,sInvertedPendulumOnCart -m = 0.0; # sROD -m_c = 0.0; # sCart -m_p = 0.0; # sInvertedPendulum -m_t = 0.0; # sInvertedPendulum -omega_0 = 0.0; # sInvertedPendulum,sROD -r = 0.0; # sDrive,sR,sR -r_a = 0.0; # sDCS -r_c = 0.0; # sCart -r_p = 0.0; # sCart -theta_0 = 0.0; # sInvertedPendulum,sROD -v_0 = 0.0; # sCart -x_0 = 0.0; # sCart,sINTFS,sINTFS - - -## Pysical Parameters -j_m = 3.87e-7; # Motor inertia -k_m = 0.00767; # Motor constant -r_a = 2.6; # Armature resistance -l_a = 0.18e-3; # Armature inductance - -k_g = 1/3.7; # Internal gear ratio -r = 0.635e-2; # Motor gear radius - -m_c = 0.455; # Cart mass - -b_m = 0.0; # Motor friction -r_c = 1.5; # Cart friction - -l_p = 0.61; # Pendulum length -m_p = 0.210; # Pendulum mass -r_p = 0.0; # Pendulum friction - -j_p = m_p*(l_p*l_p)/12; # Pendulum inertia about cm. - -g = 9.81; # Gravity - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_rep.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_rep.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_rep.txt @@ -1,41 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system InvertedPendulumOnCartPPP (InvertedPendulumOnCartPPP_rep.txt) -## Generated by MTT on" Fri Oct 22 09:03:14 EST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:29:10 peterg -## To RCS -## -## Revision 1.3 2000/08/29 13:57:23 peterg -## Zapped some steps which prevent ppp from working ???? -## -## Revision 1.2 2000/05/20 17:45:38 peterg -## Tidied -## -## Revision 1.1 2000/05/20 17:43:40 peterg -## Initial revision -## -############################################################### - -mtt InvertedPendulumOnCartPPP abg tex # The system description -mtt InvertedPendulumOnCartPPP cbg ps # The causal bond graph -mtt InvertedPendulumOnCartPPP struc tex # The system structure -mtt InvertedPendulumOnCartPPP dae tex # The system dae -# mtt InvertedPendulumOnCartPPP sm tex # State matrices (of linearised system) - -# mtt InvertedPendulumOnCartPPP simpar tex # Simulation parameters -# mtt InvertedPendulumOnCartPPP numpar tex # Numerical simulation parameters -# mtt InvertedPendulumOnCartPPP input tex # Simulation input -# mtt InvertedPendulumOnCartPPP odeso ps # Simulation output - -mtt InvertedPendulumOnCartPPP nppp m # How its done -mtt InvertedPendulumOnCartPPP nppp ps # The PPP output - -mtt InvertedPendulumOnCartPPP rep txt # The report outline - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_simpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_simpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system InvertedPendulumOnCartPPP (InvertedPendulumOnCartPPP_simpar.txt) -# Generated by MTT on Thu Aug 5 09:17:05 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 10.0; # Last time in simulation -DT = 0.1; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_state.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_state.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_state.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulumOnCartPPP_state.txt @@ -1,16 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Initial state file (InvertedPendulumOnCartPPP_state.txt) -# Generated by MTT at Thu May 4 16:13:13 BST 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -# Set the states -mttx(1) = 0.0; # i (InvertedPendulumOnCartPPP_mtt2_motor_l_a) -mttx(2) = 0.0; # i (InvertedPendulumOnCartPPP_mtt3_rod_J) -mttx(3) = -pi/2; # c (InvertedPendulumOnCartPPP_mtt3_rod_th_unit) -mttx(4) = 0.0; # i (InvertedPendulumOnCartPPP_mtt4_m_c) -mttx(5) = 0.0; # c (InvertedPendulumOnCartPPP_mtt4_x_unit) DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_abg.fig @@ -1,91 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3555 5085 6345 5310 -4 1 4 100 0 18 14 0.0000 4 210 510 3825 5265 [x_b]\001 -4 1 4 100 0 18 14 0.0000 4 210 525 4950 5265 [y_b]\001 -4 1 4 100 0 18 14 0.0000 4 210 525 6075 5265 [a_b]\001 --6 -6 3555 4545 6345 4770 -4 1 4 100 0 18 14 0.0000 4 210 495 3825 4725 [x_a]\001 -4 1 4 100 0 18 14 0.0000 4 210 510 4950 4725 [y_a]\001 -4 1 4 100 0 18 14 0.0000 4 210 510 6075 4725 [a_a]\001 --6 -6 5805 5355 6345 5445 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5850 5400 6300 5400 --6 -6 3600 4455 4140 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3645 4500 4095 4500 --6 -6 4635 4455 5175 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4680 4500 5130 4500 --6 -6 5805 4455 6345 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5850 4500 6300 4500 --6 -6 8505 4680 8595 5220 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 8550 4725 8550 5175 --6 -6 4770 2790 5040 3060 -4 1 0 100 0 18 20 0.0000 4 270 195 4905 3060 1\001 --6 -6 3690 2790 3960 3060 -4 1 0 100 0 18 20 0.0000 4 270 195 3825 3060 1\001 --6 -6 3555 2655 4095 2745 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3600 2700 4050 2700 --6 -6 4680 2655 5220 2745 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 2700 5175 2700 --6 -6 4950 2520 5355 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5008 2552 5327 2870 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6525 4950 8550 4950 8325 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 2700 4950 1350 5175 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 2700 3825 1350 4050 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5143 2687 6098 1732 6098 2050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3600 6750 4050 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4725 6750 5175 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 6750 3825 5400 4050 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 6750 4950 5400 5175 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 6750 6075 5400 6300 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 4500 6075 3150 6300 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 4500 4950 3150 5175 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 4500 3825 3150 4050 3375 -4 1 0 100 0 18 20 0.0000 4 285 1515 4964 5040 ROD:rod\001 -4 1 0 100 0 18 18 0.0000 4 270 885 6030 3015 Se:a_0\001 -4 1 4 100 0 18 20 0.0000 4 360 1050 3780 7155 SS:[x]\001 -4 1 4 100 0 18 20 0.0000 4 360 1080 4950 7155 SS:[y]\001 -4 1 4 100 0 18 20 0.0000 4 360 1065 6075 7155 SS:[a]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 6300 4995 [a]\001 -4 0 0 100 0 18 20 0.0000 4 285 1515 8685 5085 De:theta\001 -4 1 0 100 0 18 18 0.0000 4 270 675 4995 1170 I:m_y\001 -4 1 0 100 0 18 18 0.0000 4 270 675 3870 1170 I:m_x\001 -4 0 0 100 0 18 20 0.0000 4 360 1110 6120 1800 Se:mg\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/InvertedPendulum_lbl.txt @@ -1,47 +0,0 @@ -%% Label file for system InvertedPendulum (InvertedPendulum_lbl.txt) -%SUMMARY InvertedPendulum -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in x,y,a - - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - - -% Component type I - m_x lin flow,m_t - m_y lin flow,m_t - -% Component type Se - mg SS m_t*g - -% Component type De - theta SS external - -% Component type SS - [a] SS external,external - [x] SS external,external - [y] SS external,external - -% Component type Se - a_0 SS 0 - -% Component type gRod - rod none l_p;l_p;j_p;m_p;g;omega_0;theta_0 - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Make Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Make ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Make +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Make @@ -1,30 +0,0 @@ -#!/bin/sh - -## Makes the files needed for Figures.m -## Copyright (C) 2000 by Peter J. Gawthrop - -if [ -z "$1" ]; then - echo Usage ./Make system_name - exit -else - echo "Making simulation for system $1 (for use in Figures.m)" -fi - -## System -mtt -q -c -stdin $1 ode2odes out -mtt -q -c -stdin $1 sim m -mtt -q $1 state m -mtt -q $1 sympar m -mtt -q $1 numpar m - -## Sensitivity system -mtt -q -c -stdin -s s$1 ode2odes out -mtt -q -c -stdin -s s$1 sim m -mtt -q -s s$1 state m -mtt -q -s s$1 sympar m -mtt -q -s s$1 numpar m - -## Additional system reps for PPP -mtt -q $1 sm m -mtt -q $1 def m -mtt -q -s s$1 def m DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_abg.fig @@ -1,72 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 6570 1530 7200 1935 -4 1 1 101 0 3 20 0.0000 4 270 495 6885 1845 u ( )\001 -4 1 1 101 0 0 20 0.0000 4 135 150 6840 1800 *\001 -4 1 1 101 0 32 20 0.0000 4 150 135 7065 1845 t\001 --6 -6 1800 1530 2520 2025 -4 1 1 101 0 3 20 0.0000 4 270 555 2160 1845 U ( )\001 -4 1 1 101 0 3 16 0.0000 4 165 120 2070 2025 1\001 -4 1 1 101 0 0 20 0.0000 4 135 150 2115 1800 *\001 -4 1 1 101 0 32 20 0.0000 4 150 135 2340 1845 t\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6345 2250 7695 2250 7470 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 2250 5850 2250 5625 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1575 5400 2925 5400 2700 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4545 5400 5895 5400 5670 5625 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 5175 6075 4050 6300 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1575 3825 2925 3825 2700 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4545 3825 5895 3825 5670 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 3600 6075 2475 6300 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1575 6975 2925 6975 2700 7200 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4545 6975 5895 6975 5670 7200 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 6750 6075 5625 6300 5850 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1575 2250 2925 2250 2700 2475 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 9000 7875 9000 1125 225 1125 225 7875 9000 7875 -4 2 0 100 0 18 20 0.0000 4 300 1170 1485 2340 Se:Us_1\001 -4 1 0 100 0 18 20 0.0000 4 300 1035 3735 2340 AE:U_1\001 -4 1 0 100 0 18 20 0.0000 4 210 165 6075 2340 1\001 -4 1 0 100 0 18 20 0.0000 4 300 1035 3735 5490 AE:U_3\001 -4 2 0 100 0 18 20 0.0000 4 300 1170 1530 5535 Se:Us_3\001 -4 1 0 100 0 18 20 0.0000 4 210 165 6075 5535 1\001 -4 1 0 100 0 18 20 0.0000 4 300 1035 3735 3915 AE:U_2\001 -4 2 0 100 0 18 20 0.0000 4 300 1170 1530 3960 Se:Us_2\001 -4 1 0 100 0 18 20 0.0000 4 210 165 6075 3960 1\001 -4 1 0 100 0 18 20 0.0000 4 300 1035 3735 7065 AE:U_4\001 -4 2 0 100 0 18 20 0.0000 4 300 1170 1530 7110 Se:Us_4\001 -4 1 0 100 0 18 20 0.0000 4 210 165 6075 7110 1\001 -4 1 1 101 0 3 20 0.0000 4 270 555 2160 3420 U ( )\001 -4 1 1 101 0 3 16 0.0000 4 165 120 2070 3600 2\001 -4 1 1 101 0 0 20 0.0000 4 135 150 2115 3375 *\001 -4 1 1 101 0 32 20 0.0000 4 150 135 2340 3420 t\001 -4 1 1 101 0 3 20 0.0000 4 270 555 2160 4995 U ( )\001 -4 1 1 101 0 3 16 0.0000 4 165 120 2070 5175 3\001 -4 1 1 101 0 0 20 0.0000 4 135 150 2115 4950 *\001 -4 1 1 101 0 32 20 0.0000 4 150 135 2340 4995 t\001 -4 1 1 101 0 3 20 0.0000 4 270 555 2160 6570 U ( )\001 -4 1 1 101 0 3 16 0.0000 4 165 120 2070 6750 4\001 -4 1 1 101 0 0 20 0.0000 4 135 150 2115 6525 *\001 -4 1 1 101 0 32 20 0.0000 4 150 135 2340 6570 t\001 -4 0 4 100 0 18 20 0.0000 4 300 1005 7830 2340 SS:[us]\001 -4 1 1 101 0 3 20 0.0000 4 285 2370 3825 7695 Open-loop control\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/OpenLoop_lbl.txt @@ -1,40 +0,0 @@ -%% Label file for system OpenLoop (OpenLoop_lbl.txt) -%SUMMARY OpenLoop -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS out us - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AE - U_1 lin ppp_1 - U_2 lin ppp_2 - U_3 lin ppp_3 - U_4 lin ppp_4 - -% Component type SS - [us] SS external,external - -% Component type Se - Us_1 SS external - Us_2 SS external - Us_3 SS external - Us_4 SS external - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_abg.fig @@ -1,127 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4951 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8550 5400 9225 6075 8955 6075 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8685 5265 8415 5535 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 5175 2025 3825 2250 3825 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8550 4950 8550 5400 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 4950 2700 5400 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 6525 3150 7650 3150 7425 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5425 5419 4750 6094 4750 5869 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4273 3823 3148 2698 3373 2698 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 4950 4725 4275 4950 4275 -4 1 -1 0 0 0 20 0.0000 4 255 180 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 570 6933 5268 IS:J\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000 4 330 870 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000 4 330 900 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 1440 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000 4 255 1440 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000 4 255 1425 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000 4 255 1425 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000 4 255 180 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000 4 240 675 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000 4 255 1425 4681 5266 INTFS:th\001 -4 1 1 1 0 0 20 0.0000 4 255 270 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000 4 195 240 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000 4 255 240 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000 4 240 675 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 240 675 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000 4 240 675 3960 6210 [mod]\001 -4 1 4 0 0 0 20 0.0000 4 330 1785 2971 1216 SS:[xTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 330 1800 2971 9361 SS:[xTip_b]\001 -4 1 4 0 0 0 20 0.0000 4 330 1755 8372 1217 SS:[yTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 330 1770 8417 9362 SS:[yTip_b]\001 -4 1 4 0 0 0 20 0.0000 4 330 2700 5671 1216 SS:[angularTip_a]\001 -4 1 4 0 0 0 20 0.0000 4 330 2715 5671 9361 SS:[angularTip_b]\001 -4 1 1 1 0 0 20 0.0000 4 330 765 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000 4 255 1800 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000 4 330 780 1350 9855 Tip b\001 -4 1 -1 0 0 0 20 0.0000 4 330 930 9360 6345 Se:mg\001 -4 2 4 0 0 0 20 0.0000 4 330 1515 1935 3735 SS:[angle]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/ROD_lbl.txt @@ -1,101 +0,0 @@ -%SUMMARY ROD: rigid rod in two dimensions - with gravity and angle port -%DESCRIPTION See Section 10.2 of "Metamodelling" -%DESCRIPTION Gravity term added at centre - -%ALIAS $1 l_a # length from end a to mass centre -%ALIAS $2 l_b # length from end b to mass centre -%ALIAS $3 j_m # inertia about mass centre -%ALIAS $4 m # mass -%ALIAS $5 g # gravity - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS in|Tip_a xTip_a,angularTip_a,yTip_a -%ALIAS out|Tip_b xTip_b,angularTip_b,yTip_b - -%ALIAS x_a xTip_a # Force/velocity at tip a in x direction -%ALIAS y_a yTip_a # Force/velocity at tip a in y direction -%ALIAS alpha_a|a_a angularTip_a # Torque/angular velocity at tip a - -%ALIAS x_b xTip_b # Force/velocity at tip b in x direction -%ALIAS y_b yTip_b # Force/velocity at tip b in y direction -%ALIAS alpha_b|a_b angularTip_b # Torque/angular velocity at tip b - -%ALIAS angle|a angle # Angle port - -%ALIAS INTF General/INTF # The flow integration component. - -%% Label file for system ROD (ROD_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/10/22 02:01:45 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1999/08/05 08:04:40 peterg -% %% Initial revision -% %% -% %% Revision 1.3 1998/11/30 10:47:53 peterg -% %% Added extra a_a and a_b aliases -% %% -% %% Revision 1.2 1998/11/25 13:55:42 peterg -% %% Added missig attribute field m*g,internal -% %% -% %% Revision 1.1 1998/11/25 10:48:34 peterg -% %% Initial revision -% %% -% %% Revision 1.5 1998/07/27 12:27:27 peterg -% %% Added vector port aliases -% %% -% %% Revision 1.4 1998/07/27 10:51:20 peterg -% %% Aliased INTF as well. -% %% -% %% Revision 1.3 1998/07/27 10:49:10 peterg -% %% Major revision to include aliases etc -% %% -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,j_m;omega_0 -m_x lin flow,m -m_y lin flow,m - -%Integrate angular velocity to get angle -th none theta_0 - -%Modulated transformers -s1 lsin flow,l_a -s2 lsin flow,l_b -c1 lcos flow,l_a -c2 lcos flow,l_b - - -% Component type Se - mg SS m*g - -% Component type SS - [angularTip_a] SS external,external - [angularTip_b] SS external,external - [xTip_a] SS external,external - [xTip_b] SS external,external - [yTip_a] SS external,external - [yTip_b] SS external,external - [angle] SS external,external - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_abg.fig @@ -1,21 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 2700 4050 2700 3825 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 3375 4050 3375 3825 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4050 4050 4050 3825 4275 -4 1 4 100 0 18 18 0.0000 4 270 765 2160 2790 SS:[x]\001 -4 1 0 100 0 18 18 0.0000 4 210 570 4545 2790 Se:x\001 -4 1 4 100 0 18 18 0.0000 4 270 765 2160 3465 SS:[y]\001 -4 1 0 100 0 18 18 0.0000 4 270 570 4545 3465 Se:y\001 -4 1 4 100 0 18 18 0.0000 4 270 780 2160 4140 SS:[a]\001 -4 1 0 100 0 18 18 0.0000 4 210 525 4545 4140 Sf:a\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/Zero_lbl.txt @@ -1,33 +0,0 @@ -%% Label file for system Zero (Zero_lbl.txt) -%SUMMARY Zero -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in x,y,a - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - [a] SS external,external - [x] SS external,external - [y] SS external,external - -% Component type Se - x SS 0 - y SS 0 - -% Component type Sf - a SS external - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sCart_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sCart_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sCart_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sCart_lbl.txt @@ -1,59 +0,0 @@ -%% Label file for system sCart (sCart_lbl.txt) -%SUMMARY sCart -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in drive_1,drive_2 -%ALIAS pendulum|out x_1,x_2,y_1,y_2,a_1,a_2 - -% Argument aliases -%ALIAS $1 m_c -%ALIAS $2 r_c -%ALIAS $3 r_p - -%ALIAS $4 m_cs -%ALIAS $5 r_cs -%ALIAS $6 r_ps - -%ALIAS $7 v_0 -%ALIAS $8 v_0s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type I - m_c lin flow,m_c;v_0;m_cs;v_0s - -% Component type R - r_c lin flow,r_c;r_cs - r_p lin flow,r_p;r_ps - -% Component type sINTFS - x none x_0;x_0s - -% Component type SS - [a] SS external,external - [drive] SS external,external - [x] SS external,external - [y] SS external,external - -% Component type De - Position SS external;external - -% Component type Sf - zero_velocity SS 0;0 - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDCS_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDCS_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDCS_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDCS_lbl.txt @@ -1,39 +0,0 @@ -%SUMMARY sDCS: DC motor - sensitivity -%DESCRIPTION A special for the inverted pendulum system -%DESCRIPTION Derivative causality on the shaft -%DESCRIPTION No aliased parameters -%DESCRIPTION Built in causality - speeds things up -%DESCRIPTION Only the armature state and shaft resistance are variable - -%ALIAS in Electrical_1,Electrical_2 -%ALIAS out Mechanical_1,Mechanical_2 - - -%% Label file for system sDCS (sDCS_lbl.txt) - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Motor gain -k_m lin flow,k_m;0 - -% Electrical components -%Inductance -l_a lin flow,l_a;i_0;0;i_0s - -%Resistance -r_a lin flow,r_a;0 - -% Mechanical components -%Inertia -j_m lin flow,j_m;0 - -%Friction -b_m lin flow,b_m;b_ms - -% Ports - [Electrical] SS external,external - [Mechanical] SS external,external DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_identify.m Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_identify.m ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_identify.m +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_identify.m @@ -1,109 +0,0 @@ -function sDriveCart_identify () - - ## usage: sDriveCart_identify () - ## - ## - - ## Identify the Drive/cart friction - ## $Id$ - - system_name = "sDriveCart"; # Name of this system - input_name = sprintf("%s_input.dat", system_name); - ## disp("Create programs"); - ## system(sprintf("mtt -q -c -s -stdin %s ode2odes out", system_name)); # Create sim. code - ## system(sprintf("mtt -q -c -s -stdin %s numpar m", system_name)); # Create sim. code - ## system(sprintf("mtt -q -c -s -stdin %s def m", system_name)); # Create sim. code - - ## Optimisation parameters - crite = 1e-5; # Convergence criterion - alpha = 0.5; # Step reduction factor - max = 30; # Maximum iterations - View = 1 # View the optimisation process - - ## Parameters - global mtt_n_parameters - mtt_n_parameters = 0; - - eval(sprintf("%s_numpar;", system_name)); - - alpha = 0.75; - criterion = 1e-9; - max_iterations = 20; - - ## Real data - disp("Loading data"); - load -force data_020999.dat; - [N_data,M_data] = size(data_020999); - M = 10; - t = data_020999(1:M:N_data,1); - u = data_020999(1:M:N_data,2); - y = data_020999(1:M:N_data,3)/100; # convert from cm to m - - gset grid - gset title "" - gset xlabel "Time (sec)" - tu = [t u]; - ty = [t y]; - gplot tu title "input (V)", ty title "output (m)" - psfig("sDriveCart_yu"); - - - y_s = [u y]; # u is first o/p of system. - ## Start time at zero - t = t-t(1)*ones(size(t)); - - T_last = 40; - DT = t(2)-t(1); - - tu = [t u u u u]; # Put same signal on all inputs (only - # first used - save -ascii junk.dat tu - ## zap the octave comments - system(sprintf("grep -v \'#\' junk.dat > %s; rm -f junk.dat", input_name)); - - ## Set up theta - control = [1 0 0 0]; # Initial control parameters - unused = 0; # Unused parameter slot - r_c = 0; - parameters = [r_c m_c unused unused unused]; - i_r = 4+1; - i_m = 4+2; - state = [0 unused unused 0 0]; - i_v = 4+5+4; - i_x = 4+5+5; - i_i = 4+5+1; - theta_0 = [control parameters state]'; - - ## Weighting function - select output, not input - weight = ones(size(t))*[0 1]; - - ## Estimate r only - free = [i_r i_i i_v i_x]; - disp("Estimate cart friction ..."); - [theta,Theta,Error,Y] = mtt_optimise(system_name,y_s,theta_0,"time",\ - free,weight,crite,max,alpha,View); - - ## Plot results -# ix = [its Theta(i_x,:)']; -# iv = [its Theta(i_v,:)']; -# ii = [its Theta(i_i,:)']; - -# gplot \ -# ix with linespoints title "x_0",\ -# iv with linespoints title "p_0",\ -# ii with linespoints title "i_0" - -# psfig("sDriveCart_ident_x"); - - [N_th,M_th] = size(Theta); - its = [0:M_th-1]'; - gset grid - gset title "" - gset xlabel "Iterations" - ir = [its Theta(i_r,:)']; - gplot ir with linespoints title "r" - psfig("sDriveCart_ident_r"); - - r_c = theta(i_r) - -endfunction DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_numpar.txt @@ -1,200 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (sInvertedPendulumOnCart_numpar.txt) -# Generated by MTT at Wed Aug 25 22:57:05 BST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 1999/12/03 00:50:28 peterg -# %% Initial revision -# %% -# %% Revision 1.1 1999/11/12 06:47:50 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Same as sInvertedpendulumOnCart with pendulum stuff removed. - -# Parameters -j_m = 3.87e-7; # Motor inertia -k_m = 0.00767; # Motor constant -r_a = 2.6; # Armature resistance -l_a = 0.18e-3; # Armature inductance - -k_g = 1/3.7; # Internal gear ratio -r = 0.635e-2; # Motor gear radius - -m_c = 0.455; # Cart mass - -b_m = 0.0; # Motor friction -r_c = 5.0; # Cart friction - -# l_p = 0.61; # Pendulum length -# m_p = 0.210; # Pendulum mass -# r_p = 0.0; # Pendulum friction -# j_p = m_p*(l_p*l_p)/12; # Pendulum inertia about cm. - -# g = +9.81; # Gravity - -# m_t = 0.0; # Tip mass - -## Sensitivity parameters -m_cs = 0; # Cart mass -b_ms = 0; # Motor friction -r_cs = 0; # Cart friction - -# j_ps = 0; # Pendulum inertia -# m_ps = 0; # Pendulum mass -# r_ps = 0; # Pendulum friction - -# m_ts = 0; # Tip mass - -## Initial states -i_0 = 0; # Initial armature current -# omega_0 = 0; # Initial pendulum velocity -# theta_0 = 0; # Initial pendulum angle -v_0 = 0; # Initial cart velocity -x_0 = 0; # Initial cart position - -## Sensitivity parameters -i_0s = 0; # Initial armature current -# omega_0s = 0; # Initial pendulum velocity -# theta_0s = 0; # Initial pendulum angle -v_0s = 0; # Initial cart velocity -x_0s = 0; # Initial cart position - -## Control parameters -k_1 = 1; -k_2 = 0; -k_3 = 0; -k_4 = 0; - -## Control sensitivity parameters -k_1s = 0; -k_2s = 0; -k_3s = 0; -k_4s = 0; - - -## Which sensitivity function? NB all other sens. coeffs MUST be zero - -## see above -if (mtt_n_parameters>=1) - mtti = mtt_parameters(1); - - if mtti==1 - k_1s = 1; - endif - - if mtti==2 - k_2s = 1; - endif - - if mtti==3 - k_3s = 1; - endif - - if mtti==4 - k_4s = 1; - endif - - if mtti==5 - r_cs = 1; - endif - - if mtti==6 - m_cs = 1; - endif - -# if mtti==7 -# r_ps = 1; -# endif - -# if mtti==8 -# m_ts = 1; -# endif - -# if mtti==9 -# j_ps = 1; -# endif - - if mtti==10 - i_0s = 1; # Initial armature current - endif - -# if mtti==11 -# omega_0s = 1; # Initial pendulum velocity -# endif - -# if mtti==12 -# theta_0s = 1; # Initial pendulum position -# endif - - if mtti==13 - v_0s = 1; # Initial cart velocity - endif - - if mtti==14 - x_0s = 1; # Initial cart angle - endif - -endif; - -## Control parameters - -if (mtt_n_parameters>=2) - k_1 = mtt_parameters(2); -endif; - -if (mtt_n_parameters>=3) - k_2 = mtt_parameters(3); -endif; - -if (mtt_n_parameters>=4) - k_3 = mtt_parameters(4); -endif; - -if (mtt_n_parameters>=5) - k_4 = mtt_parameters(5); -endif; - -## Physical parameters -if (mtt_n_parameters>=6) - r_c = mtt_parameters(6); -endif; - -if (mtt_n_parameters>=7) - m_c = mtt_parameters(7); -endif; - -# if (mtt_n_parameters>=8) -# r_p = mtt_parameters(8); -# endif; - -# if (mtt_n_parameters>=9) -# m_t = mtt_parameters(9); -# endif; - -# if (mtt_n_parameters>=10) -# j_p = mtt_parameters(10); -# endif; - -## Initial condition parameters - states are read in -if (mtt_n_parameters>=15) # - i_0 = mtt_parameters(11); # Initial armature current -# omega_0 = mtt_parameters(12); # Initial cart velocity -# theta_0 = mtt_parameters(13); # Initial cart position - v_0 = mtt_parameters(14); # Initial pendulum velocity - x_0 = mtt_parameters(15); # Initial pendulum angle -endif; - -## Simulation stuff - -if (mtt_n_parameters>=16) - LAST = mtt_parameters(16); -endif; -if (mtt_n_parameters>=17) - DT = mtt_parameters(17); -endif; - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_simpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_simpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDriveCart_simpar.txt @@ -1,19 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system sDriveCart (sDriveCart_simpar.txt) -# Generated by MTT on Fri Dec 3 10:30:48 EST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 40.0; # Last time in simulation -DT = 0.1; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDrive_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDrive_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDrive_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sDrive_lbl.txt @@ -1,36 +0,0 @@ -%% Label file for system sDrive (sDrive_lbl.txt) -%SUMMARY sDrive -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Electrical_1,Electrical_2 -%ALIAS out Mechanical_1,Mechanical_2 - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type sDCS - motor - -% Component type SS - [Electrical] SS external,external - [Mechanical] SS external,external - -% Component type sTF - k_g lin flow,k_g;0 - r lin flow,r;0 - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_abg.fig @@ -1,103 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2205 3555 2295 4095 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2250 3600 2250 4050 --6 -6 2205 3555 2295 4095 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2250 3600 2250 4050 --6 -6 2205 7155 2295 7695 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2250 7200 2250 7650 --6 -6 3510 4005 4050 4095 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4005 4050 3555 4050 --6 -6 3645 5850 4185 5940 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4140 5895 3690 5895 --6 -6 8730 5355 9270 5445 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 9225 5400 8775 5400 --6 -6 3600 7155 4140 7245 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4095 7200 3645 7200 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 7425 3600 7425 3375 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 7425 5400 7425 5175 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7425 7425 8775 7425 8550 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9225 7425 10575 7425 10350 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 3825 3600 3825 3375 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 3825 5400 3825 5175 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7425 3825 8775 3825 8550 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9225 3825 10575 3825 10350 4050 -2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 5895 9000 7200 9000 6975 -2 1 0 2 -1 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9006 5873 3831 7178 3831 6953 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 450 6300 1800 6525 1575 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 2250 6300 3600 6525 3375 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6075 1800 6525 1800 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 - 6075 2025 4275 2025 4275 5400 4500 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 4050 3825 5400 4050 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 9000 4050 9000 5400 9225 5175 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6525 2250 6525 7200 6750 6975 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 - 6525 2025 8550 2025 8550 5400 8775 5175 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 - 6525 8550 9225 8550 9225 5850 9450 6075 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 4 - 6075 8550 3600 8550 3600 5850 3375 6075 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 10125 6300 8775 6525 9000 -2 1 0 2 5 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6075 8775 6525 8775 -4 1 4 100 0 18 20 0.0000 4 285 2415 6210 360 SS:[Actual_mod]\001 -4 1 5 100 0 18 20 0.0000 4 210 165 6300 2115 0\001 -4 1 4 100 0 18 20 0.0000 4 285 1845 1215 7515 SS:[Sens_in]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 3825 7515 1\001 -4 1 0 100 0 18 20 0.0000 4 225 1590 6435 7515 EMTF:sens\001 -4 1 0 100 0 18 20 0.0000 4 210 165 9000 7515 0\001 -4 1 4 100 0 18 20 0.0000 4 285 2040 11790 7515 SS:[Sens_out]\001 -4 1 4 100 0 18 20 0.0000 4 285 2055 1215 3915 SS:[Actual_in]\001 -4 1 0 100 0 18 20 0.0000 4 210 165 3825 3915 1\001 -4 1 0 100 0 18 20 0.0000 4 225 1785 6435 3915 EMTF:actual\001 -4 1 0 100 0 18 20 0.0000 4 210 165 9000 3915 0\001 -4 1 4 100 0 18 20 0.0000 4 285 2250 11790 3915 SS:[Actual_out]\001 -4 1 0 100 0 18 20 0.0000 4 225 1170 8955 5715 AE3:ae3\001 -4 1 0 100 0 18 20 0.0000 4 225 1095 3825 5715 AF3:af3\001 -4 2 4 100 0 18 14 0.0000 4 210 600 6255 3600 [mod]\001 -4 2 4 100 0 18 14 0.0000 4 210 600 6435 7155 [mod]\001 -4 1 4 100 0 18 20 0.0000 4 285 2205 6300 10395 SS:[Sens_mod]\001 -4 1 5 100 0 18 20 0.0000 4 210 165 6345 8640 0\001 -4 2 4 100 0 18 14 0.0000 4 210 720 3420 5985 [smod]\001 -4 0 4 100 0 18 14 0.0000 4 210 720 9540 5940 [smod]\001 -4 2 4 100 0 18 14 0.0000 4 210 600 8505 5355 [mod]\001 -4 0 4 100 0 18 14 0.0000 4 210 600 4455 5400 [mod]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sEMTF_lbl.txt @@ -1,52 +0,0 @@ -%% Label file for system sEMTF (sEMTF_lbl.txt) -%SUMMARY sEMTF Effort modulated TF - sensitivity version -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Actual_in,Sens_in -%ALIAS out Actual_out,Sens_out -%ALIAS mod Actual_mod,Sens_mod - - -% Argument aliases -%ALIAS $1 l - -% CR aliases -%ALIAS $1 lsin -%ALIAS $2 slsin - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type EMTF - actual lsin flow,l - sens lsin flow,l - -% Component type AE3 (????NB NEGATIVE GAIN HERE!!!!) - ae3 slsin l - -% Component type AF3 - af3 slsin l - -% Component type SS - [Actual_in] SS external,external - [Actual_out] SS external,external - [Actual_mod] SS external,internal - [Sens_in] SS external,external - [Sens_out] SS external,external - [Sens_mod] SS external,internal - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_abg.fig @@ -1,30 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3376 3151 4276 3151 4051 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 2926 4501 2026 4726 2251 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3151 5626 3151 5401 3376 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 10575 4950 45 4950 45 1350 10575 1350 10575 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1575 3150 2475 3150 2250 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6526 3150 7426 3150 7201 3375 -4 1 6 0 0 0 20 0.0000 4 256 181 4502 3242 [1,2]\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 4502 3241 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 1110 4501 1891 sCS:unit\001 -4 2 6 0 0 0 20 0.0000 4 316 1456 1531 3241 [1,2]\001 -4 2 4 0 0 0 20 0.0000 4 315 1455 1531 3240 SS:[Flow]\001 -4 1 -1 0 0 0 20 0.0000 4 255 825 2925 3240 sAF:af\001 -4 1 -1 0 0 0 20 0.0000 4 255 900 6075 3240 sAE:ae\001 -4 0 6 0 0 0 20 0.0000 4 331 3046 7471 3241 [1,2]\001 -4 0 4 0 0 0 20 0.0000 4 330 3045 7471 3240 SS:[Integrated_flow]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sINTFS_lbl.txt @@ -1,45 +0,0 @@ -%% Label file for system sINTFS (sINTFS_lbl.txt) -%SUMMARY sINTFS: flow integrator -%DESCRIPTION Port [in]: Flow to be integrated -%DESCRIPTION Port [out]: Effort = integral of flow on port [in] - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/07/16 07:35:10 peterg -% %% Aliased version -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Flow_1,Flow_2 -%ALIAS out Integrated_flow_1,Integrated_flow_2 - -% Argument aliases -%ALIAS $1 x_0 -%ALIAS $2 x_0s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% CS - unit SS effort,1;x_0;0;x_0s - -% Component type AE - ae lin 1;0 - -% Component type AF - af lin 1;0 - - -% Component type SS - [Flow] SS external,external - [Integrated_flow] SS external,external DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2340 3915 2610 4185 -4 1 6 100 0 18 20 0.0000 4 271 196 2476 4186 [1,2]\001 -4 1 0 100 0 18 20 0.0000 4 270 195 2476 4185 0\001 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 3825 2475 2475 2700 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 5625 2475 4275 2700 4500 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 4050 4050 4050 3825 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 3825 4050 4275 -4 1 0 100 0 18 20 0.0000 4 285 315 2475 2295 sI:i\001 -4 0 0 100 0 18 20 0.0000 4 360 1035 4185 4185 sSf:f_0\001 -4 1 6 100 0 18 20 0.0000 4 361 1186 2476 6031 [1,2]\001 -4 1 4 100 0 18 20 0.0000 4 360 1185 2476 6030 SS:[in]\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sIS_lbl.txt @@ -1,37 +0,0 @@ -%% Label file for system sIS (sIS_lbl.txt) -%SUMMARY sIS -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Port aliases -%ALIAS in in_1,in_2 - -% Argument aliases -%ALIAS $1 flow,i -%ALIAS $2 f_0 -%ALIAS $3 i_s -%ALIAS $4 f_0s - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [in] SS external,external - -% Component type sI - i lin flow,i;i_s - -% Component type sSf - f_0 SS f_0;f_0s DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_numpar.txt @@ -1,92 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (sInvertedPendulumOnCart_numpar.txt) -# Generated by MTT at Tue Apr 18 18:07:52 BST 2000 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Default parameters -b_m = 0.0; # sDCS -b_ms = 0.0; # sDCS -c = 0.0; # sC,sC,sCS,sCS -c_s = 0.0; # sCS,sCS -e_0 = 0.0; # sCS,sCS -e_0s = 0.0; # sCS,sCS -e_s = 0.0; # Se,Se,Se,sSe,sSe,sSe -f_0 = 0.0; # sIS,sIS,sIS -f_0s = 0.0; # sIS,sIS,sIS -f_s = 0.0; # Sf,Sf,Sf,sSf,sSf,sSf -g = 0.0; # AFe,AFe,sInvertedPendulum,sROD -i = 0.0; # sI,sI,sI,sI,sI,sI,sIS,sIS,sIS -i_0 = 0.0; # sDCS -i_0s = 0.0; # sDCS -i_s = 0.0; # sIS,sIS,sIS -j_m = 0.0; # sDCS,sROD -j_p = 0.0; # sInvertedPendulum -j_ps = 0.0; # sInvertedPendulum -j_s = 0.0; # sROD -k = 0.0; # sAE,sAE,sAE,sAF,sAF,sGY,sTF -ppp_1 = 1.0; # sOpenLoop -ppp_1s = 0.0; # sOpenLoop -ppp_2 = 0.0; # sOpenLoop -ppp_2s = 0.0; # sOpenLoop -ppp_3 = 0.0; # sOpenLoop -ppp_3s = 0.0; # sOpenLoop -ppp_4 = 0.0; # sOpenLoop -ppp_4s = 0.0; # sOpenLoop -k_g = 0.0; # sDrive -k_m = 0.0; # sDCS -k_s = 0.0; # sAE,sAE,sAE,sAF,sAF,sC,sC,sGY,sI,sI,sI,sI,sI,sI,sR,sR,sSe,sSe,sSe,sSf,sSf,sSf,sTF -l = 0.0; # AE3,AF3,sEMTF -l_a = 0.0; # sDCS,sROD -l_b = 0.0; # sROD -l_p = 0.0; # sInvertedPendulum,sInvertedPendulumOnCart -m = 0.0; # sROD -m_c = 0.0; # sCart -m_cs = 0.0; # sCart -m_p = 0.0; # sInvertedPendulum -m_ps = 0.0; # sInvertedPendulum -m_s = 0.0; # sROD -m_t = 0.0; # sInvertedPendulum -m_ts = 0.0; # sInvertedPendulum -omega_0 = 0.0; # sInvertedPendulum,sROD -omega_0s = 0.0; # sInvertedPendulum,sROD -r = 0.0; # sDrive,sR,sR -r_a = 0.0; # sDCS -r_c = 0.0; # sCart -r_cs = 0.0; # sCart -r_p = 0.0; # sCart -r_ps = 0.0; # sCart -theta_0 = 0.0; # sInvertedPendulum,sROD -theta_0s = 0.0; # sInvertedPendulum,sROD -v_0 = 0.0; # sCart -v_0s = 0.0; # sCart -x_0 = 0.0; # sCart,sINTFS,sINTFS -x_0s = 0.0; # sCart,sINTFS,sINTFS - - -## Pysical Parameters -j_m = 3.87e-7; # Motor inertia -k_m = 0.00767; # Motor constant -r_a = 2.6; # Armature resistance -l_a = 0.18e-3; # Armature inductance - -k_g = 1/3.7; # Internal gear ratio -r = 0.635e-2; # Motor gear radius - -m_c = 0.455; # Cart mass - -b_m = 0.0; # Motor friction -r_c = 1.5; # Cart friction - -l_p = 0.61; # Pendulum length -m_p = 0.210; # Pendulum mass -r_p = 0.0; # Pendulum friction - -j_p = m_p*(l_p*l_p)/12; # Pendulum inertia about cm. - -g = 9.81; # Gravity DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_state.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_state.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_state.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCartPPP_state.txt @@ -1,21 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Initial state file (sInvertedPendulumOnCartPPP_state.txt) -# Generated by MTT at Thu May 4 14:57:10 BST 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -# Set the states -mttx(1) = 0.0; # i_1 (sInvertedPendulumOnCartPPP_mtt2_motor_l_a_i) -mttx(2) = 0.0; # i_2 (sInvertedPendulumOnCartPPP_mtt2_motor_l_a_i) -mttx(3) = 0.0; # i_1 (sInvertedPendulumOnCartPPP_mtt3_rod_J_i) -mttx(4) = 0.0; # i_2 (sInvertedPendulumOnCartPPP_mtt3_rod_J_i) -mttx(5) = pi/2; # c_1 (sInvertedPendulumOnCartPPP_mtt3_rod_th_unit_c) -mttx(6) = 0.0; # c_2 (sInvertedPendulumOnCartPPP_mtt3_rod_th_unit_c) -mttx(7) = 0.0; # i_1 (sInvertedPendulumOnCartPPP_mtt4_m_c_i) -mttx(8) = 0.0; # i_2 (sInvertedPendulumOnCartPPP_mtt4_m_c_i) -mttx(9) = 0.0; # c_1 (sInvertedPendulumOnCartPPP_mtt4_x_unit_c) -mttx(10) = 0.0; # c_2 (sInvertedPendulumOnCartPPP_mtt4_x_unit_c) DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_input.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_input.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_input.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_input.txt @@ -1,37 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (sInvertedPendulumOnCart_input.txt) -# Generated by MTT at Thu Aug 5 09:17:30 BST 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -# Set the inputs -# mttu(1) = 1.0*(t<1) -1.0*((t>=1)&&(t<2)); # u (sInvertedPendulumOnCart_F) - - ## Doing control -# if (mtt_n_parameters>=1) -# if (mtt_parameters(1)<5) - mttu(1) = exp(-0.0*t); - mttu(2) = exp(-2.0*t); - mttu(3) = exp(-5.0*t); - mttu(4) = exp(-10.0*t); - -# mttu(1) = 1; -# mttu(2) = exp(-0.5*t);; -# mttu(3) = exp(-t); -# mttu(4) = exp(-2*t); - -# mttu(1) = (t<0.1); -# mttu(2) = ((t>=0.1)&&(t<0.2)); -# mttu(3) = ((t>=0.2)&&(t<0.3)); -# mttu(4) = ((t>=0.3)&&(t<0.4)); -# else -# ## Identification -# mttu(1) = (-1*((t>=3.37966)&&(t<= 5.36946)) + ((t>=10.36896)&&(t<=12.36876))); -# endif -# endif - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_lbl.txt @@ -1,26 +0,0 @@ -%% Label file for system sInvertedPendulumOnCart (sInvertedPendulumOnCart_lbl.txt) -%SUMMARY sInvertedPendulumOnCart -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%VAR l_p #Pendulum length - -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_rep.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_rep.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_rep.txt @@ -1,32 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system sInvertedPendulumOnCart (sInvertedPendulumOnCart_rep.txt) -## Generated by MTT on" Fri Oct 22 09:03:14 EST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:29:10 peterg -## To RCS -## -############################################################### - -mtt sInvertedPendulumOnCart abg tex # The system description -mtt sInvertedPendulumOnCart cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt sInvertedPendulumOnCart struc tex # The system structure -mtt sInvertedPendulumOnCart dae tex # The system dae -## mtt sInvertedPendulumOnCart ode tex # The system ode -## mtt sInvertedPendulumOnCart sspar tex # Steady-state parameters -## mtt sInvertedPendulumOnCart ss tex # Steady state -## mtt sInvertedPendulumOnCart dm tex # Descriptor matrices (of linearised system) -mtt sInvertedPendulumOnCart sm tex # State matrices (of linearised system) -## mtt sInvertedPendulumOnCart tf tex # Transfer function (of linearised system) -## mtt sInvertedPendulumOnCart lmfr ps # log modulus of frequency response (of linearised system) -mtt sInvertedPendulumOnCart simpar tex # Simulation parameters -mtt sInvertedPendulumOnCart numpar tex # Numerical simulation parameters -mtt sInvertedPendulumOnCart input tex # Simulation input -mtt -cse sInvertedPendulumOnCart odeso ps # Simulation output - -mtt sInvertedPendulumOnCart ppp ps # PPP control DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_simpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_simpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulumOnCart_simpar.txt @@ -1,20 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system sInvertedPendulumOnCart (sInvertedPendulumOnCart_simpar.txt) -# Generated by MTT on Thu Aug 5 09:17:05 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 1.0; # Last time in simulation -DT = 0.05; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulum_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulum_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulum_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sInvertedPendulum_lbl.txt @@ -1,48 +0,0 @@ -%% Label file for system sInvertedPendulum (sInvertedPendulum_lbl.txt) -%SUMMARY sInvertedPendulum -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in x_1,x_2,y_1,y_2,a_1,a_2 - - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type I - m_x lin flow,m_t;m_ts - m_y lin flow,m_t;m_ts - -% Component type Se - mg SS m_t*g;0 - -% Component type De - theta SS external;external - - - -% Component type SS - [a] SS external,external - [x] SS external,external - [y] SS external,external - -% Component type Se - a_0 SS 0;0 - -% Component type ROD - rod none l_p;l_p;j_p;m_p;g;omega_0;theta_0;j_ps;m_ps;omega_0s;theta_0s - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sOpenLoop_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sOpenLoop_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sOpenLoop_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sOpenLoop_lbl.txt @@ -1,54 +0,0 @@ -%% Label file for system sOpenLoop (sOpenLoop_lbl.txt) -%SUMMARY sOpenLoop -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS out us_1,us_2 - -% Argument aliases -%ALIAS $1 U_1 -%ALIAS $2 U_1s -%ALIAS $3 U_2 -%ALIAS $4 U_2s -%ALIAS $5 U_3 -%ALIAS $6 U_3s -%ALIAS $7 U_4 -%ALIAS $8 U_4s -%ALIAS $9 us -%ALIAS $10 uss -%ALIAS $11 Us_1 -%ALIAS $12 Us_1s -%ALIAS $13 Us_2 -%ALIAS $14 Us_2s -%ALIAS $15 Us_3 -%ALIAS $16 Us_3s -%ALIAS $17 Us_4 -%ALIAS $18 Us_4s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - [us] SS external,external - -% Component type AE - U_1 lin ppp_1;ppp_1s - U_2 lin ppp_2;ppp_2s - U_3 lin ppp_3;ppp_3s - U_4 lin ppp_4;ppp_4s - -% Component type Se - Us_1 SS external;0 - Us_2 SS external;0 - Us_3 SS external;0 - Us_4 SS external;0 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sROD_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sROD_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sROD_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sROD_lbl.txt @@ -1,106 +0,0 @@ -%SUMMARY sROD: rigid rod in two dimensions - with gravity and angle port -%DESCRIPTION See Section 10.2 of "Metamodelling" -%DESCRIPTION Gravity term added at centre - -%ALIAS $1 l_a # length from end a to mass centre -%ALIAS $2 l_b # length from end b to mass centre -%ALIAS $3 j_m # inertia about mass centre -%ALIAS $4 m # mass -%ALIAS $5 g # gravity - -%ALIAS $6 omega_0 # Initial angular velocity -%ALIAS $7 theta_0 # Initial angular velocity - -## Sensitivities -%ALIAS $8 j_s -%ALIAS $9 m_s - -%ALIAS $10 omega_0s # Initial angular velocity -%ALIAS $11 theta_0s # Initial angular velocity - - -%ALIAS in|Tip_a xTip_a_1,xTip_a_2,angularTip_a_1,angularTip_a_2,yTip_a_1,yTip_a_2 -%ALIAS out|Tip_b xTip_b_1,xTip_b_2,angularTip_b_1,angularTip_b_2,yTip_b_1,yTip_b_2 - -%ALIAS x_a xTip_a_1,xTip_a_2 # Force/velocity at tip a in x direction -%ALIAS y_a yTip_a_1,yTip_a_2 # Force/velocity at tip a in y direction -%ALIAS alpha_a|a_a angularTip_a_1,angularTip_a_2 # Torque/angular velocity at tip a - -%ALIAS x_b xTip_b_1,xTip_b_2 # Force/velocity at tip b in x direction -%ALIAS y_b yTip_b_1,yTip_b_2 # Force/velocity at tip b in y direction -%ALIAS alpha_b|a_b angularTip_b_1,angularTip_b_2 # Torque/angular velocity at tip b - -%ALIAS angle|a angle_1,angle_2 # Angle port - -%ALIAS INTF General/INTF # The flow integration component. - -%% Label file for system sROD (sROD_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/10/22 02:01:45 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1999/08/05 08:04:40 peterg -% %% Initial revision -% %% -% %% Revision 1.3 1998/11/30 10:47:53 peterg -% %% Added extra a_a and a_b aliases -% %% -% %% Revision 1.2 1998/11/25 13:55:42 peterg -% %% Added missig attribute field m*g,internal -% %% -% %% Revision 1.1 1998/11/25 10:48:34 peterg -% %% Initial revision -% %% -% %% Revision 1.5 1998/07/27 12:27:27 peterg -% %% Added vector port aliases -% %% -% %% Revision 1.4 1998/07/27 10:51:20 peterg -% %% Aliased INTF as well. -% %% -% %% Revision 1.3 1998/07/27 10:49:10 peterg -% %% Major revision to include aliases etc -% %% -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,j_m;omega_0;j_s;omega_0s -m_x lin flow,m;m_s -m_y lin flow,m;m_s - -%Integrate angular velocity to get angle -th none theta_0;theta_0s - -%Modulated transformers -s1 lsin;slsin l_a -s2 lsin;slsin l_b -c1 lcos;slcos l_a -c2 lcos;slcos l_b - - -% Component type Se - mg SS m*g;0 - -% Component type SS - [angularTip_a] SS external,external - [angularTip_b] SS external,external - [xTip_a] SS external,external - [xTip_b] SS external,external - [yTip_a] SS external,external - [yTip_b] SS external,external - [angle] SS external,external DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sZero_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sZero_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sZero_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/InvertedPendulumOnCartPPP/sZero_lbl.txt @@ -1,32 +0,0 @@ -%% Label file for system sZero (sZero_lbl.txt) -%SUMMARY sZero -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in x_1,x_2,y_1,y_2,a_1,a_2 - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - [a] SS external,external - [x] SS external,external - [y] SS external,external - -% Component type Se - x SS 0;0 - y SS 0;0 - -% Component type Sf - a SS 0;0 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_abg.fig @@ -1,183 +0,0 @@ -#FIG 3.2 -Portrait -Center -Inches -A4 -100.00 -Single --2 -1200 2 -6 8550 825 13500 3375 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12595 1725 11695 1725 11845 1875 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12595 1350 11695 1350 11845 1500 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12595 975 11695 975 11845 1125 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12595 2100 11695 2100 11845 2250 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12595 2475 11695 2475 11845 2625 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12595 2850 11695 2850 11845 3000 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12595 3225 11695 3225 11845 3375 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 10200 2100 9300 2100 9450 2250 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 10200 975 8700 975 8700 1875 8550 1725 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 10200 1275 9000 1275 9000 1875 8850 1725 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 10200 1725 9300 1725 9300 1875 9150 1725 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 10200 3225 8700 3225 8700 2325 8550 2475 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 10200 2925 9000 2925 9000 2325 8850 2475 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 10200 2475 9300 2475 9300 2325 9150 2475 -4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 2175 AE:ppp_4\001 -4 1 -1 0 0 0 20 0.0000 4 285 810 13050 1800 Se:u_3\001 -4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 1800 AE:ppp_3\001 -4 1 -1 0 0 0 20 0.0000 4 285 810 13050 1425 Se:u_2\001 -4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 1425 AE:ppp_2\001 -4 1 -1 0 0 0 20 0.0000 4 285 810 13050 1050 Se:u_1\001 -4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 1050 AE:ppp_1\001 -4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 2550 AE:ppp_5\001 -4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 2925 AE:ppp_6\001 -4 1 -1 0 0 0 20 0.0000 4 285 1230 10950 3300 AE:ppp_7\001 -4 1 -1 0 0 0 20 0.0000 4 285 810 13050 2550 Se:u_5\001 -4 1 -1 0 0 0 20 0.0000 4 285 810 13050 2925 Se:u_6\001 -4 1 -1 0 0 0 20 0.0000 4 285 810 13050 3300 Se:u_7\001 -4 1 -1 0 0 0 20 0.0000 4 285 810 13050 2175 Se:u_4\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 9000 2175 1\001 --6 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2706 7206 3606 7206 3456 7356 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2406 7506 2406 8406 2556 8256 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3906 7506 3906 8406 4056 8256 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7208 7208 8108 7208 7958 7358 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8708 7208 9608 7208 9458 7358 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8408 7508 8408 8408 8558 8258 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7208 6908 8108 6008 8108 6233 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8708 6008 9608 6908 9383 6908 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9909 7509 9909 8409 10059 8259 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6908 7508 6908 8408 7058 8258 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11407 7507 11407 8407 11557 8257 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11406 5706 11406 4806 11556 4956 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4206 7206 5106 7206 4956 7356 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5406 7506 5406 8406 5556 8256 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4206 6906 5106 6006 5106 6231 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5405 5705 5405 4805 5555 4955 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2405 5705 2405 4805 2555 4955 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11707 7207 12607 7207 12457 7357 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11707 6007 12607 6907 12382 6907 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2105 4205 2105 3305 2255 3455 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2705 4205 2705 3305 2855 3455 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5706 7206 6606 7206 6456 7356 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5706 6006 6606 6906 6381 6906 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2704 6004 3604 6904 3379 6904 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1208 7208 2108 7208 1958 7358 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1208 6908 2108 6008 2108 6233 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 681 6006 1131 6006 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 906 6906 906 6006 1056 6156 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12905 6905 12905 6005 13055 6155 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10207 7207 11107 7207 10957 7357 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10207 6907 11107 6007 11107 6232 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8400 5700 8625 5700 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 12900 6000 13125 6000 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 12675 6000 12900 6000 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8175 5700 8400 5700 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 1501 7801 301 7801 301 5401 1501 5401 1501 7801 -2 2 1 2 1 7 1 0 -1 6.000 1 0 0 0 0 5 - 1502 2852 3302 2852 3302 5777 1502 5777 1502 2852 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 4501 9001 3301 9001 3301 6301 4501 6301 4501 9001 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 6000 9000 4800 9000 4800 4200 6000 4200 6000 9000 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 7501 9001 6301 9001 6301 6301 7501 6301 7501 9001 -2 4 1 2 1 7 2 0 -1 6.000 0 0 7 0 0 5 - 9000 9000 7800 9000 7800 4200 9000 4200 9000 9000 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 10501 9001 9301 9001 9301 6301 10501 6301 10501 9001 -2 4 1 2 1 -1 1 0 -1 6.000 0 0 7 0 0 5 - 12000 9000 10800 9000 10800 4200 12000 4200 12000 9000 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 13501 7801 12301 7801 12301 5401 13501 5401 13501 7801 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 - 8700 2100 8400 2100 8400 5700 8550 5550 -2 2 1 2 1 7 101 0 -1 6.000 0 0 -1 0 0 5 - 8100 600 13800 600 13800 3600 8100 3600 8100 600 -4 1 -1 0 0 0 20 0.0000 4 210 150 2406 7281 0\001 -4 1 -1 0 0 0 20 0.0000 4 285 690 3906 8781 I:m_1\001 -4 1 -1 0 0 0 20 0.0000 4 285 705 2405 8780 R:b_1\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 2405 6080 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 3906 7281 1\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 8408 7283 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 8408 6083 0\001 -4 1 -1 0 0 0 20 0.0000 4 285 705 8483 8783 R:b_3\001 -4 1 -1 0 0 0 20 0.0000 4 285 690 9906 8781 I:m_3\001 -4 1 -1 0 0 0 20 0.0000 4 285 690 6905 8780 I:m_2\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 11407 7282 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 11407 6082 0\001 -4 1 -1 0 0 0 20 0.0000 4 285 645 11406 4581 C:k_t\001 -4 1 -1 0 0 0 20 0.0000 4 285 645 11482 8782 R:b_t\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 5406 7281 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 5406 6081 0\001 -4 1 -1 0 0 0 20 0.0000 4 285 705 5481 8781 R:b_2\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 12909 7284 1\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 6908 7283 1\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 2404 4579 1\001 -4 1 -1 0 0 0 20 0.0000 4 285 705 2779 3154 C:p_1\001 -4 1 -1 0 0 0 20 0.0000 4 285 705 2104 3154 R:d_1\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 910 7285 1\001 -4 1 -1 0 0 0 20 0.0000 4 285 765 902 5777 Sf:v_b\001 -4 1 -1 0 0 0 20 0.0000 4 285 735 12905 5780 De:f_t\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 9909 7284 1\001 -4 1 -1 0 0 0 20 0.0000 4 285 705 5405 4580 C:k_2\001 -4 1 1 1 0 3 20 0.0000 4 210 1515 3901 9301 Macro mass\001 -4 1 1 1 0 3 20 0.0000 4 210 1770 2401 2776 Macro control\001 -4 1 1 1 0 3 20 0.0000 4 210 1470 900 8100 Macro base\001 -4 1 1 1 0 3 20 0.0000 4 285 1845 5400 4050 Compliant link\001 -4 1 1 1 0 3 20 0.0000 4 210 1425 6901 9301 Micro mass\001 -4 1 1 1 0 3 20 0.0000 4 210 1860 8475 4050 Micro actuator\001 -4 1 1 1 0 3 20 0.0000 4 285 1095 9901 9301 Tip mass\001 -4 1 1 1 0 3 20 0.0000 4 285 2940 11400 4050 Compliant environment\001 -4 1 1 1 0 3 20 0.0000 4 285 1275 12901 8101 Tip sensor\001 -4 1 1 1 0 3 20 0.0000 4 285 2370 6750 1275 Open-loop control\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_desc.tex Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_desc.tex +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_desc.tex @@ -1,40 +0,0 @@ -% Verbal description for system MacroMicroPPP (MacroMicroPPP_desc.tex) -% Generated by MTT on Tue Dec 9 17:55:41 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/05/21 16:10:07 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{MacroMicroPPP} is - displayed in Figure \Ref{MacroMicroPPP_abg} and its label - file is listed in Section \Ref{sec:MacroMicroPPP_lbl}. - The subsystems are listed in Section \Ref{sec:MacroMicroPPP_sub}. - -This is a Bond Graph model of the macro-micro manipulation system -discussed by Sharon in his thesis and BY Sharon, Hogan and Hardt in -various papers. - -It can be regarded as a single-input single-output system with input -$e_1$ and output $e_2$. The bond graph in Figure \Ref{rcPPP_abg} is -augmented with the {\em open-loop\/} controller comprising -\begin{itemize} -\item seven effort source \textbf{Se} components ``u1'' to``u7'' -\item seven effort amplifier \textbf{AE} components ``ppp\_1'' to `ppp\_7'' -\end{itemize} -This allows up to 7 input basis functions. - -This is a \emph{linear} system; but it is used to illustate -\emph{nonlinear} PPP control. -Section \Ref{sec:rcPPP_nppp.ps} compares -\begin{itemize} -\item linear open-loop PPP control -\item linear closed-loop PPP control -\item nonlinear PPP control -\end{itemize} -as linear open and closed-loop control. DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_lbl.txt @@ -1,85 +0,0 @@ -%% Label file for system MacroMicroPPP (MacroMicroPPP_lbl.txt) -%SUMMARY MacroMicroPPP -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/05/21 16:05:48 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases -%ALIAS $1 ppp_1 -%ALIAS $2 ppp_2 -%ALIAS $3 ppp_3 -%ALIAS $4 ppp_4 -%ALIAS $5 k_2 -%ALIAS $6 k_t -%ALIAS $7 p_1 -%ALIAS $8 f_t -%ALIAS $9 m_1 -%ALIAS $10 m_2 -%ALIAS $11 m_3 -%ALIAS $12 b_1 -%ALIAS $13 b_2 -%ALIAS $14 b_3 -%ALIAS $15 b_t -%ALIAS $16 d_1 -%ALIAS $17 u_1 -%ALIAS $18 u_2 -%ALIAS $19 u_3 -%ALIAS $20 u_4 -%ALIAS $21 v_b - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - ppp_1 lin ppp_1 - ppp_2 lin ppp_2 - ppp_3 lin ppp_3 - ppp_4 lin ppp_4 - ppp_5 lin ppp_5 - ppp_6 lin ppp_6 - ppp_7 lin ppp_7 - -% Component type C - k_2 lin state,k_2 - k_t lin state,k_t - p_1 lin state,p_1 - -% Component type De - f_t SS external - -% Component type I - m_1 lin flow,m_1 - m_2 lin flow,m_2 - m_3 lin flow,m_3 - -% Component type R - b_1 lin flow,b_1 - b_2 lin flow,b_2 - b_3 lin flow,b_3 - b_t lin flow,b_t - d_1 lin flow,d_1 - -% Component type Se - u_1 SS external - u_2 SS external - u_3 SS external - u_4 SS external - u_5 SS external - u_6 SS external - u_7 SS external - -% Component type Sf - v_b SS 0 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_nppp.m Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_nppp.m ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_nppp.m +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_nppp.m @@ -1,154 +0,0 @@ -## MacroMicroPPP_nppp.m -## Makes figures for the MacroMicro_PPP exasmple. -## $Log$ -## Revision 1.4 2000/05/21 16:11:53 peterg -## 7 basis funs. -## -## Revision 1.3 2000/05/21 15:59:34 peterg -## Made into _nppp.m file -## Parameterised _sm -## -## Revision 1.2 2000/05/17 17:01:39 peterg -## Modified for Macro Micro example -- works!! -## -## Revision 1.1 2000/05/17 10:03:04 peterg -## Initial revision -## -## Revision 1.1 2000/05/17 09:14:37 peterg -## Initial revision -## -system_name = "MacroMicroPPP"; - -## Uncomment the following the first time -## (Or do ./Make MacroMicroPPP in this directory) - -## MTT stuff for the system simulation -##system("Make MacroMicroPPP"); - - - -t_s=0.1*[0:0.01:1]; -u = [ones(7,length(t_s))]; -x_0 = MacroMicroPPP_state; -par = MacroMicroPPP_numpar; - -## Simulate the system -tick=time; -[y] = MacroMicroPPP_sim(x_0,u,t_s,par); -Elapsed = time-tick -plot(t_s,y) - -## Simulate the system to give just the final few point -t_s1 = 0.1*[0.91:0.01:1]; -tick=time; -[y,x] = MacroMicroPPP_sim(x_0,u,t_s1,par); -Elapsed = time-tick -plot(t_s1,y,t_s1,x); - -## Sensitivity system simulation parameters -x_0s = sMacroMicroPPP_state; -pars = sMacroMicroPPP_numpar; -sympars = sMacroMicroPPP_sympar; - -## Simulate the sensitivity system -sensitivities = \ - [sympars.ppp_1s,\ - sympars.ppp_2s,\ - sympars.ppp_3s,\ - sympars.ppp_4s,\ - sympars.ppp_5s,\ - sympars.ppp_6s,\ - sympars.ppp_7s] -tick=time; -[y,ys] = sMacroMicroPPP_sim(x_0s,u,t_s,pars,sensitivities); -Elapsed = time-tick -plot(t_s,y,t_s,ys); - - -### PPP parameters -A_w = 0; -A_u = ppp_aug(A_w,laguerre_matrix(6,25)); # Specify basis functions - -tau = 0.5*[0.9:0.01:1]; # Optimisation interval -t_ol = 0.5*[0:0.01:0.1]; # Open-loop interval -N = 10; # Number of open-loop intervals in simulation -w = 1; # Setpoint - -## Linear system -[A,B,C,D] = MacroMicroPPP_sm(par); -Q = 1; -w = 1; -ppp_lin_plot (A,B(:,1),C(1,:),D(1,1),A_u,A_w,tau,Q,w,x_0); -psfig("MacroMicroPPP_lin"); - -## Simulate non-linear PPP (on this linear system) -extras.U_initial = "zero"; -extras.U_next = "continuation"; -extras.criterion = 1e-8; -extras.max_iterations = 10; -extras.v = 0.1; -extras.verbose = 0; - -## -- with no optimisation using linear PPP with continuation -extras.U_initial = "linear"; -extras.U_next = "continuation"; -extras.criterion = 1e-5; -extras.max_iterations = 0; - -[y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - -## -- with no optimisation using linear PPP at each step -extras.U_initial = "linear"; -extras.U_next = "linear"; -extras.criterion = 1e-5; -extras.max_iterations = 0; -[y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - -## -- with optimisation using nonlinear PPP with continuation -extras.U_initial = "zero"; -extras.U_next = "continuation"; -extras.criterion = 1e-5; -extras.max_iterations=100; -extras.verbose = 0; -extras.v = 1e-5; -disp("Non-linear optimisation ...."); -[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - - -## Plots -title(""); - -## U, U_c and U_l -I = 1:N; -IU1 = [I' U(1,:)']; -IU1_c = [I' U_c(1,:)']; -IU1_l = [I' U_l(1,:)']; -gset grid; xlabel "Interval" -gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1" -psfig("MacroMicroPPP_U1"); - -IU2 = [I' U(2,:)']; -IU2_c = [I' U_c(2,:)']; -IU2_l = [I' U_l(2,:)']; -gset grid; xlabel "Interval " -gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2" -psfig("MacroMicroPPP_U2"); - -## y & u -gset grid; xlabel "Time (sec)" -ty = [t' y'] ; tu = [t' u']; -gplot ty title "Output", tu title "Input" - -psfig("MacroMicroPPP_yu"); - -title(""); -gset grid; xlabel "Time (sec)" -ty_c = [t' y_c'] ; -ty_l = [t' y_l'] ; -ty = [t' y'] ; -tu = [t' u']; -gplot ty_c title "Continuation", ty_l title "Linear", ty title "Optimisation" -psfig("MacroMicroPPP_nppp"); - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_numpar.txt @@ -1,36 +0,0 @@ -## Dummies -b_1 = 0.0; -b_2 = 0.0; -b_3 = 0.0; -b_t = 0.0; -d_1 = 0.0; -e_s = 0.0; -f_s = 0.0; -k_2 = 0.0; -k_t = 0.0; -m_1 = 0.0; -m_2 = 0.0; -m_3 = 0.0; -p_1 = 0.0; -ppp_1 = 0.0; -ppp_2 = 0.0; -ppp_3 = 0.0; -ppp_4 = 0.0; -ppp_5 = 0.0; -ppp_6 = 0.0; -ppp_7 = 0.0; - -m_1 = 0.0169; # m_1; -m_2 = 0.0169; # m_2; -b_1 = 0.13; # b_1; -b_2 = 0.013; # b_2; -k_2 = 24; # k_2; -k_t = 150; # k_t; -b_t = 0.16; # b_t; -b_3 = 0.13; # b_3; -m_3 = 0.005; # m_3; -p_1 = 10; # p_1; -d_1 = 0.9; # d_1; - - -ppp_1 = 1.0; DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_rep.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_rep.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/MacroMicroPPP_rep.txt @@ -1,25 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system MacroMicroPPP (MacroMicroPPP_rep.txt) -## Generated by MTT on" Wed May 10 09:22:52 BST 2000. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/05/20 17:44:47 peterg -## Initial revision -## -############################################################### - -mtt MacroMicroPPP abg tex # The system description -#mtt -s sMacroMicroPPP abg tex # The system description - -mtt MacroMicroPPP struc tex # The system structure -mtt -s sMacroMicroPPP struc tex # The system structure - -mtt MacroMicroPPP nppp m # How its done -mtt MacroMicroPPP nppp ps # PPP output - -mtt MacroMicroPPP rep txt # The report. - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/Make Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/Make ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/Make +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/Make @@ -1,30 +0,0 @@ -#!/bin/sh - -## Makes the files needed for Figures.m -## Copyright (C) 2000 by Peter J. Gawthrop - -if [ -z "$1" ]; then - echo Usage ./Make system_name - exit -else - echo "Making simulation for system $1 (for use in Figures.m)" -fi - -## System -mtt -q -c -stdin $1 ode2odes out -mtt -q -c -stdin $1 sim m -mtt -q $1 state m -mtt -q $1 sympar m -mtt -q $1 numpar m - -## Sensitivity system -mtt -q -c -stdin -s s$1 ode2odes out -mtt -q -c -stdin -s s$1 sim m -mtt -q -s s$1 state m -mtt -q -s s$1 sympar m -mtt -q -s s$1 numpar m - -## Additional system reps for PPP -mtt -q $1 sm m -mtt -q $1 def m -mtt -q -s s$1 def m DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_lbl.txt @@ -1,103 +0,0 @@ -%% Label file for system sMacroMicroPPP (sMacroMicroPPP_lbl.txt) -%SUMMARY sMacroMicroPPP -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases -%ALIAS $1 ppp_1 -%ALIAS $2 ppp_1s -%ALIAS $3 ppp_2 -%ALIAS $4 ppp_2s -%ALIAS $5 ppp_3 -%ALIAS $6 ppp_3s -%ALIAS $7 ppp_4 -%ALIAS $8 ppp_4s -%ALIAS $9 k_2 -%ALIAS $10 k_2s -%ALIAS $11 k_t -%ALIAS $12 k_ts -%ALIAS $13 p_1 -%ALIAS $14 p_1s -%ALIAS $15 f_t -%ALIAS $16 f_ts -%ALIAS $17 m_1 -%ALIAS $18 m_1s -%ALIAS $19 m_2 -%ALIAS $20 m_2s -%ALIAS $21 m_3 -%ALIAS $22 m_3s -%ALIAS $23 b_1 -%ALIAS $24 b_1s -%ALIAS $25 b_2 -%ALIAS $26 b_2s -%ALIAS $27 b_3 -%ALIAS $28 b_3s -%ALIAS $29 b_t -%ALIAS $30 b_ts -%ALIAS $31 d_1 -%ALIAS $32 d_1s -%ALIAS $33 u_1 -%ALIAS $34 u_1s -%ALIAS $35 u_2 -%ALIAS $36 u_2s -%ALIAS $37 u_3 -%ALIAS $38 u_3s -%ALIAS $39 u_4 -%ALIAS $40 u_4s -%ALIAS $41 v_b -%ALIAS $42 v_bs - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - ppp_1 lin ppp_1;ppp_1s - ppp_2 lin ppp_2;ppp_2s - ppp_3 lin ppp_3;ppp_3s - ppp_4 lin ppp_4;ppp_4s - ppp_5 lin ppp_5;ppp_5s - ppp_6 lin ppp_6;ppp_6s - ppp_7 lin ppp_7;ppp_7s - -% Component type C - k_2 lin state,k_2;k_2s - k_t lin state,k_t;k_ts - p_1 lin state,p_1;p_1s - -% Component type De - f_t SS external - -% Component type I - m_1 lin flow,m_1;m_1s - m_2 lin flow,m_2;m_2s - m_3 lin flow,m_3;m_3s - -% Component type R - b_1 lin flow,b_1;b_1s - b_2 lin flow,b_2;b_2s - b_3 lin flow,b_3;b_3s - b_t lin flow,b_t;b_ts - d_1 lin flow,d_1;d_1s - -% Component type Se - u_1 SS external;u_1s - u_2 SS external;u_2s - u_3 SS external;u_3s - u_4 SS external;u_4s - u_5 SS external;u_5s - u_6 SS external;u_6s - u_7 SS external;u_7s - -% Component type Sf - v_b SS 0;0 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/MacroMicroPPP/sMacroMicroPPP_numpar.txt @@ -1,70 +0,0 @@ -## Dummies -b_1 = 0.0; -b_1s = 0.0; -b_2 = 0.0; -b_2s = 0.0; -b_3 = 0.0; -b_3s = 0.0; -b_t = 0.0; -b_ts = 0.0; -c = 0.0; -d_1 = 0.0; -d_1s = 0.0; -e_s = 0.0; -f_s = 0.0; -g = 0.0; -i = 0.0; -k = 0.0; -k_2 = 0.0; -k_2s = 0.0; -k_s = 0.0; -k_t = 0.0; -k_ts = 0.0; -m_1 = 0.0; -m_1s = 0.0; -m_2 = 0.0; -m_2s = 0.0; -m_3 = 0.0; -m_3s = 0.0; -p_1 = 0.0; -p_1s = 0.0; -ppp_1 = 0.0; -ppp_1s = 0.0; -ppp_2 = 0.0; -ppp_2s = 0.0; -ppp_3 = 0.0; -ppp_3s = 0.0; -ppp_4 = 0.0; -ppp_4s = 0.0; -ppp_5 = 0.0; -ppp_5s = 0.0; -ppp_6 = 0.0; -ppp_6s = 0.0; -ppp_7 = 0.0; -ppp_7s = 0.0; -r = 0.0; -u_1s = 0.0; -u_2s = 0.0; -u_3s = 0.0; -u_4s = 0.0; -u_5s = 0.0; -u_6s = 0.0; -u_7s = 0.0; - -## Physical parameters -m_1 = 0.0169; # m_1; -m_2 = 0.0169; # m_2; -b_1 = 0.13; # b_1; -b_2 = 0.013; # b_2; -k_2 = 24; # k_2; -k_t = 150; # k_t; -b_t = 0.16; # b_t; -b_3 = 0.13; # b_3; -m_3 = 0.005; # m_3; -p_1 = 10; # p_1; -d_1 = 0.9; # d_1; - -## First gain -ppp_1 = 1.0; - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Figures.m @@ -1,144 +0,0 @@ -## Figures.m -## Makes figures for the rc_PPP exasmple. -## $Log$ -## Revision 1.2 2000/05/17 17:02:58 peterg -## Fixed documentation -## -## Revision 1.1 2000/05/17 09:14:37 peterg -## Initial revision -## -system_name = "rcPPP"; - -## Uncomment the following the first time -## (Or do ./Make rcPPP in this directory) - -## MTT stuff for the system simulation -##system("Make rcPPP"); - -# ## System info -par = rcPPP_numpar; -simpar = rcPPP_simpar; -x_0 = rcPPP_state(par); - -# ## Set up the input -# t = [0:simpar.dt:simpar.last]; -# A_w = 0; -# A_u = ppp_aug(A_w,laguerre_matrix(1,2.0)) # Specify basis functions: constant & exp(-t/T) -# u = ppp_ustar(A_u,1,t,0,0); - -# ## Simulate the system -# tick=time; -# [y,x] = rcPPP_sim(x_0,par,simpar,u); -# Elapsed = time-tick -# plot(t,y) - -## Sensitivity system simulation parameters -simpars = srcPPP_simpar; -sympars = srcPPP_sympar; -pars = srcPPP_numpar; -x_0s = srcPPP_state(pars); - -t = [0:simpars.dt:simpars.last]; -A_w = 0; -A_u = ppp_aug(A_w,laguerre_matrix(1,2.0)) # Specify basis functions: constant & exp(-t/T) -u = ppp_ustar(A_u,1,t,0,0); - - -## Setup the indices of the adjustable stuff -i_ppp = [sympars.ppp_1, sympars.ppp_1s - sympars.ppp_2, sympars.ppp_2s]; # PPP params -i_par = [sympars.x_0, sympars.x_0s - sympars.r, sympars.rs]; # State and r component - -## Simulate the sensitivity system -sensitivities = [i_ppp(:,2); i_par(:,2)] -u = ppp_ustar(A_u,1,t,0,0); -tick=time; -[y,ys,x] = srcPPP_ssim(x_0s,pars,simpars,u,sensitivities); -Elapsed = time-tick -plot(t,y,t,ys); - -### PPP parameters -tau = [0.9:0.01:1]; # Optimisation interval -t_ol = [0:0.01:0.2]; # Open-loop interval -N = 10; # Number of open-loop intervals in simulation -w = 1; # Setpoint -w_s = w*ones(10,1); # The setpoint witnin the horizon - -## Linear system -n_Tau = round(simpars.last/simpars.dt); -dtau = simpars.dt; -Tau = [0:n_Tau-1]'*dtau; -[n_tau,n_w] = size(w_s); -tau = Tau(n_Tau-n_tau+1:n_Tau) -[A,B,C,D] = rcPPP_sm(par); -Q = 1; -w = 1; -ppp_lin_plot (A,B(:,1),C(1,:),D(1,1),A_u,A_w,tau',Q,w); -psfig("rcPPP_lin"); - -## Simulate non-linear PPP (on this linear system) -extras.U_initial = "zero"; -extras.U_next = "continuation"; -extras.criterion = 1e-5; -extras.max_iterations = 10; -extras.alpha = 0.1; -extras.verbose = 0; -extras.v = 1e-5; - -## -- with no optimisation using linear PPP with continuation -extras.U_initial = "linear"; -extras.U_next = "continuation"; -extras.criterion = 1e-5; -extras.max_iterations = 0; -[y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras); - -## -- with no optimisation using linear PPP at each step -extras.U_initial = "linear"; -extras.U_next = "linear"; -extras.criterion = 1e-5; -extras.max_iterations = 0; -[y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras); - -## -- with optimisation using nonlinear PPP with continuation -extras.U_initial = "zero"; -extras.U_next = "continuation"; -extras.criterion = 1e-5; -extras.max_iterations = 100; -[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,i_ppp,i_par,A_u,w_s,N,extras); - - -## Plots -title(""); - -## U, U_c and U_l -I = [1:N]'; -IU1 = [I U(:,1)]; -IU1_c = [I U_c(:,1)]; -IU1_l = [I U_l(:,1)]; -gset grid; xlabel "Interval" -gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1" -psfig("rcPPP_U1"); - -IU2 = [I U(:,2)]; -IU2_c = [I U_c(:,2)]; -IU2_l = [I U_l(:,2)]; -gset grid; xlabel "Interval " -gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2" -psfig("rcPPP_U2"); - -## y & u -gset grid; xlabel "Time (sec)" -ty = [t y] ; tu = [t u]; -gplot ty title "Output", tu title "Input" - -psfig("rcPPP_yu"); - -gset grid; xlabel "Time (sec)" -ty_c = [t y_c] ; -ty_l = [t y_l] ; -ty = [t y] ; -tu = [t u]; -gplot ty_c title "Continuation", ty_l title "Linear", ty title "Optimisation" -psfig("rcPPP_ylco"); - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/Make @@ -1,46 +0,0 @@ -#!/bin/sh - -## Makes the files needed for Figures.m -## Copyright (C) 2000 by Peter J. Gawthrop - -sys=$1 - -if [ -z "$2" ]; then - code=oct -else - code=$2 -fi - -if [ -z "$1" ]; then - echo 'Usage ./Make system_name [m|oct]' - exit -else - echo "Making sensitivity simulation for system ${sys} (code ${code})" -fi - -if [ "${code}" == "oct" ]; then - oct='-oct' -fi - -echo Switches ${oct} - -## System -mtt -q ${sys} sympar m -mtt -q ${sys} simpar m -mtt -q ${sys} numpar m -mtt -q ${sys} state m - - -## Sensitivity system -mtt -q -stdin -s s${sys} ssim m -mtt -q -stdin -s s${sys} sympar m -mtt -q -stdin -s s${sys} simpar m -mtt -q -stdin ${oct} -s s${sys} input ${code} -mtt -q -stdin ${oct} -s s${sys} ode2odes ${code} -mtt -q -stdin ${oct} -s s${sys} state ${code} -mtt -q -stdin ${oct} -s s${sys} numpar ${code} - -## Additional system reps for PPP -mtt -q -stdin ${sys} sm m -mtt -q -stdin ${sys} def m -mtt -q -stdin -s s${sys} def m DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_abg.fig Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_abg.fig +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_abg.fig @@ -1,68 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 3600 1125 162 162 3600 1125 3690 1260 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4952 4277 5852 4277 5627 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6302 4277 7202 4277 6977 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 4051 4726 3151 4951 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6076 4051 6076 3151 6301 3376 -2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 4275 585 5175 585 5175 765 4275 765 4275 585 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5850 1215 6300 1215 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5850 1080 6300 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3600 675 4275 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5175 675 7200 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 6075 675 6075 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 6075 1215 6075 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3600 1575 7200 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3600 945 3600 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3600 1575 3600 1260 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 7200 1530 7200 765 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3866 3414 4502 4050 4184 4050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3870 5130 4505 4494 4505 4812 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1802 3375 2702 3375 2477 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1802 5175 2702 5175 2477 5400 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8550 5625 8550 225 900 225 900 5625 8550 5625 -4 1 -1 0 0 0 20 0.0000 4 210 150 4727 4367 1\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 6077 4367 0\001 -4 1 -1 0 0 0 20 0.0000 4 285 540 7787 4367 De:y\001 -4 1 -1 0 0 0 20 0.0000 4 210 375 4726 2926 R:r\001 -4 1 -1 0 0 0 20 0.0000 4 210 555 6076 2926 CS:c\001 -4 0 1 1 0 0 20 0.0000 4 150 120 4680 450 r\001 -4 0 1 1 0 0 20 0.0000 4 150 135 6480 1215 c\001 -4 0 1 1 0 0 20 0.0000 4 150 135 7425 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 210 150 7515 1305 2\001 -4 0 1 1 0 0 20 0.0000 4 150 135 3060 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 210 150 3150 1305 1\001 -4 1 1 1 0 0 20 0.0000 4 285 1425 5400 4995 Bond graph\001 -4 1 1 1 0 0 20 0.0000 4 210 1275 5400 2025 Schematic\001 -4 1 -1 0 0 0 20 0.0000 4 285 930 3285 5265 AE:ppp_2\001 -4 1 -1 0 0 0 20 0.0000 4 285 930 3285 3465 AE:ppp_1\001 -4 1 -1 0 0 0 20 0.0000 4 210 660 1440 3465 Se:u1\001 -4 1 -1 0 0 0 20 0.0000 4 210 660 1440 5265 Se:u2\001 DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_desc.tex Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_desc.tex +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_desc.tex @@ -1,38 +0,0 @@ -% Verbal description for system rcPPP (rcPPP_desc.tex) -% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/08/24 10:27:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -The acausal bond graph of system \textbf{rcPPP} is -displayed in Figure \Ref{rcPPP_abg} and its label -file is listed in Section \Ref{sec:rcPPP_lbl}. -The subsystems are listed in Section \Ref{sec:rcPPP_sub}. -The system \textbf{rcPPP} is based on the simple electrical rc circuit shown in -Figure \Ref{rcPPP_abg}. - -It can be regarded as a single-input -single-output system with input $e_1$ and output $e_2$. -The bond graph in Figure \Ref{rcPPP_abg} is augmented with the {\em -open-loop\/} controller comprising -\begin{itemize} -\item two effort source \textbf{Se} components ``u1'' and ``u2'' -\item two effort amplifier \textbf{AE} components ``ppp\_1'' and `ppp\_2'' -\end{itemize} - -This is a \emph{linear} system; but it is used to illustate -\emph{nonlinear} PPP control. Not surprisingly, the \emph{nonlinear} -PPP control gives nearly the same result (Section \Ref{sec:rcPPP_nppp.ps}) -as linear open and closed-loop control. - - - - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_lbl.txt @@ -1,44 +0,0 @@ -%% Label file for system rcPPP (rcPPP_lbl.txt) -%SUMMARY rcPPP -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases -%ALIAS $1 ppp_1 -%ALIAS $2 ppp_2 -%ALIAS $3 c -%ALIAS $4 y -%ALIAS $5 r -%ALIAS $6 u1 -%ALIAS $7 u2 - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - ppp_1 lin ppp_1 - ppp_2 lin ppp_2 - -% Component type CS - c lin effort,c;q_0 - -% Component type De - y SS external - -% Component type R - r lin flow,r - -% Component type Se - u1 SS external - u2 SS external DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_nppp.m Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_nppp.m ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_nppp.m +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_nppp.m @@ -1,146 +0,0 @@ -## Figures.m -## Makes figures for the rc_PPP exasmple. -## $Log$ -## Revision 1.3 2000/08/12 10:39:33 peterg -## Levenberg-Marquardt version -## -## Revision 1.2 2000/05/21 06:39:23 peterg -## Parameterised _sm -## -## Revision 1.1 2000/05/19 13:15:38 peterg -## Initial revision -## -## Revision 1.2 2000/05/17 17:02:58 peterg -## Fixed documentation -## -## Revision 1.1 2000/05/17 09:14:37 peterg -## Initial revision -## -system_name = "rcPPP"; - -## Uncomment the following the first time -## (Or do ./Make rcPPP in this directory) - -## MTT stuff for the system simulation -##system("Make rcPPP"); - - - -t_s=[0:0.1:10]; -u = [ones(1,length(t_s));ones(1,length(t_s))]; -x_0 = rcPPP_state; -par = rcPPP_numpar; - -## Simulate the system -tick=time; -[y,x] = rcPPP_sim(x_0,u,t_s,par); -Elapsed = time-tick -plot(t_s,y,t_s,x); - -## Simulate the system to give just the final few point -t_s1 = [9:0.1:10]; -tick=time; -[y,x] = rcPPP_sim(x_0,u,t_s1,par); -Elapsed = time-tick -plot(t_s1,y,t_s1,x); - -## Sensitivity system simulation parameters -x_0s = srcPPP_state; -pars = srcPPP_numpar -sympars = srcPPP_sympar; - -## Simulate the sensitivity system -sensitivities = [sympars.ppp_1s,sympars.ppp_2s,sympars.rs] -tick=time; -[y,ys] = srcPPP_sim(x_0s,u,t_s,[sympars.r,2.0],sensitivities); -Elapsed = time-tick -plot(t_s,y,t_s,ys); - -### PPP parameters -A_w = 0; -A_u = ppp_aug(A_w,laguerre_matrix(1,10)); # Specify basis functions: constant & exp(-5t) -tau = [0.9:0.01:1]; # Optimisation interval -t_ol = [0:0.01:0.2]; # Open-loop interval -N = 5; # Number of open-loop intervals in simulation -w = 1; # Setpoint - -## Linear system -[A,B,C,D] = rcPPP_sm(par); -Q = 1; -w = 1; -ppp_lin_plot (A,B(:,1),C(1,:),D(1,1),A_u,A_w,tau,Q,w,x_0); -psfig("rcPPP_lin"); - -## Simulate non-linear PPP (on this linear system) -extras.U_initial = "zero"; -extras.U_next = "continuation"; -extras.criterion = 1e-5; -extras.max_iterations = 10; -extras.v = 0; -extras.verbose = 0; - -## -- with no optimisation using linear PPP with continuation -disp("Linear PPP at time zero with continuation trajectories") -extras.U_initial = "linear"; -extras.U_next = "continuation"; -extras.criterion = 1e-5; -extras.v = 0; -extras.max_iterations = 0; -[y_c,x,u_c,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - -## -- with no optimisation using linear PPP at each step -disp("Linear PPP at each step") -extras.U_initial = "linear"; -extras.U_next = "linear"; -extras.criterion = 1e-5; -extras.max_iterations = 0; -extras.v = 0; -[y_l,x,u_l,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - -## -- with optimisation using nonlinear PPP with continuation -disp("Nonlinear PPP"); -extras.U_initial = "zero"; -extras.U_next = "continuation"; -extras.v = 1e-5; -extras.criterion = 1e-5; -extras.max_iterations = 100; -extras.verbose = 0; -[y,x,u,t,U,U_c,U_l] = ppp_nlin_sim (system_name,A_u,tau,t_ol,N,w,extras); - - -## Plots -title(""); - -## U, U_c and U_l -I = 1:N; -IU1 = [I' U(1,:)']; -IU1_c = [I' U_c(1,:)']; -IU1_l = [I' U_l(1,:)']; -gset grid; xlabel "Interval" -gplot IU1 title "U_1", IU1_c title "U_c1", IU1_l title "U_l1" -psfig("rcPPP_U1"); - -IU2 = [I' U(2,:)']; -IU2_c = [I' U_c(2,:)']; -IU2_l = [I' U_l(2,:)']; -gset grid; xlabel "Interval " -gplot IU2 title "U_2", IU2_c title "U_c2", IU2_l title "U_l2" -psfig("rcPPP_U2"); - -## y & u -gset grid; xlabel "Time (sec)" -ty = [t' y'] ; tu = [t' u']; -gplot ty title "Output", tu title "Input" - -psfig("rcPPP_yu"); - -title(""); -gset grid; xlabel "Time (sec)" -ty_c = [t' y_c'] ; -ty_l = [t' y_l'] ; -ty = [t' y'] ; -tu = [t' u']; -gplot ty_c title "Continuation", ty_l title "Linear", ty title "Optimisation" -psfig("rcPPP_nppp"); - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_numpar.txt @@ -1,27 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (rcPPP_numpar.txt) -# Generated by MTT at Tue Apr 18 18:53:40 BST 2000 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:31:27 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c = 1.0; # CS,rcPPP -## Removed by MTT on Sat May 26 07:46:29 BST 2001: e_0 = 1.0; # CS -## Removed by MTT on Sat May 26 07:46:29 BST 2001: e_s = 1.0; # Se - -ppp_1 = 1.0; # rcPPP -ppp_2 = 0.0; # rcPPP - -## Physical parameters -c = 1.0; -q_0 = 0.0; -r = 1.0; - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_rep.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_rep.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/rcPPP_rep.txt @@ -1,25 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system rcPPP (rcPPP_rep.txt) -## Generated by MTT on" Wed May 10 09:22:52 BST 2000. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/05/20 17:44:47 peterg -## Initial revision -## -############################################################### - -mtt rcPPP abg tex # The system description -#mtt -s srcPPP abg tex # The system description - -mtt rcPPP struc tex # The system structure -mtt -s srcPPP struc tex # The system structure - -mtt rcPPP nppp m # How its done -mtt rcPPP nppp ps # PPP output - -mtt rcPPP rep txt # PPP output - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_input.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_input.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_input.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_input.txt @@ -1,15 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (srcPPP_input.txt) -# Generated by MTT at Fri Apr 14 17:44:36 BST 2000 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -# Set the inputs -mttu(1) = 1.0; # u (srcPPP_u1_se_1) -mttu(2) = 0.0;#exp(-mttt); # u (srcPPP_u2_se_1) - -# Set the switches DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_lbl.txt @@ -1,57 +0,0 @@ -%% Label file for system srcPPP (srcPPP_lbl.txt) -%SUMMARY srcPPP -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:31:27 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases -%ALIAS $1 ppp_1 -%ALIAS $2 ppp_1s -%ALIAS $3 ppp_2 -%ALIAS $4 ppp_2s -%ALIAS $5 c -%ALIAS $6 cs -%ALIAS $7 y -%ALIAS $8 ys -%ALIAS $9 r -%ALIAS $10 rs -%ALIAS $11 u1 -%ALIAS $12 u1s -%ALIAS $13 u2 -%ALIAS $14 u2s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- -% Component type Ae - ppp_1 slin ppp_1;ppp_1s - ppp_2 slin ppp_2;ppp_2s - -% Component type CS - c slin effort,c;x_0;cs;x_0s - -% Component type De - y SS external - -% Component type R - r slin flow,r;rs - -% Component type Se - u1 SS external;0 - u2 SS external;0 - - DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_numpar.txt @@ -1,25 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System srcPPP, representation numpar, language txt; -## File srcPPP_numpar.txt; -## Generated by MTT on Sat May 26 08:47:19 BST 2001; - - -## Parameters -c = 1.0; -r = 1.0; - -## PPP coefficients -ppp_1 = 0.0; # Default -ppp_2 = 1.0; # Default - -## State -x_0 = 0.0; # Default - -## Sensitivities -cs = 0.0; # Default -ppp_1s = 0.0; # Default -ppp_2s = 0.0; # Default -rs = 0.0; # Default -x_0s = 0.0; # Default DELETED mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt Index: mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Nonlinear/rcPPP/srcPPP_simpar.txt @@ -1,22 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system srcPPP (srcPPP_simpar.txt) -# Generated by MTT on Fri Apr 14 17:43:36 BST 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:31:27 peterg -## To RCS -## -############################################################### - - -FIRST = 0.0; # Last time in simulation -LAST = 2.0; # Last time in simulation -DT = 0.01; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_abg.fig @@ -1,19 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1125 2475 2475 2475 2250 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2835 2250 2835 900 3060 1125 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2835 2700 2835 4050 3060 3825 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 2250 2475 2700 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 4725 4500 4725 450 225 450 225 4500 4725 4500 -4 2 -1 0 0 0 20 0.0000000 4 210 570 1035 2565 SS:u\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2835 2565 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 4365 R:b\001 -4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 765 I:m\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_desc.tex @@ -1,23 +0,0 @@ -% Verbal description for system Cruise (Cruise_desc.tex) -% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Cruise} is - displayed in Figure \Ref{Cruise_abg} and its label - file is listed in Section \Ref{sec:Cruise_lbl}. - The subsystems are listed in Section \Ref{sec:Cruise_sub}. - - -This is a simple teaching example to illustrare compensator design via -observer/state-feedback methods. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_lbl.txt @@ -1,29 +0,0 @@ -%SUMMARY Cruise: -%DESCRIPTION -%% Label file for system Cruise (Cruise_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/05/20 16:26:30 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type I - m lin flow,m - -% Component type R - b lin flow,b - -% Component type SS - u SS external,external DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_numpar.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_numpar.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_numpar.txt @@ -1,27 +0,0 @@ -# Numerical parameter file (Cruise_numpar.txt) -# Generated by MTT at Mon Jan 12 15:43:19 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -b = 1.0; # Parameter b for Cruise -b_m = 1.0; # Parameter b_m for Cruise -j = 1.0; # Parameter j for Cruise -j_m = 1.0; # Parameter j_m for Cruise -k = 1.0; # Parameter k for Cruise -k_m = 1.0; # Parameter k_m for Cruise -l = 1.0; # Parameter l for Cruise -l_a = 1.0; # Parameter l_a for Cruise -l_m = 1.0; # Parameter l_m for Cruise -r = 1.0; # Parameter r for Cruise -r_a = 1.0; # Parameter r_a for Cruise -r_m = 1.0; # Parameter r_m for Cruise - -# Initial states -x(1) = 0.0; # Initial state for Cruise_motor (l_a) -x(2) = 0.0; # Initial state for Cruise_motor (j_m) DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_params.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_params.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_params.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_params.r @@ -1,11 +0,0 @@ -%% Parameter file for system Cruise (Cruise_params.r) -%% This file provides symbolic parameters for simplification - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_rep.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_rep.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_rep.txt @@ -1,24 +0,0 @@ -# Outline report file for system Cruise (Cruise_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt Cruise abg tex - -mtt -o Cruise sm tex -mtt -o Cruise tf tex - -mtt -o Cruise smc tex -mtt -o Cruise ssk tex - -mtt -o Cruise smo tex -mtt -o Cruise ssl tex - -mtt -o Cruise ctf tex - - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_simp.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_simp.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_simp.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_simp.r @@ -1,19 +0,0 @@ -%% Reduce comands to simplify output for system Cruise (Cruise_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% System -%J_m := 1; L_m := 0.1; k_m := 1; b_m := 0.1; r_m := 1; - -% Controller - poles at -2 and -10 -%alpha_c1 := 12; alpha_c2 := 20; - -% Observer - poles at -10 -50 -%alpha_o1 := 60; alpha_o2 := 500; - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_sspar.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_sspar.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Cruise/Cruise_sspar.r @@ -1,10 +0,0 @@ -%% Reduce steady-state parameter file for Cruise (Cruise_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1125 2475 2475 2475 2250 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2835 2250 2835 900 3060 1125 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2835 2700 2835 4050 3060 3825 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 2250 2475 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 2475 4500 2475 4275 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 2475 6750 2475 6525 2700 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 7650 4455 7650 450 225 450 225 4455 7650 4455 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2835 2565 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 4365 R:b\001 -4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 765 I:m\001 -4 0 -1 0 0 0 20 0.0000000 4 270 570 6930 2565 SS:y\001 -4 2 -1 0 0 0 20 0.0000000 4 210 570 1035 2565 SS:u\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1080 4950 2565 INTF:int\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_desc.tex @@ -1,33 +0,0 @@ -% Verbal description for system CruiseP (CruiseP_desc.tex) -% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This is a simple teaching example to illustrate compensator design via -observer/state-feedback methods. - -The system represents a simple model of a vehicle moving along a road. -The vehicle -\begin{itemize} -\item has mass $m$ -\item is driven by a force $u=F$ -\item has velocity $v$ -\item has momentum $p=mv$ -\item has a distance along the road $y=d$ -\item The system states are taken to be: - \begin{equation} - x = - \begin{pmatrix} - p \\ d - \end{pmatrix} - \end{equation}\end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_lbl.txt @@ -1,30 +0,0 @@ -%SUMMARY CruiseP: -%DESCRIPTION -%% Label file for system CruiseP (CruiseP_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type I - m lin flow,m - -% Component type INTF - int lin flow,int - -% Component type R - b lin flow,b - -% Component type SS - u SS external,internal - y SS external,0 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_numpar.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_numpar.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_numpar.txt @@ -1,18 +0,0 @@ -# Numerical parameter file (CruiseP_numpar.txt) -# Generated by MTT at Fri Feb 13 17:15:12 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -b = 1.0; # CruiseP -int = 1.0; # CruiseP -m = 1.0; # CruiseP - -# Initial states -x(1) = 0.0; # CruiseP (m) -x(2) = 0.0; # CruiseP_int (3) DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Inches -1200 2 -1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 3900 3900 309 309 3900 3900 4209 4209 -1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 2700 3900 309 309 2700 3900 3009 4209 -2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 2400 2400 4200 2400 4200 3600 2400 3600 2400 2400 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 4500 2700 5700 2700 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 1200 3000 2400 3000 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3900 1800 2700 1800 -4 0 -1 0 0 3 20 0.0000000 4 270 1380 5700 2400 v (velocity)\001 -4 0 -1 0 0 3 20 0.0000000 4 270 1095 525 2700 u (force)\001 -4 0 -1 0 0 3 20 0.0000000 4 270 1425 5700 3150 y (position)\001 -4 0 -1 0 0 3 20 0.0000000 4 255 1155 2700 3075 m (mass)\001 -4 0 -1 0 0 3 20 0.0000000 4 270 2235 3150 1575 bv (friction force)\001 -4 0 -1 0 0 3 16 0.0000000 4 195 2490 2325 5100 states: p=momentum=mv\001 -4 0 -1 0 0 3 16 0.0000000 4 210 1725 2325 5442 y=position\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_pic.tex @@ -1,7 +0,0 @@ -\makebox[5.541in][l]{ - \vbox to 3.458in{ - \vfill - \special{psfile=CruiseP_pic.ps} - } - \vspace{-\baselineskip} -} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.tex @@ -1,108 +0,0 @@ - - -\section{\textbf{CruiseP}: representation \textbf{abg}, language \textbf{tex}} -\label{sec:CruiseP_abg.tex} -\index{\textbf{CruiseP} -- abg} - - -MTT command: -\begin{verbatim} -mtt CruiseP abg tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_abg.tex} - - -\section{\textbf{CruiseP}: representation \textbf{ode}, language \textbf{tex}} -\label{sec:CruiseP_ode.tex} -\index{\textbf{CruiseP} -- ode} - - -MTT command: -\begin{verbatim} -mtt -o CruiseP ode tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_ode.tex} - - -\section{\textbf{CruiseP}: representation \textbf{sm}, language \textbf{tex}} -\label{sec:CruiseP_sm.tex} -\index{\textbf{CruiseP} -- sm} - - -MTT command: -\begin{verbatim} -mtt -o CruiseP sm tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_sm.tex} - - -\section{\textbf{CruiseP}: representation \textbf{tf}, language \textbf{tex}} -\label{sec:CruiseP_tf.tex} -\index{\textbf{CruiseP} -- tf} - - -MTT command: -\begin{verbatim} -mtt -o CruiseP tf tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_tf.tex} - - -\section{\textbf{CruiseP}: representation \textbf{smc}, language \textbf{tex}} -\label{sec:CruiseP_smc.tex} -\index{\textbf{CruiseP} -- smc} - - -MTT command: -\begin{verbatim} -mtt -o CruiseP smc tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_smc.tex} - - -\section{\textbf{CruiseP}: representation \textbf{ssk}, language \textbf{tex}} -\label{sec:CruiseP_ssk.tex} -\index{\textbf{CruiseP} -- ssk} - - -MTT command: -\begin{verbatim} -mtt -o CruiseP ssk tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_ssk.tex} - - -\section{\textbf{CruiseP}: representation \textbf{smo}, language \textbf{tex}} -\label{sec:CruiseP_smo.tex} -\index{\textbf{CruiseP} -- smo} - - -MTT command: -\begin{verbatim} -mtt -o CruiseP smo tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_smo.tex} - - -\section{\textbf{CruiseP}: representation \textbf{ssl}, language \textbf{tex}} -\label{sec:CruiseP_ssl.tex} -\index{\textbf{CruiseP} -- ssl} - - -MTT command: -\begin{verbatim} -mtt -o CruiseP ssl tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_ssl.tex} - - -\section{\textbf{CruiseP}: representation \textbf{ctf}, language \textbf{tex}} -\label{sec:CruiseP_ctf.tex} -\index{\textbf{CruiseP} -- ctf} - - -MTT command: -\begin{verbatim} -mtt -o CruiseP ctf tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruiseP/MTT_work/CruiseP_ctf.tex} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/CruiseP_rep.txt @@ -1,24 +0,0 @@ -# Outline report file for system CruiseP (CruiseP_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt CruiseP abg tex - -mtt -o CruiseP ode tex -mtt -o CruiseP sm tex -mtt -o CruiseP tf tex - -mtt -o CruiseP smc tex -mtt -o CruiseP ssk tex - -mtt -o CruiseP smo tex -mtt -o CruiseP ssl tex - -mtt -o CruiseP ctf tex - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/Makefile Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/Makefile ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/Makefile +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruiseP/Makefile @@ -1,18 +0,0 @@ -# -# TransFig makefile -# - -all: CruiseP_pic.tex - -# translation into ps - -CruiseP_pic.tex: CruiseP_pic.ps Makefile - fig2ps2tex CruiseP_pic.ps >CruiseP_pic.tex -clean:: - rm -f CruiseP_pic.tex - -CruiseP_pic.ps: CruiseP_pic.fig Makefile - fig2dev -L ps CruiseP_pic.fig > CruiseP_pic.ps -clean:: - rm -f CruiseP_pic.ps - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1125 2475 2475 2475 2250 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2835 2250 2835 900 3060 1125 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2835 2700 2835 4050 3060 3825 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 2250 2475 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 2475 4500 2475 4275 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 2475 6750 2475 6525 2700 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 7650 4455 7650 450 225 450 225 4455 7650 4455 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2835 2565 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 4365 R:b\001 -4 1 -1 0 0 0 20 0.0000000 4 210 435 2880 765 I:m\001 -4 0 -1 0 0 0 20 0.0000000 4 270 570 6930 2565 SS:y\001 -4 2 -1 0 0 0 20 0.0000000 4 210 570 1035 2565 SS:u\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1080 4950 2565 INTF:int\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_desc.tex @@ -1,34 +0,0 @@ -% Verbal description for system CruisePN (CruisePN_desc.tex) -% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This is a simple teaching example to illustrate compensator design via -observer/state-feedback methods. The equations are presented in -numerical (as opposed to symbolic) form. - -The system represents a simple model of a vehicle moving along a road. -The vehicle -\begin{itemize} -\item has mass $m$ -\item is driven by a force $u=F$ -\item has velocity $v$ -\item has momentum $p=mv$ -\item has a distance along the road $y=d$ -\item The system states are taken to be: - \begin{equation} - x = - \begin{pmatrix} - p \\ d - \end{pmatrix} - \end{equation}\end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_lbl.txt @@ -1,30 +0,0 @@ -%SUMMARY CruisePN: -%DESCRIPTION -%% Label file for system CruisePN (CruisePN_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type I - m lin flow,m - -% Component type INTF - int lin flow,int - -% Component type R - b lin flow,b - -% Component type SS - u SS external,internal - y SS external,0 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_numpar.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_numpar.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_numpar.txt @@ -1,18 +0,0 @@ -# Numerical parameter file (CruisePN_numpar.txt) -# Generated by MTT at Fri Feb 13 17:15:12 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -b = 1.0; # CruisePN -int = 1.0; # CruisePN -m = 1.0; # CruisePN - -# Initial states -x(1) = 0.0; # CruisePN (m) -x(2) = 0.0; # CruisePN_int (3) DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Inches -1200 2 -1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 3900 3900 309 309 3900 3900 4209 4209 -1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 2700 3900 309 309 2700 3900 3009 4209 -2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 2400 2400 4200 2400 4200 3600 2400 3600 2400 2400 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 4500 2700 5700 2700 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 1200 3000 2400 3000 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3900 1800 2700 1800 -4 0 -1 0 0 3 20 0.0000000 4 270 1380 5700 2400 v (velocity)\001 -4 0 -1 0 0 3 20 0.0000000 4 270 1095 525 2700 u (force)\001 -4 0 -1 0 0 3 20 0.0000000 4 270 1425 5700 3150 y (position)\001 -4 0 -1 0 0 3 20 0.0000000 4 255 1155 2700 3075 m (mass)\001 -4 0 -1 0 0 3 20 0.0000000 4 270 2235 3150 1575 bv (friction force)\001 -4 0 -1 0 0 3 16 0.0000000 4 195 2490 2325 5100 states: p=momentum=mv\001 -4 0 -1 0 0 3 16 0.0000000 4 210 1725 2325 5442 y=position\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_pic.tex @@ -1,7 +0,0 @@ -\makebox[5.541in][l]{ - \vbox to 3.458in{ - \vfill - \special{psfile=CruisePN_pic.ps} - } - \vspace{-\baselineskip} -} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.tex @@ -1,108 +0,0 @@ - - -\section{\textbf{CruisePN}: representation \textbf{abg}, language \textbf{tex}} -\label{sec:CruisePN_abg.tex} -\index{\textbf{CruisePN} -- abg} - - -MTT command: -\begin{verbatim} -mtt CruisePN abg tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_abg.tex} - - -\section{\textbf{CruisePN}: representation \textbf{ode}, language \textbf{tex}} -\label{sec:CruisePN_ode.tex} -\index{\textbf{CruisePN} -- ode} - - -MTT command: -\begin{verbatim} -mtt -o CruisePN ode tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_ode.tex} - - -\section{\textbf{CruisePN}: representation \textbf{sm}, language \textbf{tex}} -\label{sec:CruisePN_sm.tex} -\index{\textbf{CruisePN} -- sm} - - -MTT command: -\begin{verbatim} -mtt -o CruisePN sm tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_sm.tex} - - -\section{\textbf{CruisePN}: representation \textbf{tf}, language \textbf{tex}} -\label{sec:CruisePN_tf.tex} -\index{\textbf{CruisePN} -- tf} - - -MTT command: -\begin{verbatim} -mtt -o CruisePN tf tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_tf.tex} - - -\section{\textbf{CruisePN}: representation \textbf{smc}, language \textbf{tex}} -\label{sec:CruisePN_smc.tex} -\index{\textbf{CruisePN} -- smc} - - -MTT command: -\begin{verbatim} -mtt -o CruisePN smc tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_smc.tex} - - -\section{\textbf{CruisePN}: representation \textbf{ssk}, language \textbf{tex}} -\label{sec:CruisePN_ssk.tex} -\index{\textbf{CruisePN} -- ssk} - - -MTT command: -\begin{verbatim} -mtt -o CruisePN ssk tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_ssk.tex} - - -\section{\textbf{CruisePN}: representation \textbf{smo}, language \textbf{tex}} -\label{sec:CruisePN_smo.tex} -\index{\textbf{CruisePN} -- smo} - - -MTT command: -\begin{verbatim} -mtt -o CruisePN smo tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_smo.tex} - - -\section{\textbf{CruisePN}: representation \textbf{ssl}, language \textbf{tex}} -\label{sec:CruisePN_ssl.tex} -\index{\textbf{CruisePN} -- ssl} - - -MTT command: -\begin{verbatim} -mtt -o CruisePN ssl tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_ssl.tex} - - -\section{\textbf{CruisePN}: representation \textbf{ctf}, language \textbf{tex}} -\label{sec:CruisePN_ctf.tex} -\index{\textbf{CruisePN} -- ctf} - - -MTT command: -\begin{verbatim} -mtt -o CruisePN ctf tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/CruisePN/MTT_work/CruisePN_ctf.tex} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_rep.txt @@ -1,24 +0,0 @@ -# Outline report file for system CruisePN (CruisePN_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt CruisePN abg tex - -mtt -o CruisePN ode tex -mtt -o CruisePN sm tex -mtt -o CruisePN tf tex - -mtt -o CruisePN smc tex -mtt -o CruisePN ssk tex - -mtt -o CruisePN smo tex -mtt -o CruisePN ssl tex - -mtt -o CruisePN ctf tex - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_simp.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_simp.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_simp.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_simp.r @@ -1,21 +0,0 @@ -%% Reduce comands to simplify output for system CruisePN (CruisePN_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -m := 1; -b := 0; - -alpha_o1 := 4; -alpha_o2 := 4; - -alpha_c1 := 2; -alpha_c2 := 1; - -END; - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_sspar.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_sspar.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruisePN_sspar.r @@ -1,10 +0,0 @@ -%% Reduce steady-state parameter file for CruisePN (CruisePN_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruiseP_pic.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruiseP_pic.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruiseP_pic.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/CruiseP_pic.tex @@ -1,7 +0,0 @@ -\makebox[5.541in][l]{ - \vbox to 3.458in{ - \vfill - \special{psfile=CruiseP_pic.ps} - } - \vspace{-\baselineskip} -} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/Makefile Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/Makefile ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/Makefile +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/CruisePN/Makefile @@ -1,18 +0,0 @@ -# -# TransFig makefile -# - -all: CruisePN_pic.tex - -# translation into ps - -CruisePN_pic.tex: CruisePN_pic.ps Makefile - fig2ps2tex CruisePN_pic.ps >CruisePN_pic.tex -clean:: - rm -f CruisePN_pic.tex - -CruisePN_pic.ps: CruisePN_pic.fig Makefile - fig2dev -L ps CruisePN_pic.fig > CruisePN_pic.ps -clean:: - rm -f CruisePN_pic.ps - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_abg.fig @@ -1,40 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 4050 4500 4050 225 1800 225 1800 4500 4050 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1575 2475 2745 2475 2475 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 2250 2925 1080 3150 1350 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3105 2475 4275 2475 4005 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 2700 2925 3870 3150 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 2475 6795 2475 6525 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 2295 6975 1125 7200 1395 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 2700 6975 3870 7200 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7200 2475 8370 2475 8100 2700 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8100 4500 8100 225 5850 225 5850 4500 8100 4500 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 4950 225 4950 225 45 9450 45 9450 4950 -4 1 -1 0 0 0 20 0.0000 4 195 135 2880 2610 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 990 4995 2565 GY:k_m\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 6975 2565 1\001 -4 1 4 0 0 0 20 0.0000 4 240 810 1080 2565 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000 4 255 510 2880 990 I:l_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 600 7065 990 I:j_m\001 -4 1 -1 0 0 0 20 0.0000 4 255 645 2970 4230 R:r_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 765 7020 4230 R:b_m\001 -4 1 1 1 0 0 20 0.0000 4 195 1095 2925 4815 Electrical\001 -4 1 1 1 0 0 20 0.0000 4 195 1335 6975 4815 Mechanical\001 -4 1 1 1 0 0 20 0.0000 4 195 630 8910 2925 Shaft\001 -4 1 1 1 0 0 20 0.0000 4 195 1170 1080 2925 Terminals\001 -4 1 4 0 0 0 20 0.0000 4 240 960 8910 2565 SS:[out]\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_desc.tex @@ -1,37 +0,0 @@ -% Verbal description for system DC (DC_desc.tex) -% Generated by MTT on Thu Sep 11 10:09:58 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{DC} is - displayed in Figure \Ref{DC_abg} and its label - file is listed in Section \Ref{sec:DC_lbl}. - The subsystems are listed in Section \Ref{sec:DC_sub}. - - \begin{table}[htbp] - \begin{center} - \leavevmode - \begin{tabular}{|l|l|} - \hline - Index & Parameter\\ - \hline - 1 & Motor gain ($k_m$) \\ - 2 & Armature inductance ($l_a$) \\ - 3 & Armature resistance ($r_a$) \\ - 4 & Inertia ($j_m$) \\ - 5 & Friction coefficient ($b_m$) \\ - \hline - \end{tabular} - \caption{DC motor parameters} - \label{tab:DC_components} - \end{center} - \end{table} -{\bf DC} is a two-port component representing a DC motor. It has the 5 -parameters listed in Table \Ref{tab:DC_components}. - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DC_lbl.txt @@ -1,44 +0,0 @@ -%SUMMARY DC: DC motor (or generator) -%DESCRIPTION Port [in]: Electrical (in) -%DESCRIPTION Port [out]: Mechanical (out) -%DESCRIPTION Parameter 1: Motor gain (k_m) -%DESCRIPTION Parameter 2: Armature inductance (l_a) -%DESCRIPTION Parameter 3: Armature resistance (r_a) -%DESCRIPTION Parameter 4: Inertia (j_m) -%DESCRIPTION Parameter 5: Friction coefficient (b_m) - - -%% Label file for system DC (DC_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/12/04 16:01:42 peterg -% %% Documantation added. -% %% -% %% Revision 1.1 1996/12/04 16:00:56 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Motor gain -k_m lin flow,$1 - -% Electrical components -%Inductance -l_a lin effort,$2 -%Resistance -r_a lin flow,$3 - -% Mechanical components -%Inertia -j_m lin flow,$4 -%Friction -b_m lin flow,$5 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_abg.fig @@ -1,14 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1125 2475 2475 2475 2250 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 2475 5175 2475 4950 2700 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6075 3150 6075 1800 225 1800 225 3150 6075 3150 -4 1 -1 0 0 0 20 0.0000000 4 210 1230 3195 2565 DC:motor\001 -4 0 -1 0 0 0 20 0.0000000 4 210 570 5310 2565 SS:v\001 -4 2 -1 0 0 0 20 0.0000000 4 210 555 1035 2565 SS:e\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_args.new Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_args.new ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_args.new +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_args.new @@ -1,1 +0,0 @@ - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_desc.tex @@ -1,36 +0,0 @@ -% Verbal description for system DCexample (DCexample_desc.tex) -% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This is a simple teaching example to illustrate compensator design via -observer/state-feedback methods. - -The system represents a simple model of a DC motor including armature -resistance $r_m$, armature inductance $l_m$, motor constant $k_m$, -inertia $j_m$ and friction $b_m$. - -The DC motor has -\begin{itemize} -\item output angular velocity $y = \omega$ -\item input voltage $u = v$ -\item $\lambda = Li$ where $i$ is the armature current -\item angular momentum $p=j_m \omega$. -\item system states given by - \begin{equation} - x = - \begin{pmatrix} - \lambda \\ \omega - \end{pmatrix} - \end{equation} -\end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_lbl.txt @@ -1,24 +0,0 @@ -%SUMMARY DCexample: -%DESCRIPTION -%% Label file for system DCexample (DCexample_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type DC - motor lin k_m;l_m;r_m;j_m;b_m - -% Component type SS - e SS external,internal - v SS 0,external DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_numpar.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_numpar.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_numpar.txt @@ -1,27 +0,0 @@ -# Numerical parameter file (DCexample_numpar.txt) -# Generated by MTT at Mon Jan 12 15:43:19 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -b = 1.0; # Parameter b for DCexample -b_m = 1.0; # Parameter b_m for DCexample -j = 1.0; # Parameter j for DCexample -j_m = 1.0; # Parameter j_m for DCexample -k = 1.0; # Parameter k for DCexample -k_m = 1.0; # Parameter k_m for DCexample -l = 1.0; # Parameter l for DCexample -l_a = 1.0; # Parameter l_a for DCexample -l_m = 1.0; # Parameter l_m for DCexample -r = 1.0; # Parameter r for DCexample -r_a = 1.0; # Parameter r_a for DCexample -r_m = 1.0; # Parameter r_m for DCexample - -# Initial states -x(1) = 0.0; # Initial state for DCexample_motor (l_a) -x(2) = 0.0; # Initial state for DCexample_motor (j_m) DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_params.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_params.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_params.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_params.r @@ -1,11 +0,0 @@ -%% Parameter file for system DCexample (DCexample_params.r) -%% This file provides symbolic parameters for simplification - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.fig @@ -1,32 +0,0 @@ -#FIG 3.1 -Portrait -Center -Inches -1200 2 -6 3900 1725 7575 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 4801 1801 5701 1801 -2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 5701 1726 6601 1726 6601 1876 5701 1876 5701 1726 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 - 1 1 2.00 120.00 240.00 - 6601 1801 7501 1801 7501 2401 -2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 3901 1726 4801 1726 4801 1876 3901 1876 3901 1726 --6 -1 3 0 2 -1 7 0 0 -1 0.0000000 1 0.000 7500 2700 270 270 7500 2700 7650 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3000 1800 3900 1800 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 - 1 1 2.00 120.00 240.00 - 7500 3000 7500 3600 3000 3600 -2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 7950 2625 10800 2625 10800 2775 7950 2775 7950 2625 -2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5 - 10800 1200 11400 1200 11400 4200 10800 4200 10800 1200 -4 0 -1 0 0 3 20 0.0000000 4 150 135 3000 2775 v\001 -4 0 -1 0 0 3 20 0.0000000 4 210 90 3300 1650 i\001 -4 2 -1 0 0 3 20 0.0000000 4 255 540 6675 2775 k_m\001 -4 2 -1 0 0 32 20 0.0000000 4 135 210 6975 2775 w\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_pic.tex @@ -1,7 +0,0 @@ -\makebox[7.055in][l]{ - \vbox to 2.555in{ - \vfill - \special{psfile=DCexample_pic.ps} - } - \vspace{-\baselineskip} -} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.tex @@ -1,84 +0,0 @@ - - -\section{\textbf{DCexample}: representation \textbf{abg}, language \textbf{tex}} -\label{sec:DCexample_abg.tex} -\index{\textbf{DCexample} -- abg} - - -MTT command: -\begin{verbatim} -mtt DCexample abg tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_abg.tex} - - -\section{\textbf{DCexample}: representation \textbf{sm}, language \textbf{tex}} -\label{sec:DCexample_sm.tex} -\index{\textbf{DCexample} -- sm} - - -MTT command: -\begin{verbatim} -mtt -o DCexample sm tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_sm.tex} - - -\section{\textbf{DCexample}: representation \textbf{tf}, language \textbf{tex}} -\label{sec:DCexample_tf.tex} -\index{\textbf{DCexample} -- tf} - - -MTT command: -\begin{verbatim} -mtt -o DCexample tf tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_tf.tex} - - -\section{\textbf{DCexample}: representation \textbf{smc}, language \textbf{tex}} -\label{sec:DCexample_smc.tex} -\index{\textbf{DCexample} -- smc} - - -MTT command: -\begin{verbatim} -mtt -o DCexample smc tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_smc.tex} - - -\section{\textbf{DCexample}: representation \textbf{ssk}, language \textbf{tex}} -\label{sec:DCexample_ssk.tex} -\index{\textbf{DCexample} -- ssk} - - -MTT command: -\begin{verbatim} -mtt -o DCexample ssk tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_ssk.tex} - - -\section{\textbf{DCexample}: representation \textbf{smo}, language \textbf{tex}} -\label{sec:DCexample_smo.tex} -\index{\textbf{DCexample} -- smo} - - -MTT command: -\begin{verbatim} -mtt -o DCexample smo tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_smo.tex} - - -\section{\textbf{DCexample}: representation \textbf{ssl}, language \textbf{tex}} -\label{sec:DCexample_ssl.tex} -\index{\textbf{DCexample} -- ssl} - - -MTT command: -\begin{verbatim} -mtt -o DCexample ssl tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/DCexample/MTT_work/DCexample_ssl.tex} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_rep.txt @@ -1,21 +0,0 @@ -# Outline report file for system DCexample (DCexample_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt DCexample abg tex - -mtt -o DCexample sm tex -mtt -o DCexample tf tex - -mtt -o DCexample smc tex -mtt -o DCexample ssk tex - -mtt -o DCexample smo tex -mtt -o DCexample ssl tex - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_simp.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_simp.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_simp.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_simp.r @@ -1,19 +0,0 @@ -%% Reduce comands to simplify output for system DCexample (DCexample_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% System -%J_m := 1; L_m := 0.1; k_m := 1; b_m := 0.1; r_m := 1; - -% Controller - poles at -2 and -10 -%alpha_c1 := 12; alpha_c2 := 20; - -% Observer - poles at -10 -50 -%alpha_o1 := 60; alpha_o2 := 500; - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_sspar.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_sspar.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/DCexample_sspar.r @@ -1,10 +0,0 @@ -%% Reduce steady-state parameter file for DCexample (DCexample_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/Makefile Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/Makefile ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/Makefile +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/DCexample/Makefile @@ -1,18 +0,0 @@ -# -# TransFig makefile -# - -all: DCexample_pic.tex - -# translation into ps - -DCexample_pic.tex: DCexample_pic.ps Makefile - fig2ps2tex DCexample_pic.ps >DCexample_pic.tex -clean:: - rm -f DCexample_pic.tex - -DCexample_pic.ps: DCexample_pic.fig Makefile - fig2dev -L ps DCexample_pic.fig > DCexample_pic.ps -clean:: - rm -f DCexample_pic.ps - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2880 2655 2970 3195 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2925 2700 2925 3150 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 2700 3150 1350 3375 1575 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3172 3172 3172 4522 3397 4297 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1575 2925 2925 2925 2700 3150 -4 1 0 100 0 18 18 0.0000 4 195 150 3150 3015 0\001 -4 1 0 100 0 18 18 0.0000 4 270 540 3195 1215 I:j_1\001 -4 1 0 100 0 18 18 0.0000 4 270 540 3150 4860 I:j_2\001 -4 1 0 100 0 18 18 0.0000 4 270 750 990 3015 SS:yu\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_rep.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_rep.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Differential/Differential_rep.txt @@ -1,28 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system Differential (Differential_rep.txt) -## Generated by MTT on" Wed Jan 26 10:13:44 GMT 2000. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt Differential abg tex # The system description -mtt Differential cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt Differential struc tex # The system structure -## mtt Differential dae tex # The system dae -mtt Differential ode tex # The system ode -## mtt Differential sspar tex # Steady-state parameters -## mtt Differential ss tex # Steady state -## mtt Differential dm tex # Descriptor matrices (of linearised system) -mtt Differential sm tex # State matrices (of linearised system) -mtt Differential tf tex # Transfer function (of linearised - -## mtt Differential lmfr ps # log modulus of frequency response (of linearised system) -## mtt Differential simpar tex # Simulation parameters -## mtt Differential numpar tex # Numerical simulation parameters -## mtt Differential input tex # Simulation input -mtt Differential odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_abg.fig @@ -1,55 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.0000000 1 0.000 8550 1125 485 485 8550 1125 8730 1575 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 1128 4728 2703 4953 2478 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 7650 450 9405 450 9405 675 7650 675 7650 450 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 8100 9450 225 855 225 855 8100 9450 8100 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3871 3600 5446 3825 5221 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 3871 5850 5446 6075 5221 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3465 3870 3735 3870 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4590 3825 4860 3825 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5715 3870 5985 3870 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3465 1125 3735 1125 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4635 2700 4905 2700 -4 1 -1 0 0 0 20 0.0000000 4 240 870 3603 948 SS:v_x\001 -4 1 4 0 0 0 16 0.0000000 4 195 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000000 4 210 885 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000000 4 195 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 900 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 495 5850 2970 [y_a]\001 -4 1 -1 0 0 0 20 0.0000000 4 270 870 5850 945 SS:v_y\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1110 4729 3379 ROD:rod\001 -4 1 -1 0 0 0 20 0.0000000 4 240 825 3510 5760 SS:f_x\001 -4 1 -1 0 0 0 20 0.0000000 4 270 825 5760 5760 SS:f_y\001 -4 1 -1 0 0 0 20 0.0000000 4 240 810 4635 5760 SS:f_a\001 -4 0 1 1 0 3 20 0.0000000 4 240 720 6750 1260 Joint \001 -4 0 1 1 0 3 20 0.0000000 4 210 495 6795 3375 Rod\001 -4 1 -1 0 0 0 20 0.0000000 4 210 570 4771 946 SS:u\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_desc.tex @@ -1,42 +0,0 @@ -% Verbal description for system InvertedPendulumT (InvertedPendulumT_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/19 14:20:07 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{InvertedPendulumT} is - displayed in Figure \Ref{InvertedPendulumT_abg} and its label - file is listed in Section \Ref{sec:InvertedPendulumT_lbl}. - The subsystems are listed in Section \Ref{sec:InvertedPendulumT_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses the compound components: {\bf ROD}. {\bf -ROD} is essentially as described in Figure 10.2. -There is no gravity included in this model. - -This system has a number of dynamic elements (those corresponding to translation -motion) in derivative causality, thus the system is represnted as a -Differential-Algebraic Equation (Section -\Ref{sec:InvertedPendulumT_dae.tex}). Hovever, this is of contrained-state form and -therfore can be written as a set of constrained-state equations (Section -\Ref{sec:InvertedPendulumT_cse.tex}). The corresponding ordinary differential -equation is complicated due to the trig functions involved in -inverting the E matrix. - -As well as the standard representation the ``robot-form'' equations -appear in Section \Ref{sec:InvertedPendulumT_rfe}. - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_input.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_input.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_input.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_input.txt @@ -1,14 +0,0 @@ -# Numerical parameter file (InvertedPendulumT_input.txt) -# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -u(1) = (t<1.0); -u(2) = 0.0; # -u(3) = 0.0; # gravity DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_lbl.txt @@ -1,43 +0,0 @@ -%SUMMARY InvertedPendulumT: Pendulum with torque input at lower end - -%% Label (InvertedPendulumT_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/12/05 12:39:49 peterg -% %% Documentation -% %% -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - uniform rods -rod none l_1;l_1;j_1;m_1 - -%Zero velocity sources -v_x SS internal,0 -v_y SS internal,0 - - -%Zero force/torque sources -f_x SS 0,internal -f_a SS 0,internal -f_y SS 0,internal - - -%Torque/velocity at joint -u SS external,internal - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_numpar.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_numpar.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_numpar.txt @@ -1,23 +0,0 @@ -# Numerical parameter file (InvertedPendulumT_numpar.txt) -# Generated by MTT at Mon Jan 19 13:53:15 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -j_1 = 1.0; # Parameter j_1 for InvertedPendulumT -j_2 = 1.0; # Parameter j_2 for InvertedPendulumT -l_1 = 1.0; # Parameter l_1 for InvertedPendulumT -l_2 = 1.0; # Parameter l_2 for InvertedPendulumT -m_1 = 1.0; # Parameter m_1 for InvertedPendulumT -m_2 = 1.0; # Parameter m_2 for InvertedPendulumT - -# Initial states -x(1) = 0.0; # Initial state for InvertedPendulumT_rod1 (J) -x(2) = 0.0; # Initial state for InvertedPendulumT_rod1_th (3) -x(3) = 0.0; # Initial state for InvertedPendulumT_rod2 (J) -x(4) = 0.0; # Initial state for InvertedPendulumT_rod2_th (3) DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_rep.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_rep.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_rep.txt @@ -1,22 +0,0 @@ -# Outline report file for system InvertedPendulumT (InvertedPendulumT_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt InvertedPendulumT abg tex - -mtt -o InvertedPendulumT ode tex -mtt -o InvertedPendulumT sm tex -mtt -o InvertedPendulumT tf tex - -mtt -o InvertedPendulumT smc tex -mtt -o InvertedPendulumT ssk tex - -mtt -o InvertedPendulumT smo tex -mtt -o InvertedPendulumT ssl tex - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_simp.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_simp.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_simp.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_simp.r @@ -1,36 +0,0 @@ -%% Reduce comands to simplify output for system InvertedPendulumT (InvertedPendulumT_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - - -m_1 := m; -l_1 := l; -j_1 := j; -mg := m*g; -j := m*l*l/12; - -%l:=1; - -alpha_c1 := 2; -alpha_c2 := 1; - -alpha_o1 := 20; -alpha_o2 := 100; - - -ORDER s,m,g; - - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_sspar.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_sspar.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/InvertedPendulumT_sspar.r @@ -1,13 +0,0 @@ -%% Reduce steady-state parameter file for InvertedPendulumT (InvertedPendulumT_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -MTTx1 := 0; -MTTx2 := 0; - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_abg.fig @@ -1,133 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4951 6526 5401 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 8550 7650 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8685 5265 8415 5535 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1372 3490 1372 3172 3375 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1507 3037 1237 3307 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9180 5724 9180 6042 8544 5406 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 315 6933 5268 I:J\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000000 4 270 735 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000000 4 240 735 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1170 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1170 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000000 4 210 150 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 570 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000000 4 210 990 4681 5266 INTF:th\001 -4 1 1 1 0 0 20 0.0000000 4 210 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000000 4 135 195 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000000 4 210 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000000 4 195 330 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000000 4 240 1065 2971 1216 SS:[x_a]\001 -4 1 4 0 0 0 20 0.0000000 4 240 1080 2971 9361 SS:[x_b]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1065 8372 1217 SS:[y_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1080 8417 9362 SS:[y_b]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1575 5671 1216 SS:[alpha_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1590 5671 9361 SS:[alpha_b]\001 -4 1 1 1 0 0 20 0.0000000 4 270 630 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000000 4 240 1470 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000000 4 270 645 1350 9855 Tip b\001 -4 1 -1 0 0 0 20 0.0000000 4 270 810 9225 6300 SS:mg\001 -4 2 -1 0 0 0 20 0.0000000 4 210 1020 1395 3060 SS:theta\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_desc.tex @@ -1,20 +0,0 @@ -% Verbal description for system ROD (ROD_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/08/15 09:41:19 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ROD} is - displayed in Figure \Ref{ROD_abg} and its label - file is listed in Section \Ref{sec:ROD_lbl}. - The subsystems are listed in Section \Ref{sec:ROD_sub}. - -{\bf ROD} is essentially as described in Figure 10.2 of -``Metamodelling''. DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/InvertedPendulumT/ROD_lbl.txt @@ -1,58 +0,0 @@ -%SUMMARY ROD: rigid rod in two dimensions -%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a -%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b -%DESCRIPTION Port [x_a]: x force/velocity - end a -%DESCRIPTION Port [x_b]: x force/velocity - end b -%DESCRIPTION Port [y_a]: y force/velocity - end a -%DESCRIPTION Port [y_b]: y force/velocity - end b -%DESCRIPTION -%DESCRIPTION Parameter 1: length from end 1 to mass centre -%DESCRIPTION Parameter 2: length from end 2 to mass centre -%DESCRIPTION Parameter 3: inertia about mass centre -%DESCRIPTION Parameter 4: mass -%DESCRIPTION See Section 10.2 of "Metamodelling" - - -%% Label file for system ROD (ROD_lbl.txt) - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,$3 -m_x lin flow,$4 -m_y lin flow,$4 - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,$1 -s2 lsin flow,$2 -c1 lcos flow,$1 -c2 lcos flow,$2 - -%Gravity -mg mg internal - -% Angle -theta external 0 - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_abg.fig @@ -1,20 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1125 2475 2475 2475 2250 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 2475 4500 2475 4275 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5872 2497 7222 2497 6997 2722 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2835 2250 2835 900 3060 1125 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8145 3150 8145 450 270 450 270 3150 8145 3150 -4 1 -1 0 0 0 20 0.0000000 4 210 1080 5265 2565 INTF:int\001 -4 2 -1 0 0 0 20 0.0000000 4 210 570 1035 2565 SS:u\001 -4 0 -1 0 0 0 20 0.0000000 4 270 570 7380 2565 SS:y\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2835 2565 1\001 -4 1 -1 0 0 0 20 0.0000000 4 270 285 2880 765 I:j\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_desc.tex @@ -1,23 +0,0 @@ -% Verbal description for system Satellite (Satellite_desc.tex) -% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Satellite} is - displayed in Figure \Ref{Satellite_abg} and its label - file is listed in Section \Ref{sec:Satellite_lbl}. - The subsystems are listed in Section \Ref{sec:Satellite_sub}. - - -This is a simple teaching example to illustrare compensator design via -observer/state-feedback methods. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_lbl.txt @@ -1,27 +0,0 @@ -%SUMMARY Satellite: -%DESCRIPTION -%% Label file for system Satellite (Satellite_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type I - j lin flow,1 - -% Component type INTF - int - -% Component type SS - u SS external,internal - y SS external,0 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_numpar.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_numpar.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_numpar.txt @@ -1,27 +0,0 @@ -# Numerical parameter file (Satellite_numpar.txt) -# Generated by MTT at Mon Jan 12 15:43:19 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -b = 1.0; # Parameter b for Satellite -b_m = 1.0; # Parameter b_m for Satellite -j = 1.0; # Parameter j for Satellite -j_m = 1.0; # Parameter j_m for Satellite -k = 1.0; # Parameter k for Satellite -k_m = 1.0; # Parameter k_m for Satellite -l = 1.0; # Parameter l for Satellite -l_a = 1.0; # Parameter l_a for Satellite -l_m = 1.0; # Parameter l_m for Satellite -r = 1.0; # Parameter r for Satellite -r_a = 1.0; # Parameter r_a for Satellite -r_m = 1.0; # Parameter r_m for Satellite - -# Initial states -x(1) = 0.0; # Initial state for Satellite_motor (l_a) -x(2) = 0.0; # Initial state for Satellite_motor (j_m) DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_rep.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_rep.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_rep.txt @@ -1,23 +0,0 @@ -# Outline report file for system Satellite (Satellite_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt Satellite abg tex - -mtt -o Satellite ode tex -mtt -o Satellite sm tex -mtt -o Satellite tf tex - -mtt -o Satellite smc tex -mtt -o Satellite ssk tex - -mtt -o Satellite smo tex -mtt -o Satellite ssl tex -mtt -o Satellite ctf tex - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_simp.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_simp.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_simp.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_simp.r @@ -1,20 +0,0 @@ -%% Reduce comands to simplify output for system Satellite (Satellite_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% System - -% Controller - poles -1 -alpha_c1 := 2; alpha_c2 := 1; - -% Observer - poles at -1 -alpha_o1 := 2; alpha_o2 := 1; - -ON FACTOR; - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_sspar.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_sspar.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/Satellite/Satellite_sspar.r @@ -1,10 +0,0 @@ -%% Reduce steady-state parameter file for Satellite (Satellite_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/Makefile Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/Makefile ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/Makefile +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/Makefile @@ -1,18 +0,0 @@ -# -# TransFig makefile -# - -all: TwoTanks_pic.tex - -# translation into ps - -TwoTanks_pic.tex: TwoTanks_pic.ps Makefile - fig2ps2tex TwoTanks_pic.ps >TwoTanks_pic.tex -clean:: - rm -f TwoTanks_pic.tex - -TwoTanks_pic.ps: TwoTanks_pic.fig Makefile - fig2dev -L ps TwoTanks_pic.fig > TwoTanks_pic.ps -clean:: - rm -f TwoTanks_pic.ps - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_abg.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_abg.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_abg.fig @@ -1,51 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1351 4276 2701 4276 2476 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 4501 3826 5401 3601 5401 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2971 4051 3871 3151 3871 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 3150 5625 3150 5400 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 5400 5625 5400 5400 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4051 2925 4051 1575 4276 1800 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 5670 4050 7020 4275 6795 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 2880 5850 1530 6075 1755 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 5670 5850 7020 6075 6795 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 3150 7425 3150 7200 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 5400 7425 5400 7200 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 3150 8775 4050 8505 4050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 5400 8775 4500 8775 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9001 4275 10351 4275 10126 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1350 4050 1350 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9000 4050 9000 4500 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2926 4366 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 4096 5491 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 4096 3241 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5895 3240 1\001 -4 1 -1 0 0 0 20 0.0000000 4 240 690 5895 1440 R:r_1\001 -4 1 -1 0 0 0 20 0.0000000 4 240 720 4050 1440 C:c_1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5850 5490 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 375 7650 3240 AF\001 -4 1 -1 0 0 0 20 0.0000000 4 210 375 7695 5490 AF\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8775 4365 0\001 -4 0 -1 0 0 0 20 0.0000000 4 240 825 10620 4320 SS:f_2\001 -4 2 -1 0 0 0 20 0.0000000 4 240 825 1260 4365 SS:f_1\001 -4 1 -1 0 0 0 20 0.0000000 4 240 720 4005 7335 C:c_2\001 -4 1 -1 0 0 0 20 0.0000000 4 240 690 5850 7335 R:r_2\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_desc.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_desc.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_desc.tex @@ -1,36 +0,0 @@ -% Verbal description for system TwoTanks (TwoTanks_desc.tex) -% Generated by MTT on Mon Jan 12 16:00:15 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This is a simple teaching example to illustrate compensator design via -observer/state-feedback methods. - -\begin{itemize} -\item Each tank is identical and of unit cross section. -\item Each tank has an identical inflow $f_1 = u$ -\item Each outflow is different and given by $\sigma_i v_i$ for $i=1$ - and $i=2$ where $v_i$ is the volume of liquid in tank i and - $\sigma_i$ the corresponding discharge coefficient. The net outflow - is thus $y = f_2 = \sigma_1 v_1 + \sigma_2 v_2$. -\item The system states are taken to be: - \begin{equation} - x = - \begin{pmatrix} - v_1 \\ v_2 - \end{pmatrix} - \end{equation} -\end{itemize} - - - - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_lbl.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_lbl.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_lbl.txt @@ -1,29 +0,0 @@ -%SUMMARY TwoTanks: -%DESCRIPTION -%% Label file for system TwoTanks (TwoTanks_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_1 lin effort,1 - c_2 lin effort,1 - -% Component type R - r_1 lin effort,sigma_1 - r_2 lin effort,sigma_2 - -% Component type SS - f_1 SS internal,external - f_2 SS 0,external DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_params.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_params.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_params.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_params.r @@ -1,11 +0,0 @@ -%% Parameter file for system TwoTanks (TwoTanks_params.r) -%% This file provides symbolic parameters for simplification - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.fig Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.fig ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.fig +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.fig @@ -1,33 +0,0 @@ -#FIG 3.1 -Portrait -Center -Inches -1200 2 -6 2099 1799 3974 3974 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2100 1800 2100 3900 3900 3900 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3300 1800 3300 3600 3900 3600 --6 -6 5025 1800 6900 3975 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6899 1801 6899 3901 5099 3901 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5699 1801 5699 3601 5099 3601 --6 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 3 - 1 1 2.00 120.00 240.00 - 3600 3750 4200 3750 4200 4800 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 3 - 1 1 2.00 120.00 240.00 - 5400 3750 4800 3750 4800 4800 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 3 - 1 1 2.00 120.00 240.00 - 1800 1050 2400 1050 2400 2100 -2 1 1 2 -1 7 0 0 -1 6.000 0 0 -1 1 0 3 - 1 1 2.00 120.00 240.00 - 7200 1050 6600 1050 6600 2100 -4 0 -1 0 0 3 20 0.0000000 4 270 2610 3225 5250 y=total outflow = f_2\001 -4 0 -1 0 0 3 20 0.0000000 4 270 405 1950 900 f_1\001 -4 0 -1 0 0 3 20 0.0000000 4 270 405 6825 900 f_1\001 -4 0 -1 0 0 3 20 0.0000000 4 270 3525 2775 1500 u= inflow to each tank = f_1\001 DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_pic.tex @@ -1,7 +0,0 @@ -\makebox[4.569in][l]{ - \vbox to 3.861in{ - \vfill - \special{psfile=TwoTanks_pic.ps} - } - \vspace{-\baselineskip} -} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.tex Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.tex ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.tex +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.tex @@ -1,84 +0,0 @@ - - -\section{\textbf{TwoTanks}: representation \textbf{abg}, language \textbf{tex}} -\label{sec:TwoTanks_abg.tex} -\index{\textbf{TwoTanks} -- abg} - - -MTT command: -\begin{verbatim} -mtt TwoTanks abg tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_abg.tex} - - -\section{\textbf{TwoTanks}: representation \textbf{sm}, language \textbf{tex}} -\label{sec:TwoTanks_sm.tex} -\index{\textbf{TwoTanks} -- sm} - - -MTT command: -\begin{verbatim} -mtt -o TwoTanks sm tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_sm.tex} - - -\section{\textbf{TwoTanks}: representation \textbf{tf}, language \textbf{tex}} -\label{sec:TwoTanks_tf.tex} -\index{\textbf{TwoTanks} -- tf} - - -MTT command: -\begin{verbatim} -mtt -o TwoTanks tf tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_tf.tex} - - -\section{\textbf{TwoTanks}: representation \textbf{smc}, language \textbf{tex}} -\label{sec:TwoTanks_smc.tex} -\index{\textbf{TwoTanks} -- smc} - - -MTT command: -\begin{verbatim} -mtt -o TwoTanks smc tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_smc.tex} - - -\section{\textbf{TwoTanks}: representation \textbf{ssk}, language \textbf{tex}} -\label{sec:TwoTanks_ssk.tex} -\index{\textbf{TwoTanks} -- ssk} - - -MTT command: -\begin{verbatim} -mtt -o TwoTanks ssk tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_ssk.tex} - - -\section{\textbf{TwoTanks}: representation \textbf{smo}, language \textbf{tex}} -\label{sec:TwoTanks_smo.tex} -\index{\textbf{TwoTanks} -- smo} - - -MTT command: -\begin{verbatim} -mtt -o TwoTanks smo tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_smo.tex} - - -\section{\textbf{TwoTanks}: representation \textbf{ssl}, language \textbf{tex}} -\label{sec:TwoTanks_ssl.tex} -\index{\textbf{TwoTanks} -- ssl} - - -MTT command: -\begin{verbatim} -mtt -o TwoTanks ssl tex -\end{verbatim} - \input{/home/peterg/Research/Modelling/Control/StateSpace/TwoTanks/MTT_work/TwoTanks_ssl.tex} DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.txt Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.txt +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_rep.txt @@ -1,21 +0,0 @@ -# Outline report file for system TwoTanks (TwoTanks_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt TwoTanks abg tex - -mtt -o TwoTanks sm tex -mtt -o TwoTanks tf tex - -mtt -o TwoTanks smc tex -mtt -o TwoTanks ssk tex - -mtt -o TwoTanks smo tex -mtt -o TwoTanks ssl tex - - DELETED mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_simp.r Index: mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_simp.r ================================================================== --- mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_simp.r +++ mttroot/mtt/lib/examples/Control/SimpleStateSpace/TwoTanks/TwoTanks_simp.r @@ -1,10 +0,0 @@ -%% Reduce comands to simplify output for system TwoTanks (TwoTanks_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_abg.dia Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_abg.dia +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_abg.dia @@ -1,1864 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Rigid 2-dimensional bar# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[left_bottom]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[left_top]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[right_bottom]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[right_top]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #TF:a# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #TF:b# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #I:translational# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #I:rotational# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Se:weight# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_lbl.txt Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_lbl.txt +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/RigidBar2D_lbl.txt @@ -1,57 +0,0 @@ -#SUMMARY RigidBar2D -#DESCRIPTION A rigid bar capable of motion in two directions: -#DESCRIPTION vertical translation and rotation about its centre of gravity. -#DESCRIPTION Parameters "a" and "b" are moment arms, -#DESCRIPTION "m" is the bar's mass and "J" is a moment of inertia. - -## System RigidBar2D, representation lbl, language txt -## File RigidBar2D_lbl.txt -## Generated by MTT on Thu Aug 12 21:04:24 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases -#ALIAS in left_bottom,right_bottom -#ALIAS out left_top,right_top - -## Argument aliases -#ALIAS $1 length_a -#ALIAS $2 length_b -#ALIAS $3 inertial_mass -#ALIAS $4 moment_of_inertia - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type SS - [left_bottom] SS external,external - [left_top] SS external,external - [right_bottom] SS external,external - [right_top] SS external,external - -## Component type Se - weight SS inertial_mass*gravity - -## Component type I - rotational lin flow,moment_of_inertia - translational lin flow,inertial_mass - -## Component type TF - a lin flow,length_a - b lin flow,length_b - -## Component type 0 (anonymous => default parameters) - # 0 - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - # 1 - # 1 - # 1 DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_abg.dia Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_abg.dia +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_abg.dia @@ -1,3160 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #A stack of supported bars# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SupportedBar:bottom# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SupportedBar:top# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SupportedBar:middle*3# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[left_top,right_top]# - - - #[left_bottom,right_bottom]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Sf:ground_left# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Sf:ground_right# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[right_bottom]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:load_left# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:load_right# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[left_top]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[right_top]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[left_bottom]# - - - - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_input.txt Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_input.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_input.txt +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_input.txt @@ -1,13 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System StackOfSupportedBars, representation input, language txt; -## File StackOfSupportedBars_input.txt; -## Generated by MTT on Fri Aug 13 02:22:37 BST 2004; - - - -StackOfSupportedBars__ground_left__u = 0.0; # vertical velocity -StackOfSupportedBars__ground_right__u = 0.0; # vertical velocity -StackOfSupportedBars__load_left = 10.0 * (mttt > 5); # vertical load -StackOfSupportedBars__load_right = 0.0; # vertical load DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_lbl.txt Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_lbl.txt +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_lbl.txt @@ -1,43 +0,0 @@ -#SUMMARY StackOfSupportedBars -#DESCRIPTION A stack of rigid 2D bars supported by spring-dampers. -#DESCRIPTION The model demonstrates hierarchical modelling in dia -#DESCRIPTION including vector ports, repeated components and -#DESCRIPTION aliasing of parameters and ports. - -## System StackOfSupportedBars, representation lbl, language txt -## File StackOfSupportedBars_lbl.txt -## Generated by MTT on Thu Aug 12 21:27:46 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases - -## Argument aliases - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type SS - load_left SS external,external - load_right SS external,external - -## Component type Sf - ground_left SS external - ground_right SS external - -## Component type SupportedBar - bottom none a;b;m_b;J_b;R_d;K_s - middle none a;b;m_b;J_b;R_d;K_s - top none a;b;m_b;J_b;R_d;K_s - -## Component type 1 (anonymous => default parameters) - # 1 - # 1 - - DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_numpar.txt Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_numpar.txt +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/StackOfSupportedBars_numpar.txt @@ -1,16 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System StackOfSupportedBars, representation numpar, language txt; -## File StackOfSupportedBars_numpar.txt; -## Generated by MTT on Fri Aug 13 02:22:33 BST 2004; - - - -J_b = 3.0e-3; # bar's moment of inertia -K_s = 1.0e3; # spring's stiffness -R_d = 1.0; # damper's resistance -a = 0.5; # bar's half-length -b = 0.5; # bar's half-length -gravity = 9,81; # gravitational acceleration -m_b = 5.0; # bar's mass DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_abg.dia Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_abg.dia +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_abg.dia @@ -1,1291 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Support# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[in]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[out]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #C:spring# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #R:damper# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_lbl.txt Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_lbl.txt +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/Support_lbl.txt @@ -1,42 +0,0 @@ -#SUMMARY Support -#DESCRIPTION Spring-damper support - -## System Support, representation lbl, language txt -## File Support_lbl.txt -## Generated by MTT on Thu Aug 12 21:14:12 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases - -## Argument aliases -#ALIAS $1 resistance -#ALIAS $2 stiffness - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type SS - [in] SS external,external - [out] SS external,external - -## Component type C - spring lin effort,1/stiffness - -## Component type R - damper lin flow,resistance - -## Component type 1 (anonymous => default parameters) - # 1 - # 1 - -## Component type 0 (anonymous => default parameters) - # 0 - # 0 - DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_abg.dia Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_abg.dia +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_abg.dia @@ -1,1513 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Supported bar# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #RigidBar2D:bar# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Support:left# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Support:right# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[left_bottom]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[left_top]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[right_bottom]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[right_top]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[left_bottom]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[left_top]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[right_bottom]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[right_top]# - - - - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_lbl.txt Index: mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_lbl.txt +++ mttroot/mtt/lib/examples/Dia/Mechanical-2D/StackOfSupportedBars/SupportedBar_lbl.txt @@ -1,43 +0,0 @@ -#SUMMARY SupportedBar -#DESCRIPTION Rigid 2D bar with two spring-damper supports. - -## System SupportedBar, representation lbl, language txt -## File SupportedBar_lbl.txt -## Generated by MTT on Thu Aug 12 21:17:30 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases -#ALIAS in left_bottom,right_bottom -#ALIAS out left_top,right_top - -## Argument aliases -#ALIAS $1 length_a -#ALIAS $2 length_b -#ALIAS $3 inertial_mass -#ALIAS $4 moment_of_inertia -#ALIAS $5 resistance -#ALIAS $6 stiffness - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type SS - [left_bottom] SS external,external - [left_top] SS external,external - [right_bottom] SS external,external - [right_top] SS external,external - -## Component type RigidBar2D - bar none length_a;length_b;inertial_mass;moment_of_inertia - -## Component type Support - left none resistance;stiffness - right none resistance;stiffness - DELETED mttroot/mtt/lib/examples/Dia/doubleOscillator/diaOscillator_abg.dia Index: mttroot/mtt/lib/examples/Dia/doubleOscillator/diaOscillator_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/doubleOscillator/diaOscillator_abg.dia +++ mttroot/mtt/lib/examples/Dia/doubleOscillator/diaOscillator_abg.dia @@ -1,752 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[in]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #I:inductance# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #R:resistance# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #C:capacitance# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[out]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/doubleOscillator/diaOscillator_lbl.txt Index: mttroot/mtt/lib/examples/Dia/doubleOscillator/diaOscillator_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/doubleOscillator/diaOscillator_lbl.txt +++ mttroot/mtt/lib/examples/Dia/doubleOscillator/diaOscillator_lbl.txt @@ -1,48 +0,0 @@ -#SUMMARY diaOscillator -#DESCRIPTION Detailed description here - -## System diaOscillator, representation lbl, language txt -## File diaOscillator_lbl.txt -## Generated by MTT on Thu Aug 5 00:44:20 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases -#ALIAS in in -#ALIAS out out - -## Argument aliases -#ALIAS $1 capacitance -#ALIAS $2 inductance -#ALIAS $3 resistance - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type C - capacitance lin effort,capacitance - -## Component type SS - [in] SS external,external - -## Component type I - inductance lin flow,inductance - -## Component type 0 (anonymous => default parameters) - # 0 - -## Component type R - resistance lin flow,resistance - -## Component type SS - [out] SS external,external - DELETED mttroot/mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_abg.dia Index: mttroot/mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_abg.dia +++ mttroot/mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_abg.dia @@ -1,440 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:in# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #diaOscillator:do# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #xfigOscillator:xo# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:out# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_lbl.txt Index: mttroot/mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_lbl.txt +++ mttroot/mtt/lib/examples/Dia/doubleOscillator/doubleOscillator_lbl.txt @@ -1,37 +0,0 @@ -#SUMMARY doubleOscillator -#DESCRIPTION Detailed description here - -## System doubleOscillator, representation lbl, language txt -## File doubleOscillator_lbl.txt -## Generated by MTT on Thu Aug 5 00:44:56 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases - -## Argument aliases -#ALIAS $1 capacitance -#ALIAS $2 inductance -#ALIAS $3 resistance - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type diaOscillator - do lin C_d;L_d;R_d - -## Component type SS - in SS external,external - -## Component type xfigOscillator - xo lin C_x;L_x;R_x - -## Component type SS - out SS external,external - DELETED mttroot/mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_abg.fig Index: mttroot/mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_abg.fig +++ mttroot/mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_abg.fig @@ -1,54 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5-alpha5 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 720 3105 1620 3420 -4 2 4 100 0 18 18 0.0000 4 270 900 1620 3330 SS:[in]\001 --6 -6 1800 3150 3240 3465 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1845 3195 3195 3195 2970 3420 --6 -6 3420 1530 3780 2970 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3465 2925 3465 1575 3690 1800 --6 -6 3150 3510 3510 4950 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3465 3555 3465 4905 3240 4680 --6 -6 3780 3150 5220 3465 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 3195 5175 3195 4950 3420 --6 -6 3420 3105 3600 3330 -4 1 0 100 0 18 18 0.0000 4 195 150 3510 3330 1\001 --6 -6 5310 3015 5490 3240 -4 1 0 100 0 18 18 0.0000 4 195 150 5400 3240 0\001 --6 -6 5400 1440 5760 2880 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5445 2835 5445 1485 5670 1710 --6 -6 5670 3150 7110 3465 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 5715 3195 7065 3195 6840 3420 --6 -6 7245 3105 8370 3420 -4 0 4 100 0 18 18 0.0000 4 270 1095 7245 3330 SS:[out]\001 --6 -6 2970 990 4050 1260 -4 1 0 100 0 18 18 0.0000 4 210 1005 3510 1260 I:inductance\001 --6 -6 4410 990 6480 1350 -4 1 0 100 0 18 18 0.0000 4 270 1965 5445 1260 C:capacitance\001 --6 -6 2610 5040 4410 5310 -4 1 0 100 0 18 18 0.0000 4 210 1725 3510 5310 R:resistance\001 --6 DELETED mttroot/mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_lbl.txt Index: mttroot/mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_lbl.txt +++ mttroot/mtt/lib/examples/Dia/doubleOscillator/xfigOscillator_lbl.txt @@ -1,46 +0,0 @@ -#SUMMARY xfigOscillator -#DESCRIPTION Detailed description here - -## System xfigOscillator, representation lbl, language txt -## File xfigOscillator_lbl.txt -## Generated by MTT on Thu Aug 5 00:41:52 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases -#ALIAS in in -#ALIAS out out - -## Argument aliases -#ALIAS $1 capacitance -#ALIAS $2 inductance -#ALIAS $3 resistance - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - -## Component type 1 (anonymous => default parameters) - # 1 - -## Component type C - capacitance lin effort,capacitance - -## Component type I - inductance lin flow,inductance - -## Component type R - resistance lin flow,resistance - -## Component type SS - [in] SS external,external - [out] SS external,external - DELETED mttroot/mtt/lib/examples/Dia/robotrain/make_trajectory.sh Index: mttroot/mtt/lib/examples/Dia/robotrain/make_trajectory.sh ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/make_trajectory.sh +++ mttroot/mtt/lib/examples/Dia/robotrain/make_trajectory.sh @@ -1,21 +0,0 @@ -#! /bin/sh -mtt -cc -no-reduce robotrain odeso ps -cd MTT_work -#set data style lines -cat < - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Train of passive off-hooked trailers pulled by a tractor# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #tractor:tractor# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #trailer:front# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #trailer:rear# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #trailer:middle# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:Fx# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:Fy# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[x2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[y2]# - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/robotrain/robotrain_abg.ps Index: mttroot/mtt/lib/examples/Dia/robotrain/robotrain_abg.ps ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/robotrain_abg.ps +++ mttroot/mtt/lib/examples/Dia/robotrain/robotrain_abg.ps @@ -1,892 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: robotrain_abg.dia -%%Creator: Dia v0.94 -%%CreationDate: Tue Sep 14 20:01:52 2004 -%%For: geraint -%%Orientation: Portrait -%%Magnification: 1.0000 -%%BoundingBox: 0 0 4402 1118 -%%BeginSetup -%%EndSetup -%%EndComments -%%BeginProlog -[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright -/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one -/two /three /four /five /six /seven /eight /nine /colon /semicolon -/less /equal /greater /question /at /A /B /C /D /E -/F /G /H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W /X /Y -/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c -/d /e /f /g /h /i /j /k /l /m -/n /o /p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright -/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior -/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf -/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde -/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex -/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring -/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave -/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def -/cp {closepath} bind def -/c {curveto} bind def -/f {fill} bind def -/a {arc} bind def -/ef {eofill} bind def -/ex {exch} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth pop} bind def -/tr {translate} bind def - -/ellipsedict 8 dict def -ellipsedict /mtrx matrix put -/ellipse -{ ellipsedict begin - /endangle exch def - /startangle exch def - /yrad exch def - /xrad exch def - /y exch def - /x exch def /savematrix mtrx currentmatrix def - x y tr xrad yrad sc - 0 0 1 startangle endangle arc - savematrix setmatrix - end -} def - -/mergeprocs { -dup length -3 -1 roll -dup -length -dup -5 1 roll -3 -1 roll -add -array cvx -dup -3 -1 roll -0 exch -putinterval -dup -4 2 roll -putinterval -} bind def -/Times-Roman-latin1 - /Times-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-Italic-latin1 - /Times-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-Bold-latin1 - /Times-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-BoldItalic-latin1 - /Times-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-Book-latin1 - /AvantGarde-Book findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-BookOblique-latin1 - /AvantGarde-BookOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-Demi-latin1 - /AvantGarde-Demi findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-DemiOblique-latin1 - /AvantGarde-DemiOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-Light-latin1 - /Bookman-Light findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-LightItalic-latin1 - /Bookman-LightItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-Demi-latin1 - /Bookman-Demi findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-DemiItalic-latin1 - /Bookman-DemiItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-latin1 - /Courier findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-Oblique-latin1 - /Courier-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-Bold-latin1 - /Courier-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-BoldOblique-latin1 - /Courier-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-latin1 - /Helvetica findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Oblique-latin1 - /Helvetica-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Bold-latin1 - /Helvetica-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-BoldOblique-latin1 - /Helvetica-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-latin1 - /Helvetica-Narrow findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-Oblique-latin1 - /Helvetica-Narrow-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-Bold-latin1 - /Helvetica-Narrow-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-BoldOblique-latin1 - /Helvetica-Narrow-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Roman-latin1 - /NewCenturySchoolbook-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Italic-latin1 - /NewCenturySchoolbook-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Bold-latin1 - /NewCenturySchoolbook-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-BoldItalic-latin1 - /NewCenturySchoolbook-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Roman-latin1 - /Palatino-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Italic-latin1 - /Palatino-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Bold-latin1 - /Palatino-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-BoldItalic-latin1 - /Palatino-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Symbol-latin1 - /Symbol findfont -definefont pop -/ZapfChancery-MediumItalic-latin1 - /ZapfChancery-MediumItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/ZapfDingbats-latin1 - /ZapfDingbats findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -28.346000 -28.346000 scale -38.883800 -42.978407 translate -%%EndProlog - - -0.749020 0.749020 0.749020 srgb -n -19.463800 25.034300 m -19.463800 25.934300 l -15.763800 25.934300 l -15.763800 25.034300 l f -n -19.463800 25.034300 m -19.463800 25.034300 0.000000 0.000000 180.000000 270.000000 ellipse f -n -15.763800 25.034300 m -15.763800 25.034300 0.000000 0.000000 270.000000 360.000000 ellipse f -n -19.463800 25.034300 m -19.463800 25.934300 l -15.763800 25.934300 l -15.763800 25.034300 l f -n -19.463800 25.934300 m -19.463800 25.934300 0.000000 0.000000 90.000000 180.000000 ellipse f -n -15.763800 25.934300 m -15.763800 25.934300 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n -19.463800 25.034300 m -15.763800 25.034300 l s -n -19.463800 25.934300 m -15.763800 25.934300 l s -n -19.463800 25.034300 0.000000 0.000000 180.000000 270.000000 ellipse s -n -15.763800 25.034300 0.000000 0.000000 270.000000 360.000000 ellipse s -n -19.463800 25.034300 m -19.463800 25.934300 l s -n -15.763800 25.034300 m -15.763800 25.934300 l s -n -19.463800 25.934300 0.000000 0.000000 90.000000 180.000000 ellipse s -n -15.763800 25.934300 0.000000 0.000000 0.000000 90.000000 ellipse s -n -19.533800 9.069260 m -19.533800 9.969260 l -15.833800 9.969260 l -15.833800 9.069260 l f -n -19.533800 9.069260 m -19.533800 9.069260 0.000000 0.000000 180.000000 270.000000 ellipse f -n -15.833800 9.069260 m -15.833800 9.069260 0.000000 0.000000 270.000000 360.000000 ellipse f -n -19.533800 9.069260 m -19.533800 9.969260 l -15.833800 9.969260 l -15.833800 9.069260 l f -n -19.533800 9.969260 m -19.533800 9.969260 0.000000 0.000000 90.000000 180.000000 ellipse f -n -15.833800 9.969260 m -15.833800 9.969260 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n -19.533800 9.069260 m -15.833800 9.069260 l s -n -19.533800 9.969260 m -15.833800 9.969260 l s -n -19.533800 9.069260 0.000000 0.000000 180.000000 270.000000 ellipse s -n -15.833800 9.069260 0.000000 0.000000 270.000000 360.000000 ellipse s -n -19.533800 9.069260 m -19.533800 9.969260 l s -n -15.833800 9.069260 m -15.833800 9.969260 l s -n -19.533800 9.969260 0.000000 0.000000 90.000000 180.000000 ellipse s -n -15.833800 9.969260 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n -25.513800 10.034300 m -25.513800 24.984300 l -9.713800 24.984300 l -9.713800 10.034300 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n -25.513800 10.034300 m -25.513800 24.984300 l -9.713800 24.984300 l -9.713800 10.034300 l cp s -0.749020 0.749020 0.749020 srgb -n -23.613800 7.184260 m -23.613800 9.034260 l -11.613800 9.034260 l -11.613800 7.184260 l f -n -23.613800 7.184260 m -23.613800 7.184260 0.000000 0.000000 180.000000 270.000000 ellipse f -n -11.613800 7.184260 m -11.613800 7.184260 0.000000 0.000000 270.000000 360.000000 ellipse f -n -23.613800 7.184260 m -23.613800 9.034260 l -11.613800 9.034260 l -11.613800 7.184260 l f -n -23.613800 9.034260 m -23.613800 9.034260 0.000000 0.000000 90.000000 180.000000 ellipse f -n -11.613800 9.034260 m -11.613800 9.034260 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n -23.613800 7.184260 m -11.613800 7.184260 l s -n -23.613800 9.034260 m -11.613800 9.034260 l s -n -23.613800 7.184260 0.000000 0.000000 180.000000 270.000000 ellipse s -n -11.613800 7.184260 0.000000 0.000000 270.000000 360.000000 ellipse s -n -23.613800 7.184260 m -23.613800 9.034260 l s -n -11.613800 7.184260 m -11.613800 9.034260 l s -n -23.613800 9.034260 0.000000 0.000000 90.000000 180.000000 ellipse s -n -11.613800 9.034260 0.000000 0.000000 0.000000 90.000000 ellipse s -0.749020 0.749020 0.749020 srgb -n -23.613100 25.948600 m -23.613100 27.798600 l -11.613100 27.798600 l -11.613100 25.948600 l f -n -23.613100 25.948600 m -23.613100 25.948600 0.000000 0.000000 180.000000 270.000000 ellipse f -n -11.613100 25.948600 m -11.613100 25.948600 0.000000 0.000000 270.000000 360.000000 ellipse f -n -23.613100 25.948600 m -23.613100 27.798600 l -11.613100 27.798600 l -11.613100 25.948600 l f -n -23.613100 27.798600 m -23.613100 27.798600 0.000000 0.000000 90.000000 180.000000 ellipse f -n -11.613100 27.798600 m -11.613100 27.798600 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n -23.613100 25.948600 m -11.613100 25.948600 l s -n -23.613100 27.798600 m -11.613100 27.798600 l s -n -23.613100 25.948600 0.000000 0.000000 180.000000 270.000000 ellipse s -n -11.613100 25.948600 0.000000 0.000000 270.000000 360.000000 ellipse s -n -23.613100 25.948600 m -23.613100 27.798600 l s -n -11.613100 25.948600 m -11.613100 27.798600 l s -n -23.613100 27.798600 0.000000 0.000000 90.000000 180.000000 ellipse s -n -11.613100 27.798600 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n -9.713830 16.034300 m -9.713830 17.934300 l 3.586170 17.934300 l 3.586170 16.034300 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n -9.713830 16.034300 m -9.713830 17.934300 l 3.586170 17.934300 l 3.586170 16.034300 l cp s -1.000000 1.000000 1.000000 srgb -n -38.833800 16.119300 m -38.833800 18.019300 l -25.533800 18.019300 l -25.533800 16.119300 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n -38.833800 16.119300 m -38.833800 18.019300 l -25.533800 18.019300 l -25.533800 16.119300 l cp s -1.000000 1.000000 1.000000 srgb -n 2.486170 16.984300 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 2.486170 16.984300 0.500000 0.500000 0 360 ellipse cp s -1.000000 1.000000 1.000000 srgb -n -37.813800 17.084300 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n -37.813800 17.084300 0.500000 0.500000 0 360 ellipse cp s -/Helvetica-latin1 ff 1.400000 scf sf -(Train of passive off-hooked trailers pulled by a tractor) -38.601000 4.963450 m gs 1 -1 sc sh gr -0.749020 0.749020 0.749020 srgb -n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f -n 21.150000 25.000000 m 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 24.850000 25.000000 m 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f -n 21.150000 25.900000 m 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 24.850000 25.900000 m 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 21.150000 25.000000 m 24.850000 25.000000 l s -n 21.150000 25.900000 m 24.850000 25.900000 l s -n 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 21.150000 25.000000 m 21.150000 25.900000 l s -n 24.850000 25.000000 m 24.850000 25.900000 l s -n 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse s -n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f -n 21.080000 9.035000 m 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 24.780000 9.035000 m 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f -n 21.080000 9.935000 m 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 24.780000 9.935000 m 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 21.080000 9.035000 m 24.780000 9.035000 l s -n 21.080000 9.935000 m 24.780000 9.935000 l s -n 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 21.080000 9.035000 m 21.080000 9.935000 l s -n 24.780000 9.035000 m 24.780000 9.935000 l s -n 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l cp s -0.749020 0.749020 0.749020 srgb -n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f -n 17.000000 7.150000 m 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 29.000000 7.150000 m 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f -n 17.000000 9.000000 m 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 29.000000 9.000000 m 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 17.000000 7.150000 m 29.000000 7.150000 l s -n 17.000000 9.000000 m 29.000000 9.000000 l s -n 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 17.000000 7.150000 m 17.000000 9.000000 l s -n 29.000000 7.150000 m 29.000000 9.000000 l s -n 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse s -0.749020 0.749020 0.749020 srgb -n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f -n 17.000700 25.914300 m 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse f -n 29.000700 25.914300 m 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse f -n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f -n 17.000700 27.764300 m 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse f -n 29.000700 27.764300 m 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 17.000700 25.914300 m 29.000700 25.914300 l s -n 17.000700 27.764300 m 29.000700 27.764300 l s -n 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse s -n 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse s -n 17.000700 25.914300 m 17.000700 27.764300 l s -n 29.000700 25.914300 m 29.000700 27.764300 l s -n 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse s -n 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 30.900000 16.000000 m 30.900000 17.900000 l 44.200000 17.900000 l 44.200000 16.000000 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 30.900000 16.000000 m 30.900000 17.900000 l 44.200000 17.900000 l 44.200000 16.000000 l cp s -1.000000 1.000000 1.000000 srgb -n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l cp s -1.000000 1.000000 1.000000 srgb -n 43.100000 16.950000 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 43.100000 16.950000 0.500000 0.500000 0 360 ellipse cp s -1.000000 1.000000 1.000000 srgb -n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse cp s -0.749020 0.749020 0.749020 srgb -n 61.854300 24.963600 m 61.854300 25.863600 l 65.554300 25.863600 l 65.554300 24.963600 l f -n 61.854300 24.963600 m 61.854300 24.963600 0.000000 0.000000 180.000000 270.000000 ellipse f -n 65.554300 24.963600 m 65.554300 24.963600 0.000000 0.000000 270.000000 360.000000 ellipse f -n 61.854300 24.963600 m 61.854300 25.863600 l 65.554300 25.863600 l 65.554300 24.963600 l f -n 61.854300 25.863600 m 61.854300 25.863600 0.000000 0.000000 90.000000 180.000000 ellipse f -n 65.554300 25.863600 m 65.554300 25.863600 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 61.854300 24.963600 m 65.554300 24.963600 l s -n 61.854300 25.863600 m 65.554300 25.863600 l s -n 61.854300 24.963600 0.000000 0.000000 180.000000 270.000000 ellipse s -n 65.554300 24.963600 0.000000 0.000000 270.000000 360.000000 ellipse s -n 61.854300 24.963600 m 61.854300 25.863600 l s -n 65.554300 24.963600 m 65.554300 25.863600 l s -n 61.854300 25.863600 0.000000 0.000000 90.000000 180.000000 ellipse s -n 65.554300 25.863600 0.000000 0.000000 0.000000 90.000000 ellipse s -n 61.784300 8.998550 m 61.784300 9.898550 l 65.484300 9.898550 l 65.484300 8.998550 l f -n 61.784300 8.998550 m 61.784300 8.998550 0.000000 0.000000 180.000000 270.000000 ellipse f -n 65.484300 8.998550 m 65.484300 8.998550 0.000000 0.000000 270.000000 360.000000 ellipse f -n 61.784300 8.998550 m 61.784300 9.898550 l 65.484300 9.898550 l 65.484300 8.998550 l f -n 61.784300 9.898550 m 61.784300 9.898550 0.000000 0.000000 90.000000 180.000000 ellipse f -n 65.484300 9.898550 m 65.484300 9.898550 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 61.784300 8.998550 m 65.484300 8.998550 l s -n 61.784300 9.898550 m 65.484300 9.898550 l s -n 61.784300 8.998550 0.000000 0.000000 180.000000 270.000000 ellipse s -n 65.484300 8.998550 0.000000 0.000000 270.000000 360.000000 ellipse s -n 61.784300 8.998550 m 61.784300 9.898550 l s -n 65.484300 8.998550 m 65.484300 9.898550 l s -n 61.784300 9.898550 0.000000 0.000000 90.000000 180.000000 ellipse s -n 65.484300 9.898550 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 55.804300 9.963550 m 55.804300 24.913550 l 71.604300 24.913550 l 71.604300 9.963550 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 55.804300 9.963550 m 55.804300 24.913550 l 71.604300 24.913550 l 71.604300 9.963550 l cp s -0.749020 0.749020 0.749020 srgb -n 57.704300 7.113550 m 57.704300 8.963550 l 69.704300 8.963550 l 69.704300 7.113550 l f -n 57.704300 7.113550 m 57.704300 7.113550 0.000000 0.000000 180.000000 270.000000 ellipse f -n 69.704300 7.113550 m 69.704300 7.113550 0.000000 0.000000 270.000000 360.000000 ellipse f -n 57.704300 7.113550 m 57.704300 8.963550 l 69.704300 8.963550 l 69.704300 7.113550 l f -n 57.704300 8.963550 m 57.704300 8.963550 0.000000 0.000000 90.000000 180.000000 ellipse f -n 69.704300 8.963550 m 69.704300 8.963550 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 57.704300 7.113550 m 69.704300 7.113550 l s -n 57.704300 8.963550 m 69.704300 8.963550 l s -n 57.704300 7.113550 0.000000 0.000000 180.000000 270.000000 ellipse s -n 69.704300 7.113550 0.000000 0.000000 270.000000 360.000000 ellipse s -n 57.704300 7.113550 m 57.704300 8.963550 l s -n 69.704300 7.113550 m 69.704300 8.963550 l s -n 57.704300 8.963550 0.000000 0.000000 90.000000 180.000000 ellipse s -n 69.704300 8.963550 0.000000 0.000000 0.000000 90.000000 ellipse s -0.749020 0.749020 0.749020 srgb -n 57.705000 25.877900 m 57.705000 27.727900 l 69.705000 27.727900 l 69.705000 25.877900 l f -n 57.705000 25.877900 m 57.705000 25.877900 0.000000 0.000000 180.000000 270.000000 ellipse f -n 69.705000 25.877900 m 69.705000 25.877900 0.000000 0.000000 270.000000 360.000000 ellipse f -n 57.705000 25.877900 m 57.705000 27.727900 l 69.705000 27.727900 l 69.705000 25.877900 l f -n 57.705000 27.727900 m 57.705000 27.727900 0.000000 0.000000 90.000000 180.000000 ellipse f -n 69.705000 27.727900 m 69.705000 27.727900 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 57.705000 25.877900 m 69.705000 25.877900 l s -n 57.705000 27.727900 m 69.705000 27.727900 l s -n 57.705000 25.877900 0.000000 0.000000 180.000000 270.000000 ellipse s -n 69.705000 25.877900 0.000000 0.000000 270.000000 360.000000 ellipse s -n 57.705000 25.877900 m 57.705000 27.727900 l s -n 69.705000 25.877900 m 69.705000 27.727900 l s -n 57.705000 27.727900 0.000000 0.000000 90.000000 180.000000 ellipse s -n 69.705000 27.727900 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 71.604300 15.963600 m 71.604300 17.863600 l 84.904300 17.863600 l 84.904300 15.963600 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 71.604300 15.963600 m 71.604300 17.863600 l 84.904300 17.863600 l 84.904300 15.963600 l cp s -1.000000 1.000000 1.000000 srgb -n 42.484300 16.048600 m 42.484300 17.948600 l 55.784300 17.948600 l 55.784300 16.048600 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 42.484300 16.048600 m 42.484300 17.948600 l 55.784300 17.948600 l 55.784300 16.048600 l cp s -1.000000 1.000000 1.000000 srgb -n 83.804300 16.913600 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 83.804300 16.913600 0.500000 0.500000 0 360 ellipse cp s -1.000000 1.000000 1.000000 srgb -n 43.504300 17.013600 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 43.504300 17.013600 0.500000 0.500000 0 360 ellipse cp s -0.749020 0.749020 0.749020 srgb -n 102.295000 24.858600 m 102.295000 25.758600 l 105.995000 25.758600 l 105.995000 24.858600 l f -n 102.295000 24.858600 m 102.295000 24.858600 0.000000 0.000000 180.000000 270.000000 ellipse f -n 105.995000 24.858600 m 105.995000 24.858600 0.000000 0.000000 270.000000 360.000000 ellipse f -n 102.295000 24.858600 m 102.295000 25.758600 l 105.995000 25.758600 l 105.995000 24.858600 l f -n 102.295000 25.758600 m 102.295000 25.758600 0.000000 0.000000 90.000000 180.000000 ellipse f -n 105.995000 25.758600 m 105.995000 25.758600 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 102.295000 24.858600 m 105.995000 24.858600 l s -n 102.295000 25.758600 m 105.995000 25.758600 l s -n 102.295000 24.858600 0.000000 0.000000 180.000000 270.000000 ellipse s -n 105.995000 24.858600 0.000000 0.000000 270.000000 360.000000 ellipse s -n 102.295000 24.858600 m 102.295000 25.758600 l s -n 105.995000 24.858600 m 105.995000 25.758600 l s -n 102.295000 25.758600 0.000000 0.000000 90.000000 180.000000 ellipse s -n 105.995000 25.758600 0.000000 0.000000 0.000000 90.000000 ellipse s -n 102.225000 8.893580 m 102.225000 9.793580 l 105.925000 9.793580 l 105.925000 8.893580 l f -n 102.225000 8.893580 m 102.225000 8.893580 0.000000 0.000000 180.000000 270.000000 ellipse f -n 105.925000 8.893580 m 105.925000 8.893580 0.000000 0.000000 270.000000 360.000000 ellipse f -n 102.225000 8.893580 m 102.225000 9.793580 l 105.925000 9.793580 l 105.925000 8.893580 l f -n 102.225000 9.793580 m 102.225000 9.793580 0.000000 0.000000 90.000000 180.000000 ellipse f -n 105.925000 9.793580 m 105.925000 9.793580 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 102.225000 8.893580 m 105.925000 8.893580 l s -n 102.225000 9.793580 m 105.925000 9.793580 l s -n 102.225000 8.893580 0.000000 0.000000 180.000000 270.000000 ellipse s -n 105.925000 8.893580 0.000000 0.000000 270.000000 360.000000 ellipse s -n 102.225000 8.893580 m 102.225000 9.793580 l s -n 105.925000 8.893580 m 105.925000 9.793580 l s -n 102.225000 9.793580 0.000000 0.000000 90.000000 180.000000 ellipse s -n 105.925000 9.793580 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 96.245000 9.858580 m 96.245000 24.808580 l 112.045000 24.808580 l 112.045000 9.858580 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 96.245000 9.858580 m 96.245000 24.808580 l 112.045000 24.808580 l 112.045000 9.858580 l cp s -0.749020 0.749020 0.749020 srgb -n 98.145000 7.008580 m 98.145000 8.858580 l 110.145000 8.858580 l 110.145000 7.008580 l f -n 98.145000 7.008580 m 98.145000 7.008580 0.000000 0.000000 180.000000 270.000000 ellipse f -n 110.145000 7.008580 m 110.145000 7.008580 0.000000 0.000000 270.000000 360.000000 ellipse f -n 98.145000 7.008580 m 98.145000 8.858580 l 110.145000 8.858580 l 110.145000 7.008580 l f -n 98.145000 8.858580 m 98.145000 8.858580 0.000000 0.000000 90.000000 180.000000 ellipse f -n 110.145000 8.858580 m 110.145000 8.858580 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 98.145000 7.008580 m 110.145000 7.008580 l s -n 98.145000 8.858580 m 110.145000 8.858580 l s -n 98.145000 7.008580 0.000000 0.000000 180.000000 270.000000 ellipse s -n 110.145000 7.008580 0.000000 0.000000 270.000000 360.000000 ellipse s -n 98.145000 7.008580 m 98.145000 8.858580 l s -n 110.145000 7.008580 m 110.145000 8.858580 l s -n 98.145000 8.858580 0.000000 0.000000 90.000000 180.000000 ellipse s -n 110.145000 8.858580 0.000000 0.000000 0.000000 90.000000 ellipse s -0.749020 0.749020 0.749020 srgb -n 98.145700 25.772900 m 98.145700 27.622900 l 110.145700 27.622900 l 110.145700 25.772900 l f -n 98.145700 25.772900 m 98.145700 25.772900 0.000000 0.000000 180.000000 270.000000 ellipse f -n 110.145700 25.772900 m 110.145700 25.772900 0.000000 0.000000 270.000000 360.000000 ellipse f -n 98.145700 25.772900 m 98.145700 27.622900 l 110.145700 27.622900 l 110.145700 25.772900 l f -n 98.145700 27.622900 m 98.145700 27.622900 0.000000 0.000000 90.000000 180.000000 ellipse f -n 110.145700 27.622900 m 110.145700 27.622900 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 98.145700 25.772900 m 110.145700 25.772900 l s -n 98.145700 27.622900 m 110.145700 27.622900 l s -n 98.145700 25.772900 0.000000 0.000000 180.000000 270.000000 ellipse s -n 110.145700 25.772900 0.000000 0.000000 270.000000 360.000000 ellipse s -n 98.145700 25.772900 m 98.145700 27.622900 l s -n 110.145700 25.772900 m 110.145700 27.622900 l s -n 98.145700 27.622900 0.000000 0.000000 90.000000 180.000000 ellipse s -n 110.145700 27.622900 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 82.925000 15.943600 m 82.925000 17.843600 l 96.225000 17.843600 l 96.225000 15.943600 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 82.925000 15.943600 m 82.925000 17.843600 l 96.225000 17.843600 l 96.225000 15.943600 l cp s -1.000000 1.000000 1.000000 srgb -n 84.196000 16.913600 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 84.196000 16.913600 0.500000 0.500000 0 360 ellipse cp s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 2.800000 scf sf -(tractor:tractor) dup sw 2 div 100.944292 ex sub 34.944953 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 2.800000 scf sf -(trailer:front) dup sw 2 div 61.348192 ex sub 34.703553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 2.800000 scf sf -(trailer:rear) dup sw 2 div -14.186558 ex sub 34.844953 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 2.800000 scf sf -(trailer:middle) dup sw 2 div 22.135452 ex sub 34.632853 m gs 1 -1 sc sh gr -0.200000 slw -[] 0 sd -[] 0 sd -1 slc -n 84.483555 34.044647 m 75.184070 33.987952 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 75.184070 33.987952 m 76.478511 34.745857 l s -0.200000 slw -[] 0 sd -[] 0 sd -1 slc -n 47.512349 33.878619 m 37.845646 33.861165 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 37.845646 33.861165 m 39.143328 34.613509 l s -0.200000 slw -[] 0 sd -[] 0 sd -1 slc -n 6.428436 33.924563 m -1.194715 33.969099 l s -/Helvetica-latin1 ff 0.560000 scf sf -n -1.194715 33.969099 m 0.108682 34.711497 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(SS:Fx) dup sw 2 div -20.875658 ex sub 25.173053 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(SS:Fy) dup sw 2 div -20.148458 ex sub 42.324853 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n -16.559165 30.791773 m -19.592400 26.632642 l s -n -16.559165 30.791773 m -15.953196 30.349842 l s -n -16.559165 30.791773 m -17.165133 31.233703 l s -n -19.592400 26.632642 m -18.220986 27.240280 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n -16.618011 37.299401 m -18.837856 40.270626 l s -n -16.618011 37.299401 m -16.017180 37.748291 l s -n -16.618011 37.299401 m -17.218842 36.850512 l s -n -18.837856 40.270626 m -17.459526 39.678846 l s -showpage DELETED mttroot/mtt/lib/examples/Dia/robotrain/robotrain_desc.tex Index: mttroot/mtt/lib/examples/Dia/robotrain/robotrain_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/robotrain_desc.tex +++ mttroot/mtt/lib/examples/Dia/robotrain/robotrain_desc.tex @@ -1,31 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system robotrain (robotrain_desc.tex) -% Generated by MTT on Sun Sep 12 20:03:30 BST 2004. - -The acausal bond graph of system \textbf{robotrain} is -displayed in Figure \Ref{fig:robotrain_abg.ps}. -The model is based on an off-hooked design of a passive multiple -trailer system for indoor service robots -\footnote{{Jaehyoung Lee, Woojin Chung, Munsang Kim, Chongwon Lee and Jeabok-Song, - A passive multiple trailer system for indoor service robots, - \emph{Proceedings of the 2001 IEEE/RSJ International Conference on Intelligent Robots and Systems}, - Maui, Hawaii, USA, 2001}} -The equations of motion for each trailer are given by: -\begin{align} - v_i &= v_{i-1}\cos \phi_i+D_{i-1}\dot\theta_{i-1}\sin \phi_i\\ - \dot\theta_i &= \frac{1}{L_i}\left(v_{i-1}\sin \phi_i+D_{i-1}\dot\theta_{i-1}\cos \phi_i\right)\\ - \phi_i &= \theta_{i-1}-\theta_i -\end{align} -where $v$ and $\dot\theta$ are the translational and rotational velocity of each trailer (in the body axis system), $L$ and $D$ are the lengths of the front and rear moment arms, and the subscripts $_i$ and $_{i-1}$ refer to any trailer and the one in front of it. - -The label file is listed in Section \Ref{sec:robotrain_lbl} and the -subsystems are listed in Section \Ref{sec:robotrain_sub}. - -\subsection{Trajectory} -The trajectory of each of the trailer hooks in response to a constant forward and rotational velocity is shown in figure \Ref{fig:trajectory.ps}. -\fig{trajectory}{trajectory.ps}{0.9}{Trajectory of trailer links} -The plot was generated with the following script: -\footnotesize -\verbatiminput{make_trajectory.sh} -\normalsize - DELETED mttroot/mtt/lib/examples/Dia/robotrain/robotrain_input.txt Index: mttroot/mtt/lib/examples/Dia/robotrain/robotrain_input.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/robotrain_input.txt +++ mttroot/mtt/lib/examples/Dia/robotrain/robotrain_input.txt @@ -1,11 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System robotrain, representation input, language txt; -## File robotrain_input.txt; -## Generated by MTT on Fri Sep 10 00:39:34 BST 2004; - -robotrain__Fx = 0.0; -robotrain__Fy = 0.0; -robotrain__tractor__omega__u = 1.0; -robotrain__tractor__v__u = 1.0; DELETED mttroot/mtt/lib/examples/Dia/robotrain/robotrain_lbl.txt Index: mttroot/mtt/lib/examples/Dia/robotrain/robotrain_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/robotrain_lbl.txt +++ mttroot/mtt/lib/examples/Dia/robotrain/robotrain_lbl.txt @@ -1,36 +0,0 @@ -#SUMMARY robotrain -#DESCRIPTION Detailed description here - -## System robotrain, representation lbl, language txt -## File robotrain_lbl.txt -## Generated by MTT on Sun Sep 12 19:26:13 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases - -## Argument aliases -#ALIAS $1 D -#ALIAS $2 L - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type SS - Fx SS external,external - Fy SS external,external - -## Component type tractor - tractor lin D - -## Component type trailer - front lin D;L - middle lin D;L - rear lin D;L - DELETED mttroot/mtt/lib/examples/Dia/robotrain/robotrain_rep.pdf Index: mttroot/mtt/lib/examples/Dia/robotrain/robotrain_rep.pdf ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/robotrain_rep.pdf +++ mttroot/mtt/lib/examples/Dia/robotrain/robotrain_rep.pdf cannot compute difference between binary files DELETED mttroot/mtt/lib/examples/Dia/robotrain/robotrain_rep.txt Index: mttroot/mtt/lib/examples/Dia/robotrain/robotrain_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/robotrain_rep.txt +++ mttroot/mtt/lib/examples/Dia/robotrain/robotrain_rep.txt @@ -1,25 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system robotrain (robotrain_rep.txt) -## Generated by MTT on" Sun Sep 12 20:02:40 BST 2004. - -mtt robotrain abg tex # The system description -#mtt robotrain cbg ps # The causal bond graph -mtt robotrain struc tex # The system structure -mtt robotrain sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt robotrain dae tex # The system dae -## mtt robotrain ode tex # The system ode -## mtt robotrain sspar tex # Steady-state parameters -## mtt robotrain ss tex # Steady state -## mtt robotrain dm tex # Descriptor matrices (of linearised system) -## mtt robotrain sm tex # State matrices (of linearised system) -## mtt robotrain tf tex # Transfer function (of linearised system) -## mtt robotrain lmfr ps # log modulus of frequency response (of linearised system) -## mtt robotrain simpar txt # Simulation parameters -## mtt robotrain numpar txt # Numerical simulation parameters -mtt robotrain state txt # Simulation initial state -mtt robotrain input txt # Simulation input -## mtt robotrain logic txt # Logic control -## mtt robotrain odeso ps # Simulation output - -## mtt robotrain rep txt # This file DELETED mttroot/mtt/lib/examples/Dia/robotrain/robotrain_simpar.txt Index: mttroot/mtt/lib/examples/Dia/robotrain/robotrain_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/robotrain_simpar.txt +++ mttroot/mtt/lib/examples/Dia/robotrain/robotrain_simpar.txt @@ -1,12 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system robotrain (robotrain_simpar.txt) -# Generated by MTT on Sun Sep 12 18:45:47 BST 2004. - -FIRST = 0.0; # First time in simulation output -DT = 0.1; # Print interval -LAST = 10.0; # Last time in simulation -STEPFACTOR = 10; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Dia/robotrain/robotrain_state.txt Index: mttroot/mtt/lib/examples/Dia/robotrain/robotrain_state.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/robotrain_state.txt +++ mttroot/mtt/lib/examples/Dia/robotrain/robotrain_state.txt @@ -1,20 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System robotrain, representation state, language txt; -## File robotrain_state.txt; -## Generated by MTT on Sun Sep 12 18:46:40 BST 2004; - -robotrain__tractor__yaw__mttC = 0.0; - -robotrain__front__x_e__mttC = -D; -robotrain__front__y_e__mttC = 0.0; -robotrain__front__yaw__mttC = 0.0; - -robotrain__middle__x_e__mttC = -(D+L+D); -robotrain__middle__y_e__mttC = 0.0; -robotrain__middle__yaw__mttC = 0.0; - -robotrain__rear__x_e__mttC = -(D+L+D+L+D); -robotrain__rear__y_e__mttC = 0.0; -robotrain__rear__yaw__mttC = 0.0; DELETED mttroot/mtt/lib/examples/Dia/robotrain/rotate_z.cr Index: mttroot/mtt/lib/examples/Dia/robotrain/rotate_z.cr ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/rotate_z.cr +++ mttroot/mtt/lib/examples/Dia/robotrain/rotate_z.cr @@ -1,43 +0,0 @@ -operator rotate_z; - -let rotate_z (R,~out_causality,1, - ~x1,~causality1,1, - ~y1,~causality2,2, - ~x2,~causality3,3, - ~y2,~causality4,4, - ~psi,~causality5,5) => % x1 - x2*cos(psi)-y2*sin(psi); - -let rotate_z (R,~out_causality,2, - ~x1,~causality1,1, - ~y1,~causality2,2, - ~x2,~causality3,3, - ~y2,~causality4,4, - ~psi,~causality5,5) => % y1 - x2*sin(psi)+y2*sin(psi); - -let rotate_z (R,~out_causality,3, - ~x1,~causality1,1, - ~y1,~causality2,2, - ~x2,~causality3,3, - ~y2,~causality4,4, - ~psi,~causality5,5) => % x2 - x1*cos(psi)+y1*sin(psi); - -let rotate_z (R,~out_causality,4, - ~x1,~causality1,1, - ~y1,~causality2,2, - ~x2,~causality3,3, - ~y2,~causality4,4, - ~psi,~causality5,5) => % y2 - -x1*sin(psi)+y1*cos(psi); - -let rotate_z (R,~out_causality,5, - ~x1,~causality1,1, - ~y1,~causality2,2, - ~x2,~causality3,3, - ~y2,~causality4,4, - ~psi,~causality5,5) => % x1 - 0; - -;end; DELETED mttroot/mtt/lib/examples/Dia/robotrain/rotate_z.pm Index: mttroot/mtt/lib/examples/Dia/robotrain/rotate_z.pm ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/rotate_z.pm +++ mttroot/mtt/lib/examples/Dia/robotrain/rotate_z.pm @@ -1,121 +0,0 @@ -#------------------------------------------------------------------------------- -# Model Transformation Tools -#------------------------------------------------------------------------------- - - -package rotate_z; - -#------------------------------------------------------------------------------- -# rotation of x-y plane about z -#------------------------------------------------------------------------------- - -use strict; -use warnings; - -#------------------------------------------------------------------------------- -# standard module header (see perlmod for explanation) -#------------------------------------------------------------------------------- -BEGIN { - use Exporter (); - our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - - $VERSION = 1.00; - - @ISA = qw(Exporter); - @EXPORT = qw(&rotate_z); # CR name - %EXPORT_TAGS = ( ); -} - -#------------------------------------------------------------------------------- -# declaration of specific component implementations -#------------------------------------------------------------------------------- -sub rotate_z_R(@); # R - -#------------------------------------------------------------------------------- -# main function: selects which subfunction to call -#------------------------------------------------------------------------------- -sub rotate_z (@) { - - my $retval; - - $_ = $_[0]; - - s/\((.*)\)/$1/; # strip brackets - my @args = split (/,/); # split arguments - - $_ = $args[0]; # get component type - - # select rule to use - if (/^R|r$/) { $retval = rotate_z_R (@args); } - - # if a substitution has been made ($retval) - if ($retval) - { - return $retval; # return substituted expression - } - else # return nothing - { - return; - } -} - -#------------------------------------------------------------------------------- -# R -#------------------------------------------------------------------------------- -sub rotate_z_R (@) { - - my @args = @_; - my $retval = ''; - - if ($#args == 18-1) - { - my ($component, - $out_causality, $out_port, - $x1, $causality1, $port1, - $y1, $causality2, $port2, - $x2, $causality3, $port3, - $y2, $causality4, $port4, - $psi, $causality5, $port5) = @args; - - # [ x2 ] [ +cos(psi) +sin(psi) 0 ] [ x1 ] - # [ y2 ] = [ -sin(psi) +cos(psi) 0 ] [ y1 ] - # [ z2 ] [ 0 0 1 ] [ z1 ] - - # for reverse transformation (x2->x1) use psi=-psi - # note that cos(-psi)=cos(psi) and sin(-psi)=-sin(psi) - - if ($out_port == 1) # x1 - { - $retval = "(($x2)*(+cos($psi))+($y2)*(-sin($psi)))"; - } - elsif ($out_port == 2) # y1 - { - $retval = "(($x2)*(+sin($psi))+($y2)*(+cos($psi)))"; - } - elsif ($out_port == 3) # x2 - { - $retval = "(($x1)*(+cos($psi))+($y1)*(+sin($psi)))"; - } - elsif ($out_port == 4) # y2 - { - $retval = "(($x1)*(-sin($psi))+($y1)*(+cos($psi)))"; - } - elsif ($out_port == 5) - { - $retval = "(0)"; - } - } - - if ($retval) - { - return $retval; - } - else - { - return; - } -} - -#------------------------------------------------------------------------------- -1; # return true - DELETED mttroot/mtt/lib/examples/Dia/robotrain/rotation_abg.dia Index: mttroot/mtt/lib/examples/Dia/robotrain/rotation_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/rotation_abg.dia +++ mttroot/mtt/lib/examples/Dia/robotrain/rotation_abg.dia @@ -1,1251 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Rotation about Z# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[x_1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[y_1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[x_2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[y_2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[psi]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #R:rotation# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[3]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[4]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #AE# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[5]# - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/robotrain/rotation_abg.ps Index: mttroot/mtt/lib/examples/Dia/robotrain/rotation_abg.ps ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/rotation_abg.ps +++ mttroot/mtt/lib/examples/Dia/robotrain/rotation_abg.ps @@ -1,535 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: rotation_abg.dia -%%Creator: Dia v0.94+bondgraph -%%CreationDate: Sun Sep 12 21:15:37 2004 -%%For: geraint -%%Orientation: Portrait -%%Magnification: 1.0000 -%%BoundingBox: 0 0 1082 815 -%%BeginSetup -%%EndSetup -%%EndComments -%%BeginProlog -[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright -/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one -/two /three /four /five /six /seven /eight /nine /colon /semicolon -/less /equal /greater /question /at /A /B /C /D /E -/F /G /H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W /X /Y -/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c -/d /e /f /g /h /i /j /k /l /m -/n /o /p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright -/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior -/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf -/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde -/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex -/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring -/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave -/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def -/cp {closepath} bind def -/c {curveto} bind def -/f {fill} bind def -/a {arc} bind def -/ef {eofill} bind def -/ex {exch} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth pop} bind def -/tr {translate} bind def - -/ellipsedict 8 dict def -ellipsedict /mtrx matrix put -/ellipse -{ ellipsedict begin - /endangle exch def - /startangle exch def - /yrad exch def - /xrad exch def - /y exch def - /x exch def /savematrix mtrx currentmatrix def - x y tr xrad yrad sc - 0 0 1 startangle endangle arc - savematrix setmatrix - end -} def - -/mergeprocs { -dup length -3 -1 roll -dup -length -dup -5 1 roll -3 -1 roll -add -array cvx -dup -3 -1 roll -0 exch -putinterval -dup -4 2 roll -putinterval -} bind def -/Times-Roman-latin1 - /Times-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-Italic-latin1 - /Times-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-Bold-latin1 - /Times-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-BoldItalic-latin1 - /Times-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-Book-latin1 - /AvantGarde-Book findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-BookOblique-latin1 - /AvantGarde-BookOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-Demi-latin1 - /AvantGarde-Demi findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-DemiOblique-latin1 - /AvantGarde-DemiOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-Light-latin1 - /Bookman-Light findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-LightItalic-latin1 - /Bookman-LightItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-Demi-latin1 - /Bookman-Demi findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-DemiItalic-latin1 - /Bookman-DemiItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-latin1 - /Courier findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-Oblique-latin1 - /Courier-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-Bold-latin1 - /Courier-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-BoldOblique-latin1 - /Courier-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-latin1 - /Helvetica findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Oblique-latin1 - /Helvetica-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Bold-latin1 - /Helvetica-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-BoldOblique-latin1 - /Helvetica-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-latin1 - /Helvetica-Narrow findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-Oblique-latin1 - /Helvetica-Narrow-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-Bold-latin1 - /Helvetica-Narrow-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-BoldOblique-latin1 - /Helvetica-Narrow-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Roman-latin1 - /NewCenturySchoolbook-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Italic-latin1 - /NewCenturySchoolbook-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Bold-latin1 - /NewCenturySchoolbook-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-BoldItalic-latin1 - /NewCenturySchoolbook-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Roman-latin1 - /Palatino-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Italic-latin1 - /Palatino-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Bold-latin1 - /Palatino-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-BoldItalic-latin1 - /Palatino-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Symbol-latin1 - /Symbol findfont -definefont pop -/ZapfChancery-MediumItalic-latin1 - /ZapfChancery-MediumItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/ZapfDingbats-latin1 - /ZapfDingbats findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -28.346000 -28.346000 scale --0.900000 -26.307107 translate -%%EndProlog - - -/Helvetica-latin1 ff 1.400000 scf sf -0.000000 0.000000 0.000000 srgb -(Rotation about Z) 0.900000 -1.012500 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -0.000000 0.000000 1.000000 srgb -(SS:[x_1]) dup sw 2 div 4.837502 ex sub 3.103553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -(SS:[y_1]) dup sw 2 div 6.948192 ex sub 23.653553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -1.000000 0.000000 0.000000 srgb -(SS:[x_2]) dup sw 2 div 36.304442 ex sub 12.253553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -(SS:[y_2]) dup sw 2 div 18.410692 ex sub -0.896447 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -0.627451 0.125490 0.941176 srgb -(SS:[psi]) dup sw 2 div 18.441892 ex sub 25.603553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -(R:rotation) dup sw 2 div 18.450042 ex sub 12.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -0.000000 0.000000 1.000000 srgb -n 7.132941 4.354610 m 10.038120 6.254396 l s -n 10.038120 6.254396 m 8.540433 6.171136 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -1.000000 0.000000 0.000000 srgb -(0) dup sw 2 div 27.916942 ex sub 12.253553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -0.000000 0.000000 1.000000 srgb -(0) dup sw 2 div 11.741942 ex sub 7.618553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -(0) dup sw 2 div 12.841942 ex sub 17.768553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -1.000000 0.000000 0.000000 srgb -(0) dup sw 2 div 18.391942 ex sub 5.718553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -0.000000 0.000000 1.000000 srgb -n 8.605490 21.748750 m 11.267337 19.090836 l s -n 11.267337 19.090836 m 10.878037 20.539437 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -1.000000 0.000000 0.000000 srgb -n 29.783602 12.003600 m 32.563514 12.003600 l s -n 32.563514 12.003600 m 31.264476 12.753600 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 18.397452 3.514902 m 18.405148 0.807198 l s -n 18.405148 0.807198 m 19.151453 2.108362 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -0.000000 0.000000 1.000000 srgb -n 13.434240 8.525280 m 16.232361 10.437823 l s -n 16.232361 10.437823 m 14.736688 10.323972 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 14.418753 15.953866 m 16.780386 13.610382 l s -n 16.780386 13.610382 m 16.386571 15.057763 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -1.000000 0.000000 0.000000 srgb -n 22.566713 11.975343 m 26.049616 11.993738 l s -n 26.049616 11.993738 m 24.746634 12.736867 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 18.432499 10.000119 m 18.409401 7.422031 l s -n 18.409401 7.422031 m 19.171009 8.714298 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -0.627451 0.125490 0.941176 srgb -(AE) dup sw 2 div 18.460692 ex sub 18.953553 m gs 1 -1 sc sh gr -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 18.447422 23.400183 m 18.455178 20.657017 l s -n 18.455178 20.657017 m 19.201502 21.958170 l s -n 18.455178 20.657017 m 17.701508 21.953930 l s -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 18.457604 16.750263 m 18.453096 13.906937 l s -n 18.453096 13.906937 m 19.205155 15.204785 l s -n 18.453096 13.906937 m 17.705157 15.207163 l s -showpage DELETED mttroot/mtt/lib/examples/Dia/robotrain/rotation_desc.tex Index: mttroot/mtt/lib/examples/Dia/robotrain/rotation_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/rotation_desc.tex +++ mttroot/mtt/lib/examples/Dia/robotrain/rotation_desc.tex @@ -1,22 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system rotation (rotation_desc.tex) -% Generated by MTT on Sun Sep 12 22:06:34 BST 2004. - -The acausal bond graph of system \textbf{rotation} is -displayed in Figure \Ref{fig:rotation_abg.ps} -. -The label file is listed in Section \Ref{sec:rotation_lbl} and the -subsystems are listed in Section \Ref{sec:rotation_sub}. - -\subsubsection{rotate\_z constitutive relationship} -The rotation between body and Earth axes is achieved using the ``rotate\_z'' constitutive relationship which is implemented as a Reduce file (.cr) and a Perl module (.pm) to permit the model to be built with or without MTT's -no-reduce option. - -\paragraph{rotate\_z.cr} -\footnotesize -\verbatiminput{rotate_z.cr} -\normalsize - -\paragraph{rotate\_z.pm} -\footnotesize -\verbatiminput{rotate_z.pm} -\normalsize DELETED mttroot/mtt/lib/examples/Dia/robotrain/rotation_lbl.txt Index: mttroot/mtt/lib/examples/Dia/robotrain/rotation_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/rotation_lbl.txt +++ mttroot/mtt/lib/examples/Dia/robotrain/rotation_lbl.txt @@ -1,44 +0,0 @@ -#SUMMARY rotation -#DESCRIPTION Detailed description here - -## System rotation, representation lbl, language txt -## File rotation_lbl.txt -## Generated by MTT on Tue Sep 7 16:59:01 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases -#ALIAS in x_earth,y_earth -#ALIAS out x_body,y_body - -## Argument aliases - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 0 (anonymous => default parameters) - # 0 - # 0 - # 0 - # 0 - # 0 - -## Component type AF (anonymous => default parameters) - # AF - -## Component type R - rotation rotate_z - -## Component type SS - [psi] SS external,external - [x_body] SS external,external - [x_earth] SS external,external - [y_body] SS external,external - [y_earth] SS external,external - DELETED mttroot/mtt/lib/examples/Dia/robotrain/tractor_abg.dia Index: mttroot/mtt/lib/examples/Dia/robotrain/tractor_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/tractor_abg.dia +++ mttroot/mtt/lib/examples/Dia/robotrain/tractor_abg.dia @@ -1,1458 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Tractor# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #rotation:z2# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #TF:D# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[x2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[y2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[x_1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[y_1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[x_2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[y_2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Sf:v# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Sf:omega# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #INTF:yaw# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[psi]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #AE:negative# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/robotrain/tractor_abg.ps Index: mttroot/mtt/lib/examples/Dia/robotrain/tractor_abg.ps ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/tractor_abg.ps +++ mttroot/mtt/lib/examples/Dia/robotrain/tractor_abg.ps @@ -1,642 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: tractor_abg.dia -%%Creator: Dia v0.94+bondgraph -%%CreationDate: Sun Sep 12 21:15:57 2004 -%%For: geraint -%%Orientation: Portrait -%%Magnification: 1.0000 -%%BoundingBox: 0 0 1177 1288 -%%BeginSetup -%%EndSetup -%%EndComments -%%BeginProlog -[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright -/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one -/two /three /four /five /six /seven /eight /nine /colon /semicolon -/less /equal /greater /question /at /A /B /C /D /E -/F /G /H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W /X /Y -/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c -/d /e /f /g /h /i /j /k /l /m -/n /o /p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright -/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior -/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf -/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde -/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex -/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring -/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave -/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def -/cp {closepath} bind def -/c {curveto} bind def -/f {fill} bind def -/a {arc} bind def -/ef {eofill} bind def -/ex {exch} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth pop} bind def -/tr {translate} bind def - -/ellipsedict 8 dict def -ellipsedict /mtrx matrix put -/ellipse -{ ellipsedict begin - /endangle exch def - /startangle exch def - /yrad exch def - /xrad exch def - /y exch def - /x exch def /savematrix mtrx currentmatrix def - x y tr xrad yrad sc - 0 0 1 startangle endangle arc - savematrix setmatrix - end -} def - -/mergeprocs { -dup length -3 -1 roll -dup -length -dup -5 1 roll -3 -1 roll -add -array cvx -dup -3 -1 roll -0 exch -putinterval -dup -4 2 roll -putinterval -} bind def -/Times-Roman-latin1 - /Times-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-Italic-latin1 - /Times-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-Bold-latin1 - /Times-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-BoldItalic-latin1 - /Times-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-Book-latin1 - /AvantGarde-Book findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-BookOblique-latin1 - /AvantGarde-BookOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-Demi-latin1 - /AvantGarde-Demi findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-DemiOblique-latin1 - /AvantGarde-DemiOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-Light-latin1 - /Bookman-Light findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-LightItalic-latin1 - /Bookman-LightItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-Demi-latin1 - /Bookman-Demi findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-DemiItalic-latin1 - /Bookman-DemiItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-latin1 - /Courier findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-Oblique-latin1 - /Courier-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-Bold-latin1 - /Courier-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-BoldOblique-latin1 - /Courier-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-latin1 - /Helvetica findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Oblique-latin1 - /Helvetica-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Bold-latin1 - /Helvetica-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-BoldOblique-latin1 - /Helvetica-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-latin1 - /Helvetica-Narrow findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-Oblique-latin1 - /Helvetica-Narrow-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-Bold-latin1 - /Helvetica-Narrow-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-BoldOblique-latin1 - /Helvetica-Narrow-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Roman-latin1 - /NewCenturySchoolbook-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Italic-latin1 - /NewCenturySchoolbook-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Bold-latin1 - /NewCenturySchoolbook-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-BoldItalic-latin1 - /NewCenturySchoolbook-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Roman-latin1 - /Palatino-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Italic-latin1 - /Palatino-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Bold-latin1 - /Palatino-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-BoldItalic-latin1 - /Palatino-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Symbol-latin1 - /Symbol findfont -definefont pop -/ZapfChancery-MediumItalic-latin1 - /ZapfChancery-MediumItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/ZapfDingbats-latin1 - /ZapfDingbats findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -28.346000 -28.346000 scale -5.050000 -52.507107 translate -%%EndProlog - - -0.749020 0.749020 0.749020 srgb -n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f -n 21.150000 25.000000 m 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 24.850000 25.000000 m 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f -n 21.150000 25.900000 m 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 24.850000 25.900000 m 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 21.150000 25.000000 m 24.850000 25.000000 l s -n 21.150000 25.900000 m 24.850000 25.900000 l s -n 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 21.150000 25.000000 m 21.150000 25.900000 l s -n 24.850000 25.000000 m 24.850000 25.900000 l s -n 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse s -n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f -n 21.080000 9.035000 m 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 24.780000 9.035000 m 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f -n 21.080000 9.935000 m 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 24.780000 9.935000 m 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 21.080000 9.035000 m 24.780000 9.035000 l s -n 21.080000 9.935000 m 24.780000 9.935000 l s -n 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 21.080000 9.035000 m 21.080000 9.935000 l s -n 24.780000 9.035000 m 24.780000 9.935000 l s -n 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l cp s -0.749020 0.749020 0.749020 srgb -n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f -n 17.000000 7.150000 m 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 29.000000 7.150000 m 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f -n 17.000000 9.000000 m 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 29.000000 9.000000 m 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 17.000000 7.150000 m 29.000000 7.150000 l s -n 17.000000 9.000000 m 29.000000 9.000000 l s -n 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 17.000000 7.150000 m 17.000000 9.000000 l s -n 29.000000 7.150000 m 29.000000 9.000000 l s -n 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse s -0.749020 0.749020 0.749020 srgb -n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f -n 17.000700 25.914300 m 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse f -n 29.000700 25.914300 m 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse f -n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f -n 17.000700 27.764300 m 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse f -n 29.000700 27.764300 m 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 17.000700 25.914300 m 29.000700 25.914300 l s -n 17.000700 27.764300 m 29.000700 27.764300 l s -n 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse s -n 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse s -n 17.000700 25.914300 m 17.000700 27.764300 l s -n 29.000700 25.914300 m 29.000700 27.764300 l s -n 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse s -n 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l cp s -1.000000 1.000000 1.000000 srgb -n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse cp s -/Helvetica-latin1 ff 1.400000 scf sf -(Tractor) -3.804070 8.965100 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -(rotation:z2) dup sw 2 div 8.466942 ex sub 36.053553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(TF:D) dup sw 2 div 15.973192 ex sub 43.653553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(SS:[x2]) dup sw 2 div -2.589308 ex sub 36.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(SS:[y2]) dup sw 2 div 8.410692 ex sub 29.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(1) dup sw 2 div 23.816942 ex sub 36.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(1) dup sw 2 div 24.216942 ex sub 51.853553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 21.950301 35.891440 m 12.833155 35.832044 l s -n 12.833155 35.832044 m 14.127279 36.590491 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 22.641483 49.986534 m 17.640695 45.012255 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 17.640695 45.012255 m 18.032772 46.460107 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 14.320247 41.691015 m 10.119893 37.466185 l s -n 10.119893 37.466185 m 11.567648 37.858621 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 4.100304 35.843095 m 0.871380 35.872299 l s -n 4.100304 35.843095 m 4.107087 36.593064 l s -n 4.100304 35.843095 m 4.093521 35.093125 l s -n 0.871380 35.872299 m 2.177148 36.610520 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 8.451012 33.849745 m 8.426618 30.857455 l s -n 8.451012 33.849745 m 9.200987 33.843631 l s -n 8.451012 33.849745 m 7.701037 33.855859 l s -n 8.426618 30.857455 m 9.187183 32.150336 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(Sf:v) dup sw 2 div 33.566942 ex sub 36.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(Sf:omega) dup sw 2 div 33.423192 ex sub 51.853553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(INTF:yaw) dup sw 2 div 24.191942 ex sub 47.453553 m gs 1 -1 sc sh gr -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 24.205823 49.604007 m 24.202977 49.103193 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 24.202977 49.103193 m 24.960346 50.397949 l s -n 24.202977 49.103193 m 23.460370 50.406472 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(0) dup sw 2 div 24.216942 ex sub 43.203553 m gs 1 -1 sc sh gr -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 24.203373 45.203178 m 24.205412 44.856616 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 24.205412 44.856616 m 24.947757 46.160043 l s -n 24.205412 44.856616 m 23.447783 46.151220 l s -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 15.079625 38.564846 m 11.673015 37.142354 l s -n 11.673015 37.142354 m 12.582750 38.334991 l s -n 11.673015 37.142354 m 13.160736 36.950819 l s -n 11.673015 37.142354 m 11.384022 37.834440 l s -n 11.673015 37.142354 m 11.962008 36.450268 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 30.950033 35.903600 m 25.683950 35.903600 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 25.683950 35.903600 m 26.982988 36.653600 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 29.399573 51.553600 m 26.082238 51.553600 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 26.082238 51.553600 m 27.381276 52.303600 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(AE:negative) dup sw 2 div 18.285642 ex sub 40.153553 m gs 1 -1 sc sh gr -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 22.457897 42.013896 m 21.061956 41.307830 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 21.061956 41.307830 m 21.882638 42.563410 l s -n 21.061956 41.307830 m 22.559662 41.224889 l s -showpage DELETED mttroot/mtt/lib/examples/Dia/robotrain/tractor_lbl.txt Index: mttroot/mtt/lib/examples/Dia/robotrain/tractor_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/tractor_lbl.txt +++ mttroot/mtt/lib/examples/Dia/robotrain/tractor_lbl.txt @@ -1,49 +0,0 @@ -#SUMMARY tractor -#DESCRIPTION Detailed description here - -## System tractor, representation lbl, language txt -## File tractor_lbl.txt -## Generated by MTT on Wed Sep 8 00:42:45 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases -#ALIAS out x2,y2 - -## Argument aliases -#ALIAS $1 D - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 1 (anonymous => default parameters) - # 1 - # 1 - # 1 - -## Component type AE - negative lin effort,-1 - -## Component type INTF - yaw none - -## Component type SS - [x2] SS external,external - [y2] SS external,external - -## Component type Sf - omega SS external - v SS external - -## Component type TF - D lin flow,-D - -## Component type rotation - z2 rotate_z - DELETED mttroot/mtt/lib/examples/Dia/robotrain/trailer_abg.dia Index: mttroot/mtt/lib/examples/Dia/robotrain/trailer_abg.dia ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/trailer_abg.dia +++ mttroot/mtt/lib/examples/Dia/robotrain/trailer_abg.dia @@ -1,2672 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Passive off-hooked trailer# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #rotation:z1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #rotation:z2# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #TF:D# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #TF:L# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[x2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[y2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[x_1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[y_1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[x_2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[y_2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[x_1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[y_1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[x_2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[y_2]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Df:v# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Df:omega# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #INTF:yaw# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #0# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[psi]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #[psi]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #AE:negative# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #INTF:x_e# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #INTF:y_e# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[y1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SS:[x1]# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #De:y# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #De:x# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETED mttroot/mtt/lib/examples/Dia/robotrain/trailer_abg.ps Index: mttroot/mtt/lib/examples/Dia/robotrain/trailer_abg.ps ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/trailer_abg.ps +++ mttroot/mtt/lib/examples/Dia/robotrain/trailer_abg.ps @@ -1,854 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: trailer_abg.dia -%%Creator: Dia v0.94+bondgraph -%%CreationDate: Sun Sep 12 21:16:23 2004 -%%For: geraint -%%Orientation: Portrait -%%Magnification: 1.0000 -%%BoundingBox: 0 0 1776 1439 -%%BeginSetup -%%EndSetup -%%EndComments -%%BeginProlog -[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright -/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one -/two /three /four /five /six /seven /eight /nine /colon /semicolon -/less /equal /greater /question /at /A /B /C /D /E -/F /G /H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W /X /Y -/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c -/d /e /f /g /h /i /j /k /l /m -/n /o /p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright -/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior -/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf -/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde -/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex -/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring -/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave -/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def -/cp {closepath} bind def -/c {curveto} bind def -/f {fill} bind def -/a {arc} bind def -/ef {eofill} bind def -/ex {exch} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth pop} bind def -/tr {translate} bind def - -/ellipsedict 8 dict def -ellipsedict /mtrx matrix put -/ellipse -{ ellipsedict begin - /endangle exch def - /startangle exch def - /yrad exch def - /xrad exch def - /y exch def - /x exch def /savematrix mtrx currentmatrix def - x y tr xrad yrad sc - 0 0 1 startangle endangle arc - savematrix setmatrix - end -} def - -/mergeprocs { -dup length -3 -1 roll -dup -length -dup -5 1 roll -3 -1 roll -add -array cvx -dup -3 -1 roll -0 exch -putinterval -dup -4 2 roll -putinterval -} bind def -/Times-Roman-latin1 - /Times-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-Italic-latin1 - /Times-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-Bold-latin1 - /Times-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Times-BoldItalic-latin1 - /Times-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-Book-latin1 - /AvantGarde-Book findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-BookOblique-latin1 - /AvantGarde-BookOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-Demi-latin1 - /AvantGarde-Demi findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/AvantGarde-DemiOblique-latin1 - /AvantGarde-DemiOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-Light-latin1 - /Bookman-Light findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-LightItalic-latin1 - /Bookman-LightItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-Demi-latin1 - /Bookman-Demi findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Bookman-DemiItalic-latin1 - /Bookman-DemiItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-latin1 - /Courier findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-Oblique-latin1 - /Courier-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-Bold-latin1 - /Courier-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Courier-BoldOblique-latin1 - /Courier-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-latin1 - /Helvetica findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Oblique-latin1 - /Helvetica-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Bold-latin1 - /Helvetica-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-BoldOblique-latin1 - /Helvetica-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-latin1 - /Helvetica-Narrow findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-Oblique-latin1 - /Helvetica-Narrow-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-Bold-latin1 - /Helvetica-Narrow-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Helvetica-Narrow-BoldOblique-latin1 - /Helvetica-Narrow-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Roman-latin1 - /NewCenturySchoolbook-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Italic-latin1 - /NewCenturySchoolbook-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-Bold-latin1 - /NewCenturySchoolbook-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/NewCenturySchoolbook-BoldItalic-latin1 - /NewCenturySchoolbook-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Roman-latin1 - /Palatino-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Italic-latin1 - /Palatino-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-Bold-latin1 - /Palatino-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Palatino-BoldItalic-latin1 - /Palatino-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/Symbol-latin1 - /Symbol findfont -definefont pop -/ZapfChancery-MediumItalic-latin1 - /ZapfChancery-MediumItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/ZapfDingbats-latin1 - /ZapfDingbats findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -28.346000 -28.346000 scale -4.050000 -57.857107 translate -%%EndProlog - - -0.749020 0.749020 0.749020 srgb -n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f -n 21.150000 25.000000 m 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 24.850000 25.000000 m 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 21.150000 25.000000 m 21.150000 25.900000 l 24.850000 25.900000 l 24.850000 25.000000 l f -n 21.150000 25.900000 m 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 24.850000 25.900000 m 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 21.150000 25.000000 m 24.850000 25.000000 l s -n 21.150000 25.900000 m 24.850000 25.900000 l s -n 21.150000 25.000000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 24.850000 25.000000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 21.150000 25.000000 m 21.150000 25.900000 l s -n 24.850000 25.000000 m 24.850000 25.900000 l s -n 21.150000 25.900000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 24.850000 25.900000 0.000000 0.000000 0.000000 90.000000 ellipse s -n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f -n 21.080000 9.035000 m 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 24.780000 9.035000 m 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 21.080000 9.035000 m 21.080000 9.935000 l 24.780000 9.935000 l 24.780000 9.035000 l f -n 21.080000 9.935000 m 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 24.780000 9.935000 m 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -n 21.080000 9.035000 m 24.780000 9.035000 l s -n 21.080000 9.935000 m 24.780000 9.935000 l s -n 21.080000 9.035000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 24.780000 9.035000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 21.080000 9.035000 m 21.080000 9.935000 l s -n 24.780000 9.035000 m 24.780000 9.935000 l s -n 21.080000 9.935000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 24.780000 9.935000 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 15.100000 10.000000 m 15.100000 24.950000 l 30.900000 24.950000 l 30.900000 10.000000 l cp s -0.749020 0.749020 0.749020 srgb -n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f -n 17.000000 7.150000 m 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse f -n 29.000000 7.150000 m 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse f -n 17.000000 7.150000 m 17.000000 9.000000 l 29.000000 9.000000 l 29.000000 7.150000 l f -n 17.000000 9.000000 m 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse f -n 29.000000 9.000000 m 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 17.000000 7.150000 m 29.000000 7.150000 l s -n 17.000000 9.000000 m 29.000000 9.000000 l s -n 17.000000 7.150000 0.000000 0.000000 180.000000 270.000000 ellipse s -n 29.000000 7.150000 0.000000 0.000000 270.000000 360.000000 ellipse s -n 17.000000 7.150000 m 17.000000 9.000000 l s -n 29.000000 7.150000 m 29.000000 9.000000 l s -n 17.000000 9.000000 0.000000 0.000000 90.000000 180.000000 ellipse s -n 29.000000 9.000000 0.000000 0.000000 0.000000 90.000000 ellipse s -0.749020 0.749020 0.749020 srgb -n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f -n 17.000700 25.914300 m 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse f -n 29.000700 25.914300 m 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse f -n 17.000700 25.914300 m 17.000700 27.764300 l 29.000700 27.764300 l 29.000700 25.914300 l f -n 17.000700 27.764300 m 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse f -n 29.000700 27.764300 m 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 17.000700 25.914300 m 29.000700 25.914300 l s -n 17.000700 27.764300 m 29.000700 27.764300 l s -n 17.000700 25.914300 0.000000 0.000000 180.000000 270.000000 ellipse s -n 29.000700 25.914300 0.000000 0.000000 270.000000 360.000000 ellipse s -n 17.000700 25.914300 m 17.000700 27.764300 l s -n 29.000700 25.914300 m 29.000700 27.764300 l s -n 17.000700 27.764300 0.000000 0.000000 90.000000 180.000000 ellipse s -n 29.000700 27.764300 0.000000 0.000000 0.000000 90.000000 ellipse s -1.000000 1.000000 1.000000 srgb -n 30.900000 16.000000 m 30.900000 17.900000 l 44.200000 17.900000 l 44.200000 16.000000 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 30.900000 16.000000 m 30.900000 17.900000 l 44.200000 17.900000 l 44.200000 16.000000 l cp s -1.000000 1.000000 1.000000 srgb -n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l f -0.100000 slw -[] 0 sd -[] 0 sd -0 slj -0.000000 0.000000 0.000000 srgb -n 1.780000 16.085000 m 1.780000 17.985000 l 15.080000 17.985000 l 15.080000 16.085000 l cp s -1.000000 1.000000 1.000000 srgb -n 43.100000 16.950000 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 43.100000 16.950000 0.500000 0.500000 0 360 ellipse cp s -1.000000 1.000000 1.000000 srgb -n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse f -0.100000 slw -[] 0 sd -[] 0 sd -0.000000 0.000000 0.000000 srgb -n 2.800000 17.050000 0.500000 0.500000 0 360 ellipse cp s -/Helvetica-latin1 ff 1.400000 scf sf -(Passive off-hooked trailer) -3.804070 8.965100 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -(rotation:z1) dup sw 2 div 37.316942 ex sub 36.153553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Helvetica-latin1 ff 0.700000 scf sf -(rotation:z2) dup sw 2 div 8.316942 ex sub 36.153553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(TF:D) dup sw 2 div 14.723192 ex sub 43.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(TF:L) dup sw 2 div 30.660692 ex sub 44.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(SS:[x2]) dup sw 2 div -1.589308 ex sub 36.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(SS:[y2]) dup sw 2 div 8.410692 ex sub 29.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 45.549905 35.985115 m 41.683312 35.946832 l s -n 41.683312 35.946832 m 42.974861 36.709656 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 37.310793 30.925048 m 37.314507 33.952852 l s -n 37.314507 33.952852 m 38.062913 32.652895 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(1) dup sw 2 div 23.816942 ex sub 36.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(1) dup sw 2 div 23.816942 ex sub 53.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 32.949728 35.903600 m 25.684133 35.903600 l s -n 32.949728 35.903600 m 32.949728 36.653600 l s -n 32.949728 35.903600 m 32.949728 35.153600 l s -n 25.684133 35.903600 m 26.983171 36.653600 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 35.883879 37.625929 m 32.093721 42.181271 l s -n 35.883879 37.625929 m 36.460416 38.105622 l s -n 35.883879 37.625929 m 35.307342 37.146236 l s -n 32.093721 42.181271 m 33.501110 41.662373 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 21.949852 35.903600 m 12.681067 35.903600 l s -n 21.949852 35.903600 m 21.949852 36.653600 l s -n 21.949852 35.903600 m 21.949852 35.153600 l s -n 12.681067 35.903600 m 13.980105 36.653600 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 29.331926 45.651016 m 25.145674 51.156184 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 25.145674 51.156184 m 26.528977 50.576121 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 22.322407 51.260163 m 16.263229 44.597112 l s -n 16.263229 44.597112 m 17.692081 45.053599 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 13.176908 41.213996 m 9.863232 37.593204 l s -n 13.176908 41.213996 m 13.730183 40.707649 l s -n 13.176908 41.213996 m 12.623633 41.720342 l s -n 9.863232 37.593204 m 11.293525 38.045159 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 3.949758 35.903600 m 1.870928 35.903600 l s -n 3.949758 35.903600 m 3.949758 36.653600 l s -n 3.949758 35.903600 m 3.949758 35.153600 l s -n 1.870928 35.903600 m 3.169966 36.653600 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 8.343080 33.951785 m 8.384550 30.855415 l s -n 8.343080 33.951785 m 9.093013 33.961829 l s -n 8.343080 33.951785 m 7.593148 33.941742 l s -n 8.384550 30.855415 m 9.117086 32.164380 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(Df:v) dup sw 2 div 23.566992 ex sub 30.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(Df:omega) dup sw 2 div 23.841942 ex sub 57.203553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 23.735599 33.951585 m 23.648301 31.855615 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 23.648301 31.855615 m 24.451710 33.122317 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 23.829110 54.857194 m 23.829690 54.950006 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 23.829110 54.857194 m 24.587214 56.151519 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(INTF:yaw) dup sw 2 div 23.741942 ex sub 48.253553 m gs 1 -1 sc sh gr -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 23.787299 50.949909 m 23.771501 49.907291 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 23.771501 49.907291 m 24.541095 51.194817 l s -n 23.771501 49.907291 m 23.041268 51.217542 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(0) dup sw 2 div 23.816942 ex sub 43.203553 m gs 1 -1 sc sh gr -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 23.770904 46.000671 m 23.787896 44.856529 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 23.787896 44.856529 m 24.518523 46.166562 l s -n 23.787896 44.856529 m 23.018688 46.144287 l s -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 25.571888 41.993606 m 34.593330 37.315821 l s -n 34.593330 37.315821 m 33.785341 38.579607 l s -n 34.593330 37.315821 m 33.094865 37.247975 l s -n 34.593330 37.315821 m 34.938568 37.981637 l s -n 34.593330 37.315821 m 34.248092 36.650006 l s -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 15.214768 38.274599 m 12.037872 37.182601 l s -n 12.037872 37.182601 m 13.022564 38.314140 l s -n 12.037872 37.182601 m 13.510160 36.895602 l s -n 12.037872 37.182601 m 11.794074 37.891870 l s -n 12.037872 37.182601 m 12.281670 36.473332 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(AE:negative) dup sw 2 div 18.935642 ex sub 39.803553 m gs 1 -1 sc sh gr -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 22.129609 41.745601 m 21.148531 41.072280 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 21.148531 41.072280 m 21.795193 42.425730 l s -n 21.148531 41.072280 m 22.643984 41.188979 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(1) dup sw 2 div 47.416942 ex sub 36.303553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(1) dup sw 2 div 37.308342 ex sub 29.274253 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(INTF) dup sw 2 div 47.435692 ex sub 40.903553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(INTF) dup sw 2 div 42.499992 ex sub 29.253553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(SS:[y1]) dup sw 2 div 37.260692 ex sub 21.703553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(SS:[x1]) dup sw 2 div 56.110692 ex sub 36.153553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 52.650329 35.913304 m 49.283266 35.971398 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 52.650329 35.913304 m 52.663268 36.663193 l s -n 52.650329 35.913304 m 52.637391 35.163416 l s -n 49.283266 35.971398 m 50.595049 36.698877 l s -0.100000 slw -[] 0 sd -[] 0 sd -1 slc -n 37.272986 23.353614 m 37.296114 27.024286 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 37.272986 23.353614 m 38.022971 23.348889 l s -n 37.272986 23.353614 m 36.523001 23.358340 l s -n 37.296114 27.024286 m 38.037914 25.720548 l s -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 39.172814 28.966866 m 39.664062 28.964907 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 39.664062 28.964907 m 38.368025 29.720081 l s -n 39.664062 28.964907 m 38.362044 28.220093 l s -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 47.424885 37.957339 m 47.427716 38.650142 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 47.427716 38.650142 m 48.172401 37.348049 l s -n 47.427716 38.650142 m 46.672413 37.354179 l s -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(De:y) dup sw 2 div 48.321492 ex sub 29.353553 m gs 1 -1 sc sh gr -0.100000 slw -[] 0 sd -[] 0 sd -0 slc -0 slj -0 slc -0 slj -[] 0 sd -/Times-Roman-latin1 ff 0.700000 scf sf -(De:x) dup sw 2 div 47.421442 ex sub 45.253553 m gs 1 -1 sc sh gr -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 45.333284 29.002269 m 45.570649 29.006347 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 45.570649 29.006347 m 44.258922 29.733925 l s -n 45.570649 29.006347 m 44.284684 28.234146 l s -0.050000 slw -[] 0 sd -[] 0 sd -1 slc -n 47.429326 42.556219 m 47.427874 43.000981 l s -/Helvetica-latin1 ff 0.560000 scf sf -n 47.427874 43.000981 m 48.182111 41.704398 l s -n 47.427874 43.000981 m 46.682119 41.699501 l s -showpage DELETED mttroot/mtt/lib/examples/Dia/robotrain/trailer_lbl.txt Index: mttroot/mtt/lib/examples/Dia/robotrain/trailer_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/trailer_lbl.txt +++ mttroot/mtt/lib/examples/Dia/robotrain/trailer_lbl.txt @@ -1,61 +0,0 @@ -#SUMMARY trailer -#DESCRIPTION Detailed description here - -## System trailer, representation lbl, language txt -## File trailer_lbl.txt -## Generated by MTT on Wed Sep 8 00:41:53 BST 2004 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - -## Port aliases -#ALIAS in x1,y1 -#ALIAS out x2,y2 - -## Argument aliases -#ALIAS $1 D -#ALIAS $2 L - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type 1 (anonymous => default parameters) - # 1 - # 1 - # 1 - -## Component type AE - negative lin effort,-1 - -## Component type De - x SS external - y SS external - -## Component type Df - omega SS external - v SS external - -## Component type INTF - x_e none - y_e none - yaw none - -## Component type SS - [x1] SS external,external - [x2] SS external,external - [y1] SS external,external - [y2] SS external,external - -## Component type TF - D lin flow,-D - L lin effort,L - -## Component type rotation - z1 rotate_z - z2 rotate_z - DELETED mttroot/mtt/lib/examples/Dia/robotrain/trajectory.ps Index: mttroot/mtt/lib/examples/Dia/robotrain/trajectory.ps ================================================================== --- mttroot/mtt/lib/examples/Dia/robotrain/trajectory.ps +++ mttroot/mtt/lib/examples/Dia/robotrain/trajectory.ps @@ -1,927 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: trajectory.eps -%%Creator: gnuplot 4.0 patchlevel 0 -%%CreationDate: Sun Sep 12 19:59:53 2004 -%%DocumentFonts: (atend) -%%BoundingBox: 50 50 410 302 -%%Orientation: Portrait -%%EndComments -/gnudict 256 dict def -gnudict begin -/Color false def -/Solid false def -/gnulinewidth 5.000 def -/userlinewidth gnulinewidth def -/vshift -46 def -/dl {10.0 mul} def -/hpt_ 31.5 def -/vpt_ 31.5 def -/hpt hpt_ def -/vpt vpt_ def -/Rounded false def -/M {moveto} bind def -/L {lineto} bind def -/R {rmoveto} bind def -/V {rlineto} bind def -/N {newpath moveto} bind def -/C {setrgbcolor} bind def -/f {rlineto fill} bind def -/vpt2 vpt 2 mul def -/hpt2 hpt 2 mul def -/Lshow { currentpoint stroke M - 0 vshift R show } def -/Rshow { currentpoint stroke M - dup stringwidth pop neg vshift R show } def -/Cshow { currentpoint stroke M - dup stringwidth pop -2 div vshift R show } def -/UP { dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def - /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def } def -/DL { Color {setrgbcolor Solid {pop []} if 0 setdash } - {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse } def -/BL { stroke userlinewidth 2 mul setlinewidth - Rounded { 1 setlinejoin 1 setlinecap } if } def -/AL { stroke userlinewidth 2 div setlinewidth - Rounded { 1 setlinejoin 1 setlinecap } if } def -/UL { dup gnulinewidth mul /userlinewidth exch def - dup 1 lt {pop 1} if 10 mul /udl exch def } def -/PL { stroke userlinewidth setlinewidth - Rounded { 1 setlinejoin 1 setlinecap } if } def -/LTw { PL [] 1 setgray } def -/LTb { BL [] 0 0 0 DL } def -/LTa { AL [1 udl mul 2 udl mul] 0 setdash 0 0 0 setrgbcolor } def -/LT0 { PL [] 1 0 0 DL } def -/LT1 { PL [4 dl 2 dl] 0 1 0 DL } def -/LT2 { PL [2 dl 3 dl] 0 0 1 DL } def -/LT3 { PL [1 dl 1.5 dl] 1 0 1 DL } def -/LT4 { PL [5 dl 2 dl 1 dl 2 dl] 0 1 1 DL } def -/LT5 { PL [4 dl 3 dl 1 dl 3 dl] 1 1 0 DL } def -/LT6 { PL [2 dl 2 dl 2 dl 4 dl] 0 0 0 DL } def -/LT7 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.3 0 DL } def -/LT8 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def -/Pnt { stroke [] 0 setdash - gsave 1 setlinecap M 0 0 V stroke grestore } def -/Dia { stroke [] 0 setdash 2 copy vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V closepath stroke - Pnt } def -/Pls { stroke [] 0 setdash vpt sub M 0 vpt2 V - currentpoint stroke M - hpt neg vpt neg R hpt2 0 V stroke - } def -/Box { stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V closepath stroke - Pnt } def -/Crs { stroke [] 0 setdash exch hpt sub exch vpt add M - hpt2 vpt2 neg V currentpoint stroke M - hpt2 neg 0 R hpt2 vpt2 V stroke } def -/TriU { stroke [] 0 setdash 2 copy vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V closepath stroke - Pnt } def -/Star { 2 copy Pls Crs } def -/BoxF { stroke [] 0 setdash exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V closepath fill } def -/TriUF { stroke [] 0 setdash vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V closepath fill } def -/TriD { stroke [] 0 setdash 2 copy vpt 1.12 mul sub M - hpt neg vpt 1.62 mul V - hpt 2 mul 0 V - hpt neg vpt -1.62 mul V closepath stroke - Pnt } def -/TriDF { stroke [] 0 setdash vpt 1.12 mul sub M - hpt neg vpt 1.62 mul V - hpt 2 mul 0 V - hpt neg vpt -1.62 mul V closepath fill} def -/DiaF { stroke [] 0 setdash vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V closepath fill } def -/Pent { stroke [] 0 setdash 2 copy gsave - translate 0 hpt M 4 {72 rotate 0 hpt L} repeat - closepath stroke grestore Pnt } def -/PentF { stroke [] 0 setdash gsave - translate 0 hpt M 4 {72 rotate 0 hpt L} repeat - closepath fill grestore } def -/Circle { stroke [] 0 setdash 2 copy - hpt 0 360 arc stroke Pnt } def -/CircleF { stroke [] 0 setdash hpt 0 360 arc fill } def -/C0 { BL [] 0 setdash 2 copy moveto vpt 90 450 arc } bind def -/C1 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 90 arc closepath fill - vpt 0 360 arc closepath } bind def -/C2 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 90 180 arc closepath fill - vpt 0 360 arc closepath } bind def -/C3 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 180 arc closepath fill - vpt 0 360 arc closepath } bind def -/C4 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 180 270 arc closepath fill - vpt 0 360 arc closepath } bind def -/C5 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 90 arc - 2 copy moveto - 2 copy vpt 180 270 arc closepath fill - vpt 0 360 arc } bind def -/C6 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 90 270 arc closepath fill - vpt 0 360 arc closepath } bind def -/C7 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 270 arc closepath fill - vpt 0 360 arc closepath } bind def -/C8 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 270 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/C9 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 270 450 arc closepath fill - vpt 0 360 arc closepath } bind def -/C10 { BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill - 2 copy moveto - 2 copy vpt 90 180 arc closepath fill - vpt 0 360 arc closepath } bind def -/C11 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 180 arc closepath fill - 2 copy moveto - 2 copy vpt 270 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/C12 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 180 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/C13 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 0 90 arc closepath fill - 2 copy moveto - 2 copy vpt 180 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/C14 { BL [] 0 setdash 2 copy moveto - 2 copy vpt 90 360 arc closepath fill - vpt 0 360 arc } bind def -/C15 { BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill - vpt 0 360 arc closepath } bind def -/Rec { newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto - neg 0 rlineto closepath } bind def -/Square { dup Rec } bind def -/Bsquare { vpt sub exch vpt sub exch vpt2 Square } bind def -/S0 { BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare } bind def -/S1 { BL [] 0 setdash 2 copy vpt Square fill Bsquare } bind def -/S2 { BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def -/S3 { BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare } bind def -/S4 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def -/S5 { BL [] 0 setdash 2 copy 2 copy vpt Square fill - exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def -/S6 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare } bind def -/S7 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill - 2 copy vpt Square fill - Bsquare } bind def -/S8 { BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare } bind def -/S9 { BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare } bind def -/S10 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill - Bsquare } bind def -/S11 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill - Bsquare } bind def -/S12 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare } bind def -/S13 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill - 2 copy vpt Square fill Bsquare } bind def -/S14 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill - 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def -/S15 { BL [] 0 setdash 2 copy Bsquare fill Bsquare } bind def -/D0 { gsave translate 45 rotate 0 0 S0 stroke grestore } bind def -/D1 { gsave translate 45 rotate 0 0 S1 stroke grestore } bind def -/D2 { gsave translate 45 rotate 0 0 S2 stroke grestore } bind def -/D3 { gsave translate 45 rotate 0 0 S3 stroke grestore } bind def -/D4 { gsave translate 45 rotate 0 0 S4 stroke grestore } bind def -/D5 { gsave translate 45 rotate 0 0 S5 stroke grestore } bind def -/D6 { gsave translate 45 rotate 0 0 S6 stroke grestore } bind def -/D7 { gsave translate 45 rotate 0 0 S7 stroke grestore } bind def -/D8 { gsave translate 45 rotate 0 0 S8 stroke grestore } bind def -/D9 { gsave translate 45 rotate 0 0 S9 stroke grestore } bind def -/D10 { gsave translate 45 rotate 0 0 S10 stroke grestore } bind def -/D11 { gsave translate 45 rotate 0 0 S11 stroke grestore } bind def -/D12 { gsave translate 45 rotate 0 0 S12 stroke grestore } bind def -/D13 { gsave translate 45 rotate 0 0 S13 stroke grestore } bind def -/D14 { gsave translate 45 rotate 0 0 S14 stroke grestore } bind def -/D15 { gsave translate 45 rotate 0 0 S15 stroke grestore } bind def -/DiaE { stroke [] 0 setdash vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V closepath stroke } def -/BoxE { stroke [] 0 setdash exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V closepath stroke } def -/TriUE { stroke [] 0 setdash vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V closepath stroke } def -/TriDE { stroke [] 0 setdash vpt 1.12 mul sub M - hpt neg vpt 1.62 mul V - hpt 2 mul 0 V - hpt neg vpt -1.62 mul V closepath stroke } def -/PentE { stroke [] 0 setdash gsave - translate 0 hpt M 4 {72 rotate 0 hpt L} repeat - closepath stroke grestore } def -/CircE { stroke [] 0 setdash - hpt 0 360 arc stroke } def -/Opaque { gsave closepath 1 setgray fill grestore 0 setgray closepath } def -/DiaW { stroke [] 0 setdash vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V Opaque stroke } def -/BoxW { stroke [] 0 setdash exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V Opaque stroke } def -/TriUW { stroke [] 0 setdash vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V Opaque stroke } def -/TriDW { stroke [] 0 setdash vpt 1.12 mul sub M - hpt neg vpt 1.62 mul V - hpt 2 mul 0 V - hpt neg vpt -1.62 mul V Opaque stroke } def -/PentW { stroke [] 0 setdash gsave - translate 0 hpt M 4 {72 rotate 0 hpt L} repeat - Opaque stroke grestore } def -/CircW { stroke [] 0 setdash - hpt 0 360 arc Opaque stroke } def -/BoxFill { gsave Rec 1 setgray fill grestore } def -/BoxColFill { - gsave Rec - /Fillden exch def - currentrgbcolor - /ColB exch def /ColG exch def /ColR exch def - /ColR ColR Fillden mul Fillden sub 1 add def - /ColG ColG Fillden mul Fillden sub 1 add def - /ColB ColB Fillden mul Fillden sub 1 add def - ColR ColG ColB setrgbcolor - fill grestore } def -% -% PostScript Level 1 Pattern Fill routine -% Usage: x y w h s a XX PatternFill -% x,y = lower left corner of box to be filled -% w,h = width and height of box -% a = angle in degrees between lines and x-axis -% XX = 0/1 for no/yes cross-hatch -% -/PatternFill { gsave /PFa [ 9 2 roll ] def - PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate - PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec - gsave 1 setgray fill grestore clip - currentlinewidth 0.5 mul setlinewidth - /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def - 0 0 M PFa 5 get rotate PFs -2 div dup translate - 0 1 PFs PFa 4 get div 1 add floor cvi - { PFa 4 get mul 0 M 0 PFs V } for - 0 PFa 6 get ne { - 0 1 PFs PFa 4 get div 1 add floor cvi - { PFa 4 get mul 0 2 1 roll M PFs 0 V } for - } if - stroke grestore } def -% -/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont -dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall -currentdict end definefont pop -end -%%EndProlog -gnudict begin -gsave -50 50 translate -0.050 0.050 scale -0 setgray -newpath -(Helvetica) findfont 140 scalefont setfont -1.000 UL -LTb -1.000 UL -LTa -714 560 M -6248 0 V -1.000 UL -LTb -714 560 M -63 0 V -6185 0 R --63 0 V -630 560 M -gsave 0 setgray -(-1) Rshow -grestore -1.000 UL -LTb -1.000 UL -LTa -714 1140 M -6248 0 V -1.000 UL -LTb -714 1140 M -63 0 V -6185 0 R --63 0 V --6269 0 R -gsave 0 setgray -(-0.5) Rshow -grestore -1.000 UL -LTb -1.000 UL -LTa -714 1720 M -6248 0 V -1.000 UL -LTb -714 1720 M -63 0 V -6185 0 R --63 0 V --6269 0 R -gsave 0 setgray -( 0) Rshow -grestore -1.000 UL -LTb -1.000 UL -LTa -714 2300 M -6248 0 V -1.000 UL -LTb -714 2300 M -63 0 V -6185 0 R --63 0 V --6269 0 R -gsave 0 setgray -( 0.5) Rshow -grestore -1.000 UL -LTb -1.000 UL -LTa -714 2880 M -6248 0 V -1.000 UL -LTb -714 2880 M -63 0 V -6185 0 R --63 0 V --6269 0 R -gsave 0 setgray -( 1) Rshow -grestore -1.000 UL -LTb -1.000 UL -LTa -714 3460 M -6248 0 V -1.000 UL -LTb -714 3460 M -63 0 V -6185 0 R --63 0 V --6269 0 R -gsave 0 setgray -( 1.5) Rshow -grestore -1.000 UL -LTb -1.000 UL -LTa -714 4040 M -6248 0 V -1.000 UL -LTb -714 4040 M -63 0 V -6185 0 R --63 0 V --6269 0 R -gsave 0 setgray -( 2) Rshow -grestore -1.000 UL -LTb -1.000 UL -LTa -714 4620 M -6248 0 V -1.000 UL -LTb -714 4620 M -63 0 V -6185 0 R --63 0 V --6269 0 R -gsave 0 setgray -( 2.5) Rshow -grestore -1.000 UL -LTb -1.000 UL -LTa -714 560 M -0 4060 V -1.000 UL -LTb -714 560 M -0 63 V -0 3997 R -0 -63 V -714 420 M -gsave 0 setgray -(-5) Cshow -grestore -1.000 UL -LTb -1.000 UL -LTa -1607 560 M -0 3577 V -0 420 R -0 63 V -1.000 UL -LTb -1607 560 M -0 63 V -0 3997 R -0 -63 V -0 -4137 R -gsave 0 setgray -(-4) Cshow -grestore -1.000 UL -LTb -1.000 UL -LTa -2499 560 M -0 4060 V -1.000 UL -LTb -2499 560 M -0 63 V -0 3997 R -0 -63 V -0 -4137 R -gsave 0 setgray -(-3) Cshow -grestore -1.000 UL -LTb -1.000 UL -LTa -3392 560 M -0 4060 V -1.000 UL -LTb -3392 560 M -0 63 V -0 3997 R -0 -63 V -0 -4137 R -gsave 0 setgray -(-2) Cshow -grestore -1.000 UL -LTb -1.000 UL -LTa -4284 560 M -0 4060 V -1.000 UL -LTb -4284 560 M -0 63 V -0 3997 R -0 -63 V -0 -4137 R -gsave 0 setgray -(-1) Cshow -grestore -1.000 UL -LTb -1.000 UL -LTa -5177 560 M -0 4060 V -1.000 UL -LTb -5177 560 M -0 63 V -0 3997 R -0 -63 V -0 -4137 R -gsave 0 setgray -( 0) Cshow -grestore -1.000 UL -LTb -1.000 UL -LTa -6069 560 M -0 4060 V -1.000 UL -LTb -6069 560 M -0 63 V -0 3997 R -0 -63 V -0 -4137 R -gsave 0 setgray -( 1) Cshow -grestore -1.000 UL -LTb -1.000 UL -LTa -6962 560 M -0 4060 V -1.000 UL -LTb -6962 560 M -0 63 V -0 3997 R -0 -63 V -0 -4137 R -gsave 0 setgray -( 2) Cshow -grestore -1.000 UL -LTb -1.000 UL -LTb -714 560 M -6248 0 V -0 4060 V --6248 0 V -714 560 L -LTb -140 2590 M -gsave 0 setgray -currentpoint gsave translate 90 rotate 0 0 M -(y) Cshow -grestore -grestore -LTb -3838 210 M -gsave 0 setgray -(x) Cshow -grestore -LTb -3838 4830 M -gsave 0 setgray -(MTT model "robotrain": trajectory of trailer links) Cshow -grestore -210 70 M -gsave 0 setgray -(Sun Sep 12 19:59:53 2004) Lshow -grestore -1.000 UP -1.000 UP -1.000 UL -LT0 -LTb -1302 4487 M -gsave 0 setgray -(front) Rshow -grestore -LT0 -4284 1720 Pls -4377 1609 Pls -4479 1511 Pls -4587 1427 Pls -4701 1357 Pls -4820 1302 Pls -4942 1263 Pls -5067 1240 Pls -5193 1234 Pls -5319 1244 Pls -5444 1270 Pls -5566 1312 Pls -5684 1369 Pls -5797 1442 Pls -5904 1529 Pls -6004 1630 Pls -6095 1743 Pls -6178 1867 Pls -6250 2001 Pls -6312 2144 Pls -6362 2294 Pls -6401 2451 Pls -6427 2611 Pls -6441 2774 Pls -6443 2938 Pls -6431 3101 Pls -6408 3262 Pls -6372 3419 Pls -6324 3571 Pls -6265 3716 Pls -6195 3852 Pls -6114 3979 Pls -6025 4094 Pls -5927 4198 Pls -5822 4288 Pls -5710 4364 Pls -5593 4425 Pls -5472 4471 Pls -5347 4500 Pls -5222 4514 Pls -5096 4511 Pls -4970 4492 Pls -4847 4456 Pls -4727 4405 Pls -4612 4338 Pls -4502 4257 Pls -4399 4162 Pls -4304 4054 Pls -4218 3935 Pls -4141 3804 Pls -4075 3665 Pls -4020 3517 Pls -3976 3363 Pls -3945 3205 Pls -3926 3043 Pls -3919 2879 Pls -3925 2715 Pls -3943 2553 Pls -3974 2394 Pls -4017 2240 Pls -4072 2092 Pls -4138 1952 Pls -4214 1821 Pls -4299 1701 Pls -4394 1592 Pls -4496 1496 Pls -4606 1414 Pls -4721 1347 Pls -4840 1295 Pls -4963 1258 Pls -5089 1238 Pls -5215 1234 Pls -5340 1247 Pls -5465 1276 Pls -5586 1320 Pls -5703 1381 Pls -5816 1456 Pls -5921 1545 Pls -6020 1648 Pls -6110 1763 Pls -6190 1889 Pls -6261 2025 Pls -6321 2169 Pls -6369 2320 Pls -6406 2477 Pls -6430 2638 Pls -6442 2801 Pls -6442 2965 Pls -6428 3128 Pls -6403 3289 Pls -6365 3445 Pls -6315 3596 Pls -6254 3740 Pls -6182 3874 Pls -6100 3999 Pls -6009 4113 Pls -5910 4214 Pls -5803 4302 Pls -5690 4375 Pls -5573 4434 Pls -5451 4477 Pls -1585 4487 Pls -1.000 UP -1.000 UL -LT1 -LTb -1302 4347 M -gsave 0 setgray -(middle) Rshow -grestore -LT1 -2499 1720 Crs -2599 1820 Crs -2715 1882 Crs -2839 1910 Crs -2965 1909 Crs -3090 1884 Crs -3212 1840 Crs -3330 1784 Crs -3446 1719 Crs -3560 1647 Crs -3672 1573 Crs -3784 1497 Crs -3897 1423 Crs -4011 1352 Crs -4126 1285 Crs -4243 1223 Crs -4362 1168 Crs -4483 1121 Crs -4605 1083 Crs -4730 1055 Crs -4855 1037 Crs -4981 1031 Crs -5107 1036 Crs -5233 1054 Crs -5357 1085 Crs -5479 1128 Crs -5597 1184 Crs -5712 1253 Crs -5821 1334 Crs -5925 1428 Crs -6022 1533 Crs -6111 1649 Crs -6192 1775 Crs -6264 1910 Crs -6325 2053 Crs -6377 2203 Crs -6417 2358 Crs -6446 2518 Crs -6463 2680 Crs -6468 2844 Crs -6461 3008 Crs -6442 3170 Crs -6410 3329 Crs -6368 3483 Crs -6313 3631 Crs -6248 3772 Crs -6173 3903 Crs -6088 4025 Crs -5995 4135 Crs -5893 4232 Crs -5785 4317 Crs -5671 4386 Crs -5552 4441 Crs -5430 4481 Crs -5305 4504 Crs -5179 4511 Crs -5053 4502 Crs -4928 4477 Crs -4806 4436 Crs -4688 4379 Crs -4574 4308 Crs -4467 4222 Crs -4366 4122 Crs -4274 4011 Crs -4191 3887 Crs -4117 3754 Crs -4055 3612 Crs -4003 3462 Crs -3963 3306 Crs -3935 3146 Crs -3920 2984 Crs -3917 2820 Crs -3927 2656 Crs -3950 2495 Crs -3984 2337 Crs -4031 2185 Crs -4089 2039 Crs -4157 1902 Crs -4237 1774 Crs -4325 1657 Crs -4422 1552 Crs -4527 1460 Crs -4638 1383 Crs -4754 1320 Crs -4875 1272 Crs -4999 1241 Crs -5124 1225 Crs -5251 1226 Crs -5376 1244 Crs -5500 1277 Crs -5620 1326 Crs -5736 1391 Crs -5846 1471 Crs -5950 1564 Crs -6046 1670 Crs -6133 1789 Crs -6211 1918 Crs -6279 2056 Crs -6335 2203 Crs -6380 2356 Crs -6413 2514 Crs -1585 4347 Crs -1.000 UP -1.000 UL -LT2 -LTb -1302 4207 M -gsave 0 setgray -(rear) Rshow -grestore -LT2 -714 1720 Star -819 1631 Star -942 1601 Star -1068 1614 Star -1190 1655 Star -1309 1711 Star -1426 1771 Star -1544 1830 Star -1664 1882 Star -1786 1925 Star -1910 1956 Star -2035 1973 Star -2161 1977 Star -2287 1968 Star -2412 1946 Star -2536 1912 Star -2658 1869 Star -2777 1817 Star -2895 1758 Star -3011 1694 Star -3126 1625 Star -3240 1554 Star -3353 1481 Star -3466 1409 Star -3579 1337 Star -3693 1267 Star -3809 1199 Star -3925 1136 Star -4043 1078 Star -4163 1025 Star -4284 979 Star -4406 940 Star -4530 909 Star -4655 887 Star -4781 874 Star -4907 871 Star -5033 879 Star -5159 897 Star -5283 927 Star -5405 968 Star -5524 1021 Star -5641 1085 Star -5752 1161 Star -5859 1249 Star -5960 1347 Star -6055 1455 Star -6142 1574 Star -6221 1702 Star -6292 1838 Star -6353 1981 Star -6404 2131 Star -6444 2287 Star -6474 2446 Star -6492 2608 Star -6499 2772 Star -6494 2936 Star -6478 3099 Star -6450 3259 Star -6411 3414 Star -6360 3565 Star -6299 3708 Star -6227 3843 Star -6146 3969 Star -6056 4084 Star -5958 4187 Star -5853 4278 Star -5742 4355 Star -5625 4417 Star -5504 4465 Star -5381 4497 Star -5255 4513 Star -5129 4513 Star -5003 4497 Star -4880 4465 Star -4759 4417 Star -4642 4355 Star -4531 4277 Star -4426 4186 Star -4329 4082 Star -4240 3965 Star -4160 3838 Star -4090 3702 Star -4031 3557 Star -3984 3405 Star -3948 3247 Star -3925 3086 Star -3914 2923 Star -3915 2759 Star -3929 2596 Star -3955 2436 Star -3994 2279 Star -4044 2129 Star -4106 1986 Star -4178 1851 Star -4260 1727 Star -4351 1614 Star -4451 1513 Star -4557 1425 Star -4670 1352 Star -4788 1294 Star -4910 1251 Star -1585 4207 Star -1.000 UL -LTb -714 560 M -6248 0 V -0 4060 V --6248 0 V -714 560 L -1.000 UP -stroke -grestore -end -showpage -%%Trailer -%%DocumentFonts: Helvetica DELETED mttroot/mtt/lib/examples/Electrical/rc/pulse/rc_input.txt Index: mttroot/mtt/lib/examples/Electrical/rc/pulse/rc_input.txt ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc/pulse/rc_input.txt +++ mttroot/mtt/lib/examples/Electrical/rc/pulse/rc_input.txt @@ -1,10 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System rc, representation input, language txt; -## File rc_input.txt; -## Generated by MTT on Wed May 1 08:47:22 BST 2002; - - - -rc__e1 = 1.0*(t<1); # On for t<1 DELETED mttroot/mtt/lib/examples/Electrical/rc/r10/rc_numpar.txt Index: mttroot/mtt/lib/examples/Electrical/rc/r10/rc_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc/r10/rc_numpar.txt +++ mttroot/mtt/lib/examples/Electrical/rc/r10/rc_numpar.txt @@ -1,11 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System rc, representation numpar, language txt; -## File rc_numpar.txt; -## Generated by MTT on Wed May 1 10:18:33 BST 2002; - - - -c = 1.0; # c = 1 F -r = 10.0; # r = 10 ohms DELETED mttroot/mtt/lib/examples/Electrical/rc/rc_abg.fig Index: mttroot/mtt/lib/examples/Electrical/rc/rc_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc/rc_abg.fig +++ mttroot/mtt/lib/examples/Electrical/rc/rc_abg.fig @@ -1,63 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 1800 1125 162 162 1800 1125 1890 1260 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1802 4277 2702 4277 2477 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 4277 4052 4277 3827 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4502 4277 5402 4277 5177 4502 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 4051 2926 3151 3151 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 4051 4276 3151 4501 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 4276 2701 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5401 4051 5401 4276 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5401 4276 5401 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 4051 2701 4276 -2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 2475 585 3375 585 3375 765 2475 765 2475 585 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4050 1215 4500 1215 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4050 1080 4500 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 675 2475 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3375 675 5400 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4275 675 4275 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4275 1215 4275 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 1575 5400 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 945 1800 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 1575 1800 1260 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 5400 1530 5400 765 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6750 5625 6750 225 675 225 675 5625 6750 5625 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 4367 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 4277 4367 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 660 5987 4367 SS:e2\001 -4 1 -1 0 0 0 20 0.0000 4 195 375 2926 2926 R:r\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 4276 2926 C:c\001 -4 1 -1 0 0 0 20 0.0000 4 195 660 1395 4365 SS:e1\001 -4 0 1 1 0 0 20 0.0000 4 135 105 2880 450 r\001 -4 0 1 1 0 0 20 0.0000 4 135 120 4680 1215 c\001 -4 0 1 1 0 0 20 0.0000 4 135 120 5625 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 195 135 5715 1305 2\001 -4 0 1 1 0 0 20 0.0000 4 135 120 1260 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 195 135 1350 1305 1\001 -4 1 1 1 0 0 20 0.0000 4 255 1350 3600 4995 Bond graph\001 -4 1 1 1 0 0 20 0.0000 4 195 1200 3600 2025 Schematic\001 DELETED mttroot/mtt/lib/examples/Electrical/rc/rc_desc.tex Index: mttroot/mtt/lib/examples/Electrical/rc/rc_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc/rc_desc.tex +++ mttroot/mtt/lib/examples/Electrical/rc/rc_desc.tex @@ -1,21 +0,0 @@ -% Verbal description for system rc (rc_desc.tex) -% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/08/24 10:27:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{rc} is - displayed in Figure \Ref{rc_abg} and its label - file is listed in Section \Ref{sec:rc_lbl}. - The subsystems are listed in Section \Ref{sec:rc_sub}. - -The system \textbf{rc} is the simple electrical rc circuit shown in -Figure \Ref{rc_abg}. It can be regarded as a single-input -single-output system with input $e_1$ and output $e_2$. DELETED mttroot/mtt/lib/examples/Electrical/rc/rc_lbl.txt Index: mttroot/mtt/lib/examples/Electrical/rc/rc_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc/rc_lbl.txt +++ mttroot/mtt/lib/examples/Electrical/rc/rc_lbl.txt @@ -1,36 +0,0 @@ -## Label file for system rc (rc_lbl.txt) -#SUMMARY rc a simple rc circuit -#DESCRIPTION A basic linear voltage-in voltage-out RC circuit -#DESCRIPTION A standard test example for MTT - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.1 2000/12/28 17:40:36 peterg -# ## To RCS -# ## -# ############################################################### - - -# Port aliases - -# Argument aliases -#ALIAS $1 c -#ALIAS $2 r - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# component-name cr_name arg1,arg2,..argn -# blank - -# ---- Component labels ---- - c lin effort,c - -# Component type R - r lin flow,r - -# Component type SS - e1 SS external,internal - e2 SS external,0 DELETED mttroot/mtt/lib/examples/Electrical/rc/rc_rep.txt Index: mttroot/mtt/lib/examples/Electrical/rc/rc_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc/rc_rep.txt +++ mttroot/mtt/lib/examples/Electrical/rc/rc_rep.txt @@ -1,55 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system rc (rc_rep.txt) -## Generated by MTT on" Wed May 1 08:56:38 BST 2002. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt rc abg tex # The system description -mtt rc cbg ps # The causal bond graph -mtt rc struc tex # The system structure -mtt rc sympar txt # The system parameters -## Uncomment the following lines or add others -## mtt rc dae tex # The system dae -mtt rc ode tex # The system ode -## mtt rc sspar tex # Steady-state parameters -## mtt rc ss tex # Steady state -## mtt rc dm tex # Descriptor matrices (of linearised system) -mtt rc sm tex # State matrices (of linearised system) -mtt rc tf tex # Transfer function (of linearised system) -mtt rc lmfr ps # log modulus of frequency response (of linearised system) -mtt rc simpar txt # Simulation parameters -## mtt rc state tex # Simulation initial state - -## Default -mtt rc numpar txt # Numerical simulation parameters -mtt rc input txt # Simulation input -mtt rc odeso ps # Simulation output - -## Step input -mtt -dr step rc input txt # Simulation input -mtt -dr step rc odeso ps # Simulation output - -## Pulse input -mtt -dr pulse rc input txt # Simulation input -mtt -dr pulse rc odeso ps # Simulation output - -## r = 10 -## Step input -mtt -dr step -dr r10 rc numpar txt # Numerical simulation parameters -mtt -dr step -dr r10 rc input txt # Simulation input -mtt -dr step -dr r10 rc odeso ps # Simulation output - -## Pulse input -mtt -dr pulse -dr r10 rc numpar txt # Numerical simulation parameters -mtt -dr pulse -dr r10 rc input txt # Simulation input -mtt -dr pulse -dr r10 rc odeso ps # Simulation output - -mtt rc rep txt # This file DELETED mttroot/mtt/lib/examples/Electrical/rc/step/rc_input.txt Index: mttroot/mtt/lib/examples/Electrical/rc/step/rc_input.txt ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc/step/rc_input.txt +++ mttroot/mtt/lib/examples/Electrical/rc/step/rc_input.txt @@ -1,10 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System rc, representation input, language txt; -## File rc_input.txt; -## Generated by MTT on Wed May 1 08:51:26 BST 2002; - - - -rc__e1 = 1.0; # Step DELETED mttroot/mtt/lib/examples/Electrical/rc2/rc2_abg.fig Index: mttroot/mtt/lib/examples/Electrical/rc2/rc2_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc2/rc2_abg.fig +++ mttroot/mtt/lib/examples/Electrical/rc2/rc2_abg.fig @@ -1,19 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1350 1800 2700 1800 2475 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 1800 5400 1800 5175 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 1800 8100 1800 7875 2025 -4 1 0 100 0 18 18 0.0000 4 270 1050 3330 1890 RC:rc_1\001 -4 1 0 100 0 18 18 0.0000 4 270 1050 6075 1890 RC:rc_2\001 -4 1 0 100 0 18 18 0.0000 4 270 600 8550 1890 De:y\001 -4 1 0 100 0 18 18 0.0000 4 210 600 945 1845 Se:u\001 DELETED mttroot/mtt/lib/examples/Electrical/rc2/rc2_lbl.txt Index: mttroot/mtt/lib/examples/Electrical/rc2/rc2_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Electrical/rc2/rc2_lbl.txt +++ mttroot/mtt/lib/examples/Electrical/rc2/rc2_lbl.txt @@ -1,39 +0,0 @@ -#SUMMARY rc2 Simple example of a heirachical system -#DESCRIPTION Uses 2 copies of the RC subsystem - -## System rc2, representation lbl, language txt -## File rc2_lbl.txt -## Generated by MTT on Thu Mar 13 16:27:26 GMT 2003 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type De - y SS external - -## Component type RC - rc_1 lin c_1;r_1 - rc_2 lin c_2;r_2 - -## Component type Se - u SS external - DELETED mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_abg.fig Index: mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_abg.fig +++ mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_abg.fig @@ -1,31 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 900 2925 2475 2925 2250 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2970 2925 4545 2925 4320 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2700 2700 2700 1125 2925 1350 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 2700 2475 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 2925 7200 2925 6975 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7447 2722 7447 1147 7672 1372 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7650 2925 9225 2925 9000 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7650 2700 7650 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7425 3150 7425 4725 7650 4500 -4 1 -1 0 0 0 20 0.0000 4 195 135 2700 3015 1\001 -4 2 -1 0 0 0 20 0.0000 4 195 615 855 3015 SS:V\001 -4 1 -1 0 0 0 20 0.0000 4 195 375 2745 990 R:r\001 -4 1 -1 0 0 0 20 0.0000 4 195 870 5130 3015 CM:cm\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 7425 3015 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 405 7425 1035 C:k\001 -4 0 -1 0 0 0 20 0.0000 4 195 540 9495 3015 SS:v\001 -4 1 -1 0 0 0 20 0.0000 4 195 405 7380 5040 R:d\001 DELETED mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_desc.tex Index: mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_desc.tex +++ mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_desc.tex @@ -1,21 +0,0 @@ -% Verbal description for system Electrostatic (Electrostatic_desc.tex) -% Generated by MTT on Fri Sep 19 18:07:08 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Electrostatic} is - displayed in Figure \Ref{Electrostatic_abg} and its label - file is listed in Section \Ref{sec:Electrostatic_lbl}. - The subsystems are listed in Section \Ref{sec:Electrostatic_sub}. - -This is a simple electrostatic speaker using the \textbf{CM} -transducer component together with an electrical \textbf{R} and a -mechanical \textbf{R} and \textbf{C} components to model a compliant -support for the moving plate. See Karnopp, Margolis and Rosenberg -Section 8.2 for a similar example. - DELETED mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_input.txt Index: mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_input.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_input.txt +++ mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (Electrostatic_input.txt) -# Generated by MTT at Fri Sep 19 17:34:53 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:42:25 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Thu Jun 5 15:47:51 BST 2003: u(1) = 1.0; # V (Default value) -electrostatic__v = 1.0; # Added by MTT on Thu Jun 05 15:47:54 BST 2003 DELETED mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_lbl.txt Index: mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_lbl.txt +++ mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_lbl.txt @@ -1,31 +0,0 @@ -%SUMMARY Electrostatic: Simple electrostatic speaker model (uses CM) -%DESCRIPTION See Karnopp, Margolis & Rosenberg Section 8.2 -%% Label file for system Electrostatic (Electrostatic_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - k lin state,k - -% Component type CM - cm none c_0;x_0;m - -% Component type R - d lin flow,d - r lin flow,r - -% Component type SS - V SS external,internal - v SS 0,external DELETED mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_numpar.txt Index: mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_numpar.txt +++ mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_numpar.txt @@ -1,26 +0,0 @@ -# Numerical parameter file (Electrostatic_numpar.txt) -# Generated by MTT at Fri Sep 19 17:43:25 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:42:25 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_0 = 1.0; # Parameter c_0 for Electrostatic -d = 1.0; # Parameter d for Electrostatic -k = 100.0; # Parameter k for Electrostatic -m = 1.0; # Parameter m for Electrostatic -r = 1.0; # Parameter r for Electrostatic -x_0 = 1.0; # Parameter x_0 for Electrostatic - -# Initial states -## Removed by MTT on Thu Jun 5 15:45:05 BST 2003: x(1) = 0.0; # Initial state for Electrostatic (k) -## Removed by MTT on Thu Jun 5 15:45:05 BST 2003: x(2) = 0.0; # Initial state for Electrostatic_cm (transducer) -## Removed by MTT on Thu Jun 5 15:45:05 BST 2003: x(3) = 1.0; # Initial state for Electrostatic_cm (transducer) -## Removed by MTT on Thu Jun 5 15:45:05 BST 2003: x(4) = 0.0; # Initial state for Electrostatic_cm (mass) DELETED mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_rep.txt Index: mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_rep.txt +++ mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_rep.txt @@ -1,19 +0,0 @@ -# Outline report file for system Electrostatic (Electrostatic_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:42:25 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt Electrostatic abg tex -mtt Electrostatic struc tex -mtt Electrostatic ode tex -mtt Electrostatic numpar txt -mtt Electrostatic input txt -mtt Electrostatic simpar txt -mtt Electrostatic odeso ps DELETED mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_simp.r Index: mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_simp.r ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_simp.r +++ mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_simp.r @@ -1,10 +0,0 @@ -%% Reduce comands to simplify output for system Electrostatic (Electrostatic_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_state.txt Index: mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_state.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_state.txt +++ mttroot/mtt/lib/examples/Electromechanical/Electrostatic/Electrostatic_state.txt @@ -1,17 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System Electrostatic, representation state, language txt; -## File Electrostatic_state.txt; -## Generated by MTT on Mon Feb 5 16:40:35 GMT 2001; - - - -## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: Electrostatic_cm_1_mass = 0.0; # Default -## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: Electrostatic_cm_1_transducer = 0.0; # Default -## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: ## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: Electrostatic_cm_1_transducer_2 = 1.0; # plate displacement -## Removed by MTT on Thu Jun 5 15:45:42 BST 2003: Electrostatic_k = 0.0; # Default -electrostatic__cm__mass = 0.0; -electrostatic__cm__transducer = 0.0; -electrostatic__cm__transducer_2 = 1.0; -electrostatic__k = 0.0; DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_abg.fig Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_abg.fig +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_abg.fig @@ -1,50 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 6930 405 13770 3600 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8328 2028 9903 2028 9903 2928 8328 2928 8328 2028 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 2475 8190 2475 7965 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11475 2250 11475 1035 11700 1260 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11700 2475 12915 2475 12690 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 12915 2250 12915 2700 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 12150 3150 10800 3150 10800 450 12150 450 12150 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10035 2475 11250 2475 11025 2700 -4 1 -1 0 0 0 20 0.0000 4 255 1110 9138 2568 DC:gener\001 -4 1 1 1 0 3 20 0.0000 4 255 1575 9225 3510 DC generator\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 11475 2610 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 675 13410 2610 SS:v2\001 -4 1 -1 0 0 0 20 0.0000 4 255 585 11475 900 R:r_l\001 -4 1 1 1 0 3 20 0.0000 4 210 1575 11475 3510 Resistive load\001 --6 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1170 2475 2385 2475 2160 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4186 2476 5401 2476 5176 2701 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 13185 4275 13185 225 45 225 45 4275 13185 4275 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 2476 2026 4051 2026 4051 2926 2476 2926 2476 2026 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 7245 2925 4950 2925 4950 2025 7245 2025 7245 2925 -4 1 -1 0 0 0 20 0.0000 4 195 1170 3286 2566 DC:motor\001 -4 1 1 1 0 3 20 0.0000 4 195 1155 3285 3510 DC motor\001 -4 1 -1 0 0 0 20 0.0000 4 195 1275 6120 2520 Shaft:shaft\001 -4 1 1 1 0 3 20 0.0000 4 270 1605 6165 3510 Flexible shaft\001 -4 1 4 100 0 18 14 0.0000 4 210 1110 2250 1890 [Electrical]\001 -4 1 4 100 0 18 14 0.0000 4 210 1110 10170 1980 [Electrical]\001 -4 1 4 100 0 18 14 0.0000 4 210 1335 4140 1890 [Mechanical]\001 -4 1 4 100 0 18 14 0.0000 4 210 1335 8325 1980 [Mechanical]\001 -4 1 -1 0 0 0 20 0.0000 4 195 885 675 2565 PSU:v1\001 DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_desc.tex Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_desc.tex +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_desc.tex @@ -1,117 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system MotorGenerator (MotorGenerator_desc.tex) -% Generated by MTT on Thu Nov 16 13:11:36 GMT 2000. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:43:16 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{MotorGenerator} is - displayed in Figure \Ref{fig:MotorGenerator_abg.ps} and its label - file is listed in Section \Ref{sec:MotorGenerator_lbl}. - The subsystems are listed in Section \Ref{sec:MotorGenerator_sub}. - -This example illustates: -\begin{itemize} -\item The reuse of the DC model as both a motor and a generator -\item The assignment of a \emph{domain} and \emph{units} to component ports. -\end{itemize} - -The command: -\begin{verbatim} -mtt -I MotorGenerator ese r -\end{verbatim} -gives the following output (irrelevant parts ommitted) -\begin{verbatim} -MTT (Model Transformation Tools) version 4.8 -($Date$) -This is free software with ABSOLUTELY NO WARRANTY. -Type `mtt warranty' for details. - -Creating MotorGenerator_rbg.m -Creating MotorGenerator_cmp.m -Creating MotorGenerator_fig.fig -Creating MotorGenerator_sabg.fig -Creating MotorGenerator_alias.txt -Creating MotorGenerator_alias.m -Creating MotorGenerator_sub.sh -Copying DC from /home/peterg/mtt_new/mtt-lib/comp/compound/Electromechanical/DC to . -Creating DC_rbg.m -Creating DC_cmp.m -Creating DC_fig.fig -Creating DC_sabg.fig -Creating DC_alias.txt -Creating DC_alias.m -Creating DC_sub.sh -Creating DC_abg.m -Checking port domains and units - domains and units are OK - -... - -Creating PSU_rbg.m -Creating PSU_cmp.m -Creating PSU_fig.fig -Creating PSU_sabg.fig -Creating PSU_alias.txt -Creating PSU_alias.m -Creating PSU_sub.sh -Copying Se from /home/peterg/mtt_new/mtt-lib/comp/compound/General/Se to . -Creating Se_rbg.m -Creating Se_cmp.m -Creating Se_fig.fig -Creating Se_sabg.fig -Creating Se_alias.txt -Creating Se_alias.m -Creating Se_sub.sh -Creating Se_abg.m -Checking port domains and units - no domains or units declared -.... - -Creating PSU_abg.m -Checking port domains and units - domains and units are OK -... - -Creating Shaft_rbg.m -Creating Shaft_cmp.m -Creating Shaft_fig.fig -Creating Shaft_sabg.fig -Creating Shaft_alias.txt -Creating Shaft_alias.m -Creating Shaft_sub.sh -Creating Shaft_abg.m -Checking port domains and units - domains and units are OK -.... - -Creating MotorGenerator_abg.m -Checking port domains and units - no domains or units declared - -Creating MotorGenerator_cbg.m (maximise integral causality) -Creating MotorGenerator_type.sh - ..... -Creating MotorGenerator_ese.r -Creating MotorGenerator_def.r -Creating MotorGenerator_struc.txt -... -INFORMATION: Component MotorGenerator connects ports with units volt and volt -INFORMATION: Component MotorGenerator connects ports with units amp and amp -... -INFORMATION: Component MotorGenerator connects ports with units N*m and N*m -INFORMATION: Component MotorGenerator connects ports with units radians/s and radians/s -... -INFORMATION: Component MotorGenerator connects ports with units N*m and N*m -INFORMATION: Component MotorGenerator connects ports with units radians/s and radians/s -Creating MotorGenerator_aliased.txt -Copying MotorGenerator_ese.r - -\end{verbatim} DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_input.txt Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_input.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_input.txt +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_input.txt @@ -1,11 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System MotorGenerator, representation input, language txt; -## File MotorGenerator_input.txt; -## Generated by MTT on Mon Dec 9 09:08:54 UTC 2002; - - - -## Removed by MTT on Thu Jun 5 16:43:47 BST 2003: MotorGenerator_v1_v_u = 1.0; # Default -motorgenerator__v1__v__u = 1.0; # Added by MTT on Thu Jun 05 16:43:50 BST 2003 DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_lbl.txt Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_lbl.txt +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_lbl.txt @@ -1,48 +0,0 @@ -%SUMMARY MotorGenerator: Motor-generator example -%DESCRIPTION A simple example of DC motor driving a generator via -%DESCRIPTION a flexible shaft - -%% Label file for system MotorGenerator (MotorGenerator_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/11/16 09:58:49 peterg -% %% Initial revision -% %% -% %% Revision 1.3 2000/05/20 16:38:40 peterg -% %% New SS foramt -% %% -% %% Revision 1.2 1998/04/04 10:51:59 peterg -% %% New version using port coercion -% %% -% %% Revision 1.1 1996/12/04 16:24:01 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Voltage in -v1 SS external,internal - -% Voltage out -v2 SS external,0 - -%Motor -motor lin k_m;l_m;r_m;j_m;b_m - -%Shaft -shaft lin c_s - -%Generator -gener lin k_g;l_g;r_g;j_g;b_g - -% Resistive load -r_l lin flow,r_l - DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_numpar.txt Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_numpar.txt +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_numpar.txt @@ -1,31 +0,0 @@ -# Numerical parameter file (MotorGenerator_numpar.txt) -# Generated by MTT at Wed Dec 10 08:29:31 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/04 14:42:47 peterg -# %% Initial revision -# %% -# %% Revision 1.1 2000/08/01 12:26:48 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -b_g = 0.0; # Parameter b_g for MotorGenerator -b_m = 0.0; # Parameter b_m for MotorGenerator -c_s = 0.01; # Parameter c_s for MotorGenerator -j_g = 1.0; # Parameter j_g for MotorGenerator -j_m = 1.0; # Parameter j_m for MotorGenerator -k_g = 1.0; # Parameter k_g for MotorGenerator -k_m = 1.0; # Parameter k_m for MotorGenerator -l_g = 0.1; # Parameter l_g for MotorGenerator -l_m = 0.1; # Parameter l_m for MotorGenerator -r_g = 0.1; # Parameter r_g for MotorGenerator -r_l = 1.0; # Parameter r_l for MotorGenerator -## Removed by MTT on Mon Dec 4 14:44:19 GMT 2000: r_m_1 = 0.1; # Parameter r_m for MotorGenerator - -r_m = 0.1; # Added by MTT on Mon Dec 04 14:44:44 GMT 2000 DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_rep.txt Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_rep.txt +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_rep.txt @@ -1,33 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system MotorGenerator (MotorGenerator_rep.txt) -## Generated by MTT on" Thu Nov 16 13:37:07 GMT 2000. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt MotorGenerator abg tex # The system description -mtt MotorGenerator cbg ps # The causal bond graph -mtt MotorGenerator struc tex # The system structure -mtt MotorGenerator sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt MotorGenerator dae tex # The system dae -mtt MotorGenerator ode tex # The system ode -## mtt MotorGenerator sspar tex # Steady-state parameters -## mtt MotorGenerator ss tex # Steady state -## mtt MotorGenerator dm tex # Descriptor matrices (of linearised system) -mtt MotorGenerator sm tex # State matrices (of linearised system) -##mtt MotorGenerator tf tex # Transfer function (of linearised system) -## mtt MotorGenerator lmfr ps # log modulus of frequency response (of linearised system) -## mtt MotorGenerator simpar tex # Simulation parameters -## mtt MotorGenerator numpar tex # Numerical simulation parameters -## mtt MotorGenerator state tex # Simulation initial state -## mtt MotorGenerator input tex # Simulation input -## mtt MotorGenerator logic tex # Logic control -mtt MotorGenerator odeso ps # Simulation output - -mtt MotorGenerator rep txt # This file - DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_simpar.txt Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_simpar.txt +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/MotorGenerator_simpar.txt @@ -1,19 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system MotorGenerator (MotorGenerator_simpar.txt) -# Generated by MTT on Fri Dec 1 18:03:55 GMT 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -FIRST = 0.0; # First time in simulation output -DT = 0.1; # Print interval -LAST = 10.0; # Last time in simulation -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/PSU_abg.fig Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/PSU_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/PSU_abg.fig +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/PSU_abg.fig @@ -1,19 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3780 1710 4860 2025 -4 0 4 100 0 18 18 0.0000 4 270 1065 3780 1935 SS:[out]\001 --6 -6 1530 675 4995 3015 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 4950 2970 1575 2970 1575 720 4950 720 4950 2970 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 1845 3600 1845 3375 2070 -4 1 0 100 0 18 18 0.0000 4 210 570 1890 1935 Se:v\001 DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/PSU_lbl.txt Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/PSU_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/PSU_lbl.txt +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/PSU_lbl.txt @@ -1,30 +0,0 @@ -%% Label file for system PSU (PSU_lbl.txt) -%SUMMARY PSU -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%UNITS out electrical volt amp -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [out] SS external,external - -% Component type Se - v SS external - DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_abg.fig Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_abg.fig +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_abg.fig @@ -1,30 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 1440 405 4410 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 2250 2925 1035 3150 1260 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1486 2476 2701 2476 2476 2701 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 3600 3150 2250 3150 2250 450 3600 450 3600 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 2475 4365 2475 4140 2700 -4 1 -1 0 0 0 20 0.0000 4 195 135 2925 2565 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 630 2925 900 C:c_s\001 -4 1 1 1 0 3 20 0.0000 4 270 1605 2925 3510 Flexible shaft\001 --6 -6 540 2340 1440 2655 -4 2 4 100 0 18 18 0.0000 4 270 870 1440 2565 SS:[in]\001 --6 -6 4455 2340 5535 2655 -4 0 4 100 0 18 18 0.0000 4 270 1065 4455 2565 SS:[out]\001 --6 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 5850 3825 450 3825 450 225 5850 225 5850 3825 DELETED mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_lbl.txt Index: mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_lbl.txt +++ mttroot/mtt/lib/examples/Electromechanical/MotorGenerator/Shaft_lbl.txt @@ -1,38 +0,0 @@ -%% Label file for system Shaft (Shaft_lbl.txt) -%SUMMARY Shaft -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:43:16 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - - -% Unit definitions -%UNITS in rotational N*m radians/s -%UNITS out rotational N*m radians/s - -% Argument aliases -%ALIAS $1 c_s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - c_s lin effort,c_s - -% Component type SS - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_abg.fig Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_abg.fig ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_abg.fig +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_abg.fig @@ -1,30 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 4 1 7 1 0 -1 0.000 0 0 -1 0 0 4 - 2700 2025 7875 2025 7875 9450 2700 9450 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 6525 5625 7875 5850 7650 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 3780 5625 5130 5850 4905 -2 2 0 2 1 3 1 0 20 0.000 0 0 0 0 0 5 - 2700 5175 7875 5175 7875 6525 2700 6525 2700 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2835 855 2835 5850 3060 5625 -2 2 0 2 1 3 1 0 20 0.000 0 0 0 0 0 5 - 2700 1575 2970 1575 2970 5175 2700 5175 2700 1575 -2 1 1 2 1 7 1 0 -1 6.000 0 0 -1 0 0 2 - 2700 585 2700 9855 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 10125 9450 225 1125 225 1125 10125 9450 10125 -4 1 4 0 0 0 20 0.0000 4 240 3075 5625 8190 [mechanical,mass,thermal]\001 -4 1 -1 0 0 0 30 0.0000 4 300 1950 5625 8595 CG:bottom\001 -4 1 4 0 0 0 20 0.0000 4 255 3885 5625 6345 [mechanical_b,mass_b,thermal_b]\001 -4 1 -1 0 0 0 30 0.0000 4 405 3345 5625 5940 LeakyPiston:piston\001 -4 1 -1 0 0 0 30 0.0000 4 405 1260 5625 3285 CG:top\001 -4 1 4 0 0 0 20 0.0000 4 240 3075 5625 3600 [mechanical,mass,thermal]\001 -4 1 4 0 0 0 20 0.0000 4 255 3750 5625 5400 [mechanical_t,mass_t,thermal_t]\001 -4 1 4 0 0 0 20 0.0000 4 240 750 3375 5895 [shaft]\001 -4 0 -1 0 0 0 20 0.0000 4 195 975 2925 900 SS:shaft\001 DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_desc.tex Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_desc.tex ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_desc.tex +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_desc.tex @@ -1,33 +0,0 @@ -% Verbal description for system LeakyCylinder (LeakyCylinder_desc.tex) -% Generated by MTT on Tue Nov 25 17:22:29 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:44:35 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{LeakyCylinder} is - displayed in Figure \Ref{LeakyCylinder_abg} and its label - file is listed in Section \Ref{sec:LeakyCylinder_lbl}. - The subsystems are listed in Section \Ref{sec:LeakyCylinder_sub}. - -This example roughly corresponds to the Example in section 12.4.3 -(Fig. 12.17) of Karnopp, Margolis and Rosenberg (1990). It is a pseudo bond -graph representation based on the ``thermal accumulator'' of section -12.4.1 and the ``isentropic nozzle'' of section 12.4.2 of that book. - -[ -Notes added by PJG 10 June 03. -\begin{enumerate} -\item The parameters/states used in the simulation (odeso) are - meaningless at the moment. -\item The steady-state parameters (sspar.r) need to be calculated; at - the moment, the state mattrices (sm) are in terms of the - steady-state states. -\end{enumerate} -] DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_input.txt Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_input.txt ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_input.txt +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_input.txt @@ -1,12 +0,0 @@ -# Numerical parameter file (LeakyCylinder_input.txt) -# Generated by MTT at Tue Nov 25 17:00:09 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -u(1) = 0.0; # shaft DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_lbl.txt Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_lbl.txt +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_lbl.txt @@ -1,36 +0,0 @@ -%SUMMARY LeakyCylinder: Pseudo bond graph model of compressible gas dynamics - -%DESCRIPTION This example roughly corresponds to the Example in -%DESCRIPTION section 12.4.3 (Fig. 12.17) of Karnopp, Margolis and Rosenberg -%DESCRIPTION (1990). It is a pseudo bond graph representation based on the -%DESCRIPTION "thermal acummulator" of section 12.4.1 and the "isentropic -%DESCRIPTION nozzle" of section 12.4.2 of that book. - -%% Label file for system LeakyCylinder (LeakyCylinder_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/04 09:56:05 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type CG - bottom none c_v;r - top none c_v;r - -% Component type LeakyPiston - piston none m_p;a_b;a_t;gamma;r;0 - -% Component type SS - shaft SS external,external DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_numpar.txt Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_numpar.txt +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_numpar.txt @@ -1,26 +0,0 @@ -# Numerical parameter file (LeakyCylinder_numpar.txt) -# Generated by MTT at Mon Dec 1 08:59:51 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:44:35 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -a_b = 1.0; # Parameter a_b for LeakyCylinder -## Removed by MTT on Tue Jun 10 09:55:26 BST 2003: a_l = 1.0; # Parameter a_l for LeakyCylinder -a_t = 1.0; # Parameter a_t for LeakyCylinder -c_v = 1.0; # Parameter c_v for LeakyCylinder -gamma = 1.0; # Parameter gamma for LeakyCylinder -m_p = 1.0; # Parameter m_p for LeakyCylinder -r = 1.0; # Parameter r for LeakyCylinder - -# Initial states -## Removed by MTT on Tue Jun 10 09:55:26 BST 2003: x(3) = 0.0; # Initial state for LeakyCylinder_bottom (cg) -## Removed by MTT on Tue Jun 10 09:55:26 BST 2003: x(6) = 0.0; # Initial state for LeakyCylinder_top (cg) -## Removed by MTT on Tue Jun 10 09:55:26 BST 2003: x(7) = 0.0; # Initial state for LeakyCylinder_piston_piston (m_p) DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_rep.txt Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_rep.txt ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_rep.txt +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_rep.txt @@ -1,26 +0,0 @@ -# Outline report file for system LeakyCylinder (LeakyCylinder_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2003/06/11 15:57:57 gawthrop -% %% Updated examples for latest MTT. -% %% -% %% Revision 1.1 2000/12/28 17:44:35 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt LeakyCylinder abg tex -mtt LeakyCylinder struc tex -mtt LeakyCylinder sympar tex -mtt LeakyCylinder ode tex -mtt LeakyCylinder ss tex -mtt LeakyCylinder sm tex -##mtt LeakyCylinder odeso ps - -mtt LeakyCylinder rep txt - - DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_simp.r Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_simp.r ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_simp.r +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_simp.r @@ -1,10 +0,0 @@ -%% Reduce comands to simplify output for system LeakyCylinder (LeakyCylinder_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_sspar.r Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_sspar.r ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_sspar.r +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyCylinder_sspar.r @@ -1,10 +0,0 @@ -%% Reduce steady-state parameter file for LeakyCylinder (LeakyCylinder_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_abg.fig Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_abg.fig ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_abg.fig +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_abg.fig @@ -1,54 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 3375 6300 4725 6525 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7200 3375 7200 4725 7425 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 6075 6300 8122 6525 7897 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7245 6075 7245 8100 7470 7875 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4500 9000 9225 9000 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 450 9000 4050 9000 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 4050 9675 4050 450 450 450 450 9675 4050 9675 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9225 9675 4500 9675 4500 450 9225 450 9225 9675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 2925 6300 1575 6525 1800 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7200 2925 7200 1575 7425 1800 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 2925 3150 1575 3375 1800 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 3375 3150 4725 3375 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2056 4711 1101 3756 1101 4074 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 6075 3150 7425 3375 7200 -4 0 4 0 0 0 20 0.0000 4 255 1440 7200 5040 [thermal_in]\001 -4 1 4 0 0 0 20 0.0000 4 255 1110 6300 5040 [mass_in]\001 -4 1 4 0 0 0 20 0.0000 4 255 1260 6300 5895 [mass_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 1590 7200 5895 [thermal_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 1755 7155 8505 SS:[thermal_b]\001 -4 2 4 0 0 0 20 0.0000 4 255 1425 6255 8505 SS:[mass_b]\001 -4 1 1 1 0 0 20 0.0000 4 195 1335 6750 9450 Leak model\001 -4 1 1 1 0 0 20 0.0000 4 195 1515 2250 9405 Piston Model\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 6300 3240 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 7200 3240 0\001 -4 2 4 0 0 0 20 0.0000 4 255 2115 3195 1305 SS:[mechanical_t]\001 -4 2 4 0 0 0 20 0.0000 4 255 1380 6345 1305 SS:[mass_t]\001 -4 0 4 0 0 0 20 0.0000 4 255 1710 7155 1350 SS:[thermal_t]\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 3150 3240 0\001 -4 1 4 0 0 0 20 0.0000 4 255 540 3150 5040 [top]\001 -4 1 4 0 0 0 20 0.0000 4 240 750 2070 5040 [shaft]\001 -4 1 4 0 0 0 20 0.0000 4 240 1155 1080 3645 SS:[shaft]\001 -4 2 4 0 0 0 20 0.0000 4 255 2160 3150 7785 SS:[mechanical_b]\001 -4 1 4 0 0 0 20 0.0000 4 240 990 3150 5940 [bottom]\001 -4 1 -1 0 0 0 30 0.0000 4 300 1425 6885 5535 RG:leak\001 -4 1 -1 0 0 0 30 0.0000 4 405 2295 2700 5535 Piston:piston\001 DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_desc.tex Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_desc.tex ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_desc.tex +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system LeakyPiston (LeakyPiston_desc.tex) -% Generated by MTT on Fri Nov 28 12:09:15 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{LeakyPiston} is - displayed in Figure \Ref{LeakyPiston_abg} and its label - file is listed in Section \Ref{sec:LeakyPiston_lbl}. - The subsystems are listed in Section \Ref{sec:LeakyPiston_sub}. DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_lbl.txt Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_lbl.txt +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/LeakyPiston_lbl.txt @@ -1,35 +0,0 @@ -%SUMMARY LeakyPiston: Leaky piston sub model -%DESCRIPTION -%% Label file for system LeakyPiston (LeakyPiston_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/04 10:00:11 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type Piston - piston lin $1;$2;$3 - -% Component type RG - leak lin $4;$5;$6 - -% Component type SS - [mass_b] SS external,external - [mass_t] SS external,external - [mechanical_b] SS external,external - [mechanical_t] SS external,external - [shaft] SS external,external - [thermal_b] SS external,external - [thermal_t] SS external,external DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_abg.fig Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_abg.fig ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_abg.fig +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_abg.fig @@ -1,31 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 1575 6075 3150 6300 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 3600 6075 4275 6300 4050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 4636 6075 5311 6300 5086 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 4500 4500 4500 4725 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5905 4281 4950 3326 4950 3645 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 5850 6075 7200 6300 6975 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3375 8100 6975 8100 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6975 8775 6975 900 3375 900 3375 8775 6975 8775 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9945 9225 9945 450 450 450 450 9225 9945 9225 -4 1 -1 0 0 0 20 0.0000 4 255 780 6120 3465 TF:a_t\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 6075 4590 1\001 -4 2 4 0 0 0 20 0.0000 4 240 1155 4905 3240 SS:[shaft]\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 4050 4545 I:m_p\001 -4 1 -1 0 0 0 20 0.0000 4 255 825 6075 5670 TF:a_b\001 -4 2 4 0 0 0 20 0.0000 4 240 1395 6120 7650 SS:[bottom]\001 -4 1 1 1 0 0 20 0.0000 4 195 1515 5175 8505 Piston Model\001 -4 2 4 0 0 0 20 0.0000 4 255 945 6120 1395 SS:[top]\001 DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_desc.tex Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_desc.tex ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_desc.tex +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_desc.tex @@ -1,22 +0,0 @@ -% Verbal description for system Piston (Piston_desc.tex) -% Generated by MTT on Fri Nov 28 12:09:27 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Piston} is - displayed in Figure \Ref{Piston_abg} and its label - file is listed in Section \Ref{sec:Piston_lbl}. - The subsystems are listed in Section \Ref{sec:Piston_sub}. - -The two {\bf TF} components convert pressure to force. The {\bf I} -component represents piston inertia. - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_lbl.txt Index: mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_lbl.txt +++ mttroot/mtt/lib/examples/GasDynamics/LeakyCylinder/Piston_lbl.txt @@ -1,32 +0,0 @@ -%SUMMARY Piston: simple model of the piston -%DESCRIPTION Inludes inertia and pressure effects. -%% Label file for system Piston (Piston_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/04 10:01:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type I - m_p lin flow,$1 - -% Component type SS - [bottom] SS external,external - [shaft] SS external,external - [top] SS external,external - -% Component type TF - a_b lin flow,$2 - a_t lin effort,$3 DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_abg.fig @@ -1,64 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -6 3150 4410 5940 4995 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 - 3154 4730 5449 4730 5404 4730 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3379 4730 3154 4955 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3604 4730 3379 4955 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3829 4730 3604 4955 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4054 4730 3829 4955 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4279 4730 4054 4955 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4505 4731 4280 4956 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4730 4731 4505 4956 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4955 4731 4730 4956 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5180 4731 4955 4956 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5405 4731 5180 4956 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 5897 4413 5627 4683 --6 -1 3 0 2 1 7 1 0 -1 0.0000000 1 0.000 4276 2206 612 612 4276 2206 4636 2701 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 0 0 2.00 120.00 240.00 - 5176 1531 4906 1801 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 2475 5175 3600 5175 3330 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 2250 2925 2250 3150 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 2250 5625 2250 5400 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 2070 4275 946 4500 1171 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 4050 4275 2475 4500 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4297 4522 4297 5646 4522 5421 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 3600 7875 3600 7650 3825 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 6300 8775 225 225 225 225 6300 8775 6300 -4 2 -1 0 0 2 20 0.0000000 4 240 2130 2835 2250 R:air_resistance\001 -4 1 -1 0 0 2 20 0.0000000 4 210 150 4276 2341 1\001 -4 1 1 1 0 3 20 0.0000000 4 210 525 5176 1441 Ball\001 -4 0 -1 0 0 2 20 0.0000000 4 270 1365 5760 2340 SS:gravity\001 -4 1 -1 0 0 2 20 0.0000000 4 240 1515 4275 810 I:ball_mass\001 -4 1 -1 0 0 2 20 0.0000000 4 270 1710 4320 5940 CSW:ground\001 -4 1 1 1 0 3 20 0.0000000 4 210 960 6030 4275 Ground\001 -4 1 1 1 0 3 20 0.0000000 4 150 135 4590 3465 v\001 -4 1 1 1 0 3 20 0.0000000 4 150 315 4590 5220 -v\001 -4 1 -1 0 0 2 20 0.0000000 4 210 150 4275 4365 0\001 -4 1 -1 0 0 2 20 0.0000000 4 210 1275 5985 3690 INTF:intf\001 -4 0 -1 0 0 2 20 0.0000000 4 210 585 8010 3690 SS:x\001 DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_desc.tex Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_desc.tex +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_desc.tex @@ -1,47 +0,0 @@ -% Verbal description for system Bounce (Bounce_desc.tex) -% Generated by MTT on Wed Jul 2 10:55:51 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:45:24 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Bounce}, togehter with a - schematic diagram is - displayed in Figure \Ref{Bounce_abg} and its label - file is listed in Section \Ref{sec:Bounce_lbl}. - The subsystems are listed in Section \Ref{sec:Bounce_sub}. - -The model uses the {\bf CSW} switched {\bf C} element to simulate -contact with the ground. The corresponding switching function (See -Section \ref{sec:Bounce_input-noargs.txt}), is based on the height above the -ground $h$ as follows: -\begin{equation} -i_{sw} = - \begin{cases} - 0 & \text{if $h > 0$}\\ - -1 & \text{if $h \le 0$} - \end{cases} -\end{equation} - -In other words, the component acts as an ideal spring when the ball is -in contact with the ground yet has no effect when the ball is not in -contact with the ground. - -The ball is modelled as a point mass (the \textbf{I} component) and a -linear resistance to motion (the (the \textbf{R} component). - -The system was simulated for 100 time units and the resultant height -is plotted in Figure \ref{fig:Bounce_odeso-noargs.ps}. The ball was released at zero -velocity from a height of ten units. The bounce height decreases due to -the effect of the modelled air resistance. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_input.txt Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_input.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_input.txt +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_input.txt @@ -1,29 +0,0 @@ -# Numerical parameter file (Bounce_input.txt) -# Generated by MTT at Wed Jul 2 10:47:49 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.4 2001/10/05 11:24:29 gawthrop -# %% Updated for new mtt features - input.txt etc -# %% -# %% Revision 1.3 2000/05/18 11:30:14 peterg -# %% Moved switch logic to logic.txt -# %% -# %% Revision 1.2 1998/10/01 19:20:33 peterg -# %% Cahged switch function -# %% -# %% Revision 1.1 1998/07/25 18:35:02 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Fri Oct 5 10:37:56 BST 2001: mttu(1) = 9.81; - - -## Removed by MTT on Tue Jun 10 10:22:08 BST 2003: bounce_gravity = 9.81; # Added by MTT on Fri Oct 05 10:37:59 BST 2001 -bounce__gravity = 9.81; - DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_lbl.txt @@ -1,37 +0,0 @@ -%SUMMARY Bounce: Bouncing ball example (hybrid) -%DESCRIPTION -%% Label file for system Bounce (Bounce_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/09/11 09:54:22 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type INTF - intf - -% Component type CSW - ground lin state,k_g - -% Component type I - ball_mass lin flow,m - -% Component type R - air_resistance lin flow,r - -% Component type SS - gravity SS external,internal - x SS external,0 - DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_logic.txt Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_logic.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_logic.txt +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_logic.txt @@ -1,24 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system Bounce (Bounce_logic.txt) -# Generated by MTT on Thu May 18 12:29:15 BST 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2002/09/29 13:14:12 geraint -## Updated names. -## -## Revision 1.2 2000/12/28 17:45:24 peterg -## To RCS -## -## Revision 1.1 2000/05/18 11:29:58 peterg -## Initial revision -## -############################################################### - - -# Set the switches - -## On when below ground level -bounce__ground__mtt_switch_logic = (bounce__intf__mttc < 0); DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_numpar.txt Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_numpar.txt +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_numpar.txt @@ -1,17 +0,0 @@ -# Numerical parameter file (Bounce_numpar.txt) -# Generated by MTT at Wed Jul 2 10:47:47 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:45:24 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -k_g = 100.0; # Ground stiffness -m = 1.0; # Ball mass -r = 1.0; # Air resistance DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_rep.txt Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_rep.txt +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_rep.txt @@ -1,25 +0,0 @@ -# Outline report file for system Bounce (Bounce_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/05/19 07:09:19 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt Bounce abg tex -mtt Bounce struc tex -mtt Bounce ode tex - - -mtt Bounce simpar txt -mtt Bounce input txt -mtt Bounce logic txt -mtt Bounce numpar txt - -mtt Bounce odeso ps - -mtt Bounce rep txt DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_simpar.txt Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_simpar.txt +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_simpar.txt @@ -1,16 +0,0 @@ -# Simulation parameters for system Bounce (Bounce_simpar.txt) -# Generated by MTT on Sat Jul 25 15:57:56 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/10/01 19:21:04 peterg -## Initial revision -## -############################################################### -FIRST=0.0; -LAST=10.0; -DT=0.02; -STEPFACTOR=1; - DELETED mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_state.txt Index: mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_state.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_state.txt +++ mttroot/mtt/lib/examples/Hybrid/Bounce/Bounce_state.txt @@ -1,29 +0,0 @@ -# -*-octave-*- -# Initial state file (Bounce_state.txt) -# Generated by MTT at Sat Jul 25 15:56:57 BST 1998 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.4 2002/09/29 13:14:12 geraint -## Updated names. -## -## Revision 1.3 2001/10/05 11:24:30 gawthrop -## Updated for new mtt features - input.txt etc -## -## Revision 1.2 1998/07/25 20:34:05 peterg -## *** empty log message *** -## -## Revision 1.1 1998/07/25 14:59:11 peterg -## Initial revision -## -############################################################### - -# Set the states -## Removed by MTT on Tue Jun 10 10:23:07 BST 2003: bounce_ball_mass = 0.0; # -## Removed by MTT on Tue Jun 10 10:23:07 BST 2003: bounce_ground_mtt_switch = 0.0; # -## Removed by MTT on Tue Jun 10 10:23:07 BST 2003: bounce_intf_mttc = 10.0; # -bounce__ball_mass = 0.0; # Zero velocity -bounce__ground__mtt_switch = 0.0; # Not on ground -bounce__intf__mttc = 10.0; # 10m above ground DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_abg.fig @@ -1,161 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -6 3513 9498 8733 9858 -6 3513 9498 4953 9813 -6 3513 9498 4233 9768 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3514 9724 3739 9499 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3739 9724 3964 9499 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3964 9724 4189 9499 --6 -6 4189 9499 4909 9769 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4190 9725 4415 9500 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4415 9725 4640 9500 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4640 9725 4865 9500 --6 --6 -6 4864 9499 6304 9814 -6 4864 9499 5584 9769 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4865 9725 5090 9500 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5090 9725 5315 9500 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5315 9725 5540 9500 --6 -6 5540 9500 6260 9770 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5541 9726 5766 9501 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5766 9726 5991 9501 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 5991 9726 6216 9501 --6 --6 -6 6214 9499 6934 9769 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 6215 9725 6440 9500 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 6440 9725 6665 9500 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 6665 9725 6890 9500 --6 -6 6890 9500 7610 9770 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 6891 9726 7116 9501 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 7116 9726 7341 9501 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 7341 9726 7566 9501 --6 -6 7565 9500 8285 9770 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 7566 9726 7791 9501 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 7791 9726 8016 9501 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 8016 9726 8241 9501 --6 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3514 9499 8689 9499 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 8242 9727 8467 9502 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 8467 9727 8692 9502 --6 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4727 2072 4727 3647 4952 3422 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6077 2072 6077 3647 6302 3422 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4502 3647 4952 3647 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5852 3647 6302 3647 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7202 3647 7652 3647 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 8823 4728 10398 4953 10173 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 6571 2926 6571 3151 6796 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2251 6797 2251 8372 2476 8147 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9923 6774 9923 8349 10148 8124 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5851 4771 6301 4771 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 8372 4726 6797 4951 7022 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4501 6346 4501 6796 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7651 6346 7651 6796 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7629 6571 9204 6571 8979 6796 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 6347 4726 4772 4951 4997 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2521 4186 4096 4186 3871 4411 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4096 3961 4096 4411 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 4770 7426 6345 7651 6120 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 6795 7426 8370 7651 8145 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8101 4186 9676 4186 9451 4411 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8101 3961 8101 4411 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 3647 7426 2072 7651 2297 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6076 4772 6076 6347 6301 6122 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 8820 7426 10395 7651 10170 -2 2 0 2 1 3 1 0 20 0.000 0 0 0 0 0 5 - 3827 3422 8327 3422 8327 4997 3827 4997 3827 3422 -2 1 0 3 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 3.00 180.00 360.00 - 9226 2521 8371 3196 -2 1 0 3 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 3.00 180.00 360.00 - 11458 7718 10603 8393 -2 1 0 3 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 3.00 180.00 360.00 - 701 7685 1556 8360 -4 1 -1 0 0 2 20 0.0000000 4 210 1470 2115 6660 INTF:intfL\001 -4 1 -1 0 0 2 20 0.0000000 4 210 1215 6077 4322 ROD:rod\001 -4 1 4 0 0 2 20 0.0000000 4 240 360 6077 3962 [p7]\001 -4 1 4 0 0 2 20 0.0000000 4 240 360 6077 4637 [p8]\001 -4 1 -1 0 0 2 20 0.0000000 4 210 150 4727 6662 1\001 -4 1 -1 0 0 2 20 0.0000000 4 210 150 7427 6662 1\001 -4 1 -1 0 0 2 20 0.0000000 4 210 150 4728 8688 0\001 -4 1 -1 0 0 2 20 0.0000000 4 270 1905 4728 10713 CSW:groundL\001 -4 1 -1 0 0 2 20 0.0000000 4 210 150 7428 8688 0\001 -4 1 -1 0 0 2 20 0.0000000 4 270 1365 6077 6662 SS:gravity\001 -4 1 -1 0 0 2 20 0.0000000 4 210 795 10217 4277 SS:aR\001 -4 1 -1 0 0 2 20 0.0000000 4 210 1485 10126 6661 INTF:intfR\001 -4 1 -1 0 0 2 20 0.0000000 4 210 795 2251 8641 SS:hL\001 -4 1 -1 0 0 2 20 0.0000000 4 210 810 9946 8641 SS:hR\001 -4 1 -1 0 0 2 20 0.0000000 4 210 795 6077 1937 SS:xC\001 -4 1 -1 0 0 2 20 0.0000000 4 270 1920 7426 10711 CSW:groundR\001 -4 1 -1 0 0 2 20 0.0000000 4 210 780 4727 1937 SS:xL\001 -4 1 -1 0 0 2 20 0.0000000 4 210 795 7427 1937 SS:xR\001 -4 1 4 0 0 2 20 0.0000000 4 240 360 4727 3962 [p3]\001 -4 1 4 0 0 2 20 0.0000000 4 240 360 7427 3962 [p4]\001 -4 1 4 0 0 2 20 0.0000000 4 240 360 4727 4637 [p5]\001 -4 1 4 0 0 2 20 0.0000000 4 240 360 7426 4636 [p6]\001 -4 1 -1 0 0 2 20 0.0000000 4 210 780 2026 4276 SS:aL\001 -4 1 4 0 0 2 20 0.0000000 4 240 360 4411 4276 [p1]\001 -4 1 4 0 0 2 20 0.0000000 4 240 360 7876 4321 [p2]\001 -4 0 1 1 0 3 30 0.0000000 4 300 1470 5311 10171 Ground\001 -4 0 1 1 0 3 30 0.0000000 4 390 2685 8326 2476 Bouncing Rod\001 -4 0 1 1 0 3 30 0.0000000 4 390 3315 11026 7651 Height of right tip\001 -4 2 1 1 0 3 30 0.0000000 4 390 3000 1800 7515 Height of left tip\001 DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_desc.tex Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_desc.tex +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_desc.tex @@ -1,51 +0,0 @@ -% Verbal description for system BouncingRod (BouncingRod_desc.tex) -% Generated by MTT on Sun Jul 6 17:21:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1999/12/20 09:36:24 peterg -% %% *** empty log message *** -% %% -% Revision 1.1 1997/07/06 16:35:20 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -The acausal bond graph of system \textbf{BouncingRod} is displayed in -Figure \Ref{BouncingRod_abg} and its label file is listed in Section -\Ref{sec:BouncingRod_lbl}. - The subsystems are listed in Section -\Ref{sec:BouncingRod_sub}. - -The system consists of a uniform rod of mass 1kg, length 2m (and -therefore of inertia about the mass centre of $\frac{1}{3} -\text{kgm}^2$. The rod is released at an angle of $\frac{\pi}{4}$ from -the vertical, the mass centre is $10\text{m}$ above the ground and all -velocities are initially zero. The gravitational constant is taken as unity. - -The ground is modeled as an ideal compliance in the vertical -direction with compliance of $0.1 \text{mN}^{-1}$ and it is assumed -that contact takes place at the rod tips only. There is no -horizontal resistance to motion. This idealised setup is modeled by a -two {\bf CSW} components, one for each rod tip, modulated by the -height of each rod tip above the ground: each {\bf CSW} is off when -the corresponding height is positive. - -The system was simulated for 100 time units and the resultant height -of each tip is plotted in Figure \ref{fig:BouncingRod_odeso-noargs.ps}. The rod was -released at zero velocity from a height of ten units and at an angle -of $\frac{\pi}{4}$ radians to the vertical. The oscillations in height -are due to rod rotation about its mass centre. The bounce height -changes due to energy transfer to and from the rod rotation about its -mass centre. - - - - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: "yes" -%%% End: DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_input.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_input.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_input.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_input.txt @@ -1,21 +0,0 @@ -# Numerical parameter file (BouncingRod_input.txt) -# Generated by MTT at Fri Jul 4 14:09:14 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.2 2000/12/04 08:27:42 peterg -# %% New version -# %% -# %% Revision 1.1 1997/07/06 16:17:48 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Mon Dec 4 08:27:04 GMT 2000: u(1) = 9.81; # gravity (Default value) -## Removed by MTT on Tue Jun 10 10:33:30 BST 2003: bouncingrod_gravity = 9.81; # Added by MTT on Mon Dec 04 08:27:10 GMT 2000 -bouncingrod__gravity = 9.81; # Gravity - DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_lbl.txt @@ -1,55 +0,0 @@ -%SUMMARY BouncingRod: Two-dimensional bouncing rod (hybrid) -%DESCRIPTION A uniform rod bounces on a compliant surface -- the -%DESCRIPTION CSW component is used. - -%% Label file for system BouncingRod (BouncingRod_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.5 2000/12/04 08:36:23 peterg -% %% Declare pi -% %% -% %% Revision 1.4 2000/05/18 10:30:39 peterg -% %% New SS form -% %% -% %% Revision 1.3 1997/09/11 09:55:25 peterg -% %% Added documentation -% %% -% %% Revision 1.2 1997/09/11 08:37:29 peterg -% %% Added description -% %% -% %% Revision 1.1 1997/07/06 16:18:37 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type CSW - groundL lin effort,epsilon - groundR lin effort,epsilon - -% Component type INTF - intfL - intfR - -% Component type ROD - rod none l;l;j;m - -% Component type SS - aL SS 0,internal - aR SS 0,internal - gravity SS external,internal - hL SS external,0 - hR SS external,0 - xC SS 0,internal - xL SS 0,internal - xR SS 0,internal DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_logic.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_logic.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_logic.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_logic.txt @@ -1,21 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system BouncingRod (BouncingRod_logic.txt) -# Generated by MTT on Thu May 18 12:14:35 BST 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2002/09/29 15:31:39 geraint -## Updated names. -## -## Revision 1.1 2000/12/28 17:45:59 peterg -## To RCS -## -############################################################### - -# Set the switches -## Removed by MTT on Tue Jun 10 10:45:53 BST 2003: bouncingrod_groundl_mtt_switch_logic = (bouncingrod_intfl_mttc <= 0); -## Removed by MTT on Tue Jun 10 10:45:53 BST 2003: bouncingrod_groundr_mtt_switch_logic = (bouncingrod_intfr_mttc <= 0); -bouncingrod__groundl__mtt_switch_logic = (bouncingrod__intfl__mttc <= 0); -bouncingrod__groundr__mtt_switch_logic = (bouncingrod__intfr__mttc <= 0); DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_numpar.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_numpar.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_numpar.txt @@ -1,24 +0,0 @@ -# Numerical parameter file (BouncingRod_numpar.txt) -# Generated by MTT at Fri Jul 4 14:09:11 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.2 2000/12/28 17:45:59 peterg -# %% To RCS -# %% -# %% Revision 1.1 1997/07/06 16:17:27 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -epsilon = 0.01; -l = 1.0; # Default value -m = 1.0; # Default value -j = l*l*m/3; - - - DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_odes.h Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_odes.h ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_odes.h +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_odes.h @@ -1,7 +0,0 @@ -/* -%% Parameter file for system BouncingRod (BouncingRod_odes.h) -%% This file provides the params for simulation: -*/ -#define DT 0.1 /* Time step (for printing) */ -#define LAST 99.9 /* Last time */ -#define STEPFACTOR 1000 /* Integration steps per time step */ DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_rep.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_rep.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_rep.txt @@ -1,25 +0,0 @@ -# Outline report file for system BouncingRod (BouncingRod_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 17:45:59 peterg -% %% To RCS -% %% -% %% Revision 1.1 1997/07/06 16:20:44 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt BouncingRod abg tex -mtt BouncingRod struc tex -mtt BouncingRod ode tex -mtt BouncingRod numpar txt -mtt BouncingRod input txt -mtt BouncingRod logic txt -mtt BouncingRod odeso ps - - - DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_simpar.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_simpar.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_simpar.txt @@ -1,17 +0,0 @@ -# Simulation parameters for system BouncingRod (BouncingRod_simpar.txt) -# Generated by MTT on Sun Jul 26 12:14:17 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1999/12/21 08:07:38 peterg -## Initial revision -## -############################################################### - -LAST=20; -DT=0.01; -STEPFACTOR=1; - - DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_state.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_state.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_state.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/BouncingRod_state.txt @@ -1,37 +0,0 @@ -# Initial state file (BouncingRod_state.txt) -# Generated by MTT at Sun Jul 26 12:19:13 BST 1998 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2002/09/29 15:31:39 geraint -## Updated names. -## -## Revision 1.2 2002/05/10 12:38:11 gawthrop -## Updated to new format -## -## Revision 1.1 2000/12/28 17:45:59 peterg -## To RCS -## -############################################################### - - -# Set the states - -## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_groundl_mtt_switch = 0.0; -## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_groundr_mtt_switch = 0.0; -## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_intfl_mttc = 10 + sin(pi/4); -## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_intfr_mttc = 10 - sin(pi/4); -## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_rod_j = 0.0; -## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_rod_m_x = 0.0; -## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_rod_m_y = 0.0; -## Removed by MTT on Tue Jun 10 10:31:03 BST 2003: bouncingrod_rod_th_mttc = pi/4; -bouncingrod__groundl__mtt_switch = 0.0; -bouncingrod__groundr__mtt_switch = 0.0; -bouncingrod__intfl__mttc = 10 + sin(pi/4); # Start at 45 degree angle -bouncingrod__intfr__mttc = 10 - sin(pi/4); # Start at 45 degree angle -bouncingrod__rod__j = 0.0; -bouncingrod__rod__m_x = 0.0; -bouncingrod__rod__m_y = 0.0; -bouncingrod__rod__th__mttc = pi/4; # Start at 45 degree angle DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/CSW_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/CSW_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/CSW_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/CSW_lbl.txt @@ -1,30 +0,0 @@ -%SUMMARY ISW: Switched I component -%DESCRIPTION ISW acts as an I component except when the -s -c option is used. -%DESCRIPTION When the -s -c option is used: -%DESCRIPTION The component label is used as a variable name (eg Name) -%DESCRIPTION In the ode simulation: -%DESCRIPTION Name = 1 implies normal I (closed switch) -%DESCRIPTION Name = 0 implies state=0 (open switch) -%DESCRIPTION Name = -1 implies state>0 (Diode) - -%% Label file for system ISW (ISW_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/06/03 15:26:09 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type I - MTT_SWITCH $1 $1 DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_abg.fig @@ -1,125 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 3600 675 2250 675 2250 9675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 4 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 4 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 4 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2700 5625 2700 5400 1800 6300 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 5401 5625 9001 5850 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 7875 2925 9000 3195 8730 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 7875 8325 9000 8595 8730 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8550 5400 9450 6300 9225 6300 -4 1 -1 0 0 0 20 0.0000 4 195 135 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 270 6933 5268 I:J\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000 4 255 660 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1110 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1095 7156 6391 EMTF:s2\001 -4 1 -1 0 0 0 20 0.0000 4 240 720 8372 1217 SS:[p5]\001 -4 1 -1 0 0 0 20 0.0000 4 240 720 5671 9361 SS:[p2]\001 -4 1 -1 0 0 0 20 0.0000 4 240 720 8417 9362 SS:[p6]\001 -4 1 5 0 0 0 20 0.0000 4 195 135 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000 4 210 270 4501 4456 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 4501 3781 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 3826 4051 [mod]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 6301 4006 [mod]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 6211 6526 [mod]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 4591 5896 [in]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 4591 6841 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 3916 6526 [mod]\001 -4 1 -1 0 0 0 20 0.0000 4 240 720 2971 1216 SS:[p3]\001 -4 1 -1 0 0 0 20 0.0000 4 240 720 5671 1216 SS:[p1]\001 -4 1 -1 0 0 0 20 0.0000 4 240 720 2971 9361 SS:[p4]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 4411 5446 [out]\001 -4 1 26 0 0 0 16 0.0000 4 210 270 4906 5446 [in]\001 -4 1 5 0 0 0 20 0.0000 4 195 960 4681 5266 INTF:th\001 -4 1 1 1 0 0 20 0.0000 4 195 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000 4 135 180 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000 4 195 210 8280 9990 Y\001 -4 1 4 1 0 0 20 0.0000 4 255 390 1350 2700 Tip\001 -4 1 4 1 0 0 20 0.0000 4 255 390 1350 9855 Tip\001 -4 1 4 1 0 0 20 0.0000 4 195 1380 1080 6120 Mass centre\001 -4 1 -1 0 0 0 20 0.0000 4 240 720 1710 6615 SS:[p7]\001 -4 1 -1 0 0 0 20 0.0000 4 240 720 9495 6570 SS:[p8]\001 DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_desc.tex Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_desc.tex +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_desc.tex @@ -1,17 +0,0 @@ -% Verbal description for system ROD (ROD_desc.tex) -% Generated by MTT on Fri Jul 4 10:30:17 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ROD} is - displayed in Figure \Ref{ROD_abg} and its label - file is listed in Section \Ref{sec:ROD_lbl}. - The subsystems are listed in Section \Ref{sec:ROD_sub}. - - -This is a special version just for this problem. DELETED mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/BouncingRod/ROD_lbl.txt @@ -1,60 +0,0 @@ -%SUMMARY ROD: rigid rod in two dimensions -%DESCRIPTION Port [1]: Angular torque/velocity - end 1 -%DESCRIPTION Port [2]: Angular torque/velocity - end 2 -%DESCRIPTION Port [3]: x force/velocity - end 1 -%DESCRIPTION Port [4]: x force/velocity - end 2 -%DESCRIPTION Port [5]: y force/velocity - end 1 -%DESCRIPTION Port [6]: y force/velocity - end 2 -%DESCRIPTION Port [7]: x force/velocity - centre -%DESCRIPTION Port [8]: y force/velocity - centre -%DESCRIPTION -%DESCRIPTION Parameter 1: length from end 1 to mass centre -%DESCRIPTION Parameter 2: length from end 2 to mass centre -%DESCRIPTION Parameter 3: inertia about mass centre -%DESCRIPTION Parameter 4: mass -%DESCRIPTION See Section 10.2 of "Metamodelling" - - -%% Label file for system ROD (ROD_lbl.txt) - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,$3 -m_x lin flow,$4 -m_y lin flow,$4 - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,$1 -s2 lsin flow,$2 -c1 lcos flow,$1 -c2 lcos flow,$2 - -% ports - -[p1] SS external,external -[p2] SS external,external -[p3] SS external,external -[p4] SS external,external -[p5] SS external,external -[p6] SS external,external -[p7] SS external,external -[p8] SS external,external DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_abg.fig @@ -1,23 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 4726 3376 4726 2026 2476 2026 2476 3376 4726 3376 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8101 3376 8101 2026 5851 2026 5851 3376 8101 3376 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11476 3376 11476 2026 9226 2026 9226 3376 11476 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4501 2701 6076 2701 5941 2836 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7876 2701 9451 2701 9316 2836 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1126 2701 2701 2701 2566 2836 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11925 5400 11925 225 225 225 225 5400 11925 5400 -4 1 -1 0 0 0 20 0.0000 4 195 1170 3511 2791 DC:motor\001 -4 1 -1 0 0 0 20 0.0000 4 195 1140 10306 2791 Load:load\001 -4 1 -1 0 0 0 20 0.0000 4 195 1290 7021 2791 Drive:drive\001 -4 1 -1 0 0 0 20 0.0000 4 195 525 765 2790 SS:e\001 DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_desc.tex Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_desc.tex +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_desc.tex @@ -1,28 +0,0 @@ -% Verbal description for system Clutch (Clutch_desc.tex) -% Generated by MTT on Thu Jul 3 13:57:59 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:46:44 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Clutch} is displayed in - Figure \Ref{Clutch_abg} and its label file is listed in Section - \Ref{sec:Clutch_lbl}. The subsystems are listed in Section - \Ref{sec:Clutch_sub}. The details of the DC motor and the load are - hidden behind a word bond graph so as to focus on the clutch - mechanism as modelled by the \textbf{CSW} component. - It is natural to model the clutch shaft by a -compliance to absorb the shock of engaging the clutch; therefore the -drive model contains a \textbf{CSW} component. - - -Figure \ref{fig:Clutch_odeso-noargs.ps}, shows the angular velocities of the motor -and load. The clutch is engaged from time $t$ given by $0= 5)&&(t < 15)); # DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_numpar.txt Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_numpar.txt +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_numpar.txt @@ -1,19 +0,0 @@ -# Numerical parameter file (Clutch_numpar.txt) -# Generated by MTT at Thu Jul 3 12:12:35 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -b_m = 0.1; # Default value -epsilon = 0.01; -j_l = 1.0; # Default value -j_m = 10.0; # Default value -k_m = 1.0; # Default value -l_a = 0.1; # Default value -r_a = 1.0; # Default value -r_l = 5.0; # Default value DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_rep.txt Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_rep.txt +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_rep.txt @@ -1,28 +0,0 @@ -# Outline report file for system Clutch (Clutch_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/05/19 07:16:07 peterg -% %% Added logic -% %% -% %% Revision 1.1 1999/02/21 08:18:25 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt Clutch abg tex -mtt Clutch struc tex -mtt Clutch ode tex -mtt Clutch dm tex - -mtt Clutch simpar txt -mtt Clutch input txt -mtt Clutch logic txt -mtt Clutch numpar txt - -mtt Clutch odeso ps - -mtt Clutch rep txt DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_simpar.txt Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_simpar.txt +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Clutch_simpar.txt @@ -1,16 +0,0 @@ -# Simulation parameters for system Clutch (Clutch_simpar.txt) -# Generated by MTT on Sun Jul 26 13:26:44 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1999/12/21 09:13:19 peterg -## Initial revision -## -############################################################### - -LAST=20.0; -DT=0.1; -STEPFACTOR=1; - DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_abg.fig @@ -1,31 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1800 2475 2925 2475 2700 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3397 2497 4522 2497 4297 2722 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4950 2475 6075 2475 5850 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6547 2497 7672 2497 7447 2722 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 2700 3150 3825 3375 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 2700 6300 3825 6525 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4725 2250 4725 1125 4950 1350 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2925 2700 3375 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6030 2700 6525 2700 -4 1 -1 0 0 0 20 0.0000 4 195 135 3150 2565 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 6300 2565 1\001 -4 1 4 0 0 0 20 0.0000 4 240 810 1305 2565 SS:[in]\001 -4 1 4 0 0 0 20 0.0000 4 240 960 8235 2565 SS:[out]\001 -4 1 -1 0 0 0 20 0.0000 4 195 675 3150 4185 SS:v1\001 -4 1 -1 0 0 0 20 0.0000 4 195 675 6300 4185 SS:v2\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 4725 2610 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 1410 4725 945 CSW:clutch\001 DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_desc.tex Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_desc.tex +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system Drive (Drive_desc.tex) -% Generated by MTT on Thu Jul 3 13:58:26 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Drive} is - displayed in Figure \Ref{Drive_abg} and its label - file is listed in Section \Ref{sec:Drive_lbl}. - The subsystems are listed in Section \Ref{sec:Drive_sub}. DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Drive_lbl.txt @@ -1,35 +0,0 @@ -%SUMMARY Drive: The clutch/shaft drive subsystem -%DESCRIPTION -%% Label file for system Drive (Drive_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/05/18 10:32:32 peterg -% %% New SS form -% %% -% %% Revision 1.1 1997/09/11 09:39:16 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type CSW - clutch lin effort,epsilon - -% Component type R -% r_d lin flow,r_d - -% Component type SS - v1 SS 0,external - v2 SS 0,external - [in] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Load_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Load_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Load_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Load_abg.fig @@ -1,22 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 3376 2926 3376 2701 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 3151 3151 2251 3376 2476 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 3601 3151 4501 3376 4276 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 2476 1801 3826 1801 3826 4951 2476 4951 2476 1801 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 2026 3151 2476 3151 2476 3601 2026 3601 2026 3151 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6075 5400 6075 900 495 900 495 5400 6075 5400 -4 1 -1 0 0 0 20 0.0000 4 195 135 3151 3466 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 450 3151 2161 I:j_l\001 -4 1 -1 0 0 0 20 0.0000 4 255 585 3196 4816 R:r_l\001 -4 1 4 0 0 0 20 0.0000 4 240 810 1576 3466 SS:[in]\001 -4 1 1 1 0 0 20 0.0000 4 255 4395 3331 1531 Rotating load with inertia and friction\001 DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Load_desc.tex Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Load_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Load_desc.tex +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Load_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system Load (Load_desc.tex) -% Generated by MTT on Thu Jul 3 13:58:38 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Load} is - displayed in Figure \Ref{Load_abg} and its label - file is listed in Section \Ref{sec:Load_lbl}. - The subsystems are listed in Section \Ref{sec:Load_sub}. DELETED mttroot/mtt/lib/examples/Hybrid/Clutch/Load_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/Clutch/Load_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Clutch/Load_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/Clutch/Load_lbl.txt @@ -1,29 +0,0 @@ -%SUMMARY Load: An inertial/frictional load -%DESCRIPTION -%% Label file for system Load (Load_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/09/11 09:39:29 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type I - j_l lin flow,j_l - -% Component type R - r_l lin flow,r_l - -% Component type SS - [in] SS external,external DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_abg.fig @@ -1,28 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1350 2025 2475 2025 2250 2250 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 1800 2700 675 2925 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2925 2025 4050 2025 3825 2250 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 2025 5625 2025 5400 2250 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 1800 4275 675 4500 900 -2 4 0 2 31 7 99 0 -1 6.000 0 0 7 0 0 5 - 6975 3600 6975 180 225 180 225 3600 6975 3600 -4 1 0 100 0 0 20 0.0000 4 195 150 2700 2115 1\001 -4 1 0 100 0 0 20 0.0000 4 210 1065 2700 585 ISW:isw\001 -4 1 4 100 0 0 20 0.0000 4 255 870 765 2115 SS:[in]\001 -4 1 4 100 0 0 20 0.0000 4 255 1020 6255 2115 SS:[out]\001 -4 1 0 100 0 0 20 0.0000 4 195 150 4275 2115 1\001 -4 1 0 100 0 0 20 0.0000 4 195 390 4230 585 R:r\001 -4 1 1 99 0 1 20 0.0000 4 270 2250 3375 2835 Simple weir model\001 DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_desc.tex Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_desc.tex +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_desc.tex @@ -1,24 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system Weir (Weir_desc.tex) -% Generated by MTT on Tue Mar 2 22:05:29 GMT 1999. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Weir} is - displayed in Figure \Ref{Weir_abg} and its label - file is listed in Section \Ref{sec:Weir_lbl}. - The subsystems are listed in Section \Ref{sec:Weir_sub}. - - -The weir is modelled by an \textbf{ISW} component in series with an -\textbf{R} component. Physicaly, the former represents the inertia of -the fluid together with the switching effect of the weir; the latter -represents the flow resistance. - -The switching logic is on if the level on either side of the weir -reaches the level of the weir. DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weir_lbl.txt @@ -1,54 +0,0 @@ -#SUMMARY Weir -#DESCRIPTION Detailed description here - -## System Weir, representation lbl, language txt -## File Weir_lbl.txt -## Generated by MTT on Fri Oct 5 10:50:46 BST 2001 - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.2 2001/07/03 22:59:10 gawthrop - ## Fixed problems with argument passing for CRs - ## - ############################################################### - -## Port aliases -#ALIAS in in -#ALIAS out out - -## Argument aliases -#ALIAS $1 i_s -#ALIAS $2 r - -## Each line should be of one of the following forms: -## a comment (ie starting with #) -## component-name cr_name arg1,arg2,..argn -## blank - -## ---- Component labels ---- - -## Component type ISW - isw lin flow,i_s - -## Component type R - r lin flow,r - -## Component type R - [in] SS external,external - [out] SS external,external - - - - - - - - - DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_abg.fig @@ -1,73 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 6075 2025 4950 2250 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 675 6300 1800 6300 1530 6570 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 6525 2025 7650 2250 7425 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 675 6075 675 6525 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 7650 2250 7650 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 6525 6750 7200 6570 7200 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 6300 3375 6300 3105 6570 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 6300 5625 6300 5355 6570 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 6300 7200 6300 6930 6570 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 6300 9450 6300 9180 6570 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 6076 5851 4951 6076 5176 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5850 6525 5850 7650 6075 7425 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 7650 6075 7650 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9677 6077 9677 4952 9902 5177 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9675 6525 9675 7650 9900 7425 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9450 7650 9900 7650 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4860 3150 4860 1980 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 7110 3150 7110 1395 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 3 - 1 0 2.00 120.00 240.00 - 2610 450 3285 450 3285 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 - 3060 675 3060 3150 5760 3150 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 - 5985 3150 8955 3150 8955 675 -2 1 0 2 1 7 99 0 -1 0.000 0 0 -1 1 0 2 - 1 0 1.00 60.00 120.00 - 5850 2925 5850 3600 -4 1 -1 0 0 0 20 0.0000 4 195 150 2025 6390 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 960 2025 4815 C:tank1\001 -4 1 -1 0 0 0 20 0.0000 4 270 720 1980 7965 SS:p1\001 -4 1 -1 0 0 0 20 0.0000 4 210 525 315 6390 SS:f\001 -4 0 -1 0 0 0 20 0.0000 4 210 795 6300 7515 R:leak\001 -4 1 -1 0 0 0 20 0.0000 4 195 1065 3960 6390 Weir:w1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1065 7785 6390 Weir:w2\001 -4 1 -1 0 0 0 20 0.0000 4 210 960 5851 4816 C:tank2\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5851 6391 0\001 -4 1 -1 0 0 0 20 0.0000 4 270 720 5850 7965 SS:p2\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 9677 6392 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 960 9677 4817 C:tank3\001 -4 1 -1 0 0 0 20 0.0000 4 270 720 9630 7965 SS:p3\001 -4 1 1 1 0 3 20 0.0000 4 270 105 2970 315 f\001 -4 1 1 99 0 1 20 0.0000 4 210 825 3780 2565 Tank 1\001 -4 1 1 99 0 1 20 0.0000 4 210 825 5940 2565 Tank 2\001 -4 1 1 99 0 1 20 0.0000 4 210 825 8055 2565 Tank 3\001 -4 1 1 99 0 1 20 0.0000 4 210 585 5895 3870 Leak\001 DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_desc.tex Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_desc.tex +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_desc.tex @@ -1,69 +0,0 @@ -% Verbal description for system Weirs (Weirs_desc.tex) -% Generated by MTT on Thu Jul 3 10:27:26 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:47:43 peterg -% %% To RCS -% %% -% Revision 1.1 1997/09/11 10:31:48 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Weirs} is - displayed in Figure \Ref{Weirs_abg} and its label - file is listed in Section \Ref{sec:Weirs_lbl}. - The subsystems are listed in Section \Ref{sec:Weirs_sub}. - -%Each weir is modeled by two {\bf ISW} components: one for flow -%left-right and one for flow right-left. The switching is such that -%they become non-return valves when the left hand (respectively -%right-hand) level reaches an appropriate value. The parameters appear -%in Section \Ref{sec:Weirs_numpar.txt} and the switching conditions in -%Section \Ref{sec:Weirs_input.txt}. - -Aircraft fuel tanks are often fitted with baffles to reduce fuel -slosh. A simple model relating to such a system is shown in Figure -\Ref{Weirs_abg} which corresponds to a single tank containing two -dividing weirs. Liquid with flow rate $f$ enters the left-hand -compartment; liquid leaks out of the centre compartment at a flow rate -determined by gravity and the properties of the corresponding orifice. - -The Bond Graph appearing in Figure \Ref{Weirs_abg} represents each of -the three compartments by a \textbf{C} component (labelled tank1 to -tank3), the corresponding pressures are measured by the \textbf{SS} -elements p1--p3. The leak is represented by the \textbf{R} component -labelled leak. The flows over the two weirs are represented by the four -\textbf{ISW} components; each weir has a separate \textbf{ISW} -component for each flow direction. Each \textbf{ISW} component is -switched by the appropriate level. - -%It could be argued that, when switched on, each \textbf{ISW} component -%corresponds to flow inertia; but it is admitted that ideal -%\textbf{Sw} components would give a simpler approximation in this -%case. So the modeller has the choice of having a simple simulation -%problem but with four extra states, or a complex simulation with model -%switching but without the four extra states. - -The system was simulated for 20 time units and the resultant level of -each tank partition is plotted in Figure \Ref{fig:Weirs_odeso-noargs.ps}. Each -partition has unit cross section, and the two weir heights are $1$ and -$2$ respectively; the inflow $f$ is given by: -\begin{equation} - f = - \begin{cases} - 1 & \text{if $t \le 10$}\\ - 0 & \text{if $t > 10$} - \end{cases} -\end{equation} -and the leak resistance is linear with flow resistance 5. - - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_input.txt Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_input.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_input.txt +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_input.txt @@ -1,25 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (Weirs_input.txt) -# Generated by MTT at Tue Mar 2 07:48:04 GMT 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2001/10/05 11:24:35 gawthrop -## Updated for new mtt features - input.txt etc -## -## Revision 1.1 2000/05/19 07:12:04 peterg -## Initial revision -## -############################################################### - -# Set the inputs -## Removed by MTT on Fri Oct 5 10:47:20 BST 2001: mttu(1) = 1.0*(t<10); # f (Weirs) - - - -## Removed by MTT on Tue Jun 10 10:53:48 BST 2003: weirs_f = 1.0*(t<10); # Added by MTT on Fri Oct 05 10:48:01 BST 2001 - - -weirs__f = 1.0*(t<10); DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_lbl.txt @@ -1,47 +0,0 @@ -%% Label file for system Weirs (Weirs_lbl.txt) -%SUMMARY Weirs Double-weir tanks system (hybrid) -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/03/09 00:12:12 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases -%ALIAS $1 tank1 -%ALIAS $2 tank2 -%ALIAS $3 tank3 -%ALIAS $4 leak - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - tank1 lin effort,c_1 - tank2 lin effort,c_2 - tank3 lin effort,c_3 - -% Component type R - leak lin flow,r_l - -% Component type SS - f SS internal,external - p1 SS external,0 - p2 SS external,0 - p3 SS external,0 - -% Component type Weir - w1 none epsilon_i;epsilon_r - w2 none epsilon_i;epsilon_r DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_logic.txt Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_logic.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_logic.txt +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_logic.txt @@ -1,31 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system Weirs (Weirs_logic.txt) -# Generated by MTT on Thu May 18 12:29:15 BST 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 2002/09/29 14:23:16 geraint -## Updated switch names. -## -## Revision 1.2 2001/10/05 11:24:35 gawthrop -## Updated for new mtt features - input.txt etc -## -## Revision 1.1 2000/05/19 07:13:29 peterg -## Initial revision -## -## Revision 1.1 2000/05/18 11:29:58 peterg -## Initial revision -## -############################################################### - - -# Set the switches -# First weir - height 1 -# Second weir - height 2 -## Removed by MTT on Tue Jun 10 10:54:35 BST 2003: weirs_w1_isw_mtt_switch_logic = ((weirs_tank1 > 1) | (weirs_tank2 > 1)); -## Removed by MTT on Tue Jun 10 10:54:35 BST 2003: weirs_w2_isw_mtt_switch_logic = ((weirs_tank2 > 2) | (weirs_tank3 > 2)); -weirs__w1__isw__mtt_switch_logic = ((weirs__tank1 > 1) | (weirs__tank2 > 1)); -weirs__w2__isw__mtt_switch_logic = ((weirs__tank2 > 2) | (weirs__tank3 > 2)); - DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_numpar.txt Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_numpar.txt +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_numpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (Weirs_numpar.txt) -# Generated by MTT at Tue Mar 2 07:55:47 GMT 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_1 = 1.0; # Weirs -c_2 = 1.0; # Weirs -c_3 = 1.0; # Weirs -epsilon_i = 0.01; # weir -epsilon_r = 0.1; # weir -r_l = 5.0; # Weirs DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_rep.txt Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_rep.txt +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_rep.txt @@ -1,46 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system Weirs (Weirs_rep.txt) -## Generated by MTT on" Tue Mar 2 22:02:59 GMT 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.5 2000/05/19 07:15:04 peterg -## Added logic -## -## Revision 1.4 1999/12/21 09:24:26 peterg -## Euler integration - compiled -## -## Revision 1.3 1999/03/02 22:19:22 peterg -## Added switch rep -## -## Revision 1.2 1999/03/02 22:09:49 peterg -## Addded switch rep -## -## Revision 1.1 1999/03/02 22:04:11 peterg -## Initial revision -## -############################################################### - -mtt Weirs abg tex # The system description -## mtt Weirs cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt Weirs struc tex # The system structure -## mtt Weirs dae tex # The system dae -mtt Weirs ode tex # The system ode -mtt Weirs switch txt # The system switches -## mtt Weirs sspar tex # Steady-state parameters -## mtt Weirs ss tex # Steady state -## mtt Weirs dm tex # Descriptor matrices (of linearised system) -## mtt Weirs sm tex # State matrices (of linearised system) -## mtt Weirs tf tex # Transfer function (of linearised system) -## mtt Weirs lmfr ps # log modulus of frequency response (of linearised system) -mtt Weirs simpar tex # Simulation parameters -mtt Weirs numpar tex # Numerical simulation parameters -mtt Weirs input tex # Simulation input -mtt Weirs logic tex # Switch logic -mtt Weirs odeso ps # Simulation output - -mtt Weirs rep txt DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_simpar.txt Index: mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_simpar.txt +++ mttroot/mtt/lib/examples/Hybrid/Weirs/Weirs_simpar.txt @@ -1,16 +0,0 @@ -# Simulation parameters for system Weirs (Weirs_simpar.txt) -# Generated by MTT on Sun Jul 26 13:55:27 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1999/12/21 09:22:43 peterg -## Initial revision -## -############################################################### - - -LAST=19.9; -DT=0.01; -STEPFACTOR=1; DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/weir_abg.fig Index: mttroot/mtt/lib/examples/Hybrid/Weirs/weir_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/weir_abg.fig +++ mttroot/mtt/lib/examples/Hybrid/Weirs/weir_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1350 2025 2475 2025 2250 2250 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 1800 2700 675 2925 900 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2700 2250 2700 3375 2925 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2925 2025 4050 2025 3825 2250 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 2025 5625 2025 5400 2250 -4 1 0 100 0 0 20 0.0000 4 195 150 2700 2115 1\001 -4 1 0 100 0 0 20 0.0000 4 210 1065 2700 585 ISW:isw\001 -4 1 0 100 0 0 20 0.0000 4 195 390 2700 3690 R:r\001 -4 1 0 100 0 0 20 0.0000 4 255 870 765 2115 SS:[in]\001 -4 1 0 100 0 0 20 0.0000 4 255 1020 6255 2115 SS:[out]\001 -4 1 0 100 0 0 20 0.0000 4 195 150 4275 2115 1\001 DELETED mttroot/mtt/lib/examples/Hybrid/Weirs/weir_lbl.txt Index: mttroot/mtt/lib/examples/Hybrid/Weirs/weir_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Hybrid/Weirs/weir_lbl.txt +++ mttroot/mtt/lib/examples/Hybrid/Weirs/weir_lbl.txt @@ -1,37 +0,0 @@ -%% Label file for system weir (weir_lbl.txt) -%SUMMARY weir -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS out out - -% Argument aliases -%ALIAS $1 r - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type ISW - isw lin effort,epsilon_i - -% Component type R - r lin flow,epsilon_r - -% Component type SS - [in] SS external,external - [out] SS external,external - - DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/README Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/README ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/README +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/README @@ -1,10 +0,0 @@ -This is the example from: -@Article{Gaw00c, - author = {Peter J Gawthrop}, - title = {Sensitivity Bond Graphs}, - journal = JFI, - year = {2000} -} - - -NB Compile with -i euler DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/conical.cr Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/conical.cr ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/conical.cr +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/conical.cr @@ -1,9 +0,0 @@ -%% CR for conical tank example - -OPERATOR conical; -%% State input. -FOR ALL COMP, rho,g,V_0,V LET - conical(COMP, rho,g,V_0,effort,1,V,state,1) = rho*g*(12*(V+V_0)/pi)^(1/3); - - -END;; DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr @@ -1,13 +0,0 @@ -%% CR for pipe discharge - - -OPERATOR discharge; -%% Flow input -FOR ALL COMP, alpha,beta,F LET - discharge(COMP, alpha,beta,effort,1,F,flow,1) = beta*F^alpha; - -%% Effort input -FOR ALL COMP, alpha,beta,P LET - discharge(COMP, alpha,beta,flow,1,P,effort,1) = (P/beta)^(1/alpha); - -END;; DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_abg.fig Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_abg.fig +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_abg.fig @@ -1,39 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1575 2925 2745 2925 2520 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 2925 4320 2925 4095 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4725 2925 5895 2925 5670 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 2925 7470 2925 7245 3150 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2925 2700 2925 1530 3150 1755 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 2700 4500 1530 4725 1755 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 2700 6075 1530 6300 1755 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7650 2700 7650 1530 7875 1755 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 3150 6075 4320 6300 4095 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 1575 2700 1575 3150 -4 1 0 100 0 18 20 0.0000 4 270 195 2925 3015 0\001 -4 1 0 100 0 18 20 0.0000 4 270 195 4500 3015 1\001 -4 1 0 100 0 18 20 0.0000 4 270 195 7650 3015 1\001 -4 1 0 100 0 18 20 0.0000 4 285 705 2925 1440 C:t1\001 -4 1 0 100 0 18 20 0.0000 4 360 780 4545 1440 R:p1\001 -4 1 0 100 0 18 20 0.0000 4 360 780 7695 1440 R:p2\001 -4 1 0 100 0 18 20 0.0000 4 285 705 6075 1440 C:t2\001 -4 1 0 100 0 18 20 0.0000 4 270 195 6075 3015 0\001 -4 1 0 100 0 18 20 0.0000 4 360 825 6075 4680 De:y\001 -4 1 0 100 0 18 20 0.0000 4 285 720 1125 3060 Sf:u\001 DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_desc.tex Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_desc.tex +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_desc.tex @@ -1,34 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system idNonlinearTanks (idRC_desc.tex) -% Generated by MTT on Thu Apr 5 11:04:33 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{idNonlinearTanks} is - displayed in Figure \Ref{fig:idRC_abg.ps} and its label - file is listed in Section \Ref{sec:idRC_lbl}. - The subsystems are listed in Section \Ref{sec:idRC_sub}. - - - This example illustrates the sensitivity approach to model-based - system identification\footnote{Peter J Gawthrop, \emph{Sensitivity - Bond Graphs}, Journal Franklin Institute, \textbf{337}, 2000, - pp 907--922}. - - The system compprises two non-linear tanks (see the paper for details). - The method identifies four parameters: the two initial states ans - the two parameters of the non-linear flow resistance. - - To see the results, type: -\begin{verbatim} -mtt -oct -i euler -pdf idNonlinearTanks ippp view -\end{verbatim} - DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_ippp.m Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_ippp.m ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_ippp.m +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_ippp.m @@ -1,57 +0,0 @@ - -## Set up parameters -name = "idNonlinearTanks"; -sim = sidNonlinearTanks_simpar; # Simulation parameter -sym = sidNonlinearTanks_sympar; # Parameter names -par = sidNonlinearTanks_numpar; # Parameter values -x0 = sidNonlinearTanks_state(par); # Initial state - -## Simulation of "actual" system -t = [0:sim.dt:sim.last]'; -T = 5; # Period -u = ones(size(t)); -y_0 = sidNonlinearTanks_ssim(x0,par,sim,u,2); - -plot(t,y_0); - -## The initial parameters -par_0 = par; -par_0(sym.V_1) = 2.0; -par_0(sym.V_2) = 1.0; -par_0(sym.alpha) = 1.0; -par_0(sym.beta) = 2.0; - -## Identify -extras.criterion = 1e-5; -extras.max_iterations = 10; -extras.v = 10; # Use a really big initial value -extras.verbose = 1; # Show what is going on -[par,Par,Error,Y] = ppp_identify (name,u,y_0,["V_1 ";"V_2 ";"alpha";"beta "],par_0,extras); - -par = par - -grid; -xlabel("Time") -title("Output"); -plot(t,y_0); -figfig("idNonlinearTanks_output","pdf"); -figfig("idNonlinearTanks_output","ps"); -grid; - -xlabel("Time") -title("Estimated output"); -plot(t,y_0,t,Y); -figfig("idNonlinearTanks_outputs","pdf"); -figfig("idNonlinearTanks_outputs","ps"); - -xlabel("Iteration") -title("Estimation error"); -plot(Error); -figfig("idNonlinearTanks_error","pdf"); -figfig("idNonlinearTanks_error","ps"); - -xlabel("Iteration") -title("Estimated Parameter"); -plot(Par'); -figfig("idNonlinearTanks_parameters","pdf"); -figfig("idNonlinearTanks_parameters","ps"); DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_lbl.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_lbl.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_lbl.txt @@ -1,26 +0,0 @@ -%% Label file for system idNonlinearTanks (NonlinearTanks_lbl.txt) -%SUMMARY NonlinearTanks -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Component type C - t1 conical rho,g,V_1 - t2 conical rho,g,V_2 - -% Component type R - p1 discharge alpha,beta - p2 discharge alpha,beta - -% Component type Sf - u SS external - -% Component type De - y SS external - DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_numpar.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_numpar.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_numpar.txt @@ -1,26 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (sNonlinearTanks_numpar.txt) -# Generated by MTT at Mon Nov 29 17:36:54 EST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Parameters - -## States -v_1 = 0.5; # Tank 1 -v_2 = 0.25; # Tank 2 - -## Tank parameters -g = 1; #Gravity -rho = 1; # sC,sNonlinearTanks -alpha = 1.5; - -## Pipe parameters -beta = 1; - - DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.tex Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.tex ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.tex +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.tex @@ -1,133 +0,0 @@ - - -\section{\textbf{abg.tex}: System idNonlinearTanks, representation \textbf{abg}, language \textbf{tex}} -\label{sec:idNonlinearTanks_abg.tex} -\index{\textbf{idNonlinearTanks} -- abg} - - -MTT command: -\begin{verbatim} -mtt idNonlinearTanks abg tex -\end{verbatim} - \input{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_abg.tex} - - -\section{\textbf{cbg.ps}: System idNonlinearTanks, representation \textbf{cbg}, language \textbf{ps}} -\label{sec:idNonlinearTanks_cbg.ps} -\index{\textbf{idNonlinearTanks} -- cbg} - - -MTT command: -\begin{verbatim} -mtt idNonlinearTanks cbg ps -\end{verbatim} -This representation is given as Figure \Ref{fig:idNonlinearTanks_cbg.ps}. -\fig{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_cbg} - {idNonlinearTanks_cbg.ps} - {0.9} - {System \textbf{idNonlinearTanks}, representation cbg} - - -\section{\textbf{struc.tex}: System idNonlinearTanks, representation \textbf{struc}, language \textbf{tex}} -\label{sec:idNonlinearTanks_struc.tex} -\index{\textbf{idNonlinearTanks} -- struc} - - -MTT command: -\begin{verbatim} -mtt idNonlinearTanks struc tex -\end{verbatim} - \input{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_struc.tex} - - -\section{\textbf{sympar.tex}: System idNonlinearTanks, representation \textbf{sympar}, language \textbf{tex}} -\label{sec:idNonlinearTanks_sympar.tex} -\index{\textbf{idNonlinearTanks} -- sympar} - - -MTT command: -\begin{verbatim} -mtt idNonlinearTanks sympar tex -\end{verbatim} - \input{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_sympar.tex} - - -\section{\textbf{odeso.ps}: System sidNonlinearTanks, representation \textbf{odeso}, language \textbf{ps}} -\label{sec:sidNonlinearTanks_odeso.ps} -\index{\textbf{sidNonlinearTanks} -- odeso} - - -MTT command: -\begin{verbatim} -mtt -oct -s sidNonlinearTanks odeso ps -\end{verbatim} -This representation is given as Figure \Ref{fig:sidNonlinearTanks_odeso.ps}. -\fig{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/sidNonlinearTanks_odeso} - {sidNonlinearTanks_odeso.ps} - {0.9} - {System \textbf{sidNonlinearTanks}, representation odeso} - - -\section{\textbf{ippp.ps}: System idNonlinearTanks, representation \textbf{ippp}, language \textbf{ps}} -\label{sec:idNonlinearTanks_ippp.ps} -\index{\textbf{idNonlinearTanks} -- ippp} - - -MTT command: -\begin{verbatim} -mtt -oct -i euler idNonlinearTanks ippp ps -\end{verbatim} -This representation is given as Figure \Ref{fig:idNonlinearTanks_ippp.ps}. -\fig{/home/peterg/Research/Identification/MTT/idNonlinearTanks/MTT_work/idNonlinearTanks_ippp} - {idNonlinearTanks_ippp.ps} - {0.9} - {System \textbf{idNonlinearTanks}, representation ippp} - - -\section{\textbf{rep.txt}: System idNonlinearTanks, representation \textbf{rep}, language \textbf{txt}} -\label{sec:idNonlinearTanks_rep.txt} -\index{\textbf{idNonlinearTanks} -- rep} - - -MTT command: -\begin{verbatim} -mtt idNonlinearTanks rep txt -\end{verbatim} - \begin{verbatim} -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system idNonlinearTanks (idRC_rep.txt) -## Generated by MTT on" Thu Apr 5 11:17:27 BST 2001. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt idNonlinearTanks abg tex # The system description -mtt idNonlinearTanks cbg ps # The causal bond graph -mtt idNonlinearTanks struc tex # The system structure -mtt idNonlinearTanks sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt idNonlinearTanks dae tex # The system dae -## mtt idNonlinearTanks ode tex # The system ode -## mtt idNonlinearTanks sspar tex # Steady-state parameters -## mtt idNonlinearTanks ss tex # Steady state -## mtt idNonlinearTanks dm tex # Descriptor matrices (of linearised system) -## mtt idNonlinearTanks sm tex # State matrices (of linearised system) -## mtt idNonlinearTanks tf tex # Transfer function (of linearised system) -## mtt idNonlinearTanks lmfr ps # log modulus of frequency response (of linearised system) -## mtt idNonlinearTanks simpar tex # Simulation parameters -## mtt idNonlinearTanks numpar tex # Numerical simulation parameters -## mtt idNonlinearTanks state tex # Simulation initial state -## mtt idNonlinearTanks input tex # Simulation input -## mtt idNonlinearTanks logic tex # Logic control - mtt -oct -s sidNonlinearTanks odeso ps # Simulation output - mtt -oct -i euler idNonlinearTanks ippp ps - -mtt idNonlinearTanks rep txt # This file - \end{verbatim} DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt @@ -1,39 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system idNonlinearTanks (idRC_rep.txt) -## Generated by MTT on" Thu Apr 5 11:17:27 BST 2001. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2001/04/05 12:00:18 gawthrop -## Identification example -## -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt idNonlinearTanks abg tex # The system description -mtt idNonlinearTanks cbg ps # The causal bond graph -mtt idNonlinearTanks struc tex # The system structure -mtt idNonlinearTanks sympar tex # The system parameters -## Uncomment the following lines or add others -##mtt idNonlinearTanks dae tex # The system dae - mtt idNonlinearTanks ode tex # The system ode -## mtt idNonlinearTanks sspar tex # Steady-state parameters -## mtt idNonlinearTanks ss tex # Steady state -## mtt idNonlinearTanks dm tex # Descriptor matrices (of linearised system) -## mtt idNonlinearTanks sm tex # State matrices (of linearised system) -## mtt idNonlinearTanks tf tex # Transfer function (of linearised system) -## mtt idNonlinearTanks lmfr ps # log modulus of frequency response (of linearised system) -## mtt idNonlinearTanks simpar tex # Simulation parameters -## mtt idNonlinearTanks numpar tex # Numerical simulation parameters -## mtt idNonlinearTanks state tex # Simulation initial state -## mtt idNonlinearTanks input tex # Simulation input -## mtt idNonlinearTanks logic tex # Logic control -## mtt -oct -s sidNonlinearTanks odeso ps # Simulation output - mtt -i euler idNonlinearTanks ident ps - -mtt idNonlinearTanks rep txt # This file DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_simpar.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_simpar.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_simpar.txt @@ -1,22 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system idNonlinearTanks (sidNonlinearTanks_simpar.txt) -# Generated by MTT on Wed Apr 4 15:25:33 BST 2001. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - - -FIRST = 0.0; # First time in simulation output -DT = 0.1; # Print interval -LAST = 10.0; # Last time in simulation -STEPFACTOR = 10; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_subs.r Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_subs.r ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_subs.r +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_subs.r @@ -1,23 +0,0 @@ -% Default SUBS file -% File idRC_subs.r -% Generated by MTT on Tue Apr 3 09:43:38 BST 2001. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2001/04/05 12:00:18 gawthrop -% %% Identification example -% %% -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Put algebraic substitution commands here - -%The following is now done automatically -% FOR ALL x,y LET x^y = pow(x,y); -END; DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sC_abg.fig Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sC_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sC_abg.fig +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sC_abg.fig @@ -1,26 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3105 3105 3195 3645 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3150 3150 3150 3600 --6 -6 6705 3105 6795 3645 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6750 3150 6750 3600 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 3375 5400 3375 5625 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 3375 4500 3375 4275 3600 -4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 -4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 -4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 -4 1 0 100 0 18 18 0.0000 4 210 450 4950 3465 C:c\001 DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sC_lbl.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sC_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sC_lbl.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sC_lbl.txt @@ -1,29 +0,0 @@ -%% Label file for system sC (sC_lbl.txt) -%SUMMARY sC -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in actual,sensitivity - -% Argument aliases -%ALIAS $1 rho,g,V_0,V_0s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - c sconical rho,g,V_0,V_0s - -% Component type SS - [actual] SS external,external - [sensitivity] SS external,external DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sR_abg.fig Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sR_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sR_abg.fig +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sR_abg.fig @@ -1,26 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 4455 3105 4545 3645 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4500 3150 4500 3600 --6 -6 5355 3105 5445 3645 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 3150 5400 3600 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6750 3375 5400 3375 5625 3600 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 3375 4500 3375 4275 3600 -4 1 4 100 0 18 14 0.0000 4 210 270 4410 3105 [1]\001 -4 1 4 100 0 18 14 0.0000 4 210 270 5535 3105 [2]\001 -4 0 4 100 0 18 18 0.0000 4 270 1935 6840 3465 SS:[sensitivity]\001 -4 2 4 100 0 18 18 0.0000 4 270 1410 3060 3465 SS:[actual]\001 -4 1 0 100 0 18 18 0.0000 4 210 390 4950 3465 R:r\001 DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sR_lbl.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sR_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sR_lbl.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sR_lbl.txt @@ -1,29 +0,0 @@ -%% Label file for system sR (sR_lbl.txt) -%SUMMARY sR -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in actual,sensitivity - -% Argument aliases -%ALIAS $1 alpha,beta,alpha_s,beta_s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - r sdischarge alpha,beta,alpha_s,beta_s - -% Component type SS - [actual] SS external,external - [sensitivity] SS external,external DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr @@ -1,21 +0,0 @@ -%% CR for conical tank example - sensitivity - -in "conical.cr"; - -OPERATOR sconical; -%% The actual port (1) -FOR ALL COMP, rho,g,V_0,V_0s,V,sV LET - sconical(COMP, rho,g,V_0,V_0s,effort,1, - V,state,1, - sV,state,2) - = conical(COMP, rho,g,V_0,effort,1,V,state,1); - -%% The sensitivity port (2) -FOR ALL COMP, rho,g,V_0,V_0s,V,sV LET - sconical(COMP, rho,g,V_0,V_0s,effort,2, - V,state,1, - sV,state,2) - = df(conical(COMP, rho,g,V_0,effort,1,V,state,1),V) * sV - + df(conical(COMP, rho,g,V_0,effort,1,V,state,1),V_0)* V_0s; - -END;; DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr @@ -1,31 +0,0 @@ -%% CR file for the sR component. - 2 port. -%% Special version just for this example. - -%% CR for non-linear pipe discharge -%% Just do for flow input causality. - -in "discharge.cr"; - -PROCEDURE l_discharge(COMP, alpha,beta,P); -BEGIN - result := sub({x=P},df(discharge(COMP, alpha,beta,flow,1,x,effort,1), x)); - return result; -END; - -OPERATOR sdischarge; -%% The actual port (1) -- Pressure input -FOR ALL COMP, alpha,beta,alpha_s,beta_s,P,sP LET - sdischarge(COMP, alpha,beta,alpha_s,beta_s,flow,1, - P,effort,1, - sP,effort,2) - = discharge(COMP, alpha,beta,flow,1,P,effort,1); - -%% The sensitivity port (2) -- Pressure input -FOR ALL COMP, alpha,beta,alpha_s,beta_s,P,sP LET - sdischarge(COMP, alpha,beta,alpha_s,beta_s,flow,2, - P,effort,1, - sP,effort,2) - = l_discharge(COMP, alpha,beta,P) * sP - + df(discharge(COMP, alpha,beta,flow,1,P,effort,1), alpha)* alpha_s - + df(discharge(COMP, alpha,beta,flow,1,P,effort,1), beta) * beta_s; -END;; DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_lbl.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_lbl.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_lbl.txt @@ -1,32 +0,0 @@ -%% Label file for system NonlinearTanks (NonlinearTanks_lbl.txt) -%SUMMARY NonlinearTanks -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - t1 sconical rho,g,V_1,V_1s - t2 sconical rho,g,V_2,V_2s - -% Component type R - p1 sdischarge alpha,beta,alphas,betas - p2 sdischarge alpha,beta,alphas,betas - -% Component type Sf - u SS external;0 - -% Component type De - y SS external;external - DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt @@ -1,35 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (sNonlinearTanks_numpar.txt) -# Generated by MTT at Mon Nov 29 17:36:54 EST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2001/04/05 12:00:18 gawthrop -# %% Identification example -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Parameters - -## States -v_1 = 2.0; # Tank 1 -v_2 = 1.0; # Tank 2 - -## Tank parameters -g = 1; #Gravity -rho = 1; # sC,sNonlinearTanks -alpha = 1.0; - -## Pipe parameters -beta = 2.0; - -## Sensitivity. -v_1s = 0; # Tank 1 -v_2s = 0; # Tank 2 - -alphas = 0; -betas = 0; - DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_simpar.txt Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_simpar.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_simpar.txt @@ -1,22 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system sidNonlinearTanks (sidNonlinearTanks_simpar.txt) -# Generated by MTT on Wed Apr 4 15:25:33 BST 2001. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - - -FIRST = 0.0; # First time in simulation output -DT = 0.1; # Print interval -LAST = 10.0; # Last time in simulation -STEPFACTOR = 10; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_subs.r Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_subs.r ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_subs.r +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_subs.r @@ -1,22 +0,0 @@ -% Default SUBS file -% File idRC_subs.r -% Generated by MTT on Tue Apr 3 09:43:38 BST 2001. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Put algebraic substitution commands here - -FOR ALL x,y LET x^y = pow(x,y); % Use the pow function - -ON ROUNDED; % No integer output - -END; DELETED mttroot/mtt/lib/examples/Identification/idRC/create_data.m Index: mttroot/mtt/lib/examples/Identification/idRC/create_data.m ================================================================== --- mttroot/mtt/lib/examples/Identification/idRC/create_data.m +++ mttroot/mtt/lib/examples/Identification/idRC/create_data.m @@ -1,12 +0,0 @@ -## Create some data - c = 1; - r = 5; - tau = r*c; - - t = [0:0.1:10]'; # time - one = ones(size(t)); - u = one; # Step input - y = one - exp(-t/tau); # Exact step response - - save idRC_ident_data.dat y u t - DELETED mttroot/mtt/lib/examples/Identification/idRC/idRC_abg.fig Index: mttroot/mtt/lib/examples/Identification/idRC/idRC_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Identification/idRC/idRC_abg.fig +++ mttroot/mtt/lib/examples/Identification/idRC/idRC_abg.fig @@ -1,18 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2250 2475 3600 2475 3375 2700 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4500 2475 5850 2475 5625 2700 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 6975 3600 1125 3600 1125 1800 6975 1800 6975 3600 -4 1 0 100 0 18 18 0.0000 4 210 600 1800 2565 Se:u\001 -4 1 0 100 0 18 18 0.0000 4 210 750 4050 2565 RC:rc\001 -4 1 0 100 0 18 18 0.0000 4 270 600 6345 2565 De:y\001 DELETED mttroot/mtt/lib/examples/Identification/idRC/idRC_desc.tex Index: mttroot/mtt/lib/examples/Identification/idRC/idRC_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Identification/idRC/idRC_desc.tex +++ mttroot/mtt/lib/examples/Identification/idRC/idRC_desc.tex @@ -1,48 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system idRC (idRC_desc.tex) -% Generated by MTT on Thu Apr 5 11:04:33 BST 2001. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 2003/08/18 08:06:11 gawthrop -% %% A working version with more explantion -% %% -% %% Revision 1.2 2002/09/23 11:16:27 gawthrop -% %% New example for ident representation -% %% -% %% Revision 1.1 2001/04/05 11:57:29 gawthrop -% %% Identification example -% %% -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{idRC} is - displayed in Figure \Ref{fig:idRC_abg.ps} and its label - file is listed in Section \Ref{sec:idRC_lbl}. - The subsystems are listed in Section \Ref{sec:idRC_sub}. - - - This example illustrates the sensitivity approach to model-based - system identification\footnote{Peter J Gawthrop, \emph{Sensitivity - Bond Graphs}, Journal Franklin Institute, \textbf{337}, 2000, - pp 907--922}. - - The system is a simple RC circuit with zero initial condition; the - method identifies the resitance $r$. - - The data is created by typing: -\begin{verbatim} -make -\end{verbatim} -To see the results, type: -\begin{verbatim} -mtt -oct -i euler idRC ident view -\end{verbatim} - - \paragraph{NB} All sensitivity coefficients in idRC\_simpar.txt must - be set to zero. DELETED mttroot/mtt/lib/examples/Identification/idRC/idRC_ident_numpar.m Index: mttroot/mtt/lib/examples/Identification/idRC/idRC_ident_numpar.m ================================================================== --- mttroot/mtt/lib/examples/Identification/idRC/idRC_ident_numpar.m +++ mttroot/mtt/lib/examples/Identification/idRC/idRC_ident_numpar.m @@ -1,71 +0,0 @@ -function [y,u,t,par_names,Q,extras] = idRC_ident_numpar; - - ## usage: [y,u,t,par_names,Q,extras] = idRC_ident_numpar; - ## Edit for your own requirements - ## Created by MTT on - - - ## This section sets up the data source - ## simulate = 0 Real data (you supply idRC_ident_data.dat) - ## simulate = 1 Real data input, simulated output - ## simulate = 2 Unit step input, simulated output - simulate = 0; - - - ## System info - [n_x,n_y,n_u,n_z,n_yz] = idRC_def; - simpars = sidRC_simpar; - - ## Access or create data - if (simulate<2) # Get the real data - if (exist("idRC_ident_data.dat")==2) - printf("Loading idRC_ident_data.dat\n"); - load idRC_ident_data.dat - else - printf("Please create a loadable file idRC_ident_data.dat containing y,u and t\n"); - return - endif - else - switch simulate - case 2 # Step simulation - t = [0:simpars.dt:simpars.last]'; - u = ones(size(t)); - otherwise - error(sprintf("simulate = %i not implemented", simulate)); - endswitch - endif - - if (simulate>0) - par = idRC_numpar(); - x_0 = idRC_state(par); - dt = t(2)-t(1); - simpars.dt = dt; - simpars.last = t(length(t)); - y = idRC_sim(zeros(n_x,1), par, simpars, u); - endif - - ## Default parameter names - Put in your own here - sympar = idRC_sympar; # Symbolic params as structure - par_names = struct_elements (sympar); # Symbolic params as strings - [n,m] = size(par_names); # Size the string list - - ## Sort by index - for [i,name] = sympar - par_names(i,:) = sprintf("%s%s",name, blanks(m-length(name))); - endfor - - par_names = "r"; # Estimate r only - - ## Output weighting vector - Q = ones(n_y,1); - - ## Extra parameters - extras.criterion = 1e-5; - extras.emulate_timing = 0; - extras.max_iterations = 10; - extras.simulate = simulate; - extras.v = 1e-2; - extras.verbose = 1; - extras.visual = 1; - -endfunction DELETED mttroot/mtt/lib/examples/Identification/idRC/idRC_rep.txt Index: mttroot/mtt/lib/examples/Identification/idRC/idRC_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idRC/idRC_rep.txt +++ mttroot/mtt/lib/examples/Identification/idRC/idRC_rep.txt @@ -1,46 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system idRC (idRC_rep.txt) -## Generated by MTT on" Thu Jun 27 17:03:00 BST 2002. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2002/09/23 11:42:14 gawthrop -## Example uses simulated data from idRC_ident_data -## -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt idRC abg tex # The system description -##mtt idRC cbg ps # The causal bond graph -mtt idRC struc tex # The system structure -mtt idRC sympar tex # The system parameters - -## Uncomment the following lines or add others -## mtt idRC dae tex # The system dae -## mtt idRC ode tex # The system ode -## mtt idRC sspar tex # Steady-state parameters -## mtt idRC ss tex # Steady state -## mtt idRC dm tex # Descriptor matrices (of linearised system) -## mtt idRC sm tex # State matrices (of linearised system) -## mtt idRC tf tex # Transfer function (of linearised system) -## mtt idRC lmfr ps # log modulus of frequency response (of linearised system) -## mtt idRC simpar txt # Simulation parameters -## mtt idRC numpar txt # Numerical simulation parameters -## mtt idRC state txt # Simulation initial state -## mtt idRC input txt # Simulation input -## mtt idRC logic txt # Logic control -## mtt idRC odeso ps # Simulation output - - -## Linear identificationm -##mtt idRC ident_numpar tex -mtt idRC ident ps -##mtt idRC ident_comparison ps -mtt idRC ident_par tex - -mtt idRC rep txt # This file DELETED mttroot/mtt/lib/examples/Identification/idRC/sidRC_numpar.txt Index: mttroot/mtt/lib/examples/Identification/idRC/sidRC_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idRC/sidRC_numpar.txt +++ mttroot/mtt/lib/examples/Identification/idRC/sidRC_numpar.txt @@ -1,15 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System sidRC, representation numpar, language txt; -## File sidRC_numpar.txt; -## Generated by MTT on Mon Sep 23 11:39:27 BST 2002; - - - -c = 1.0; # Default -cs = 0.0; # MUST BE ZERO -r = 1.0; # Default -rs = 0.0; # MUST BE ZERO -us = 0.0; # MUST BE ZERO - DELETED mttroot/mtt/lib/examples/Inverse/iMacroMicro/Make Index: mttroot/mtt/lib/examples/Inverse/iMacroMicro/Make ================================================================== --- mttroot/mtt/lib/examples/Inverse/iMacroMicro/Make +++ mttroot/mtt/lib/examples/Inverse/iMacroMicro/Make @@ -1,7 +0,0 @@ -%Makes the figures for the paper/report. -mtt macmic cbg ps -mtt imacmic cbg ps -mtt imacmic sm m -mtt imacmic numpar m - -octave figures.m DELETED mttroot/mtt/lib/examples/Inverse/iMacroMicro/figures.m Index: mttroot/mtt/lib/examples/Inverse/iMacroMicro/figures.m ================================================================== --- mttroot/mtt/lib/examples/Inverse/iMacroMicro/figures.m +++ mttroot/mtt/lib/examples/Inverse/iMacroMicro/figures.m @@ -1,56 +0,0 @@ -% Set up the parameters -imacmic_numpar; - -% Range of damping for the macro controller -D_1 = [0:0.1:2]; - -% Compute the damping factor d and save in arrray DD -% -- uses zeros of system -% $$$ DD = []; -% $$$ for d_1 = D_1 -% $$$ [A,B,C,D] = macmic_dm(m_1,m_2,b_1,b_2,k_2,k_t,b_t,b_3,m_3,p_1,d_1); -% $$$ zz = ss2zp(A,B,C,D,1); -% $$$ z = (zz(:,2)); -% $$$ re = sort(real(z)); -% $$$ im = sort(imag(z)); -% $$$ d = -re./sqrt(re.^2 + im.^2); -% $$$ d = sort(d); -% $$$ DD = [DD d]; -% $$$ end; -% $$$ -% $$$ plot(D_1,min(DD)); grid -% $$$ xlabel('Derivative gain'); -% $$$ ylabel('Damping factor'); -% $$$ -% $$$ - -% Compute the damping factor d and save in arrray DD -% -- uses poles of inverse system -DD1 = []; -for d_1 = D_1 - [A] = imacmic_sm; - z = eig(A); - - re = (real(z)); - im = (imag(z)); - d = -re./sqrt(re.^2 + im.^2); - d = sort(d); - DD1 = [DD1 d]; -end; -minDD1 = min(DD1); - -plot(D_1,minDD1); grid -xlabel('Derivative gain'); -ylabel('Damping factor'); - -Maximum_Damping = max(minDD1) -index = minDD1 == Maximum_Damping*ones(size(minDD1)); -Opt_gain = index*D_1' - -% Plot on disk -set term postscript -set output "damping.ps" -plot(D_1,minDD1); grid - - - DELETED mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_abg.fig @@ -1,151 +0,0 @@ -#FIG 3.2 -Portrait -Center -Inches -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2706 4806 3606 4806 3456 4956 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2406 5106 2406 6006 2556 5856 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3906 5106 3906 6006 4056 5856 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7208 4808 8108 4808 7958 4958 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8708 4808 9608 4808 9458 4958 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8408 5108 8408 6008 8558 5858 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7208 4508 8108 3608 8108 3833 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8708 3608 9608 4508 9383 4508 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9909 5109 9909 6009 10059 5859 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6908 5108 6908 6008 7058 5858 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8405 2405 8405 3305 8555 3155 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11407 5107 11407 6007 11557 5857 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11406 3306 11406 2406 11556 2556 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4206 4806 5106 4806 4956 4956 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5406 5106 5406 6006 5556 5856 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4206 4506 5106 3606 5106 3831 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5405 3305 5405 2405 5555 2555 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2405 3305 2405 2405 2555 2555 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11707 4807 12607 4807 12457 4957 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11707 3607 12607 4507 12382 4507 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2105 1805 2105 905 2255 1055 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2705 1805 2705 905 2855 1055 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5706 4806 6606 4806 6456 4956 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5706 3606 6606 4506 6381 4506 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2704 3604 3604 4504 3379 4504 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1208 4808 2108 4808 1958 4958 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1208 4508 2108 3608 2108 3833 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 681 3606 1131 3606 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 906 4506 906 3606 1056 3756 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12905 4505 12905 3605 13055 3755 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10207 4807 11107 4807 10957 4957 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10207 4507 11107 3607 11107 3832 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8400 3300 8625 3300 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 12900 3600 13125 3600 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 12675 4500 12900 4500 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8175 2400 8400 2400 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 1501 5401 301 5401 301 3001 1501 3001 1501 5401 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 3300 2700 1500 2700 1500 450 3300 450 3300 2700 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 3000 6600 1800 6600 1800 3000 3000 3000 3000 6600 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 4501 6601 3301 6601 3301 3901 4501 3901 4501 6601 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 6000 6600 4800 6600 4800 1800 6000 1800 6000 6600 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 7501 6601 6301 6601 6301 3901 7501 3901 7501 6601 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 9000 6600 7800 6600 7800 1800 9000 1800 9000 6600 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 10501 6601 9301 6601 9301 3901 10501 3901 10501 6601 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 12000 6600 10800 6600 10800 1800 12000 1800 12000 6600 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 13501 5401 12301 5401 12301 3001 13501 3001 13501 5401 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 11700 4575 11700 4800 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 12600 4800 12600 5025 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 10200 4575 10200 4800 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 11100 4800 11100 5025 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 9600 4500 9450 4650 -2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 8700 3600 8850 3450 -4 1 -1 0 0 0 20 0.0000 4 195 150 2406 4881 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 585 3906 6381 I:m1\001 -4 1 -1 0 0 0 20 0.0000 4 210 585 2405 6380 R:b1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 2405 3680 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 3906 4881 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 8408 4883 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 8408 3683 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 585 8483 6383 R:b3\001 -4 1 -1 0 0 0 20 0.0000 4 210 675 8407 2182 SS:f2\001 -4 1 -1 0 0 0 20 0.0000 4 195 585 9906 6381 I:m3\001 -4 1 -1 0 0 0 20 0.0000 4 195 585 6905 6380 I:m2\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 11407 4882 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 11407 3682 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 525 11406 2181 C:kt\001 -4 1 -1 0 0 0 20 0.0000 4 210 525 11482 6382 R:bt\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5406 4881 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5406 3681 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 585 5481 6381 R:b2\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 12909 4884 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 6908 4883 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 2404 2179 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 585 2779 754 C:p1\001 -4 1 -1 0 0 0 20 0.0000 4 210 585 2104 754 R:d1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 910 4885 1\001 -4 1 -1 0 0 0 20 0.0000 4 210 675 902 3377 SS:fb\001 -4 1 -1 0 0 0 20 0.0000 4 210 615 12905 3380 SS:ft\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 9909 4884 1\001 -4 1 -1 0 0 0 20 0.0000 4 210 585 5405 2180 C:k2\001 -4 1 1 1 0 3 20 0.0000 4 210 1455 900 5700 Macro base\001 -4 1 1 1 0 3 20 0.0000 4 210 1800 2401 376 Macro control\001 -4 1 1 1 0 3 20 0.0000 4 195 1950 2400 6900 Macro actuator\001 -4 1 1 1 0 3 20 0.0000 4 195 1530 3900 3825 Macro mass\001 -4 1 1 1 0 3 20 0.0000 4 195 1470 6900 3825 Micro mass\001 -4 1 1 1 0 3 20 0.0000 4 270 1890 5400 1650 Compliant link\001 -4 1 1 1 0 3 20 0.0000 4 195 1890 8475 1650 Micro actuator\001 -4 1 1 1 0 3 20 0.0000 4 255 1125 9900 3825 Tip mass\001 -4 1 1 1 0 3 20 0.0000 4 270 2985 11400 1650 Compliant environment\001 -4 1 1 1 0 3 20 0.0000 4 255 1305 12901 5701 Tip sensor\001 DELETED mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_desc.tex @@ -1,31 +0,0 @@ -% Verbal description for system iMacroMicro (iMacroMicro_desc.tex) -% Generated by MTT on Tue Dec 9 18:13:04 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/02/22 22:24:27 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{iMacroMicro} is - displayed in Figure \Ref{iMacroMicro_abg} and its label - file is listed in Section \Ref{sec:iMacroMicro_lbl}. - The subsystems are listed in Section \Ref{sec:iMacroMicro_sub}. - -This is a Bond Graph model of the macro-micro manipulation system -discussed by Sharon in his thesis and by Sharon, Hogan and Hardt in -various papers. The micro loop is inverted whilst leaving the macro -control in place. This {\em partial inverse\/} gives information about -the {\em zero dynamics\/} of the micro control system with the -particular macro controller in place and allows desidn of the macro -controller to ease the design of the micro controller. - - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_lbl.txt @@ -1,32 +0,0 @@ -%% Label file (macmic_lbl.txt) -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Masses -m1 lin flow,m_1 -m2 lin flow,m_2 -m3 lin flow,m_3 - -%Springs -k2 lin state,k_2 -kt lin state,k_t - -%Dampers -b1 lin flow,b_1 -b2 lin flow,b_2 -b3 lin flow,b_3 -bt lin flow,b_t - -%Source/sensors -f2 SS external,internal -ft SS external,0 -fb SS internal,0 - -%Control -p1 lin flow,p_1 -d1 lin flow,d_1 - - - DELETED mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_numpar.txt @@ -1,11 +0,0 @@ -m_1 = 0.0169; # m_1; -m_2 = 0.0169; # m_2; -b_1 = 0.13; # b_1; -b_2 = 0.013; # b_2; -k_2 = 24; # k_2; -k_t = 150; # k_t; -b_t = 0.16; # b_t; -b_3 = 0.13; # b_3; -m_3 = 0.005; # m_3; -p_1 = 10; # p_1; -d_1 = 0.9; # d_1; DELETED mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_rep.txt @@ -1,24 +0,0 @@ -# Outline report file for system iMacroMicro (iMacroMicro_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:49:22 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt iMacroMicro abg tex -mtt iMacroMicro cbg ps -mtt iMacroMicro struc tex -mtt iMacroMicro dae tex -mtt iMacroMicro dm tex -mtt iMacroMicro tf tex -mtt iMacroMicro numpar txt -mtt iMacroMicro lmfr ps -mtt iMacroMicro lpfr ps -mtt iMacroMicro sro ps -mtt iMacroMicro odeso ps - DELETED mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_simpar.txt Index: mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_simpar.txt +++ mttroot/mtt/lib/examples/Inverse/iMacroMicro/iMacroMicro_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system iMacroMicro (iMacroMicro_simpar.txt) -# Generated by MTT on Wed Nov 18 10:08:20 GMT 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 10.0; # Last time in simulation -DT = 0.1; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -2; # Minimum frequency = 10^WMIN -WMAX = 4; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_abg.fig @@ -1,68 +0,0 @@ -#FIG 3.2 -Portrait -Center -Inches -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3903 2403 4803 2403 4653 2553 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5403 2403 6303 2403 6153 2553 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 2103 3603 1203 3753 1353 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2702 3002 3302 2402 3302 2627 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3905 4201 4805 4201 4655 4351 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5405 4201 6305 4201 6155 4351 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3605 4501 3605 5401 3755 5251 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2702 3602 3302 4202 3077 4202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7803 3302 8703 3302 8553 3452 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1203 3302 2103 3302 1953 3452 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2101 3076 2101 3301 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2101 3301 2101 3526 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8701 3076 8701 3301 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8701 3301 8701 3526 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5103 2103 5103 1203 5253 1353 -2 4 1 2 -1 7 0 0 -1 6.000 0 0 7 0 0 5 - 5700 3000 5700 600 3000 600 3000 3000 5700 3000 -2 4 1 2 -1 7 0 0 -1 6.000 0 0 7 0 0 5 - 5700 6000 5700 3600 3000 3600 3000 6000 5700 6000 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 4200 7650 3600 7650 3825 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7052 2402 7652 3002 7427 3002 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5100 4500 5100 5400 5250 5250 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4800 4501 4164 5137 4376 5137 -4 1 -1 0 0 0 20 0.0000 4 195 150 3603 2478 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5103 2478 0\001 -4 1 -1 0 0 0 20 0.0000 4 240 660 3602 1052 R:r_s\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 2402 3377 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 3603 4278 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5103 4278 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 720 6603 4278 AE:m\001 -4 1 -1 0 0 0 20 0.0000 4 240 645 3603 5778 R:r_f\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 7577 3377 1\001 -4 1 -1 0 0 0 20 0.0000 4 210 705 751 3376 SS:e1\001 -4 1 -1 0 0 0 20 0.0000 4 210 705 9151 3376 SS:e2\001 -4 1 -1 0 0 0 20 0.0000 4 240 690 5102 1052 C:c_s\001 -4 1 1 1 0 3 20 0.0000 4 270 1515 4200 375 Slow system\001 -4 1 1 1 0 3 20 0.0000 4 255 1470 4200 6450 Fast system\001 -4 1 -1 0 0 0 20 0.0000 4 255 630 6678 2478 AE:p\001 -4 1 -1 0 0 0 20 0.0000 4 240 675 5104 5779 C:c_f\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 4203 5478 R:r\001 DELETED mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_desc.tex @@ -1,21 +0,0 @@ -% Verbal description for system NMP (NMP_desc.tex) -% Generated by MTT on Tue Dec 9 17:34:06 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{NMP} is - displayed in Figure \Ref{NMP_abg} and its label - file is listed in Section \Ref{sec:NMP_lbl}. - The subsystems are listed in Section \Ref{sec:NMP_sub}. - -This is a simple non-minimum phase system with an inverse-type -response. It is the standard fast negative and slow positive systems -in parallel. The corresponding inverse system \textbf{iNMP} is -unstable. - - DELETED mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_lbl.txt @@ -1,49 +0,0 @@ -%% Label file for system NMP (NMP_lbl.txt) -%SUMMARY NMP A simple non-minimum phase system -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/05/20 16:40:54 peterg -% %% New SS format -% %% -% %% Revision 1.1 1999/03/09 00:08:21 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases -%ALIAS $1 c_f -%ALIAS $2 c_s -%ALIAS $3 r_f -%ALIAS $4 r_s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AE - m lin -1 - p lin 1 - -% Component type C - c_f lin effort,c_f - c_s lin effort,c_s - -% Component type R - r lin flow,r - r_f lin flow,r_f - r_s lin flow,r_s - -% Component type SS - e1 SS external,internal - e2 SS external,0 DELETED mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_numpar.txt @@ -1,17 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (NMP_numpar.txt) -# Generated by MTT at Thu Oct 8 09:25:16 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_f = 0.5; # NMP -c_s = 1.0; # NMP -r = 1.0; # NMP -r_f = 1.0; # NMP -r_s = 1.0; # NMP DELETED mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iNMP/NMP/NMP_rep.txt @@ -1,18 +0,0 @@ -# Outline report file for system NMP (NMP_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt NMP abg tex -mtt NMP struc tex -mtt NMP ode tex -mtt NMP sm tex -mtt NMP tf tex - -mtt NMP sro ps -mtt NMP lmfr ps -mtt NMP lpfr ps DELETED mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_abg.fig @@ -1,72 +0,0 @@ -#FIG 3.2 -Portrait -Center -Inches -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3903 2403 4803 2403 4653 2553 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5403 2403 6303 2403 6153 2553 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 2103 3603 1203 3753 1353 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2702 3002 3302 2402 3302 2627 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3905 4201 4805 4201 4655 4351 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5405 4201 6305 4201 6155 4351 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3605 4501 3605 5401 3755 5251 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2702 3602 3302 4202 3077 4202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7803 3302 8703 3302 8553 3452 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1203 3302 2103 3302 1953 3452 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2101 3301 2101 3526 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8701 3301 8701 3526 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5103 2103 5103 1203 5253 1353 -2 4 1 2 -1 7 0 0 -1 6.000 0 0 7 0 0 5 - 5700 3000 5700 600 3000 600 3000 3000 5700 3000 -2 4 1 2 -1 7 0 0 -1 6.000 0 0 7 0 0 5 - 5700 6000 5700 3600 3000 3600 3000 6000 5700 6000 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 4200 7650 3600 7650 3825 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7052 2402 7652 3002 7427 3002 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5100 4500 5100 5400 5250 5250 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4800 4501 4164 5137 4376 5137 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1200 3075 1200 3300 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7800 3075 7800 3300 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6300 2400 6300 2625 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5400 2175 5400 2400 -4 1 -1 0 0 0 20 0.0000 4 195 150 3603 2478 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5103 2478 0\001 -4 1 -1 0 0 0 20 0.0000 4 240 660 3602 1052 R:r_s\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 2402 3377 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 3603 4278 1\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5103 4278 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 720 6603 4278 AE:m\001 -4 1 -1 0 0 0 20 0.0000 4 240 645 3603 5778 R:r_f\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 7577 3377 1\001 -4 1 -1 0 0 0 20 0.0000 4 210 705 751 3376 SS:e1\001 -4 1 -1 0 0 0 20 0.0000 4 210 705 9151 3376 SS:e2\001 -4 1 -1 0 0 0 20 0.0000 4 240 690 5102 1052 C:c_s\001 -4 1 1 1 0 3 20 0.0000 4 270 1515 4200 375 Slow system\001 -4 1 1 1 0 3 20 0.0000 4 255 1470 4200 6450 Fast system\001 -4 1 -1 0 0 0 20 0.0000 4 255 630 6678 2478 AE:p\001 -4 1 -1 0 0 0 20 0.0000 4 240 675 5104 5779 C:c_f\001 -4 1 -1 0 0 0 20 0.0000 4 195 390 4203 5478 R:r\001 DELETED mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_desc.tex @@ -1,21 +0,0 @@ -% Verbal description for system iNMP (iNMP_desc.tex) -% Generated by MTT on Tue Dec 9 17:34:06 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{iNMP} is - displayed in Figure \Ref{iNMP_abg} and its label - file is listed in Section \Ref{sec:iNMP_lbl}. - The subsystems are listed in Section \Ref{sec:iNMP_sub}. - -This is a simple non-minimum phase system with an inverse-type -response. It is the standard fast negative and slow positive systems -in parallel. The corresponding inverse system \textbf{iiNMP} is -unstable. - - DELETED mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_lbl.txt @@ -1,49 +0,0 @@ -%% Label file for system iNMP (iNMP_lbl.txt) -%SUMMARY iNMP Inverse simple non-minimum phase system -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/05/20 16:42:42 peterg -% %% New SS format -% %% -% %% Revision 1.1 1999/03/09 00:10:07 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases -%ALIAS $1 c_f -%ALIAS $2 c_s -%ALIAS $3 r_f -%ALIAS $4 r_s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type AE - m lin -1 - p lin 1 - -% Component type C - c_f lin effort,c_f - c_s lin effort,c_s - -% Component type R - r lin flow,r - r_f lin flow,r_f - r_s lin flow,r_s - -% Component type SS - e1 SS external,internal - e2 SS external,0 DELETED mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_numpar.txt @@ -1,17 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (NMP_numpar.txt) -# Generated by MTT at Thu Oct 8 09:25:16 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_f = 0.5; # NMP -c_s = 1.0; # NMP -r = 1.0; # NMP -r_f = 1.0; # NMP -r_s = 1.0; # NMP DELETED mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iNMP/iNMP/iNMP_rep.txt @@ -1,17 +0,0 @@ -# Outline report file for system iNMP (iNMP_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt iNMP abg tex -mtt iNMP struc tex -mtt iNMP ode tex -mtt iNMP dm tex -mtt iNMP tf tex - -mtt iNMP lmfr ps -mtt iNMP lpfr ps DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_abg.fig @@ -1,54 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 3600 3375 3600 3150 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3375 5175 2475 5400 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 3376 8325 2476 8550 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 3600 4950 3600 4725 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7200 3601 8100 3601 7875 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 3600 4050 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6525 3780 6525 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 3600 6525 3600 6300 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3345 3600 2445 3825 2670 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 3346 6750 2446 6975 2671 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 3780 2475 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 3600 2475 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3465 3375 3780 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 3780 4050 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4995 3375 5310 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8145 3375 8460 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6615 2475 6930 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6525 3600 6525 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7200 3780 7200 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7200 3555 7200 3375 -4 0 -1 0 0 2 20 0.0000000 4 210 150 5085 3735 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 3510 3690 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 6660 3691 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 8235 3736 0\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 3465 2250 R:r_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 4995 2250 C:c_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 6525 2250 R:r_2\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 8100 2295 C:c_2\001 -4 2 -1 0 0 2 20 0.0000000 4 270 750 2385 3690 SS:uy\001 DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_desc.tex @@ -1,20 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system iRC2c (iRC2c_desc.tex) -% Generated by MTT on Mon Apr 6 10:46:00 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{iRC2c} is - displayed in Figure \Ref{iRC2c_abg} and its label - file is listed in Section \Ref{sec:iRC2c_lbl}. - The subsystems are listed in Section \Ref{sec:iRC2c_sub}. - -This example gives the inverse of a double RC circuit with -\emph{collocated} sensor/actuator pairing. - - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_input.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_input.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_input.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_input.txt @@ -1,12 +0,0 @@ -# Numerical parameter file (iRC2c_input.txt) -# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -u(1) = 1 ; # iRC2c (u_s) DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_lbl.txt @@ -1,30 +0,0 @@ -%SUMMARY iRC2c Inverse of double RC circuit with collocated io -%DESCRIPTION -%% Label file for system iRC2c (iRC2c_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_1 lin effort,c_1 - c_2 lin effort,c_2 - -% Component type R - r_1 lin flow,r_1 - r_2 lin flow,r_2 - -% Component type SS - uy SS external,external - - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_numpar.txt @@ -1,25 +0,0 @@ -# Numerical parameter file (iRC2c_numpar.txt) -# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_1 = 1.0; # iRC2c -c_1s = 0.1; # iRC2c -c_2 = 1.0; # iRC2c -c_2s = 0.1; # iRC2c -r_1 = 1.0; # iRC2c -r_1s = 1.0; # iRC2c -r_2 = 1.0; # iRC2c -r_2s = 1.0; # iRC2c - -# Initial states -x(1) = 0.0; # iRC2c (c_1) -x(2) = 0.0; # iRC2c (c_1s) -x(3) = 0.0; # iRC2c (c_2) -x(4) = 0.0; # iRC2c (c_2s) DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2c/iRC2c_rep.txt @@ -1,16 +0,0 @@ -# Outline report file for system iRC2c (iRC2c_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt iRC2c abg tex -mtt iRC2c struc tex -mtt iRC2c dae tex -mtt iRC2c dm tex -mtt iRC2c tf tex - - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_abg.fig @@ -1,68 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5625 3600 5625 3420 -2 1 2 2 1 7 1 0 -1 4.500 0 0 7 0 0 4 - 9585 3465 8325 3465 8190 3375 8190 2565 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 3600 3375 3600 3150 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3375 5175 2475 5400 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 3376 8325 2476 8550 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 3600 4950 3600 4725 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7200 3601 8100 3601 7875 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8775 3601 9675 3601 9450 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3465 3375 3780 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5040 2475 5355 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6615 3375 6930 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8190 2475 8505 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 3600 2475 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3375 3780 3375 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 3600 4050 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 3780 4950 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6525 3780 6525 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 3600 6525 3600 6300 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7200 3600 7200 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8100 3780 8100 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8775 3600 8775 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9675 3600 9675 3780 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3345 3600 2445 3825 2670 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 3346 6750 2446 6975 2671 -2 1 1 1 1 7 1 0 -1 4.000 0 0 7 0 0 4 - 9585 3510 5400 3510 5310 3420 5310 2790 -2 1 2 2 1 -1 1 0 -1 3.000 0 0 7 0 0 9 - 8392 2632 8392 3712 6862 3712 6862 2497 6727 2362 6592 2497 - 6592 3442 5242 3442 5242 2632 -4 0 -1 0 0 2 20 0.0000000 4 210 150 5085 3735 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 3510 3690 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 6660 3691 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 8235 3736 0\001 -4 2 -1 0 0 2 20 0.0000000 4 210 600 2295 3645 SS:u\001 -4 0 -1 0 0 2 20 0.0000000 4 270 585 9810 3690 SS:y\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 3465 2250 R:r_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 4995 2250 C:c_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 6525 2250 R:r_2\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 8100 2295 C:c_2\001 DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_desc.tex @@ -1,19 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system iRC2n (iRC2n_desc.tex) -% Generated by MTT on Mon Apr 6 10:46:52 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{iRC2n} is - displayed in Figure \Ref{iRC2n_abg} and its label - file is listed in Section \Ref{sec:iRC2n_lbl}. - The subsystems are listed in Section \Ref{sec:iRC2n_sub}. - -This example gives the inverse of a double RC circuit with -\emph{non-collocated} sensor/actuator pairing. - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_input.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_input.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_input.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_input.txt @@ -1,12 +0,0 @@ -# Numerical parameter file (iRC2n_input.txt) -# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -u(1) = 1 ; # iRC2n (u_s) DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_lbl.txt @@ -1,32 +0,0 @@ -%SUMMARY iRC2n Inverse of double RC circuit with non-collocated io -%DESCRIPTION -%% Label file for system iRC2n (iRC2n_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/05/20 16:43:52 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_1 lin effort,c_1 - c_2 lin effort,c_2 - -% Component type R - r_1 lin flow,r_1 - r_2 lin flow,r_2 - -% Component type SS - u SS external,internal - y SS external,0 DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_numpar.txt @@ -1,25 +0,0 @@ -# Numerical parameter file (iRC2n_numpar.txt) -# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_1 = 1.0; # iRC2n -c_1s = 0.1; # iRC2n -c_2 = 1.0; # iRC2n -c_2s = 0.1; # iRC2n -r_1 = 1.0; # iRC2n -r_1s = 1.0; # iRC2n -r_2 = 1.0; # iRC2n -r_2s = 1.0; # iRC2n - -# Initial states -x(1) = 0.0; # iRC2n (c_1) -x(2) = 0.0; # iRC2n (c_1s) -x(3) = 0.0; # iRC2n (c_2) -x(4) = 0.0; # iRC2n (c_2s) DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_rep.txt @@ -1,17 +0,0 @@ -# Outline report file for system iRC2n (iRC2n_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt iRC2n abg tex -mtt iRC2n struc tex -mtt iRC2n dae tex -mtt iRC2n dm tex -mtt iRC2n tf tex - - - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_simp.r Index: mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_simp.r ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_simp.r +++ mttroot/mtt/lib/examples/Inverse/iRC2/iRC2n/iRC2n_simp.r @@ -1,12 +0,0 @@ -%% Reduce commands to simplify output for system iRC2n (iRC2n_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -MTTu1 := y; - -END; DELETED mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_abg.fig @@ -1,134 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 3601 4051 3601 3826 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3376 5851 2476 6076 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9001 3377 9001 2477 9226 2702 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3601 5626 3601 5401 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7876 3602 8776 3602 8551 3827 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4726 3601 4726 3421 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7201 3781 7201 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6301 3601 7201 3601 6976 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 3346 4276 2446 4501 2671 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 3347 7426 2447 7651 2672 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5671 3376 5986 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8821 3376 9136 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7291 2476 7606 2476 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7201 3601 7201 3421 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7876 3781 7876 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 3825 2925 4725 3150 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 5175 2925 6075 3150 5850 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 6301 4051 6301 3826 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 6076 5851 5176 6076 5401 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9001 6077 9001 5177 9226 5402 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 6301 5626 6301 5401 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7876 6302 8776 6302 8551 6527 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4726 6301 4726 6121 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7201 6481 7201 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6301 6301 7201 6301 6976 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 6046 4276 5146 4501 5371 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 6047 7426 5147 7651 5372 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3151 6481 3151 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3151 6301 3151 6121 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4141 6076 4456 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4726 6481 4726 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5671 6076 5986 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8821 6076 9136 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7291 5176 7606 5176 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7201 6301 7201 6121 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7876 6481 7876 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1756 6301 2656 6301 2431 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 3780 4050 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 3600 4050 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4141 2475 4456 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4725 3781 4725 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7875 3645 7875 3465 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7875 6300 7875 6120 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 3375 2700 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1801 3600 2701 3600 2476 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 3825 3150 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3105 5175 2925 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2925 5175 2745 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1755 6480 1755 6300 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1755 6300 1755 6120 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 9900 4050 9900 1530 3600 1530 3600 4050 9900 4050 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 9900 7020 9900 4500 3600 4500 3600 7020 9900 7020 -4 2 -1 0 0 2 20 0.0000000 4 240 870 1710 3645 SS:u_s\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 7336 3692 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 8911 3737 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 4231 3691 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 5806 3736 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 7336 6392 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 8911 6437 0\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 4141 4951 R:r_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 5671 4951 C:c_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 7201 4951 R:r_2\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 4231 6391 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 5806 6436 0\001 -4 2 -1 0 0 2 20 0.0000000 4 210 600 1665 6345 SS:u\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 8775 4950 C:c_2\001 -4 2 -1 0 0 2 20 0.0000000 4 210 150 3016 3691 1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 4141 2251 R:r_1s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 5671 2251 C:c_1s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 7201 2251 R:r_2s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 8775 2250 C:c_2s\001 -4 0 -1 0 0 2 20 0.0000000 4 210 390 2835 5040 AF\001 -4 2 -1 0 0 2 20 0.0000000 4 210 150 3016 6391 0\001 -4 1 1 1 0 0 20 0.0000000 4 210 450 2565 4455 e=0\001 -4 1 1 1 0 0 20 0.0000000 4 210 420 2070 6570 f=0\001 -4 1 1 1 0 0 20 0.0000000 4 270 2550 6750 1845 Specification system\001 -4 1 1 1 0 0 20 0.0000000 4 270 1830 6615 6840 Inverse system\001 DELETED mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_desc.tex @@ -1,24 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system saRC2c (saRC2c_desc.tex) -% Generated by MTT on Mon Apr 6 10:47:43 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{saRC2c} is - displayed in Figure \Ref{saRC2c_abg} and its label - file is listed in Section \Ref{sec:saRC2c_lbl}. - The subsystems are listed in Section \Ref{sec:saRC2c_sub}. - -This example gives the inverse of a double RC circuit with -\begin{itemize} -\item specification system, -\item amplifier connection and -\item collocated sensor/actuator pairing. -\end{itemize} - - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_input.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_input.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_input.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (saRC2c_input.txt) -# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:53:33 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Tue Jun 10 16:20:22 BST 2003: u(1) = 1 ; # saRC2c (u_s) -sarc2c__u_s = 1.0; DELETED mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_lbl.txt @@ -1,33 +0,0 @@ -%SUMMARY saRC2c -%DESCRIPTION -%% Label file for system saRC2c (saRC2c_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_1 lin effort,c_1 - c_1s lin effort,c_1s - c_2 lin effort,c_2 - c_2s lin effort,c_2s - -% Component type R - r_1 lin flow,r_1 - r_1s lin flow,r_1s - r_2 lin flow,r_2 - r_2s lin flow,r_2s - -% Component type SS - u SS external,0 - u_s SS external,external DELETED mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_numpar.txt @@ -1,28 +0,0 @@ -# Numerical parameter file (saRC2c_numpar.txt) -# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:53:33 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_1 = 1.0; # saRC2c -c_1s = 0.1; # saRC2c -c_2 = 1.0; # saRC2c -c_2s = 0.1; # saRC2c -r_1 = 1.0; # saRC2c -r_1s = 1.0; # saRC2c -r_2 = 1.0; # saRC2c -r_2s = 1.0; # saRC2c - -# Initial states -## Removed by MTT on Tue Jun 10 16:19:14 BST 2003: x(1) = 0.0; # saRC2c (c_1) -## Removed by MTT on Tue Jun 10 16:19:14 BST 2003: x(2) = 0.0; # saRC2c (c_1s) -## Removed by MTT on Tue Jun 10 16:19:14 BST 2003: x(3) = 0.0; # saRC2c (c_2) -## Removed by MTT on Tue Jun 10 16:19:14 BST 2003: x(4) = 0.0; # saRC2c (c_2s) DELETED mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/saRC2c/saRC2c_rep.txt @@ -1,22 +0,0 @@ -# Outline report file for system saRC2c (saRC2c_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:53:33 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt saRC2c abg tex -mtt saRC2c struc tex -mtt saRC2c dae tex -mtt saRC2c dm tex -mtt saRC2c tf tex - -mtt saRC2c odeso ps -mtt saRC2c lmfr ps - - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_abg.fig @@ -1,141 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 3601 4051 3601 3826 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3376 5851 2476 6076 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9001 3377 9001 2477 9226 2702 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3601 5626 3601 5401 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7876 3602 8776 3602 8551 3827 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4726 3601 4726 3421 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7201 3781 7201 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6301 3601 7201 3601 6976 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 3346 4276 2446 4501 2671 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 3347 7426 2447 7651 2672 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5671 3376 5986 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8821 3376 9136 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7291 2476 7606 2476 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7201 3601 7201 3421 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7876 3781 7876 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 3825 2925 4725 3150 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2925 5175 2925 6075 3150 5850 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3151 6301 4051 6301 3826 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 6076 5851 5176 6076 5401 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9001 6077 9001 5177 9226 5402 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 6301 5626 6301 5401 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7876 6302 8776 6302 8551 6527 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4726 6301 4726 6121 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7201 6481 7201 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6301 6301 7201 6301 6976 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 6046 4276 5146 4501 5371 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7426 6047 7426 5147 7651 5372 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3151 6481 3151 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3151 6301 3151 6121 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4141 6076 4456 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4726 6481 4726 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5671 6076 5986 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8821 6076 9136 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7291 5176 7606 5176 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7201 6301 7201 6121 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7876 6481 7876 6301 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1756 6301 2656 6301 2431 6526 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1801 4950 2701 4950 2476 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 4950 2700 4770 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 5130 1800 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2655 6480 2655 6300 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 3780 4050 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 3600 4050 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4141 2475 4456 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4725 3781 4725 3601 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7875 3645 7875 3465 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7875 6300 7875 6120 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 3375 2700 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1801 3600 2701 3600 2476 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 3825 3150 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2925 6075 2745 6075 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3105 5175 2925 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1755 6300 1755 6120 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 9900 4275 9900 1125 3600 1125 3600 4275 9900 4275 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 9900 7650 9900 4500 3600 4500 3600 7650 9900 7650 -4 2 -1 0 0 2 20 0.0000000 4 240 870 1710 3645 SS:u_s\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 7336 3692 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 8911 3737 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 4231 3691 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 5806 3736 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 7336 6392 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 8911 6437 0\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 4141 4951 R:r_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 5671 4951 C:c_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 7201 4951 R:r_2\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 4231 6391 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 5806 6436 0\001 -4 2 -1 0 0 2 20 0.0000000 4 210 600 1665 6345 SS:u\001 -4 2 -1 0 0 2 20 0.0000000 4 210 990 1620 5040 SS:zero\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 8775 4950 C:c_2\001 -4 2 -1 0 0 2 20 0.0000000 4 210 150 3016 3691 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 2835 5040 0\001 -4 2 -1 0 0 2 20 0.0000000 4 210 150 3016 6391 1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 4141 2251 R:r_1s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 5671 2251 C:c_1s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 7201 2251 R:r_2s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 8775 2250 C:c_2s\001 -4 1 1 1 0 3 20 0.0000000 4 210 450 2250 4860 e=0\001 -4 1 1 1 0 3 20 0.0000000 4 270 420 2250 5220 f=0\001 -4 1 1 1 0 3 20 0.0000000 4 270 1845 6525 7110 Inverse system\001 -4 1 1 1 0 3 20 0.0000000 4 270 2565 6660 1665 Specification system\001 DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_desc.tex @@ -1,24 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system szRC2c (szRC2c_desc.tex) -% Generated by MTT on Mon Apr 6 10:50:51 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{szRC2c} is - displayed in Figure \Ref{szRC2c_abg} and its label - file is listed in Section \Ref{sec:szRC2c_lbl}. - The subsystems are listed in Section \Ref{sec:szRC2c_sub}. - - -This example gives the inverse of a double RC circuit with -\begin{itemize} -\item specification system, -\item zero-zero \textbf{SS} connection and -\item collocated sensor/actuator pairing. -\end{itemize} - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_input.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_input.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_input.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (szRC2c_input.txt) -# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:54:15 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Tue Jun 10 16:39:19 BST 2003: u(1) = 1 ; # szRC2c (u_s) -szrc2c__u_s = 1.0; DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_lbl.txt @@ -1,40 +0,0 @@ -%SUMMARY szRC2c Specification inverse of double RC circuit with collocated io -%DESCRIPTION -%% Label file for system szRC2c (szRC2c_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:54:15 peterg -% %% To RCS -% %% -% %% Revision 1.1 2000/05/20 16:44:55 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_1 lin effort,c_1 - c_1s lin effort,c_1s - c_2 lin effort,c_2 - c_2s lin effort,c_2s - -% Component type R - r_1 lin flow,r_1 - r_1s lin flow,r_1s - r_2 lin flow,r_2 - r_2s lin flow,r_2s - -% Component type SS - u_s SS external,external - zero SS 0,0 - u SS external,internal DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_numpar.txt @@ -1,28 +0,0 @@ -# Numerical parameter file (szRC2c_numpar.txt) -# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:54:15 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_1 = 1.0; # szRC2c -c_1s = 0.1; # szRC2c -c_2 = 1.0; # szRC2c -c_2s = 0.1; # szRC2c -r_1 = 1.0; # szRC2c -r_1s = 1.0; # szRC2c -r_2 = 1.0; # szRC2c -r_2s = 1.0; # szRC2c - -# Initial states -## Removed by MTT on Tue Jun 10 16:38:56 BST 2003: x(1) = 0.0; # szRC2c (c_1) -## Removed by MTT on Tue Jun 10 16:38:56 BST 2003: x(2) = 0.0; # szRC2c (c_1s) -## Removed by MTT on Tue Jun 10 16:38:56 BST 2003: x(3) = 0.0; # szRC2c (c_2) -## Removed by MTT on Tue Jun 10 16:38:56 BST 2003: x(4) = 0.0; # szRC2c (c_2s) DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2c/szRC2c_rep.txt @@ -1,22 +0,0 @@ -# Outline report file for system szRC2c (szRC2c_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:54:15 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt szRC2c abg tex -mtt szRC2c struc tex -mtt szRC2c dae tex -mtt szRC2c dm tex -mtt szRC2c tf tex - -mtt zRC2c odeso ps -mtt szRC2c lmfr ps - - DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_abg.fig @@ -1,151 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2251 4726 3151 4726 2926 4951 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 4501 4951 3601 5176 3826 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8101 4502 8101 3602 8326 3827 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4726 4726 4726 4501 4951 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6976 4727 7876 4727 7651 4952 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 4727 9451 4727 9226 4952 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3151 4906 3151 4726 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4726 3826 4546 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6301 4906 6301 4726 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5401 4726 6301 4726 6076 4951 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6976 4726 6976 4546 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3825 4905 3825 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4770 4500 5085 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6345 3600 6660 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6975 4905 6975 4725 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7920 4500 8235 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9450 4725 9450 4905 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9450 4680 9450 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10126 6301 9901 6076 11026 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9901 6076 9901 5896 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 11026 6256 11026 6076 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9675 4950 9675 5850 9900 5625 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5402 7427 5402 7247 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2252 7427 3152 7427 2927 7652 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4952 7202 4952 6302 5177 6527 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8102 7203 8102 6303 8327 6528 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3827 7427 4727 7427 4502 7652 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 7428 7877 7428 7652 7653 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8552 7428 9452 7428 9227 7653 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3242 7202 3557 7202 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4817 6302 5132 6302 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6392 7202 6707 7202 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7967 6302 8282 6302 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2252 7427 2252 7247 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3152 7607 3152 7427 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3827 7427 3827 7247 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4727 7607 4727 7427 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6302 7607 6302 7427 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5402 7427 6302 7427 6077 7652 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6977 7427 6977 7247 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7877 7607 7877 7427 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8552 7427 8552 7247 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3377 7172 3377 6272 3602 6497 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6527 7173 6527 6273 6752 6498 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9450 7425 9450 7605 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3150 4725 3150 4545 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3240 3600 3555 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9901 4725 10801 4725 10576 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 10800 4725 10800 4905 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 10800 4725 10800 4545 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 4516 3375 3616 3600 3841 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 4517 6525 3617 6750 3842 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9495 5850 9810 5850 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9675 6300 9855 6300 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9675 6313 9675 7213 9900 6988 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9675 7245 9495 7245 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 9045 5355 9045 2250 2475 2250 2475 5355 9045 5355 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 9045 8730 9045 5625 2475 5625 2475 8730 9045 8730 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6300 4680 6300 4500 -4 0 -1 0 0 2 20 0.0000000 4 210 150 4861 4861 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 3286 4816 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 6436 4817 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 8011 4862 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 9586 4816 0\001 -4 2 -1 0 0 2 20 0.0000000 4 240 870 2071 4771 SS:u_s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 3241 3376 R:r_1s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 6301 3376 R:r_2s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 4771 3376 C:c_1s\001 -4 0 -1 0 0 2 20 0.0000000 4 240 870 7875 3375 C:c_2s\001 -4 0 -1 0 0 2 20 0.0000000 4 210 990 11206 6166 SS:zero\001 -4 1 1 1 0 3 20 0.0000000 4 210 450 10441 5986 e=0\001 -4 1 1 1 0 3 20 0.0000000 4 270 420 10441 6346 f=0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 9585 6210 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 4862 7562 0\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 3287 7517 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 6437 7518 1\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 8012 7563 0\001 -4 2 -1 0 0 2 20 0.0000000 4 210 600 2072 7472 SS:u\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 3242 6077 R:r_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 4772 6077 C:c_1\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 6302 6077 R:r_2\001 -4 0 -1 0 0 2 20 0.0000000 4 240 750 7876 6076 C:c_2\001 -4 0 -1 0 0 2 20 0.0000000 4 210 150 9630 7515 0\001 -4 0 -1 0 0 2 20 0.0000000 4 270 855 10935 4815 SS:y_s\001 -4 1 1 1 0 3 20 0.0000000 4 270 420 10260 5085 f=0\001 -4 1 1 1 0 3 20 0.0000000 4 270 2565 5625 2745 Specification system\001 -4 1 1 1 0 3 20 0.0000000 4 270 1845 5535 8280 Inverse system\001 DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_desc.tex @@ -1,29 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system szRC2n (szRC2n_desc.tex) -% Generated by MTT on Mon Apr 6 10:52:26 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{szRC2n} is - displayed in Figure \Ref{szRC2n_abg} and its label - file is listed in Section \Ref{sec:szRC2n_lbl}. - The subsystems are listed in Section \Ref{sec:szRC2n_sub}. - -This example gives the inverse of a double RC circuit with -\begin{itemize} -\item specification system, -\item zero-zero \textbf{SS} connection and -\item non-collocated sensor/actuator pairing. -\end{itemize} - - - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_input.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_input.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_input.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (szRC2n_input.txt) -# Generated by MTT at Mon Mar 2 15:42:48 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:54:46 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Tue Jun 10 16:43:05 BST 2003: u(1) = 1 ; # szRC2n (u_s) -szrc2n__u_s = 1.0; DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_lbl.txt @@ -1,41 +0,0 @@ -%SUMMARY szRC2n Specification inverse of double RC circuit with noncollocated io -%DESCRIPTION -%% Label file for system szRC2n (szRC2n_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:54:46 peterg -% %% To RCS -% %% -% %% Revision 1.1 2000/05/20 16:45:37 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - c_1 lin effort,c_1 - c_1s lin effort,c_1s - c_2 lin effort,c_2 - c_2s lin effort,c_2s - -% Component type R - r_1 lin flow,r_1 - r_1s lin flow,r_1s - r_2 lin flow,r_2 - r_2s lin flow,r_2s - -% Component type SS - u_s SS external,internal - y_s SS external,0 - zero SS 0,0 - u SS external,internal DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_numpar.txt @@ -1,28 +0,0 @@ -# Numerical parameter file (szRC2n_numpar.txt) -# Generated by MTT at Mon Mar 2 15:41:26 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:54:46 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_1 = 1.0; # szRC2n -c_1s = 0.1; # szRC2n -c_2 = 1.0; # szRC2n -c_2s = 0.1; # szRC2n -r_1 = 1.0; # szRC2n -r_1s = 1.0; # szRC2n -r_2 = 1.0; # szRC2n -r_2s = 1.0; # szRC2n - -# Initial states -## Removed by MTT on Tue Jun 10 16:42:56 BST 2003: x(1) = 0.0; # szRC2n (c_1) -## Removed by MTT on Tue Jun 10 16:42:56 BST 2003: x(2) = 0.0; # szRC2n (c_1s) -## Removed by MTT on Tue Jun 10 16:42:56 BST 2003: x(3) = 0.0; # szRC2n (c_2) -## Removed by MTT on Tue Jun 10 16:42:56 BST 2003: x(4) = 0.0; # szRC2n (c_2s) DELETED mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iRC2/szRC2n/szRC2n_rep.txt @@ -1,22 +0,0 @@ -# Outline report file for system szRC2n (szRC2n_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:54:46 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt szRC2n abg tex -mtt szRC2n struc tex -mtt szRC2n dae tex -mtt szRC2n dm tex -mtt szRC2n tf tex - -mtt szRC2n odeso ps -mtt szRC2n lmfr ps - - DELETED mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_abg.fig @@ -1,77 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 900 3150 2025 3150 1755 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 3150 3600 3150 3330 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 2925 2250 1800 2520 2070 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7201 3151 8326 3151 8056 3421 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8776 3151 9901 3151 9631 3421 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6976 2926 6976 1801 7246 2071 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 2926 8551 1801 8821 2071 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 3150 5175 3150 4905 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5625 3150 6750 3150 6480 3420 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 2925 3825 1800 4095 2070 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 2925 5400 1800 5670 2070 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 3375 6975 4500 7245 4230 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11295 5625 11295 450 45 450 45 5625 11295 5625 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 - 3150 1125 3150 2700 1305 2700 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 4 - 4500 1125 4500 2700 6300 2700 6300 1125 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 3 - 7650 1125 7650 2700 9675 2700 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1350 3600 9720 3600 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 3375 3825 4500 4095 4230 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 900 2925 900 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2025 3150 2025 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 3375 3825 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3825 4500 4095 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 2925 9900 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8775 3150 8775 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6705 3375 6930 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6975 4500 7200 4500 -4 1 -1 0 0 2 20 0.0000 4 195 135 2250 3240 1\001 -4 1 -1 0 0 2 20 0.0000 4 195 210 2250 1665 R\001 -4 1 -1 0 0 2 20 0.0000 4 195 135 8551 3241 1\001 -4 1 -1 0 0 2 20 0.0000 4 195 135 6976 3241 0\001 -4 1 -1 0 0 2 20 0.0000 4 195 210 8551 1666 R\001 -4 1 -1 0 0 2 20 0.0000 4 195 210 6976 1666 C\001 -4 1 -1 0 0 2 20 0.0000 4 195 135 5400 3240 1\001 -4 1 -1 0 0 2 20 0.0000 4 195 135 3825 3240 0\001 -4 1 -1 0 0 2 20 0.0000 4 195 210 5400 1665 R\001 -4 1 -1 0 0 2 20 0.0000 4 195 210 3825 1665 C\001 -4 1 -1 0 0 2 20 0.0000 4 195 705 495 3240 SS:u1\001 -4 1 -1 0 0 2 20 0.0000 4 195 705 10440 3240 SS:u2\001 -4 1 -1 0 0 2 20 0.0000 4 255 675 3825 4725 SS:y1\001 -4 1 -1 0 0 2 20 0.0000 4 255 675 6975 4770 SS:y2\001 -4 1 1 1 0 3 20 0.0000 4 270 510 2295 1125 Pipe\001 -4 1 1 1 0 3 20 0.0000 4 270 510 5445 1125 Pipe\001 -4 1 1 1 0 3 20 0.0000 4 270 510 8595 1125 Pipe\001 -4 1 1 1 0 3 20 0.0000 4 210 600 3870 1125 Tank\001 -4 1 1 1 0 3 20 0.0000 4 210 600 6975 1125 Tank\001 -4 1 1 1 0 3 20 0.0000 4 270 1665 5265 5445 System inverse\001 DELETED mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_desc.tex @@ -1,65 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system iTanks (iTanks_desc.tex) -% Generated by MTT on Wed Nov 18 11:04:33 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Figure \Ref{iTanks_abg} shows the bond graph of a two-tank system -superimposed on a schematic diagram. -The two \textbf{C} components corresponds to the fluid storage and how -it relates to the pressure at the base of the tanks. In this case, for -simplicity, each tank ($i=1$ or $i=2$) is assumed to have a unity constitutive relationship: -\begin{equation} - \text{pressure} = p_i = v_i = \text{volume} -\end{equation} -The volumetric flow rate into the first, and out of the second, tank -is represented by the two unlabelled \textbf{R} components. Again, -each is assumed to have a unit constitutive relationship: -\begin{equation} - \text{flow} = f_i = \Delta_i = \text{pressure drop} -\end{equation} -The volumetric flow rate between the first and the second tanks -is represented \textbf{R} component labelled $k$. The constitutive relationship is assumed -linear of the form: -\begin{equation} - \text{flow} = f = k \Delta = \text{pressure drop} -\end{equation} - -The system has two inputs: -\begin{equation} - \begin{aligned} - u_1 &= \text{input pressure at left-hand pipe} \\ - u_2 &= \text{input pressure at right-hand pipe} - \end{aligned} -\end{equation} -and two outputs: -\begin{equation} - \begin{aligned} - y_1 &= p_1 = \text{pressure at left-hand tank} \\ - y_2 &= p_2 = \text{pressure at right-hand tank} - \end{aligned} -\end{equation} -The system transfer-function matrix is given by: -\begin{equation} - \begin{aligned} -G_{11} = G_{22} &= \frac{(s + k + 1)}{(s^2 + 2 s {(k + 1)} + 2 k + 1)}\\ -G_{12} = G_{21} &= \frac{k}{(s^2 + 2 s {(k + 1)} + 2 k + 1)} -\end{aligned} -\end{equation} - -However, Figure \Ref{iTanks_abg} shows the causality of the -\textbf{SS} components to \emph{invert} the system with respect to its -inputs and outputs. Figure \Ref{fig:iTanks_cbg.ps} shows the causally -complete bond graph; this system has no dynamic components in integral -causality -- the inverse has no poles and therefore the system has no -zeros. - -Some further representations of the inverse appear in the following -sections. - - DELETED mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_lbl.txt @@ -1,24 +0,0 @@ -%SUMMARY iTanks: Inversion of a two-tanks system -%DESCRIPTION This inverse system has no poles thus -%DESCRIPTION the system itself has no (multivariable) zeros -%% Label file for system iTanks (iTanks_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type SS - u1 SS external,internal - u2 SS external,internal - y1 SS external,0 - y2 SS external,0 DELETED mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iTanks/iTanks_rep.txt @@ -1,26 +0,0 @@ -# Outline report file for system iTanks (iTanks_rep.txt) -# Generated by MTT on" Wed Nov 18 10:44:55 GMT 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt iTanks abg tex # The system description -mtt iTanks cbg ps # The causal bond graph -# Uncomment the following lines or add others - mtt iTanks struc tex # The system structure -# mtt iTanks dae tex # The system dae -# mtt iTanks ode tex # The system ode -# mtt iTanks sspar tex # Steady-state parameters -# mtt iTanks ss tex # Steady state -mtt iTanks dm tex # Descriptor matrices (of linearised system) -mtt iTanks tf tex -mtt iTanks lmfr ps # log modulus of frequency response (of linearised system) -mtt iTanks lpfr ps # log modulus of frequency response (of linearised system) -# mtt iTanks simpar tex # Simulation parameters -# mtt iTanks numpar tex # Numerical simulation parameters -# mtt iTanks input tex # Simulation input -# mtt iTanks odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_abg.fig @@ -1,123 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 4950 2700 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5850 4950 5850 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8550 4950 8550 5400 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 315 6933 5268 I:J\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000000 4 270 735 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000000 4 240 735 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1170 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1170 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000000 4 210 150 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 570 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000000 4 210 990 4681 5266 INTF:th\001 -4 1 1 1 0 0 20 0.0000000 4 210 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000000 4 135 195 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000000 4 210 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000000 4 195 330 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000000 4 240 1065 2971 1216 SS:[x_a]\001 -4 1 4 0 0 0 20 0.0000000 4 240 1080 2971 9361 SS:[x_b]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1065 8372 1217 SS:[y_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1080 8417 9362 SS:[y_b]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1575 5671 1216 SS:[alpha_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1590 5671 9361 SS:[alpha_b]\001 -4 1 1 1 0 0 20 0.0000000 4 270 630 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000000 4 240 1470 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000000 4 270 645 1350 9855 Tip b\001 DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_desc.tex @@ -1,17 +0,0 @@ -% Verbal description for system ROD (ROD_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ROD} is - displayed in Figure \Ref{ROD_abg} and its label - file is listed in Section \Ref{sec:ROD_lbl}. - The subsystems are listed in Section \Ref{sec:ROD_sub}. - -{\bf ROD} is essentially as described in Figure 10.2 of -``Metamodelling''. DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/ROD_lbl.txt @@ -1,53 +0,0 @@ -%SUMMARY ROD: rigid rod in two dimensions -%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a -%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b -%DESCRIPTION Port [x_a]: x force/velocity - end a -%DESCRIPTION Port [x_b]: x force/velocity - end b -%DESCRIPTION Port [y_a]: y force/velocity - end a -%DESCRIPTION Port [y_b]: y force/velocity - end b -%DESCRIPTION -%DESCRIPTION Parameter 1: length from end 1 to mass centre -%DESCRIPTION Parameter 2: length from end 2 to mass centre -%DESCRIPTION Parameter 3: inertia about mass centre -%DESCRIPTION Parameter 4: mass -%DESCRIPTION See Section 10.2 of "Metamodelling" - - -%% Label file for system ROD (ROD_lbl.txt) - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,$3 -m_x lin flow,$4 -m_y lin flow,$4 - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,$1 -s2 lsin flow,$2 -c1 lcos flow,$1 -c2 lcos flow,$2 - - - DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_abg.fig @@ -1,74 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 2476 4951 2701 5176 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4051 3376 4051 4726 4276 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3781 4726 4276 4726 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2476 4726 2476 5221 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 4951 5626 4951 5401 5176 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6526 4681 6526 5176 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 2250 2475 2250 2700 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 675 4050 2025 4275 1800 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3780 2025 4275 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 2025 2475 2520 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4275 2250 5625 2250 5400 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6525 1980 6525 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 2250 7875 2250 7650 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 4950 7875 4950 7650 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8371 3376 7876 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8101 3376 8101 4726 8326 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8326 4726 8326 5221 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8370 675 7875 675 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8100 675 8100 2025 8325 1800 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8325 2025 8325 2520 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 5175 6075 675 6075 675 225 5175 225 5175 6075 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 675 5625 5175 5625 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 11475 6075 6975 6075 6975 225 11475 225 11475 6075 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 6975 5625 11475 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 2250 9450 3375 9225 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8325 4950 9450 3825 9225 3825 -4 1 -1 0 0 0 20 0.0000000 4 210 150 4051 5041 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 4050 2340 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 780 4050 585 SS:t1s\001 -4 1 -1 0 0 0 20 0.0000000 4 210 750 6120 2340 AF:a1\001 -4 1 -1 0 0 0 20 0.0000000 4 270 1290 1845 2340 msd:spec1\001 -4 1 -1 0 0 0 20 0.0000000 4 270 1290 1846 5041 msd:spec2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 780 4051 3286 SS:t2s\001 -4 1 -1 0 0 0 20 0.0000000 4 210 750 6121 5041 AF:a2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8101 5041 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8100 2340 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 660 8100 585 SS:t1\001 -4 1 1 1 0 0 20 0.0000000 4 270 1620 2880 5940 Specification\001 -4 1 1 1 0 0 20 0.0000000 4 270 900 9270 5940 System\001 -4 1 -1 0 0 0 20 0.0000000 4 210 660 8101 3286 SS:t2\001 -4 1 -1 0 0 0 20 0.0000000 4 270 1500 9900 3690 twolink:syst\001 -4 0 4 0 0 0 20 0.0000000 4 270 1080 9585 3330 [joint_1]\001 -4 0 4 0 0 0 20 0.0000000 4 270 1080 9540 4140 [joint_2]\001 DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_desc.tex @@ -1,53 +0,0 @@ -% Verbal description for system iTwoLink (iTwoLink_desc.tex) -% Generated by MTT on Mon Nov 17 10:42:48 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/01/19 10:08:21 peterg -% %% Added comment about linearisation point -% %% -% %% Revision 1.2 1998/01/19 09:57:26 peterg -% %% Added a discussion of the relevance of G(s). -% %% -% Revision 1.1 1997/12/09 16:53:27 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{iTwoLink} is - displayed in Figure \Ref{iTwoLink_abg} and its label - file is listed in Section \Ref{sec:iTwoLink_lbl}. - The subsystems are listed in Section \Ref{sec:iTwoLink_sub}. - -This example illustrates the inversion of two link manipulator -dynamics using two identical simple mass-spring-damper systems as -specification systems. - -The velocities $\omega_1=\omega_2$ specified by the specification -systems are given in Figure \Ref{fig:iTwoLink_odeso.ps-iTwoLink-t1s} -together with the input defined in Section \Ref{sec:iTwoLink_input.txt}. -The torques $\tau_1$ and $\tau_2$ required to give the these -velocities specified by the specification system are given in Figures -\Ref{fig:iTwoLink_odeso.ps-iTwoLink-t1} and -\Ref{fig:iTwoLink_odeso.ps-iTwoLink-t2} respectively. - -The corresponding velocity/torque diagrams for joints 1 and 2 appear in -Figures \Ref{fig:iTwoLink_odeso.ps-iTwoLink-t1s:iTwoLink-t1} -\Ref{fig:iTwoLink_odeso.ps-iTwoLink-t2s:iTwoLink-t2} respectively. -Such diagrams can be used for actuator sizing in terms of torque, -velocity and power. - - -This non-linear system can be linearised (about the various -configurations) and small-signal frequency response methods applied. -For example, the four transfer functions $G_11$ to $G_22$ in Section -\Ref{sec:iTwoLink_tf} (representing the system linearised about zero -angles and velocities), give the small-signal relations between the -two spec. torques and the required system torques. Used together with -$G_31$ and $G_42$ (relating the spec. torques and the joint -velocities) gives, in principle, a method for evaluating actuator -requirements (for small signals) as a function of frequency. - DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_input.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_input.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_input.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_input.txt @@ -1,18 +0,0 @@ -# Numerical parameter file (iTwoLink_input.txt) -# Generated by MTT at Mon Nov 17 10:40:37 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:56:50 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Mon Aug 18 18:15:41 BST 2003: u(1) = 1.0 - 2.0*(t>5.0) + 2.0*(t>15.0);; # t1s input torque -## Removed by MTT on Mon Aug 18 18:15:41 BST 2003: u(2) = 1.0 - 2.0*(t>5.0) + (t>15.0); # t2s input torque -itwolink__t1s = 1.0 - 2.0*(t>5.0) + 2.0*(t>15.0); # t1s input torque -itwolink__t2s = 1.0 - 2.0*(t>5.0) + (t>15.0); # t2s input torque DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_lbl.txt @@ -1,40 +0,0 @@ -%SUMMARY iTwoLink: Inverse of two-link manipulator -%DESCRIPTION Uses the specification system idea to get an ordinary -%DESCRIPTION differential equation inverse. -%% Label file for system iTwoLink (iTwoLink_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/11/17 15:50:45 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%ALIAS INTF General/INTF - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type AF - a1 lin flow,1 - a2 lin flow,1 - -% Component type SS - t1 SS external,0 - t2 SS external,0 - t1s SS external,external - t2s SS external,external - -% Component type msd - spec1 - spec2 - -% Component type onelink - syst DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_numpar.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_numpar.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_numpar.txt @@ -1,17 +0,0 @@ -# Numerical parameter file (iTwoLink_numpar.txt) -# Generated by MTT at Mon Nov 17 10:40:34 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -d_s = 1.0; # Parameter d_s for msd -k_s = 1.0; # Parameter k_s for msd -m_s = 1.0; # Parameter m_s for msd -j_s = 1.0; # Parameter j_s for twolink -l = 1.0; # Parameter l for twolink -m_s = 1.0; # Parameter m_s for twolink DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_rep.txt @@ -1,37 +0,0 @@ -# Outline report file for system iTwoLink (iTwoLink_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 17:56:50 peterg -% %% To RCS -% %% -% %% Revision 1.1 1997/12/09 16:53:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt iTwoLink abg tex -mtt iTwoLink struc tex -mtt iTwoLink simp r -mtt iTwoLink dae tex -mtt iTwoLink ode tex -mtt iTwoLink sspar r -mtt iTwoLink sm tex -mtt iTwoLink tf tex - -mtt iTwoLink numpar txt -mtt iTwoLink input txt -mtt iTwoLink odeso ps 'iTwoLink__t1' -mtt iTwoLink odeso ps 'iTwoLink__t2' -mtt iTwoLink odeso ps 'iTwoLink__t1s' -mtt iTwoLink odeso ps 'iTwoLink__t1s:iTwoLink__t1' -mtt iTwoLink odeso ps 'iTwoLink__t2s:iTwoLink__t2' - - - - - - DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_simp.r Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_simp.r ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_simp.r +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_simp.r @@ -1,17 +0,0 @@ -%% Reduce comands to simplify output for system twolink (twolink_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -END; DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_sspar.r Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_sspar.r +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/iTwoLink_sspar.r @@ -1,17 +0,0 @@ -%% Reduce steady-state parameter file for ionelink (ionelink_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mttx1 := 0; -mttx2 := 0; -mttx3 := 0; -mttx4 := 0; -mttx5 := 0; -mttx6 := 0; - -END; DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/itwolink_rep.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/itwolink_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/itwolink_rep.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/itwolink_rep.txt @@ -1,35 +0,0 @@ -# Outline report file for system itwolink (itwolink_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -c itwolink abg tex -mtt -c itwolink struc tex -mtt -c itwolink simp r -mtt -c itwolink dae tex -mtt -c itwolink cse tex -mtt -c itwolink ode tex -mtt -c itwolink sspar r -mtt -c itwolink dm tex -mtt -c itwolink sm tex -mtt -c itwolink tf tex -mtt -c itwolink lmfr ps - -mtt -c itwolink odes h -mtt -c itwolink numpar txt -mtt -c itwolink input txt -mtt -c itwolink odeso ps 'itwolink_t1' -mtt -c itwolink odeso ps 'itwolink_t2' -mtt -c itwolink odeso ps 'itwolink_t1s' -mtt -c itwolink odeso ps 'itwolink_t1s:itwolink_t1' -mtt -c itwolink odeso ps 'itwolink_t1s:itwolink_t2' -mtt -c itwolink rep txt - - - - - DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_abg.fig @@ -1,21 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 4050 4950 4050 4725 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3825 3600 2700 3825 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 4275 3600 5400 3825 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2250 4050 3375 4050 3150 4275 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6750 6975 6750 1125 900 1125 900 6975 6750 6975 -4 1 -1 0 0 0 20 0.0000000 4 210 150 3600 4185 1\001 -4 0 -1 0 0 0 20 0.0000000 4 270 1200 5085 4140 R:damper\001 -4 1 1 1 0 0 20 0.0000000 4 270 3585 3555 6300 Mass-spring-damper system\001 -4 2 4 0 0 0 20 0.0000000 4 240 870 2160 4140 SS:[in]\001 -4 1 -1 0 0 0 20 0.0000000 4 210 990 3600 5715 I:inertia\001 -4 1 -1 0 0 0 20 0.0000000 4 270 1050 3555 2610 C:spring\001 DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_desc.tex @@ -1,31 +0,0 @@ -% Verbal description for system msd (msd_desc.tex) -% Generated by MTT on Thu Nov 13 09:38:17 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{msd} is - displayed in Figure \Ref{msd_abg} and its label - file is listed in Section \Ref{sec:msd_lbl}. - The subsystems are listed in Section \Ref{sec:msd_sub}. - - - \textbf{msd} is a simple Mass-Spring-Damper system with collocated - force and velocity. It is set up to provide a specification system - for each link of the two-link maipulator. This is appropriate because - \begin{itemize} - \item it has compatible physical behaviour with the system itself, - \item it specifies two decoupled systems, - \item it has linear behaviour and - \item it has a simple performance interpretation in terms of system - rise-time and overshoot. - \end{itemize} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/msd_lbl.txt @@ -1,29 +0,0 @@ -%SUMMARY msd: Simple mass-spring damper -%DESCRIPTION -%% Label file for system msd (msd_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type C - spring lin state,k_s - -% Component type I - inertia lin flow,m_s - -% Component type R - damper lin flow,d_s - -% Component type SS - [in] SS external,external DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_abg.fig @@ -1,123 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 4278 5403 4953 5178 4953 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5854 5404 6529 6079 6304 6079 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 6078 5403 5403 5403 5628 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 4953 6528 4278 6528 4503 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 - 4277 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 2702 4277 3827 4052 3827 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 6527 8102 7652 7877 7652 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 7652 4277 6527 4277 6752 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3827 8102 2702 8102 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5852 5177 6527 5177 6392 5312 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 2927 2927 4952 3152 4727 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5402 2927 7427 3152 7202 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2701 5176 2026 5176 2161 5311 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 1351 2926 2476 3196 2206 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 7876 2926 9001 3196 8731 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 2928 8328 4953 8553 4728 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8328 5403 8328 7428 8553 7203 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 1352 8327 2477 8597 2207 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8327 7877 8327 9002 8597 8732 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 1351 5626 4951 5851 4726 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5626 5401 5626 9001 5851 8776 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8551 5176 9226 5176 9091 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 4951 6526 4051 6436 4231 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3826 4996 3826 5356 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 5176 3826 5176 3961 5311 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3826 5401 6301 6301 6121 6301 -2 1 0 1 5 -1 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 5401 4051 6301 3826 6301 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 4951 4051 4051 4051 4276 -2 1 0 1 5 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5536 5176 5086 5176 5221 5311 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6300 9675 6300 675 4950 675 4950 9675 6300 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 9000 9675 9000 675 7650 675 7650 9675 9000 9675 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11025 10305 11025 225 225 225 225 10305 11025 10305 -2 4 0 1 1 7 0 0 -1 0.000 0 0 7 0 0 5 - 3600 9675 2250 9675 2250 675 3600 675 3600 9675 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 2250 990 2250 990 900 10125 900 10125 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 5850 990 5850 990 4500 10125 4500 10125 5850 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 10125 9450 990 9450 990 8100 10125 8100 10125 9450 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2700 4950 2700 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5850 4950 5850 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8550 4950 8550 5400 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5628 5268 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 315 6933 5268 I:J\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 5312 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2972 2792 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2927 7742 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 5313 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8373 2793 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8328 7743 0\001 -4 1 -1 0 0 0 20 0.0000000 4 270 735 9676 5266 I:m_y\001 -4 1 -1 0 0 0 20 0.0000000 4 240 735 1531 5221 I:m_x\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1170 4636 4141 EMTF:c1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1170 4681 6391 EMTF:c2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 4141 EMTF:s1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1155 7156 6391 EMTF:s2\001 -4 1 5 0 0 0 20 0.0000000 4 210 150 3603 5313 0\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 6751 4456 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 6751 3781 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 6751 6076 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 6751 6706 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 570 6211 6526 [mod]\001 -4 1 5 0 0 0 20 0.0000000 4 210 990 4681 5266 INTF:th\001 -4 1 1 1 0 0 20 0.0000000 4 210 210 2925 10035 X\001 -4 1 1 1 0 32 20 0.0000000 4 135 195 5580 9990 a\001 -4 1 1 1 0 0 20 0.0000000 4 210 210 8280 9990 Y\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 3960 4140 [mod]\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 6345 4095 [mod]\001 -4 2 26 0 0 0 16 0.0000000 4 195 570 3960 6210 [mod]\001 -4 1 26 0 0 0 16 0.0000000 4 195 330 4590 4455 [in]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 4545 3780 [out]\001 -4 1 26 0 0 0 16 0.0000000 4 195 450 4590 6660 [out]\001 -4 0 26 0 0 0 16 0.0000000 4 195 330 4365 6030 [in]\001 -4 1 4 0 0 0 20 0.0000000 4 240 1065 2971 1216 SS:[x_a]\001 -4 1 4 0 0 0 20 0.0000000 4 240 1080 2971 9361 SS:[x_b]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1065 8372 1217 SS:[y_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1080 8417 9362 SS:[y_b]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1575 5671 1216 SS:[alpha_a]\001 -4 1 4 0 0 0 20 0.0000000 4 270 1590 5671 9361 SS:[alpha_b]\001 -4 1 1 1 0 0 20 0.0000000 4 270 630 1350 2700 Tip a\001 -4 1 1 1 0 0 20 0.0000000 4 240 1470 1260 6300 Mass centre\001 -4 1 1 1 0 0 20 0.0000000 4 270 645 1350 9855 Tip b\001 DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_desc.tex @@ -1,20 +0,0 @@ -% Verbal description for system oldROD (oldROD_desc.tex) -% Generated by MTT on Fri Aug 15 09:53:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/08/15 09:41:19 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{oldROD} is - displayed in Figure \Ref{oldROD_abg} and its label - file is listed in Section \Ref{sec:oldROD_lbl}. - The subsystems are listed in Section \Ref{sec:oldROD_sub}. - -{\bf oldROD} is essentially as described in Figure 10.2 of -``Metamodelling''. DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/oldROD_lbl.txt @@ -1,53 +0,0 @@ -%SUMMARY oldROD: rigid rod in two dimensions -%DESCRIPTION Port [alpha_a]: Angular torque/velocity - end a -%DESCRIPTION Port [alpha_b]: Angular torque/velocity - end b -%DESCRIPTION Port [x_a]: x force/velocity - end a -%DESCRIPTION Port [x_b]: x force/velocity - end b -%DESCRIPTION Port [y_a]: y force/velocity - end a -%DESCRIPTION Port [y_b]: y force/velocity - end b -%DESCRIPTION -%DESCRIPTION Parameter 1: length from end 1 to mass centre -%DESCRIPTION Parameter 2: length from end 2 to mass centre -%DESCRIPTION Parameter 3: inertia about mass centre -%DESCRIPTION Parameter 4: mass -%DESCRIPTION See Section 10.2 of "Metamodelling" - - -%% Label file for system oldROD (oldROD_lbl.txt) - - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1997/08/15 09:43:06 peterg -% %% Now has lablelled (as opposed to numbered) ports. -% %% -% Revision 1.1 1996/11/07 10:57:17 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Inertias -J lin flow,$3 -m_x lin flow,$4 -m_y lin flow,$4 - -%Integrate angular velocity to get angle -th - -%Modulated transformers -s1 lsin flow,$1 -s2 lsin flow,$2 -c1 lcos flow,$1 -c2 lcos flow,$2 - - - DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_abg.fig Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_abg.fig +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_abg.fig @@ -1,82 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3468 1128 3738 1128 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 5625 4502 5627 4277 5852 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 7426 4951 7201 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3472 8647 3742 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4597 8647 4867 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5724 8649 5994 8649 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4730 8645 4730 10220 4955 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5855 8645 5855 10220 6080 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3826 3601 7426 3826 7201 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3826 5851 7426 6076 7201 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 11475 9450 225 180 225 180 11475 9450 11475 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 8622 3600 10197 3825 9972 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 2025 2250 4725 2250 4725 2700 4950 2475 -4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000 4 195 1200 4729 3379 ROD:rod1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1200 4731 8196 ROD:rod2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 -4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 -4 2 4 0 0 0 20 0.0000 4 255 1380 1936 2341 SS:[joint_1]\001 -4 2 4 0 0 0 20 0.0000 4 255 1380 1936 5716 SS:[joint_2]\001 -4 1 -1 0 0 0 20 0.0000 4 255 810 5808 948 SS:v_y\001 DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_desc.tex Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_desc.tex +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_desc.tex @@ -1,28 +0,0 @@ -% Verbal description for system twolink (twolink_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{twolink} is - displayed in Figure \Ref{twolink_abg} and its label - file is listed in Section \Ref{sec:twolink_lbl}. - The subsystems are listed in Section \Ref{sec:twolink_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses two compound components: {\bf ROD} and {\bf -GRAV}. {\bf ROD} is essentially as described in Figure 10.2 {\bf -GRAV} represents gravity by a vertical accelleration as in Section -10.9 of "Metamodelling" - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_lbl.txt Index: mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_lbl.txt +++ mttroot/mtt/lib/examples/Inverse/iTwoLink/twolink_lbl.txt @@ -1,54 +0,0 @@ -%SUMMARY twolink: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (twolink_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/12/05 12:39:49 peterg -% %% Documentation -% %% -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - identical rods -rod1 none l;l;j_s;m_s -rod2 none l;l;j_s;m_s - -%Zero velocity sources -v_x SS internal,0 -v_y SS internal,0 - - -%Zero force/torque sources -F_x SS 0,internal -F_a SS 0,internal -F_y SS 0,internal - - -%Torque at joints -%f_a1 SS external,external -%f_a2 SS external,external - -%Gravity -%g - DELETED mttroot/mtt/lib/examples/Makefile Index: mttroot/mtt/lib/examples/Makefile ================================================================== --- mttroot/mtt/lib/examples/Makefile +++ mttroot/mtt/lib/examples/Makefile @@ -1,32 +0,0 @@ -#! /usr/bin/make -f - -# DESTDIR prefix required by Debian build process -INSTDIR=$(DESTDIR)/usr/share/mtt/lib/examples - -configure: configure-stamp -configure-stamp: - @touch configure-stamp - -build: configure build-stamp -build-stamp: - @touch build-stamp - -clean: - @touch clean.sh - @-chmod a+x clean.sh - @./clean.sh - @rm -f clean.sh - -distclean: clean - -install: build clean.sh - @install -d $(INSTDIR) - @cp -a $(filter-out CVS Makefile debian, $(wildcard *)) $(INSTDIR) - -.PHONY: FORCE - -clean.sh: FORCE - @echo '#! /bin/sh' >>clean.sh - @echo '# This file is auto-generated - do not edit' >>clean.sh - @echo "rm -f $(INSTDIR)/examples" >>clean.sh - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_abg.fig @@ -1,16 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1125 2700 2250 2700 2025 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2745 2700 3870 2700 3645 2925 -4 1 0 100 0 18 20 1.5708 4 225 675 1035 2700 Free\001 -4 1 0 100 0 18 20 1.5708 4 300 3405 2610 2700 BernoulliEuler:Lump*20\001 -4 1 0 100 0 18 20 1.5708 4 225 795 4230 2700 Fixed\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_desc.tex @@ -1,59 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system CantileverBeam (CantileverBeam_desc.tex) -% Generated by MTT on Mon Apr 19 07:04:54 BST 1999. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/05/18 04:01:50 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -The acausal bond graph of system \textbf{CantileverBeam} is displayed in -Figure \Ref{fig:CantileverBeam_abg.ps} and its label file is listed in -Section \Ref{sec:CantileverBeam_lbl}. The subsystems are listed in Section -\Ref{sec:CantileverBeam_sub}. - -This example represents the dynamics of a uniform beam with one fixed -and one free end. The beam is approximated by 20 equal lumps using -the Bernoulli-Euler approximation with damping. -The input is the angular velocity of the fixed end, the output is the -linear velocity of the free end. - -The system parameters are given in Section -\Ref{sec:CantileverBeam_numpar.tex}. Note that the numer of ban -segments has been set to 21. - - The system has 20 states (10 -modes of vibration), 1 inputs and 1 outputs. - -The first 5 vibration frequencies are given in Table \ref{tab:freq} -togtherr with the theoretical (based on the Bernoulli-Euler beam with -the same values of $EI$ and $\rho A$. -\begin{table}[htbp] - \begin{center} - \begin{tabular}{||l|l|l||} - \hline - \hline - Mode & Frequency & Theoretical frequency\\ - \hline - 1 & 76.14 & 76.14\\ - 2 & 477.11 & 484.50\\ - 3 &1330.62 &1334.55\\ - 4 &2586.77 &2617.19\\ - 5 &4225.14 &4323.77\\ - \hline - \hline - \end{tabular} - \caption{Mode frequencies (rad $s^{-1}$)} - \label{tab:freq} - \end{center} -\end{table} - - - - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_input.txt @@ -1,19 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (CantileverBeam_input.txt) -# Generated by MTT at Thu Apr 22 00:12:54 BST 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 2003/05/08 18:48:49 gawthrop -## Modified for new format with __ -## -## Revision 1.1 2000/12/28 17:58:27 peterg -## To RCS -## -############################################################### - -# Set the inputs -## Removed by MTT on Thu May 8 16:55:10 BST 2003: mttu(1) = exp(-t/0.1); # tau (CantileverBeam) -cantileverbeam__mttfixed__u__u = exp(-t/0.1); # tau (CantileverBeam) DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_lbl.txt @@ -1,37 +0,0 @@ -%% Label file for system CantileverBeam (CantileverBeam_lbl.txt) -%SUMMARY CantileverBeam -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%VAR n -%VAR BeamLength -%VAR BeamWidth -%VAR BeamThickness -%VAR Youngs -%VAR Density -%VAR Area -%VAR AreaMoment -%VAR EI -%VAR rhoA -%VAR k - -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type BernoulliEuler - Lump DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt @@ -1,45 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (CantileverBeam_numpar.txt) -# Generated by MTT at Mon Apr 19 06:24:08 BST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 17:58:27 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -N = 21; -BeamLength = 0.58; -BeamWidth = 0.05; -BeamThickness = 0.005; -Youngs = 68.94e9; -Density = 2712.8; -Area = BeamWidth*BeamThickness; -AreaMoment = (BeamWidth*pow(BeamThickness,3))/12; - -EI = Youngs*AreaMoment; -rhoA = Density*Area; - -dz = BeamLength/N; # Incremental length -dm = rhoA*dz; # Incremental mass -dk = EI/dz; # Incremental stiffness -dr = 0; # Damping - -K = sqrt(EI/rhoA)/pow(BeamLength,2); # Normalising factor - - -# EI= 58.6957 # from Reza -# rhoA= 0.7989 # from Reza - - - - - - - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_rep.txt @@ -1,28 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system CantileverBeam (CantileverBeam_rep.txt) -## Generated by MTT on" Mon Apr 19 06:43:08 BST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt CantileverBeam abg tex # The system description -## mtt CantileverBeam cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt CantileverBeam struc tex # The system structure -## mtt CantileverBeam dae tex # The system dae -## mtt CantileverBeam ode tex # The system ode -## mtt CantileverBeam sspar tex # Steady-state parameters -## mtt CantileverBeam ss tex # Steady state -## mtt CantileverBeam dm tex # Descriptor matrices (of linearised system) -## mtt CantileverBeam sm tex # State matrices (of linearised system) -## mtt CantileverBeam tf tex # Transfer function (of linearised system) -mtt CantileverBeam simpar tex # Simulation parameters -mtt CantileverBeam numpar tex # Numerical simulation parameters -## mtt CantileverBeam input tex # Simulation input -## mtt CantileverBeam odeso ps # Simulation output -mtt CantileverBeam lmfr ps # log modulus of frequency response (of linearised system) - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system CantileverBeam (CantileverBeam_simpar.txt) -# Generated by MTT on Mon Apr 19 06:32:42 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 1.0; # Last time in simulation -DT = 0.001; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = 1; # Minimum frequency = 10^WMIN -WMAX = 4; # Maximum frequency = 10^WMAX -WSTEPS = 200; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_abg.fig @@ -1,21 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 1800 5400 1800 5175 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4230 2700 5355 2700 5130 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 1575 5400 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 2475 5400 2925 -4 0 0 100 0 18 20 0.0000 4 225 1065 5625 1890 Sf:zero\001 -4 0 0 100 0 18 20 0.0000 4 225 585 5625 2790 Sf:u\001 -4 2 4 100 0 18 20 0.0000 4 300 1230 4140 1890 SS:[y_in]\001 -4 2 4 100 0 18 20 0.0000 4 300 1785 4140 2790 SS:[theta_in]\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Fixed_lbl.txt @@ -1,31 +0,0 @@ -%% Label file for system Fixed (Fixed_lbl.txt) -%SUMMARY Fixed -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in y_in,theta_in - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [theta_in] SS external,external - [y_in] SS external,external - -% Component type Sf - u SS external - zero SS 0 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_abg.fig @@ -1,21 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 1800 5400 1800 5175 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4230 2700 5355 2700 5130 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 1575 5400 2025 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5400 2475 5400 2925 -4 2 0 100 0 18 20 0.0000 4 300 585 4140 1890 Df:y\001 -4 2 0 100 0 18 20 0.0000 4 225 1125 4140 2790 Se:zero\001 -4 0 4 100 0 18 20 0.0000 4 300 1440 5490 1890 SS:[y_out]\001 -4 0 4 100 0 18 20 0.0000 4 300 1995 5445 2790 SS:[theta_out]\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/Free_lbl.txt @@ -1,35 +0,0 @@ -%% Label file for system Free (Free_lbl.txt) -%SUMMARY Free -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS out y_out,theta_out - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type Df - y SS external - -% Component type SS - [theta_out] SS external,external - [y_out] SS external,external - -% Component type Se - zero SS 0 - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/frequencies.m Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/frequencies.m ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/frequencies.m +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/frequencies.m @@ -1,14 +0,0 @@ -function [w_r,w_a,n_null] = frequencies (A,B,C,D) - - ## usage: [w_r,w_a] = frequencies (A,B,C,D) - ## - ## Resonant and antiresonant frequencies for undampled beam - - poles = eig(A); - Np = length(poles); - zeros = tzero(A,B,C,D); - Nz = length(zeros); - w_r = sort(imag(poles)); w_r = w_r(Np/2+1:Np); - w_a = sort(imag(zeros)); w_a = nozeros(w_a(Nz/2+1:Nz))'; - n_null = (Nz/2-length(w_a))*2; -endfunction DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Fixed_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Fixed_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Fixed_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Fixed_lbl.txt @@ -1,31 +0,0 @@ -%% Label file for system Fixed (Fixed_lbl.txt) -%SUMMARY Fixed -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in y_in,theta_in - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [theta_in] SS external,external - [y_in] SS external,external - -% Component type Sf - u SS external - zero SS 0 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Free_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Free_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Free_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/Free_lbl.txt @@ -1,35 +0,0 @@ -%% Label file for system Free (Free_lbl.txt) -%SUMMARY Free -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS out y_out,theta_out - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type Df - y SS external - -% Component type SS - [theta_out] SS external,external - [y_out] SS external,external - -% Component type Se - zero SS 0 - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/MakeFreqTable.m Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/MakeFreqTable.m ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/MakeFreqTable.m +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/MakeFreqTable.m @@ -1,64 +0,0 @@ -# ## Makes the table of resonant frequencies - -# ## Actual resonant freqs -# fr_measured = [ -# 2.0683e+01 -# 7.5310e+01 -# 1.7080e+02 -# 3.0532e+02 -# 4.7414e+02]; - -# fa_measured = [ -# 2.0896e+01 -# 7.6867e+01 -# 1.7794e+02 -# 3.1890e+02 -# 4.8768e+02]; - -## Parameters - ideal pinned beam -PinnedBeam_numpar; - -## Ideal pinned beam - theory -[fr_theory] = beam_frequencies("pinned",ei,rhoa,beamlength)/(2*pi); -[fa_theory] = beam_frequencies("clamped-pinned",ei,rhoa,beamlength)/(2*pi); - -## SM form to get poles and zeros of the model -# ## Ideal pinned -# [A,B,C,D] = PinnedBeam_sm; -# fr_model_ideal = frequencies(A,B,C,D)/(2*pi); - -# ## Actual with non-ideal pins -# PinnedBeam_numpar; - -[A,B,C,D] = PinnedBeam_sm; - -[w_r, w_a] = frequencies(A,B,C,D); -fr_model = w_r/(2*pi); -fa_model = w_a/(2*pi); - - -printf("\nIndex \t& Theory \t& Model \t& Theory \t& Model \\\\ \n"); -printf("\\hline\n"); -for i = 1:5 - printf("%i \t& %3.2f \t& %3.2f \t& %3.2f \t& %3.2f\\\\ \n", i, \ - fr_theory(i), fr_model(i), fa_theory(i), fa_model(i)); -endfor - -# printf("\nMode \t& Theory \t& Model(ideal) \t& Model \t& Actual \\\\ \n"); -# printf("\\hline\n"); -# for i = 1:5 -# printf("%i \t& %3.2f \t& %3.2f \t& %3.2f \t& %3.2f\\\\ \n", i, fr_theory(i), \ -# fr_model_ideal(i), fr_model(i), fr_measured(i)); -# endfor - -# printf("\nMode \t& Theory \t& Model \t& Actual \\\\ \n"); -# printf("\\hline\n"); -# for i = 1:5 -# printf("%i \t& %3.2f \t& %3.2f \t& %3.2f \\\\ \n", i, fa_theory(i), fa_model(i), fa_measured(i)); -# endfor - - - - - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_abg.fig @@ -1,50 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2925 1980 3015 2520 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2970 2025 2970 2475 --6 -6 4005 2880 4095 3420 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 2925 4050 3375 --6 -6 8955 1980 9045 2520 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 9000 2025 9000 2475 --6 -6 7830 2880 7920 3420 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 7875 2925 7875 3375 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4770 2700 5895 2700 5670 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6300 2700 7425 2700 7200 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2970 2250 4095 2250 3870 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2925 3150 4050 3150 3825 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7875 2250 9000 2250 8775 2475 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 7875 3150 9000 3150 8775 3375 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 1125 225 1125 5400 10800 5400 10800 225 1125 225 -4 1 0 100 0 18 20 1.5708 4 360 3855 4635 2700 BernoulliEuler:LumpL\001 -4 1 0 100 0 18 20 1.5708 4 360 4170 6165 2700 BernoulliEuler:Lump*18\001 -4 1 0 100 0 18 20 1.5708 4 360 3885 7740 2700 BernoulliEuler:LumpR\001 -4 2 4 100 0 18 14 0.0000 4 210 585 3915 2070 [y_in]\001 -4 2 4 100 0 18 14 0.0000 4 210 990 3915 2970 [theta_in]\001 -4 0 4 100 0 18 14 0.0000 4 210 735 7965 1980 [y_out]\001 -4 0 4 100 0 18 14 0.0000 4 210 1140 7965 2970 [theta_out]\001 -4 2 0 100 0 18 20 0.0000 4 285 1230 2835 3285 SS:ssL\001 -4 0 0 100 0 18 20 0.0000 4 285 1515 9135 2385 Sf:zeroR\001 -4 0 0 100 0 18 20 0.0000 4 285 1260 9135 3285 SS:ssR\001 -4 2 0 100 0 18 20 0.0000 4 285 1485 2835 2385 Sf:zeroL\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_desc.tex @@ -1,101 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system PinnedBeam (PinnedBeam_desc.tex) -% Generated by MTT on Mon Apr 19 07:04:54 BST 1999. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1999/11/24 22:17:26 peterg -% %% Updated to correspond to Reza's beam -% %% -% %% Revision 1.1 1999/10/11 05:08:14 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1999/05/18 04:01:50 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -The acausal bond graph of system \textbf{PinnedBeam} is displayed in -Figure \Ref{fig:PinnedBeam_abg.ps} and its label file is listed in -Section \Ref{sec:PinnedBeam_lbl}. The subsystems are listed in Section -\Ref{sec:PinnedBeam_sub}. - -This example represents the dynamics of a uniform beam with two pinned -ends. The left-hand end is driven by a torque input and the -corresponding collocated angular velocity is measured. The beam is -approximated by 20 equal lumps using the Bernoulli-Euler. Because the -two end lumps have different causality to the rest of the beam lumps, -they are represented seperately. The system has 40 states (20 modes -of vibration), 1 input and 1 output. - -\begin{table}[htbp] - \begin{center} - \begin{tabular}{|l|l|} - \hline - Name & Value\\ - \hline - Beam Length, $L$ & 0.60 m\\ - Beam Width $w$ & 0.05 m\\ - Beam Thickness $t_b$ & 0.003\\ - Young's Modulus $E$ & $68.94 \times 10^9$ \\ - Density $\rho$ & 2712.8\\ - \hline - Derived quantities & \\ - \hline - $EI$ & 7.76\\ - $\rho A$ & 0.40692 \\ - \hline - \end{tabular} - \caption{Beam parameters} - \label{tab:beam} - \end{center} -\end{table} - - -The beam was made of aluminium with physical dimensions and constants -given in Table \ref{tab:beam}. The derived beam constants are given by the -formulae: -\begin{equation} - \label{eq:formulae} - \begin{align} - EI &= E \times w \frac{1}{12} t_b^3\\ - \rho A &= \rho \times w t_b - \end{align} -\end{equation} - -The system parameters are also given in Section -\Ref{sec:PinnedBeam_numpar.tex}. - - -\begin{table}[htbp] - \begin{center} - \begin{tabular}{||l|l|l|l|l||} - \hline - \hline -Index & $f_r$ (theory) & $f_r$ (model)& $f_a$ (theory) & $f_a$ (model) \\ -\hline -1 & 19.05 & 19.01 & 29.72 & 31.28\\ -2 & 76.24 & 75.57 & 96.50 & 100.80\\ -3 & 171.58 & 168.29 & 200.73 & 208.20\\ -4 & 304.76 & 294.89 & 344.13 & 350.88\\ -5 & 476.34 & 452.25 & 524.98 & 525.23\\ - \hline - \hline - \end{tabular} - \caption{Resonant and anti-resonant frequencies (Hz)} - \label{tab:freq} - \end{center} -\end{table} - -Standard modal analysis give the theoretical system resonant -frequencies $f_r$ (based on the Bernoulli-Euler beam with the same values of -$EI$ and $\rho A$). The system anti-resonances $f_a$ correspond to those of -the \emph{inverse} system with reversed causality, that the driven -pinned end is replaced by a clamped end; again modal analysis of the -inverse system gives the system anti resonances. The model and -theoretical values are compared in Table \ref{tab:freq} for the first -5 modes. (This table was generated using the script MakeFreqTable.m) - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_input.txt @@ -1,17 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (PinnedBeam_input.txt) -# Generated by MTT at Thu Apr 22 00:12:54 BST 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 17:59:05 peterg -## To RCS -## -############################################################### - -# Set the inputs -pinnedbeam__mttfixed__u__u = exp(-t/0.1); # tau (PinnedBeam) - -# Set the switches DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_lbl.txt @@ -1,54 +0,0 @@ -%% Label file for system PinnedBeam (PinnedBeam_lbl.txt) -%SUMMARY PinnedBeam -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/08/01 12:11:57 peterg -% %% Added %Vars -% %% -% %% Revision 1.1 1999/10/11 05:08:22 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%VAR Lumps -%VAR BeamLength -%VAR BeamWidth -%VAR BeamThickness -%VAR Youngs -%VAR Density -%VAR Area -%VAR AreaMoment -%VAR EI -%VAR rhoA - -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type BernoulliEuler - Lump - LumpL - LumpR - -% Component type SS - ssL SS external,external - ssR SS 0,internal - -% Component type Sf - zeroL none 0 - zeroR none 0 - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt @@ -1,37 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (pPinnedBeam_numpar.txt) -# Generated by MTT at Mon Apr 19 06:24:08 BST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.2 2003/06/11 16:03:06 gawthrop -# %% Updated examples for latest MTT. -# %% -# %% Revision 1.1 2000/12/28 17:59:05 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -## Number of lumps -Lumps = 20; # Number of lumps - -## Beam physical parameters -BeamLength = 0.60; -BeamWidth = 0.05; -BeamThickness = 0.003; -Youngs = 68.94e9; -Density = 2712.8; -Area = BeamWidth*BeamThickness; -AreaMoment = (BeamWidth*pow(BeamThickness,3))/12; -EI = Youngs*AreaMoment; -rhoA = Density*Area; - -## Segments -dz = BeamLength/Lumps; # Incremental length -dm = rhoA*dz; # Incremental mass -dk = EI/dz; # Incremental stiffness -dr = 0; # Damping - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_rep.txt @@ -1,28 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system PinnedBeam (PinnedBeam_rep.txt) -## Generated by MTT on" Mon Apr 19 06:43:08 BST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt PinnedBeam abg tex # The system description -## mtt PinnedBeam cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt PinnedBeam struc tex # The system structure -## mtt PinnedBeam dae tex # The system dae -## mtt PinnedBeam ode tex # The system ode -## mtt PinnedBeam sspar tex # Steady-state parameters -## mtt PinnedBeam ss tex # Steady state -## mtt PinnedBeam dm tex # Descriptor matrices (of linearised system) -## mtt PinnedBeam sm tex # State matrices (of linearised system) -## mtt PinnedBeam tf tex # Transfer function (of linearised system) -mtt PinnedBeam simpar tex # Simulation parameters -mtt PinnedBeam numpar tex # Numerical simulation parameters -## mtt PinnedBeam input tex # Simulation input -## mtt PinnedBeam odeso ps # Simulation output -mtt PinnedBeam lmfr ps # log modulus of frequency response (of linearised system) - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system PinnedBeam (PinnedBeam_simpar.txt) -# Generated by MTT on Mon Apr 19 06:32:42 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 1.0; # Last time in simulation -DT = 0.01; # Print interval -STEPFACTOR = 10; # Integration steps per print interval -WMIN = 1; # Minimum frequency = 10^WMIN -WMAX = 4; # Maximum frequency = 10^WMAX -WSTEPS = 200; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_abg.fig @@ -1,132 +0,0 @@ -#FIG 3.1 -Portrait -Center -Inches -1200 2 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2706 4806 3606 4806 3456 4956 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2406 5106 2406 6006 2556 5856 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3906 5106 3906 6006 4056 5856 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7208 4808 8108 4808 7958 4958 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8708 4808 9608 4808 9458 4958 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8408 5108 8408 6008 8558 5858 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7208 4508 8108 3608 8108 3833 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8708 3608 9608 4508 9383 4508 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9909 5109 9909 6009 10059 5859 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6908 5108 6908 6008 7058 5858 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 8405 2405 8405 3305 8555 3155 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11407 5107 11407 6007 11557 5857 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11406 3306 11406 2406 11556 2556 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4206 4806 5106 4806 4956 4956 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5406 5106 5406 6006 5556 5856 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4206 4506 5106 3606 5106 3831 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5405 3305 5405 2405 5555 2555 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2405 3305 2405 2405 2555 2555 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11707 4807 12607 4807 12457 4957 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11707 3607 12607 4507 12382 4507 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2105 1805 2105 905 2255 1055 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2705 1805 2705 905 2855 1055 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5706 4806 6606 4806 6456 4956 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5706 3606 6606 4506 6381 4506 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2704 3604 3604 4504 3379 4504 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1208 4808 2108 4808 1958 4958 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1208 4508 2108 3608 2108 3833 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 681 3606 1131 3606 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 906 4506 906 3606 1056 3756 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12905 4505 12905 3605 13055 3755 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10207 4807 11107 4807 10957 4957 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10207 4507 11107 3607 11107 3832 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8400 3300 8625 3300 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 12900 3600 13125 3600 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 12675 3600 12900 3600 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8175 3300 8400 3300 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 1501 5401 301 5401 301 3001 1501 3001 1501 5401 -2 2 1 2 1 7 1 0 -1 6.000 1 0 0 0 0 5 - 1502 452 3302 452 3302 3377 1502 3377 1502 452 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 4501 6601 3301 6601 3301 3901 4501 3901 4501 6601 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 6000 6600 4800 6600 4800 1800 6000 1800 6000 6600 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 7501 6601 6301 6601 6301 3901 7501 3901 7501 6601 -2 4 1 2 1 7 2 0 -1 6.000 0 0 7 0 0 5 - 9000 6600 7800 6600 7800 1800 9000 1800 9000 6600 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 10501 6601 9301 6601 9301 3901 10501 3901 10501 6601 -2 4 1 2 1 -1 1 0 -1 6.000 0 0 7 0 0 5 - 12000 6600 10800 6600 10800 1800 12000 1800 12000 6600 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 13501 5401 12301 5401 12301 3001 13501 3001 13501 5401 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2406 4881 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 585 3906 6381 I:m1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 585 2405 6380 R:b1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2405 3680 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 3906 4881 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8408 4883 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 8408 3683 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 585 8483 6383 R:b3\001 -4 1 -1 0 0 0 20 0.0000000 4 210 675 8407 2182 SS:f2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 585 9906 6381 I:m3\001 -4 1 -1 0 0 0 20 0.0000000 4 210 585 6905 6380 I:m2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 11407 4882 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 11407 3682 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 525 11406 2181 C:kt\001 -4 1 -1 0 0 0 20 0.0000000 4 210 525 11482 6382 R:bt\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5406 4881 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5406 3681 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 585 5481 6381 R:b2\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 12909 4884 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 6908 4883 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 2404 2179 1\001 -4 1 -1 0 0 0 20 0.0000000 4 270 585 2779 754 C:p1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 585 2104 754 R:d1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 910 4885 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 675 902 3377 SS:fb\001 -4 1 -1 0 0 0 20 0.0000000 4 210 615 12905 3380 SS:ft\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 9909 4884 1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 585 5405 2180 C:k2\001 -4 1 1 1 0 3 20 0.0000000 4 240 1530 3901 6901 Macro mass\001 -4 1 1 1 0 3 20 0.0000000 4 240 1800 2401 376 Macro control\001 -4 1 1 1 0 3 20 0.0000000 4 240 1455 900 5700 Macro base\001 -4 1 1 1 0 3 20 0.0000000 4 270 1890 5400 1650 Compliant link\001 -4 1 1 1 0 3 20 0.0000000 4 240 1470 6901 6901 Micro mass\001 -4 1 1 1 0 3 20 0.0000000 4 240 1890 8475 1650 Micro actuator\001 -4 1 1 1 0 3 20 0.0000000 4 270 1125 9901 6901 Tip mass\001 -4 1 1 1 0 3 20 0.0000000 4 270 2985 11400 1650 Compliant environment\001 -4 1 1 1 0 3 20 0.0000000 4 270 1305 12901 5701 Tip sensor\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_desc.tex @@ -1,18 +0,0 @@ -% Verbal description for system MacroMicro (MacroMicro_desc.tex) -% Generated by MTT on Tue Dec 9 17:55:41 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{MacroMicro} is - displayed in Figure \Ref{MacroMicro_abg} and its label - file is listed in Section \Ref{sec:MacroMicro_lbl}. - The subsystems are listed in Section \Ref{sec:MacroMicro_sub}. - -This is a Bond Graph model of the macro-micro manipulation system -discussed by Sharon in his thesis and BY Sharon, Hogan and Hardt in -various papers. DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_lbl.txt @@ -1,32 +0,0 @@ -%% Label file (macmic_lbl.txt) -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Masses -m1 lin flow,m_1 -m2 lin flow,m_2 -m3 lin flow,m_3 - -%Springs -k2 lin state,k_2 -kt lin state,k_t - -%Dampers -b1 lin flow,b_1 -b2 lin flow,b_2 -b3 lin flow,b_3 -bt lin flow,b_t - -%Source/sensors -f2 SS external,internal -ft SS external,0 -fb SS internal,0 - -%Control -p1 lin flow,p_1 -d1 lin flow,d_1 - - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_numpar.txt @@ -1,12 +0,0 @@ - -m_1 = 0.0169; # m_1; -m_2 = 0.0169; # m_2; -b_1 = 0.13; # b_1; -b_2 = 0.013; # b_2; -k_2 = 24; # k_2; -k_t = 150; # k_t; -b_t = 0.16; # b_t; -b_3 = 0.13; # b_3; -m_3 = 0.005; # m_3; -p_1 = 10; # p_1; -d_1 = 0.9; # d_1; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_rep.txt @@ -1,19 +0,0 @@ -# Outline report file for system MacroMicro (MacroMicro_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt MacroMicro abg tex -mtt MacroMicro cbg ps -mtt MacroMicro struc tex -mtt MacroMicro dae tex -mtt MacroMicro dm tex -mtt MacroMicro tf tex -mtt MacroMicro numpar txt -mtt MacroMicro lmfr ps -mtt MacroMicro sro ps - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_simpar.txt @@ -1,19 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system MacroMicro (MacroMicro_simpar.txt) -# Generated by MTT on Thu Nov 9 15:19:17 GMT 2000. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -FIRST = 0.0; # First time in simulation output -DT = 0.01; # Print interval -LAST = 1.0; # Last time in simulation -STEPFACTOR = 10; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_state.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_state.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_state.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/MacroMicro/MacroMicro_state.txt @@ -1,14 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System MacroMicro, representation state, language txt; -## File MacroMicro_state.txt; -## Generated by MTT on Thu Nov 9 15:19:28 GMT 2000; - - -MacroMicro_k2 = 0.0; # Default -MacroMicro_kt = 0.0; # Default -MacroMicro_m1 = 0.0; # Default -MacroMicro_m2 = 0.0; # Default -MacroMicro_m3 = 0.0; # Default -MacroMicro_p1 = 0.0; # Default DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_abg.fig @@ -1,45 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -0 32 #969296 -0 33 #e7e7cf -0 34 #9e9a9e -0 35 #cf9200 -0 36 #f761ae -0 37 #7171ff -0 38 #595d59 -1 3 0 3 1 7 55 0 -1 0.000 1 0.0000 1845 2430 186 186 1845 2430 2031 2430 -2 2 0 1 1 7 55 0 47 0.000 0 0 -1 0 0 5 - 1800 2475 4500 2475 4500 2925 1800 2925 1800 2475 -2 1 0 3 1 7 55 0 -1 0.000 0 0 -1 0 0 2 - 1830 2467 3180 129 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 5625 4725 5625 4500 5850 -2 1 0 3 1 7 55 0 -1 0.000 0 0 -1 0 0 12 - 4453 2442 4177 1964 3884 2024 4282 1579 3700 1707 4103 1268 - 3521 1396 3914 946 3337 1077 3749 632 3445 696 3158 215 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2925 5625 1575 5625 1800 5850 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 5400 3150 4050 3375 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 7200 3150 5850 3375 6075 -4 1 1 55 0 32 30 0.0000 4 315 240 2385 2295 q\001 -4 0 1 55 0 3 30 0.0000 4 300 270 2025 1260 L\001 -4 0 1 55 0 3 30 0.0000 4 300 270 3105 3510 L\001 -4 1 1 55 0 32 30 0.0000 4 225 195 1530 2250 t\001 -4 1 0 100 0 18 18 0.0000 4 195 150 3150 5715 1\001 -4 1 0 100 0 18 18 0.0000 4 210 390 3195 3915 R:r\001 -4 1 4 100 0 18 18 0.0000 4 270 930 3060 7515 SS:[yu]\001 -4 1 0 100 0 18 18 0.0000 4 270 240 1305 5715 I:j\001 -4 0 0 100 0 18 18 0.0000 4 270 8610 4860 5715 C:k:mtt_e=k*(l^2)*cos(mtt_f/2)*2*(sin(mtt_f/2)-sin(alpha/2))+0*eta\001 -4 0 1 101 0 3 20 0.0000 4 270 3255 4950 675 Rod (length L) hinged at left\001 -4 0 1 101 0 3 20 0.0000 4 270 4275 4950 1125 Spring (stiffness k) unstretched when \001 -4 0 1 101 0 32 20 0.0000 4 210 510 9225 1125 q=a\001 -4 0 1 101 0 3 20 0.0000 4 270 3120 4950 1575 eta is the equilibrium angle\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_desc.tex @@ -1,127 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system NonlinearMSD (NonlinearMSD_desc.tex) -% Generated by MTT on Thu Mar 7 14:48:47 GMT 2002. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 09:13:38 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This example illustrates the use of \textbf{MTT} to \emph{linaerise} a -nonlinear system -- a non-linear mass-spring-damper system called -\textbf{NonlinearMSD}. The model is considered in Section -\ref{sec:model} and linearisation in Section \Ref{sec:linearisation}. - -Further work is suggested in Section \Ref{sec:further}. - -\subsection{Bond Graph model}\label{sec:model} - -The schematic diagram of the system -\textbf{NonlinearMSD} is displayed in Figure -\ref{fig:NonlinearMSD_abg.ps}. The system comprises -\begin{itemize} -\item a rigid foundation, -\item a rod of length $L$ hinged at the left-hand end and -\item a linear spring of stiffness $k$ attached to the rigid - foundation a distance $L$ from the hinge and to the free end of the rod. -\end{itemize} -The spring is unstretched when the rod makes an angle $\theta = \alpa -= \frac{pi}{3}$ with the foundation. - -Using elementary geometry, the effectice angular spring generates a -torque $\tau$ given by (\ref{eq:spring}) -\begin{equation}\label{eq:spring} - \tau = -2kl^2 \cos{\frac{\theta}{2}} (\sin{\frac{\theta}{2}}-\sin{\frac{\alpha}{2}}) -\end{equation} - -The acausal bond graph of system \textbf{NonlinearMSD} is also -displayed in Figure \Ref{fig:NonlinearMSD_abg.ps}. This shows the -three bond graph components representing the friction \textbf{R}, the -inertia \textbf{I} and the spring \textbf{C} components. The -non-linear spring characteristic is given explicitly\footnote{The - additional 0*eta term has no effect - it merely introduced the - variable $\eta$ -- the equilibrium angle -- into the model}. - -The (nonlinear) system ordinary differential equation is given by -\textbf{MTT} in Section \Ref{sec:NonlinearMSD_ode.tex}. This is a -special case of the general non-linear ordinary differential equation: -\begin{equation} - \label{eq:non-state} - \begin{cases} - \dot{x} = f(x,u)\\ - y = g(x,u) - \end{cases} -\end{equation} - -\subsection{Linearisation} -\label{sec:linearisation} - -The first step in linearisation is to determine a set of (constant) -states $x_e$ and (constant) inputs $u_e$ so that the system is in -equilibrium - that is -\begin{equation} - \label{eq:eqilibrium} - \dot{x} = f(x_e,u_e) = 0 -\end{equation} - -In this case, choosing an angle $\theta=\eta$ and an input: -\begin{equation}\label{eq:u_e} - u_e = -\tau = 2kl^2 \cos{\frac{\eta}{2}} (\sin{\frac{\eta}{2}}-\sin{\frac{\alpha}{2}}) -\end{equation} -together with zero velocity gives an equilibrium. - -With this choice -The linearised system is given in terms of the $A$, $B$, $C$ and $D$ -matrices appearing in the state equation: -\begin{equation} - \label{eq:state} - \begin{cases} - \dot{x} = Ax + Bu\\ - y = Cx + Du - \end{cases} -\end{equation} - -\textbf{MTT} automatically generates these matrices -- see Section -\Ref{sec:NonlinearMSD_sm.tex}. - -\subsection{Further work} -\label{sec:further} -\begin{enumerate} -\item Derive the system ordinary differential equation appearing in - Section \Ref{sec:NonlinearMSD_ode.tex}. -\item Explain how the input of (\ref{eq:u_e}) gives equilibrium for - all $\eta$. -\item Explain how the elements of the $A$, $B$, $C$ and $D$ appearing - Section \Ref{sec:NonlinearMSD_sm.tex} arise from the ordinary - differential equation of Section \Ref{sec:NonlinearMSD_ode.tex} - together with the input of (\ref{eq:u_e}). -\item Setting up parameters, inputs and initial state as in Sections - \Ref{sec:NonlinearMSD_numpar.tex}, \Ref{sec:NonlinearMSD_input.tex} - and \Ref{sec:NonlinearMSD_state.tex}, perform simulations as in - Section \Ref{sec:NonlinearMSD_state.tex} - the figure shows the - angular \emph{velocity} $\dot{\theta}$. -\item Repeat the simulation with different perturbations by modifying - the file ``NonlinearMSD\_input.tex'' (see Section - \Ref{sec:NonlinearMSD_input.tex}) - \begin{enumerate} - \item note that for smaller perturbations, the graphs are of similar - shape (scaled by the perturbation input) - \item note that for larger perturbations the graphs are quite - different - this is a non-linear system. - \end{enumerate} -\item \label{item:1} Repeat the simulation with different equilibrium angles $\eta$ by modifying - the file ``NonlinearMSD\_numpar.tex'' (see Section - \Ref{sec:NonlinearMSD_numpar.tex}) appropriately. Note that when - $\eta=\pi$, the linearised system is \emph{unstable}. -\item The (2,1) element of the $A$ matrix in Section - \Ref{sec:NonlinearMSD_sm.tex} is the \emph{linearised} stiffness - $k_l$. Plot this against $\eta$ and explain the observation in item - \ref{item:1}. -\end{enumerate} - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt @@ -1,11 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System NonlinearMSD, representation input, language txt; -## File NonlinearMSD_input.txt; -## Generated by MTT on Thu Mar 7 10:50:46 GMT 2002; - -## First term is the equilibrium input; last term is the perturbation input. - -nonlinearmsd__yu = k*(pow(l,2))*cos(eta/2)*2*(sin(eta/2)-sin(alpha/2)) + 1e-2; - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_numpar.txt @@ -1,15 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System NonlinearMSD, representation numpar, language txt; -## File NonlinearMSD_numpar.txt; -## Generated by MTT on Thu Mar 7 14:03:19 GMT 2002; - - - -alpha = pi/3; # Angle for unstretched string -eta = pi/3; # Equilibrium angle -j = 1.0; # Inertia -k = 1.0; # Spring constant -l = 1.0; # Rod length -r = 1.0; # Rotational resistance DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_rep.txt @@ -1,33 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system NonlinearMSD (NonlinearMSD_rep.txt) -## Generated by MTT on" Thu Mar 7 14:44:37 GMT 2002. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 11:58:07 peterg -## Put under RCS -## -############################################################### - -mtt NonlinearMSD abg tex # The system description -mtt NonlinearMSD sympar tex # The system parameters -## Uncomment the following lines or add others -## mtt NonlinearMSD dae tex # The system dae -mtt NonlinearMSD ode tex # The system ode -mtt NonlinearMSD sspar tex # Steady-state parameters -mtt NonlinearMSD ss tex # Steady state -## mtt NonlinearMSD dm tex # Descriptor matrices (of linearised system) -mtt NonlinearMSD sm tex # State matrices (of linearised system) -## mtt NonlinearMSD tf tex # Transfer function (of linearised system) -## mtt NonlinearMSD lmfr ps # log modulus of frequency response (of linearised system) -## mtt NonlinearMSD simpar tex # Simulation parameters -mtt NonlinearMSD numpar tex # Numerical simulation parameters -mtt NonlinearMSD state tex # Simulation initial state -mtt NonlinearMSD input tex # Simulation input -## mtt NonlinearMSD logic tex # Logic control -mtt NonlinearMSD odeso ps # Simulation output - -## mtt NonlinearMSD rep txt # This file DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_sspar.r @@ -1,25 +0,0 @@ -% Steady-state parameter file (NonlinearMSD_sspar.r) -% Generated by MTT at Thu Mar 7 10:39:15 GMT 2002 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 2000/12/28 09:32:04 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%% This one corresponds to the unstretched spring at theta = pi/3 -%% Note that U is calculated to give equilibrium for all angles - -alpha := pi/3; - -% Steady-state states -MTTX1 := eta; %Initial angle (corresponds to u=0) -MTTX2 := 0; %Initial anglular velocity -% Steady-state inputs -MTTU1 := k*(l^2)*cos(MTTX1/2)*2*(sin(MTTX1/2)-sin(alpha/2)); -;;END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_state.txt @@ -1,13 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System NonlinearMSD, representation state, language txt; -## File NonlinearMSD_state.txt; -## Generated by MTT on Thu Mar 7 10:50:45 GMT 2002; - - - -## Removed by MTT on Tue Jun 10 16:51:50 BST 2003: NonlinearMSD_j = 0.0; % Initial angular momentum -## Removed by MTT on Tue Jun 10 16:51:50 BST 2003: NonlinearMSD_k = eta; % Initial angle -nonlinearmsd__j = 0.0; # Added by MTT on Tue Jun 10 16:51:52 BST 2003 -nonlinearmsd__k = eta; # initial angle DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/plot_k.m @@ -1,18 +0,0 @@ -## Plots the effective spring constant. - -p = NonlinearMSD_numpar; # Numerical parameters -s = NonlinearMSD_sympar # Symbolic parameters - -Eta = eta=[0:0.01:1]*pi; K = []; -for eta=Eta - p(s.eta) = eta; # Change the eta parameter - A = NonlinearMSD_sm(p); # SS A matrix - k = -A(2,1); - K = [K k]; -endfor - -grid; -ylabel("k"); -xlabel("eta"); -plot(Eta,K); -figfig("k","eps"); DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_abg.fig @@ -1,51 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4050 2925 4050 1575 4275 1800 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 3150 5625 3150 5400 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4950 5625 4950 5400 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2475 3825 2475 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 3150 3825 3150 3600 3375 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 4950 2475 4950 2700 5175 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 2925 2870 1970 2870 2289 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4288 2957 5243 2002 5243 2320 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6525 3150 7875 3150 7650 3375 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 9900 5850 225 5850 225 900 9900 900 9900 5850 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 4050 3825 4050 3600 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4050 5625 4050 5400 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4275 3780 4275 4230 -4 1 1 101 0 3 20 0.0000 4 270 1215 4140 3600 x-velocity\001 -4 1 0 100 0 18 20 0.0000 4 210 165 4050 3240 1\001 -4 1 4 100 0 18 20 0.0000 4 285 1425 1710 3240 SS:[drive]\001 -4 1 1 101 0 3 20 0.0000 4 270 1200 4185 4500 y-velocity\001 -4 1 1 101 0 3 20 0.0000 4 270 2055 4050 5490 angular-velocity\001 -4 1 0 100 0 18 20 0.0000 4 210 165 4050 5040 1\001 -4 1 4 100 0 18 20 0.0000 4 285 870 6165 5040 SS:[a]\001 -4 2 0 100 0 18 20 0.0000 4 300 780 2430 5040 R:r_p\001 -4 1 0 100 0 18 20 0.0000 4 285 765 2835 1845 R:r_c\001 -4 1 4 100 0 18 20 0.0000 4 285 870 4050 1440 SS:[x]\001 -4 1 0 100 0 18 20 0.0000 4 285 795 5355 1845 I:m_c\001 -4 1 0 100 0 18 20 0.0000 4 225 660 6075 3240 INTF\001 -4 0 0 100 0 18 20 0.0000 4 225 1665 8010 3240 De:Position\001 -4 1 0 100 0 18 20 0.0000 4 210 165 4050 4140 1\001 -4 1 4 100 0 18 20 0.0000 4 285 870 6165 4140 SS:[y]\001 -4 2 0 100 0 18 20 0.0000 4 285 2310 2430 4140 Sf:zero_velocity\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/Cart_lbl.txt @@ -1,55 +0,0 @@ -%% Label file for system Cart (Cart_lbl.txt) -%SUMMARY Cart -%DESCRIPTION Simple cart model - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 18:00:45 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in drive -%ALIAS pendulum|out x,y,a -%UNITS drive translational N m/s -b%UNITS x translational N m/s -%UNITS y translational N m/s -%UNITS a rotational N*m radian/s - - -% Argument aliases -%ALIAS $1 m_c - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type I - m_c lin flow,m_c - -% Component type R - r_c lin flow,r_c - r_p lin flow,r_p - -% Component type SS - [a] SS external,external - [drive] SS external,external - [x] SS external,external - [y] SS external,external - -% Component type De - Position SS external - -% Component type Sf - zero_velocity SS 0 - - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_abg.fig @@ -1,28 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3780 4005 3870 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 3825 4050 3825 4500 --6 -1 4 0 2 1 7 51 0 -1 0.000 1 0.0000 3700 4909 203 203 3497 4909 3903 4909 -1 4 0 2 1 7 51 0 -1 0.000 1 0.0000 4817 4902 203 203 4614 4902 5020 4902 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 2475 4275 3825 4275 3600 4500 -2 4 0 2 1 7 101 0 -1 0.000 0 0 7 0 0 5 - 5175 4725 3375 4725 3375 3825 5175 3825 5175 4725 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4275 4050 5230 3095 5230 3414 -2 1 0 2 1 7 101 0 -1 0.000 0 0 -1 0 0 5 - 4477 3712 5872 2317 6052 2497 4702 3847 4522 3667 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 6750 5400 1125 5400 1125 2025 6750 2025 6750 5400 -4 1 0 100 0 18 20 0.0000 4 210 570 4275 4365 Cart\001 -4 1 0 100 0 18 20 0.0000 4 270 840 2070 4365 SS:[F]\001 -4 1 0 100 0 18 20 0.0000 4 210 2445 5355 3060 InvertedPendulum\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_desc.tex @@ -1,21 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system InvertedPendulumOnCart (InvertedPendulumOnCart_desc.tex) -% Generated by MTT on Thu Aug 5 10:38:16 BST 1999. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{InvertedPendulumOnCart} is - displayed in Figure \Ref{fig:InvertedPendulumOnCart_abg.ps} and its label - file is listed in Section \Ref{sec:InvertedPendulumOnCart_lbl}. - The subsystems are listed in Section \Ref{sec:InvertedPendulumOnCart_sub}. - -This is a one input, two output nonlinear system comprising an -inverted pendulum attached by a hinge to a cart constrained to move in -the horizontal direction. The input is the horizontal force acting on -the cart, and the two outputs are the horizontal position and the -pendulum angle respectively. DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_input.txt @@ -1,10 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode ## - -## -## System InvertedPendulumOnCart, representation input, language txt; -## File idInvertedPendulumOnCart_input.txt; -## Generated by MTT on Thu Apr 5 15:27:30 BST 2001; - - - -InvertedPendulumOnCart_f = 1.0*(t<1); # Force for 1 sec DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_lbl.txt @@ -1,34 +0,0 @@ -%% Label file for system InvertedPendulumOnCart (InvertedPendulumOnCart_lbl.txt) -%SUMMARY InvertedPendulumOnCart -%DESCRIPTION An Inverted Pendulum on a Cart - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 18:00:45 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in F -%UNITS F translational N m/s - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type SS - [F] SS external,internal - - - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_numpar.txt @@ -1,27 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (InvertedPendulumOnCart_numpar.txt) -# Generated by MTT at Thu Aug 5 10:07:08 BST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: e_s = 1.0; # Se -## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: f_s = 1.0; # Sf -g = 1.0; # Pendulum,gRODa -## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: j_m = 1.0; # gRODa -j_r = 1.0; # Pendulum -l = 1.0; # Pendulum -## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: l_a = 1.0; # gRODa -## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: ## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: l_b = 1.0; # gRODa -## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: m = 1.0; # gRODa -## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: m_c = 1.0; # Cart -## Removed by MTT on Thu Nov 9 17:21:31 GMT 2000: m_r = 1.0; # Pendulum -r_c = 0.1; # Cart -r_p = 0.1; # Cart -m_c = 1.0; # Added by MTT on Thu Nov 09 17:22:55 GMT 2000 -m_r = 1.0; # Added by MTT on Thu Nov 09 17:22:55 GMT 2000 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_rep.txt @@ -1,30 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system InvertedPendulumOnCart (InvertedPendulumOnCart_rep.txt) -## Generated by MTT on" Fri Oct 22 09:03:14 EST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 18:00:45 peterg -## To RCS -## -############################################################### - -mtt InvertedPendulumOnCart abg tex # The system description -mtt InvertedPendulumOnCart cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt InvertedPendulumOnCart struc tex # The system structure -mtt InvertedPendulumOnCart dae tex # The system dae -## mtt InvertedPendulumOnCart ode tex # The system ode -## mtt InvertedPendulumOnCart sspar tex # Steady-state parameters -## mtt InvertedPendulumOnCart ss tex # Steady state -## mtt InvertedPendulumOnCart dm tex # Descriptor matrices (of linearised system) -## mtt InvertedPendulumOnCart dm tex # State matrices (of linearised system) -## mtt InvertedPendulumOnCart tf tex # Transfer function (of linearised system) -## mtt InvertedPendulumOnCart lmfr ps # log modulus of frequency response (of linearised system) -## mtt InvertedPendulumOnCart simpar tex # Simulation parameters -## mtt InvertedPendulumOnCart numpar tex # Numerical simulation parameters -## mtt InvertedPendulumOnCart input tex # Simulation input -## mtt InvertedPendulumOnCart odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system InvertedPendulumOnCart (InvertedPendulumOnCart_simpar.txt) -# Generated by MTT on Thu Aug 5 09:17:05 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 100.0; # Last time in simulation -DT = 0.1; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_subs.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_subs.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_subs.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulumOnCart_subs.r @@ -1,27 +0,0 @@ -% Default SUBS file -% File InvertedPendulumOnCart_subs.r -% Generated by MTT on Thu Nov 9 18:55:44 GMT 2000. - - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2001/04/02 10:57:57 gawthrop -% %% Added missing ; -% %% -% %% Revision 1.1 2000/12/28 18:00:45 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Put algebraic substitution commands here - -for all x let cos(x)^2+sin(x)^2 = 1; - -FOR ALL x,y LET x^y = pow(x,y); % Use the pow function - -ON ROUNDED; % No integer output - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_abg.fig @@ -1,50 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 3780 3105 6345 4545 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 3150 4950 4500 5175 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 3150 6075 4500 6300 4275 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 3150 3825 4500 4050 4275 --6 -6 3780 5355 6345 6795 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 4950 5400 4950 6750 5175 6525 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6075 5400 6075 6750 6300 6525 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3825 5400 3825 6750 4050 6525 --6 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 6840 4950 8190 4950 7965 5175 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 9675 7425 3150 7425 3150 2475 9675 2475 9675 7425 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 4050 6750 3600 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5175 6750 4725 6750 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 6300 5400 5850 5400 -4 1 4 100 0 18 20 0.0000 4 285 870 3825 7065 SS:[x]\001 -4 1 4 100 0 18 20 0.0000 4 285 870 4950 7065 SS:[y]\001 -4 1 4 100 0 18 20 0.0000 4 285 870 6075 7065 SS:[a]\001 -4 1 0 100 0 18 20 0.0000 4 285 1590 4964 5040 gRODa:rod\001 -4 1 0 100 0 18 20 0.0000 4 285 960 3825 3015 Se:x_0\001 -4 1 0 100 0 18 20 0.0000 4 285 960 4950 3015 Se:y_0\001 -4 1 0 100 0 18 20 0.0000 4 285 960 6030 3015 Se:a_0\001 -4 1 4 100 0 18 14 0.0000 4 195 270 6660 4995 [a]\001 -4 1 0 100 0 18 20 0.0000 4 225 1200 8865 5040 De:theta\001 -4 1 4 100 0 18 14 0.0000 4 195 510 3825 4725 [x_a]\001 -4 1 4 100 0 18 14 0.0000 4 195 510 4950 4725 [y_a]\001 -4 1 4 100 0 18 14 0.0000 4 195 510 6075 4725 [a_a]\001 -4 1 4 100 0 18 14 0.0000 4 195 525 3825 5265 [x_b]\001 -4 1 4 100 0 18 14 0.0000 4 195 525 4950 5265 [y_b]\001 -4 1 4 100 0 18 14 0.0000 4 195 525 6075 5265 [a_b]\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/InvertedPendulumOnCart/InvertedPendulum_lbl.txt @@ -1,49 +0,0 @@ -%% Label file for system InvertedPendulum (InvertedPendulum_lbl.txt) -%SUMMARY InvertedPendulum -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 18:00:45 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%UNITS x translational N m/s -%UNITS y translational N m/s -%UNITS a rotational N*m radian/s - - -%ALIAS in|cart x,y,a - - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type De - theta SS external - -% Component type SS - [a] SS external,external - [x] SS external,external - [y] SS external,external - -% Component type Se - a_0 SS 0 - x_0 SS 0 - y_0 SS 0 - -% Component type gRod - rod none l;l;j_r;m_r;g - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_abg.fig @@ -1,51 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3017 1577 3287 1577 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5269 1579 5539 1579 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 1577 3152 3152 3377 2927 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4142 3152 4412 3152 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4277 1577 4277 3152 4502 2927 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5402 1577 5402 3152 5627 2927 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3019 4279 3289 4279 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4144 4279 4414 4279 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5271 4281 5541 4281 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4277 4277 4277 5852 4502 5627 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5402 4277 5402 5852 5627 5627 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 7200 2250 7200 675 1575 675 1575 2250 7200 2250 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 7200 4500 7200 2925 1575 2925 1575 4500 7200 4500 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 7200 6750 7200 5175 1575 5175 1575 6750 7200 6750 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3150 4299 3150 5874 3375 5649 -4 1 -1 0 0 0 20 0.0000000 4 240 870 3152 1397 SS:v_x\001 -4 1 -1 0 0 0 20 0.0000000 4 240 810 4277 1397 SS:f_a\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1110 4278 3828 ROD:rod\001 -4 1 -1 0 0 0 20 0.0000000 4 240 885 3155 6305 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000000 4 240 870 4280 6305 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000000 4 270 885 5450 6305 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000000 4 270 1920 5986 1396 ACCEL:gravity\001 -4 1 1 1 0 3 20 0.0000000 4 240 1245 7965 1440 Fixed end\001 -4 1 1 1 0 3 20 0.0000000 4 240 1110 7920 6075 Free end\001 -4 1 1 1 0 3 20 0.0000000 4 270 1755 8280 3735 Rod dynamics\001 -4 1 4 0 0 0 16 0.0000000 4 195 495 3152 3467 [x_a]\001 -4 1 4 0 0 0 16 0.0000000 4 210 885 4277 3467 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000000 4 210 495 5402 3467 [y_a]\001 -4 1 4 0 0 0 16 0.0000000 4 195 510 3154 4144 [x_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 900 4280 4145 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 510 5406 4146 [y_b]\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_desc.tex @@ -1,25 +0,0 @@ -% Verbal description for system Pendulum (Pendulum_desc.tex) -% Generated by MTT on Fri Aug 15 09:52:55 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Pendulum} is - displayed in Figure \Ref{Pendulum_abg} and its label - file is listed in Section \Ref{sec:Pendulum_lbl}. - The subsystems are listed in Section \Ref{sec:Pendulum_sub}. - -This is a heirachical version of the example from Section 10.3 of -``Metamodelling''. It uses two compound components: {\bf ROD} and {\bf -GRAV}. {\bf ROD} is -essentially as described in Figure 10.2 {\bf GRAV} represents gravity by a -vertical accelleration as in Section 10.9 of "Metamodelling". - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_input.txt @@ -1,22 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode' -# Numerical parameter file (Pendulum_input.txt) -# Generated by MTT at Fri Aug 15 09:02:02 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.2 1998/07/27 11:27:05 peterg -# %% Reformatted -# %% -# Revision 1.1 1997/08/15 08:04:01 peterg -# Initial revision -# -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Tue Jun 10 17:17:50 BST 2003: u(1) = 0.0; # no torque at joint -## Removed by MTT on Tue Jun 10 17:17:50 BST 2003: u(2) = 9.81; # g -pendulum__f_a = 0.0; # No joint torque -pendulum__gravity__force = 9.81; # g DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_lbl.txt @@ -1,50 +0,0 @@ -%SUMMARY Pendulum: Pendulum example from Section 10.3 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.3 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling". - -%ALIAS ACCEL Mechanical-2D/ACCEL # Constant acceleration -%% Label file for system pend (pend_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1997/08/15 09:46:22 peterg -% %% New labeled ports version -% %% -% Revision 1.1 1996/11/09 18:44:58 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters -rod none l;l;j;m - -%Zero velocity sources -v_x SS internal,0 - -%Zero force/torque sources -F_x SS 0,internal -F_y SS 0,internal -F_a SS 0,internal - -%Torque at end -f_a SS external,external - -%Gravity -gravity - - - - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_numpar.txt @@ -1,15 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (Pendulum_numpar.txt) -# Generated by MTT at Mon Jul 27 12:38:25 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -l = 1.0; # Pendulum -m = 1.0; # Pendulum -j = m*l*l/12.0; # Pendulum DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_rep.txt @@ -1,24 +0,0 @@ -# Outline report file for system Pendulum (Pendulum_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/05/19 17:34:30 peterg -% %% Put in -c -% %% -% %% Revision 1.1 1999/02/22 09:17:59 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt Pendulum abg tex -mtt Pendulum struc tex -mtt Pendulum dae tex -mtt Pendulum cse tex -## mtt Pendulum rfe tex -mtt Pendulum ode tex -mtt Pendulum input txt -mtt Pendulum numpar txt -mtt Pendulum odeso ps DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_simpar.txt @@ -1,23 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system Pendulum (Pendulum_simpar.txt) -# Generated by MTT on Mon Jul 27 12:27:43 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1999/12/23 20:16:47 peterg -## Removed MTHOD -## -## Revision 1.2 1999/02/22 10:08:05 peterg -## -## -## Revision 1.1 1998/07/27 11:29:13 peterg -## Initial revision -## -############################################################### - - -LAST=10.0; # Last time in simulation -DT=0.1; # Print interval -STEPFACTOR=10; # Integration steps per print interval DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_state.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_state.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_state.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_state.txt @@ -1,21 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Initial state file (Pendulum_state.txt) -# Generated by MTT at Mon Jul 27 12:34:12 BST 1998 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/07/27 11:41:39 peterg -## Initial revision -## -############################################################### - -# Set the states -## Removed by MTT on Tue Jun 10 17:16:38 BST 2003: mttx(1) = 0.0; # J (Pendulum_rod) -## Removed by MTT on Tue Jun 10 17:16:38 BST 2003: mttx(2) = pi/4; # 3 (Pendulum_rod_th) -## Removed by MTT on Tue Jun 10 17:16:38 BST 2003: mttx(3) = 0.0; # 2 (Pendulum_gravity) -pendulum__gravity__mtti = 0.0; -pendulum__rod__j = 0.0; -pendulum__rod__th__mttc = pi/4; - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_subs.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_subs.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_subs.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/Pendulum/Pendulum_subs.r @@ -1,17 +0,0 @@ -%% Reduce comands to sunstitute in system Pendulum (Pendulum_subs.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_abg.fig @@ -1,88 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.0000000 1 0.000 8550 1125 485 485 8550 1125 8730 1575 -1 3 0 2 1 7 1 0 -1 0.0000000 1 0.000 8550 5625 485 485 8550 5625 9035 6110 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3468 1128 3738 1128 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4593 2703 4863 2703 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 1128 4728 2703 4953 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4502 5492 4502 5762 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5627 4502 5627 4277 5852 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 7426 4951 7201 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3472 8647 3742 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4597 8647 4867 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5724 8649 5994 8649 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4730 8645 4730 10220 4955 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5855 8645 5855 10220 6080 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3826 3601 7426 3826 7201 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3826 5851 7426 6076 7201 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 11475 9450 225 180 225 180 11475 9450 11475 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 8622 3600 10197 3825 9972 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 7650 450 9405 450 9405 675 7650 675 7650 450 -4 1 -1 0 0 0 20 0.0000000 4 240 870 3603 948 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000000 4 210 150 4683 5718 0\001 -4 1 -1 0 0 0 20 0.0000000 4 240 960 2432 5717 SS:f_a2\001 -4 1 -1 0 0 0 20 0.0000000 4 240 885 3608 10673 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000000 4 240 870 4733 10673 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000000 4 270 885 5903 10673 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1260 4729 3379 ROD:rod1\001 -4 1 -1 0 0 0 20 0.0000000 4 210 1260 4731 8196 ROD:rod2\001 -4 1 -1 0 0 0 20 0.0000000 4 240 960 4771 946 SS:f_a1\001 -4 0 1 1 0 3 20 0.0000000 4 240 810 6795 3375 Link 1\001 -4 0 1 1 0 3 20 0.0000000 4 240 870 6750 5760 Joint 2\001 -4 0 1 1 0 3 20 0.0000000 4 240 810 6750 8190 Link 2\001 -4 0 1 1 0 3 20 0.0000000 4 270 420 6750 10485 Tip\001 -4 0 1 1 0 3 20 0.0000000 4 240 870 6750 1260 Joint 1\001 -4 1 4 0 0 0 16 0.0000000 4 195 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000000 4 210 885 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000000 4 195 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 900 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 495 5850 2970 [y_a]\001 -4 1 4 0 0 0 16 0.0000000 4 195 495 3605 7835 [x_a]\001 -4 1 4 0 0 0 16 0.0000000 4 210 885 4730 7835 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000000 4 210 495 5855 7835 [y_a]\001 -4 1 4 0 0 0 16 0.0000000 4 195 510 3607 8512 [x_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 900 4733 8513 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000000 4 210 510 5859 8514 [y_b]\001 -4 1 -1 0 0 0 20 0.0000000 4 270 870 5850 945 SS:v_y\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_desc.tex @@ -1,42 +0,0 @@ -% Verbal description for system TwoLink (TwoLink_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/19 14:20:07 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLink} is - displayed in Figure \Ref{TwoLink_abg} and its label - file is listed in Section \Ref{sec:TwoLink_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLink_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses the compound components: {\bf ROD}. {\bf -ROD} is essentially as described in Figure 10.2. -There is no gravity included in this model. - -This system has a number of dynamic elements (those corresponding to -translation motion) in derivative causality, thus the system is -represnted as a Differential-Algebraic Equation (Section -\Ref{sec:TwoLink_dae.tex}). Hovever, this is of contrained-state form -and therfore can be written as a set of constrained-state equations -(Section \Ref{sec:TwoLink_cse.tex}). The corresponding ordinary -differential equation is complicated due to the trig functions -involved in inverting the E matrix. - -As well as the standard representation the ``robot-form'' equations -appear in Section \Ref{sec:TwoLink_rfe}. - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_input.txt @@ -1,20 +0,0 @@ -# Numerical parameter file (TwoLink_input.txt) -# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 1998/07/27 10:44:59 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Tue Jun 10 17:24:08 BST 2003: u(1) = (t<1.0); # Torque on Joint 1 -## Removed by MTT on Tue Jun 10 17:24:08 BST 2003: u(2) = -(t>10.0)&&(t<11.0); # Torque on Joint 2 -## Removed by MTT on Tue Jun 10 17:24:08 BST 2003: u(3) = 0.0; # Gravity -twolink__f_a1 = (t<1.0); # Torque on Joint 1 -twolink__f_a2 = -(t>10.0)&&(t<11.0); # Torque on Joint 2 - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_lbl.txt @@ -1,55 +0,0 @@ -%SUMMARY TwoLink: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (TwoLink_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/07/27 10:45:22 peterg -% %% Initial revision -% %% -% %% Revision 1.2 1996/12/05 12:39:49 peterg -% %% Documentation -% %% -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - uniform rods -rod1 none l_1;l_1;j_1;m_1 -rod2 none l_2;l_2;j_2;m_2 - -%Zero velocity sources -v_x SS internal,0 -v_y SS internal,0 - - -%Zero force/torque sources -F_x SS 0,internal -F_a SS 0,internal -F_y SS 0,internal - - -%Torque/velocity at joints -f_a1 SS external,external -f_a2 SS external,external - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_numpar.txt @@ -1,18 +0,0 @@ -# Numerical parameter file (TwoLink_numpar.txt) -# Generated by MTT at Mon Jan 19 13:53:15 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -j_1 = 1.0; # Parameter j_1 for TwoLink -j_2 = 1.0; # Parameter j_2 for TwoLink -l_1 = 1.0; # Parameter l_1 for TwoLink -l_2 = 1.0; # Parameter l_2 for TwoLink -m_1 = 1.0; # Parameter m_1 for TwoLink -m_2 = 1.0; # Parameter m_2 for TwoLink - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_rep.txt @@ -1,32 +0,0 @@ -# Outline report file for system TwoLink (TwoLink_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.4 2000/05/19 17:35:34 peterg -% %% -c -% %% -% %% Revision 1.3 1999/02/22 09:18:33 peterg -% %% Removed -c -% %% -% %% Revision 1.2 1998/01/19 14:21:21 peterg -% %% Removed ordinary differential equation representation - its to -% %% verbose. -% %% -% %% Revision 1.1 1998/01/19 14:15:52 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt TwoLink abg tex -mtt TwoLink struc tex -mtt TwoLink sympar tex -mtt TwoLink dae tex -mtt TwoLink cse tex -## mtt TwoLink rfe tex - -mtt TwoLink input txt -mtt TwoLink numpar txt -mtt -i euler TwoLink odeso ps DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simp.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simp.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simp.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simp.r @@ -1,11 +0,0 @@ -%% Reduce comands to simplify output for system TwoLink (TwoLink_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_simpar.txt @@ -1,24 +0,0 @@ -# Simulation parameters for system TwoLink (TwoLink_simpar.txt) -# Generated by MTT on Mon Jul 27 08:16:50 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ - -## Revision 1.3 1999/02/22 10:07:24 peterg -## Step facttor 10 -## -## Revision 1.2 1999/02/22 10:06:13 peterg -## -## Revision 1.1 1998/07/27 10:46:30 peterg -## Initial revision -## -############################################################### - - -LAST=50.0; -DT=0.1; -STEPFACTOR=10; - - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_subs.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_subs.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_subs.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/TwoLink_subs.r @@ -1,20 +0,0 @@ -%% Reduce substitution statements for system TwoLink (TwoLink_subs.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/03/22 20:12:51 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_desc.tex @@ -1,25 +0,0 @@ -% Verbal description for system twolink (twolink_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{twolink} is - displayed in Figure \Ref{twolink_abg} and its label - file is listed in Section \Ref{sec:twolink_lbl}. - The subsystems are listed in Section \Ref{sec:twolink_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses two compound components: {\bf ROD} and {\bf -GRAV}. {\bf ROD} is essentially as described in Figure 10.2 {\bf -GRAV} represents gravity by a vertical accelleration as in Section -10.9 of "Metamodelling" - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_lbl.txt @@ -1,50 +0,0 @@ -%SUMMARY twolink: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (twolink_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - identical rods -rod1 none l;l;j;m -rod2 none l;l;j;m - -%Zero velocity sources -v_x internal 0 - - -%Zero force/torque sources -F_x 0 internal -F_a 0 internal -F_y 0 internal - - -%Torque at joints -f_a1 external external -f_a2 external external - - -%Gravity -g DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_params.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_params.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_params.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_params.r @@ -1,24 +0,0 @@ -%% Parameter file for system twolink (twolink_params.r) -%% This file provides symbolic parameters for simplification - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Useful trig simplifications - - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -% Some simplifications -- see book -j := m*l*l/3; - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_rep.txt @@ -1,19 +0,0 @@ -%% Outline report file for system twolink (twolink_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -abg tex -struc tex -dae tex -csm tex -sro ps -lmfr ps -odeso ps -input txt -numpar txt - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_simp.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_simp.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_simp.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLink/twolink_simp.r @@ -1,14 +0,0 @@ -%% Reduce comands to simplify output for system twolink (twolink_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%simplify the output equations -% Joint angles -mttx2 := theta_1; -mttx4 := theta_1 + theta_2; -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_abg.fig @@ -1,86 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3468 1128 3738 1128 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4593 2703 4863 2703 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 1128 4728 2703 4953 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4502 5492 4502 5762 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5627 4502 5627 4277 5852 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 7426 4951 7201 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3472 8647 3742 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4597 8647 4867 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5724 8649 5994 8649 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4730 8645 4730 10220 4955 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5855 8645 5855 10220 6080 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3826 3601 7426 3826 7201 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3826 5851 7426 6076 7201 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 11475 9450 225 180 225 180 11475 9450 11475 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 8622 3600 10197 3825 9972 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 -4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 900 2432 5717 SS:f_a2\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000 4 195 1200 4729 3379 ROD:rod1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1200 4731 8196 ROD:rod2\001 -4 1 -1 0 0 0 20 0.0000 4 255 900 4771 946 SS:f_a1\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 -4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 1170 5850 945 ACCEL:g\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_desc.tex @@ -1,31 +0,0 @@ -% Verbal description for system TwoLinkxyc (TwoLinkxyc_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLinkxyc} is - displayed in Figure \Ref{TwoLinkxyc_abg} and its label - file is listed in Section \Ref{sec:TwoLinkxyc_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLinkxyc_sub}. - -This system is identical to \textbf{twolink} except that the two -colocated {\bf SS} components act at the tip in the $x$ and $y$ -directions instead of at the two joints. - -It uses two compound components: {\bf ROD} and {\bf GRAV}. {\bf ROD} -is essentially as described in Figure 10.2 of "Metamodelling" and {\bf -GRAV} represents gravity by a vertical acceleration as in Section -10.9 of "Metamodelling" - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_input.txt @@ -1,20 +0,0 @@ -# Numerical parameter file (TwoLinkxyc_input.txt) -# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:02:44 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Wed Jun 11 14:02:21 BST 2003: u(1) = (t<1.0); -## Removed by MTT on Wed Jun 11 14:02:21 BST 2003: u(2) = 0.0; # -## Removed by MTT on Wed Jun 11 14:02:21 BST 2003: u(3) = 0.0; # gravity -twolinkxyc__f_x = (t<1.0); -twolinkxyc__f_y = 0.0; -twolinkxyc__g__force = 0.0; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_lbl.txt @@ -1,51 +0,0 @@ -%SUMMARY TwoLinkxyc: two-link manipulator with collocated tip source-sensors. -%DESCRIPTION This is related to a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" -%DESCRIPTION except that the collocated source-sensors act at the -%DESCRIPTION tip rather than at the joints. - -%% Label (TwoLinkxyc_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/06 15:56:31 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - identical rods -rod1 none l;l;j;m;mg -rod2 none l;l;j;m;mg - -%Zero velocity sources -v_x SS internal,0 - - -%Zero force/torque sources -F_a SS 0,internal - - -%Torque at joints -f_a1 SS 0,internal -f_a2 SS 0,internal - -%Forces at tip -F_x SS external,external -F_y SS external,external - - -%Gravity -g - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_numpar.txt @@ -1,21 +0,0 @@ -# Numerical parameter file (TwoLinkxyc_numpar.txt) -# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.2 2000/05/20 15:44:26 peterg -# %% Split from old numpar file -# %% -# %% Revision 1.1 2000/05/20 15:43:27 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -l = 1.0; # Default value -m = 1.0; # Default value -j = m*l*l/12.0; # Uniform rod -mg = m*9.81; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_rep.txt @@ -1,19 +0,0 @@ -# Outline report file for system TwoLinkxyc (TwoLinkxyc_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 18:02:44 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt TwoLinkxyc abg tex -mtt TwoLinkxyc struc tex -mtt TwoLinkxyc dae tex -mtt TwoLinkxyc cse tex -mtt TwoLinkxyc input txt -mtt TwoLinkxyc numpar txt -mtt -i euler TwoLinkxyc odeso ps DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simp.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simp.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simp.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simp.r @@ -1,17 +0,0 @@ -%% Reduce comands to simplify output for system TwoLinkxyc (TwoLinkxyc_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_simpar.txt @@ -1,21 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system TwoLinkxyc (TwoLinkxyc_simpar.txt) -# Generated by MTT on Mon Feb 22 09:44:37 GMT 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1999/02/22 10:09:34 peterg -## Initial revision -## -############################################################### - - -LAST = 10.0; # Last time in simulation -DT = 0.1; # Print interval -STEPFACTOR = 10; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_sspar.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_sspar.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_sspar.r @@ -1,10 +0,0 @@ -%% Reduce steady-state parameter file for TwoLinkxyc (TwoLinkxyc_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_state.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_state.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_state.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyc/TwoLinkxyc_state.txt @@ -1,24 +0,0 @@ -# State initialisation file file (TwoLinkxyc_numpar.txt) -# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/05/20 15:44:48 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Initial states -## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(1) = 0.0; # Initial state for TwoLinkxyc_rod1 (J) -## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(2) = 0.0; # Initial state for TwoLinkxyc_rod1_th (3) -## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(3) = 0.0; # Initial state for TwoLinkxyc_rod2 (J) -## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(4) = 3.142/4; # Initial state for TwoLinkxyc_rod2_th (3) - 45 deg. -## Removed by MTT on Wed Jun 11 14:05:13 BST 2003: x(5) = 0.0; # Initial state for TwoLinkxyc_g (2) -twolinkxyc__g__mtti = 0.0; -twolinkxyc__rod1__j = 0.0; -twolinkxyc__rod1__th__mttc = 0.0; -twolinkxyc__rod2__j = 0.0; -twolinkxyc__rod2__th__mttc = 3.142/4; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_abg.fig @@ -1,86 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3468 1128 3738 1128 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4593 2703 4863 2703 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 1128 4728 2703 4953 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4502 5492 4502 5762 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5627 4502 5627 4277 5852 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 7426 4951 7201 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3472 8647 3742 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4597 8647 4867 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5724 8649 5994 8649 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4730 8645 4730 10220 4955 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5855 8645 5855 10220 6080 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3826 3601 7426 3826 7201 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3826 5851 7426 6076 7201 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 11475 9450 225 180 225 180 11475 9450 11475 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 8622 3600 10197 3825 9972 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 -4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 900 2432 5717 SS:f_a2\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000 4 195 1200 4729 3379 ROD:rod1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1200 4731 8196 ROD:rod2\001 -4 1 -1 0 0 0 20 0.0000 4 255 900 4771 946 SS:f_a1\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 -4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 1170 5850 945 ACCEL:g\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_desc.tex @@ -1,31 +0,0 @@ -% Verbal description for system TwoLinkxyn (TwoLinkxyn_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1998/01/06 17:36:33 peterg -% Initial revision -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TwoLinkxyn} is - displayed in Figure \Ref{TwoLinkxyn_abg} and its label - file is listed in Section \Ref{sec:TwoLinkxyn_lbl}. - The subsystems are listed in Section \Ref{sec:TwoLinkxyn_sub}. - -This system is identical to \textbf{twolink} except that there are -now two non-collocated input-output pairs: The torque input to joint 1 --- x velocity of the tip and the torque input to joint 2 --- y velocity of the tip. - -It uses two compound components: {\bf ROD} and {\bf GRAV}. {\bf ROD} -is essentially as described in Figure 10.2 of "Metamodelling" and {\bf -GRAV} represents gravity by a vertical acceleration as in Section -10.9 of "Metamodelling" - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_input.txt @@ -1,20 +0,0 @@ -# Numerical parameter file (TwoLinkxyn_input.txt) -# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:03:12 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Wed Jun 11 14:14:40 BST 2003: u(1) = (t<1.0); -## Removed by MTT on Wed Jun 11 14:14:40 BST 2003: u(2) = 0.0; # -## Removed by MTT on Wed Jun 11 14:14:40 BST 2003: u(3) = 0.0; # gravity -twolinkxyn__f_a1 = (t<1.0); -twolinkxyn__f_a2 = 0.0; -twolinkxyn__g__force = 0.0; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_lbl.txt @@ -1,51 +0,0 @@ -%SUMMARY TwoLinkxyn: two-link manipulator with collocated tip source-sensors. -%DESCRIPTION This is related to a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" -%DESCRIPTION except that the source sensors are not collocated: -%DESCRIPTION sources at the joints, sensors at the xy motion of the tip. - -%% Label (TwoLinkxyn_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/06 17:37:55 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - identical rods -rod1 none l;l;j;m;mg -rod2 none l;l;j;m;mg - -%Zero velocity sources -v_x SS internal,0 - - -%Zero force/torque sources -F_a SS 0,internal - - -%Torque at joints -f_a1 SS external,internal -f_a2 SS external,internal - -%Forces at tip -F_x SS 0,external -F_y SS 0,external - - -%Gravity -g - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_numpar.txt @@ -1,19 +0,0 @@ -# Numerical parameter file (TwoLinkxyn_numpar.txt) -# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/05/20 15:50:31 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -l = 1.0; # Default value -m = 1.0; # Default value -j = m*l*l/12.0; # Uniform rod -mg = m*9.81; - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_rep.txt @@ -1,24 +0,0 @@ -# Outline report file for system TwoLinkxyn (TwoLinkxyn_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/05/19 17:36:55 peterg -% %% -c -% %% -% %% Revision 1.1 1999/02/22 10:01:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt TwoLinkxyn abg tex -mtt TwoLinkxyn struc tex -mtt TwoLinkxyn dae tex -mtt TwoLinkxyn cse tex -##mtt TwoLinkxyn rfe tex -##mtt TwoLinkxyn ode tex -mtt TwoLinkxyn input txt -mtt TwoLinkxyn numpar txt -mtt -i euler TwoLinkxyn odeso ps DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simp.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simp.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simp.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simp.r @@ -1,17 +0,0 @@ -%% Reduce comands to simplify output for system TwoLinkxyn (TwoLinkxyn_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system TwoLinkxyn (TwoLinkxyn_simpar.txt) -# Generated by MTT on Mon Feb 22 09:53:04 GMT 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 10.0; # Last time in simulation -DT = 0.1; # Print interval -STEPFACTOR = 10; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_sspar.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_sspar.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_sspar.r @@ -1,10 +0,0 @@ -%% Reduce steady-state parameter file for TwoLinkxyn (TwoLinkxyn_sspar.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_state.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_state.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_state.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/TwoLinkxyn/TwoLinkxyn_state.txt @@ -1,25 +0,0 @@ -# State file (TwoLinkxyn_state.txt) -# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/05/20 15:50:57 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Initial states -## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(1) = 0.0; # Initial state for TwoLinkxyn_rod1 (J) -## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(2) = 0.0; # Initial state for TwoLinkxyn_rod1_th (3) -## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(3) = 0.0; # Initial state for TwoLinkxyn_rod2 (J) -## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(4) = 3.142/4; # Initial state for TwoLinkxyn_rod2_th (3) - 45 deg. -## Removed by MTT on Wed Jun 11 14:15:48 BST 2003: x(5) = 0.0; # Initial state for TwoLinkxyn_g (2) -twolinkxyn__g__mtti = 0.0; -twolinkxyn__rod1__j = 0.0; -twolinkxyn__rod1__th__mttc = 0.0; -twolinkxyn__rod2__j = 0.0; -twolinkxyn__rod2__th__mttc = 3.142/4; - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_abg.fig Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_abg.fig +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_abg.fig @@ -1,86 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 1125 485 485 8550 1125 8730 1575 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 8550 5625 485 485 8550 5625 9035 6110 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3468 1128 3738 1128 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5720 1130 5990 1130 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4593 2703 4863 2703 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4728 1128 4728 2703 4953 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4502 5492 4502 5762 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2927 5627 4502 5627 4277 5852 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 5851 4726 7426 4951 7201 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3472 8647 3742 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4597 8647 4867 8647 -2 1 0 1 25 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5724 8649 5994 8649 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4730 8645 4730 10220 4955 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5855 8645 5855 10220 6080 9995 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3601 3826 3601 7426 3826 7201 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5851 3826 5851 7426 6076 7201 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 8775 6525 7200 2925 7200 2925 8775 6525 8775 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 2025 6525 450 2925 450 2925 2025 6525 2025 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 6435 6525 4860 2925 4860 2925 6435 6525 6435 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 11250 6525 9675 2925 9675 2925 11250 6525 11250 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 11475 9450 225 180 225 180 11475 9450 11475 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3603 1128 3603 2703 3828 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5853 1128 5853 2703 6078 2478 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4726 3826 4726 5401 4951 5176 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 6525 4050 2925 4050 2925 2475 6525 2475 6525 4050 -2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 8622 3600 10197 3825 9972 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 5175 8775 1575 8325 1575 8325 5175 8775 5175 -2 4 0 2 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 8775 9675 8775 6075 8325 6075 8325 9675 8775 9675 -4 1 -1 0 0 0 20 0.0000 4 255 810 3603 948 SS:v_x\001 -4 0 -1 0 0 0 20 0.0000 4 195 135 4683 5718 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 900 2432 5717 SS:f_a2\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 3608 10673 SS:F_x\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 4733 10673 SS:F_a\001 -4 1 -1 0 0 0 20 0.0000 4 255 840 5903 10673 SS:F_y\001 -4 1 -1 0 0 0 20 0.0000 4 195 1200 4729 3379 ROD:rod1\001 -4 1 -1 0 0 0 20 0.0000 4 195 1200 4731 8196 ROD:rod2\001 -4 1 -1 0 0 0 20 0.0000 4 255 900 4771 946 SS:f_a1\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6795 3375 Link 1\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 5760 Joint 2\001 -4 0 1 1 0 3 20 0.0000 4 210 720 6750 8190 Link 2\001 -4 0 1 1 0 3 20 0.0000 4 270 375 6750 10485 Tip\001 -4 0 1 1 0 3 20 0.0000 4 225 795 6750 1260 Joint 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 1170 5850 945 ACCEL:g\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3600 2970 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4725 2970 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3600 3780 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4725 3780 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5850 3780 [y_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5850 2970 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 495 3605 7835 [x_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 900 4730 7835 [alpha_a]\001 -4 1 4 0 0 0 16 0.0000 4 225 495 5855 7835 [y_a]\001 -4 1 4 0 0 0 16 0.0000 4 210 510 3607 8512 [x_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 915 4733 8513 [alpha_b]\001 -4 1 4 0 0 0 16 0.0000 4 225 510 5859 8514 [y_b]\001 DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_desc.tex @@ -1,43 +0,0 @@ -% Verbal description for system gTwoLink (gTwoLink_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/01/19 14:20:07 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/08/15 13:31:00 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{gTwoLink} is - displayed in Figure \Ref{gTwoLink_abg} and its label - file is listed in Section \Ref{sec:gTwoLink_lbl}. - The subsystems are listed in Section \Ref{sec:gTwoLink_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses the compound components: {\bf ROD}. {\bf -ROD} is essentially as described in Figure 10.2. -Gravity is included as discussed in "Metamodelling" by accelerating -the manipulator vertically using the {\bf ACCEL} component. - -This system has a number of dynamic elements (those corresponding to -translation motion) in derivative causality, thus the system is -represnted as a Differential-Algebraic Equation (Section -\Ref{sec:gTwoLink_dae.tex}). Hovever, this -is of contrained-state form and therfore can be written as a set of -constrained-state equations (Section \Ref{sec:gTwoLink_cse.tex}). The -corresponding ordinary differential equation is complicated due to the -trig functions involved in inverting the E matrix. - -As well as the standard representation the ``robot-form'' equations -appear in Section \Ref{sec:gTwoLink_rfe.tex}. - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_input.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_input.txt @@ -1,21 +0,0 @@ -# Numerical parameter file (gTwoLink_input.txt) -# Generated by MTT at Fri Jun 13 16:56:09 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:03:41 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Wed Jun 11 14:23:00 BST 2003: u(1) = (t<1.0); -## Removed by MTT on Wed Jun 11 14:23:00 BST 2003: u(2) = 0.0; # -## Removed by MTT on Wed Jun 11 14:23:00 BST 2003: u(3) = 0.0; # gravity -gtwolink__f_a1 = (t<1.0); -gtwolink__f_a2 = 0.0; -gtwolink__g__force = 0.0; - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_lbl.txt @@ -1,53 +0,0 @@ -%SUMMARY gTwoLink: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (gTwoLink_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1996/12/05 12:39:49 peterg -% %% Documentation -% %% -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - identical rods -rod1 none l;l;j;m;mg -rod2 none l;l;j;m;mg - -%Zero velocity sources -v_x SS internal,0 - - -%Zero force/torque sources -F_x SS 0,internal -F_a SS 0,internal -F_y SS 0,internal - - -%Torque at joints -f_a1 SS external,external -f_a2 SS external,external - -%Gravity -g - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_numpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_numpar.txt @@ -1,19 +0,0 @@ -# Numerical parameter file (gTwoLink_numpar.txt) -# Generated by MTT at Fri Jun 13 16:39:41 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:03:41 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -l = 1.0; # Default value -m = 1.0; # Default value -j = m*l*l/12.0; # Uniform rod - -mg = m*9.81; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_rep.txt @@ -1,23 +0,0 @@ -# Outline report file for system gTwoLink (gTwoLink_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 18:03:41 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/02/22 09:18:53 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt gTwoLink abg tex -mtt gTwoLink struc tex -mtt gTwoLink sympar tex -mtt gTwoLink dae tex -mtt gTwoLink cse tex -mtt gTwoLink input txt -mtt gTwoLink numpar txt -mtt -i euler gTwoLink odeso ps DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simp.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simp.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simp.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simp.r @@ -1,17 +0,0 @@ -%% Reduce comands to simplify output for system gTwoLink (gTwoLink_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simpar.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_simpar.txt @@ -1,19 +0,0 @@ -# Simulation parameters for system gTwoLink (gTwoLink_simpar.txt) -# Generated by MTT on Mon Jul 27 08:11:02 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.2 1999/12/23 20:18:54 peterg -## Removed METHOD -## -## Revision 1.1 1999/02/22 10:06:54 peterg -## Initial revision -## -############################################################### - - -LAST=5.0; -DT=0.1; -STEPFACTOR=10; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_state.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_state.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_state.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/gTwoLink_state.txt @@ -1,24 +0,0 @@ -# Initial state file (gTwoLink_state.txt) -# Generated by MTT at Mon Jul 27 07:54:23 BST 1998 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/07/27 06:59:25 peterg -## Initial revision -## -############################################################### - -# Set the states -## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(1) = 0.0; # J (gTwoLink_rod1) -## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(2) = 0.0; # 3 (gTwoLink_rod1_th) -## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(3) = 0.0; # J (gTwoLink_rod2) -## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(4) = pi/4; # 3 (gTwoLink_rod2_th) -## Removed by MTT on Wed Jun 11 14:22:12 BST 2003: mttx(5) = 0.0; # 2 (gTwoLink_g) -gtwolink__g__mtti = 0.0; -gtwolink__rod1__j = 0.0; -gtwolink__rod1__th__mttc = 0.0; -gtwolink__rod2__j = 0.0; -gtwolink__rod2__th__mttc = pi/4; - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_desc.tex Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_desc.tex +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_desc.tex @@ -1,25 +0,0 @@ -% Verbal description for system twolink (twolink_desc.tex) -% Generated by MTT on Fri Jun 13 16:30:23 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{twolink} is - displayed in Figure \Ref{twolink_abg} and its label - file is listed in Section \Ref{sec:twolink_lbl}. - The subsystems are listed in Section \Ref{sec:twolink_sub}. - -This is a heirachical version of the example from Section 10.5 of -"Metamodelling". It uses two compound components: {\bf ROD} and {\bf -GRAV}. {\bf ROD} is essentially as described in Figure 10.2 {\bf -GRAV} represents gravity by a vertical accelleration as in Section -10.9 of "Metamodelling" - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_lbl.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_lbl.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_lbl.txt @@ -1,50 +0,0 @@ -%SUMMARY twolink: two-link manipulator from Section 10.5 of "Metamodelling" -%DESCRIPTION This is a heirachical version of the -%DESCRIPTION example from Section 10.5 of "Metamodelling". -%DESCRIPTION It uses two compound components: ROD and GRA -%DESCRIPTION ROD is essentially as described in Figure 10.2 -%DESCRIPTION GRAV represents gravity by a vertical accelleration -%DESCRIPTION as in Section 10.9 of "Metamodelling" - - -%% Label (twolink_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1996/12/05 12:17:15 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1996/11/14 10:48:42 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%Rod parameters - identical rods -rod1 none l;l;j;m -rod2 none l;l;j;m - -%Zero velocity sources -v_x internal 0 - - -%Zero force/torque sources -F_x 0 internal -F_a 0 internal -F_y 0 internal - - -%Torque at joints -f_a1 external external -f_a2 external external - - -%Gravity -g DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_params.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_params.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_params.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_params.r @@ -1,24 +0,0 @@ -%% Parameter file for system twolink (twolink_params.r) -%% This file provides symbolic parameters for simplification - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Useful trig simplifications - - - trig1 := {cos(~x)*cos(~y) => (cos(x+y)+cos(x-y))/2, - cos(~x)*sin(~y) => (sin(x+y)-sin(x-y))/2, - sin(~x)*sin(~y) => (cos(x-y)-cos(x+y))/2, - cos(~x)^2 => (1+cos(2*x))/2, - sin(~x)^2 => (1-cos(2*x))/2}; - LET trig1; - -% Some simplifications -- see book -j := m*l*l/3; - -END; DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_rep.txt Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_rep.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_rep.txt @@ -1,19 +0,0 @@ -%% Outline report file for system twolink (twolink_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -abg tex -struc tex -dae tex -csm tex -sro ps -lmfr ps -odeso ps -input txt -numpar txt - DELETED mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_simp.r Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_simp.r ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_simp.r +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-2D/gTwoLink/twolink_simp.r @@ -1,14 +0,0 @@ -%% Reduce comands to simplify output for system twolink (twolink_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%simplify the output equations -% Joint angles -mttx2 := theta_1; -mttx4 := theta_1 + theta_2; -END; DELETED mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_abg.fig Index: mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_abg.fig +++ mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_abg.fig @@ -1,69 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 1800 1125 162 162 1800 1125 1890 1260 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1802 4277 2702 4277 2477 4502 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 4277 4052 4277 3827 4502 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4502 4277 5402 4277 5177 4502 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 4051 2926 3151 3151 3376 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 4051 4276 3151 4501 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 4276 2701 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5401 4051 5401 4276 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5401 4276 5401 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 4051 2701 4276 -2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 2475 585 3375 585 3375 765 2475 765 2475 585 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4050 1215 4500 1215 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4050 1080 4500 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 675 2475 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3375 675 5400 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4275 675 4275 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4275 1215 4275 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 1575 5400 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 945 1800 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 1575 1800 1260 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 5400 1530 5400 765 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6750 5625 6750 225 675 225 675 5625 6750 5625 -4 1 -1 0 0 0 20 0.0000 4 255 180 2927 4367 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 4277 4367 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 600 2926 2926 sR:r\001 -4 1 -1 0 0 0 20 0.0000 4 255 645 4276 2926 sC:c\001 -4 1 -1 0 0 0 20 0.0000 4 255 945 1395 4365 sSe:e1\001 -4 0 1 1 0 0 20 0.0000 4 180 120 2880 450 r\001 -4 0 1 1 0 0 20 0.0000 4 180 165 4680 1215 c\001 -4 0 1 1 0 0 20 0.0000 4 180 165 5625 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 255 180 5715 1305 2\001 -4 0 1 1 0 0 20 0.0000 4 180 165 1260 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 255 180 1350 1305 1\001 -4 1 1 1 0 0 20 0.0000 4 330 1725 3600 4995 Bond graph\001 -4 1 1 1 0 0 20 0.0000 4 255 1545 3600 2025 Schematic\001 -4 1 -1 0 0 0 20 0.0000 4 255 1005 5987 4367 sDe:e2\001 -4 1 4 100 0 18 4 0.0000 4 120 270 4500 4005 [1,2]\001 -4 1 4 100 0 18 4 0.0000 4 120 270 3105 4005 [1,2]\001 DELETED mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_desc.tex Index: mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_desc.tex +++ mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_desc.tex @@ -1,33 +0,0 @@ -% Verbal description for system sRCc (sRCc_desc.tex) -% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/07/29 05:17:04 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1997/08/24 10:27:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{sRCc} is - displayed in Figure \Ref{sRCc_abg} and its label - file is listed in Section \Ref{sec:sRCc_lbl}. - The subsystems are listed in Section \Ref{sec:sRCc_sub}. - -The system \textbf{sRCc} is the the sensitivity version of the simple -electrical sRCc circuit shown in Figure \Ref{sRCc_abg}. The circuit itself can be -regarded as a single-input single-output system with input $e_1$ and -output $e_2$; the sensitivity system has {\em two\/} outputs: $e_2$ -and $\frac{\partial e_2}{\partial r}$. - -All bonds are two-bond vector bonds, and the {\bf sR} and {\bf sC} -components are two-port versions of the usual {\bf R} and {\bf C} -components respectively. One port conveys the usual effort/flow pair; -the other port conveys the sensitivity of the effort and flow with -respect to the $c$ parameter. - DELETED mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_lbl.txt Index: mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_lbl.txt +++ mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_lbl.txt @@ -1,40 +0,0 @@ -%% Label file for system sRCc (sRCc_lbl.txt) -%SUMMARY sRCc Sensitivity of output of RC circuit wrt value of r -%DESCRIPTION Uses the sR and sC components and vector bonds - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/10/18 07:34:32 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1999/07/29 05:18:59 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type sSe - e1 slin external;0 - -% Component type sDe - e2 - -% Component type sC - c slin effort,c;1 - -% Component type sR - r slin flow,r;0 DELETED mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_rep.txt Index: mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_rep.txt +++ mttroot/mtt/lib/examples/Sensitivity/sRCc/sRCc_rep.txt @@ -1,27 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system sRCc (sRCc_rep.txt) -## Generated by MTT on" Thu Jul 29 06:02:47 BST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt sRCc abg tex # The system description -## mtt sRCc cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt sRCc struc tex # The system structure -## mtt sRCc dae tex # The system dae -mtt sRCc ode tex # The system ode -## mtt sRCc sspar tex # Steady-state parameters -## mtt sRCc ss tex # Steady state -## mtt sRCc dm tex # Descriptor matrices (of linearised system) -mtt sRCc sm tex # State matrices (of linearised system) -mtt sRCc tf tex # Transfer function (of linearised system) -mtt sRCc lmfr ps # log modulus of frequency response (of linearised system) -## mtt sRCc simpar tex # Simulation parameters -## mtt sRCc numpar tex # Numerical simulation parameters -## mtt sRCc input tex # Simulation input - mtt sRCc odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_abg.fig Index: mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_abg.fig +++ mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_abg.fig @@ -1,69 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -1 3 0 2 1 7 1 0 -1 0.000 1 0.0000 1800 1125 162 162 1800 1125 1890 1260 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1802 4277 2702 4277 2477 4502 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 4277 4052 4277 3827 4502 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4502 4277 5402 4277 5177 4502 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2926 4051 2926 3151 3151 3376 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4276 4051 4276 3151 4501 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 4276 2701 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5401 4051 5401 4276 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5401 4276 5401 4501 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2701 4051 2701 4276 -2 2 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 5 - 2475 585 3375 585 3375 765 2475 765 2475 585 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4050 1215 4500 1215 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4050 1080 4500 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 675 2475 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 3375 675 5400 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4275 675 4275 1080 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 4275 1215 4275 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 1575 5400 1575 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 945 1800 675 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 0 0 2 - 1800 1575 1800 1260 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 5400 1530 5400 765 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6750 5625 6750 225 675 225 675 5625 6750 5625 -4 1 -1 0 0 0 20 0.0000 4 255 180 2927 4367 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 180 4277 4367 0\001 -4 1 -1 0 0 0 20 0.0000 4 255 600 2926 2926 sR:r\001 -4 1 -1 0 0 0 20 0.0000 4 255 645 4276 2926 sC:c\001 -4 1 -1 0 0 0 20 0.0000 4 255 945 1395 4365 sSe:e1\001 -4 0 1 1 0 0 20 0.0000 4 180 120 2880 450 r\001 -4 0 1 1 0 0 20 0.0000 4 180 165 4680 1215 c\001 -4 0 1 1 0 0 20 0.0000 4 180 165 5625 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 255 180 5715 1305 2\001 -4 0 1 1 0 0 20 0.0000 4 180 165 1260 1170 e\001 -4 0 1 1 0 0 20 0.0000 4 255 180 1350 1305 1\001 -4 1 1 1 0 0 20 0.0000 4 330 1725 3600 4995 Bond graph\001 -4 1 1 1 0 0 20 0.0000 4 255 1545 3600 2025 Schematic\001 -4 1 -1 0 0 0 20 0.0000 4 255 1005 5987 4367 sDe:e2\001 -4 1 4 100 0 18 10 0.0000 4 150 345 4545 4005 [1,2]\001 -4 1 4 100 0 18 10 0.0000 4 150 345 3195 4005 [1,2]\001 DELETED mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_desc.tex Index: mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_desc.tex +++ mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_desc.tex @@ -1,33 +0,0 @@ -% Verbal description for system sRCr (sRCr_desc.tex) -% Generated by MTT on Sun Aug 24 11:03:55 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1999/07/29 05:17:04 peterg -% %% Initial revision -% %% -% %% Revision 1.1 1997/08/24 10:27:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{sRCr} is - displayed in Figure \Ref{sRCr_abg} and its label - file is listed in Section \Ref{sec:sRCr_lbl}. - The subsystems are listed in Section \Ref{sec:sRCr_sub}. - -The system \textbf{sRCr} is the the sensitivity version of the simple -electrical sRCr circuit shown in Figure \Ref{sRCr_abg}. The circuit itself can be -regarded as a single-input single-output system with input $e_1$ and -output $e_2$; the sensitivity system has {\em two\/} outputs: $e_2$ -and $\frac{\partial e_2}{\partial r}$. - -All bonds are two-bond vector bonds, and the {\bf sR} and {\bf sC} -components are two-port versions of the usual {\bf R} and {\bf C} -components respectively. One port conveys the usual effort/flow pair; -the other port conveys the sensitivity of the effort and flow with -respect to the $r$ parameter. - DELETED mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_lbl.txt Index: mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_lbl.txt +++ mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_lbl.txt @@ -1,40 +0,0 @@ -%% Label file for system sRCr (sRCr_lbl.txt) -%SUMMARY sRCr Sensitivity of output of RC circuit wrt value of r -%DESCRIPTION Uses the sR and sC components and vector bonds - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 18:04:59 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/07/29 05:18:59 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases - -% Argument aliases - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type sSe - e1 slin external;0 - -% Component type sDe - e2 - -% Component type sC - c slin effort,c;0 - -% Component type sR - r slin flow,r;1 DELETED mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_rep.txt Index: mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_rep.txt +++ mttroot/mtt/lib/examples/Sensitivity/sRCr/sRCr_rep.txt @@ -1,27 +0,0 @@ -## -*-octave-*- Put Emacs into octave-mode -## Outline report file for system sRCr (sRCr_rep.txt) -## Generated by MTT on" Thu Jul 29 06:02:47 BST 1999. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt sRCr abg tex # The system description -## mtt sRCr cbg ps # The causal bond graph -## Uncomment the following lines or add others -mtt sRCr struc tex # The system structure -## mtt sRCr dae tex # The system dae -mtt sRCr ode tex # The system ode -## mtt sRCr sspar tex # Steady-state parameters -## mtt sRCr ss tex # Steady state -## mtt sRCr dm tex # Descriptor matrices (of linearised system) -mtt sRCr sm tex # State matrices (of linearised system) -mtt sRCr tf tex # Transfer function (of linearised system) -mtt sRCr lmfr ps # log modulus of frequency response (of linearised system) -## mtt sRCr simpar tex # Simulation parameters -## mtt sRCr numpar tex # Numerical simulation parameters -## mtt sRCr input tex # Simulation input - mtt sRCr odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_abg.fig Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_abg.fig +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_abg.fig @@ -1,37 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 3150 5850 3150 5625 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 4275 5850 4275 5625 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1800 3150 3150 3150 2925 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3150 2925 3150 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 4050 1800 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1777 4275 3127 4275 2902 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4500 4095 4500 4545 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 3150 8325 3150 8100 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6975 2925 6975 3375 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 2925 2025 4725 2025 4725 5400 2925 5400 2925 2025 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 5850 9450 1575 450 1575 450 5850 9450 5850 -4 0 -1 0 0 0 20 0.0000000 4 240 870 6030 3240 RT:r_2\001 -4 2 4 0 0 0 20 0.0000000 4 240 690 2835 3060 [t_in]\001 -4 0 4 0 0 0 20 0.0000000 4 240 840 4770 3015 [t_out]\001 -4 2 4 0 0 0 20 0.0000000 4 240 735 2880 4185 [e_in]\001 -4 0 4 0 0 0 20 0.0000000 4 240 885 4770 4185 [e_out]\001 -4 2 -1 0 0 0 20 0.0000000 4 240 900 1620 3240 SS:T_1\001 -4 0 -1 0 0 0 20 0.0000000 4 240 900 8460 3240 SS:T_2\001 -4 2 -1 0 0 0 20 0.0000000 4 240 780 1665 4365 SS:I_r\001 -4 0 -1 0 0 0 20 0.0000000 4 240 930 5985 4365 SS:V_0\001 -4 1 -1 0 0 0 20 0.0000000 4 270 1575 3780 3825 Segment:s*100\001 DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_input.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_input.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_input.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (BigHeatedRod_input.txt) -# Generated by MTT at Thu Sep 4 16:11:06 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:06:11 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Sun Aug 17 13:03:18 BST 2003: u(1) = 10.0*(t<5.0); # I_r -bigheatedrod__i_r = 10.0*(t<5.0); # I_r DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_lbl.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_lbl.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_lbl.txt @@ -1,52 +0,0 @@ -#SUMMARY BigHeatedRod: Thermal/Electrical model of Electric rod -#DESCRIPTION Introduces the idea of the ES component which -#DESCRIPTION transforms a relative-temperature/enthalpy pseudo bond -#DESCRIPTION (at the [e]port) into an absolute-temperature/enntropy -#DESCRIPTION energy bond (at the [s] port) and vice versa. - -#PAR rod_length -#PAR rod_radius -#PAR electrical_resistivity -#PAR thermal_resistivity -#PAR thermal_capacity -#PAR segments -#PAR area -#PAR delta_x -#PAR volume -#PAR density -#PAR mass -#PAR pi - -## Label file for system BigHeatedRod (BigHeatedRod_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.1 2000/12/28 18:06:11 peterg -# ## To RCS -# ## -# ## Revision 1.1 1997/09/11 16:16:29 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - -# Component type RT - r_2 lin flow,r_2 - -# Component type SS - I_r SS internal,external - T_1 SS t_0,internal - T_2 SS t_0,internal - V_0 SS internal,internal - -# Component type Segment - s DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_numpar.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_numpar.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_numpar.txt @@ -1,40 +0,0 @@ -# Numerical parameter file (BigHeatedRod_numpar.txt) -# Generated by MTT at Thu Sep 4 16:11:04 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:06:11 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -# Constants for copper -density = 8.96; -rod_length = 1.0; -rod_radius = 1e-3; -electrical_resistivity = 16.8*0.000000001; -thermal_resistivity = 1/390.0; -thermal_capacity = 380.0; - -pi = 3.142; - -segments = 100; -area = pi*rod_radius*rod_radius; -delta_x = rod_length/segments; -volume = area*delta_x; -mass = volume*density; - -# Parameters -c_t = thermal_capacity*mass; -r = electrical_resistivity*delta_x/area; -r_t = thermal_resistivity*delta_x/area; -r_2 = r_t; -t_0 = 300; # Ambient - - - - DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_rep.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_rep.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_rep.txt @@ -1,21 +0,0 @@ -# Outline report file for system BigHeatedRod (BigHeatedRod_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2003/08/17 17:02:31 gawthrop -% %% Updated for new MTT -% %% -% %% Revision 1.1 1998/11/23 13:37:55 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -o BigHeatedRod abg tex - -mtt -o BigHeatedRod numpar txt -mtt -o BigHeatedRod input txt -mtt -o BigHeatedRod odeso ps - DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_simpar.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_simpar.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_simpar.txt @@ -1,20 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system BigHeatedRod (BigHeatedRod_simpar.txt) -# Generated by MTT on Tue Aug 24 01:20:41 BST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 10.0; # Last time in simulation -DT = 0.1; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input - -DT = 1.0; # Print interval DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_state.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_state.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_state.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/BigHeatedRod_state.txt @@ -1,214 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Initial state file (BigHeatedRod_state.txt) -# Generated by MTT at Friday August 14 18:38:47 BST 1998 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 18:06:11 peterg -## To RCS -## -############################################################### - -# Set the states -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(1) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(2) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(3) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(4) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(5) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(6) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(7) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(8) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(9) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(10) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(11) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(12) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(13) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(14) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(15) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(16) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(17) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(18) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(19) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(20) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(21) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(22) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(23) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(24) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(25) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(26) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(27) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(28) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(29) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(30) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(31) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(32) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(33) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(34) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(35) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(36) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(37) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(38) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(39) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(40) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(41) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(42) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(43) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(44) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(45) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(46) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(47) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(48) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(49) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(50) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(51) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(52) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(53) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(54) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(55) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(56) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(57) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(58) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(59) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(60) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(61) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(62) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(63) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(64) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(65) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(66) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(67) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(68) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(69) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(70) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(71) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(72) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(73) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(74) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(75) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(76) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(77) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(78) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(79) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(80) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(81) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(82) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(83) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(84) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(85) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(86) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(87) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(88) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(89) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(90) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(91) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(92) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(93) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(94) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(95) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(96) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(97) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(98) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(99) = c_t*t_0; # c (BigHeatedRod_s_c_t) -## Removed by MTT on Sun Aug 17 13:05:21 BST 2003: mttx(100) = c_t*t_0; # c (BigHeatedRod_s_c_t) -bigheatedrod__s__100__c_t__c = c_t*t_0; -bigheatedrod__s__10__c_t__c = c_t*t_0; -bigheatedrod__s__11__c_t__c = c_t*t_0; -bigheatedrod__s__12__c_t__c = c_t*t_0; -bigheatedrod__s__13__c_t__c = c_t*t_0; -bigheatedrod__s__14__c_t__c = c_t*t_0; -bigheatedrod__s__15__c_t__c = c_t*t_0; -bigheatedrod__s__16__c_t__c = c_t*t_0; -bigheatedrod__s__17__c_t__c = c_t*t_0; -bigheatedrod__s__18__c_t__c = c_t*t_0; -bigheatedrod__s__19__c_t__c = c_t*t_0; -bigheatedrod__s__20__c_t__c = c_t*t_0; -bigheatedrod__s__21__c_t__c = c_t*t_0; -bigheatedrod__s__22__c_t__c = c_t*t_0; -bigheatedrod__s__23__c_t__c = c_t*t_0; -bigheatedrod__s__24__c_t__c = c_t*t_0; -bigheatedrod__s__25__c_t__c = c_t*t_0; -bigheatedrod__s__26__c_t__c = c_t*t_0; -bigheatedrod__s__27__c_t__c = c_t*t_0; -bigheatedrod__s__28__c_t__c = c_t*t_0; -bigheatedrod__s__29__c_t__c = c_t*t_0; -bigheatedrod__s__2__c_t__c = c_t*t_0; -bigheatedrod__s__30__c_t__c = c_t*t_0; -bigheatedrod__s__31__c_t__c = c_t*t_0; -bigheatedrod__s__32__c_t__c = c_t*t_0; -bigheatedrod__s__33__c_t__c = c_t*t_0; -bigheatedrod__s__34__c_t__c = c_t*t_0; -bigheatedrod__s__35__c_t__c = c_t*t_0; -bigheatedrod__s__36__c_t__c = c_t*t_0; -bigheatedrod__s__37__c_t__c = c_t*t_0; -bigheatedrod__s__38__c_t__c = c_t*t_0; -bigheatedrod__s__39__c_t__c = c_t*t_0; -bigheatedrod__s__3__c_t__c = c_t*t_0; -bigheatedrod__s__40__c_t__c = c_t*t_0; -bigheatedrod__s__41__c_t__c = c_t*t_0; -bigheatedrod__s__42__c_t__c = c_t*t_0; -bigheatedrod__s__43__c_t__c = c_t*t_0; -bigheatedrod__s__44__c_t__c = c_t*t_0; -bigheatedrod__s__45__c_t__c = c_t*t_0; -bigheatedrod__s__46__c_t__c = c_t*t_0; -bigheatedrod__s__47__c_t__c = c_t*t_0; -bigheatedrod__s__48__c_t__c = c_t*t_0; -bigheatedrod__s__49__c_t__c = c_t*t_0; -bigheatedrod__s__4__c_t__c = c_t*t_0; -bigheatedrod__s__50__c_t__c = c_t*t_0; -bigheatedrod__s__51__c_t__c = c_t*t_0; -bigheatedrod__s__52__c_t__c = c_t*t_0; -bigheatedrod__s__53__c_t__c = c_t*t_0; -bigheatedrod__s__54__c_t__c = c_t*t_0; -bigheatedrod__s__55__c_t__c = c_t*t_0; -bigheatedrod__s__56__c_t__c = c_t*t_0; -bigheatedrod__s__57__c_t__c = c_t*t_0; -bigheatedrod__s__58__c_t__c = c_t*t_0; -bigheatedrod__s__59__c_t__c = c_t*t_0; -bigheatedrod__s__5__c_t__c = c_t*t_0; -bigheatedrod__s__60__c_t__c = c_t*t_0; -bigheatedrod__s__61__c_t__c = c_t*t_0; -bigheatedrod__s__62__c_t__c = c_t*t_0; -bigheatedrod__s__63__c_t__c = c_t*t_0; -bigheatedrod__s__64__c_t__c = c_t*t_0; -bigheatedrod__s__65__c_t__c = c_t*t_0; -bigheatedrod__s__66__c_t__c = c_t*t_0; -bigheatedrod__s__67__c_t__c = c_t*t_0; -bigheatedrod__s__68__c_t__c = c_t*t_0; -bigheatedrod__s__69__c_t__c = c_t*t_0; -bigheatedrod__s__6__c_t__c = c_t*t_0; -bigheatedrod__s__70__c_t__c = c_t*t_0; -bigheatedrod__s__71__c_t__c = c_t*t_0; -bigheatedrod__s__72__c_t__c = c_t*t_0; -bigheatedrod__s__73__c_t__c = c_t*t_0; -bigheatedrod__s__74__c_t__c = c_t*t_0; -bigheatedrod__s__75__c_t__c = c_t*t_0; -bigheatedrod__s__76__c_t__c = c_t*t_0; -bigheatedrod__s__77__c_t__c = c_t*t_0; -bigheatedrod__s__78__c_t__c = c_t*t_0; -bigheatedrod__s__79__c_t__c = c_t*t_0; -bigheatedrod__s__7__c_t__c = c_t*t_0; -bigheatedrod__s__80__c_t__c = c_t*t_0; -bigheatedrod__s__81__c_t__c = c_t*t_0; -bigheatedrod__s__82__c_t__c = c_t*t_0; -bigheatedrod__s__83__c_t__c = c_t*t_0; -bigheatedrod__s__84__c_t__c = c_t*t_0; -bigheatedrod__s__85__c_t__c = c_t*t_0; -bigheatedrod__s__86__c_t__c = c_t*t_0; -bigheatedrod__s__87__c_t__c = c_t*t_0; -bigheatedrod__s__88__c_t__c = c_t*t_0; -bigheatedrod__s__89__c_t__c = c_t*t_0; -bigheatedrod__s__8__c_t__c = c_t*t_0; -bigheatedrod__s__90__c_t__c = c_t*t_0; -bigheatedrod__s__91__c_t__c = c_t*t_0; -bigheatedrod__s__92__c_t__c = c_t*t_0; -bigheatedrod__s__93__c_t__c = c_t*t_0; -bigheatedrod__s__94__c_t__c = c_t*t_0; -bigheatedrod__s__95__c_t__c = c_t*t_0; -bigheatedrod__s__96__c_t__c = c_t*t_0; -bigheatedrod__s__97__c_t__c = c_t*t_0; -bigheatedrod__s__98__c_t__c = c_t*t_0; -bigheatedrod__s__99__c_t__c = c_t*t_0; -bigheatedrod__s__9__c_t__c = c_t*t_0; -bigheatedrod__s__c_t__c = c_t*t_0; DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_input.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_input.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_input.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_input.txt @@ -1,12 +0,0 @@ -# Numerical parameter file (HR_input.txt) -# Generated by MTT at Thu Sep 4 16:11:06 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -u(1) = 10.0*(t<5.0); # I_r DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_numpar.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_numpar.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_numpar.txt @@ -1,36 +0,0 @@ -# Numerical parameter file (HR_numpar.txt) -# Generated by MTT at Thu Sep 4 16:11:04 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -# Constants for copper -density = 8.96; -rod_length = 1.0; -rod_radius = 1e-3; -electrical_resistivity = 16.8*0.000000001; -thermal_resistivity = 1/390.0; -thermal_capacity = 380.0; - - -segments = 2; -area = pi*rod_radius*rod_radius; -delta_x = rod_length/segments; -volume = area*delta_x; -mass = volume*density; - -# Parameters -c_t = thermal_capacity*mass; -r = electrical_resistivity*delta_x/area; -r_t = thermal_resistivity*delta_x/area; -r_2 = r_t/100; -t_0 = 300; # Ambient - - - - DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_simpar.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_simpar.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HR_simpar.txt @@ -1,19 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system HR (HR_simpar.txt) -# Generated by MTT on Wednesday July 29 13:59:50 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 10; # Last time in simulation -WMIN = 1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps - -STEPFACTOR = 1; # Added automatically -METHOD = IMPLICIT; # Added automatically -DT = 0.25; # Added automatically DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_desc.tex Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_desc.tex +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_desc.tex @@ -1,39 +0,0 @@ -% Verbal description for system HeatedRod (HeatedRod_desc.tex) -% Generated by MTT on Thu Sep 4 18:05:09 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - - - The acausal bond graph of system \textbf{HeatedRod} is - displayed in Figure \Ref{HeatedRod_abg} and its label - file is listed in Section \Ref{sec:HeatedRod_lbl}. -The subsystems are listed in Section \Ref{sec:HeatedRod_sub}. - - System \textbf{HeatedRod} is a model of a rod of copper with an - electric current passing through it which warms it up. The two ends of - the rod are fixed at ambient temperature; this is where all the heat - loss occurs. - - This system introduces the idea of the {\bf ES} component which - transforms a relative-temperature/enthalpy pseudo bond (at the [e] - port) into an absolute-temperature/enntropy energy bond (at the [s] - port) and vice versa. - - The model is similar to that described in chapter 8 of - Cellier's book. However, instead of representing the thermal - resistance by {\bf RS} components and reinserting the entropy flow, - the {\bf RT} component uses two {\bf ES} components to convert from - true to pseudo bonds and back again. Similary, the thermal capacity is - modelled by the {\bf CT} component. - - - The rod parameters are given in the numpar file and the input current - in the input file. DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_lbl.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_lbl.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/HeatedRod_lbl.txt @@ -1,33 +0,0 @@ -%SUMMARY HeatedRod: Thermal/Electrical model of Electric rod -%DESCRIPTION Introduces the idea of the ES component which -%DESCRIPTION transforms a relative-temperature/enthalpy pseudo bond -%DESCRIPTION (at the [e]port) into an absolute-temperature/enntropy -%DESCRIPTION energy bond (at the [s] port) and vice versa. - -%% Label file for system HeatedRod (HeatedRod_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type RT - r_2 lin flow,r_2 - -% Component type SS - I_r internal external - T_1 t_0 internal - T_2 t_0 internal - V_0 0 internal - -% Component type Segment - s DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Run Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Run ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Run +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Run @@ -1,129 +0,0 @@ -#! /bin/sh -# Shell script for running the large HeatedRod systems to compare -# four integration methods. -# Usage example: Run 100 0.25 runf the 100 segment example at interval 0.25 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.3 1998/08/17 09:42:26 peterg -## Third argument gives the desired methods. -## -## Revision 1.2 1998/08/15 14:07:11 peterg -## Don't do ImplicitL -## -## Revision 1.1 1998/08/15 13:58:27 peterg -## Initial revision -## -############################################################### - - -n=$1 -DT=$2 - -if [ -z "$n" ]; then - echo "First argument is N: number of segments (eg 100)" - exit -fi -if [ -z "$DT" ]; then - echo "Second argument is DT: the sample interval (eg 0.25)" - exit -fi -if [ -z "$3" ]; then - METHODS='ImplicitS Euler Implicit' -else - METHODS=$3 -fi - -echo "Running system HR$1 with DT = $DT" -echo "using methods $METHODS" - -#Create the system -mtt -q rename HR HR$n >/dev/null -rm -f MTT_work/HR$1_state.* #Why ?? - -# Is it already correct? -count=`grep -c "*$n" HR$1_abg.fig` - -# if not, then set the correct number of segments -if [ "$count" = "0" ]; then - echo Setting number of segments to $n - mv HR$1_abg.fig HR$1_abg.old - sed "s/\*[0-9]*/*$1/"HR$1_abg.fig - - mv HR$1_numpar.txt HR$1_numpar.old - sed "s/segments = [0-9]*/segments = $1/"HR$1_numpar.txt - - echo "Making the default HR$1_state.txt" - rm -f HR$1_state.txt MTT_work/HR$1_state.txt - mtt -q HR$1 state txt - echo "Setting $n states to c_t*t_0" - mv HR$1_state.txt HR$1_state.old - sed "s/0.0/c_t*t_0/"HR$1_state.txt -fi - - - - - - -rm -f HR$1_table.txt - -#Do the methods of interest - -for METHOD in $METHODS; do - -case $METHOD in - Euler) - # What is the minimum step size for Euler? - mtt -q HR$n numpar m - mtt -q HR$n sm m -octave -q <HR$1.tmp1 - HR$1_numpar; - A=HR$1_sm; - Max_Eig=max(eig(-A)) - STEPFACTOR=ceil( Max_Eig*$DT/2 ) -EOF - MinSTEPFACTOR=`gawk '{if ($1=="STEPFACTOR") print $3}' HR$1.tmp1` - STEPFACTOR=$MinSTEPFACTOR - ;; - ImplicitS) - # What is the empirical step size for sparse method? - octave -q <HR$1.tmp1 - if $n>100 - SparseSTEPFACTOR=10*$n - else - SparseSTEPFACTOR=5*$n - endif -EOF - SparseSTEPFACTOR=`gawk '{if ($1=="SparseSTEPFACTOR") print $3}' HR$1.tmp1` - - STEPFACTOR=$SparseSTEPFACTOR - ;; - *) - STEPFACTOR=1 - ;; -esac - - - echo "Doing HR$1 with DT=$DT using $METHOD (STEPFACTOR = $STEPFACTOR)" - - # Modify the simpar.txt files - grep -v 'STEPFACTOR' HR_simpar.txt | grep -v 'METHOD' | grep -v 'DT' > HR$1_simpar.txt - echo "STEPFACTOR = $STEPFACTOR; # Added automatically" >>HR$1_simpar.txt - echo "METHOD = $METHOD; # Added automatically" >>HR$1_simpar.txt - echo "DT = $DT; # Added automatically" >>HR$1_simpar.txt - mtt -q -c -o HR$1 odeso ps > junk 2>>junk #HR$1_$METHOD.tmp - grep user junk |\ - gawk '{print System " &\t" METHOD " &\t" DT " &\t" STEPFACTOR " &\t" $2 "\\\\"}'\ - METHOD=$METHOD STEPFACTOR=$STEPFACTOR System=HR$1 DT=$DT >> HR$1_table.txt - - cp HR$1_odeso.ps HR$1.$METHOD.$DT.ps -done - -cat HR$1_table.txt - - - DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Run_All Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Run_All ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Run_All +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Run_All @@ -1,20 +0,0 @@ -#! /bin/sh -# Generates the tables of timings -# PJG 17/8/98 - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -Run 2 0.25 'ImplicitS Implicit Euler' -Run 10 0.25 'ImplicitS Implicit Euler' -Run 20 0.25 'ImplicitS Implicit Euler' -Run 50 0.25 'ImplicitS Implicit Euler' -Run 100 0.25 'ImplicitS Implicit Euler' -Run 200 0.25 'ImplicitS Implicit' - -cat Run*_table.txt | sort DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Segment_abg.fig Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Segment_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Segment_abg.fig +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Segment_abg.fig @@ -1,64 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2835 2205 2925 2745 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 2880 2250 2880 2700 --6 -6 8505 2250 8595 2790 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 8550 2295 8550 2745 --6 -6 5310 6255 5400 6795 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5355 6300 5355 6750 --6 -6 5805 6255 5895 6795 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 5850 6300 5850 6750 --6 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1306 2476 2881 2476 2656 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3781 2476 5356 2476 5131 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5761 2476 8550 2475 8325 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5581 4276 5581 2701 5806 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5581 6301 5581 4726 5806 4951 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 6525 5356 6526 5131 6751 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5806 6526 8550 6525 8325 6750 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5806 2701 6920 3815 6601 3815 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5581 2251 5581 676 5806 901 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5356 676 5806 676 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9900 7425 9900 90 45 90 45 7425 9900 7425 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 7650 4455 7650 1800 1575 1800 1575 4455 7650 4455 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 7650 6975 7650 4545 1575 4545 1575 6975 7650 6975 -4 1 -1 0 0 0 20 0.0000 4 240 810 3331 2566 RT:r_t\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5581 2566 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 555 5581 4591 RS:r\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5581 6616 1\001 -4 1 -1 0 0 0 20 0.0000 4 240 840 7021 4141 CT:c_t\001 -4 1 -1 0 0 0 20 0.0000 4 255 870 5581 586 SS:T_s\001 -4 2 4 0 0 0 20 0.0000 4 255 1110 1261 2566 SS:[t_in]\001 -4 0 4 0 0 0 20 0.0000 4 255 1260 8685 2565 SS:[t_out]\001 -4 2 4 0 0 0 20 0.0000 4 255 1155 1260 6615 SS:[e_in]\001 -4 0 4 0 0 0 20 0.0000 4 255 1305 8685 6615 SS:[e_out]\001 -4 0 1 1 0 0 20 0.0000 4 210 1875 1845 4050 Thermal model\001 -4 0 1 1 0 0 20 0.0000 4 210 2025 1800 5175 Electrical model\001 -4 0 1 1 0 0 20 0.0000 4 255 2415 6075 585 Temperature sensor\001 DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Segment_lbl.txt Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Segment_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Segment_lbl.txt +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/Segment_lbl.txt @@ -1,38 +0,0 @@ -%SUMMARY Segment: Segment of HeatedRod -%DESCRIPTION Part of the HeatedRod example. -%% Label file for system Segment (Segment_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/08/10 12:29:48 peterg -% %% Added missing ports. -% %% -% %% Revision 1.1 1997/09/11 16:17:14 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -% Component type CT - c_t lin effort,c_t - -% Component type RS - r lin flow,r - -% Component type RT - r_t lin flow,r_t - -% Component type SS - T_s SS external,0 - [t_in] SS external,internal - [t_out] SS internal,external - [e_in] SS external,internal - [e_out] SS external,internal - DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/examples.m Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/examples.m ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/examples.m +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/examples.m @@ -1,17 +0,0 @@ - -mttdt = 1; -mttx=(zeros(200,1)); -mttu=(zeros(200,1)); -BigHeatedRod_numpar; -alpha = BigHeatedRod_smx(mttx,mttu,mttdt); -show_matrix (alpha); -psfig("sparsity.ps"); - - -[N,junk] = size(alpha); -A = eye(N) - alpha; -plot(log10(abs(eig(A)))) -grid; -xlabel("i"); -ylabel("e_i"); -psfig("eig.ps"); DELETED mttroot/mtt/lib/examples/Simulation/BigHeatedRod/time_svdlu.m Index: mttroot/mtt/lib/examples/Simulation/BigHeatedRod/time_svdlu.m ================================================================== --- mttroot/mtt/lib/examples/Simulation/BigHeatedRod/time_svdlu.m +++ mttroot/mtt/lib/examples/Simulation/BigHeatedRod/time_svdlu.m @@ -1,16 +0,0 @@ -function [N,Ts,Tl]=time_svdlu; - - N=[100:100:700]; - - Ts=[]; Tl=[]; - for n=N - n - M=rand(n,n); - ts=time; svd(M); ts=time-ts - tl=time; lu(M); tl=time-tl - Ts=[Ts,ts]; - Tl=[Tl,tl]; - endfor; - -endfunction; - DELETED mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_abg.fig Index: mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_abg.fig +++ mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_abg.fig @@ -1,21 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 900 3150 2250 3150 2025 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 3150 4950 3150 4725 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 3150 7425 3150 7200 3375 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8550 5175 8550 900 45 900 45 5175 8550 5175 -4 1 -1 0 0 10 20 0.0000 4 210 570 495 3240 Se:u\001 -4 1 -1 0 0 10 20 0.0000 4 210 1095 2925 3240 RC:slow\001 -4 1 -1 0 0 10 20 0.0000 4 210 1005 5535 3240 RC:fast\001 -4 1 -1 0 0 10 20 0.0000 4 270 600 7830 3240 De:y\001 DELETED mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_desc.tex Index: mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_desc.tex +++ mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_desc.tex @@ -1,168 +0,0 @@ -% -*-latex-*- Put EMACS into LaTeX-mode -% Verbal description for system ImplicitRC (ImplicitRC_desc.tex) -% Generated by MTT on Wednesday June 24 09:50:17 BST 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 18:06:50 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This report describes the \emph{implicit} integration methods -available in MTT. They are introduced to provide simulation -of systems within the following context: -\begin{enumerate} -\item The system may be stiff with a mixture of slow and fast - (possibly due to approximating algebraic loops) subsystems. -\item The fast parts of the response are of no interest -\item A fixed sample interval is required -- possibly for real-time - simulation or control -\item The system is nonlinear. -\item The solution of nonlinear algebraic equations is to be avaided. -\end{enumerate} - -The following sections consider the linear and nonlinear versions -respectively. The ideas are based on a standard textbook -\footnote{Press et al: \emph{Numerical Recipes in C}, 2nd edition, - 1992. Cambridge, Section 16.6}. - - -\subsection{Implicit integration - the linear case} -\label{sec:linear} - -Consider the \emph{linear} system: -\begin{equation} - \label{eq:sys} - \dot x = A x + B u -\end{equation} - -For the purposes of simulation, it can be discretised (with sample -interval $\Delta t$) in at least two -ways: -\begin{enumerate} -\item $ \dot x \approx \frac{x_{i+1} - x_{i}}{\Delta t}$ -\item $ \dot x \approx \frac{x_{i} - x_{i-1}}{\Delta t}$ -\end{enumerate} -The former is gives rise to the \emph{forward} Euler or \emph{explicit} -integration scheme: -\begin{equation} - x_{i+1} = x_{i} + \Delta t \left [ A x_{i} + B_{i} u \right ] -\end{equation} -and the latter gives rise to the \emph{backward} Euler or \emph{implicit} -integration scheme: -\begin{equation} - x_{i} = x_{i-1} + \Delta t \left [ A x_{i} + B_{i} u \right ] -\end{equation} -which must be rewritten as: -\begin{equation} - x_{i} = \left [ I - \Delta t A \right ]^{-1} x_{i-1} + \Delta t B_{i} u -\end{equation} -for the purposes of implementation. - -The explicit method gives simple implementation whereas the implicit -method requires matrix inversion. However, the explicit method is only -stable if: -\begin{equation} - \Delta t < \frac{2}{| \lambda |} -\end{equation} -where $\lambda$ is the \emph{largest} eigenvalue of $A$. If this -largest eigenvalue is real so $\lambda = \frac{1}{\tau}$ where $\tau$ -is the \emph{smallest} system time constant: -\begin{equation} - \Delta t < 2 \tau -\end{equation} - -If the system is stiff, that is it contains at least one small time -constant relative to the dominant time constants, Euler integration is -not feasible due to the very small sample interval $\Delta t$ -required. - -In contrast, the implicit method is stable. - - -\subsubsection{Example} - The acausal bond graph of system \textbf{ImplicitRC} is - displayed in Figure \Ref{fig:ImplicitRC_abg.ps} and its label - file is listed in Section \Ref{sec:ImplicitRC_lbl} - The subsystems are listed in Section \Ref{sec:ImplicitRC_sub}. - -The system represents two simple RC circuits in series with -differential equations as given in Section \Ref{sec:ImplicitRC_ode-noargs.tex} and -transfer function as given in Section \Ref{sec:ImplicitRC_tf-noargs.tex}. - -For the purposes of this example the two time constants are $1$ and -$\epsilon=10^{-3}$ -- this is a stiff system. All of the simulations -use a sample interval of $\Delta t = 0.1$ ang the input is a unit -step. Section \Ref{sec:ImplicitRC_sro-noargs.ps} shows the exact (computed from -the matrix exponential) solution, and Section {sec:ImplicitRC_odeso-cc.ps} -shows the solution by implicit integration. - -The explicit solution is not shown, but was found to be unstable for -$\Delta t > 0.002$ as predicted. - -\subsection{Implicit integration - the nonlinear case}} -\label{sec:nonlinear} - -Consider the \emph{nonlinear} system: -\begin{equation} - \label{eq:sys} - \dot x = f(x,u) -\end{equation} -and suppose it can be linearised about any state and input to give: -\begin{equation} - A(x,u) = \frac{\partial f(x,u)}{\partial x} -\end{equation} - -The corresponding \emph{implicit} scheme is: -\begin{equation} - x_{i} = x_{i-1} + \Delta t f(x_{i},u_{i}) -\end{equation} -This is not easy to solve in general due to the set of non-linear -equations that need to be solved. To avoid this, consider a further -approximation: -\begin{equation} - f(x_{i},u_{i}) \approx f(x_{i-1},u_{i}) + A(x_{i-1},u_i) ( x_{i} - x_{i-1} ) -\end{equation} -This then gives the \emph{semi-implicit} scheme -\begin{equation} - x_{i} = x_{i-1} + \Delta t \left [ f(x_{i-1},u_{i}) + A(x_{i-1},u_i) ( - x_{i} - x_{i-1} ) \right ] -\end{equation} -which can be rewritten as: -\begin{equation}\label{eq:implicit} - x_{i} = \left [ I - \Delta t A(x_{i-1},u_i) \right ]^{-1} - \Delta t \left [ f(x_{i-1},u_{i}) - A(x_{i-1},u_i) x_{i-1} \right ] -\end{equation} - - -Because of the approximations invoved, Equation \ref{eq:implicit} is -not guarenteed to be stable. Nevertheless, it should do a much better -job than the corresponding \emph{explicit} method for reasonably -smooth systems. -This method is chosen by setting -\begin{verbatim} -METHOD='Implicit' -\end{verbatim} -in the MTT simpar.txt file. - -A further approximation arises by setting $A(x_{i-1},u_i) = -A(x_{0},u_0)$ ie computing it one only at the beginning of the -simulation. -This method is chosen by setting -\begin{verbatim} -METHOD='ImplicitL' -\end{verbatim} -in the MTT simpar.txt file. - -Both methods make use of the \textbf{smx} ``state-matrix with state $x$'' -representation of MTT which is generated symbolically from the system -bond graph. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_lbl.txt Index: mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_lbl.txt +++ mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_lbl.txt @@ -1,30 +0,0 @@ -%SUMMARY ImplicitRC -%DESCRIPTION -%% Label file for system ImplicitRC (ImplicitRC_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type RC - fast lin epsilon;1 - slow lin 1;1 - -% Component type SS - u SS external - y SS external - - - - - DELETED mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_numpar.txt Index: mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_numpar.txt +++ mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_numpar.txt @@ -1,18 +0,0 @@ -# Numerical parameter file (ImplicitRC_numpar.txt) -# Generated by MTT at Wednesday June 24 09:21:23 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:06:50 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -epsilon = 1e-3; # ImplicitRC -## Removed by MTT on Sun Aug 17 13:59:26 BST 2003: ## Removed by MTT on Sun Aug 17 13:59:26 BST 2003: c = 1.0; -## Removed by MTT on Sun Aug 17 13:59:26 BST 2003: r = 1.0; - DELETED mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_rep.txt Index: mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_rep.txt +++ mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_rep.txt @@ -1,28 +0,0 @@ -# Outline report file for system ImplicitRC (ImplicitRC_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2003/08/17 17:03:02 gawthrop -% %% Updated for new MTT -% %% -% %% Revision 1.1 2000/12/28 18:06:50 peterg -% %% To RCS -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt ImplicitRC abg tex -mtt ImplicitRC struc tex -mtt ImplicitRC ode tex -mtt ImplicitRC sm tex -mtt ImplicitRC sm m -mtt ImplicitRC tf tex - -mtt ImplicitRC sro ps - -mtt ImplicitRC numpar tex - -mtt ImplicitRC simpar tex -mtt ImplicitRC odeso ps DELETED mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_simpar.txt Index: mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_simpar.txt +++ mttroot/mtt/lib/examples/Simulation/ImplicitRC/ImplicitRC_simpar.txt @@ -1,15 +0,0 @@ -%% Simulation parameters for system ImplicitRC (ImplicitRC_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/08/12 13:29:02 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=10.0 -DT=0.1 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Simulation/ImplicitRC/examples.sh Index: mttroot/mtt/lib/examples/Simulation/ImplicitRC/examples.sh ================================================================== --- mttroot/mtt/lib/examples/Simulation/ImplicitRC/examples.sh +++ mttroot/mtt/lib/examples/Simulation/ImplicitRC/examples.sh @@ -1,28 +0,0 @@ -#! /bin/sh - -mv ImplicitRC_simpar.txt SAVE -Delta="0.01 0.2 1.0" -for delta in $Delta; do - echo Doing with sample interval = $delta - - cp SAVE ImplicitRC_simpar.txt -cat <>ImplicitRC_simpar.txt -DT=$delta -EOF - mtt -q ImplicitRC odeso dat - cp ImplicitRC_odeso.dat ImplicitRC_odeso.$delta -done - -gnuplot < -%ALIAS in|out Th_out,Hy_out -%% Label file for system In (In_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/07/04 09:41:53 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type SS - [Hy_out] SS external,external - [Th_out] SS external,external - Hy_in SS p_1,internal - Th_in SS t_1,internal - DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_abg.fig Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_abg.fig +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_abg.fig @@ -1,24 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2700 900 2700 2250 2925 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2700 2700 2700 4050 2925 3825 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4050 2475 5400 2475 5175 2700 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6795 5175 6795 225 1350 225 1350 5175 6795 5175 -4 1 4 0 0 22 20 0.0000 4 270 900 2745 720 SS:[in]\001 -4 1 -1 0 0 22 20 0.0000 4 210 2325 2880 2565 PS:PowerSensor\001 -4 1 4 0 0 22 20 0.0000 4 270 420 2385 2250 [in]\001 -4 1 4 0 0 22 20 0.0000 4 270 615 2385 2835 [out]\001 -4 1 4 0 0 22 20 0.0000 4 270 1035 3735 2250 [power]\001 -4 1 -1 0 0 22 20 0.0000 4 210 1095 6030 2565 Df:Work\001 -4 1 -1 0 0 22 20 0.0000 4 270 630 2655 4410 R:r_l\001 DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Load_lbl.txt @@ -1,36 +0,0 @@ -%% Label file for system Load (Load_lbl.txt) -%SUMMARY Load -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in - -% Argument aliases -%ALIAS $1 r_l - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - - - PowerSensor - -% Component type Df - Work SS external - -% Component type R - r_l lin flow,r_l - -% Component type SS - [in] SS external,external DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_abg.fig Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_abg.fig +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_abg.fig @@ -1,21 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2252 4952 3197 4952 3017 5132 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 5400 5625 5400 1530 675 1530 675 5625 5400 5625 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2205 2250 3150 2250 2970 2430 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2250 4725 2250 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2250 2250 2250 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2250 1980 2250 2250 -4 0 -1 0 0 0 20 0.0000000 4 240 1290 3465 2340 SS:Th_out\001 -4 0 -1 0 0 0 20 0.0000000 4 270 1320 3375 5040 SS:Hy_out\001 -4 2 4 0 0 0 20 0.0000000 4 270 1380 2160 5040 SS:[Hy_in]\001 -4 2 4 0 0 0 20 0.0000000 4 240 1350 2115 2340 SS:[Th_in]\001 DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_desc.tex Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_desc.tex +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system Out (Out_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:44 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Out} is - displayed in Figure \Ref{Out_abg} and its label - file is listed in Section \Ref{sec:Out_lbl}. - The subsystems are listed in Section \Ref{sec:Out_sub}. DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Out_lbl.txt @@ -1,25 +0,0 @@ -%SUMMARY Out: Outflow conditions -%DESCRIPTION -%ALIAS in Th_in,Hy_in -%% Label file for system Out (Out_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type SS - [Hy_in] SS external,external - [Th_in] SS external,external - Hy_out SS p_1,internal - Th_out SS t_1,internal - DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_abg.fig Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_abg.fig +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_abg.fig @@ -1,27 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 1620 2700 2970 2700 2745 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 2700 4725 2700 4500 2925 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 2925 3150 4275 3375 4050 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3150 2475 3150 1125 3375 1350 -2 4 0 2 31 7 50 0 -1 0.000 0 0 7 0 0 5 - 6075 4950 6075 450 450 450 450 4950 6075 4950 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 3375 2475 4330 1520 4330 1839 -4 1 0 100 0 18 18 0.0000 4 195 150 3150 2790 1\001 -4 1 0 100 0 18 18 0.0000 4 270 540 3150 990 I:j_s\001 -4 1 4 100 0 18 18 0.0000 4 270 870 1170 2790 SS:[in]\001 -4 1 4 100 0 18 18 0.0000 4 270 1065 5310 2790 SS:[out]\001 -4 1 4 100 0 18 18 0.0000 4 270 1215 3195 4680 SS:[load]\001 -4 1 0 100 0 18 18 0.0000 4 270 1245 4455 1395 Df:speed\001 DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/Shaft_lbl.txt @@ -1,35 +0,0 @@ -%% Label file for system Shaft (Shaft_lbl.txt) -%SUMMARY Shaft -%DESCRIPTION - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in in -%ALIAS load load -%ALIAS out out - -% Argument aliases -%ALIAS $1 j_s - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - speed SS external - -% Component type I - j_s lin flow,j_s - -% Component type SS - [in] SS external,external - [load] SS external,external - [out] SS external,external DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_abg.fig Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_abg.fig +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_abg.fig @@ -1,45 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6078 1803 6078 2944 6303 2719 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4230 3375 5584 3375 5359 3600 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6750 3375 8104 3375 7879 3600 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1575 3375 2704 3375 2479 3600 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9450 3375 10579 3375 10354 3600 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 4 - 8550 3870 8550 5850 6975 5850 7200 6075 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 4 - 5175 5850 3375 5850 3375 3825 3600 4050 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6075 6284 6075 7425 6300 7200 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 12152 8550 12152 675 225 675 225 8550 12152 8550 -4 1 4 0 0 2 12 0.0000 4 180 540 8510 3740 [Shaft]\001 -4 1 4 0 0 2 12 0.0000 4 180 540 3379 3739 [Shaft]\001 -4 1 1 1 0 2 30 0.0000 4 300 210 2162 3017 1\001 -4 1 1 1 0 2 30 0.0000 4 300 210 4817 3017 2\001 -4 1 1 1 0 2 30 0.0000 4 300 210 7292 3017 3\001 -4 1 1 1 0 2 30 0.0000 4 300 210 9947 3017 4\001 -4 1 4 0 0 2 12 0.0000 4 180 540 6078 3198 [Heat]\001 -4 1 -1 0 0 22 20 0.0000 4 210 570 1217 3467 In:in\001 -4 1 -1 0 0 2 20 0.0000 4 195 1050 6167 3467 Comb:c1\001 -4 0 -1 0 0 22 20 0.0000 4 210 1005 10758 3468 Out:out\001 -4 1 -1 0 0 2 20 0.0000 4 255 1455 3469 3469 Pump:comp\001 -4 1 -1 0 0 2 20 0.0000 4 255 1335 8780 3470 Pump:turb\001 -4 1 4 0 0 2 12 0.0000 4 180 465 6075 6165 [load]\001 -4 1 -1 0 0 22 20 0.0000 4 210 1500 6078 5943 Shaft:shaft\001 -4 1 -1 0 0 22 20 0.0000 4 210 1380 6075 7740 Load:load\001 -4 1 1 1 0 3 25 0.0000 4 270 1425 6030 8145 Work out\001 -4 1 -1 0 0 22 20 0.0000 4 210 1185 6030 1665 Fuel:fuel\001 -4 1 1 1 0 3 25 0.0000 4 270 1140 5985 1215 Heat in\001 DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_desc.tex Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_desc.tex +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_desc.tex @@ -1,123 +0,0 @@ -% -*-latex-*- used to set EMACS into LaTeX-mode -% Verbal description for system SimpleGasTurbine (SimpleGasTurbine_desc.tex) -% Generated by MTT on Tue Jan 13 18:01:55 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/05/18 15:45:50 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{SimpleGasTurbine} is - displayed in Figure \Ref{SimpleGasTurbine_abg} and its label - file is listed in Section \Ref{sec:SimpleGasTurbine_lbl}. - The subsystems are listed in Section \Ref{sec:SimpleGasTurbine_sub}. - - \textbf{SimpleGasTurbine} can be regarded as an single-spool gas - turbine (producing shaft power) with an ideal-gas working fluid. It - corresponds to the simple Joule Cycle as described in Chapter 12 of - Rogers and Mayhew and in Chapter 2 of Cohen, Rogers and - Saravanamutto. However, unlike those examples, the system is - written with dynamics in mind. - - The system is described using an energy Bond Graph- this ensures - that the first law is observed. In particular transformers are used - to explicitly convert between energy covariables. Although this is - a simple model, I believe that it provides the basis for building - complex thermodynamic systems involving gas power cycles. - - -There are five main components: -\begin{enumerate} -\item p1 -- a \textbf{Pump} component representing the compressor - stage. This converts shaft work to energy flow in the working fluid. -\item c1 -- a \textbf{Comb} component representing the combustion - chamber. This converts the heat obtained by burning fuel to energy - flow in the working fluid. -\item t1 -- a \textbf{Turb} component representing the turbine - component. This converts the energy flow in the working fluid to - shaft work -\item j\_s -- an \textbf{I} component representing the combined inertia - of the shaft and compressor and turbine rotors. -\item a \textbf{Load} component to absorb the shaft power. -\end{enumerate} -The components \textbf{In} and \textbf{Out} provide the inlet and -outlet conditions. - -Both \textbf{Pump} and \textbf{Turb} are implemented with the -\emph{polytropic} constitutive relationship with index $n$. When -$n=\gamma=\frac{c_p}{c_v}$ this corresponds to isentropic compression -and expansion and thus the \textbf{SimpleGasTurbine} achieves its -cycle efficiency. However, other values of $n$ can be used to account -for isentropic efficiency of less than unity. - -To obtain a very simple dynamic model (and to avoid the need for an -accurate combustion chamber model) there are no dynamics associated -with the combustion chamber, but rahter it is assumed that the -corresponding temperature is imposed on the component (that is $T_3$ -is the system input) the corresponding heat flow is then an output. - -Both heat input and work output are measured using the \textbf{PS} -(power sensor) component, that for work output is embedded in the -\textbf{Load} component. These can be monitored to give the efficiency -of the \textbf{SimpleGasTurbine}. - -A symbolic steady-state for the model was computed -- see Section -\ref{sec:SimpleGasTurbine_ss.tex}. In particular, the load -resistance was chosen to absorb all the generated work at the steady -state and the shaft inertia was chosen to give a unit time constant -for the linearised system. The mass flow and shaft speeds were taken -as unity. - -For the purposed of simulation, the numerical values given in Examples -12.1 of Chapter 12 of Rogers and Mayhew, except that the isentropic -efficiencies are 100\% ($n=\gamma$) -- see Section -\ref{sec:SimpleGasTurbine_numpar.tex}. - -Simulations were performed starting at the steady state and increasing -the combustion chamber temperature by 10\% at $t=1$ and reducing by -10\% at $t=5$. Graphs of the various outputs are plotted: -\begin{itemize} -\item Figure - \Ref{fig:SimpleGasTurbine_odeso-SimpleGasTurbine-comp-1-T,SimpleGasTurbine-c1-1-T,SimpleGasTurbine-turb-1-T.ps} - -- the temperatures at the output of the - \begin{itemize} - \item compressor, - \item combustion chamber and - \item turbine - \end{itemize} -\item Figure - \Ref{fig:SimpleGasTurbine_odeso-SimpleGasTurbine-fuel-1-Heat-1-y,SimpleGasTurbine-load-1-Work-1-y.ps} - -- the heat input and work output -\item Figure - \Ref{fig:SimpleGasTurbine_odeso-SimpleGasTurbine-shaft-1-speed-1-y.ps} -- the shaft speed and -\item Figure - \Ref{fig:SimpleGasTurbine_odeso-SimpleGasTurbine-c1-1-P.ps} - -- the pressure at the output of the - \begin{itemize} - \item compressor, - \item combustion chamber and - \item turbine - \end{itemize} -\end{itemize} - -This model can be modified extended in various ways to yield related -dynamic systems. For example: -\begin{itemize} -\item an air cooler is obtained by changing the direction of heat and - work flows -\item additional \textbf{Turb} and \textbf{Comb} components add reheat - to the cycle -\item an isentropic nozzle can be added and the work output removed - to give a jet engine. -\end{itemize} - - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_input.txt Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_input.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_input.txt @@ -1,20 +0,0 @@ -# Numerical parameter file (SimpleGasTurbine_input.txt) -# Generated by MTT at Tue Mar 31 12:38:39 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:08:28 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -t_3 = 1000; - -# Set the inputs -## Removed by MTT on Mon Nov 27 15:18:54 GMT 2000: u(1) = t_3 + 0.1*t_3*(t>1) - 0.2*t_3*(t>5); # SimpleGasTurbine (T3) -## Removed by MTT on Wed Jun 11 15:42:11 BST 2003: simplegasturbine_fuel_1_t3_1_u = t_3 + 0.1*t_3*(t>1) - 0.2*t_3*(t>5); - -simplegasturbine__fuel__t3__u = t_3 + 0.1*t_3*(t>1) - 0.2*t_3*(t>5); DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_lbl.txt @@ -1,91 +0,0 @@ -#SUMMARY SimpleGasTurbine: single-spool gas turbine producing shaft power -#DESCRIPTION SimpleGasTurbine can be regarded as an single-spool gas -#DESCRIPTION turbine (producing shaft power) with an ideal-gas working fluid. It -#DESCRIPTION corresponds to the simple Joule Cycle as described in Chapter 12 of -#DESCRIPTION Rogers and Mayhew and in Chapter 2 of Cohen, Rogers and -#DESCRIPTION Saravanamutto. However, unlike those examples, the system is -#DESCRIPTION written with dynamics in mind. - -## Explicitly copy appropriate components -#ALIAS Pump CompressibleFlow/Pump -#ALIAS Comb CompressibleFlow/Comb - -#PAR t_2 -#PAR t_3 -#PAR t_4 -#PAR p_2 -#PAR p_3 -#PAR p_4 -#PAR mdot -#PAR gamma_0 -#PAR q_0 -#PAR w_0 -#PAR omega_0 -#PAR r_p -#PAR c_p -#PAR mom_0 - -#NOTPAR density -#NOTPAR ideal_gas -#NOTPAR q_0 - -## Label file for system SimpleGasTurbine (SimpleGasTurbine_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.5 2000/12/28 18:08:28 peterg -# ## To RCS -# ## -# ## Revision 1.4 1998/07/30 15:27:42 peterg -# ## Use #VAR inplace of dummy component. -# ## -# ## Revision 1.3 1998/07/03 14:54:45 peterg -# ## k_p --> k -# ## k_t --> k -# ## -# ## Revision 1.2 1998/07/03 14:53:38 peterg -# ## Renames tank to comb to be consistent. -# ## -# ## Revision 1.1 1998/05/18 15:46:02 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - -# Component type Fuel - fuel - -# Component type In - in - -# Component type Pump - comp none c_v;density,ideal_gas,r;alpha;effort,k - -# Component type Comb - c1 none m_c;v_c;r - -# Component type Pump - turb none c_v;density,ideal_gas,r;alpha;effort,k - -# Component type Out - out - -# Component type Shaft - shaft none j_s - -# Component type Load - load none r_l - - - - - - - DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt @@ -1,59 +0,0 @@ -# Numerical parameter file (SimpleGasTurbine_numpar.txt) -# Generated by MTT at Tue Mar 31 12:15:00 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:08:28 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_p = 1005.0; -c_v = 718.0; -gamma_0 = c_p/c_v; -alpha = (gamma_0-1)/gamma_0; -k = 1.0; -p_1 = 1e5; # 1 bar -p_4 = p_1; -r = c_p-c_v; -t_1 = 288.0; # In -v_c = 1.0; - -%Set the CC pressure and temperature -t_3 = 1000.0; -r_p = 6.0; -p_3 = r_p*p_1; - -%Find stored mass to give combustion chamber pressure p_3 (at -% temperature t_3 -m_c = (p_3*v_c)/(t_3*r); - -%Equate pressures -p_4 = p_1; -p_2 = p_3; - -%Compute ss temperatures (isentropic) -t_2 = t_1*pow((p_2/p_1),alpha); -t_4 = t_3*pow((p_4/p_3),alpha); - -%Find the steady-state work output -w_0 = c_p*(t_3-t_4) - c_p*(t_2-t_1); - -%Unit mass flow -mdot = 1; - -%Corresponding shaft speed -omega_0 = mdot/k; - -%Compute the corresponding load resistance (to absorb that work) -r_l = w_0/pow((omega_0),2); - -%Compute shaft inertia to give unit time constant (j_s*r_l) -j_s = r_l; - -%Find angular momentum to give shaft speed omega_0 -mom_0 = omega_0*j_s; DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_rep.txt Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_rep.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_rep.txt @@ -1,43 +0,0 @@ -# Outline report file for system SimpleGasTurbine (SimpleGasTurbine_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 2003/06/11 16:10:37 gawthrop -% %% Updated examples for latest MTT. -% %% -% %% Revision 1.2 2000/12/28 18:08:28 peterg -% %% To RCS -% %% -% %% Revision 1.1 2000/11/27 18:16:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -o -ss SimpleGasTurbine abg tex -mtt -o -ss SimpleGasTurbine struc tex -mtt -o -ss SimpleGasTurbine sympar tex -mtt -o -ss SimpleGasTurbine ode tex - -mtt -o -ss SimpleGasTurbine sspar r -mtt -o -ss SimpleGasTurbine ss tex -mtt -o -ss SimpleGasTurbine sm tex - -mtt -o -ss SimpleGasTurbine numpar tex -mtt -o -ss SimpleGasTurbine input tex -mtt -o -ss SimpleGasTurbine state tex -mtt -o -ss SimpleGasTurbine simpar tex -mtt -o -ss SimpleGasTurbine odeso ps 'SimpleGasTurbine__comp__T,SimpleGasTurbine__c1__T,SimpleGasTurbine__turb__T' - -mtt -o -ss SimpleGasTurbine odeso ps 'SimpleGasTurbine_fuel_1_Heat_1_y,SimpleGasTurbine_load_1_Work_1_y' - -mtt -o -ss SimpleGasTurbine odeso ps 'SimpleGasTurbine_shaft_1_speed_1_y' - -mtt -o -ss SimpleGasTurbine odeso ps 'SimpleGasTurbine_c1_1_P' - - - - - DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_simp.r Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_simp.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_simp.r +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_simp.r @@ -1,11 +0,0 @@ -%% Reduce commands to simplify output for system SimpleGasTurbine (SimpleGasTurbine_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LET c_v = c_p - r; -END; DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r @@ -1,51 +0,0 @@ -% Steady-state parameter file (SimpleGasTurbine_sspar.r) -% Generated by MTT at Thu Mar 26 16:28:59 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 2000/12/28 18:08:28 peterg -% % To RCS -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%Find stored mass to give combustion chamber pressure p_3 (at -% temperature t_3 -m_c := (p_3*v_c)/(t_3*r); - -%Equate pressures -p_4 := p_1; -p_2 := p_3; - -%Compute ss temperatures (isentropic) -t_2 := t_1*pow((p_2/p_1),alpha); -t_4 := t_3*pow((p_4/p_3),alpha); - -%Find the steady-state work output -w_0 := c_p*(t_3-t_4) - c_p*(t_2-t_1); - -%Compute the corresponding load resistance (to absorb that work) -r_l := w_0/pow((omega_0),2); - -%Unit mass flow -mdot := 1; - -%Corresponding shaft speed -omega_0 := mdot/k; - -%Compute shaft inertia to give unit time constant (j_s*r_l) -j_s := r_l; - -%Find angular momentum to give shaft speed omega_0 -mom_0 := omega_0*j_s; - -% Steady-state states -MTTX1 := mom_0; - -% Steady-state inputs - combustion temperature -MTTU1 := t_3; % SimpleGasTurbine (T3) - -;;END; - DELETED mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_state.txt Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_state.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_state.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_state.txt @@ -1,19 +0,0 @@ -# State initialisation file (SimpleGasTurbine_state.txt) -# Generated by MTT at Tue Mar 31 12:37:17 BST 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:08:28 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -# Set the states -## Removed by MTT on Mon Nov 27 15:20:21 GMT 2000: x(1) = j_s/k ; # SimpleGasTurbine (j_s) - -## Removed by MTT on Wed Jun 11 15:41:26 BST 2003: simplegasturbine_shaft_1_j_s = j_s/k ; -simplegasturbine__shaft__j_s = j_s/k; DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_abg.fig @@ -1,32 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 1351 4051 1351 3826 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4051 1126 4051 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2027 2702 4052 2702 3827 2927 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 2702 6976 2702 6751 2927 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 1351 6976 1351 6751 1576 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8550 3375 8550 405 450 405 450 3375 8550 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 2475 4050 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 2475 4950 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 1125 4950 1575 -4 2 4 0 0 0 20 0.0000000 4 240 930 4096 991 [Th_in]\001 -4 2 -1 0 0 22 20 0.0000000 4 285 1065 1936 1441 SS:Th_in\001 -4 2 -1 0 0 22 20 0.0000000 4 285 1080 1937 2792 SS:Hy_in\001 -4 2 4 0 0 0 20 0.0000000 4 270 960 4097 2342 [Hy_in]\001 -4 0 -1 0 0 22 20 0.0000000 4 285 1215 7111 1441 SS:Th_out\001 -4 0 4 0 0 0 20 0.0000000 4 240 1080 4951 991 [Th_out]\001 -4 0 4 0 0 0 20 0.0000000 4 270 1110 4951 2342 [Hy_out]\001 -4 0 -1 0 0 22 20 0.0000000 4 285 1230 7111 2792 SS:Hy_out\001 -4 1 -1 0 0 22 20 0.0000000 4 285 1110 4545 1980 Pipe:pipe\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_lbl.txt @@ -1,29 +0,0 @@ -%SUMMARY TestPipe -%DESCRIPTION -%% Label file for system TestPipe (TestPipe_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1998/11/20 08:02:53 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%ALIAS Pipe IncompressibleFlow/Pipe - -% Component type Pipe - pipe lin rho;c_p;lin,r - -% Component type SS - Hy_in SS external,external - Hy_out SS external,external - Th_in SS external,external - Th_out SS external,external DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_rep.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_rep.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPipe/TestPipe_rep.txt @@ -1,26 +0,0 @@ -# Outline report file for system TestPipe (TestPipe_rep.txt) -# Generated by MTT on" Fri Nov 20 08:16:40 GMT 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt TestPipe abg tex # The system description -mtt TestPipe cbg ps # The causal bond graph -# Uncomment the following lines or add others -mtt TestPipe struc tex # The system structure -mtt TestPipe dae tex # The system dae -# mtt TestPipe ode tex # The system ode -# mtt TestPipe sspar tex # Steady-state parameters -# mtt TestPipe ss tex # Steady state -# mtt TestPipe dm tex # Descriptor matrices (of linearised system) -# mtt TestPipe sm tex # State matrices (of linearised system) -# mtt TestPipe tf tex # Transfer function (of linearised system) -# mtt TestPipe lmfr ps # log modulus of frequency response (of linearised system) -# mtt TestPipe simpar tex # Simulation parameters -# mtt TestPipe numpar tex # Numerical simulation parameters -# mtt TestPipe input tex # Simulation input -# mtt TestPipe odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_abg.fig @@ -1,38 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 1351 4051 1351 3826 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2027 2702 4052 2702 3827 2927 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 2702 6976 2702 6751 2927 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 1351 6976 1351 6751 1576 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8550 3375 8550 405 450 405 450 3375 8550 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 4500 4500 2475 4725 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4275 4500 4725 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 2475 4050 2925 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 2476 4950 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 1125 4950 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 1125 4050 1575 -4 2 4 0 0 0 20 0.0000 4 255 870 4096 991 [Th_in]\001 -4 2 -1 0 0 22 20 0.0000 4 270 1200 1936 1441 SS:Th_in\001 -4 2 -1 0 0 22 20 0.0000 4 270 1245 1937 2792 SS:Hy_in\001 -4 0 -1 0 0 22 20 0.0000 4 270 1395 7111 1441 SS:Th_out\001 -4 0 4 0 0 0 20 0.0000 4 255 1020 4951 991 [Th_out]\001 -4 0 -1 0 0 22 20 0.0000 4 270 1440 7111 2792 SS:Hy_out\001 -4 2 4 0 0 0 20 0.0000 4 255 885 3735 2565 [Hy_in]\001 -4 0 4 0 0 0 20 0.0000 4 255 1035 5355 2565 [Hy_out]\001 -4 1 4 0 0 0 20 0.0000 4 240 810 4545 2340 [Shaft]\001 -4 1 -1 0 0 22 20 0.0000 4 210 1200 4500 4815 SS:Shaft\001 -4 1 -1 0 0 22 20 0.0000 4 270 1740 4545 1980 lPump:pump\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_lbl.txt @@ -1,43 +0,0 @@ -%SUMMARY TestPump: test of incompressible-flow pump component -%DESCRIPTION -%% Label file for system TestPump (TestPump_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.5 1998/11/20 13:00:27 peterg -% %% Replaces Pump by lPump in ALIAS -% %% -% %% Revision 1.4 1998/11/20 08:31:24 peterg -% %% Fixed alias error -% %% -% %% Revision 1.3 1998/11/20 08:28:41 peterg -% %% Tidied -% %% -% %% Revision 1.2 1998/11/20 08:09:57 peterg -% %% Added alias for Pump -% %% -% %% Revision 1.1 1998/11/20 08:06:28 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%ALIAS lPump IncompressibleFlow/lPump - - -% Component type lPump - pump lin;lin rho;c_p;flow,r_p;k_p;flow,r_l - -% Component type SS - Hy_in SS external,external - Hy_out SS external,external - Shaft SS external,external - Th_in SS external,external - Th_out SS external,external DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_rep.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_rep.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestPump/TestPump_rep.txt @@ -1,26 +0,0 @@ -# Outline report file for system TestPump (TestPump_rep.txt) -# Generated by MTT on" Fri Nov 20 08:19:56 GMT 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt TestPump abg tex # The system description -mtt TestPump cbg ps # The causal bond graph -# Uncomment the following lines or add others -mtt TestPump struc tex # The system structure -#mtt TestPump dae tex # The system dae -mtt TestPump ode tex # The system ode -# mtt TestPump sspar tex # Steady-state parameters -# mtt TestPump ss tex # Steady state -# mtt TestPump dm tex # Descriptor matrices (of linearised system) -# mtt TestPump sm tex # State matrices (of linearised system) -# mtt TestPump tf tex # Transfer function (of linearised system) -# mtt TestPump lmfr ps # log modulus of frequency response (of linearised system) -# mtt TestPump simpar tex # Simulation parameters -# mtt TestPump numpar tex # Numerical simulation parameters -# mtt TestPump input tex # Simulation input -# mtt TestPump odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_abg.fig @@ -1,36 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 1351 4051 1351 3826 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2027 2702 4052 2702 3827 2927 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 2702 6976 2702 6751 2927 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4951 1351 6976 1351 6751 1576 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8550 3375 8550 405 450 405 450 3375 8550 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2025 1125 2025 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6975 1126 6975 1576 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6975 2476 6975 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2025 2476 2025 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4502 4500 4502 2475 4727 2700 -4 2 4 0 0 0 20 0.0000000 4 240 930 4096 991 [Th_in]\001 -4 2 -1 0 0 22 20 0.0000000 4 285 1065 1936 1441 SS:Th_in\001 -4 2 -1 0 0 22 20 0.0000000 4 285 1080 1937 2792 SS:Hy_in\001 -4 0 -1 0 0 22 20 0.0000000 4 285 1215 7111 1441 SS:Th_out\001 -4 0 4 0 0 0 20 0.0000000 4 240 1080 4951 991 [Th_out]\001 -4 0 -1 0 0 22 20 0.0000000 4 285 1230 7111 2792 SS:Hy_out\001 -4 1 -1 0 0 22 20 0.0000000 4 225 1140 4545 1980 Tank:tank\001 -4 1 4 0 0 0 20 0.0000000 4 240 1170 4590 2295 [Heat_in]\001 -4 2 4 0 0 0 20 0.0000000 4 270 960 3915 2565 [Hy_in]\001 -4 0 4 0 0 0 20 0.0000000 4 270 1110 5130 2565 [Hy_out]\001 -4 1 -1 0 0 0 20 0.0000000 4 240 1590 4500 4860 SS:[Heat_in]\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_lbl.txt @@ -1,37 +0,0 @@ -%SUMMARY TestTank: Equations for incompressible-flow Tank component -%DESCRIPTION -%% Label file for system TestTank (TestTank_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/11/20 08:36:30 peterg -% %% Corrected alias -% %% -% %% Revision 1.2 1998/11/20 08:09:20 peterg -% %% Added alias for Tank -% %% -% %% Revision 1.1 1998/11/20 08:07:20 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%ALIAS Tank IncompressibleFlow/Tank - -% Component type SS - Heat_in SS external,external - Hy_in SS external,external - Hy_out SS external,external - Th_in SS external,external - Th_out SS external,external - -% Component type Tank - tank none rho;c_p;c - DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_rep.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_rep.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Components/TestTank/TestTank_rep.txt @@ -1,26 +0,0 @@ -# Outline report file for system TestTank (TestTank_rep.txt) -# Generated by MTT on" Fri Nov 20 08:11:01 GMT 1998. - -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - -mtt TestTank abg tex # The system description -mtt TestTank cbg ps # The causal bond graph -# Uncomment the following lines or add others -mtt TestTank struc tex # The system structure -# mtt TestTank dae tex # The system dae -mtt TestTank ode tex # The system ode -# mtt TestTank sspar tex # Steady-state parameters -# mtt TestTank ss tex # Steady state -# mtt TestTank dm tex # Descriptor matrices (of linearised system) -# mtt TestTank sm tex # State matrices (of linearised system) -# mtt TestTank tf tex # Transfer function (of linearised system) -# mtt TestTank lmfr ps # log modulus of frequency response (of linearised system) -# mtt TestTank simpar tex # Simulation parameters -# mtt TestTank numpar tex # Numerical simulation parameters -# mtt TestTank input tex # Simulation input -# mtt TestTank odeso ps # Simulation output DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2253 2253 3198 2253 3018 2433 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2252 4952 3197 4952 3017 5132 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3196 2026 3196 2476 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3195 4725 3195 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3602 4950 4547 4950 4367 5130 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3602 2250 4547 2250 4367 2430 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 7200 5670 7200 1530 675 1530 675 5670 7200 5670 -4 2 -1 0 0 0 20 0.0000 4 255 1095 2026 2341 SS:Th_in\001 -4 2 -1 0 0 0 20 0.0000 4 255 1110 2071 5041 SS:Hy_in\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 3376 5041 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 3376 2341 0\001 -4 0 4 0 0 0 20 0.0000 4 255 2235 4727 5042 SS:[Hydraulic_out]\001 -4 0 4 0 0 0 20 0.0000 4 255 2085 4772 2342 SS:[Thermal_out]\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_desc.tex Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_desc.tex +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system In (In_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:36 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{In} is - displayed in Figure \Ref{In_abg} and its label - file is listed in Section \Ref{sec:In_lbl}. - The subsystems are listed in Section \Ref{sec:In_sub}. DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/In_lbl.txt @@ -1,27 +0,0 @@ -%SUMMARY In: Inflow conditions -%DESCRIPTION -%% Label file for system In (In_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%ALIAS out Thermal_out,Hydraulic_out -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - - - -% Component type SS - Hy_in SS p_0,external - Th_in SS t_0,external - [Hydraulic_out] SS external,external - [Thermal_out] SS external,external DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_abg.fig @@ -1,41 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6302 1127 6302 2252 6527 2027 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6077 1127 6527 1127 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9495 2700 10534 2703 10309 2928 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 6075 5175 3600 5175 3600 3150 3849 3399 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6076 5401 6526 5401 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 4950 6300 4050 6525 4275 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 - 8775 3150 8775 5175 6525 5175 6750 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6301 6299 6301 5399 6526 5624 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 2700 3060 2700 2835 2925 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4497 2698 5715 2700 5490 2925 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6930 2700 8145 2700 7920 2925 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11925 7200 11925 225 900 225 900 7200 11925 7200 -4 1 4 0 0 2 16 0.0000 4 210 750 3602 3062 [Shaft]\001 -4 1 4 0 0 2 16 0.0000 4 225 1005 6302 2477 [Heat_in]\001 -4 1 4 0 0 2 16 0.0000 4 210 750 8733 3063 [Shaft]\001 -4 1 -1 0 0 2 20 0.0000 4 255 1185 3737 2792 lPump:p1\001 -4 1 -1 0 0 22 20 0.0000 4 210 1110 6257 1037 SS:Heat\001 -4 1 -1 0 0 22 20 0.0000 4 195 150 6301 5266 1\001 -4 1 -1 0 0 22 20 0.0000 4 210 1170 6391 6751 SS:Work\001 -4 1 -1 0 0 22 20 0.0000 4 270 555 6300 3915 I:j_s\001 -4 1 -1 0 0 2 20 0.0000 4 195 1065 6302 2792 Tank:C1\001 -4 1 -1 0 0 2 20 0.0000 4 255 1140 8868 2793 lPump:t1\001 -4 1 -1 0 0 22 20 0.0000 4 210 570 1620 2790 In:in\001 -4 1 -1 0 0 22 20 0.0000 4 210 1005 11116 2791 Out:out\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_desc.tex Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_desc.tex +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_desc.tex @@ -1,37 +0,0 @@ -% -*-latex-*- used to set EMACS into LaTeX-mode -% Verbal description for system LiquidTurbine (LiquidTurbine_desc.tex) -% Generated by MTT on Tue Jan 13 18:01:55 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{LiquidTurbine} is - displayed in Figure \Ref{LiquidTurbine_abg} and its label - file is listed in Section \Ref{sec:LiquidTurbine_lbl}. - The subsystems are listed in Section \Ref{sec:LiquidTurbine_sub}. - -\textbf{LiquidTurbine} can be regarded as a single-spool gas turbine -with an incompressible working fluid. Of course, such a device cannot -convert heat to work; however, it provides a useful first step towards -modelling a gas turbine. - -There are three main components: -\begin{enumerate} -\item p1 -- a leaky pump \textbf{lPump} component. This is analogous - to the gas turbine compressor. -\item c1 -- a tank \textbf{Tank} component. This is analogous - to the gas turbine combustion chamber. -\item t1 -- a leaky turbine \textbf{lTurb} component. This is analogous - to the gas turbine turbine. -\end{enumerate} -The components \textbf{In} and \textbf{Out} provide the inlet and -outlet conditions. - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_lbl.txt @@ -1,46 +0,0 @@ -%SUMMARY LiquidTurbine -%DESCRIPTION -%% Label file for system LiquidTurbine (LiquidTurbine_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%ALIAS lPump IncompressibleFlow/lPump -%ALIAS Tank IncompressibleFlow/Tank - -%VAR p_0 -%VAR q_0 -%VAR t_0 - - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -% Component type I - j_s lin flow,j_s - -% Component type Pump - p1 lin;lin rho;c_p;flow,r_p;k_p;flow,r_pl - -% Component type SS - Heat SS external,external - Work SS external,external - -% Component type Turb - t1 lin;lin rho;c_p;flow,r_t;k_t;flow,r_tl - -% Component type Tank - C1 none rho;c_p;c_t - -% Component type In - in - -% Component type Out - out - DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_numpar.txt @@ -1,27 +0,0 @@ -# Numerical parameter file (LiquidTurbine_numpar.txt) -# Generated by MTT at Mon Mar 9 09:16:28 GMT 1998 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:11:16 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_p = 1.0; # LiquidTurbine -c_t = 1.0; # LiquidTurbine -j_s = 1.0; # LiquidTurbine -k_p = 1.0; # LiquidTurbine -k_t = 1.0; # LiquidTurbine -p_0 = 1e5; # In,Out -q_0 = 1e5; # Heat in -r_p = 1.0; # LiquidTurbine -r_pl = 100.0; # LiquidTurbine -r_t = 1.0; # LiquidTurbine -r_tl = 100.0; # LiquidTurbine -rho = 1.0; # LiquidTurbine -t_0 = 300.0; # In,Out DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_rep.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_rep.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_rep.txt @@ -1,30 +0,0 @@ -# Outline report file for system LiquidTurbine (LiquidTurbine_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1999/12/21 23:50:25 peterg -% %% Use compiled version -% %% -% %% Revision 1.1 1999/02/21 02:13:25 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -o -ss LiquidTurbine abg tex -mtt -o -ss LiquidTurbine struc tex -mtt -o -ss LiquidTurbine sympar tex -mtt -o -ss LiquidTurbine ss tex -mtt -o -ss LiquidTurbine ode tex - - -mtt -o -ss LiquidTurbine numpar txt -mtt -o -ss LiquidTurbine input txt - -mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__Heat' -mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__Work' -mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__in__Hy_in' -mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__out__Hy_out' -mtt -o -ss LiquidTurbine odeso ps 'LiquidTurbine__out__Th_out' DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_sspar.r Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_sspar.r +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/LiquidTurbine_sspar.r @@ -1,23 +0,0 @@ -% Steady-state parameter file (LiquidTurbine_sspar.r) -% Generated by MTT at Fri Nov 20 11:42:16 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 2000/12/28 18:11:16 peterg -% % To RCS -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Steady-state states -MTTX1 := 1; % LiquidTurbine (j_s) -MTTX2 := p_0*c_t/rho; % LiquidTurbine_C1 (tank) - pressure = p0 -MTTX3 := t_0*p_0*c_t*c_p; % LiquidTurbine_C1 (tank) - temp = t0 -% Steady-state inputs -MTTU1 := q_0; % LiquidTurbine (Heat) -MTTU2 := 0; % LiquidTurbine (Work) -;;END; DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2252 4952 3197 4952 3017 5132 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2205 2250 3150 2250 2970 2430 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2250 4725 2250 5175 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2205 2025 2205 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 4950 4545 4950 4365 5130 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3555 2250 4500 2250 4320 2430 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6075 5850 6075 1530 45 1530 45 5850 6075 5850 -4 2 4 0 0 0 20 0.0000 4 255 2085 2160 5040 SS:[Hydraulic_in]\001 -4 2 4 0 0 0 20 0.0000 4 255 1935 2115 2340 SS:[Thermal_in]\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 3375 5040 0\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 3375 2340 0\001 -4 0 -1 0 0 0 20 0.0000 4 255 1245 4590 2340 SS:Th_out\001 -4 0 -1 0 0 0 20 0.0000 4 255 1260 4635 5040 SS:Hy_out\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_desc.tex Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_desc.tex +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system Out (Out_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:44 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Out} is - displayed in Figure \Ref{Out_abg} and its label - file is listed in Section \Ref{sec:Out_lbl}. - The subsystems are listed in Section \Ref{sec:Out_sub}. DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/LiquidTurbine/Out_lbl.txt @@ -1,27 +0,0 @@ -%SUMMARY Out: Outflow conditions -%DESCRIPTION -%% Label file for system Out (Out_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - - -% Component type SS - Hy_out SS p_0,external - Th_out SS t_0,external - [Hydraulic_in] SS external,external - [Thermal_in] SS external,external - DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2253 2253 3198 2253 3018 2433 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2252 4952 3197 4952 3017 5132 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3196 2026 3196 2476 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3602 4950 4547 4950 4367 5130 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3602 2250 4547 2250 4367 2430 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 7200 5670 7200 1530 675 1530 675 5670 7200 5670 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2250 4725 2250 5175 -4 2 -1 0 0 0 20 0.0000 4 285 1140 2026 2341 SS:Th_in\001 -4 2 -1 0 0 0 20 0.0000 4 285 1125 2071 5041 SS:Hy_in\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 3376 5041 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 3376 2341 0\001 -4 0 4 0 0 0 20 0.0000 4 285 2295 4727 5042 SS:[Hydraulic_out]\001 -4 0 4 0 0 0 20 0.0000 4 285 2175 4772 2342 SS:[Thermal_out]\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_desc.tex Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_desc.tex +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system In (In_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:36 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{In} is - displayed in Figure \Ref{In_abg} and its label - file is listed in Section \Ref{sec:In_lbl}. - The subsystems are listed in Section \Ref{sec:In_sub}. DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/In_lbl.txt @@ -1,27 +0,0 @@ -%SUMMARY In: Inflow conditions -%DESCRIPTION -%% Label file for system In (In_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%ALIAS out Thermal_out,Hydraulic_out -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - - - -% Component type SS - Hy_in SS internal,external - Th_in SS external,internal - [Hydraulic_out] SS external,external - [Thermal_out] SS external,external DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_abg.fig @@ -1,29 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2252 4952 3197 4952 3017 5132 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2205 2250 3150 2250 2970 2430 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2250 4725 2250 5175 -2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2205 2025 2205 2475 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 4950 4545 4950 4365 5130 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3555 2250 4500 2250 4320 2430 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 6075 5850 6075 1530 45 1530 45 5850 6075 5850 -4 2 4 0 0 0 20 0.0000 4 285 2145 2160 5040 SS:[Hydraulic_in]\001 -4 2 4 0 0 0 20 0.0000 4 285 2025 2115 2340 SS:[Thermal_in]\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 3375 5040 0\001 -4 1 -1 0 0 0 20 0.0000 4 210 150 3375 2340 0\001 -4 0 -1 0 0 0 20 0.0000 4 285 1290 4590 2340 SS:Th_out\001 -4 0 -1 0 0 0 20 0.0000 4 285 1275 4635 5040 SS:Hy_out\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_desc.tex Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_desc.tex +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system Out (Out_desc.tex) -% Generated by MTT on Tue Jan 13 18:02:44 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Out} is - displayed in Figure \Ref{Out_abg} and its label - file is listed in Section \Ref{sec:Out_lbl}. - The subsystems are listed in Section \Ref{sec:Out_sub}. DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/Out_lbl.txt @@ -1,26 +0,0 @@ -%SUMMARY Out: Outflow conditions -%DESCRIPTION -%% Label file for system Out (Out_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - - -% Component type SS - Hy_out SS p_0,internal - Th_out SS t_0,internal - [Hydraulic_in] SS external,external - [Thermal_in] SS external,external DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_abg.fig @@ -1,39 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 6210 4140 6390 4365 -4 1 0 100 0 18 18 0.0000 4 195 150 6300 4365 0\001 --6 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9495 2700 10534 2703 10309 2928 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2025 2700 3060 2700 2835 2925 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4497 2698 5715 2700 5490 2925 -2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6930 2700 8145 2700 7920 2925 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 11925 7200 11925 225 900 225 900 7200 11925 7200 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6300 4050 6300 2925 6525 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6525 4275 7650 4275 7425 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4950 4275 6075 4275 5850 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2475 4275 3600 4275 3375 4500 -4 1 4 0 0 2 16 0.0000 4 240 1020 6302 2477 [Heat_in]\001 -4 1 -1 0 0 2 20 0.0000 4 210 1245 6302 2792 TankC:t1\001 -4 1 -1 0 0 2 20 0.0000 4 285 945 8868 2793 Pipe:p2\001 -4 1 -1 0 0 22 20 0.0000 4 225 600 1620 2790 In:in\001 -4 1 -1 0 0 22 20 0.0000 4 225 1080 11116 2791 Out:out\001 -4 1 -1 0 0 2 20 0.0000 4 285 945 3737 2792 Pipe:p1\001 -4 1 0 100 0 18 18 0.0000 4 210 1305 4275 4365 RS:heater\001 -4 1 0 100 0 18 18 0.0000 4 270 1020 1935 4365 Se:V_in\001 -4 1 0 100 0 18 18 0.0000 4 270 1215 8280 4365 De:T_out\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_desc.tex Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_desc.tex +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_desc.tex @@ -1,55 +0,0 @@ -% -*-latex-*- used to set EMACS into LaTeX-mode -% Verbal description for system ShowerHeater (ShowerHeater_desc.tex) -% Generated by MTT on Tue Jan 13 18:01:55 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{ShowerHeater} is - displayed in Figure \Ref{ShowerHeater_abg} and its label - file is listed in Section \Ref{sec:ShowerHeater_lbl}. - The subsystems are listed in Section \Ref{sec:ShowerHeater_sub}. - -\textbf{ShowerHeater} is a very elementary model of an electric heater suitable for -a shower. It illustates the use of bond graph components which are -internally pseudo, but externally true bond graphs -(temperature/entropy flow). - -There are three main components: -\begin{enumerate} -\item p1 and p2 -- a \textbf{Pipe} component (see Section - \Ref{sec:Pipe}). It is assumed that the pipes have zero flow - resistance and thus do not generate heat via flow resistance. -\item t1 -- a tank \textbf{Tank} component. -\item Heater -- a resistive heater modelled by the thermodynamic - \textbf{R} component \textbf{RS}. -\end{enumerate} -Other components could be added to represent thermal conduction and -thermal capacities. - -The components \textbf{In} and \textbf{Out} provide the inlet and -outlet conditions. - -The three inputs are -\begin{description} -\item[$u_1$] The flow rate -\item[$u_2$] The inlet temperature -\item[$u_3$] The voltage across the heating element. -\end{description} -The single output is -\begin{description} -\item[$y_1$] The outflow temperature -\end{description} -and the state is -\begin{description} -\item[$x_1$] The heat contained in the tank. -\end{description} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_input.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_input.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_input.txt @@ -1,17 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Input specification (ShowerHeater_input.txt) -# Generated by MTT at Tue Dec 14 10:03:59 EST 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 18:11:47 peterg -## To RCS -## -############################################################### - -# Set the inputs -showerheater__in__hy_in = 1e-4*(t>30); # Inflow -showerheater__in__th_in = 280; # In temperature -showerheater__v_in__u = 240*((t<60)&&(t>1)); # Input voltage DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_lbl.txt @@ -1,46 +0,0 @@ -#SUMMARY ShowerHeater -#DESCRIPTION -## Label file for system ShowerHeater (ShowerHeater_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.1 2000/12/28 18:11:47 peterg -# ## To RCS -# ## -# ############################################################### - -#NOTPAR t_0 - -#ALIAS Pipe IncompressibleFlow/Pipe - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - -# Component type Pipe - p1 lin rho;c_p;flow,0 - p2 lin rho;c_p;flow,0 - - -# Component type TankC - t1 TankC rho;c_p;v - -# Component type In - in - -# Component type Out - out - -# Component type RS - heater lin flow,r_h - -# Component type Se - V_in SS external - -# Component type De - T_out SS external DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_numpar.txt @@ -1,21 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Numerical parameter file (ShowerHeater_numpar.txt) -# Generated by MTT at Tue Dec 14 09:52:42 EST 1999 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:11:47 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Parameters -c_p = 4.184*1e3; # Specific heat -p_0 = 0.0; # Ambient pressure -r_h = 10.0; # Heater resistance -rho = 1e3; # Density -v = 1e-3; # Volume (1 lit) -t_0 = 1.0; # Added by MTT on Wed Aug 06 19:05:01 BST 2003 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_rep.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_rep.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_rep.txt @@ -1,26 +0,0 @@ -# Outline report file for system ShowerHeater (ShowerHeater_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 2000/12/28 18:11:47 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/02/21 02:13:25 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt ShowerHeater abg tex -mtt ShowerHeater struc tex -mtt ShowerHeater sympar tex -mtt ShowerHeater ode tex - - -mtt ShowerHeater numpar txt -mtt ShowerHeater input txt - -mtt ShowerHeater odeso ps - DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system ShowerHeater (ShowerHeater_simpar.txt) -# Generated by MTT on Tue Dec 14 10:05:57 EST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 100.0; # Last time in simulation -DT = 0.5; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt_old Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt_old ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt_old +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_simpar.txt_old @@ -1,18 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system ShowerHeater (ShowerHeater_simpar.txt) -# Generated by MTT on Tue Dec 14 10:05:57 EST 1999. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -############################################################### - - -LAST = 100.0; # Last time in simulation -DT = 0.5; # Print interval -STEPFACTOR = 1; # Integration steps per print interval -WMIN = -1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps -INPUT = 1; # Index of the input DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_sspar.r Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_sspar.r +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_sspar.r @@ -1,20 +0,0 @@ -% Steady-state parameter file (ShowerHeater_sspar.r) -% Generated by MTT at Fri Nov 20 11:42:16 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Steady-state states -MTTX1 := 1; % ShowerHeater (j_s) -MTTX2 := p_0*c/rho; % ShowerHeater_C1 (tank) - pressure = p0 -MTTX3 := t_0*p_0*c*c_p; % ShowerHeater_C1 (tank) - temp = t0 -% Steady-state inputs -MTTU1 := q_0; % ShowerHeater (Heat) -MTTU2 := 0; % ShowerHeater (Work) -;;END; DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_state.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_state.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_state.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/ShowerHeater_state.txt @@ -1,16 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Initial state file (ShowerHeater_state.txt) -# Generated by MTT at Tue Dec 14 10:06:08 EST 1999 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 18:11:47 peterg -## To RCS -## -############################################################### - -# Set the states -## Removed by MTT on Wed Aug 6 19:07:29 BST 2003: mttx(1) -showerheater__t1__tank = 280*rho*v*c_p; # Initial heat in tank DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_TankC_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_TankC_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_TankC_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_TankC_abg.fig @@ -1,81 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2430 2070 3600 3105 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2445 2477 3570 2477 3345 2702 -4 1 1 1 0 3 20 0.0000 4 210 180 2850 2297 T\001 -4 1 1 1 0 3 20 0.0000 4 210 150 2985 2387 1\001 -4 1 1 1 0 3 20 0.0000 4 210 150 2985 3062 1\001 -4 1 1 1 0 3 20 0.0000 4 210 180 2850 2927 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2850 2657 .\001 --6 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5865 2477 6990 2477 6765 2702 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4065 5627 6990 5627 6765 5852 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7440 2478 8565 2478 8340 2703 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9241 2479 10366 2479 10141 2704 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7440 5626 10365 5626 10140 5851 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 8609 6571 5864 6571 5864 1801 8609 1801 8609 6571 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6989 2701 7439 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7214 2702 7214 3827 7439 3602 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 5850 4050 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 1127 3825 2252 4050 2027 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4065 2475 5190 2475 4965 2700 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 12825 7155 12825 225 225 225 225 7155 12825 7155 -4 0 4 0 0 0 20 0.0000 4 285 2295 10546 5719 SS:[Hydraulic_out]\001 -4 0 4 0 0 0 20 0.0000 4 285 2175 10501 2569 SS:[Thermal_out]\001 -4 2 4 0 0 0 20 0.0000 4 285 2145 4019 5716 SS:[Hydraulic_in]\001 -4 1 -1 0 0 22 20 0.0000 4 225 390 5550 2567 ES\001 -4 1 1 1 0 3 20 0.0000 4 210 150 4606 5538 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 4471 5808 .\001 -4 1 1 1 0 3 20 0.0000 4 210 180 4471 5448 P\001 -4 1 1 1 0 3 20 0.0000 4 210 210 4471 6078 V\001 -4 1 4 0 0 0 20 0.0000 4 270 300 5280 2252 [s]\001 -4 1 4 0 0 0 20 0.0000 4 270 315 5820 2252 [e]\001 -4 1 1 1 0 3 20 0.0000 4 210 150 6406 2388 1\001 -4 1 1 1 0 3 20 0.0000 4 210 660 6584 2206 T - T\001 -4 1 1 1 0 3 20 0.0000 4 210 150 6899 2386 0\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6497 2659 .\001 -4 1 1 1 0 3 20 0.0000 4 210 195 6497 2929 E\001 -4 1 -1 0 0 22 20 0.0000 4 225 915 7214 4186 C:tank\001 -4 1 -1 0 0 22 20 0.0000 4 210 165 7215 5762 0\001 -4 1 -1 0 0 22 20 0.0000 4 225 390 8925 2568 ES\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9648 5811 .\001 -4 1 1 1 0 3 20 0.0000 4 210 180 9648 5451 P\001 -4 1 1 1 0 3 20 0.0000 4 210 210 9648 6081 V\001 -4 1 1 1 0 3 20 0.0000 4 210 150 9783 5541 2\001 -4 1 1 1 0 3 20 0.0000 4 210 195 7846 2930 E\001 -4 1 4 0 0 0 20 0.0000 4 270 315 8655 2208 [e]\001 -4 1 4 0 0 0 20 0.0000 4 270 300 9150 2208 [s]\001 -4 1 1 1 0 3 20 0.0000 4 210 180 9648 2301 T\001 -4 1 1 1 0 3 20 0.0000 4 210 150 9783 2391 2\001 -4 1 1 1 0 3 20 0.0000 4 210 180 9648 2931 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9648 2661 .\001 -4 1 1 1 0 3 20 0.0000 4 210 150 9783 3066 2\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7846 2660 .\001 -4 1 1 1 0 3 20 0.0000 4 210 660 7936 2209 T - T\001 -4 1 1 1 0 3 20 0.0000 4 210 150 8251 2389 0\001 -4 1 1 1 0 3 20 0.0000 4 210 150 7758 2391 2\001 -4 1 1 1 0 3 20 0.0000 4 285 2550 7259 6346 Pseudo Bond Graph\001 -4 1 4 0 0 0 20 0.0000 4 285 1530 3870 945 SS:[Heat_in]\001 -4 1 -1 0 0 22 20 0.0000 4 210 165 7245 2565 0\001 -4 1 -1 0 0 22 20 0.0000 4 210 165 3825 2565 0\001 -4 2 4 0 0 0 20 0.0000 4 285 2025 2385 2565 SS:[Thermal_in]\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_abg.fig Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_abg.fig +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_abg.fig @@ -1,81 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 2430 2070 3600 3105 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2445 2477 3570 2477 3345 2702 -4 1 1 1 0 3 20 0.0000 4 210 180 2850 2297 T\001 -4 1 1 1 0 3 20 0.0000 4 210 150 2985 2387 1\001 -4 1 1 1 0 3 20 0.0000 4 210 150 2985 3062 1\001 -4 1 1 1 0 3 20 0.0000 4 210 180 2850 2927 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 2850 2657 .\001 --6 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5865 2477 6990 2477 6765 2702 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4065 5627 6990 5627 6765 5852 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7440 2478 8565 2478 8340 2703 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 9241 2479 10366 2479 10141 2704 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7440 5626 10365 5626 10140 5851 -2 4 1 2 1 7 1 0 -1 6.000 0 0 7 0 0 5 - 8609 6571 5864 6571 5864 1801 8609 1801 8609 6571 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6989 2701 7439 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7214 2702 7214 3827 7439 3602 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4050 5850 4050 5400 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3825 1127 3825 2252 4050 2027 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4065 2475 5190 2475 4965 2700 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 12825 7155 12825 225 225 225 225 7155 12825 7155 -4 0 4 0 0 0 20 0.0000 4 285 2295 10546 5719 SS:[Hydraulic_out]\001 -4 0 4 0 0 0 20 0.0000 4 285 2175 10501 2569 SS:[Thermal_out]\001 -4 2 4 0 0 0 20 0.0000 4 285 2145 4019 5716 SS:[Hydraulic_in]\001 -4 1 -1 0 0 22 20 0.0000 4 225 390 5550 2567 ES\001 -4 1 1 1 0 3 20 0.0000 4 210 150 4606 5538 1\001 -4 1 1 1 0 3 30 0.0000 4 60 120 4471 5808 .\001 -4 1 1 1 0 3 20 0.0000 4 210 180 4471 5448 P\001 -4 1 1 1 0 3 20 0.0000 4 210 210 4471 6078 V\001 -4 1 4 0 0 0 20 0.0000 4 270 300 5280 2252 [s]\001 -4 1 4 0 0 0 20 0.0000 4 270 315 5820 2252 [e]\001 -4 1 1 1 0 3 20 0.0000 4 210 150 6406 2388 1\001 -4 1 1 1 0 3 20 0.0000 4 210 660 6584 2206 T - T\001 -4 1 1 1 0 3 20 0.0000 4 210 150 6899 2386 0\001 -4 1 1 1 0 3 30 0.0000 4 60 120 6497 2659 .\001 -4 1 1 1 0 3 20 0.0000 4 210 195 6497 2929 E\001 -4 1 -1 0 0 22 20 0.0000 4 225 915 7214 4186 C:tank\001 -4 1 -1 0 0 22 20 0.0000 4 210 165 7215 5762 0\001 -4 1 -1 0 0 22 20 0.0000 4 225 390 8925 2568 ES\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9648 5811 .\001 -4 1 1 1 0 3 20 0.0000 4 210 180 9648 5451 P\001 -4 1 1 1 0 3 20 0.0000 4 210 210 9648 6081 V\001 -4 1 1 1 0 3 20 0.0000 4 210 150 9783 5541 2\001 -4 1 1 1 0 3 20 0.0000 4 210 195 7846 2930 E\001 -4 1 4 0 0 0 20 0.0000 4 270 315 8655 2208 [e]\001 -4 1 4 0 0 0 20 0.0000 4 270 300 9150 2208 [s]\001 -4 1 1 1 0 3 20 0.0000 4 210 180 9648 2301 T\001 -4 1 1 1 0 3 20 0.0000 4 210 150 9783 2391 2\001 -4 1 1 1 0 3 20 0.0000 4 210 180 9648 2931 S\001 -4 1 1 1 0 3 30 0.0000 4 60 120 9648 2661 .\001 -4 1 1 1 0 3 20 0.0000 4 210 150 9783 3066 2\001 -4 1 1 1 0 3 30 0.0000 4 60 120 7846 2660 .\001 -4 1 1 1 0 3 20 0.0000 4 210 660 7936 2209 T - T\001 -4 1 1 1 0 3 20 0.0000 4 210 150 8251 2389 0\001 -4 1 1 1 0 3 20 0.0000 4 210 150 7758 2391 2\001 -4 1 1 1 0 3 20 0.0000 4 285 2550 7259 6346 Pseudo Bond Graph\001 -4 1 4 0 0 0 20 0.0000 4 285 1530 3870 945 SS:[Heat_in]\001 -4 1 -1 0 0 22 20 0.0000 4 210 165 7245 2565 0\001 -4 1 -1 0 0 22 20 0.0000 4 210 165 3825 2565 0\001 -4 2 4 0 0 0 20 0.0000 4 285 2025 2385 2565 SS:[Thermal_in]\001 DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_cr.r Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_cr.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_cr.r +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_cr.r @@ -1,15 +0,0 @@ -% Constitutive relation file for TankC (TankC_cr.r) -% Generated by MTT at Thu Mar 5 10:30:23 GMT 1998 - -OPERATOR TankC; - -%Pressure -% -- not relevant here - -%Temperature -FOR ALL COMP,rho,c_p,volume,Energy -LET TankC(COMP,rho,c_p,volume,effort,1, - Energy,state,1 - ) = Energy/(volume*rho*c_p); - -END; DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_desc.tex Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_desc.tex +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_desc.tex @@ -1,14 +0,0 @@ -% Verbal description for system TankC (TankC_desc.tex) -% Generated by MTT on Tue Jan 13 18:03:04 GMT 1998. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{TankC} is - displayed in Figure \Ref{TankC_abg} and its label - file is listed in Section \Ref{sec:TankC_lbl}. - The subsystems are listed in Section \Ref{sec:TankC_sub}. DELETED mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/Incompressible/Incompressible-Systems/ShowerHeater/TankC_lbl.txt @@ -1,58 +0,0 @@ -%% Label file for system TankC (TankC_lbl.txt) -%SUMMARY TankC: TankC of hot incompressible liquid - fixed volume -%DESCRIPTION rho - density; c_p - specific heat; v - volume -%DESCRIPTION Typical lable: tank TankC rho;c_p;v - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.3 1998/11/20 13:20:27 peterg -% %% Aliased ports -% %% -% %% Revision 1.2 1998/11/20 09:46:34 peterg -% %% Modernised lbl syntax -% %% -% %% Revision 1.1 1998/11/20 08:57:19 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Port aliases -%ALIAS in Thermal_in,Hydraulic_in -%ALIAS out Thermal_out,Hydraulic_out - -%ALIAS Th_in Thermal_in -%ALIAS Hy_in Hydraulic_in - -%ALIAS Th_out Thermal_out -%ALIAS Hy_out Hydraulic_out - -%ALIAS Heat Heat_in - -% Argument aliases -%ALIAS $1 rho -%ALIAS $2 c_p -%ALIAS $3 v - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% component-name cr_name arg1,arg2,..argn -% blank - -% ---- Component labels ---- - -% Component type C - tank TankC rho,c_p,v - -% Component type SS - [Heat_in] SS external,external - [Hydraulic_in] SS external,external - [Hydraulic_out] SS external,external - [Thermal_in] SS external,external - [Thermal_out] SS external,external - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_abg.fig @@ -1,37 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 3150 5850 3150 5625 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 4500 4275 5850 4275 5625 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1800 3150 3150 3150 2925 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3150 2925 3150 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1800 4050 1800 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1777 4275 3127 4275 2902 4500 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4500 4095 4500 4545 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6975 3150 8325 3150 8100 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6975 2925 6975 3375 -2 2 0 2 1 7 1 0 -1 0.000 0 0 0 0 0 5 - 2925 2025 4725 2025 4725 5400 2925 5400 2925 2025 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9450 5850 9450 1575 450 1575 450 5850 9450 5850 -4 0 -1 0 0 0 20 0.0000000 4 240 870 6030 3240 RT:r_2\001 -4 2 4 0 0 0 20 0.0000000 4 240 690 2835 3060 [t_in]\001 -4 0 4 0 0 0 20 0.0000000 4 240 840 4770 3015 [t_out]\001 -4 2 4 0 0 0 20 0.0000000 4 240 735 2880 4185 [e_in]\001 -4 0 4 0 0 0 20 0.0000000 4 240 885 4770 4185 [e_out]\001 -4 2 -1 0 0 0 20 0.0000000 4 240 900 1620 3240 SS:T_1\001 -4 0 -1 0 0 0 20 0.0000000 4 240 900 8460 3240 SS:T_2\001 -4 2 -1 0 0 0 20 0.0000000 4 240 780 1665 4365 SS:I_r\001 -4 0 -1 0 0 0 20 0.0000000 4 240 930 5985 4365 SS:V_0\001 -4 1 -1 0 0 0 20 0.0000000 4 270 1575 3780 3825 Segment:s*20\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_desc.tex @@ -1,67 +0,0 @@ -% Verbal description for system HeatedRod (HeatedRod_desc.tex) -% Generated by MTT on Thu Sep 4 18:05:09 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/09/11 16:16:50 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{table}[htbp] - \begin{center} - \leavevmode - \begin{tabular}{l l l} - \hline - Parameter & Symbol & Value \\ - \hline - Length & $L_r$ & 1m \\ - Diameter & $D_r$ & 1mm \\ - Resistivity & $\rho$ & $1.68\times10^{-9} \Omega$m \\ - Thermal conductivity & $\sigma$ & 390 W$\text{m}^{-1}$\\ - Thermal capacity & $\kappa$ & 380 J$\text{m}^{-3}$\\ - \hline - \end{tabular} - \caption{Heated rod parameters} - \label{tab:rod} - \end{center} -\end{table} - - System \textbf{HeatedRod} is a model of a well-insulated rod of copper with an - electric current passing through it which warms it up. The two ends of - the rod are fixed at ambient temperature; this is where all the heat - loss occurs. - - This example introduces the idea of the {\bf FP}, \textbf{RT} and - \textbf{CT} components in the context of thermal conduction. - - The model is similar to that described in chapter 8 of \citeN{Cel91}. - However, instead of representing the thermal resistance by {\bf RS} - components and reinserting the entropy flow, the {\bf RT} component - uses two {\bf FP} components to convert from true to pseudo bonds and - back again. Similary, the thermal capacity is modelled by the {\bf - CT} component. - - This distributed system (which strictly speaking has a partial - differential equation model) is approximated by an ordinary - diffferential equation model by modelling the system by a number of - discrete segments of length $\Delta x$. Each segment model consists - of two conceptual parts. - \begin{itemize} - \item An ideal lump of copper with no thermal resistance but with the - normal attributes of electrical resistance (modelled by the - \textbf{RS} component and thermal capacity (modelled by the - \textbf{CF} component). - \item A thin lump wtih thermal resistance but no thermal capacity or - electrical resistance (modeled by the \textbf{RT} component). - \end{itemize} -At this level of the hierarchy, all bonds are true energy bonds and -thus energy conservation is assured. Note that the \textbf{RS} -component correctely transforms electrical to thermal energy. - -The system was simulated with a total of nine lumps whilst passing a -current of 1A though the rod for a total of 10s. The initial -temperature and the end temperatures were all set at 300K. DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_input.txt Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_input.txt +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_input.txt @@ -1,19 +0,0 @@ -# Numerical parameter file (HeatedRod_input.txt) -# Generated by MTT at Thu Sep 4 16:11:06 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:12:41 peterg -# %% To RCS -# %% -# %% Revision 1.1 1998/08/15 13:40:20 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Thu Jun 12 14:33:52 BST 2003: u() = 10.0*(t<5.0); # I_r -heatedrod__i_r = 10.0*(t<5.0); # I_r DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_lbl.txt @@ -1,48 +0,0 @@ -%SUMMARY HeatedRod: Thermal/Electrical model of Electric rod -%DESCRIPTION Introduces the idea of the ES component which -%DESCRIPTION transforms a relative-temperature/enthalpy pseudo bond -%DESCRIPTION (at the [e]port) into an absolute-temperature/enntropy -%DESCRIPTION energy bond (at the [s] port) and vice versa. - -%VAR rod_length -%VAR rod_radius -%VAR electrical_resistivity -%VAR thermal_resistivity -%VAR thermal_capacity -%VAR segments -%VAR area -%VAR delta_x -%VAR volume -%VAR density -%VAR mass - -%% Label file for system HeatedRod (HeatedRod_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.1 1997/09/11 16:16:29 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type RT - r_2 lin flow,r_2 - -% Component type SS - I_r SS internal,external - T_1 SS t_0,internal - T_2 SS t_0,internal - V_0 SS internal,internal - -% Component type Segment - s DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_numpar.txt @@ -1,39 +0,0 @@ -# Numerical parameter file (HeatedRod_numpar.txt) -# Generated by MTT at Thu Sep 4 16:11:04 BST 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 1998/08/15 13:40:33 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -# Constants for copper -density = 8.96; -rod_length = 1.0; -rod_radius = 1e-3; -electrical_resistivity = 16.8*0.000000001; -thermal_resistivity = 1/390.0; -thermal_capacity = 380.0; - - -segments = 20; -area = pi*rod_radius*rod_radius; -delta_x = rod_length/segments; -volume = area*delta_x; -mass = volume*density; - -# Parameters -c_t = thermal_capacity*mass; -r = electrical_resistivity*delta_x/area; -r_t = thermal_resistivity*delta_x/area; -r_2 = r_t; -t_0 = 300; # Ambient - - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_rep.txt Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_rep.txt +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_rep.txt @@ -1,26 +0,0 @@ -# Outline report file for system HeatedRod (HeatedRod_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1999/12/21 23:53:04 peterg -% %% Compiled version -% %% -% %% Revision 1.1 1999/02/21 02:14:29 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -o -ss HeatedRod abg tex -mtt -o -ss HeatedRod struc tex -mtt -o -ss HeatedRod ode tex -mtt -o -ss HeatedRod ss tex -mtt -o -ss HeatedRod sm tex -mtt -o -ss HeatedRod lmfr ps - -mtt -o -ss HeatedRod numpar txt -mtt -o -ss HeatedRod input txt -mtt -o -ss HeatedRod odeso ps - DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_simpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_simpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_simpar.txt @@ -1,21 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Simulation parameters for system HR (HR_simpar.txt) -# Generated by MTT on Wednesday July 29 13:59:50 BST 1998. -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 1998/08/15 13:40:47 peterg -## Initial revision -## -############################################################### - - -LAST = 10; # Last time in simulation -WMIN = 1; # Minimum frequency = 10^WMIN -WMAX = 2; # Maximum frequency = 10^WMAX -WSTEPS = 100; # Number of frequency steps - -STEPFACTOR = 1; # Added automatically -DT = 0.1; # Added automatically DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_sspar.r Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_sspar.r +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_sspar.r @@ -1,27 +0,0 @@ -% Steady-state parameter file (HeatedRod_sspar.r) -% Generated by MTT at Thu Jun 25 09:32:38 BST 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Steady-state states -MTTX1 := t_0*c_t; % HeatedRod_s_c_t (c) -MTTX2 := t_0*c_t; % HeatedRod_s_c_t (c) -MTTX3 := t_0*c_t; % HeatedRod_s_c_t (c) -MTTX4 := t_0*c_t; % HeatedRod_s_c_t (c) -MTTX5 := t_0*c_t; % HeatedRod_s_c_t (c) -MTTX6 := t_0*c_t; % HeatedRod_s_c_t (c) -MTTX7 := t_0*c_t; % HeatedRod_s_c_t (c) -MTTX8 := t_0*c_t; % HeatedRod_s_c_t (c) -MTTX9 := t_0*c_t; % HeatedRod_s_c_t (c) - -% Steady-state inputs -MTTU1 := 1.0; % HeatedRod (I_r) - -;;END; DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_state.txt Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_state.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_state.txt +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/HeatedRod_state.txt @@ -1,56 +0,0 @@ -# -*-octave-*- Put Emacs into octave-mode -# Initial state file (HeatedRod_state.txt) -# Generated by MTT at Sat Aug 15 15:34:41 BST 1998 -############################################################### -## Version control history -############################################################### -## $Id$ -## $Log$ -## Revision 1.1 2000/12/28 18:12:41 peterg -## To RCS -## -############################################################### - -# Set the states -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(1) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(2) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(3) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(4) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(5) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(6) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(7) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(8) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(9) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(10) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(11) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(12) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(13) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(14) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(15) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(16) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(17) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(18) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(19) = c_t*t_0; # c (HeatedRod_s_c_t) -## Removed by MTT on Thu Jun 12 14:34:50 BST 2003: mttx(20) = -## c_t*t_0; # c (HeatedRod_s_c_t) - -heatedrod__s__10__c_t__c = c_t*t_0; -heatedrod__s__11__c_t__c = c_t*t_0; -heatedrod__s__12__c_t__c = c_t*t_0; -heatedrod__s__13__c_t__c = c_t*t_0; -heatedrod__s__14__c_t__c = c_t*t_0; -heatedrod__s__15__c_t__c = c_t*t_0; -heatedrod__s__16__c_t__c = c_t*t_0; -heatedrod__s__17__c_t__c = c_t*t_0; -heatedrod__s__18__c_t__c = c_t*t_0; -heatedrod__s__19__c_t__c = c_t*t_0; -heatedrod__s__20__c_t__c = c_t*t_0; -heatedrod__s__2__c_t__c = c_t*t_0; -heatedrod__s__3__c_t__c = c_t*t_0; -heatedrod__s__4__c_t__c = c_t*t_0; -heatedrod__s__5__c_t__c = c_t*t_0; -heatedrod__s__6__c_t__c = c_t*t_0; -heatedrod__s__7__c_t__c = c_t*t_0; -heatedrod__s__8__c_t__c = c_t*t_0; -heatedrod__s__9__c_t__c = c_t*t_0; -heatedrod__s__c_t__c = c_t*t_0; DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_abg.fig @@ -1,44 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1306 2476 2881 2476 2656 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3781 2476 5356 2476 5131 2701 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5761 2476 8550 2475 8325 2700 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5581 4276 5581 2701 5806 2926 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5581 6301 5581 4726 5806 4951 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1350 6525 5356 6526 5131 6751 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5806 6526 8550 6525 8325 6750 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5806 2701 6920 3815 6601 3815 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5581 2251 5581 676 5806 901 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5356 676 5806 676 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9900 7425 9900 90 45 90 45 7425 9900 7425 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 7650 4455 7650 1800 1575 1800 1575 4455 7650 4455 -2 4 0 1 1 7 1 0 -1 0.000 0 0 7 0 0 5 - 7650 6975 7650 4545 1575 4545 1575 6975 7650 6975 -4 1 -1 0 0 0 20 0.0000000 4 240 810 3331 2566 RT:r_t\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5581 2566 0\001 -4 1 -1 0 0 0 20 0.0000000 4 210 555 5581 4591 RS:r\001 -4 1 -1 0 0 0 20 0.0000000 4 210 150 5581 6616 1\001 -4 1 -1 0 0 0 20 0.0000000 4 240 840 7021 4141 CT:c_t\001 -4 1 -1 0 0 0 20 0.0000000 4 240 870 5581 586 SS:T_s\001 -4 2 4 0 0 0 20 0.0000000 4 240 1020 1261 2566 SS:[t_in]\001 -4 0 4 0 0 0 20 0.0000000 4 240 1020 8685 2565 SS:[t_out]\001 -4 2 4 0 0 0 20 0.0000000 4 240 1065 1260 6615 SS:[e_in]\001 -4 0 4 0 0 0 20 0.0000000 4 240 1065 8685 6615 SS:[e_out]\001 -4 0 1 1 0 0 20 0.0000000 4 240 1875 1845 4050 Thermal model\001 -4 0 1 1 0 0 20 0.0000000 4 240 2025 1800 5175 Electrical model\001 -4 0 1 1 0 0 20 0.0000000 4 270 2415 6075 585 Temperature sensor\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_desc.tex @@ -1,19 +0,0 @@ -% Verbal description for system Segment (Segment_desc.tex) -% Generated by MTT on Thu Sep 4 18:05:43 BST 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - The acausal bond graph of system \textbf{Segment} is - displayed in Figure \ref{Segment_abg} and its label - file is listed in Section \ref{sec:Segment_lbl}. - The subsystems are listed in Section \ref{sec:Segment_sub}. - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermalConduction/HeatedRod/Segment_lbl.txt @@ -1,39 +0,0 @@ -%SUMMARY Segment: Segment of HeatedRod -%DESCRIPTION Part of the HeatedRod example. -%% Label file for system Segment (Segment_lbl.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/08/10 12:29:48 peterg -% %% Added missing ports. -% %% -% %% Revision 1.1 1997/09/11 16:17:14 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Each line should be of one of the following forms: -% a comment (ie starting with %) -% Component-name CR_name arg1,arg2,..argn -% blank - - - -% Component type CT - c_t lin effort,c_t - -% Component type RS - r lin flow,r - -% Component type RT - r_t lin flow,r_t - -% Component type SS - T_s SS external,0 - [t_in] SS external,external - [t_out] SS external,external - [e_in] SS external,external - [e_out] SS external,external DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_abg.fig @@ -1,36 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3827 3152 5402 3152 5177 3377 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 6977 3152 8552 3152 8327 3377 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 8552 2927 8552 3377 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 902 3150 2477 3150 2252 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2475 2925 2475 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3825 2925 3825 3375 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3152 1125 3152 2700 2927 2475 -2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 9900 5175 -450 5175 -450 450 9900 450 9900 5175 -4 1 -1 0 0 0 20 0.0000 4 285 1440 6212 3242 Cycle:cycle\001 -4 0 -1 0 0 0 20 0.0000 4 210 1050 8687 3242 Sf:Work\001 -4 1 1 1 0 3 20 0.0000 4 210 735 4456 3466 dS/dT\001 -4 1 1 1 0 3 20 0.0000 4 195 180 4501 2926 T\001 -4 1 1 1 0 3 20 0.0000 4 195 180 7921 2926 P\001 -4 1 1 1 0 3 20 0.0000 4 210 765 7786 3466 dV/dT\001 -4 1 1 1 0 3 30 0.0000 4 405 2325 5085 4635 Carnot cycle\001 -4 2 -1 0 0 0 20 0.0000 4 210 975 810 3240 Se:Heat\001 -4 1 -1 0 0 0 20 0.0000 4 195 1005 3150 3240 FMRT:r\001 -4 1 4 100 0 18 14 0.0000 4 195 600 3150 2925 [mod]\001 -4 1 -1 0 0 0 20 0.0000 4 210 1170 3150 990 Sf:switch\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_desc.tex @@ -1,72 +0,0 @@ -% Verbal description for system CarnotCycle (CarnotCycle_desc.tex) -% Generated by MTT on Tue Dec 9 12:13:57 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{CarnotCycle} is - displayed in Figure \Ref{CarnotCycle_abg} and its label - file is listed in Section \Ref{sec:CarnotCycle_lbl}. - The subsystems are listed in Section \Ref{sec:CarnotCycle_sub}. - -The Carnot cycle is a simple closed thermodynamic cycle with four parts: -\begin{enumerate} -\item Isentropic compression -\item Heat injection at constant temperature -\item Isentropic expansion -\item Heat extraction at constant temperature -\end{enumerate} - -The subsystem \textbf{Cycle} (Section \Ref{sec:Cycle}) is a two-port -component describing an ideal gas. It has two energy ports which, with -integral causality correspond to -\begin{enumerate} -\item Entropy flow in; temperature out -\item Volume rate of change in; pressure out -\end{enumerate} - -In contast to the Otto cycle (see Table -\Ref{tab:cycles} where each table entry gives the causality on the -heat and work ports respectively). The ideal Carnot cycle has -derivative causality on the {\bf [Heat]} port for two parts of the -cycle. - -To avoid this causlity change, the Carnot cycle is approximated by -applying the heat from a temperature source via a thermal resistance -{\bf RT} component. During the {\em heat injection\/} and {\em heat -extraction\/} parts of the cycle, the resistance parameter $r\approx -0$, but during the {\em isentropic compression\/} and {\em isentropic -expansion\/} parts of the cycle, the resistance parameter $r\approx -\inf$. - -The simulation parameters appear in Section -\Ref{sec:CarnotCycle_numpar.txt}. The results are plotted against time -as follows: -\begin{itemize} -\item Volume (Figure \Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-V}) -\item Pressure (Figure -\Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-P}) -\item Entropy (Figure \Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-S}) -\item Temperature (Figure -\Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-T}) -\end{itemize} - -These values are replotted as the standard PV and TS diagrams in -Figures -\Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-V:CarnotCycle-cycle-P} -and -\Ref{fig:CarnotCycle_odeso.ps-CarnotCycle-cycle-S:CarnotCycle-cycle-T} -respectively. - -The PV diagram shows the long and thin form typical of the Carnot -cycle -- this implies a poor work ratio. The TS diagram is not -informative; it is not the expected rectangle because both T and S -change in a stepwise manner. - - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_input.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_input.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_input.txt @@ -1,42 +0,0 @@ -# Input file (CarnotCycle_input.txt) -# Generated by MTT at Mon Dec 8 20:05:30 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:14:40 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -alpha = 0.553; - -# Set the inputs -if ((t>=0.0)&&(t<1.0)) #Cooling - carnotcycle__heat__u= 300.0; # Source temperature - carnotcycle__switch__u = 1e10; # Large conductance - isothermal - carnotcycle__work__u = -alpha; # Volume rate-of-change -endif; - -if ((t>=1.0)&&(t<2.0)) #Compression - carnotcycle__heat__u = 300.0; # Source temperature - carnotcycle__switch__u = 0; # Small conductance -- isentropic - carnotcycle__work__u = -(0.8-alpha); # Volume rate-of-change -endif; - -if ((t>=2.0)&&(t<3.0)) #Heating - TopTemp = x(1)/(m_g*c_v); - carnotcycle__heat__u = TopTemp; # Source temperature - carnotcycle__switch__u = 1e10; # Large conductance - isothermal - carnotcycle__work__u = (0.8-alpha); # Volume rate-of-change -endif; - -if (t>=3.0) #Cooling - carnotcycle__heat__u = 300.0; # Source temperature - carnotcycle__switch__u = 0; # Small conductance -- isentropic - carnotcycle__work__u = alpha; # Volume rate-of-change -endif; - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_lbl.txt @@ -1,56 +0,0 @@ -#SUMMARY CarnotCycle: a simple closed thermodynamic cycle -#DESCRIPTION The Carnot cycle is a simple closed thermodynamic cycle -#DESCRIPTION with four parts: -#DESCRIPTION o Isentropic compression -#DESCRIPTION o Heat injection at constant temperature -#DESCRIPTION o Isentropic expansion -#DESCRIPTION o Heat extraction at constant temperature - -#PAR P_0 -#PAR T_0 -#PAR V_0 -#PAR alpha -#PAR TopTemp - - -#NOTPAR ideal_gas - -## Label file for system CarnotCycle (CarnotCycle_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.3 2003/08/13 17:03:00 gawthrop -# ## Updated for new MTT -# ## Use FMR in place of R -# ## Fixed bug in sspar -# ## -# ## Revision 1.2 1998/08/10 16:40:07 peterg -# ## Added VARs and parametrs -# ## -# ## Revision 1.1 1998/07/21 15:18:18 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - -# Component type Cycle - cycle none ideal_gas;c_v;gamma_g;m_g - -# Component type RT - r lin flow,1 - -# Component type Se - Heat SS external - -# Component type Sf - Work SS external - switch SS external DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_numpar.txt @@ -1,34 +0,0 @@ -# Numerical parameter file (CarnotCycle_numpar.txt) -# Generated by MTT at Mon Dec 8 20:02:31 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.3 2003/08/13 17:03:10 gawthrop -# %% Updated for new MTT -# %% Use FMR in place of R -# %% Fixed bug in sspar -# %% -# %% Revision 1.2 2000/12/28 18:14:40 peterg -# %% To RCS -# %% -# %% Revision 1.1 1998/03/04 11:49:01 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Initial states -- needed to choose an approppriate mass -P_0 = 1e5; -V_0 = 1; -T_0 = 300; - -# Parameters -c_v = 718.0; # Parameter c_v for CU -gamma_g = 1.4; # Parameter gamma for CU -m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU - -## Use in input.txt -alpha = 1.0; # Added by MTT on Thu Aug 14 11:42:15 BST 2003 -toptemp = 1.0; # Added by MTT on Thu Aug 14 11:42:15 BST 2003 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_params.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_params.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_params.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_params.r @@ -1,11 +0,0 @@ -%% Parameter file for system CarnotCycle (CarnotCycle_params.r) -%% This file provides symbolic parameters for simplification - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_rep.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_rep.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_rep.txt @@ -1,29 +0,0 @@ -# Outline report file for system CarnotCycle (CarnotCycle_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 18:14:40 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/02/21 02:15:05 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -ss -o CarnotCycle abg tex -mtt -ss -o CarnotCycle struc tex -mtt -ss -o CarnotCycle ode tex -mtt -ss -o CarnotCycle ss tex - -mtt -ss -o CarnotCycle numpar txt -mtt -ss -o CarnotCycle input txt - -mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__V' -mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__P' -mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__S' -mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__T' -mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__V:CarnotCycle__cycle__P' -mtt -ss -o CarnotCycle odeso ps 'CarnotCycle__cycle__S:CarnotCycle__cycle__T' DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simp.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simp.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simp.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simp.r @@ -1,10 +0,0 @@ -%% Reduce comands to simplify output for system CarnotCycle (CarnotCycle_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_simpar.txt @@ -1,12 +0,0 @@ -%% Simulation parameters for system OttoCycle (OttoCycle_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=4.0 -DT=0.01 -STEPFACTOR=10 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_sspar.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_sspar.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/CarnotCycle/CarnotCycle_sspar.r @@ -1,48 +0,0 @@ -% Steady-state parameter file (CarnotCycle_sspar.r) -% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.2 2000/12/28 18:14:40 peterg -% % To RCS -% % -% % Revision 1.1 1998/03/04 11:49:14 peterg -% % Initial revision -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -% Set a pressure of 1 bar -%P_0 := 10^5; - -% Unit initial volume -%V_0 := 1; - -% Internal energy -U_0 := P_0*V_0/(gamma_g-1); - -% Set initial temperature of 300k -%T_0 := 300; - -% Deduce the mass of gas -m_g := U_0/(T_0*c_v); - -% Entropy -S_0 := U_0/T_0; - -% Steady-state states -MTTX1 := U_0; % CarnotCycle_cycle_gas (c) -MTTX2 := V_0; % CarnotCycle_cycle_gas (c) -MTTX3 := S_0; % CarnotCycle_cycle_volume (3) -MTTX4 := V_0; % CarnotCycle_cycle_entropy (3) - -% Steady-state inputs -MTTU1 := T_0; % CarnotCycle (Heat) -MTTU2 := 0; % CarnotCycle (Work) -MTTU3 := 0; % Switch (conduction) -;;END; - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_abg.fig @@ -1,27 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 3151 3601 3151 3376 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5176 3151 6751 3151 6526 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6751 2926 6751 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2026 2926 2026 3376 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 5850 8325 450 675 450 675 5850 8325 5850 -4 1 -1 0 0 0 20 0.0000 4 285 1440 4411 3241 Cycle:cycle\001 -4 0 -1 0 0 0 20 0.0000 4 210 1050 6886 3241 Sf:Work\001 -4 2 -1 0 0 0 20 0.0000 4 210 945 1936 3241 Sf:Heat\001 -4 1 1 1 0 3 20 0.0000 4 210 735 2655 3465 dS/dT\001 -4 1 1 1 0 3 20 0.0000 4 195 180 2700 2925 T\001 -4 1 1 1 0 3 20 0.0000 4 195 180 6120 2925 P\001 -4 1 1 1 0 3 20 0.0000 4 210 765 5985 3465 dV/dT\001 -4 1 1 1 0 3 30 0.0000 4 405 1815 4365 4770 Otto cycle\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_desc.tex @@ -1,65 +0,0 @@ -% Verbal description for system OttoCycle (OttoCycle_desc.tex) -% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/12/08 09:37:04 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{OttoCycle} is - displayed in Figure \Ref{OttoCycle_abg} and its label - file is listed in Section \Ref{sec:OttoCycle_lbl}. - The subsystems are listed in Section \Ref{sec:OttoCycle_sub}. - - -The Otto cycle is a simple closed thermodynamic cycle with four parts: -\begin{enumerate} -\item Isentropic compression -\item Heating at constant volume -\item Isentropic expansion -\item Cooling at constant volume -\end{enumerate} - -The subsystem \textbf{Cycle} (Section \Ref{sec:Cycle}) is a two-port -component describing an ideal gas. It has two energy ports which, with -integral causality correspond to -\begin{enumerate} -\item Entropy flow in; temperature out -\item Volume rate of change in; pressure out -\end{enumerate} - -In Bond Graph terms, each of the four parts of the Otto cycle -correspond to integral causality as in each case a \emph{flow} is -constrained. This is in contrast to other cycles listed in Table -\Ref{tab:cycles} where each table entry gives the causality on the -heat and work ports respectively. This is possibly why the Otto cycle -is conceptually and practically simple. - -The simulation parameters appear in Section -\Ref{sec:OttoCycle_numpar.txt}. The results are plotted against time -as follows: -\begin{itemize} -\item Volume (Figure \Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-V}) -\item Pressure (Figure -\Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-P}) -\item Entropy (Figure \Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-S}) -\item Temperature (Figure -\Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-T}) -\end{itemize} - -These values are replotted as the standard PV and TS diagrams in -Figures -\Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-V:OttoCycle-cycle-P} -and -\Ref{fig:OttoCycle_odeso.ps-OttoCycle-cycle-S:OttoCycle-cycle-T} -respectively. - - - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_input.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_input.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_input.txt @@ -1,45 +0,0 @@ -# Numerical parameter file (OttoCycle_input.txt) -# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.3 2000/12/28 18:42:16 peterg -# %% New input definition. -# %% NB Needs to handle mutiports properly and state.txt modified accordingly -# %% -# %% Revision 1.2 2000/12/28 18:15:52 peterg -# %% To RCS -# %% -# %% Revision 1.1 1998/08/10 14:42:13 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs - -if ((t>=0.0)&&(t<1.0)) #Compression - OttoCycle__Heat__u = 0.0; # Entropy flow - OttoCycle__Work__u = -0.8; # Volume rate-of-change -endif; - -if ((t>=1.0)&&(t<2.0)) #Heating - OttoCycle__Heat__u = 1000; # Entropy flow - OttoCycle__Work__u = 0.0; # Volume rate-of-change -endif; - -if ((t>=2.0)&&(t<3.0)) #Expansion - OttoCycle__Heat__u = 0.0; # Entropy flow - OttoCycle__Work__u = 0.8; # Volume rate-of-change -endif; - -if (t>=3.0) #Cooling - OttoCycle__Heat__u = -1000; # Entropy flow - OttoCycle__Work__u = 0.0; # Volume rate-of-change -endif; - - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_lbl.txt @@ -1,49 +0,0 @@ -#SUMMARY OttoCycle: a simple closed thermodynamic cycle -#DESCRIPTION The Otto cycle is a simple closed thermodynamic cycle -#DESCRIPTION with four parts: -#DESCRIPTION o Isentropic compression -#DESCRIPTION o Heating at constant volume -#DESCRIPTION o Isentropic expansion -#DESCRIPTION o Cooling at constant volume - -#PAR P_0 -#PAR T_0 -#PAR V_0 -#NOTPAR ideal_gas - - -## Label file for system OttoCycle (OttoCycle_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.4 2000/12/28 18:42:17 peterg -# ## New input definition. -# ## NB Needs to handle mutiports properly and state.txt modified accordingly -# ## -# ## Revision 1.3 1998/08/10 16:05:52 peterg -# ## Added VARs and parameters -# ## -# ## Revision 1.2 1998/07/21 15:15:27 peterg -# ## Documentation + new format -# ## -# ## Revision 1.1 1998/07/21 15:12:21 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - -# Component type Cycle - cycle none ideal_gas;c_v;gamma_g;m_g - -# Component type Sf - Heat SS external - Work SS external DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_numpar.txt @@ -1,23 +0,0 @@ -# Numerical parameter file (OttoCycle_numpar.txt) -# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 1998/03/04 11:45:49 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Initial states -- needed to choose an appropriate mass -P_0 = 1e5; -V_0 = 1; -T_0 = 300; - -# Parameters -c_v = 718.0; # Parameter c_v for CU -gamma_g = 1.4; # Parameter gamma for CU -m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v);# Parameter m for CU - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_rep.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_rep.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_rep.txt @@ -1,33 +0,0 @@ -# Outline report file for system OttoCycle (OttoCycle_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 18:15:52 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/02/21 02:16:17 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -o -ss OttoCycle abg tex -mtt -o -ss OttoCycle struc tex -mtt -o -ss OttoCycle ode tex -mtt -o -ss OttoCycle ss tex - -mtt -o -ss OttoCycle numpar txt -mtt -o -ss OttoCycle input txt - -mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__V' -mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__P' -mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__S' -mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__T' -mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__V:OttoCycle__cycle__P' -mtt -o -ss OttoCycle odeso ps 'OttoCycle__cycle__S:OttoCycle__cycle__T' - - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_sspar.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_sspar.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicCycles/OttoCycle/OttoCycle_sspar.r @@ -1,42 +0,0 @@ -% Steady-state parameter file (OttoCycle_sspar.r) -% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% % Revision 1.1 2000/12/28 18:15:52 peterg -% % To RCS -% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Set a pressure of 1 bar -%%P_0 := 10^5; - -% Unit initial volume -%%V_0 := 1; - -% Internal energy -U_0 := P_0*V_0/(gamma_g-1); - -% Set initial temperature of 300k -%%T_0 := 300; - -% Deduce the mass of gas -m_g := U_0/(T_0*c_v); - -% Entropy -S_0 := U_0/T_0; - -% Steady-state states -MTTX1 := U_0; % OttoCycle_cycle_gas (c) -MTTX2 := V_0; % OttoCycle_cycle_gas (c) -MTTX3 := S_0; % OttoCycle_cycle_entropy (3) -MTTX4 := V_0; % OttoCycle_cycle_volume (3) - -% Steady-state inputs -MTTU1 := 0; % OttoCycle (Heat) -MTTU2 := 0; % OttoCycle (Work) -;;END; DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 3151 3601 3151 3376 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5176 3151 6751 3151 6526 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6751 2926 6751 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2026 2926 2026 3376 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 5850 8325 450 675 450 675 5850 8325 5850 -4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001 -4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001 -4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 2700 2925 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001 -4 1 1 1 0 3 30 0.0000000 4 390 3360 4365 4770 Isentropic process\001 -4 1 1 1 0 3 20 0.0000000 4 210 480 2700 3555 S=0\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 2565 3330 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 195 6120 3555 V\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 6165 3285 .\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_desc.tex @@ -1,16 +0,0 @@ -% Verbal description for system Isentropic (Isentropic_desc.tex) -% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/12/09 12:30:26 peterg -% Initial revision -% -% Revision 1.1 1997/12/08 09:37:04 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_input.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_input.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (Isentropic_input.txt) -# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:16:47 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Wed Aug 6 10:14:17 BST 2003: u(1) = -0.8; # Volume rate-of-change -isentropic__work = -0.8; # Volume rate-of-change DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_lbl.txt @@ -1,40 +0,0 @@ -#SUMMARY Isentropic: Isentropic thermodynamic process - ideal gas -#DESCRIPTION A dynamic simulation of an isentropic process using -#DESCRIPTION the Cycle component and the two-prt CU component. - -#PAR P_0 -#PAR T_0 -#PAR V_0 - -#NOTPAR ideal_gas - - - -## Label file for system Isentropic (Isentropic_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.2 2000/12/28 18:16:47 peterg -# ## To RCS -# ## -# ## Revision 1.1 1998/07/21 14:27:44 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - -# Component type Cycle - cycle none ideal_gas;c_v;gamma_g;m_g - -# Component type SS - Heat SS internal,0 - Work SS internal,external DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_numpar.txt @@ -1,23 +0,0 @@ -# Numerical parameter file (Isentropic_numpar.txt) -# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 1998/03/04 11:45:49 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Initial states -- needed to choose an approppriate mass -P_0 = 1e5; -V_0 = 1; -T_0 = 300; - -# Parameters -c_v = 718.0; # Parameter c_v for CU -gamma_g = 1.4; # Parameter gamma for CU -m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_rep.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_rep.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_rep.txt @@ -1,29 +0,0 @@ -# Outline report file for system Isentropic (Isentropic_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 18:16:47 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/02/21 02:18:41 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -o -ss Isentropic abg tex -mtt -o -ss Isentropic struc tex -mtt -o -ss Isentropic ode tex -mtt -o -ss Isentropic ss tex - -mtt -o -ss Isentropic numpar txt -mtt -o -ss Isentropic input txt - -mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__V' -mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__P' -mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__S' -mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__T' -mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__V:Isentropic__cycle__P' -mtt -o -ss Isentropic odeso ps 'Isentropic__cycle__S:Isentropic__cycle__T' DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt @@ -1,13 +0,0 @@ -%% Simulation parameters for system Isentropic (Isentropic_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=1.0 -DT=0.01 -STEPFACTOR=1 - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt_old Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt_old ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt_old +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_simpar.txt_old @@ -1,13 +0,0 @@ -%% Simulation parameters for system Isentropic (Isentropic_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=1.0 -DT=0.01 -STEPFACTOR=1 - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_sspar.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_sspar.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isentropic/Isentropic_sspar.r @@ -1,39 +0,0 @@ -% Steady-state parameter file (Isentropic_sspar.r) -% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Set a pressure of 1 bar -P_0 := 10^5; - -% Unit initial volume -V_0 := 1; - -% Internal energy -U_0 := P_0*V_0/(gamma_g-1); - -% Set initial temperature of 300k -T_0 := 300; - -% Deduce the mass of gas -m := U_0/(T_0*c_v); - -% Entropy -S_0 := U_0/T_0; - -% Steady-state states -MTTX1 := U_0; % Isentropic_cycle_gas (c) -MTTX2 := V_0; % Isentropic_cycle_gas (c) -MTTX3 := S_0; % Isentropic_cycle_entropy (3) -MTTX4 := V_0; % Isentropic_cycle_volume (3) - -% Steady-state inputs -MTTU1 := 0; % Isentropic (Heat) -MTTU2 := 0; % Isentropic (Work) -;;END; DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_abg.fig @@ -1,89 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 1800 6750 1800 6525 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 2025 5175 3375 5400 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3825 5175 5175 5400 4950 -2 2 0 3 1 7 1 0 -1 0.000 1 0 -1 0 0 5 - 6075 900 9000 900 9000 2700 6075 2700 6075 900 -2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 - 8325 900 8550 900 8550 2700 8325 2700 8325 900 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10125 3825 10125 5175 10350 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 1800 9900 1800 9675 2025 -2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 - 8550 1665 9585 1665 9585 1935 8550 1935 8550 1665 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 4725 1440 5805 1440 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 9675 1440 10755 1440 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 7785 3465 8415 2835 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 1800 4950 1800 4725 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1755 1800 3105 1800 2880 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 2025 3375 5175 3600 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3150 5175 3600 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10350 1800 11700 1800 11475 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12150 1800 13500 1800 13275 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 11700 5175 12150 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11925 2025 11925 5175 12150 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10125 2025 10125 3375 10350 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 2025 5400 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 2025 10350 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 5175 10350 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 5175 5400 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5400 1575 5400 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 7875 1575 7875 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 1755 1575 1755 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 12150 1575 12150 2025 -4 1 -1 0 0 0 20 0.0000 4 255 915 7290 1890 CU:gas\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 5175 1890 1\001 -4 1 -1 0 0 0 20 0.0000 4 270 1695 5175 3690 INTF:entropy\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 10125 1890 1\001 -4 1 1 1 0 3 20 0.0000 4 270 1140 7200 1440 Ideal gas\001 -4 1 1 1 0 3 20 0.0000 4 195 945 4635 1305 Heat in\001 -4 1 1 1 0 3 20 0.0000 4 210 1170 10170 1305 Work out\001 -4 1 1 1 0 3 20 0.0000 4 270 1980 5130 5895 Entropy change\001 -4 1 1 1 0 3 20 0.0000 4 270 1485 7110 3690 Ideal piston\001 -4 1 -1 0 0 0 20 0.0000 4 210 1680 10125 3690 INTF:volume\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 3375 1890 0\001 -4 2 4 0 0 0 20 0.0000 4 255 1215 1575 1890 SS:[Heat]\001 -4 1 -1 0 0 0 20 0.0000 4 210 600 3375 5490 SS:T\001 -4 1 1 1 0 3 20 0.0000 4 255 1620 3240 5895 Temperature\001 -4 1 -1 0 0 0 20 0.0000 4 210 585 5130 5490 SS:S\001 -4 1 -1 0 0 0 20 0.0000 4 210 645 10125 5490 SS:V\001 -4 1 -1 0 0 0 20 0.0000 4 210 585 11880 5490 SS:P\001 -4 0 4 0 0 0 20 0.0000 4 255 1320 13680 1890 SS:[Work]\001 -4 1 1 1 0 3 20 0.0000 4 270 1950 10080 5850 Volume change\001 -4 1 1 1 0 3 20 0.0000 4 195 1095 11925 5850 Pressure\001 -4 1 -1 0 0 0 20 0.0000 4 195 150 11925 1890 0\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_desc.tex @@ -1,74 +0,0 @@ -% Verbal description for system Cycle (Cycle_desc.tex) -% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/06/30 12:46:49 peterg -% %% Changed CT2 to CU -% %% -% %% Revision 1.1 1998/06/30 12:46:24 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/12/08 09:37:04 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Cycle} is - displayed in Figure \Ref{Cycle_abg} and its label - file is listed in Section \Ref{sec:Cycle_lbl}. - The subsystems are listed in Section \Ref{sec:Cycle_sub}. - -The system has two heat engine ports: -\begin{enumerate} -\item \textbf{[Heat]} and -\item \textbf{[Work]} -\end{enumerate} -By convention, energy flows in to the \textbf{[Heat]} port and out of -the \textbf{[Work]} port. Both ports are true energy ports. - - -The subsystem \textbf{CU} (Section \Ref{sec:CU}) is a two-port -component describing an ideal gas. It has two energy ports which, with -integral causality correspond to -\begin{enumerate} -\item Entropy flow in; temperature out -\item Volume rate of change in; pressure out -\end{enumerate} - -Four \textbf{SS} components are set up as sensors to measure the -important quantities pertaining to the cycle: -\begin{enumerate} -\item \textbf{S} to measure the integrated entropy flow -\item \textbf{T} to measure the (absolute) temperature -\item \textbf{V} to measure the integrated volume change -\item \textbf{P} to measure the pressure -\end{enumerate} - - \begin{table}[htbp] - \begin{center} - \leavevmode - \begin{tabular}{|l|l|l|l|l|} - \hline - Cycle & Compression & Heating & Expansion & Cooling \\ - \hline - Otto & II & II & II & II \\ - Carnot & II & DI & II & DI \\ - Diesel & II & ID & II & II \\ - Joule & II & ID & II & ID \\ - \hline - \end{tabular} - \caption{Cycles and their causality} - \label{tab:cycles} - \end{center} - \end{table} - - A number of cycles can be built depending on the causality of the - two ports \textbf{[Heat]} and \textbf{[Work]} of \textbf{Cycle} - Some possible cycles listed in Tables \Ref{tab:cycles} where each - table entry gives the causality on the heat and work ports - respectively. - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_lbl.txt @@ -1,54 +0,0 @@ -#SUMMARY Cycle: Closed cycle with ideal gas -#DESCRIPTION Uses the CU two-port thermal capacitor. - -#ALIAS in Heat -#ALIAS out Work - -#ALIAS $1 ideal_gas -#ALIAS $2 c_v -#ALIAS $3 gamma_g -#ALIAS $4 m_g - -## Label file for system Cycle (Cycle_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.2 1998/07/21 14:21:04 peterg -# ## New style file -# ## -# ## Revision 1.1 1997/12/08 20:24:43 peterg -# ## Initial revision -# ## -# ## Revision 1.1 1997/12/07 20:38:05 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - - -# Component type CU - gas CU ideal_gas,c_v,gamma_g,m_g - -# Component type INTF - entropy - volume - -# Component type SS - S SS external,0 - T SS external,0 - V SS external,0 - P SS external,0 - [Heat] SS external,external - [Work] SS external,external - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_simp.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_simp.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_simp.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Cycle_simp.r @@ -1,10 +0,0 @@ -%% Reduce commands to simplify output for system Cycle (Cycle_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 3151 3601 3151 3376 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5176 3151 6751 3151 6526 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2026 2926 2026 3376 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 5850 8325 450 675 450 675 5850 8325 5850 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 5175 2925 5175 3375 -4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001 -4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001 -4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 2700 2925 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001 -4 1 1 1 0 3 30 0.0000000 4 390 3015 4365 4770 Isobaric process\001 -4 1 1 1 0 3 20 0.0000000 4 210 480 2700 3555 S=0\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 2565 3330 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 195 6120 3555 V\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 6165 3285 .\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_desc.tex @@ -1,16 +0,0 @@ -% Verbal description for system Isobaric (Isobaric_desc.tex) -% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/12/09 12:30:26 peterg -% Initial revision -% -% Revision 1.1 1997/12/08 09:37:04 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_input.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_input.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (Isobaric_input.txt) -# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:17:13 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Wed Aug 6 11:41:46 BST 2003: u(1) = 1000; #Entropy flow -isobaric__heat = 1000; #Entropy flow DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_lbl.txt @@ -1,38 +0,0 @@ -#SUMMARY Isobaric: Isobaric thermodynamic process - ideal gas -#DESCRIPTION A dynamic simulation of an isobaric (constant pressure) -#DESCRIPTION process using the Cycle component and the two-port CU component. - -#PAR P_0 -#PAR T_0 -#PAR V_0 - -#NOTPAR ideal_gas - -## Label file for system Isobaric (Isobaric_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.2 2000/12/28 18:17:13 peterg -# ## To RCS -# ## -# ## Revision 1.1 1998/07/21 14:32:49 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - -# Component type Cycle - cycle none ideal_gas;c_v;gamma_g;m_g - -# Component type SS - Heat SS internal,external - Work SS P_0,internal DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_numpar.txt @@ -1,23 +0,0 @@ -# Numerical parameter file (Isobaric_numpar.txt) -# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 1998/03/04 11:45:49 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Initial states -- needed to choose an approppriate mass -P_0 = 1e5; -V_0 = 1; -T_0 = 300; - -# Parameters -c_v = 718.0; # Parameter c_v for CU -gamma_g = 1.4; # Parameter gamma_g for CU -m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_rep.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_rep.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_rep.txt @@ -1,33 +0,0 @@ -# Outline report file for system Isobaric (Isobaric_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 18:17:13 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/02/21 02:19:31 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -ss Isobaric abg tex -mtt -ss Isobaric struc tex -mtt -ss Isobaric ode tex -mtt -ss Isobaric ss tex - -mtt -ss Isobaric numpar txt -mtt -ss Isobaric input txt - -mtt -ss Isobaric odeso ps 'Isobaric__cycle__V' -mtt -ss Isobaric odeso ps 'Isobaric__cycle__P' -mtt -ss Isobaric odeso ps 'Isobaric__cycle__S' -mtt -ss Isobaric odeso ps 'Isobaric__cycle__T' -mtt -ss Isobaric odeso ps 'Isobaric__cycle__V:Isobaric__cycle__P' -mtt -ss Isobaric odeso ps 'Isobaric__cycle__S:Isobaric__cycle__T' - - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt @@ -1,12 +0,0 @@ -%% Simulation parameters for system Isobaric (Isobaric_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=1.0 -DT=0.01 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt_old Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt_old ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt_old +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_simpar.txt_old @@ -1,12 +0,0 @@ -%% Simulation parameters for system Isobaric (Isobaric_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=1.0 -DT=0.01 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_sspar.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_sspar.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isobaric/Isobaric_sspar.r @@ -1,38 +0,0 @@ -% Steady-state parameter file (Isobaric_sspar.r) -% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Set a pressure of 1 bar -P_0 := 10^5; - -% Unit initial volume -V_0 := 1; - -% Internal energy -U_0 := P_0*V_0/(gamma_g-1); - -% Set initial temperature of 300k -T_0 := 300; - -% Deduce the mass of gas -m := U_0/(T_0*c_v); - -% Entropy -S_0 := U_0/T_0; - -% Steady-state states -MTTX1 := U_0; % Isobaric_cycle_gas (c) -%MTTX2 := V_0; % Isobaric_cycle_gas (c) -MTTX2 := S_0; % Isobaric_cycle_entropy (3) -MTTX3 := V_0; % Isobaric_cycle_volume (3) - -% Steady-state inputs -MTTU1 := 0; % Isobaric (Heat) -;;END; DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_abg.fig @@ -1,81 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5400 1800 6750 1800 6525 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 2025 5175 3375 5400 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5175 3825 5175 5175 5400 4950 -2 2 0 3 1 7 1 0 -1 0.000 1 0 -1 0 0 5 - 6075 900 9000 900 9000 2700 6075 2700 6075 900 -2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 - 8325 900 8550 900 8550 2700 8325 2700 8325 900 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10125 3825 10125 5175 10350 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 7875 1800 9900 1800 9675 2025 -2 2 0 2 1 3 1 0 20 0.000 0 0 -1 0 0 5 - 8550 1665 9585 1665 9585 1935 8550 1935 8550 1665 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 4725 1440 5805 1440 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 9675 1440 10755 1440 -2 1 0 2 1 7 1 0 -1 0.000 0 0 -1 1 0 2 - 1 0 2.00 120.00 240.00 - 7785 3465 8415 2835 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3600 1800 4950 1800 4725 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 1755 1800 3105 1800 2880 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 3375 2025 3375 5175 3600 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3150 5175 3600 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10350 1800 11700 1800 11475 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 12150 1800 13500 1800 13275 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 11700 5175 12150 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 11925 2025 11925 5175 12150 4950 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 10125 2025 10125 3375 10350 3150 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 2025 5400 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 2025 10350 2025 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 5175 10350 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 4950 5175 5400 5175 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6750 2025 6750 1575 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 9900 2025 9900 1575 -4 1 -1 0 0 0 20 0.0000 4 255 855 7290 1890 CU:gas\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 5175 1890 1\001 -4 1 -1 0 0 0 20 0.0000 4 255 1590 5175 3690 INTF:entropy\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 10125 1890 1\001 -4 1 1 1 0 3 20 0.0000 4 270 1035 7200 1440 Ideal gas\001 -4 1 1 1 0 3 20 0.0000 4 210 885 4635 1305 Heat in\001 -4 1 1 1 0 3 20 0.0000 4 210 1080 10170 1305 Work out\001 -4 1 1 1 0 3 20 0.0000 4 270 1800 5130 5895 Entropy change\001 -4 1 1 1 0 3 20 0.0000 4 270 1365 7110 3690 Ideal piston\001 -4 1 -1 0 0 0 20 0.0000 4 195 1560 10125 3690 INTF:volume\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 3375 1890 0\001 -4 2 4 0 0 0 20 0.0000 4 240 1140 1575 1890 SS:[Heat]\001 -4 1 -1 0 0 0 20 0.0000 4 195 585 3375 5490 SS:T\001 -4 1 1 1 0 3 20 0.0000 4 255 1485 3240 5895 Temperature\001 -4 1 -1 0 0 0 20 0.0000 4 195 570 5130 5490 SS:S\001 -4 1 -1 0 0 0 20 0.0000 4 195 615 10125 5490 SS:V\001 -4 1 -1 0 0 0 20 0.0000 4 195 570 11880 5490 SS:P\001 -4 0 4 0 0 0 20 0.0000 4 240 1230 13680 1890 SS:[Work]\001 -4 1 1 1 0 3 20 0.0000 4 270 1815 10080 5850 Volume change\001 -4 1 1 1 0 3 20 0.0000 4 195 975 11925 5850 Pressure\001 -4 1 -1 0 0 0 20 0.0000 4 195 135 11925 1890 0\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_desc.tex @@ -1,74 +0,0 @@ -% Verbal description for system Cycle (Cycle_desc.tex) -% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 1998/06/30 12:46:49 peterg -% %% Changed CT2 to CU -% %% -% %% Revision 1.1 1998/06/30 12:46:24 peterg -% %% Initial revision -% %% -% Revision 1.1 1997/12/08 09:37:04 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - The acausal bond graph of system \textbf{Cycle} is - displayed in Figure \Ref{Cycle_abg} and its label - file is listed in Section \Ref{sec:Cycle_lbl}. - The subsystems are listed in Section \Ref{sec:Cycle_sub}. - -The system has two heat engine ports: -\begin{enumerate} -\item \textbf{[Heat]} and -\item \textbf{[Work]} -\end{enumerate} -By convention, energy flows in to the \textbf{[Heat]} port and out of -the \textbf{[Work]} port. Both ports are true energy ports. - - -The subsystem \textbf{CU} (Section \Ref{sec:CU}) is a two-port -component describing an ideal gas. It has two energy ports which, with -integral causality correspond to -\begin{enumerate} -\item Entropy flow in; temperature out -\item Volume rate of change in; pressure out -\end{enumerate} - -Four \textbf{SS} components are set up as sensors to measure the -important quantities pertaining to the cycle: -\begin{enumerate} -\item \textbf{S} to measure the integrated entropy flow -\item \textbf{T} to measure the (absolute) temperature -\item \textbf{V} to measure the integrated volume change -\item \textbf{P} to measure the pressure -\end{enumerate} - - \begin{table}[htbp] - \begin{center} - \leavevmode - \begin{tabular}{|l|l|l|l|l|} - \hline - Cycle & Compression & Heating & Expansion & Cooling \\ - \hline - Otto & II & II & II & II \\ - Carnot & II & DI & II & DI \\ - Diesel & II & ID & II & II \\ - Joule & II & ID & II & ID \\ - \hline - \end{tabular} - \caption{Cycles and their causality} - \label{tab:cycles} - \end{center} - \end{table} - - A number of cycles can be built depending on the causality of the - two ports \textbf{[Heat]} and \textbf{[Work]} of \textbf{Cycle} - Some possible cycles listed in Tables \Ref{tab:cycles} where each - table entry gives the causality on the heat and work ports - respectively. - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_lbl.txt @@ -1,54 +0,0 @@ -#SUMMARY Cycle: Closed cycle with ideal gas -#DESCRIPTION Uses the CU two-port thermal capacitor. - -#ALIAS in Heat -#ALIAS out Work - -#ALIAS $1 ideal_gas -#ALIAS $2 c_v -#ALIAS $3 gamma_g -#ALIAS $4 m_g - -## Label file for system Cycle (Cycle_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.2 1998/07/21 14:21:04 peterg -# ## New style file -# ## -# ## Revision 1.1 1997/12/08 20:24:43 peterg -# ## Initial revision -# ## -# ## Revision 1.1 1997/12/07 20:38:05 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - - -# Component type CU - gas CU ideal_gas,c_v,gamma_g,m_g - -# Component type INTF - entropy - volume - -# Component type SS - S SS external,0 - T SS external,0 - V SS external,0 - P SS external,0 - [Heat] SS external,external - [Work] SS external,external - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_simp.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_simp.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_simp.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Cycle_simp.r @@ -1,10 +0,0 @@ -%% Reduce commands to simplify output for system Cycle (Cycle_simp.r) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -END; DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 3151 3601 3151 3376 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5176 3151 6751 3151 6526 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6751 2926 6751 3376 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 5850 8325 450 675 450 675 5850 8325 5850 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 3600 2925 3600 3375 -4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001 -4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001 -4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001 -4 1 1 1 0 3 30 0.0000000 4 390 3510 4365 4770 Isothermal process\001 -4 1 1 1 0 3 20 0.0000000 4 210 195 6120 3555 V\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 6165 3285 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 165 2700 3555 S\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 2700 3285 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 1005 2700 2925 T=const\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_desc.tex @@ -1,16 +0,0 @@ -% Verbal description for system Isothermal (Isothermal_desc.tex) -% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/12/09 12:30:26 peterg -% Initial revision -% -% Revision 1.1 1997/12/08 09:37:04 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_input.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_input.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (Isothermal_input.txt) -# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:17:37 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Wed Aug 6 10:47:34 BST 2003: u(1) = -0.8; # Volume rate-of-change -isothermal__work = -0.8; # Volume rate-of-change DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_lbl.txt @@ -1,38 +0,0 @@ -#SUMMARY Isothermal: Isothermal thermodynamic process - ideal gas -#DESCRIPTION A dynamic simulation of an isothermal process using -#DESCRIPTION the Cycle component and the two-port CU component. - -#PAR P_0 -#PAR T_0 -#PAR V_0 - -#NOTPAR ideal_gas - -## Label file for system Isothermal (Isothermal_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.2 2000/12/28 18:17:37 peterg -# ## To RCS -# ## -# ## Revision 1.1 1998/07/21 14:30:29 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - -# Component type Cycle - cycle none ideal_gas;c_v;gamma_g;m_g - -# Component type SS - Heat SS T_0,internal - Work SS internal,external DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_numpar.txt @@ -1,23 +0,0 @@ -# Numerical parameter file (Isothermal_numpar.txt) -# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 1998/03/04 11:45:49 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Initial states -- needed to choose an approppriate mass -P_0 = 1e5; -V_0 = 1; -T_0 = 300; - -# Parameters -c_v = 718.0; # Parameter c_v for CU -gamma_g = 1.4; # Parameter gamma_g for CU -m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_rep.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_rep.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_rep.txt @@ -1,33 +0,0 @@ -# Outline report file for system Isothermal (Isothermal_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 18:17:37 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/02/21 02:20:18 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -ss Isothermal abg tex -mtt -ss Isothermal struc tex -mtt -ss Isothermal ode tex -mtt -ss Isothermal ss tex - -mtt -ss Isothermal numpar txt -mtt -ss Isothermal input txt - -mtt -ss Isothermal odeso ps 'Isothermal__cycle__V' -mtt -ss Isothermal odeso ps 'Isothermal__cycle__P' -mtt -ss Isothermal odeso ps 'Isothermal__cycle__S' -mtt -ss Isothermal odeso ps 'Isothermal__cycle__T' -mtt -ss Isothermal odeso ps 'Isothermal__cycle__V:Isothermal__cycle__P' -mtt -ss Isothermal odeso ps 'Isothermal__cycle__S:Isothermal__cycle__T' - - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt @@ -1,12 +0,0 @@ -%% Simulation parameters for system Isothermal (Isothermal_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=1.0 -DT=0.01 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt_old Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt_old ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt_old +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_simpar.txt_old @@ -1,12 +0,0 @@ -%% Simulation parameters for system Isothermal (Isothermal_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=1.0 -DT=0.01 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_sspar.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_sspar.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isothermal/Isothermal_sspar.r @@ -1,37 +0,0 @@ -% Steady-state parameter file (Isothermal_sspar.r) -% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Set a pressure of 1 bar -P_0 := 10^5; - -% Unit initial volume -V_0 := 1; - -% Internal energy -U_0 := P_0*V_0/(gamma_g-1); - -% Set initial temperature of 300k -T_0 := 300; - -% Deduce the mass of gas -m := U_0/(T_0*c_v); - -% Entropy -S_0 := U_0/T_0; - -% Steady-state states -MTTX1 := V_0; % Isothermal_cycle_gas (c) -MTTX2 := S_0; % Isothermal_cycle_entropy (3) -MTTX3 := V_0; % Isothermal_cycle_volume (3) - -% Steady-state inputs -MTTU1 := 0; % Isothermal (Work) -;;END; DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_abg.fig Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_abg.fig ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_abg.fig +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_abg.fig @@ -1,25 +0,0 @@ -#FIG 3.1 -Portrait -Center -Metric -1200 2 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 2026 3151 3601 3151 3376 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3 - 5176 3151 6751 3151 6526 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 6751 2926 6751 3376 -2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 - 2026 2926 2026 3376 -2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5 - 8325 5850 8325 450 675 450 675 5850 8325 5850 -4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001 -4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001 -4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 2700 2925 T\001 -4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001 -4 1 1 1 0 3 30 0.0000000 4 390 4020 4365 4770 Isovolumetric process\001 -4 1 1 1 0 3 20 0.0000000 4 210 510 6120 3555 V=0\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 5940 3285 .\001 -4 1 1 1 0 3 20 0.0000000 4 210 165 2700 3555 S\001 -4 1 1 1 0 3 30 0.0000000 4 60 105 2700 3285 .\001 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_desc.tex Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_desc.tex ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_desc.tex +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_desc.tex @@ -1,16 +0,0 @@ -% Verbal description for system Isovolumetric (Isovolumetric_desc.tex) -% Generated by MTT on Thu Dec 4 15:59:55 GMT 1997. - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% Revision 1.1 1997/12/09 12:30:26 peterg -% Initial revision -% -% Revision 1.1 1997/12/08 09:37:04 peterg -% Initial revision -% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_input.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_input.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_input.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_input.txt @@ -1,16 +0,0 @@ -# Numerical parameter file (Isovolumetric_input.txt) -# Generated by MTT at Thu Dec 4 11:17:09 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 2000/12/28 18:17:57 peterg -# %% To RCS -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Set the inputs -## Removed by MTT on Wed Aug 6 11:04:07 BST 2003: u(1) = 1000; #Entropy flow -isovolumetric__heat = 1000; #Entropy flow DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_lbl.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_lbl.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_lbl.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_lbl.txt @@ -1,40 +0,0 @@ -#SUMMARY Isovolumetric: Isovolumetric thermodynamic process - ideal gas -#DESCRIPTION A dynamic simulation of an Isovolumetric (constant volume) -#DESCRIPTION process using the Cycle component and the two-port CU component. -#DESCRIPTION -#DESCRIPTION the Cycle component and the two-port CU component. - -#PAR P_0 -#PAR T_0 -#PAR V_0 - -#NOTPAR ideal_gas - -## Label file for system Isovolumetric (Isovolumetric_lbl.txt) - -# ############################################################### -# ## Version control history -# ############################################################### -# ## $Id$ -# ## $Log$ -# ## Revision 1.2 2000/12/28 18:17:57 peterg -# ## To RCS -# ## -# ## Revision 1.1 1998/07/21 14:37:03 peterg -# ## Initial revision -# ## -# ############################################################### - -## Each line should be of one of the following forms: -# a comment (ie starting with #) -# Component-name CR_name arg1,arg2,..argn -# blank - - - -# Component type Cycle - cycle none ideal_gas;c_v;gamma_g;m_g - -# Component type SS - Heat SS internal,external - Work SS internal,0 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_numpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_numpar.txt @@ -1,23 +0,0 @@ -# Numerical parameter file (Isovolumetric_numpar.txt) -# Generated by MTT at Thu Dec 4 11:44:46 GMT 1997 - -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% Version control history -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -# %% $Id$ -# %% $Log$ -# %% Revision 1.1 1998/03/04 11:45:49 peterg -# %% Initial revision -# %% -# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -# Initial states -- needed to choose an approppriate mass -P_0 = 1e5; -V_0 = 1; -T_0 = 300; - -# Parameters -c_v = 718.0; # Parameter c_v for CU -gamma_g = 1.4; # Parameter gamma_g for CU -m_g = P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_rep.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_rep.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_rep.txt @@ -1,33 +0,0 @@ -# Outline report file for system Isovolumetric (Isovolumetric_rep.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %% Revision 1.2 2000/12/28 18:17:57 peterg -% %% To RCS -% %% -% %% Revision 1.1 1999/02/21 02:21:03 peterg -% %% Initial revision -% %% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mtt -o -ss Isovolumetric abg tex -mtt -o -ss Isovolumetric struc tex -mtt -o -ss Isovolumetric ode tex -mtt -o -ss Isovolumetric ss tex - -mtt -o -ss Isovolumetric numpar txt -mtt -o -ss Isovolumetric input txt - -mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__V' -mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__P' -mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__S' -mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__T' -mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__V:Isovolumetric__cycle__P' -mtt -o -ss Isovolumetric odeso ps 'Isovolumetric__cycle__S:Isovolumetric__cycle__T' - - - - DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt @@ -1,12 +0,0 @@ -%% Simulation parameters for system Isovolumetric (Isovolumetric_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=1.0 -DT=0.01 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt_old Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt_old ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt_old +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_simpar.txt_old @@ -1,12 +0,0 @@ -%% Simulation parameters for system Isovolumetric (Isovolumetric_simpar.txt) - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %% $Id$ -% %% $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -LAST=1.0 -DT=0.01 -STEPFACTOR=1 DELETED mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_sspar.r Index: mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_sspar.r +++ mttroot/mtt/lib/examples/Thermal/ThermodynamicProcesses/Isovolumetric/Isovolumetric_sspar.r @@ -1,39 +0,0 @@ -% Steady-state parameter file (Isovolumetric_sspar.r) -% Generated by MTT at Wed Mar 4 11:02:40 GMT 1998 - -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % Version control history -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % $Id$ -% % $Log$ -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -% Set a pressure of 1 bar -P_0 := 10^5; - -% Unit initial volume -V_0 := 1; - -% Internal energy -U_0 := P_0*V_0/(gamma_g-1); - -% Set initial temperature of 300k -T_0 := 300; - -% Deduce the mass of gas -m := U_0/(T_0*c_v); - -% Entropy -S_0 := U_0/T_0; - -% Steady-state states -MTTX1 := U_0; % Isovolumetric_cycle_gas (c) -MTTX2 := V_0; % Isovolumetric_cycle_gas (c) -MTTX3 := S_0; % Isovolumetric_cycle_entropy (3) -MTTX4 := V_0; % Isovolumetric_cycle_volume (3) - -% Steady-state inputs -MTTU1 := 0; % Isovolumetric (Heat) -MTTU2 := 0; % Isovolumetric (Work) -;;END; DELETED mttroot/mtt/lib/examples/debian/README.Debian Index: mttroot/mtt/lib/examples/debian/README.Debian ================================================================== --- mttroot/mtt/lib/examples/debian/README.Debian +++ mttroot/mtt/lib/examples/debian/README.Debian @@ -1,6 +0,0 @@ -mtt-examples for Debian ------------------------ - -Library of examples for MTT (Model Transformation Tools). - - -- Geraint Paul Bevan , Wed, 18 Feb 2004 22:47:08 +0000 DELETED mttroot/mtt/lib/examples/debian/changelog Index: mttroot/mtt/lib/examples/debian/changelog ================================================================== --- mttroot/mtt/lib/examples/debian/changelog +++ mttroot/mtt/lib/examples/debian/changelog @@ -1,6 +0,0 @@ -mtt-examples (5.0-1) unstable; urgency=low - - * Initial Release. - - -- Geraint Paul Bevan Wed, 18 Feb 2004 22:47:08 +0000 - DELETED mttroot/mtt/lib/examples/debian/compat Index: mttroot/mtt/lib/examples/debian/compat ================================================================== --- mttroot/mtt/lib/examples/debian/compat +++ mttroot/mtt/lib/examples/debian/compat @@ -1,1 +0,0 @@ -4 DELETED mttroot/mtt/lib/examples/debian/conffiles.ex Index: mttroot/mtt/lib/examples/debian/conffiles.ex ================================================================== --- mttroot/mtt/lib/examples/debian/conffiles.ex +++ mttroot/mtt/lib/examples/debian/conffiles.ex @@ -1,7 +0,0 @@ -# -# If you want to use this conffile, remove all comments and put files that -# you want dpkg to process here using their absolute pathnames. -# See the policy manual -# -# for example: -# /etc/mtt-examples/mtt-examples.conf DELETED mttroot/mtt/lib/examples/debian/control Index: mttroot/mtt/lib/examples/debian/control ================================================================== --- mttroot/mtt/lib/examples/debian/control +++ mttroot/mtt/lib/examples/debian/control @@ -1,15 +0,0 @@ -Source: mtt-examples -Section: contrib/math -Priority: optional -Maintainer: Geraint Paul Bevan -Build-Depends: debhelper (>= 4.0.0) -Standards-Version: 3.6.0 - -Package: mtt-examples -Architecture: all -Depends: mtt -Description: Library of examples for Model Transformation Tools - A library of examples containing models of systems which span a range of physical domains (including chemical, electrical, hydraulic, mechanical and thermal) and which demonstrate several uses of bond graph modelling with MTT, such as analysis, control and simulation. - . - The MTT homepage is located at http://mtt.sourceforge.net. An on-line manual is available at http://mtt.sourceforge.net/doc. - . DELETED mttroot/mtt/lib/examples/debian/copyright Index: mttroot/mtt/lib/examples/debian/copyright ================================================================== --- mttroot/mtt/lib/examples/debian/copyright +++ mttroot/mtt/lib/examples/debian/copyright @@ -1,16 +0,0 @@ -This package was debianized by Geraint Paul Bevan on -Wed, 18 Feb 2004 22:47:08 +0000. - -It was downloaded from http://sourceforge.net/projects/mtt - -Upstream Author(s): Peter Gawthrop - -Copyright: - -mtt-examples is copyright (c) 1989-2004 by Peter J. Gawthrop. - -You are free to distribute this software under the terms of the -GNU General Public License (GPL). - -On Debian systems, the complete text of the GNU General Public License -can be found in /usr/share/common-licenses/GPL. DELETED mttroot/mtt/lib/examples/debian/cron.d.ex Index: mttroot/mtt/lib/examples/debian/cron.d.ex ================================================================== --- mttroot/mtt/lib/examples/debian/cron.d.ex +++ mttroot/mtt/lib/examples/debian/cron.d.ex @@ -1,4 +0,0 @@ -# -# Regular cron jobs for the mtt-examples package -# -0 4 * * * root mtt-examples_maintenance DELETED mttroot/mtt/lib/examples/debian/dirs Index: mttroot/mtt/lib/examples/debian/dirs ================================================================== --- mttroot/mtt/lib/examples/debian/dirs +++ mttroot/mtt/lib/examples/debian/dirs @@ -1,2 +0,0 @@ -usr/bin - DELETED mttroot/mtt/lib/examples/debian/docs Index: mttroot/mtt/lib/examples/debian/docs ================================================================== --- mttroot/mtt/lib/examples/debian/docs +++ mttroot/mtt/lib/examples/debian/docs DELETED mttroot/mtt/lib/examples/debian/emacsen-install.ex Index: mttroot/mtt/lib/examples/debian/emacsen-install.ex ================================================================== --- mttroot/mtt/lib/examples/debian/emacsen-install.ex +++ mttroot/mtt/lib/examples/debian/emacsen-install.ex @@ -1,45 +0,0 @@ -#! /bin/sh -e -# /usr/lib/emacsen-common/packages/install/mtt-examples - -# Written by Jim Van Zandt , borrowing heavily -# from the install scripts for gettext by Santiago Vila -# and octave by Dirk Eddelbuettel . - -FLAVOR=$1 -PACKAGE=mtt-examples - -if [ ${FLAVOR} = emacs ]; then exit 0; fi - -echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} - -#FLAVORTEST=`echo $FLAVOR | cut -c-6` -#if [ ${FLAVORTEST} = xemacs ] ; then -# SITEFLAG="-no-site-file" -#else -# SITEFLAG="--no-site-file" -#fi -FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" - -ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} -ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} - -# Install-info-altdir does not actually exist. -# Maybe somebody will write it. -if test -x /usr/sbin/install-info-altdir; then - echo install/${PACKAGE}: install Info links for ${FLAVOR} - install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz -fi - -install -m 755 -d ${ELCDIR} -cd ${ELDIR} -FILES=`echo *.el` -cp ${FILES} ${ELCDIR} -cd ${ELCDIR} - -cat << EOF > path.el -(setq load-path (cons "." load-path) byte-compile-warnings nil) -EOF -${FLAVOR} ${FLAGS} ${FILES} -rm -f *.el path.el - -exit 0 DELETED mttroot/mtt/lib/examples/debian/emacsen-remove.ex Index: mttroot/mtt/lib/examples/debian/emacsen-remove.ex ================================================================== --- mttroot/mtt/lib/examples/debian/emacsen-remove.ex +++ mttroot/mtt/lib/examples/debian/emacsen-remove.ex @@ -1,15 +0,0 @@ -#!/bin/sh -e -# /usr/lib/emacsen-common/packages/remove/mtt-examples - -FLAVOR=$1 -PACKAGE=mtt-examples - -if [ ${FLAVOR} != emacs ]; then - if test -x /usr/sbin/install-info-altdir; then - echo remove/${PACKAGE}: removing Info links for ${FLAVOR} - install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/mtt-examples.info.gz - fi - - echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} - rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} -fi DELETED mttroot/mtt/lib/examples/debian/emacsen-startup.ex Index: mttroot/mtt/lib/examples/debian/emacsen-startup.ex ================================================================== --- mttroot/mtt/lib/examples/debian/emacsen-startup.ex +++ mttroot/mtt/lib/examples/debian/emacsen-startup.ex @@ -1,19 +0,0 @@ -;; -*-emacs-lisp-*- -;; -;; Emacs startup file for the Debian mtt-examples package -;; -;; Originally contributed by Nils Naumann -;; Modified by Dirk Eddelbuettel -;; Adapted for dh-make by Jim Van Zandt - -;; The mtt-examples package follows the Debian/GNU Linux 'emacsen' policy and -;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, -;; xemacs19, emacs20, xemacs20...). The compiled code is then -;; installed in a subdirectory of the respective site-lisp directory. -;; We have to add this to the load-path: -(let ((package-dir (concat "/usr/share/" - (symbol-name flavor) - "/site-lisp/mtt-examples"))) - (when (file-directory-p package-dir) - (setq load-path (cons package-dir load-path)))) - DELETED mttroot/mtt/lib/examples/debian/init.d.ex Index: mttroot/mtt/lib/examples/debian/init.d.ex ================================================================== --- mttroot/mtt/lib/examples/debian/init.d.ex +++ mttroot/mtt/lib/examples/debian/init.d.ex @@ -1,74 +0,0 @@ -#! /bin/sh -# -# skeleton example file to build /etc/init.d/ scripts. -# This file should be used to construct scripts for /etc/init.d. -# -# Written by Miquel van Smoorenburg . -# Modified for Debian -# by Ian Murdock . -# -# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl -# - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/mtt-examples -NAME=mtt-examples -DESC=mtt-examples - -test -x $DAEMON || exit 0 - -# Include mtt-examples defaults if available -if [ -f /etc/default/mtt-examples ] ; then - . /etc/default/mtt-examples -fi - -set -e - -case "$1" in - start) - echo -n "Starting $DESC: " - start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON -- $DAEMON_OPTS - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON - echo "$NAME." - ;; - #reload) - # - # If the daemon can reload its config files on the fly - # for example by sending it SIGHUP, do it here. - # - # If the daemon responds to changes in its config file - # directly anyway, make this a do-nothing entry. - # - # echo "Reloading $DESC configuration files." - # start-stop-daemon --stop --signal 1 --quiet --pidfile \ - # /var/run/$NAME.pid --exec $DAEMON - #;; - restart|force-reload) - # - # If the "reload" option is implemented, move the "force-reload" - # option to the "reload" entry above. If not, "force-reload" is - # just the same as "restart". - # - echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON - sleep 1 - start-stop-daemon --start --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS - echo "$NAME." - ;; - *) - N=/etc/init.d/$NAME - # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 DELETED mttroot/mtt/lib/examples/debian/manpage.1.ex Index: mttroot/mtt/lib/examples/debian/manpage.1.ex ================================================================== --- mttroot/mtt/lib/examples/debian/manpage.1.ex +++ mttroot/mtt/lib/examples/debian/manpage.1.ex @@ -1,60 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH MTT-EXAMPLES SECTION "February 18, 2004" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -mtt-examples \- program to do something -.SH SYNOPSIS -.B mtt-examples -.RI [ options ] " files" ... -.br -.B bar -.RI [ options ] " files" ... -.SH DESCRIPTION -This manual page documents briefly the -.B mtt-examples -and -.B bar -commands. -This manual page was written for the Debian distribution -because the original program does not have a manual page. -Instead, it has documentation in the GNU Info format; see below. -.PP -.\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, -.\" respectively. -\fBmtt-examples\fP is a program that... -.SH OPTIONS -These programs follow the usual GNU command line syntax, with long -options starting with two dashes (`-'). -A summary of options is included below. -For a complete description, see the Info files. -.TP -.B \-h, \-\-help -Show summary of options. -.TP -.B \-v, \-\-version -Show version of program. -.SH SEE ALSO -.BR bar (1), -.BR baz (1). -.br -The programs are documented fully by -.IR "The Rise and Fall of a Fooish Bar" , -available via the Info system. -.SH AUTHOR -This manual page was written by Geraint Paul Bevan , -for the Debian project (but may be used by others). DELETED mttroot/mtt/lib/examples/debian/manpage.sgml.ex Index: mttroot/mtt/lib/examples/debian/manpage.sgml.ex ================================================================== --- mttroot/mtt/lib/examples/debian/manpage.sgml.ex +++ mttroot/mtt/lib/examples/debian/manpage.sgml.ex @@ -1,156 +0,0 @@ - manpage.1'. You may view - the manual page with: `docbook-to-man manpage.sgml | nroff -man | - less'. A typical entry in a Makefile or Makefile.am is: - -manpage.1: manpage.sgml - docbook-to-man $< > $@ - - - The docbook-to-man binary is found in the docbook-to-man package. - Please remember that if you create the nroff version in one of the - debian/rules file targets (such as build), you will need to include - docbook-to-man in your Build-Depends control field. - - --> - - - FIRSTNAME"> - SURNAME"> - - February 18, 2004"> - - SECTION"> - geraint@users.sourceforge.net"> - - MTT-EXAMPLES"> - - - Debian"> - GNU"> - GPL"> -]> - - - -
      - &dhemail; -
      - - &dhfirstname; - &dhsurname; - - - 2003 - &dhusername; - - &dhdate; -
      - - &dhucpackage; - - &dhsection; - - - &dhpackage; - - program to do something - - - - &dhpackage; - - - - - - - - DESCRIPTION - - This manual page documents briefly the - &dhpackage; and bar - commands. - - This manual page was written for the &debian; distribution - because the original program does not have a manual page. - Instead, it has documentation in the &gnu; - Info format; see below. - - &dhpackage; is a program that... - - - - OPTIONS - - These programs follow the usual &gnu; command line syntax, - with long options starting with two dashes (`-'). A summary of - options is included below. For a complete description, see the - Info files. - - - - - - - - Show summary of options. - - - - - - - - Show version of program. - - - - - - SEE ALSO - - bar (1), baz (1). - - The programs are documented fully by The Rise and - Fall of a Fooish Bar available via the - Info system. - - - AUTHOR - - This manual page was written by &dhusername; &dhemail; for - the &debian; system (but may be used by others). Permission is - granted to copy, distribute and/or modify this document under - the terms of the &gnu; General Public License, Version 2 any - later version published by the Free Software Foundation. - - - On Debian systems, the complete text of the GNU General Public - License can be found in /usr/share/common-licenses/GPL. - - - -
      - - - - DELETED mttroot/mtt/lib/examples/debian/manpage.xml.ex Index: mttroot/mtt/lib/examples/debian/manpage.xml.ex ================================================================== --- mttroot/mtt/lib/examples/debian/manpage.xml.ex +++ mttroot/mtt/lib/examples/debian/manpage.xml.ex @@ -1,148 +0,0 @@ - -.
      will be generated. You may view the -manual page with: nroff -man .
      | less'. A -typical entry in a Makefile or Makefile.am is: - -DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ -manpages/docbook.xsl -XP=xsltproc -''-nonet - -manpage.1: manpage.dbk - $(XP) $(DB2MAN) $< - -The xsltproc binary is found in the xsltproc package. The -XSL files are in docbook-xsl. Please remember that if you -create the nroff version in one of the debian/rules file -targets (such as build), you will need to include xsltproc -and docbook-xsl in your Build-Depends control field. - ---> - - - FIRSTNAME"> - SURNAME"> - - February 18, 2004"> - - SECTION"> - geraint@users.sourceforge.net"> - - MTT-EXAMPLES"> - - - Debian"> - GNU"> - GPL"> -]> - - - -
      - &dhemail; -
      - - &dhfirstname; - &dhsurname; - - - 2003 - &dhusername; - - &dhdate; -
      - - &dhucpackage; - - &dhsection; - - - &dhpackage; - - program to do something - - - - &dhpackage; - - - - - - - - DESCRIPTION - - This manual page documents briefly the - &dhpackage; and bar - commands. - - This manual page was written for the &debian; distribution - because the original program does not have a manual page. - Instead, it has documentation in the &gnu; - Info format; see below. - - &dhpackage; is a program that... - - - - OPTIONS - - These programs follow the usual &gnu; command line syntax, - with long options starting with two dashes (`-'). A summary of - options is included below. For a complete description, see the - Info files. - - - - - - - - Show summary of options. - - - - - - - - Show version of program. - - - - - - SEE ALSO - - bar (1), baz (1). - - The programs are documented fully by The Rise and - Fall of a Fooish Bar available via the - Info system. - - - AUTHOR - - This manual page was written by &dhusername; &dhemail; for - the &debian; system (but may be used by others). Permission is - granted to copy, distribute and/or modify this document under - the terms of the &gnu; General Public License, Version 2 any - later version published by the Free Software Foundation. - - - On Debian systems, the complete text of the GNU General Public - License can be found in /usr/share/common-licenses/GPL. - - - -
      - DELETED mttroot/mtt/lib/examples/debian/menu.ex Index: mttroot/mtt/lib/examples/debian/menu.ex ================================================================== --- mttroot/mtt/lib/examples/debian/menu.ex +++ mttroot/mtt/lib/examples/debian/menu.ex @@ -1,2 +0,0 @@ -?package(mtt-examples):needs=X11|text|vc|wm section=Apps/see-menu-manual\ - title="mtt-examples" command="/usr/bin/mtt-examples" DELETED mttroot/mtt/lib/examples/debian/mtt-examples-default.ex Index: mttroot/mtt/lib/examples/debian/mtt-examples-default.ex ================================================================== --- mttroot/mtt/lib/examples/debian/mtt-examples-default.ex +++ mttroot/mtt/lib/examples/debian/mtt-examples-default.ex @@ -1,10 +0,0 @@ -# Defaults for mtt-examples initscript -# sourced by /etc/init.d/mtt-examples -# installed at /etc/default/mtt-examples by the maintainer scripts - -# -# This is a POSIX shell fragment -# - -# Additional options that are passed to the Daemon. -DAEMON_OPTS="" DELETED mttroot/mtt/lib/examples/debian/mtt-examples.doc-base.EX Index: mttroot/mtt/lib/examples/debian/mtt-examples.doc-base.EX ================================================================== --- mttroot/mtt/lib/examples/debian/mtt-examples.doc-base.EX +++ mttroot/mtt/lib/examples/debian/mtt-examples.doc-base.EX @@ -1,22 +0,0 @@ -Document: mtt-examples -Title: Debian mtt-examples Manual -Author: -Abstract: This manual describes what mtt-examples is - and how it can be used to - manage online manuals on Debian systems. -Section: unknown - -Format: debiandoc-sgml -Files: /usr/share/doc/mtt-examples/mtt-examples.sgml.gz - -Format: postscript -Files: /usr/share/doc/mtt-examples/mtt-examples.ps.gz - -Format: text -Files: /usr/share/doc/mtt-examples/mtt-examples.text.gz - -Format: HTML -Index: /usr/share/doc/mtt-examples/html/index.html -Files: /usr/share/doc/mtt-examples/html/*.html - - DELETED mttroot/mtt/lib/examples/debian/postinst.ex Index: mttroot/mtt/lib/examples/debian/postinst.ex ================================================================== --- mttroot/mtt/lib/examples/debian/postinst.ex +++ mttroot/mtt/lib/examples/debian/postinst.ex @@ -1,42 +0,0 @@ -#! /bin/sh -# postinst script for mtt-examples -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package -# - -case "$1" in - configure) - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - DELETED mttroot/mtt/lib/examples/debian/postrm.ex Index: mttroot/mtt/lib/examples/debian/postrm.ex ================================================================== --- mttroot/mtt/lib/examples/debian/postrm.ex +++ mttroot/mtt/lib/examples/debian/postrm.ex @@ -1,38 +0,0 @@ -#! /bin/sh -# postrm script for mtt-examples -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' overwrit>r> -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - - - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 DELETED mttroot/mtt/lib/examples/debian/preinst.ex Index: mttroot/mtt/lib/examples/debian/preinst.ex ================================================================== --- mttroot/mtt/lib/examples/debian/preinst.ex +++ mttroot/mtt/lib/examples/debian/preinst.ex @@ -1,44 +0,0 @@ -#! /bin/sh -# preinst script for mtt-examples -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - install|upgrade) -# if [ "$1" = "upgrade" ] -# then -# start-stop-daemon --stop --quiet --oknodo \ -# --pidfile /var/run/mtt-examples.pid \ -# --exec /usr/sbin/mtt-examples 2>/dev/null || true -# fi - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - DELETED mttroot/mtt/lib/examples/debian/prerm.ex Index: mttroot/mtt/lib/examples/debian/prerm.ex ================================================================== --- mttroot/mtt/lib/examples/debian/prerm.ex +++ mttroot/mtt/lib/examples/debian/prerm.ex @@ -1,39 +0,0 @@ -#! /bin/sh -# prerm script for mtt-examples -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `upgrade' -# * `failed-upgrade' -# * `remove' `in-favour' -# * `deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - remove|upgrade|deconfigure) -# install-info --quiet --remove /usr/info/mtt-examples.info.gz - ;; - failed-upgrade) - ;; - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - DELETED mttroot/mtt/lib/examples/debian/rules Index: mttroot/mtt/lib/examples/debian/rules ================================================================== --- mttroot/mtt/lib/examples/debian/rules +++ mttroot/mtt/lib/examples/debian/rules @@ -1,98 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - - - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - #/usr/bin/docbook-to-man debian/mtt-examples.sgml > mtt-examples.1 - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) clean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/mtt-examples. - $(MAKE) install DESTDIR=$(CURDIR)/debian/mtt-examples - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs -# dh_installdocs - dh_installexamples -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_python -# dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure DELETED mttroot/mtt/lib/examples/debian/watch.ex Index: mttroot/mtt/lib/examples/debian/watch.ex ================================================================== --- mttroot/mtt/lib/examples/debian/watch.ex +++ mttroot/mtt/lib/examples/debian/watch.ex @@ -1,6 +0,0 @@ -# Example watch control file for uscan -# Rename this file to "watch" and then you can run the "uscan" command -# to check for upstream updates and more. -# Site Directory Pattern Version Script -version=2 -sunsite.unc.edu /pub/Linux/Incoming mtt-examples-(.*)\.tar\.gz debian uupdate DELETED mttroot/mtt/lib/latex/bg.sty Index: mttroot/mtt/lib/latex/bg.sty ================================================================== --- mttroot/mtt/lib/latex/bg.sty +++ mttroot/mtt/lib/latex/bg.sty @@ -1,35 +0,0 @@ -%% Bond Graph commands -\newcommand{\B}[1]{\text{\sffamily\textbf{#1}}} -\newcommand{\AmpE}{\B{AE }} -\newcommand{\AF}{\B{AF }} -\newcommand{\C}{\B{C }} -\newcommand{\CSW}{\B{CSW }} -\newcommand{\De}{\B{De }} -\newcommand{\Df}{\B{Df }} -\newcommand{\I}{\B{I }} -\newcommand{\INTF}{\B{INTF }} -\newcommand{\ISW}{\B{ISW }} -\newcommand{\R}{\B{R }} -\newcommand{\Se}{\B{Se }} -\newcommand{\Sf}{\B{Sf }} -\newcommand{\Ss}{\B{SS }} -\newcommand{\one}{\B{1 }} -\newcommand{\zero}{\B{0 }} -\newcommand{\TF}{\B{TF }} -\newcommand{\GY}{\B{GY }} - -%% Bond Graph components with label -\newcommand{\BB}[2]{$\B{#1}$:$\mathbf{#2}$} %Generic - -\newcommand{\BC}[1]{\BB{C}{#1}} -\newcommand{\BI}[1]{\BB{I}{#1}} -\newcommand{\BR}[1]{\BB{R}{#1}} - -\newcommand{\BSS}[1]{\BB{SS}{#1}} -\newcommand{\BSe}[1]{\BB{Se}{#1}} -\newcommand{\BSf}[1]{\BB{Sf}{#1}} -\newcommand{\BDe}[1]{\BB{De}{#1}} -\newcommand{\BDf}[1]{\BB{Df}{#1}} - -\newcommand{\BTF}[1]{\BB{TF}{#1}} -\newcommand{\BGY}[1]{\BB{TF}{#1}} DELETED mttroot/mtt/lib/octave/.octaverc Index: mttroot/mtt/lib/octave/.octaverc ================================================================== --- mttroot/mtt/lib/octave/.octaverc +++ mttroot/mtt/lib/octave/.octaverc @@ -1,16 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Startup file for Octave for use with MTT -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -implicit_str_to_num_ok = 1; -empty_list_elements_ok = 1; -warn_string_concat = 0; - -## Turn off irrelevant warnings -warning off Octave:possible-matlab-short-circuit-operator -warning off Octave:deprecated-syntax - -## No more core dumps -crash_dumps_octave_core(0) -sigterm_dumps_octave_core(0) -sighup_dumps_octave_core(0) DELETED mttroot/mtt/lib/octave/README Index: mttroot/mtt/lib/octave/README ================================================================== --- mttroot/mtt/lib/octave/README +++ mttroot/mtt/lib/octave/README @@ -1,1 +0,0 @@ -This contains some octave specific helps to MTT DELETED mttroot/mtt/lib/octave/mkoctfile Index: mttroot/mtt/lib/octave/mkoctfile ================================================================== --- mttroot/mtt/lib/octave/mkoctfile +++ mttroot/mtt/lib/octave/mkoctfile @@ -1,202 +0,0 @@ -#! /bin/sh -# -# mkoctfile -- create a .oct file suitable for dynamic linking by -# Octave. -echo mkoctfile with optimisation level 0 -# Exit immediately on any error. - -set -e - -# Default values for these variables are filled in when Octave is -# compiled. - -: ${CPPFLAGS=""} -: ${INCFLAGS="-I/usr/include -I/usr/include/octave-2.0.16"} -: ${F77="g77"} -: ${FFLAGS="-O0"} -: ${FPICFLAG="-fPIC"} -: ${CC="gcc"} -: ${CFLAGS="-DHAVE_CONFIG_H -mieee-fp -O0"} -: ${CPICFLAG="-fPIC"} -: ${CXX="c++"} -: ${CXXFLAGS="-O0"} -: ${CXXPICFLAG="-fPIC"} -: ${XTRA_CFLAGS="-mieee-fp -fno-rtti -fno-exceptions -fno-implicit-templates"} -: ${XTRA_CXXFLAGS="-mieee-fp -fno-rtti -fno-exceptions -fno-implicit-templates"} - -: ${SH_LD="c++"} -: ${SH_LDFLAGS="-shared"} - -: ${ALL_FFLAGS="$FFLAGS"} - -: ${ALL_CFLAGS="$INCFLAGS $XTRA_CFLAGS $CFLAGS"} - -: ${ALL_CXXFLAGS="$INCFLAGS $XTRA_CXXFLAGS $CXXFLAGS"} - -# Local variables. - -usage_msg="usage: mkoctfile [options] file ..." - -cfiles= -ccfiles= -f77files= -objfiles= -octfiles= -octfile= -incflags= -defs= -ldflags= -dbg=: -strip=false - -if [ $# -eq 0 ]; then - echo $usage_msg - exit 1; -fi - -while [ $# -gt 0 ]; do - file= - case "$1" in - *.c) - file=$1 - cfiles="$cfiles $file" - ;; - *.cc | *.C | *.cpp) - file=$1 - ccfiles="$ccfiles $file" - ;; - *.f | *.F) - file=$1 - f77files="$f77files $file" - ;; - *.o) - file=$1 - objfiles="$objfiles $file" - ;; - -d | --debug | -v | --verbose) - dbg=echo - ;; - -h | -\? | --help) - echo $usage_msg - cat << EOF - -Options: - - -h, -?, --help Print this message. - -IDIR Add -IDIR to compile commands. - -DDEF Add -DDEF to compile commands. - -lLIB Add library LIB to link command. - -LDIR Add -LDIR to link command. - -o FILE, --output FILE Output file name. Default extension is .oct. - -s, --strip Strip output file. - -v, --verbose Echo commands as they are executed. - - FILE Compile or link FILE. Recognized file types are: - - .c C source - .cc C++ source - .C C++ source - .cpp C++ source - .f Fortran source - .F Fortran source - .o object file - -EOF - exit 0 - ;; - -I*) - incflags="$incflags $1" - ;; - -D*) - defs="$defs $1" - ;; - -[lL]*) - ldflags="$ldflags $1" - ;; - -o | --output) - shift - if [ $# -gt 0 ]; then - octfile=`echo $1 | sed 's,\.[^.]*$,,'`.oct - else - echo "mkoctfile: output file name missing" - fi - ;; - -s | --strip) - strip=true - ;; - *) - echo "mkoctfile: unrecognized argument $1" - exit 1 - ;; - esac - if [ -n "$file" ]; then - if [ -z "$octfile" ]; then - octfile=`echo $file | sed 's,\.[^.]*$,,'`.oct - fi - fi - shift -done - -# Compile Fortran, C, and C++ files. Add the name of each object file -# that is produced to the overall list of object files. - -if [ -n "$f77files" ]; then - for f in $f77files; do - case $f in - *.f) - b=`echo $f | sed 's,\.f$,,'` - ;; - *.F) - b=`echo $f | sed 's,\.F$,,'` - ;; - esac - o=$b.o - objfiles="$objfiles $o" - $dbg $F77 -c $FPICFLAG $ALL_FFLAGS $f -o $o - eval $F77 -c $FPICFLAG $ALL_FFLAGS $f -o $o - done -fi - -if [ -n "$cfiles" ]; then - for f in $cfiles; do - b=`echo $f | sed 's,\.c$,,'` - o=$b.o - objfiles="$objfiles $o" - $dbg $CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $incflags $defs $f -o $o - eval $CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $incflags $defs $f -o $o - done -fi - -if [ -n "$ccfiles" ]; then - for f in $ccfiles; do - case $f in - *.cc) - b=`echo $f | sed 's,\.cc$,,'` - ;; - *.C) - b=`echo $f | sed 's,\.C$,,'` - ;; - *.cpp) - b=`echo $f | sed 's,\.cpp$,,'` - ;; - esac - o=$b.o - objfiles="$objfiles $o" - $dbg $CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $incflags $defs $f -o $o - eval $CXX -c $CPPFLAGS $CXXPICFLAG $ALL_CXXFLAGS $incflags $defs $f -o $o - done -fi - -# Link all the object files. - -$dbg $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags -eval $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags - -# Maybe strip it. - -if $strip; then - $dbg strip $octfile - eval strip $octfile -fi - -exit 0 DELETED mttroot/mtt/lib/reduce/fix_c.r Index: mttroot/mtt/lib/reduce/fix_c.r ================================================================== --- mttroot/mtt/lib/reduce/fix_c.r +++ mttroot/mtt/lib/reduce/fix_c.r @@ -1,26 +0,0 @@ -%% Fixes for c-code generation - -%% Set PI explicitly here to avoid later conflict with cc headers -%% if PI is not already a number (i.e. on rounded has not been set) -IF NOT NUMBERP (pi) THEN LET PI = 3.14159$ - -ON ROUNDED$ % No integer output - -%% Changes x^y to pow(x,y) - OPERATOR pow$ - FOR ALL x,y LET x^y = pow(x,y)$ % Use the pow function - FOR ALL x,y LET x**y = pow(x,y)$ % Use the pow function - - %% Derivatives - FOR ALL f,g,x LET df(pow(f,g),x)= - pow(f,g-1) * (df(f,x)*g + df(g,x)*f*log(f))$ - - %% Special cases - FOR ALL x LET pow(x,0) = 1$ - FOR ALL x LET pow(x,1) = x$ - -OPERATOR fabs$ -FOR ALL x let abs(x) = fabs(x)$ - - -END$ DELETED mttroot/mtt/lib/reduce/reserved_words.make Index: mttroot/mtt/lib/reduce/reserved_words.make ================================================================== --- mttroot/mtt/lib/reduce/reserved_words.make +++ mttroot/mtt/lib/reduce/reserved_words.make @@ -1,15 +0,0 @@ -#! /bin/sh - -reduce_reserved_word_manual_page=${1:-"/usr/local/reduce/doc/manual/appenda.tex"} -output="reserved_words.txt" - -cat $reduce_reserved_word_manual_page |\ - tr "\n" " " |\ - sed 's/\\\_/_/g' |\ - sed 's/\\tt\ \([A-Za-z0-9_]*\)/\"\1\"/g' |\ - tr " " "\n" |\ - sed 's/\{//g' |\ - sed 's/\}//g' |\ - gawk -F\" '(NF==3) { printf "%s\n",$2 }' |\ - sort -u \ -> $output DELETED mttroot/mtt/lib/reduce/reserved_words.txt Index: mttroot/mtt/lib/reduce/reserved_words.txt ================================================================== --- mttroot/mtt/lib/reduce/reserved_words.txt +++ mttroot/mtt/lib/reduce/reserved_words.txt @@ -1,279 +0,0 @@ -ABS -ACOS -ACOSH -ACOT -ACOTH -ACSC -ACSCH -ADJPREC -ALGEBRAIC -ALGINT -ALLBRANCH -ALLFAC -AND -ANTISYMMETRIC -APPEND -ARGLENGTH -ARRAY -ASEC -ASECH -ASIN -ASINH -ATAN -ATAN2 -ATANH -BEGIN -BFSPACE -BYE -CARD_NO -CEILING -CLEAR -CLEARRULES -COEFF -COEFFN -COFACTOR -COMBINEEXPT -COMBINELOGS -COMMENT -COMP -COMPLEX -CONJ -CONS -CONT -COS -COSH -COT -COTH -CRAMER -CREF -CSC -CSCH -DECOMPOSE -DEFINE -DEFN -DEG -DEMO -DEN -DEPEND -DET -DF -DIFFERENCE -DILOG -DISPLAY -DIV -DO -E -ECHO -ED -EDITDEF -EI -END -EPS -EQ -EQUAL -ERF -ERRCONT -EVALLHSEQP -EVAL_MODE -EVEN -EVENP -EXP -EXPANDLOGS -EXPR -EXPT -EZGCD -FACTOR -FACTORIAL -FACTORIZE -FEXPR -FIRST -FIX -FIXP -FLOOR -FOR -FORALL -FOREACH -FORT -FORT_WIDTH -FREEOF -FULLROOTS -G -GCD -GEQ -GO -GOTO -GREATERP -HIGH_POW -HYPOT -I -IF -IFACTOR -IMPART -IN -INDEX -INFINITY -INFIX -INPUT -INT -INTEGER -INTERPOL -INTSTR -K -KORDER -LAMBDA -LCM -LCOF -LENGTH -LEQ -LESSP -LET -LHS -LINEAR -LINELENGTH -LISP -LIST -LISTARGP -LISTARGS -LN -LOAD -LOAD_PACKAGE -LOG -LOG10 -LOGB -LOW_POW -LTERM -MACRO -MAINVAR -MASS -MAT -MATCH -MATEIGEN -MATRIX -MAX -MCD -MEMBER -MEMQ -MIN -MINUS -MKID -MODULAR -MSG -MSHELL -MULTIPLICITIES -NAT -NEQ -NERO -NEXTPRIME -NIL -NODEPEND -NONCOM -NONZERO -NOSPLIT -NOSPUR -NULLSPACE -NUM -NUMBERP -ODD -OFF -ON -OPERATOR -OR -ORDER -ORDP -OUT -OUTPUT -PART -PAUSE -PERIOD -PF -PI -PLUS -PRECEDENCE -PRECISE -PRECISION -PRET -PRI -PRIMEP -PRINT_PRECISION -PROCEDURE -PRODUCT -QUIT -QUOTIENT -RANDOM -RANDOM_NEW_SEED -RANK -RAT -RATARG -RATIONAL -RATIONALIZE -RATPRI -REAL -REDERR -REDUCT -REMAINDER -REMFAC -REMIND -REPART -REPEAT -REST -RESULTANT -RETRY -RETURN -REVERSE -REVPRI -RHS -RLISP88 -ROOT_MULTIPLICITY -ROUND -ROUNDALL -ROUNDBF -ROUNDED -SAVEAS -SAVESTRUCTR -SCALAR -SEC -SECH -SECOND -SET -SETMOD -SETQ -SHARE -SHOWRULES -SHOWTIME -SHUT -SIGN -SIN -SINH -SMACRO -SOLVE -SOLVESINGULAR -SPUR -SQRT -STRUCTR -SUB -SUM -SYMBOLIC -SYMMETRIC -T -TAN -TANH -THIRD -TIME -TIMES -TP -TRA -TRACE -TRFAC -TRIGFORM -TRINT -UNTIL -VARNAME -VECDIM -VECTOR -WEIGHT -WHEN -WHERE -WHILE -WRITE -WS -WTLEVEL DELETED mttroot/mtt/lib/rep/cxxsim.cc Index: mttroot/mtt/lib/rep/cxxsim.cc ================================================================== --- mttroot/mtt/lib/rep/cxxsim.cc +++ mttroot/mtt/lib/rep/cxxsim.cc @@ -1,672 +0,0 @@ -/* cxxsim: creates a C++ simulation from MTT elementary system equations - * Copyright (C) 2000,2002 Geraint Paul Bevan - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include - -namespace cxxsim { - - class cr { - - public: - - cr (std::string system_name); - - void read (std::ifstream &file); - void write (std::ofstream &file); - - friend std::ifstream &operator>> (std::ifstream &file, cr &c); - friend std::ofstream &operator<< (std::ofstream &file, cr &c); - - private: - - std::string name; - - std::list L; - }; - - class equations { - - public: - - equations (std::string system_name); - - void read (std::ifstream &file); - void write (std::ofstream &file); - - friend std::ifstream &operator>> (std::ifstream &file, equations &e); - friend std::ofstream &operator<< (std::ofstream &file, equations &e); - - private: - - void descend (std::string s); - void parse (void); - - std::string name; // system name - - // list of statements collected by reader - std::list statements; - - std::list leqn; // final expressions - std::list lvar; // intermediate expressions - std::list loop; // algebraic loops - - // table of final and intermediate expressions - std::map meqn; // lhs, rhs mapping - std::map mvar; - - // tag is symbol denoting an intermediate variable - std::string tag; // denotes intermediates - - // token delimiters (not ([{.`'" or alphanumeric) - std::string delim; - }; - - class parameter { - - public: - - parameter (std::string system_name); - - void read (std::ifstream &file); - void write (std::ofstream &file); - - friend std::ifstream &operator>> (std::ifstream &file, parameter &p); - friend std::ofstream &operator<< (std::ofstream &file, parameter &p); - - private: - - std::string name; - - struct record { - std::string variable; - std::string component; - }; - - typedef struct record record_t; - std::list L; - }; - - class structure { - - public: - - structure (std::string system_name); - - void read (std::ifstream &file); - void write (std::ofstream &file); - - friend std::ifstream &operator>> (std::ifstream &file, structure &s); - friend std::ofstream &operator<< (std::ofstream &file, structure &s); - - private: - - void write_declare (std::ofstream &file); - void write_input (std::ofstream &file); - void write_logic (std::ofstream &file); - void write_state (std::ofstream &file); - - std::string name; - - struct record { - std::string vec; // vector: u, x, y, yz - unsigned int num; // position of element in vector - std::string cmp; // component - std::string fnm; // full name - unsigned int rpt; // number of repetitions - std::string cty; // causality - }; - - typedef struct record record_t; - std::list Lu; - std::list Lx; - std::list Ly; - std::list Lyz; - std::list::iterator i; - }; - - cr::cr (std::string system_name){ - name = system_name; - } - - void - cr::read (std::ifstream &file){ - std::string r; - while (file >> r){ - L.push_back(r); - } - } - - void - cr::write (std::ofstream &file){ - file << "enum causality { effort, flow, state };" << std::endl - << "typedef enum causality causality_t;" << std::endl; - std::list::iterator i; - for (i = L.begin(); i != L.end(); i++){ - if ((*i != "SS") && (*i != "ISW")){ - file << "#include <" << *i << ".hh>" << std::endl; - } - } - file << std::endl; - } - - std::ifstream &operator>> (std::ifstream &file, cr &c){ - c.read(file); - return file; - } - - std::ofstream &operator<< (std::ofstream &file, cr &c){ - c.write(file); - return file; - } - - equations::equations (std::string system_name){ - name = system_name; - tag = system_name; - delim = "~!@#$%^&*)-+=]}\\|;:,<>/?"; - }; - - void - equations::read (std::ifstream &file){ - - char c; - std::string s; - std::string t; - - unsigned int i; - - // file.unsetf(std::ios::skipws); - file.setf(std::ios::skipws); - - // read lines from file (no max length, unlike std::getline) - while (file >> c){ - s = ""; - while (c != ';' && file){ - if (c == '%'){ - file.unsetf(std::ios::skipws); - while ((c != '\n') && file){ - file >> c; // eat comment - } - file.setf(std::ios::skipws); - } else { - if ((c != ' ') && (c != '\t')){ // strip whitespace - s += c; - } - file >> c; - } - } - - // fix vector references - t = "MTTu("; - while ((i = s.find(t)) < s.length()){ - s.replace(i, 5, "mttu["); - i += s.substr(i, s.length()).find(",1)"); - s.replace(i, 3, "]"); - } - t = "MTTx("; - while ((i = s.find(t)) < s.length()){ - s.replace(i, 5, "mttx["); - i += s.substr(i, s.length()).find(",1)"); - s.replace(i, 3, "]"); - } - t = "MTTdX("; - while ((i = s.find(t)) < s.length()){ - s.replace(i, 6, "mttdx["); - i += s.substr(i, s.length()).find(",1)"); - s.replace(i, 3, "]"); - } - t = "MTTy("; - while ((i = s.find(t)) < s.length()){ - s.replace(i, 5, "mtty["); - i += s.substr(i, s.length()).find(",1)"); - s.replace(i, 3, "]"); - } - - // strip newlines - while ((i = s.find('\n')) < s.length()){ - s.replace(i, 1, ""); - } - - if ((s != "") && (s != "END")){ - // add statement to list - statements.push_back(s); - } - } - - // finished reading, time to comprehend ... - this->parse(); - } - - void - equations::write (std::ofstream &file){ - - std::list::iterator eqn; - - file << "void" << std::endl - << this->name << "_ode(const double t," << std::endl - << "\tdouble *mttu," << std::endl - << "\tdouble *mttx," << std::endl - << "\tdouble *mttdx," << std::endl - << "\tdouble *mtty)" << std::endl - << "{" << std::endl; - for (eqn = leqn.begin(); eqn != leqn.end(); eqn++){ - file << *eqn << " = " << meqn[*eqn] << ";" << std::endl; - } - file << "} // " << this->name << "_ode" << std::endl; - }; - - void - equations::descend (std::string s){ - - char c; - unsigned int i; - bool cont; - - std::list::iterator var; - - loop.push_back(s); - - // find algebraic loops - for (var = loop.begin(); var != loop.end(); var++){ - if ((i = mvar[s].find(*var)) < mvar[s].length()){ - c = mvar[s].c_str()[i + var->length()]; - if (delim.find(c) < delim.length()){ - std::cerr << std::endl - << "warning: algebraic loop" << std::endl - << '\t' << s << " = " << mvar[s].substr(0, 60); - if (mvar[s].length() > 60){ - std::cerr << " ..."; - } - std::cerr << std::endl << std::endl; - mvar[s] = s + "____loop"; - } - } - } - - // substitutes intermediate variables for their expansion - do { - cont = false; - for (var = lvar.begin(); var != lvar.end(); var++){ - // check for token match - while ((i = mvar[s].find(*var)) < mvar[s].length()){ - // ensure exact match - c = mvar[s].c_str()[i + var->length()]; - if (delim.find(c) < delim.length()){ - // expand expression recursively - this->descend(*var); - // check match again, map may have changed - if ((i = mvar[s].find(*var)) < mvar[s].length()){ - c = mvar[s].c_str()[i + var->length()]; - if (delim.find(c) < delim.length()){ - // substitute expression - mvar[s].replace(i, var->length(), mvar[*var]); - // continue - cont = true; - } - } - } - } - } - } while (cont); - loop.pop_back(); - } - - void - equations::parse (void){ - - char c; - unsigned int i; - - std::string lhs; - std::string rhs; - - std::list::iterator s; - - std::list::iterator eqn; - std::list::iterator var; - - for (s = statements.begin(); s != statements.end(); s++){ - // parse statement - if ((i = s->find(":=")) < s->length()){ - lhs = s->substr(0, i); - rhs = s->substr(i+2, s->length()); - - // separate intermediate and final variables - if (s->substr(0, tag.length()) == tag){ - // add to table of intermediate variables - lvar.push_back(lhs); - mvar[lhs] = "(" + rhs + ")"; - } else { - // add to table of final variables - leqn.push_back(lhs); - meqn[lhs] = rhs + ";"; - } - } else { - std::cerr << std::endl - << "warning: non-assignment -- ignoring" - << std::endl - << '\t' << *s << std::endl - << std::endl; - } - } - - // expand rhs of intermediate variables - for (var = lvar.begin(); var != lvar.end(); var++){ - loop.clear(); - descend(*var); - } - - // substitute expanded expressions into final equations - for (eqn = leqn.begin(); eqn != leqn.end(); eqn++){ - for (var = lvar.begin(); var != lvar.end(); var++){ - while ((i = meqn[*eqn].find(*var)) < meqn[*eqn].length()){ - c = meqn[*eqn].c_str()[i + var->length()]; - if (delim.find(c) < delim.length()){ - meqn[*eqn].replace(i, var->length(), mvar[*var]); - } - } - } - } - } - - std::ifstream &operator>> (std::ifstream &file, equations &e){ - e.read(file); - return file; - } - - std::ofstream &operator<< (std::ofstream &file, equations &e){ - e.write(file); - return file; - } - - parameter::parameter (std::string system_name){ - name = system_name; - }; - - void - parameter::read (std::ifstream &file){ - record_t r; - while (file >> r.variable >> r.component){ - if (r.variable.find("#") == 0){ - file.unsetf(std::ios::skipws); - char c = '\0'; - while (c != '\n'){ - file >> c; - } - file.setf(std::ios::skipws); - } else { - L.push_back(r); - } - } - } - - void - parameter::write (std::ofstream &file){ - std::list::iterator i; - std::string type; - std::string value; - for (i = L.begin(); i != L.end(); i++){ - if (i->variable.substr(0, 6) == "bool__"){ - type = "bool"; - value = "false"; - } else if (i->variable.substr(0, 6) == "char__"){ - type = "char"; - value = "\0"; - } else if (i->variable.substr(0, 8) == "double__"){ - type = "double"; - value = "1.0"; - } else if (i->variable.substr(0, 7) == "float__"){ - type = "float"; - value = "1.0"; - } else if (i->variable.substr(0, 5) == "int__"){ - type = "int"; - value = "1"; - } else if (i->variable.substr(0, 7) == "string__"){ - type = "std::string"; - value = "hello world!"; - } else { - type = "double"; - value = "1.0"; - } - file << "static " << type << "\t" << i->variable << " = " << value - << ";\t// " << i->component << std::endl; - } - file << std::endl; - } - - std::ifstream &operator>> (std::ifstream &file, parameter &p){ - p.read(file); - return file; - } - - std::ofstream &operator<< (std::ofstream &file, parameter &p){ - p.write(file); - return file; - } - - structure::structure (std::string system_name){ - name = system_name; - }; - - void - structure::read (std::ifstream &file){ - std::list *p; - record_t r; - if (! file){ - std::cerr << "warning: no structure data found (empty file)" << std::endl; - } - while (file >> r.vec >> r.num >> r.cmp >> r.fnm >> r.rpt >> r.cty){ - if (r.vec == "input"){ - p = &(this->Lu); - } else if (r.vec == "state"){ - p = &(this->Lx); - } else if (r.vec == "output"){ - p = &(this->Ly); - } else { - p = &(this->Lyz); - } - p->push_back(r); - } - }; - - void - structure::write (std::ofstream &file){ - this->write_declare(file); - file << std::endl; - this->write_input(file); - file << std::endl; - this->write_logic(file); - file << std::endl; - this->write_state(file); - file << std::endl; - } - - void - structure::write_declare (std::ofstream &file){ - file << "const int mttNu\t= " << this->Lu.size() + 1 << ";" << std::endl - << "const int mttNx\t= " << this->Lx.size() + 1 << ";" << std::endl - << "const int mttNy\t= " << this->Ly.size() + 1 << ";" << std::endl - << "static double mttu[mttNu];" << std::endl - << "static double mttx[mttNx];" << std::endl - << "static double mtty[mttNy];" << std::endl - << "static double mttdx[mttNx];" << std::endl - << std::endl; - } - - void - structure::write_input (std::ofstream &file){ - file << "void" << std::endl - << this->name << "_input(const double t," << std::endl - << "\tdouble *mttu," << std::endl - << "\tdouble *mttx," << std::endl - << "\tdouble *mtty)" << std::endl - << "{" << std::endl; - for (i = Lu.begin(); i != Lu.end(); i++){ - file << "\tmttu[" << i->num << "]\t= 1.0;" - << "\t// " << i->cmp - << "\t(" << i->fnm << ")" << std::endl; - } - file << "} // " << this->name << "_input" << std::endl; - } - - void - structure::write_logic (std::ofstream &file){ - file << "void" << std::endl - << this->name << "_logic(const double t," << std::endl - << "\tdouble *mttu," << std::endl - << "\tdouble *mttx," << std::endl - << "\tdouble *mttdx," << std::endl - << "\tdouble *mtty)" << std::endl - << "{" << std::endl; - for (i = Lx.begin(); i != Lx.end(); i++){ - if (i->cmp == "MTT_SWITCH"){ - file << "int " << i->fnm << " = 1;" << std::endl - << "if ((" << i->fnm << " == 0)" - << " || ((" << i->fnm << " < 0)" - << " && (mttx[" << i->num << "] < 0.0))){" << std::endl - << "\tmttx[" << i->num << "]\t = 0.0;" << std::endl - << "\tmttdx[" << i->num << "]\t = 0.0;" << std::endl - << "}" << std::endl; - } - } - file << "} // " << this->name << "_logic" << std::endl; - } - - void - structure::write_state (std::ofstream &file){ - file << "void" << std::endl - << this->name << "_state(double *mttx)" << std::endl - << "{" << std::endl; - for (i = Lx.begin(); i != Lx.end(); i++){ - file << "\tmttx[" << i->num << "]\t= 0.0;" - << "\t// " << i->cmp - << "\t(" << i->fnm << ")" << std::endl; - } - file << "} // " << this->name << "_state" << std::endl; - } - - std::ifstream &operator>> (std::ifstream &file, structure &s){ - s.read(file); - return file; - } - - std::ofstream &operator<< (std::ofstream &file, structure &s){ - s.write(file); - return file; - } - -}; - -void -usage(const char *program){ - std::cerr << std::endl - << "usage: " << program << " system" << std::endl - << std::endl; -} - -int main(int argc, char *argv[]) -{ - // check usage - if (argc != 2){ - usage(argv[0]); - return 1; - } - std::string system_name = argv[1]; - - // open files for reading and writing - std::string cr_filename = system_name + "_cr.txt"; - std::string parameter_filename = system_name + "_sympar.txt"; - std::string structure_filename = system_name + "_struc.txt"; - std::string equations_filename = system_name + "_ese.r"; - std::string cxxsim_filename = system_name + "_cxxsim.cc"; - - std::ifstream cr_file (cr_filename.c_str()); - std::ifstream parameter_file(parameter_filename.c_str()); - std::ifstream structure_file(structure_filename.c_str()); - std::ifstream equations_file(equations_filename.c_str()); - std::ofstream cxxsim_file(cxxsim_filename.c_str()); - - // announce transformation - std::clog << "Creating " << cxxsim_filename << std::endl; - - // do transformations (abracadabra!) - cxxsim::cr system_cr (system_name); - cxxsim::parameter system_parameter(system_name); - cxxsim::structure system_structure(system_name); - cxxsim::equations system_equations(system_name); - - cr_file >> system_cr; - parameter_file >> system_parameter; - structure_file >> system_structure; - equations_file >> system_equations; - - - cxxsim_file << system_cr - << system_parameter - << system_structure - << system_equations - << std::endl; - - cxxsim_file << std::endl - << "int" << std::endl - << "main(void){" << std::endl - << std::endl - << " double mttdt = 0.1; // integration time step" << std::endl - << " double mttt;" << std::endl - << " int i;" << std::endl - << std::endl - << " for (mttt = 0.0; mttt <= 10.0; mttt += mttdt){" << std::endl - << std::endl - << " // get inputs and rates" << std::endl - << " " << system_name << "_input(mttt,mttu,mttx,mtty);" << std::endl - << " " << system_name << "_ode(mttt,mttu,mttx,mttdx,mtty);" << std::endl - << std::endl - << " // integrate states (euler)" << std::endl - << " for (i = 1; i <= mttNx; i++){" << std::endl - << " mttx[i] += mttdx[i] * mttdt;" << std::endl - << " }" << std::endl - << std::endl - << " // overwrite switch states" << std::endl - << " " << system_name << "_logic(mttt,mttu,mttx,mttdx,mtty);" << std::endl - << std::endl - << " // write: time outputs time states" << std::endl - << " std::cout << mttt << '\\t';" << std::endl - << " for (i = 1; i <= mttNy; i++){" << std::endl - << " std::cout << mtty[i] << ' ';" << std::endl - << " }" << std::endl - << " std::cout << '\\t' << mttt;" << std::endl - << " for (i = 1; i <= mttNx; i++){" << std::endl - << " std::cout << ' ' << mttx[i];" << std::endl - << " }" << std::endl - << " std::cout << std::endl;" << std::endl - << " }" << std::endl - << " return 0;" << std::endl - << "}" << std::endl; - - // close files - cr_file.close(); - parameter_file.close(); - structure_file.close(); - equations_file.close(); - cxxsim_file.close(); - - return 0; -} DELETED mttroot/mtt/lib/rep/cxxsim_rep.make Index: mttroot/mtt/lib/rep/cxxsim_rep.make ================================================================== --- mttroot/mtt/lib/rep/cxxsim_rep.make +++ mttroot/mtt/lib/rep/cxxsim_rep.make @@ -1,95 +0,0 @@ -# -*-makefile-*- - -# usage: mtt cxxsim view - -# example: -# mtt copy MotorGenerator && cd MotorGenerator && mtt MotorGenerator cxxsim view - -# cxxsim creates a very simple C++ simulation without using Reduce -# it doesn't use MTT's normal .txt files so the resultant .cc must be edited -# manually to alter parameter, input and logic values - -# a more intelligent version would just do ese_r2cc to create _ese.cc -# this could then be embedded into MTT's normal code like _ode.cc -# maybe another day ... - -CC=g++ - -INCLUDE=-I. -I${MTT_LIB}/cr/hh -OPTIMISE=-O3 -WARNINGS=-Wall -ansi -pedantic - -ifeq ("","$(MTT_ARG)") -TARGET=$(MTT_SYS)_cxxsim.$(MTT_LANG) -else -TARGET=$(MTT_SYS)_cxxsim-$(MTT_ARG).$(MTT_LANG) -endif - -all: $(TARGET) - -# rule copied from gnuplot_rep.make -# need it here to prevent MTT using the default route (via dae) -$(MTT_SYS)_cxxsim.gnuplot: $(MTT_SYS)_gnuplot.wish $(MTT_SYS)_odes.dat2 - sh $(MTT_SYS)_gnuplot.wish |\ - tee gnuplot_in.log |\ - gnuplot -geometry 400x300 \ - > gnuplot_out.log 2> gnuplot_err.log & - -$(MTT_SYS)_cxxsim.view: $(MTT_SYS)_cxxsim-odes.ps $(MTT_SYS)_cxxsim-odeso.ps - ${PSVIEW} $(MTT_SYS)_cxxsim-odes.ps - ${PSVIEW} $(MTT_SYS)_cxxsim-odeso.ps - -$(MTT_SYS)_cxxsim.ps: $(MTT_SYS)_cxxsim-odeso.ps - cp $< $@ - -$(MTT_SYS)_cxxsim-ode%.ps: $(MTT_SYS)_ode%.fig - fig2dev -Leps $(MTT_SYS)_ode$*.fig $@ - -$(MTT_SYS)_ode%.fig: $(MTT_SYS)_ode%.gdat - gdat2fig $(MTT_SYS)_ode$* - -$(MTT_SYS)_ode%.gdat: $(MTT_SYS)_ode%.dat - dat2gdat $(MTT_SYS) ode$* - -$(MTT_SYS)_ode%.dat: $(MTT_SYS)_def.r $(MTT_SYS)_odes.dat2 - dat22dat $(MTT_SYS) ode $* - -$(MTT_SYS)_odes.dat2: $(MTT_SYS)_cxxsim.exe - ./$< > $@ - -$(MTT_SYS)_cxxsim.exe: $(MTT_SYS)_cxxsim.cc - echo Creating $(MTT_SYS)_cxxsim.exe - $(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE) - -$(MTT_SYS)_cxxsim.cc: $(MTT_SYS)_cr.txt $(MTT_SYS)_ese.r $(MTT_SYS)_struc.txt $(MTT_SYS)_sympar.txt cxxsim - ./cxxsim $(MTT_SYS) - cp $@ .. - -cxxsim: ${MTT_LIB}/rep/cxxsim.cc - echo creating $@ - echo Compiling $^ - $(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE) - -# list of constitutive relationships -$(MTT_SYS)_cr.txt: - mtt -q $(MTT_OPTS) $(MTT_SYS) cr txt - -# array sizes -$(MTT_SYS)_def.r: - mtt -q $(MTT_OPTS) $(MTT_SYS) def r - -# elementary system equations -$(MTT_SYS)_ese.r: - mtt -q $(MTT_OPTS) $(MTT_SYS) ese r - -# system structure -$(MTT_SYS)_struc.txt: - mtt -q $(MTT_OPTS) $(MTT_SYS) struc txt - -# list of symbolic parameters -$(MTT_SYS)_sympar.txt: - mtt -q $(MTT_OPTS) $(MTT_SYS) sympar txt - -# gnuplot script -$(MTT_SYS)_gnuplot.wish: - mtt -q $(MTT_OPTS) $(MTT_SYS) gnuplot wish DELETED mttroot/mtt/lib/rep/gnuplot_rep.make Index: mttroot/mtt/lib/rep/gnuplot_rep.make ================================================================== --- mttroot/mtt/lib/rep/gnuplot_rep.make +++ mttroot/mtt/lib/rep/gnuplot_rep.make @@ -1,21 +0,0 @@ -# -*-makefile-*- -# create a gnuplot input file - -MTTFLAGS = $(MTT_OPTS) - -all: $(MTT_SYS)_gnuplot.$(MTT_LANG) - -$(MTT_SYS)_gnuplot.view: $(MTT_SYS)_gnuplot.wish - mtt $(MTT_OPTS) $(MTT_SYS) odes dat2 - sh $(MTT_SYS)_gnuplot.wish |\ - tee gnuplot_in.log |\ - gnuplot -name $(MTT_SYS) -geometry 400x300 \ - > gnuplot_out.log 2> gnuplot_err.log & - -$(MTT_SYS)_gnuplot.wish: $(MTT_SYS)_struc.txt - $(MTTPATH)/trans/struc2gnuplot_txt2wish $(MTT_SYS) - -$(MTT_SYS)_struc.txt: - mtt $(MTTFLAGS) $(MTT_SYS) struc txt - - DELETED mttroot/mtt/lib/rep/ident_rep.make Index: mttroot/mtt/lib/rep/ident_rep.make ================================================================== --- mttroot/mtt/lib/rep/ident_rep.make +++ mttroot/mtt/lib/rep/ident_rep.make @@ -1,145 +0,0 @@ -# -*-makefile-*- - -#SUMMARY Identification -#DESCRIPTION Partially know system identification using -#DESCRIPTION using bond graphs - -# Makefile for representation ident -# File ident_rep.make - -#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop - -## Model targets -model_reps = ${MTT_SYS}_sympar.m ${MTT_SYS}_simpar.m ${MTT_SYS}_state.m -model_reps += ${MTT_SYS}_numpar.m ${MTT_SYS}_input.m ${MTT_SYS}_ode2odes.m -model_reps += ${MTT_SYS}_def.m - -## Prepend s to get the sensitivity targets -sensitivity_reps = ${model_reps:%=s%} - -## Model prerequisites -model_pre = ${MTT_SYS}_abg.fig ${MTT_SYS}_lbl.txt -model_pre += ${MTT_SYS}_rdae.r ${MTT_SYS}_numpar.txt - -## Prepend s to get the sensitivity targets -sensitivity_pre = ${model_pre:%=s%} - - -## Simulation targets -sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m - -## m-files needed for ident -ident_m = ${MTT_SYS}_ident.m ${MTT_SYS}_ident_numpar.m - -## The input data -ident_data = ${MTT_SYS}_ident_data.dat - -## Targets for the ident simulation -ident_reps = ${ident_m} ${sims} ${model_reps} ${sensitivity_reps} - -## ps output files etc -psfile = ${MTT_SYS}_ident.ps -psfiles = ${MTT_SYS}_ident.ps ${MTT_SYS}_ident.comparison.ps ${MTT_SYS}_ident_pars.ps -figfiles = ${psfiles:%.ps=%.fig} -gdatfiles = ${psfiles:%.ps=%.gdat} -datfiles = ${psfiles:%.ps=%.dat2} - -## LaTeX files etc -latexfiles = ${MTT_SYS}_ident_par.tex - -all: ${MTT_SYS}_ident.${MTT_LANG} - -echo: - echo "sims: ${sims}" - echo "model_reps: ${model_reps}" - echo "sensitivity_reps: ${sensitivity_reps}" - echo "ident_reps: ${ident_reps}" - -${MTT_SYS}_ident.view: ${psfiles} - ident_rep.sh ${MTT_SYS} view - -${psfiles}: ${figfiles} - ident_rep.sh ${MTT_SYS} ps - touch ${psfiles} - -${figfiles}: ${gdatfiles} - ident_rep.sh ${MTT_SYS} fig - touch ${figfiles} - -${gdatfiles}: ${datfiles} - ident_rep.sh ${MTT_SYS} gdat - touch ${gdatfiles} - -${datfiles} ${latexfiles}: ${ident_reps} ${ident_data} - ident_rep.sh ${MTT_SYS} dat2 - touch ${datfiles} - -${MTT_SYS}_ident.m: - ident_rep.sh ${MTT_SYS} m - -${MTT_SYS}_ident_numpar.m: - ident_rep.sh ${MTT_SYS} numpar.m - -## System model reps -## Generic txt files -${MTT_SYS}_%.txt: - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt - -## Specific m files -${MTT_SYS}_ode2odes.m: ${model_pre} - mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m - -${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m - -## Numpar files -${MTT_SYS}_numpar.m: - mtt ${MTT_SYS} numpar m - -## Sympar files -${MTT_SYS}_sympar.m: - mtt ${MTT_SYS} sympar m - -## Generic txt to m -${MTT_SYS}_%.m: ${MTT_SYS}_%.txt - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m - -## r files -${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r - -${MTT_SYS}_rdae.r: - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r - -## Sensitivity model reps -## Generic txt files -s${MTT_SYS}_%.txt: - mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} $* txt - -## Specific m files -## Numpar files -s${MTT_SYS}_numpar.m: - mtt -s s${MTT_SYS} numpar m - -## Sympar files -s${MTT_SYS}_sympar.m: - mtt -s s${MTT_SYS} sympar m - -s${MTT_SYS}_ode2odes.m: ${sensitivity_pre} - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ode2odes m - -s${MTT_SYS}_ssim.m: - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ssim m - -s${MTT_SYS}_def.m: - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} def m - - -## Generic txt to m -s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt - mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m - -## r files -s${MTT_SYS}_rdae.r: - mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r - DELETED mttroot/mtt/lib/rep/ident_rep.sh Index: mttroot/mtt/lib/rep/ident_rep.sh ================================================================== --- mttroot/mtt/lib/rep/ident_rep.sh +++ mttroot/mtt/lib/rep/ident_rep.sh @@ -1,293 +0,0 @@ -#! /bin/sh - -## ident_rep.sh -## DIY representation "ident" for mtt -# Copyright (C) 2002 by Peter J. Gawthrop - -ps=ps - -sys=$1 -rep=ident -lang=$2 -mtt_parameters=$3 -rep_parameters=$4 - -## Some names -target=${sys}_${rep}.${lang} -def_file=${sys}_def.r -dat2_file=${sys}_ident.dat2 -dat2s_file=${sys}_idents.dat2 -ident_numpar_file=${sys}_ident_numpar.m -option_file=${sys}_ident_mtt_options.txt - -## Get system information -if [ -f "${def_file}" ]; then - echo Using ${def_file} -else - mtt -q ${sys} def r -fi - -ny=`mtt_getsize $1 y` -nu=`mtt_getsize $1 u` - -check_new_options() { - if [ -f "${option_file}" ]; then - old_options=`cat ${option_file}` - if [ "${mtt_options}" != "${old_options}" ]; then - echo ${mtt_options} > ${option_file} - fi - else - echo ${mtt_options} > ${option_file} - fi -} - -## Make the _ident.m file -make_ident() { -filename=${sys}_${rep}.m -date=`date` -echo Creating ${filename} - -cat > ${filename} < ${sys}_ident_numpar.m <0) - par = ${sys}_numpar(); - x_0 = ${sys}_state(par); - dt = t(2)-t(1); - simpars.dt = dt; - simpars.last = t(length(t)); - y = ${sys}_sim(zeros(n_x,1), par, simpars, u); - endif - - ## Default parameter names - Put in your own here - sympar = ${sys}_sympar; # Symbolic params as structure - par_names = struct_elements (sympar); # Symbolic params as strings - [n,m] = size(par_names); # Size the string list - - ## Sort by index - for [i,name] = sympar - par_names(i,:) = sprintf("%s%s",name, blanks(m-length(name))); - endfor - - ## Output weighting vector - Q = ones(n_y,1); - - ## Extra parameters - extras.criterion = 1e-5; - extras.emulate_timing = 0; - extras.max_iterations = 10; - extras.simulate = simulate; - extras.v = 1e-2; - extras.verbose = 1; - extras.visual = 1; - extras.domain = "time"; - -endfunction -EOF -} - -make_dat2() { - -## Inform user -echo Creating ${dat2_file} - -## Use octave to generate the data -octave -q < mtt_junk -sed -e "s/_\([a-z0-9,]*\)/_{\1}/g" < mtt_junk >${sys}_ident_par.tex -rm mtt_junk -} - -case ${lang} in - numpar.m) - ## Make the numpar stuff - make_ident_numpar; - ;; - m) - ## Make the code - make_ident; - ;; - dat2) - ## The dat2 language (output data) & fig file - make_dat2; - ;; - gdat) - cp ${dat2_file} ${dat2s_file} - dat22dat ${sys} ${rep} - dat2gdat ${sys} ${rep} - ;; - fig) - gdat2fig ${sys}_${rep} - ;; - ps) - figs=`ls ${sys}_ident*.fig | sed -e 's/\.fig//'` - for fig in ${figs}; do - fig2dev -Leps ${fig}.fig > ${fig}.ps - done - texs=`ls ${sys}_ident*.tex | sed -e 's/\.tex//'` - for tex in ${texs}; do - makedoc "" "${sys}" "ident_par" "tex" "" "" "$ps" - doc2$ps ${sys}_ident_par "$documenttype" - done - ;; - view) - pss=`ls ${sys}_ident*.ps` - echo Viewing ${pss} - for ps in ${pss}; do - ${PSVIEW} ${ps}& - done - ;; - *) - echo Language ${lang} not supported by ${rep} representation - exit 3 -esac - - DELETED mttroot/mtt/lib/rep/ippp_rep.make Index: mttroot/mtt/lib/rep/ippp_rep.make ================================================================== --- mttroot/mtt/lib/rep/ippp_rep.make +++ mttroot/mtt/lib/rep/ippp_rep.make @@ -1,78 +0,0 @@ -# -*-makefile-*- -# Makefile for representation ippp - ppp system identification -# File ippp_rep.make - - ###################################### - ##### Model Transformation Tools ##### - ###################################### - - ############################################################### - ## Version control history - ############################################################### - ## $Id$ - ## $Log$ - ## Revision 1.5 2002/12/12 17:18:42 geraint - ## Fixed [ 647664 ] Namespace clash: LANG - ## Prepended MTT_ to SYS, OPTS and LANG environment variables. - ## - ## Revision 1.4 2001/04/23 15:06:21 gawthrop - ## Removed stdin bug workaround - ## - ## Revision 1.3 2001/04/11 07:52:45 gawthrop - ## Temporary fix to avoid incorrect _input.cc with stdin - ## - ## Revision 1.2 2001/04/05 11:49:07 gawthrop - ## Fixed a number of bugs to as to work with reports. - ## - ## Revision 1.1 2001/04/04 10:05:38 gawthrop - ## Reresentation for system identification for ppp - ## - ############################################################### - -#Copyright (C) 2000 by Peter J. Gawthrop - -all: $(MTT_SYS)_ippp.$(MTT_LANG) - -$(MTT_SYS)_ippp.view: $(MTT_SYS)_ippp.pdf - acroread *.pdf - -$(MTT_SYS)_ippp.ps: $(MTT_SYS)_parameters.ps $(MTT_SYS)_error.ps $(MTT_SYS)_outputs.ps $(MTT_SYS)_ippp.pdf - cp $(MTT_SYS)_parameters.ps $(MTT_SYS)_ippp.ps - -$(MTT_SYS)_ippp.pdf: $(MTT_SYS)_parameters.pdf $(MTT_SYS)_error.pdf $(MTT_SYS)_outputs.pdf - cp $(MTT_SYS)_parameters.pdf $(MTT_SYS)_ippp.pdf - -$(MTT_SYS)_parameters.ps: s$(MTT_SYS)_ode2odes.m s$(MTT_SYS)_ssim.m $(MTT_SYS)_ippp.m s$(MTT_SYS)_sympar.m s$(MTT_SYS)_simpar.m - octave $(MTT_SYS)_ippp.m - -$(MTT_SYS)_error.ps: $(MTT_SYS)_parameters.ps - touch $(MTT_SYS)_error.ps - -$(MTT_SYS)_outputs.ps: $(MTT_SYS)_parameters.ps - touch $(MTT_SYS)_outputs.ps - -$(MTT_SYS)_parameters.pdf: s$(MTT_SYS)_ode2odes.m s$(MTT_SYS)_ssim.m $(MTT_SYS)_ippp.m s$(MTT_SYS)_sympar.m s$(MTT_SYS)_simpar.m - octave $(MTT_SYS)_ippp.m - -$(MTT_SYS)_error.pdf: $(MTT_SYS)_parameters.pdf - touch $(MTT_SYS)_error.pdf - -$(MTT_SYS)_outputs.pdf: $(MTT_SYS)_parameters.pdf - touch $(MTT_SYS)_outputs.pdf - -s$(MTT_SYS)_ode2odes.m: - echo Starting creation of s$(MTT_SYS)_ode2odes.m with options $(MTT_OPTS) - mtt -q $(MTT_OPTS) -stdin -s s$(MTT_SYS) ode2odes m - -s$(MTT_SYS)_ssim.m: s$(MTT_SYS)_def.m - mtt -q $(MTT_OPTS) -s s$(MTT_SYS) ssim m - -s$(MTT_SYS)_sympar.m: - mtt -q $(MTT_OPTS) -s s$(MTT_SYS) sympar m - -s$(MTT_SYS)_simpar.m: - mtt -q $(MTT_OPTS) -s s$(MTT_SYS) simpar m - -s$(MTT_SYS)_def.m: - mtt -q $(MTT_OPTS) -s s$(MTT_SYS) def m - DELETED mttroot/mtt/lib/rep/mtt_rep_diy Index: mttroot/mtt/lib/rep/mtt_rep_diy ================================================================== --- mttroot/mtt/lib/rep/mtt_rep_diy +++ mttroot/mtt/lib/rep/mtt_rep_diy @@ -1,138 +0,0 @@ -#! /bin/sh - -rep_name="diy" - -help_message=" - A representation you can create all by yourself! - - The purpose of this representation is to help in the creation of a new DIY rep structure. - Eventually it should form a template for creating new representations. -" - -non_standard_options=" - --crash: make the computer crash, wiping the hard drive in the process - --recover: attempt to recover data after crash (by crying very loudly for 10 minutes) -" - -texi_message=" -This message should be really, really helpful. -@node Stuff, More Stuff, Top, Top -Stuff! -@node More Stuff, Top, Top, Top -More Stuff -" - -# function definitions for non-standard options (should have same name) -crash () { - touch .crash - echo "IDIOT!" - exit 99 -} -recover () { - if [ -f .crash ]; then - cat < /dev/null || warn "option --${option} unknown" - shift - done - export Language="$*" - fi -} - -process_arguments $* -if [ ! "${Language}" ]; then - error "no language specified" ${NoLanguageSpecified} -fi - -process_language ${Language} - DELETED mttroot/mtt/lib/rep/nppp_rep.make Index: mttroot/mtt/lib/rep/nppp_rep.make ================================================================== --- mttroot/mtt/lib/rep/nppp_rep.make +++ mttroot/mtt/lib/rep/nppp_rep.make @@ -1,106 +0,0 @@ -# -*-makefile-*- - -#SUMMARY Nonlinear pole-placement predictive control (nPPP) -#DESCRIPTION - -# Makefile for representation nppp -# File nppp_rep.make - -#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop - -## Model targets -model_reps = ${MTT_SYS}_sympar.m ${MTT_SYS}_simpar.m ${MTT_SYS}_state.m -model_reps += ${MTT_SYS}_numpar.m ${MTT_SYS}_input.m ${MTT_SYS}_ode2odes.m -model_reps += ${MTT_SYS}_def.m - -## Prepend s to get the sensitivity targets -sensitivity_reps = ${model_reps:%=s%} - -## Simulation targets -sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m - -## m-files needed for nppp -nppp_m = ${MTT_SYS}_nppp.m ${MTT_SYS}_nppp_numpar.m - -## Targets for the nppp simulation -nppp_reps = ${nppp_m} ${sims} ${model_reps} ${sensitivity_reps} - -## ps output files -psfiles = ${MTT_SYS}_nppp.ps ${MTT_SYS}_nppp.basis.ps ${MTT_SYS}_nppp.par.ps ${MTT_SYS}_nppp.U.ps -figfiles = ${psfiles:%.ps=%.fig} - -all: ${MTT_SYS}_nppp.${MTT_LANG} - -echo: - echo "sims: ${sims}" - echo "model_reps: ${model_reps}" - echo "sensitivity_reps: ${sensitivity_reps}" - echo "nppp_reps: ${nppp_reps}" - -${MTT_SYS}_nppp.view: ${MTT_SYS}_nppp.ps - nppp_rep.sh ${MTT_SYS} view - -${psfiles}: ${MTT_SYS}_nppp.fig - nppp_rep.sh ${MTT_SYS} ps - -${MTT_SYS}_nppp.gdat: ${MTT_SYS}_nppp.dat2 - nppp_rep.sh ${MTT_SYS} gdat - -${MTT_SYS}_nppp.fig ${MTT_SYS}_nppp.dat2: ${nppp_reps} - nppp_rep.sh ${MTT_SYS} dat2 - -${MTT_SYS}_nppp.m: - nppp_rep.sh ${MTT_SYS} m - -${MTT_SYS}_nppp_numpar.m: - nppp_rep.sh ${MTT_SYS} numpar.m - -## System model reps -## Generic txt files -${MTT_SYS}_%.txt: - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt - -## Specific m files -${MTT_SYS}_ode2odes.m: ${MTT_SYS}_rdae.r - mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m - -${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m - -## Generic txt to m -${MTT_SYS}_%.m: ${MTT_SYS}_%.txt - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m - -## r files -${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r - -${MTT_SYS}_rdae.r: - mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r - -## Sensitivity model reps -## Generic txt files -s${MTT_SYS}_%.txt: - mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* txt - -## Specific m files -s${MTT_SYS}_ode2odes.m: s${MTT_SYS}_rdae.r - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ode2odes m - -s${MTT_SYS}_ssim.m: - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ssim m - -s${MTT_SYS}_def.m: - mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} def m - - -## Generic txt to m -s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt - mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m - - -## r files -s${MTT_SYS}_rdae.r: - mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r - - DELETED mttroot/mtt/lib/rep/nppp_rep.sh Index: mttroot/mtt/lib/rep/nppp_rep.sh ================================================================== --- mttroot/mtt/lib/rep/nppp_rep.sh +++ mttroot/mtt/lib/rep/nppp_rep.sh @@ -1,331 +0,0 @@ -#! /bin/sh - -## nppp_rep.sh -## DIY representation "nppp" for mtt -# Copyright (C) 2002 by Peter J. Gawthrop - -sys=$1 -rep=nppp -lang=$2 -mtt_parameters=$3 -rep_parameters=$4 - -## Some names -target=${sys}_${rep}.${lang} -def_file=${sys}_def.r -dat2_file=${sys}_nppp.dat2 -dat2s_file=${sys}_nppps.dat2 -nppp_numpar_file=${sys}_nppp_numpar.m -option_file=${sys}_nppp_mtt_options.txt - -## Get system information -if [ -f "${def_file}" ]; then - echo Using ${def_file} -else - mtt -q ${sys} def r -fi - -ny=`mtt_getsize $1 y` -nu=`mtt_getsize $1 u` - -check_new_options() { - if [ -f "${option_file}" ]; then - old_options=`cat ${option_file}` - if [ "${mtt_options}" != "${old_options}" ]; then - echo ${mtt_options} > ${option_file} - fi - else - echo ${mtt_options} > ${option_file} - fi -} - -## Make the _nppp.m file -make_nppp() { -filename=${sys}_${rep}.m -echo Creating ${filename} - -cat > ${filename} <0 - P = P(1:n-1,:); # Loose last point - PP = []; - for j=1:m - pp = [P(:,j) P(:,j)]'; - PP = [PP pp(:)]; - endfor - - oneplot; - gset output "${sys}_nppp.par.fig" - title(""); - xlabel("Time (s)"); - ylabel("Parameters"); - plot(TT,PP); - endif - - [n,m] = size(U); - if m>0 oneplot; - gset output "${sys}_nppp.U.fig" - title(""); - xlabel("Time (s)"); - ylabel("U"); - [n,m] = size(U); - U = U(1:n-1,:); # Loose last point - UU = []; - for j=1:m - uu = [U(:,j) U(:,j)]'; - UU = [UU uu(:)]; - endfor - plot(TT,UU); - endif - -endfunction - -EOF -} - -make_nppp_numpar() { -echo Creating ${nppp_numpar_file} -cat > ${sys}_nppp_numpar.m < ${fig}.ps - done - ;; - view) - pss=`ls ${sys}_nppp*.ps` - echo Viewing ${pss} - for ps in ${pss}; do - gv ${ps}& - done - ;; - *) - echo Language ${lang} not supported by ${rep} representation - exit 3 -esac - - DELETED mttroot/mtt/lib/rep/odeso_rep.make Index: mttroot/mtt/lib/rep/odeso_rep.make ================================================================== --- mttroot/mtt/lib/rep/odeso_rep.make +++ mttroot/mtt/lib/rep/odeso_rep.make @@ -1,13 +0,0 @@ -# -*-makefile-*- - -all: ${MTT_SYS}_odeso.${MTT_LANG} - -${MTT_SYS}_odeso.gnuplot: - @mtt -q ${MTT_OPTS} ${MTT_SYS} gnuplot view - -ifneq ("${MTT_LANG}","gnuplot") -${MTT_SYS}_odeso.${MTT_LANG}: - @touch odeso_rep.make.ignore - @mtt -q ${MTT_OPTS} ${MTT_SYS} odeso ${MTT_LANG} - @rm odeso_rep.make.ignore -endif DELETED mttroot/mtt/lib/rep/sfun_rep.make Index: mttroot/mtt/lib/rep/sfun_rep.make ================================================================== --- mttroot/mtt/lib/rep/sfun_rep.make +++ mttroot/mtt/lib/rep/sfun_rep.make @@ -1,4 +0,0 @@ -# -*-makefile-*- - -all: - ${MTT_REP}/sfun_rep.sh "$(MTT_OPTS)" "$(MTT_SYS)" "$(MTT_LANG)" DELETED mttroot/mtt/lib/rep/sfun_rep.sh Index: mttroot/mtt/lib/rep/sfun_rep.sh ================================================================== --- mttroot/mtt/lib/rep/sfun_rep.sh +++ mttroot/mtt/lib/rep/sfun_rep.sh @@ -1,1383 +0,0 @@ -#! /bin/sh - -set -e - -# -# function definitions -# - - -set_debug () -{ - debug=$1 - if ( $debug ); then - set -x - make_debug='--debug=a' - else - set +x - make_debug='' - fi -} - -exit_error () -{ - message="$1" - case $message in - "Invalid Input" ) errno = 2 ;; - "Unknown Template" ) errno = 3 ;; - * ) errno = -1 ;; - esac - echo "#Error: " $message - exit errno; -} - -check_for_valid_input () -{ - return 0; -} - -# -# file templates -# - -# template_README compilation instructions -# template_mdk simulink sub-system model - -# template_mex_ae_c -# template_sfun_c -# template_sfun_debug_h -# template_sfun_input_c -# template_sfun_interface_c - -write_template () -{ - filename="$1" - - case $filename in - - README) - - cat < model without using MTT: - -mex _sfun.c - -The input block can be created with: - -mex _sfun_input.c - -If numerical solution of algebraic equations is also required: - -mex _sfun_ae.c - -The interface block can be created with - -mex _sfun_interface.c - -EOF - ;; - - mdl) - - cat <" - Version 4.00 - SampleTimeColors off - LibraryLinkDisplay "all" - WideLines off - ShowLineDimensions on - ShowPortDataTypes off - ShowStorageClass off - ExecutionOrder off - RecordCoverage off - CovPath "/" - CovSaveName "covdata" - CovMetricSettings "dw" - CovNameIncrementing off - CovHtmlReporting on - BlockNameDataTip off - BlockParametersDataTip off - BlockDescriptionStringDataTip off - ToolBar on - StatusBar on - BrowserShowLibraryLinks off - BrowserLookUnderMasks off - Created "Mon May 20 13:21:21 2002" - Creator "geraint" - UpdateHistory "UpdateHistoryNever" - ModifiedByFormat "%" - LastModifiedBy "geraint" - ModifiedDateFormat "%" - LastModifiedDate "Thu May 23 16:35:42 2002" - ModelVersionFormat "1.%" - ConfigurationManager "None" - SimParamPage "Solver" - StartTime "0.0" - StopTime "10.0" - SolverMode "Auto" - Solver "ode45" - RelTol "1e-3" - AbsTol "auto" - Refine "1" - MaxStep "auto" - MinStep "auto" - MaxNumMinSteps "-1" - InitialStep "auto" - FixedStep "auto" - MaxOrder 5 - OutputOption "RefineOutputTimes" - OutputTimes "[]" - LoadExternalInput off - ExternalInput "[t, u]" - SaveTime on - TimeSaveName "tout" - SaveState off - StateSaveName "xout" - SaveOutput on - OutputSaveName "yout" - LoadInitialState off - InitialState "xInitial" - SaveFinalState off - FinalStateName "xFinal" - SaveFormat "Array" - LimitDataPoints on - MaxDataPoints "1000" - Decimation "1" - AlgebraicLoopMsg "warning" - MinStepSizeMsg "warning" - UnconnectedInputMsg "warning" - UnconnectedOutputMsg "warning" - UnconnectedLineMsg "warning" - InheritedTsInSrcMsg "warning" - SingleTaskRateTransMsg "none" - MultiTaskRateTransMsg "error" - IntegerOverflowMsg "warning" - CheckForMatrixSingularity "none" - UnnecessaryDatatypeConvMsg "none" - Int32ToFloatConvMsg "warning" - InvalidFcnCallConnMsg "error" - SignalLabelMismatchMsg "none" - LinearizationMsg "none" - VectorMatrixConversionMsg "none" - SfunCompatibilityCheckMsg "none" - BlockPriorityViolationMsg "warning" - ArrayBoundsChecking "none" - ConsistencyChecking "none" - ZeroCross on - Profile off - SimulationMode "normal" - RTWSystemTargetFile "grt.tlc" - RTWInlineParameters off - RTWRetainRTWFile off - RTWTemplateMakefile "grt_default_tmf" - RTWMakeCommand "make_rtw" - RTWGenerateCodeOnly off - TLCProfiler off - TLCDebug off - TLCCoverage off - AccelSystemTargetFile "accel.tlc" - AccelTemplateMakefile "accel_default_tmf" - AccelMakeCommand "make_rtw" - TryForcingSFcnDF off - ExtModeMexFile "ext_comm" - ExtModeBatchMode off - ExtModeTrigType "manual" - ExtModeTrigMode "normal" - ExtModeTrigPort "1" - ExtModeTrigElement "any" - ExtModeTrigDuration 1000 - ExtModeTrigHoldOff 0 - ExtModeTrigDelay 0 - ExtModeTrigDirection "rising" - ExtModeTrigLevel 0 - ExtModeArchiveMode "off" - ExtModeAutoIncOneShot off - ExtModeIncDirWhenArm off - ExtModeAddSuffixToVar off - ExtModeWriteAllDataToWs off - ExtModeArmWhenConnect on - ExtModeSkipDownloadWhenConnect off - ExtModeLogAll on - ExtModeAutoUpdateStatusClock off - OptimizeBlockIOStorage on - BufferReuse on - ParameterPooling on - BlockReductionOpt on - RTWExpressionDepthLimit 5 - BooleanDataType off - BlockDefaults { - Orientation "right" - ForegroundColor "black" - BackgroundColor "white" - DropShadow off - NamePlacement "normal" - FontName "Helvetica" - FontSize 10 - FontWeight "normal" - FontAngle "normal" - ShowName on - } - AnnotationDefaults { - HorizontalAlignment "center" - VerticalAlignment "middle" - ForegroundColor "black" - BackgroundColor "white" - DropShadow off - FontName "Helvetica" - FontSize 10 - FontWeight "normal" - FontAngle "normal" - } - LineDefaults { - FontName "Helvetica" - FontSize 9 - FontWeight "normal" - FontAngle "normal" - } - System { - Name "" - Location [51, 441, 346, 574] - Open on - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - ReportName "simulink-default.rpt" - Block { - BlockType Inport - Name "In1" - Position [25, 43, 55, 57] - Port "1" - LatchInput off - DataType "double" - SignalType "real" - Interpolate on - } - Block { - BlockType SubSystem - Name "MTT Model\n" - Ports [1, 1] - Position [100, 20, 140, 80] - ForegroundColor "blue" - BackgroundColor "lightBlue" - ShowPortLabels on - TreatAsAtomicUnit off - RTWSystemCode "Auto" - RTWFcnNameOpts "Auto" - RTWFileNameOpts "Auto" - System { - Name "MTT Model\n" - Location [45, 448, 1008, 720] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Inport - Name "In1" - Position [590, 203, 620, 217] - Port "1" - LatchInput off - DataType "double" - SignalType "real" - Interpolate on - } - Block { - BlockType "S-Function" - Name "MTT Model Inputs" - Ports [1, 1] - Position [390, 59, 565, 91] - BackgroundColor "lightBlue" - DropShadow on - FunctionName "_sfun_input" - PortCounts "[]" - SFunctionModules "''" - Port { - PortNumber 1 - Name "MTT Model Inputs: MTTU" - TestPoint off - LinearAnalysisOutput off - LinearAnalysisInput off - RTWStorageClass "Auto" - } - } - Block { - BlockType "S-Function" - Name "MTT Plant Model" - Ports [1, 2] - Position [65, 61, 250, 199] - BackgroundColor "lightBlue" - DropShadow on - FunctionName "_sfun" - PortCounts "[]" - SFunctionModules "''" - Port { - PortNumber 1 - Name "MTT Model States: MTTX" - TestPoint off - LinearAnalysisOutput off - LinearAnalysisInput off - RTWStorageClass "Auto" - } - Port { - PortNumber 2 - Name "MTT Model Outputs: MTTY" - TestPoint off - LinearAnalysisOutput off - LinearAnalysisInput off - RTWStorageClass "Auto" - } - } - Block { - BlockType "S-Function" - Name "S-Function" - Ports [4, 2] - Position [710, 47, 840, 238] - BackgroundColor "lightBlue" - DropShadow on - FunctionName "_sfun_interface" - PortCounts "[]" - SFunctionModules "''" - } - Block { - BlockType Outport - Name "Out1" - Position [905, 183, 935, 197] - Port "1" - OutputWhenDisabled "held" - InitialOutput "[]" - } - Line { - Name "MTT Model States: MTTX" - Labels [2, 0] - SrcBlock "MTT Plant Model" - SrcPort 1 - Points [0, 0; 105, 0] - Branch { - Points [0, -20] - DstBlock "MTT Model Inputs" - DstPort 1 - } - Branch { - Points [0, 25] - DstBlock "S-Function" - DstPort 2 - } - } - Line { - Name "MTT Model Outputs: MTTY" - Labels [1, 0] - SrcBlock "MTT Plant Model" - SrcPort 2 - DstBlock "S-Function" - DstPort 3 - } - Line { - Name "MTT Model Inputs: MTTU" - Labels [1, 0] - SrcBlock "MTT Model Inputs" - SrcPort 1 - DstBlock "S-Function" - DstPort 1 - } - Line { - SrcBlock "S-Function" - SrcPort 1 - Points [30, 0; 0, -70; -850, 0; 0, 105] - DstBlock "MTT Plant Model" - DstPort 1 - } - Line { - SrcBlock "In1" - SrcPort 1 - DstBlock "S-Function" - DstPort 4 - } - Line { - SrcBlock "S-Function" - SrcPort 2 - DstBlock "Out1" - DstPort 1 - } - } - } - Block { - BlockType Outport - Name "Out1" - Position [185, 43, 215, 57] - Port "1" - OutputWhenDisabled "held" - InitialOutput "[]" - } - Line { - SrcBlock "MTT Model\n" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Line { - SrcBlock "In1" - SrcPort 1 - DstBlock "MTT Model\n" - DstPort 1 - } - } -} - -EOF - ;; - - mex_ae.c) - - cat <_sfun_ae.c: - * Matlab mex algebraic equations for - */ - -#include -#include -#include -#include -#include "sfun_debug.h" -#include "_def.h" -#include "_sympar.h" - -/* utility procedures */ - -double * -array_of_double (size_t n) -{ - void *p = calloc (n, sizeof (double)); - if (! p) { - fprintf (stderr, "*** Error: failed to allocate memory\n"); - } - return (double *) p; -} - -/* system equations */ - -static double * -_ae (double *mttyz, - const double *mttx, - const double *mttu, - const double mttt, - const double *mttpar) -{ -#include "_ae.c" - PRINT_LEAVE; -} - -/* generic mex function */ - -#ifdef __cplusplus -extern "C" { -#endif - -void -mexFunction (int nlhs, mxArray *plhs[], - int nrhs, const mxArray *prhs[]) -{ - double *mttyz; /* residuals */ - - double *mttx; /* states */ - double *mttu; /* known + unknown inputs */ - double mttt; /* time */ - double *mttpar; /* parameters */ - - unsigned int i; - double *p; - - PRINT_ENTER; - - mttyz = array_of_double (MTTNYZ); - - mttx = array_of_double (MTTNX); - mttu = array_of_double (MTTNU + MTTNYZ); - mttpar = array_of_double (MTTNPAR); - - /* get trial values */ - p = mxGetPr (prhs[0]); - for (i = 0; i < MTTNYZ; i++) { - mttu[MTTNU + i] = p[i]; - } - - /* get states */ - p = mxGetPr (prhs[1]); - for (i = 0; i < MTTNX; i++) { - mttx[i] = p[i]; - } - - /* get known inputs */ - p = mxGetPr (prhs[2]); - for (i = 0; i < MTTNU; i++) { - mttu[i] = p[i]; - } - - /* get time */ - p = mxGetPr (prhs[3]); - mttt = *p; - - /* get parameters */ - p = mxGetPr (prhs[4]); - for (i = 0; i < MTTNPAR; i++) { - mttpar[i] = p[i]; - } - - /* evaluate residuals */ - _ae (mttyz, mttx, mttu, mttt, mttpar); - - /* return residuals */ - plhs[0] = mxCreateDoubleMatrix (MTTNYZ, 1, mxREAL); - p = mxGetPr (plhs[0]); - for (i = 0; i < MTTNYZ; i++) { - p[i] = mttyz[i]; - } - - /* release memory */ - free (mttx); - free (mttu); - free (mttpar); - free (mttyz); - - PRINT_LEAVE; -} - -#ifdef __cplusplus -} -#endif - -EOF - ;; - - sfun_c) - - cat <_sfun.c: - * Matlab S-function simulation of - */ - -#define S_FUNCTION_NAME _sfun -#define S_FUNCTION_LEVEL 2 - -#include -#include -#include -#include "simstruc.h" -#include "sfun_debug.h" -#include "_def.h" -#include "_sympar.h" - -static double *mttdx; /* pointer to rates */ -static double *mttu; /* pointer to inputs */ -static double *mttpar; /* pointer to parameters */ -static double *mttx; /* pointer to states */ -static double *mtty; /* pointer to outputs */ -static double *mttyz; /* pointer to residuals */ -static double mttt; /* time */ - -static unsigned int i; /* loop counter */ - -/* system equations */ - -static void -_ae (void) -{ -#include "_ae.c" - PRINT_LEAVE; -} - -static void -_numpar (void) -{ -#include "_numpar.c" - PRINT_LEAVE; -} - -static void -_ode (void) -{ -#include "_ode.c" - PRINT_LEAVE; -} - -static void -_odeo (void) -{ -#include "_odeo.c" - PRINT_LEAVE; -} - -static void -_state (void) -{ -#include "_state.c" - PRINT_LEAVE; -} - -/* utility procedures */ - -static double * -array_of_double (size_t n) -{ - void *p = calloc (n, sizeof (double)); - if (! p) { - fprintf (stderr, "*** Error: failed to allocate memory\n"); - } - return (double *) p; -} - -static void -initialise_arrays (void) -{ - PRINT_ENTER; - - mttdx = array_of_double (MTTNX); - mttpar = array_of_double (MTTNPAR); - mttu = array_of_double (MTTNU + MTTNYZ); - mttx = array_of_double (MTTNX); - mtty = array_of_double (MTTNY); - mttyz = array_of_double (MTTNYZ); - - PRINT_LEAVE; -} - -static void -update_states_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - for (i = 0; i < MTTNX; i++) { - mttx[i] = ssGetContStates (S)[i]; - } - PRINT_LEAVE; -} - -static void -update_inputs_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - for (i = 0; i < MTTNU; i++) { - mttu[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; - } - PRINT_LEAVE; -} - -static void -update_inputs_from_solver (void) -{ - mxArray *MTT_MATLAB_P; - mxArray *MTT_MATLAB_T; - mxArray *MTT_MATLAB_U; - mxArray *MTT_MATLAB_Ui; - mxArray *MTT_MATLAB_X; - - double *p; - - PRINT_ENTER; - - /* starting value for solver - start with zero */ - MTT_MATLAB_Ui = mxCreateDoubleMatrix (MTTNYZ, 1, mxREAL); - mxSetName (MTT_MATLAB_Ui, "MTT_Ui"); - p = mxGetPr (MTT_MATLAB_Ui); - for (i = 0; i < MTTNYZ; i++) { - p[i] = 0.0; - } - mexPutArray (MTT_MATLAB_Ui, "base"); - - /* put states into matlab workspace */ - MTT_MATLAB_X = mxCreateDoubleMatrix (MTTNX, 1, mxREAL); - mxSetName (MTT_MATLAB_X, "MTT_X"); - p = mxGetPr (MTT_MATLAB_X); - for (i = 0; i < MTTNX; i++) { - p[i] = mttx[i]; - } - mexPutArray (MTT_MATLAB_X, "base"); - - /* put known inputs into matlab workspace */ - MTT_MATLAB_U = mxCreateDoubleMatrix (MTTNU, 1, mxREAL); - mxSetName (MTT_MATLAB_U, "MTT_U"); - p = mxGetPr (MTT_MATLAB_U); - for (i = 0; i < MTTNU; i++) { - p[i] = mttu[i]; - } - mexPutArray (MTT_MATLAB_U, "base"); - - /* put time into matlab workspace */ - MTT_MATLAB_T = mxCreateDoubleMatrix (1, 1, mxREAL); - mxSetName (MTT_MATLAB_T, "MTT_T"); - *mxGetPr (MTT_MATLAB_T) = mttt; - mexPutArray (MTT_MATLAB_T, "base"); - - /* put parameters into matlab workspace */ - MTT_MATLAB_P = mxCreateDoubleMatrix (MTTNPAR, 1, mxREAL); - mxSetName (MTT_MATLAB_P, "MTT_P"); - p = mxGetPr (MTT_MATLAB_P); - for (i = 0; i < MTTNPAR; i++) { - p[i] = mttpar[i]; - } - mexPutArray (MTT_MATLAB_P, "base"); - - /* call fsolve */ - mexEvalString ("MTT_Ui = fsolve (@_sfun_ae, MTT_Ui, optimset('display','off'), MTT_X, MTT_U, MTT_T, MTT_P);"); - - /* retrieve result */ - MTT_MATLAB_Ui = mexGetArray ("MTT_Ui", "base"); - p = mxGetPr (MTT_MATLAB_Ui); - for (i = 0; i < MTTNYZ; i++) { - mttu[MTTNU + i] = p[i]; - } - - /* free memory */ - mxDestroyArray (MTT_MATLAB_P); - mxDestroyArray (MTT_MATLAB_T); - mxDestroyArray (MTT_MATLAB_U); - mxDestroyArray (MTT_MATLAB_Ui); - mxDestroyArray (MTT_MATLAB_X); - - PRINT_LEAVE; -} - -static void -update_simtime_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - mttt = ssGetT (S); - PRINT_LEAVE; -} - -/* S-function methods */ - -static void mdlInitializeSizes(SimStruct *S) -{ - PRINT_ENTER; - - ssSetNumSFcnParams(S, 0); - if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { - PRINT_LEAVE; - return; - } - - ssSetNumContStates(S, MTTNX); - ssSetNumDiscStates(S, 0); - - if (!ssSetNumInputPorts(S, 1)) return; - ssSetInputPortWidth(S, 0, MTTNU); - ssSetInputPortDirectFeedThrough(S, 0, 1); - - if (!ssSetNumOutputPorts(S, 2)) return; - ssSetOutputPortWidth(S, 0, MTTNX); - ssSetOutputPortWidth(S, 1, MTTNY); - - ssSetNumSampleTimes(S, 1); - ssSetNumRWork(S, 0); - ssSetNumIWork(S, 0); - ssSetNumPWork(S, 0); - ssSetNumModes(S, 0); - ssSetNumNonsampledZCs(S, 0); - - ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); - - initialise_arrays (); - - PRINT_LEAVE; -} - -static void mdlInitializeSampleTimes(SimStruct *S) -{ - PRINT_ENTER; - - ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); - ssSetOffsetTime(S, 0, 0.0); - - PRINT_LEAVE; -} - -#define MDL_INITIALIZE_CONDITIONS -static void mdlInitializeConditions(SimStruct *S) -{ - PRINT_ENTER; - - _numpar (); - _state (); - - for (i = 0; i < MTTNX; i++) { - ssGetContStates (S)[i] = mttx[i]; - } - - PRINT_LEAVE; -} - -static void mdlOutputs(SimStruct *S, int_T tid) -{ - PRINT_ENTER; - - update_states_from_simulink (S); - update_inputs_from_simulink (S); - if (MTTNYZ > 0) { - update_inputs_from_solver (); - } - update_simtime_from_simulink (S); - - UNUSED_ARG(tid); /* not used in single tasking mode */ - - _odeo (); - - for (i = 0; i < MTTNX; i++) { - ssGetOutputPortRealSignal (S, 0)[i] = mttx[i]; - } - - for (i = 0; i < MTTNY; i++) { - ssGetOutputPortRealSignal (S, 1)[i] = mtty[i]; - } - - PRINT_LEAVE; -} - -#define MDL_DERIVATIVES -static void mdlDerivatives(SimStruct *S) -{ - PRINT_ENTER; - - update_states_from_simulink (S); - update_inputs_from_simulink (S); - if (MTTNYZ > 0) { - update_inputs_from_solver (); - } - update_simtime_from_simulink (S); - - _ode (); - - for (i = 0; i < MTTNX; i++) { - ssGetdX (S)[i] = mttdx[i]; - } - - PRINT_LEAVE; -} - -static void mdlTerminate(SimStruct *S) -{ - PRINT_ENTER; - UNUSED_ARG(S); - - free (mttdx); - free (mttpar); - free (mttu); - free (mttx); - free (mtty); - free (mttyz); - - PRINT_LEAVE; -} - -#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ -#include "simulink.c" /* MEX-file interface mechanism */ -#else -#include "cg_sfun.h" /* Code generation registration function */ -#endif - -EOF - ;; - - sfun_debug.h) - - cat < -#define PRINT_ENTER fprintf (stderr, "debug> Entered '%s'\n", __FUNCTION__); -#define PRINT_LEAVE fprintf (stderr, "debug> Leaving '%s'\n", __FUNCTION__); - -#elif defined DEBUG && ! defined __GNUC__ - -#include -#define PRINT_ENTER fprintf (stderr, "debug> Entered a function\n"); -#define PRINT_LEAVE fprintf (stderr, "debug> Leaving a function\n"); - -#elif ! defined DEBUG - -#define PRINT_ENTER -#define PRINT_LEAVE - -#else - -#error "Momentary lapse of logic : unreachable statement reached" - -#endif - - -#endif /* HAVE_SFUN_DEBUG_H */ - -EOF - ;; - - sfun_input.c) - - cat <_sfun_input.c: - * Matlab S-function inputs for - */ - -#define S_FUNCTION_NAME _sfun_input -#define S_FUNCTION_LEVEL 2 - -#include -#include -#include -#include "simstruc.h" -#include "sfun_debug.h" -#include "_def.h" -#include "_sympar.h" - -static double *mttu; /* pointer to inputs */ -static double *mttpar; /* pointer to parameters */ -static double *mttx; /* pointer to states */ -static double *mtty; /* pointer to outputs */ -static double mttt; /* time */ - -static unsigned int i; /* loop counter */ - -/* system equations */ - -static void -_input (void) -{ -#include "_input.c" - PRINT_LEAVE; -} - -static void -_numpar (void) -{ -#include "_numpar.c" - PRINT_LEAVE; -} - -/* utility procedures */ - -static double * -array_of_double (size_t n) -{ - void *p = calloc (n, sizeof (double)); - if (! p) { - fprintf (stderr, "*** Error: failed to allocate memory\n"); - } - return (double *) p; -} - -static void -initialise_arrays (void) -{ - PRINT_ENTER; - - mttpar = array_of_double (MTTNPAR); - mttu = array_of_double (MTTNU + MTTNYZ); - mttx = array_of_double (MTTNX); - mtty = array_of_double (MTTNY); - - PRINT_LEAVE; -} - -static void -update_inputs_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - for (i = 0; i < MTTNX; i++) { - mttx[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; - } - PRINT_LEAVE; -} - -static void -update_simtime_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - mttt = ssGetT (S); - PRINT_LEAVE; -} - -/* S-function methods */ - -static void mdlInitializeSizes(SimStruct *S) -{ - PRINT_ENTER; - - ssSetNumSFcnParams(S, 0); - if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { - PRINT_LEAVE; - return; - } - - ssSetNumContStates(S, 0); - ssSetNumDiscStates(S, 0); - - if (!ssSetNumInputPorts(S, 1)) return; - ssSetInputPortWidth(S, 0, MTTNX); - ssSetInputPortDirectFeedThrough(S, 0, 1); - - if (!ssSetNumOutputPorts(S, 1)) return; - ssSetOutputPortWidth(S, 0, MTTNU); - - ssSetNumSampleTimes(S, 1); - ssSetNumRWork(S, 0); - ssSetNumIWork(S, 0); - ssSetNumPWork(S, 0); - ssSetNumModes(S, 0); - ssSetNumNonsampledZCs(S, 0); - - ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); - - initialise_arrays (); - - PRINT_LEAVE; -} - -static void mdlInitializeSampleTimes(SimStruct *S) -{ - PRINT_ENTER; - ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); - ssSetOffsetTime(S, 0, 0.0); - PRINT_LEAVE; -} - -#define MDL_INITIALIZE_CONDITIONS -static void mdlInitializeConditions(SimStruct *S) -{ - PRINT_ENTER; - _numpar (); - PRINT_LEAVE; -} - -static void mdlOutputs(SimStruct *S, int_T tid) -{ - PRINT_ENTER; - - update_inputs_from_simulink (S); - update_simtime_from_simulink (S); - - UNUSED_ARG(tid); /* not used in single tasking mode */ - - _input (); - - for (i = 0; i < MTTNU; i++) { - ssGetOutputPortRealSignal (S, 0)[i] = mttu[i]; - } - - PRINT_LEAVE; -} - -#define MDL_DERIVATIVES -static void mdlDerivatives(SimStruct *S) -{ - PRINT_ENTER; - - update_inputs_from_simulink (S); - update_simtime_from_simulink (S); - - PRINT_LEAVE; -} - -static void mdlTerminate(SimStruct *S) -{ - PRINT_ENTER; - - UNUSED_ARG(S); - - free (mttpar); - free (mttu); - free (mttx); - free (mtty); - - PRINT_LEAVE; -} - -#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ -#include "simulink.c" /* MEX-file interface mechanism */ -#else -#include "cg_sfun.h" /* Code generation registration function */ -#endif - -EOF - ;; - - sfun_interface.c) - - cat <_sfun_interface.c: - * Matlab S-function to process inputs and outputs of - */ - - -#define S_FUNCTION_NAME _sfun_interface -#define S_FUNCTION_LEVEL 2 - -#include -#include -#include -#include "simstruc.h" -#include "sfun_debug.h" -#include "_def.h" -#include "_sympar.h" - -static double *mttu; /* pointer to inputs */ -static double *mttpar; /* pointer to parameters */ -static double *mttx; /* pointer to states */ -static double *mtty; /* pointer to outputs */ -static double mttt; /* time */ - -static double *controller_inputs; -static double *controller_outputs; - -static unsigned int i; /* loop counter */ - -/* Start EDIT */ -/* Edit this block to define the number of controller inputs, outputs and parameters */ -const int NumberOfControllerInputs = 1; /* inputs TO controller */ -const int NumberOfControllerOutputs = 1; /* outputs FROM controller */ -/* End EDIT */ - -static void -_process_inputs (void) -{ - /* insert _struc.c */ - - /* Start EDIT */ - /* Edit this block to process the model inputs and outputs */ - - /* Remove the following line */ - fprintf (stderr, "*** Error: _sfun_interface.c has not been customised!\n"); return; - - /* simple example follows */ - - /* Get total of all outputs and input to controller */ - controller_inputs[0] = 0.0; - for (i = 0; i < MTTNY; i++) { - controller_inputs[0] += mtty[i]; - } - - /* overwrite first model input with output from controller */ - mttu[0] = controller_outputs[0]; - - /* End EDIT */ -} - - -/****************************************************************************** - * DO NOT EDIT ANYTHING BELOW THIS LINE * - ******************************************************************************/ - -/* system equations */ - -static void -_numpar (void) -{ -#include "_numpar.c" - PRINT_LEAVE; -} - -/* utility procedures */ - -static double * -array_of_double (size_t n) -{ - void *p = calloc (n, sizeof (double)); - if (! p) { - fprintf (stderr, "*** Error: failed to allocate memory\n"); - } - return (double *) p; -} - -static void -initialise_arrays (void) -{ - PRINT_ENTER; - - mttpar = array_of_double (MTTNPAR); - mttu = array_of_double (MTTNU + MTTNYZ); - mttx = array_of_double (MTTNX); - mtty = array_of_double (MTTNY); - - controller_inputs = array_of_double (NumberOfControllerInputs); - controller_outputs = array_of_double (NumberOfControllerOutputs); - - PRINT_LEAVE; -} - -static void -update_inputs_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - for (i = 0; i < MTTNU; i++) { - mttu[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; - } - for (i = 0; i < MTTNX; i++) { - mttx[i] = *ssGetInputPortRealSignalPtrs (S, 1)[i]; - } - for (i = 0; i < MTTNY; i++) { - mtty[i] = *ssGetInputPortRealSignalPtrs (S, 2)[i]; - } - for (i = 0; i < NumberOfControllerOutputs; i++) { - controller_outputs[i] = *ssGetInputPortRealSignalPtrs (S, 3)[i]; - } - PRINT_LEAVE; -} - -static void -update_simtime_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - mttt = ssGetT (S); - PRINT_LEAVE; -} - -/* S-function methods */ - -static void mdlInitializeSizes(SimStruct *S) -{ - PRINT_ENTER; - - ssSetNumSFcnParams(S, 0); - if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { - PRINT_LEAVE; - return; - } - - ssSetNumContStates(S, 0); - ssSetNumDiscStates(S, 0); - - if (!ssSetNumInputPorts(S, 4)) return; - ssSetInputPortWidth(S, 0, MTTNU); - ssSetInputPortWidth(S, 1, MTTNX); - ssSetInputPortWidth(S, 2, MTTNY); - ssSetInputPortWidth(S, 3, NumberOfControllerOutputs); /* inputs from controller */ - ssSetInputPortDirectFeedThrough(S, 0, 1); - ssSetInputPortDirectFeedThrough(S, 1, 1); - ssSetInputPortDirectFeedThrough(S, 2, 1); - ssSetInputPortDirectFeedThrough(S, 3, 1); - - if (!ssSetNumOutputPorts(S, 2)) return; - ssSetOutputPortWidth(S, 0, MTTNU); /* altered inputs */ - ssSetOutputPortWidth(S, 1, NumberOfControllerInputs); /* outputs to controller */ - - ssSetNumSampleTimes(S, 1); - ssSetNumRWork(S, 0); - ssSetNumIWork(S, 0); - ssSetNumPWork(S, 0); - ssSetNumModes(S, 0); - ssSetNumNonsampledZCs(S, 0); - - ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); - - initialise_arrays (); - - PRINT_LEAVE; -} - -static void mdlInitializeSampleTimes(SimStruct *S) -{ - PRINT_ENTER; - ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); - ssSetOffsetTime(S, 0, 0.0); - PRINT_LEAVE; -} - -#define MDL_INITIALIZE_CONDITIONS -static void mdlInitializeConditions(SimStruct *S) -{ - PRINT_ENTER; - _numpar (); - PRINT_LEAVE; -} - -static void mdlOutputs(SimStruct *S, int_T tid) -{ - PRINT_ENTER; - - update_inputs_from_simulink (S); - update_simtime_from_simulink (S); - - _process_inputs (); - - UNUSED_ARG(tid); /* not used in single tasking mode */ - - for (i = 0; i < MTTNU; i++) { - ssGetOutputPortRealSignal (S, 0)[i] = mttu[i]; - } - - for (i = 0; i < NumberOfControllerInputs; i++) { - ssGetOutputPortRealSignal (S, 1)[i] = controller_inputs[i]; - } - - PRINT_LEAVE; -} - -#define MDL_DERIVATIVES -static void mdlDerivatives(SimStruct *S) -{ - PRINT_ENTER; - PRINT_LEAVE; -} - -static void mdlTerminate(SimStruct *S) -{ - PRINT_ENTER; - - UNUSED_ARG(S); - - free (mttpar); - free (mttu); - free (mttx); - free (mtty); - - free (controller_inputs); - free (controller_outputs); - - PRINT_LEAVE; -} - -#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ -#include "simulink.c" /* MEX-file interface mechanism */ -#else -#include "cg_sfun.h" /* Code generation registration function */ -#endif - -EOF - ;; - - *) - exit_error "Unknown Template"; - ;; - - esac -} - - - - - - - -### main program - -set_debug false -check_for_valid_input "$*" - -MTT_OPTS="$1" MTT_SYS="$2" MTT_LANG="$3" make $make_debug -f ${MTT_REP}/sfun_rep/Makefile ${2}_sfun.${3} -exit 0 DELETED mttroot/mtt/lib/rep/sfun_rep/Makefile Index: mttroot/mtt/lib/rep/sfun_rep/Makefile ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/Makefile +++ mttroot/mtt/lib/rep/sfun_rep/Makefile @@ -1,105 +0,0 @@ -#! /usr/bin/make -f - -all: $(MTT_SYS)_sfun.mexglx - -$(MTT_SYS)_sfun.mexglx: $(MTT_SYS)_sfun.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_numpar.c $(MTT_SYS)_ode.c $(MTT_SYS)_odeo.c $(MTT_SYS)_state.c $(MTT_SYS)_sfun_ae.mexglx $(MTT_SYS)_sfun_input.mexglx $(MTT_SYS)_sfun_interface.mexglx $(MTT_SYS).mdl - echo Creating $@ - mex $(MTT_SYS)_sfun.c - cp *_sfun*mexglx $(MTT_SYS).mdl .. - -$(MTT_SYS)_sfun.c:: ${MTT_REP}/sfun_rep/sfun.c.tmpl $(MTT_SYS)_def.r - echo Creating $@ - cat $< | sed 's//$(MTT_SYS)/g' |\ - sed s/\/`mtt_getsize $(MTT_SYS) yz`/ > $@ - -$(MTT_SYS)_sfun_ae.mexglx: $(MTT_SYS)_sfun_ae.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_ae.c - echo Creating $@ - mex $(MTT_SYS)_sfun_ae.c - -$(MTT_SYS)_sfun_ae.c:: ${MTT_REP}/sfun_rep/mex_ae.c.tmpl $(MTT_SYS)_def.r - echo Creating $@ - cat $< | sed 's//$(MTT_SYS)/g' |\ - sed s/\/`mtt_getsize $(MTT_SYS) yz`/ > $@ - -$(MTT_SYS)_sfun_input.mexglx: $(MTT_SYS)_sfun_input.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_input.c $(MTT_SYS)_numpar.c - echo Creating $@ - mex $(MTT_SYS)_sfun_input.c - -$(MTT_SYS)_sfun_input.c:: ${MTT_REP}/sfun_rep/sfun_input.c.tmpl - echo Creating $@ - cat $^ | sed 's//$(MTT_SYS)/g' > $@ - -$(MTT_SYS)_sfun_interface.mexglx: $(MTT_SYS)_sfun_interface.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_numpar.c - echo Creating $@ - mex $(MTT_SYS)_sfun_interface.c - -$(MTT_SYS)_sfun_interface.c: ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl $(MTT_SYS)_struc.c - echo Creating $@ - cat ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl |\ - sed 's//$(MTT_SYS)/g' |\ - ${MTT_REP}/sfun_rep/insert_file.sh > $@ - -$(MTT_SYS)_sfun.zip: $(MTT_SYS)_sfun.c sfun_debug.h useful-functions.hh $(MTT_SYS)_sfun_ae.c $(MTT_SYS)_sfun_input.c $(MTT_SYS)_sfun_interface.c \ - $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h\ - $(MTT_SYS)_ae.c $(MTT_SYS)_input.c $(MTT_SYS)_numpar.c $(MTT_SYS)_ode.c $(MTT_SYS)_odeo.c $(MTT_SYS)_state.c \ - $(MTT_SYS).mdl README - echo Creating $@ - zip $@ $^ - -$(MTT_SYS).mdl: ${MTT_REP}/sfun_rep/mdl.tmpl - echo Creating $@ - cat $^ | sed 's//$(MTT_SYS)/g' > $@ - -README:: ${MTT_REP}/sfun_rep/README.tmpl README.CVS - echo Creating $@ - date > $@ - cat $^ | sed 's//$(MTT_SYS)/g' >> $@ - rm -f README.CVS - -README.CVS: - echo Getting CVS status - (cvs status ../$(MTT_SYS)_abg.fig || echo -e "\n$(MTT_SYS)_abg.fig is not under CVS\n") > $@ 2>1 - -$(MTT_SYS)_ae.c: $(MTT_SYS)_ae.m - echo Creating $@ - ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) ae c cat - -$(MTT_SYS)_input.c: $(MTT_SYS)_input.m - echo Creating $@ - ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) input c cat - -$(MTT_SYS)_numpar.c: $(MTT_SYS)_numpar.m - echo Creating $@ - ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) numpar c cat - -$(MTT_SYS)_ode.c: $(MTT_SYS)_ode.m - echo Creating $@ - ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) ode c cat - -$(MTT_SYS)_odeo.c: $(MTT_SYS)_odeo.m - echo Creating $@ - ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) odeo c cat - -$(MTT_SYS)_state.c: $(MTT_SYS)_state.m - echo Creating $@ - ${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) state c cat - -$(MTT_SYS)_struc.c: $(MTT_SYS)_struc.txt - echo Creating $@ - gawk '\ -($$1 == "input") { printf " double *%s\t= &(mttu[%d]);\t/* input and output */\n", $$4, $$2-1 }\ -($$1 == "state") { printf " const double *_%s\t= &(mttx[%d]);\t/* input */\n", $$4, $$2-1 }\ -($$1 == "output") { printf " const double *_%s\t= &(mtty[%d]);\t/* input */\n", $$4, $$2-1 }\ -($$1 != "input" && $$1 != "state" && $$1 != "output") { }\ - ' $^ > $@ - -sfun_debug.h:: ${MTT_REP}/sfun_rep/sfun_debug.h - echo Copying $@ - cp $^ $@ - -useful-functions.hh:: ${MTT_CC}/include/useful-functions.hh - echo Copying $@ - cp $^ $@ - -%:: - mtt -cc -q $(MTT_OPTS) `echo $* | sed 's/\(.*\)_\(.*\)\.\(.*\)/\1 \2 \3/'` DELETED mttroot/mtt/lib/rep/sfun_rep/README.tmpl Index: mttroot/mtt/lib/rep/sfun_rep/README.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/README.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/README.tmpl @@ -1,16 +0,0 @@ - -To build a Simulink funtion of the model without using MTT: - -mex -I. _sfun.c - -The input block can be created with: - -mex -I. _sfun_input.c - -If numerical solution of algebraic equations is also required: - -mex -I. _sfun_ae.c - -The interface block can be created with - -mex -I. _sfun_interface.c DELETED mttroot/mtt/lib/rep/sfun_rep/insert_file.sh Index: mttroot/mtt/lib/rep/sfun_rep/insert_file.sh ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/insert_file.sh +++ mttroot/mtt/lib/rep/sfun_rep/insert_file.sh @@ -1,4 +0,0 @@ -#! /usr/bin/gawk -f -# script to replace the line: "/* insert filename */" with the contents of file "filename" -($1 != "/*" || $2 != "insert" || $4 != "*/") { print } -($1 == "/*" && $2 == "insert" && $4 == "*/") { cmd = "cat " $3 ; system(cmd) } DELETED mttroot/mtt/lib/rep/sfun_rep/mdl.tmpl Index: mttroot/mtt/lib/rep/sfun_rep/mdl.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/mdl.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/mdl.tmpl @@ -1,381 +0,0 @@ -Model { - Name "mdl" - Version 4.00 - SampleTimeColors off - LibraryLinkDisplay "all" - WideLines off - ShowLineDimensions on - ShowPortDataTypes off - ShowStorageClass off - ExecutionOrder off - RecordCoverage off - CovPath "/" - CovSaveName "covdata" - CovMetricSettings "dw" - CovNameIncrementing off - CovHtmlReporting on - BlockNameDataTip off - BlockParametersDataTip off - BlockDescriptionStringDataTip off - ToolBar on - StatusBar on - BrowserShowLibraryLinks off - BrowserLookUnderMasks off - Created "Mon May 20 13:21:21 2002" - Creator "geraint" - UpdateHistory "UpdateHistoryNever" - ModifiedByFormat "%" - LastModifiedBy "geraint" - ModifiedDateFormat "%" - LastModifiedDate "Tue Jun 18 18:49:28 2002" - ModelVersionFormat "1.%" - ConfigurationManager "None" - SimParamPage "Solver" - StartTime "0.0" - StopTime "10.0" - SolverMode "Auto" - Solver "ode45" - RelTol "1e-3" - AbsTol "auto" - Refine "1" - MaxStep "auto" - MinStep "auto" - MaxNumMinSteps "-1" - InitialStep "auto" - FixedStep "auto" - MaxOrder 5 - OutputOption "RefineOutputTimes" - OutputTimes "[]" - LoadExternalInput off - ExternalInput "[t, u]" - SaveTime on - TimeSaveName "tout" - SaveState off - StateSaveName "xout" - SaveOutput on - OutputSaveName "yout" - LoadInitialState off - InitialState "xInitial" - SaveFinalState off - FinalStateName "xFinal" - SaveFormat "Array" - LimitDataPoints on - MaxDataPoints "1000" - Decimation "1" - AlgebraicLoopMsg "warning" - MinStepSizeMsg "warning" - UnconnectedInputMsg "warning" - UnconnectedOutputMsg "warning" - UnconnectedLineMsg "warning" - InheritedTsInSrcMsg "warning" - SingleTaskRateTransMsg "none" - MultiTaskRateTransMsg "error" - IntegerOverflowMsg "warning" - CheckForMatrixSingularity "none" - UnnecessaryDatatypeConvMsg "none" - Int32ToFloatConvMsg "warning" - InvalidFcnCallConnMsg "error" - SignalLabelMismatchMsg "none" - LinearizationMsg "none" - VectorMatrixConversionMsg "none" - SfunCompatibilityCheckMsg "none" - BlockPriorityViolationMsg "warning" - ArrayBoundsChecking "none" - ConsistencyChecking "none" - ZeroCross on - Profile off - SimulationMode "normal" - RTWSystemTargetFile "grt.tlc" - RTWInlineParameters off - RTWRetainRTWFile off - RTWTemplateMakefile "grt_default_tmf" - RTWMakeCommand "make_rtw" - RTWGenerateCodeOnly off - TLCProfiler off - TLCDebug off - TLCCoverage off - AccelSystemTargetFile "accel.tlc" - AccelTemplateMakefile "accel_default_tmf" - AccelMakeCommand "make_rtw" - TryForcingSFcnDF off - ExtModeMexFile "ext_comm" - ExtModeBatchMode off - ExtModeTrigType "manual" - ExtModeTrigMode "normal" - ExtModeTrigPort "1" - ExtModeTrigElement "any" - ExtModeTrigDuration 1000 - ExtModeTrigHoldOff 0 - ExtModeTrigDelay 0 - ExtModeTrigDirection "rising" - ExtModeTrigLevel 0 - ExtModeArchiveMode "off" - ExtModeAutoIncOneShot off - ExtModeIncDirWhenArm off - ExtModeAddSuffixToVar off - ExtModeWriteAllDataToWs off - ExtModeArmWhenConnect on - ExtModeSkipDownloadWhenConnect off - ExtModeLogAll on - ExtModeAutoUpdateStatusClock off - OptimizeBlockIOStorage on - BufferReuse on - ParameterPooling on - BlockReductionOpt on - RTWExpressionDepthLimit 5 - BooleanDataType off - BlockDefaults { - Orientation "right" - ForegroundColor "black" - BackgroundColor "white" - DropShadow off - NamePlacement "normal" - FontName "Helvetica" - FontSize 10 - FontWeight "normal" - FontAngle "normal" - ShowName on - } - AnnotationDefaults { - HorizontalAlignment "center" - VerticalAlignment "middle" - ForegroundColor "black" - BackgroundColor "white" - DropShadow off - FontName "Helvetica" - FontSize 10 - FontWeight "normal" - FontAngle "normal" - } - LineDefaults { - FontName "Helvetica" - FontSize 9 - FontWeight "normal" - FontAngle "normal" - } - System { - Name "mdl" - Location [61, 487, 356, 620] - Open on - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - ReportName "simulink-default.rpt" - Block { - BlockType Inport - Name "In1" - Position [25, 43, 55, 57] - Port "1" - LatchInput off - DataType "double" - SignalType "real" - Interpolate on - } - Block { - BlockType SubSystem - Name "MTT Model\n" - Ports [1, 1] - Position [100, 20, 140, 80] - ForegroundColor "blue" - BackgroundColor "lightBlue" - ShowPortLabels on - TreatAsAtomicUnit off - RTWSystemCode "Auto" - RTWFcnNameOpts "Auto" - RTWFileNameOpts "Auto" - System { - Name "MTT Model\n" - Location [55, 494, 1018, 766] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Inport - Name "In1" - Position [590, 203, 620, 217] - Port "1" - LatchInput off - DataType "double" - SignalType "real" - Interpolate on - } - Block { - BlockType "S-Function" - Name "MTT Model Inputs" - Ports [1, 1] - Position [390, 59, 565, 91] - BackgroundColor "lightBlue" - DropShadow on - FunctionName "_sfun_input" - PortCounts "[]" - SFunctionModules "''" - Port { - PortNumber 1 - Name "MTT Model Inputs: MTTU" - TestPoint off - LinearAnalysisOutput off - LinearAnalysisInput off - RTWStorageClass "Auto" - } - } - Block { - BlockType "S-Function" - Name "MTT Plant Model" - Ports [1, 2] - Position [65, 61, 250, 199] - BackgroundColor "lightBlue" - DropShadow on - FunctionName "_sfun" - PortCounts "[]" - SFunctionModules "''" - Port { - PortNumber 1 - Name "MTT Model States: MTTX" - TestPoint off - LinearAnalysisOutput off - LinearAnalysisInput off - RTWStorageClass "Auto" - } - Port { - PortNumber 2 - Name "MTT Model Outputs: MTTY" - TestPoint off - LinearAnalysisOutput off - LinearAnalysisInput off - RTWStorageClass "Auto" - } - } - Block { - BlockType Memory - Name "Memory" - Position [870, 80, 900, 110] - X0 "0" - InheritSampleTime off - RTWStateStorageClass "Auto" - } - Block { - BlockType Memory - Name "Memory1" - Position [860, 175, 890, 205] - X0 "0" - InheritSampleTime off - RTWStateStorageClass "Auto" - } - Block { - BlockType "S-Function" - Name "S-Function" - Ports [4, 2] - Position [710, 47, 840, 238] - BackgroundColor "lightBlue" - DropShadow on - FunctionName "_sfun_interface" - PortCounts "[]" - SFunctionModules "''" - } - Block { - BlockType Outport - Name "Out1" - Position [905, 183, 935, 197] - Port "1" - OutputWhenDisabled "held" - InitialOutput "[]" - } - Line { - Name "MTT Model States: MTTX" - Labels [2, 0] - SrcBlock "MTT Plant Model" - SrcPort 1 - Points [0, 0; 105, 0] - Branch { - Points [0, -20] - DstBlock "MTT Model Inputs" - DstPort 1 - } - Branch { - Points [0, 25] - DstBlock "S-Function" - DstPort 2 - } - } - Line { - Name "MTT Model Outputs: MTTY" - Labels [1, 0] - SrcBlock "MTT Plant Model" - SrcPort 2 - DstBlock "S-Function" - DstPort 3 - } - Line { - Name "MTT Model Inputs: MTTU" - Labels [1, 0] - SrcBlock "MTT Model Inputs" - SrcPort 1 - DstBlock "S-Function" - DstPort 1 - } - Line { - SrcBlock "In1" - SrcPort 1 - DstBlock "S-Function" - DstPort 4 - } - Line { - SrcBlock "S-Function" - SrcPort 1 - DstBlock "Memory" - DstPort 1 - } - Line { - SrcBlock "Memory" - SrcPort 1 - Points [0, -55; -855, 0] - DstBlock "MTT Plant Model" - DstPort 1 - } - Line { - SrcBlock "Memory1" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Line { - SrcBlock "S-Function" - SrcPort 2 - DstBlock "Memory1" - DstPort 1 - } - } - } - Block { - BlockType Outport - Name "Out1" - Position [185, 43, 215, 57] - Port "1" - OutputWhenDisabled "held" - InitialOutput "[]" - } - Line { - SrcBlock "MTT Model\n" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Line { - SrcBlock "In1" - SrcPort 1 - DstBlock "MTT Model\n" - DstPort 1 - } - } -} DELETED mttroot/mtt/lib/rep/sfun_rep/mex_ae.c.tmpl Index: mttroot/mtt/lib/rep/sfun_rep/mex_ae.c.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/mex_ae.c.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/mex_ae.c.tmpl @@ -1,122 +0,0 @@ -/* -*-c-*- Put emacs into c-mode - * _sfun_ae.c: - * Matlab mex algebraic equations for - */ - -#if /* have_algebraic_equations */ - -#include -#include -#include -#include -#include "sfun_debug.h" -#include "useful-functions.hh" -#include "_def.h" -#include "_sympar.h" -#include "_cr.h" - -/* utility procedures */ - -double * -array_of_double (size_t n) -{ - void *p = calloc (n, sizeof (double)); - if (! p) { - fprintf (stderr, "*** Error: failed to allocate memory\n"); - } - return (double *) p; -} - -/* system equations */ - -static void -_ae (double *mttyz, - const double *mttx, - const double *mttu, - const double mttt, - const double *mttpar) -{ -#include "_ae.c" - PRINT_LEAVE; -} - -/* generic mex function */ - -#ifdef __cplusplus -extern "C" { -#endif - -void -mexFunction (int nlhs, mxArray *plhs[], - int nrhs, const mxArray *prhs[]) -{ - double *mttyz; /* residuals */ - - double *mttx; /* states */ - double *mttu; /* known + unknown inputs */ - double mttt; /* time */ - double *mttpar; /* parameters */ - - unsigned int i; - double *p; - - PRINT_ENTER; - - mttyz = array_of_double (MTTNYZ); - - mttx = array_of_double (MTTNX); - mttu = array_of_double (MTTNU + MTTNYZ); - mttpar = array_of_double (MTTNPAR); - - /* get trial values */ - p = mxGetPr (prhs[0]); - for (i = 0; i < MTTNYZ; i++) { - mttu[MTTNU + i] = p[i]; - } - - /* get states */ - p = mxGetPr (prhs[1]); - for (i = 0; i < MTTNX; i++) { - mttx[i] = p[i]; - } - - /* get known inputs */ - p = mxGetPr (prhs[2]); - for (i = 0; i < MTTNU; i++) { - mttu[i] = p[i]; - } - - /* get time */ - p = mxGetPr (prhs[3]); - mttt = *p; - - /* get parameters */ - p = mxGetPr (prhs[4]); - for (i = 0; i < MTTNPAR; i++) { - mttpar[i] = p[i]; - } - - /* evaluate residuals */ - _ae (mttyz, mttx, mttu, mttt, mttpar); - - /* return residuals */ - plhs[0] = mxCreateDoubleMatrix (MTTNYZ, 1, mxREAL); - p = mxGetPr (plhs[0]); - for (i = 0; i < MTTNYZ; i++) { - p[i] = mttyz[i]; - } - - /* release memory */ - free (mttx); - free (mttu); - free (mttpar); - free (mttyz); - - PRINT_LEAVE; -} - -#ifdef __cplusplus -} -#endif - -#endif /* have_algebraic_equations */ DELETED mttroot/mtt/lib/rep/sfun_rep/sfun.c.tmpl Index: mttroot/mtt/lib/rep/sfun_rep/sfun.c.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/sfun.c.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/sfun.c.tmpl @@ -1,322 +0,0 @@ -/* -*-c-*- Put emacs into c-mode - * _sfun.c: - * Matlab S-function simulation of - */ - -#define S_FUNCTION_NAME _sfun -#define S_FUNCTION_LEVEL 2 - -#include -#include -#include -#include "simstruc.h" -#include "sfun_debug.h" -#include "useful-functions.hh" -#include "_def.h" -#include "_sympar.h" -#include "_cr.h" - -static double *mttdx; /* pointer to rates */ -static double *mttu; /* pointer to inputs */ -static double *mttpar; /* pointer to parameters */ -static double *mttx; /* pointer to states */ -static double *mtty; /* pointer to outputs */ -static double *mttyz; /* pointer to residuals */ -static double mttt; /* time */ - -static unsigned int i; /* loop counter */ - -/* system equations */ - -static void -_ae (void) -{ -#include "_ae.c" - PRINT_LEAVE; -} - -static void -_numpar (void) -{ -#include "_numpar.c" - PRINT_LEAVE; -} - -static void -_ode (void) -{ -#include "_ode.c" - PRINT_LEAVE; -} - -static void -_odeo (void) -{ -#include "_odeo.c" - PRINT_LEAVE; -} - -static void -_state (void) -{ -#include "_state.c" - PRINT_LEAVE; -} - -/* utility procedures */ - -static double * -array_of_double (size_t n) -{ - void *p = calloc (n, sizeof (double)); - if (! p) { - fprintf (stderr, "*** Error: failed to allocate memory\n"); - } - return (double *) p; -} - -static void -initialise_arrays (void) -{ - PRINT_ENTER; - - mttdx = array_of_double (MTTNX); - mttpar = array_of_double (MTTNPAR); - mttu = array_of_double (MTTNU + MTTNYZ); - mttx = array_of_double (MTTNX); - mtty = array_of_double (MTTNY); - mttyz = array_of_double (MTTNYZ); - - PRINT_LEAVE; -} - -static void -update_states_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - for (i = 0; i < MTTNX; i++) { - mttx[i] = ssGetContStates (S)[i]; - } - PRINT_LEAVE; -} - -static void -update_inputs_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - for (i = 0; i < MTTNU; i++) { - mttu[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; - } - PRINT_LEAVE; -} - -static void -update_inputs_from_solver (void) -{ -#if /* have_algebraic_equations */ - mxArray *MTT_MATLAB_P; - mxArray *MTT_MATLAB_T; - mxArray *MTT_MATLAB_U; - mxArray *MTT_MATLAB_Ui; - mxArray *MTT_MATLAB_X; - - double *p; - - PRINT_ENTER; - - /* starting value for solver - start with zero */ - MTT_MATLAB_Ui = mxCreateDoubleMatrix (MTTNYZ, 1, mxREAL); - p = mxGetPr (MTT_MATLAB_Ui); - for (i = 0; i < MTTNYZ; i++) { - p[i] = 0.0; - } - mexPutVariable ("base", "MTT_Ui", MTT_MATLAB_Ui); - - /* put states into matlab workspace */ - MTT_MATLAB_X = mxCreateDoubleMatrix (MTTNX, 1, mxREAL); - p = mxGetPr (MTT_MATLAB_X); - for (i = 0; i < MTTNX; i++) { - p[i] = mttx[i]; - } - mexPutVariable ("base", "MTT_X", MTT_MATLAB_X); - - /* put known inputs into matlab workspace */ - MTT_MATLAB_U = mxCreateDoubleMatrix (MTTNU, 1, mxREAL); - p = mxGetPr (MTT_MATLAB_U); - for (i = 0; i < MTTNU; i++) { - p[i] = mttu[i]; - } - mexPutVariable ("base", "MTT_U", MTT_MATLAB_U); - - /* put time into matlab workspace */ - MTT_MATLAB_T = mxCreateDoubleMatrix (1, 1, mxREAL); - *mxGetPr (MTT_MATLAB_T) = mttt; - mexPutVariable ("base", "MTT_T", MTT_MATLAB_T); - - /* put parameters into matlab workspace */ - MTT_MATLAB_P = mxCreateDoubleMatrix (MTTNPAR, 1, mxREAL); - p = mxGetPr (MTT_MATLAB_P); - for (i = 0; i < MTTNPAR; i++) { - p[i] = mttpar[i]; - } - mexPutVariable ("base", "MTT_P", MTT_MATLAB_P); - - /* call solver */ - mexEvalString ("MTT_Ui = lsqnonlin (@_sfun_ae, MTT_Ui, [], [], optimset('display','off','diagnostics','off','TolX',1e-2,'TolFun',1e-2), MTT_X, MTT_U, MTT_T, MTT_P);"); - - /* retrieve result */ - MTT_MATLAB_Ui = mexGetVariable ("base", "MTT_Ui"); - p = mxGetPr (MTT_MATLAB_Ui); - for (i = 0; i < MTTNYZ; i++) { - mttu[MTTNU + i] = p[i]; - } - - /* free memory */ - mxDestroyArray (MTT_MATLAB_P); - mxDestroyArray (MTT_MATLAB_T); - mxDestroyArray (MTT_MATLAB_U); - mxDestroyArray (MTT_MATLAB_Ui); - mxDestroyArray (MTT_MATLAB_X); - - PRINT_LEAVE; -#endif /* have_algebraic_equations */ - ; -} - -static void -update_simtime_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - mttt = ssGetT (S); - PRINT_LEAVE; -} - -/* S-function methods */ - -static void mdlInitializeSizes(SimStruct *S) -{ - PRINT_ENTER; - - ssSetNumSFcnParams(S, 0); - if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { - PRINT_LEAVE; - return; - } - - ssSetNumContStates(S, MTTNX); - ssSetNumDiscStates(S, 0); - - if (!ssSetNumInputPorts(S, 1)) return; - ssSetInputPortWidth(S, 0, MTTNU); - ssSetInputPortDirectFeedThrough(S, 0, 1); - - if (!ssSetNumOutputPorts(S, 2)) return; - ssSetOutputPortWidth(S, 0, MTTNX); - ssSetOutputPortWidth(S, 1, MTTNY); - - ssSetNumSampleTimes(S, 1); - ssSetNumRWork(S, 0); - ssSetNumIWork(S, 0); - ssSetNumPWork(S, 0); - ssSetNumModes(S, 0); - ssSetNumNonsampledZCs(S, 0); - - ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); - - initialise_arrays (); - - PRINT_LEAVE; -} - -static void mdlInitializeSampleTimes(SimStruct *S) -{ - PRINT_ENTER; - - ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); - ssSetOffsetTime(S, 0, 0.0); - - PRINT_LEAVE; -} - -#define MDL_INITIALIZE_CONDITIONS -static void mdlInitializeConditions(SimStruct *S) -{ - PRINT_ENTER; - - _numpar (); - _state (); - - for (i = 0; i < MTTNX; i++) { - ssGetContStates (S)[i] = mttx[i]; - } - - PRINT_LEAVE; -} - -static void mdlOutputs(SimStruct *S, int_T tid) -{ - PRINT_ENTER; - - update_states_from_simulink (S); - update_inputs_from_simulink (S); - if (MTTNYZ > 0) { - update_inputs_from_solver (); - } - update_simtime_from_simulink (S); - - UNUSED_ARG(tid); /* not used in single tasking mode */ - - _odeo (); - - for (i = 0; i < MTTNX; i++) { - ssGetOutputPortRealSignal (S, 0)[i] = mttx[i]; - } - - for (i = 0; i < MTTNY; i++) { - ssGetOutputPortRealSignal (S, 1)[i] = mtty[i]; - } - - PRINT_LEAVE; -} - -#define MDL_DERIVATIVES -static void mdlDerivatives(SimStruct *S) -{ - PRINT_ENTER; - - update_states_from_simulink (S); - update_inputs_from_simulink (S); - if (MTTNYZ > 0) { - update_inputs_from_solver (); - } - update_simtime_from_simulink (S); - - _ode (); - - for (i = 0; i < MTTNX; i++) { - ssGetdX (S)[i] = mttdx[i]; - } - - PRINT_LEAVE; -} - -static void mdlTerminate(SimStruct *S) -{ - PRINT_ENTER; - UNUSED_ARG(S); - - free (mttdx); - free (mttpar); - free (mttu); - free (mttx); - free (mtty); - free (mttyz); - - PRINT_LEAVE; -} - -#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ -#include "simulink.c" /* MEX-file interface mechanism */ -#else -#include "cg_sfun.h" /* Code generation registration function */ -#endif DELETED mttroot/mtt/lib/rep/sfun_rep/sfun_debug.h Index: mttroot/mtt/lib/rep/sfun_rep/sfun_debug.h ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/sfun_debug.h +++ mttroot/mtt/lib/rep/sfun_rep/sfun_debug.h @@ -1,30 +0,0 @@ - -#ifndef HAVE_SFUN_DEBUG_H -#define HAVE_SFUN_DEBUG_H - - -#if defined DEBUG && defined __GNUC__ - -#include -#define PRINT_ENTER fprintf (stderr, "debug> Entered '%s'\n", __FUNCTION__); -#define PRINT_LEAVE fprintf (stderr, "debug> Leaving '%s'\n", __FUNCTION__); - -#elif defined DEBUG && ! defined __GNUC__ - -#include -#define PRINT_ENTER fprintf (stderr, "debug> Entered a function\n"); -#define PRINT_LEAVE fprintf (stderr, "debug> Leaving a function\n"); - -#elif ! defined DEBUG - -#define PRINT_ENTER -#define PRINT_LEAVE - -#else - -#error "Momentary lapse of logic : unreachable statement reached" - -#endif - - -#endif /* HAVE_SFUN_DEBUG_H */ DELETED mttroot/mtt/lib/rep/sfun_rep/sfun_input.c.tmpl Index: mttroot/mtt/lib/rep/sfun_rep/sfun_input.c.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/sfun_input.c.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/sfun_input.c.tmpl @@ -1,185 +0,0 @@ -/* -*-c-*- Put emacs into c-mode - * _sfun_input.c: - * Matlab S-function inputs for - */ - -#define S_FUNCTION_NAME _sfun_input -#define S_FUNCTION_LEVEL 2 - -#include -#include -#include -#include "simstruc.h" -#include "sfun_debug.h" -#include "useful-functions.hh" -#include "_def.h" -#include "_sympar.h" -#include "_cr.h" - -static double *mttu; /* pointer to inputs */ -static double *mttpar; /* pointer to parameters */ -static double *mttx; /* pointer to states */ -static double *mtty; /* pointer to outputs */ -static double mttt; /* time */ - -static unsigned int i; /* loop counter */ - -/* system equations */ - -static void -_input (void) -{ -#include "_input.c" - PRINT_LEAVE; -} - -static void -_numpar (void) -{ -#include "_numpar.c" - PRINT_LEAVE; -} - -/* utility procedures */ - -static double * -array_of_double (size_t n) -{ - void *p = calloc (n, sizeof (double)); - if (! p) { - fprintf (stderr, "*** Error: failed to allocate memory\n"); - } - return (double *) p; -} - -static void -initialise_arrays (void) -{ - PRINT_ENTER; - - mttpar = array_of_double (MTTNPAR); - mttu = array_of_double (MTTNU + MTTNYZ); - mttx = array_of_double (MTTNX); - mtty = array_of_double (MTTNY); - - PRINT_LEAVE; -} - -static void -update_inputs_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - for (i = 0; i < MTTNX; i++) { - mttx[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; - } - PRINT_LEAVE; -} - -static void -update_simtime_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - mttt = ssGetT (S); - PRINT_LEAVE; -} - -/* S-function methods */ - -static void mdlInitializeSizes(SimStruct *S) -{ - PRINT_ENTER; - - ssSetNumSFcnParams(S, 0); - if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { - PRINT_LEAVE; - return; - } - - ssSetNumContStates(S, 0); - ssSetNumDiscStates(S, 0); - - if (!ssSetNumInputPorts(S, 1)) return; - ssSetInputPortWidth(S, 0, MTTNX); - ssSetInputPortDirectFeedThrough(S, 0, 1); - - if (!ssSetNumOutputPorts(S, 1)) return; - ssSetOutputPortWidth(S, 0, MTTNU); - - ssSetNumSampleTimes(S, 1); - ssSetNumRWork(S, 0); - ssSetNumIWork(S, 0); - ssSetNumPWork(S, 0); - ssSetNumModes(S, 0); - ssSetNumNonsampledZCs(S, 0); - - ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); - - initialise_arrays (); - - PRINT_LEAVE; -} - -static void mdlInitializeSampleTimes(SimStruct *S) -{ - PRINT_ENTER; - ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); - ssSetOffsetTime(S, 0, 0.0); - PRINT_LEAVE; -} - -#define MDL_INITIALIZE_CONDITIONS -static void mdlInitializeConditions(SimStruct *S) -{ - PRINT_ENTER; - _numpar (); - PRINT_LEAVE; -} - -static void mdlOutputs(SimStruct *S, int_T tid) -{ - PRINT_ENTER; - - update_inputs_from_simulink (S); - update_simtime_from_simulink (S); - - UNUSED_ARG(tid); /* not used in single tasking mode */ - - _input (); - - for (i = 0; i < MTTNU; i++) { - ssGetOutputPortRealSignal (S, 0)[i] = mttu[i]; - } - - PRINT_LEAVE; -} - -#define MDL_DERIVATIVES -static void mdlDerivatives(SimStruct *S) -{ - PRINT_ENTER; - - update_inputs_from_simulink (S); - update_simtime_from_simulink (S); - - PRINT_LEAVE; -} - -static void mdlTerminate(SimStruct *S) -{ - PRINT_ENTER; - - UNUSED_ARG(S); - - free (mttpar); - free (mttu); - free (mttx); - free (mtty); - - PRINT_LEAVE; -} - -#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ -#include "simulink.c" /* MEX-file interface mechanism */ -#else -#include "cg_sfun.h" /* Code generation registration function */ -#endif DELETED mttroot/mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl Index: mttroot/mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/sfun_interface.c.tmpl @@ -1,275 +0,0 @@ -/* -*-c-*- Put emacs into c-mode - * _sfun_interface.c: - * Matlab S-function to process inputs and outputs of - */ - - -#define S_FUNCTION_NAME _sfun_interface -#define S_FUNCTION_LEVEL 2 - -#include -#include -#include -#include "simstruc.h" -#include "sfun_debug.h" -#include "useful-functions.hh" -#include "_def.h" -#include "_sympar.h" - -static double *mttu; /* pointer to inputs */ -static double *mttpar; /* pointer to parameters */ -static double *mttx; /* pointer to states */ -static double *mtty; /* pointer to outputs */ -static double mttt; /* time */ - -static double *MTT_outputs; -static double *MTT_inputs; - -static unsigned int i; /* loop counter */ - -/* Start EDIT */ -/* Edit this block to define the number of simulink inputs, outputs and parameters */ -#define NumberOfSimulinkInputs MTTNY /* MTT outputs */ -#define NumberOfSimulinkOutputs MTTNU /* MTT inputs */ -/* End EDIT */ - -static void -_process_inputs (SimStruct *S) -{ - /* insert _struc.c */ - - /* Start EDIT */ - /* Edit this block to process the model inputs and outputs */ - - /* Error messages can be set using the following line */ - /* ssSetErrorStatus (S, "_some error message!\n"); */ - - /* Default is to expose all MTT inputs, outputs and states */ - - /* Get all the MTT model outputs and pass them to simulink */ - for (i = 0; i < NumberOfSimulinkInputs; i++) { - MTT_outputs[i] = mtty[i]; - } - - /* Get all inputs from Simulink and pass them to the MTT model */ - /* Any inputs not over-written here will be read from _input.c */ - for (i = 0; i < NumberOfSimulinkOutputs; i++) { - mttu[i] = MTT_inputs[i]; - } - - /* End EDIT */ -} - - -/****************************************************************************** - * DO NOT EDIT ANYTHING BELOW THIS LINE * - ******************************************************************************/ - -/* system equations */ - -static void -_numpar (void) -{ -#include "_numpar.c" - PRINT_LEAVE; -} - -/* utility procedures */ - -static double * -array_of_double (size_t n) -{ - void *p = calloc (n, sizeof (double)); - if (! p) { - fprintf (stderr, "*** Error: failed to allocate memory\n"); - } - return (double *) p; -} - -static void -check_finite(SimStruct *S, double *array, unsigned int index) -{ - const char *array_name; - char warning[128]; - if ((array[index] <= 0.0) || (array[index] >= 0.0)) { - ; /* no problem */ - } else { - if (array == mttpar) { - array_name = "mttpar"; - } else if (array == mttu) { - array_name = "mttu"; - } else if (array == mttx) { - array_name = "mttx"; - } else if (array == mtty) { - array_name = "mtty"; - } else if (array == MTT_outputs) { - array_name = "MTT_outputs"; - } else if (array == MTT_inputs) { - array_name = "MTT_inputs"; - } else { - array_name = "unknown_array"; - } - sprintf(warning, "(time %f) Non-finite array element: %s[%d]\n", mttt, array_name, index); - ssWarning(S, warning); - } -} - -static void -initialise_arrays (void) -{ - PRINT_ENTER; - - mttpar = array_of_double (MTTNPAR); - mttu = array_of_double (MTTNU + MTTNYZ); - mttx = array_of_double (MTTNX); - mtty = array_of_double (MTTNY); - - MTT_outputs = array_of_double (NumberOfSimulinkInputs); - MTT_inputs = array_of_double (NumberOfSimulinkOutputs); - - PRINT_LEAVE; -} - -static void -update_inputs_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - for (i = 0; i < MTTNU; i++) { - mttu[i] = *ssGetInputPortRealSignalPtrs (S, 0)[i]; - check_finite(S, mttu, i); - } - for (i = 0; i < MTTNX; i++) { - mttx[i] = *ssGetInputPortRealSignalPtrs (S, 1)[i]; - check_finite(S, mttx, i); - } - for (i = 0; i < MTTNY; i++) { - mtty[i] = *ssGetInputPortRealSignalPtrs (S, 2)[i]; - check_finite(S, mtty, i); - } - for (i = 0; i < NumberOfSimulinkOutputs; i++) { - MTT_inputs[i] = *ssGetInputPortRealSignalPtrs (S, 3)[i]; - check_finite(S, MTT_inputs, i); - } - PRINT_LEAVE; -} - -static void -update_simtime_from_simulink (SimStruct *S) -{ - PRINT_ENTER; - mttt = ssGetT (S); - PRINT_LEAVE; -} - -/* S-function methods */ - -static void mdlInitializeSizes(SimStruct *S) -{ - PRINT_ENTER; - - ssSetNumSFcnParams(S, 0); - if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { - PRINT_LEAVE; - return; - } - - ssSetNumContStates(S, 0); - ssSetNumDiscStates(S, 0); - - if (!ssSetNumInputPorts(S, 4)) return; - ssSetInputPortWidth(S, 0, MTTNU); - ssSetInputPortWidth(S, 1, MTTNX); - ssSetInputPortWidth(S, 2, MTTNY); - ssSetInputPortWidth(S, 3, NumberOfSimulinkOutputs); /* inputs from simulink */ - ssSetInputPortDirectFeedThrough(S, 0, 1); - ssSetInputPortDirectFeedThrough(S, 1, 1); - ssSetInputPortDirectFeedThrough(S, 2, 1); - ssSetInputPortDirectFeedThrough(S, 3, 1); - - if (!ssSetNumOutputPorts(S, 2)) return; - ssSetOutputPortWidth(S, 0, MTTNU); /* altered inputs */ - ssSetOutputPortWidth(S, 1, NumberOfSimulinkInputs); /* outputs to simulink */ - - ssSetNumSampleTimes(S, 1); - ssSetNumRWork(S, 0); - ssSetNumIWork(S, 0); - ssSetNumPWork(S, 0); - ssSetNumModes(S, 0); - ssSetNumNonsampledZCs(S, 0); - - ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE); - - initialise_arrays (); - - PRINT_LEAVE; -} - -static void mdlInitializeSampleTimes(SimStruct *S) -{ - PRINT_ENTER; - ssSetSampleTime(S, 0, CONTINUOUS_SAMPLE_TIME); - ssSetOffsetTime(S, 0, 0.0); - PRINT_LEAVE; -} - -#define MDL_INITIALIZE_CONDITIONS -static void mdlInitializeConditions(SimStruct *S) -{ - PRINT_ENTER; - _numpar (); - PRINT_LEAVE; -} - -static void mdlOutputs(SimStruct *S, int_T tid) -{ - PRINT_ENTER; - - update_inputs_from_simulink (S); - update_simtime_from_simulink (S); - - _process_inputs (S); - - UNUSED_ARG(tid); /* not used in single tasking mode */ - - for (i = 0; i < MTTNU; i++) { - check_finite(S, mttu, i); - ssGetOutputPortRealSignal (S, 0)[i] = mttu[i]; - } - - for (i = 0; i < NumberOfSimulinkInputs; i++) { - check_finite(S, MTT_outputs, i); - ssGetOutputPortRealSignal (S, 1)[i] = MTT_outputs[i]; - } - - PRINT_LEAVE; -} - -#define MDL_DERIVATIVES -static void mdlDerivatives(SimStruct *S) -{ - PRINT_ENTER; - PRINT_LEAVE; -} - -static void mdlTerminate(SimStruct *S) -{ - PRINT_ENTER; - - UNUSED_ARG(S); - - free (mttpar); - free (mttu); - free (mttx); - free (mtty); - - free (MTT_outputs); - free (MTT_inputs); - - PRINT_LEAVE; -} - -#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */ -#include "simulink.c" /* MEX-file interface mechanism */ -#else -#include "cg_sfun.h" /* Code generation registration function */ -#endif DELETED mttroot/mtt/lib/xfig/Basic/0.fig Index: mttroot/mtt/lib/xfig/Basic/0.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/0.fig +++ mttroot/mtt/lib/xfig/Basic/0.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 0\001 DELETED mttroot/mtt/lib/xfig/Basic/1.fig Index: mttroot/mtt/lib/xfig/Basic/1.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/1.fig +++ mttroot/mtt/lib/xfig/Basic/1.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 1\001 DELETED mttroot/mtt/lib/xfig/Basic/AE.fig Index: mttroot/mtt/lib/xfig/Basic/AE.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/AE.fig +++ mttroot/mtt/lib/xfig/Basic/AE.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 AE:ae_1\001 DELETED mttroot/mtt/lib/xfig/Basic/AEf.fig Index: mttroot/mtt/lib/xfig/Basic/AEf.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/AEf.fig +++ mttroot/mtt/lib/xfig/Basic/AEf.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 AEf:aef_1\001 DELETED mttroot/mtt/lib/xfig/Basic/AF.fig Index: mttroot/mtt/lib/xfig/Basic/AF.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/AF.fig +++ mttroot/mtt/lib/xfig/Basic/AF.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 AF:af_1\001 DELETED mttroot/mtt/lib/xfig/Basic/AFe.fig Index: mttroot/mtt/lib/xfig/Basic/AFe.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/AFe.fig +++ mttroot/mtt/lib/xfig/Basic/AFe.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 AFe:afe_1\001 DELETED mttroot/mtt/lib/xfig/Basic/C.fig Index: mttroot/mtt/lib/xfig/Basic/C.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/C.fig +++ mttroot/mtt/lib/xfig/Basic/C.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 C:c_1\001 DELETED mttroot/mtt/lib/xfig/Basic/De.fig Index: mttroot/mtt/lib/xfig/Basic/De.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/De.fig +++ mttroot/mtt/lib/xfig/Basic/De.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 De:de_1\001 DELETED mttroot/mtt/lib/xfig/Basic/DescriptiveText.fig Index: mttroot/mtt/lib/xfig/Basic/DescriptiveText.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/DescriptiveText.fig +++ mttroot/mtt/lib/xfig/Basic/DescriptiveText.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 1 101 0 3 20 0.0000 4 255 2025 1395 630 Descriptive text.\001 DELETED mttroot/mtt/lib/xfig/Basic/Df.fig Index: mttroot/mtt/lib/xfig/Basic/Df.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/Df.fig +++ mttroot/mtt/lib/xfig/Basic/Df.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 Df:df_1\001 DELETED mttroot/mtt/lib/xfig/Basic/EMTF.fig Index: mttroot/mtt/lib/xfig/Basic/EMTF.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/EMTF.fig +++ mttroot/mtt/lib/xfig/Basic/EMTF.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 EMTF:emtf_1\001 DELETED mttroot/mtt/lib/xfig/Basic/GY.fig Index: mttroot/mtt/lib/xfig/Basic/GY.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/GY.fig +++ mttroot/mtt/lib/xfig/Basic/GY.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 GY:gy_1\001 DELETED mttroot/mtt/lib/xfig/Basic/I.fig Index: mttroot/mtt/lib/xfig/Basic/I.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/I.fig +++ mttroot/mtt/lib/xfig/Basic/I.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 I:i_1\001 DELETED mttroot/mtt/lib/xfig/Basic/INTF.fig Index: mttroot/mtt/lib/xfig/Basic/INTF.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/INTF.fig +++ mttroot/mtt/lib/xfig/Basic/INTF.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 INTF:intf_1\001 DELETED mttroot/mtt/lib/xfig/Basic/InPort.fig Index: mttroot/mtt/lib/xfig/Basic/InPort.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/InPort.fig +++ mttroot/mtt/lib/xfig/Basic/InPort.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 2 4 100 0 18 18 0.0000 4 270 870 1890 855 SS:[in]\001 DELETED mttroot/mtt/lib/xfig/Basic/MAKE_COMPONENT Index: mttroot/mtt/lib/xfig/Basic/MAKE_COMPONENT ================================================================== --- mttroot/mtt/lib/xfig/Basic/MAKE_COMPONENT +++ mttroot/mtt/lib/xfig/Basic/MAKE_COMPONENT @@ -1,22 +0,0 @@ -#!/bin/sh -## Makes a new component - -if [ -z "$2" ]; then - label=$1 -else - label=$2 -fi - -case $1 in - 0) - echo Making new component $1 with no label - sed "s/TEXT/$1/" $1.fig - ;; - 1) - echo Making new component $1 with no label - sed "s/TEXT/$1/" $1.fig - ;; - *) - echo Making new component $1 with label $label - sed "s/TEXT/$1:$label/" $1.fig -esac DELETED mttroot/mtt/lib/xfig/Basic/MAKE_COMPONENTS Index: mttroot/mtt/lib/xfig/Basic/MAKE_COMPONENTS ================================================================== --- mttroot/mtt/lib/xfig/Basic/MAKE_COMPONENTS +++ mttroot/mtt/lib/xfig/Basic/MAKE_COMPONENTS @@ -1,28 +0,0 @@ -#!/bin/sh -## Makes all components - -./MAKE_COMPONENT R r_1 -./MAKE_COMPONENT C c_1 -./MAKE_COMPONENT I i_1 - -./MAKE_COMPONENT 0 -./MAKE_COMPONENT 1 - -./MAKE_COMPONENT SS ss_1 -./MAKE_COMPONENT Se se_1 -./MAKE_COMPONENT Sf sf_1 -./MAKE_COMPONENT De de_1 -./MAKE_COMPONENT Df df_1 - -./MAKE_COMPONENT TF tf_1 -./MAKE_COMPONENT GY gy_1 -./MAKE_COMPONENT AE ae_1 -./MAKE_COMPONENT AEf aef_1 -./MAKE_COMPONENT AF af_1 -./MAKE_COMPONENT AFe afe_1 - - -./MAKE_COMPONENT EMTF emtf_1 -./MAKE_COMPONENT INTF intf_1 - -./MAKE_COMPONENT Subsystem sub_1 DELETED mttroot/mtt/lib/xfig/Basic/OutPort.fig Index: mttroot/mtt/lib/xfig/Basic/OutPort.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/OutPort.fig +++ mttroot/mtt/lib/xfig/Basic/OutPort.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 0 4 100 0 18 18 0.0000 4 270 1065 1890 855 SS:[out]\001 DELETED mttroot/mtt/lib/xfig/Basic/Port.fig Index: mttroot/mtt/lib/xfig/Basic/Port.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/Port.fig +++ mttroot/mtt/lib/xfig/Basic/Port.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 4 100 0 18 18 0.0000 4 300 1620 1890 855 SS:[port_1]\001 DELETED mttroot/mtt/lib/xfig/Basic/PortLabel.fig Index: mttroot/mtt/lib/xfig/Basic/PortLabel.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/PortLabel.fig +++ mttroot/mtt/lib/xfig/Basic/PortLabel.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 4 100 0 18 14 0.0000 4 210 825 855 630 [port_1]\001 DELETED mttroot/mtt/lib/xfig/Basic/PortLabel.txt Index: mttroot/mtt/lib/xfig/Basic/PortLabel.txt ================================================================== --- mttroot/mtt/lib/xfig/Basic/PortLabel.txt +++ mttroot/mtt/lib/xfig/Basic/PortLabel.txt @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 4 100 0 18 14 0.0000 4 210 825 855 630 [port_1]\001 DELETED mttroot/mtt/lib/xfig/Basic/R.fig Index: mttroot/mtt/lib/xfig/Basic/R.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/R.fig +++ mttroot/mtt/lib/xfig/Basic/R.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 R:r_1\001 DELETED mttroot/mtt/lib/xfig/Basic/SS.fig Index: mttroot/mtt/lib/xfig/Basic/SS.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/SS.fig +++ mttroot/mtt/lib/xfig/Basic/SS.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 SS:ss_1\001 DELETED mttroot/mtt/lib/xfig/Basic/Se.fig Index: mttroot/mtt/lib/xfig/Basic/Se.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/Se.fig +++ mttroot/mtt/lib/xfig/Basic/Se.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 Se:se_1\001 DELETED mttroot/mtt/lib/xfig/Basic/Sf.fig Index: mttroot/mtt/lib/xfig/Basic/Sf.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/Sf.fig +++ mttroot/mtt/lib/xfig/Basic/Sf.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 Sf:sf_1\001 DELETED mttroot/mtt/lib/xfig/Basic/Subsystem.fig Index: mttroot/mtt/lib/xfig/Basic/Subsystem.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/Subsystem.fig +++ mttroot/mtt/lib/xfig/Basic/Subsystem.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 Subsystem:sub_1\001 DELETED mttroot/mtt/lib/xfig/Basic/TF.fig Index: mttroot/mtt/lib/xfig/Basic/TF.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/TF.fig +++ mttroot/mtt/lib/xfig/Basic/TF.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 TF:tf_1\001 DELETED mttroot/mtt/lib/xfig/Basic/blue-box.fig Index: mttroot/mtt/lib/xfig/Basic/blue-box.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/blue-box.fig +++ mttroot/mtt/lib/xfig/Basic/blue-box.fig @@ -1,11 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 4 1 2 1 7 101 0 -1 6.000 0 0 7 0 0 5 - 3825 2700 450 2700 450 450 3825 450 3825 2700 DELETED mttroot/mtt/lib/xfig/Basic/bond.fig Index: mttroot/mtt/lib/xfig/Basic/bond.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/bond.fig +++ mttroot/mtt/lib/xfig/Basic/bond.fig @@ -1,11 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 3 - 900 675 2250 675 2025 900 DELETED mttroot/mtt/lib/xfig/Basic/gold-box.fig Index: mttroot/mtt/lib/xfig/Basic/gold-box.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/gold-box.fig +++ mttroot/mtt/lib/xfig/Basic/gold-box.fig @@ -1,11 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 4 0 2 31 7 101 0 -1 0.000 0 0 7 0 0 5 - 3825 2700 450 2700 450 450 3825 450 3825 2700 DELETED mttroot/mtt/lib/xfig/Basic/halfstroke.fig Index: mttroot/mtt/lib/xfig/Basic/halfstroke.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/halfstroke.fig +++ mttroot/mtt/lib/xfig/Basic/halfstroke.fig @@ -1,11 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 1350 1125 1350 1350 DELETED mttroot/mtt/lib/xfig/Basic/stroke.fig Index: mttroot/mtt/lib/xfig/Basic/stroke.fig ================================================================== --- mttroot/mtt/lib/xfig/Basic/stroke.fig +++ mttroot/mtt/lib/xfig/Basic/stroke.fig @@ -1,11 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 100 0 -1 0.000 0 0 -1 0 0 2 - 675 675 675 1125 DELETED mttroot/mtt/lib/xfig/Basic/template.txt Index: mttroot/mtt/lib/xfig/Basic/template.txt ================================================================== --- mttroot/mtt/lib/xfig/Basic/template.txt +++ mttroot/mtt/lib/xfig/Basic/template.txt @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 TEXT\001 DELETED mttroot/mtt/lib/xfig/Thermal/CT.fig Index: mttroot/mtt/lib/xfig/Thermal/CT.fig ================================================================== --- mttroot/mtt/lib/xfig/Thermal/CT.fig +++ mttroot/mtt/lib/xfig/Thermal/CT.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 CT:ct_1\001 DELETED mttroot/mtt/lib/xfig/Thermal/MAKE_COMPONENT Index: mttroot/mtt/lib/xfig/Thermal/MAKE_COMPONENT ================================================================== --- mttroot/mtt/lib/xfig/Thermal/MAKE_COMPONENT +++ mttroot/mtt/lib/xfig/Thermal/MAKE_COMPONENT @@ -1,16 +0,0 @@ -#!/bin/sh -## Makes a new component - -if [ -z "$2" ]; then - label=$1 -else - label=$2 -fi - -if [ "$1" = "0" ]||[ "$1" = "1" ]; then - echo Making new component $1 with no label - sed "s/TEXT/$1/" $1.fig -else - echo Making new component $1 with label $label - sed "s/TEXT/$1:$label/" $1.fig -fi DELETED mttroot/mtt/lib/xfig/Thermal/MAKE_COMPONENTS Index: mttroot/mtt/lib/xfig/Thermal/MAKE_COMPONENTS ================================================================== --- mttroot/mtt/lib/xfig/Thermal/MAKE_COMPONENTS +++ mttroot/mtt/lib/xfig/Thermal/MAKE_COMPONENTS @@ -1,7 +0,0 @@ -#!/bin/sh -## Makes all components - -./MAKE_COMPONENT RS rs_1 -./MAKE_COMPONENT RT rt_1 -./MAKE_COMPONENT CT ct_1 - DELETED mttroot/mtt/lib/xfig/Thermal/RS.fig Index: mttroot/mtt/lib/xfig/Thermal/RS.fig ================================================================== --- mttroot/mtt/lib/xfig/Thermal/RS.fig +++ mttroot/mtt/lib/xfig/Thermal/RS.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 RS:rs_1\001 DELETED mttroot/mtt/lib/xfig/Thermal/RT.fig Index: mttroot/mtt/lib/xfig/Thermal/RT.fig ================================================================== --- mttroot/mtt/lib/xfig/Thermal/RT.fig +++ mttroot/mtt/lib/xfig/Thermal/RT.fig @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 RT:rt_1\001 DELETED mttroot/mtt/lib/xfig/Thermal/template.txt Index: mttroot/mtt/lib/xfig/Thermal/template.txt ================================================================== --- mttroot/mtt/lib/xfig/Thermal/template.txt +++ mttroot/mtt/lib/xfig/Thermal/template.txt @@ -1,10 +0,0 @@ -#FIG 3.2 -Portrait -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 1 0 100 0 18 18 0.0000 4 285 765 900 765 TEXT\001 DELETED mttroot/mtt/lib/xfig/libs.txt Index: mttroot/mtt/lib/xfig/libs.txt ================================================================== --- mttroot/mtt/lib/xfig/libs.txt +++ mttroot/mtt/lib/xfig/libs.txt @@ -1,4 +0,0 @@ -/home/peterg/mtt_new/mtt/lib/xfig/Basic Basic -/home/peterg/mtt_new/mtt/lib/comp/compound/Electrical Electrical -/home/peterg/mtt_new/mtt/lib/comp/compound/Thermal Thermal - DELETED mttroot/ntt/COPYING Index: mttroot/ntt/COPYING ================================================================== --- mttroot/ntt/COPYING +++ mttroot/ntt/COPYING @@ -1,358 +0,0 @@ - - ntt: new transformation tools for using bond graphs with Matlab - Copyright (C) 2003 Dr. Dominic J. Diston - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -^L - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. DELETED mttroot/ntt/bin/make_abg.m Index: mttroot/ntt/bin/make_abg.m ================================================================== --- mttroot/ntt/bin/make_abg.m +++ mttroot/ntt/bin/make_abg.m @@ -1,57 +0,0 @@ -function abg = make_abg(system) -global mtt_environment - -start_time = mttGetTime ; - -input = [] ; -abg = [] ; - - -switch class(system) -case 'char', - input = 'spec' ; -case 'struct', - if isfield(system,'representation') - input = system.representation ; - end -end - - -if strcmp(input,'spec') - mttWriteNewLine ; - mttNotify('Making "abg" representation') ; - mttWriteNewLine ; - - if isempty(mtt_environment) - mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; - mttWriteNewLine ; - mttNotify(' => paths will not be recognised') ; - mttWriteNewLine ; - end - - abg = mttCreateAcausalBondgraph(system) ; - input = 'abg' ; -end - -mttAssert(strcmp(input,'abg'),'Input representation not recognised') ; - -if isempty(abg) - mttWriteNewLine ; - mttNotify('Copying "abg" representation') ; - mttWriteNewLine ; - - mttNotify('...INFO: Input already defined as a "abg": copying to Output') ; - mttWriteNewLine ; - mttWriteNewLine ; - abg = system ; -end - - -elapsed_time = mttElapseTime(start_time) ; -cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; - -mttWriteNewLine ; -mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; -mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; -mttWriteNewLine ; -mttWriteNewLine ; DELETED mttroot/ntt/bin/make_cbg.m Index: mttroot/ntt/bin/make_cbg.m ================================================================== --- mttroot/ntt/bin/make_cbg.m +++ mttroot/ntt/bin/make_cbg.m @@ -1,70 +0,0 @@ -function cbg = make_cbg(system) -global mtt_environment - -start_time = mttGetTime ; - -input = [] ; -abg = [] ; -cbg = [] ; - - -switch class(system) -case 'char', - input = 'spec' ; -case 'struct', - if isfield(system,'representation') - input = system.representation ; - end -end - - -if strcmp(input,'spec') - mttWriteNewLine ; - mttNotify('Making "abg" representation') ; - mttWriteNewLine ; - - if isempty(mtt_environment) - mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; - mttWriteNewLine ; - mttNotify(' => paths will not be recognised') ; - mttWriteNewLine ; - end - - abg = mttCreateAcausalBondgraph(system) ; - input = 'abg' ; -end - -if strcmp(input,'abg') - if isempty(abg) - abg = system ; - end - - mttWriteNewLine ; - mttNotify('Transforming from "abg" to "cbg"') ; - mttWriteNewLine ; - cbg = mttCreateCausalBondgraph(abg) ; - input = 'cbg' ; -end - -mttAssert(strcmp(input,'cbg'),'Input representation not recognised') ; - -if isempty(cbg) - mttWriteNewLine ; - mttNotify('Copying "cbg" representation') ; - mttWriteNewLine ; - - mttNotify('...INFO: Input already defined as a "cbg": copying to Output') ; - mttWriteNewLine ; - mttWriteNewLine ; - cbg = system ; -end - - -elapsed_time = mttElapseTime(start_time) ; -cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; - -mttWriteNewLine ; -mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; -mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; -mttWriteNewLine ; -mttWriteNewLine ; DELETED mttroot/ntt/bin/make_env.m Index: mttroot/ntt/bin/make_env.m ================================================================== --- mttroot/ntt/bin/make_env.m +++ mttroot/ntt/bin/make_env.m @@ -1,52 +0,0 @@ -function make_env(system) -global mtt_environment - -start_time = mttGetTime ; - -input = [] ; -env = [] ; - - -switch class(system) -case 'char', - input = 'spec' ; -case 'struct', - if isfield(system,'representation') - input = system.representation ; - end -end - -if strcmp(input,'spec') - mttWriteNewLine ; - mttNotify('Making "env" representation') ; - mttWriteNewLine ; - - env = mttCreateEnvironment(system) ; - input = 'env' ; -end - -mttAssert(strcmp(input,'env'),'Input representation not recognised') ; - -if isempty(env) - mttWriteNewLine ; - mttNotify('Copying "env" representation') ; - mttWriteNewLine ; - - mttNotify('...INFO: Input already defined as a "env": copying to Output') ; - mttWriteNewLine ; - mttWriteNewLine ; - env = system ; -end - - -elapsed_time = mttElapseTime(start_time) ; -cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; - -mttWriteNewLine ; -mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; -mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; -mttWriteNewLine ; -mttWriteNewLine ; - - -mtt_environment = env ; DELETED mttroot/ntt/bin/make_ese.m Index: mttroot/ntt/bin/make_ese.m ================================================================== --- mttroot/ntt/bin/make_ese.m +++ mttroot/ntt/bin/make_ese.m @@ -1,84 +0,0 @@ -function ese = make_ese(system,sorter_on) -global mtt_environment - -if nargin<2 - sorter_on = 1 ; -end - -switch class(system) -case 'char', - input = 'spec' ; -case 'struct', - if isfield(system,'representation') - input = system.representation ; - end -end - -start_time = mttGetTime ; - -abg = [] ; -cbg = [] ; -ese = [] ; - -if strcmp(input,'spec') - mttWriteNewLine ; - mttNotify('Making "abg" representation') ; - mttWriteNewLine ; - - if isempty(mtt_environment) - mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; - mttWriteNewLine ; - mttNotify(' => paths will not be recognised') ; - mttWriteNewLine ; - end - - abg = mttCreateAcausalBondgraph(system) ; - input = 'abg' ; -end - -if strcmp(input,'abg') - if isempty(abg) - abg = system ; - end - - mttWriteNewLine ; - mttNotify('Transforming from "abg" to "cbg"') ; - mttWriteNewLine ; - cbg = mttCreateCausalBondgraph(abg) ; - input = 'cbg' ; -end - -if strcmp(input,'cbg') - if isempty(cbg) - cbg = system ; - end - - mttWriteNewLine ; - mttNotify('Transforming from "cbg" to "ese"') ; - mttWriteNewLine ; - ese = mttCreateElementaryEquations(cbg,sorter_on) ; - input = 'ese' ; -end - -mttAssert(strcmp(input,'ese'),'Input representation not recognised') ; - -if isempty(ese) - mttWriteNewLine ; - mttNotify('Making "ese" representation') ; - mttWriteNewLine ; - - mttNotify('Input already defined as a "ese": copying to Output') ; - mttWriteNewLine ; - mttWriteNewLine ; - ese = system ; -end - - -elapsed_time = mttElapseTime(start_time) ; -cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; - -mttWriteNewLine ; -mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; -mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; -mttWriteNewLine ; -mttWriteNewLine ; DELETED mttroot/ntt/bin/make_mdl.m Index: mttroot/ntt/bin/make_mdl.m ================================================================== --- mttroot/ntt/bin/make_mdl.m +++ mttroot/ntt/bin/make_mdl.m @@ -1,78 +0,0 @@ -function make_sfun(system,sorter_on) -global mtt_environment - -if nargin<2 - sorter_on = 1 ; -end - -switch class(system) -case 'char', - input = 'spec' ; -case 'struct', - if isfield(system,'representation') - input = system.representation ; - end -end - -start_time = mttGetTime ; - -abg = [] ; -cbg = [] ; -ese = [] ; - -if strcmp(input,'spec') - mttWriteNewLine ; - mttNotify('Making "abg" representation') ; - mttWriteNewLine ; - - if isempty(mtt_environment) - mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; - mttWriteNewLine ; - mttNotify(' => paths will not be recognised') ; - mttWriteNewLine ; - end - - abg = mttCreateAcausalBondgraph(system) ; - input = 'abg' ; -end - -if strcmp(input,'abg') - if isempty(abg) - abg = system ; - end - - mttWriteNewLine ; - mttNotify('Transforming from "abg" to "cbg"') ; - mttWriteNewLine ; - cbg = mttCreateCausalBondgraph(abg) ; - input = 'cbg' ; -end - -if strcmp(input,'cbg') - if isempty(cbg) - cbg = system ; - end - - mttWriteNewLine ; - mttNotify('Transforming from "cbg" to "ese"') ; - mttWriteNewLine ; - ese = mttCreateElementaryEquations(cbg,sorter_on) ; - input = 'ese' ; -end - -mttAssert(strcmp(input,'ese'),'Input representation not recognised') ; - -if isempty(ese) - ese = system ; -end -mttCreateSystemMdl(ese) ; - - -elapsed_time = mttElapseTime(start_time) ; -cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; - -mttWriteNewLine ; -mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; -mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; -mttWriteNewLine ; -mttWriteNewLine ; DELETED mttroot/ntt/bin/make_sfun.m Index: mttroot/ntt/bin/make_sfun.m ================================================================== --- mttroot/ntt/bin/make_sfun.m +++ mttroot/ntt/bin/make_sfun.m @@ -1,85 +0,0 @@ -function make_sfun(system,sorter_on) -global mtt_environment - -if nargin<2 - sorter_on = 1 ; -end - -switch class(system) -case 'char', - input = 'spec' ; -case 'struct', - if isfield(system,'representation') - input = system.representation ; - end -end - -start_time = mttGetTime ; - -abg = [] ; -cbg = [] ; -ese = [] ; - -if strcmp(input,'spec') - mttWriteNewLine ; - mttNotify('Making "abg" representation') ; - mttWriteNewLine ; - - if isempty(mtt_environment) - mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; - mttWriteNewLine ; - mttNotify(' => paths will not be recognised') ; - mttWriteNewLine ; - end - - abg = mttCreateAcausalBondgraph(system) ; - input = 'abg' ; -end - -if strcmp(input,'abg') - if isempty(abg) - abg = system ; - end - - mttWriteNewLine ; - mttNotify('Transforming from "abg" to "cbg"') ; - mttWriteNewLine ; - cbg = mttCreateCausalBondgraph(abg) ; - input = 'cbg' ; -end - -if strcmp(input,'cbg') - if isempty(cbg) - cbg = system ; - end - - mttWriteNewLine ; - mttNotify('Transforming from "cbg" to "ese"') ; - mttWriteNewLine ; - ese = mttCreateElementaryEquations(cbg,sorter_on) ; - input = 'ese' ; -end - -mttAssert(strcmp(input,'ese'),'Input representation not recognised') ; - -if isempty(ese) - ese = system ; -end -mttWriteSystemEquations(ese) ; -mttWriteSystemDefinitions(ese) ; -mttWriteSystemInitialisation(ese) ; -mttWriteSystemMapping(ese) ; - -ese = mttCreateApps(ese) ; -mttWriteSystemApps(ese) ; -mttWriteSystemSfun(ese) ; - - -elapsed_time = mttElapseTime(start_time) ; -cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; - -mttWriteNewLine ; -mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; -mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; -mttWriteNewLine ; -mttWriteNewLine ; DELETED mttroot/ntt/bin/trans/m/mttApplyInterfaceCausality.m Index: mttroot/ntt/bin/trans/m/mttApplyInterfaceCausality.m ================================================================== --- mttroot/ntt/bin/trans/m/mttApplyInterfaceCausality.m +++ mttroot/ntt/bin/trans/m/mttApplyInterfaceCausality.m @@ -1,200 +0,0 @@ -function model = mttApplyInterfaceCausality(model,specified_rule,branch) ; - is_root_model = (nargin==2) ; - - objects = mttGetFieldNames(model,'obj') ; - - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - if isfield(object,'obj') - if is_root_model - branch = object_name ; - else - branch = [branch,'/',object_name] ; - end - - object = mttApplyInterfaceCausality(object,specified_rule,branch) ; - model = setfield(model,'obj',object_name,object) ; - - else - if ~isempty(object.cr) - if is_root_model - branch = mttDetachText(model.source,'/') ; - end - here = [branch,':',object_name] ; - - port_names = mttGetFieldNames(object.cr.interface,'port') ; - - for j = 1:length(port_names) - port_name = port_names{j} ; - port = getfield(object.cr.interface,'port',port_name) ; - - inbond = port.in ; - outbond = port.out ; - - for k = 1:mttGetFieldLength(port,'causality') - rule = port.causality(k).rule ; - definition = port.causality(k).def ; - association = port.causality(k).with ; - not_applied = ~port.causality(k).applied ; - - switch rule - case 'assert', is_assertion = 1 ; - case 'prefer', is_assertion = 0 ; - otherwise - error(['Unrecognised rule "',port_causality.rule,'" in ',here]) ; - end - - apply_rule = strcmp(specified_rule,rule) & not_applied ; - if apply_rule - - switch definition -% case 'effort_state', -% mttAssert(mttIsEqual(port.is_flow_state,0),... -% ['Attempt to overwrite state assignment at port "',port_name,'" in ',here]) ; -% port.is_effort_state = 1 ; - -% case 'flow_state', -% mttAssert(mttIsEqual(port.is_effort_state,0),... -% ['Attempt to overwrite state assignment at port "',port_name,'" in ',here]) ; -% port.is_flow_state = 1 ; - - case {'effort_in_flow_out','flow_in_effort_out','flow_out_effort_in','effort_out_flow_in'} - mttAssert(isempty(association),... - ['Over-constraint at port "',port_name,'" in ',here]) ; - - switch definition - case {'effort_in_flow_out','flow_out_effort_in'}, - [model,inbond_ok] = mttUpdateBondCausality(model,inbond,1,1,1) ; - [model,outbond_ok] = mttUpdateBondCausality(model,outbond,0,0,1) ; - case {'flow_in_effort_out','effort_out_flow_in'}, - [model,inbond_ok] = mttUpdateBondCausality(model,inbond,0,0,1) ; - [model,outbond_ok] = mttUpdateBondCausality(model,outbond,1,1,1) ; - end - - ok = inbond_ok & outbond_ok ; - if is_assertion - mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; - end - - case 'effort_in' - mttAssert(isempty(association),... - ['Over-constraint at port "',port_name,'" in ',here]) ; - - [model,inbond_ok] = mttUpdateBondCausality(model,inbond,1,[],1) ; - [model,outbond_ok] = mttUpdateBondCausality(model,outbond,0,[],1) ; - - ok = inbond_ok & outbond_ok ; - if is_assertion - mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; - end - - case 'effort_out' - mttAssert(isempty(association),... - ['Over-constraint at port "',port_name,'" in ',here]) ; - - [model,inbond_ok] = mttUpdateBondCausality(model,inbond,0,[],1) ; - [model,outbond_ok] = mttUpdateBondCausality(model,outbond,1,[],1) ; - - ok = inbond_ok & outbond_ok ; - if is_assertion - mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; - end - - case 'flow_in' - mttAssert(isempty(association),... - ['Over-constraint at port "',port_name,'" in ',here]) ; - - [model,inbond_ok] = mttUpdateBondCausality(model,inbond,[],0,1) ; - [model,outbond_ok] = mttUpdateBondCausality(model,outbond,[],1,1) ; - - ok = inbond_ok & outbond_ok ; - if is_assertion - mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; - end - - case 'flow_out' - mttAssert(isempty(association),... - ['Over-constraint at port "',port_name,'" in ',here]) ; - - [model,inbond_ok] = mttUpdateBondCausality(model,inbond,[],1,1) ; - [model,outbond_ok] = mttUpdateBondCausality(model,outbond,[],0,1) ; - - ok = inbond_ok & outbond_ok ; - if is_assertion - mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; - end - - case 'unicausal', - mttAssert(isempty(association),... - ['Over-constraint at port "',port_name,'" in ',here]) ; - - [model,inbond_ok] = mttUpdateBondCausality(model,inbond,[],[],1) ; - [model,outbond_ok] = mttUpdateBondCausality(model,outbond,[],[],1) ; - - ok = inbond_ok & outbond_ok ; - if is_assertion - mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; - end - - case {'equicausal','anticausal'} - mttAssert(length(association)==1,... - ['Incorrect constraint at port "',port_name,'" in ',here]) ; - - associated_port_name = association{1} ; - associated_port = getfield(cr.interface,'port',associated_port_name) ; - - associated_inbond = associated_port.in ; - associated_outbond = associated_port.out ; - - mttAsert(xor(isempty(inbond),isempty(outbond)),... - ['Causal rule expects unique bond at port "',port_name,'" in ',here]) ; - mttAsert(xor(isempty(associated_inbond),isempty(associated_outbond)),... - ['Causal rule expects unique bond at port "',associated_port_name,'" in ',here]) ; - - if isempty(associated_inbond) - a = associated_outbond ; - else - a = associated_inbond ; - end - - if isempty(inbond) - b = outbond ; - else - b = inbond ; - end - - switch definition - case 'equicausal', - [model,bond_ok] = mttUpdateBondCausality(model,b,... - model.bond(a).effort,model.bond(a).flow,model.bond(a).unicausal) ; - [model,associated_bond_ok] = mttUpdateBondCausality(model,a,... - model.bond(b).effort,~model.bond(b).flow,model.bond(b).unicausal) ; - case 'anticausal', - [model,bond_ok] = mttUpdateBondCausality(model,b,... - ~model.bond(a).effort,model.bond(a).flow,model.bond(a).unicausal) ; - [model,associated_bond_ok] = mttUpdateBondCausality(model,a,... - ~model.bond(b).effort,~model.bond(b).flow,model.bond(b).unicausal) ; - end - - ok = bond_ok & associated_bond_ok ; - if is_assertion - mttAssert(ok,['Causal conflict between ports "',port_name,... - 'and',associated_port_name,'" in ',here]) ; - end - - otherwise, - error(['Unrecognised constraint "',definition,'" in ',here]) ; - end - - port.causality(k).applied = 1 ; - object = setfield(object,'cr','interface','port',port_name,port) ; - model = setfield(model,'obj',object_name,object) ; - end - end - end - end - end - end - DELETED mttroot/ntt/bin/trans/m/mttApplyInterfaceDomains.m Index: mttroot/ntt/bin/trans/m/mttApplyInterfaceDomains.m ================================================================== --- mttroot/ntt/bin/trans/m/mttApplyInterfaceDomains.m +++ mttroot/ntt/bin/trans/m/mttApplyInterfaceDomains.m @@ -1,52 +0,0 @@ -function model = mttApplyInterfaceDomains(model,branch) ; - is_root_model = (nargin==1) ; - - objects = mttGetFieldNames(model,'obj') ; - - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - if isfield(object,'obj') - if is_root_model - branch = object_name ; - else - branch = [branch,'/',object_name] ; - end - - object = mttApplyInterfaceDomains(object,branch) ; - model = setfield(model,'obj',object_name,object) ; - - else - if ~isempty(object.cr) - if is_root_model - branch = mttDetachText(model.source,'/') ; - end - here = [branch,':',object_name] ; - - port_names = mttGetFieldNames(object.cr.interface,'port') ; - - for j = 1:length(port_names) - port_name = port_names{j} ; - port = getfield(object.cr.interface,'port',port_name) ; - - predefined_domain = port.domain ; - predefined_domain_item = port.domain_item ; - - inbond = port.in ; - outbond = port.out ; - - if isempty(inbond) - bond_number = outbond ; - else - bond_number = inbond ; - end - - [model,ok] = mttUpdateBondDomain(model,bond_number,predefined_domain,predefined_domain_item) ; - - mttAssert(ok,['Domain conflict at port "',port_name,'" in ',here]) ; - end - end - end - end - DELETED mttroot/ntt/bin/trans/m/mttCreateAcausalBondgraph.m Index: mttroot/ntt/bin/trans/m/mttCreateAcausalBondgraph.m ================================================================== --- mttroot/ntt/bin/trans/m/mttCreateAcausalBondgraph.m +++ mttroot/ntt/bin/trans/m/mttCreateAcausalBondgraph.m @@ -1,131 +0,0 @@ -function model = mttCreateAcausalBondgraph(system,root) -global mtt_environment - - -switch nargin -case 0, - model = [] ; return ; -case 1, - root = [] ; - is_root_model = 1 ; -otherwise, - is_root_model = 0 ; -end - -if is_root_model - model = intialise_model(system) ; - - directory_name = identify_directory_name(system) ; - source_name = identify_source_name(system,directory_name) ; - - mttNotify('...acquiring "abg" source definitions') ; - mttWriteNewLine ; -else - model = propagate_root_data(root) ; - source_name = system ; -end - -specification_filename = [source_name,'_abg.txt'] ; -specification = mttFetchSpecification(specification_filename) ; -specification = mttSetFieldDefault(specification,'bondgraph',system) ; - -[local_system_name,rubbish] = mttDetachText(system,'/') ; -if isempty(local_system_name) - local_system_name = system ; -end - - -if is_root_model - source_name = identify_source_name(specification.bondgraph,directory_name) ; -else - source_name = specification.bondgraph ; -end -source_name = mttCutText(source_name,'_abg.fig') ; - -bondgraph_filename = [source_name,'_abg.fig'] ; -bondgraph = mttFetchBondgraph(bondgraph_filename) ; - -model = mttCreateUnifiedModel(model,bondgraph,specification) ; -model = mttDeleteField(model,'branch') ; -model = mttDeleteField(model,'leaf') ; - - -if is_root_model - mttWriteNewLine ; - mttNotify('...acquiring "cr" source definitions') ; - mttWriteNewLine ; - - for n = 1:length(model.crs) - source_name = model.crs{n} ; - cr_filename = [source_name,'_cr.txt'] ; - - if ~mttFileExists(cr_filename) - cr_short_name = mttDetachText(source_name,'/') ; - - mttNotify([' ...ERROR: "',cr_short_name,'_cr" source does not exist']) ; - mttWriteNewLine ; - mttNotify([' ...finding dependencies for ',source_name,':']) ; - mttWriteNewLine ; - - prefix = mttDetachText(system,'/') ; - if isempty(prefix) - prefix = system ; - end - - cr_user = model.cr_usage(n).obj ; - for i = 1:length(cr_user) - mttNotify([' ',prefix,'/',cr_user{i}]) ; - mttWriteNewLine ; - end - end - - model.cr(n) = mttFetchInterfaceDefinition(cr_filename) ; - end - - model = mttDeleteField(model,'cr_usage') ; - model = mttDeleteField(model,'crs') ; - model = mttDeleteField(model,'abgs') ; -end - -model.env = mtt_environment ; - - - -function model = intialise_model(system) - model.representation = 'abg' ; - model.abgs = [] ; - model.crs = [] ; - model.cr_usage = [] ; - model.branch = [] ; - model.leaf = [] ; - -function model = propagate_root_data(root) - model.abgs = root.abgs ; - model.crs = root.crs ; - model.cr_usage = root.cr_usage ; - model.branch = root.branch ; - model.leaf = root.leaf ; - -function directory = identify_directory_name(system) - mttAssert(ischar(system),'System must be specified by name') ; - working_directory = pwd ; - working_directory = strrep(working_directory,'\','/') ; - - [system_name,local_directory] = mttDetachText(system,'/') ; - if isempty(system_name) - local_directory = [] ; - end - - if isempty(local_directory) - directory = working_directory ; - else - directory = mttLocateDirectory(working_directory,local_directory) ; - end - -function source = identify_source_name(system,directory) - [system_name,local_directory] = mttDetachText(system,'/') ; - if isempty(system_name) - system_name = system ; - local_directory = [] ; - end - source = [directory,'/',system_name] ; DELETED mttroot/ntt/bin/trans/m/mttCreateApps.m Index: mttroot/ntt/bin/trans/m/mttCreateApps.m ================================================================== --- mttroot/ntt/bin/trans/m/mttCreateApps.m +++ mttroot/ntt/bin/trans/m/mttCreateApps.m @@ -1,72 +0,0 @@ -function model = mttCreateApps(model) - -apps_filename = [model.source,'_apps.txt'] ; -apps = mttFetchApps(apps_filename) ; - -if isempty(apps) - return ; -end - -for i = 1:length(apps.app) - app_source = apps.app{i} ; - - [rubbish,working_directory] = mttDetachText(model.source,'/') ; - [name,path_spec] = mttDetachText(app_source,'/') ; - - if isempty(name) - source_name = [working_directory,'/',domain_source] ; - else - directory = identify_directory(working_directory,path_spec,model) ; - source_name = [directory,'/',name] ; - end - - app_filename = [source_name,'_app.h'] ; - model.app{i} = app_filename ; -end - - -function directory = identify_directory(working_directory,path_spec,model) - path_names = mttGetFieldNames(model.env,'path') ; - - if isempty(path_spec) - directory = [] ; - else - if path_spec(1)=='$' - [path_alias,path_branch] = mttCutText(path_spec,'/') ; - path_alias(1) = [] ; - - mttAssert(ismember(path_alias,path_names),... - ['Path "',path_alias,'" not recognised']) ; - - path_root = getfield(model.env,'path',path_alias) ; - - if isempty(path_branch) - directory = path_root ; - else - directory = [path_root,'/',path_branch] ; - end - else - [name,local_directory] = mttDetachText(path_spec,'/') ; - - directory_located = 0 ; - if strcmp(local_directory,'.') - if isempty(name) - directory = working_directory ; - directory_located = 1 ; - else - local_directory = name ; - end - else - local_directory = path_spec ; - end - - if ~directory_located - directory = mttLocateDirectory(working_directory,local_directory) ; - end - end - end - - - - - DELETED mttroot/ntt/bin/trans/m/mttCreateCausalBondgraph.m Index: mttroot/ntt/bin/trans/m/mttCreateCausalBondgraph.m ================================================================== --- mttroot/ntt/bin/trans/m/mttCreateCausalBondgraph.m +++ mttroot/ntt/bin/trans/m/mttCreateCausalBondgraph.m @@ -1,452 +0,0 @@ -function model = mttCreateCausalBondgraph(model) - -model.representation = 'cbg' ; - -model = incorporate_interface_definitions(model) ; -model = establish_abg_dependencies(model) ; -model = create_object_hierarchy(model) ; -model = assign_sympar_values(model) ; -model = complete_causal_assignment(model) ; -model = complete_domain_assignment(model) ; -model = overwrite_implicit_domains(model) ; - - -function model = incorporate_interface_definitions(model) - mttNotify('...incorporating "cr" definitions') ; - mttWriteNewLine ; - - mttNotify([' ...processing ',model.source]) ; - mttWriteNewLine ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - if ~mttIsFoundationClass(object.class) - mttAssert(xor(isempty(object.abg),isempty(object.cr)),... - ['"',object_name,'" must exclusively have a "cr" or an "abg" representation']) ; - end - - if isempty(object.cr) - object = mttDeleteField(object,'cr_item') ; - model = setfield(model,'obj',object_name,object) ; - else - model = mttEmbedInterfaceDefinition(model,object_name) ; - end - end - - for i = 1:mttGetFieldLength(model,'abg') - component_type = mttDetachText(model.abg(i).source,'/') ; - mttNotify([' ...processing "#',num2str(i),':',component_type,'" ',model.abg(i).source]) ; - mttWriteNewLine ; - - objects = mttGetFieldNames(model.abg(i),'obj') ; - for j = 1:length(objects) - object_name = objects{j} ; - object = getfield(model,'abg',{i},'obj',object_name) ; - - if ~mttIsFoundationClass(object.class) - mttAssert(xor(isempty(object.abg),isempty(object.cr)),... - ['abg[',num2str(i),']: "',object_name,'" must exclusively have a "cr" or an "abg" representation']) ; - end - - if isempty(object.cr) - object = mttDeleteField(object,'cr_item') ; - model = setfield(model,'abg',{i},'obj',object_name,object) ; - else - model.abg(i) = mttEmbedInterfaceDefinition(model.abg(i),object_name,model) ; - end - end - model.abg(i).invokes = [] ; - model.abg(i).invoked_by = [] ; - end - model = mttDeleteField(model,'cr') ; - - -function model = establish_abg_dependencies(model) - mttNotify('...establishing "abg" dependencies') ; - mttWriteNewLine ; - - for i = 1:mttGetFieldLength(model,'abg') - objects = mttGetFieldNames(model.abg(i),'obj') ; - for j = 1:length(objects) - object_name = objects{j} ; - object = getfield(model.abg(i).obj,object_name) ; - - if isempty(object.cr) %... still within object hierarchy - if ~mttIsFoundationClass(object.class) - existing_dependencies = model.abg(i).invokes ; - - if isempty(existing_dependencies) - new_dependency = 1 ; - else - new_dependency = isempty(find(existing_dependencies==object.abg)) ; - end - - if new_dependency - model.abg(i).invokes = [existing_dependencies,object.abg] ; - end - - existing_dependencies = model.abg(object.abg).invoked_by ; - if isempty(existing_dependencies) - new_dependency = 1 ; - else - new_dependency = isempty(find(existing_dependencies==i)) ; - end - - if new_dependency - model.abg(object.abg).invoked_by = [existing_dependencies,i] ; - end - end - end - end - end - - model.invokes = [] ; - - objects = mttGetFieldNames(model,'obj') ; - for j = 1:length(objects) - object_name = objects{j} ; - object = getfield(model.obj,object_name) ; - - if ~isempty(object.abg) - if ~mttIsFoundationClass(object.class) - existing_dependencies = model.invokes ; - - if isempty(existing_dependencies) - new_dependency = 1 ; - else - new_dependency = isempty(find(existing_dependencies==object.abg)) ; - end - - if new_dependency - model.invokes = [existing_dependencies,object.abg] ; - end - end - end - end - - -function model = create_object_hierarchy(model) ; - mttNotify('...creating object hierarchy') ; - mttWriteNewLine ; - - top_level_model = mttDetachText(model.source,'/') ; - - if isfield(model,'abg') - is_embedded = zeros(1,length(model.abg)) ; - embedding = 1 ; - else - embedding = 0 ; - end - - component = 0 ; - - embedding = isfield(model,'abg') ; - while embedding - component = 1 + mod(component,length(model.abg)) ; - if ~is_embedded(component) - if isempty(model.abg(component).invokes) - number_of_systems = length(model.abg(component).invoked_by) ; - - for n = 1:number_of_systems - system = model.abg(component).invoked_by(n) ; - component_type = mttDetachText(model.abg(component).source,'/') ; - system_type = mttDetachText(model.abg(system).source,'/') ; - mttNotify([' ...embedding "#',num2str(component),':',component_type,... - '" definition within "#',num2str(system),':',system_type,'" objects']) ; - mttWriteNewLine ; - - model = mttEmbedAcausalBondgraph(model,component,system) ; - end - model.abg(component).invoked_by = [] ; - - if ~isempty(find(model.invokes==component)) - component_type = mttDetachText(model.abg(component).source,'/') ; - mttNotify([' ...embedding "#',num2str(component),':',component_type,... - '" definition within "',top_level_model,'"']) ; - mttWriteNewLine ; - - model = mttEmbedAcausalBondgraph(model,component) ; - end - is_embedded(component) = 1 ; - end - end - embedding = any(~is_embedded) ; - end - - model = mttDeleteField(model,'abg') ; - model = mttDeleteField(model,'invokes') ; - - -function model = assign_sympar_values(model) - mttNotify('...assigning "sympar" values') ; - mttWriteNewLine ; - - model_name = mttDetachText(model.source,'/') ; - current_branch = model_name ; - - sympars = model.sympar ; - defaults = model.sympar_default ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - if ~mttIsPassiveClass(object.class) - for j = 1:length(object.parameter) - object_parameter = object.parameter{j} ; - if ischar(object_parameter) - index = strmatch(object_parameter,sympars,'exact') ; - - new_parameter = 0 ; - - if isempty(index) - new_parameter = 1 ; - else - default_value = defaults{index} ; - if isempty(default_value) - new_parameter = 1 ; - else - object.parameter{j} = default_value ; - end - end - - if new_parameter - object.parameter{j} = [current_branch,'___',object_parameter] ; - end - end - end - - branch = [model_name,'__',object_name] ; - object = assign_object_sympar_values(object,branch) ; - - model = setfield(model,'obj',object_name,object) ; - end - end - - -function model = assign_object_sympar_values(model,branch) - current_branch = branch ; - - sympars = model.sympar ; - parameters = model.parameter ; - - if ~isempty(model.abg) - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - if ~mttIsPassiveClass(object.class) - for j = 1:length(object.parameter) - object_parameter = object.parameter{j} ; - if ischar(object_parameter) - index = strmatch(object_parameter,sympars,'exact') ; - if isempty(index) - object.parameter{j} = [current_branch,'___',object_parameter] ; - else - object.parameter{j} = parameters{index} ; - end - end - end - - branch = [current_branch,'__',object_name] ; - object = assign_object_sympar_values(object,branch) ; - - model = setfield(model,'obj',object_name,object) ; - end - end - elseif ~isempty(model.cr) - model.cr.parameter = model.parameter ; - end - - -function model = complete_causal_assignment(model) - mttWriteNewLine ; - mttNotify('...summarising model content') ; - mttWriteNewLine ; - - model = mttCountObjects(model) ; - mttNotifyNumberOfObjects(model) ; - mttWriteNewLine ; - model = mttDeleteField(model,'count') ; - - model = mttMeasureCausalCompletion(model) ; - mttNotifyNumberOfBonds(model) ; - mttWriteNewLine ; - - mttWriteNewLine ; - mttNotify('...analysing predefined causality') ; - mttWriteNewLine ; - - mttNotifyCausalCompletion(model) ; - mttWriteNewLine ; - - if model.causal_completion.is_causal - mttNotify('...applying CR constraints') ; - mttWriteNewLine ; - model = incorporate_cr_rules(model,'assert') ; - else - mttNotify('...completing causality') ; - mttWriteNewLine ; - - iterations = 0 ; - - propagating = 1 ; - while propagating - iterations = iterations + 1 ; - previous_causal_completion = model.causal_completion ; - - model = mttApplyInterfaceCausality(model,'assert') ; - model = mttPropagateCausality(model) ; - model = mttApplyInterfaceCausality(model,'prefer') ; - model = mttPropagateCausality(model) ; - model = mttMeasureCausalCompletion(model) ; - - is_stable = mttCompareCausalCompletion(model.causal_completion,previous_causal_completion) ; - propagating = (~is_stable) ; - - if propagating - mttNotify(['...iteration ',num2str(iterations)]) ; - mttWriteNewLine ; - mttNotifyCausalCompletion(model) ; - end - - propagating = propagating & (~model.causal_completion.is_causal) ; - end - end - - - if ~model.causal_completion.is_causal - mttWriteNewLine ; - mttNotify('...causality not complete') ; - mttWriteNewLine ; - mttWriteNewLine ; - - mttIdentifyUndercausalBonds(model) ; - end - - model = mttDeleteField(model,'causal_completion') ; - - -function model = complete_domain_assignment(model) - mttWriteNewLine ; - mttNotify('...allocating domain definitions') ; - mttWriteNewLine ; - - model = mttMeasureDomainCompletion(model) ; - - iterations = 0 ; - - propagating = 1 ; - while propagating - iterations = iterations + 1 ; - previous_domain_completion = model.domain_completion ; - - model = mttApplyInterfaceDomains(model) ; - model = mttPropagateDomains(model) ; - model = mttMeasureDomainCompletion(model) ; - - is_stable = mttCompareDomainCompletion(model.domain_completion,previous_domain_completion) ; - propagating = (~is_stable) ; - - if propagating - mttNotify(['...iteration ',num2str(iterations)]) ; - mttWriteNewLine ; - mttNotifyDomainCompletion(model) ; - end - - propagating = propagating & (~model.domain_completion.is_done) ; - end - - model = mttDeleteField(model,'domain_completion') ; - - -function model = overwrite_implicit_domains(model) - mttWriteNewLine ; - mttNotify('...overwriting implicit domain definitions') ; - mttWriteNewLine ; - - model = mttOverwriteImplicitDomains(model) ; - - -function model = mttOverwriteImplicitDomains(root,model,env) - is_root_model = nargin==1 ; - - if is_root_model - model = root ; - env = root.env ; - end - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - if ~isempty(object.abg) - object = mttOverwriteImplicitDomains(model,object,env) ; - end - - if ~isempty(object.cr) - interface_ports = mttGetFieldNames(object.cr.interface,'port') ; - for j = 1:length(interface_ports) - port_name = interface_ports{j} ; - port = getfield(object.cr.interface,'port',port_name) ; - - if isempty(port.domain) - if isempty(port.in) - bond_number = port.out ; - else - bond_number = port.in ; - end - - actual_domain = model.bond(bond_number).domain ; - actual_domain_item = model.bond(bond_number).domain_item ; - - port.domain = actual_domain ; - port.domain_item = actual_domain_item ; - object.cr.interface = setfield(object.cr.interface,'port',port_name,port) ; - - number_of_operators = mttGetFieldLength(object.cr,'operator') ; - for op_counter = 1:number_of_operators - operator = object.cr.operator(op_counter) ; - - matching_links = strmatch(port_name,{operator.link.name},'exact') ; - - number_of_equations = mttGetFieldLength(operator,'equation') ; - - for eq_counter = 1:number_of_equations - equation = operator.equation(eq_counter) ; -% if isempty(equation.domain) - - number_of_chunks = mttGetFieldLength(equation,'chunk') ; - for chunk_counter = 1:number_of_chunks - chunk = equation.chunk{chunk_counter} ; - - if iscell(chunk) - if strcmp(chunk{1},'link') - link = chunk{2} ; - - if any(link==matching_links) - covar = chunk{3} ; - chunk{3} = ['generic___',covar] ; - end - end - equation.chunk{chunk_counter} = chunk ; - end - end - operator.equation(eq_counter) = equation ; -% end - end - object.cr.operator(op_counter) = operator ; - end - end - end - end - - model = setfield(model,'obj',object_name,object) ; - end - DELETED mttroot/ntt/bin/trans/m/mttCreateElementaryEquations.m Index: mttroot/ntt/bin/trans/m/mttCreateElementaryEquations.m ================================================================== --- mttroot/ntt/bin/trans/m/mttCreateElementaryEquations.m +++ mttroot/ntt/bin/trans/m/mttCreateElementaryEquations.m @@ -1,960 +0,0 @@ -function model = mttCreateElementaryEquations(model,sorter_on) - -model.representation = 'ese' ; - -[model,ese,namelist] = specify_equations(model) ; -if sorter_on - [sse,counter] = sort_equations(ese,model,namelist) ; -else - sse = ese ; - counter = 0 ; -end - -model.equation = sse ; -model.sorted_equations = counter ; -model.namelist = namelist ; - - - -function [model,ese,namelist] = specify_equations(model,branch,root_namelist) - is_root_model = (nargin==1) ; - - if is_root_model - mttNotify('...specifying equations') ; - mttWriteNewLine ; - - branch = mttDetachText(model.source,'/') ; - - name_counter = 1 ; - namelist(name_counter).var = '0' ; - namelist(name_counter).domain = [] ; - namelist(name_counter).domain_item = [] ; - else - namelist = root_namelist ; - name_counter = length(namelist) ; - end - - mttNotify([' ...processing ',branch]) ; - mttWriteNewLine ; - - objects = mttGetFieldNames(model,'obj') ; - - line = 0 ; - - for n = 1:length(objects) - object_name = objects{n} ; - object = getfield(model,'obj',object_name) ; - - here = [branch,':',object_name] ; - - switch object.class - case {'SS','Se','Sf','De','Df'}, - - for j = 1:mttGetFieldLength(object,'interface') - flow_equation = [] ; - effort_equation = [] ; - - terminal = [branch,'__',object_name] ; - - inbond = object.interface(j).in ; - outbond = object.interface(j).out ; - - if ~isempty(inbond) - bond = model.bond(inbond) ; - [specified_domain,specified_domain_item] = mttGetBondDomain(model,inbond) ; - - new_name = 0 ; - - line = line + 1 ; - if bond.flow - if strcmp(object.class,'De') - ese(line) = specify_ese(branch,[2*inbond],branch,{1},[]) ; - else - ese(line) = specify_ese(branch,[2*inbond],branch,{name_counter+1},[]) ; - new_name = 1 ; - end - else - ese(line) = specify_ese(branch,{name_counter+1},branch,[2*inbond],[]) ; - new_name = 1 ; - end - - if new_name - name_counter = name_counter + 1 ; - namelist(name_counter).var = [terminal,'.flow'] ; - namelist(name_counter).domain = specified_domain ; - namelist(name_counter).domain_item = specified_domain_item ; - end - - new_name = 0 ; - - line = line + 1 ; - if bond.effort - ese(line) = specify_ese(branch,{name_counter+1},branch,[2*inbond-1],[]) ; - new_name = 1 ; - else - if strcmp(object.class,'Df') - ese(line) = specify_ese(branch,[2*inbond-1],branch,{1},[]) ; - else - ese(line) = specify_ese(branch,[2*inbond-1],branch,{name_counter+1},[]) ; - new_name = 1 ; - end - end - - if new_name - name_counter = name_counter + 1 ; - namelist(name_counter).var = [terminal,'.effort'] ; - namelist(name_counter).domain = specified_domain ; - namelist(name_counter).domain_item = specified_domain_item ; - end - end - - if ~isempty(outbond) - bond = model.bond(outbond) ; - [specified_domain,specified_domain_item] = mttGetBondDomain(model,outbond) ; - - new_name = 0 ; - - if bond.flow - if ~strcmp(object.class,'Se') - line = line + 1 ; - ese(line) = specify_ese(branch,{name_counter+1},branch,[2*outbond],[]) ; - new_name = 1 ; - end - else - line = line + 1 ; - ese(line) = specify_ese(branch,[2*outbond],branch,{name_counter+1},[]) ; - new_name = 1 ; - end - - if new_name - name_counter = name_counter + 1 ; - namelist(name_counter).var = [terminal,'.flow'] ; - namelist(name_counter).domain = specified_domain ; - namelist(name_counter).domain_item = specified_domain_item ; - end - - new_name = 0 ; - - if bond.effort - line = line + 1 ; - ese(line) = specify_ese(branch,[2*outbond-1],branch,{name_counter+1},[]) ; - new_name = 1 ; - else - if ~strcmp(object.class,'Sf') - line = line + 1 ; - ese(line) = specify_ese(branch,{name_counter+1},branch,[2*outbond-1],[]) ; - new_name = 1 ; - end - end - - if new_name - name_counter = name_counter + 1 ; - namelist(name_counter).var = [terminal,'.effort'] ; - namelist(name_counter).domain = specified_domain ; - namelist(name_counter).domain_item = specified_domain_item ; - end - end - end - - case '0', - - imposed_effort = [] ; - resultant_flow = [] ; - - for i = 1:mttGetFieldLength(object,'interface') - inbond = object.interface(i).in ; - outbond = object.interface(i).out ; - - if isempty(inbond) - bond_number(i) = outbond ; - orientation(i) = 0 ; - else - bond_number(i) = inbond ; - orientation(i) = 1 ; - end - - [effort,flow] = mttGetBondCausality(model,bond_number(i)) ; - - if effort==orientation(i) - imposed_effort = 2*bond_number(i)-1 ; - end - if flow==orientation(i) - resultant_flow = 2*bond_number(i) ; - resultant_orientation = orientation(i) ; - end - end - - for i = 1:mttGetFieldLength(object,'interface') - effort = 2*bond_number(i)-1 ; - if effort~=imposed_effort - derived_effort = effort ; - - line = line + 1 ; - ese(line) = specify_ese(branch,derived_effort,branch,imposed_effort,[]) ; - end - end - - flow_summation = [] ; - for i = 1:mttGetFieldLength(object,'interface') - flow = 2*bond_number(i) ; - - if flow~=resultant_flow - impinging_flow = flow ; - - if orientation(i) - if resultant_orientation - flow_summation = [ flow_summation, -impinging_flow ] ; - else - flow_summation = [ flow_summation, impinging_flow ] ; - end - else - if resultant_orientation - flow_summation = [ flow_summation, impinging_flow ] ; - else - flow_summation = [ flow_summation, -impinging_flow ] ; - end - end - end - end - - line = line + 1 ; - ese(line) = specify_ese(branch,resultant_flow,branch,flow_summation,[]) ; - - case '1', - - imposed_flow = [] ; - resultant_effort = [] ; - - for i = 1:mttGetFieldLength(object,'interface') - inbond = object.interface(i).in ; - outbond = object.interface(i).out ; - - if isempty(inbond) - bond_number(i) = outbond ; - orientation(i) = 0 ; - else - bond_number(i) = inbond ; - orientation(i) = 1 ; - end - - [effort,flow] = mttGetBondCausality(model,bond_number(i)) ; - - if flow~=orientation(i) - imposed_flow = 2*bond_number(i) ; - end - if effort~=orientation(i) - resultant_effort = 2*bond_number(i)-1 ; - resultant_orientation = orientation(i) ; - end - end - - for i = 1:mttGetFieldLength(object,'interface') - flow = 2*bond_number(i) ; - if flow~=imposed_flow - derived_flow = flow ; - - line = line + 1 ; - ese(line) = specify_ese(branch,derived_flow,branch,imposed_flow,[]) ; - end - end - - effort_summation = [] ; - for i = 1:mttGetFieldLength(object,'interface') - effort = 2*bond_number(i)-1 ; - - if effort~=resultant_effort - impinging_effort = effort ; - - if orientation(i) - if resultant_orientation - effort_summation = [ effort_summation, -impinging_effort ] ; - else - effort_summation = [ effort_summation, impinging_effort ] ; - end - else - if resultant_orientation - effort_summation = [ effort_summation, impinging_effort ] ; - else - effort_summation = [ effort_summation, -impinging_effort ] ; - end - end - end - end - - line = line + 1 ; - ese(line) = specify_ese(branch,resultant_effort,branch,effort_summation,[]) ; - - otherwise, - - if ~isempty(object.cr) - interface = object.cr.interface ; - port_names = mttGetFieldNames(interface,'port') ; - number_of_ports = length(port_names) ; - - link_counter = 0 ; - - for i = 1:number_of_ports - port_name = port_names{i} ; - port = getfield(interface,'port',port_name) ; - terminal = [branch,'__',object_name,'___',port_name] ; - - inbond = port.in ; - outbond = port.out ; - - if ~isempty(inbond) - bond = model.bond(inbond) ; - [specified_domain,specified_domain_item] = mttGetBondDomain(model,inbond) ; - - name_counter = name_counter + 1 ; - if port.is_flow_state - namelist(name_counter).var = [terminal,'.flow_state'] ; - else - namelist(name_counter).var = [terminal,'.flow'] ; - end - namelist(name_counter).domain = specified_domain ; - namelist(name_counter).domain_item = specified_domain_item ; - - line = line + 1 ; - link_counter = link_counter + 1 ; - if bond.flow - ese(line) = specify_ese(branch,[2*inbond],branch,{name_counter},[]) ; - link(link_counter) = create_link(0,0,1,port_name,port.is_flow_state) ; - else - ese(line) = specify_ese(branch,{name_counter},branch,[2*inbond],[]) ; - link(link_counter) = create_link(1,0,1,port_name,port.is_flow_state) ; - end - - name_counter = name_counter + 1 ; - if port.is_effort_state - namelist(name_counter).var = [terminal,'.effort_state'] ; - else - namelist(name_counter).var = [terminal,'.effort'] ; - end - namelist(name_counter).domain = specified_domain ; - namelist(name_counter).domain_item = specified_domain_item ; - - line = line + 1 ; - link_counter = link_counter + 1 ; - if bond.effort - ese(line) = specify_ese(branch,{name_counter},branch,[2*inbond-1],[]) ; - link(link_counter) = create_link(1,1,0,port_name,port.is_effort_state) ; - else - ese(line) = specify_ese(branch,[2*inbond-1],branch,{name_counter},[]) ; - link(link_counter) = create_link(0,1,0,port_name,port.is_effort_state) ; - end - end - - if ~isempty(outbond) - bond = model.bond(outbond) ; - [specified_domain,specified_domain_item] = mttGetBondDomain(model,outbond) ; - - name_counter = name_counter + 1 ; - if port.is_flow_state - namelist(name_counter).var = [terminal,'.flow_state'] ; - else - namelist(name_counter).var = [terminal,'.flow'] ; - end - namelist(name_counter).domain = specified_domain ; - namelist(name_counter).domain_item = specified_domain_item ; - - line = line + 1 ; - link_counter = link_counter + 1 ; - if bond.flow - ese(line) = specify_ese(branch,{name_counter},branch,[2*outbond],[]) ; - link(link_counter) = create_link(1,0,1,port_name,port.is_flow_state) ; - else - ese(line) = specify_ese(branch,[2*outbond],branch,{name_counter},[]) ; - link(link_counter) = create_link(0,0,1,port_name,port.is_flow_state) ; - end - - name_counter = name_counter + 1 ; - if port.is_effort_state - namelist(name_counter).var = [terminal,'.effort_state'] ; - else - namelist(name_counter).var = [terminal,'.effort'] ; - end - namelist(name_counter).domain = specified_domain ; - namelist(name_counter).domain_item = specified_domain_item ; - - line = line + 1 ; - link_counter = link_counter + 1 ; - if bond.effort - ese(line) = specify_ese(branch,[2*outbond-1],branch,{name_counter},[]) ; - link(link_counter) = create_link(0,1,0,port_name,port.is_effort_state) ; - else - ese(line) = specify_ese(branch,{name_counter},branch,[2*outbond-1],[]) ; - link(link_counter) = create_link(1,1,0,port_name,port.is_effort_state) ; - end - end - end - - - input_mask = zeros(number_of_ports,1) ; - output_mask = zeros(number_of_ports,1) ; - - number_of_links = link_counter ; - linked = zeros(number_of_links,1) ; - - operators = object.cr.operator ; - number_of_operators = length(operators) ; - - object.cr.used_operator = zeros(1,number_of_operators) ; - - op_counter = 0 ; - - matching = 1 ; - while matching - op_counter = op_counter + 1 ; - operator = operators(op_counter) ; - - full_operator_name = [branch,'__',object_name,'___',operator.name] ; - - number_of_op_links = length(operator.link) ; - op_linked = zeros(number_of_op_links,1) ; - - for j = 1:number_of_op_links - k = 0 ; - comparing = 1 ; - while comparing - k = k + 1 ; - if compare_links(link(k),operator.link(j)) - op_linked(j) = k ; - comparing = 0 ; - end - comparing = comparing & (k0 - for i = 1:number_of_domains - model.public_domain(i).representation = model.dom(i).representation ; - model.public_domain(i).source = model.dom(i).source ; - - domain = model.dom(i) ; - item_names = mttGetFieldNames(domain,'item') ; - for j = 1:length(item_names) - item_name = item_names{j} ; - item = getfield(domain,'item',item_name) ; - - compound_item = mttIdentifyDomainCovariables(item,domain,model) ; - model = setfield(model,'public_domain',{i},'item',item_name,compound_item) ; - end - end - model = hide_private_domains(model) ; -end - -model = mttDeleteField(model,'dom') ; - - -mttWriteNewLine ; -mttNotify('...acquiring "struct" source definitions') ; -mttWriteNewLine ; - -model = establish_user_structs(model) ; - -number_of_structs = mttGetFieldLength(model,'str') ; -if number_of_structs>0 - for i = 1:number_of_structs - model.public_struct(i).representation = model.str(i).representation ; - model.public_struct(i).source = model.str(i).source ; - - struct = model.str(i) ; - item_names = mttGetFieldNames(struct,'item') ; - for j = 1:length(item_names) - item_name = item_names{j} ; - item = getfield(struct,'item',item_name) ; - - compound_item = mttIdentifyStructVariables(item,struct,model) ; - model = setfield(model,'public_struct',{i},'item',item_name,compound_item) ; - end - end - model = hide_private_structs(model) ; -end - -model = mttDeleteField(model,'str') ; - - - -function directory = identify_directory_name(context) - mttAssert(ischar(context),'Context must be specified by name') ; - working_directory = pwd ; - working_directory = strrep(working_directory,'\','/') ; - - [system_name,local_directory] = mttDetachText(context,'/') ; - if isempty(system_name) - local_directory = [] ; - end - - if isempty(local_directory) - directory = working_directory ; - else - directory = mttLocateDirectory(working_directory,local_directory) ; - end - - -function source = identify_source_name(context,directory) - [context_name,local_directory] = mttDetachText(context,'/') ; - if isempty(context_name) - context_name = context ; - local_directory = [] ; - end - source = [directory,'/',context_name] ; - - -function model = establish_path_names(model) - path_names = mttGetFieldNames(model,'path') ; - - for n = 1:length(path_names) - path_name = path_names{n} ; - path_spec = getfield(model,'path',path_name) ; - - [rubbish,working_directory] = mttDetachText(model.source,'/') ; - - directory = identify_directory(working_directory,path_spec,model) ; - - mttAssert(~isempty(directory),... - ['Undefined path "',path_name,'"']) ; - - model = setfield(model,'path',path_name,directory) ; - end - - -function directory = identify_directory(working_directory,path_spec,model) - path_names = mttGetFieldNames(model,'path') ; - - if isempty(path_spec) - directory = [] ; - else - if path_spec(1)=='$' - [path_alias,path_branch] = mttCutText(path_spec,'/') ; - path_alias(1) = [] ; - - mttAssert(ismember(path_alias,path_names),... - ['Path "',path_alias,'" not recognised']) ; - - path_root = getfield(model,'path',path_alias) ; - - if isempty(path_branch) - directory = path_root ; - else - directory = [path_root,'/',path_branch] ; - end - else - [local_directory,name] = mttCutText(path_spec,'/') ; - - directory_located = 0 ; - if strcmp(local_directory,'.') - if isempty(name) - directory = working_directory ; - directory_located = 1 ; - else - local_directory = name ; - end - else - local_directory = path_spec ; - end - - if ~directory_located - directory = mttLocateDirectory(working_directory,local_directory) ; - end - end - end - - -function model = establish_user_domains(model) - path_names = mttGetFieldNames(model,'path') ; - domain_names = mttGetFieldNames(model,'domain') ; - - counter = 0 ; - - for n = 1:length(domain_names) - domain_name = domain_names{n} ; - domain_spec = getfield(model,'domain',domain_name) ; - - [rubbish,working_directory] = mttDetachText(model.source,'/') ; - [domain_source,domain_item] = mttCutText(domain_spec,'::') ; - [name,path_spec] = mttDetachText(domain_source,'/') ; - - if isempty(name) - source_name = [working_directory,'/',domain_source] ; - else - directory = identify_directory(working_directory,path_spec,model) ; - source_name = [directory,'/',name] ; - end - - domain_filename = [source_name,'_domain.txt'] ; - - domain_index = [] ; - if isfield(model,'dom') - existing_doms = {model.dom.source} ; - domain_index = strmatch(source_name,existing_doms,'exact') ; - end - - if isempty(domain_index) - counter = counter + 1 ; - model.dom(counter) = mttFetchDomain(domain_filename) ; - domain_index = counter ; - end - - domain_spec.dom = domain_index ; - domain_spec.item = domain_item ; - model = setfield(model,'domain',domain_name,domain_spec) ; - end - -function model = hide_private_domains(model) - for n = 1:mttGetFieldLength(model,'public_domain') - dom = model.dom(n) ; - dom_items = dom.item ; - - domain = model.public_domain(n) ; - domain_items = domain.item ; - - item_names = mttGetFieldNames(domain,'item') ; - - for j = 1:length(item_names) - item_name = item_names{j} ; - is_private(j) = getfield(dom_items,item_name,'is_private') ; - - if is_private(j) - domain_items = mttDeleteField(domain_items,item_name) ; - - mttAssert(~isempty(domain_items),... - ['No public domains in ',dom.source]) ; - end - end - - model = setfield(model,'public_domain',{n},'item',domain_items) ; - end - - user_domain_names = mttGetFieldNames(model,'domain') ; - for i = 1:length(user_domain_names) - user_domain_name = user_domain_names{i} ; - user_domain = getfield(model,'domain',user_domain_name) ; - - dom = model.dom(user_domain.dom) ; - if ~isempty(user_domain.item) - is_private = getfield(dom,'item',user_domain.item,'is_private') ; - mttAssert(~is_private,... - ['User-defined domain "',user_domain_name,'" is declared as private']) ; - end - end - - -function model = establish_user_structs(model) - path_names = mttGetFieldNames(model,'path') ; - struct_names = mttGetFieldNames(model,'struct') ; - - counter = 0 ; - - for n = 1:length(struct_names) - struct_name = struct_names{n} ; - struct_spec = getfield(model,'struct',struct_name) ; - - [rubbish,working_directory] = mttDetachText(model.source,'/') ; - [struct_source,struct_item] = mttCutText(struct_spec,'::') ; - [name,path_spec] = mttDetachText(struct_source,'/') ; - - if isempty(name) - source_name = [working_directory,'/',struct_source] ; - else - directory = identify_directory(working_directory,path_spec,model) ; - source_name = [directory,'/',name] ; - end - - struct_filename = [source_name,'_struct.txt'] ; - - struct_index = [] ; - if isfield(model,'str') - existing_strs = {model.str.source} ; - struct_index = strmatch(source_name,existing_strs,'exact') ; - end - - if isempty(struct_index) - counter = counter + 1 ; - model.str(counter) = mttFetchStruct(struct_filename) ; - struct_index = counter ; - end - - struct_spec.str = struct_index ; - struct_spec.item = struct_item ; - model = setfield(model,'struct',struct_name,struct_spec) ; - end - -function model = hide_private_structs(model) - for n = 1:mttGetFieldLength(model,'public_struct') - str = model.str(n) ; - str_items = str.item ; - - struct = model.public_struct(n) ; - struct_items = struct.item ; - - item_names = mttGetFieldNames(struct,'item') ; - - for j = 1:length(item_names) - item_name = item_names{j} ; - is_private(j) = getfield(str_items,item_name,'is_private') ; - - if is_private(j) - struct_items = mttDeleteField(struct_items,item_name) ; - - mttAssert(~isempty(struct_items),... - ['No public structs in ',str.source]) ; - end - end - - model = setfield(model,'public_struct',{n},'item',struct_items) ; - end - - user_struct_names = mttGetFieldNames(model,'struct') ; - for i = 1:length(user_struct_names) - user_struct_name = user_struct_names{i} ; - user_struct = getfield(model,'struct',user_struct_name) ; - - str = model.str(user_struct.str) ; - if ~isempty(user_struct.item) - is_private = getfield(str,'item',user_struct.item,'is_private') ; - mttAssert(~is_private,... - ['User-defined struct "',user_struct_name,'" is declared as private']) ; - end - end - DELETED mttroot/ntt/bin/trans/m/mttCreateSystemMdl.m Index: mttroot/ntt/bin/trans/m/mttCreateSystemMdl.m ================================================================== --- mttroot/ntt/bin/trans/m/mttCreateSystemMdl.m +++ mttroot/ntt/bin/trans/m/mttCreateSystemMdl.m @@ -1,170 +0,0 @@ -function mttCreateSystemMdl(model) - -model_name = mttDetachText(model.source,'/') ; -icd = mttCreateSystemMdl_ICD(model) ; - -NumInputs = length(icd.input_namelist) ; -NumOutputs = length(icd.output_namelist) ; -MaxInterfaces = max(NumInputs,NumOutputs) ; - -new_system(model_name) ; -open_system(model_name) ; -set_param(model_name,'Location',[50 100 850 250+20*MaxInterfaces]) ; - -left = 100 ; -top = 25 ; -width = 600 ; -height = 25*(5+MaxInterfaces) ; - -position_vector = [left,top,left+width,top+height] ; - -ModelHndl = add_block(... - 'simulink3/Subsystems/Subsystem',... - [model_name,'/Model'],... - 'Position',position_vector,... - 'BackgroundColor','yellow',... - 'FontName','Helvetica',... - 'FontSize',num2str(16)) ; - - -system = [model_name,'/Model'] ; - -set_param(system,'Location',[200 250 1050 285+30*MaxInterfaces]) ; - -Line = get_param(system,'Lines') ; -for i = 1:length(Line) - SrcBlock = get_param(Line(i).SrcBlock,'Name') ; - DstBlock = get_param(Line(i).DstBlock,'Name') ; - SrcPort = num2str(Line(i).SrcPort) ; - DstPort = num2str(Line(i).DstPort) ; - - delete_line(system,[SrcBlock,'/',SrcPort],[DstBlock,'/',DstPort]) ; -end - -Block = get_param(system,'Blocks') ; -for i = 1:length(Block) - delete_block([system,'/',Block{i}]) ; -end - - -left = 125 ; -centre_left = 250 ; -centre = 350 ; -centre_right = 580 ; -right = 670 ; - -top = 20 ; -down = 30 ; - -port_width = 40 ; -port_height = 15 ; -port_spacing = down ; - -mux_width = 5 ; -mux_height = NumInputs*port_spacing ; - -demux_width = 5 ; -demux_height = NumOutputs*port_spacing ; - -sfun_width = 150 ; -sfun_height = 30 ; - -left_vertical_offset = (NumInputs*port_spacing - sfun_height)/2 ; -right_vertical_offset = (NumOutputs*port_spacing - sfun_height)/2 ; - -vertical_offset = max(left_vertical_offset,right_vertical_offset) ; -datum = top + vertical_offset ; - - - -top = datum - left_vertical_offset ; - -for i = 1:NumInputs - position_vector = [... - left,... - top + (i-1)*port_spacing,... - left + port_width,... - top + (i-1)*port_spacing + port_height] ; - - InHndl(i) = add_block(... - 'simulink3/Sources/In1',... - [system,'/',icd.input_namelist{i}],... - 'Position',position_vector) ; -end - -position_vector = [... - centre_left,... - top-port_height/3,... - centre_left+mux_width,... - top+mux_height-port_height/3] ; - -MuxHndl = add_block(... - 'simulink3/Signals & Systems/Mux',... - [system,'/InputMapping'],... - 'Position',position_vector,... - 'Inputs',num2str(NumInputs)) ; - -position_vector = [... - centre,... - top+left_vertical_offset-sfun_height/2,... - centre+sfun_width,... - top+left_vertical_offset+sfun_height] ; - -SfunHndl = add_block(... - 'simulink3/Functions & Tables/S-Function',... - [system,'/sfun'],... - 'Position',position_vector,... - 'FunctionName',[model_name,'_sfun'],... - 'BackgroundColor','yellow',... - 'FontName','Helvetica',... - 'FontSize',num2str(16)) ; - - - -top = datum - right_vertical_offset ; - -position_vector = [... - centre_right,... - top-port_height/3,... - centre_right+demux_width,... - top+demux_height-port_height/3] ; - -DemuxHndl = add_block(... - 'simulink3/Signals & Systems/Demux',... - [system,'/OutputMapping'],... - 'Position',position_vector,... - 'Outputs',num2str(NumOutputs)) ; - -for i = 1:NumOutputs - position_vector = [... - right,... - top + (i-1)*port_spacing,... - right + port_width,... - top + (i-1)*port_spacing + port_height] ; - - OutHndl(i) = add_block(... - 'simulink3/Sinks/Out1',... - [system,'/',icd.output_namelist{i}],... - 'Position',position_vector) ; -end - - - -for i = 1:NumInputs - port = num2str(i) ; - InLineHndl(i) = add_line(system,... - [icd.input_namelist{i},'/1'],['InputMapping/',port]) ; -end - -SfunInLineHndl = add_line(system,'InputMapping/1','sfun/1') ; -set_param(SfunInLineHndl,'Name','_Input') ; - -SfunOutLineHndl = add_line(system,'sfun/1','OutputMapping/1') ; -set_param(SfunOutLineHndl,'Name','_Output') ; - -for i = 1:NumOutputs - port = num2str(i) ; - OutLineHndl(i) = add_line(system,... - ['OutputMapping/',port],[icd.output_namelist{i},'/1']) ; -end - DELETED mttroot/ntt/bin/trans/m/mttCreateSystemMdl_ICD.m Index: mttroot/ntt/bin/trans/m/mttCreateSystemMdl_ICD.m ================================================================== --- mttroot/ntt/bin/trans/m/mttCreateSystemMdl_ICD.m +++ mttroot/ntt/bin/trans/m/mttCreateSystemMdl_ICD.m @@ -1,274 +0,0 @@ -function icd = mttCreateSystemMdl_ICD(model) - -sympar = map_system_sympars(model) ; -input = map_system_inputs(model) ; -invar = map_system_invars(model) ; -outvar = map_system_outvars(model) ; - -icd.output_namelist = outvar ; -icd.input_namelist = invar ; -if ~isempty(input) - icd.input_namelist = [icd.input_namelist,input] ; -end -if ~isempty(sympar) - icd.input_namelist = [icd.input_namelist,sympar] ; -end - -icd.output_namelist = sort(icd.output_namelist) ; -icd.input_namelist = sort(icd.input_namelist) ; - - - -function map = map_system_sympars(model) - mttNotify('...mapping system inputs (symbolic parameters)') ; - mttWriteNewLine ; - - map = [] ; - line = 0 ; - - number_of_variables = mttGetFieldLength(model,'sympar') ; - - model_name = mttDetachText(model.source,'/') ; - - for i = 1:number_of_variables - variable_name = model.sympar{i} ; - default_value = model.sympar_default{i} ; - - if isempty(default_value) - line = line + 1 ; - map{line} = [model_name,'___',variable_name] ; - end - end - - -function map = map_system_inputs(model,root,branch) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...mapping system inputs (input variables)') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - else - current_branch = branch ; - end - - map = [] ; - line = 0 ; - - number_of_variables = mttGetFieldLength(model,'input') ; - - for i = 1:number_of_variables - variable_name = model.input{i} ; - - line = line + 1 ; - map{line} = [current_branch,'___',variable_name] ; - end - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - additional_map = [] ; - if ~isempty(object.abg) - additional_map = map_system_inputs(object,root,next_branch) ; - elseif ~isempty(object.cr) - additional_map = map_system_inputs(object.cr,root,next_branch) ; - end - - if isempty(map) - map = additional_map ; - else - line = length(map) ; - for j = 1:length(additional_map) - if ~ismember(additional_map{j},map) - line = line + 1 ; - map{line} = additional_map{j} ; - end - end - end - end - - -function map = map_system_invars(model,root,branch,env) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...mapping system inputs (input covariables)') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - env = model.env ; - else - current_branch = branch ; - end - - map = [] ; - line = 0 ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - switch object.class - case {'SS','Se','Sf','De','Df'} - inbond_number = object.interface.in ; - outbond_number = object.interface.out ; - - inbond = model.bond(inbond_number) ; - outbond = model.bond(outbond_number) ; - - if ~isempty(inbond) - covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; - covar = [] ; - - if ~inbond.effort - if ~strcmp(object.class,'Df') - covar = covariables.effort ; - end - elseif inbond.flow - if ~strcmp(object.class,'De') - covar = covariables.flow ; - end - end - - for j = 1:length(covar) - line = line + 1 ; - covariable = strrep(covar{j},'.','__') ; - map{line} = [current_branch,'__',object_name,'(',covariable,')'] ; - end - end - - if ~isempty(outbond) - covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; - - if outbond.effort - covar = covariables.effort ; - elseif ~outbond.flow - covar = covariables.flow ; - end - - for j = 1:length(covar) - line = line + 1 ; - covariable = strrep(covar{j},'.','__') ; - map{line} = [current_branch,'__',object_name,'(',covariable,')'] ; - end - end - end - - additional_map = [] ; - if ~isempty(object.abg) - additional_map = map_system_invars(object,root,next_branch,env) ; - end - - if isempty(map) - map = additional_map ; - else - line = length(map) ; - for j = 1:length(additional_map) - if ~ismember(additional_map{j},map) - line = line + 1 ; - map{line} = additional_map{j} ; - end - end - end - end - - -function map = map_system_outvars(model,root,branch,env) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...mapping system outputs (output covariables)') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - env = model.env ; - else - current_branch = branch ; - end - - map = [] ; - line = 0 ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - switch object.class - case {'SS','Se','Sf','De','Df'} - inbond_number = object.interface.in ; - outbond_number = object.interface.out ; - - inbond = model.bond(inbond_number) ; - outbond = model.bond(outbond_number) ; - - if ~isempty(inbond) - covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; - covar = [] ; - - if inbond.effort - covar = covariables.effort ; - elseif ~inbond.flow - covar = covariables.flow ; - end - - for j = 1:length(covar) - line = line + 1 ; - covariable = strrep(covar{j},'.','__') ; - map{line} = [current_branch,'__',object_name,'(',covariable,')'] ; - end - end - - if ~isempty(outbond) - covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; - covar = [] ; - - if ~outbond.effort - if ~strcmp(object.class,'Sf') - covar = covariables.effort ; - end - elseif outbond.flow - if ~strcmp(object.class,'Se') - covar = covariables.flow ; - end - end - - for j = 1:length(covar) - line = line + 1 ; - covariable = strrep(covar{j},'.','__') ; - map{line} = [current_branch,'__',object_name,'(',covariable,')'] ; - end - end - end - - additional_map = [] ; - if ~isempty(object.abg) - additional_map = map_system_outvars(object,root,next_branch,env) ; - end - - if isempty(map) - map = additional_map ; - else - line = length(map) ; - for j = 1:length(additional_map) - if ~ismember(additional_map{j},map) - line = line + 1 ; - map{line} = additional_map{j} ; - end - end - end - end - DELETED mttroot/ntt/bin/trans/m/mttCreateUnifiedModel.m Index: mttroot/ntt/bin/trans/m/mttCreateUnifiedModel.m ================================================================== --- mttroot/ntt/bin/trans/m/mttCreateUnifiedModel.m +++ mttroot/ntt/bin/trans/m/mttCreateUnifiedModel.m @@ -1,182 +0,0 @@ -function model = mttCreateUnifiedModel(model,bondgraph,specification) - - model.source = mttCutText(specification.specification,'_abg.txt') ; - model.bondgraph = mttCutText(bondgraph.bondgraph,'_abg.fig') ; - - model.obj = bondgraph.obj ; - model.bond = bondgraph.bond ; - - object_names = mttGetFieldNames(model,'obj') ; - specified_object_names = mttGetFieldNames(specification,'obj') ; - - for n = 1:length(object_names) - object_name = object_names{n} ; - object = getfield(model,'obj',object_name) ; - - if ~mttIsPassiveClass(object.class) - mttAssert(ismember(object_name,specified_object_names),... - ['Object name "',object_name,'" does not appear in specification']) ; - end - end - - for n = 1:length(specified_object_names) - specified_object_name = specified_object_names{n} ; - mttAssert(ismember(specified_object_name,object_names),... - ['Specified object name "',specified_object_name,... - '" does not appear in bond graph']) ; - - specified_object = getfield(specification,'obj',specified_object_name) ; - object = getfield(model,'obj',specified_object_name) ; - - if strcmp(specified_object.name.class,object.class) - mttAssert(~mttIsFoundationClass(object.class),... - 'Cannot redefine MTT foundation class') ; - is_abg = 1 ; - else - mttAssert(~mttIsPassiveClass(object.class),... - 'Cannot modify MTT junctions or ports') ; - is_abg = 0 ; - end - - object.is_abg = is_abg ; - object.name = specified_object.name ; - object.parameter = specified_object.parameter ; - - model = setfield(model,'obj',specified_object_name,object) ; - end - - model.sympar = specification.sympar ; - model.numpar = specification.numpar ; - model.input = specification.input ; - - model.sympar_default = specification.sympar_default ; - model.numpar_default = specification.numpar_default ; - model.input_default = specification.input_default ; - - for n = 1:length(object_names) - object_name = object_names{n} ; - object = getfield(model,'obj',object_name) ; - - if mttIsPortClass(object.class) - mttAssert(mttGetFieldLength(object,'interface')==1,... - ['Port components must have one and only one interface']) ; - - switch object.class - case {'Se','Sf'}, - mttAssert(~isempty(object.interface.out),... - 'Each source port must have an outward bond') ; - case {'De','Df'}, - mttAssert(~isempty(object.interface.in),... - 'Each detector port must have an inward bond') ; - end - end - - if ~ismember(object_name,specified_object_names) - object.name.item = [] ; - object.name.class = object.class ; - object.name.path = [] ; - object.parameter = [] ; - object.is_abg = 1 ; - end - - [rubbish,working_directory] = mttDetachText(model.source,'/') ; - local_directory = object.name.path ; - directory = mttLocateDirectory(working_directory,local_directory) ; - - source = [directory,'/',object.name.class] ; - - current_leaf = model.leaf ; - - if object.is_abg - if mttIsPassiveClass(object.name.class) - object.abg = [] ; - else - current_branch = model.branch ; - mttAssert(~ismember(source,current_branch),... - ['Recursive definition of "',source,'"']) ; - - if isempty(model.abgs) - existing_abg = [] ; - else - existing_abg = strmatch(source,model.abgs,'exact') ; - end - - if isempty(existing_abg) - if isempty(current_branch) - next_branch = {source} ; - next_leaf = object_name ; - else - next_branch = [current_branch,{source}] ; - next_leaf = [current_leaf,'/',object_name] ; - end - model.branch = next_branch ; - model.leaf = next_leaf ; - - class_model = mttCreateAcausalBondgraph(source,model) ; - - model.leaf = current_leaf ; - model.branch = current_branch ; - - next_abg = 1 + mttGetFieldLength(model,'abg') ; - for i = 1:mttGetFieldLength(class_model,'abg') - model.abg(next_abg) = class_model.abg(i) ; - model.abgs = class_model.abgs ; - next_abg = next_abg + 1 ; - end - class_model = mttDeleteField(class_model,'abg') ; - - model.crs = class_model.crs ; - class_model = mttDeleteField(class_model,'crs') ; - - model.cr_usage = class_model.cr_usage ; - class_model = mttDeleteField(class_model,'cr_usage') ; - - model.abg(next_abg) = class_model ; - model = mttAppend(model,'abgs',{source}) ; - - index = length(model.abgs) ; - mttNotify([' ...made "#',num2str(index),':',object.name.class,'" definition']) ; - mttWriteNewLine ; - end - object.abg = strmatch(source,model.abgs,'exact') ; - end - object.cr = [] ; - object.cr_item = [] ; - else - if isempty(model.crs) - existing_cr = [] ; - else - existing_cr = strmatch(source,model.crs,'exact') ; - end - - if isempty(current_leaf) - cr_user = object_name ; - else - cr_user = [current_leaf,'/',object_name] ; - end - - if isempty(existing_cr) - model = mttAppend(model,'crs',{source}) ; - - N = length(model.crs) ; - model.cr_usage(N).obj{1} = cr_user ; - else - N = 1+length(model.cr_usage(existing_cr).obj) ; - model.cr_usage(existing_cr).obj{N} = cr_user ; - end - - object.abg = [] ; - object.cr = strmatch(source,model.crs,'exact') ; - - if isempty(object.name.item) - object.cr_item = mttDetachText(model.crs{object.cr},'/') ; - else - object.cr_item = object.name.item ; - end - end - - object = mttDeleteField(object,'name') ; - object = mttDeleteField(object,'is_abg') ; - - model = setfield(model,'obj',object_name,object) ; - end DELETED mttroot/ntt/bin/trans/m/mttEmbedAcausalBondgraph.m Index: mttroot/ntt/bin/trans/m/mttEmbedAcausalBondgraph.m ================================================================== --- mttroot/ntt/bin/trans/m/mttEmbedAcausalBondgraph.m +++ mttroot/ntt/bin/trans/m/mttEmbedAcausalBondgraph.m @@ -1,159 +0,0 @@ -function model = mttEmbedAcausalBondgraph(model,component,system) - source = model.abg(component) ; - - if nargin==2 - is_root_model = 1 ; - target = model ; - else - is_root_model = 0 ; - target = model.abg(system) ; - end - - source_objects = mttGetFieldNames(source,'obj') ; - target_objects = mttGetFieldNames(target,'obj') ; - - for n = 1:length(target_objects) - target_object_name = target_objects{n} ; - target_object = getfield(target,'obj',target_object_name) ; - - here = [mttDetachText(target.source,'/'),'/',target_object_name] ; - - is_abg_instance = 0 ; - if ~isempty(target_object.abg) - is_abg_instance = target_object.abg==component ; - end - - if is_abg_instance - target_object.sympar = source.sympar ; - target_object.numpar = source.numpar ; - target_object.input = source.input ; - - target_object.sympar_default = source.sympar_default ; - target_object.numpar_default = source.numpar_default ; - target_object.input_default = source.input_default ; - - declarations = length(target_object.sympar) ; - values = length(target_object.parameter) ; - - mttAssert(declarations==values,['Mismatched parameters in object ',here]) ; - - - number_of_target_ports = mttGetFieldLength(target_object,'interface') ; - - found_target_port = [] ; - target_ports_found = [] ; - - for i = 1:number_of_target_ports - - target_port_name = target_object.interface(i).name ; - target_inbond = target_object.interface(i).in ; - target_outbond = target_object.interface(i).out ; - - is_inline = (~isempty(target_inbond) & ~isempty(target_outbond)) ; - - next = 0 ; - found_target_port(i) = 0 ; - - matching = 1 ; - while matching - next = next + 1 ; - source_object_name = source_objects{next} ; - source_object = getfield(source,'obj',source_object_name) ; - - if ismember(source_object.class,{'SS','Se','Sf','De','Df'}) - source_port_name = source_object_name ; - - if is_inline - source_interface = getfield(source,'obj',source_port_name,'interface') ; - - inport_found = 0 ; - if ~isempty(source_interface.in) - inport_found = strcmp(source_port_name,[target_port_name,'_in']) ; - end - - outport_found = 0 ; - if ~isempty(source_interface.out) - outport_found = strcmp(source_port_name,[target_port_name,'_out']) ; - end - - found_target_port(i) = inport_found | outport_found ; - else - found_target_port(i) = strcmp(source_port_name,target_port_name) ; - end - end - - if found_target_port(i) - if isempty(target_ports_found) - target_ports_found = {target_port_name} ; - else - target_ports_found = [target_ports_found, {target_port_name}] ; - end - matching = 0 ; - else - matching = (next2 - model = create_bond(model,coordinates) ; - end - else - jump = jump + forward_arrow + reverse_arrow ; - end - end - end - else - [last_word,first_part] = mttDetachText(line,' ') ; - - if mttIsNumericText(first_part) - numbers = round(str2num(first_part)) ; % only interested in integer values - if numbers(1)==4 % ... text definition - depth = numbers(4) ; - is_visible = rem(depth,10)==0 ; - - if is_visible - coordinates = numbers(12:13) ; - text = mttCompressText(mttCutText(last_word,'\001')) ; - - identifier = mttCutText(text,'[') ; - qualifier = mttExtractText(text,'[',']') ; - - name.label = [] ; - name.domain = [] ; - name.domain_item = [] ; - name.class = [] ; - name.object = [] ; - - if isempty(identifier) - name.label = qualifier ; - model = create_label(model,name,coordinates) ; - else - [name.domain,name.domain_item] = mttCutText(qualifier,'::') ; - [name.class,name.object] = mttCutText(identifier,':') ; - model = create_object(model,name,coordinates) ; - end - end - end - end - end - end - - N = N + jump ; - processing = (N<=L) ; -end - -model = incorporate_anonymous_objects(model) ; -model = identify_causal_assignments(model) ; -model = identify_object_binding(model) ; -model = identify_object_interfaces(model) ; -model = associate_external_domains(model) ; -model = tidy_up(model) ; - - - -function model = create_line(model,coordinates) - next = 1 + mttGetFieldLength(model,'line') ; - model.line(next).xy1 = coordinates(1:2) ; - model.line(next).xy2 = coordinates(3:4) ; - model.line(next).mid = (coordinates(1:2)+coordinates(3:4))/2 ; - -function model = create_bond(model,coordinates) - next = 1 + mttGetFieldLength(model,'bond') ; - - N = length(coordinates) ; - - q1 = coordinates(N-1:N) ; p1 = coordinates(1:2) ; - p2 = coordinates(3:4) ; q2 = coordinates(N-3:N-2) ; - p3 = coordinates(5:6) ; q3 = coordinates(N-5:N-4) ; - ps = norm(p2-p1) ; qs = norm(q2-q1) ; - - orientation = sign(ps-qs) ; - - switch orientation - case 1, % harpoon points forward - xy1 = p1 ; xy2 = q2 ; v1 = p2-p1 ; v2 = q2-q3 ; harpoon = q1-q2 ; - case -1, % harpoon points backward - xy1 = p2 ; xy2 = q1 ; v1 = q2-q1 ; v2 = p2-p3 ; harpoon = p1-p2 ; - end - - harpoon_side = sign_cross_product(v2,harpoon) ; - - mttAssert(~(orientation==0 | harpoon_side==0),... - ['Ambiguous bond orientation between[',num2str(xy1),'] and [',num2str(xy2),']']) ; - - model.bond(next).xy1 = xy1 ; - model.bond(next).xy2 = xy2 ; - model.bond(next).v1 = v1 ; - model.bond(next).v2 = v2 ; - model.bond(next).harpoon = harpoon ; - model.bond(next).harpoon_side = harpoon_side ; - - model.bond(next).from.obj = [] ; - model.bond(next).from.interface = [] ; - model.bond(next).to.obj = [] ; - model.bond(next).to.interface = [] ; - model.bond(next).flow = [] ; - model.bond(next).effort = [] ; - model.bond(next).unicausal = [] ; - model.bond(next).domain = [] ; - model.bond(next).domain_item = [] ; - -function model = create_label(model,name,coordinates) - inner_name = mttExtractText(name.label,'<','>') ; - if isempty(inner_name) - label_name = name.label ; - is_inline = 0 ; - else - label_name = inner_name ; - is_inline = 1 ; - end - mttValidateName(label_name) ; - - next = 1 + mttGetFieldLength(model,'label') ; - model.label(next).name = label_name ; - model.label(next).is_inline = is_inline ; - model.label(next).xy = coordinates ; - -function model = create_object(model,name,coordinates) -global mtt_environment - - domain_names = mttGetFieldNames(mtt_environment,'domain') ; - - is_anonymous = 0 ; - if isempty(name.object) - switch name.class - case {'0','1'}, - is_anonymous = 1 ; - case 'SS', - mttAssert(~isempty(name.object),... - 'Anonymous "SS" object') ; - otherwise, - name.object = name.class ; - end - end - - if is_anonymous - next = 1 + mttGetFieldLength(model,'anonymous') ; - model.anonymous(next).class = name.class ; - model.anonymous(next).xy = coordinates ; - else - object_names = mttGetFieldNames(model,'obj') ; - if ~isempty(object_names) - mttAssert(~ismember(name.object,object_names),... - ['Repeated object: "',name.object,'"']) ; - end - - switch name.class - case {'0','1'}, - mttValidateName(name.object) ; - mttAssert(~ismember(name.object,{'in','out'}),... - 'Junctions cannot use reserved port names') ; - - case {'SS','Se','Sf','De','Df'}, - mttValidateName(name.object) ; - - if isempty(name.domain) | isempty(mtt_environment) - model = setfield(model,'obj',name.object,'domain',[]) ; - model = setfield(model,'obj',name.object,'domain_item',[]) ; - else - mttAssert(ismember(name.domain,domain_names),... - ['Unrecognised domain "',name.domain,'"']) ; - dom = getfield(mtt_environment,'domain',name.domain,'dom') ; - item = getfield(mtt_environment,'domain',name.domain,'item') ; - - if isempty(item) - public_domain = getfield(mtt_environment,'public_domain',{dom}) ; - item_names = mttGetFieldNames(public_domain,'item') ; - - mttAssert(ismember(name.domain_item,item_names),... - ['Item "',name.domain_item,'" not found in public domain "',name.domain,'"']) ; - item_name = name.domain_item ; - else - mttAssert(isempty(name.domain_item),... - ['Item unspecified in public domain "',name.domain,'"']) ; - item_name = item ; - end - - model = setfield(model,'obj',name.object,'domain',dom) ; - model = setfield(model,'obj',name.object,'domain_item',item_name) ; - end - - otherwise, - mttValidateName(name.class) ; - mttValidateName(name.object) ; - - mttAssert(~ismember(name.object,{'in','out'}),... - 'Objects cannot use reserved port names') ; - end - model = setfield(model,'obj',name.object,'class',name.class) ; - model = setfield(model,'obj',name.object,'xy',coordinates) ; - end - -function model = incorporate_anonymous_objects(model) - number_of_objects = mttGetFieldLength(model,'anonymous') ; - - last = length(num2str(number_of_objects)) ; - for i = 1:last - object_number(i) = '0' ; - end - - for i = 1:number_of_objects - anonymous_object = getfield(model,'anonymous',{i}) ; - - current_number = num2str(i) ; - width = length(current_number) ; - first = last-width+1 ; - object_number(first:last) = current_number ; - - object_name = ['mtt_obj',object_number] ; - model = setfield(model,'obj',object_name,model.anonymous(i)) ; - end - -function r = sign_cross_product(v1,v2) - r = sign(v1(1)*v2(2) - v1(2)*v2(1)) ; - -function model = identify_causal_assignments(model) - L = mttGetFieldLength(model,'line') ; - - if L>0 - N = mttGetFieldLength(model,'bond') ; - - for j = 1:L - for i = 1:N - s(i,j) = norm(model.line(j).mid - model.bond(i).xy1) ; - f(i,j) = norm(model.line(j).mid - model.bond(i).xy2) ; - end - end - - [min_range_start,nearest_bond_start] = min(s) ; - [min_range_finish,nearest_bond_finish] = min(f) ; - - equidistant = min_range_start==min_range_finish ; - at_harpoon = min_range_start>min_range_finish ; - - for j = 1:L - fulcrum = num2str(model.line(j).mid) ; - - mttAssert(~equidistant(j),... - ['Ambiguous causal line at [',num2str(model.line(j).mid),']']) ; - - if at_harpoon(j) - index = nearest_bond_finish(j) ; - bond = model.bond(index) ; - terminal = bond.xy2 ; - terminal_vector = bond.v2 ; - else - index = nearest_bond_start(j) ; - bond = model.bond(index) ; - terminal = bond.xy1 ; - terminal_vector = bond.v1 ; - end - - to_lhs = norm(model.line(j).xy1 - terminal) ; - to_mid = norm(model.line(j).mid - terminal) ; - to_rhs = norm(model.line(j).xy2 - terminal) ; - - mttAssert(to_midto_left) ; - causal_assignment = sign_cross_product(terminal_vector,causal_vector) ; - mttAssert(causal_assignment~=0,... - ['Cannot determine causality near [',num2str(fulcrum),']']) ; - - if causal_assignment==bond.harpoon_side - [bond.flow,causality_ok] = mttAssign(bond.flow,at_harpoon(j)) ; - else - [bond.effort,causality_ok] = mttAssign(bond.effort,at_harpoon(j)) ; - end - end - mttAssert(causality_ok,... - ['Ambiguous causal assignment near [',num2str(fulcrum),']']) ; - - bond.unicausal = mttCompare(bond.flow,bond.effort) ; - - model.bond(index) = bond ; - end - end - - -function model = identify_object_binding(model) - object_names = mttGetFieldNames(model,'obj') ; - number_of_objects = length(object_names) ; - number_of_bonds = mttGetFieldLength(model,'bond') ; - - for j = 1:number_of_bonds - bond = model.bond(j) ; - for i = 1:number_of_objects - object = getfield(model,'obj',object_names{i}) ; - origin_proximity(i) = norm(object.xy - bond.xy1) ; - target_proximity(i) = norm(object.xy - bond.xy2) ; - end - - [range,index] = min(origin_proximity) ; - origin_name = object_names{index} ; - bond.from.obj = origin_name ; - bond.from.interface = [] ; - - [range,index] = min(target_proximity) ; - target_name = object_names{index} ; - bond.to.obj = target_name ; - bond.to.interface = [] ; - - model = setfield(model,'bond',{j},bond) ; - - origin = getfield(model,'obj',origin_name) ; - next = 1 + mttGetFieldLength(origin,'bond') ; - origin.bond(next).number = j ; - origin.bond(next).is_inbond = 0 ; - model = setfield(model,'obj',origin_name,origin) ; - - target = getfield(model,'obj',target_name) ; - next = 1 + mttGetFieldLength(target,'bond') ; - target.bond(next).number = j ; - target.bond(next).is_inbond = 1 ; - model = setfield(model,'obj',target_name,target) ; - end - - -function model = identify_object_interfaces(model) - object_names = mttGetFieldNames(model,'obj') ; - number_of_objects = length(object_names) ; - number_of_labels = mttGetFieldLength(model,'label') ; - number_of_bonds = mttGetFieldLength(model,'bond') ; - - for j = 1:number_of_labels - label = model.label(j) ; - for i = 1:number_of_objects - object_name = object_names{i} ; - object = getfield(model,'obj',object_names{i}) ; - proximity(i) = norm(object.xy - label.xy) ; - end - [range,index] = min(proximity) ; - associated_object = object_names{index} ; - object = getfield(model,'obj',associated_object) ; - - switch object.class - case {'0','1'}, - mttAssert(~label.is_inline,... - ['Inline ports not valid for "0" and "1" junctions']) ; - end - - next = 1 + mttGetFieldLength(object,'interface') ; - object = setfield(object,'interface',{next},'name',label.name) ; - object = setfield(object,'interface',{next},'class',[]) ; - object = setfield(object,'interface',{next},'is_inline',label.is_inline) ; - object = setfield(object,'interface',{next},'xy',label.xy) ; - object = setfield(object,'interface',{next},'in',[]) ; - object = setfield(object,'interface',{next},'out',[]) ; - object = setfield(object,'interface',{next},'map',[]) ; - model = setfield(model,'obj',associated_object,object) ; - end - - for j = 1:number_of_objects - object_name = object_names{j} ; - object = getfield(model,'obj',object_name) ; - - number_of_attached_bonds = mttGetFieldLength(object,'bond') ; - number_of_interfaces = mttGetFieldLength(object,'interface') ; - - for k = 1:number_of_interfaces - interface = object.interface(k) ; - - inbond_proximity = [] ; inbond_counter = [] ; - outbond_proximity = [] ; outbond_counter = [] ; - - in_counter = 0 ; - out_counter = 0 ; - - for i = 1:number_of_attached_bonds - bond_number = object.bond(i).number ; - bond = model.bond(bond_number) ; - - if object.bond(i).is_inbond - if isempty(bond.to.interface) - in_counter = in_counter + 1 ; - inbond_proximity(in_counter) = norm(interface.xy - bond.xy2) ; - inbond_counter(in_counter) = bond_number ; - end - else - if isempty(bond.from.interface) - out_counter = out_counter + 1 ; - outbond_proximity(out_counter) = norm(interface.xy - bond.xy1) ; - outbond_counter(out_counter) = bond_number ; - end - end - end - - [in_range,inbond_index] = min(inbond_proximity) ; - [out_range,outbond_index] = min(outbond_proximity) ; - - inbond = inbond_counter(inbond_index) ; - outbond = outbond_counter(outbond_index) ; - - if interface.is_inline - mttAssert(~isempty(inbond_proximity),... - ['No in-bond for interface "',object_name,'[',interface.name,']"']) ; - mttAssert(~isempty(outbond_proximity),... - ['No out-bond for interface "',object_name,'[',interface.name,']"']) ; - - interface.in = inbond ; - interface.out = outbond ; - - model = setfield(model,'bond',{outbond},'from','interface',k) ; - model = setfield(model,'bond',{inbond},'to','interface',k) ; - else - mttAssert(~(isempty(inbond_proximity) & isempty(outbond_proximity)),... - ['No bond for interface "',object_name,'[',interface.name,']"']) ; - - if isempty(inbond_proximity) - interface.out = outbond ; - model = setfield(model,'bond',{outbond},'from','interface',k) ; - elseif isempty(outbond_proximity) - interface.in = inbond ; - model = setfield(model,'bond',{inbond},'to','interface',k) ; - else - mttAssert(in_range~=out_range,... - ['Ambiguous interface "',object_name,'[',interface.name,']"']) ; - - if out_range0,... - ['No operator defined in ',here]) ; - - assigned_ports = [] ; - - for i = 1:length(cr.operator) - if i==1 - operator_names{1} = cr.operator(i).name ; - else - operator_name = cr.operator(i).name ; - mttAssert(~ismember(operator_name,operator_names),... - ['Repeated operator name "',operator_name,'" in ',here]) ; - operator_names{i} = operator_name ; - end - - newly_assigned_ports = mttGetFieldNames(cr.operator(i),'assign') ; - if isempty(assigned_ports) - assigned_ports = newly_assigned_ports ; - else - if ~isempty(newly_assigned_ports) - assigned_ports = [assigned_ports, newly_assigned_ports] ; - end - end - end - - for i = 1:length(interface_ports_with_state) - interface_port = interface_ports_with_state{i} ; - - mttAssert(ismember(interface_port,assigned_ports),... - ['Missing "set" declaration for port "',interface_port,'" in ',here]) ; - end - - - - -function [interface,next] = fetch_interface(statements,next,cr_name) -global mtt_environment - unit_name = 'interface' ; - here = [cr_name,'/',unit_name] ; - - domain_names = mttGetFieldNames(mtt_environment,'domain') ; - - interface = [] ; - number_of_statements = length(statements) ; - - counter = 0 ; - constraint = [] ; - - open = 0 ; - parsing = 1 ; - while parsing - next = next + 1 ; - statement = statements{next} ; - [keyword,line] = mttSeparateText(statement) ; - - switch keyword - case 'port', - ports = mttGetItemList(line) ; - for n = 1:length(ports) - identifier = mttCutText(ports{n},'[') ; - qualifier = mttExtractText(ports{n},'[',']') ; - [name.domain,name.domain_item] = mttCutText(qualifier,'::') ; - - name.port = identifier ; - mttValidateName(name.port) ; - - if isempty(name.domain) | isempty(mtt_environment) - interface = setfield(interface,'port',name.port,'domain',[]) ; - interface = setfield(interface,'port',name.port,'domain_item',[]) ; - interface = setfield(interface,'port',name.port,'was_generic',1) ; - else - mttAssert(ismember(name.domain,domain_names),... - ['Unrecognised domain "',name.domain,'"']) ; - dom = getfield(mtt_environment,'domain',name.domain,'dom') ; - item = getfield(mtt_environment,'domain',name.domain,'item') ; - - if isempty(item) - public_domain = getfield(mtt_environment,'public_domain',{dom}) ; - item_names = mttGetFieldNames(public_domain,'item') ; - - mttAssert(ismember(name.domain_item,item_names),... - ['Item "',name.domain_item,'" not found in public domain "',name.domain,'"']) ; - item_name = name.domain_item ; - else - mttAssert(isempty(name.domain_item),... - ['Item unspecified in public domain "',name.domain,'"']) ; - item_name = item ; - end - - interface = setfield(interface,'port',name.port,'domain',dom) ; - interface = setfield(interface,'port',name.port,'domain_item',item_name) ; - interface = setfield(interface,'port',name.port,'was_generic',0) ; - end - interface = setfield(interface,'port',name.port,'is_effort_state',0) ; - interface = setfield(interface,'port',name.port,'is_flow_state',0) ; - interface = setfield(interface,'port',name.port,'assign',[]) ; - end - - case {'assert','prefer'}, - counter = counter + 1 ; - constraint{counter} = statement ; - - case '{', - mttAssert(~open,['Unmatched "{" in ',here]) ; - open = 1 ; - case '}', - mttAssert(open,['Unmatched "}" in ',here]) ; - open = 0 ; - otherwise, - error(['Unrecognised_keyword "',keyword,'" in ',here]) ; - end - - mttAssert(~(open & (next==number_of_statements)),... - ['Missing "}" in ',here]) ; - - if (~open) | (next==number_of_statements) - parsing = 0 ; - end - end - - - interface_ports = mttGetFieldNames(interface,'port') ; - number_of_constraints = length(constraint) ; - - for i = 1:number_of_constraints - [keyword,assignment] = mttSeparateText(constraint{i}) ; - [namelist,definition] = mttCutText(assignment,'=>') ; - - mttAssert(~isempty(keyword),... - ['Rule "',constraint{i},'" has no context in cr ',cr_name]) ; - - if ~isempty(namelist) - first = 1 ; - last = length(namelist) ; - if namelist([first,last])=='[]' - ports = mttGetItemList(mttExtractText(namelist,'[',']')) ; - else - ports = {namelist} ; - end - end - - mttAssert(~isempty(ports),... - ['Rule "',constraint{i},'" has no association in cr ',cr_name]) ; - mttAssert(~isempty(definition),... - ['Rule "',constraint{i},'" not defined in cr ',cr_name]) ; - - for j = 1:length(ports) - port_name = ports{j} ; - mttValidateName(port_name) ; - - other_ports = [] ; - counter = 0 ; - for k = 1:length(ports) - if j~=k - counter = counter + 1 ; - other_ports{counter} = ports{k} ; - end - end - - mttAssert(ismember(port_name,interface_ports),... - ['Unreferenced port "',port_name,'" in cr ',cr_name]) ; - - port = getfield(interface,'port',port_name) ; - - switch definition - case 'effort_state', - mttAssert(mttIsEqual(port.is_flow_state,0),... - ['Attempt to overwrite state assignment at port "',port_name,'" in ',here]) ; - port.is_effort_state = 1 ; - - case 'flow_state', - mttAssert(mttIsEqual(port.is_effort_state,0),... - ['Attempt to overwrite state assignment at port "',port_name,'" in ',here]) ; - port.is_flow_state = 1 ; - - otherwise, - rule_number = 1 + mttGetFieldLength(port,'causality') ; - - port.causality(rule_number).rule = keyword ; - port.causality(rule_number).def = definition ; - port.causality(rule_number).with = other_ports ; - port.causality(rule_number).applied = 0 ; - end - - interface = setfield(interface,'port',port_name,port) ; - end - end - - -function [operator,next] = fetch_operator(statements,next,cr,cr_name) - unit_name = 'operator' ; - here = [cr_name,'/',unit_name] ; - - interface = [] ; - number_of_statements = length(statements) ; - - statement = statements{next} ; - [keyword,line] = mttSeparateText(statement) ; - - operator = mttGetOperatorContext(line,cr,cr_name) ; - - operator.content = [] ; - operator.var = [] ; - operator.var_default = [] ; - operator.struct = [] ; - operator.set = [] ; - - counter = 0 ; - - open = 0 ; - parsing = 1 ; - while parsing - next = next + 1 ; - statement = statements{next} ; - [keyword,line] = mttSeparateText(statement) ; - - switch keyword - case '{', - mttAssert(~open,['Unmatched "{" in ',here]) ; - open = 1 ; - - case '}', - mttAssert(open,['Unmatched "}" in ',here]) ; - open = 0 ; - - case 'set', - mttAssert(open,... - ['"set" declarations must be contained inside {...} in ',here]) ; - - operator = mttAppend(operator,'set',{line}) ; - - case 'var', - mttAssert(open,... - ['"var" declarations must be contained inside {...} in ',here]) ; - - variable_list = line ; - [variables,defaults] = mttGetParameters(variable_list) ; - - operator = mttAppend(operator,'var',variables) ; - operator = mttAppend(operator,'var_default',defaults) ; - - case 'struct', - mttAssert(open,... - ['"struct" declarations must be contained inside {...} in ',here]) ; - - [struct_name,variable_list] = mttSeparateText(line) ; - [variables,defaults] = mttGetParameters(variable_list) ; - - mttAssert(mttIsEmptyCellArray(defaults),... - ['"struct" declarations cannot have default values in ',here]) ; - - operator.struct = mttAppend(operator.struct,struct_name,variables) ; - - otherwise, - counter = counter + 1 ; - operator.content{counter} = statement ; - end - - mttAssert(~(open & (next==number_of_statements)),... - ['Missing "}" in ',here]) ; - - if (~open) | (next==number_of_statements) - parsing = 0 ; - end - end - - cr_ports = mttGetFieldNames(cr.interface,'port') ; - for i = 1:length(operator.var) - current_var = operator.var{i} ; - mttAssert(~ismember(current_var,cr.numpar),... - ['Variable "',current_var,'" redeclares CR numerical parameter in ',cr_name]) ; - mttAssert(~ismember(current_var,cr.sympar),... - ['Variable "',current_var,'" redeclares CR parameter in ',cr_name]) ; - mttAssert(~ismember(current_var,cr_ports),... - ['Variable "',current_var,'" redeclares CR port in ',cr_name]) ; - end - - operator = mttParseOperatorEquations(operator,cr,cr_name) ; - - -function context = mttGetOperatorContext(line,cr,cr_name) - index = sort([findstr(line,'|'),findstr(line,'<'),findstr(line,'>')]) ; - assignment = findstr(line,':=') ; - - mttAssert(length(assignment)==1,... - ['Operator declaration must contain a unique ":=" assignment in cr ',cr_name]) ; - mttAssert(length(index)>0,... - ['Operator declaration without ports in cr ',cr_name]) ; - - left_side = index(indexassignment) ; - - mttAssert(length(left_side)>0,... - ['Operator declaration without input ports in cr ',cr_name]) ; - mttAssert(length(right_side)>0,... - ['Operator declaration without output ports in cr ',cr_name]) ; - mttAssert(mod(length(left_side),2)==0 & mod(length(right_side),2)==0,... - ['Operator declaration has mismatched tags in cr ',cr_name]) ; - - context.name = mttClipText(line(assignment+2:right_side(1)-1)) ; - mttAssert(~isempty(context.name),... - ['Operator declaration is anonymous in cr ',cr_name]) ; - - mttValidateName(context.name) ; - - - counter = 0 ; - - for i = 1:length(index)/2 - counter = counter + 1 ; - link = [] ; - - right = 2*i ; - left = right - 1 ; - - if index(right)assignment - link.is_input = 1 ; - end - - - recognised = 1 ; - switch line(index([left,right])) - case '|>', - link.is_flow = 1 ; - link.is_effort = 0 ; - case '<|', - link.is_flow = 0 ; - link.is_effort = 1 ; - case '<>', - link.is_flow = 1 ; - link.is_effort = 1 ; - otherwise, - recognised = 0 ; - end - - mttAssert(recognised,... - ['Unrecognised tags in operator ',context.name,' (cr ',cr_name,')']) ; - - port_declaration = line(index(left):index(right)) ; - port = line(index(left)+1:index(right)-1) ; - mttAssert(~isempty(port),... - ['Empty port in operator ',context.name,' (cr ',cr_name,')']) ; - - [port_name,qualifier] = mttCutText(port,'=') ; - - link.name = port_name ; - - if isempty(qualifier) - link.is_unconstrained = 1 ; - else - link.is_unconstrained = 0 ; - mttAssert(strcmp(qualifier,'0'),... - ['Non-zero port constraint in operator ',context.name,' (cr ',cr_name,')']) ; - end - - context.link(counter) = link ; - end - - - cr_port_names = mttGetFieldNames(cr.interface,'port') ; - - check.is_input = [] ; - check.is_output = [] ; - check.is_effort = [] ; - check.is_flow = [] ; - - for j = 1:length(cr_port_names) - port_check(j) = check ; - end - - for i = 1:counter - port_name = context.link(i).name ; - mttAssert(ismember(port_name,cr_port_names),... - ['Operator declaration uses undefined port "',port_name,'" in cr ',cr_name]) ; - - index = strmatch(port_name,cr_port_names,'exact') ; - - mttAssert(~mttIsEqual(port_check(index).is_input,context.link(i).is_input),... - ['Operator declaration has repeated input ports in cr ',cr_name]) ; - mttAssert( mttIsEqual(port_check(index).is_output,context.link(i).is_input),... - ['Operator declaration has repeated output ports in cr ',cr_name]) ; - mttAssert(~mttIsEqual(port_check(index).is_flow,context.link(i).is_flow),... - ['Operator declaration has repeated flow in cr ',cr_name]) ; - mttAssert(~mttIsEqual(port_check(index).is_effort,context.link(i).is_effort),... - ['Operator declaration has repeated effort in cr ',cr_name]) ; - - port_check(index).is_input = context.link(i).is_input ; - port_check(index).is_output = ~context.link(i).is_input ; - port_check(index).is_flow = context.link(i).is_flow ; - port_check(index).is_effort = context.link(i).is_effort ; - end - - for j = 1:length(cr_port_names) - mttAssert(~isempty(port_check(j).is_input),... - ['Operator declaration has missing input ports in cr ',cr_name]) ; - mttAssert(~isempty(port_check(j).is_output),... - ['Operator declaration has missing output ports in cr ',cr_name]) ; - mttAssert(~isempty(port_check(j).is_flow),... - ['Operator declaration has missing flow in cr ',cr_name]) ; - mttAssert(~isempty(port_check(j).is_effort),... - ['Operator declaration has missing effort in cr ',cr_name]) ; - end DELETED mttroot/ntt/bin/trans/m/mttFetchSpecification.m Index: mttroot/ntt/bin/trans/m/mttFetchSpecification.m ================================================================== --- mttroot/ntt/bin/trans/m/mttFetchSpecification.m +++ mttroot/ntt/bin/trans/m/mttFetchSpecification.m @@ -1,189 +0,0 @@ -function model = mttFetchSpecification(filename) - -model = [] ; - -mttAssert(mttFileExists(filename),... - ['File "',filename,'" not found']) ; - -mttNotify([' ...processing ',filename]) ; -mttWriteNewLine ; - -model.specification = filename ; - -model.source = mttCutText(filename,'_abg.txt') ; -model_name = mttDetachText(model.source,'/') ; - -content = mttReadFile(filename) ; -statements = mttExtractStatements(content) ; - -number_of_statements = length(statements) ; - -abg_declared = 0 ; -next = 0 ; - -parsing = 1 ; -while parsing - next = next + 1 ; - statement = statements{next} ; - [keyword,line] = mttSeparateText(statement) ; - - switch keyword - case 'abg', - mttAssert(~abg_declared,... - '"abg" declaration must be unique') ; - abg_declared = 1 ; - - abg_name = mttCutText(line,'[') ; - mttAssert(strcmp(abg_name,model_name),... - ['Wrong name:[',abg_name,'] Expecting:[',model_name,']']) ; - - abg_parameter_list = mttExtractText(line,'[',']') ; - [abg_parameters,abg_defaults] = mttGetParameters(abg_parameter_list) ; - - model.name = abg_name ; - - model.sympar = abg_parameters ; - model.sympar_default = abg_defaults ; - - [abg,next] = fetch_abg(statements,next) ; - - model = mttAppendFields(model,abg) ; - - case '{', - error('Unexpected "{" found') ; - case '}', - error('Unexpected "}" found') ; - otherwise, - error(['Unrecognised top-level keyword "',keyword,'"']) ; - end - - if next==number_of_statements - parsing = 0 ; - end -end - -mttCheckBondgraphDeclarations(model) ; - - - -function [abg,next] = fetch_abg(statements,next) -global mtt_environment - - abg = [] ; - unit_name = 'abg' ; - - user_defined_paths = mttGetFieldNames(mtt_environment,'path') ; - - number_of_statements = length(statements) ; - - bondgraph = [] ; - use_declared = 0 ; - open = 0 ; - - parsing = 1 ; - while parsing - next = next + 1 ; - statement = statements{next} ; - [keyword,line] = mttSeparateText(statement) ; - - switch keyword - case 'use', - mttAssert(open,... - ['"use" declaration must be contained inside {...} in "',unit_name,'"']) ; - mttAssert(~use_declared,... - '"use" declaration must be unique') ; - - use_declared = 1 ; - bondgraph = line ; - - abg.bondgraph = bondgraph ; - - case 'input', - mttAssert(open,... - ['"input" declarations must be contained inside {...} in "',unit_name,'"']) ; - - input_parameter_list = line ; - [input_parameters,input_defaults] = mttGetParameters(input_parameter_list) ; - - abg = mttAppend(abg,'input',input_parameters) ; - abg = mttAppend(abg,'input_default',input_defaults) ; - - case 'numpar', - mttAssert(open,... - ['"numpar" declarations must be contained inside {...} in "',unit_name,'"']) ; - - numerical_parameter_list = line ; - [numerical_parameters,numerical_defaults] = mttGetParameters(numerical_parameter_list) ; - - abg = mttAppend(abg,'numpar',numerical_parameters) ; - abg = mttAppend(abg,'numpar_default',numerical_defaults) ; - - case 'object', - mttAssert(open,... - ['"object" declarations must be contained inside {...} in "',unit_name,'"']) ; - - object_names = mttGetFieldNames(abg,'obj') ; - - [object_name,object_spec] = mttCutText(line,':=') ; - mttAssert(~ismember(object_name,object_names),... - ['Object "',object_name,'" already declared']) ; - - implementation = mttCutText(object_spec,'[') ; - mttAssert(~isempty(implementation),... - ['Incomplete specification:[',line,']']) ; - - object_parameter_list = mttExtractText(line,'[',']') ; - object_parameters = mttGetInstanceParameters(object_parameter_list) ; - - [source,name.item] = mttCutText(implementation,'::') ; - [name.class,name.path] = mttDetachText(source,'/') ; - - if isempty(name.class) - name.class = source ; - name.path = [] ; - else - mttAssert(~isempty(name.path),... - ['Empty path name in "',unit_name,'"']) ; - if name.path(1)=='$' - [path_alias,path_branch] = mttCutText(name.path,'/') ; - path_alias(1) = [] ; - - mttAssert(ismember(path_alias,user_defined_paths),... - ['Path "',path_alias,'" not recognised']) ; - - path_root = getfield(mtt_environment,'path',path_alias) ; - if isempty(path_branch) - name.path = path_root ; - else - name.path = [path_root,'/',path_branch] ; - end - end - end - - abg = setfield(abg,'obj',object_name,'name',name) ; - abg = setfield(abg,'obj',object_name,'parameter',object_parameters) ; - - case '{', - mttAssert(~open,['Unmatched "{" in "',unit_name,'"']) ; - open = 1 ; - case '}', - mttAssert(open,['Unmatched "}" in "',unit_name,'"']) ; - open = 0 ; - otherwise, - error(['Unrecognised_keyword "',keyword,'" in "',unit_name,'"']) ; - end - - mttAssert(~(open & (next==number_of_statements)),... - ['Missing "}" in "',unit_name,'"']) ; - - if (~open) | (next==number_of_statements) - parsing = 0 ; - end - end - - abg = mttSetFieldDefault(abg,'input',[]) ; - abg = mttSetFieldDefault(abg,'input_default',[]) ; - abg = mttSetFieldDefault(abg,'numpar',[]) ; - abg = mttSetFieldDefault(abg,'numpar_default',[]) ; - abg = mttSetFieldDefault(abg,'bondgraph',[]) ; - DELETED mttroot/ntt/bin/trans/m/mttFetchStruct.m Index: mttroot/ntt/bin/trans/m/mttFetchStruct.m ================================================================== --- mttroot/ntt/bin/trans/m/mttFetchStruct.m +++ mttroot/ntt/bin/trans/m/mttFetchStruct.m @@ -1,108 +0,0 @@ -function model = mttFetchStruct(filename) - -model.representation = 'struct' ; - -mttAssert(mttFileExists(filename),... - ['File "',filename,'" not found']) ; - -mttNotify([' ...processing ',filename]) ; -mttWriteNewLine ; - -model.source = mttCutText(filename,'_struct.txt') ; -content = mttReadFile(filename) ; -statements = mttExtractStatements(content) ; - -number_of_statements = length(statements) ; - -next = 0 ; - -parsing = 1 ; -while parsing - next = next + 1 ; - statement = statements{next} ; - [keyword,line] = mttSeparateText(statement) ; - - switch keyword - case {'struct','public_struct','private_struct'}, - struct_name = line ; - mttValidateName(struct_name) ; - - [struct,next] = fetch_struct(statements,next,struct_name) ; - model = setfield(model,'item',struct_name,struct) ; - - is_private = strcmp(keyword,'private_struct') ; - model = setfield(model,'item',struct_name,'is_private',is_private) ; - - case '{', - error('Unexpected "{" found') ; - case '}', - error('Unexpected "}" found') ; - otherwise, - error(['Unrecognised top-level keyword "',keyword,'"']) ; - end - - if next==number_of_statements - parsing = 0 ; - end -end - - -function [struct,next] = fetch_struct(statements,next,struct_name) - struct = [] ; - unit_name = 'struct' ; - - number_of_statements = length(statements) ; - - counter = 0 ; - open = 0 ; - - parsing = 1 ; - while parsing - next = next + 1 ; - statement = statements{next} ; - [keyword,line] = mttSeparateText(statement) ; - - switch keyword - case 'var', - mttAssert(open,... - ['"var" declarations must be contained inside {...} in "',unit_name,'"']) ; - mttAssert(~isempty(line),... - ['Undefined "var" in "',unit_name,'"']) ; - - data_name = line ; - mttValidateName(data_name) ; - - counter = counter + 1 ; - struct.var(counter).name = data_name ; - struct.var(counter).type = [] ; - - case '{', - mttAssert(~open,['Unmatched "{" in "',unit_name,'"']) ; - open = 1 ; - case '}', - mttAssert(open,['Unmatched "}" in "',unit_name,'"']) ; - open = 0 ; - otherwise, - mttAssert(open,... - ['Declarations must be contained inside {...} in "',unit_name,'"']) ; - mttAssert(~isempty(line),... - ['Empty declaration in "',unit_name,'"']) ; - - data_name = line ; - mttValidateName(data_name) ; - - data_type = keyword ; - mttValidateName(data_type) ; - - counter = counter + 1 ; - struct.var(counter).name = data_name ; - struct.var(counter).type = data_type ; - end - - mttAssert(~(open & (next==number_of_statements)),... - ['Missing "}" in "',unit_name,'"']) ; - - if (~open) | (next==number_of_statements) - parsing = 0 ; - end - end DELETED mttroot/ntt/bin/trans/m/mttIdentifyDomainCovariables.m Index: mttroot/ntt/bin/trans/m/mttIdentifyDomainCovariables.m ================================================================== --- mttroot/ntt/bin/trans/m/mttIdentifyDomainCovariables.m +++ mttroot/ntt/bin/trans/m/mttIdentifyDomainCovariables.m @@ -1,97 +0,0 @@ -function compound_item = mttIdentifyDomainCovariables(item,domain,model) - domains = mttGetFieldNames(model,'domain') ; - - domain_name = domain.source ; - domain_shortname = mttDetachText(domain_name,'/') ; - - item_names = mttGetFieldNames(domain,'item') ; - - number_of_bonds = mttGetFieldLength(item,'bond') ; - - if number_of_bonds==0 - compound_item.effort = {item.covar.effort} ; - compound_item.flow = {item.covar.flow} ; - - compound_item.effort_default = {item.covar.effort_default} ; - compound_item.flow_default = {item.covar.flow_default} ; - - else - counter = 0 ; - for k = 1:number_of_bonds - bond = item.bond(k) ; - - [next_domain,next_item] = mttCutText(bond.domain,'::') ; - if isempty(next_item) - mttAssert(ismember(next_item,item_names),... - ['Unrecognised reference "',next_item,'" in domain ',domain_shortname]) ; - - next_item = bond.domain ; - dependent_item = getfield(domain,'item',next_item) ; - compound_domain = mttIdentifyDomainCovariables(dependent_item,domain,model) ; - else - mttAssert(ismember(next_domain,domains),... - ['Unrecognised domain reference "',next_domain,'" in domain ',domain_shortname]) ; - - next_domain_index = getfield(model,'domain',next_domain,'dom') ; - next_domain_item_reference = getfield(model,'domain',next_domain,'item') ; - - mttAssert(isempty(next_domain_item_reference),... - ['Constrained domain reference "',next_domain,'" in domain ',domain_shortname]) ; - - actual_domain = model.dom(next_domain_index) ; - - actual_domain_name = actual_domain.source ; - actual_domain_shortname = mttDetachText(actual_domain_name,'/') ; - - actual_item_names = mttGetFieldNames(actual_domain,'item') ; - mttAssert(ismember(next_item,actual_item_names),... - ['Unrecognised reference "',next_item,'" in domain ',actual_domain_shortname]) ; - - dependent_item = getfield(actual_domain,'item',next_item) ; - mttAssert(~dependent_item.is_private,... - ['No public cross-reference available for "',next_item,'" in domain ',actual_domain_shortname]) ; - - compound_domain = mttIdentifyDomainCovariables(dependent_item,actual_domain,model) ; - end - - for i = 1:length(compound_domain.effort) - counter = counter + 1 ; - if isempty(bond.name) - compound_effort{counter} = compound_domain.effort{i} ; - compound_flow{counter} = compound_domain.flow{i} ; - else - compound_effort{counter} = [bond.name,'.',compound_domain.effort{i}] ; - compound_flow{counter} = [bond.name,'.',compound_domain.flow{i}] ; - end - compound_effort_default{counter} = compound_domain.effort_default{i} ; - compound_flow_default{counter} = compound_domain.flow_default{i} ; - end - end - - depth = length(compound_effort) ; - for n = 1:depth-1 - mttAssert(~ismember(compound_effort{n},{compound_effort{n+1:depth}}),... - ['Repeated effort variable "',compound_effort{n},'" in domain ',domain_shortname]) ; - mttAssert(~ismember(compound_flow{n},{compound_flow{n+1:depth}}),... - ['Repeated flow variable "',compound_flow{n},'" in domain ',domain_shortname]) ; - end - - for n = 1:depth - mttAssert(~ismember(compound_effort{n},{compound_flow{1:depth}}),... - ['Ambiguous effort/flow variable "',compound_effort{n},'" in domain ',domain_shortname]) ; - mttAssert(~ismember(compound_flow{n},{compound_effort{1:depth}}),... - ['Ambiguous flow/effort variable "',compound_flow{n},'" in domain ',domain_shortname]) ; - end - - mttAssert(~ismember('flow',{compound_effort{1:depth}}),... - ['Effort variable called "flow" in domain ',domain_shortname]) ; - mttAssert(~ismember('effort',{compound_flow{1:depth}}),... - ['flow variable called "effort" in domain ',domain_shortname]) ; - - compound_item.effort = compound_effort ; - compound_item.flow = compound_flow ; - - compound_item.effort_default = compound_effort_default ; - compound_item.flow_default = compound_flow_default ; - end - DELETED mttroot/ntt/bin/trans/m/mttIdentifyStructVariables.m Index: mttroot/ntt/bin/trans/m/mttIdentifyStructVariables.m ================================================================== --- mttroot/ntt/bin/trans/m/mttIdentifyStructVariables.m +++ mttroot/ntt/bin/trans/m/mttIdentifyStructVariables.m @@ -1,40 +0,0 @@ -function compound_item = mttIdentifyStructVariables(item,struct,model) - structs = mttGetFieldNames(model,'struct') ; - - struct_name = struct.source ; - struct_shortname = mttDetachText(struct_name,'/') ; - - item_names = mttGetFieldNames(struct,'item') ; - - number_of_vars = mttGetFieldLength(item,'var') ; - - counter = 0 ; - for k = 1:number_of_vars - var = item.var(k) ; - - next_item = var.type ; - if isempty(next_item) - counter = counter + 1 ; - compound_var{counter} = var.name ; - else - mttAssert(ismember(next_item,item_names),... - ['Unrecognised reference "',next_item,'" in struct ',struct_shortname]) ; - - dependent_item = getfield(struct,'item',next_item) ; - compound_struct = mttIdentifyStructVariables(dependent_item,struct,model) ; - - for i = 1:length(compound_struct.var) - counter = counter + 1 ; - compound_var{counter} = [var.name,'.',compound_struct.var{i}] ; - end - end - - variables = length(compound_var) ; - for n = 1:variables-1 ; - mttAssert(~ismember(compound_var{n},{compound_var{n+1:variables}}),... - ['Repeated variable "',compound_var{n},'" in struct ',struct_shortname]) ; - end - - compound_item.var = compound_var ; - end - DELETED mttroot/ntt/bin/trans/m/mttParseOperatorEquations.m Index: mttroot/ntt/bin/trans/m/mttParseOperatorEquations.m ================================================================== --- mttroot/ntt/bin/trans/m/mttParseOperatorEquations.m +++ mttroot/ntt/bin/trans/m/mttParseOperatorEquations.m @@ -1,318 +0,0 @@ -function operator = mttParseOperatorEquations(operator,cr,cr_name) -global mtt_environment - - operator.equation = [] ; -% operator.is_used = 0 ; - - numparlist = cr.numpar ; - symparlist = cr.sympar ; - varlist = operator.var ; - inputlist = cr.input ; - statelist = cr.state ; - - structlist = [] ; - if ~isempty(operator.struct) - struct_names = mttGetFieldNames(operator,'struct') ; - number_of_structs = length(struct_names) ; - for i = 1:number_of_structs - struct_name = struct_names{i} ; - variables = getfield(operator,'struct',struct_name) ; - if i==1 - structlist = variables ; - else - structlist = [structlist,variables] ; - end - end - end - - - inlist = [] ; - outlist = [] ; - inlink = [] ; - outlink = [] ; - - input_counter = 0 ; - output_counter = 0 ; - - for i = 1:length(operator.link) - if operator.link(i).is_input - input_counter = input_counter + 1 ; - inlist{input_counter} = operator.link(i).name ; - inlink(input_counter) = i ; - infree(input_counter) = operator.link(i).is_unconstrained ; - else - output_counter = output_counter + 1 ; - outlist{output_counter} = operator.link(i).name ; - outlink(output_counter) = i ; - outfree(output_counter) = operator.link(i).is_unconstrained ; - end - end - - - operator.assign = [] ; - ports_with_state_assignment = [] ; - - for i = 1:length(operator.set) - [port_covariable,state] = mttCutText(operator.set{i},'=>') ; - mttAssert(~isempty(state),... - ['"set" declarations must use "=>" in cr ',cr_name]) ; - - [port_name,covariable] = mttCutText(port_covariable,'.') ; - mttAssert(~isempty(covariable),... - ['"set" declarations must reference effort/flow covariables in cr ',cr_name]) ; - - port = strmatch(port_name,outlist,'exact') ; - ports_with_state_assignment = [ports_with_state_assignment,port] ; - - mttAssert(~isempty(port),... - ['Output port "',port_name,'" not recognised for "set" declaration in cr ',cr_name]) ; - mttAssert(outfree(port),... - ['Constrained port variable used for "set" declaration in cr ',cr_name]) ; - - actual_port = getfield(cr.interface.port,port_name) ; - mttAssert(actual_port.is_effort_state | actual_port.is_flow_state,... - ['"set" declarations must only be used for effort_states or flow_states in cr ',cr_name]) ; - - if isempty(actual_port.domain) - if actual_port.is_effort_state - covariables = {'effort'} ; - elseif actual_port.is_flow_state - covariables = {'flow'} ; - end - else - public_domain = mtt_environment.public_domain(actual_port.domain) ; - domain_item = getfield(public_domain.item,actual_port.domain_item) ; - - if actual_port.is_effort_state - covariables = domain_item.effort ; - elseif actual_port.is_flow_state - covariables = domain_item.flow ; - end - end - - index = strmatch(covariable,covariables,'exact') ; - mttAssert(~isempty(index),... - ['Unrecognised covariable "',covariable,'" used for "set" declaration in cr ',cr_name]) ; - - if isfield(operator.assign,port_name) - assignment = getfield(operator,'assign',port_name) ; - mttAssert(isempty(assignment.states{index}),... - ['Repeated covariable "',covariable,'" used for "set" declaration in cr ',cr_name]) ; - else - assignment.covar = covariables ; - assignment.state{length(covariables)} = [] ; -% assignment.domain = actual_port.domain ; -% assignment.domain_item = actual_port.domain_item ; - end - - mttAssert(ismember(state,cr.state),... - ['Unrecognised state "',state,'" used for "set" declaration in cr ',cr_name]) ; - - assignment.state{index} = state ; - operator = setfield(operator,'assign',port_name,assignment) ; - end - operator = mttDeleteField(operator,'set') ; - - - port_assignments = mttGetFieldNames(operator,'assign') ; - number_of_assignments = length(port_assignments) ; - for i = 1:number_of_assignments - assignment = getfield(operator,'assign',port_name) ; - for j = 1:length(assignment.state) - mttAssert(~isempty(assignment.state{j}),... - ['Missing covariable "',covariable,'" from "set" declaration in cr ',cr_name]) ; - end - end - - - for i = 1:length(operator.content) - operator.equation(i).chunk = {[]} ; -% operator.equation(i).was_generic = 1 ; -% operator.equation(i).domain = [] ; -% operator.equation(i).domain_item = [] ; -% operator.equation(i).is_effort = [] ; -% operator.equation(i).covariable = [] ; - - counter = 0 ; - - line = operator.content{i} ; - - if ~isempty(mttClipText(line)) - [var,loc] = mttFindEquationVariables(line) ; - - if loc(1)>1 - front = line(1:loc(1)-1) ; - counter = counter + 1 ; - operator.equation(i).chunk{counter} = front ; - end - - last = length(line) ; - - for j = 1:length(var) - [name,component] = mttCutText(var{j},'.') ; - - if isempty(component) - [name,attribute] = mttCutText(name,'''') ; - - numpar = strmatch(name,numparlist,'exact') ; - sympar = strmatch(name,symparlist,'exact') ; - variable = strmatch(name,varlist,'exact') ; - struct = strmatch(name,structlist,'exact') ; - input = strmatch(name,inputlist,'exact') ; - state = strmatch(name,statelist,'exact') ; - - ok = ~(isempty(numpar)&isempty(sympar)&isempty(variable)&isempty(struct)&isempty(input)&isempty(state)) ; - mttAssert(ok,['Variable ',var{j},' not recognised in cr ',cr_name]) ; - - is_numpar = ~isempty(numpar) ; - is_sympar = ~isempty(sympar) ; - is_var = ~isempty(variable) ; - is_struct = ~isempty(struct) ; - is_input = ~isempty(input) ; - is_state = ~isempty(state) ; - is_derivative = 0 ; - - if ~isempty(attribute) - mttAssert(strcmp(attribute,'dt'),... - ['Unrecognised attribute ',attribute,' in cr ',cr_name]) ; - mttAssert(is_state,... - ['Derivative of non-state variable in cr ',cr_name]) ; - is_state = 0 ; - is_derivative = 1 ; - end - - counter = counter + 1 ; - - if is_numpar - operator.equation(i).chunk{counter} = {'numpar',numpar} ; - end - - if is_sympar - operator.equation(i).chunk{counter} = {'sympar',sympar} ; - end - - if is_var - operator.equation(i).chunk{counter} = {'var',variable} ; - end - - if is_struct - operator.equation(i).chunk{counter} = {'struct',struct} ; - end - - if is_input - operator.equation(i).chunk{counter} = {'input',input} ; - end - - if is_state - operator.equation(i).chunk{counter} = {'state',state} ; - end - - if is_derivative - operator.equation(i).chunk{counter} = {'derivative',state} ; - end - - else - - if j==1 - port = strmatch(name,outlist,'exact') ; - - if ~isempty(ports_with_state_assignment) - mttAssert(~any(port==ports_with_state_assignment),... - ['Use "set" declaration to assign output port ',name,' to state in cr ',cr_name]) ; - end - - mttAssert(~isempty(port),... - ['Output port ',name,' not recognised in cr ',cr_name]) ; - mttAssert(outfree(port),... - ['Constrained port variable used in cr ',cr_name]) ; - - counter = counter + 1 ; - operator.equation(i).chunk{counter} = {'link',outlink(port),component} ; - else - port = strmatch(name,inlist,'exact') ; - mttAssert(~isempty(port),... - ['Input port ',name,' not recognised in cr ',cr_name]) ; - mttAssert(infree(port),... - ['Constrained port variable used in cr ',cr_name]) ; - - counter = counter + 1 ; - operator.equation(i).chunk{counter} = {'link',inlink(port),component} ; - end - - -% equation_domain = mttIdentifyUserDomain(mtt_environment,... -% operator.equation(i).domain,.... -% operator.equation(i).domain_item) ; - - covariable = component ; - port_name = name ; - port = getfield(cr.interface.port,port_name) ; - - if isempty(port.domain) - is_effort = strcmp(covariable,'effort') ; - is_flow = strcmp(covariable,'flow') ; - - mttAssert(is_effort|is_flow, ... - ['"',covariable,'" is not a generic covariable']) ; - -% mttAssert(isempty(operator.equation(i).domain),... -% ['Generic interface "',port_name,'" referenced in ',equation_domain,' equation']) ; - else - public_domain = mtt_environment.public_domain(port.domain) ; - actual_domain = getfield(public_domain,'item',port.domain_item) ; - - port_domain = mttIdentifyUserDomain(mtt_environment,port.domain,port.domain_item) ; - - is_effort = ismember(covariable,actual_domain.effort) ; - is_flow = ismember(covariable,actual_domain.flow) ; - - mttAssert(is_effort|is_flow, ... - ['"',covariable,'" is not a covariable defined in domain "',port_domain,'"']) ; - -% if isempty(equation_domain) -% operator.equation(i).was_generic = 0 ; -% operator.equation(i).domain = port.domain ; -% operator.equation(i).domain_item = port.domain_item ; - % operator.equation(i).covariable = covariable ; - % else - % mttAssert(covariable==operator.equation(i).covariable, ... - % ['Equation cannot combine different covariables: [',covariable,',',operator.equation(i).covariable,']') ; -% end - end - -% if isempty(operator.equation(i).is_effort) -% if is_effort -% operator.equation(i).is_effort = 1 ; -% else -% operator.equation(i).is_effort = 0 ; -% end -% else -% mttAssert(operator.equation(i).is_effort==is_effort,... -% ['Effort and flow covariables appear in equation: "',operator.content{i},'"']) ; -% end - end - - next = loc(j) + length(var{j}) ; - - if j1,... - ['Less than two interfaces at 0-junction ',here]) ; - - imposed_effort = [] ; - resultant_flow = [] ; - - for j = 1:number_of_interfaces - inbond = object.interface(j).in ; - outbond = object.interface(j).out ; - - if isempty(inbond) - bond(j) = outbond ; - orientation(j) = 0 ; - else - bond(j) = inbond ; - orientation(j) = 1 ; - end - - [effort,flow,unicausal] = mttGetBondCausality(model,bond(j)) ; - - if ~isempty(effort) - if effort==orientation(j) - mttAssert(isempty(imposed_effort),... - ['Over-determined effort at 0-junction ',here]) ; - imposed_effort = bond(j) ; - end - end - - if ~isempty(flow) - if flow==orientation(j) - mttAssert(isempty(resultant_flow),... - ['Over-determined flow at 0-junction ',here]) ; - resultant_flow = bond(j) ; - end - end - end - - for j = 1:number_of_interfaces - if ~isempty(imposed_effort) - if bond(j)~=imposed_effort - model = mttUpdateBondCausality(model,bond(j),~orientation(j),[],[]) ; - end - end - - if ~isempty(resultant_flow) - if bond(j)~=resultant_flow - model = mttUpdateBondCausality(model,bond(j),[],~orientation(j),[]) ; - end - end - end - - case '1', - mttAssert(number_of_interfaces>1,... - ['Less than two interfaces at 1-junction ',here]) ; - - imposed_flow = [] ; - resultant_effort = [] ; - - for j = 1:number_of_interfaces - inbond = object.interface(j).in ; - outbond = object.interface(j).out ; - - if isempty(inbond) - bond(j) = outbond ; - orientation(j) = 0 ; - else - bond(j) = inbond ; - orientation(j) = 1 ; - end - - [effort,flow,unicausal] = mttGetBondCausality(model,bond(j)) ; - - if ~isempty(effort) - if effort~=orientation(j) - mttAssert(isempty(resultant_effort),... - ['Over-determined effort at 1-junction ',here]) ; - resultant_effort = bond(j) ; - end - end - - if ~isempty(flow) - if flow~=orientation(j) - mttAssert(isempty(imposed_flow),... - ['Over-determined flow at 1-junction ',here]) ; - imposed_flow = bond(j) ; - end - end - end - - for j = 1:number_of_interfaces - if ~isempty(resultant_effort) - if bond(j)~=resultant_effort - model = mttUpdateBondCausality(model,bond(j),orientation(j),[],[]) ; - end - end - - if ~isempty(imposed_flow) - if bond(j)~=imposed_flow - model = mttUpdateBondCausality(model,bond(j),[],orientation(j),[]) ; - end - end - end - end - end - end - DELETED mttroot/ntt/bin/trans/m/mttPropagateDomains.m Index: mttroot/ntt/bin/trans/m/mttPropagateDomains.m ================================================================== --- mttroot/ntt/bin/trans/m/mttPropagateDomains.m +++ mttroot/ntt/bin/trans/m/mttPropagateDomains.m @@ -1,111 +0,0 @@ -function model = mttPropagateDomains(model,branch) - is_root_model = (nargin==1) ; - - objects = mttGetFieldNames(model,'obj') ; - - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - if is_root_model - branch = mttDetachText(model.source,'/') ; - end - here = [branch,':',object_name] ; - - if ~isempty(object.abg) - - for j = 1:mttGetFieldLength(object,'interface') - port_name = object.interface(j).name ; - - inbond = object.interface(j).in ; - outbond = object.interface(j).out ; - inmap = object.interface(j).map.in ; - outmap = object.interface(j).map.out ; - - [inbond_domain,inbond_domain_item] = mttGetBondDomain(model,inbond) ; - [outbond_domain,outbond_domain_item] = mttGetBondDomain(model,outbond) ; - [inmap_domain,inmap_domain_item] = mttGetBondDomain(object,inmap) ; - [outmap_domain,outmap_domain_item] = mttGetBondDomain(object,outmap) ; - - [model,inbond_ok] = mttUpdateBondDomain(model,inbond,inmap_domain,inmap_domain_item) ; - [model,outbond_ok] = mttUpdateBondDomain(model,outbond,outmap_domain,outmap_domain_item) ; - [object,inmap_ok] = mttUpdateBondDomain(object,inmap,inbond_domain,inbond_domain_item) ; - [object,outmap_ok] = mttUpdateBondDomain(object,outmap,outbond_domain,outbond_domain_item) ; - - ok = inbond_ok & outbond_ok & inmap_ok & outmap_ok ; - mttAssert(ok,['Domain conflict at port "',port_name,'" in ',here]) ; - end - - if is_root_model - branch = object_name ; - else - branch = [branch,'/',object_name] ; - end - - object = mttPropagateDomains(object,branch) ; - model = setfield(model,'obj',object_name,object) ; - - elseif ~isempty(object.cr) - - interface = object.cr.interface ; - port_names = mttGetFieldNames(interface,'port') ; - - for j = 1:length(port_names) - port_name = port_names{j} ; - port = getfield(interface,'port',port_name) ; - - inbond = port.in ; - outbond = port.out ; - - [model,inbond_ok] = mttUpdateBondDomain(model,inbond,port.domain,port.domain_item) ; - [model,outbond_ok] = mttUpdateBondDomain(model,outbond,port.domain,port.domain_item) ; - - ok = inbond_ok & outbond_ok ; - mttAssert(ok,['Domain conflict at port "',port_name,'" in ',here]) ; - end - - else - - number_of_interfaces = mttGetFieldLength(object,'interface') ; - - switch object.class - case {'0','1'}, - index = 0 ; - finding_domain = 1 ; - - while finding_domain - index = index + 1 ; - - inbond = object.interface(index).in ; - outbond = object.interface(index).out ; - - if isempty(inbond) - bond_number = outbond ; - else - bond_number = inbond ; - end - - [existing_domain,existing_domain_item] = mttGetBondDomain(model,bond_number) ; - - found_domain = ~isempty(existing_domain) ; - finding_domain = ~found_domain & index0 - RHS.name{j} = [' + ',RHS.name{j}] ; - else - RHS.name{j} = [' - ',RHS.name{j}] ; - end - end - - case 'cell', - [name,covar] = mttCutText(namelist(var{1}).var,'.') ; - RHS.name{1} = name ; - - if strcmp(covar,'effort') | strcmp(covar,'effort_state') - RHS.is_effort = 1 ; - else - RHS.is_effort = 0 ; - end - end - - for k = 1:dimension - if LHS.is_effort - covar = covariables.effort{k} ; - else - covar = covariables.flow{k} ; - end - - content = [LHS.name,'.',strrep(covar,'.','__')] ; - indent = char(32*ones(1,length(content)+3)) ; - - for j = 1:length(RHS.name) - if RHS.is_effort(j) - covar = covariables.effort{k} ; - else - covar = covariables.flow{k} ; - end - - if j==1 - if strcmp(RHS.name{1},'0') - content = [content,' = ',RHS.name{1}] ; - else - content = [content,' = ',RHS.name{1},'.',strrep(covar,'.','__')] ; - end - else - content = [content,'\n',indent,RHS.name{j},'.',strrep(covar,'.','__')] ; - end - end - - content = [content,' ;'] ; - - if ~isempty(content) - eqn_counter = eqn_counter + 1 ; - eqn{eqn_counter} = content ; - end - end - - else - op = [sse(i).operator] ; - [cr,operator] = mttCutText(op,'___') ; - - if ~strcmp(eqn{eqn_counter},'') - eqn_counter = eqn_counter + 1 ; - eqn{eqn_counter} = [''] ; - end - eqn_counter = eqn_counter + 1 ; - eqn{eqn_counter} = ['// ',op] ; - - - [root,hierarchy] = mttCutText(cr,'__') ; - - level = length(findstr(cr,'__')) ; - for j = 1:level - [obj{j},hierarchy] = mttCutText(hierarchy,'__') ; - end - - object = getfield(model,'obj',obj{1}) ; - for j = 2:level - object = getfield(object,'obj',obj{j}) ; - end - - index = strmatch(operator,{object.cr.operator.name},'exact') ; - cr_definition = object.cr ; - operator_definition = cr_definition.operator(index) ; - - - - structlist = [] ; - if ~isempty(operator_definition.struct) - struct_names = mttGetFieldNames(operator_definition,'struct') ; - number_of_structs = length(struct_names) ; - for i = 1:number_of_structs - struct_name = struct_names{i} ; - variables = getfield(operator_definition,'struct',struct_name) ; - if i==1 - structlist = variables ; - else - structlist = [structlist,variables] ; - end - end - end - - - - - reassigned_state_list = [] ; - counter = 0 ; - - - port_names = mttGetFieldNames(cr_definition.interface,'port') ; - for j = 1:length(port_names) - port_name = port_names{j} ; - port = getfield(cr_definition,'interface','port',port_name) ; - - if ~isempty(port.assign) - assignment = port.assign ; - - - if port.was_generic & ~isempty(port.domain) - covar = mttGetCovariables(model.env,port.domain,port.domain_item) ; - if port.is_effort_state - covar = covariables.effort ; - else - covar = covariables.flow ; - end - - for k = 1:length(assignment.state) - counter = counter + 1 ; - reassigned_state_list.name{counter} = assignment.state{k} ; - reassigned_state_list.covar{counter} = covar ; - end - - - block_size = length(covar) ; - for var = 1:block_size - segment = [] ; - - for k = 1:length(assignment.state) - segment{1} = [cr,'___',port_name,'.',strrep(covar{var},'.','__')] ; - segment{2} = [' = '] ; - segment{3} = [cr,'___',assignment.state{k},'___',strrep(covar{var},'.','__'),'.state ;'] ; - - ini_counter = ini_counter + 1 ; - ini{ini_counter} = [segment{1},segment{2},segment{3}] ; - end - end - else - - for k = 1:length(assignment.state) - segment{1} = [cr,'___',port_name,'.',strrep(assignment.covar{k},'.','__')] ; - segment{2} = [' = '] ; - segment{3} = [cr,'___',assignment.state{k},'.state ;'] ; - - ini_counter = ini_counter + 1 ; - ini{ini_counter} = [segment{1},segment{2},segment{3}] ; - end - end - end - end - - - equations = operator_definition.equation ; - for j = 1:length(equations) - equation = equations(j) ; - number_of_chunks = mttGetFieldLength(equation,'chunk') ; - - equation.domain = [] ; - equation.domain_item = [] ; - - for k = 1:number_of_chunks - chunk = equation.chunk{k} ; - - switch class(chunk) - case 'cell' - type = chunk{1} ; - index = chunk{2} ; - - switch type - case 'link' - port_name = operator_definition.link(index).name ; - port = getfield(cr_definition,'interface','port',port_name) ; - - if port.was_generic & ~isempty(port.domain) - if isempty(equation.domain) - equation.domain = port.domain ; - equation.domain_item = port.domain_item ; - else - same_domain = equation.domain==port.domain ; - same_domain_item = strcmp(equation.domain_item,port.domain_item) ; - mttAssert(same_domain&same_domain_item,... - ['Attempt to overwrite implicit variables with conflicting domains in "',... - operator_definition.content{j},'"']) ; - end - end - end - end - end - - - covariables = mttGetCovariables(model.env,equation.domain,equation.domain_item) ; -% if equation.is_effort -% covar = covariables.effort ; -% else -% covar = covariables.flow ; -% end - - block_size = length(covariables.effort) ; - - - for line = 1:block_size - segment = [] ; - content = [] ; - - for k = 1:number_of_chunks - chunk = equation.chunk{k} ; - - switch class(chunk) - case 'cell' - type = chunk{1} ; - index = chunk{2} ; - - switch type - case 'link' - port_variable = [cr,'___',operator_definition.link(index).name] ; - - if strcmp(chunk{3},'generic___effort') - segment{k} = [port_variable,'.',strrep(covariables.effort{line},'.','__')] ; - elseif strcmp(chunk{3},'generic___flow') - segment{k} = [port_variable,'.',strrep(covariables.flow{line},'.','__')] ; - else - segment{k} = [port_variable,'.',strrep(chunk{3},'.','__')] ; - end - -% if length(chunk)>2 -% segment{k} = [port_variable,'.',strrep(chunk{3},'.','__')] ; -% else -% segment{k} = [port_variable,'.',strrep(covar{line},'.','__')] ; -% end - - case 'numpar' - segment{k} = [cr,'___',cr_definition.numpar{index}] ; - - case 'sympar' - parameter = [cr_definition.parameter{index}] ; - if isnumeric(parameter) - segment{k} = num2str(parameter) ; - else - segment{k} = [cr_definition.parameter{index}] ; - end - - case 'var' - segment{k} = [op,'___',operator_definition.var{index}] ; - - case 'struct' - segment{k} = [op,'___',structlist{index}] ; - - case 'input' - segment{k} = [cr,'___',cr_definition.input{index}] ; - - case 'state' - state = cr_definition.state{index} ; - if isempty(reassigned_state_list) - state_reassignment = [] ; - else - state_reassignment = strmatch(state,reassigned_state_list.name,'exact') ; - end - - if isempty(state_reassignment) - segment{k} = [cr,'___',state,'.state'] ; - else - state_covar = reassigned_state_list.covar{line} ; - segment{k} = [cr,'___',state,'___',state_covar{1},'.state'] ; - end - -% segment{k} = [cr,'___',cr_definition.state{index},'.state'] ; - - case 'derivative' - state = cr_definition.state{index} ; - if isempty(reassigned_state_list) - state_reassignment = [] ; - else - state_reassignment = strmatch(state,reassigned_state_list.name,'exact') ; - end - - if isempty(state_reassignment) - segment{k} = [cr,'___',state,'.derivative'] ; - else - state_covar = reassigned_state_list.covar{line} ; - segment{k} = [cr,'___',state,'___',state_covar{1},'.derivative'] ; - end - -% segment{k} = [cr,'___',cr_definition.state{index},'.derivative'] ; - - end - otherwise - chunk = strrep(chunk,':=','=') ; - segment{k} = chunk ; - end - end - - content = [tab,segment{1}] ; - for k = 2:length(segment) - content = [content,segment{k}] ; - end - content = [content,' ;'] ; - - eqn_counter = eqn_counter + 1 ; - eqn{eqn_counter} = content ; - end - end - - eqn_counter = eqn_counter + 1 ; - eqn{eqn_counter} = ['// End of ',op] ; - eqn_counter = eqn_counter + 1 ; - eqn{eqn_counter} = [''] ; - end - end - - eqn = eqn' ; - ini = ini' ; - - -function write_equations(eqn,ini,model) - filename = [model.source,'_include_ode.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - fprintf(fid,'\n\n') ; - - tab = char(32*ones(1,3)) ; - for i = 1:length(ini) - formatted_equation = [tab,ini{i},'\n'] ; - fprintf(fid,formatted_equation) ; - end - fprintf(fid,'\n') ; - for i = 1:length(eqn) - formatted_equation = [tab,eqn{i},'\n'] ; - fprintf(fid,formatted_equation) ; - end - - fclose(fid) ; - DELETED mttroot/ntt/bin/trans/m/mttWriteSystemInitialisation.m Index: mttroot/ntt/bin/trans/m/mttWriteSystemInitialisation.m ================================================================== --- mttroot/ntt/bin/trans/m/mttWriteSystemInitialisation.m +++ mttroot/ntt/bin/trans/m/mttWriteSystemInitialisation.m @@ -1,435 +0,0 @@ -function mttWriteSystemInitialisation(model) - -assignment.numpar = assign_numerical_parameters(model) ; -assignment.sympar = assign_symbolic_parameters(model) ; -assignment.input = assign_input_variables(model) ; -assignment.invar = assign_input_covariables(model) ; -assignment.state = assign_state_variables(model) ; - -write_set_numpar(assignment,model) ; -write_set_input(assignment,model) ; -write_set_state(assignment,model) ; - - - -function code = assign_symbolic_parameters(model) - mttNotify('...assigning symbolic parameters') ; - mttWriteNewLine ; - - model_name = mttDetachText(model.source,'/') ; - - code = [] ; - line = 0 ; - - number_of_variables = mttGetFieldLength(model,'sympar') ; - - for i = 1:number_of_variables - variable_name = model.sympar{i} ; - default = model.sympar_default{i} ; - - if isempty(default) - line = line + 1 ; - code{line} = [model_name,'___',variable_name,' = 1.0 ;'] ; - else - line = line + 1 ; - code{line} = [model_name,'___',variable_name,' = ',default,' ;'] ; - end - end - - -function code = assign_numerical_parameters(model,root,branch) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...assigning numerical parameters') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - else - current_branch = branch ; - end - - code = [] ; - line = 0 ; - - number_of_variables = mttGetFieldLength(model,'numpar') ; - - for i = 1:number_of_variables - variable_name = model.numpar{i} ; - default = model.numpar_default{i} ; - - line = line + 1 ; - if isempty(default) - code{line} = [current_branch,'___',variable_name,' = 1.0 ;'] ; - else - code{line} = [current_branch,'___',variable_name,' = ',default,' ;'] ; - end - end - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - additional_code = [] ; - if ~isempty(object.abg) - additional_code = assign_numerical_parameters(object,root,next_branch) ; - elseif ~isempty(object.cr) - additional_code = assign_numerical_parameters(object.cr,root,next_branch) ; - end - - if isempty(code) - code = additional_code ; - else - line = length(code) ; - for j = 1:length(additional_code) - if ~ismember(additional_code{j},code) - line = line + 1 ; - code{line} = additional_code{j} ; - end - end - end - end - - -function code = assign_input_variables(model,root,branch) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...assigning input variables') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - else - current_branch = branch ; - end - - code = [] ; - line = 0 ; - - number_of_variables = mttGetFieldLength(model,'input') ; - - for i = 1:number_of_variables - variable_name = model.input{i} ; - default = model.input_default{i} ; - - line = line + 1 ; - if isempty(default) - code{line} = [current_branch,'___',variable_name,' = 0.0 ;'] ; - else - code{line} = [current_branch,'___',variable_name,' = ',default,' ;'] ; - end - end - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - additional_code = [] ; - if ~isempty(object.abg) - additional_code = assign_input_variables(object,root,next_branch) ; - elseif ~isempty(object.cr) - additional_code = assign_input_variables(object.cr,root,next_branch) ; - end - - if isempty(code) - code = additional_code ; - else - line = length(code) ; - for j = 1:length(additional_code) - if ~ismember(additional_code{j},code) - line = line + 1 ; - code{line} = additional_code{j} ; - end - end - end - end - - -function code = assign_input_covariables(model,root,branch,env) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...assigning input covariables') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - env = model.env ; - else - current_branch = branch ; - end - - code = [] ; - line = 0 ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - switch object.class - case {'SS','Se','Sf','De','Df'} - inbond_number = object.interface.in ; - outbond_number = object.interface.out ; - - inbond = model.bond(inbond_number) ; - outbond = model.bond(outbond_number) ; - - if ~isempty(inbond) - covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; - covar = [] ; - - if ~inbond.effort - if ~strcmp(object.class,'Df') - covar = covariables.effort ; - end - elseif inbond.flow - if ~strcmp(object.class,'De') - covar = covariables.flow ; - end - end - - for j = 1:length(covar) - line = line + 1 ; - covariable = strrep(covar{j},'.','__') ; - code{line} = [current_branch,'__',object_name,'.',covariable,' = 0.0 ;'] ; - end - end - - if ~isempty(outbond) - covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; - - if outbond.effort - covar = covariables.effort ; - elseif ~outbond.flow - covar = covariables.flow ; - end - - for j = 1:length(covar) - line = line + 1 ; - covariable = strrep(covar{j},'.','__') ; - code{line} = [current_branch,'__',object_name,'.',covariable,' = 0.0 ;'] ; - end - end - end - - additional_code = [] ; - if ~isempty(object.abg) - additional_code = assign_input_covariables(object,root,next_branch,env) ; - end - - if isempty(code) - code = additional_code ; - else - line = length(code) ; - for j = 1:length(additional_code) - if ~ismember(additional_code{j},code) - line = line + 1 ; - code{line} = additional_code{j} ; - end - end - end - end - - -function code = assign_state_variables(model,root,branch,env) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...assigning state variables') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - env = model.env ; - else - current_branch = branch ; - end - - code = [] ; - line = 0 ; - - if isfield(model,'state') - assigned_states = [] ; - counter = 0 ; - - port_names = mttGetFieldNames(model.interface,'port') ; - for j = 1:length(port_names) - port_name = port_names{j} ; - port = getfield(model,'interface','port',port_name) ; - - if ~isempty(port.assign) - assignment = port.assign ; - - if port.was_generic & ~isempty(port.domain) - covariables = mttGetCovariables(env,port.domain,port.domain_item) ; - if port.is_effort_state - covar = covariables.effort ; - default = covariables.effort_default ; - else - covar = covariables.flow ; - default = covariables.flow_default ; - end - - block_size = length(covar) ; - for k = 1:length(assignment.state) - counter = counter + 1 ; - assigned_states{counter} = assignment.state{k} ; - - for var = 1:block_size - line = line + 1 ; - if isempty(default{var}) - code{line} = [current_branch,'___',assignment.state{k},'___',covar{var},'.state = 0.0 ;'] ; - else - code{line} = [current_branch,'___',assignment.state{k},'___',covar{var},'.state = ',default{var},' ;'] ; - end - end - end - end - end - end - - number_of_variables = mttGetFieldLength(model,'state') ; - - for i = 1:number_of_variables - variable_name = model.state{i} ; - default = model.state_default{i} ; - - if ~ismember(variable_name,assigned_states) - line = line + 1 ; - if isempty(default) - code{line} = [current_branch,'___',variable_name,'.state = 0.0 ;'] ; - else - code{line} = [current_branch,'___',variable_name,'.state = ',default,' ;'] ; - end - end - end - end - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - additional_code = [] ; - if ~isempty(object.abg) - additional_code = assign_state_variables(object,root,next_branch,env) ; - elseif ~isempty(object.cr) - additional_code = assign_state_variables(object.cr,root,next_branch,env) ; - end - - if isempty(code) - code = additional_code ; - else - line = length(code) ; - for j = 1:length(additional_code) - if ~ismember(additional_code{j},code) - line = line + 1 ; - code{line} = additional_code{j} ; - end - end - end - end - - -function write_set_numpar(assignment,model) - filename = [model.source,'_include_set_numpar.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// Numerical Parameters for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_assigned_list(fid,[],assignment.numpar,model_name) ; - - fclose(fid) ; - - -function write_set_input(assignment,model) - filename = [model.source,'_include_set_input.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// Default Inputs for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_assigned_list(fid,'symbolic_parameters',assignment.sympar,model_name) ; - write_assigned_list(fid,'input_variables',assignment.input,model_name) ; - write_assigned_list(fid,'input_covariables',assignment.invar,model_name) ; - - fclose(fid) ; - - -function write_set_state(assignment,model) - filename = [model.source,'_include_set_state.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// Initial states for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_assigned_list(fid,[],assignment.state,model_name) ; - - fclose(fid) ; - - -function write_assigned_list(fid,var_type,var_list,model_name) - if ~isempty(var_list) - if ~isempty(var_type) - fprintf(fid,'\n\n') ; - fprintf(fid,['// ',var_type]) ; - end - fprintf(fid,'\n') ; - - var_list = sort(var_list) ; - - width = 0 ; - for i = 1:length(var_list) - [left,right] = mttCutText(var_list{i},'=') ; - width = max(width,length(left)) ; - end - - tab = char(32*ones(1,3)) ; - for i = 1:length(var_list) - [left,right] = mttCutText(var_list{i},'=') ; - - nominal_width = width ; - actual_width = length(left) ; - - gap = nominal_width - actual_width ; - whitespace = char(32*ones(1,gap)) ; - - formatted_assignment = [tab,left,whitespace,' = ',right,'\n'] ; - fprintf(fid,formatted_assignment) ; - end - end DELETED mttroot/ntt/bin/trans/m/mttWriteSystemMapping.m Index: mttroot/ntt/bin/trans/m/mttWriteSystemMapping.m ================================================================== --- mttroot/ntt/bin/trans/m/mttWriteSystemMapping.m +++ mttroot/ntt/bin/trans/m/mttWriteSystemMapping.m @@ -1,528 +0,0 @@ -function mttWriteSystemMapping(model) - -sympar = map_system_sympars(model) ; -input = map_system_inputs(model) ; -invar = map_system_invars(model) ; -outvar = map_system_outvars(model) ; -state = map_system_states(model) ; - -derivative = differentiate(state) ; - -mapping.input = invar ; -if ~isempty(input) - mapping.input = [mapping.input,input] ; -end -if ~isempty(sympar) - mapping.input = [mapping.input,sympar] ; -end - -mapping.output = outvar ; -mapping.state = state ; -mapping.derivative = derivative ; - -write_get_input(mapping,model) ; -write_get_state(mapping,model) ; - -write_put_input(mapping,model) ; -write_put_state(mapping,model) ; -write_put_output(mapping,model) ; -write_put_derivative(mapping,model) ; - - - -function map = map_system_sympars(model) - mttNotify('...mapping system inputs (symbolic parameters)') ; - mttWriteNewLine ; - - model_name = mttDetachText(model.source,'/') ; - - map = [] ; - line = 0 ; - - number_of_variables = mttGetFieldLength(model,'sympar') ; - - for i = 1:number_of_variables - variable_name = model.sympar{i} ; - default_value = model.sympar_default{i} ; - - if isempty(default_value) - line = line + 1 ; - map{line} = [model_name,'___',variable_name] ; - end - end - - -function map = map_system_inputs(model,root,branch) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...mapping system inputs (input variables)') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - else - current_branch = branch ; - end - - map = [] ; - line = 0 ; - - number_of_variables = mttGetFieldLength(model,'input') ; - - for i = 1:number_of_variables - variable_name = model.input{i} ; - - line = line + 1 ; - map{line} = [current_branch,'___',variable_name] ; - end - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - additional_map = [] ; - if ~isempty(object.abg) - additional_map = map_system_inputs(object,root,next_branch) ; - elseif ~isempty(object.cr) - additional_map = map_system_inputs(object.cr,root,next_branch) ; - end - - if isempty(map) - map = additional_map ; - else - line = length(map) ; - for j = 1:length(additional_map) - if ~ismember(additional_map{j},map) - line = line + 1 ; - map{line} = additional_map{j} ; - end - end - end - end - - -function map = map_system_invars(model,root,branch,env) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...mapping system inputs (input covariables)') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - env = model.env ; - else - current_branch = branch ; - end - - map = [] ; - line = 0 ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - switch object.class - case {'SS','Se','Sf','De','Df'} - inbond_number = object.interface.in ; - outbond_number = object.interface.out ; - - inbond = model.bond(inbond_number) ; - outbond = model.bond(outbond_number) ; - - if ~isempty(inbond) - covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; - covar = [] ; - - if ~inbond.effort - if ~strcmp(object.class,'Df') - covar = covariables.effort ; - end - elseif inbond.flow - if ~strcmp(object.class,'De') - covar = covariables.flow ; - end - end - - for j = 1:length(covar) - line = line + 1 ; - map{line} = [current_branch,'__',object_name,'.',strrep(covar{j},'.','__')] ; - end - end - - if ~isempty(outbond) - covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; - covar = [] ; - - if outbond.effort - covar = covariables.effort ; - elseif ~outbond.flow - covar = covariables.flow ; - end - - for j = 1:length(covar) - line = line + 1 ; - map{line} = [current_branch,'__',object_name,'.',strrep(covar{j},'.','__')] ; - end - end - end - - additional_map = [] ; - if ~isempty(object.abg) - additional_map = map_system_invars(object,root,next_branch,env) ; - end - - if isempty(map) - map = additional_map ; - else - line = length(map) ; - for j = 1:length(additional_map) - if ~ismember(additional_map{j},map) - line = line + 1 ; - map{line} = additional_map{j} ; - end - end - end - end - - -function map = map_system_outvars(model,root,branch,env) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...mapping system outputs (output covariables)') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - env = model.env ; - else - current_branch = branch ; - end - - map = [] ; - line = 0 ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - switch object.class - case {'SS','Se','Sf','De','Df'} - inbond_number = object.interface.in ; - outbond_number = object.interface.out ; - - inbond = model.bond(inbond_number) ; - outbond = model.bond(outbond_number) ; - - if ~isempty(inbond) - covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; - covar = [] ; - - if inbond.effort - covar = covariables.effort ; - elseif ~inbond.flow - covar = covariables.flow ; - end - - for j = 1:length(covar) - line = line + 1 ; - map{line} = [current_branch,'__',object_name,'.',strrep(covar{j},'.','__')] ; - end - end - - if ~isempty(outbond) - covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; - covar = [] ; - - if ~outbond.effort - if ~strcmp(object.class,'Sf') - covar = covariables.effort ; - end - elseif outbond.flow - if ~strcmp(object.class,'Se') - covar = covariables.flow ; - end - end - - for j = 1:length(covar) - line = line + 1 ; - map{line} = [current_branch,'__',object_name,'.',strrep(covar{j},'.','__')] ; - end - end - end - - additional_map = [] ; - if ~isempty(object.abg) - additional_map = map_system_outvars(object,root,next_branch,env) ; - end - - if isempty(map) - map = additional_map ; - else - line = length(map) ; - for j = 1:length(additional_map) - if ~ismember(additional_map{j},map) - line = line + 1 ; - map{line} = additional_map{j} ; - end - end - end - end - - -function map = map_system_states(model,root,branch,env) - is_root_model = nargin==1 ; - - if is_root_model - mttNotify('...mapping system states') ; - mttWriteNewLine ; - - root = model ; - current_branch = mttDetachText(model.source,'/') ; - env = model.env ; - else - current_branch = branch ; - end - - map = [] ; - line = 0 ; - - if isfield(model,'state') - assigned_states = [] ; - counter = 0 ; - - port_names = mttGetFieldNames(model.interface,'port') ; - for j = 1:length(port_names) - port_name = port_names{j} ; - port = getfield(model,'interface','port',port_name) ; - - if ~isempty(port.assign) - assignment = port.assign ; - - if port.was_generic & ~isempty(port.domain) - covariables = mttGetCovariables(env,port.domain,port.domain_item) ; - if port.is_effort_state - covar = covariables.effort ; - else - covar = covariables.flow ; - end - - block_size = length(covar) ; - for k = 1:length(assignment.state) - counter = counter + 1 ; - assigned_states{counter} = assignment.state{k} ; - - for var = 1:block_size - line = line + 1 ; - map{line} = [current_branch,'___',assignment.state{k},'___',covar{var},'.state'] ; - end - end - end - end - end - - number_of_variables = mttGetFieldLength(model,'state') ; - - for i = 1:number_of_variables - variable_name = model.state{i} ; - - if ~ismember(variable_name,assigned_states) - line = line + 1 ; - map{line} = [current_branch,'___',variable_name,'.state'] ; - end - end - end - - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - next_branch = [current_branch,'__',object_name] ; - - additional_map = [] ; - if ~isempty(object.abg) - additional_map = map_system_states(object,root,next_branch,env) ; - elseif ~isempty(object.cr) - additional_map = map_system_states(object.cr,root,next_branch,env) ; - end - - if isempty(map) - map = additional_map ; - else - line = length(map) ; - for j = 1:length(additional_map) - if ~ismember(additional_map{j},map) - line = line + 1 ; - map{line} = additional_map{j} ; - end - end - end - end - - -function derivative = differentiate(state) - mttNotify('...mapping system derivatives') ; - mttWriteNewLine ; - - for i = 1:length(state) - derivative{i} = strrep(state{i},'.state','.derivative') ; - end - - -function write_get_input(mapping,model) - filename = [model.source,'_include_get_input.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// Input get-mapping for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_mapping(fid,'_mttInput',mapping.input,model_name,1) ; - - fclose(fid) ; - - -function write_put_input(mapping,model) - filename = [model.source,'_include_put_input.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// Input put-mapping for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_mapping(fid,'_mttInput',mapping.input,model_name,0) ; - - fclose(fid) ; - - -function write_get_state(mapping,model) - filename = [model.source,'_include_get_state.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// State get-mapping for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_mapping(fid,'_mttState',mapping.state,model_name,1) ; - - fclose(fid) ; - - -function write_put_state(mapping,model) - filename = [model.source,'_include_put_state.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// State put-mapping for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_mapping(fid,'_mttState',mapping.state,model_name,0) ; - - fclose(fid) ; - - -function write_put_output(mapping,model) - filename = [model.source,'_include_put_output.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// Output put-mapping for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_mapping(fid,'_mttOutput',mapping.output,model_name,0) ; - - fclose(fid) ; - - -function write_put_derivative(mapping,model) - filename = [model.source,'_include_put_derivative.h'] ; - fid = fopen(filename,'w') ; - - mttNotify(['...creating ',filename]) ; - mttWriteNewLine ; - - fprintf(fid,['// Derivative put-mapping for Ordinary Differential Equations\n']) ; - fprintf(fid,'\n') ; - fprintf(fid,['// file: ',filename,'\n']) ; - fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; - - model_name = mttDetachText(model.source,'/') ; - - write_mapping(fid,'_mttDerivative',mapping.derivative,model_name,0) ; - - fclose(fid) ; - - -function write_mapping(fid,array_name,var_list,model_name,is_inward_mapping) - if ~isempty(var_list) - var_list = sort(var_list) ; - - width = 0 ; - for i = 1:length(var_list) - width = max(width,length(var_list{i})) ; - end - - tab = char(32*ones(1,3)) ; - - fprintf(fid,'\n') ; - for i = 1:length(var_list) - variable = var_list{i} ; - - if is_inward_mapping - nominal_width = width ; - actual_width = length(variable) ; - - gap = nominal_width - actual_width ; - whitespace = char(32*ones(1,gap)) ; - - formatted_mapping = [tab,variable,whitespace,' = ',array_name,'[',num2str(i-1),'] ;\n'] ; - else - formatted_mapping = [tab,array_name,'[',num2str(i-1),'] = ',variable,' ;\n'] ; - end - - fprintf(fid,formatted_mapping) ; - end - end DELETED mttroot/ntt/bin/trans/m/mttWriteSystemSfun.m Index: mttroot/ntt/bin/trans/m/mttWriteSystemSfun.m ================================================================== --- mttroot/ntt/bin/trans/m/mttWriteSystemSfun.m +++ mttroot/ntt/bin/trans/m/mttWriteSystemSfun.m @@ -1,250 +0,0 @@ -function mttWriteSystemSfun(model) - -model_name = mttDetachText(model.source,'/') ; - -working_directory = pwd ; -working_directory = strrep(working_directory,'\','/') ; - -filename = [working_directory,'/',model_name,'_sfun.cpp'] ; -fid = fopen(filename,'w') ; - -mttNotify(['...creating ',filename]) ; -mttWriteNewLine ; - -model_name = mttDetachText(model.source,'/') ; - -fprintf(fid,['// Simulation Code for "',model_name,'"\n']) ; -fprintf(fid,'\n') ; -fprintf(fid,['// file: ',filename ,'\n']) ; -fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; -fprintf(fid,'\n') ; - -write_sfun(fid,model) ; - -fclose(fid) ; - - -function write_sfun(fid,model) - model_name = mttDetachText(model.source,'/') ; - counter = mttCountSystemMapping(model) ; - - fprintf(fid,['#define S_FUNCTION_NAME ',model_name,'_sfun' ,'\n']) ; - fprintf(fid,['#define S_FUNCTION_LEVEL 2' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_def.h"' ,'\n']) ; - - if isfield(model,'app') - if ~isempty(model.app) - fprintf(fid,['#include "',model_name,'_include_apps.h"' ,'\n']) ; - end - end - - fprintf(fid,['#include "simstruc.h"' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static double *_mttInput ;' ,'\n']) ; - fprintf(fid,['static double *_mttState ;' ,'\n']) ; - fprintf(fid,['static double *_mttDerivative ;' ,'\n']) ; - fprintf(fid,['static double *_mttOutput ;' ,'\n']) ; - fprintf(fid,['static double _mttTime ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static unsigned int _mttIndex ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['const int _mttNumInputs = ',num2str(counter.input),' ;' ,'\n']) ; - fprintf(fid,['const int _mttNumOutputs = ',num2str(counter.output),' ;' ,'\n']) ; - fprintf(fid,['const int _mttNumStates = ',num2str(counter.state),' ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - - fprintf(fid,['// system equations' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_set_numpar (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_set_numpar.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_set_input (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_set_input.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_set_state (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_set_state.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_get_input (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_get_input.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_get_state (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_get_state.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_put_state (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_put_state.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_put_derivative (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_put_derivative.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_put_output (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_put_output.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void ',model_name,'_ode (void) {' ,'\n']) ; - fprintf(fid,['#include "',model_name,'_include_ode.h"' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - - fprintf(fid,['// utility procedures' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static double *array_of_double (size_t n)' ,'\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' void *p = calloc (n, sizeof (double)) ;' ,'\n']) ; - fprintf(fid,[' if (! p) fprintf (stderr, "*** ERROR: failed to allocate memory") ;','\n']) ; - fprintf(fid,[' return (double *) p ;' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void initialise_arrays (void)' ,'\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' _mttInput = array_of_double(_mttNumInputs) ;' ,'\n']) ; - fprintf(fid,[' _mttOutput = array_of_double(_mttNumOutputs) ;' ,'\n']) ; - fprintf(fid,[' _mttState = array_of_double(_mttNumStates) ;' ,'\n']) ; - fprintf(fid,[' _mttDerivative = array_of_double(_mttNumStates) ;' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void check_finite(SimStruct *S, double *array, unsigned int index)','\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' const char *array_name ;' ,'\n']) ; - fprintf(fid,[' char warning[128] ;' ,'\n']) ; - fprintf(fid,[' if ((array[index] <= 0.0) || (array[index] >= 0.0)) {' ,'\n']) ; - fprintf(fid,[' ; // ...no problem' ,'\n']) ; - fprintf(fid,[' } else {' ,'\n']) ; - fprintf(fid,[' if (array == _mttInput) {' ,'\n']) ; - fprintf(fid,[' array_name = "_mttInput" ;' ,'\n']) ; - fprintf(fid,[' } else if (array == _mttState) {' ,'\n']) ; - fprintf(fid,[' array_name = "_mttState" ;' ,'\n']) ; - fprintf(fid,[' } else if (array == _mttOutput) {' ,'\n']) ; - fprintf(fid,[' array_name = "_mttOutput" ;' ,'\n']) ; - fprintf(fid,[' } else if (array == _mttDerivative) {' ,'\n']) ; - fprintf(fid,[' array_name = "_mttDerivative" ;' ,'\n']) ; - fprintf(fid,[' } else {' ,'\n']) ; - fprintf(fid,[' array_name = "unknown_array" ;' ,'\n']) ; - fprintf(fid,[' }' ,'\n']) ; - fprintf(fid,[' sprintf(warning,"(time %%f) Non-finite array element: %%s[%%d]",_mttTime,array_name,index) ;','\n']) ; - fprintf(fid,[' ssWarning(S,warning) ;' ,'\n']) ; - fprintf(fid,[' }' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - - fprintf(fid,['// S-function methods' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void mdlInitializeSizes(SimStruct *S)' ,'\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' ssSetNumSFcnParams(S,0) ;' ,'\n']) ; - fprintf(fid,[' if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) return ;','\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' ssSetNumContStates(S,_mttNumStates) ;' ,'\n']) ; - fprintf(fid,[' ssSetNumDiscStates(S,0) ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' if (!ssSetNumInputPorts(S,1)) return ;' ,'\n']) ; - fprintf(fid,[' ssSetInputPortWidth(S,0,_mttNumInputs) ;' ,'\n']) ; - fprintf(fid,[' ssSetInputPortDirectFeedThrough(S,0,1) ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' if (!ssSetNumOutputPorts(S,1)) return ;' ,'\n']) ; - fprintf(fid,[' ssSetOutputPortWidth(S,0,_mttNumOutputs) ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' ssSetNumSampleTimes(S,1) ;' ,'\n']) ; - fprintf(fid,[' ssSetNumRWork(S,0) ;' ,'\n']) ; - fprintf(fid,[' ssSetNumIWork(S,0) ;' ,'\n']) ; - fprintf(fid,[' ssSetNumPWork(S,0) ;' ,'\n']) ; - fprintf(fid,[' ssSetNumModes(S,0) ;' ,'\n']) ; - fprintf(fid,[' ssSetNumNonsampledZCs(S,0) ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' ssSetOptions(S,SS_OPTION_EXCEPTION_FREE_CODE) ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' initialise_arrays() ;' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void mdlInitializeSampleTimes(SimStruct *S)' ,'\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' ssSetSampleTime(S,0,CONTINUOUS_SAMPLE_TIME) ;' ,'\n']) ; - fprintf(fid,[' ssSetOffsetTime(S,0,0.0) ;' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['#define MDL_INITIALIZE_CONDITIONS' ,'\n']) ; - fprintf(fid,['static void mdlInitializeConditions(SimStruct *S)' ,'\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' ',model_name,'_set_numpar() ;' ,'\n']) ; - fprintf(fid,[' ',model_name,'_set_state() ;' ,'\n']) ; - fprintf(fid,[' ',model_name,'_put_state() ;' ,'\n']) ; - fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) ssGetContStates(S)[_mttIndex] = _mttState[_mttIndex] ;','\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void mdlOutputs(SimStruct *S,int_T tid)' ,'\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' UNUSED_ARG(tid) ;' ,'\n']) ; - fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) {' ,'\n']) ; - fprintf(fid,[' _mttState[_mttIndex] = ssGetContStates(S)[_mttIndex] ;' ,'\n']) ; - fprintf(fid,[' check_finite(S,_mttState,_mttIndex) ;' ,'\n']) ; - fprintf(fid,[' }' ,'\n']) ; - fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumInputs; _mttIndex++) {' ,'\n']) ; - fprintf(fid,[' _mttInput[_mttIndex] = *ssGetInputPortRealSignalPtrs(S,0)[_mttIndex] ;','\n']) ; - fprintf(fid,[' check_finite(S,_mttInput,_mttIndex) ;' ,'\n']) ; - fprintf(fid,[' }' ,'\n']) ; - fprintf(fid,[' _mttTime = ssGetT(S) ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' ',model_name,'_get_input() ;' ,'\n']) ; - fprintf(fid,[' ',model_name,'_get_state() ;' ,'\n']) ; - fprintf(fid,[' ',model_name,'_ode() ;' ,'\n']) ; - fprintf(fid,[' ',model_name,'_put_output() ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' for(_mttIndex=0; _mttIndex<_mttNumOutputs; _mttIndex++) {' ,'\n']) ; - fprintf(fid,[' check_finite(S,_mttOutput,_mttIndex) ;' ,'\n']) ; - fprintf(fid,[' ssGetOutputPortRealSignal(S,0)[_mttIndex] = _mttOutput[_mttIndex] ;','\n']) ; - fprintf(fid,[' }' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['#define MDL_DERIVATIVES' ,'\n']) ; - fprintf(fid,['static void mdlDerivatives(SimStruct *S)' ,'\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) {' ,'\n']) ; - fprintf(fid,[' _mttState[_mttIndex] = ssGetContStates(S)[_mttIndex] ;' ,'\n']) ; - fprintf(fid,[' check_finite(S,_mttState,_mttIndex) ;' ,'\n']) ; - fprintf(fid,[' }' ,'\n']) ; - fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumInputs; _mttIndex++) {' ,'\n']) ; - fprintf(fid,[' _mttInput[_mttIndex] = *ssGetInputPortRealSignalPtrs(S,0)[_mttIndex] ;','\n']) ; - fprintf(fid,[' check_finite(S,_mttInput,_mttIndex) ;' ,'\n']) ; - fprintf(fid,[' }' ,'\n']) ; - fprintf(fid,[' _mttTime = ssGetT(S) ;' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,[' ',model_name,'_get_input() ;' ,'\n']) ; - fprintf(fid,[' ',model_name,'_get_state() ;' ,'\n']) ; - fprintf(fid,[' ',model_name,'_ode() ;' ,'\n']) ; - fprintf(fid,[' ',model_name,'_put_derivative() ;' ,'\n']) ; - fprintf(fid,[' ' ,'\n']) ; - fprintf(fid,[' if (_mttTime==0)' ,'\n']) ; - fprintf(fid,[' for(_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) ssGetdX(S)[_mttIndex] = 0.0 ;','\n']) ; - fprintf(fid,[' else' ,'\n']) ; - fprintf(fid,[' for(_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) {' ,'\n']) ; - fprintf(fid,[' check_finite(S,_mttDerivative,_mttIndex) ;' ,'\n']) ; - fprintf(fid,[' ssGetdX(S)[_mttIndex] = _mttDerivative[_mttIndex] ;' ,'\n']) ; - fprintf(fid,[' }' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['static void mdlTerminate(SimStruct *S)' ,'\n']) ; - fprintf(fid,['{' ,'\n']) ; - fprintf(fid,[' UNUSED_ARG(S);' ,'\n']) ; - fprintf(fid,[' free (_mttInput) ;' ,'\n']) ; - fprintf(fid,[' free (_mttOutput) ;' ,'\n']) ; - fprintf(fid,[' free (_mttState) ;' ,'\n']) ; - fprintf(fid,[' free (_mttDerivative) ;' ,'\n']) ; - fprintf(fid,['}' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - fprintf(fid,['' ,'\n']) ; - - fprintf(fid,['#ifdef MATLAB_MEX_FILE' ,'\n']) ; - fprintf(fid,['#include "simulink.c"' ,'\n']) ; - fprintf(fid,['#else' ,'\n']) ; - fprintf(fid,['#include "cg_sfun.h"' ,'\n']) ; - fprintf(fid,['#endif' ,'\n']) ; DELETED mttroot/ntt/bin/trans/mttAppend.m Index: mttroot/ntt/bin/trans/mttAppend.m ================================================================== --- mttroot/ntt/bin/trans/mttAppend.m +++ mttroot/ntt/bin/trans/mttAppend.m @@ -1,11 +0,0 @@ -function information = mttAppend(information,field,items) - if isfield(information,field) - previous = getfield(information,field) ; - if isempty(previous) - information = setfield(information,field,items) ; - else - information = setfield(information,field,[previous,items]) ; - end - else - information = setfield(information,field,items) ; - end DELETED mttroot/ntt/bin/trans/mttAppendFields.m Index: mttroot/ntt/bin/trans/mttAppendFields.m ================================================================== --- mttroot/ntt/bin/trans/mttAppendFields.m +++ mttroot/ntt/bin/trans/mttAppendFields.m @@ -1,11 +0,0 @@ -function information = mttAppendFields(information,extra) - if isstruct(information) & isstruct(extra) - information_fields = fieldnames(information) ; - extra_fields = fieldnames(extra) ; - - for i = 1:length(extra_fields) - field_name = extra_fields{i} ; - extra_field = getfield(extra,field_name) ; - information = setfield(information,field_name,extra_field) ; - end - end DELETED mttroot/ntt/bin/trans/mttAssert.m Index: mttroot/ntt/bin/trans/mttAssert.m ================================================================== --- mttroot/ntt/bin/trans/mttAssert.m +++ mttroot/ntt/bin/trans/mttAssert.m @@ -1,7 +0,0 @@ -function mttAssert(rule,msg) - if ~isempty(rule) - if ~rule - error(['MTT: ',msg]) ; - end - end - DELETED mttroot/ntt/bin/trans/mttAssign.m Index: mttroot/ntt/bin/trans/mttAssign.m ================================================================== --- mttroot/ntt/bin/trans/mttAssign.m +++ mttroot/ntt/bin/trans/mttAssign.m @@ -1,7 +0,0 @@ -function [register,ok] = mttAssign(register,new_value) - if isempty(register) - register = new_value ; - ok = 1 ; - else - ok = register==new_value ; - end DELETED mttroot/ntt/bin/trans/mttCheckBondgraphDeclarations.m Index: mttroot/ntt/bin/trans/mttCheckBondgraphDeclarations.m ================================================================== --- mttroot/ntt/bin/trans/mttCheckBondgraphDeclarations.m +++ mttroot/ntt/bin/trans/mttCheckBondgraphDeclarations.m @@ -1,97 +0,0 @@ -function mttCheckBondgraphDeclarations(model) - - for i = 1:length(model.sympar) - mttAssert(~ismember(model.sympar{i},model.numpar),... - ['Same name (',model.sympar{i},') used for "numpar" and "abg[...]" parameters']) ; - mttAssert(~ismember(model.sympar{i},model.input),... - ['Same name (',model.sympar{i},') used for "input" and "abg[...]" parameters']) ; - end - - for i = 1:length(model.numpar) - mttAssert(~ismember(model.numpar{i},model.input),... - ['Same name (',model.numpar{i},') used for "numpar" and "input" parameters']) ; - mttAssert(~ismember(model.numpar{i},model.sympar),... - ['Same name (',model.numpar{i},') used for "numpar" and "abg[...]" parameters']) ; - end - - for i = 1:length(model.input) - mttAssert(~ismember(model.input{i},model.sympar),... - ['Same name (',model.input{i},') used for "input" and "abg[...]" parameters']) ; - mttAssert(~ismember(model.input{i},model.numpar),... - ['Same name (',model.input{i},') used for "numpar" and "input" parameters']) ; - end - - all_parameters = [] ; - - if ~isempty(model.sympar) - all_parameters = model.sympar ; - end - if ~isempty(model.numpar) - if isempty(all_parameters) - all_parameters = model.numpar ; - else - all_parameters = [all_parameters, model.numpar] ; - end - end - if ~isempty(model.input) - if isempty(all_parameters) - all_parameters = model.input ; - else - all_parameters = [all_parameters, model.input] ; - end - end - - object_names = mttGetFieldNames(model,'obj') ; - - if ~isempty(all_parameters) - for i = 1:length(object_names) - object_name = object_names{i} ; - object = getfield(model,'obj',object_name) ; - - for j = 1:length(object.parameter) - object_parameter = object.parameter{j} ; - if ~isnumeric(object_parameter) - mttAssert(ismember(object_parameter,all_parameters),... - ['Object parameter "',object.parameter{j},'" not previously declared']) ; - end - end - end - - for j = 1:length(all_parameters) - current_parameter = all_parameters{j} ; - other_parameters = all_parameters ; - other_parameters(j) = [] ; - - mttAssert(~ismember(current_parameter,other_parameters),... - ['Repeated parameter/input name "',current_parameter,'"']) ; - end - end - - - counter = 0 ; - all_instance_parameters = [] ; - - for i = 1:length(object_names) - object_name = object_names{i} ; - object = getfield(model,'obj',object_name) ; - - for j = 1:length(object.parameter) - object_parameter = object.parameter{j} ; - if ~isnumeric(object_parameter) - counter = counter + 1 ; - all_instance_parameters{counter} = object_parameter ; - end - end - end - - for k = 1:length(all_parameters) - parameter = all_parameters{k} ; - if isempty(all_instance_parameters) - mttAssert(0,['Declared parameter/input "',parameter,'" not used']) ; - else - mttAssert(ismember(parameter,all_instance_parameters),... - ['Declared parameter/input "',parameter,'" not used']) ; - end - end - - DELETED mttroot/ntt/bin/trans/mttCheckInterfaceDeclarations.m Index: mttroot/ntt/bin/trans/mttCheckInterfaceDeclarations.m ================================================================== --- mttroot/ntt/bin/trans/mttCheckInterfaceDeclarations.m +++ mttroot/ntt/bin/trans/mttCheckInterfaceDeclarations.m @@ -1,69 +0,0 @@ -function mttCheckInterfaceDeclarations(model) - - for i = 1:length(model.sympar) - mttAssert(~ismember(model.sympar{i},model.numpar),... - ['Same name (',model.sympar{i},') used for "numpar" and "abg[...]" parameters']) ; - mttAssert(~ismember(model.sympar{i},model.input),... - ['Same name (',model.sympar{i},') used for "input" and "abg[...]" parameters']) ; - end - - for i = 1:length(model.numpar) - mttAssert(~ismember(model.numpar{i},model.input),... - ['Same name (',model.numpar{i},') used for "numpar" and "input" parameters']) ; - mttAssert(~ismember(model.numpar{i},model.sympar),... - ['Same name (',model.numpar{i},') used for "numpar" and "abg[...]" parameters']) ; - end - - for i = 1:length(model.input) - mttAssert(~ismember(model.input{i},model.sympar),... - ['Same name (',model.input{i},') used for "input" and "abg[...]" parameters']) ; - mttAssert(~ismember(model.input{i},model.numpar),... - ['Same name (',model.input{i},') used for "numpar" and "input" parameters']) ; - end - - all_parameters = [] ; - - if ~isempty(model.sympar) - all_parameters = model.sympar ; - end - if ~isempty(model.numpar) - if isempty(all_parameters) - all_parameters = model.numpar ; - else - all_parameters = [all_parameters, model.numpar] ; - end - end - if ~isempty(model.input) - if isempty(all_parameters) - all_parameters = model.input ; - else - all_parameters = [all_parameters, model.input] ; - end - end - - object_names = mttGetFieldNames(model,'obj') ; - - if ~isempty(all_parameters) - for i = 1:length(object_names) - object_name = object_names{i} ; - object = getfield(model,'obj',object_name) ; - - for j = 1:length(object.parameter) - object_parameter = object.parameter{j} ; - if ~isnumeric(object_parameter) - mttAssert(ismember(object_parameter,all_parameters),... - ['Object parameter "',object.parameter{j},'" not previously declared']) ; - end - end - end - - for j = 1:length(all_parameters) - current_parameter = all_parameters{j} ; - other_parameters = all_parameters ; - other_parameters(j) = [] ; - - mttAssert(~ismember(current_parameter,other_parameters),... - ['Repeated parameter/input name "',current_parameter,'"']) ; - end - end - DELETED mttroot/ntt/bin/trans/mttCheckStateDeclarations.m Index: mttroot/ntt/bin/trans/mttCheckStateDeclarations.m ================================================================== --- mttroot/ntt/bin/trans/mttCheckStateDeclarations.m +++ mttroot/ntt/bin/trans/mttCheckStateDeclarations.m @@ -1,57 +0,0 @@ -function mttCheckStateDeclarations(model) - for i = 1:length(model.sympar) - mttAssert(~ismember(model.sympar{i},model.state),... - ['Same name (',model.sympar{i},') used for "state" and "abg[...]" parameters']) ; - end - - for i = 1:length(model.numpar) - mttAssert(~ismember(model.numpar{i},model.state),... - ['Same name (',model.numpar{i},') used for "numpar" and "state" parameters']) ; - end - - for i = 1:length(model.input) - mttAssert(~ismember(model.input{i},model.state),... - ['Same name (',model.input{i},') used for "input" and "state" parameters']) ; - end - - for i = 1:length(model.state) - mttAssert(~ismember(model.state{i},model.sympar),... - ['Same name (',model.state{i},') used for "state" and "abg[...]" parameters']) ; - mttAssert(~ismember(model.state{i},model.numpar),... - ['Same name (',model.state{i},') used for "state" and "numpar" parameters']) ; - mttAssert(~ismember(model.state{i},model.input),... - ['Same name (',model.state{i},') used for "state" and "input" parameters']) ; - end - - all_parameters = [] ; - - if ~isempty(model.sympar) - all_parameters = model.sympar ; - end - if ~isempty(model.numpar) - if isempty(all_parameters) - all_parameters = model.numpar ; - else - all_parameters = [all_parameters, model.numpar] ; - end - end - if ~isempty(model.input) - if isempty(all_parameters) - all_parameters = model.input ; - else - all_parameters = [all_parameters, model.input] ; - end - end - - for j = 1:length(all_parameters) - current_parameter = all_parameters{j} ; - mttAssert(~ismember(current_parameter,model.state),... - ['Repeated parameter/state name "',current_parameter,'"']) ; - end - - for j = 1:length(model.state) - current_state = model.state{j} ; - mttAssert(~ismember(current_state,all_parameters),... - ['Repeated parameter/state name "',current_state,'"']) ; - end - DELETED mttroot/ntt/bin/trans/mttClipText.m Index: mttroot/ntt/bin/trans/mttClipText.m ================================================================== --- mttroot/ntt/bin/trans/mttClipText.m +++ mttroot/ntt/bin/trans/mttClipText.m @@ -1,8 +0,0 @@ -function clipped_text = mttClipText(text) - if isempty(text) - clipped_text = [] ; - else - index = 1:length(text) ; - useful = index(~isspace(text)) ; - clipped_text = text(min(useful):max(useful)) ; - end DELETED mttroot/ntt/bin/trans/mttCompare.m Index: mttroot/ntt/bin/trans/mttCompare.m ================================================================== --- mttroot/ntt/bin/trans/mttCompare.m +++ mttroot/ntt/bin/trans/mttCompare.m @@ -1,7 +0,0 @@ -function comparison = mttCompare(left,right) - if isempty(left) | isempty(right) - comparison = [] ; - else - comparison = (left==right) ; - end - DELETED mttroot/ntt/bin/trans/mttCompareCausalCompletion.m Index: mttroot/ntt/bin/trans/mttCompareCausalCompletion.m ================================================================== --- mttroot/ntt/bin/trans/mttCompareCausalCompletion.m +++ mttroot/ntt/bin/trans/mttCompareCausalCompletion.m @@ -1,6 +0,0 @@ -function is_stable = mttCompareCausalCompletion(current,previous) - is_stable_flow = current.flows==previous.flows ; - is_stable_effort = current.efforts==previous.efforts ; - is_stable = is_stable_flow & is_stable_effort ; - - DELETED mttroot/ntt/bin/trans/mttCompareDomainCompletion.m Index: mttroot/ntt/bin/trans/mttCompareDomainCompletion.m ================================================================== --- mttroot/ntt/bin/trans/mttCompareDomainCompletion.m +++ mttroot/ntt/bin/trans/mttCompareDomainCompletion.m @@ -1,3 +0,0 @@ -function is_stable = mttCompareDomainCompletion(current,previous) - is_stable = current.assignments==previous.assignments ; - DELETED mttroot/ntt/bin/trans/mttCompressText.m Index: mttroot/ntt/bin/trans/mttCompressText.m ================================================================== --- mttroot/ntt/bin/trans/mttCompressText.m +++ mttroot/ntt/bin/trans/mttCompressText.m @@ -1,6 +0,0 @@ -function compressed_text = mttCompressText(text) - if isempty(text) - compressed_text = [] ; - else - compressed_text = text(~isspace(text)) ; - end DELETED mttroot/ntt/bin/trans/mttCountObjects.m Index: mttroot/ntt/bin/trans/mttCountObjects.m ================================================================== --- mttroot/ntt/bin/trans/mttCountObjects.m +++ mttroot/ntt/bin/trans/mttCountObjects.m @@ -1,23 +0,0 @@ -function model = mttCountObjects(model) - - object_names = mttGetFieldNames(model,'obj') ; - number_of_objects = length(object_names) ; - - model.count.obj = number_of_objects ; - model.count.cr = 0 ; - - for i = 1:number_of_objects - object_name = object_names{i} ; - object = getfield(model,'obj',object_name) ; - - if ~isempty(object.cr) - model.count.cr = model.count.cr + 1 ; - end - - if isfield(object,'obj') - next = mttCountObjects(object) ; - model.count.obj = model.count.obj + next.count.obj ; - model.count.cr = model.count.cr + next.count.cr ; - end - end - DELETED mttroot/ntt/bin/trans/mttCountSystemMapping.m Index: mttroot/ntt/bin/trans/mttCountSystemMapping.m ================================================================== --- mttroot/ntt/bin/trans/mttCountSystemMapping.m +++ mttroot/ntt/bin/trans/mttCountSystemMapping.m @@ -1,195 +0,0 @@ -function counter = mttCountSystemMapping(model) - -sympars = count_system_sympars(model) ; -inputs = count_system_inputs(model) ; -invars = count_system_invars(model) ; -outvars = count_system_outvars(model) ; -states = count_system_states(model) ; - -counter.input = sympars + inputs + invars ; -counter.output = outvars ; -counter.state = states ; - - -function counter = count_system_sympars(model) - number_of_variables = mttGetFieldLength(model,'sympar') ; - counter = 0 ; - - for i = 1:number_of_variables - default_value = model.sympar_default{i} ; - if isempty(default_value) - counter = counter + 1 ; - end - end - - -function counter = count_system_inputs(model) - number_of_variables = mttGetFieldLength(model,'input') ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - additional_variables = 0 ; - if ~isempty(object.abg) - additional_variables = count_system_inputs(object) ; - elseif ~isempty(object.cr) - additional_variables = count_system_inputs(object.cr) ; - end - - number_of_variables = number_of_variables + additional_variables ; - end - - counter = number_of_variables ; - - -function counter = count_system_invars(model,root,env) - is_root_model = nargin==1 ; - - if is_root_model - root = model ; - env = model.env ; - end - - number_of_variables = 0 ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - switch object.class - case {'SS','Se','Sf','De','Df'} - inbond_number = object.interface.in ; - outbond_number = object.interface.out ; - - inbond = model.bond(inbond_number) ; - outbond = model.bond(outbond_number) ; - - if ~isempty(inbond) - covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; - covar = [] ; - - if ~inbond.effort - if ~strcmp(object.class,'Df') - covar = covariables.effort ; - end - elseif inbond.flow - if ~strcmp(object.class,'De') - covar = covariables.flow ; - end - end - - number_of_variables = number_of_variables + length(covar) ; - end - - if ~isempty(outbond) - covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; - covar = [] ; - - if outbond.effort - covar = covariables.effort ; - elseif ~outbond.flow - covar = covariables.flow ; - end - - number_of_variables = number_of_variables + length(covar) ; - end - end - - additional_variables = 0 ; - if ~isempty(object.abg) - additional_variables = count_system_invars(object,root,env) ; - end - - number_of_variables = number_of_variables + additional_variables ; - end - - counter = number_of_variables ; - - -function counter = count_system_outvars(model,root,env) - is_root_model = nargin==1 ; - - if is_root_model - root = model ; - env = model.env ; - end - - number_of_variables = 0 ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - switch object.class - case {'SS','Se','Sf','De','Df'} - inbond_number = object.interface.in ; - outbond_number = object.interface.out ; - - inbond = model.bond(inbond_number) ; - outbond = model.bond(outbond_number) ; - - if ~isempty(inbond) - covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; - covar = [] ; - - if inbond.effort - covar = covariables.effort ; - elseif ~inbond.flow - covar = covariables.flow ; - end - - number_of_variables = number_of_variables + length(covar) ; - end - - if ~isempty(outbond) - covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; - covar = [] ; - - if ~outbond.effort - if ~strcmp(object.class,'Sf') - covar = covariables.effort ; - end - elseif outbond.flow - if ~strcmp(object.class,'Se') - covar = covariables.flow ; - end - end - - number_of_variables = number_of_variables + length(covar) ; - end - end - - additional_variables = 0 ; - if ~isempty(object.abg) - additional_variables = count_system_outvars(object,root,env) ; - end - - number_of_variables = number_of_variables + additional_variables ; - end - - counter = number_of_variables ; - - -function counter = count_system_states(model) - number_of_variables = mttGetFieldLength(model,'state') ; - - objects = mttGetFieldNames(model,'obj') ; - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - additional_variables = 0 ; - if ~isempty(object.abg) - additional_variables = count_system_states(object) ; - elseif ~isempty(object.cr) - additional_variables = count_system_states(object.cr) ; - end - - number_of_variables = number_of_variables + additional_variables ; - end - - counter = number_of_variables ; DELETED mttroot/ntt/bin/trans/mttCreateAlternativeEquations.m Index: mttroot/ntt/bin/trans/mttCreateAlternativeEquations.m ================================================================== --- mttroot/ntt/bin/trans/mttCreateAlternativeEquations.m +++ mttroot/ntt/bin/trans/mttCreateAlternativeEquations.m @@ -1,563 +0,0 @@ -function ese = mttCreateAlternativeEquations(model) - -ese = write_equations(model) ; -ese = ese' ; - -filename = [model.source,'_ese.txt'] ; -fid = fopen(filename,'w') ; - -fprintf(fid,['// Elementary System Equations\n']) ; -fprintf(fid,'\n') ; -fprintf(fid,['// file: ',filename,'\n']) ; -fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; -fprintf(fid,'\n\n') ; - -fprintf(fid,['ese ',mttDetachText(model.source,'/'),' {']) ; -fprintf(fid,'\n') ; - -tab = char(32*ones(1,3)) ; - -for i = 1:length(ese) - fprintf(fid,[tab,ese{i},'\n']) ; -end - -fprintf(fid,'}') ; - -fclose(fid) ; - - - -function ese = write_equations(model,branch) - is_root_model = (nargin==1) ; - - if is_root_model - branch = mttDetachText(model.source,'/') ; - end - -% ese{1} = ' ' ; -% ese{2} = ['// ESE representation for module: ',branch] ; -% ese{3} = ' ' ; -% -% line = 3 ; - - line = 0 ; - - indent = char(32*ones(1,6)) ; - - - objects = mttGetFieldNames(model,'obj') ; - - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - here = [branch,':',object_name] ; - - switch object.class - case 'SS', - - for j = 1:mttGetFieldLength(object,'interface') - flow_equation = [] ; - effort_equation = [] ; - - port_name = object.interface(j).name ; - - inbond = object.interface(j).in ; - outbond = object.interface(j).out ; - - if ~isempty(inbond) - bond = model.bond(inbond) ; - - extern = [branch,'__',object_name,'___flow'] ; - intern = [branch,'___f[',num2str(inbond),']'] ; - if bond.flow - flow_equation = [intern,' = ',extern,' ;'] ; - else - flow_equation = [extern,' = ',intern,' ;'] ; - end - - extern = [branch,'__',object_name,'___effort'] ; - intern = [branch,'___e[',num2str(inbond),']'] ; - if bond.effort - effort_equation = [extern,' = ',intern,' ;'] ; - else - effort_equation = [intern,' = ',extern,' ;'] ; - end - - line = line + 1 ; - ese{line} = flow_equation ; - - line = line + 1 ; - ese{line} = effort_equation ; - end - - if ~isempty(outbond) - bond = model.bond(outbond) ; - - extern = [branch,'__',object_name,'___flow'] ; - intern = [branch,'___f[',num2str(outbond),']'] ; - if bond.flow - flow_equation = [extern,' = ',intern,' ;'] ; - else - flow_equation = [intern,' = ',extern,' ;'] ; - end - - extern = [branch,'__',object_name,'___effort'] ; - intern = [branch,'___e[',num2str(outbond),']'] ; - if bond.effort - effort_equation = [intern,' = ',extern,' ;'] ; - else - effort_equation = [extern,' = ',intern,' ;'] ; - end - - line = line + 1 ; - ese{line} = flow_equation ; - - line = line + 1 ; - ese{line} = effort_equation ; - end - end - - case '0', - - imposed_effort = [] ; - resultant_flow = [] ; - - for i = 1:mttGetFieldLength(object,'interface') - inbond = object.interface(i).in ; - outbond = object.interface(i).out ; - - if isempty(inbond) - bond_number(i) = outbond ; - orientation(i) = 0 ; - else - bond_number(i) = inbond ; - orientation(i) = 1 ; - end - - [effort(i),flow(i)] = mttGetBondCausality(model,bond_number(i)) ; - - if effort(i)==orientation(i) - imposed_effort_bond = bond_number(i) ; - imposed_effort = [branch,'___e[',num2str(imposed_effort_bond),']'] ; - end - if flow(i)==orientation(i) - resultant_flow_bond = bond_number(i) ; - resultant_flow = [branch,'___f[',num2str(resultant_flow_bond),']'] ; - end - end - - - for i = 1:mttGetFieldLength(object,'interface') - if bond_number(i)~=imposed_effort_bond - line = line + 1 ; - derived_effort = [branch,'___e[',num2str(bond_number(i)),']'] ; - ese{line} = [derived_effort,' = ',imposed_effort,' ;'] ; - end - end - - waiting = 1 ; - offset = char(32*ones(1,length(resultant_flow)+1)) ; - - for i = 1:mttGetFieldLength(object,'interface') - next_flow = [] ; - - if bond_number(i)~=resultant_flow_bond - next_flow = [branch,'___f[',num2str(bond_number(i)),']'] ; - line = line + 1 ; - - if waiting - if orientation(i) - ese{line} = [resultant_flow,' = ',next_flow] ; - else - ese{line} = [resultant_flow,' = -',next_flow] ; - end - waiting = 0 ; - else - if orientation(i) - ese{line} = [offset,'+ ',next_flow] ; - else - ese{line} = [offset,'- ',next_flow] ; - end - end - end - end - ese{line} = [ese{line},' ;'] ; - - case '1', - - imposed_flow = [] ; - resultant_effort = [] ; - - for i = 1:mttGetFieldLength(object,'interface') - inbond = object.interface(i).in ; - outbond = object.interface(i).out ; - - if isempty(inbond) - bond_number(i) = outbond ; - orientation(i) = 0 ; - else - bond_number(i) = inbond ; - orientation(i) = 1 ; - end - - [effort(i),flow(i)] = mttGetBondCausality(model,bond_number(i)) ; - - if flow(i)~=orientation(i) - imposed_flow_bond = bond_number(i) ; - imposed_flow = [branch,'___f[',num2str(imposed_flow_bond),']'] ; - end - if effort(i)~=orientation(i) - resultant_effort_bond = bond_number(i) ; - resultant_effort = [branch,'___e[',num2str(resultant_effort_bond),']'] ; - end - end - - - for i = 1:mttGetFieldLength(object,'interface') - if bond_number(i)~=imposed_flow_bond - line = line + 1 ; - derived_flow = [branch,'___f[',num2str(bond_number(i)),']'] ; - ese{line} = [derived_flow,' = ',imposed_flow,' ;'] ; - end - end - - waiting = 1 ; - offset = char(32*ones(1,length(resultant_effort)+1)) ; - - for i = 1:mttGetFieldLength(object,'interface') - next_effort = [] ; - - if bond_number(i)~=resultant_effort_bond - next_effort = [branch,'___e[',num2str(bond_number(i)),']'] ; - line = line + 1 ; - - if waiting - if orientation(i) - ese{line} = [resultant_effort,' = ',next_effort] ; - else - ese{line} = [resultant_effort,' = -',next_effort] ; - end - waiting = 0 ; - else - if orientation(i) - ese{line} = [offset,'+ ',next_effort] ; - else - ese{line} = [offset,'- ',next_effort] ; - end - end - end - end - ese{line} = [ese{line},' ;'] ; - - otherwise, - - if ~isempty(object.cr) - operators = object.cr.operator ; - interface = object.cr.interface ; - port_names = mttGetFieldNames(interface,'port') ; - - link_counter = 0 ; - - for i = 1:length(port_names) - port_name = port_names{i} ; - port = getfield(interface,'port',port_name) ; - terminal = [branch,'__',object_name,'___',port_name] ; - - inbond = port.in ; - outbond = port.out ; - - if ~isempty(inbond) - bond = model.bond(inbond) ; - - intern = [branch,'___f[',num2str(inbond),']'] ; - if bond.flow - link_counter = link_counter + 1 ; - link(link_counter) = create_link(0,0,1,port_name,port.is_flow_state) ; - - if port.is_flow_state - flow_equation = [intern,' = ',terminal,'___flow_state ;'] ; - else - flow_equation = [intern,' = ',terminal,'___flow ;'] ; - end - else - link_counter = link_counter + 1 ; - link(link_counter) = create_link(1,0,1,port_name,port.is_flow_state) ; - - if port.is_flow_state - flow_equation = [terminal,'___flow_state = ',intern,' ;'] ; - else - flow_equation = [terminal,'___flow = ',intern,' ;'] ; - end - end - - intern = [branch,'___e[',num2str(inbond),']'] ; - if bond.effort - link_counter = link_counter + 1 ; - link(link_counter) = create_link(1,1,0,port_name,port.is_effort_state) ; - - if port.is_effort_state - effort_equation = [terminal,'___effort_state = ',intern,' ;'] ; - else - effort_equation = [terminal,'___effort = ',intern,' ;'] ; - end - else - link_counter = link_counter + 1 ; - link(link_counter) = create_link(0,1,0,port_name,port.is_effort_state) ; - - if port.is_effort_state - effort_equation = [intern,' = ',terminal,'___effort_state ;'] ; - else - effort_equation = [intern,' = ',terminal,'___effort ;'] ; - end - end - - line = line + 1 ; - ese{line} = flow_equation ; - - line = line + 1 ; - ese{line} = effort_equation ; - end - - if ~isempty(outbond) - bond = model.bond(outbond) ; - - intern = [branch,'___f[',num2str(outbond),']'] ; - if bond.flow - link_counter = link_counter + 1 ; - link(link_counter) = create_link(1,0,1,port_name,port.is_flow_state) ; - - if port.is_flow_state - flow_equation = [terminal,'___flow_state = ',intern,' ;'] ; - else - flow_equation = [terminal,'___flow = ',intern,' ;'] ; - end - else - link_counter = link_counter + 1 ; - link(link_counter) = create_link(0,0,1,port_name,port.is_flow_state) ; - - if port.is_flow_state - flow_equation = [intern,' = ',terminal,'___flow_state ;'] ; - else - flow_equation = [intern,' = ',terminal,'___flow ;'] ; - end - end - - intern = [branch,'___e[',num2str(outbond),']'] ; - if bond.effort - link_counter = link_counter + 1 ; - link(link_counter) = create_link(0,1,0,port_name,port.is_effort_state) ; - - if port.is_effort_state - effort_equation = [intern,' = ',terminal,'___effort_state ;'] ; - else - effort_equation = [intern,' = ',terminal,'___effort ;'] ; - end - else - link_counter = link_counter + 1 ; - link(link_counter) = create_link(1,1,0,port_name,port.is_effort_state) ; - - if port.is_effort_state - effort_equation = [terminal,'___effort_state = ',intern,' ;'] ; - else - effort_equation = [terminal,'___effort = ',intern,' ;'] ; - end - end - - line = line + 1 ; - ese{line} = flow_equation ; - - line = line + 1 ; - ese{line} = effort_equation ; - end - end - - number_of_operators = length(operators) ; - op_counter = 1 ; - - matching = 1 ; - while matching - operator = operators(op_counter) ; - - links = length(link) ; - op_links = length(operator.link) ; - op_linked = zeros(op_links,1) ; - - for j = 1:op_links - for k = 1:links - if compare_links(link(k),operator.link(j)) - op_linked(j) = k ; - break ; - end - end - end - - input_counter = 0 ; - output_counter = 0 ; - input = [] ; - output = [] ; - - if all(op_linked) - for j = 1:op_links - current_link = link(op_linked(j)) ; - port_name = current_link.name ; - - if current_link.is_effort - if current_link.is_state - link_name = [branch,'__',object_name,'___',port_name,'___effort_state'] ; - else - link_name = [branch,'__',object_name,'___',port_name,'___effort'] ; - end - end - if current_link.is_flow - if current_link.is_state - link_name = [branch,'__',object_name,'___',port_name,'___flow_state'] ; - else - link_name = [branch,'__',object_name,'___',port_name,'___flow'] ; - end - end - if current_link.is_input - input_counter = input_counter + 1 ; - input{input_counter} = link_name ; - else - output_counter = output_counter + 1 ; - output{output_counter} = link_name ; - end - end - - if input_counter>0 - input_list = ['[',input{1}] ; - for j = 2:input_counter - input_list = [input_list,',',input{j}] ; - end - input_list = [input_list,']'] ; - end - - if output_counter>0 - output_list = ['[',output{1}] ; - for j = 2:output_counter - output_list = [output_list,',',output{j}] ; - end - output_list = [output_list,']'] ; - end - - if input_counter>0 - line = line + 1 ; - ese{line} = [output_list,' = '] ; - end - - line = line + 1 ; - ese{line} = [indent,branch,'__',object_name,'___',operator.name] ; - - if output_counter>0 - line = line + 1 ; - ese{line} = [indent,indent,input_list,' ;'] ; - end - - link(op_linked) = [] ; - end - - op_counter = op_counter + 1 ; - matching = ~isempty(link) & (op_counter<=number_of_operators) ; - end - - mttAssert(isempty(link),... - ['Unattached ports in "cr" implementation in ',here]) ; - end - end - end - - for i = 1:length(objects) - object_name = objects{i} ; - object = getfield(model,'obj',object_name) ; - - here = [branch,':',object_name] ; - - if ~isempty(object.abg) - for j = 1:mttGetFieldLength(object,'interface') - inbond = object.interface(j).in ; - outbond = object.interface(j).out ; - inmap = object.interface(j).map.in ; - outmap = object.interface(j).map.out ; - - line = line + 1 ; - ese{line} = ' ' ; - - if ~isempty(inbond) - bond = model.bond(inbond) ; - - extern = [branch,'__',object_name,'___f[',num2str(inmap),']'] ; - intern = [branch,'___f[',num2str(inbond),']'] ; - if bond.flow - flow_equation = [intern,' = ',extern,' ;'] ; - else - flow_equation = [extern,' = ',intern,' ;'] ; - end - - extern = [branch,'__',object_name,'___e[',num2str(inmap),']'] ; - intern = [branch,'___e[',num2str(inbond),']'] ; - if bond.effort - effort_equation = [extern,' = ',intern,' ;'] ; - else - effort_equation = [intern,' = ',extern,' ;'] ; - end - - line = line + 1 ; - ese{line} = flow_equation ; - - line = line + 1 ; - ese{line} = effort_equation ; - end - - if ~isempty(outbond) - bond = model.bond(outbond) ; - - extern = [branch,'__',object_name,'___f[',num2str(outmap),']'] ; - intern = [branch,'___f[',num2str(outbond),']'] ; - if bond.flow - flow_equation = [extern,' = ',intern,' ;'] ; - else - flow_equation = [intern,' = ',extern,' ;'] ; - end - - extern = [branch,'__',object_name,'___e[',num2str(outmap),']'] ; - intern = [branch,'___e[',num2str(outbond),']'] ; - if bond.effort - effort_equation = [intern,' = ',extern,' ;'] ; - else - effort_equation = [extern,' = ',intern,' ;'] ; - end - - line = line + 1 ; - ese{line} = flow_equation ; - - line = line + 1 ; - ese{line} = effort_equation ; - end - end - next_branch = [branch,'__',object_name] ; - - object_ese = write_equations(object,next_branch) ; - - ese = [ese, object_ese] ; - line = length(ese) ; - end - end - - -function link = create_link(is_input,is_effort,is_flow,name,is_state) - link.is_input = is_input ; - link.is_effort = is_effort ; - link.is_flow = is_flow ; - link.name = name ; - link.is_state = is_state ; - -function boolean = compare_links(actual_link,op_link) - input_is_same = actual_link.is_input==op_link.is_input ; - effort_is_same = actual_link.is_effort==op_link.is_effort ; - flow_is_same = actual_link.is_flow==op_link.is_flow ; - name_is_same = strcmp(actual_link.name,op_link.name) ; - - boolean = input_is_same & effort_is_same & flow_is_same & name_is_same ; - - DELETED mttroot/ntt/bin/trans/mttCutText.m Index: mttroot/ntt/bin/trans/mttCutText.m ================================================================== --- mttroot/ntt/bin/trans/mttCutText.m +++ mttroot/ntt/bin/trans/mttCutText.m @@ -1,14 +0,0 @@ -function [left,right] = mttCutText(text,delimiter) - if isempty(text) - left = [] ; - right = [] ; - else - where = min(findstr(text,delimiter)) ; - if isempty(where) - left = mttClipText(text) ; - right = [] ; - else - left = mttClipText(text(1:where-1)) ; - right = mttClipText(text(where+length(delimiter):length(text))) ; - end - end DELETED mttroot/ntt/bin/trans/mttDeleteField.m Index: mttroot/ntt/bin/trans/mttDeleteField.m ================================================================== --- mttroot/ntt/bin/trans/mttDeleteField.m +++ mttroot/ntt/bin/trans/mttDeleteField.m @@ -1,6 +0,0 @@ -function model = mttDeleteField(structure,field_name) - if isfield(structure,field_name) - model = rmfield(structure,field_name) ; - else - model = structure ; - end DELETED mttroot/ntt/bin/trans/mttDetachText.m Index: mttroot/ntt/bin/trans/mttDetachText.m ================================================================== --- mttroot/ntt/bin/trans/mttDetachText.m +++ mttroot/ntt/bin/trans/mttDetachText.m @@ -1,14 +0,0 @@ -function [detached_text,preceding_text] = mttDetachText(text,delimiter) - if isempty(text) - detached_text = [] ; - preceding_text = [] ; - else - where = max(findstr(text,delimiter)) ; - if isempty(where) - detached_text = [] ; - preceding_text = mttClipText(text) ; - else - detached_text = mttClipText(text(where+length(delimiter):length(text))) ; - preceding_text = mttClipText(text(1:where-1)) ; - end - end DELETED mttroot/ntt/bin/trans/mttElapseTime.m Index: mttroot/ntt/bin/trans/mttElapseTime.m ================================================================== --- mttroot/ntt/bin/trans/mttElapseTime.m +++ mttroot/ntt/bin/trans/mttElapseTime.m @@ -1,4 +0,0 @@ -function elapsed_time = mttElapseTime(t0) - current_time = mttGetTime ; - elapsed_time.cpu = current_time.cpu - t0.cpu ; - elapsed_time.clock = etime(current_time.clock,t0.clock) ; DELETED mttroot/ntt/bin/trans/mttExtractStatements.m Index: mttroot/ntt/bin/trans/mttExtractStatements.m ================================================================== --- mttroot/ntt/bin/trans/mttExtractStatements.m +++ mttroot/ntt/bin/trans/mttExtractStatements.m @@ -1,55 +0,0 @@ -function statements = mttExtractStatements(content) - input = 1 ; - output = 0 ; - line = [] ; - - searching = 0 ; - processing = 1 ; - while processing - line = [line,content{input}] ; - line = mttCutText(line,'//') ; - - if ~isempty(line) - semicolon = findstr(line,';') ; - leftbrace = findstr(line,'{') ; - rightbrace = findstr(line,'}') ; - terminator = sort([semicolon,leftbrace,rightbrace]) ; - - if isempty(terminator) - searching = 1 ; - else - first = 1 ; - N = length(terminator) ; - L = length(line) ; - - for i = 1:N - last = terminator(i) - 1 ; - if first<=last - output = output + 1 ; - statements{output} = mttClipText(line(first:last)) ; - end - - if ismember(line(terminator(i)),{'{','}'}) - output = output + 1 ; - statements{output} = line(terminator(i)) ; - end - first = last + 2 ; - end - - if terminator(N)==L - line = [] ; - searching = 0 ; - else - line = mttClipText(line(terminator(N):L)) ; - end - end - end - input = input + 1 ; - processing = input<=length(content) ; - - if searching - mttAssert(input<=length(content),... - 'End of file found with an incomplete statement') ; - end - end - DELETED mttroot/ntt/bin/trans/mttExtractText.m Index: mttroot/ntt/bin/trans/mttExtractText.m ================================================================== --- mttroot/ntt/bin/trans/mttExtractText.m +++ mttroot/ntt/bin/trans/mttExtractText.m @@ -1,13 +0,0 @@ -function extracted_text = mttExtractText(text,left,right) - if isempty(text) - extracted_text = [] ; - else - where_left = min(findstr(text,left)) ; - where_right = min(findstr(text,right)) ; - - if ~isempty(where_left) & ~isempty(where_right) - extracted_text = mttClipText(text(where_left+length(left):where_right-1)) ; - else - extracted_text = [] ; - end - end DELETED mttroot/ntt/bin/trans/mttFileExists.m Index: mttroot/ntt/bin/trans/mttFileExists.m ================================================================== --- mttroot/ntt/bin/trans/mttFileExists.m +++ mttroot/ntt/bin/trans/mttFileExists.m @@ -1,4 +0,0 @@ -function boolean = mttFileExists(filename) - - boolean = exist(filename)==2 ; - DELETED mttroot/ntt/bin/trans/mttFindEquationVariables.m Index: mttroot/ntt/bin/trans/mttFindEquationVariables.m ================================================================== --- mttroot/ntt/bin/trans/mttFindEquationVariables.m +++ mttroot/ntt/bin/trans/mttFindEquationVariables.m @@ -1,67 +0,0 @@ -function [varlist,location] = mttFindEquationVariables(line) - line = mttClipText(line) ; - - if isempty(line) - namelist = [] ; - location = [] ; - else - numbers = (line>=48 & line<=57) ; - letters = (line>=65 & line<=90)|(line>=97 & line<=122) ; - underscores = (line==95) ; - dots = (line==46) ; - apostrophes = (line==39) ; - - mask = (numbers|letters|underscores|dots|apostrophes) ; - - buffer = line ; - buffer(~mask) = char(32*ones(1,sum(~mask))) ; - - next = 1 ; - last = length(buffer) ; - - counter = 0 ; - - finding = any(mask) ; - while finding - i = min(find(~isspace(buffer(next:last))))+next-1 ; - - if isempty(i) - finding = 0 ; - else - if i>last - finding = 0 ; - else - if i==last - j = last ; - else - j = min(find(isspace(buffer(i+1:last))))+i ; - - if isempty(j) - j = last ; - else - j = j - 1 ; - end - end - - if ~mttIsNumericText(buffer(i:j)) - var_found = 1 ; - - if j %i bonds are unicausal\n'],... - model.causal_completion.unicausal) ; - end DELETED mttroot/ntt/bin/trans/mttNotifyDomainCompletion.m Index: mttroot/ntt/bin/trans/mttNotifyDomainCompletion.m ================================================================== --- mttroot/ntt/bin/trans/mttNotifyDomainCompletion.m +++ mttroot/ntt/bin/trans/mttNotifyDomainCompletion.m @@ -1,6 +0,0 @@ -function mttNotifyDomainCompletion(model) - - domain = floor(100*model.domain_completion.assignments/model.domain_completion.bonds) ; - - fprintf([' ...domain allocation is %i%% complete [%i/%i]\n'],... - domain,model.domain_completion.assignments,model.domain_completion.bonds) ; DELETED mttroot/ntt/bin/trans/mttNotifyEquationSort.m Index: mttroot/ntt/bin/trans/mttNotifyEquationSort.m ================================================================== --- mttroot/ntt/bin/trans/mttNotifyEquationSort.m +++ mttroot/ntt/bin/trans/mttNotifyEquationSort.m @@ -1,23 +0,0 @@ -function is_complete = mttNotifyEquationSort(sort_iteration,... - number_of_unsorted_equations,number_of_equations,... - number_of_known_covariables,number_of_covariables,... - number_of_known_interface_variables,number_of_interface_variables) ; - -% number_of_known_covariables = number_of_known_covariables - 1 ; - number_of_known_interface_variables = number_of_known_interface_variables - 1 ; - - number_of_sorted_equations = number_of_equations - number_of_unsorted_equations ; - - sorted = floor(100*number_of_sorted_equations/number_of_equations) ; - covar = floor(100*number_of_known_covariables/number_of_covariables) ; - interface_var = floor(100*number_of_known_interface_variables/number_of_interface_variables) ; - - fprintf([' ...%i%% complete [%i/%i]\n'],... - sorted,number_of_sorted_equations,number_of_equations) ; - fprintf([' matching %i%% co_variables [%i/%i] and'],... - covar,number_of_known_covariables,number_of_covariables) ; - fprintf([' %i%% interface_variables [%i/%i]\n'],... - interface_var,number_of_known_interface_variables,number_of_interface_variables) ; - - is_complete = (sorted==100) & (covar==100) & (interface_var==100) ; - DELETED mttroot/ntt/bin/trans/mttNotifyEquationSortProblems.m Index: mttroot/ntt/bin/trans/mttNotifyEquationSortProblems.m ================================================================== --- mttroot/ntt/bin/trans/mttNotifyEquationSortProblems.m +++ mttroot/ntt/bin/trans/mttNotifyEquationSortProblems.m @@ -1,7 +0,0 @@ -function mttNotifyEquationSortProblems(name_known,namelist) - fprintf(' ...undetermined interface_variables are:\n') ; - for i = 2:length(namelist) - if ~name_known(i) - fprintf([' ',namelist{i},'\n']) ; - end - end DELETED mttroot/ntt/bin/trans/mttNotifyEquationSummary.m Index: mttroot/ntt/bin/trans/mttNotifyEquationSummary.m ================================================================== --- mttroot/ntt/bin/trans/mttNotifyEquationSummary.m +++ mttroot/ntt/bin/trans/mttNotifyEquationSummary.m @@ -1,7 +0,0 @@ -function mttNotifyEquationSummary(number_of_equations,number_of_covariables,number_of_interface_variables) - mttNotify([' ...model has ',num2str(number_of_equations),' equations']) ; - mttWriteNewLine ; - mttNotify([' with ',num2str(number_of_covariables),' co_variables']) ; - mttNotify([' and ',num2str(number_of_interface_variables),' interface_variables']) ; - mttWriteNewLine ; - DELETED mttroot/ntt/bin/trans/mttNotifyNumberOfBonds.m Index: mttroot/ntt/bin/trans/mttNotifyNumberOfBonds.m ================================================================== --- mttroot/ntt/bin/trans/mttNotifyNumberOfBonds.m +++ mttroot/ntt/bin/trans/mttNotifyNumberOfBonds.m @@ -1,4 +0,0 @@ -function mttNotifyOfBonds(model) - - number_of_bonds = model.causal_completion.bonds ; - fprintf(' ...model has %i bonds',number_of_bonds) ; DELETED mttroot/ntt/bin/trans/mttNotifyNumberOfObjects.m Index: mttroot/ntt/bin/trans/mttNotifyNumberOfObjects.m ================================================================== --- mttroot/ntt/bin/trans/mttNotifyNumberOfObjects.m +++ mttroot/ntt/bin/trans/mttNotifyNumberOfObjects.m @@ -1,5 +0,0 @@ -function mttNotifyOfObjects(model) - - number_of_objects = model.count.obj ; - number_of_crs = model.count.cr ; - fprintf(' ...model has %i active objects (%i implemented by CRs)',number_of_objects,number_of_crs) ; DELETED mttroot/ntt/bin/trans/mttReadFile.m Index: mttroot/ntt/bin/trans/mttReadFile.m ================================================================== --- mttroot/ntt/bin/trans/mttReadFile.m +++ mttroot/ntt/bin/trans/mttReadFile.m @@ -1,23 +0,0 @@ -function content = mttReadFile(filename) - -file_exists = exist(filename)==2 ; -if file_exists - fid = fopen(filename,'r') ; - reading = 1 ; - - counter = 0 ; - while reading - line = fgetl(fid) ; - if ~isempty(line) - if line==-1 - reading = 0 ; - else - counter = counter + 1 ; - content{counter} = line ; - end - end - end - fclose(fid) ; -else - error(['file_not_found[',filename,']']) -end DELETED mttroot/ntt/bin/trans/mttSeparateText.m Index: mttroot/ntt/bin/trans/mttSeparateText.m ================================================================== --- mttroot/ntt/bin/trans/mttSeparateText.m +++ mttroot/ntt/bin/trans/mttSeparateText.m @@ -1,14 +0,0 @@ -function [left,right] = mttSeparateText(text) - if isempty(text) - left = [] ; - right = [] ; - else - whitespace = min(find(isspace(text))) ; - if isempty(whitespace) - left = text ; - right = [] ; - else - left = text(1:whitespace-1) ; - right = mttClipText(text(whitespace+1:length(text))) ; - end - end DELETED mttroot/ntt/bin/trans/mttSetFieldDefault.m Index: mttroot/ntt/bin/trans/mttSetFieldDefault.m ================================================================== --- mttroot/ntt/bin/trans/mttSetFieldDefault.m +++ mttroot/ntt/bin/trans/mttSetFieldDefault.m @@ -1,11 +0,0 @@ -function structure = mttSetFieldDefault(structure,component,value) - undefined = 0 ; - if isfield(structure,component) - undefined = isempty(getfield(structure,component)) ; - else - undefined = 1 ; - end - - if undefined - structure = setfield(structure,component,value) ; - end DELETED mttroot/ntt/bin/trans/mttUpdateBondCausality.m Index: mttroot/ntt/bin/trans/mttUpdateBondCausality.m ================================================================== --- mttroot/ntt/bin/trans/mttUpdateBondCausality.m +++ mttroot/ntt/bin/trans/mttUpdateBondCausality.m @@ -1,63 +0,0 @@ -%function [model,bond_not_failed,diagnostic] = mttUpdateBondCausality(... -% model,bond_number,effort_causality,flow_causality,uni_causality) -function [model,bond_not_failed] = mttUpdateBondCausality(... - model,bond_number,effort_causality,flow_causality,uni_causality) - - if isempty(bond_number) - bond_not_failed = 1 ; -% diagnostic = [] ; - else - [model.bond(bond_number).effort,effort_ok] = ... - update_causality(model.bond(bond_number).effort,effort_causality) ; - [model.bond(bond_number).flow,flow_ok] = ... - update_causality(model.bond(bond_number).flow,flow_causality) ; - [model.bond(bond_number).unicausal,unicausal_ok] = ... - update_causality(model.bond(bond_number).unicausal,uni_causality) ; - - [model.bond(bond_number),unicausal_checked] = ... - check_unicausal(model.bond(bond_number)) ; - - bond_not_failed = effort_ok & flow_ok & unicausal_ok & unicausal_checked ; -% diagnostic = [effort_ok,flow_ok,unicausal_ok,unicausal_checked] ; - end - - -function [value,ok] = update_causality(value,new_value) - ok = 1 ; - - if ~isempty(new_value) - if isempty(value) - value = new_value ; - else - ok = value==new_value ; - end - end - -function [bond,ok] = check_unicausal(bond) - unicausal_defined = ~isempty(bond.unicausal) ; - effort_defined = ~isempty(bond.effort) ; - flow_defined = ~isempty(bond.flow) ; - - ok = 1 ; - - if unicausal_defined - switch bond.unicausal - case 0, - if effort_defined & flow_defined - ok = bond.effort==~bond.flow ; - elseif effort_defined & ~flow_defined - bond.flow = ~bond.effort ; - elseif flow_defined & ~effort_defined - bond.effort = ~bond.flow ; - end - case 1, - if effort_defined & flow_defined - ok = bond.effort==bond.flow ; - elseif effort_defined & ~flow_defined - bond.flow = bond.effort ; - elseif flow_defined & ~effort_defined - bond.effort = bond.flow ; - end - end - end - DELETED mttroot/ntt/bin/trans/mttUpdateBondDomain.m Index: mttroot/ntt/bin/trans/mttUpdateBondDomain.m ================================================================== --- mttroot/ntt/bin/trans/mttUpdateBondDomain.m +++ mttroot/ntt/bin/trans/mttUpdateBondDomain.m @@ -1,41 +0,0 @@ -function [model,bond_not_failed] = mttUpdateBondDomain(... - model,bond_number,imposed_domain,imposed_domain_item) - - if isempty(bond_number) - bond_not_failed = 1 ; - else - [model.bond(bond_number).domain,domain_ok] = ... - update_domain(model.bond(bond_number).domain,imposed_domain) ; - if domain_ok - [model.bond(bond_number).domain_item,domain_item_ok] = ... - update_domain_item(model.bond(bond_number).domain_item,imposed_domain_item) ; - else - domain_item_ok = 0 ; - end - - bond_not_failed = domain_ok & domain_item_ok ; - end - - -function [value,ok] = update_domain(value,new_value) - ok = 1 ; - - if ~isempty(new_value) - if isempty(value) - value = new_value ; - else - ok = value==new_value ; - end - end - -function [value,ok] = update_domain_item(value,new_value) - ok = 1 ; - - if ~isempty(new_value) - if isempty(value) - value = new_value ; - else - ok = strcmp(value,new_value) ; - end - end - DELETED mttroot/ntt/bin/trans/mttValidateName.m Index: mttroot/ntt/bin/trans/mttValidateName.m ================================================================== --- mttroot/ntt/bin/trans/mttValidateName.m +++ mttroot/ntt/bin/trans/mttValidateName.m @@ -1,18 +0,0 @@ -function mttValidateName(name) - mttAssert(~isempty(name),'Empty name') ; - - numbers = (name>=48 & name<=57) ; - letters = (name>=65 & name<=90)|(name>=97 & name<=122) ; - underscores = (name==95) ; - - is_alphanumeric = all(numbers|letters|underscores) ; - starts_with_letter = isletter(name(1)) ; - - valid_name = is_alphanumeric & starts_with_letter ; -% mtt_prefix = strncmp(name,'mtt_',4) ; - mtt_delimiter = ~isempty(findstr(name,'__')) ; - -% mttAssert(~mtt_prefix,['"',name,'" must not contain "mtt_" prefix']) ; - mttAssert(~mtt_delimiter,['"',name,'" must not contain contiguous "_" delimiters']) ; - mttAssert(valid_name,['"',name,'" is not a valid name']) ; - mttAssert(length(name)<32,['"',name,'" must be shortened to less than 32 characters']) ; DELETED mttroot/ntt/bin/trans/mttVerifyAlternativeEquations.m Index: mttroot/ntt/bin/trans/mttVerifyAlternativeEquations.m ================================================================== --- mttroot/ntt/bin/trans/mttVerifyAlternativeEquations.m +++ mttroot/ntt/bin/trans/mttVerifyAlternativeEquations.m @@ -1,41 +0,0 @@ -function delta = mttVerifyEquations(primary,secondary) - searching = 1 ; - - length_primary = length(primary) ; - length_secondary = length(secondary) ; - - i = 1 ; - j = 1 ; - k = 1 ; - fprintf('k=%i: i=%i j=%i L=%i\n',k,i,j,length_secondary) ; - - while searching - k = k + 1 ; - if strcmp(primary(i),secondary(j)) - secondary(j) = [] ; - length_secondary = length_secondary - 1 ; - fprintf('k=%i: i=%i j=%i L=%i\n',k,i,j,length_secondary) ; - - i = i + 1; - j = 1 ; - else - j = j + 1 ; - end - - if length_secondary<1 - searching = 0 ; - elseif j>length_secondary - i = i + 1 ; - j = 1 ; - end - - if i>length_primary - searching = 0 ; - end - end - - delta = secondary ; - - fprintf('Verification complete after %i iterations\n',k) ; - fprintf('...%i new records found\n',length(delta)) ; - DELETED mttroot/ntt/bin/trans/mttWriteNewLine.m Index: mttroot/ntt/bin/trans/mttWriteNewLine.m ================================================================== --- mttroot/ntt/bin/trans/mttWriteNewLine.m +++ mttroot/ntt/bin/trans/mttWriteNewLine.m @@ -1,3 +0,0 @@ -function mttWriteNewLine - fprintf('\n') ; - DELETED mttroot/patches/p2c/p2c-1.21alpha2/lex.c.diff Index: mttroot/patches/p2c/p2c-1.21alpha2/lex.c.diff ================================================================== --- mttroot/patches/p2c/p2c-1.21alpha2/lex.c.diff +++ mttroot/patches/p2c/p2c-1.21alpha2/lex.c.diff @@ -1,63 +0,0 @@ -*** p2c-1.22/src/lex.c Tue Mar 16 09:28:20 1999 ---- p2c-1.22-dev/src/lex.c Tue Jan 30 16:57:23 2001 -*************** Static int skipflag; -*** 38,44 **** - Static char modulenotation; - Static short inputkind; - Static Strlist *instrlist; -! Static char inbuf[300]; - Static char *oldinfname, *oldctxname; - Static Strlist *endnotelist; - ---- 38,44 ---- - Static char modulenotation; - Static short inputkind; - Static Strlist *instrlist; -! Static char *inbuf; - Static char *oldinfname, *oldctxname; - Static Strlist *endnotelist; - -*************** void init_lex() -*** 411,416 **** ---- 411,417 ---- - inputkind = INP_FILE; - inf_lnum = 0; - inf_ltotal = 0; -+ inbuf = ALLOC(buffersize, char, strings); /* strings ? */ - *inbuf = 0; - inbufptr = inbuf; - keepingstrlist = NULL; -*************** void getline() -*** 1055,1061 **** - case INP_INCFILE: - inf_lnum++; - inf_ltotal++; -! if (fgets(inbuf, 300, inf)) { - cp = inbuf + strlen(inbuf); - if (*inbuf && cp[-1] == '\n') - cp[-1] = 0; ---- 1056,1062 ---- - case INP_INCFILE: - inf_lnum++; - inf_ltotal++; -! if (fgets(inbuf, buffersize, inf)) { - cp = inbuf + strlen(inbuf); - if (*inbuf && cp[-1] == '\n') - cp[-1] = 0; -*************** int p2c_only, starparen; -*** 1889,1895 **** - } - if (!isalpha(*cp)) - return 0; -! while ((isalnum(*cp) || *cp == '_') && cp2 < namebuf+300) - *cp2++ = toupper(*cp++); - if (cp[0] == '+' && cp[1] == '+' && - cp == inbufptr+1 && toupper(cp[-1]) == 'C') ---- 1890,1896 ---- - } - if (!isalpha(*cp)) - return 0; -! while ((isalnum(*cp) || *cp == '_') && cp2 < namebuf+buffersize) - *cp2++ = toupper(*cp++); - if (cp[0] == '+' && cp[1] == '+' && - cp == inbufptr+1 && toupper(cp[-1]) == 'C') DELETED mttroot/patches/p2c/p2c-1.21alpha2/loc.p2crc Index: mttroot/patches/p2c/p2c-1.21alpha2/loc.p2crc ================================================================== --- mttroot/patches/p2c/p2c-1.21alpha2/loc.p2crc +++ mttroot/patches/p2c/p2c-1.21alpha2/loc.p2crc @@ -1,12 +0,0 @@ - -# Store public p2crc commands local to your system here, so that -# you can grab a new version of sys.p2crc without losing your changes. - -BufferSize=1000000. - -LineWidth=1000000. -MaxLineWidth=1000000. - -OverWidePenalty=0. -OverWideExtraPenalty=0. - DELETED mttroot/patches/p2c/p2c-1.21alpha2/parse.c.diff Index: mttroot/patches/p2c/p2c-1.21alpha2/parse.c.diff ================================================================== --- mttroot/patches/p2c/p2c-1.21alpha2/parse.c.diff +++ mttroot/patches/p2c/p2c-1.21alpha2/parse.c.diff @@ -1,19 +0,0 @@ -*** p2c-1.22/src/parse.c Tue Mar 16 09:28:20 1999 ---- p2c-1.22-dev/src/parse.c Tue Jan 30 16:30:40 2001 -*************** int p_search(fname, ext, need) -*** 5477,5483 **** - char *fname, *ext; - int need; - { -! char infnbuf[300]; - FILE *fp; - Meaning *mod; - int savesysprog, savecopysource; ---- 5477,5483 ---- - char *fname, *ext; - int need; - { -! char infnbuf[buffersize]; - FILE *fp; - Meaning *mod; - int savesysprog, savecopysource; DELETED mttroot/patches/p2c/p2c-1.21alpha2/sys.p2crc.diff Index: mttroot/patches/p2c/p2c-1.21alpha2/sys.p2crc.diff ================================================================== --- mttroot/patches/p2c/p2c-1.21alpha2/sys.p2crc.diff +++ mttroot/patches/p2c/p2c-1.21alpha2/sys.p2crc.diff @@ -1,13 +0,0 @@ -*** p2c-1.22/src/sys.p2crc Tue Mar 16 09:28:20 1999 ---- p2c-1.22-dev/src/sys.p2crc Tue Jan 30 17:01:14 2001 -*************** MinSpacingThresh # If spe -*** 455,460 **** ---- 455,462 ---- - - # LINE BREAKING - -+ BufferSize # Maximum input line length; default=300. -+ - LineWidth # Target max output line width; default=78. - - MaxLineWidth # Absolute max output line width; default=90. DELETED mttroot/patches/p2c/p2c-1.21alpha2/trans.h.diff Index: mttroot/patches/p2c/p2c-1.21alpha2/trans.h.diff ================================================================== --- mttroot/patches/p2c/p2c-1.21alpha2/trans.h.diff +++ mttroot/patches/p2c/p2c-1.21alpha2/trans.h.diff @@ -1,22 +0,0 @@ -*** p2c-1.22/src/trans.h Tue Mar 16 09:28:21 1999 ---- p2c-1.22-dev/src/trans.h Tue Jan 30 17:25:33 2001 -*************** extern int sizeof_char, sizeof_short, si -*** 1133,1138 **** ---- 1133,1139 ---- - extern short size_t_long; - extern int setbits, defaultsetsize, seek_base, integerwidth, realwidth; - extern short quoteincludes, expandincludes, collectnest; -+ extern const int buffersize; - extern int phystabsize, intabsize, linewidth, maxlinewidth; - extern int majorspace, minorspace, declspace, functionspace, minfuncspace; - extern int casespacing, caselimit; -*************** struct rcstruct { -*** 1351,1356 **** ---- 1352,1358 ---- - 'I', 'R', "MINSPACINGTHRESH",(anyptr) &minspacingthresh, -1, - - /* LINE BREAKING */ -+ 'I', 'R', "BUFFERSIZE", (anyptr) &buffersize, 300, - 'I', 'R', "LINEWIDTH", (anyptr) &linewidth, 78, - 'I', 'R', "MAXLINEWIDTH", (anyptr) &maxlinewidth, 90, - 'R', 'V', "OVERWIDEPENALTY", (anyptr) &overwidepenalty, 2500, ADDED ntt/COPYING Index: ntt/COPYING ================================================================== --- ntt/COPYING +++ ntt/COPYING @@ -0,0 +1,358 @@ + + ntt: new transformation tools for using bond graphs with Matlab + Copyright (C) 2003 Dr. Dominic J. Diston + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +^L + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. ADDED ntt/bin/make_abg.m Index: ntt/bin/make_abg.m ================================================================== --- ntt/bin/make_abg.m +++ ntt/bin/make_abg.m @@ -0,0 +1,57 @@ +function abg = make_abg(system) +global mtt_environment + +start_time = mttGetTime ; + +input = [] ; +abg = [] ; + + +switch class(system) +case 'char', + input = 'spec' ; +case 'struct', + if isfield(system,'representation') + input = system.representation ; + end +end + + +if strcmp(input,'spec') + mttWriteNewLine ; + mttNotify('Making "abg" representation') ; + mttWriteNewLine ; + + if isempty(mtt_environment) + mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; + mttWriteNewLine ; + mttNotify(' => paths will not be recognised') ; + mttWriteNewLine ; + end + + abg = mttCreateAcausalBondgraph(system) ; + input = 'abg' ; +end + +mttAssert(strcmp(input,'abg'),'Input representation not recognised') ; + +if isempty(abg) + mttWriteNewLine ; + mttNotify('Copying "abg" representation') ; + mttWriteNewLine ; + + mttNotify('...INFO: Input already defined as a "abg": copying to Output') ; + mttWriteNewLine ; + mttWriteNewLine ; + abg = system ; +end + + +elapsed_time = mttElapseTime(start_time) ; +cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; + +mttWriteNewLine ; +mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; +mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; +mttWriteNewLine ; +mttWriteNewLine ; ADDED ntt/bin/make_cbg.m Index: ntt/bin/make_cbg.m ================================================================== --- ntt/bin/make_cbg.m +++ ntt/bin/make_cbg.m @@ -0,0 +1,70 @@ +function cbg = make_cbg(system) +global mtt_environment + +start_time = mttGetTime ; + +input = [] ; +abg = [] ; +cbg = [] ; + + +switch class(system) +case 'char', + input = 'spec' ; +case 'struct', + if isfield(system,'representation') + input = system.representation ; + end +end + + +if strcmp(input,'spec') + mttWriteNewLine ; + mttNotify('Making "abg" representation') ; + mttWriteNewLine ; + + if isempty(mtt_environment) + mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; + mttWriteNewLine ; + mttNotify(' => paths will not be recognised') ; + mttWriteNewLine ; + end + + abg = mttCreateAcausalBondgraph(system) ; + input = 'abg' ; +end + +if strcmp(input,'abg') + if isempty(abg) + abg = system ; + end + + mttWriteNewLine ; + mttNotify('Transforming from "abg" to "cbg"') ; + mttWriteNewLine ; + cbg = mttCreateCausalBondgraph(abg) ; + input = 'cbg' ; +end + +mttAssert(strcmp(input,'cbg'),'Input representation not recognised') ; + +if isempty(cbg) + mttWriteNewLine ; + mttNotify('Copying "cbg" representation') ; + mttWriteNewLine ; + + mttNotify('...INFO: Input already defined as a "cbg": copying to Output') ; + mttWriteNewLine ; + mttWriteNewLine ; + cbg = system ; +end + + +elapsed_time = mttElapseTime(start_time) ; +cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; + +mttWriteNewLine ; +mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; +mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; +mttWriteNewLine ; +mttWriteNewLine ; ADDED ntt/bin/make_env.m Index: ntt/bin/make_env.m ================================================================== --- ntt/bin/make_env.m +++ ntt/bin/make_env.m @@ -0,0 +1,52 @@ +function make_env(system) +global mtt_environment + +start_time = mttGetTime ; + +input = [] ; +env = [] ; + + +switch class(system) +case 'char', + input = 'spec' ; +case 'struct', + if isfield(system,'representation') + input = system.representation ; + end +end + +if strcmp(input,'spec') + mttWriteNewLine ; + mttNotify('Making "env" representation') ; + mttWriteNewLine ; + + env = mttCreateEnvironment(system) ; + input = 'env' ; +end + +mttAssert(strcmp(input,'env'),'Input representation not recognised') ; + +if isempty(env) + mttWriteNewLine ; + mttNotify('Copying "env" representation') ; + mttWriteNewLine ; + + mttNotify('...INFO: Input already defined as a "env": copying to Output') ; + mttWriteNewLine ; + mttWriteNewLine ; + env = system ; +end + + +elapsed_time = mttElapseTime(start_time) ; +cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; + +mttWriteNewLine ; +mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; +mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; +mttWriteNewLine ; +mttWriteNewLine ; + + +mtt_environment = env ; ADDED ntt/bin/make_ese.m Index: ntt/bin/make_ese.m ================================================================== --- ntt/bin/make_ese.m +++ ntt/bin/make_ese.m @@ -0,0 +1,84 @@ +function ese = make_ese(system,sorter_on) +global mtt_environment + +if nargin<2 + sorter_on = 1 ; +end + +switch class(system) +case 'char', + input = 'spec' ; +case 'struct', + if isfield(system,'representation') + input = system.representation ; + end +end + +start_time = mttGetTime ; + +abg = [] ; +cbg = [] ; +ese = [] ; + +if strcmp(input,'spec') + mttWriteNewLine ; + mttNotify('Making "abg" representation') ; + mttWriteNewLine ; + + if isempty(mtt_environment) + mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; + mttWriteNewLine ; + mttNotify(' => paths will not be recognised') ; + mttWriteNewLine ; + end + + abg = mttCreateAcausalBondgraph(system) ; + input = 'abg' ; +end + +if strcmp(input,'abg') + if isempty(abg) + abg = system ; + end + + mttWriteNewLine ; + mttNotify('Transforming from "abg" to "cbg"') ; + mttWriteNewLine ; + cbg = mttCreateCausalBondgraph(abg) ; + input = 'cbg' ; +end + +if strcmp(input,'cbg') + if isempty(cbg) + cbg = system ; + end + + mttWriteNewLine ; + mttNotify('Transforming from "cbg" to "ese"') ; + mttWriteNewLine ; + ese = mttCreateElementaryEquations(cbg,sorter_on) ; + input = 'ese' ; +end + +mttAssert(strcmp(input,'ese'),'Input representation not recognised') ; + +if isempty(ese) + mttWriteNewLine ; + mttNotify('Making "ese" representation') ; + mttWriteNewLine ; + + mttNotify('Input already defined as a "ese": copying to Output') ; + mttWriteNewLine ; + mttWriteNewLine ; + ese = system ; +end + + +elapsed_time = mttElapseTime(start_time) ; +cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; + +mttWriteNewLine ; +mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; +mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; +mttWriteNewLine ; +mttWriteNewLine ; ADDED ntt/bin/make_mdl.m Index: ntt/bin/make_mdl.m ================================================================== --- ntt/bin/make_mdl.m +++ ntt/bin/make_mdl.m @@ -0,0 +1,78 @@ +function make_sfun(system,sorter_on) +global mtt_environment + +if nargin<2 + sorter_on = 1 ; +end + +switch class(system) +case 'char', + input = 'spec' ; +case 'struct', + if isfield(system,'representation') + input = system.representation ; + end +end + +start_time = mttGetTime ; + +abg = [] ; +cbg = [] ; +ese = [] ; + +if strcmp(input,'spec') + mttWriteNewLine ; + mttNotify('Making "abg" representation') ; + mttWriteNewLine ; + + if isempty(mtt_environment) + mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; + mttWriteNewLine ; + mttNotify(' => paths will not be recognised') ; + mttWriteNewLine ; + end + + abg = mttCreateAcausalBondgraph(system) ; + input = 'abg' ; +end + +if strcmp(input,'abg') + if isempty(abg) + abg = system ; + end + + mttWriteNewLine ; + mttNotify('Transforming from "abg" to "cbg"') ; + mttWriteNewLine ; + cbg = mttCreateCausalBondgraph(abg) ; + input = 'cbg' ; +end + +if strcmp(input,'cbg') + if isempty(cbg) + cbg = system ; + end + + mttWriteNewLine ; + mttNotify('Transforming from "cbg" to "ese"') ; + mttWriteNewLine ; + ese = mttCreateElementaryEquations(cbg,sorter_on) ; + input = 'ese' ; +end + +mttAssert(strcmp(input,'ese'),'Input representation not recognised') ; + +if isempty(ese) + ese = system ; +end +mttCreateSystemMdl(ese) ; + + +elapsed_time = mttElapseTime(start_time) ; +cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; + +mttWriteNewLine ; +mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; +mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; +mttWriteNewLine ; +mttWriteNewLine ; ADDED ntt/bin/make_sfun.m Index: ntt/bin/make_sfun.m ================================================================== --- ntt/bin/make_sfun.m +++ ntt/bin/make_sfun.m @@ -0,0 +1,85 @@ +function make_sfun(system,sorter_on) +global mtt_environment + +if nargin<2 + sorter_on = 1 ; +end + +switch class(system) +case 'char', + input = 'spec' ; +case 'struct', + if isfield(system,'representation') + input = system.representation ; + end +end + +start_time = mttGetTime ; + +abg = [] ; +cbg = [] ; +ese = [] ; + +if strcmp(input,'spec') + mttWriteNewLine ; + mttNotify('Making "abg" representation') ; + mttWriteNewLine ; + + if isempty(mtt_environment) + mttNotify('...WARNING: No "env" definition => all domain references will be ignored') ; + mttWriteNewLine ; + mttNotify(' => paths will not be recognised') ; + mttWriteNewLine ; + end + + abg = mttCreateAcausalBondgraph(system) ; + input = 'abg' ; +end + +if strcmp(input,'abg') + if isempty(abg) + abg = system ; + end + + mttWriteNewLine ; + mttNotify('Transforming from "abg" to "cbg"') ; + mttWriteNewLine ; + cbg = mttCreateCausalBondgraph(abg) ; + input = 'cbg' ; +end + +if strcmp(input,'cbg') + if isempty(cbg) + cbg = system ; + end + + mttWriteNewLine ; + mttNotify('Transforming from "cbg" to "ese"') ; + mttWriteNewLine ; + ese = mttCreateElementaryEquations(cbg,sorter_on) ; + input = 'ese' ; +end + +mttAssert(strcmp(input,'ese'),'Input representation not recognised') ; + +if isempty(ese) + ese = system ; +end +mttWriteSystemEquations(ese) ; +mttWriteSystemDefinitions(ese) ; +mttWriteSystemInitialisation(ese) ; +mttWriteSystemMapping(ese) ; + +ese = mttCreateApps(ese) ; +mttWriteSystemApps(ese) ; +mttWriteSystemSfun(ese) ; + + +elapsed_time = mttElapseTime(start_time) ; +cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ; + +mttWriteNewLine ; +mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ; +mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ; +mttWriteNewLine ; +mttWriteNewLine ; ADDED ntt/bin/trans/m/mttApplyInterfaceCausality.m Index: ntt/bin/trans/m/mttApplyInterfaceCausality.m ================================================================== --- ntt/bin/trans/m/mttApplyInterfaceCausality.m +++ ntt/bin/trans/m/mttApplyInterfaceCausality.m @@ -0,0 +1,200 @@ +function model = mttApplyInterfaceCausality(model,specified_rule,branch) ; + is_root_model = (nargin==2) ; + + objects = mttGetFieldNames(model,'obj') ; + + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + if isfield(object,'obj') + if is_root_model + branch = object_name ; + else + branch = [branch,'/',object_name] ; + end + + object = mttApplyInterfaceCausality(object,specified_rule,branch) ; + model = setfield(model,'obj',object_name,object) ; + + else + if ~isempty(object.cr) + if is_root_model + branch = mttDetachText(model.source,'/') ; + end + here = [branch,':',object_name] ; + + port_names = mttGetFieldNames(object.cr.interface,'port') ; + + for j = 1:length(port_names) + port_name = port_names{j} ; + port = getfield(object.cr.interface,'port',port_name) ; + + inbond = port.in ; + outbond = port.out ; + + for k = 1:mttGetFieldLength(port,'causality') + rule = port.causality(k).rule ; + definition = port.causality(k).def ; + association = port.causality(k).with ; + not_applied = ~port.causality(k).applied ; + + switch rule + case 'assert', is_assertion = 1 ; + case 'prefer', is_assertion = 0 ; + otherwise + error(['Unrecognised rule "',port_causality.rule,'" in ',here]) ; + end + + apply_rule = strcmp(specified_rule,rule) & not_applied ; + if apply_rule + + switch definition +% case 'effort_state', +% mttAssert(mttIsEqual(port.is_flow_state,0),... +% ['Attempt to overwrite state assignment at port "',port_name,'" in ',here]) ; +% port.is_effort_state = 1 ; + +% case 'flow_state', +% mttAssert(mttIsEqual(port.is_effort_state,0),... +% ['Attempt to overwrite state assignment at port "',port_name,'" in ',here]) ; +% port.is_flow_state = 1 ; + + case {'effort_in_flow_out','flow_in_effort_out','flow_out_effort_in','effort_out_flow_in'} + mttAssert(isempty(association),... + ['Over-constraint at port "',port_name,'" in ',here]) ; + + switch definition + case {'effort_in_flow_out','flow_out_effort_in'}, + [model,inbond_ok] = mttUpdateBondCausality(model,inbond,1,1,1) ; + [model,outbond_ok] = mttUpdateBondCausality(model,outbond,0,0,1) ; + case {'flow_in_effort_out','effort_out_flow_in'}, + [model,inbond_ok] = mttUpdateBondCausality(model,inbond,0,0,1) ; + [model,outbond_ok] = mttUpdateBondCausality(model,outbond,1,1,1) ; + end + + ok = inbond_ok & outbond_ok ; + if is_assertion + mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; + end + + case 'effort_in' + mttAssert(isempty(association),... + ['Over-constraint at port "',port_name,'" in ',here]) ; + + [model,inbond_ok] = mttUpdateBondCausality(model,inbond,1,[],1) ; + [model,outbond_ok] = mttUpdateBondCausality(model,outbond,0,[],1) ; + + ok = inbond_ok & outbond_ok ; + if is_assertion + mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; + end + + case 'effort_out' + mttAssert(isempty(association),... + ['Over-constraint at port "',port_name,'" in ',here]) ; + + [model,inbond_ok] = mttUpdateBondCausality(model,inbond,0,[],1) ; + [model,outbond_ok] = mttUpdateBondCausality(model,outbond,1,[],1) ; + + ok = inbond_ok & outbond_ok ; + if is_assertion + mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; + end + + case 'flow_in' + mttAssert(isempty(association),... + ['Over-constraint at port "',port_name,'" in ',here]) ; + + [model,inbond_ok] = mttUpdateBondCausality(model,inbond,[],0,1) ; + [model,outbond_ok] = mttUpdateBondCausality(model,outbond,[],1,1) ; + + ok = inbond_ok & outbond_ok ; + if is_assertion + mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; + end + + case 'flow_out' + mttAssert(isempty(association),... + ['Over-constraint at port "',port_name,'" in ',here]) ; + + [model,inbond_ok] = mttUpdateBondCausality(model,inbond,[],1,1) ; + [model,outbond_ok] = mttUpdateBondCausality(model,outbond,[],0,1) ; + + ok = inbond_ok & outbond_ok ; + if is_assertion + mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; + end + + case 'unicausal', + mttAssert(isempty(association),... + ['Over-constraint at port "',port_name,'" in ',here]) ; + + [model,inbond_ok] = mttUpdateBondCausality(model,inbond,[],[],1) ; + [model,outbond_ok] = mttUpdateBondCausality(model,outbond,[],[],1) ; + + ok = inbond_ok & outbond_ok ; + if is_assertion + mttAssert(ok,['Causal conflict at port "',port_name,'" in ',here]) ; + end + + case {'equicausal','anticausal'} + mttAssert(length(association)==1,... + ['Incorrect constraint at port "',port_name,'" in ',here]) ; + + associated_port_name = association{1} ; + associated_port = getfield(cr.interface,'port',associated_port_name) ; + + associated_inbond = associated_port.in ; + associated_outbond = associated_port.out ; + + mttAsert(xor(isempty(inbond),isempty(outbond)),... + ['Causal rule expects unique bond at port "',port_name,'" in ',here]) ; + mttAsert(xor(isempty(associated_inbond),isempty(associated_outbond)),... + ['Causal rule expects unique bond at port "',associated_port_name,'" in ',here]) ; + + if isempty(associated_inbond) + a = associated_outbond ; + else + a = associated_inbond ; + end + + if isempty(inbond) + b = outbond ; + else + b = inbond ; + end + + switch definition + case 'equicausal', + [model,bond_ok] = mttUpdateBondCausality(model,b,... + model.bond(a).effort,model.bond(a).flow,model.bond(a).unicausal) ; + [model,associated_bond_ok] = mttUpdateBondCausality(model,a,... + model.bond(b).effort,~model.bond(b).flow,model.bond(b).unicausal) ; + case 'anticausal', + [model,bond_ok] = mttUpdateBondCausality(model,b,... + ~model.bond(a).effort,model.bond(a).flow,model.bond(a).unicausal) ; + [model,associated_bond_ok] = mttUpdateBondCausality(model,a,... + ~model.bond(b).effort,~model.bond(b).flow,model.bond(b).unicausal) ; + end + + ok = bond_ok & associated_bond_ok ; + if is_assertion + mttAssert(ok,['Causal conflict between ports "',port_name,... + 'and',associated_port_name,'" in ',here]) ; + end + + otherwise, + error(['Unrecognised constraint "',definition,'" in ',here]) ; + end + + port.causality(k).applied = 1 ; + object = setfield(object,'cr','interface','port',port_name,port) ; + model = setfield(model,'obj',object_name,object) ; + end + end + end + end + end + end + ADDED ntt/bin/trans/m/mttApplyInterfaceDomains.m Index: ntt/bin/trans/m/mttApplyInterfaceDomains.m ================================================================== --- ntt/bin/trans/m/mttApplyInterfaceDomains.m +++ ntt/bin/trans/m/mttApplyInterfaceDomains.m @@ -0,0 +1,52 @@ +function model = mttApplyInterfaceDomains(model,branch) ; + is_root_model = (nargin==1) ; + + objects = mttGetFieldNames(model,'obj') ; + + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + if isfield(object,'obj') + if is_root_model + branch = object_name ; + else + branch = [branch,'/',object_name] ; + end + + object = mttApplyInterfaceDomains(object,branch) ; + model = setfield(model,'obj',object_name,object) ; + + else + if ~isempty(object.cr) + if is_root_model + branch = mttDetachText(model.source,'/') ; + end + here = [branch,':',object_name] ; + + port_names = mttGetFieldNames(object.cr.interface,'port') ; + + for j = 1:length(port_names) + port_name = port_names{j} ; + port = getfield(object.cr.interface,'port',port_name) ; + + predefined_domain = port.domain ; + predefined_domain_item = port.domain_item ; + + inbond = port.in ; + outbond = port.out ; + + if isempty(inbond) + bond_number = outbond ; + else + bond_number = inbond ; + end + + [model,ok] = mttUpdateBondDomain(model,bond_number,predefined_domain,predefined_domain_item) ; + + mttAssert(ok,['Domain conflict at port "',port_name,'" in ',here]) ; + end + end + end + end + ADDED ntt/bin/trans/m/mttCreateAcausalBondgraph.m Index: ntt/bin/trans/m/mttCreateAcausalBondgraph.m ================================================================== --- ntt/bin/trans/m/mttCreateAcausalBondgraph.m +++ ntt/bin/trans/m/mttCreateAcausalBondgraph.m @@ -0,0 +1,131 @@ +function model = mttCreateAcausalBondgraph(system,root) +global mtt_environment + + +switch nargin +case 0, + model = [] ; return ; +case 1, + root = [] ; + is_root_model = 1 ; +otherwise, + is_root_model = 0 ; +end + +if is_root_model + model = intialise_model(system) ; + + directory_name = identify_directory_name(system) ; + source_name = identify_source_name(system,directory_name) ; + + mttNotify('...acquiring "abg" source definitions') ; + mttWriteNewLine ; +else + model = propagate_root_data(root) ; + source_name = system ; +end + +specification_filename = [source_name,'_abg.txt'] ; +specification = mttFetchSpecification(specification_filename) ; +specification = mttSetFieldDefault(specification,'bondgraph',system) ; + +[local_system_name,rubbish] = mttDetachText(system,'/') ; +if isempty(local_system_name) + local_system_name = system ; +end + + +if is_root_model + source_name = identify_source_name(specification.bondgraph,directory_name) ; +else + source_name = specification.bondgraph ; +end +source_name = mttCutText(source_name,'_abg.fig') ; + +bondgraph_filename = [source_name,'_abg.fig'] ; +bondgraph = mttFetchBondgraph(bondgraph_filename) ; + +model = mttCreateUnifiedModel(model,bondgraph,specification) ; +model = mttDeleteField(model,'branch') ; +model = mttDeleteField(model,'leaf') ; + + +if is_root_model + mttWriteNewLine ; + mttNotify('...acquiring "cr" source definitions') ; + mttWriteNewLine ; + + for n = 1:length(model.crs) + source_name = model.crs{n} ; + cr_filename = [source_name,'_cr.txt'] ; + + if ~mttFileExists(cr_filename) + cr_short_name = mttDetachText(source_name,'/') ; + + mttNotify([' ...ERROR: "',cr_short_name,'_cr" source does not exist']) ; + mttWriteNewLine ; + mttNotify([' ...finding dependencies for ',source_name,':']) ; + mttWriteNewLine ; + + prefix = mttDetachText(system,'/') ; + if isempty(prefix) + prefix = system ; + end + + cr_user = model.cr_usage(n).obj ; + for i = 1:length(cr_user) + mttNotify([' ',prefix,'/',cr_user{i}]) ; + mttWriteNewLine ; + end + end + + model.cr(n) = mttFetchInterfaceDefinition(cr_filename) ; + end + + model = mttDeleteField(model,'cr_usage') ; + model = mttDeleteField(model,'crs') ; + model = mttDeleteField(model,'abgs') ; +end + +model.env = mtt_environment ; + + + +function model = intialise_model(system) + model.representation = 'abg' ; + model.abgs = [] ; + model.crs = [] ; + model.cr_usage = [] ; + model.branch = [] ; + model.leaf = [] ; + +function model = propagate_root_data(root) + model.abgs = root.abgs ; + model.crs = root.crs ; + model.cr_usage = root.cr_usage ; + model.branch = root.branch ; + model.leaf = root.leaf ; + +function directory = identify_directory_name(system) + mttAssert(ischar(system),'System must be specified by name') ; + working_directory = pwd ; + working_directory = strrep(working_directory,'\','/') ; + + [system_name,local_directory] = mttDetachText(system,'/') ; + if isempty(system_name) + local_directory = [] ; + end + + if isempty(local_directory) + directory = working_directory ; + else + directory = mttLocateDirectory(working_directory,local_directory) ; + end + +function source = identify_source_name(system,directory) + [system_name,local_directory] = mttDetachText(system,'/') ; + if isempty(system_name) + system_name = system ; + local_directory = [] ; + end + source = [directory,'/',system_name] ; ADDED ntt/bin/trans/m/mttCreateApps.m Index: ntt/bin/trans/m/mttCreateApps.m ================================================================== --- ntt/bin/trans/m/mttCreateApps.m +++ ntt/bin/trans/m/mttCreateApps.m @@ -0,0 +1,72 @@ +function model = mttCreateApps(model) + +apps_filename = [model.source,'_apps.txt'] ; +apps = mttFetchApps(apps_filename) ; + +if isempty(apps) + return ; +end + +for i = 1:length(apps.app) + app_source = apps.app{i} ; + + [rubbish,working_directory] = mttDetachText(model.source,'/') ; + [name,path_spec] = mttDetachText(app_source,'/') ; + + if isempty(name) + source_name = [working_directory,'/',domain_source] ; + else + directory = identify_directory(working_directory,path_spec,model) ; + source_name = [directory,'/',name] ; + end + + app_filename = [source_name,'_app.h'] ; + model.app{i} = app_filename ; +end + + +function directory = identify_directory(working_directory,path_spec,model) + path_names = mttGetFieldNames(model.env,'path') ; + + if isempty(path_spec) + directory = [] ; + else + if path_spec(1)=='$' + [path_alias,path_branch] = mttCutText(path_spec,'/') ; + path_alias(1) = [] ; + + mttAssert(ismember(path_alias,path_names),... + ['Path "',path_alias,'" not recognised']) ; + + path_root = getfield(model.env,'path',path_alias) ; + + if isempty(path_branch) + directory = path_root ; + else + directory = [path_root,'/',path_branch] ; + end + else + [name,local_directory] = mttDetachText(path_spec,'/') ; + + directory_located = 0 ; + if strcmp(local_directory,'.') + if isempty(name) + directory = working_directory ; + directory_located = 1 ; + else + local_directory = name ; + end + else + local_directory = path_spec ; + end + + if ~directory_located + directory = mttLocateDirectory(working_directory,local_directory) ; + end + end + end + + + + + ADDED ntt/bin/trans/m/mttCreateCausalBondgraph.m Index: ntt/bin/trans/m/mttCreateCausalBondgraph.m ================================================================== --- ntt/bin/trans/m/mttCreateCausalBondgraph.m +++ ntt/bin/trans/m/mttCreateCausalBondgraph.m @@ -0,0 +1,452 @@ +function model = mttCreateCausalBondgraph(model) + +model.representation = 'cbg' ; + +model = incorporate_interface_definitions(model) ; +model = establish_abg_dependencies(model) ; +model = create_object_hierarchy(model) ; +model = assign_sympar_values(model) ; +model = complete_causal_assignment(model) ; +model = complete_domain_assignment(model) ; +model = overwrite_implicit_domains(model) ; + + +function model = incorporate_interface_definitions(model) + mttNotify('...incorporating "cr" definitions') ; + mttWriteNewLine ; + + mttNotify([' ...processing ',model.source]) ; + mttWriteNewLine ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + if ~mttIsFoundationClass(object.class) + mttAssert(xor(isempty(object.abg),isempty(object.cr)),... + ['"',object_name,'" must exclusively have a "cr" or an "abg" representation']) ; + end + + if isempty(object.cr) + object = mttDeleteField(object,'cr_item') ; + model = setfield(model,'obj',object_name,object) ; + else + model = mttEmbedInterfaceDefinition(model,object_name) ; + end + end + + for i = 1:mttGetFieldLength(model,'abg') + component_type = mttDetachText(model.abg(i).source,'/') ; + mttNotify([' ...processing "#',num2str(i),':',component_type,'" ',model.abg(i).source]) ; + mttWriteNewLine ; + + objects = mttGetFieldNames(model.abg(i),'obj') ; + for j = 1:length(objects) + object_name = objects{j} ; + object = getfield(model,'abg',{i},'obj',object_name) ; + + if ~mttIsFoundationClass(object.class) + mttAssert(xor(isempty(object.abg),isempty(object.cr)),... + ['abg[',num2str(i),']: "',object_name,'" must exclusively have a "cr" or an "abg" representation']) ; + end + + if isempty(object.cr) + object = mttDeleteField(object,'cr_item') ; + model = setfield(model,'abg',{i},'obj',object_name,object) ; + else + model.abg(i) = mttEmbedInterfaceDefinition(model.abg(i),object_name,model) ; + end + end + model.abg(i).invokes = [] ; + model.abg(i).invoked_by = [] ; + end + model = mttDeleteField(model,'cr') ; + + +function model = establish_abg_dependencies(model) + mttNotify('...establishing "abg" dependencies') ; + mttWriteNewLine ; + + for i = 1:mttGetFieldLength(model,'abg') + objects = mttGetFieldNames(model.abg(i),'obj') ; + for j = 1:length(objects) + object_name = objects{j} ; + object = getfield(model.abg(i).obj,object_name) ; + + if isempty(object.cr) %... still within object hierarchy + if ~mttIsFoundationClass(object.class) + existing_dependencies = model.abg(i).invokes ; + + if isempty(existing_dependencies) + new_dependency = 1 ; + else + new_dependency = isempty(find(existing_dependencies==object.abg)) ; + end + + if new_dependency + model.abg(i).invokes = [existing_dependencies,object.abg] ; + end + + existing_dependencies = model.abg(object.abg).invoked_by ; + if isempty(existing_dependencies) + new_dependency = 1 ; + else + new_dependency = isempty(find(existing_dependencies==i)) ; + end + + if new_dependency + model.abg(object.abg).invoked_by = [existing_dependencies,i] ; + end + end + end + end + end + + model.invokes = [] ; + + objects = mttGetFieldNames(model,'obj') ; + for j = 1:length(objects) + object_name = objects{j} ; + object = getfield(model.obj,object_name) ; + + if ~isempty(object.abg) + if ~mttIsFoundationClass(object.class) + existing_dependencies = model.invokes ; + + if isempty(existing_dependencies) + new_dependency = 1 ; + else + new_dependency = isempty(find(existing_dependencies==object.abg)) ; + end + + if new_dependency + model.invokes = [existing_dependencies,object.abg] ; + end + end + end + end + + +function model = create_object_hierarchy(model) ; + mttNotify('...creating object hierarchy') ; + mttWriteNewLine ; + + top_level_model = mttDetachText(model.source,'/') ; + + if isfield(model,'abg') + is_embedded = zeros(1,length(model.abg)) ; + embedding = 1 ; + else + embedding = 0 ; + end + + component = 0 ; + + embedding = isfield(model,'abg') ; + while embedding + component = 1 + mod(component,length(model.abg)) ; + if ~is_embedded(component) + if isempty(model.abg(component).invokes) + number_of_systems = length(model.abg(component).invoked_by) ; + + for n = 1:number_of_systems + system = model.abg(component).invoked_by(n) ; + component_type = mttDetachText(model.abg(component).source,'/') ; + system_type = mttDetachText(model.abg(system).source,'/') ; + mttNotify([' ...embedding "#',num2str(component),':',component_type,... + '" definition within "#',num2str(system),':',system_type,'" objects']) ; + mttWriteNewLine ; + + model = mttEmbedAcausalBondgraph(model,component,system) ; + end + model.abg(component).invoked_by = [] ; + + if ~isempty(find(model.invokes==component)) + component_type = mttDetachText(model.abg(component).source,'/') ; + mttNotify([' ...embedding "#',num2str(component),':',component_type,... + '" definition within "',top_level_model,'"']) ; + mttWriteNewLine ; + + model = mttEmbedAcausalBondgraph(model,component) ; + end + is_embedded(component) = 1 ; + end + end + embedding = any(~is_embedded) ; + end + + model = mttDeleteField(model,'abg') ; + model = mttDeleteField(model,'invokes') ; + + +function model = assign_sympar_values(model) + mttNotify('...assigning "sympar" values') ; + mttWriteNewLine ; + + model_name = mttDetachText(model.source,'/') ; + current_branch = model_name ; + + sympars = model.sympar ; + defaults = model.sympar_default ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + if ~mttIsPassiveClass(object.class) + for j = 1:length(object.parameter) + object_parameter = object.parameter{j} ; + if ischar(object_parameter) + index = strmatch(object_parameter,sympars,'exact') ; + + new_parameter = 0 ; + + if isempty(index) + new_parameter = 1 ; + else + default_value = defaults{index} ; + if isempty(default_value) + new_parameter = 1 ; + else + object.parameter{j} = default_value ; + end + end + + if new_parameter + object.parameter{j} = [current_branch,'___',object_parameter] ; + end + end + end + + branch = [model_name,'__',object_name] ; + object = assign_object_sympar_values(object,branch) ; + + model = setfield(model,'obj',object_name,object) ; + end + end + + +function model = assign_object_sympar_values(model,branch) + current_branch = branch ; + + sympars = model.sympar ; + parameters = model.parameter ; + + if ~isempty(model.abg) + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + if ~mttIsPassiveClass(object.class) + for j = 1:length(object.parameter) + object_parameter = object.parameter{j} ; + if ischar(object_parameter) + index = strmatch(object_parameter,sympars,'exact') ; + if isempty(index) + object.parameter{j} = [current_branch,'___',object_parameter] ; + else + object.parameter{j} = parameters{index} ; + end + end + end + + branch = [current_branch,'__',object_name] ; + object = assign_object_sympar_values(object,branch) ; + + model = setfield(model,'obj',object_name,object) ; + end + end + elseif ~isempty(model.cr) + model.cr.parameter = model.parameter ; + end + + +function model = complete_causal_assignment(model) + mttWriteNewLine ; + mttNotify('...summarising model content') ; + mttWriteNewLine ; + + model = mttCountObjects(model) ; + mttNotifyNumberOfObjects(model) ; + mttWriteNewLine ; + model = mttDeleteField(model,'count') ; + + model = mttMeasureCausalCompletion(model) ; + mttNotifyNumberOfBonds(model) ; + mttWriteNewLine ; + + mttWriteNewLine ; + mttNotify('...analysing predefined causality') ; + mttWriteNewLine ; + + mttNotifyCausalCompletion(model) ; + mttWriteNewLine ; + + if model.causal_completion.is_causal + mttNotify('...applying CR constraints') ; + mttWriteNewLine ; + model = incorporate_cr_rules(model,'assert') ; + else + mttNotify('...completing causality') ; + mttWriteNewLine ; + + iterations = 0 ; + + propagating = 1 ; + while propagating + iterations = iterations + 1 ; + previous_causal_completion = model.causal_completion ; + + model = mttApplyInterfaceCausality(model,'assert') ; + model = mttPropagateCausality(model) ; + model = mttApplyInterfaceCausality(model,'prefer') ; + model = mttPropagateCausality(model) ; + model = mttMeasureCausalCompletion(model) ; + + is_stable = mttCompareCausalCompletion(model.causal_completion,previous_causal_completion) ; + propagating = (~is_stable) ; + + if propagating + mttNotify(['...iteration ',num2str(iterations)]) ; + mttWriteNewLine ; + mttNotifyCausalCompletion(model) ; + end + + propagating = propagating & (~model.causal_completion.is_causal) ; + end + end + + + if ~model.causal_completion.is_causal + mttWriteNewLine ; + mttNotify('...causality not complete') ; + mttWriteNewLine ; + mttWriteNewLine ; + + mttIdentifyUndercausalBonds(model) ; + end + + model = mttDeleteField(model,'causal_completion') ; + + +function model = complete_domain_assignment(model) + mttWriteNewLine ; + mttNotify('...allocating domain definitions') ; + mttWriteNewLine ; + + model = mttMeasureDomainCompletion(model) ; + + iterations = 0 ; + + propagating = 1 ; + while propagating + iterations = iterations + 1 ; + previous_domain_completion = model.domain_completion ; + + model = mttApplyInterfaceDomains(model) ; + model = mttPropagateDomains(model) ; + model = mttMeasureDomainCompletion(model) ; + + is_stable = mttCompareDomainCompletion(model.domain_completion,previous_domain_completion) ; + propagating = (~is_stable) ; + + if propagating + mttNotify(['...iteration ',num2str(iterations)]) ; + mttWriteNewLine ; + mttNotifyDomainCompletion(model) ; + end + + propagating = propagating & (~model.domain_completion.is_done) ; + end + + model = mttDeleteField(model,'domain_completion') ; + + +function model = overwrite_implicit_domains(model) + mttWriteNewLine ; + mttNotify('...overwriting implicit domain definitions') ; + mttWriteNewLine ; + + model = mttOverwriteImplicitDomains(model) ; + + +function model = mttOverwriteImplicitDomains(root,model,env) + is_root_model = nargin==1 ; + + if is_root_model + model = root ; + env = root.env ; + end + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + if ~isempty(object.abg) + object = mttOverwriteImplicitDomains(model,object,env) ; + end + + if ~isempty(object.cr) + interface_ports = mttGetFieldNames(object.cr.interface,'port') ; + for j = 1:length(interface_ports) + port_name = interface_ports{j} ; + port = getfield(object.cr.interface,'port',port_name) ; + + if isempty(port.domain) + if isempty(port.in) + bond_number = port.out ; + else + bond_number = port.in ; + end + + actual_domain = model.bond(bond_number).domain ; + actual_domain_item = model.bond(bond_number).domain_item ; + + port.domain = actual_domain ; + port.domain_item = actual_domain_item ; + object.cr.interface = setfield(object.cr.interface,'port',port_name,port) ; + + number_of_operators = mttGetFieldLength(object.cr,'operator') ; + for op_counter = 1:number_of_operators + operator = object.cr.operator(op_counter) ; + + matching_links = strmatch(port_name,{operator.link.name},'exact') ; + + number_of_equations = mttGetFieldLength(operator,'equation') ; + + for eq_counter = 1:number_of_equations + equation = operator.equation(eq_counter) ; +% if isempty(equation.domain) + + number_of_chunks = mttGetFieldLength(equation,'chunk') ; + for chunk_counter = 1:number_of_chunks + chunk = equation.chunk{chunk_counter} ; + + if iscell(chunk) + if strcmp(chunk{1},'link') + link = chunk{2} ; + + if any(link==matching_links) + covar = chunk{3} ; + chunk{3} = ['generic___',covar] ; + end + end + equation.chunk{chunk_counter} = chunk ; + end + end + operator.equation(eq_counter) = equation ; +% end + end + object.cr.operator(op_counter) = operator ; + end + end + end + end + + model = setfield(model,'obj',object_name,object) ; + end + ADDED ntt/bin/trans/m/mttCreateElementaryEquations.m Index: ntt/bin/trans/m/mttCreateElementaryEquations.m ================================================================== --- ntt/bin/trans/m/mttCreateElementaryEquations.m +++ ntt/bin/trans/m/mttCreateElementaryEquations.m @@ -0,0 +1,960 @@ +function model = mttCreateElementaryEquations(model,sorter_on) + +model.representation = 'ese' ; + +[model,ese,namelist] = specify_equations(model) ; +if sorter_on + [sse,counter] = sort_equations(ese,model,namelist) ; +else + sse = ese ; + counter = 0 ; +end + +model.equation = sse ; +model.sorted_equations = counter ; +model.namelist = namelist ; + + + +function [model,ese,namelist] = specify_equations(model,branch,root_namelist) + is_root_model = (nargin==1) ; + + if is_root_model + mttNotify('...specifying equations') ; + mttWriteNewLine ; + + branch = mttDetachText(model.source,'/') ; + + name_counter = 1 ; + namelist(name_counter).var = '0' ; + namelist(name_counter).domain = [] ; + namelist(name_counter).domain_item = [] ; + else + namelist = root_namelist ; + name_counter = length(namelist) ; + end + + mttNotify([' ...processing ',branch]) ; + mttWriteNewLine ; + + objects = mttGetFieldNames(model,'obj') ; + + line = 0 ; + + for n = 1:length(objects) + object_name = objects{n} ; + object = getfield(model,'obj',object_name) ; + + here = [branch,':',object_name] ; + + switch object.class + case {'SS','Se','Sf','De','Df'}, + + for j = 1:mttGetFieldLength(object,'interface') + flow_equation = [] ; + effort_equation = [] ; + + terminal = [branch,'__',object_name] ; + + inbond = object.interface(j).in ; + outbond = object.interface(j).out ; + + if ~isempty(inbond) + bond = model.bond(inbond) ; + [specified_domain,specified_domain_item] = mttGetBondDomain(model,inbond) ; + + new_name = 0 ; + + line = line + 1 ; + if bond.flow + if strcmp(object.class,'De') + ese(line) = specify_ese(branch,[2*inbond],branch,{1},[]) ; + else + ese(line) = specify_ese(branch,[2*inbond],branch,{name_counter+1},[]) ; + new_name = 1 ; + end + else + ese(line) = specify_ese(branch,{name_counter+1},branch,[2*inbond],[]) ; + new_name = 1 ; + end + + if new_name + name_counter = name_counter + 1 ; + namelist(name_counter).var = [terminal,'.flow'] ; + namelist(name_counter).domain = specified_domain ; + namelist(name_counter).domain_item = specified_domain_item ; + end + + new_name = 0 ; + + line = line + 1 ; + if bond.effort + ese(line) = specify_ese(branch,{name_counter+1},branch,[2*inbond-1],[]) ; + new_name = 1 ; + else + if strcmp(object.class,'Df') + ese(line) = specify_ese(branch,[2*inbond-1],branch,{1},[]) ; + else + ese(line) = specify_ese(branch,[2*inbond-1],branch,{name_counter+1},[]) ; + new_name = 1 ; + end + end + + if new_name + name_counter = name_counter + 1 ; + namelist(name_counter).var = [terminal,'.effort'] ; + namelist(name_counter).domain = specified_domain ; + namelist(name_counter).domain_item = specified_domain_item ; + end + end + + if ~isempty(outbond) + bond = model.bond(outbond) ; + [specified_domain,specified_domain_item] = mttGetBondDomain(model,outbond) ; + + new_name = 0 ; + + if bond.flow + if ~strcmp(object.class,'Se') + line = line + 1 ; + ese(line) = specify_ese(branch,{name_counter+1},branch,[2*outbond],[]) ; + new_name = 1 ; + end + else + line = line + 1 ; + ese(line) = specify_ese(branch,[2*outbond],branch,{name_counter+1},[]) ; + new_name = 1 ; + end + + if new_name + name_counter = name_counter + 1 ; + namelist(name_counter).var = [terminal,'.flow'] ; + namelist(name_counter).domain = specified_domain ; + namelist(name_counter).domain_item = specified_domain_item ; + end + + new_name = 0 ; + + if bond.effort + line = line + 1 ; + ese(line) = specify_ese(branch,[2*outbond-1],branch,{name_counter+1},[]) ; + new_name = 1 ; + else + if ~strcmp(object.class,'Sf') + line = line + 1 ; + ese(line) = specify_ese(branch,{name_counter+1},branch,[2*outbond-1],[]) ; + new_name = 1 ; + end + end + + if new_name + name_counter = name_counter + 1 ; + namelist(name_counter).var = [terminal,'.effort'] ; + namelist(name_counter).domain = specified_domain ; + namelist(name_counter).domain_item = specified_domain_item ; + end + end + end + + case '0', + + imposed_effort = [] ; + resultant_flow = [] ; + + for i = 1:mttGetFieldLength(object,'interface') + inbond = object.interface(i).in ; + outbond = object.interface(i).out ; + + if isempty(inbond) + bond_number(i) = outbond ; + orientation(i) = 0 ; + else + bond_number(i) = inbond ; + orientation(i) = 1 ; + end + + [effort,flow] = mttGetBondCausality(model,bond_number(i)) ; + + if effort==orientation(i) + imposed_effort = 2*bond_number(i)-1 ; + end + if flow==orientation(i) + resultant_flow = 2*bond_number(i) ; + resultant_orientation = orientation(i) ; + end + end + + for i = 1:mttGetFieldLength(object,'interface') + effort = 2*bond_number(i)-1 ; + if effort~=imposed_effort + derived_effort = effort ; + + line = line + 1 ; + ese(line) = specify_ese(branch,derived_effort,branch,imposed_effort,[]) ; + end + end + + flow_summation = [] ; + for i = 1:mttGetFieldLength(object,'interface') + flow = 2*bond_number(i) ; + + if flow~=resultant_flow + impinging_flow = flow ; + + if orientation(i) + if resultant_orientation + flow_summation = [ flow_summation, -impinging_flow ] ; + else + flow_summation = [ flow_summation, impinging_flow ] ; + end + else + if resultant_orientation + flow_summation = [ flow_summation, impinging_flow ] ; + else + flow_summation = [ flow_summation, -impinging_flow ] ; + end + end + end + end + + line = line + 1 ; + ese(line) = specify_ese(branch,resultant_flow,branch,flow_summation,[]) ; + + case '1', + + imposed_flow = [] ; + resultant_effort = [] ; + + for i = 1:mttGetFieldLength(object,'interface') + inbond = object.interface(i).in ; + outbond = object.interface(i).out ; + + if isempty(inbond) + bond_number(i) = outbond ; + orientation(i) = 0 ; + else + bond_number(i) = inbond ; + orientation(i) = 1 ; + end + + [effort,flow] = mttGetBondCausality(model,bond_number(i)) ; + + if flow~=orientation(i) + imposed_flow = 2*bond_number(i) ; + end + if effort~=orientation(i) + resultant_effort = 2*bond_number(i)-1 ; + resultant_orientation = orientation(i) ; + end + end + + for i = 1:mttGetFieldLength(object,'interface') + flow = 2*bond_number(i) ; + if flow~=imposed_flow + derived_flow = flow ; + + line = line + 1 ; + ese(line) = specify_ese(branch,derived_flow,branch,imposed_flow,[]) ; + end + end + + effort_summation = [] ; + for i = 1:mttGetFieldLength(object,'interface') + effort = 2*bond_number(i)-1 ; + + if effort~=resultant_effort + impinging_effort = effort ; + + if orientation(i) + if resultant_orientation + effort_summation = [ effort_summation, -impinging_effort ] ; + else + effort_summation = [ effort_summation, impinging_effort ] ; + end + else + if resultant_orientation + effort_summation = [ effort_summation, impinging_effort ] ; + else + effort_summation = [ effort_summation, -impinging_effort ] ; + end + end + end + end + + line = line + 1 ; + ese(line) = specify_ese(branch,resultant_effort,branch,effort_summation,[]) ; + + otherwise, + + if ~isempty(object.cr) + interface = object.cr.interface ; + port_names = mttGetFieldNames(interface,'port') ; + number_of_ports = length(port_names) ; + + link_counter = 0 ; + + for i = 1:number_of_ports + port_name = port_names{i} ; + port = getfield(interface,'port',port_name) ; + terminal = [branch,'__',object_name,'___',port_name] ; + + inbond = port.in ; + outbond = port.out ; + + if ~isempty(inbond) + bond = model.bond(inbond) ; + [specified_domain,specified_domain_item] = mttGetBondDomain(model,inbond) ; + + name_counter = name_counter + 1 ; + if port.is_flow_state + namelist(name_counter).var = [terminal,'.flow_state'] ; + else + namelist(name_counter).var = [terminal,'.flow'] ; + end + namelist(name_counter).domain = specified_domain ; + namelist(name_counter).domain_item = specified_domain_item ; + + line = line + 1 ; + link_counter = link_counter + 1 ; + if bond.flow + ese(line) = specify_ese(branch,[2*inbond],branch,{name_counter},[]) ; + link(link_counter) = create_link(0,0,1,port_name,port.is_flow_state) ; + else + ese(line) = specify_ese(branch,{name_counter},branch,[2*inbond],[]) ; + link(link_counter) = create_link(1,0,1,port_name,port.is_flow_state) ; + end + + name_counter = name_counter + 1 ; + if port.is_effort_state + namelist(name_counter).var = [terminal,'.effort_state'] ; + else + namelist(name_counter).var = [terminal,'.effort'] ; + end + namelist(name_counter).domain = specified_domain ; + namelist(name_counter).domain_item = specified_domain_item ; + + line = line + 1 ; + link_counter = link_counter + 1 ; + if bond.effort + ese(line) = specify_ese(branch,{name_counter},branch,[2*inbond-1],[]) ; + link(link_counter) = create_link(1,1,0,port_name,port.is_effort_state) ; + else + ese(line) = specify_ese(branch,[2*inbond-1],branch,{name_counter},[]) ; + link(link_counter) = create_link(0,1,0,port_name,port.is_effort_state) ; + end + end + + if ~isempty(outbond) + bond = model.bond(outbond) ; + [specified_domain,specified_domain_item] = mttGetBondDomain(model,outbond) ; + + name_counter = name_counter + 1 ; + if port.is_flow_state + namelist(name_counter).var = [terminal,'.flow_state'] ; + else + namelist(name_counter).var = [terminal,'.flow'] ; + end + namelist(name_counter).domain = specified_domain ; + namelist(name_counter).domain_item = specified_domain_item ; + + line = line + 1 ; + link_counter = link_counter + 1 ; + if bond.flow + ese(line) = specify_ese(branch,{name_counter},branch,[2*outbond],[]) ; + link(link_counter) = create_link(1,0,1,port_name,port.is_flow_state) ; + else + ese(line) = specify_ese(branch,[2*outbond],branch,{name_counter},[]) ; + link(link_counter) = create_link(0,0,1,port_name,port.is_flow_state) ; + end + + name_counter = name_counter + 1 ; + if port.is_effort_state + namelist(name_counter).var = [terminal,'.effort_state'] ; + else + namelist(name_counter).var = [terminal,'.effort'] ; + end + namelist(name_counter).domain = specified_domain ; + namelist(name_counter).domain_item = specified_domain_item ; + + line = line + 1 ; + link_counter = link_counter + 1 ; + if bond.effort + ese(line) = specify_ese(branch,[2*outbond-1],branch,{name_counter},[]) ; + link(link_counter) = create_link(0,1,0,port_name,port.is_effort_state) ; + else + ese(line) = specify_ese(branch,{name_counter},branch,[2*outbond-1],[]) ; + link(link_counter) = create_link(1,1,0,port_name,port.is_effort_state) ; + end + end + end + + + input_mask = zeros(number_of_ports,1) ; + output_mask = zeros(number_of_ports,1) ; + + number_of_links = link_counter ; + linked = zeros(number_of_links,1) ; + + operators = object.cr.operator ; + number_of_operators = length(operators) ; + + object.cr.used_operator = zeros(1,number_of_operators) ; + + op_counter = 0 ; + + matching = 1 ; + while matching + op_counter = op_counter + 1 ; + operator = operators(op_counter) ; + + full_operator_name = [branch,'__',object_name,'___',operator.name] ; + + number_of_op_links = length(operator.link) ; + op_linked = zeros(number_of_op_links,1) ; + + for j = 1:number_of_op_links + k = 0 ; + comparing = 1 ; + while comparing + k = k + 1 ; + if compare_links(link(k),operator.link(j)) + op_linked(j) = k ; + comparing = 0 ; + end + comparing = comparing & (k0 + for i = 1:number_of_domains + model.public_domain(i).representation = model.dom(i).representation ; + model.public_domain(i).source = model.dom(i).source ; + + domain = model.dom(i) ; + item_names = mttGetFieldNames(domain,'item') ; + for j = 1:length(item_names) + item_name = item_names{j} ; + item = getfield(domain,'item',item_name) ; + + compound_item = mttIdentifyDomainCovariables(item,domain,model) ; + model = setfield(model,'public_domain',{i},'item',item_name,compound_item) ; + end + end + model = hide_private_domains(model) ; +end + +model = mttDeleteField(model,'dom') ; + + +mttWriteNewLine ; +mttNotify('...acquiring "struct" source definitions') ; +mttWriteNewLine ; + +model = establish_user_structs(model) ; + +number_of_structs = mttGetFieldLength(model,'str') ; +if number_of_structs>0 + for i = 1:number_of_structs + model.public_struct(i).representation = model.str(i).representation ; + model.public_struct(i).source = model.str(i).source ; + + struct = model.str(i) ; + item_names = mttGetFieldNames(struct,'item') ; + for j = 1:length(item_names) + item_name = item_names{j} ; + item = getfield(struct,'item',item_name) ; + + compound_item = mttIdentifyStructVariables(item,struct,model) ; + model = setfield(model,'public_struct',{i},'item',item_name,compound_item) ; + end + end + model = hide_private_structs(model) ; +end + +model = mttDeleteField(model,'str') ; + + + +function directory = identify_directory_name(context) + mttAssert(ischar(context),'Context must be specified by name') ; + working_directory = pwd ; + working_directory = strrep(working_directory,'\','/') ; + + [system_name,local_directory] = mttDetachText(context,'/') ; + if isempty(system_name) + local_directory = [] ; + end + + if isempty(local_directory) + directory = working_directory ; + else + directory = mttLocateDirectory(working_directory,local_directory) ; + end + + +function source = identify_source_name(context,directory) + [context_name,local_directory] = mttDetachText(context,'/') ; + if isempty(context_name) + context_name = context ; + local_directory = [] ; + end + source = [directory,'/',context_name] ; + + +function model = establish_path_names(model) + path_names = mttGetFieldNames(model,'path') ; + + for n = 1:length(path_names) + path_name = path_names{n} ; + path_spec = getfield(model,'path',path_name) ; + + [rubbish,working_directory] = mttDetachText(model.source,'/') ; + + directory = identify_directory(working_directory,path_spec,model) ; + + mttAssert(~isempty(directory),... + ['Undefined path "',path_name,'"']) ; + + model = setfield(model,'path',path_name,directory) ; + end + + +function directory = identify_directory(working_directory,path_spec,model) + path_names = mttGetFieldNames(model,'path') ; + + if isempty(path_spec) + directory = [] ; + else + if path_spec(1)=='$' + [path_alias,path_branch] = mttCutText(path_spec,'/') ; + path_alias(1) = [] ; + + mttAssert(ismember(path_alias,path_names),... + ['Path "',path_alias,'" not recognised']) ; + + path_root = getfield(model,'path',path_alias) ; + + if isempty(path_branch) + directory = path_root ; + else + directory = [path_root,'/',path_branch] ; + end + else + [local_directory,name] = mttCutText(path_spec,'/') ; + + directory_located = 0 ; + if strcmp(local_directory,'.') + if isempty(name) + directory = working_directory ; + directory_located = 1 ; + else + local_directory = name ; + end + else + local_directory = path_spec ; + end + + if ~directory_located + directory = mttLocateDirectory(working_directory,local_directory) ; + end + end + end + + +function model = establish_user_domains(model) + path_names = mttGetFieldNames(model,'path') ; + domain_names = mttGetFieldNames(model,'domain') ; + + counter = 0 ; + + for n = 1:length(domain_names) + domain_name = domain_names{n} ; + domain_spec = getfield(model,'domain',domain_name) ; + + [rubbish,working_directory] = mttDetachText(model.source,'/') ; + [domain_source,domain_item] = mttCutText(domain_spec,'::') ; + [name,path_spec] = mttDetachText(domain_source,'/') ; + + if isempty(name) + source_name = [working_directory,'/',domain_source] ; + else + directory = identify_directory(working_directory,path_spec,model) ; + source_name = [directory,'/',name] ; + end + + domain_filename = [source_name,'_domain.txt'] ; + + domain_index = [] ; + if isfield(model,'dom') + existing_doms = {model.dom.source} ; + domain_index = strmatch(source_name,existing_doms,'exact') ; + end + + if isempty(domain_index) + counter = counter + 1 ; + model.dom(counter) = mttFetchDomain(domain_filename) ; + domain_index = counter ; + end + + domain_spec.dom = domain_index ; + domain_spec.item = domain_item ; + model = setfield(model,'domain',domain_name,domain_spec) ; + end + +function model = hide_private_domains(model) + for n = 1:mttGetFieldLength(model,'public_domain') + dom = model.dom(n) ; + dom_items = dom.item ; + + domain = model.public_domain(n) ; + domain_items = domain.item ; + + item_names = mttGetFieldNames(domain,'item') ; + + for j = 1:length(item_names) + item_name = item_names{j} ; + is_private(j) = getfield(dom_items,item_name,'is_private') ; + + if is_private(j) + domain_items = mttDeleteField(domain_items,item_name) ; + + mttAssert(~isempty(domain_items),... + ['No public domains in ',dom.source]) ; + end + end + + model = setfield(model,'public_domain',{n},'item',domain_items) ; + end + + user_domain_names = mttGetFieldNames(model,'domain') ; + for i = 1:length(user_domain_names) + user_domain_name = user_domain_names{i} ; + user_domain = getfield(model,'domain',user_domain_name) ; + + dom = model.dom(user_domain.dom) ; + if ~isempty(user_domain.item) + is_private = getfield(dom,'item',user_domain.item,'is_private') ; + mttAssert(~is_private,... + ['User-defined domain "',user_domain_name,'" is declared as private']) ; + end + end + + +function model = establish_user_structs(model) + path_names = mttGetFieldNames(model,'path') ; + struct_names = mttGetFieldNames(model,'struct') ; + + counter = 0 ; + + for n = 1:length(struct_names) + struct_name = struct_names{n} ; + struct_spec = getfield(model,'struct',struct_name) ; + + [rubbish,working_directory] = mttDetachText(model.source,'/') ; + [struct_source,struct_item] = mttCutText(struct_spec,'::') ; + [name,path_spec] = mttDetachText(struct_source,'/') ; + + if isempty(name) + source_name = [working_directory,'/',struct_source] ; + else + directory = identify_directory(working_directory,path_spec,model) ; + source_name = [directory,'/',name] ; + end + + struct_filename = [source_name,'_struct.txt'] ; + + struct_index = [] ; + if isfield(model,'str') + existing_strs = {model.str.source} ; + struct_index = strmatch(source_name,existing_strs,'exact') ; + end + + if isempty(struct_index) + counter = counter + 1 ; + model.str(counter) = mttFetchStruct(struct_filename) ; + struct_index = counter ; + end + + struct_spec.str = struct_index ; + struct_spec.item = struct_item ; + model = setfield(model,'struct',struct_name,struct_spec) ; + end + +function model = hide_private_structs(model) + for n = 1:mttGetFieldLength(model,'public_struct') + str = model.str(n) ; + str_items = str.item ; + + struct = model.public_struct(n) ; + struct_items = struct.item ; + + item_names = mttGetFieldNames(struct,'item') ; + + for j = 1:length(item_names) + item_name = item_names{j} ; + is_private(j) = getfield(str_items,item_name,'is_private') ; + + if is_private(j) + struct_items = mttDeleteField(struct_items,item_name) ; + + mttAssert(~isempty(struct_items),... + ['No public structs in ',str.source]) ; + end + end + + model = setfield(model,'public_struct',{n},'item',struct_items) ; + end + + user_struct_names = mttGetFieldNames(model,'struct') ; + for i = 1:length(user_struct_names) + user_struct_name = user_struct_names{i} ; + user_struct = getfield(model,'struct',user_struct_name) ; + + str = model.str(user_struct.str) ; + if ~isempty(user_struct.item) + is_private = getfield(str,'item',user_struct.item,'is_private') ; + mttAssert(~is_private,... + ['User-defined struct "',user_struct_name,'" is declared as private']) ; + end + end + ADDED ntt/bin/trans/m/mttCreateSystemMdl.m Index: ntt/bin/trans/m/mttCreateSystemMdl.m ================================================================== --- ntt/bin/trans/m/mttCreateSystemMdl.m +++ ntt/bin/trans/m/mttCreateSystemMdl.m @@ -0,0 +1,170 @@ +function mttCreateSystemMdl(model) + +model_name = mttDetachText(model.source,'/') ; +icd = mttCreateSystemMdl_ICD(model) ; + +NumInputs = length(icd.input_namelist) ; +NumOutputs = length(icd.output_namelist) ; +MaxInterfaces = max(NumInputs,NumOutputs) ; + +new_system(model_name) ; +open_system(model_name) ; +set_param(model_name,'Location',[50 100 850 250+20*MaxInterfaces]) ; + +left = 100 ; +top = 25 ; +width = 600 ; +height = 25*(5+MaxInterfaces) ; + +position_vector = [left,top,left+width,top+height] ; + +ModelHndl = add_block(... + 'simulink3/Subsystems/Subsystem',... + [model_name,'/Model'],... + 'Position',position_vector,... + 'BackgroundColor','yellow',... + 'FontName','Helvetica',... + 'FontSize',num2str(16)) ; + + +system = [model_name,'/Model'] ; + +set_param(system,'Location',[200 250 1050 285+30*MaxInterfaces]) ; + +Line = get_param(system,'Lines') ; +for i = 1:length(Line) + SrcBlock = get_param(Line(i).SrcBlock,'Name') ; + DstBlock = get_param(Line(i).DstBlock,'Name') ; + SrcPort = num2str(Line(i).SrcPort) ; + DstPort = num2str(Line(i).DstPort) ; + + delete_line(system,[SrcBlock,'/',SrcPort],[DstBlock,'/',DstPort]) ; +end + +Block = get_param(system,'Blocks') ; +for i = 1:length(Block) + delete_block([system,'/',Block{i}]) ; +end + + +left = 125 ; +centre_left = 250 ; +centre = 350 ; +centre_right = 580 ; +right = 670 ; + +top = 20 ; +down = 30 ; + +port_width = 40 ; +port_height = 15 ; +port_spacing = down ; + +mux_width = 5 ; +mux_height = NumInputs*port_spacing ; + +demux_width = 5 ; +demux_height = NumOutputs*port_spacing ; + +sfun_width = 150 ; +sfun_height = 30 ; + +left_vertical_offset = (NumInputs*port_spacing - sfun_height)/2 ; +right_vertical_offset = (NumOutputs*port_spacing - sfun_height)/2 ; + +vertical_offset = max(left_vertical_offset,right_vertical_offset) ; +datum = top + vertical_offset ; + + + +top = datum - left_vertical_offset ; + +for i = 1:NumInputs + position_vector = [... + left,... + top + (i-1)*port_spacing,... + left + port_width,... + top + (i-1)*port_spacing + port_height] ; + + InHndl(i) = add_block(... + 'simulink3/Sources/In1',... + [system,'/',icd.input_namelist{i}],... + 'Position',position_vector) ; +end + +position_vector = [... + centre_left,... + top-port_height/3,... + centre_left+mux_width,... + top+mux_height-port_height/3] ; + +MuxHndl = add_block(... + 'simulink3/Signals & Systems/Mux',... + [system,'/InputMapping'],... + 'Position',position_vector,... + 'Inputs',num2str(NumInputs)) ; + +position_vector = [... + centre,... + top+left_vertical_offset-sfun_height/2,... + centre+sfun_width,... + top+left_vertical_offset+sfun_height] ; + +SfunHndl = add_block(... + 'simulink3/Functions & Tables/S-Function',... + [system,'/sfun'],... + 'Position',position_vector,... + 'FunctionName',[model_name,'_sfun'],... + 'BackgroundColor','yellow',... + 'FontName','Helvetica',... + 'FontSize',num2str(16)) ; + + + +top = datum - right_vertical_offset ; + +position_vector = [... + centre_right,... + top-port_height/3,... + centre_right+demux_width,... + top+demux_height-port_height/3] ; + +DemuxHndl = add_block(... + 'simulink3/Signals & Systems/Demux',... + [system,'/OutputMapping'],... + 'Position',position_vector,... + 'Outputs',num2str(NumOutputs)) ; + +for i = 1:NumOutputs + position_vector = [... + right,... + top + (i-1)*port_spacing,... + right + port_width,... + top + (i-1)*port_spacing + port_height] ; + + OutHndl(i) = add_block(... + 'simulink3/Sinks/Out1',... + [system,'/',icd.output_namelist{i}],... + 'Position',position_vector) ; +end + + + +for i = 1:NumInputs + port = num2str(i) ; + InLineHndl(i) = add_line(system,... + [icd.input_namelist{i},'/1'],['InputMapping/',port]) ; +end + +SfunInLineHndl = add_line(system,'InputMapping/1','sfun/1') ; +set_param(SfunInLineHndl,'Name','_Input') ; + +SfunOutLineHndl = add_line(system,'sfun/1','OutputMapping/1') ; +set_param(SfunOutLineHndl,'Name','_Output') ; + +for i = 1:NumOutputs + port = num2str(i) ; + OutLineHndl(i) = add_line(system,... + ['OutputMapping/',port],[icd.output_namelist{i},'/1']) ; +end + ADDED ntt/bin/trans/m/mttCreateSystemMdl_ICD.m Index: ntt/bin/trans/m/mttCreateSystemMdl_ICD.m ================================================================== --- ntt/bin/trans/m/mttCreateSystemMdl_ICD.m +++ ntt/bin/trans/m/mttCreateSystemMdl_ICD.m @@ -0,0 +1,274 @@ +function icd = mttCreateSystemMdl_ICD(model) + +sympar = map_system_sympars(model) ; +input = map_system_inputs(model) ; +invar = map_system_invars(model) ; +outvar = map_system_outvars(model) ; + +icd.output_namelist = outvar ; +icd.input_namelist = invar ; +if ~isempty(input) + icd.input_namelist = [icd.input_namelist,input] ; +end +if ~isempty(sympar) + icd.input_namelist = [icd.input_namelist,sympar] ; +end + +icd.output_namelist = sort(icd.output_namelist) ; +icd.input_namelist = sort(icd.input_namelist) ; + + + +function map = map_system_sympars(model) + mttNotify('...mapping system inputs (symbolic parameters)') ; + mttWriteNewLine ; + + map = [] ; + line = 0 ; + + number_of_variables = mttGetFieldLength(model,'sympar') ; + + model_name = mttDetachText(model.source,'/') ; + + for i = 1:number_of_variables + variable_name = model.sympar{i} ; + default_value = model.sympar_default{i} ; + + if isempty(default_value) + line = line + 1 ; + map{line} = [model_name,'___',variable_name] ; + end + end + + +function map = map_system_inputs(model,root,branch) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...mapping system inputs (input variables)') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + else + current_branch = branch ; + end + + map = [] ; + line = 0 ; + + number_of_variables = mttGetFieldLength(model,'input') ; + + for i = 1:number_of_variables + variable_name = model.input{i} ; + + line = line + 1 ; + map{line} = [current_branch,'___',variable_name] ; + end + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + additional_map = [] ; + if ~isempty(object.abg) + additional_map = map_system_inputs(object,root,next_branch) ; + elseif ~isempty(object.cr) + additional_map = map_system_inputs(object.cr,root,next_branch) ; + end + + if isempty(map) + map = additional_map ; + else + line = length(map) ; + for j = 1:length(additional_map) + if ~ismember(additional_map{j},map) + line = line + 1 ; + map{line} = additional_map{j} ; + end + end + end + end + + +function map = map_system_invars(model,root,branch,env) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...mapping system inputs (input covariables)') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + env = model.env ; + else + current_branch = branch ; + end + + map = [] ; + line = 0 ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + switch object.class + case {'SS','Se','Sf','De','Df'} + inbond_number = object.interface.in ; + outbond_number = object.interface.out ; + + inbond = model.bond(inbond_number) ; + outbond = model.bond(outbond_number) ; + + if ~isempty(inbond) + covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; + covar = [] ; + + if ~inbond.effort + if ~strcmp(object.class,'Df') + covar = covariables.effort ; + end + elseif inbond.flow + if ~strcmp(object.class,'De') + covar = covariables.flow ; + end + end + + for j = 1:length(covar) + line = line + 1 ; + covariable = strrep(covar{j},'.','__') ; + map{line} = [current_branch,'__',object_name,'(',covariable,')'] ; + end + end + + if ~isempty(outbond) + covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; + + if outbond.effort + covar = covariables.effort ; + elseif ~outbond.flow + covar = covariables.flow ; + end + + for j = 1:length(covar) + line = line + 1 ; + covariable = strrep(covar{j},'.','__') ; + map{line} = [current_branch,'__',object_name,'(',covariable,')'] ; + end + end + end + + additional_map = [] ; + if ~isempty(object.abg) + additional_map = map_system_invars(object,root,next_branch,env) ; + end + + if isempty(map) + map = additional_map ; + else + line = length(map) ; + for j = 1:length(additional_map) + if ~ismember(additional_map{j},map) + line = line + 1 ; + map{line} = additional_map{j} ; + end + end + end + end + + +function map = map_system_outvars(model,root,branch,env) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...mapping system outputs (output covariables)') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + env = model.env ; + else + current_branch = branch ; + end + + map = [] ; + line = 0 ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + switch object.class + case {'SS','Se','Sf','De','Df'} + inbond_number = object.interface.in ; + outbond_number = object.interface.out ; + + inbond = model.bond(inbond_number) ; + outbond = model.bond(outbond_number) ; + + if ~isempty(inbond) + covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; + covar = [] ; + + if inbond.effort + covar = covariables.effort ; + elseif ~inbond.flow + covar = covariables.flow ; + end + + for j = 1:length(covar) + line = line + 1 ; + covariable = strrep(covar{j},'.','__') ; + map{line} = [current_branch,'__',object_name,'(',covariable,')'] ; + end + end + + if ~isempty(outbond) + covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; + covar = [] ; + + if ~outbond.effort + if ~strcmp(object.class,'Sf') + covar = covariables.effort ; + end + elseif outbond.flow + if ~strcmp(object.class,'Se') + covar = covariables.flow ; + end + end + + for j = 1:length(covar) + line = line + 1 ; + covariable = strrep(covar{j},'.','__') ; + map{line} = [current_branch,'__',object_name,'(',covariable,')'] ; + end + end + end + + additional_map = [] ; + if ~isempty(object.abg) + additional_map = map_system_outvars(object,root,next_branch,env) ; + end + + if isempty(map) + map = additional_map ; + else + line = length(map) ; + for j = 1:length(additional_map) + if ~ismember(additional_map{j},map) + line = line + 1 ; + map{line} = additional_map{j} ; + end + end + end + end + ADDED ntt/bin/trans/m/mttCreateUnifiedModel.m Index: ntt/bin/trans/m/mttCreateUnifiedModel.m ================================================================== --- ntt/bin/trans/m/mttCreateUnifiedModel.m +++ ntt/bin/trans/m/mttCreateUnifiedModel.m @@ -0,0 +1,182 @@ +function model = mttCreateUnifiedModel(model,bondgraph,specification) + + model.source = mttCutText(specification.specification,'_abg.txt') ; + model.bondgraph = mttCutText(bondgraph.bondgraph,'_abg.fig') ; + + model.obj = bondgraph.obj ; + model.bond = bondgraph.bond ; + + object_names = mttGetFieldNames(model,'obj') ; + specified_object_names = mttGetFieldNames(specification,'obj') ; + + for n = 1:length(object_names) + object_name = object_names{n} ; + object = getfield(model,'obj',object_name) ; + + if ~mttIsPassiveClass(object.class) + mttAssert(ismember(object_name,specified_object_names),... + ['Object name "',object_name,'" does not appear in specification']) ; + end + end + + for n = 1:length(specified_object_names) + specified_object_name = specified_object_names{n} ; + mttAssert(ismember(specified_object_name,object_names),... + ['Specified object name "',specified_object_name,... + '" does not appear in bond graph']) ; + + specified_object = getfield(specification,'obj',specified_object_name) ; + object = getfield(model,'obj',specified_object_name) ; + + if strcmp(specified_object.name.class,object.class) + mttAssert(~mttIsFoundationClass(object.class),... + 'Cannot redefine MTT foundation class') ; + is_abg = 1 ; + else + mttAssert(~mttIsPassiveClass(object.class),... + 'Cannot modify MTT junctions or ports') ; + is_abg = 0 ; + end + + object.is_abg = is_abg ; + object.name = specified_object.name ; + object.parameter = specified_object.parameter ; + + model = setfield(model,'obj',specified_object_name,object) ; + end + + model.sympar = specification.sympar ; + model.numpar = specification.numpar ; + model.input = specification.input ; + + model.sympar_default = specification.sympar_default ; + model.numpar_default = specification.numpar_default ; + model.input_default = specification.input_default ; + + for n = 1:length(object_names) + object_name = object_names{n} ; + object = getfield(model,'obj',object_name) ; + + if mttIsPortClass(object.class) + mttAssert(mttGetFieldLength(object,'interface')==1,... + ['Port components must have one and only one interface']) ; + + switch object.class + case {'Se','Sf'}, + mttAssert(~isempty(object.interface.out),... + 'Each source port must have an outward bond') ; + case {'De','Df'}, + mttAssert(~isempty(object.interface.in),... + 'Each detector port must have an inward bond') ; + end + end + + if ~ismember(object_name,specified_object_names) + object.name.item = [] ; + object.name.class = object.class ; + object.name.path = [] ; + object.parameter = [] ; + object.is_abg = 1 ; + end + + [rubbish,working_directory] = mttDetachText(model.source,'/') ; + local_directory = object.name.path ; + directory = mttLocateDirectory(working_directory,local_directory) ; + + source = [directory,'/',object.name.class] ; + + current_leaf = model.leaf ; + + if object.is_abg + if mttIsPassiveClass(object.name.class) + object.abg = [] ; + else + current_branch = model.branch ; + mttAssert(~ismember(source,current_branch),... + ['Recursive definition of "',source,'"']) ; + + if isempty(model.abgs) + existing_abg = [] ; + else + existing_abg = strmatch(source,model.abgs,'exact') ; + end + + if isempty(existing_abg) + if isempty(current_branch) + next_branch = {source} ; + next_leaf = object_name ; + else + next_branch = [current_branch,{source}] ; + next_leaf = [current_leaf,'/',object_name] ; + end + model.branch = next_branch ; + model.leaf = next_leaf ; + + class_model = mttCreateAcausalBondgraph(source,model) ; + + model.leaf = current_leaf ; + model.branch = current_branch ; + + next_abg = 1 + mttGetFieldLength(model,'abg') ; + for i = 1:mttGetFieldLength(class_model,'abg') + model.abg(next_abg) = class_model.abg(i) ; + model.abgs = class_model.abgs ; + next_abg = next_abg + 1 ; + end + class_model = mttDeleteField(class_model,'abg') ; + + model.crs = class_model.crs ; + class_model = mttDeleteField(class_model,'crs') ; + + model.cr_usage = class_model.cr_usage ; + class_model = mttDeleteField(class_model,'cr_usage') ; + + model.abg(next_abg) = class_model ; + model = mttAppend(model,'abgs',{source}) ; + + index = length(model.abgs) ; + mttNotify([' ...made "#',num2str(index),':',object.name.class,'" definition']) ; + mttWriteNewLine ; + end + object.abg = strmatch(source,model.abgs,'exact') ; + end + object.cr = [] ; + object.cr_item = [] ; + else + if isempty(model.crs) + existing_cr = [] ; + else + existing_cr = strmatch(source,model.crs,'exact') ; + end + + if isempty(current_leaf) + cr_user = object_name ; + else + cr_user = [current_leaf,'/',object_name] ; + end + + if isempty(existing_cr) + model = mttAppend(model,'crs',{source}) ; + + N = length(model.crs) ; + model.cr_usage(N).obj{1} = cr_user ; + else + N = 1+length(model.cr_usage(existing_cr).obj) ; + model.cr_usage(existing_cr).obj{N} = cr_user ; + end + + object.abg = [] ; + object.cr = strmatch(source,model.crs,'exact') ; + + if isempty(object.name.item) + object.cr_item = mttDetachText(model.crs{object.cr},'/') ; + else + object.cr_item = object.name.item ; + end + end + + object = mttDeleteField(object,'name') ; + object = mttDeleteField(object,'is_abg') ; + + model = setfield(model,'obj',object_name,object) ; + end ADDED ntt/bin/trans/m/mttEmbedAcausalBondgraph.m Index: ntt/bin/trans/m/mttEmbedAcausalBondgraph.m ================================================================== --- ntt/bin/trans/m/mttEmbedAcausalBondgraph.m +++ ntt/bin/trans/m/mttEmbedAcausalBondgraph.m @@ -0,0 +1,159 @@ +function model = mttEmbedAcausalBondgraph(model,component,system) + source = model.abg(component) ; + + if nargin==2 + is_root_model = 1 ; + target = model ; + else + is_root_model = 0 ; + target = model.abg(system) ; + end + + source_objects = mttGetFieldNames(source,'obj') ; + target_objects = mttGetFieldNames(target,'obj') ; + + for n = 1:length(target_objects) + target_object_name = target_objects{n} ; + target_object = getfield(target,'obj',target_object_name) ; + + here = [mttDetachText(target.source,'/'),'/',target_object_name] ; + + is_abg_instance = 0 ; + if ~isempty(target_object.abg) + is_abg_instance = target_object.abg==component ; + end + + if is_abg_instance + target_object.sympar = source.sympar ; + target_object.numpar = source.numpar ; + target_object.input = source.input ; + + target_object.sympar_default = source.sympar_default ; + target_object.numpar_default = source.numpar_default ; + target_object.input_default = source.input_default ; + + declarations = length(target_object.sympar) ; + values = length(target_object.parameter) ; + + mttAssert(declarations==values,['Mismatched parameters in object ',here]) ; + + + number_of_target_ports = mttGetFieldLength(target_object,'interface') ; + + found_target_port = [] ; + target_ports_found = [] ; + + for i = 1:number_of_target_ports + + target_port_name = target_object.interface(i).name ; + target_inbond = target_object.interface(i).in ; + target_outbond = target_object.interface(i).out ; + + is_inline = (~isempty(target_inbond) & ~isempty(target_outbond)) ; + + next = 0 ; + found_target_port(i) = 0 ; + + matching = 1 ; + while matching + next = next + 1 ; + source_object_name = source_objects{next} ; + source_object = getfield(source,'obj',source_object_name) ; + + if ismember(source_object.class,{'SS','Se','Sf','De','Df'}) + source_port_name = source_object_name ; + + if is_inline + source_interface = getfield(source,'obj',source_port_name,'interface') ; + + inport_found = 0 ; + if ~isempty(source_interface.in) + inport_found = strcmp(source_port_name,[target_port_name,'_in']) ; + end + + outport_found = 0 ; + if ~isempty(source_interface.out) + outport_found = strcmp(source_port_name,[target_port_name,'_out']) ; + end + + found_target_port(i) = inport_found | outport_found ; + else + found_target_port(i) = strcmp(source_port_name,target_port_name) ; + end + end + + if found_target_port(i) + if isempty(target_ports_found) + target_ports_found = {target_port_name} ; + else + target_ports_found = [target_ports_found, {target_port_name}] ; + end + matching = 0 ; + else + matching = (next2 + model = create_bond(model,coordinates) ; + end + else + jump = jump + forward_arrow + reverse_arrow ; + end + end + end + else + [last_word,first_part] = mttDetachText(line,' ') ; + + if mttIsNumericText(first_part) + numbers = round(str2num(first_part)) ; % only interested in integer values + if numbers(1)==4 % ... text definition + depth = numbers(4) ; + is_visible = rem(depth,10)==0 ; + + if is_visible + coordinates = numbers(12:13) ; + text = mttCompressText(mttCutText(last_word,'\001')) ; + + identifier = mttCutText(text,'[') ; + qualifier = mttExtractText(text,'[',']') ; + + name.label = [] ; + name.domain = [] ; + name.domain_item = [] ; + name.class = [] ; + name.object = [] ; + + if isempty(identifier) + name.label = qualifier ; + model = create_label(model,name,coordinates) ; + else + [name.domain,name.domain_item] = mttCutText(qualifier,'::') ; + [name.class,name.object] = mttCutText(identifier,':') ; + model = create_object(model,name,coordinates) ; + end + end + end + end + end + end + + N = N + jump ; + processing = (N<=L) ; +end + +model = incorporate_anonymous_objects(model) ; +model = identify_causal_assignments(model) ; +model = identify_object_binding(model) ; +model = identify_object_interfaces(model) ; +model = associate_external_domains(model) ; +model = tidy_up(model) ; + + + +function model = create_line(model,coordinates) + next = 1 + mttGetFieldLength(model,'line') ; + model.line(next).xy1 = coordinates(1:2) ; + model.line(next).xy2 = coordinates(3:4) ; + model.line(next).mid = (coordinates(1:2)+coordinates(3:4))/2 ; + +function model = create_bond(model,coordinates) + next = 1 + mttGetFieldLength(model,'bond') ; + + N = length(coordinates) ; + + q1 = coordinates(N-1:N) ; p1 = coordinates(1:2) ; + p2 = coordinates(3:4) ; q2 = coordinates(N-3:N-2) ; + p3 = coordinates(5:6) ; q3 = coordinates(N-5:N-4) ; + ps = norm(p2-p1) ; qs = norm(q2-q1) ; + + orientation = sign(ps-qs) ; + + switch orientation + case 1, % harpoon points forward + xy1 = p1 ; xy2 = q2 ; v1 = p2-p1 ; v2 = q2-q3 ; harpoon = q1-q2 ; + case -1, % harpoon points backward + xy1 = p2 ; xy2 = q1 ; v1 = q2-q1 ; v2 = p2-p3 ; harpoon = p1-p2 ; + end + + harpoon_side = sign_cross_product(v2,harpoon) ; + + mttAssert(~(orientation==0 | harpoon_side==0),... + ['Ambiguous bond orientation between[',num2str(xy1),'] and [',num2str(xy2),']']) ; + + model.bond(next).xy1 = xy1 ; + model.bond(next).xy2 = xy2 ; + model.bond(next).v1 = v1 ; + model.bond(next).v2 = v2 ; + model.bond(next).harpoon = harpoon ; + model.bond(next).harpoon_side = harpoon_side ; + + model.bond(next).from.obj = [] ; + model.bond(next).from.interface = [] ; + model.bond(next).to.obj = [] ; + model.bond(next).to.interface = [] ; + model.bond(next).flow = [] ; + model.bond(next).effort = [] ; + model.bond(next).unicausal = [] ; + model.bond(next).domain = [] ; + model.bond(next).domain_item = [] ; + +function model = create_label(model,name,coordinates) + inner_name = mttExtractText(name.label,'<','>') ; + if isempty(inner_name) + label_name = name.label ; + is_inline = 0 ; + else + label_name = inner_name ; + is_inline = 1 ; + end + mttValidateName(label_name) ; + + next = 1 + mttGetFieldLength(model,'label') ; + model.label(next).name = label_name ; + model.label(next).is_inline = is_inline ; + model.label(next).xy = coordinates ; + +function model = create_object(model,name,coordinates) +global mtt_environment + + domain_names = mttGetFieldNames(mtt_environment,'domain') ; + + is_anonymous = 0 ; + if isempty(name.object) + switch name.class + case {'0','1'}, + is_anonymous = 1 ; + case 'SS', + mttAssert(~isempty(name.object),... + 'Anonymous "SS" object') ; + otherwise, + name.object = name.class ; + end + end + + if is_anonymous + next = 1 + mttGetFieldLength(model,'anonymous') ; + model.anonymous(next).class = name.class ; + model.anonymous(next).xy = coordinates ; + else + object_names = mttGetFieldNames(model,'obj') ; + if ~isempty(object_names) + mttAssert(~ismember(name.object,object_names),... + ['Repeated object: "',name.object,'"']) ; + end + + switch name.class + case {'0','1'}, + mttValidateName(name.object) ; + mttAssert(~ismember(name.object,{'in','out'}),... + 'Junctions cannot use reserved port names') ; + + case {'SS','Se','Sf','De','Df'}, + mttValidateName(name.object) ; + + if isempty(name.domain) | isempty(mtt_environment) + model = setfield(model,'obj',name.object,'domain',[]) ; + model = setfield(model,'obj',name.object,'domain_item',[]) ; + else + mttAssert(ismember(name.domain,domain_names),... + ['Unrecognised domain "',name.domain,'"']) ; + dom = getfield(mtt_environment,'domain',name.domain,'dom') ; + item = getfield(mtt_environment,'domain',name.domain,'item') ; + + if isempty(item) + public_domain = getfield(mtt_environment,'public_domain',{dom}) ; + item_names = mttGetFieldNames(public_domain,'item') ; + + mttAssert(ismember(name.domain_item,item_names),... + ['Item "',name.domain_item,'" not found in public domain "',name.domain,'"']) ; + item_name = name.domain_item ; + else + mttAssert(isempty(name.domain_item),... + ['Item unspecified in public domain "',name.domain,'"']) ; + item_name = item ; + end + + model = setfield(model,'obj',name.object,'domain',dom) ; + model = setfield(model,'obj',name.object,'domain_item',item_name) ; + end + + otherwise, + mttValidateName(name.class) ; + mttValidateName(name.object) ; + + mttAssert(~ismember(name.object,{'in','out'}),... + 'Objects cannot use reserved port names') ; + end + model = setfield(model,'obj',name.object,'class',name.class) ; + model = setfield(model,'obj',name.object,'xy',coordinates) ; + end + +function model = incorporate_anonymous_objects(model) + number_of_objects = mttGetFieldLength(model,'anonymous') ; + + last = length(num2str(number_of_objects)) ; + for i = 1:last + object_number(i) = '0' ; + end + + for i = 1:number_of_objects + anonymous_object = getfield(model,'anonymous',{i}) ; + + current_number = num2str(i) ; + width = length(current_number) ; + first = last-width+1 ; + object_number(first:last) = current_number ; + + object_name = ['mtt_obj',object_number] ; + model = setfield(model,'obj',object_name,model.anonymous(i)) ; + end + +function r = sign_cross_product(v1,v2) + r = sign(v1(1)*v2(2) - v1(2)*v2(1)) ; + +function model = identify_causal_assignments(model) + L = mttGetFieldLength(model,'line') ; + + if L>0 + N = mttGetFieldLength(model,'bond') ; + + for j = 1:L + for i = 1:N + s(i,j) = norm(model.line(j).mid - model.bond(i).xy1) ; + f(i,j) = norm(model.line(j).mid - model.bond(i).xy2) ; + end + end + + [min_range_start,nearest_bond_start] = min(s) ; + [min_range_finish,nearest_bond_finish] = min(f) ; + + equidistant = min_range_start==min_range_finish ; + at_harpoon = min_range_start>min_range_finish ; + + for j = 1:L + fulcrum = num2str(model.line(j).mid) ; + + mttAssert(~equidistant(j),... + ['Ambiguous causal line at [',num2str(model.line(j).mid),']']) ; + + if at_harpoon(j) + index = nearest_bond_finish(j) ; + bond = model.bond(index) ; + terminal = bond.xy2 ; + terminal_vector = bond.v2 ; + else + index = nearest_bond_start(j) ; + bond = model.bond(index) ; + terminal = bond.xy1 ; + terminal_vector = bond.v1 ; + end + + to_lhs = norm(model.line(j).xy1 - terminal) ; + to_mid = norm(model.line(j).mid - terminal) ; + to_rhs = norm(model.line(j).xy2 - terminal) ; + + mttAssert(to_midto_left) ; + causal_assignment = sign_cross_product(terminal_vector,causal_vector) ; + mttAssert(causal_assignment~=0,... + ['Cannot determine causality near [',num2str(fulcrum),']']) ; + + if causal_assignment==bond.harpoon_side + [bond.flow,causality_ok] = mttAssign(bond.flow,at_harpoon(j)) ; + else + [bond.effort,causality_ok] = mttAssign(bond.effort,at_harpoon(j)) ; + end + end + mttAssert(causality_ok,... + ['Ambiguous causal assignment near [',num2str(fulcrum),']']) ; + + bond.unicausal = mttCompare(bond.flow,bond.effort) ; + + model.bond(index) = bond ; + end + end + + +function model = identify_object_binding(model) + object_names = mttGetFieldNames(model,'obj') ; + number_of_objects = length(object_names) ; + number_of_bonds = mttGetFieldLength(model,'bond') ; + + for j = 1:number_of_bonds + bond = model.bond(j) ; + for i = 1:number_of_objects + object = getfield(model,'obj',object_names{i}) ; + origin_proximity(i) = norm(object.xy - bond.xy1) ; + target_proximity(i) = norm(object.xy - bond.xy2) ; + end + + [range,index] = min(origin_proximity) ; + origin_name = object_names{index} ; + bond.from.obj = origin_name ; + bond.from.interface = [] ; + + [range,index] = min(target_proximity) ; + target_name = object_names{index} ; + bond.to.obj = target_name ; + bond.to.interface = [] ; + + model = setfield(model,'bond',{j},bond) ; + + origin = getfield(model,'obj',origin_name) ; + next = 1 + mttGetFieldLength(origin,'bond') ; + origin.bond(next).number = j ; + origin.bond(next).is_inbond = 0 ; + model = setfield(model,'obj',origin_name,origin) ; + + target = getfield(model,'obj',target_name) ; + next = 1 + mttGetFieldLength(target,'bond') ; + target.bond(next).number = j ; + target.bond(next).is_inbond = 1 ; + model = setfield(model,'obj',target_name,target) ; + end + + +function model = identify_object_interfaces(model) + object_names = mttGetFieldNames(model,'obj') ; + number_of_objects = length(object_names) ; + number_of_labels = mttGetFieldLength(model,'label') ; + number_of_bonds = mttGetFieldLength(model,'bond') ; + + for j = 1:number_of_labels + label = model.label(j) ; + for i = 1:number_of_objects + object_name = object_names{i} ; + object = getfield(model,'obj',object_names{i}) ; + proximity(i) = norm(object.xy - label.xy) ; + end + [range,index] = min(proximity) ; + associated_object = object_names{index} ; + object = getfield(model,'obj',associated_object) ; + + switch object.class + case {'0','1'}, + mttAssert(~label.is_inline,... + ['Inline ports not valid for "0" and "1" junctions']) ; + end + + next = 1 + mttGetFieldLength(object,'interface') ; + object = setfield(object,'interface',{next},'name',label.name) ; + object = setfield(object,'interface',{next},'class',[]) ; + object = setfield(object,'interface',{next},'is_inline',label.is_inline) ; + object = setfield(object,'interface',{next},'xy',label.xy) ; + object = setfield(object,'interface',{next},'in',[]) ; + object = setfield(object,'interface',{next},'out',[]) ; + object = setfield(object,'interface',{next},'map',[]) ; + model = setfield(model,'obj',associated_object,object) ; + end + + for j = 1:number_of_objects + object_name = object_names{j} ; + object = getfield(model,'obj',object_name) ; + + number_of_attached_bonds = mttGetFieldLength(object,'bond') ; + number_of_interfaces = mttGetFieldLength(object,'interface') ; + + for k = 1:number_of_interfaces + interface = object.interface(k) ; + + inbond_proximity = [] ; inbond_counter = [] ; + outbond_proximity = [] ; outbond_counter = [] ; + + in_counter = 0 ; + out_counter = 0 ; + + for i = 1:number_of_attached_bonds + bond_number = object.bond(i).number ; + bond = model.bond(bond_number) ; + + if object.bond(i).is_inbond + if isempty(bond.to.interface) + in_counter = in_counter + 1 ; + inbond_proximity(in_counter) = norm(interface.xy - bond.xy2) ; + inbond_counter(in_counter) = bond_number ; + end + else + if isempty(bond.from.interface) + out_counter = out_counter + 1 ; + outbond_proximity(out_counter) = norm(interface.xy - bond.xy1) ; + outbond_counter(out_counter) = bond_number ; + end + end + end + + [in_range,inbond_index] = min(inbond_proximity) ; + [out_range,outbond_index] = min(outbond_proximity) ; + + inbond = inbond_counter(inbond_index) ; + outbond = outbond_counter(outbond_index) ; + + if interface.is_inline + mttAssert(~isempty(inbond_proximity),... + ['No in-bond for interface "',object_name,'[',interface.name,']"']) ; + mttAssert(~isempty(outbond_proximity),... + ['No out-bond for interface "',object_name,'[',interface.name,']"']) ; + + interface.in = inbond ; + interface.out = outbond ; + + model = setfield(model,'bond',{outbond},'from','interface',k) ; + model = setfield(model,'bond',{inbond},'to','interface',k) ; + else + mttAssert(~(isempty(inbond_proximity) & isempty(outbond_proximity)),... + ['No bond for interface "',object_name,'[',interface.name,']"']) ; + + if isempty(inbond_proximity) + interface.out = outbond ; + model = setfield(model,'bond',{outbond},'from','interface',k) ; + elseif isempty(outbond_proximity) + interface.in = inbond ; + model = setfield(model,'bond',{inbond},'to','interface',k) ; + else + mttAssert(in_range~=out_range,... + ['Ambiguous interface "',object_name,'[',interface.name,']"']) ; + + if out_range0,... + ['No operator defined in ',here]) ; + + assigned_ports = [] ; + + for i = 1:length(cr.operator) + if i==1 + operator_names{1} = cr.operator(i).name ; + else + operator_name = cr.operator(i).name ; + mttAssert(~ismember(operator_name,operator_names),... + ['Repeated operator name "',operator_name,'" in ',here]) ; + operator_names{i} = operator_name ; + end + + newly_assigned_ports = mttGetFieldNames(cr.operator(i),'assign') ; + if isempty(assigned_ports) + assigned_ports = newly_assigned_ports ; + else + if ~isempty(newly_assigned_ports) + assigned_ports = [assigned_ports, newly_assigned_ports] ; + end + end + end + + for i = 1:length(interface_ports_with_state) + interface_port = interface_ports_with_state{i} ; + + mttAssert(ismember(interface_port,assigned_ports),... + ['Missing "set" declaration for port "',interface_port,'" in ',here]) ; + end + + + + +function [interface,next] = fetch_interface(statements,next,cr_name) +global mtt_environment + unit_name = 'interface' ; + here = [cr_name,'/',unit_name] ; + + domain_names = mttGetFieldNames(mtt_environment,'domain') ; + + interface = [] ; + number_of_statements = length(statements) ; + + counter = 0 ; + constraint = [] ; + + open = 0 ; + parsing = 1 ; + while parsing + next = next + 1 ; + statement = statements{next} ; + [keyword,line] = mttSeparateText(statement) ; + + switch keyword + case 'port', + ports = mttGetItemList(line) ; + for n = 1:length(ports) + identifier = mttCutText(ports{n},'[') ; + qualifier = mttExtractText(ports{n},'[',']') ; + [name.domain,name.domain_item] = mttCutText(qualifier,'::') ; + + name.port = identifier ; + mttValidateName(name.port) ; + + if isempty(name.domain) | isempty(mtt_environment) + interface = setfield(interface,'port',name.port,'domain',[]) ; + interface = setfield(interface,'port',name.port,'domain_item',[]) ; + interface = setfield(interface,'port',name.port,'was_generic',1) ; + else + mttAssert(ismember(name.domain,domain_names),... + ['Unrecognised domain "',name.domain,'"']) ; + dom = getfield(mtt_environment,'domain',name.domain,'dom') ; + item = getfield(mtt_environment,'domain',name.domain,'item') ; + + if isempty(item) + public_domain = getfield(mtt_environment,'public_domain',{dom}) ; + item_names = mttGetFieldNames(public_domain,'item') ; + + mttAssert(ismember(name.domain_item,item_names),... + ['Item "',name.domain_item,'" not found in public domain "',name.domain,'"']) ; + item_name = name.domain_item ; + else + mttAssert(isempty(name.domain_item),... + ['Item unspecified in public domain "',name.domain,'"']) ; + item_name = item ; + end + + interface = setfield(interface,'port',name.port,'domain',dom) ; + interface = setfield(interface,'port',name.port,'domain_item',item_name) ; + interface = setfield(interface,'port',name.port,'was_generic',0) ; + end + interface = setfield(interface,'port',name.port,'is_effort_state',0) ; + interface = setfield(interface,'port',name.port,'is_flow_state',0) ; + interface = setfield(interface,'port',name.port,'assign',[]) ; + end + + case {'assert','prefer'}, + counter = counter + 1 ; + constraint{counter} = statement ; + + case '{', + mttAssert(~open,['Unmatched "{" in ',here]) ; + open = 1 ; + case '}', + mttAssert(open,['Unmatched "}" in ',here]) ; + open = 0 ; + otherwise, + error(['Unrecognised_keyword "',keyword,'" in ',here]) ; + end + + mttAssert(~(open & (next==number_of_statements)),... + ['Missing "}" in ',here]) ; + + if (~open) | (next==number_of_statements) + parsing = 0 ; + end + end + + + interface_ports = mttGetFieldNames(interface,'port') ; + number_of_constraints = length(constraint) ; + + for i = 1:number_of_constraints + [keyword,assignment] = mttSeparateText(constraint{i}) ; + [namelist,definition] = mttCutText(assignment,'=>') ; + + mttAssert(~isempty(keyword),... + ['Rule "',constraint{i},'" has no context in cr ',cr_name]) ; + + if ~isempty(namelist) + first = 1 ; + last = length(namelist) ; + if namelist([first,last])=='[]' + ports = mttGetItemList(mttExtractText(namelist,'[',']')) ; + else + ports = {namelist} ; + end + end + + mttAssert(~isempty(ports),... + ['Rule "',constraint{i},'" has no association in cr ',cr_name]) ; + mttAssert(~isempty(definition),... + ['Rule "',constraint{i},'" not defined in cr ',cr_name]) ; + + for j = 1:length(ports) + port_name = ports{j} ; + mttValidateName(port_name) ; + + other_ports = [] ; + counter = 0 ; + for k = 1:length(ports) + if j~=k + counter = counter + 1 ; + other_ports{counter} = ports{k} ; + end + end + + mttAssert(ismember(port_name,interface_ports),... + ['Unreferenced port "',port_name,'" in cr ',cr_name]) ; + + port = getfield(interface,'port',port_name) ; + + switch definition + case 'effort_state', + mttAssert(mttIsEqual(port.is_flow_state,0),... + ['Attempt to overwrite state assignment at port "',port_name,'" in ',here]) ; + port.is_effort_state = 1 ; + + case 'flow_state', + mttAssert(mttIsEqual(port.is_effort_state,0),... + ['Attempt to overwrite state assignment at port "',port_name,'" in ',here]) ; + port.is_flow_state = 1 ; + + otherwise, + rule_number = 1 + mttGetFieldLength(port,'causality') ; + + port.causality(rule_number).rule = keyword ; + port.causality(rule_number).def = definition ; + port.causality(rule_number).with = other_ports ; + port.causality(rule_number).applied = 0 ; + end + + interface = setfield(interface,'port',port_name,port) ; + end + end + + +function [operator,next] = fetch_operator(statements,next,cr,cr_name) + unit_name = 'operator' ; + here = [cr_name,'/',unit_name] ; + + interface = [] ; + number_of_statements = length(statements) ; + + statement = statements{next} ; + [keyword,line] = mttSeparateText(statement) ; + + operator = mttGetOperatorContext(line,cr,cr_name) ; + + operator.content = [] ; + operator.var = [] ; + operator.var_default = [] ; + operator.struct = [] ; + operator.set = [] ; + + counter = 0 ; + + open = 0 ; + parsing = 1 ; + while parsing + next = next + 1 ; + statement = statements{next} ; + [keyword,line] = mttSeparateText(statement) ; + + switch keyword + case '{', + mttAssert(~open,['Unmatched "{" in ',here]) ; + open = 1 ; + + case '}', + mttAssert(open,['Unmatched "}" in ',here]) ; + open = 0 ; + + case 'set', + mttAssert(open,... + ['"set" declarations must be contained inside {...} in ',here]) ; + + operator = mttAppend(operator,'set',{line}) ; + + case 'var', + mttAssert(open,... + ['"var" declarations must be contained inside {...} in ',here]) ; + + variable_list = line ; + [variables,defaults] = mttGetParameters(variable_list) ; + + operator = mttAppend(operator,'var',variables) ; + operator = mttAppend(operator,'var_default',defaults) ; + + case 'struct', + mttAssert(open,... + ['"struct" declarations must be contained inside {...} in ',here]) ; + + [struct_name,variable_list] = mttSeparateText(line) ; + [variables,defaults] = mttGetParameters(variable_list) ; + + mttAssert(mttIsEmptyCellArray(defaults),... + ['"struct" declarations cannot have default values in ',here]) ; + + operator.struct = mttAppend(operator.struct,struct_name,variables) ; + + otherwise, + counter = counter + 1 ; + operator.content{counter} = statement ; + end + + mttAssert(~(open & (next==number_of_statements)),... + ['Missing "}" in ',here]) ; + + if (~open) | (next==number_of_statements) + parsing = 0 ; + end + end + + cr_ports = mttGetFieldNames(cr.interface,'port') ; + for i = 1:length(operator.var) + current_var = operator.var{i} ; + mttAssert(~ismember(current_var,cr.numpar),... + ['Variable "',current_var,'" redeclares CR numerical parameter in ',cr_name]) ; + mttAssert(~ismember(current_var,cr.sympar),... + ['Variable "',current_var,'" redeclares CR parameter in ',cr_name]) ; + mttAssert(~ismember(current_var,cr_ports),... + ['Variable "',current_var,'" redeclares CR port in ',cr_name]) ; + end + + operator = mttParseOperatorEquations(operator,cr,cr_name) ; + + +function context = mttGetOperatorContext(line,cr,cr_name) + index = sort([findstr(line,'|'),findstr(line,'<'),findstr(line,'>')]) ; + assignment = findstr(line,':=') ; + + mttAssert(length(assignment)==1,... + ['Operator declaration must contain a unique ":=" assignment in cr ',cr_name]) ; + mttAssert(length(index)>0,... + ['Operator declaration without ports in cr ',cr_name]) ; + + left_side = index(indexassignment) ; + + mttAssert(length(left_side)>0,... + ['Operator declaration without input ports in cr ',cr_name]) ; + mttAssert(length(right_side)>0,... + ['Operator declaration without output ports in cr ',cr_name]) ; + mttAssert(mod(length(left_side),2)==0 & mod(length(right_side),2)==0,... + ['Operator declaration has mismatched tags in cr ',cr_name]) ; + + context.name = mttClipText(line(assignment+2:right_side(1)-1)) ; + mttAssert(~isempty(context.name),... + ['Operator declaration is anonymous in cr ',cr_name]) ; + + mttValidateName(context.name) ; + + + counter = 0 ; + + for i = 1:length(index)/2 + counter = counter + 1 ; + link = [] ; + + right = 2*i ; + left = right - 1 ; + + if index(right)assignment + link.is_input = 1 ; + end + + + recognised = 1 ; + switch line(index([left,right])) + case '|>', + link.is_flow = 1 ; + link.is_effort = 0 ; + case '<|', + link.is_flow = 0 ; + link.is_effort = 1 ; + case '<>', + link.is_flow = 1 ; + link.is_effort = 1 ; + otherwise, + recognised = 0 ; + end + + mttAssert(recognised,... + ['Unrecognised tags in operator ',context.name,' (cr ',cr_name,')']) ; + + port_declaration = line(index(left):index(right)) ; + port = line(index(left)+1:index(right)-1) ; + mttAssert(~isempty(port),... + ['Empty port in operator ',context.name,' (cr ',cr_name,')']) ; + + [port_name,qualifier] = mttCutText(port,'=') ; + + link.name = port_name ; + + if isempty(qualifier) + link.is_unconstrained = 1 ; + else + link.is_unconstrained = 0 ; + mttAssert(strcmp(qualifier,'0'),... + ['Non-zero port constraint in operator ',context.name,' (cr ',cr_name,')']) ; + end + + context.link(counter) = link ; + end + + + cr_port_names = mttGetFieldNames(cr.interface,'port') ; + + check.is_input = [] ; + check.is_output = [] ; + check.is_effort = [] ; + check.is_flow = [] ; + + for j = 1:length(cr_port_names) + port_check(j) = check ; + end + + for i = 1:counter + port_name = context.link(i).name ; + mttAssert(ismember(port_name,cr_port_names),... + ['Operator declaration uses undefined port "',port_name,'" in cr ',cr_name]) ; + + index = strmatch(port_name,cr_port_names,'exact') ; + + mttAssert(~mttIsEqual(port_check(index).is_input,context.link(i).is_input),... + ['Operator declaration has repeated input ports in cr ',cr_name]) ; + mttAssert( mttIsEqual(port_check(index).is_output,context.link(i).is_input),... + ['Operator declaration has repeated output ports in cr ',cr_name]) ; + mttAssert(~mttIsEqual(port_check(index).is_flow,context.link(i).is_flow),... + ['Operator declaration has repeated flow in cr ',cr_name]) ; + mttAssert(~mttIsEqual(port_check(index).is_effort,context.link(i).is_effort),... + ['Operator declaration has repeated effort in cr ',cr_name]) ; + + port_check(index).is_input = context.link(i).is_input ; + port_check(index).is_output = ~context.link(i).is_input ; + port_check(index).is_flow = context.link(i).is_flow ; + port_check(index).is_effort = context.link(i).is_effort ; + end + + for j = 1:length(cr_port_names) + mttAssert(~isempty(port_check(j).is_input),... + ['Operator declaration has missing input ports in cr ',cr_name]) ; + mttAssert(~isempty(port_check(j).is_output),... + ['Operator declaration has missing output ports in cr ',cr_name]) ; + mttAssert(~isempty(port_check(j).is_flow),... + ['Operator declaration has missing flow in cr ',cr_name]) ; + mttAssert(~isempty(port_check(j).is_effort),... + ['Operator declaration has missing effort in cr ',cr_name]) ; + end ADDED ntt/bin/trans/m/mttFetchSpecification.m Index: ntt/bin/trans/m/mttFetchSpecification.m ================================================================== --- ntt/bin/trans/m/mttFetchSpecification.m +++ ntt/bin/trans/m/mttFetchSpecification.m @@ -0,0 +1,189 @@ +function model = mttFetchSpecification(filename) + +model = [] ; + +mttAssert(mttFileExists(filename),... + ['File "',filename,'" not found']) ; + +mttNotify([' ...processing ',filename]) ; +mttWriteNewLine ; + +model.specification = filename ; + +model.source = mttCutText(filename,'_abg.txt') ; +model_name = mttDetachText(model.source,'/') ; + +content = mttReadFile(filename) ; +statements = mttExtractStatements(content) ; + +number_of_statements = length(statements) ; + +abg_declared = 0 ; +next = 0 ; + +parsing = 1 ; +while parsing + next = next + 1 ; + statement = statements{next} ; + [keyword,line] = mttSeparateText(statement) ; + + switch keyword + case 'abg', + mttAssert(~abg_declared,... + '"abg" declaration must be unique') ; + abg_declared = 1 ; + + abg_name = mttCutText(line,'[') ; + mttAssert(strcmp(abg_name,model_name),... + ['Wrong name:[',abg_name,'] Expecting:[',model_name,']']) ; + + abg_parameter_list = mttExtractText(line,'[',']') ; + [abg_parameters,abg_defaults] = mttGetParameters(abg_parameter_list) ; + + model.name = abg_name ; + + model.sympar = abg_parameters ; + model.sympar_default = abg_defaults ; + + [abg,next] = fetch_abg(statements,next) ; + + model = mttAppendFields(model,abg) ; + + case '{', + error('Unexpected "{" found') ; + case '}', + error('Unexpected "}" found') ; + otherwise, + error(['Unrecognised top-level keyword "',keyword,'"']) ; + end + + if next==number_of_statements + parsing = 0 ; + end +end + +mttCheckBondgraphDeclarations(model) ; + + + +function [abg,next] = fetch_abg(statements,next) +global mtt_environment + + abg = [] ; + unit_name = 'abg' ; + + user_defined_paths = mttGetFieldNames(mtt_environment,'path') ; + + number_of_statements = length(statements) ; + + bondgraph = [] ; + use_declared = 0 ; + open = 0 ; + + parsing = 1 ; + while parsing + next = next + 1 ; + statement = statements{next} ; + [keyword,line] = mttSeparateText(statement) ; + + switch keyword + case 'use', + mttAssert(open,... + ['"use" declaration must be contained inside {...} in "',unit_name,'"']) ; + mttAssert(~use_declared,... + '"use" declaration must be unique') ; + + use_declared = 1 ; + bondgraph = line ; + + abg.bondgraph = bondgraph ; + + case 'input', + mttAssert(open,... + ['"input" declarations must be contained inside {...} in "',unit_name,'"']) ; + + input_parameter_list = line ; + [input_parameters,input_defaults] = mttGetParameters(input_parameter_list) ; + + abg = mttAppend(abg,'input',input_parameters) ; + abg = mttAppend(abg,'input_default',input_defaults) ; + + case 'numpar', + mttAssert(open,... + ['"numpar" declarations must be contained inside {...} in "',unit_name,'"']) ; + + numerical_parameter_list = line ; + [numerical_parameters,numerical_defaults] = mttGetParameters(numerical_parameter_list) ; + + abg = mttAppend(abg,'numpar',numerical_parameters) ; + abg = mttAppend(abg,'numpar_default',numerical_defaults) ; + + case 'object', + mttAssert(open,... + ['"object" declarations must be contained inside {...} in "',unit_name,'"']) ; + + object_names = mttGetFieldNames(abg,'obj') ; + + [object_name,object_spec] = mttCutText(line,':=') ; + mttAssert(~ismember(object_name,object_names),... + ['Object "',object_name,'" already declared']) ; + + implementation = mttCutText(object_spec,'[') ; + mttAssert(~isempty(implementation),... + ['Incomplete specification:[',line,']']) ; + + object_parameter_list = mttExtractText(line,'[',']') ; + object_parameters = mttGetInstanceParameters(object_parameter_list) ; + + [source,name.item] = mttCutText(implementation,'::') ; + [name.class,name.path] = mttDetachText(source,'/') ; + + if isempty(name.class) + name.class = source ; + name.path = [] ; + else + mttAssert(~isempty(name.path),... + ['Empty path name in "',unit_name,'"']) ; + if name.path(1)=='$' + [path_alias,path_branch] = mttCutText(name.path,'/') ; + path_alias(1) = [] ; + + mttAssert(ismember(path_alias,user_defined_paths),... + ['Path "',path_alias,'" not recognised']) ; + + path_root = getfield(mtt_environment,'path',path_alias) ; + if isempty(path_branch) + name.path = path_root ; + else + name.path = [path_root,'/',path_branch] ; + end + end + end + + abg = setfield(abg,'obj',object_name,'name',name) ; + abg = setfield(abg,'obj',object_name,'parameter',object_parameters) ; + + case '{', + mttAssert(~open,['Unmatched "{" in "',unit_name,'"']) ; + open = 1 ; + case '}', + mttAssert(open,['Unmatched "}" in "',unit_name,'"']) ; + open = 0 ; + otherwise, + error(['Unrecognised_keyword "',keyword,'" in "',unit_name,'"']) ; + end + + mttAssert(~(open & (next==number_of_statements)),... + ['Missing "}" in "',unit_name,'"']) ; + + if (~open) | (next==number_of_statements) + parsing = 0 ; + end + end + + abg = mttSetFieldDefault(abg,'input',[]) ; + abg = mttSetFieldDefault(abg,'input_default',[]) ; + abg = mttSetFieldDefault(abg,'numpar',[]) ; + abg = mttSetFieldDefault(abg,'numpar_default',[]) ; + abg = mttSetFieldDefault(abg,'bondgraph',[]) ; + ADDED ntt/bin/trans/m/mttFetchStruct.m Index: ntt/bin/trans/m/mttFetchStruct.m ================================================================== --- ntt/bin/trans/m/mttFetchStruct.m +++ ntt/bin/trans/m/mttFetchStruct.m @@ -0,0 +1,108 @@ +function model = mttFetchStruct(filename) + +model.representation = 'struct' ; + +mttAssert(mttFileExists(filename),... + ['File "',filename,'" not found']) ; + +mttNotify([' ...processing ',filename]) ; +mttWriteNewLine ; + +model.source = mttCutText(filename,'_struct.txt') ; +content = mttReadFile(filename) ; +statements = mttExtractStatements(content) ; + +number_of_statements = length(statements) ; + +next = 0 ; + +parsing = 1 ; +while parsing + next = next + 1 ; + statement = statements{next} ; + [keyword,line] = mttSeparateText(statement) ; + + switch keyword + case {'struct','public_struct','private_struct'}, + struct_name = line ; + mttValidateName(struct_name) ; + + [struct,next] = fetch_struct(statements,next,struct_name) ; + model = setfield(model,'item',struct_name,struct) ; + + is_private = strcmp(keyword,'private_struct') ; + model = setfield(model,'item',struct_name,'is_private',is_private) ; + + case '{', + error('Unexpected "{" found') ; + case '}', + error('Unexpected "}" found') ; + otherwise, + error(['Unrecognised top-level keyword "',keyword,'"']) ; + end + + if next==number_of_statements + parsing = 0 ; + end +end + + +function [struct,next] = fetch_struct(statements,next,struct_name) + struct = [] ; + unit_name = 'struct' ; + + number_of_statements = length(statements) ; + + counter = 0 ; + open = 0 ; + + parsing = 1 ; + while parsing + next = next + 1 ; + statement = statements{next} ; + [keyword,line] = mttSeparateText(statement) ; + + switch keyword + case 'var', + mttAssert(open,... + ['"var" declarations must be contained inside {...} in "',unit_name,'"']) ; + mttAssert(~isempty(line),... + ['Undefined "var" in "',unit_name,'"']) ; + + data_name = line ; + mttValidateName(data_name) ; + + counter = counter + 1 ; + struct.var(counter).name = data_name ; + struct.var(counter).type = [] ; + + case '{', + mttAssert(~open,['Unmatched "{" in "',unit_name,'"']) ; + open = 1 ; + case '}', + mttAssert(open,['Unmatched "}" in "',unit_name,'"']) ; + open = 0 ; + otherwise, + mttAssert(open,... + ['Declarations must be contained inside {...} in "',unit_name,'"']) ; + mttAssert(~isempty(line),... + ['Empty declaration in "',unit_name,'"']) ; + + data_name = line ; + mttValidateName(data_name) ; + + data_type = keyword ; + mttValidateName(data_type) ; + + counter = counter + 1 ; + struct.var(counter).name = data_name ; + struct.var(counter).type = data_type ; + end + + mttAssert(~(open & (next==number_of_statements)),... + ['Missing "}" in "',unit_name,'"']) ; + + if (~open) | (next==number_of_statements) + parsing = 0 ; + end + end ADDED ntt/bin/trans/m/mttIdentifyDomainCovariables.m Index: ntt/bin/trans/m/mttIdentifyDomainCovariables.m ================================================================== --- ntt/bin/trans/m/mttIdentifyDomainCovariables.m +++ ntt/bin/trans/m/mttIdentifyDomainCovariables.m @@ -0,0 +1,97 @@ +function compound_item = mttIdentifyDomainCovariables(item,domain,model) + domains = mttGetFieldNames(model,'domain') ; + + domain_name = domain.source ; + domain_shortname = mttDetachText(domain_name,'/') ; + + item_names = mttGetFieldNames(domain,'item') ; + + number_of_bonds = mttGetFieldLength(item,'bond') ; + + if number_of_bonds==0 + compound_item.effort = {item.covar.effort} ; + compound_item.flow = {item.covar.flow} ; + + compound_item.effort_default = {item.covar.effort_default} ; + compound_item.flow_default = {item.covar.flow_default} ; + + else + counter = 0 ; + for k = 1:number_of_bonds + bond = item.bond(k) ; + + [next_domain,next_item] = mttCutText(bond.domain,'::') ; + if isempty(next_item) + mttAssert(ismember(next_item,item_names),... + ['Unrecognised reference "',next_item,'" in domain ',domain_shortname]) ; + + next_item = bond.domain ; + dependent_item = getfield(domain,'item',next_item) ; + compound_domain = mttIdentifyDomainCovariables(dependent_item,domain,model) ; + else + mttAssert(ismember(next_domain,domains),... + ['Unrecognised domain reference "',next_domain,'" in domain ',domain_shortname]) ; + + next_domain_index = getfield(model,'domain',next_domain,'dom') ; + next_domain_item_reference = getfield(model,'domain',next_domain,'item') ; + + mttAssert(isempty(next_domain_item_reference),... + ['Constrained domain reference "',next_domain,'" in domain ',domain_shortname]) ; + + actual_domain = model.dom(next_domain_index) ; + + actual_domain_name = actual_domain.source ; + actual_domain_shortname = mttDetachText(actual_domain_name,'/') ; + + actual_item_names = mttGetFieldNames(actual_domain,'item') ; + mttAssert(ismember(next_item,actual_item_names),... + ['Unrecognised reference "',next_item,'" in domain ',actual_domain_shortname]) ; + + dependent_item = getfield(actual_domain,'item',next_item) ; + mttAssert(~dependent_item.is_private,... + ['No public cross-reference available for "',next_item,'" in domain ',actual_domain_shortname]) ; + + compound_domain = mttIdentifyDomainCovariables(dependent_item,actual_domain,model) ; + end + + for i = 1:length(compound_domain.effort) + counter = counter + 1 ; + if isempty(bond.name) + compound_effort{counter} = compound_domain.effort{i} ; + compound_flow{counter} = compound_domain.flow{i} ; + else + compound_effort{counter} = [bond.name,'.',compound_domain.effort{i}] ; + compound_flow{counter} = [bond.name,'.',compound_domain.flow{i}] ; + end + compound_effort_default{counter} = compound_domain.effort_default{i} ; + compound_flow_default{counter} = compound_domain.flow_default{i} ; + end + end + + depth = length(compound_effort) ; + for n = 1:depth-1 + mttAssert(~ismember(compound_effort{n},{compound_effort{n+1:depth}}),... + ['Repeated effort variable "',compound_effort{n},'" in domain ',domain_shortname]) ; + mttAssert(~ismember(compound_flow{n},{compound_flow{n+1:depth}}),... + ['Repeated flow variable "',compound_flow{n},'" in domain ',domain_shortname]) ; + end + + for n = 1:depth + mttAssert(~ismember(compound_effort{n},{compound_flow{1:depth}}),... + ['Ambiguous effort/flow variable "',compound_effort{n},'" in domain ',domain_shortname]) ; + mttAssert(~ismember(compound_flow{n},{compound_effort{1:depth}}),... + ['Ambiguous flow/effort variable "',compound_flow{n},'" in domain ',domain_shortname]) ; + end + + mttAssert(~ismember('flow',{compound_effort{1:depth}}),... + ['Effort variable called "flow" in domain ',domain_shortname]) ; + mttAssert(~ismember('effort',{compound_flow{1:depth}}),... + ['flow variable called "effort" in domain ',domain_shortname]) ; + + compound_item.effort = compound_effort ; + compound_item.flow = compound_flow ; + + compound_item.effort_default = compound_effort_default ; + compound_item.flow_default = compound_flow_default ; + end + ADDED ntt/bin/trans/m/mttIdentifyStructVariables.m Index: ntt/bin/trans/m/mttIdentifyStructVariables.m ================================================================== --- ntt/bin/trans/m/mttIdentifyStructVariables.m +++ ntt/bin/trans/m/mttIdentifyStructVariables.m @@ -0,0 +1,40 @@ +function compound_item = mttIdentifyStructVariables(item,struct,model) + structs = mttGetFieldNames(model,'struct') ; + + struct_name = struct.source ; + struct_shortname = mttDetachText(struct_name,'/') ; + + item_names = mttGetFieldNames(struct,'item') ; + + number_of_vars = mttGetFieldLength(item,'var') ; + + counter = 0 ; + for k = 1:number_of_vars + var = item.var(k) ; + + next_item = var.type ; + if isempty(next_item) + counter = counter + 1 ; + compound_var{counter} = var.name ; + else + mttAssert(ismember(next_item,item_names),... + ['Unrecognised reference "',next_item,'" in struct ',struct_shortname]) ; + + dependent_item = getfield(struct,'item',next_item) ; + compound_struct = mttIdentifyStructVariables(dependent_item,struct,model) ; + + for i = 1:length(compound_struct.var) + counter = counter + 1 ; + compound_var{counter} = [var.name,'.',compound_struct.var{i}] ; + end + end + + variables = length(compound_var) ; + for n = 1:variables-1 ; + mttAssert(~ismember(compound_var{n},{compound_var{n+1:variables}}),... + ['Repeated variable "',compound_var{n},'" in struct ',struct_shortname]) ; + end + + compound_item.var = compound_var ; + end + ADDED ntt/bin/trans/m/mttParseOperatorEquations.m Index: ntt/bin/trans/m/mttParseOperatorEquations.m ================================================================== --- ntt/bin/trans/m/mttParseOperatorEquations.m +++ ntt/bin/trans/m/mttParseOperatorEquations.m @@ -0,0 +1,318 @@ +function operator = mttParseOperatorEquations(operator,cr,cr_name) +global mtt_environment + + operator.equation = [] ; +% operator.is_used = 0 ; + + numparlist = cr.numpar ; + symparlist = cr.sympar ; + varlist = operator.var ; + inputlist = cr.input ; + statelist = cr.state ; + + structlist = [] ; + if ~isempty(operator.struct) + struct_names = mttGetFieldNames(operator,'struct') ; + number_of_structs = length(struct_names) ; + for i = 1:number_of_structs + struct_name = struct_names{i} ; + variables = getfield(operator,'struct',struct_name) ; + if i==1 + structlist = variables ; + else + structlist = [structlist,variables] ; + end + end + end + + + inlist = [] ; + outlist = [] ; + inlink = [] ; + outlink = [] ; + + input_counter = 0 ; + output_counter = 0 ; + + for i = 1:length(operator.link) + if operator.link(i).is_input + input_counter = input_counter + 1 ; + inlist{input_counter} = operator.link(i).name ; + inlink(input_counter) = i ; + infree(input_counter) = operator.link(i).is_unconstrained ; + else + output_counter = output_counter + 1 ; + outlist{output_counter} = operator.link(i).name ; + outlink(output_counter) = i ; + outfree(output_counter) = operator.link(i).is_unconstrained ; + end + end + + + operator.assign = [] ; + ports_with_state_assignment = [] ; + + for i = 1:length(operator.set) + [port_covariable,state] = mttCutText(operator.set{i},'=>') ; + mttAssert(~isempty(state),... + ['"set" declarations must use "=>" in cr ',cr_name]) ; + + [port_name,covariable] = mttCutText(port_covariable,'.') ; + mttAssert(~isempty(covariable),... + ['"set" declarations must reference effort/flow covariables in cr ',cr_name]) ; + + port = strmatch(port_name,outlist,'exact') ; + ports_with_state_assignment = [ports_with_state_assignment,port] ; + + mttAssert(~isempty(port),... + ['Output port "',port_name,'" not recognised for "set" declaration in cr ',cr_name]) ; + mttAssert(outfree(port),... + ['Constrained port variable used for "set" declaration in cr ',cr_name]) ; + + actual_port = getfield(cr.interface.port,port_name) ; + mttAssert(actual_port.is_effort_state | actual_port.is_flow_state,... + ['"set" declarations must only be used for effort_states or flow_states in cr ',cr_name]) ; + + if isempty(actual_port.domain) + if actual_port.is_effort_state + covariables = {'effort'} ; + elseif actual_port.is_flow_state + covariables = {'flow'} ; + end + else + public_domain = mtt_environment.public_domain(actual_port.domain) ; + domain_item = getfield(public_domain.item,actual_port.domain_item) ; + + if actual_port.is_effort_state + covariables = domain_item.effort ; + elseif actual_port.is_flow_state + covariables = domain_item.flow ; + end + end + + index = strmatch(covariable,covariables,'exact') ; + mttAssert(~isempty(index),... + ['Unrecognised covariable "',covariable,'" used for "set" declaration in cr ',cr_name]) ; + + if isfield(operator.assign,port_name) + assignment = getfield(operator,'assign',port_name) ; + mttAssert(isempty(assignment.states{index}),... + ['Repeated covariable "',covariable,'" used for "set" declaration in cr ',cr_name]) ; + else + assignment.covar = covariables ; + assignment.state{length(covariables)} = [] ; +% assignment.domain = actual_port.domain ; +% assignment.domain_item = actual_port.domain_item ; + end + + mttAssert(ismember(state,cr.state),... + ['Unrecognised state "',state,'" used for "set" declaration in cr ',cr_name]) ; + + assignment.state{index} = state ; + operator = setfield(operator,'assign',port_name,assignment) ; + end + operator = mttDeleteField(operator,'set') ; + + + port_assignments = mttGetFieldNames(operator,'assign') ; + number_of_assignments = length(port_assignments) ; + for i = 1:number_of_assignments + assignment = getfield(operator,'assign',port_name) ; + for j = 1:length(assignment.state) + mttAssert(~isempty(assignment.state{j}),... + ['Missing covariable "',covariable,'" from "set" declaration in cr ',cr_name]) ; + end + end + + + for i = 1:length(operator.content) + operator.equation(i).chunk = {[]} ; +% operator.equation(i).was_generic = 1 ; +% operator.equation(i).domain = [] ; +% operator.equation(i).domain_item = [] ; +% operator.equation(i).is_effort = [] ; +% operator.equation(i).covariable = [] ; + + counter = 0 ; + + line = operator.content{i} ; + + if ~isempty(mttClipText(line)) + [var,loc] = mttFindEquationVariables(line) ; + + if loc(1)>1 + front = line(1:loc(1)-1) ; + counter = counter + 1 ; + operator.equation(i).chunk{counter} = front ; + end + + last = length(line) ; + + for j = 1:length(var) + [name,component] = mttCutText(var{j},'.') ; + + if isempty(component) + [name,attribute] = mttCutText(name,'''') ; + + numpar = strmatch(name,numparlist,'exact') ; + sympar = strmatch(name,symparlist,'exact') ; + variable = strmatch(name,varlist,'exact') ; + struct = strmatch(name,structlist,'exact') ; + input = strmatch(name,inputlist,'exact') ; + state = strmatch(name,statelist,'exact') ; + + ok = ~(isempty(numpar)&isempty(sympar)&isempty(variable)&isempty(struct)&isempty(input)&isempty(state)) ; + mttAssert(ok,['Variable ',var{j},' not recognised in cr ',cr_name]) ; + + is_numpar = ~isempty(numpar) ; + is_sympar = ~isempty(sympar) ; + is_var = ~isempty(variable) ; + is_struct = ~isempty(struct) ; + is_input = ~isempty(input) ; + is_state = ~isempty(state) ; + is_derivative = 0 ; + + if ~isempty(attribute) + mttAssert(strcmp(attribute,'dt'),... + ['Unrecognised attribute ',attribute,' in cr ',cr_name]) ; + mttAssert(is_state,... + ['Derivative of non-state variable in cr ',cr_name]) ; + is_state = 0 ; + is_derivative = 1 ; + end + + counter = counter + 1 ; + + if is_numpar + operator.equation(i).chunk{counter} = {'numpar',numpar} ; + end + + if is_sympar + operator.equation(i).chunk{counter} = {'sympar',sympar} ; + end + + if is_var + operator.equation(i).chunk{counter} = {'var',variable} ; + end + + if is_struct + operator.equation(i).chunk{counter} = {'struct',struct} ; + end + + if is_input + operator.equation(i).chunk{counter} = {'input',input} ; + end + + if is_state + operator.equation(i).chunk{counter} = {'state',state} ; + end + + if is_derivative + operator.equation(i).chunk{counter} = {'derivative',state} ; + end + + else + + if j==1 + port = strmatch(name,outlist,'exact') ; + + if ~isempty(ports_with_state_assignment) + mttAssert(~any(port==ports_with_state_assignment),... + ['Use "set" declaration to assign output port ',name,' to state in cr ',cr_name]) ; + end + + mttAssert(~isempty(port),... + ['Output port ',name,' not recognised in cr ',cr_name]) ; + mttAssert(outfree(port),... + ['Constrained port variable used in cr ',cr_name]) ; + + counter = counter + 1 ; + operator.equation(i).chunk{counter} = {'link',outlink(port),component} ; + else + port = strmatch(name,inlist,'exact') ; + mttAssert(~isempty(port),... + ['Input port ',name,' not recognised in cr ',cr_name]) ; + mttAssert(infree(port),... + ['Constrained port variable used in cr ',cr_name]) ; + + counter = counter + 1 ; + operator.equation(i).chunk{counter} = {'link',inlink(port),component} ; + end + + +% equation_domain = mttIdentifyUserDomain(mtt_environment,... +% operator.equation(i).domain,.... +% operator.equation(i).domain_item) ; + + covariable = component ; + port_name = name ; + port = getfield(cr.interface.port,port_name) ; + + if isempty(port.domain) + is_effort = strcmp(covariable,'effort') ; + is_flow = strcmp(covariable,'flow') ; + + mttAssert(is_effort|is_flow, ... + ['"',covariable,'" is not a generic covariable']) ; + +% mttAssert(isempty(operator.equation(i).domain),... +% ['Generic interface "',port_name,'" referenced in ',equation_domain,' equation']) ; + else + public_domain = mtt_environment.public_domain(port.domain) ; + actual_domain = getfield(public_domain,'item',port.domain_item) ; + + port_domain = mttIdentifyUserDomain(mtt_environment,port.domain,port.domain_item) ; + + is_effort = ismember(covariable,actual_domain.effort) ; + is_flow = ismember(covariable,actual_domain.flow) ; + + mttAssert(is_effort|is_flow, ... + ['"',covariable,'" is not a covariable defined in domain "',port_domain,'"']) ; + +% if isempty(equation_domain) +% operator.equation(i).was_generic = 0 ; +% operator.equation(i).domain = port.domain ; +% operator.equation(i).domain_item = port.domain_item ; + % operator.equation(i).covariable = covariable ; + % else + % mttAssert(covariable==operator.equation(i).covariable, ... + % ['Equation cannot combine different covariables: [',covariable,',',operator.equation(i).covariable,']') ; +% end + end + +% if isempty(operator.equation(i).is_effort) +% if is_effort +% operator.equation(i).is_effort = 1 ; +% else +% operator.equation(i).is_effort = 0 ; +% end +% else +% mttAssert(operator.equation(i).is_effort==is_effort,... +% ['Effort and flow covariables appear in equation: "',operator.content{i},'"']) ; +% end + end + + next = loc(j) + length(var{j}) ; + + if j1,... + ['Less than two interfaces at 0-junction ',here]) ; + + imposed_effort = [] ; + resultant_flow = [] ; + + for j = 1:number_of_interfaces + inbond = object.interface(j).in ; + outbond = object.interface(j).out ; + + if isempty(inbond) + bond(j) = outbond ; + orientation(j) = 0 ; + else + bond(j) = inbond ; + orientation(j) = 1 ; + end + + [effort,flow,unicausal] = mttGetBondCausality(model,bond(j)) ; + + if ~isempty(effort) + if effort==orientation(j) + mttAssert(isempty(imposed_effort),... + ['Over-determined effort at 0-junction ',here]) ; + imposed_effort = bond(j) ; + end + end + + if ~isempty(flow) + if flow==orientation(j) + mttAssert(isempty(resultant_flow),... + ['Over-determined flow at 0-junction ',here]) ; + resultant_flow = bond(j) ; + end + end + end + + for j = 1:number_of_interfaces + if ~isempty(imposed_effort) + if bond(j)~=imposed_effort + model = mttUpdateBondCausality(model,bond(j),~orientation(j),[],[]) ; + end + end + + if ~isempty(resultant_flow) + if bond(j)~=resultant_flow + model = mttUpdateBondCausality(model,bond(j),[],~orientation(j),[]) ; + end + end + end + + case '1', + mttAssert(number_of_interfaces>1,... + ['Less than two interfaces at 1-junction ',here]) ; + + imposed_flow = [] ; + resultant_effort = [] ; + + for j = 1:number_of_interfaces + inbond = object.interface(j).in ; + outbond = object.interface(j).out ; + + if isempty(inbond) + bond(j) = outbond ; + orientation(j) = 0 ; + else + bond(j) = inbond ; + orientation(j) = 1 ; + end + + [effort,flow,unicausal] = mttGetBondCausality(model,bond(j)) ; + + if ~isempty(effort) + if effort~=orientation(j) + mttAssert(isempty(resultant_effort),... + ['Over-determined effort at 1-junction ',here]) ; + resultant_effort = bond(j) ; + end + end + + if ~isempty(flow) + if flow~=orientation(j) + mttAssert(isempty(imposed_flow),... + ['Over-determined flow at 1-junction ',here]) ; + imposed_flow = bond(j) ; + end + end + end + + for j = 1:number_of_interfaces + if ~isempty(resultant_effort) + if bond(j)~=resultant_effort + model = mttUpdateBondCausality(model,bond(j),orientation(j),[],[]) ; + end + end + + if ~isempty(imposed_flow) + if bond(j)~=imposed_flow + model = mttUpdateBondCausality(model,bond(j),[],orientation(j),[]) ; + end + end + end + end + end + end + ADDED ntt/bin/trans/m/mttPropagateDomains.m Index: ntt/bin/trans/m/mttPropagateDomains.m ================================================================== --- ntt/bin/trans/m/mttPropagateDomains.m +++ ntt/bin/trans/m/mttPropagateDomains.m @@ -0,0 +1,111 @@ +function model = mttPropagateDomains(model,branch) + is_root_model = (nargin==1) ; + + objects = mttGetFieldNames(model,'obj') ; + + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + if is_root_model + branch = mttDetachText(model.source,'/') ; + end + here = [branch,':',object_name] ; + + if ~isempty(object.abg) + + for j = 1:mttGetFieldLength(object,'interface') + port_name = object.interface(j).name ; + + inbond = object.interface(j).in ; + outbond = object.interface(j).out ; + inmap = object.interface(j).map.in ; + outmap = object.interface(j).map.out ; + + [inbond_domain,inbond_domain_item] = mttGetBondDomain(model,inbond) ; + [outbond_domain,outbond_domain_item] = mttGetBondDomain(model,outbond) ; + [inmap_domain,inmap_domain_item] = mttGetBondDomain(object,inmap) ; + [outmap_domain,outmap_domain_item] = mttGetBondDomain(object,outmap) ; + + [model,inbond_ok] = mttUpdateBondDomain(model,inbond,inmap_domain,inmap_domain_item) ; + [model,outbond_ok] = mttUpdateBondDomain(model,outbond,outmap_domain,outmap_domain_item) ; + [object,inmap_ok] = mttUpdateBondDomain(object,inmap,inbond_domain,inbond_domain_item) ; + [object,outmap_ok] = mttUpdateBondDomain(object,outmap,outbond_domain,outbond_domain_item) ; + + ok = inbond_ok & outbond_ok & inmap_ok & outmap_ok ; + mttAssert(ok,['Domain conflict at port "',port_name,'" in ',here]) ; + end + + if is_root_model + branch = object_name ; + else + branch = [branch,'/',object_name] ; + end + + object = mttPropagateDomains(object,branch) ; + model = setfield(model,'obj',object_name,object) ; + + elseif ~isempty(object.cr) + + interface = object.cr.interface ; + port_names = mttGetFieldNames(interface,'port') ; + + for j = 1:length(port_names) + port_name = port_names{j} ; + port = getfield(interface,'port',port_name) ; + + inbond = port.in ; + outbond = port.out ; + + [model,inbond_ok] = mttUpdateBondDomain(model,inbond,port.domain,port.domain_item) ; + [model,outbond_ok] = mttUpdateBondDomain(model,outbond,port.domain,port.domain_item) ; + + ok = inbond_ok & outbond_ok ; + mttAssert(ok,['Domain conflict at port "',port_name,'" in ',here]) ; + end + + else + + number_of_interfaces = mttGetFieldLength(object,'interface') ; + + switch object.class + case {'0','1'}, + index = 0 ; + finding_domain = 1 ; + + while finding_domain + index = index + 1 ; + + inbond = object.interface(index).in ; + outbond = object.interface(index).out ; + + if isempty(inbond) + bond_number = outbond ; + else + bond_number = inbond ; + end + + [existing_domain,existing_domain_item] = mttGetBondDomain(model,bond_number) ; + + found_domain = ~isempty(existing_domain) ; + finding_domain = ~found_domain & index0 + RHS.name{j} = [' + ',RHS.name{j}] ; + else + RHS.name{j} = [' - ',RHS.name{j}] ; + end + end + + case 'cell', + [name,covar] = mttCutText(namelist(var{1}).var,'.') ; + RHS.name{1} = name ; + + if strcmp(covar,'effort') | strcmp(covar,'effort_state') + RHS.is_effort = 1 ; + else + RHS.is_effort = 0 ; + end + end + + for k = 1:dimension + if LHS.is_effort + covar = covariables.effort{k} ; + else + covar = covariables.flow{k} ; + end + + content = [LHS.name,'.',strrep(covar,'.','__')] ; + indent = char(32*ones(1,length(content)+3)) ; + + for j = 1:length(RHS.name) + if RHS.is_effort(j) + covar = covariables.effort{k} ; + else + covar = covariables.flow{k} ; + end + + if j==1 + if strcmp(RHS.name{1},'0') + content = [content,' = ',RHS.name{1}] ; + else + content = [content,' = ',RHS.name{1},'.',strrep(covar,'.','__')] ; + end + else + content = [content,'\n',indent,RHS.name{j},'.',strrep(covar,'.','__')] ; + end + end + + content = [content,' ;'] ; + + if ~isempty(content) + eqn_counter = eqn_counter + 1 ; + eqn{eqn_counter} = content ; + end + end + + else + op = [sse(i).operator] ; + [cr,operator] = mttCutText(op,'___') ; + + if ~strcmp(eqn{eqn_counter},'') + eqn_counter = eqn_counter + 1 ; + eqn{eqn_counter} = [''] ; + end + eqn_counter = eqn_counter + 1 ; + eqn{eqn_counter} = ['// ',op] ; + + + [root,hierarchy] = mttCutText(cr,'__') ; + + level = length(findstr(cr,'__')) ; + for j = 1:level + [obj{j},hierarchy] = mttCutText(hierarchy,'__') ; + end + + object = getfield(model,'obj',obj{1}) ; + for j = 2:level + object = getfield(object,'obj',obj{j}) ; + end + + index = strmatch(operator,{object.cr.operator.name},'exact') ; + cr_definition = object.cr ; + operator_definition = cr_definition.operator(index) ; + + + + structlist = [] ; + if ~isempty(operator_definition.struct) + struct_names = mttGetFieldNames(operator_definition,'struct') ; + number_of_structs = length(struct_names) ; + for i = 1:number_of_structs + struct_name = struct_names{i} ; + variables = getfield(operator_definition,'struct',struct_name) ; + if i==1 + structlist = variables ; + else + structlist = [structlist,variables] ; + end + end + end + + + + + reassigned_state_list = [] ; + counter = 0 ; + + + port_names = mttGetFieldNames(cr_definition.interface,'port') ; + for j = 1:length(port_names) + port_name = port_names{j} ; + port = getfield(cr_definition,'interface','port',port_name) ; + + if ~isempty(port.assign) + assignment = port.assign ; + + + if port.was_generic & ~isempty(port.domain) + covar = mttGetCovariables(model.env,port.domain,port.domain_item) ; + if port.is_effort_state + covar = covariables.effort ; + else + covar = covariables.flow ; + end + + for k = 1:length(assignment.state) + counter = counter + 1 ; + reassigned_state_list.name{counter} = assignment.state{k} ; + reassigned_state_list.covar{counter} = covar ; + end + + + block_size = length(covar) ; + for var = 1:block_size + segment = [] ; + + for k = 1:length(assignment.state) + segment{1} = [cr,'___',port_name,'.',strrep(covar{var},'.','__')] ; + segment{2} = [' = '] ; + segment{3} = [cr,'___',assignment.state{k},'___',strrep(covar{var},'.','__'),'.state ;'] ; + + ini_counter = ini_counter + 1 ; + ini{ini_counter} = [segment{1},segment{2},segment{3}] ; + end + end + else + + for k = 1:length(assignment.state) + segment{1} = [cr,'___',port_name,'.',strrep(assignment.covar{k},'.','__')] ; + segment{2} = [' = '] ; + segment{3} = [cr,'___',assignment.state{k},'.state ;'] ; + + ini_counter = ini_counter + 1 ; + ini{ini_counter} = [segment{1},segment{2},segment{3}] ; + end + end + end + end + + + equations = operator_definition.equation ; + for j = 1:length(equations) + equation = equations(j) ; + number_of_chunks = mttGetFieldLength(equation,'chunk') ; + + equation.domain = [] ; + equation.domain_item = [] ; + + for k = 1:number_of_chunks + chunk = equation.chunk{k} ; + + switch class(chunk) + case 'cell' + type = chunk{1} ; + index = chunk{2} ; + + switch type + case 'link' + port_name = operator_definition.link(index).name ; + port = getfield(cr_definition,'interface','port',port_name) ; + + if port.was_generic & ~isempty(port.domain) + if isempty(equation.domain) + equation.domain = port.domain ; + equation.domain_item = port.domain_item ; + else + same_domain = equation.domain==port.domain ; + same_domain_item = strcmp(equation.domain_item,port.domain_item) ; + mttAssert(same_domain&same_domain_item,... + ['Attempt to overwrite implicit variables with conflicting domains in "',... + operator_definition.content{j},'"']) ; + end + end + end + end + end + + + covariables = mttGetCovariables(model.env,equation.domain,equation.domain_item) ; +% if equation.is_effort +% covar = covariables.effort ; +% else +% covar = covariables.flow ; +% end + + block_size = length(covariables.effort) ; + + + for line = 1:block_size + segment = [] ; + content = [] ; + + for k = 1:number_of_chunks + chunk = equation.chunk{k} ; + + switch class(chunk) + case 'cell' + type = chunk{1} ; + index = chunk{2} ; + + switch type + case 'link' + port_variable = [cr,'___',operator_definition.link(index).name] ; + + if strcmp(chunk{3},'generic___effort') + segment{k} = [port_variable,'.',strrep(covariables.effort{line},'.','__')] ; + elseif strcmp(chunk{3},'generic___flow') + segment{k} = [port_variable,'.',strrep(covariables.flow{line},'.','__')] ; + else + segment{k} = [port_variable,'.',strrep(chunk{3},'.','__')] ; + end + +% if length(chunk)>2 +% segment{k} = [port_variable,'.',strrep(chunk{3},'.','__')] ; +% else +% segment{k} = [port_variable,'.',strrep(covar{line},'.','__')] ; +% end + + case 'numpar' + segment{k} = [cr,'___',cr_definition.numpar{index}] ; + + case 'sympar' + parameter = [cr_definition.parameter{index}] ; + if isnumeric(parameter) + segment{k} = num2str(parameter) ; + else + segment{k} = [cr_definition.parameter{index}] ; + end + + case 'var' + segment{k} = [op,'___',operator_definition.var{index}] ; + + case 'struct' + segment{k} = [op,'___',structlist{index}] ; + + case 'input' + segment{k} = [cr,'___',cr_definition.input{index}] ; + + case 'state' + state = cr_definition.state{index} ; + if isempty(reassigned_state_list) + state_reassignment = [] ; + else + state_reassignment = strmatch(state,reassigned_state_list.name,'exact') ; + end + + if isempty(state_reassignment) + segment{k} = [cr,'___',state,'.state'] ; + else + state_covar = reassigned_state_list.covar{line} ; + segment{k} = [cr,'___',state,'___',state_covar{1},'.state'] ; + end + +% segment{k} = [cr,'___',cr_definition.state{index},'.state'] ; + + case 'derivative' + state = cr_definition.state{index} ; + if isempty(reassigned_state_list) + state_reassignment = [] ; + else + state_reassignment = strmatch(state,reassigned_state_list.name,'exact') ; + end + + if isempty(state_reassignment) + segment{k} = [cr,'___',state,'.derivative'] ; + else + state_covar = reassigned_state_list.covar{line} ; + segment{k} = [cr,'___',state,'___',state_covar{1},'.derivative'] ; + end + +% segment{k} = [cr,'___',cr_definition.state{index},'.derivative'] ; + + end + otherwise + chunk = strrep(chunk,':=','=') ; + segment{k} = chunk ; + end + end + + content = [tab,segment{1}] ; + for k = 2:length(segment) + content = [content,segment{k}] ; + end + content = [content,' ;'] ; + + eqn_counter = eqn_counter + 1 ; + eqn{eqn_counter} = content ; + end + end + + eqn_counter = eqn_counter + 1 ; + eqn{eqn_counter} = ['// End of ',op] ; + eqn_counter = eqn_counter + 1 ; + eqn{eqn_counter} = [''] ; + end + end + + eqn = eqn' ; + ini = ini' ; + + +function write_equations(eqn,ini,model) + filename = [model.source,'_include_ode.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + fprintf(fid,'\n\n') ; + + tab = char(32*ones(1,3)) ; + for i = 1:length(ini) + formatted_equation = [tab,ini{i},'\n'] ; + fprintf(fid,formatted_equation) ; + end + fprintf(fid,'\n') ; + for i = 1:length(eqn) + formatted_equation = [tab,eqn{i},'\n'] ; + fprintf(fid,formatted_equation) ; + end + + fclose(fid) ; + ADDED ntt/bin/trans/m/mttWriteSystemInitialisation.m Index: ntt/bin/trans/m/mttWriteSystemInitialisation.m ================================================================== --- ntt/bin/trans/m/mttWriteSystemInitialisation.m +++ ntt/bin/trans/m/mttWriteSystemInitialisation.m @@ -0,0 +1,435 @@ +function mttWriteSystemInitialisation(model) + +assignment.numpar = assign_numerical_parameters(model) ; +assignment.sympar = assign_symbolic_parameters(model) ; +assignment.input = assign_input_variables(model) ; +assignment.invar = assign_input_covariables(model) ; +assignment.state = assign_state_variables(model) ; + +write_set_numpar(assignment,model) ; +write_set_input(assignment,model) ; +write_set_state(assignment,model) ; + + + +function code = assign_symbolic_parameters(model) + mttNotify('...assigning symbolic parameters') ; + mttWriteNewLine ; + + model_name = mttDetachText(model.source,'/') ; + + code = [] ; + line = 0 ; + + number_of_variables = mttGetFieldLength(model,'sympar') ; + + for i = 1:number_of_variables + variable_name = model.sympar{i} ; + default = model.sympar_default{i} ; + + if isempty(default) + line = line + 1 ; + code{line} = [model_name,'___',variable_name,' = 1.0 ;'] ; + else + line = line + 1 ; + code{line} = [model_name,'___',variable_name,' = ',default,' ;'] ; + end + end + + +function code = assign_numerical_parameters(model,root,branch) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...assigning numerical parameters') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + else + current_branch = branch ; + end + + code = [] ; + line = 0 ; + + number_of_variables = mttGetFieldLength(model,'numpar') ; + + for i = 1:number_of_variables + variable_name = model.numpar{i} ; + default = model.numpar_default{i} ; + + line = line + 1 ; + if isempty(default) + code{line} = [current_branch,'___',variable_name,' = 1.0 ;'] ; + else + code{line} = [current_branch,'___',variable_name,' = ',default,' ;'] ; + end + end + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + additional_code = [] ; + if ~isempty(object.abg) + additional_code = assign_numerical_parameters(object,root,next_branch) ; + elseif ~isempty(object.cr) + additional_code = assign_numerical_parameters(object.cr,root,next_branch) ; + end + + if isempty(code) + code = additional_code ; + else + line = length(code) ; + for j = 1:length(additional_code) + if ~ismember(additional_code{j},code) + line = line + 1 ; + code{line} = additional_code{j} ; + end + end + end + end + + +function code = assign_input_variables(model,root,branch) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...assigning input variables') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + else + current_branch = branch ; + end + + code = [] ; + line = 0 ; + + number_of_variables = mttGetFieldLength(model,'input') ; + + for i = 1:number_of_variables + variable_name = model.input{i} ; + default = model.input_default{i} ; + + line = line + 1 ; + if isempty(default) + code{line} = [current_branch,'___',variable_name,' = 0.0 ;'] ; + else + code{line} = [current_branch,'___',variable_name,' = ',default,' ;'] ; + end + end + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + additional_code = [] ; + if ~isempty(object.abg) + additional_code = assign_input_variables(object,root,next_branch) ; + elseif ~isempty(object.cr) + additional_code = assign_input_variables(object.cr,root,next_branch) ; + end + + if isempty(code) + code = additional_code ; + else + line = length(code) ; + for j = 1:length(additional_code) + if ~ismember(additional_code{j},code) + line = line + 1 ; + code{line} = additional_code{j} ; + end + end + end + end + + +function code = assign_input_covariables(model,root,branch,env) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...assigning input covariables') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + env = model.env ; + else + current_branch = branch ; + end + + code = [] ; + line = 0 ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + switch object.class + case {'SS','Se','Sf','De','Df'} + inbond_number = object.interface.in ; + outbond_number = object.interface.out ; + + inbond = model.bond(inbond_number) ; + outbond = model.bond(outbond_number) ; + + if ~isempty(inbond) + covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; + covar = [] ; + + if ~inbond.effort + if ~strcmp(object.class,'Df') + covar = covariables.effort ; + end + elseif inbond.flow + if ~strcmp(object.class,'De') + covar = covariables.flow ; + end + end + + for j = 1:length(covar) + line = line + 1 ; + covariable = strrep(covar{j},'.','__') ; + code{line} = [current_branch,'__',object_name,'.',covariable,' = 0.0 ;'] ; + end + end + + if ~isempty(outbond) + covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; + + if outbond.effort + covar = covariables.effort ; + elseif ~outbond.flow + covar = covariables.flow ; + end + + for j = 1:length(covar) + line = line + 1 ; + covariable = strrep(covar{j},'.','__') ; + code{line} = [current_branch,'__',object_name,'.',covariable,' = 0.0 ;'] ; + end + end + end + + additional_code = [] ; + if ~isempty(object.abg) + additional_code = assign_input_covariables(object,root,next_branch,env) ; + end + + if isempty(code) + code = additional_code ; + else + line = length(code) ; + for j = 1:length(additional_code) + if ~ismember(additional_code{j},code) + line = line + 1 ; + code{line} = additional_code{j} ; + end + end + end + end + + +function code = assign_state_variables(model,root,branch,env) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...assigning state variables') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + env = model.env ; + else + current_branch = branch ; + end + + code = [] ; + line = 0 ; + + if isfield(model,'state') + assigned_states = [] ; + counter = 0 ; + + port_names = mttGetFieldNames(model.interface,'port') ; + for j = 1:length(port_names) + port_name = port_names{j} ; + port = getfield(model,'interface','port',port_name) ; + + if ~isempty(port.assign) + assignment = port.assign ; + + if port.was_generic & ~isempty(port.domain) + covariables = mttGetCovariables(env,port.domain,port.domain_item) ; + if port.is_effort_state + covar = covariables.effort ; + default = covariables.effort_default ; + else + covar = covariables.flow ; + default = covariables.flow_default ; + end + + block_size = length(covar) ; + for k = 1:length(assignment.state) + counter = counter + 1 ; + assigned_states{counter} = assignment.state{k} ; + + for var = 1:block_size + line = line + 1 ; + if isempty(default{var}) + code{line} = [current_branch,'___',assignment.state{k},'___',covar{var},'.state = 0.0 ;'] ; + else + code{line} = [current_branch,'___',assignment.state{k},'___',covar{var},'.state = ',default{var},' ;'] ; + end + end + end + end + end + end + + number_of_variables = mttGetFieldLength(model,'state') ; + + for i = 1:number_of_variables + variable_name = model.state{i} ; + default = model.state_default{i} ; + + if ~ismember(variable_name,assigned_states) + line = line + 1 ; + if isempty(default) + code{line} = [current_branch,'___',variable_name,'.state = 0.0 ;'] ; + else + code{line} = [current_branch,'___',variable_name,'.state = ',default,' ;'] ; + end + end + end + end + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + additional_code = [] ; + if ~isempty(object.abg) + additional_code = assign_state_variables(object,root,next_branch,env) ; + elseif ~isempty(object.cr) + additional_code = assign_state_variables(object.cr,root,next_branch,env) ; + end + + if isempty(code) + code = additional_code ; + else + line = length(code) ; + for j = 1:length(additional_code) + if ~ismember(additional_code{j},code) + line = line + 1 ; + code{line} = additional_code{j} ; + end + end + end + end + + +function write_set_numpar(assignment,model) + filename = [model.source,'_include_set_numpar.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// Numerical Parameters for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_assigned_list(fid,[],assignment.numpar,model_name) ; + + fclose(fid) ; + + +function write_set_input(assignment,model) + filename = [model.source,'_include_set_input.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// Default Inputs for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_assigned_list(fid,'symbolic_parameters',assignment.sympar,model_name) ; + write_assigned_list(fid,'input_variables',assignment.input,model_name) ; + write_assigned_list(fid,'input_covariables',assignment.invar,model_name) ; + + fclose(fid) ; + + +function write_set_state(assignment,model) + filename = [model.source,'_include_set_state.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// Initial states for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_assigned_list(fid,[],assignment.state,model_name) ; + + fclose(fid) ; + + +function write_assigned_list(fid,var_type,var_list,model_name) + if ~isempty(var_list) + if ~isempty(var_type) + fprintf(fid,'\n\n') ; + fprintf(fid,['// ',var_type]) ; + end + fprintf(fid,'\n') ; + + var_list = sort(var_list) ; + + width = 0 ; + for i = 1:length(var_list) + [left,right] = mttCutText(var_list{i},'=') ; + width = max(width,length(left)) ; + end + + tab = char(32*ones(1,3)) ; + for i = 1:length(var_list) + [left,right] = mttCutText(var_list{i},'=') ; + + nominal_width = width ; + actual_width = length(left) ; + + gap = nominal_width - actual_width ; + whitespace = char(32*ones(1,gap)) ; + + formatted_assignment = [tab,left,whitespace,' = ',right,'\n'] ; + fprintf(fid,formatted_assignment) ; + end + end ADDED ntt/bin/trans/m/mttWriteSystemMapping.m Index: ntt/bin/trans/m/mttWriteSystemMapping.m ================================================================== --- ntt/bin/trans/m/mttWriteSystemMapping.m +++ ntt/bin/trans/m/mttWriteSystemMapping.m @@ -0,0 +1,528 @@ +function mttWriteSystemMapping(model) + +sympar = map_system_sympars(model) ; +input = map_system_inputs(model) ; +invar = map_system_invars(model) ; +outvar = map_system_outvars(model) ; +state = map_system_states(model) ; + +derivative = differentiate(state) ; + +mapping.input = invar ; +if ~isempty(input) + mapping.input = [mapping.input,input] ; +end +if ~isempty(sympar) + mapping.input = [mapping.input,sympar] ; +end + +mapping.output = outvar ; +mapping.state = state ; +mapping.derivative = derivative ; + +write_get_input(mapping,model) ; +write_get_state(mapping,model) ; + +write_put_input(mapping,model) ; +write_put_state(mapping,model) ; +write_put_output(mapping,model) ; +write_put_derivative(mapping,model) ; + + + +function map = map_system_sympars(model) + mttNotify('...mapping system inputs (symbolic parameters)') ; + mttWriteNewLine ; + + model_name = mttDetachText(model.source,'/') ; + + map = [] ; + line = 0 ; + + number_of_variables = mttGetFieldLength(model,'sympar') ; + + for i = 1:number_of_variables + variable_name = model.sympar{i} ; + default_value = model.sympar_default{i} ; + + if isempty(default_value) + line = line + 1 ; + map{line} = [model_name,'___',variable_name] ; + end + end + + +function map = map_system_inputs(model,root,branch) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...mapping system inputs (input variables)') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + else + current_branch = branch ; + end + + map = [] ; + line = 0 ; + + number_of_variables = mttGetFieldLength(model,'input') ; + + for i = 1:number_of_variables + variable_name = model.input{i} ; + + line = line + 1 ; + map{line} = [current_branch,'___',variable_name] ; + end + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + additional_map = [] ; + if ~isempty(object.abg) + additional_map = map_system_inputs(object,root,next_branch) ; + elseif ~isempty(object.cr) + additional_map = map_system_inputs(object.cr,root,next_branch) ; + end + + if isempty(map) + map = additional_map ; + else + line = length(map) ; + for j = 1:length(additional_map) + if ~ismember(additional_map{j},map) + line = line + 1 ; + map{line} = additional_map{j} ; + end + end + end + end + + +function map = map_system_invars(model,root,branch,env) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...mapping system inputs (input covariables)') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + env = model.env ; + else + current_branch = branch ; + end + + map = [] ; + line = 0 ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + switch object.class + case {'SS','Se','Sf','De','Df'} + inbond_number = object.interface.in ; + outbond_number = object.interface.out ; + + inbond = model.bond(inbond_number) ; + outbond = model.bond(outbond_number) ; + + if ~isempty(inbond) + covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; + covar = [] ; + + if ~inbond.effort + if ~strcmp(object.class,'Df') + covar = covariables.effort ; + end + elseif inbond.flow + if ~strcmp(object.class,'De') + covar = covariables.flow ; + end + end + + for j = 1:length(covar) + line = line + 1 ; + map{line} = [current_branch,'__',object_name,'.',strrep(covar{j},'.','__')] ; + end + end + + if ~isempty(outbond) + covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; + covar = [] ; + + if outbond.effort + covar = covariables.effort ; + elseif ~outbond.flow + covar = covariables.flow ; + end + + for j = 1:length(covar) + line = line + 1 ; + map{line} = [current_branch,'__',object_name,'.',strrep(covar{j},'.','__')] ; + end + end + end + + additional_map = [] ; + if ~isempty(object.abg) + additional_map = map_system_invars(object,root,next_branch,env) ; + end + + if isempty(map) + map = additional_map ; + else + line = length(map) ; + for j = 1:length(additional_map) + if ~ismember(additional_map{j},map) + line = line + 1 ; + map{line} = additional_map{j} ; + end + end + end + end + + +function map = map_system_outvars(model,root,branch,env) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...mapping system outputs (output covariables)') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + env = model.env ; + else + current_branch = branch ; + end + + map = [] ; + line = 0 ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + switch object.class + case {'SS','Se','Sf','De','Df'} + inbond_number = object.interface.in ; + outbond_number = object.interface.out ; + + inbond = model.bond(inbond_number) ; + outbond = model.bond(outbond_number) ; + + if ~isempty(inbond) + covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; + covar = [] ; + + if inbond.effort + covar = covariables.effort ; + elseif ~inbond.flow + covar = covariables.flow ; + end + + for j = 1:length(covar) + line = line + 1 ; + map{line} = [current_branch,'__',object_name,'.',strrep(covar{j},'.','__')] ; + end + end + + if ~isempty(outbond) + covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; + covar = [] ; + + if ~outbond.effort + if ~strcmp(object.class,'Sf') + covar = covariables.effort ; + end + elseif outbond.flow + if ~strcmp(object.class,'Se') + covar = covariables.flow ; + end + end + + for j = 1:length(covar) + line = line + 1 ; + map{line} = [current_branch,'__',object_name,'.',strrep(covar{j},'.','__')] ; + end + end + end + + additional_map = [] ; + if ~isempty(object.abg) + additional_map = map_system_outvars(object,root,next_branch,env) ; + end + + if isempty(map) + map = additional_map ; + else + line = length(map) ; + for j = 1:length(additional_map) + if ~ismember(additional_map{j},map) + line = line + 1 ; + map{line} = additional_map{j} ; + end + end + end + end + + +function map = map_system_states(model,root,branch,env) + is_root_model = nargin==1 ; + + if is_root_model + mttNotify('...mapping system states') ; + mttWriteNewLine ; + + root = model ; + current_branch = mttDetachText(model.source,'/') ; + env = model.env ; + else + current_branch = branch ; + end + + map = [] ; + line = 0 ; + + if isfield(model,'state') + assigned_states = [] ; + counter = 0 ; + + port_names = mttGetFieldNames(model.interface,'port') ; + for j = 1:length(port_names) + port_name = port_names{j} ; + port = getfield(model,'interface','port',port_name) ; + + if ~isempty(port.assign) + assignment = port.assign ; + + if port.was_generic & ~isempty(port.domain) + covariables = mttGetCovariables(env,port.domain,port.domain_item) ; + if port.is_effort_state + covar = covariables.effort ; + else + covar = covariables.flow ; + end + + block_size = length(covar) ; + for k = 1:length(assignment.state) + counter = counter + 1 ; + assigned_states{counter} = assignment.state{k} ; + + for var = 1:block_size + line = line + 1 ; + map{line} = [current_branch,'___',assignment.state{k},'___',covar{var},'.state'] ; + end + end + end + end + end + + number_of_variables = mttGetFieldLength(model,'state') ; + + for i = 1:number_of_variables + variable_name = model.state{i} ; + + if ~ismember(variable_name,assigned_states) + line = line + 1 ; + map{line} = [current_branch,'___',variable_name,'.state'] ; + end + end + end + + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + next_branch = [current_branch,'__',object_name] ; + + additional_map = [] ; + if ~isempty(object.abg) + additional_map = map_system_states(object,root,next_branch,env) ; + elseif ~isempty(object.cr) + additional_map = map_system_states(object.cr,root,next_branch,env) ; + end + + if isempty(map) + map = additional_map ; + else + line = length(map) ; + for j = 1:length(additional_map) + if ~ismember(additional_map{j},map) + line = line + 1 ; + map{line} = additional_map{j} ; + end + end + end + end + + +function derivative = differentiate(state) + mttNotify('...mapping system derivatives') ; + mttWriteNewLine ; + + for i = 1:length(state) + derivative{i} = strrep(state{i},'.state','.derivative') ; + end + + +function write_get_input(mapping,model) + filename = [model.source,'_include_get_input.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// Input get-mapping for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_mapping(fid,'_mttInput',mapping.input,model_name,1) ; + + fclose(fid) ; + + +function write_put_input(mapping,model) + filename = [model.source,'_include_put_input.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// Input put-mapping for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_mapping(fid,'_mttInput',mapping.input,model_name,0) ; + + fclose(fid) ; + + +function write_get_state(mapping,model) + filename = [model.source,'_include_get_state.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// State get-mapping for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_mapping(fid,'_mttState',mapping.state,model_name,1) ; + + fclose(fid) ; + + +function write_put_state(mapping,model) + filename = [model.source,'_include_put_state.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// State put-mapping for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_mapping(fid,'_mttState',mapping.state,model_name,0) ; + + fclose(fid) ; + + +function write_put_output(mapping,model) + filename = [model.source,'_include_put_output.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// Output put-mapping for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_mapping(fid,'_mttOutput',mapping.output,model_name,0) ; + + fclose(fid) ; + + +function write_put_derivative(mapping,model) + filename = [model.source,'_include_put_derivative.h'] ; + fid = fopen(filename,'w') ; + + mttNotify(['...creating ',filename]) ; + mttWriteNewLine ; + + fprintf(fid,['// Derivative put-mapping for Ordinary Differential Equations\n']) ; + fprintf(fid,'\n') ; + fprintf(fid,['// file: ',filename,'\n']) ; + fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; + + model_name = mttDetachText(model.source,'/') ; + + write_mapping(fid,'_mttDerivative',mapping.derivative,model_name,0) ; + + fclose(fid) ; + + +function write_mapping(fid,array_name,var_list,model_name,is_inward_mapping) + if ~isempty(var_list) + var_list = sort(var_list) ; + + width = 0 ; + for i = 1:length(var_list) + width = max(width,length(var_list{i})) ; + end + + tab = char(32*ones(1,3)) ; + + fprintf(fid,'\n') ; + for i = 1:length(var_list) + variable = var_list{i} ; + + if is_inward_mapping + nominal_width = width ; + actual_width = length(variable) ; + + gap = nominal_width - actual_width ; + whitespace = char(32*ones(1,gap)) ; + + formatted_mapping = [tab,variable,whitespace,' = ',array_name,'[',num2str(i-1),'] ;\n'] ; + else + formatted_mapping = [tab,array_name,'[',num2str(i-1),'] = ',variable,' ;\n'] ; + end + + fprintf(fid,formatted_mapping) ; + end + end ADDED ntt/bin/trans/m/mttWriteSystemSfun.m Index: ntt/bin/trans/m/mttWriteSystemSfun.m ================================================================== --- ntt/bin/trans/m/mttWriteSystemSfun.m +++ ntt/bin/trans/m/mttWriteSystemSfun.m @@ -0,0 +1,250 @@ +function mttWriteSystemSfun(model) + +model_name = mttDetachText(model.source,'/') ; + +working_directory = pwd ; +working_directory = strrep(working_directory,'\','/') ; + +filename = [working_directory,'/',model_name,'_sfun.cpp'] ; +fid = fopen(filename,'w') ; + +mttNotify(['...creating ',filename]) ; +mttWriteNewLine ; + +model_name = mttDetachText(model.source,'/') ; + +fprintf(fid,['// Simulation Code for "',model_name,'"\n']) ; +fprintf(fid,'\n') ; +fprintf(fid,['// file: ',filename ,'\n']) ; +fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; +fprintf(fid,'\n') ; + +write_sfun(fid,model) ; + +fclose(fid) ; + + +function write_sfun(fid,model) + model_name = mttDetachText(model.source,'/') ; + counter = mttCountSystemMapping(model) ; + + fprintf(fid,['#define S_FUNCTION_NAME ',model_name,'_sfun' ,'\n']) ; + fprintf(fid,['#define S_FUNCTION_LEVEL 2' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_def.h"' ,'\n']) ; + + if isfield(model,'app') + if ~isempty(model.app) + fprintf(fid,['#include "',model_name,'_include_apps.h"' ,'\n']) ; + end + end + + fprintf(fid,['#include "simstruc.h"' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static double *_mttInput ;' ,'\n']) ; + fprintf(fid,['static double *_mttState ;' ,'\n']) ; + fprintf(fid,['static double *_mttDerivative ;' ,'\n']) ; + fprintf(fid,['static double *_mttOutput ;' ,'\n']) ; + fprintf(fid,['static double _mttTime ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static unsigned int _mttIndex ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['const int _mttNumInputs = ',num2str(counter.input),' ;' ,'\n']) ; + fprintf(fid,['const int _mttNumOutputs = ',num2str(counter.output),' ;' ,'\n']) ; + fprintf(fid,['const int _mttNumStates = ',num2str(counter.state),' ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + + fprintf(fid,['// system equations' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_set_numpar (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_set_numpar.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_set_input (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_set_input.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_set_state (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_set_state.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_get_input (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_get_input.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_get_state (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_get_state.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_put_state (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_put_state.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_put_derivative (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_put_derivative.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_put_output (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_put_output.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void ',model_name,'_ode (void) {' ,'\n']) ; + fprintf(fid,['#include "',model_name,'_include_ode.h"' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + + fprintf(fid,['// utility procedures' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static double *array_of_double (size_t n)' ,'\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' void *p = calloc (n, sizeof (double)) ;' ,'\n']) ; + fprintf(fid,[' if (! p) fprintf (stderr, "*** ERROR: failed to allocate memory") ;','\n']) ; + fprintf(fid,[' return (double *) p ;' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void initialise_arrays (void)' ,'\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' _mttInput = array_of_double(_mttNumInputs) ;' ,'\n']) ; + fprintf(fid,[' _mttOutput = array_of_double(_mttNumOutputs) ;' ,'\n']) ; + fprintf(fid,[' _mttState = array_of_double(_mttNumStates) ;' ,'\n']) ; + fprintf(fid,[' _mttDerivative = array_of_double(_mttNumStates) ;' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void check_finite(SimStruct *S, double *array, unsigned int index)','\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' const char *array_name ;' ,'\n']) ; + fprintf(fid,[' char warning[128] ;' ,'\n']) ; + fprintf(fid,[' if ((array[index] <= 0.0) || (array[index] >= 0.0)) {' ,'\n']) ; + fprintf(fid,[' ; // ...no problem' ,'\n']) ; + fprintf(fid,[' } else {' ,'\n']) ; + fprintf(fid,[' if (array == _mttInput) {' ,'\n']) ; + fprintf(fid,[' array_name = "_mttInput" ;' ,'\n']) ; + fprintf(fid,[' } else if (array == _mttState) {' ,'\n']) ; + fprintf(fid,[' array_name = "_mttState" ;' ,'\n']) ; + fprintf(fid,[' } else if (array == _mttOutput) {' ,'\n']) ; + fprintf(fid,[' array_name = "_mttOutput" ;' ,'\n']) ; + fprintf(fid,[' } else if (array == _mttDerivative) {' ,'\n']) ; + fprintf(fid,[' array_name = "_mttDerivative" ;' ,'\n']) ; + fprintf(fid,[' } else {' ,'\n']) ; + fprintf(fid,[' array_name = "unknown_array" ;' ,'\n']) ; + fprintf(fid,[' }' ,'\n']) ; + fprintf(fid,[' sprintf(warning,"(time %%f) Non-finite array element: %%s[%%d]",_mttTime,array_name,index) ;','\n']) ; + fprintf(fid,[' ssWarning(S,warning) ;' ,'\n']) ; + fprintf(fid,[' }' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + + fprintf(fid,['// S-function methods' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void mdlInitializeSizes(SimStruct *S)' ,'\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' ssSetNumSFcnParams(S,0) ;' ,'\n']) ; + fprintf(fid,[' if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) return ;','\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' ssSetNumContStates(S,_mttNumStates) ;' ,'\n']) ; + fprintf(fid,[' ssSetNumDiscStates(S,0) ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' if (!ssSetNumInputPorts(S,1)) return ;' ,'\n']) ; + fprintf(fid,[' ssSetInputPortWidth(S,0,_mttNumInputs) ;' ,'\n']) ; + fprintf(fid,[' ssSetInputPortDirectFeedThrough(S,0,1) ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' if (!ssSetNumOutputPorts(S,1)) return ;' ,'\n']) ; + fprintf(fid,[' ssSetOutputPortWidth(S,0,_mttNumOutputs) ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' ssSetNumSampleTimes(S,1) ;' ,'\n']) ; + fprintf(fid,[' ssSetNumRWork(S,0) ;' ,'\n']) ; + fprintf(fid,[' ssSetNumIWork(S,0) ;' ,'\n']) ; + fprintf(fid,[' ssSetNumPWork(S,0) ;' ,'\n']) ; + fprintf(fid,[' ssSetNumModes(S,0) ;' ,'\n']) ; + fprintf(fid,[' ssSetNumNonsampledZCs(S,0) ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' ssSetOptions(S,SS_OPTION_EXCEPTION_FREE_CODE) ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' initialise_arrays() ;' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void mdlInitializeSampleTimes(SimStruct *S)' ,'\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' ssSetSampleTime(S,0,CONTINUOUS_SAMPLE_TIME) ;' ,'\n']) ; + fprintf(fid,[' ssSetOffsetTime(S,0,0.0) ;' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['#define MDL_INITIALIZE_CONDITIONS' ,'\n']) ; + fprintf(fid,['static void mdlInitializeConditions(SimStruct *S)' ,'\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' ',model_name,'_set_numpar() ;' ,'\n']) ; + fprintf(fid,[' ',model_name,'_set_state() ;' ,'\n']) ; + fprintf(fid,[' ',model_name,'_put_state() ;' ,'\n']) ; + fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) ssGetContStates(S)[_mttIndex] = _mttState[_mttIndex] ;','\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void mdlOutputs(SimStruct *S,int_T tid)' ,'\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' UNUSED_ARG(tid) ;' ,'\n']) ; + fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) {' ,'\n']) ; + fprintf(fid,[' _mttState[_mttIndex] = ssGetContStates(S)[_mttIndex] ;' ,'\n']) ; + fprintf(fid,[' check_finite(S,_mttState,_mttIndex) ;' ,'\n']) ; + fprintf(fid,[' }' ,'\n']) ; + fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumInputs; _mttIndex++) {' ,'\n']) ; + fprintf(fid,[' _mttInput[_mttIndex] = *ssGetInputPortRealSignalPtrs(S,0)[_mttIndex] ;','\n']) ; + fprintf(fid,[' check_finite(S,_mttInput,_mttIndex) ;' ,'\n']) ; + fprintf(fid,[' }' ,'\n']) ; + fprintf(fid,[' _mttTime = ssGetT(S) ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' ',model_name,'_get_input() ;' ,'\n']) ; + fprintf(fid,[' ',model_name,'_get_state() ;' ,'\n']) ; + fprintf(fid,[' ',model_name,'_ode() ;' ,'\n']) ; + fprintf(fid,[' ',model_name,'_put_output() ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' for(_mttIndex=0; _mttIndex<_mttNumOutputs; _mttIndex++) {' ,'\n']) ; + fprintf(fid,[' check_finite(S,_mttOutput,_mttIndex) ;' ,'\n']) ; + fprintf(fid,[' ssGetOutputPortRealSignal(S,0)[_mttIndex] = _mttOutput[_mttIndex] ;','\n']) ; + fprintf(fid,[' }' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['#define MDL_DERIVATIVES' ,'\n']) ; + fprintf(fid,['static void mdlDerivatives(SimStruct *S)' ,'\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) {' ,'\n']) ; + fprintf(fid,[' _mttState[_mttIndex] = ssGetContStates(S)[_mttIndex] ;' ,'\n']) ; + fprintf(fid,[' check_finite(S,_mttState,_mttIndex) ;' ,'\n']) ; + fprintf(fid,[' }' ,'\n']) ; + fprintf(fid,[' for (_mttIndex=0; _mttIndex<_mttNumInputs; _mttIndex++) {' ,'\n']) ; + fprintf(fid,[' _mttInput[_mttIndex] = *ssGetInputPortRealSignalPtrs(S,0)[_mttIndex] ;','\n']) ; + fprintf(fid,[' check_finite(S,_mttInput,_mttIndex) ;' ,'\n']) ; + fprintf(fid,[' }' ,'\n']) ; + fprintf(fid,[' _mttTime = ssGetT(S) ;' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,[' ',model_name,'_get_input() ;' ,'\n']) ; + fprintf(fid,[' ',model_name,'_get_state() ;' ,'\n']) ; + fprintf(fid,[' ',model_name,'_ode() ;' ,'\n']) ; + fprintf(fid,[' ',model_name,'_put_derivative() ;' ,'\n']) ; + fprintf(fid,[' ' ,'\n']) ; + fprintf(fid,[' if (_mttTime==0)' ,'\n']) ; + fprintf(fid,[' for(_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) ssGetdX(S)[_mttIndex] = 0.0 ;','\n']) ; + fprintf(fid,[' else' ,'\n']) ; + fprintf(fid,[' for(_mttIndex=0; _mttIndex<_mttNumStates; _mttIndex++) {' ,'\n']) ; + fprintf(fid,[' check_finite(S,_mttDerivative,_mttIndex) ;' ,'\n']) ; + fprintf(fid,[' ssGetdX(S)[_mttIndex] = _mttDerivative[_mttIndex] ;' ,'\n']) ; + fprintf(fid,[' }' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['static void mdlTerminate(SimStruct *S)' ,'\n']) ; + fprintf(fid,['{' ,'\n']) ; + fprintf(fid,[' UNUSED_ARG(S);' ,'\n']) ; + fprintf(fid,[' free (_mttInput) ;' ,'\n']) ; + fprintf(fid,[' free (_mttOutput) ;' ,'\n']) ; + fprintf(fid,[' free (_mttState) ;' ,'\n']) ; + fprintf(fid,[' free (_mttDerivative) ;' ,'\n']) ; + fprintf(fid,['}' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + fprintf(fid,['' ,'\n']) ; + + fprintf(fid,['#ifdef MATLAB_MEX_FILE' ,'\n']) ; + fprintf(fid,['#include "simulink.c"' ,'\n']) ; + fprintf(fid,['#else' ,'\n']) ; + fprintf(fid,['#include "cg_sfun.h"' ,'\n']) ; + fprintf(fid,['#endif' ,'\n']) ; ADDED ntt/bin/trans/mttAppend.m Index: ntt/bin/trans/mttAppend.m ================================================================== --- ntt/bin/trans/mttAppend.m +++ ntt/bin/trans/mttAppend.m @@ -0,0 +1,11 @@ +function information = mttAppend(information,field,items) + if isfield(information,field) + previous = getfield(information,field) ; + if isempty(previous) + information = setfield(information,field,items) ; + else + information = setfield(information,field,[previous,items]) ; + end + else + information = setfield(information,field,items) ; + end ADDED ntt/bin/trans/mttAppendFields.m Index: ntt/bin/trans/mttAppendFields.m ================================================================== --- ntt/bin/trans/mttAppendFields.m +++ ntt/bin/trans/mttAppendFields.m @@ -0,0 +1,11 @@ +function information = mttAppendFields(information,extra) + if isstruct(information) & isstruct(extra) + information_fields = fieldnames(information) ; + extra_fields = fieldnames(extra) ; + + for i = 1:length(extra_fields) + field_name = extra_fields{i} ; + extra_field = getfield(extra,field_name) ; + information = setfield(information,field_name,extra_field) ; + end + end ADDED ntt/bin/trans/mttAssert.m Index: ntt/bin/trans/mttAssert.m ================================================================== --- ntt/bin/trans/mttAssert.m +++ ntt/bin/trans/mttAssert.m @@ -0,0 +1,7 @@ +function mttAssert(rule,msg) + if ~isempty(rule) + if ~rule + error(['MTT: ',msg]) ; + end + end + ADDED ntt/bin/trans/mttAssign.m Index: ntt/bin/trans/mttAssign.m ================================================================== --- ntt/bin/trans/mttAssign.m +++ ntt/bin/trans/mttAssign.m @@ -0,0 +1,7 @@ +function [register,ok] = mttAssign(register,new_value) + if isempty(register) + register = new_value ; + ok = 1 ; + else + ok = register==new_value ; + end ADDED ntt/bin/trans/mttCheckBondgraphDeclarations.m Index: ntt/bin/trans/mttCheckBondgraphDeclarations.m ================================================================== --- ntt/bin/trans/mttCheckBondgraphDeclarations.m +++ ntt/bin/trans/mttCheckBondgraphDeclarations.m @@ -0,0 +1,97 @@ +function mttCheckBondgraphDeclarations(model) + + for i = 1:length(model.sympar) + mttAssert(~ismember(model.sympar{i},model.numpar),... + ['Same name (',model.sympar{i},') used for "numpar" and "abg[...]" parameters']) ; + mttAssert(~ismember(model.sympar{i},model.input),... + ['Same name (',model.sympar{i},') used for "input" and "abg[...]" parameters']) ; + end + + for i = 1:length(model.numpar) + mttAssert(~ismember(model.numpar{i},model.input),... + ['Same name (',model.numpar{i},') used for "numpar" and "input" parameters']) ; + mttAssert(~ismember(model.numpar{i},model.sympar),... + ['Same name (',model.numpar{i},') used for "numpar" and "abg[...]" parameters']) ; + end + + for i = 1:length(model.input) + mttAssert(~ismember(model.input{i},model.sympar),... + ['Same name (',model.input{i},') used for "input" and "abg[...]" parameters']) ; + mttAssert(~ismember(model.input{i},model.numpar),... + ['Same name (',model.input{i},') used for "numpar" and "input" parameters']) ; + end + + all_parameters = [] ; + + if ~isempty(model.sympar) + all_parameters = model.sympar ; + end + if ~isempty(model.numpar) + if isempty(all_parameters) + all_parameters = model.numpar ; + else + all_parameters = [all_parameters, model.numpar] ; + end + end + if ~isempty(model.input) + if isempty(all_parameters) + all_parameters = model.input ; + else + all_parameters = [all_parameters, model.input] ; + end + end + + object_names = mttGetFieldNames(model,'obj') ; + + if ~isempty(all_parameters) + for i = 1:length(object_names) + object_name = object_names{i} ; + object = getfield(model,'obj',object_name) ; + + for j = 1:length(object.parameter) + object_parameter = object.parameter{j} ; + if ~isnumeric(object_parameter) + mttAssert(ismember(object_parameter,all_parameters),... + ['Object parameter "',object.parameter{j},'" not previously declared']) ; + end + end + end + + for j = 1:length(all_parameters) + current_parameter = all_parameters{j} ; + other_parameters = all_parameters ; + other_parameters(j) = [] ; + + mttAssert(~ismember(current_parameter,other_parameters),... + ['Repeated parameter/input name "',current_parameter,'"']) ; + end + end + + + counter = 0 ; + all_instance_parameters = [] ; + + for i = 1:length(object_names) + object_name = object_names{i} ; + object = getfield(model,'obj',object_name) ; + + for j = 1:length(object.parameter) + object_parameter = object.parameter{j} ; + if ~isnumeric(object_parameter) + counter = counter + 1 ; + all_instance_parameters{counter} = object_parameter ; + end + end + end + + for k = 1:length(all_parameters) + parameter = all_parameters{k} ; + if isempty(all_instance_parameters) + mttAssert(0,['Declared parameter/input "',parameter,'" not used']) ; + else + mttAssert(ismember(parameter,all_instance_parameters),... + ['Declared parameter/input "',parameter,'" not used']) ; + end + end + + ADDED ntt/bin/trans/mttCheckInterfaceDeclarations.m Index: ntt/bin/trans/mttCheckInterfaceDeclarations.m ================================================================== --- ntt/bin/trans/mttCheckInterfaceDeclarations.m +++ ntt/bin/trans/mttCheckInterfaceDeclarations.m @@ -0,0 +1,69 @@ +function mttCheckInterfaceDeclarations(model) + + for i = 1:length(model.sympar) + mttAssert(~ismember(model.sympar{i},model.numpar),... + ['Same name (',model.sympar{i},') used for "numpar" and "abg[...]" parameters']) ; + mttAssert(~ismember(model.sympar{i},model.input),... + ['Same name (',model.sympar{i},') used for "input" and "abg[...]" parameters']) ; + end + + for i = 1:length(model.numpar) + mttAssert(~ismember(model.numpar{i},model.input),... + ['Same name (',model.numpar{i},') used for "numpar" and "input" parameters']) ; + mttAssert(~ismember(model.numpar{i},model.sympar),... + ['Same name (',model.numpar{i},') used for "numpar" and "abg[...]" parameters']) ; + end + + for i = 1:length(model.input) + mttAssert(~ismember(model.input{i},model.sympar),... + ['Same name (',model.input{i},') used for "input" and "abg[...]" parameters']) ; + mttAssert(~ismember(model.input{i},model.numpar),... + ['Same name (',model.input{i},') used for "numpar" and "input" parameters']) ; + end + + all_parameters = [] ; + + if ~isempty(model.sympar) + all_parameters = model.sympar ; + end + if ~isempty(model.numpar) + if isempty(all_parameters) + all_parameters = model.numpar ; + else + all_parameters = [all_parameters, model.numpar] ; + end + end + if ~isempty(model.input) + if isempty(all_parameters) + all_parameters = model.input ; + else + all_parameters = [all_parameters, model.input] ; + end + end + + object_names = mttGetFieldNames(model,'obj') ; + + if ~isempty(all_parameters) + for i = 1:length(object_names) + object_name = object_names{i} ; + object = getfield(model,'obj',object_name) ; + + for j = 1:length(object.parameter) + object_parameter = object.parameter{j} ; + if ~isnumeric(object_parameter) + mttAssert(ismember(object_parameter,all_parameters),... + ['Object parameter "',object.parameter{j},'" not previously declared']) ; + end + end + end + + for j = 1:length(all_parameters) + current_parameter = all_parameters{j} ; + other_parameters = all_parameters ; + other_parameters(j) = [] ; + + mttAssert(~ismember(current_parameter,other_parameters),... + ['Repeated parameter/input name "',current_parameter,'"']) ; + end + end + ADDED ntt/bin/trans/mttCheckStateDeclarations.m Index: ntt/bin/trans/mttCheckStateDeclarations.m ================================================================== --- ntt/bin/trans/mttCheckStateDeclarations.m +++ ntt/bin/trans/mttCheckStateDeclarations.m @@ -0,0 +1,57 @@ +function mttCheckStateDeclarations(model) + for i = 1:length(model.sympar) + mttAssert(~ismember(model.sympar{i},model.state),... + ['Same name (',model.sympar{i},') used for "state" and "abg[...]" parameters']) ; + end + + for i = 1:length(model.numpar) + mttAssert(~ismember(model.numpar{i},model.state),... + ['Same name (',model.numpar{i},') used for "numpar" and "state" parameters']) ; + end + + for i = 1:length(model.input) + mttAssert(~ismember(model.input{i},model.state),... + ['Same name (',model.input{i},') used for "input" and "state" parameters']) ; + end + + for i = 1:length(model.state) + mttAssert(~ismember(model.state{i},model.sympar),... + ['Same name (',model.state{i},') used for "state" and "abg[...]" parameters']) ; + mttAssert(~ismember(model.state{i},model.numpar),... + ['Same name (',model.state{i},') used for "state" and "numpar" parameters']) ; + mttAssert(~ismember(model.state{i},model.input),... + ['Same name (',model.state{i},') used for "state" and "input" parameters']) ; + end + + all_parameters = [] ; + + if ~isempty(model.sympar) + all_parameters = model.sympar ; + end + if ~isempty(model.numpar) + if isempty(all_parameters) + all_parameters = model.numpar ; + else + all_parameters = [all_parameters, model.numpar] ; + end + end + if ~isempty(model.input) + if isempty(all_parameters) + all_parameters = model.input ; + else + all_parameters = [all_parameters, model.input] ; + end + end + + for j = 1:length(all_parameters) + current_parameter = all_parameters{j} ; + mttAssert(~ismember(current_parameter,model.state),... + ['Repeated parameter/state name "',current_parameter,'"']) ; + end + + for j = 1:length(model.state) + current_state = model.state{j} ; + mttAssert(~ismember(current_state,all_parameters),... + ['Repeated parameter/state name "',current_state,'"']) ; + end + ADDED ntt/bin/trans/mttClipText.m Index: ntt/bin/trans/mttClipText.m ================================================================== --- ntt/bin/trans/mttClipText.m +++ ntt/bin/trans/mttClipText.m @@ -0,0 +1,8 @@ +function clipped_text = mttClipText(text) + if isempty(text) + clipped_text = [] ; + else + index = 1:length(text) ; + useful = index(~isspace(text)) ; + clipped_text = text(min(useful):max(useful)) ; + end ADDED ntt/bin/trans/mttCompare.m Index: ntt/bin/trans/mttCompare.m ================================================================== --- ntt/bin/trans/mttCompare.m +++ ntt/bin/trans/mttCompare.m @@ -0,0 +1,7 @@ +function comparison = mttCompare(left,right) + if isempty(left) | isempty(right) + comparison = [] ; + else + comparison = (left==right) ; + end + ADDED ntt/bin/trans/mttCompareCausalCompletion.m Index: ntt/bin/trans/mttCompareCausalCompletion.m ================================================================== --- ntt/bin/trans/mttCompareCausalCompletion.m +++ ntt/bin/trans/mttCompareCausalCompletion.m @@ -0,0 +1,6 @@ +function is_stable = mttCompareCausalCompletion(current,previous) + is_stable_flow = current.flows==previous.flows ; + is_stable_effort = current.efforts==previous.efforts ; + is_stable = is_stable_flow & is_stable_effort ; + + ADDED ntt/bin/trans/mttCompareDomainCompletion.m Index: ntt/bin/trans/mttCompareDomainCompletion.m ================================================================== --- ntt/bin/trans/mttCompareDomainCompletion.m +++ ntt/bin/trans/mttCompareDomainCompletion.m @@ -0,0 +1,3 @@ +function is_stable = mttCompareDomainCompletion(current,previous) + is_stable = current.assignments==previous.assignments ; + ADDED ntt/bin/trans/mttCompressText.m Index: ntt/bin/trans/mttCompressText.m ================================================================== --- ntt/bin/trans/mttCompressText.m +++ ntt/bin/trans/mttCompressText.m @@ -0,0 +1,6 @@ +function compressed_text = mttCompressText(text) + if isempty(text) + compressed_text = [] ; + else + compressed_text = text(~isspace(text)) ; + end ADDED ntt/bin/trans/mttCountObjects.m Index: ntt/bin/trans/mttCountObjects.m ================================================================== --- ntt/bin/trans/mttCountObjects.m +++ ntt/bin/trans/mttCountObjects.m @@ -0,0 +1,23 @@ +function model = mttCountObjects(model) + + object_names = mttGetFieldNames(model,'obj') ; + number_of_objects = length(object_names) ; + + model.count.obj = number_of_objects ; + model.count.cr = 0 ; + + for i = 1:number_of_objects + object_name = object_names{i} ; + object = getfield(model,'obj',object_name) ; + + if ~isempty(object.cr) + model.count.cr = model.count.cr + 1 ; + end + + if isfield(object,'obj') + next = mttCountObjects(object) ; + model.count.obj = model.count.obj + next.count.obj ; + model.count.cr = model.count.cr + next.count.cr ; + end + end + ADDED ntt/bin/trans/mttCountSystemMapping.m Index: ntt/bin/trans/mttCountSystemMapping.m ================================================================== --- ntt/bin/trans/mttCountSystemMapping.m +++ ntt/bin/trans/mttCountSystemMapping.m @@ -0,0 +1,195 @@ +function counter = mttCountSystemMapping(model) + +sympars = count_system_sympars(model) ; +inputs = count_system_inputs(model) ; +invars = count_system_invars(model) ; +outvars = count_system_outvars(model) ; +states = count_system_states(model) ; + +counter.input = sympars + inputs + invars ; +counter.output = outvars ; +counter.state = states ; + + +function counter = count_system_sympars(model) + number_of_variables = mttGetFieldLength(model,'sympar') ; + counter = 0 ; + + for i = 1:number_of_variables + default_value = model.sympar_default{i} ; + if isempty(default_value) + counter = counter + 1 ; + end + end + + +function counter = count_system_inputs(model) + number_of_variables = mttGetFieldLength(model,'input') ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + additional_variables = 0 ; + if ~isempty(object.abg) + additional_variables = count_system_inputs(object) ; + elseif ~isempty(object.cr) + additional_variables = count_system_inputs(object.cr) ; + end + + number_of_variables = number_of_variables + additional_variables ; + end + + counter = number_of_variables ; + + +function counter = count_system_invars(model,root,env) + is_root_model = nargin==1 ; + + if is_root_model + root = model ; + env = model.env ; + end + + number_of_variables = 0 ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + switch object.class + case {'SS','Se','Sf','De','Df'} + inbond_number = object.interface.in ; + outbond_number = object.interface.out ; + + inbond = model.bond(inbond_number) ; + outbond = model.bond(outbond_number) ; + + if ~isempty(inbond) + covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; + covar = [] ; + + if ~inbond.effort + if ~strcmp(object.class,'Df') + covar = covariables.effort ; + end + elseif inbond.flow + if ~strcmp(object.class,'De') + covar = covariables.flow ; + end + end + + number_of_variables = number_of_variables + length(covar) ; + end + + if ~isempty(outbond) + covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; + covar = [] ; + + if outbond.effort + covar = covariables.effort ; + elseif ~outbond.flow + covar = covariables.flow ; + end + + number_of_variables = number_of_variables + length(covar) ; + end + end + + additional_variables = 0 ; + if ~isempty(object.abg) + additional_variables = count_system_invars(object,root,env) ; + end + + number_of_variables = number_of_variables + additional_variables ; + end + + counter = number_of_variables ; + + +function counter = count_system_outvars(model,root,env) + is_root_model = nargin==1 ; + + if is_root_model + root = model ; + env = model.env ; + end + + number_of_variables = 0 ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + switch object.class + case {'SS','Se','Sf','De','Df'} + inbond_number = object.interface.in ; + outbond_number = object.interface.out ; + + inbond = model.bond(inbond_number) ; + outbond = model.bond(outbond_number) ; + + if ~isempty(inbond) + covariables = mttGetCovariables(env,inbond.domain,inbond.domain_item) ; + covar = [] ; + + if inbond.effort + covar = covariables.effort ; + elseif ~inbond.flow + covar = covariables.flow ; + end + + number_of_variables = number_of_variables + length(covar) ; + end + + if ~isempty(outbond) + covariables = mttGetCovariables(env,outbond.domain,outbond.domain_item) ; + covar = [] ; + + if ~outbond.effort + if ~strcmp(object.class,'Sf') + covar = covariables.effort ; + end + elseif outbond.flow + if ~strcmp(object.class,'Se') + covar = covariables.flow ; + end + end + + number_of_variables = number_of_variables + length(covar) ; + end + end + + additional_variables = 0 ; + if ~isempty(object.abg) + additional_variables = count_system_outvars(object,root,env) ; + end + + number_of_variables = number_of_variables + additional_variables ; + end + + counter = number_of_variables ; + + +function counter = count_system_states(model) + number_of_variables = mttGetFieldLength(model,'state') ; + + objects = mttGetFieldNames(model,'obj') ; + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + additional_variables = 0 ; + if ~isempty(object.abg) + additional_variables = count_system_states(object) ; + elseif ~isempty(object.cr) + additional_variables = count_system_states(object.cr) ; + end + + number_of_variables = number_of_variables + additional_variables ; + end + + counter = number_of_variables ; ADDED ntt/bin/trans/mttCreateAlternativeEquations.m Index: ntt/bin/trans/mttCreateAlternativeEquations.m ================================================================== --- ntt/bin/trans/mttCreateAlternativeEquations.m +++ ntt/bin/trans/mttCreateAlternativeEquations.m @@ -0,0 +1,563 @@ +function ese = mttCreateAlternativeEquations(model) + +ese = write_equations(model) ; +ese = ese' ; + +filename = [model.source,'_ese.txt'] ; +fid = fopen(filename,'w') ; + +fprintf(fid,['// Elementary System Equations\n']) ; +fprintf(fid,'\n') ; +fprintf(fid,['// file: ',filename,'\n']) ; +fprintf(fid,['// written by MTT on ',datestr(now),'\n']) ; +fprintf(fid,'\n\n') ; + +fprintf(fid,['ese ',mttDetachText(model.source,'/'),' {']) ; +fprintf(fid,'\n') ; + +tab = char(32*ones(1,3)) ; + +for i = 1:length(ese) + fprintf(fid,[tab,ese{i},'\n']) ; +end + +fprintf(fid,'}') ; + +fclose(fid) ; + + + +function ese = write_equations(model,branch) + is_root_model = (nargin==1) ; + + if is_root_model + branch = mttDetachText(model.source,'/') ; + end + +% ese{1} = ' ' ; +% ese{2} = ['// ESE representation for module: ',branch] ; +% ese{3} = ' ' ; +% +% line = 3 ; + + line = 0 ; + + indent = char(32*ones(1,6)) ; + + + objects = mttGetFieldNames(model,'obj') ; + + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + here = [branch,':',object_name] ; + + switch object.class + case 'SS', + + for j = 1:mttGetFieldLength(object,'interface') + flow_equation = [] ; + effort_equation = [] ; + + port_name = object.interface(j).name ; + + inbond = object.interface(j).in ; + outbond = object.interface(j).out ; + + if ~isempty(inbond) + bond = model.bond(inbond) ; + + extern = [branch,'__',object_name,'___flow'] ; + intern = [branch,'___f[',num2str(inbond),']'] ; + if bond.flow + flow_equation = [intern,' = ',extern,' ;'] ; + else + flow_equation = [extern,' = ',intern,' ;'] ; + end + + extern = [branch,'__',object_name,'___effort'] ; + intern = [branch,'___e[',num2str(inbond),']'] ; + if bond.effort + effort_equation = [extern,' = ',intern,' ;'] ; + else + effort_equation = [intern,' = ',extern,' ;'] ; + end + + line = line + 1 ; + ese{line} = flow_equation ; + + line = line + 1 ; + ese{line} = effort_equation ; + end + + if ~isempty(outbond) + bond = model.bond(outbond) ; + + extern = [branch,'__',object_name,'___flow'] ; + intern = [branch,'___f[',num2str(outbond),']'] ; + if bond.flow + flow_equation = [extern,' = ',intern,' ;'] ; + else + flow_equation = [intern,' = ',extern,' ;'] ; + end + + extern = [branch,'__',object_name,'___effort'] ; + intern = [branch,'___e[',num2str(outbond),']'] ; + if bond.effort + effort_equation = [intern,' = ',extern,' ;'] ; + else + effort_equation = [extern,' = ',intern,' ;'] ; + end + + line = line + 1 ; + ese{line} = flow_equation ; + + line = line + 1 ; + ese{line} = effort_equation ; + end + end + + case '0', + + imposed_effort = [] ; + resultant_flow = [] ; + + for i = 1:mttGetFieldLength(object,'interface') + inbond = object.interface(i).in ; + outbond = object.interface(i).out ; + + if isempty(inbond) + bond_number(i) = outbond ; + orientation(i) = 0 ; + else + bond_number(i) = inbond ; + orientation(i) = 1 ; + end + + [effort(i),flow(i)] = mttGetBondCausality(model,bond_number(i)) ; + + if effort(i)==orientation(i) + imposed_effort_bond = bond_number(i) ; + imposed_effort = [branch,'___e[',num2str(imposed_effort_bond),']'] ; + end + if flow(i)==orientation(i) + resultant_flow_bond = bond_number(i) ; + resultant_flow = [branch,'___f[',num2str(resultant_flow_bond),']'] ; + end + end + + + for i = 1:mttGetFieldLength(object,'interface') + if bond_number(i)~=imposed_effort_bond + line = line + 1 ; + derived_effort = [branch,'___e[',num2str(bond_number(i)),']'] ; + ese{line} = [derived_effort,' = ',imposed_effort,' ;'] ; + end + end + + waiting = 1 ; + offset = char(32*ones(1,length(resultant_flow)+1)) ; + + for i = 1:mttGetFieldLength(object,'interface') + next_flow = [] ; + + if bond_number(i)~=resultant_flow_bond + next_flow = [branch,'___f[',num2str(bond_number(i)),']'] ; + line = line + 1 ; + + if waiting + if orientation(i) + ese{line} = [resultant_flow,' = ',next_flow] ; + else + ese{line} = [resultant_flow,' = -',next_flow] ; + end + waiting = 0 ; + else + if orientation(i) + ese{line} = [offset,'+ ',next_flow] ; + else + ese{line} = [offset,'- ',next_flow] ; + end + end + end + end + ese{line} = [ese{line},' ;'] ; + + case '1', + + imposed_flow = [] ; + resultant_effort = [] ; + + for i = 1:mttGetFieldLength(object,'interface') + inbond = object.interface(i).in ; + outbond = object.interface(i).out ; + + if isempty(inbond) + bond_number(i) = outbond ; + orientation(i) = 0 ; + else + bond_number(i) = inbond ; + orientation(i) = 1 ; + end + + [effort(i),flow(i)] = mttGetBondCausality(model,bond_number(i)) ; + + if flow(i)~=orientation(i) + imposed_flow_bond = bond_number(i) ; + imposed_flow = [branch,'___f[',num2str(imposed_flow_bond),']'] ; + end + if effort(i)~=orientation(i) + resultant_effort_bond = bond_number(i) ; + resultant_effort = [branch,'___e[',num2str(resultant_effort_bond),']'] ; + end + end + + + for i = 1:mttGetFieldLength(object,'interface') + if bond_number(i)~=imposed_flow_bond + line = line + 1 ; + derived_flow = [branch,'___f[',num2str(bond_number(i)),']'] ; + ese{line} = [derived_flow,' = ',imposed_flow,' ;'] ; + end + end + + waiting = 1 ; + offset = char(32*ones(1,length(resultant_effort)+1)) ; + + for i = 1:mttGetFieldLength(object,'interface') + next_effort = [] ; + + if bond_number(i)~=resultant_effort_bond + next_effort = [branch,'___e[',num2str(bond_number(i)),']'] ; + line = line + 1 ; + + if waiting + if orientation(i) + ese{line} = [resultant_effort,' = ',next_effort] ; + else + ese{line} = [resultant_effort,' = -',next_effort] ; + end + waiting = 0 ; + else + if orientation(i) + ese{line} = [offset,'+ ',next_effort] ; + else + ese{line} = [offset,'- ',next_effort] ; + end + end + end + end + ese{line} = [ese{line},' ;'] ; + + otherwise, + + if ~isempty(object.cr) + operators = object.cr.operator ; + interface = object.cr.interface ; + port_names = mttGetFieldNames(interface,'port') ; + + link_counter = 0 ; + + for i = 1:length(port_names) + port_name = port_names{i} ; + port = getfield(interface,'port',port_name) ; + terminal = [branch,'__',object_name,'___',port_name] ; + + inbond = port.in ; + outbond = port.out ; + + if ~isempty(inbond) + bond = model.bond(inbond) ; + + intern = [branch,'___f[',num2str(inbond),']'] ; + if bond.flow + link_counter = link_counter + 1 ; + link(link_counter) = create_link(0,0,1,port_name,port.is_flow_state) ; + + if port.is_flow_state + flow_equation = [intern,' = ',terminal,'___flow_state ;'] ; + else + flow_equation = [intern,' = ',terminal,'___flow ;'] ; + end + else + link_counter = link_counter + 1 ; + link(link_counter) = create_link(1,0,1,port_name,port.is_flow_state) ; + + if port.is_flow_state + flow_equation = [terminal,'___flow_state = ',intern,' ;'] ; + else + flow_equation = [terminal,'___flow = ',intern,' ;'] ; + end + end + + intern = [branch,'___e[',num2str(inbond),']'] ; + if bond.effort + link_counter = link_counter + 1 ; + link(link_counter) = create_link(1,1,0,port_name,port.is_effort_state) ; + + if port.is_effort_state + effort_equation = [terminal,'___effort_state = ',intern,' ;'] ; + else + effort_equation = [terminal,'___effort = ',intern,' ;'] ; + end + else + link_counter = link_counter + 1 ; + link(link_counter) = create_link(0,1,0,port_name,port.is_effort_state) ; + + if port.is_effort_state + effort_equation = [intern,' = ',terminal,'___effort_state ;'] ; + else + effort_equation = [intern,' = ',terminal,'___effort ;'] ; + end + end + + line = line + 1 ; + ese{line} = flow_equation ; + + line = line + 1 ; + ese{line} = effort_equation ; + end + + if ~isempty(outbond) + bond = model.bond(outbond) ; + + intern = [branch,'___f[',num2str(outbond),']'] ; + if bond.flow + link_counter = link_counter + 1 ; + link(link_counter) = create_link(1,0,1,port_name,port.is_flow_state) ; + + if port.is_flow_state + flow_equation = [terminal,'___flow_state = ',intern,' ;'] ; + else + flow_equation = [terminal,'___flow = ',intern,' ;'] ; + end + else + link_counter = link_counter + 1 ; + link(link_counter) = create_link(0,0,1,port_name,port.is_flow_state) ; + + if port.is_flow_state + flow_equation = [intern,' = ',terminal,'___flow_state ;'] ; + else + flow_equation = [intern,' = ',terminal,'___flow ;'] ; + end + end + + intern = [branch,'___e[',num2str(outbond),']'] ; + if bond.effort + link_counter = link_counter + 1 ; + link(link_counter) = create_link(0,1,0,port_name,port.is_effort_state) ; + + if port.is_effort_state + effort_equation = [intern,' = ',terminal,'___effort_state ;'] ; + else + effort_equation = [intern,' = ',terminal,'___effort ;'] ; + end + else + link_counter = link_counter + 1 ; + link(link_counter) = create_link(1,1,0,port_name,port.is_effort_state) ; + + if port.is_effort_state + effort_equation = [terminal,'___effort_state = ',intern,' ;'] ; + else + effort_equation = [terminal,'___effort = ',intern,' ;'] ; + end + end + + line = line + 1 ; + ese{line} = flow_equation ; + + line = line + 1 ; + ese{line} = effort_equation ; + end + end + + number_of_operators = length(operators) ; + op_counter = 1 ; + + matching = 1 ; + while matching + operator = operators(op_counter) ; + + links = length(link) ; + op_links = length(operator.link) ; + op_linked = zeros(op_links,1) ; + + for j = 1:op_links + for k = 1:links + if compare_links(link(k),operator.link(j)) + op_linked(j) = k ; + break ; + end + end + end + + input_counter = 0 ; + output_counter = 0 ; + input = [] ; + output = [] ; + + if all(op_linked) + for j = 1:op_links + current_link = link(op_linked(j)) ; + port_name = current_link.name ; + + if current_link.is_effort + if current_link.is_state + link_name = [branch,'__',object_name,'___',port_name,'___effort_state'] ; + else + link_name = [branch,'__',object_name,'___',port_name,'___effort'] ; + end + end + if current_link.is_flow + if current_link.is_state + link_name = [branch,'__',object_name,'___',port_name,'___flow_state'] ; + else + link_name = [branch,'__',object_name,'___',port_name,'___flow'] ; + end + end + if current_link.is_input + input_counter = input_counter + 1 ; + input{input_counter} = link_name ; + else + output_counter = output_counter + 1 ; + output{output_counter} = link_name ; + end + end + + if input_counter>0 + input_list = ['[',input{1}] ; + for j = 2:input_counter + input_list = [input_list,',',input{j}] ; + end + input_list = [input_list,']'] ; + end + + if output_counter>0 + output_list = ['[',output{1}] ; + for j = 2:output_counter + output_list = [output_list,',',output{j}] ; + end + output_list = [output_list,']'] ; + end + + if input_counter>0 + line = line + 1 ; + ese{line} = [output_list,' = '] ; + end + + line = line + 1 ; + ese{line} = [indent,branch,'__',object_name,'___',operator.name] ; + + if output_counter>0 + line = line + 1 ; + ese{line} = [indent,indent,input_list,' ;'] ; + end + + link(op_linked) = [] ; + end + + op_counter = op_counter + 1 ; + matching = ~isempty(link) & (op_counter<=number_of_operators) ; + end + + mttAssert(isempty(link),... + ['Unattached ports in "cr" implementation in ',here]) ; + end + end + end + + for i = 1:length(objects) + object_name = objects{i} ; + object = getfield(model,'obj',object_name) ; + + here = [branch,':',object_name] ; + + if ~isempty(object.abg) + for j = 1:mttGetFieldLength(object,'interface') + inbond = object.interface(j).in ; + outbond = object.interface(j).out ; + inmap = object.interface(j).map.in ; + outmap = object.interface(j).map.out ; + + line = line + 1 ; + ese{line} = ' ' ; + + if ~isempty(inbond) + bond = model.bond(inbond) ; + + extern = [branch,'__',object_name,'___f[',num2str(inmap),']'] ; + intern = [branch,'___f[',num2str(inbond),']'] ; + if bond.flow + flow_equation = [intern,' = ',extern,' ;'] ; + else + flow_equation = [extern,' = ',intern,' ;'] ; + end + + extern = [branch,'__',object_name,'___e[',num2str(inmap),']'] ; + intern = [branch,'___e[',num2str(inbond),']'] ; + if bond.effort + effort_equation = [extern,' = ',intern,' ;'] ; + else + effort_equation = [intern,' = ',extern,' ;'] ; + end + + line = line + 1 ; + ese{line} = flow_equation ; + + line = line + 1 ; + ese{line} = effort_equation ; + end + + if ~isempty(outbond) + bond = model.bond(outbond) ; + + extern = [branch,'__',object_name,'___f[',num2str(outmap),']'] ; + intern = [branch,'___f[',num2str(outbond),']'] ; + if bond.flow + flow_equation = [extern,' = ',intern,' ;'] ; + else + flow_equation = [intern,' = ',extern,' ;'] ; + end + + extern = [branch,'__',object_name,'___e[',num2str(outmap),']'] ; + intern = [branch,'___e[',num2str(outbond),']'] ; + if bond.effort + effort_equation = [intern,' = ',extern,' ;'] ; + else + effort_equation = [extern,' = ',intern,' ;'] ; + end + + line = line + 1 ; + ese{line} = flow_equation ; + + line = line + 1 ; + ese{line} = effort_equation ; + end + end + next_branch = [branch,'__',object_name] ; + + object_ese = write_equations(object,next_branch) ; + + ese = [ese, object_ese] ; + line = length(ese) ; + end + end + + +function link = create_link(is_input,is_effort,is_flow,name,is_state) + link.is_input = is_input ; + link.is_effort = is_effort ; + link.is_flow = is_flow ; + link.name = name ; + link.is_state = is_state ; + +function boolean = compare_links(actual_link,op_link) + input_is_same = actual_link.is_input==op_link.is_input ; + effort_is_same = actual_link.is_effort==op_link.is_effort ; + flow_is_same = actual_link.is_flow==op_link.is_flow ; + name_is_same = strcmp(actual_link.name,op_link.name) ; + + boolean = input_is_same & effort_is_same & flow_is_same & name_is_same ; + + ADDED ntt/bin/trans/mttCutText.m Index: ntt/bin/trans/mttCutText.m ================================================================== --- ntt/bin/trans/mttCutText.m +++ ntt/bin/trans/mttCutText.m @@ -0,0 +1,14 @@ +function [left,right] = mttCutText(text,delimiter) + if isempty(text) + left = [] ; + right = [] ; + else + where = min(findstr(text,delimiter)) ; + if isempty(where) + left = mttClipText(text) ; + right = [] ; + else + left = mttClipText(text(1:where-1)) ; + right = mttClipText(text(where+length(delimiter):length(text))) ; + end + end ADDED ntt/bin/trans/mttDeleteField.m Index: ntt/bin/trans/mttDeleteField.m ================================================================== --- ntt/bin/trans/mttDeleteField.m +++ ntt/bin/trans/mttDeleteField.m @@ -0,0 +1,6 @@ +function model = mttDeleteField(structure,field_name) + if isfield(structure,field_name) + model = rmfield(structure,field_name) ; + else + model = structure ; + end ADDED ntt/bin/trans/mttDetachText.m Index: ntt/bin/trans/mttDetachText.m ================================================================== --- ntt/bin/trans/mttDetachText.m +++ ntt/bin/trans/mttDetachText.m @@ -0,0 +1,14 @@ +function [detached_text,preceding_text] = mttDetachText(text,delimiter) + if isempty(text) + detached_text = [] ; + preceding_text = [] ; + else + where = max(findstr(text,delimiter)) ; + if isempty(where) + detached_text = [] ; + preceding_text = mttClipText(text) ; + else + detached_text = mttClipText(text(where+length(delimiter):length(text))) ; + preceding_text = mttClipText(text(1:where-1)) ; + end + end ADDED ntt/bin/trans/mttElapseTime.m Index: ntt/bin/trans/mttElapseTime.m ================================================================== --- ntt/bin/trans/mttElapseTime.m +++ ntt/bin/trans/mttElapseTime.m @@ -0,0 +1,4 @@ +function elapsed_time = mttElapseTime(t0) + current_time = mttGetTime ; + elapsed_time.cpu = current_time.cpu - t0.cpu ; + elapsed_time.clock = etime(current_time.clock,t0.clock) ; ADDED ntt/bin/trans/mttExtractStatements.m Index: ntt/bin/trans/mttExtractStatements.m ================================================================== --- ntt/bin/trans/mttExtractStatements.m +++ ntt/bin/trans/mttExtractStatements.m @@ -0,0 +1,55 @@ +function statements = mttExtractStatements(content) + input = 1 ; + output = 0 ; + line = [] ; + + searching = 0 ; + processing = 1 ; + while processing + line = [line,content{input}] ; + line = mttCutText(line,'//') ; + + if ~isempty(line) + semicolon = findstr(line,';') ; + leftbrace = findstr(line,'{') ; + rightbrace = findstr(line,'}') ; + terminator = sort([semicolon,leftbrace,rightbrace]) ; + + if isempty(terminator) + searching = 1 ; + else + first = 1 ; + N = length(terminator) ; + L = length(line) ; + + for i = 1:N + last = terminator(i) - 1 ; + if first<=last + output = output + 1 ; + statements{output} = mttClipText(line(first:last)) ; + end + + if ismember(line(terminator(i)),{'{','}'}) + output = output + 1 ; + statements{output} = line(terminator(i)) ; + end + first = last + 2 ; + end + + if terminator(N)==L + line = [] ; + searching = 0 ; + else + line = mttClipText(line(terminator(N):L)) ; + end + end + end + input = input + 1 ; + processing = input<=length(content) ; + + if searching + mttAssert(input<=length(content),... + 'End of file found with an incomplete statement') ; + end + end + ADDED ntt/bin/trans/mttExtractText.m Index: ntt/bin/trans/mttExtractText.m ================================================================== --- ntt/bin/trans/mttExtractText.m +++ ntt/bin/trans/mttExtractText.m @@ -0,0 +1,13 @@ +function extracted_text = mttExtractText(text,left,right) + if isempty(text) + extracted_text = [] ; + else + where_left = min(findstr(text,left)) ; + where_right = min(findstr(text,right)) ; + + if ~isempty(where_left) & ~isempty(where_right) + extracted_text = mttClipText(text(where_left+length(left):where_right-1)) ; + else + extracted_text = [] ; + end + end ADDED ntt/bin/trans/mttFileExists.m Index: ntt/bin/trans/mttFileExists.m ================================================================== --- ntt/bin/trans/mttFileExists.m +++ ntt/bin/trans/mttFileExists.m @@ -0,0 +1,4 @@ +function boolean = mttFileExists(filename) + + boolean = exist(filename)==2 ; + ADDED ntt/bin/trans/mttFindEquationVariables.m Index: ntt/bin/trans/mttFindEquationVariables.m ================================================================== --- ntt/bin/trans/mttFindEquationVariables.m +++ ntt/bin/trans/mttFindEquationVariables.m @@ -0,0 +1,67 @@ +function [varlist,location] = mttFindEquationVariables(line) + line = mttClipText(line) ; + + if isempty(line) + namelist = [] ; + location = [] ; + else + numbers = (line>=48 & line<=57) ; + letters = (line>=65 & line<=90)|(line>=97 & line<=122) ; + underscores = (line==95) ; + dots = (line==46) ; + apostrophes = (line==39) ; + + mask = (numbers|letters|underscores|dots|apostrophes) ; + + buffer = line ; + buffer(~mask) = char(32*ones(1,sum(~mask))) ; + + next = 1 ; + last = length(buffer) ; + + counter = 0 ; + + finding = any(mask) ; + while finding + i = min(find(~isspace(buffer(next:last))))+next-1 ; + + if isempty(i) + finding = 0 ; + else + if i>last + finding = 0 ; + else + if i==last + j = last ; + else + j = min(find(isspace(buffer(i+1:last))))+i ; + + if isempty(j) + j = last ; + else + j = j - 1 ; + end + end + + if ~mttIsNumericText(buffer(i:j)) + var_found = 1 ; + + if j %i bonds are unicausal\n'],... + model.causal_completion.unicausal) ; + end ADDED ntt/bin/trans/mttNotifyDomainCompletion.m Index: ntt/bin/trans/mttNotifyDomainCompletion.m ================================================================== --- ntt/bin/trans/mttNotifyDomainCompletion.m +++ ntt/bin/trans/mttNotifyDomainCompletion.m @@ -0,0 +1,6 @@ +function mttNotifyDomainCompletion(model) + + domain = floor(100*model.domain_completion.assignments/model.domain_completion.bonds) ; + + fprintf([' ...domain allocation is %i%% complete [%i/%i]\n'],... + domain,model.domain_completion.assignments,model.domain_completion.bonds) ; ADDED ntt/bin/trans/mttNotifyEquationSort.m Index: ntt/bin/trans/mttNotifyEquationSort.m ================================================================== --- ntt/bin/trans/mttNotifyEquationSort.m +++ ntt/bin/trans/mttNotifyEquationSort.m @@ -0,0 +1,23 @@ +function is_complete = mttNotifyEquationSort(sort_iteration,... + number_of_unsorted_equations,number_of_equations,... + number_of_known_covariables,number_of_covariables,... + number_of_known_interface_variables,number_of_interface_variables) ; + +% number_of_known_covariables = number_of_known_covariables - 1 ; + number_of_known_interface_variables = number_of_known_interface_variables - 1 ; + + number_of_sorted_equations = number_of_equations - number_of_unsorted_equations ; + + sorted = floor(100*number_of_sorted_equations/number_of_equations) ; + covar = floor(100*number_of_known_covariables/number_of_covariables) ; + interface_var = floor(100*number_of_known_interface_variables/number_of_interface_variables) ; + + fprintf([' ...%i%% complete [%i/%i]\n'],... + sorted,number_of_sorted_equations,number_of_equations) ; + fprintf([' matching %i%% co_variables [%i/%i] and'],... + covar,number_of_known_covariables,number_of_covariables) ; + fprintf([' %i%% interface_variables [%i/%i]\n'],... + interface_var,number_of_known_interface_variables,number_of_interface_variables) ; + + is_complete = (sorted==100) & (covar==100) & (interface_var==100) ; + ADDED ntt/bin/trans/mttNotifyEquationSortProblems.m Index: ntt/bin/trans/mttNotifyEquationSortProblems.m ================================================================== --- ntt/bin/trans/mttNotifyEquationSortProblems.m +++ ntt/bin/trans/mttNotifyEquationSortProblems.m @@ -0,0 +1,7 @@ +function mttNotifyEquationSortProblems(name_known,namelist) + fprintf(' ...undetermined interface_variables are:\n') ; + for i = 2:length(namelist) + if ~name_known(i) + fprintf([' ',namelist{i},'\n']) ; + end + end ADDED ntt/bin/trans/mttNotifyEquationSummary.m Index: ntt/bin/trans/mttNotifyEquationSummary.m ================================================================== --- ntt/bin/trans/mttNotifyEquationSummary.m +++ ntt/bin/trans/mttNotifyEquationSummary.m @@ -0,0 +1,7 @@ +function mttNotifyEquationSummary(number_of_equations,number_of_covariables,number_of_interface_variables) + mttNotify([' ...model has ',num2str(number_of_equations),' equations']) ; + mttWriteNewLine ; + mttNotify([' with ',num2str(number_of_covariables),' co_variables']) ; + mttNotify([' and ',num2str(number_of_interface_variables),' interface_variables']) ; + mttWriteNewLine ; + ADDED ntt/bin/trans/mttNotifyNumberOfBonds.m Index: ntt/bin/trans/mttNotifyNumberOfBonds.m ================================================================== --- ntt/bin/trans/mttNotifyNumberOfBonds.m +++ ntt/bin/trans/mttNotifyNumberOfBonds.m @@ -0,0 +1,4 @@ +function mttNotifyOfBonds(model) + + number_of_bonds = model.causal_completion.bonds ; + fprintf(' ...model has %i bonds',number_of_bonds) ; ADDED ntt/bin/trans/mttNotifyNumberOfObjects.m Index: ntt/bin/trans/mttNotifyNumberOfObjects.m ================================================================== --- ntt/bin/trans/mttNotifyNumberOfObjects.m +++ ntt/bin/trans/mttNotifyNumberOfObjects.m @@ -0,0 +1,5 @@ +function mttNotifyOfObjects(model) + + number_of_objects = model.count.obj ; + number_of_crs = model.count.cr ; + fprintf(' ...model has %i active objects (%i implemented by CRs)',number_of_objects,number_of_crs) ; ADDED ntt/bin/trans/mttReadFile.m Index: ntt/bin/trans/mttReadFile.m ================================================================== --- ntt/bin/trans/mttReadFile.m +++ ntt/bin/trans/mttReadFile.m @@ -0,0 +1,23 @@ +function content = mttReadFile(filename) + +file_exists = exist(filename)==2 ; +if file_exists + fid = fopen(filename,'r') ; + reading = 1 ; + + counter = 0 ; + while reading + line = fgetl(fid) ; + if ~isempty(line) + if line==-1 + reading = 0 ; + else + counter = counter + 1 ; + content{counter} = line ; + end + end + end + fclose(fid) ; +else + error(['file_not_found[',filename,']']) +end ADDED ntt/bin/trans/mttSeparateText.m Index: ntt/bin/trans/mttSeparateText.m ================================================================== --- ntt/bin/trans/mttSeparateText.m +++ ntt/bin/trans/mttSeparateText.m @@ -0,0 +1,14 @@ +function [left,right] = mttSeparateText(text) + if isempty(text) + left = [] ; + right = [] ; + else + whitespace = min(find(isspace(text))) ; + if isempty(whitespace) + left = text ; + right = [] ; + else + left = text(1:whitespace-1) ; + right = mttClipText(text(whitespace+1:length(text))) ; + end + end ADDED ntt/bin/trans/mttSetFieldDefault.m Index: ntt/bin/trans/mttSetFieldDefault.m ================================================================== --- ntt/bin/trans/mttSetFieldDefault.m +++ ntt/bin/trans/mttSetFieldDefault.m @@ -0,0 +1,11 @@ +function structure = mttSetFieldDefault(structure,component,value) + undefined = 0 ; + if isfield(structure,component) + undefined = isempty(getfield(structure,component)) ; + else + undefined = 1 ; + end + + if undefined + structure = setfield(structure,component,value) ; + end ADDED ntt/bin/trans/mttUpdateBondCausality.m Index: ntt/bin/trans/mttUpdateBondCausality.m ================================================================== --- ntt/bin/trans/mttUpdateBondCausality.m +++ ntt/bin/trans/mttUpdateBondCausality.m @@ -0,0 +1,63 @@ +%function [model,bond_not_failed,diagnostic] = mttUpdateBondCausality(... +% model,bond_number,effort_causality,flow_causality,uni_causality) +function [model,bond_not_failed] = mttUpdateBondCausality(... + model,bond_number,effort_causality,flow_causality,uni_causality) + + if isempty(bond_number) + bond_not_failed = 1 ; +% diagnostic = [] ; + else + [model.bond(bond_number).effort,effort_ok] = ... + update_causality(model.bond(bond_number).effort,effort_causality) ; + [model.bond(bond_number).flow,flow_ok] = ... + update_causality(model.bond(bond_number).flow,flow_causality) ; + [model.bond(bond_number).unicausal,unicausal_ok] = ... + update_causality(model.bond(bond_number).unicausal,uni_causality) ; + + [model.bond(bond_number),unicausal_checked] = ... + check_unicausal(model.bond(bond_number)) ; + + bond_not_failed = effort_ok & flow_ok & unicausal_ok & unicausal_checked ; +% diagnostic = [effort_ok,flow_ok,unicausal_ok,unicausal_checked] ; + end + + +function [value,ok] = update_causality(value,new_value) + ok = 1 ; + + if ~isempty(new_value) + if isempty(value) + value = new_value ; + else + ok = value==new_value ; + end + end + +function [bond,ok] = check_unicausal(bond) + unicausal_defined = ~isempty(bond.unicausal) ; + effort_defined = ~isempty(bond.effort) ; + flow_defined = ~isempty(bond.flow) ; + + ok = 1 ; + + if unicausal_defined + switch bond.unicausal + case 0, + if effort_defined & flow_defined + ok = bond.effort==~bond.flow ; + elseif effort_defined & ~flow_defined + bond.flow = ~bond.effort ; + elseif flow_defined & ~effort_defined + bond.effort = ~bond.flow ; + end + case 1, + if effort_defined & flow_defined + ok = bond.effort==bond.flow ; + elseif effort_defined & ~flow_defined + bond.flow = bond.effort ; + elseif flow_defined & ~effort_defined + bond.effort = bond.flow ; + end + end + end + ADDED ntt/bin/trans/mttUpdateBondDomain.m Index: ntt/bin/trans/mttUpdateBondDomain.m ================================================================== --- ntt/bin/trans/mttUpdateBondDomain.m +++ ntt/bin/trans/mttUpdateBondDomain.m @@ -0,0 +1,41 @@ +function [model,bond_not_failed] = mttUpdateBondDomain(... + model,bond_number,imposed_domain,imposed_domain_item) + + if isempty(bond_number) + bond_not_failed = 1 ; + else + [model.bond(bond_number).domain,domain_ok] = ... + update_domain(model.bond(bond_number).domain,imposed_domain) ; + if domain_ok + [model.bond(bond_number).domain_item,domain_item_ok] = ... + update_domain_item(model.bond(bond_number).domain_item,imposed_domain_item) ; + else + domain_item_ok = 0 ; + end + + bond_not_failed = domain_ok & domain_item_ok ; + end + + +function [value,ok] = update_domain(value,new_value) + ok = 1 ; + + if ~isempty(new_value) + if isempty(value) + value = new_value ; + else + ok = value==new_value ; + end + end + +function [value,ok] = update_domain_item(value,new_value) + ok = 1 ; + + if ~isempty(new_value) + if isempty(value) + value = new_value ; + else + ok = strcmp(value,new_value) ; + end + end + ADDED ntt/bin/trans/mttValidateName.m Index: ntt/bin/trans/mttValidateName.m ================================================================== --- ntt/bin/trans/mttValidateName.m +++ ntt/bin/trans/mttValidateName.m @@ -0,0 +1,18 @@ +function mttValidateName(name) + mttAssert(~isempty(name),'Empty name') ; + + numbers = (name>=48 & name<=57) ; + letters = (name>=65 & name<=90)|(name>=97 & name<=122) ; + underscores = (name==95) ; + + is_alphanumeric = all(numbers|letters|underscores) ; + starts_with_letter = isletter(name(1)) ; + + valid_name = is_alphanumeric & starts_with_letter ; +% mtt_prefix = strncmp(name,'mtt_',4) ; + mtt_delimiter = ~isempty(findstr(name,'__')) ; + +% mttAssert(~mtt_prefix,['"',name,'" must not contain "mtt_" prefix']) ; + mttAssert(~mtt_delimiter,['"',name,'" must not contain contiguous "_" delimiters']) ; + mttAssert(valid_name,['"',name,'" is not a valid name']) ; + mttAssert(length(name)<32,['"',name,'" must be shortened to less than 32 characters']) ; ADDED ntt/bin/trans/mttVerifyAlternativeEquations.m Index: ntt/bin/trans/mttVerifyAlternativeEquations.m ================================================================== --- ntt/bin/trans/mttVerifyAlternativeEquations.m +++ ntt/bin/trans/mttVerifyAlternativeEquations.m @@ -0,0 +1,41 @@ +function delta = mttVerifyEquations(primary,secondary) + searching = 1 ; + + length_primary = length(primary) ; + length_secondary = length(secondary) ; + + i = 1 ; + j = 1 ; + k = 1 ; + fprintf('k=%i: i=%i j=%i L=%i\n',k,i,j,length_secondary) ; + + while searching + k = k + 1 ; + if strcmp(primary(i),secondary(j)) + secondary(j) = [] ; + length_secondary = length_secondary - 1 ; + fprintf('k=%i: i=%i j=%i L=%i\n',k,i,j,length_secondary) ; + + i = i + 1; + j = 1 ; + else + j = j + 1 ; + end + + if length_secondary<1 + searching = 0 ; + elseif j>length_secondary + i = i + 1 ; + j = 1 ; + end + + if i>length_primary + searching = 0 ; + end + end + + delta = secondary ; + + fprintf('Verification complete after %i iterations\n',k) ; + fprintf('...%i new records found\n',length(delta)) ; + ADDED ntt/bin/trans/mttWriteNewLine.m Index: ntt/bin/trans/mttWriteNewLine.m ================================================================== --- ntt/bin/trans/mttWriteNewLine.m +++ ntt/bin/trans/mttWriteNewLine.m @@ -0,0 +1,3 @@ +function mttWriteNewLine + fprintf('\n') ; + ADDED patches/p2c/p2c-1.21alpha2/lex.c.diff Index: patches/p2c/p2c-1.21alpha2/lex.c.diff ================================================================== --- patches/p2c/p2c-1.21alpha2/lex.c.diff +++ patches/p2c/p2c-1.21alpha2/lex.c.diff @@ -0,0 +1,63 @@ +*** p2c-1.22/src/lex.c Tue Mar 16 09:28:20 1999 +--- p2c-1.22-dev/src/lex.c Tue Jan 30 16:57:23 2001 +*************** Static int skipflag; +*** 38,44 **** + Static char modulenotation; + Static short inputkind; + Static Strlist *instrlist; +! Static char inbuf[300]; + Static char *oldinfname, *oldctxname; + Static Strlist *endnotelist; + +--- 38,44 ---- + Static char modulenotation; + Static short inputkind; + Static Strlist *instrlist; +! Static char *inbuf; + Static char *oldinfname, *oldctxname; + Static Strlist *endnotelist; + +*************** void init_lex() +*** 411,416 **** +--- 411,417 ---- + inputkind = INP_FILE; + inf_lnum = 0; + inf_ltotal = 0; ++ inbuf = ALLOC(buffersize, char, strings); /* strings ? */ + *inbuf = 0; + inbufptr = inbuf; + keepingstrlist = NULL; +*************** void getline() +*** 1055,1061 **** + case INP_INCFILE: + inf_lnum++; + inf_ltotal++; +! if (fgets(inbuf, 300, inf)) { + cp = inbuf + strlen(inbuf); + if (*inbuf && cp[-1] == '\n') + cp[-1] = 0; +--- 1056,1062 ---- + case INP_INCFILE: + inf_lnum++; + inf_ltotal++; +! if (fgets(inbuf, buffersize, inf)) { + cp = inbuf + strlen(inbuf); + if (*inbuf && cp[-1] == '\n') + cp[-1] = 0; +*************** int p2c_only, starparen; +*** 1889,1895 **** + } + if (!isalpha(*cp)) + return 0; +! while ((isalnum(*cp) || *cp == '_') && cp2 < namebuf+300) + *cp2++ = toupper(*cp++); + if (cp[0] == '+' && cp[1] == '+' && + cp == inbufptr+1 && toupper(cp[-1]) == 'C') +--- 1890,1896 ---- + } + if (!isalpha(*cp)) + return 0; +! while ((isalnum(*cp) || *cp == '_') && cp2 < namebuf+buffersize) + *cp2++ = toupper(*cp++); + if (cp[0] == '+' && cp[1] == '+' && + cp == inbufptr+1 && toupper(cp[-1]) == 'C') ADDED patches/p2c/p2c-1.21alpha2/loc.p2crc Index: patches/p2c/p2c-1.21alpha2/loc.p2crc ================================================================== --- patches/p2c/p2c-1.21alpha2/loc.p2crc +++ patches/p2c/p2c-1.21alpha2/loc.p2crc @@ -0,0 +1,12 @@ + +# Store public p2crc commands local to your system here, so that +# you can grab a new version of sys.p2crc without losing your changes. + +BufferSize=1000000. + +LineWidth=1000000. +MaxLineWidth=1000000. + +OverWidePenalty=0. +OverWideExtraPenalty=0. + ADDED patches/p2c/p2c-1.21alpha2/parse.c.diff Index: patches/p2c/p2c-1.21alpha2/parse.c.diff ================================================================== --- patches/p2c/p2c-1.21alpha2/parse.c.diff +++ patches/p2c/p2c-1.21alpha2/parse.c.diff @@ -0,0 +1,19 @@ +*** p2c-1.22/src/parse.c Tue Mar 16 09:28:20 1999 +--- p2c-1.22-dev/src/parse.c Tue Jan 30 16:30:40 2001 +*************** int p_search(fname, ext, need) +*** 5477,5483 **** + char *fname, *ext; + int need; + { +! char infnbuf[300]; + FILE *fp; + Meaning *mod; + int savesysprog, savecopysource; +--- 5477,5483 ---- + char *fname, *ext; + int need; + { +! char infnbuf[buffersize]; + FILE *fp; + Meaning *mod; + int savesysprog, savecopysource; ADDED patches/p2c/p2c-1.21alpha2/sys.p2crc.diff Index: patches/p2c/p2c-1.21alpha2/sys.p2crc.diff ================================================================== --- patches/p2c/p2c-1.21alpha2/sys.p2crc.diff +++ patches/p2c/p2c-1.21alpha2/sys.p2crc.diff @@ -0,0 +1,13 @@ +*** p2c-1.22/src/sys.p2crc Tue Mar 16 09:28:20 1999 +--- p2c-1.22-dev/src/sys.p2crc Tue Jan 30 17:01:14 2001 +*************** MinSpacingThresh # If spe +*** 455,460 **** +--- 455,462 ---- + + # LINE BREAKING + ++ BufferSize # Maximum input line length; default=300. ++ + LineWidth # Target max output line width; default=78. + + MaxLineWidth # Absolute max output line width; default=90. ADDED patches/p2c/p2c-1.21alpha2/trans.h.diff Index: patches/p2c/p2c-1.21alpha2/trans.h.diff ================================================================== --- patches/p2c/p2c-1.21alpha2/trans.h.diff +++ patches/p2c/p2c-1.21alpha2/trans.h.diff @@ -0,0 +1,22 @@ +*** p2c-1.22/src/trans.h Tue Mar 16 09:28:21 1999 +--- p2c-1.22-dev/src/trans.h Tue Jan 30 17:25:33 2001 +*************** extern int sizeof_char, sizeof_short, si +*** 1133,1138 **** +--- 1133,1139 ---- + extern short size_t_long; + extern int setbits, defaultsetsize, seek_base, integerwidth, realwidth; + extern short quoteincludes, expandincludes, collectnest; ++ extern const int buffersize; + extern int phystabsize, intabsize, linewidth, maxlinewidth; + extern int majorspace, minorspace, declspace, functionspace, minfuncspace; + extern int casespacing, caselimit; +*************** struct rcstruct { +*** 1351,1356 **** +--- 1352,1358 ---- + 'I', 'R', "MINSPACINGTHRESH",(anyptr) &minspacingthresh, -1, + + /* LINE BREAKING */ ++ 'I', 'R', "BUFFERSIZE", (anyptr) &buffersize, 300, + 'I', 'R', "LINEWIDTH", (anyptr) &linewidth, 78, + 'I', 'R', "MAXLINEWIDTH", (anyptr) &maxlinewidth, 90, + 'R', 'V', "OVERWIDEPENALTY", (anyptr) &overwidepenalty, 2500,